/* ==========================================================================
   Cobalynx design system — one file, no framework, no external assets.
   Aesthetic: scientific-instrument trust. Calm, precise, zero marketing noise.
   Two families (system sans for UI, system mono for measured numbers),
   a cobalt anchor with near-black/off-white neutrals, narrow semantic colors
   for verdict states, and a 4px spacing scale. Light and dark via
   prefers-color-scheme; every text/background pair targets WCAG AA.
   ========================================================================== */

/* ---- Tokens ---- */
:root {
  /* Type: system sans for UI, system mono for scores and dates. */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui,
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Restrained type scale. */
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.625rem;
  --text-3xl: clamp(2rem, 1.45rem + 2.2vw, 2.75rem);
  --leading-tight: 1.15;
  --leading-body: 1.65;

  /* Spacing scale (4px base). */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shell-max: 66rem;
  --measure: 44rem;

  /* Light palette. Cobalt anchor + near-black/off-white neutrals. */
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #edf0f7;
  --ink: #10182a;
  --muted: #475569;          /* 7:1 on --bg */
  --line: #dbe1ec;
  --cobalt: #1d4ed8;         /* 6.3:1 on white */
  --cobalt-hover: #1a3fae;
  --on-cobalt: #ffffff;
  --focus: #1d4ed8;

  /* Semantic verdict/state colors (AA as text on their backgrounds). */
  --state-ai: #b3261e;
  --state-ai-bg: #fdecea;
  --state-warn: #92400e;
  --state-warn-bg: #fdf3e1;
  --state-ok: #166534;
  --state-ok-bg: #e7f5ec;

  /* Heatmap band fills (graphics, separated by gaps + the strip track). */
  --band-low: #8cc9a4;
  --band-elevated: #edbe57;
  --band-high: #de6a50;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f1a;
    --surface: #121a2b;
    --surface-2: #1a2438;
    --ink: #e9edf6;
    --muted: #a4b0c6;        /* ~8:1 on --bg */
    --line: #273350;
    --cobalt: #93b3fb;       /* links on dark, ~9:1 */
    --cobalt-hover: #b4cafc;
    --focus: #93b3fb;

    --state-ai: #f0958d;
    --state-ai-bg: #3a1512;
    --state-warn: #e5b878;
    --state-warn-bg: #33210a;
    --state-ok: #8ed3ab;
    --state-ok-bg: #10301e;

    --band-low: #4f8a68;
    --band-elevated: #c69a3a;
    --band-high: #c05a44;
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}
h1, h2, h3 {
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  margin: 0 0 var(--s-3);
}
h1 { font-size: var(--text-3xl); font-weight: 750; }
h2 { font-size: var(--text-xl); font-weight: 700; }
h3 { font-size: var(--text-lg); font-weight: 650; }
p { margin: 0 0 var(--s-4); }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--cobalt-hover); }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}
::selection { background: var(--cobalt); color: var(--on-cobalt); }
@media (prefers-color-scheme: dark) {
  ::selection { background: #2c4fb8; color: #f2f5fd; }
}

.shell {
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 1.5rem);
}
.muted { color: var(--muted); }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* Skip link: hidden until keyboard focus. */
.skip-link {
  position: absolute;
  left: var(--s-4); top: -100px;
  z-index: 10;
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--cobalt);
}
.skip-link:focus-visible { top: var(--s-2); }

/* ---- Header ---- */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  padding-block: var(--s-4);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
/* Lynx mark: PNGs are @2x; fixed CSS height + intrinsic width/height
   attributes reserve the box before load (no layout shift). */
.wordmark-mark { display: inline-flex; flex: none; }
.wordmark-mark img { display: block; height: 32px; width: auto; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
}
.site-nav a {
  padding-block: var(--s-1);
  font-size: var(--text-sm);
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--cobalt);
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.5rem;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 650;
  border: 0;
  border-radius: var(--radius-s);
  cursor: pointer;
}
.btn-primary { background: var(--cobalt); color: var(--on-cobalt); }
.btn-primary:hover { background: var(--cobalt-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.65; cursor: progress; }
@media (prefers-color-scheme: dark) {
  /* Buttons keep the anchored cobalt fill in dark mode (AA with white). */
  .btn-primary { background: #2b55d8; color: #ffffff; }
  .btn-primary:hover { background: #3b66ea; }
}

/* ---- Cards & callouts ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: var(--s-5);
}
.callout {
  border-radius: var(--radius-m);
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  background: var(--surface);
}
.callout-error {
  border-left-color: var(--state-ai);
  background: var(--state-ai-bg);
  color: var(--state-ai);
}

/* ---- Hero + scan form ---- */
.hero { padding-block: var(--s-6) var(--s-6); }
.hero-inner { max-width: 54rem; text-align: center; }
.hero-sub {
  max-width: 58ch;
  margin-inline: auto;
  color: var(--muted);
  font-size: var(--text-lg);
  margin-bottom: var(--s-5);
}
.hero .result-card, .hero .callout { text-align: left; }
#scan-input {
  display: block;
  width: 100%;
  text-align: left;
  min-height: 13rem;
  padding: var(--s-4);
  font: inherit;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  resize: vertical;
}
#scan-input::placeholder { color: var(--muted); opacity: 1; }
#scan-input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 0;
  border-color: var(--focus);
}
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-3);
}
/* One family for the whole counter line (measured numbers + their caption)
   — no mid-line mono/sans mix. */
.action-bar-info {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
}
@media (max-width: 30rem) {
  /* Keep the primary action above the 375x667 fold: compact hero, shorter
     paste box, button first in the bar. */
  .hero { padding-block: var(--s-4) var(--s-5); }
  .hero-sub { font-size: var(--text-base); margin-bottom: var(--s-4); }
  /* rows= sets the intrinsic height; cap it here so the button stays above
     the fold (the box remains user-resizable). */
  #scan-input { min-height: 0; height: 10rem; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .action-bar-info { order: 2; text-align: center; }
  .action-bar .btn { order: 1; width: 100%; padding-block: 0.8rem; }
  /* The mode switch must not push the primary action below the fold. */
  .mode-switch { margin-bottom: var(--s-3); padding: 2px; }
  .mode-tab { padding-block: var(--s-1); }
}

/* ---- Mode switch (check text / check a file) ---- */
.mode-switch {
  display: inline-flex;
  gap: 0;
  margin-bottom: var(--s-4);
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}
.mode-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--s-2) var(--s-4);
  border-radius: calc(var(--radius-m) - 3px);
  cursor: pointer;
}
.mode-tab:hover { color: var(--ink); }
.mode-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(16, 24, 42, 0.12);
}

/* ---- File dropzone (provenance check) ---- */
.dropzone {
  position: relative;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-m);
  transition: border-color 120ms ease, background 120ms ease;
}
.dropzone.is-dragover,
.dropzone:hover { border-color: var(--cobalt); }
.dropzone.is-dragover { background: var(--surface-2); }
/* The real input stays focusable (keyboard path); paint its focus ring on
   the zone. */
.dropzone-input {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.dropzone:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.dropzone-label {
  display: block;
  padding: var(--s-6) var(--s-4);
  cursor: pointer;
  color: var(--ink);
}
.dropzone-hint {
  display: block;
  margin-top: var(--s-2);
  color: var(--muted);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}
.prov-progress {
  display: block;
  height: 6px;
}
/* display:block above would defeat the hidden attribute (class and
   attribute selectors tie on specificity; author styles beat the UA sheet),
   so hide explicitly. */
.prov-progress[hidden] { display: none; }
.prov-progress {
  margin-top: var(--s-3);
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.prov-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cobalt);
  transition: width 120ms ease;
}

/* Provenance outcome tones (same instrument language as the verdict). */
.prov-outcome[data-outcome="verified"] { color: var(--state-ok); }
.prov-outcome[data-outcome="verified"]::before { background: var(--state-ok); }
.prov-outcome[data-outcome="failed"] { color: var(--state-ai); }
.prov-outcome[data-outcome="failed"]::before { background: var(--state-ai); }
.prov-outcome[data-outcome="hint"] { color: var(--state-warn); }
.prov-outcome[data-outcome="hint"]::before { background: var(--state-warn); }
.prov-outcome[data-outcome="none"] { color: var(--muted); }
.prov-outcome[data-outcome="none"]::before { background: var(--muted); }
.module-outcome { text-align: left; }
.module-outcome .verdict { margin-top: var(--s-2); }

/* ---- Result instrument panel ---- */
#scan-live .result-card { margin-top: var(--s-5); padding: var(--s-4); }
#prov-live .result-card { margin-top: var(--s-5); padding: var(--s-4); text-align: left; }
.result-eyebrow {
  margin-bottom: var(--s-3);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: var(--s-3);
}
@media (max-width: 48rem) {
  .panel-grid { grid-template-columns: 1fr; }
}
.module {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s-4);
  background: var(--surface);
}
.module-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  min-width: 0;
}
.module-stack .module-context { flex: 1; }
.module-title {
  margin-bottom: var(--s-3);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.module-footnote {
  margin: var(--s-3) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Gauge module: the dial dominates; reading + verdict + explanation below. */
.module-gauge { text-align: center; }
.gauge-figure { margin: 0; }
.gauge { max-width: 21rem; margin-inline: auto; }
.gauge-svg { display: block; width: 100%; height: auto; }
.gauge-zone {
  fill: none;
  stroke-width: 13;
  stroke-linecap: butt;
}
.zone-human { stroke: var(--band-low); }
.zone-abstain { stroke: var(--band-elevated); }
.zone-ai { stroke: var(--band-high); }
.zone-neutral { stroke: var(--surface-2); }
.gauge-zone-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 6.5px;
  letter-spacing: 0.08em;
}
/* Dark scheme: --muted reads low beside the amber abstention arc (closing-
   pass minor m5); the zone names take full ink contrast there. */
@media (prefers-color-scheme: dark) {
  .gauge-zone-label { fill: var(--ink); }
}
.gauge-tick { stroke: var(--muted); stroke-width: 1; }
.gauge-tick-label {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
}
.gauge-needle {
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
}
.gauge-hub { fill: var(--ink); }
.gauge-reading { margin: var(--s-2) 0 var(--s-3); }
.gauge-value {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.gauge-caption {
  display: block;
  font-size: var(--text-xs);
  color: var(--muted);
}
.verdict {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  margin-bottom: var(--s-2);
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.verdict::before {
  content: "";
  flex: none;
  width: 0.7em; height: 0.7em;
  border-radius: 50%;
  background: var(--muted);
}
.verdict[data-verdict="likely_ai"] { color: var(--state-ai); }
.verdict[data-verdict="likely_ai"]::before { background: var(--state-ai); }
.verdict[data-verdict="inconclusive"] { color: var(--state-warn); }
.verdict[data-verdict="inconclusive"]::before { background: var(--state-warn); }
.verdict[data-verdict="likely_human"] { color: var(--state-ok); }
.verdict[data-verdict="likely_human"]::before { background: var(--state-ok); }
.verdict-explain {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: left;
}
/* Input-quality caveat under the verdict (e.g. grossly repetitive text);
   copy comes verbatim from the scan response's typed caveats. Muted text
   with a warn-toned rule keeps AA contrast in both schemes. */
.scan-caveats {
  margin: var(--s-2) 0 0;
  padding: var(--s-2) var(--s-3);
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: left;
  border-left: 3px solid var(--state-warn);
}

/* Verdict-context module: per-tier measured rates, current tier emphasized. */
.context-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
  color: var(--muted);
}
.context-row {
  padding: var(--s-2) var(--s-3);
  border-left: 3px solid var(--line);
  margin-bottom: var(--s-2);
}
.context-row:last-child { margin-bottom: 0; }
.context-row strong { color: var(--ink); }
.context-row.is-current {
  border-left-color: var(--cobalt);
  background: var(--surface-2);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--ink);
}

/* Stat grids (sample module + technical module). */
.stat-grid {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s-1) var(--s-4);
  margin: 0;
  font-size: var(--text-sm);
}
.stat-grid dt { color: var(--muted); }
.stat-grid dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  align-self: center;
  overflow-wrap: anywhere;
}
/* At phone widths the two-column grid squeezes long values (e.g. the full
   engine display name) into a words-per-line sliver (closing-pass minor m3):
   stack each label above its value instead. */
@media (max-width: 30rem) {
  .stat-grid { grid-template-columns: minmax(0, 1fr); }
  .stat-grid dt:not(:first-child) { margin-top: var(--s-2); }
}
/* Provider-watermark disclosure line in the technical module (F28). */
.tech-provenance-note {
  margin: var(--s-3) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}

/* Inspector module. */
.module-inspector { margin-top: var(--s-3); }
.inspector-hint {
  margin: calc(-1 * var(--s-2)) 0 var(--s-3);
  font-size: var(--text-xs);
  color: var(--muted);
}
.signal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block: var(--s-3);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 550;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: var(--on-cobalt);
}
@media (prefers-color-scheme: dark) {
  .chip[aria-pressed="true"] { background: #2b55d8; border-color: #2b55d8; color: #ffffff; }
}
.chip-count { font-family: var(--font-mono); opacity: 0.75; }
.chip-none {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--muted);
}
.chip-status {
  margin: 0 0 var(--s-3);
  font-size: var(--text-xs);
  color: var(--muted);
}
.inspector-text {
  max-height: 17rem;
  overflow-y: auto;
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--bg);
  font-size: var(--text-sm);
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
/* Band marks: tint + a non-color cue (underline style) per band. */
.inspector-text mark.seg { color: var(--ink); background: transparent; }
.seg-low {
  border-bottom: 2px solid var(--band-low);
}
.seg-elevated {
  background: var(--state-warn-bg);
  border-bottom: 2px dashed var(--band-elevated);
}
.seg-high {
  background: var(--state-ai-bg);
  border-bottom: 3px solid var(--band-high);
}
.inspector-text mark.seg-elevated { background: var(--state-warn-bg); }
.inspector-text mark.seg-high { background: var(--state-ai-bg); }
.inspector-text.filtering .seg:not(.seg-hit),
.inspector-text.filtering .seg-gap { opacity: 0.35; }
.inspector-text.filtering .seg-hit {
  opacity: 1;
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

/* Technical module (collapsible). */
.module-tech { margin-top: var(--s-3); }
.module-tech summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--muted);
}
.module-tech summary:hover { color: var(--ink); }
.module-tech[open] summary { margin-bottom: var(--s-3); }

/* Caveats: honest-limits block closing the panel. */
.result-caveats {
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
}
.result-caveat, .result-disclosure {
  margin: 0 0 var(--s-2);
  font-size: var(--text-xs);
  color: var(--muted);
}
.result-disclosure { margin-bottom: 0; }
.error { font-size: var(--text-sm); margin-top: var(--s-4); }

/* ---- Band strip (inspector minimap) ---- */
.band-strip {
  display: flex;
  gap: 2px;
  height: 0.875rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}
.band { display: inline-block; height: 100%; }
.band-low { background: var(--band-low); }
.band-elevated { background: var(--band-elevated); }
.band-high { background: var(--band-high); }
.band-legend {
  display: flex;
  gap: var(--s-4);
  margin: var(--s-2) 0 0;
  font-size: var(--text-xs);
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: var(--s-1); }
.legend-chip {
  width: 0.7rem; height: 0.7rem;
  border-radius: 3px;
}
.chip-low { background: var(--band-low); }
.chip-elevated { background: var(--band-elevated); }
.chip-high { background: var(--band-high); }

/* ---- Verdict honesty ---- */
.verdict-honesty { margin-block: var(--s-6); }
.verdict-honesty .section-title { font-size: var(--text-lg); }
.honesty-list {
  margin: 0;
  padding-left: 1.2rem;
}
.honesty-list li { margin-bottom: var(--s-3); }
.honesty-list li:last-child { margin-bottom: 0; }

/* ---- Value sections ---- */
.values { padding-block: var(--s-6); }
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
}
@media (max-width: 56rem) {
  .values-grid { grid-template-columns: 1fr; }
}
.value-card h2 { font-size: var(--text-lg); }
.value-card p { color: var(--muted); font-size: var(--text-sm); }
.text-link { font-weight: 600; font-size: var(--text-sm); }

/* ---- Use-case guide links (landing "checking something specific?") ---- */
.usecases { padding-block: 0 var(--s-6); }
.usecase-links {
  list-style: none;
  margin: var(--s-4) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}
@media (max-width: 56rem) {
  .usecase-links { grid-template-columns: 1fr; }
}
.usecase-links a {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s-3) var(--s-4);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
}
.usecase-links a:hover { border-color: var(--muted); }

/* ---- How it works ---- */
.how { padding-block: var(--s-6) var(--s-7); }
.how-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-5);
  margin: var(--s-5) 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
@media (max-width: 56rem) {
  .how-steps { grid-template-columns: 1fr; }
}
.how-steps li {
  counter-increment: step;
  color: var(--muted);
  font-size: var(--text-sm);
}
.how-steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--cobalt);
}
.how-steps strong { color: var(--ink); }

/* ---- Adapter status ---- */
.adapter-status { padding-block: 0 var(--s-8); }
.status-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--s-4);
  margin: var(--s-4) 0 0;
  padding: 0;
  list-style: none;
}
.status-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-4) var(--s-5);
}
.status-provider { font-weight: 700; }
.state {
  align-self: flex-start;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.state-live { color: var(--state-ok); background: var(--state-ok-bg); }
.state-announced { color: var(--state-warn); background: var(--state-warn-bg); }
.state-unavailable { color: var(--muted); background: var(--surface-2); }
.status-note { color: var(--muted); font-size: var(--text-sm); }

/* ---- Article (education pages) ---- */
.article {
  max-width: calc(var(--measure) + 2 * clamp(1rem, 4vw, 1.5rem));
  padding-block: var(--s-7) var(--s-8);
}
.article-header { margin-bottom: var(--s-6); }
.article-lede {
  font-size: var(--text-lg);
  color: var(--muted);
  margin: 0;
}
.article-body h2, .article-sources h2, .article-changelog h2 {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  margin-block: var(--s-4);
}
.article-body th, .article-body td {
  text-align: left;
  padding: var(--s-2) var(--s-3);
  border-bottom: 1px solid var(--line);
}
.article-body th { font-weight: 650; }
.article-body blockquote {
  margin: var(--s-4) 0;
  padding: var(--s-3) var(--s-5);
  border-left: 3px solid var(--cobalt);
  background: var(--surface);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  color: var(--muted);
}
.article-body code, .article-changelog time {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
.article-body code {
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.article-body pre {
  background: var(--surface-2);
  padding: var(--s-4);
  border-radius: var(--radius-m);
  overflow-x: auto;
}
.article-body pre code { background: none; padding: 0; }
.article-body sup a { text-decoration: none; font-weight: 600; }
.sources-list, .article-sources ol {
  padding-left: 1.4rem;
  font-size: var(--text-sm);
  color: var(--muted);
}
.sources-list li { margin-bottom: var(--s-2); }
/* Long unbroken citation URLs must wrap instead of forcing horizontal page
   overflow at narrow viewports (375px). */
.sources-list a,
.article-sources a { overflow-wrap: anywhere; }
.changelog {
  margin: 0;
  padding: 0;
  list-style: none;
}
.changelog li {
  display: flex;
  gap: var(--s-4);
  padding-block: var(--s-2);
  font-size: var(--text-sm);
}
.changelog time {
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding-top: 0.15em;
}
.changelog span { color: var(--muted); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s-6) var(--s-5);
  color: var(--muted);
  font-size: var(--text-sm);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.footer-brand { max-width: 34rem; }
.wordmark-footer { color: var(--ink); font-size: 1.1rem; }
.wordmark-footer .wordmark-mark img { height: 20px; }
.footer-tagline { margin: var(--s-2) 0 var(--s-2); }
.footer-disclosure { font-size: var(--text-xs); margin: 0; }
.footer-nav {
  display: flex;
  gap: var(--s-6);
  flex-wrap: wrap;
}
.footer-group {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.footer-group-title {
  margin: 0 0 var(--s-1);
  font-size: var(--text-xs);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.footer-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-block: var(--s-1);
}
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-meta {
  margin-top: var(--s-6);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: var(--text-xs);
}

/* ---- Article extras (published education content) ---- */
.article-meta {
  display: flex;
  gap: var(--s-2);
  margin: var(--s-3) 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
/* Spot illustration: a restrained text-first aside, never a banner. */
.article-hero {
  margin: 0 0 var(--s-5);
  max-width: 22rem;
}
.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: #ffffff;
}
@media (prefers-color-scheme: dark) {
  /* The spots have solid white backgrounds; in dark mode present them as a
     deliberate card (padding + hairline) and soften the whole container —
     brightness filter dims the baked-in white so the card no longer glares
     on an otherwise dark page. */
  .article-hero img {
    padding: var(--s-3);
    border-color: var(--line);
    box-shadow: 0 1px 2px rgb(0 0 0 / 40%);
    filter: brightness(0.78) contrast(1.04);
  }
}
.article-toc {
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--s-3) var(--s-4);
  font-size: var(--text-sm);
  margin-bottom: var(--s-5);
}
.article-toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-4);
  margin: 0;
  padding: 0;
}
.article-toc a { text-decoration: none; }
.article-toc a:hover { text-decoration: underline; }

/* ---- Breadcrumbs (use-case guides) ---- */
.breadcrumbs {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--s-4);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0;
  padding: 0;
}
.breadcrumbs li + li::before {
  content: "\203A";
  margin-right: var(--s-2);
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }

/* ---- FAQ groups (the /faq page and per-guide question blocks) ---- */
.faq-item { margin-top: var(--s-5); }
.faq-item h3 { margin: 0 0 var(--s-2); }
.faq-item p { margin: 0; }
.table-scroll { overflow-x: auto; }
.article-body .cite { text-decoration: none; font-size: 0.85em; }
.article-body .cite:hover { text-decoration: underline; }
.article-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
}
.article-cta p { margin: 0; color: var(--muted); }

/* ---- Scan queue panel (202 flow) ----
   Honest wait state: position + measured ETA, updated in place by scan.js.
   Works in both color schemes via the shared surface tokens; the spinner is
   decorative (aria-hidden) and disabled under prefers-reduced-motion. */
.queue-card { margin-top: var(--s-5); text-align: left; }
.queue-card[hidden] { display: none; }
.queue-title {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin: 0 0 var(--s-3);
  font-weight: 600;
}
.queue-spinner {
  width: 1em;
  height: 1em;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--cobalt, currentColor);
  animation: queue-spin 1s linear infinite;
}
@keyframes queue-spin { to { transform: rotate(360deg); } }
.queue-position { margin: 0 0 var(--s-2); }
.queue-eta { margin: 0 0 var(--s-3); }
.queue-note { margin: 0; color: var(--muted); font-size: 0.9em; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
