/* Server-rendered pages (questions, sections, categories). Same tokens as the app. */
:root {
  --bg: #f3f5f9; --surface: #fff; --surface-2: #f7f8fb; --text: #172033; --muted: #5b6475;
  --border: #dde2ea; --primary: #1d5bd8; --primary-hover: #174bb3; --primary-ink: #fff;
  --primary-soft: #e8effd; --ok: #17824a; --ok-soft: #e2f4e9; --radius: 14px;
  color-scheme: light;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px; line-height: 1.55; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e131b; --surface: #161d28; --surface-2: #1b2331; --text: #e6eaf1; --muted: #9aa4b5;
    --border: #2a3342; --primary: #5b8cff; --primary-hover: #7aa2ff; --primary-ink: #0b1220;
    --primary-soft: #1b2948; --ok: #3fcf80; --ok-soft: #12301f;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-width: 320px; }
a { color: var(--primary); }
h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 14px; }
h2 { font-size: 1.15rem; margin: 24px 0 10px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 54px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; }
.container { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.lead { color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text);
  font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.panel, .q { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.panel { margin: 16px 0; }
.panel ul { padding-left: 20px; }
.q-meta { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.q-img { display: block; max-width: 100%; height: auto; margin: 0 auto 14px; border-radius: 10px; background: #fff; }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.opt .n { flex: 0 0 auto; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); font-size: .85rem; font-weight: 700; }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); }
.opt.ok .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.mark { color: var(--ok); white-space: nowrap; }
.answer { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); }
.expl { margin-top: 16px; }
.ref, .src { color: var(--muted); font-size: .9rem; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qlist a { display: block; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); text-decoration: none; }
.qlist a:hover { border-color: var(--primary); }
.qid { color: var(--primary); font-weight: 700; margin-right: 6px; }
.tlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tlist a { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text); text-decoration: none; }
.tlist a:hover { border-color: var(--primary); }
.tcode { min-width: 2.6em; color: var(--primary); font-weight: 700; }
.tcount { color: var(--muted); font-size: .85rem; }
.footer { padding: 20px 16px 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; text-align: center; }
.footer p, .footer-nav { max-width: 640px; margin: 6px auto; }
