:root {
  --bg: #f3f2ec;
  --card: #ffffff;
  --text: #151515;
  --muted: #5b5a55;
  --primary: #1f4fd1;
  --primary-dark: #173ca3;
  --mark: #ffd43b;
  --line: #dcdad1;
  --radius: 8px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.06);
  --shadow-2: 0 8px 24px rgba(0,0,0,.08);
  --font-head: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--font-body); }
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.2; color: var(--text); letter-spacing: -.01em; }
h1 { font-size: 48px; margin: 0 0 16px; }
h2 { font-size: 28px; margin: 48px 0 16px; }
h3 { font-size: 22px; margin: 32px 0 12px; }

/* header */
.site-head { background: var(--text); color: #fff; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 700 22px/1.2 var(--font-head); }
.brand:hover { color: #fff; }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius); background: var(--mark); color: var(--text); font: 700 14px/1 var(--font-head); }
.head-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.head-nav a { color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; }
.head-nav a:hover { text-decoration: underline; color: #fff; }

/* fact tags: the site's one signature element */
.fact { display: inline-block; padding: 0 8px; border: 1.5px solid var(--text); border-radius: 4px; font: 600 12px/20px var(--font-body); letter-spacing: .04em; text-transform: uppercase; vertical-align: 2px; white-space: nowrap; }
.fact-ok { background: var(--text); color: #fff; }
.fact-rep { background: var(--card); color: var(--text); }
.fact-un { background: transparent; color: var(--muted); border-style: dashed; border-color: var(--muted); }

/* hero */
.hero { padding: 48px 0 32px; border-bottom: 2px solid var(--text); }
.kicker { margin: 0 0 8px; font-weight: 600; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hero h1 { font-size: 48px; }
.lead { font-size: 18px; max-width: 70ch; margin: 0 0 24px; }

/* search */
.search { max-width: 720px; }
.search-label { display: block; font-weight: 600; margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; height: 48px; padding: 0 16px; font: 400 16px var(--font-body); border: 2px solid var(--text); border-radius: var(--radius); background: var(--card); color: var(--text); }
.search-help { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.search-results { list-style: none; margin: 12px 0 0; padding: 0; }
.search-results:empty { display: none; }
.search-results li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.search-results a { font-weight: 600; }
.search-results p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--radius); background: var(--primary); color: #fff; font: 600 16px var(--font-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--primary-dark); color: #fff; }

/* chapters: guidebook table of contents */
.toc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--text); }
.toc-list a { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.toc-list a:hover .toc-title { text-decoration: underline; }
.toc-num { font: 700 28px/1 var(--font-head); background: var(--mark); border-radius: var(--radius); text-align: center; padding: 12px 0; }
.toc-title { display: block; font: 700 22px/1.2 var(--font-head); }
.toc-desc { display: block; color: var(--muted); font-size: 16px; margin-top: 4px; }
.toc-state { font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.toc-state.live { color: var(--text); }

/* snapshot: uneven two columns */
.snapshot { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; margin-top: 64px; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.snapshot h2 { margin-top: 0; }
.snap-intro p { color: var(--muted); margin: 0 0 16px; }
.legend { font-size: 14px; line-height: 2; }
.facts { margin: 0; }
.fact-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fact-row:last-child { border-bottom: 0; }
.fact-row dt { font-weight: 600; }
.fact-row dd { margin: 0; }

/* prose */
.prose { max-width: 70ch; }
.prose p, .prose li { font-size: 17px; }
.prose table { width: 100%; border-collapse: collapse; margin: 16px 0 24px; background: var(--card); font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--text); color: #fff; font-weight: 600; }
.prose blockquote { margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--mark); background: var(--card); }
.home-prose { margin-top: 16px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--text); }
.timeline li { position: relative; padding: 8px 0 8px 16px; }
.timeline li::before { content: ""; position: absolute; left: -23px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--mark); border: 2px solid var(--text); }
.timeline time { display: block; font-size: 14px; color: var(--muted); font-weight: 600; }

/* faq */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; max-width: 70ch; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq details p { margin: 8px 0 0; }

/* doc pages */
.doc { padding: 32px 0 64px; }
.crumb { font-size: 14px; color: var(--muted); margin-bottom: 24px; }
.crumb a { color: var(--muted); }
.doc-head { border-bottom: 2px solid var(--text); padding-bottom: 16px; margin-bottom: 24px; max-width: 70ch; }
.doc-meta { margin: 0; font-size: 14px; color: var(--muted); }
.status-box { max-width: 70ch; background: var(--card); border: 1.5px dashed var(--muted); border-radius: var(--radius); padding: 16px; }
.checklist { max-width: 70ch; padding-left: 24px; }
.checklist li { margin-bottom: 8px; }
.sources ol { max-width: 70ch; padding-left: 24px; font-size: 16px; }
.src-type { color: var(--muted); font-size: 14px; }
.related { margin-top: 48px; max-width: 70ch; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.related li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.related a { font-weight: 600; display: block; }
.related span { color: var(--muted); font-size: 14px; }
.notfound .nf-links { padding-left: 24px; margin-top: 24px; }

/* footer */
.site-foot { margin-top: 64px; border-top: 2px solid var(--text); background: var(--card); padding: 24px 0; font-size: 14px; color: var(--muted); }
.disclaimer { max-width: 90ch; margin: 0 0 16px; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-row p { margin: 0; }
.foot-nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot-nav a { color: var(--text); }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  h1, .hero h1 { font-size: 32px; }
  h2 { font-size: 22px; }
  .head-row { flex-direction: column; align-items: flex-start; padding: 12px 0; gap: 8px; }
  .head-nav { gap: 16px; }
  .search-row { flex-direction: column; }
  .search .btn { width: 100%; }
  .toc-list a { grid-template-columns: 48px 1fr; }
  .toc-num { font-size: 22px; }
  .toc-state { grid-column: 2; }
  .snapshot { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .fact-row { grid-template-columns: 1fr; gap: 4px; }
  .related ul { grid-template-columns: 1fr; }
}
