:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --bg-alt: #f1efe9;
  --fg: #1f1f1d;
  --fg-muted: #6b6a64;
  --border: #dedbd2;
  --accent: #7a3e9d;
  --accent-fg: #ffffff;
  --link: #5a2d7a;
  --code-bg: #f3f1ea;
  --quote-bar: #c9b8d6;
  --max: 64rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --bg-alt: #202024;
    --fg: #e6e4de;
    --fg-muted: #9b9a93;
    --border: #34343a;
    --accent: #b083cf;
    --accent-fg: #17171a;
    --link: #c9a5e3;
    --code-bg: #232328;
    --quote-bar: #5a4670;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.site-header { background: var(--accent); color: var(--accent-fg); padding: 1.25rem 0; }
.site-header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; }
.search { display: flex; gap: 0.4rem; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 0.4rem 0.6rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--fg); }
.search button { font: inherit; padding: 0.4rem 0.8rem; border: 1px solid transparent; border-radius: 4px; background: var(--accent); color: var(--accent-fg); cursor: pointer; }
.search-header input { width: 12rem; }
.search-header button { background: var(--bg); color: var(--fg); }
.search-results { padding-left: 1.5rem; }
.search-results li { margin: 0.5rem 0; }
.search-results a { font-weight: 600; }
.site-title { color: inherit; text-decoration: none; font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
.site-tagline { margin: 0.15rem 0 0; opacity: 0.9; }
.archive-notice { margin: 1rem 0; padding: 0.6rem 0.9rem; border: 1px solid var(--border); border-left: 4px solid var(--accent); background: var(--bg-alt); border-radius: 4px; font-size: 0.9rem; color: var(--fg-muted); }

.crumbs ol { list-style: none; margin: 0.5rem 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; font-size: 0.9rem; }
.crumbs li + li::before { content: "›"; margin: 0 0.35rem; color: var(--fg-muted); }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 0.5rem; }
.topic-info, .forum-desc { color: var(--fg-muted); margin: 0 0 1rem; font-size: 0.95rem; }
.forum-rules { margin: 0 0 1rem; padding: 0.6rem 0.9rem; background: var(--bg-alt); border-radius: 4px; font-size: 0.95rem; }

.table-wrap { overflow-x: auto; margin: 0.5rem 0 1rem; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; border-top: 1px solid var(--border); }
thead th { border-top: 0; border-bottom: 2px solid var(--border); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-muted); }
td.num, th.num { text-align: right; white-space: nowrap; width: 5rem; }
td.last-post { font-size: 0.875rem; color: var(--fg-muted); }
td.last-post time { white-space: nowrap; }
.forum-title, .topic-title { font-weight: 600; }
.forum-main .forum-desc, .topic-meta { margin: 0.1rem 0 0; font-size: 0.85rem; color: var(--fg-muted); }
.topic-pinned { background: var(--bg-alt); }
.topic-moved .topic-main { color: var(--fg-muted); }

.badge { display: inline-block; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.1rem 0.4rem; border-radius: 3px; margin-right: 0.35rem; vertical-align: middle; background: var(--bg-alt); border: 1px solid var(--border); color: var(--fg-muted); }
.badge-announce, .badge-sticky { border-color: var(--accent); color: var(--accent); }
h1 .badge { font-size: 0.75rem; vertical-align: middle; }

.user { font-weight: 600; }
.user-colour { color: var(--user-colour); }
.user-guest { color: var(--fg-muted); }
.user-group { font-size: 0.75rem; color: var(--fg-muted); margin-left: 0.4rem; }

.pagination { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0.75rem 0; font-size: 0.9rem; }
.pagination .pages a, .pagination .pages strong { display: inline-block; padding: 0.15rem 0.45rem; border-radius: 3px; }
.pagination .pages strong { background: var(--accent); color: var(--accent-fg); }

.posts { display: flex; flex-direction: column; gap: 1rem; }
.post { border: 1px solid var(--border); border-radius: 6px; background: var(--bg-alt); padding: 0.75rem 1rem 1rem; }
.post:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.post-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; padding-bottom: 0.5rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.post-meta { color: var(--fg-muted); }
.post-permalink { margin-right: 0.6rem; text-decoration: none; color: var(--fg-muted); }
.post-subject { font-size: 1rem; margin: 0 0 0.5rem; }
.post-body { overflow-wrap: anywhere; }
.post-body img { max-width: 100%; height: auto; }
.post-body img.smiley { vertical-align: text-bottom; }
img.icon { width: 1em; height: 1em; vertical-align: -0.1em; margin-right: 0.35rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; }
.post-edited { font-size: 0.8rem; color: var(--fg-muted); margin: 0.75rem 0 0; }
.post-signature { margin-top: 0.75rem; padding-top: 0.5rem; border-top: 1px dashed var(--border); font-size: 0.85rem; color: var(--fg-muted); }
.topic-locked-note { color: var(--fg-muted); font-size: 0.9rem; }

pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 4px; padding: 0.6rem 0.8rem; overflow-x: auto; font-size: 0.875rem; line-height: 1.45; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
blockquote { margin: 0.75rem 0; padding: 0.4rem 0.9rem; border-left: 3px solid var(--quote-bar); background: var(--bg); border-radius: 0 4px 4px 0; }
blockquote cite { display: block; font-style: normal; font-weight: 600; font-size: 0.85rem; color: var(--fg-muted); margin-bottom: 0.25rem; }
blockquote blockquote { background: var(--bg-alt); }

.poll { border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; margin-bottom: 1rem; }
.poll h2 { margin-top: 0; }
.poll-note, .poll-total { font-size: 0.85rem; color: var(--fg-muted); }
.poll-results th { font-weight: normal; width: 40%; }
.poll-bar { width: 40%; }
.poll-bar .bar { height: 0.8rem; background: var(--accent); border-radius: 2px; min-width: 2px; }

.profile { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0 0 1.5rem; }
.profile dt { font-weight: 600; color: var(--fg-muted); }
.profile dd { margin: 0; overflow-wrap: anywhere; }

.stats p { color: var(--fg-muted); }
.site-footer { margin-top: 2.5rem; padding: 1.25rem 0 2rem; border-top: 1px solid var(--border); font-size: 0.875rem; color: var(--fg-muted); }
.site-footer p { margin: 0.25rem 0; }

@media (max-width: 40rem) {
  td.num, th.num { width: auto; }
  .profile { grid-template-columns: 1fr; gap: 0.1rem; }
  .profile dd { margin-bottom: 0.5rem; }
}
