/* Pitstop Resilience Console
 *
 * Direction: a control-room instrument panel. Dark because it is watched
 * during an incident, with one warm signal colour reserved for things an
 * operator can act on. Condensed display type for labels and readouts, mono
 * for every measured number, a plain sans for prose.
 *
 * No webfonts: the stacks below resolve to faces already on the machine, so
 * the console renders identically offline, which is when it matters most.
 */

:root {
  --bg: oklch(15% 0.012 250);
  --bg-raised: oklch(19.5% 0.014 250);
  --bg-sunken: oklch(12.5% 0.01 250);
  --bg-hover: oklch(25% 0.016 250);
  --line: oklch(29% 0.016 250);
  --line-soft: oklch(24% 0.014 250);
  --line-bright: oklch(41% 0.02 250);
  --text: oklch(94% 0.004 250);
  --text-dim: oklch(73% 0.012 250);
  --text-faint: oklch(60% 0.014 250);

  --ok: oklch(78% 0.15 158);
  --warn: oklch(82% 0.15 80);
  --fail: oklch(68% 0.2 24);
  --unknown: oklch(60% 0.015 250);
  --accent: oklch(76% 0.12 220);
  --signal: oklch(80% 0.15 68);
  --ai: oklch(78% 0.11 300);
  --ai-line: oklch(48% 0.09 300);

  --display: "Bahnschrift", "DIN Alternate", "Roboto Condensed", "Arial Narrow", ui-sans-serif, sans-serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;

  --r-sm: 3px;
  --r-md: 6px;
  --gap: 16px;
  --gutter: clamp(14px, 2.4vw, 28px);
  --zone-gap: clamp(34px, 5vw, 60px);

  --fast: 130ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow: 0 1px 0 oklch(100% 0 0 / 0.03) inset, 0 10px 28px -18px oklch(0% 0 0 / 0.8);

  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 132px; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Faint engineering-paper grid: texture, not decoration. */
  background:
    linear-gradient(oklch(100% 0 0 / 0.018) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, oklch(100% 0 0 / 0.018) 1px, transparent 1px) 0 0 / 32px 100%,
    var(--bg);
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--text); }
code { font-family: var(--mono); font-size: 0.92em; color: var(--text); background: var(--bg-sunken); padding: 1px 5px; border-radius: var(--r-sm); border: 1px solid var(--line-soft); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

.skip-link { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--signal); color: var(--bg); padding: 8px 12px; border-radius: var(--r-sm); font-weight: 600; }
.skip-link:focus { left: 8px; }

/* ---- utilities ---------------------------------------------------------- */
.mono { font-family: var(--mono); }
.small { font-size: 11px; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.t-ok { color: var(--ok); }
.t-warn { color: var(--warn); }
.t-fail { color: var(--fail); }
.t-faint { color: var(--text-faint); }
.t-accent { color: var(--accent); }
.hint { margin: 8px 0 0; font-size: 11.5px; color: var(--text-faint); }
.lede { margin: 0 0 12px; color: var(--text-dim); font-size: 12.5px; max-width: 62ch; }
.empty { color: var(--text-faint); font-size: 12.5px; font-style: italic; margin: 0; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* ---- top bar: brand, status readouts, kill switch ----------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px 26px; flex-wrap: wrap;
  padding: 12px var(--gutter);
  background: oklch(13% 0.012 250 / 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  border: 2px solid var(--signal);
  background: conic-gradient(from 210deg, var(--signal) 0 22%, transparent 0);
  box-shadow: 0 0 0 4px oklch(80% 0.15 68 / 0.12);
}
.brand h1 {
  margin: 0; font-family: var(--display); font-size: 21px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.1;
}
.brand h1 span { font-weight: 400; color: var(--text-dim); }
.brand-sub { margin: 1px 0 0; font-size: 11.5px; color: var(--text-faint); }

.hud { display: flex; margin: 0; flex: 1; gap: 0; min-width: 0; }
.hud-cell { padding: 2px 18px; border-left: 1px solid var(--line); min-width: 0; }
.hud dt { font-family: var(--display); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); }
.hud dd {
  margin: 0; font-family: var(--mono); font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text-dim); transition: color var(--fast) var(--ease);
}
.hud-cell[data-level="ok"] dd { color: var(--ok); }
.hud-cell[data-level="warn"] dd { color: var(--warn); }
.hud-cell[data-level="fail"] dd { color: var(--fail); }

.killswitch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.zone-nav {
  position: sticky; top: 61px; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  padding: 0 var(--gutter);
  background: oklch(15% 0.012 250 / 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.zone-nav a {
  font-family: var(--display); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim); text-decoration: none; white-space: nowrap;
  padding: 10px 14px 9px; border-bottom: 2px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.zone-nav a b { color: var(--signal); font-weight: 600; margin-right: 6px; }
.zone-nav a:hover { color: var(--text); border-bottom-color: var(--line-bright); }
.zone-nav a:active { color: var(--signal); }

.freshness { font-family: var(--mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; padding: 3px 0 3px 12px; }
.freshness::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-right: 7px; vertical-align: 1px; }
.freshness.stale { color: var(--warn); }
.freshness.stale::before { background: var(--warn); }

.mode-banner {
  margin: var(--gap) var(--gutter) 0; padding: 10px 14px;
  border: 1px solid var(--signal); border-left-width: 4px; border-radius: var(--r-sm);
  background: oklch(80% 0.15 68 / 0.08); color: var(--text); font-size: 12.5px;
}

/* ---- zones -------------------------------------------------------------- */
main { max-width: 1720px; margin: 0 auto; padding: 0 var(--gutter) 70px; }
.zone { padding-top: var(--zone-gap); }
.zone-head {
  display: grid; grid-template-columns: auto auto 1fr; align-items: baseline; column-gap: 16px;
  padding-bottom: 12px; margin-bottom: var(--gap); border-bottom: 1px solid var(--line-bright);
}
.zone-no { font-family: var(--mono); font-size: 13px; color: var(--signal); }
.zone-head h2 {
  margin: 0; font-family: var(--display); font-weight: 700; line-height: 0.95;
  font-size: clamp(34px, 5vw, 60px); letter-spacing: 0.02em; text-transform: uppercase;
}
.zone-head p { margin: 0; color: var(--text-dim); font-size: 13px; max-width: 58ch; justify-self: end; text-align: right; }

.zone-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }

/* ---- panels ------------------------------------------------------------- */
.panel { background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); min-width: 0; }
.panel-head {
  display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--bg-sunken); border-radius: var(--r-md) var(--r-md) 0 0;
}
.panel-head h3 { margin: 0; font-family: var(--display); font-size: 14px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }
.panel-head .note { margin-left: auto; font-size: 11.5px; color: var(--text-faint); text-align: right; }
.panel .body { padding: 14px; }

/* AI panels are visually distinct so advisory output is never mistaken for a
   measured value. Violet + dashed = a model wrote this. */
.panel.ai { border-color: var(--ai-line); }
.panel.ai .panel-head { border-bottom-style: dashed; border-bottom-color: var(--ai-line); }
.panel.ai .panel-head h3 { color: var(--ai); }

/* ---- status primitives -------------------------------------------------- */
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.s-ok { background: var(--ok); }
.s-warn { background: var(--warn); }
.s-fail { background: var(--fail); }
.s-unknown { background: var(--unknown); }
.dot-x { background: transparent; border: 1px solid var(--text-faint); transform: rotate(45deg); border-radius: 0; }
.swatch { width: 8px; height: 8px; flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 99px; white-space: nowrap;
  border: 1px solid var(--line-bright); color: var(--text-dim);
}
.pill.high { color: var(--fail); border-color: var(--fail); }
.pill.medium { color: var(--warn); border-color: var(--warn); }
.pill.low { color: var(--text-faint); }
.pill.observed { color: var(--accent); border-color: var(--accent); }
.pill.inferred { color: var(--text-faint); border-style: dashed; }
.pill.ai { color: var(--ai); border-color: var(--ai-line); border-style: dashed; }
.pill.rejected { color: var(--fail); border-color: var(--fail); }
.pill.validated { color: var(--ok); border-color: var(--ok); }
.pill.not-executable { color: var(--warn); border-color: var(--warn); border-style: dotted; }

/* Milestone pills. The colour carries the same information as the word,
   never more: nothing here can report a status the data did not produce. */
.ms { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.ms:empty { display: none; }
.ms-ok { background: color-mix(in oklab, var(--ok) 16%, transparent); color: var(--ok); }
.ms-warn { background: color-mix(in oklab, var(--warn) 16%, transparent); color: var(--warn); }
.ms-bad { background: color-mix(in oklab, var(--fail) 15%, transparent); color: var(--fail); }

.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 11px; color: var(--text-faint); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend strong { color: var(--text-dim); font-weight: 600; }

/* ---- services ----------------------------------------------------------- */
.grid-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(216px, 1fr)); gap: 6px; }
.svc {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px;
  background: var(--bg-sunken); border: 1px solid var(--line-soft); border-left: 3px solid var(--unknown);
  border-radius: var(--r-sm); transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.svc:hover { background: var(--bg-hover); }
.svc.ok { border-left-color: var(--ok); }
.svc.warn { border-left-color: var(--warn); }
.svc.fail { border-left-color: var(--fail); background: oklch(20% 0.04 24); }
.svc .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svc .state { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

/* ---- tables ------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tbody tr { transition: background var(--fast) var(--ease); }
tbody tr:hover { background: oklch(100% 0 0 / 0.025); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }

.metric-row { display: flex; align-items: baseline; gap: 10px; padding: 9px 0 0; }
.metric-row .label { flex: 1; color: var(--text-dim); font-size: 12.5px; }
.metric-row .value { font-family: var(--mono); font-size: 13px; }

/* ---- scores: the one element allowed to dominate ----------------------- */
.score-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.score-card { padding: 12px 12px 11px; background: var(--bg-sunken); border: 1px solid var(--line-soft); border-top: 3px solid var(--unknown); border-radius: var(--r-sm); }
.score-card[data-level="ok"] { border-top-color: var(--ok); }
.score-card[data-level="warn"] { border-top-color: var(--warn); }
.score-card[data-level="fail"] { border-top-color: var(--fail); }
.score { font-family: var(--display); font-size: 58px; font-weight: 700; line-height: 0.95; font-variant-numeric: tabular-nums; }
.score small { font-family: var(--mono); font-size: 13px; font-weight: 400; color: var(--text-faint); margin-left: 3px; }
.score-name { font-family: var(--mono); font-size: 12.5px; margin: 7px 0 3px; }
.score-meta { font-size: 11.5px; color: var(--text-dim); }
.comparison { margin: 0 0 6px; font-size: 12.5px; color: var(--text-dim); }

.finding { padding: 12px 0; border-top: 1px solid var(--line-soft); }
.finding:first-child { border-top: none; padding-top: 0; }
.finding .head, .discovery .head { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-bottom: 6px; }
.finding .title, .discovery .title { font-weight: 600; font-size: 13px; }
.finding p { margin: 5px 0; color: var(--text-dim); font-size: 12.5px; max-width: 78ch; }
.finding p strong { color: var(--text); }
.evidence {
  font-family: var(--mono); font-size: 11px; color: var(--accent); word-break: break-word;
  background: var(--bg-sunken); border: 1px solid var(--line-soft); border-left: 2px solid var(--accent);
  border-radius: var(--r-sm); padding: 6px 9px; margin-top: 7px;
}
.gap { padding: 9px 0; border-top: 1px solid var(--line-soft); }
.gap:first-child { border-top: none; padding-top: 0; }
.gap p { margin: 5px 0 0; font-size: 12.5px; color: var(--text-dim); }

/* ---- controls ----------------------------------------------------------- */
.controls { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--text-faint); }
input[type="number"], select {
  background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 12px;
  border: 1px solid var(--line-bright); border-radius: var(--r-sm); padding: 6px 8px; min-height: 32px;
  transition: border-color var(--fast) var(--ease);
}
input[type="number"] { width: 84px; }
select { max-width: 100%; }
input[type="number"]:hover, select:hover { border-color: var(--text-faint); }

button {
  font: inherit; font-size: 12.5px; font-weight: 600; min-height: 32px;
  padding: 6px 13px; border-radius: var(--r-sm); cursor: pointer;
  border: 1px solid var(--line-bright); background: var(--bg); color: var(--text);
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
button:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--text-faint); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.quiet { background: transparent; color: var(--text-dim); }
button.primary { border-color: var(--ai-line); color: var(--ai); }
button.primary:hover:not(:disabled) { background: var(--ai); border-color: var(--ai); color: var(--bg); }
button.danger { border-color: var(--fail); color: var(--fail); }
button.danger:hover:not(:disabled) { background: var(--fail); border-color: var(--fail); color: var(--bg); }
/* The kill switch is the only filled button on the page. */
button.stop { background: var(--signal); border-color: var(--signal); color: oklch(18% 0.03 68); font-family: var(--display); font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
button.stop:hover:not(:disabled) { background: oklch(86% 0.15 68); border-color: oklch(86% 0.15 68); }

.exp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.exp-card { display: flex; flex-direction: column; padding: 12px; background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--r-sm); transition: border-color var(--fast) var(--ease); }
.exp-card:hover, .exp-card:focus-within { border-color: var(--line-bright); }
.exp-card .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.exp-card .exp-name, .ai-card .exp { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.exp-card dl, .ai-card dl, .discovery dl, .confirm-facts { margin: 0 0 11px; display: grid; grid-template-columns: 92px 1fr; gap: 4px 10px; font-size: 12px; }
.exp-card dl { flex: 1; align-content: start; }
dt { color: var(--text-faint); }
dd { margin: 0; color: var(--text-dim); min-width: 0; overflow-wrap: anywhere; }
.blockers { margin-top: 9px; font-size: 12px; color: var(--warn); }
.blockers:empty { display: none; }
.blockers ul, .preflight-result ul, .sublist ul, .ai-reject ul, .ai-unsupported ul { margin: 4px 0 0; padding-left: 17px; color: var(--text-dim); }

.guarantees { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-dim); }
.guarantees li { padding: 7px 0 7px 18px; border-top: 1px solid var(--line-soft); position: relative; }
.guarantees li::before { content: ""; position: absolute; left: 2px; top: 14px; width: 7px; height: 7px; background: var(--signal); transform: rotate(45deg); }

/* ---- timeline ----------------------------------------------------------- */
.timeline-body { display: grid; grid-template-columns: minmax(170px, 0.42fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li { position: relative; padding: 0 0 13px 20px; border-left: 1px solid var(--line); font-size: 12.5px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -4.5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bg-raised); border: 1px solid var(--line-bright); }
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.active { color: var(--signal); }
.timeline li.active::before { background: var(--signal); border-color: var(--signal); animation: pulse 1.4s var(--ease) infinite; }
.timeline li.pending { color: var(--text-faint); }
@keyframes pulse { 50% { opacity: 0.35; } }

.log { font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--text-dim); background: var(--bg-sunken); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: 10px; min-height: 132px; max-height: 230px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- charts and map ----------------------------------------------------- */
svg.graph { width: 100%; height: auto; display: block; }
svg.graph text { font-family: var(--mono); font-size: 9.5px; fill: var(--text-dim); }
svg.graph .node rect { fill: var(--bg-sunken); stroke: var(--line-bright); rx: 3; transition: stroke var(--fast) var(--ease); }
svg.graph .node:hover rect { stroke: var(--text); }
svg.graph .node.infra rect { stroke: var(--accent); }
svg.graph .node.target rect { stroke: var(--fail); stroke-width: 2; fill: oklch(24% 0.05 24); }
svg.graph .node.unaffected rect { stroke: var(--ok); }
svg.graph .edge { stroke: var(--line-bright); fill: none; }
svg.graph .edge.event { stroke-dasharray: 3 3; }

.chart-head { display: flex; align-items: flex-end; gap: 8px 14px; flex-wrap: wrap; margin: 16px 0 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.chart-head .note { font-family: var(--mono); font-size: 11px; color: var(--text-dim); flex: 1; min-width: 200px; }
.chart { width: 100%; height: auto; display: block; }
.chart .band-baseline { fill: color-mix(in oklab, var(--ok) 7%, transparent); }
.chart .band-fault { fill: color-mix(in oklab, var(--fail) 10%, transparent); }
.chart .band-recovery { fill: color-mix(in oklab, var(--accent) 7%, transparent); }
.chart .band-edge { stroke: var(--line-bright); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .band-label { fill: var(--text-faint); font-family: var(--display); font-size: 11px; text-anchor: middle; letter-spacing: 0.12em; text-transform: uppercase; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { fill: var(--text-faint); font-family: var(--mono); font-size: 9.5px; text-anchor: end; }
.chart .fail-row { stroke: var(--fail); stroke-dasharray: 3 4; opacity: 0.5; }

/* ---- AI output ---------------------------------------------------------- */
.ai-card { margin-top: 12px; padding: 12px; background: var(--bg-sunken); border: 1px dashed var(--ai-line); border-radius: var(--r-sm); }
.ai-card .headline { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-card .summary { margin: 0 0 10px; }
.ai-card .controls { margin-top: 12px; }
.sublist { font-size: 12px; color: var(--text-faint); margin-top: 8px; }
.preflight-result { margin-top: 12px; font-size: 12.5px; }
.ai-reject { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--fail); border-radius: var(--r-sm); background: oklch(21% 0.05 24); font-size: 12.5px; }
.ai-reject strong { color: var(--fail); }
.ai-reject p { margin: 6px 0 0; color: var(--text-dim); }
.ai-unsupported { margin-top: 10px; padding: 8px 10px; border-left: 2px solid var(--warn); background: var(--bg); font-size: 12px; color: var(--text-dim); }
.subhead { margin: 18px 0 4px; font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.subhead span { font-family: var(--sans); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-faint); }

/* Discoveries are research notes, not controls. No button ever renders here,
   and the dotted edge keeps them apart from experiments that can run. */
.discovery { margin-top: 9px; padding: 10px 12px; background: var(--bg-sunken); border: 1px dotted var(--line-bright); border-left: 3px solid var(--warn); border-radius: var(--r-sm); }
.discovery p { margin: 5px 0; color: var(--text-dim); font-size: 12px; }
.discovery dl { margin: 6px 0 0; font-size: 11.5px; }

/* ---- approval dialog ---------------------------------------------------- */
dialog { width: min(560px, calc(100vw - 32px)); padding: 0; color: var(--text); background: var(--bg-raised); border: 1px solid var(--fail); border-radius: var(--r-md); box-shadow: 0 30px 80px -20px oklch(0% 0 0 / 0.9); }
dialog::backdrop { background: oklch(8% 0.01 250 / 0.78); backdrop-filter: blur(3px); }
dialog[open] { animation: rise 180ms var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
dialog form { padding: 20px; }
dialog h2 { margin: 0 0 14px; font-family: var(--display); font-size: 22px; letter-spacing: 0.04em; text-transform: uppercase; }
.confirm-facts { grid-template-columns: 104px 1fr; font-size: 12.5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.footer { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding: 18px var(--gutter) 30px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-faint); }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1180px) {
  .span-8, .span-7, .span-5, .span-4 { grid-column: span 12; }
  .zone-head { grid-template-columns: auto 1fr; }
  .zone-head p { grid-column: 1 / -1; justify-self: start; text-align: left; margin-top: 8px; }
}
@media (max-width: 1100px) {
  .hud { flex-basis: 100%; order: 3; }
  .hud-cell:first-child { border-left: none; padding-left: 0; }
  .killswitch { margin-left: auto; }
  .zone-nav { top: 108px; }
  html { scroll-padding-top: 170px; }
}
@media (max-width: 860px) {
  html { scroll-padding-top: 16px; }
  .topbar, .zone-nav { position: static; }
}
@media (max-width: 560px) {
  .hud { flex-wrap: wrap; gap: 8px 0; }
  .hud-cell { flex: 1 1 50%; padding: 2px 10px; }
  .hud-cell:nth-child(odd) { border-left: none; padding-left: 0; }
  .brand-sub { display: none; }
  .killswitch { width: 100%; }
  .killswitch .stop { flex: 1; }
  .timeline-body { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: 1fr; }
  .exp-card dl, .ai-card dl, .discovery dl, .confirm-facts { grid-template-columns: 1fr; gap: 0; }
  .exp-card dd, .ai-card dd, .discovery dd, .confirm-facts dd { margin-bottom: 6px; }
  .panel-head .note { margin-left: 0; flex-basis: 100%; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
