/* Theme tokens — light is the base; dark overrides under both the OS media
   query and the explicit toggle, so the toggle wins in both directions. */
:root {
  color-scheme: light;
  /* Warm "book" neutrals: paper-ivory grounds, warm near-black ink (never pure
     white/black), a single coral accent used sparingly. Contrast verified WCAG
     AA: ink 17.5:1, --ink-2 6.3:1, --accent-ink links 5.6:1. Active controls
     use the higher-contrast --accent-fill/--on-accent pair. Chart series stay
     the dataviz-validated blue/orange —
     they read cleanly on ivory and keep their colorblind-safe separation. */
  --page: #f4f2ec;
  --surface: #faf9f5;
  --ink: #141413;
  --ink-2: #5e5d59;
  --muted: #a4a299;
  --grid: #e6e3d9;
  --baseline: #d1cfc5;
  --border: rgba(20, 20, 19, 0.12);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --accent: #c6613f;
  --accent-ink: #a8451d;
  --accent-fill: #a8451d;
  --on-accent: #faf9f5;
  --good: #4f7a3a;
  --good-text: #3d6b28;
  --critical: #c0392b;
  --star: #c98a2e;
  --wash: rgba(198, 97, 63, 0.08);
  --shadow: 0 10px 34px rgba(20, 20, 19, 0.12);
  /* --muted is decorative (axis ticks, borders-adjacent chrome); --muted-text
     is for readable secondary copy and meets WCAG AA (>=4.5:1) on --surface. */
  --muted-text: #6b6960;
}
/* The dark token set appears twice on purpose: once under the OS preference
   (media query) and once under the explicit data-theme toggle. CSS custom
   properties can't be grouped across a media query and an attribute selector
   in one rule without nesting/mixin machinery — plain CSS keeps the file
   dependency-free, so the duplication is the honest cost. Keep both blocks
   in sync when editing tokens. */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme='light'])) {
    color-scheme: dark;
    --page: #131210;
    --surface: #1f1e1c;
    --ink: #faf9f5;
    --ink-2: #c6c4ba;
    --muted: #86847c;
    --grid: #302e2a;
    --baseline: #3c3a35;
    --border: rgba(250, 249, 245, 0.12);
    --series-1: #3987e5;
    --series-2: #d95926;
    --accent: #d97757;
    --accent-ink: #e8a07f;
    --accent-fill: #d97757;
    --on-accent: #141413;
    --good: #6fae52;
    --good-text: #7fbf62;
    --critical: #e0685a;
    --star: #d1a24f;
    --wash: rgba(217, 119, 87, 0.16);
    --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
    --muted-text: #a8a69c;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #131210;
  --surface: #1f1e1c;
  --ink: #faf9f5;
  --ink-2: #c6c4ba;
  --muted: #86847c;
  --grid: #302e2a;
  --baseline: #3c3a35;
  --border: rgba(250, 249, 245, 0.12);
  --series-1: #3987e5;
  --series-2: #d95926;
  --accent: #d97757;
  --accent-ink: #e8a07f;
  --accent-fill: #d97757;
  --on-accent: #141413;
  --good: #6fae52;
  --good-text: #7fbf62;
  --critical: #e0685a;
  --star: #d1a24f;
  --wash: rgba(217, 119, 87, 0.16);
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  --muted-text: #a8a69c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15.5px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
img, svg { max-width: 100%; }
a { color: var(--accent-ink); }
code {
  font: 0.85em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--wash);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0.4em 0; }
h2 { font-size: 22px; }
h3 { font-size: 16.5px; }
.sub { color: var(--muted-text); font-size: 13.5px; }
.sub code { color: var(--ink); }
button { font: inherit; }

/* ---------- app header ---------- */
header.app {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand-block { display: flex; flex-direction: column; line-height: 1.15; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: 0.01em; }
.unofficial { font-size: 11px; color: var(--muted-text); letter-spacing: 0.04em; }
.spacer { flex: 1; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  border: 1px solid transparent; background: none; color: var(--ink-2);
  padding: 7px 13px; border-radius: 999px; cursor: pointer; font-size: 14.5px;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { background: var(--wash); color: var(--ink); }
.tab.active { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; }
.ghost-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 13px; cursor: pointer; font-size: 14px;
}
.ghost-btn:hover { background: var(--wash); }

/* ---------- layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 18px 20px 60px; }
/* View fade lives on .view-enter (not .view) so switching tabs can re-trigger
   it: app.js removes the class, forces a reflow, and adds it back (M15). */
.view-enter { animation: viewin 0.25s ease; }
@keyframes viewin { from { opacity: 0; transform: translateY(4px); } }
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; margin: 14px 0;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.badge {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--ink-2);
}
.badge.deadline { border-color: color-mix(in srgb, var(--series-2) 40%, transparent); }
.badge.deadline.past { border-color: var(--border); color: var(--muted-text); }
.pill {
  display: inline-block; border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 9px; font-size: 12px; color: var(--ink-2); white-space: nowrap;
}
.pill-20x { border-color: var(--series-2); color: var(--series-2); font-weight: 600; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 14px 0; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tile-accent { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.tile-value { font-size: 34px; font-weight: 750; }
.tile-label { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.tile-note { color: var(--muted-text); font-size: 12.5px; margin-top: 2px; }

/* ---------- pulse ---------- */
.pulse-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: start; }
.pulse-side { display: flex; flex-direction: column; }
.live-dot {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  background: var(--good); margin-right: 4px; animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
#activity-stream { list-style: none; margin: 6px 0 0; padding: 0; }
#activity-stream li {
  display: grid; grid-template-columns: 64px 22px 1fr; gap: 8px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--grid); font-size: 14px;
}
.feed-date { color: var(--muted-text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.feed-icon { text-align: center; }
.feed-what { min-width: 0; }

.watch { border-left: 3px solid var(--star); }
.watch.changed { border-left-color: var(--accent); }
.watch .ghost-btn { margin-left: 8px; }
.watch-diff {
  /* rendered as a <button>: reset UA button chrome, keep the card look */
  display: block; width: 100%; text-align: left; font: inherit;
  background: none; color: inherit;
  padding: 7px 10px; margin-top: 8px; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.watch-diff:hover { background: var(--wash); }
.watch-name { font-weight: 650; margin-right: 6px; }

/* ---------- stars ---------- */
.star {
  border: none; background: none; cursor: pointer; font-size: 18px;
  color: var(--muted); padding: 2px 6px; border-radius: 6px; line-height: 1;
  transition: transform 0.12s;
}
.star:hover { transform: scale(1.25); }
.star.starred { color: var(--star); }

/* ---------- services ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.toolbar input[type='search'], .toolbar select {
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px; font-size: 14.5px;
}
.toolbar input[type='search'] { flex: 1; min-width: 200px; }
.chk { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink-2); }
#svc-list { border-top: 1px solid var(--grid); }
/* Each list entry is a flex wrapper: a star <button> + a .svc-row <button>. */
.svc-item { display: flex; align-items: center; border-bottom: 1px solid var(--grid); }
.svc-item > .star { flex: 0 0 auto; }
.svc-item > .svc-row { flex: 1; border-bottom: none; }
.svc-row {
  display: grid; grid-template-columns: 34px 1fr auto auto 64px; gap: 10px; align-items: center;
  padding: 9px 4px; border-bottom: 1px solid var(--grid); cursor: pointer;
  /* rendered as a <button>: reset UA button chrome */
  width: 100%; text-align: left; font: inherit; background: none; border-left: none;
  border-right: none; border-top: none; color: inherit;
}
.svc-item > .svc-row { grid-template-columns: 1fr auto auto 64px; }
.svc-row:hover { background: var(--wash); }
.svc-name { min-width: 0; }
.svc-name strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-name span { color: var(--muted-text); font-size: 12.5px; }
.svc-reuse { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13.5px; }
#svc-more, #refresh-live, #ksi-export, #ksi-reset {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: 14px;
}
#svc-more:hover, #refresh-live:hover:not(:disabled), #ksi-export:hover, #ksi-reset:hover { background: var(--wash); }

/* ---------- drawers ---------- */
#drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40;
}
#svc-drawer, #explainer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(480px, 94vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 18px 22px 40px;
  transform: translateX(30px); opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
#svc-drawer.open, #explainer.open { transform: none; opacity: 1; }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; }
.drawer-head h2 { margin: 0; font-size: 20px; flex: 1; }
.drawer-head > div { flex: 1; }
.close-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-2);
  border-radius: 8px; padding: 4px 9px; cursor: pointer;
}
.myth { border-left: 3px solid var(--series-2); padding: 6px 10px; margin: 8px 0; font-size: 14px; }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 10px 0; padding: 0 0 0 4px; border-left: 2px solid var(--grid); }
.timeline li { position: relative; padding: 0 0 12px 16px; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--baseline); border: 2px solid var(--surface);
}
.timeline li.tl-now::before { background: var(--accent); }
.tl-date { display: block; color: var(--muted-text); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl-status { font-size: 14.5px; }
.agency-list { columns: 2; margin: 6px 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv td, .kv th { padding: 6px 8px 6px 0; border-top: 1px solid var(--grid); vertical-align: top; }
.kv td:first-child, .kv th[scope='row'] { color: var(--muted-text); white-space: nowrap; font-weight: 400; text-align: left; }

/* ---------- agencies ---------- */
.agency-grid { display: grid; grid-template-columns: minmax(230px, 1fr) 1.6fr; gap: 14px; align-items: start; }
#ag-list { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.ag-row {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 8px 11px; cursor: pointer; font-size: 13.5px;
}
.ag-row:hover { background: var(--wash); }
.ag-row.active { border-color: var(--accent); background: var(--wash); }
.ag-counts { color: var(--muted-text); font-size: 12px; }
.svc-mini-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 8px 0; }
.svc-mini {
  text-align: left; border: 1px solid var(--border); background: var(--page);
  border-radius: 8px; padding: 7px 10px; cursor: pointer; color: var(--ink);
}
.svc-mini:hover { background: var(--wash); }
.svc-mini strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svc-mini span { color: var(--muted-text); font-size: 11.5px; }

/* ---------- compare table (explainer) ---------- */
.compare { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.compare th, .compare td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--grid); vertical-align: top; }
.compare th { color: var(--muted-text); font-weight: 600; }
.compare td:first-child, .compare th[scope='row'] { color: var(--muted-text); white-space: nowrap; }

/* ---------- charts ---------- */
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin: 6px 0; }
.legend .swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.swatch.s1 { background: var(--series-1); }
.swatch.s2 { background: var(--series-2); }
svg .grid { stroke: var(--grid); stroke-width: 1; }
svg .baseline { stroke: var(--baseline); stroke-width: 1; }
svg .tick { fill: var(--muted); font-size: 11px; font-family: system-ui, sans-serif; }
svg .direct-label { fill: var(--ink); font-size: 12px; font-weight: 700; font-family: system-ui, sans-serif; }
svg .series-1 { fill: var(--series-1); }
svg .series-2 { fill: var(--series-2); }
.chart-tip {
  position: fixed; right: 12px; bottom: 12px; z-index: 50; pointer-events: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); max-width: 260px;
}
.chart-tip[hidden] { display: none; }
.barlist-row { display: grid; grid-template-columns: minmax(140px, 38%) 1fr; gap: 10px; align-items: center; padding: 5px 0; }
.barlist-row.clickable { cursor: pointer; }
.barlist-row.clickable:hover { background: var(--wash); }
.barlist-label { display: flex; flex-direction: column; min-width: 0; }
.barlist-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barlist-sub { font-size: 12px; color: var(--muted-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barlist-track { display: flex; align-items: center; gap: 8px; }
.barlist-bar { appearance: none; width: 100%; height: 14px; border: 0; border-radius: 4px; background: transparent; }
.barlist-bar::-webkit-progress-bar { background: var(--grid); border-radius: 4px; }
.barlist-bar::-webkit-progress-value { background: var(--series-1); border-radius: 4px; }
.barlist-bar::-moz-progress-bar { background: var(--series-1); border-radius: 4px; }
.barlist-value { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.method summary { cursor: pointer; font-weight: 600; }
.provenance { margin: 8px 0 12px; font-size: 13px; }
.provenance summary { cursor: pointer; font-weight: 600; }
.provenance-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0; }
.provenance-list dt { color: var(--muted-text); }
.provenance-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }

/* ---------- KSI ---------- */
#ksi-explorer { display: grid; grid-template-columns: 250px 1fr; gap: 16px; }
#ksi-families { display: flex; flex-direction: column; gap: 6px; }
.ksi-fam {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center;
  text-align: left; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: 13.5px;
}
.ksi-fam.active { border-color: var(--accent); background: var(--wash); }
.ksi-fam-id { font-weight: 700; color: var(--accent-ink); }
.ksi-fam-count { color: var(--muted-text); font-variant-numeric: tabular-nums; }
#ksi-detail { min-width: 0; }
.ksi-ind {
  display: flex; gap: 10px; padding: 12px; border: 1px solid var(--border);
  border-radius: 10px; margin: 10px 0; background: var(--surface); cursor: pointer;
}
.ksi-ind input { margin-top: 4px; accent-color: var(--accent); }
.ksi-ind-body { display: block; min-width: 0; }
.ksi-ind-head { display: block; margin-bottom: 3px; }
.ksi-ind-statement { display: block; color: var(--ink-2); font-size: 14px; }
.ksi-classes { color: var(--muted-text); font-size: 13px; margin: 6px 0 0; }
.ksi-ind-controls { display: block; margin-top: 6px; color: var(--muted-text); font-size: 12.5px; }
.ksi-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
#ksi-ring-wrap { position: relative; width: 64px; height: 64px; }
#ksi-ring-wrap svg { transform: rotate(-90deg); }
#ksi-ring { fill: none; stroke: var(--accent); stroke-width: 7; stroke-linecap: round; transition: stroke-dasharray 0.3s; }
#ksi-ring-bg { fill: none; stroke: var(--grid); stroke-width: 7; }
#ksi-ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
#ksi-meta { color: var(--muted-text); font-size: 13px; }
@keyframes celebrate { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1); } }
.celebrate #ksi-ring-wrap { animation: celebrate 0.7s ease; }
.celebrate #ksi-ring { stroke: var(--good); }

/* ---------- citations & footer ---------- */
a.cite {
  font-size: 11px; vertical-align: super; text-decoration: none;
  color: var(--accent-ink); font-weight: 700; padding: 0 1px;
}
footer { border-top: 1px solid var(--border); padding: 20px; color: var(--muted-text); font-size: 13px; text-align: center; }

/* ---------- focus visibility (keyboard a11y) ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.tab:focus-visible, .ghost-btn:focus-visible, .pill:focus-visible { border-radius: 999px; }

/* ---------- screen-reader utilities ---------- */
/* Visually hidden, still read by screen readers (WebAIM clip pattern). */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
/* Skip link: first focusable element; hidden until keyboard focus lands on it. */
.skip-link {
  position: absolute;
  top: -48px;
  left: 8px;
  z-index: 200;
  background: var(--ink);
  color: var(--page);
  padding: 8px 14px;
  border-radius: 0 0 8px 8px;
  font-size: 14px;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ---------- header nav links (learn/about) ---------- */
.header-nav { display: flex; align-items: center; gap: 14px; }
.header-link {
  color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 6px 8px;
}
.header-link:hover { color: var(--accent-ink); text-decoration: underline; }
.plain-link { text-decoration: none; color: inherit; }

/* ---------- error & empty states ---------- */
.view-error {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--critical); border-radius: 12px;
  padding: 14px 16px; margin: 14px 0; color: var(--muted-text); font-size: 14px;
}
.chart-empty { color: var(--muted-text); font-size: 13px; margin: 8px 0; }

/* ---------- learn page ---------- */
main.learn, main.about { max-width: 820px; }
.hero h1 { font-size: clamp(28px, 5vw, 40px); margin: 0.3em 0; }
.lede { font-size: 18px; color: var(--ink-2); max-width: 62ch; }
.section-kicker {
  display: flex; align-items: baseline; gap: 10px; margin-top: 34px;
  color: var(--muted-text); font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase;
}
.section-kicker .min { font-weight: 600; color: var(--accent-ink); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; margin: 16px 0; }
.role-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.role-card h3, .role-card h4 { margin: 0 0 6px; font-size: 1em; }
.role-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
.role-card .aka { color: var(--muted-text); font-size: 12.5px; }
.table-scroll { overflow-x: auto; }
.hedge { font-weight: 400; color: var(--muted-text); }
.m0 { margin: 0; }
.timeline li.tl-done::before { background: var(--accent); }

/* ---------- quiz (learn page checkpoints) ---------- */
.quiz { border-left: 3px solid var(--accent); }
.quiz-q { font-weight: 600; }
.quiz button[data-opt] {
  display: block; width: 100%; text-align: left; margin: 6px 0; padding: 9px 12px;
  background: var(--page); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-size: 14.5px;
}
.quiz button[data-opt]:hover:not(:disabled) { background: var(--wash); }
.quiz button.correct { border-color: var(--good); box-shadow: inset 3px 0 0 var(--good); }
.quiz button.incorrect { border-color: var(--critical); box-shadow: inset 3px 0 0 var(--critical); }
.quiz-explain { color: var(--ink-2); font-size: 14px; }
.quiz-explain::before {
  content: '✓ ';
  content: '✓ ' / ''; /* alt-text syntax: decorative for AT; first line is the fallback */
  color: var(--good-text);
  font-weight: 700;
}

/* ---------- class picker (learn page) ---------- */
#class-picker .picker-options { display: flex; flex-wrap: wrap; gap: 8px; }
#class-picker button[data-pick] {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-size: 14px;
}
#class-picker button[data-pick]:hover { background: var(--wash); }
#class-picker button.active { border-color: var(--accent); background: var(--wash); }
.picker-card { margin-top: 14px; }
.picker-card h3, .picker-card h4 { margin-top: 0; }

/* ---------- sources / about ---------- */
#source-list { font-size: 14px; }
#source-list li { margin: 8px 0; }
#source-list li:target { background: var(--wash); border-radius: 6px; }
.src-url { display: block; color: var(--muted-text); font-size: 12px; word-break: break-all; }
.unverified-panel { border-left: 3px solid var(--series-2); }

/* ---------- motion & small screens ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) {
  .pulse-grid, .agency-grid, #ksi-explorer { grid-template-columns: 1fr; }
  .svc-row { grid-template-columns: 30px 1fr auto; }
  .svc-item > .svc-row { grid-template-columns: 1fr auto; }
  .svc-row .pill:nth-of-type(2), .svc-row .svc-reuse { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .compare { font-size: 12.5px; }
  .hero h1 { font-size: 26px; }
  .lede { font-size: 16px; }
  header.app { gap: 8px; padding: 8px 12px; }
  .tabs { order: 3; width: 100%; }
  main { padding: 12px 12px 60px; }
  .agency-list { columns: 1; }
}
