/* Leonida Field Guide — prototype stylesheet v1 (13/11/2026)
 * Depends on ../../tokens/tokens.css (copied to ./tokens.css for the prototype).
 * Sections mirror COMPONENTS.md. Class names are the contract for Sol (BEM-ish, `lfg-` free
 * because the site owns the whole page; rename only with a mapping note).
 */

/* ── 0. Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--fs-base)/var(--lh-body) var(--font-text);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 650; line-height: var(--lh-snug); text-wrap: balance; margin: 0; letter-spacing: -0.01em; font-optical-sizing: auto; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--green); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--green-strong); text-decoration-thickness: 2.5px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--focus-halo); border-radius: var(--r-sm);
}
@media (forced-colors: active) { :focus-visible { outline: 3px solid CanvasText; box-shadow: none; } }
::selection { background: var(--sun); color: #111820; }
mark { background: var(--sun); color: #111820; padding: 0 .1em; border-radius: 2px; }
time, .num, table { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; } /* component display rules must never beat the hidden attribute (QA 13/11) */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link { position: fixed; left: var(--s-3); top: -100px; z-index: var(--z-toast); background: var(--ink); color: var(--paper); padding: var(--s-3) var(--s-4); border-radius: var(--r-pill); font-weight: 600; text-decoration: none; }
.skip-link:focus { top: var(--s-3); }

/* Label: the field-guide "caption" voice. Uppercase only for ≤3 words. */
.label { font: 600 var(--fs-xs)/1.2 var(--font-text); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--ink-muted); }

/* ── 1. Prototype chrome (strip in production) ───────────── */

/* ── 2. Header ───────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.2) blur(8px); border-bottom: var(--rule); }
.site-header__row { display: flex; align-items: center; gap: var(--s-4); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; min-height: var(--tap); }
.brand:hover { color: var(--ink); }
.brand__mark { width: 34px; height: 34px; flex: none; }
.brand__name { font: 700 1.125rem/1 var(--font-display); letter-spacing: -0.01em; white-space: nowrap; }
.brand__name span { color: var(--coral-ink); }
.nav { display: flex; gap: var(--s-1); }
.nav a { display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-pill); color: var(--ink); text-decoration: none; font-weight: 550; font-size: var(--fs-sm); }
.nav a:hover { background: var(--paper-sunk); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.header-actions { display: flex; align-items: center; gap: var(--s-2); }
.icon-btn { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: var(--r-pill); border: 1px solid transparent; background: transparent; color: var(--ink); }
.icon-btn:hover { background: var(--paper-sunk); }
.icon-btn svg { width: 20px; height: 20px; }
.search-pill { display: inline-flex; align-items: center; gap: var(--s-2); height: var(--tap); padding: 0 var(--s-2) 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--paper-raised); color: var(--ink-muted); font-size: var(--fs-sm); min-width: 220px; }
.search-pill svg { width: 18px; height: 18px; color: var(--ink); }
.search-pill kbd { margin-left: auto; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; font: 600 12px/1.4 var(--font-mono); color: var(--ink); background: var(--paper); text-align: center; }
@media (hover: none) { .search-pill kbd, .kbd-hint { display: none; } }

/* Language menu */
.lang { position: relative; }
.lang__btn { display: inline-flex; align-items: center; gap: 6px; height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: transparent; font-weight: 600; font-size: var(--fs-sm); }
.lang__btn svg { width: 16px; height: 16px; }
.lang__menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; padding: var(--s-2); margin: 0; list-style: none; background: var(--paper-raised); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); }
.lang__menu[hidden] { display: none; }
.lang__menu a, .lang__menu .lang__na { display: flex; justify-content: space-between; gap: var(--s-3); align-items: center; min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.lang__menu a:hover { background: var(--paper-sunk); }
.lang__menu a[aria-current="true"]::after { content: "✓"; font-weight: 700; color: var(--green); }
.lang__na { color: var(--ink-muted); font-size: var(--fs-sm); }
.lang__na small { font-size: var(--fs-xs); }

/* Mobile header: brand + icons; nav becomes a scroll row below */
@media (max-width: 899px) {
  .site-header .nav { display: none; }
  .search-pill { min-width: 0; width: var(--tap); padding: 0; justify-content: center; }
  .search-pill kbd { display: none; }
  .search-pill .search-pill__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* keeps the accessible name */
  .lang__btn .lang__code-long { display: none; }
  .nav-row { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; padding: 0 var(--gutter) var(--s-2); margin: 0 calc(var(--gutter) * -1); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav-row::-webkit-scrollbar { display: none; }
  .nav-row a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 550; }
  .nav-row a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
}
@media (min-width: 900px) { .nav-row { display: none; } }
@media (max-width: 380px) { .brand__name { font-size: 1rem; } .brand__mark { width: 28px; height: 28px; } }

/* ── 3. Chips: status, evidence, platform ─────────────────── */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px; border-radius: var(--r-pill); font: 600 var(--fs-xs)/1.2 var(--font-text); letter-spacing: .02em; white-space: nowrap; }
.chip svg { width: 14px; height: 14px; flex: none; }
.chip--announced   { background: var(--st-announced-bg); color: var(--st-announced-fg); }
.chip--tested      { background: var(--st-tested-bg); color: var(--st-tested-fg); }
.chip--review      { background: var(--st-review-bg); color: var(--st-review-fg); }
.chip--archived    { background: var(--st-archived-bg); color: var(--st-archived-fg); }
.chip--unconfirmed { background: transparent; color: var(--st-unconfirmed-fg); border: 1.5px dashed currentColor; }
.chip--platform    { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }
.chip--spoiler     { background: transparent; color: var(--spoiler); border: 1.5px solid currentColor; }
.chip--illustration{ background: rgba(17,24,32,.72); color: #F4EADC; backdrop-filter: blur(4px); }

/* Stamp — decorative status for hero/article header; mirrors chip text. */
.stamp { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 2px solid currentColor; border-radius: var(--r-sm); color: var(--coral-ink); font: 700 var(--fs-xs)/1 var(--font-text); letter-spacing: .12em; text-transform: uppercase; transform: rotate(-2deg); }

/* ── 4. Buttons & inputs ──────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--r-pill); border: 1.5px solid transparent; font-weight: 650; font-size: var(--fs-sm); text-decoration: none; transition: transform var(--dur-1) var(--ease), background var(--dur-2); touch-action: manipulation; }
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--green); color: var(--on-green); }
.btn--primary:hover { background: var(--green-strong); color: var(--on-green); }
.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: var(--paper); }
.btn--quiet { background: transparent; color: var(--green); padding-inline: var(--s-3); }
.btn--danger { background: var(--coral); color: var(--on-coral); }
.btn:active { transform: translateY(1px); }
.field { display: flex; align-items: center; gap: var(--s-3); min-height: 56px; padding: 0 var(--s-2) 0 var(--s-4); border: 1.5px solid var(--ink); border-radius: var(--r-pill); background: var(--paper-raised); box-shadow: 4px 4px 0 var(--ink); }
.field svg { width: 22px; height: 22px; flex: none; }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.0625rem; height: 52px; outline: none; }
.field:focus-within { box-shadow: 4px 4px 0 var(--ink), 0 0 0 4px var(--focus-halo); }
.field input::placeholder { color: var(--ink-muted); opacity: 1; }
@media (max-width: 599px) { input, select, textarea { font-size: 16px !important; } }

/* ── 5. Home ──────────────────────────────────────────────── */
.home-hero { padding-block: var(--s-7) var(--s-6); }
.home-hero__grid { display: grid; gap: var(--s-6); align-items: start; }
@media (min-width: 960px) { .home-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-8); } }
.home-hero__eyebrow { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; margin-bottom: var(--s-4); }
.home-hero h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.025em; font-weight: 700; max-width: 14ch; }
.home-hero h1 em { font-style: italic; color: var(--coral-ink); font-weight: 600; }
.home-hero__lead { font-size: var(--fs-lg); max-width: 46ch; margin: var(--s-4) 0 var(--s-5); color: var(--ink); }
.quick { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--s-4); }
.quick a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 550; background: var(--paper-raised); }
.quick a:hover { border-color: var(--ink); }

/* Facts desk — the answer on the home page */
.desk { background: var(--paper-raised); border: var(--rule-strong); border-radius: var(--r-lg); box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.desk__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-bottom: 1.5px dashed var(--line-strong); }
.desk__head h2 { font-size: 1.25rem; }
.desk__list { margin: 0; padding: var(--s-2) var(--s-5); }
.desk__row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: var(--s-3) 0; border-bottom: var(--rule); }
.desk__row:last-child { border-bottom: 0; }
.desk__row dt { font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 550; }
.desk__row dd { margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: baseline; justify-content: space-between; }
.desk__value { font: 650 1.375rem/1.25 var(--font-display); }
.desk__value--sm { font: 600 1.0625rem/1.4 var(--font-text); }
.desk__count { display: flex; align-items: baseline; gap: var(--s-2); padding: var(--s-3) var(--s-5); background: var(--sun); color: #111820; font-weight: 600; }
.desk__count b { font: 700 2rem/1 var(--font-display); }
.desk__count[hidden] { display: none; }
.desk__foot { padding: var(--s-3) var(--s-5) var(--s-4); font-size: var(--fs-sm); color: var(--ink-muted); background: var(--paper); border-top: var(--rule); }
.desk__foot a { font-weight: 600; }

/* Art band — illustration in a controlled frame */
.art-band { position: relative; margin: 0; border-radius: var(--r-lg); overflow: hidden; border: var(--rule-strong); aspect-ratio: 21 / 6; background: #F4EADC; }
.art-band img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 60%; }
.art-band figcaption, .art-tag { position: absolute; left: var(--s-3); bottom: var(--s-3); }
@media (max-width: 599px) { .art-band { aspect-ratio: 16 / 7; border-radius: var(--r-md); } .art-band img { object-position: 78% 60%; } }

.section { padding-block: var(--s-8) 0; }
.section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s-3); margin-bottom: var(--s-5); }
.section__head h2 { font-size: var(--fs-h2); }
.section__head p { margin: 4px 0 0; color: var(--ink-muted); }

/* Need cards — "what do you need right now" */
.needs { display: grid; gap: var(--s-4); grid-template-columns: 1fr; counter-reset: need; }
@media (min-width: 700px) { .needs { grid-template-columns: repeat(3, 1fr); } }
.need { position: relative; display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5); min-height: 100%; border: var(--rule-strong); border-radius: var(--r-md); background: var(--paper-raised); color: var(--ink); text-decoration: none; transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.need::before { counter-increment: need; content: "0" counter(need); font: 700 var(--fs-sm)/1 var(--font-mono); color: var(--coral-ink); }
.need h3 { font-size: var(--fs-h3); }
.need p { margin: 0; color: var(--ink-muted); font-size: var(--fs-sm); }
.need__go { margin-top: auto; padding-top: var(--s-3); font-weight: 650; color: var(--green); font-size: var(--fs-sm); }
.need:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }

/* Hub cards */
.hubs { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 640px) { .hubs { grid-template-columns: repeat(3, 1fr); } }
.hub-card { display: grid; grid-template-columns: 96px 1fr; gap: var(--s-4); align-items: center; padding: var(--s-3); border: var(--rule); border-radius: var(--r-md); background: var(--paper-raised); color: var(--ink); text-decoration: none; }
@media (min-width: 640px) { .hub-card { grid-template-columns: 1fr; align-items: start; align-content: start; padding: 0; overflow: hidden; } .hub-card__body { padding: var(--s-4) var(--s-5) var(--s-5); } }
.hub-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); background: var(--paper-sunk); }
@media (min-width: 640px) { .hub-card img { aspect-ratio: 4 / 3; border-radius: 0; } }
.hub-card h3 { font-size: var(--fs-h3); }
.hub-card p { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.hub-card:hover { color: var(--ink); border-color: var(--ink); }
.hub-card:hover img { filter: saturate(1.15); }

/* Guide rows (lists everywhere) */
.rows { list-style: none; margin: 0; padding: 0; border-top: var(--rule-strong); }
.row { border-bottom: var(--rule); }
.row a { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--s-4); padding: var(--s-4) var(--s-1); color: var(--ink); text-decoration: none; }
.row a:hover { background: var(--paper-raised); }
.row__title { font: 650 1.1875rem/1.3 var(--font-display); }
.row a:hover .row__title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.row__sum { grid-column: 1 / -1; margin: 0; font-size: var(--fs-sm); color: var(--ink-muted); max-width: 70ch; }
.row__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; font-size: var(--fs-sm); color: var(--ink-muted); }
.row__arrow { align-self: start; color: var(--green); font-weight: 700; }

/* Post-launch home: start-here strip */
.start-here { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 700px) { .start-here { grid-template-columns: repeat(2, 1fr); } }

/* ── 6. Footer ────────────────────────────────────────────── */
.site-footer { margin-top: var(--s-9); padding-block: var(--s-7) var(--s-6); background: var(--ink); color: var(--paper); }
:root[data-theme="dark"] .site-footer { background: var(--paper-sunk); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: var(--paper-sunk); color: var(--ink); } }
.site-footer a { color: inherit; }
.footer__grid { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 800px) { .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer__grid h2 { font: 600 var(--fs-xs)/1.2 var(--font-text); letter-spacing: var(--tracking-label); text-transform: uppercase; opacity: .8; margin-bottom: var(--s-3); }
.footer__grid ul { list-style: none; margin: 0; padding: 0; }
.footer__grid li a { display: inline-flex; min-height: 36px; align-items: center; font-size: var(--fs-sm); text-decoration: none; }
.footer__grid li a:hover { text-decoration: underline; }
.footer__disclaimer { font-size: var(--fs-sm); line-height: 1.55; opacity: .92; max-width: 52ch; }
.footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); font-size: var(--fs-sm); opacity: .9; }
.footer__base button { background: none; border: 1px solid currentColor; border-radius: var(--r-pill); min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-sm); }
.site-footer :focus-visible { outline-color: currentColor; }

/* ── 7. Article ───────────────────────────────────────────── */
.breadcrumb { padding-top: var(--s-5); font-size: var(--fs-sm); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 2px var(--s-2); list-style: none; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: var(--s-2); color: var(--ink-muted); }
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb [aria-current] { color: var(--ink); }

.article-layout { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .article-layout { grid-template-columns: minmax(0, var(--measure)) var(--toc-w); justify-content: space-between; gap: var(--s-8); } }
.article-head { padding-block: var(--s-4) var(--s-5); }
.article-head h1 { font-size: var(--fs-h1); max-width: 22ch; margin-top: var(--s-3); }
.article-head__chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Answer box — 40–80 word summary, always first, readable without JS */
.answer { position: relative; margin: var(--s-5) 0; padding: var(--s-5) var(--s-5) var(--s-4); background: var(--paper-raised); border: var(--rule-strong); border-radius: var(--r-md); border-left-width: 6px; border-left-color: var(--green); }
.answer__label { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.answer p { font-size: var(--fs-lg); line-height: 1.55; margin: 0; }
.answer__foot { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px dashed var(--line-strong); font-size: var(--fs-sm); color: var(--ink-muted); }
.answer__foot a { font-weight: 600; }

/* Freshness line: verified ≠ updated ≠ review due */
.fresh { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); color: var(--ink-muted); }
.fresh li { display: inline-flex; align-items: center; gap: 6px; }
.fresh svg { width: 16px; height: 16px; }
.fresh b { color: var(--ink); font-weight: 600; }
.translations { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-muted); }
.translations a { font-weight: 600; }

/* Notice — stale source / translation missing / storage / expired date */
.notice { display: grid; grid-template-columns: 24px 1fr; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-md); border: 1.5px solid; margin: var(--s-4) 0; font-size: var(--fs-sm); line-height: 1.5; }
.notice svg { width: 22px; height: 22px; }
.notice p { margin: 0; }
.notice strong { display: block; font-size: 1rem; margin-bottom: 2px; }
.notice--warn { background: var(--st-review-bg); color: var(--st-review-fg); border-color: color-mix(in srgb, var(--st-review-fg) 40%, transparent); }
.notice--info { background: var(--st-announced-bg); color: var(--st-announced-fg); border-color: color-mix(in srgb, var(--st-announced-fg) 35%, transparent); }
.notice--neutral { background: var(--paper-raised); color: var(--ink); border-color: var(--line-strong); }
.notice a { color: inherit; font-weight: 700; }

/* TOC */
.toc { font-size: var(--fs-sm); }
.toc details { border: var(--rule); border-radius: var(--r-md); background: var(--paper-raised); }
.toc summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 var(--s-4); font-weight: 650; cursor: pointer; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; font: 600 1.25rem/1 var(--font-mono); }
.toc details[open] summary::after { content: "–"; }
.toc ol { margin: 0; padding: 0 var(--s-4) var(--s-4); list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: grid; grid-template-columns: 2.2em 1fr; min-height: 40px; align-items: center; color: var(--ink); text-decoration: none; border-radius: var(--r-sm); }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 600 12px/1 var(--font-mono); color: var(--ink-muted); }
.toc a:hover { color: var(--green); }
.toc a[aria-current="true"] { font-weight: 700; color: var(--green); }
.toc a[aria-current="true"]::before { color: var(--coral-ink); }
@media (min-width: 1100px) {
  .toc { position: sticky; top: calc(var(--header-h) + var(--s-5)); align-self: start; }
  .toc details { border: 0; background: transparent; border-left: var(--rule-strong); border-radius: 0; }
  .toc summary { min-height: 32px; cursor: default; pointer-events: none; }
  .toc summary::after { content: none; }
  .toc .toc__aside { padding: var(--s-4); margin-top: var(--s-4); border-top: var(--rule); color: var(--ink-muted); }
}

/* Prose */
.prose { font-size: var(--fs-base); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: var(--fs-h2); margin-top: var(--s-7); scroll-margin-top: calc(var(--header-h) + var(--s-4)); padding-top: var(--s-4); border-top: var(--rule-strong); }
.prose h3 { font-size: var(--fs-h3); margin-top: var(--s-6); scroll-margin-top: calc(var(--header-h) + var(--s-4)); }
.prose ul { padding-left: 1.2em; }
.prose li::marker { color: var(--coral-ink); }
.prose li + li { margin-top: .35em; }
.prose code { font: 0.9em var(--font-mono); background: var(--paper-sunk); padding: .1em .35em; border-radius: var(--r-sm); }
.prose .heading-anchor { margin-left: .3em; color: var(--ink-muted); text-decoration: none; opacity: 0; font-family: var(--font-text); }
.prose h2:hover .heading-anchor, .prose h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }

/* Route steps — ordered list with the dashed "road" line */
.route { list-style: none; padding: 0; margin: var(--s-5) 0; counter-reset: stop; }
.route > li { position: relative; padding: 0 0 var(--s-5) 56px; counter-increment: stop; }
.route > li::before { content: counter(stop); position: absolute; left: 0; top: -2px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 1rem/1 var(--font-display); }
.route > li::after { content: ""; position: absolute; left: 18px; top: 42px; bottom: 6px; border-left: 2.5px dashed var(--coral); }
.route > li:last-child::after { display: none; }
.route > li:last-child { padding-bottom: 0; }
.route h3 { font-size: 1.125rem; margin: 4px 0 4px; font-family: var(--font-text); font-weight: 700; }
.route p { margin: 0; }

/* Evidence callouts */
.evidence { display: grid; grid-template-columns: auto 1fr; gap: var(--s-2) var(--s-3); padding: var(--s-4); border-radius: var(--r-md); background: var(--paper-raised); border: var(--rule); }
.evidence > .chip { align-self: start; }
.evidence p { margin: 0; font-size: var(--fs-base); }
.evidence cite { display: block; grid-column: 2; font-style: normal; font-size: var(--fs-sm); color: var(--ink-muted); }
@media (max-width: 520px) { .evidence { grid-template-columns: 1fr; } .evidence cite { grid-column: 1; } }

/* Tables */
.table-wrap { overflow-x: auto; border: var(--rule-strong); border-radius: var(--r-md); background: var(--paper-raised); scrollbar-width: thin; }
.table-wrap:focus-visible { outline-offset: 4px; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 520px; }
caption { text-align: left; padding: var(--s-3) var(--s-4); font-weight: 650; border-bottom: var(--rule); }
th, td { text-align: left; vertical-align: top; padding: var(--s-3) var(--s-4); border-bottom: var(--rule); }
thead th { background: var(--paper-sunk); font-weight: 700; color: var(--ink); white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 650; }
.table-note { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: var(--s-2); }

/* Spoiler — native <details>, works without JS */
.spoiler { border: 1.5px solid var(--spoiler); border-radius: var(--r-md); background: var(--paper-raised); }
.spoiler > summary { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s-3); align-items: center; min-height: 64px; padding: var(--s-3) var(--s-4); cursor: pointer; list-style: none; }
.spoiler > summary::-webkit-details-marker { display: none; }
.spoiler__title { font-weight: 650; }
.spoiler__hint { display: block; font-size: var(--fs-sm); color: var(--ink-muted); font-weight: 400; }
.spoiler__action { font-size: var(--fs-sm); font-weight: 700; color: var(--spoiler); white-space: nowrap; }
.spoiler[open] .spoiler__action .when-closed, .spoiler:not([open]) .spoiler__action .when-open { display: none; }
.spoiler__body { padding: 0 var(--s-4) var(--s-4); border-top: 1px dashed var(--spoiler); padding-top: var(--s-4); }

/* Figure — illustration labelled as illustration */
.figure { margin: var(--s-6) 0; }
.figure__frame { position: relative; border-radius: var(--r-md); overflow: hidden; border: var(--rule); }
.figure figcaption { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--ink-muted); }

/* Sources & corrections */
.sources { margin-top: var(--s-7); padding: var(--s-5); border: var(--rule-strong); border-radius: var(--r-md); background: var(--paper-raised); }
.sources h2 { font-size: 1.375rem; border: 0; margin: 0 0 var(--s-3); padding: 0; }
.sources ol { margin: 0; padding-left: 1.4em; font-size: var(--fs-sm); }
.sources li { padding: var(--s-2) 0; border-bottom: var(--rule); }
.sources li:last-child { border-bottom: 0; }
.sources .src__supports { display: block; color: var(--ink-muted); }
.corrections { margin-top: var(--s-4); font-size: var(--fs-sm); }
.corrections summary { cursor: pointer; font-weight: 650; min-height: 40px; display: flex; align-items: center; }
.byline { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-5); font-size: var(--fs-sm); color: var(--ink-muted); }
.byline b { color: var(--ink); }

/* Related */
.related { margin-top: var(--s-7); }
.related h2 { font-size: var(--fs-h2); margin-bottom: var(--s-4); }

/* ── 8. Hub ───────────────────────────────────────────────── */
.hub-head { display: grid; gap: var(--s-5); align-items: center; padding-block: var(--s-4) var(--s-6); }
@media (min-width: 860px) { .hub-head { grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-8); } }
.hub-head h1 { font-size: var(--fs-h1); margin: var(--s-2) 0 var(--s-4); }
.hub-head p { font-size: var(--fs-lg); max-width: 52ch; }
.hub-head__art { position: relative; border-radius: var(--r-lg); overflow: hidden; border: var(--rule-strong); box-shadow: 6px 6px 0 var(--ink); }
@media (max-width: 859px) { .hub-head__art { max-width: 360px; aspect-ratio: 16/9; } .hub-head__art img { height: 100%; object-fit: cover; } }
.choices { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 760px) { .choices { grid-template-columns: repeat(3, 1fr); } }
.choice { display: block; padding: var(--s-4) var(--s-5); border-radius: var(--r-md); border: var(--rule-strong); background: var(--paper-raised); color: var(--ink); text-decoration: none; }
.choice b { display: block; font: 650 1.125rem/1.3 var(--font-display); margin-bottom: 4px; }
.choice span { font-size: var(--fs-sm); color: var(--ink-muted); }
.choice:hover { color: var(--ink); background: var(--paper-sunk); }
.policy-note { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); margin-top: var(--s-6); padding: var(--s-5); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); }
.policy-note svg { width: 28px; height: 28px; color: var(--coral-ink); }
.policy-note p { margin: 0; font-size: var(--fs-sm); }
.policy-note h2 { font-size: 1.125rem; margin-bottom: 4px; }

/* ── 9. Checklist tool ────────────────────────────────────── */
.tool-head { padding-block: var(--s-4) var(--s-5); }
.tool-head h1 { font-size: var(--fs-h1); margin: var(--s-2) 0 var(--s-3); max-width: 20ch; }
.tool-head p { max-width: 60ch; }
.tool { display: grid; gap: var(--s-6); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .tool { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-8); } }
.tool__panel { position: sticky; top: calc(var(--header-h) + var(--s-4)); align-self: start; display: grid; gap: var(--s-4); padding: var(--s-5); border: var(--rule-strong); border-radius: var(--r-md); background: var(--paper-raised); }
@media (max-width: 999px) { .tool__panel { position: sticky; top: var(--header-h); z-index: 5; padding: var(--s-3) var(--s-4); grid-template-columns: 1fr auto; align-items: center; gap: var(--s-2) var(--s-4); border-radius: 0 0 var(--r-md) var(--r-md); border-top: 0; margin-inline: calc(var(--gutter) * -1); box-shadow: var(--shadow); } .tool__panel .tool__panel-extra { display: none; } }
.progress__label { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); font-weight: 600; }
.progress__label b { font: 700 1.5rem/1 var(--font-display); }
.progress__track { height: 12px; border-radius: var(--r-pill); background: var(--paper-sunk); border: 1px solid var(--line-strong); overflow: hidden; margin-top: var(--s-2); }
.progress__fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--green) 0 14px, var(--green-strong) 14px 16px); transition: width var(--dur-3) var(--ease); }
@media (max-width: 999px) { .progress { grid-column: 1 / -1; } }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid var(--ink); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button { min-height: 38px; padding: 0 var(--s-4); border: 0; border-radius: var(--r-pill); background: transparent; font-size: var(--fs-sm); font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.check-group { margin-bottom: var(--s-6); }
.check-group h2 { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); font-size: var(--fs-h2); padding-bottom: var(--s-3); border-bottom: var(--rule-strong); }
.check-group h2 small { font: 600 var(--fs-sm)/1 var(--font-text); color: var(--ink-muted); }
.checks { list-style: none; margin: 0; padding: 0; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-3); padding: var(--s-4) var(--s-1); border-bottom: var(--rule); }
.check input { appearance: none; -webkit-appearance: none; margin: 2px 0 0; width: 28px; height: 28px; border: 2px solid var(--line-strong); border-radius: 6px; background: var(--paper-raised); display: grid; place-items: center; cursor: pointer; }
.check input::after { content: ""; width: 14px; height: 8px; border: solid var(--on-green); border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform var(--dur-1) var(--ease); }
.check input:checked { background: var(--green); border-color: var(--green); }
.check input:checked::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check label { cursor: pointer; font-weight: 600; line-height: 1.4; }
.check input:checked + div label { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-muted); }
.check__why { margin: 4px 0 0; font-size: var(--fs-sm); color: var(--ink-muted); }
.check__meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
.check[hidden] { display: none; }
@media (forced-colors: active) { .check input { appearance: auto; -webkit-appearance: auto; width: 24px; height: 24px; } .check input::after { content: none; } }
.dataset-note { font-size: var(--fs-sm); color: var(--ink-muted); }

/* ── 10. Dialogs: search & confirm ───────────────────────── */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 15, 20, .55); backdrop-filter: blur(2px); }
.search-dialog { width: min(680px, calc(100vw - 24px)); margin: 10vh auto auto; }
@media (max-width: 599px) { .search-dialog { width: 100vw; height: 100dvh; margin: 0; } .search-dialog .search { border-radius: 0; height: 100%; border: 0; } }
.search { display: flex; flex-direction: column; max-height: 76vh; background: var(--paper-raised); border: var(--rule-strong); border-radius: var(--r-lg); box-shadow: 8px 8px 0 var(--ink); overflow: hidden; }
@media (max-width: 599px) { .search { max-height: none; box-shadow: none; } }
.search__bar { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border-bottom: var(--rule); }
.search__bar svg { width: 22px; height: 22px; flex: none; }
.search__bar input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 1.125rem; height: 48px; outline: none; }
.search__body { overflow-y: auto; padding: var(--s-4); min-height: 160px; }
.search__state { text-align: left; padding: var(--s-3) var(--s-2); }
.search__state h3 { font: 650 1.125rem/1.3 var(--font-display); margin-bottom: 4px; }
.search__state p { color: var(--ink-muted); font-size: var(--fs-sm); margin: 0 0 var(--s-3); }
.search__results { list-style: none; margin: 0; padding: 0; }
.search__results a { display: block; padding: var(--s-3); border-radius: var(--r-sm); color: var(--ink); text-decoration: none; }
.search__results [aria-selected="true"] a, .search__results a:hover { background: var(--paper-sunk); }
.search__results .r-title { font-weight: 650; }
.search__results .r-sum { display: block; font-size: var(--fs-sm); color: var(--ink-muted); }
.search__results .r-cat { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--coral-ink); font-weight: 700; }
.search__foot { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-2) var(--s-4); border-top: var(--rule); font-size: var(--fs-xs); color: var(--ink-muted); }
.skeleton { height: 54px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--paper-sunk) 0 40%, var(--paper) 50%, var(--paper-sunk) 60% 100%); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; margin-bottom: var(--s-2); }
@keyframes shimmer { to { background-position: -100% 0; } }

.confirm { width: min(440px, calc(100vw - 32px)); }
.confirm__box { padding: var(--s-5); background: var(--paper-raised); border: var(--rule-strong); border-radius: var(--r-md); box-shadow: 6px 6px 0 var(--ink); }
.confirm__box h2 { font-size: 1.375rem; margin-bottom: var(--s-2); }
.confirm__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }

.toast { position: fixed; left: 50%; bottom: var(--s-5); transform: translateX(-50%); z-index: var(--z-toast); padding: var(--s-3) var(--s-5); border-radius: var(--r-pill); background: var(--ink); color: var(--paper); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }

/* ── 11. 404 & states gallery ─────────────────────────────── */
.lost { display: grid; gap: var(--s-6); align-items: center; padding-block: var(--s-7); }
@media (min-width: 860px) { .lost { grid-template-columns: 1fr 360px; } }
.lost h1 { font-size: var(--fs-display); line-height: 1.02; }
.lost .stamp { margin-bottom: var(--s-4); }
.state-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .state-grid { grid-template-columns: 1fr 1fr; } }
.state-card { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: var(--s-4); }
.state-card > .label { display: block; margin-bottom: var(--s-3); }
.state-card .search { box-shadow: none; max-height: none; }

/* ── 12. Motion preferences & print ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .need:hover { transform: none; }
}
@media print {
  body { background: #fff; color: #000; font-size: 12pt; }
  .spoiler:not([open]) .spoiler__body { display: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
}
.search-pill { text-decoration: none; }
.search-pill:hover { color: var(--ink-muted); border-color: var(--ink); }

/* ── Mobile header fit (fix from QA 13/11: overflow at 390/320) ── */
.footer-theme { display: none; }
@media (max-width: 599px) {
  .site-header__row { gap: var(--s-2); }
  .site-header .icon-btn[data-theme-toggle] { display: none; }   /* moves to footer on phones */
  .footer-theme { display: inline-flex; }
  .lang__btn { padding: 0 10px; }
}
@media (max-width: 380px) {
  .brand__name { display: grid; font-size: .9375rem; line-height: 1.05; }
  .brand__name span { font-size: .8125rem; }
}
/* Grid tracks must allow shrinking below min-content (fix from QA 13/11: 320px overflow). */
.home-hero__grid, .hub-head, .lost { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .home-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
@media (min-width: 860px) { .hub-head { grid-template-columns: minmax(0, 1fr) 320px; } .lost { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 380px) { .field .btn { padding-inline: var(--s-4); } }
@media (min-width: 1100px) { .toc details[open] summary::after { content: none; } }
.figure__frame img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 60%; }
/* Mobile hero: keep the facts desk inside the first screen (QA 13/11) */
@media (max-width: 599px) {
  .home-hero { padding-block: var(--s-5) var(--s-5); }
  .home-hero__eyebrow { margin-bottom: var(--s-3); }
  .home-hero__lead { font-size: 1.0625rem; margin: var(--s-3) 0 var(--s-4); }
  .home-hero .quick { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); }
  .home-hero .quick::-webkit-scrollbar { display: none; }
  .home-hero .quick a { flex: none; }
  .home-hero__grid { gap: var(--s-5); }
}
/* Search dialog input: the bar shows focus, not the bare input; one close control only */
.search__bar input:focus-visible { outline: none; box-shadow: none; }
.search__bar:focus-within { box-shadow: inset 0 -3px 0 var(--green); }
.search__bar input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.field input:focus-visible { outline: none; box-shadow: none; }
@media (max-width: 599px) { .answer { padding: var(--s-4); } .answer p { font-size: 1.0625rem; } }
/* Font budget (measured 13/11): no Fraunces italic file; emphasis is colour + weight. */
.home-hero h1 em { font-style: normal; font-weight: 700; }
/* Dark theme: illustrations stay paper-toned but slightly dimmed so they don't glare */
:root[data-theme="dark"] .art-band img, :root[data-theme="dark"] .hub-card img, :root[data-theme="dark"] .hub-head__art img, :root[data-theme="dark"] .figure__frame img { filter: brightness(.9) saturate(.95); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.art-band, .hub-card, .hub-head__art, .figure__frame) img { filter: brightness(.9) saturate(.95); } }
[hidden]{display:none!important}
.no-js :is([data-lang], [data-theme-toggle], [data-privacy-open], .tool__panel){display:none}
.answer__foot{font-size:var(--fs-sm)}
.article-layout .table-wrap th{padding:var(--s-3);text-align:start}
.heading-anchor{opacity:0;margin-inline-start:.25em}
:is(h2,h3,h4):hover>.heading-anchor,.heading-anchor:focus-visible{opacity:1}
@media(max-width:599px){.tool__panel [data-reset]{grid-column:1/-1;justify-self:start}}
