:root {
  --recording-stripe: repeating-linear-gradient(135deg, var(--fg-muted) 0 6px, var(--panel) 6px 12px);
  --survey-bg: #0f1417;
  --survey-panel: #161d21;
  --survey-line: #26323a;
  --survey-fg: #dfe7ea;
  --survey-muted: #8a9aa3;
  --survey-accent: #4fc3c9;
  --survey-warning: #f0a03c;
  --survey-critical: #ff5a4f;
  --survey-ok: rgb(98, 195, 122);
  --survey-header: #0b1013;
  --survey-raised: #1d262b;
  --survey-line2: #34434d;
  --survey-title: #b9c6cc;
  --survey-accent-soft: #10292c;
  --survey-cpu-gold: #DA8C00;
  --survey-cpu-dark: #060D18;
  --survey-cpu-light: #DEE3EA;
  --survey-cpu-green: rgb(34, 139, 34);
  --survey-cpu-red: #C02B2B;
  --survey-cpu-button-bg: rgba(218, 140, 0, 0.12);
  --survey-cpu-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --survey-cpu-rule: #1C2A40;
  --survey-cpu-label: #8FA1BA;
  --survey-cpu-info: #B2BCCB;
  --bg: #15181c;
  --panel: #1d2126;
  --panel-raised: #242931;
  --line: #313841;
  --line-strong: #3e4652;
  --fg: #d7dce2;
  --fg-muted: #8d97a3;
  --fg-faint: #5f6873;
  --text: var(--fg);
  --muted: var(--fg-muted);
  --plot: var(--panel-raised);
  --ink: #111111;
  --white: #ffffff;
  --print-ink: #000000;
  --fault: var(--state-breaking);
  --ui: "Segoe UI", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --t-xs: 11px;
  --t-s: 12px;
  --t-m: 13px;
  --t-l: 15px;
  --t-xl: 20px;
  --row-height: 34px;
  --chip-height: 20px;
  --section-gap: 12px;
  --status-height: 36px;
  --action-height: 48px;
  --state: var(--accent-neutral);
  --bar-height: 0;
  --state-learning: #8B5CF6;
  --state-expected: #22C55E;
  --state-watching: #FACC15;
  --state-deviating: #F97316;
  --state-breaking: #C8213D;
  --state-learning-dim: color-mix(in srgb, var(--state-learning) 30%, var(--panel-raised));
  --state-learning-bright: var(--state-learning);
  --state-expected-dim: color-mix(in srgb, var(--state-expected) 30%, var(--panel-raised));
  --state-expected-bright: var(--state-expected);
  --state-watching-dim: color-mix(in srgb, var(--state-watching) 30%, var(--panel-raised));
  --state-watching-bright: var(--state-watching);
  --state-deviating-dim: color-mix(in srgb, var(--state-deviating) 30%, var(--panel-raised));
  --state-deviating-bright: var(--state-deviating);
  --state-breaking-dim: color-mix(in srgb, var(--state-breaking) 30%, var(--panel-raised));
  --state-breaking-bright: var(--state-breaking);
  --signals: #4fc3d9;
  --accent-neutral: #c9d1d9;
  --hatch: repeating-linear-gradient(135deg, transparent 0 4px, var(--accent-neutral) 4px 5px);
  --report-level-0: var(--white);
  --report-level-1: #d9d9d9;
  --report-level-2: #a6a6a6;
  --report-level-3: #737373;
  --report-level-4: #303030;
}

:root[data-theme="light"] {
  --survey-bg: #f4f6f8;
  --survey-panel: #ffffff;
  --survey-line: #c4ccd4;
  --survey-fg: #18202a;
  --survey-muted: #465363;
  --survey-accent: #0f7c82;
  --survey-warning: #a85d00;
  --survey-critical: #b42318;
  --survey-ok: rgb(30, 122, 58);
  --survey-header: #ffffff;
  --survey-raised: #e8edf2;
  --survey-line2: #8c98a5;
  --survey-title: #2c3a47;
  --survey-accent-soft: #d5eef0;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-raised: #e8edf2;
  --line: #c4ccd4;
  --line-strong: #8c98a5;
  --fg: #18202a;
  --fg-muted: #465363;
  --fg-faint: #5b6877;
  --accent-neutral: #18202a;
  --signals: #003326;
  --plot: var(--panel-raised);
  --ink: #111111;
}

.st-learning { color: var(--state-learning); }
.st-expected { color: var(--state-expected); }
.st-watching { color: var(--state-watching); }
.st-deviating { color: var(--state-deviating); }
.st-breaking { color: var(--state-breaking); }

.st-learning::before,
.st-expected::before,
.st-watching::before,
.st-deviating::before,
.st-breaking::before {
  content: "";
  display: inline-block;
  box-sizing: border-box;
  width: 0.7em;
  height: 0.7em;
  margin-inline-end: 0.5em;
  vertical-align: baseline;
  background: currentColor;
}
.st-learning::before { border: 2px dotted currentColor; border-radius: 50%; background: transparent; }
.st-expected::before { border-radius: 50%; }
.st-watching::before { transform: rotate(45deg); }
.st-deviating::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.st-breaking::before { border-radius: 0; }
.hatched { background-image: var(--hatch); }
.signals { color: var(--signals); }
.chip-filter { color: var(--accent-neutral); border: 1px solid var(--accent-neutral); border-radius: 3px; padding: 2px 5px; white-space: nowrap; }

/* State words retain their paint in both rows and status counts. */
.st-chip.st-expected, .st-chip.st-watching, .st-chip.st-deviating, .st-chip.st-breaking, .st-chip.st-learning {
  display: inline-block; white-space: nowrap; border-radius: 3px; padding: 2px 5px;
  background: var(--state); color: var(--ink);
}
.st-chip.st-breaking, .st-chip.st-learning { color: var(--white); font-size: var(--t-s); font-weight: 700; }

.mono, svg text, .frequency, .when, .rx { font-family: var(--mono); font-variant-numeric: tabular-nums; }
body.wall { --t-xs: 26.4px; --t-s: 28.8px; --t-m: 31.2px; --t-l: 36px; --t-xl: 48px; --row-height: 81.6px; --chip-height: 48px; --section-gap: 28.8px; --status-height: 86.4px; --action-height: 115.2px; }
.st-chip { height: var(--chip-height); font-size: var(--t-xs); line-height: 1.35; border: 1px solid var(--state); }
.mark-glyph { display: inline-flex; gap: .15em; color: var(--fg-muted); }
.unack .mark-glyph { color: var(--accent-neutral); }
.mark-cell { position: relative; display: inline-block; width: 1em; height: 1.4em; }
.mark-cell::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 1px solid currentColor; }
.mark-cell i { position: absolute; bottom: 50%; left: .3em; width: .4em; height: var(--bar-height, 0); background: currentColor; }
.mark-cell.down i { bottom: auto; top: 50%; }
.mark-cell.not-ready { border: 1px dotted currentColor; }
.mark-cell.not-ready::before { display: none; }
@keyframes rows-swap { from { opacity: .3; } to { opacity: 1; } }
@keyframes fault-flash { 50% { outline-color: transparent; } }
.rows-swap { animation: rows-swap 300ms ease-out 1; }
.chip.fault.unacknowledged { outline: 1px solid var(--fault); animation: fault-flash 1s steps(1) infinite; }
@media print {
  :root, body.wall { --bg: var(--white); --panel: var(--white); --panel-raised: var(--white); --fg: var(--print-ink); --fg-muted: var(--print-ink); --accent-neutral: var(--print-ink); --line: var(--print-ink); --hatch: repeating-linear-gradient(135deg, transparent 0 4px, var(--print-ink) 4px 5px); }
  .st-chip { background: var(--white) !important; color: var(--print-ink) !important; border-color: var(--print-ink); }
  * { animation: none !important; }
}

:root { view-transition-name: none; }
.measurementPane { border-color: var(--line-strong); }
.measureHead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.measureHead h2 { margin: 0; }
.measureHead .tabs, .measureShow { margin-left: auto; }
.measureShow { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-muted); font-size: var(--t-s); }
.measureShow select { width: auto; }
.measureHead .tog.on, .bwSort .on { color: var(--survey-bg); background: var(--accent-neutral); border-color: var(--accent-neutral); }
.measurementPane canvas { width: 100%; display: block; background: var(--plot); border: 1px solid var(--line); }
#rasterCanvas { cursor: crosshair; touch-action: none; }
.measureNote, .measureExplain { color: var(--fg-muted); font-size: var(--t-s); margin-top: 7px; white-space: pre-wrap; }
.measureExplain { color: var(--fg); border-left: 2px solid var(--signals); padding-left: 9px; }
.burstKey, .heldBurstKey, .joinKey, .edgeKey, .establishingRasterKey { display: inline-flex; align-items: center; gap: 5px; }
.burstKey i { display: inline-block; width: 16px; height: 4px; background: var(--accent-neutral); }
.heldBurstKey i { display: inline-block; width: 16px; height: 6px; border: 1px dashed var(--fg-muted); }
.joinKey i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-neutral); }
.edgeKey i { display: inline-block; width: 2px; height: 11px; background: var(--accent-neutral); }
.establishingRasterKey i { display: inline-block; width: 16px; height: 9px; border: 1px dashed var(--fg-muted); }
.rasterSignalKey { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; color: var(--fg-muted); font: var(--t-xs) var(--mono); }
.rasterSignalKey span { display: inline-flex; align-items: center; gap: 5px; }
.rasterSignalKey i { width: 16px; height: 4px; background: var(--signal-color); }
.rasterWhy { margin-top: 10px; padding: 10px; border: 1px solid var(--line-strong); background: var(--panel-raised); }
.rasterWhyHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rasterWhyHead h3 { margin: 0; font-size: var(--t-l); }
.rasterWhy p { margin: 6px 0 9px; }
.rasterWhyLists { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; font-size: var(--t-s); }
.rasterWhyLists ul { margin: 4px 0; padding-left: 18px; color: var(--fg-muted); }
#bwFrameRange { flex: 1 1 220px; }
.bwLegend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--fg-muted); font-size: var(--t-s); margin-bottom: 8px; }
.bwLegend span { border: 1px solid var(--line); padding: 2px 6px; }
.bwSort { display: inline-flex; gap: 4px; margin-left: auto; }
.bwRows { display: grid; gap: 5px; }
.bwRow { display: grid; grid-template-columns: 82px 78px 118px minmax(190px,2fr) 98px minmax(125px,1fr); gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--signal-color); font-family: var(--mono); font-size: var(--t-s); cursor: pointer; }
.bwRow.final { box-shadow: inset 4px 0 0 var(--signal-color), inset 7px 0 0 var(--accent-neutral); font-weight: 700; }
.bwRow.bwLit { background: var(--panel-raised); outline: 1px solid var(--signal-color); outline-offset: -1px; }
.bwRow.bwGap { height: 5px; padding: 0; border: 0; box-shadow: none; cursor: default; }
.bwRow.bwMore { display: block; color: var(--signals); box-shadow: inset 4px 0 0 var(--signal-color); }
.bwRow.establishing { background-image: var(--hatch); background-color: var(--panel); }
.bwRow.establishing > * { background: var(--panel-raised); padding: 1px 3px; }
.establishingKey { background-image: var(--hatch); background-color: var(--panel); }
.establishingKey > b { display: inline-block; background: var(--panel-raised); color: var(--fg); padding: 1px 3px; }
.bwHow summary, .skipFold summary { cursor: pointer; color: var(--signals); margin-top: 8px; }
.frameStep, .skipForm { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 8px; }
.skipForm label { max-width: 180px; }
.skipRow { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); }
.skipRow .coverage { color: var(--accent-neutral); margin-right: auto; }
.tqName { display: block; color: var(--signals); font-size: var(--t-xs); margin-top: 2px; }
@media screen and (max-width:900px){.bwRow{grid-template-columns:74px 72px 100px minmax(160px,1fr)}.bwRow span:nth-child(n+5){display:none}.rasterWhyLists{grid-template-columns:1fr}}
#worklist tbody { view-transition-name: worklist; }
::view-transition-old(worklist), ::view-transition-new(worklist) { animation-duration: 300ms; animation-timing-function: ease-out; }

/* A 1080p feed on the same wall panel has half the pixels per physical inch. */
@media screen and (max-height:1200px){
  body.wall{--t-xs:13.2px;--t-s:14.4px;--t-m:15.6px;--t-l:18px;--t-xl:24px;--chip-height:24px;--section-gap:14.4px;--status-height:43.2px;--action-height:57.6px}
}

/* GHOST pages beside the operator screen share its header and menu (approved mockup, 11 November 2026). */
header:not(.vf-help-header){display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;padding:8px 16px;background:var(--panel);border-bottom:1px solid var(--line);font-size:var(--t-s)}
header:not(.vf-help-header)>strong{font-size:var(--t-l);letter-spacing:.12em}
header:not(.vf-help-header) nav{display:flex;flex-wrap:wrap;gap:2px}
header:not(.vf-help-header) nav a{color:var(--fg-muted);text-decoration:none;padding:6px 10px;border-radius:4px;font-size:var(--t-m)}
header:not(.vf-help-header) nav a:hover{color:var(--fg);background:var(--panel-raised)}
header:not(.vf-help-header) nav a[aria-current=page]{color:var(--fg);background:var(--panel-raised);box-shadow:inset 0 -2px 0 var(--signals)}
header:not(.vf-help-header) #receiver-selection{display:inline-flex;align-items:center;gap:6px;color:var(--fg-muted)}
header:not(.vf-help-header) #receiver-selection select{min-width:170px}
header:not(.vf-help-header) #signed-in-user a{text-decoration:none;border:1px solid var(--line-strong);border-radius:4px;padding:3px 8px;color:var(--fg-muted)}
.theme-toggle{font:600 var(--t-s) var(--ui);padding:4px 10px;border-radius:4px;border:1px solid var(--line-strong);background:var(--panel-raised);color:var(--fg);cursor:pointer}

