:root {
  --bg: #fafaf8;
  --fg: #1d1d1b;
  --muted: #66665f;
  --line: #e2e1dc;
  --card: #ffffff;
  --accent: #0f6a8b;
  --banner-bg: #fff3c4;
  --banner-fg: #5a4500;
  --quote-bg: #f2f1ec;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --fg: #e8e7e2;
    --muted: #a3a29b;
    --line: #34332f;
    --card: #1f1f1d;
    --accent: #6cc3e0;
    --banner-bg: #4a3a00;
    --banner-fg: #ffe9a6;
    --quote-bg: #262624;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.archive-banner {
  background: var(--banner-bg);
  color: var(--banner-fg);
  text-align: center;
  padding: .55rem 1rem;
  font-weight: 600;
}
.site-header {
  max-width: 960px;
  margin: 0 auto;
  padding: .9rem 16px;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.site-title { font-weight: 700; font-size: 1.2rem; color: var(--fg); text-decoration: none; }
.site-header nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-header nav a { text-decoration: none; }
main { max-width: 960px; margin: 0 auto; padding: 1rem 16px 3rem; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .6rem 0 .4rem; overflow-wrap: anywhere; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
.crumbs { font-size: .9rem; color: var(--muted); }
.topic-meta, .cat-desc { color: var(--muted); margin-top: 0; }
.site-footer {
  max-width: 960px; margin: 0 auto; padding: 1.5rem 16px 3rem;
  color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line);
}

/* lists */
.topic-list, .cat-list, .subcats { list-style: none; padding: 0; margin: 0; }
.topic-list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line);
}
.tl-main { flex: 1 1 22rem; min-width: 0; overflow-wrap: anywhere; }
.tl-title { font-weight: 600; text-decoration: none; margin-right: .5rem; }
.tl-meta { display: flex; gap: .9rem; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.cat-badge {
  display: inline-block; font-size: .78rem; color: var(--muted); text-decoration: none;
  border-left: 4px solid var(--cat, #999); padding-left: .35rem;
}
.cat-list > li {
  border-left: 5px solid var(--cat, #999); background: var(--card);
  padding: .7rem .9rem; margin: .6rem 0; border-radius: 4px;
}
.cat-list p { margin: .3rem 0 0; color: var(--muted); font-size: .92rem; }
.cat-name { font-weight: 700; text-decoration: none; }
.count { color: var(--muted); font-size: .85rem; }
.subcats { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .4rem; font-size: .92rem; }

/* intro / search */
.intro { margin-bottom: 1rem; }
.search-form { display: flex; gap: .5rem; max-width: 32rem; }
.search-form input {
  flex: 1; min-width: 0; padding: .5rem .7rem; font: inherit; color: var(--fg);
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
}
.search-form button {
  padding: .5rem 1rem; font: inherit; border: 0; border-radius: 4px;
  background: var(--accent); color: var(--bg); cursor: pointer;
}

/* posts */
.post {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: .8rem 1rem; margin: .9rem 0; scroll-margin-top: 1rem;
}
.post:target, .post.highlight { outline: 2px solid var(--accent); }
.post-head { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .6rem; margin-bottom: .4rem; }
.username { font-weight: 700; }
.reply-to { font-size: .85rem; }
.post-date { margin-left: auto; color: var(--muted); font-size: .85rem; text-decoration: none; }
.avatar { border-radius: 50%; flex: none; vertical-align: middle; object-fit: cover; }
.avatar.letter {
  display: inline-flex; align-items: center; justify-content: center;
  background: hsl(var(--hue, 200) 45% 45%); color: #fff; font-weight: 700; font-size: .95rem;
}
.cooked { overflow-wrap: anywhere; }
.cooked img { max-width: 100%; height: auto; }
.cooked img.emoji { width: 1.25em; height: 1.25em; vertical-align: text-bottom; }
.cooked pre { overflow-x: auto; background: var(--quote-bg); padding: .7rem; border-radius: 4px; }
.cooked code { font-size: .9em; }
.cooked table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.cooked th, .cooked td { border: 1px solid var(--line); padding: .3rem .5rem; }
.cooked blockquote, .cooked aside.quote, .cooked aside.onebox {
  margin: .8rem 0; padding: .6rem .9rem; background: var(--quote-bg);
  border-left: 4px solid var(--line); border-radius: 0 4px 4px 0;
}
.cooked aside.quote .title { font-size: .9rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.cooked aside.quote blockquote { margin: .3rem 0 0; padding: 0; border: 0; }
.cooked aside.onebox header { font-size: .85rem; color: var(--muted); }
.cooked aside.onebox img.site-icon { width: 16px; height: 16px; }
.cooked aside.onebox .thumbnail, .cooked aside.onebox img.thumbnail { max-width: 160px; float: right; margin-left: .7rem; }
.cooked aside.onebox::after { content: ""; display: block; clear: both; }
.cooked .lightbox-wrapper .meta { display: none; }
.cooked .video-link .video-provider { color: var(--muted); font-size: .85rem; }
.cooked .mention { font-weight: 600; }
.cooked details { background: var(--quote-bg); padding: .4rem .8rem; border-radius: 4px; }
.cooked .poll { border: 1px solid var(--line); border-radius: 4px; padding: .5rem .9rem; margin: .8rem 0; }
.cooked .poll ul { list-style: none; padding: 0; }
.cooked .poll li {
  padding: .3rem .5rem; margin: .25rem 0; border-radius: 3px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent) var(--pct, 0%), transparent var(--pct, 0%));
}
.cooked .poll-votes { float: right; color: var(--muted); font-size: .85rem; margin-left: .6rem; }
.cooked .poll-note { color: var(--muted); font-size: .85rem; margin: .3rem 0 0; }
@media (max-width: 560px) {
  h1 { font-size: 1.35rem; }
  .post { padding: .7rem .75rem; }
  .post-date { margin-left: 0; width: 100%; }
}
