/* Cryptos Speedtest - dark-first, light via prefers-color-scheme */
:root {
  color-scheme: dark;
  --bg: #0a0c10;
  --surface: #11141a;
  --surface-2: #171b22;
  --raised: #1d222b;
  --ink: #eef1f5;
  --ink-2: #b3bac5;
  --muted: #7d8694;
  --line: #222832;
  --line-2: #2c333f;
  --accent: #3987e5;
  --accent-ink: #8ab8f2;
  --accent-wash: rgba(57, 135, 229, 0.14);
  --s1: #3987e5;   /* series 1 blue */
  --s2: #d95926;   /* series 2 orange */
  --s3: #199e70;   /* series 3 aqua */
  --s4: #c98500;   /* series 4 yellow */
  --ghost: #3a4250;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --seq-0: #184f95; --seq-1: #1c5cab; --seq-2: #256abf; --seq-3: #3987e5; --seq-4: #6da7ec;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 30px rgba(0,0,0,0.35);
  --radius: 10px;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 16px;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --raised: #e9ecf1;
    --ink: #0c0f14;
    --ink-2: #434a55;
    --muted: #6b7380;
    --line: #e0e3e8;
    --line-2: #cfd4db;
    --accent: #2a78d6;
    --accent-ink: #1f5fae;
    --accent-wash: rgba(42, 120, 214, 0.10);
    --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
    --ghost: #cdd3db;
    --seq-0: #b7d3f6; --seq-1: #86b6ef; --seq-2: #5598e7; --seq-3: #2a78d6; --seq-4: #1c5cab;
    --shadow: 0 1px 2px rgba(12,15,20,0.05), 0 8px 24px rgba(12,15,20,0.06);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #f1f3f6; --raised: #e9ecf1;
  --ink: #0c0f14; --ink-2: #434a55; --muted: #6b7380; --line: #e0e3e8; --line-2: #cfd4db;
  --accent: #2a78d6; --accent-ink: #1f5fae; --accent-wash: rgba(42, 120, 214, 0.10);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --ghost: #cdd3db;
  --seq-0: #b7d3f6; --seq-1: #86b6ef; --seq-2: #5598e7; --seq-3: #2a78d6; --seq-4: #1c5cab;
  --shadow: 0 1px 2px rgba(12,15,20,0.05), 0 8px 24px rgba(12,15,20,0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-stretch: 112%; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.mono, code { font-family: var(--font-mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 28px; } }

/* top bar */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1180px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.brand-mark { width: 18px; height: 18px; border-radius: 4px; background:
  linear-gradient(var(--accent), var(--accent)) 0 100% / 4px 40% no-repeat,
  linear-gradient(var(--accent), var(--accent)) 7px 100% / 4px 70% no-repeat,
  linear-gradient(var(--accent), var(--accent)) 14px 100% / 4px 100% no-repeat; }
.brand-name { font-family: var(--font-display); font-stretch: 118%; font-weight: 500; font-size: 15px; letter-spacing: 0.01em; }
.brand-name b { font-weight: 750; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 13.5px; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.nav a:hover, .nav a.active { color: var(--ink); background: var(--surface-2); }
.updated { color: var(--muted); font-size: 12px; white-space: nowrap; font-family: var(--font-mono); }
@media (max-width: 860px) { .updated { display: none; } }

/* sections */
.section { padding-block: 56px; border-top: 1px solid var(--line); }
.section.hero { border-top: 0; padding-top: 40px; }
.section-head { display: grid; gap: 6px; margin-bottom: 22px; }
.section-head h2 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 700; }
.section-sub { color: var(--ink-2); max-width: 68ch; }
.eyebrow { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 18px; }

/* hero */
.hero-grid { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: 1.45fr 1fr; gap: 40px; } }
.hero-figure { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: clamp(64px, 11vw, 132px); line-height: 0.9; letter-spacing: -0.035em; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.hero-unit { font-size: 0.26em; font-weight: 500; letter-spacing: 0; color: var(--ink-2); font-stretch: 100%; }
.hero-label { margin-top: 14px; font-size: 18px; font-weight: 500; }
.hero-context { margin-top: 4px; color: var(--ink-2); max-width: 62ch; }
.callouts { display: grid; gap: 14px; margin-top: 26px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .callouts { grid-template-columns: 1fr 1fr; } }
.callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 8px; align-content: start; }
.callout p { color: var(--ink-2); font-size: 14px; }
.callout-h { font-family: var(--font-body); font-stretch: 100%; font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); box-shadow: 0 0 0 0 rgba(250,178,25,0.5); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(250,178,25,0.45); } 70% { box-shadow: 0 0 0 8px rgba(250,178,25,0); } 100% { box-shadow: 0 0 0 0 rgba(250,178,25,0); } }
.refs { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.refs a { color: var(--muted); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tile { background: var(--surface); padding: 18px 18px 16px; display: grid; gap: 6px; align-content: start; min-height: 128px; }
.tile-value { font-family: var(--font-display); font-stretch: 115%; font-weight: 700; font-size: clamp(26px, 3.4vw, 34px); line-height: 1; letter-spacing: -0.02em; }
.tile-value small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; margin-left: 4px; }
.tile-label { color: var(--ink-2); font-size: 13px; }

/* panels & charts */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.chart-panel { margin: 28px 0 0; }
.panel-h { font-family: var(--font-display); font-stretch: 108%; font-size: 17px; font-weight: 650; }
.panel-sub { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; max-width: 80ch; }
.chart { margin-top: 12px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font: 11px var(--font-body); font-variant-numeric: tabular-nums; }
.chart .lbl-strong { fill: var(--ink-2); font-weight: 500; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis line, .chart .axis path { stroke: var(--line-2); }
.chart .hit { fill: transparent; cursor: pointer; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 2px; border-radius: 1px; width: 14px; }
.legend i.band { background: var(--accent-wash); border: 1px dashed var(--line-2); }
.chart-empty { color: var(--muted); font-size: 13px; padding: 12px 0; }

.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--raised); color: var(--ink); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.45; box-shadow: var(--shadow); max-width: 280px; }
.tooltip b { font-weight: 600; }
.tooltip .tt-k { color: var(--muted); }

/* filters & tabs */
.filters, .tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 500 13px var(--font-body); padding: 6px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.chip:hover { color: var(--ink); border-color: var(--muted); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.swatch { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line-2); margin-left: 6px; }
.tl-item { position: relative; padding-left: 22px; }
.tl-item::before { content: ""; position: absolute; left: -5px; top: 21px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--phase, var(--muted)); }
.tl-day { position: relative; padding: 18px 0 6px 22px; color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; list-style: none; }
.tl-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 8px; border: 1px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; }
.tl-row:hover { background: var(--surface); border-color: var(--line); }
.tl-time { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.tl-main { display: grid; gap: 3px; min-width: 0; }
.tl-title { font-weight: 600; font-size: 14.5px; }
.tl-label { font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink); margin-right: 8px; font-weight: 500; }
.tl-meta { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-right { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.tl-value { font-family: var(--font-display); font-stretch: 110%; font-weight: 650; font-size: 16px; white-space: nowrap; }
.tl-value small { font-family: var(--font-body); font-size: 11px; color: var(--muted); font-weight: 500; }
@media (max-width: 640px) {
  .tl-row { grid-template-columns: 44px minmax(0, 1fr); }
  .tl-right { grid-column: 2; justify-content: flex-start; }
  .tl-meta { white-space: normal; }
}

/* pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface-2); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.adopted::before, .pill.kept::before { background: var(--good); }
.pill.baseline::before { background: var(--accent); }
.pill.finding::before { background: var(--ink-2); }
.pill.not_adopted::before, .pill.no_effect::before { background: var(--serious); }
.pill.reverted::before, .pill.withdrawn::before { background: var(--critical); }
.pill.pending::before, .pill.in_progress::before { background: var(--warning); }
.pill.void::before, .pill.retracted::before, .pill.superseded::before { background: transparent; border: 1px solid var(--muted); }
.net { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); }

/* test details */
.phase-intro { margin: 34px 0 12px; display: grid; gap: 4px; }
.phase-intro:first-child { margin-top: 0; }
.phase-intro h3 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.phase-intro h3 .swatch { width: 10px; height: 10px; }
.phase-intro p { color: var(--ink-2); max-width: 80ch; }
.phase-intro .dates { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.test { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); margin-top: 10px; scroll-margin-top: 80px; }
.test[open] { border-color: var(--line-2); box-shadow: var(--shadow); }
.test > summary { list-style: none; cursor: pointer; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; }
.test > summary::-webkit-details-marker { display: none; }
.test-h { font-size: 16px; font-weight: 650; font-stretch: 105%; }
.test-sub { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-family: var(--font-mono); }
.test-sum-right { display: flex; align-items: center; gap: 12px; }
.chev { width: 18px; height: 18px; color: var(--muted); transition: transform .2s; flex: none; }
.test[open] .chev { transform: rotate(180deg); }
@media (max-width: 640px) { .test > summary { grid-template-columns: 1fr; } .test-sum-right { justify-content: space-between; } }
.test-body { padding: 4px 16px 18px; display: grid; gap: 18px; border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-top: 14px; }
.fact { background: var(--surface-2); padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.fact dt { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.fact dd { margin: 0; font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.prose { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 820px) { .prose { grid-template-columns: 1fr 1fr; } }
.prose h4, .block-h { font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 4px; font-family: var(--font-body); }
.prose p { color: var(--ink-2); max-width: 68ch; }
.verdict { border-left: 3px solid var(--muted); padding: 10px 14px; background: var(--surface-2); border-radius: 0 8px 8px 0; display: grid; gap: 6px; }
.verdict.adopted, .verdict.kept { border-color: var(--good); }
.verdict.baseline { border-color: var(--accent); }
.verdict.not_adopted { border-color: var(--serious); }
.verdict.reverted { border-color: var(--critical); }
.verdict.pending { border-color: var(--warning); }
.verdict p { color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .refs { white-space: nowrap; }
.sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hash { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.show-data { font-size: 12.5px; color: var(--ink-2); }
.show-data summary { cursor: pointer; color: var(--accent-ink); margin-top: 6px; }
.chart-block { display: grid; gap: 4px; }
.chart-title { font-weight: 600; font-size: 13.5px; }
.chart-note { color: var(--muted); font-size: 12px; }

/* heat table */
.heat { display: grid; gap: 2px; font-size: 12px; min-width: 420px; }
.heat-row { display: grid; grid-template-columns: minmax(120px, 1.4fr) repeat(5, minmax(52px, 1fr)); gap: 2px; align-items: stretch; }
.heat-h { color: var(--muted); font-size: 11px; text-align: center; padding: 4px 2px; }
.heat-h:first-child { text-align: left; }
.heat-name { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-2); padding: 6px 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.heat-cell { text-align: center; padding: 6px 2px; border-radius: 3px; font-variant-numeric: tabular-nums; font-weight: 600; cursor: default; }
.heat-scroll { overflow-x: auto; }

/* strategies */
.strategy-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.strategy { display: grid; grid-template-columns: 110px minmax(0, 1.2fr) minmax(0, 1.4fr) 128px; gap: 6px 18px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: start; }
.strategy:first-child { border-top: 0; }
.strategy-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.strategy-name { font-weight: 600; font-size: 14px; }
.strategy-area { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.strategy-effect { color: var(--ink-2); font-size: 13.5px; }
.strategy-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; }
.strategy-outcome { justify-self: end; }
@media (max-width: 860px) {
  .strategy { grid-template-columns: 1fr; }
  .strategy-outcome { justify-self: start; grid-row: 1; }
}

/* agents */
.agent-head { display: grid; gap: 4px; margin-bottom: 14px; }
.agent-head h3 { font-size: 20px; font-weight: 700; }
.agent-head p { color: var(--ink-2); max-width: 75ch; }
.agent-head .host { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.concl { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.concl li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 4px 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.concl li:first-child { border-top: 0; }
.concl .d { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 2px; }
.concl .t { color: var(--ink); }
.concl .m { margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; align-items: center; }
@media (max-width: 640px) { .concl li { grid-template-columns: 1fr; } }

/* incidents */
.incident-grid, .next-grid { display: grid; gap: 22px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 980px) { .incident-grid, .next-grid { grid-template-columns: 1.6fr 1fr; } }
.incident-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.incident { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.incident-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.incident-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.incident h3 { font-family: var(--font-body); font-stretch: 100%; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.incident p { color: var(--ink-2); font-size: 13.5px; }
.incident .lesson { color: var(--ink); }
.incident .lesson b { font-weight: 600; color: var(--muted); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 6px; }
.kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); }
.kind.halt { border-color: var(--critical); color: var(--critical); }
.kind.safety { border-color: var(--serious); color: var(--serious); }
.kind.measurement { border-color: var(--accent); color: var(--accent-ink); }
.impact { font-size: 12.5px; color: var(--muted); }
.lessons ol, .q-list { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.q-list { list-style: square; }

/* next */
.next-list { list-style: none; counter-reset: n; margin: 0; padding: 0; display: grid; gap: 10px; }
.next-list li { counter-increment: n; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 14px 56px; position: relative; display: grid; gap: 4px; }
.next-list li::before { content: counter(n); position: absolute; left: 16px; top: 13px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.next-list h3 { font-family: var(--font-body); font-stretch: 100%; font-size: 15px; font-weight: 600; letter-spacing: 0; }
.next-list p { color: var(--ink-2); font-size: 13.5px; }

.footer { border-top: 1px solid var(--line); padding-block: 28px 40px; color: var(--muted); font-size: 12.5px; }
.footer p + p { margin-top: 6px; font-family: var(--font-mono); }
.error { color: var(--critical); padding: 16px 0; }

/* phase identity colours (categorical, fixed order) */
:root { --p0: #3987e5; --p1: #d95926; --p2: #199e70; --p3: #c98500; --p4: #d55181; --p5: #008300; --p6: #9085e9; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --p0: #2a78d6; --p1: #eb6834; --p2: #1baf7a; --p3: #eda100; --p4: #e87ba4; --p5: #008300; --p6: #4a3aa7; } }
:root[data-theme="light"] { --p0: #2a78d6; --p1: #eb6834; --p2: #1baf7a; --p3: #eda100; --p4: #e87ba4; --p5: #008300; --p6: #4a3aa7; }

/* heat steps: dark-first (brighter = more), light (darker = more) */
.h0 { background: var(--seq-0); color: #eef1f5; }
.h1 { background: var(--seq-1); color: #eef1f5; }
.h2 { background: var(--seq-2); color: #ffffff; }
.h3 { background: var(--seq-3); color: #0a0c10; }
.h4 { background: var(--seq-4); color: #0a0c10; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .h0, :root:not([data-theme="dark"]) .h1, :root:not([data-theme="dark"]) .h2 { color: #0c0f14; } :root:not([data-theme="dark"]) .h3, :root:not([data-theme="dark"]) .h4 { color: #ffffff; } }
:root[data-theme="light"] .h0, :root[data-theme="light"] .h1, :root[data-theme="light"] .h2 { color: #0c0f14; }
:root[data-theme="light"] .h3, :root[data-theme="light"] .h4 { color: #ffffff; }

/* narrow-screen safety: no grid child may force horizontal page scroll */
.hero-grid, .callouts, .incident-grid, .next-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .callouts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .incident-grid, .next-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}
.hero-grid > *, .tiles > *, main { min-width: 0; }
.tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.eyebrow, .hero-context, .callout p { overflow-wrap: anywhere; }
.chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 720px) { .chart svg { min-width: 640px; } .tile-value { font-size: 24px; } .tile { padding: 14px; min-height: 0; } }

/* ===================== decision timeline ===================== */
:root { --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b; --st-pend: #8a93a3; }
.dt-controls { display: grid; gap: 10px; margin-bottom: 14px; }
.dt-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dt-count { color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); margin-left: 4px; }
.dt-phases .chip { font-size: 12.5px; padding: 5px 10px; }
.dt-filters { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.dt-fgroup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dt-flabel { font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.dt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-chips .chip { font-size: 12px; padding: 4px 10px; }
.dt-chips .chip[aria-pressed="false"] { opacity: 0.55; text-decoration: line-through; text-decoration-color: var(--muted); }
.dt-chips .chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.chip svg.glyph { width: 12px; height: 12px; flex: none; }
.dt-play[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.dt-play-icon { width: 0; height: 0; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.dt-play[aria-pressed="true"] .dt-play-icon { width: 8px; height: 10px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.dt-panel { padding: 10px 10px 8px; }
.dt-stage { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; cursor: crosshair; border-radius: 6px; outline: none; }
.dt-stage:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.dt-stage.dragging { cursor: grabbing; }
.dt-svg { display: block; width: 100%; overflow: visible; }
.dt-svg text { fill: var(--muted); font: 11px var(--font-body); font-variant-numeric: tabular-nums; }
.dt-svg .lane-label { fill: var(--ink-2); font-weight: 600; font-size: 11.5px; }
.dt-svg .lane-bg { fill: var(--surface-2); }
.dt-svg .grid-line { stroke: var(--line); }
.dt-svg .axis-line { stroke: var(--line-2); }
.dt-svg .tp-line { fill: none; stroke: var(--accent); stroke-width: 2; }
.dt-svg .tp-area { fill: var(--accent-wash); }
.dt-svg .stem { stroke: var(--line-2); stroke-width: 1; }
.dt-svg .co { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.5; }
.dt-svg .mk { stroke: var(--surface); stroke-width: 2; transition: opacity .25s ease; }
.dt-svg .mk-ring { fill: none; stroke: var(--ink); stroke-width: 2; }
.dt-svg .ev { transition: opacity .25s ease; }
.dt-svg.has-sel .ev { opacity: 0.16; }
.dt-svg.has-sel .ev.in-chain { opacity: 1; }
.dt-svg .chain { fill: none; stroke: var(--ink-2); stroke-width: 1.6; opacity: 0.9; }
.dt-svg .chain.fwd { stroke: var(--accent); stroke-width: 2; }
.dt-svg .chain-head { fill: var(--accent); }
.dt-svg .chain-head.back { fill: var(--ink-2); }
.dt-svg .xhair { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0.7; pointer-events: none; }
.dt-svg .xhair-label { fill: var(--ink); font-weight: 600; }
.dt-svg .phase-band { opacity: 0.07; }
.dt-svg .phase-label { font-size: 10.5px; fill: var(--muted); letter-spacing: 0.04em; }
.dt-svg .brush { fill: var(--accent-wash); stroke: var(--accent); stroke-width: 1.5; cursor: grab; }
.dt-svg .brush-h { fill: var(--accent); cursor: ew-resize; }
.dt-svg .mini-tick { stroke: var(--ink-2); stroke-width: 1; opacity: 0.6; }
.dt-mini { margin-top: 6px; touch-action: none; }
.dt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 12px; color: var(--ink-2); align-items: center; }
.dt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dt-legend .sep { width: 1px; height: 14px; background: var(--line-2); }
.dt-legend svg { width: 14px; height: 14px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); white-space: nowrap; }
.badge i { width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: 10px; line-height: 1; color: #fff; }
.badge.worked i { background: var(--st-good); }
.badge.did_not_work i { background: var(--st-crit); }
.badge.partial i { background: var(--st-warn); color: #111; }
.badge.pending i { background: var(--st-pend); }
.badge.na i { background: var(--muted); }
.agent-chip { font-family: var(--font-mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface); }
.agent-chip.lead { color: var(--ink); border-color: var(--ink-2); }
.kind-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.kind-tag svg { width: 12px; height: 12px; }

.dt-bubble { position: fixed; z-index: 70; width: min(360px, calc(100vw - 24px)); background: var(--raised); color: var(--ink); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; font-size: 13px; line-height: 1.45; pointer-events: none; transition: opacity .12s ease; display: grid; gap: 10px; max-height: 70vh; overflow: hidden; }
.dt-bubble .b-time { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.dt-bubble .b-metrics { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.dt-bubble .b-metrics b { color: var(--ink); font-family: var(--font-display); font-stretch: 110%; font-size: 15px; }
.b-ev { display: grid; gap: 5px; border-top: 1px solid var(--line-2); padding-top: 9px; }
.b-ev h4 { margin: 0; font-size: 13.5px; font-weight: 600; font-family: var(--font-body); }
.b-ev p { color: var(--ink-2); font-size: 12.5px; }
.b-ev .b-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.b-ev .b-led { font-size: 12px; color: var(--ink-2); }
.b-ev .b-led b { color: var(--muted); font-weight: 600; }
.b-more { font-size: 11.5px; color: var(--muted); }
.dt-bubble .b-hint { font-size: 11px; color: var(--muted); }
@media (max-width: 640px) {
  .dt-bubble { left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 46vh; overflow-y: auto; pointer-events: auto; border-radius: 14px 14px 10px 10px; }
}

.dt-pinned:empty { display: none; }
.dt-pinned { margin-top: 14px; }
.dt-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 12px; box-shadow: var(--shadow); animation: dtIn .25s ease; }
@keyframes dtIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dt-card-top { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.dt-card h3 { font-size: 19px; font-weight: 700; }
.dt-card .why { color: var(--ink); }
.dt-card .what { color: var(--ink-2); }
.dt-chain { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .dt-chain { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.dt-chain h4 { font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 6px; font-family: var(--font-body); }
.dt-chain ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dt-link { appearance: none; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.dt-link:hover { border-color: var(--line-2); background: var(--raised); }
.dt-link .t { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.dt-card .close { appearance: none; background: none; border: 1px solid var(--line-2); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font: 500 12px var(--font-body); cursor: pointer; }
.dt-empty { color: var(--muted); font-size: 13px; }
.dt-bubble .b-close { display: none; }
@media (max-width: 640px) { .dt-bubble .b-close { display: inline-block; justify-self: end; appearance: none; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 3px 10px; font: 500 12px var(--font-body); margin-bottom: -4px; } }
