:root {
  --page: #f2f4f6;
  --surface: #ffffff;
  --ink: #14212b;
  --ink-2: #33434f;
  --muted: #5d6d79;
  --line: #d9dfe4;
  --line-soft: #e9edf0;
  --subtle: #eef1f4;
  --rail: #101c26;
  --rail-ink: #e9eef2;
  --rail-muted: #9aaab6;
  --rail-line: #263541;
  --good: #0a7466;
  --good-bg: #e4f2ef;
  --good-bright: #45d0bb;
  --warn: #9a5800;
  --warn-bg: #fbf0dc;
  --warn-bright: #f0b04a;
  --bad: #b3261e;
  --bad-bg: #fbecea;
  --focus: #1c5fd0;
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; line-height: 1.45; }
h1, h2, h3, h4, p, ol, dl { margin: 0; }
p { text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 6px 12px; cursor: pointer; font-weight: 550; }
button:hover:not(:disabled) { border-color: var(--muted); background: var(--subtle); }
button:disabled { color: var(--muted); background: var(--subtle); cursor: not-allowed; font-weight: 400; }
button.quiet { font-size: 13px; padding: 4px 10px; font-weight: 500; }
input[type="search"], input[type="password"], input[type="number"], select { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 6px 10px; min-height: 34px; max-width: 100%; }
input[type="checkbox"] { width: 15px; height: 15px; margin: 0 6px 0 0; vertical-align: -2px; accent-color: var(--good-bright); }
.skip-link { position: absolute; left: 16px; top: -64px; z-index: 40; background: var(--surface); padding: 8px 14px; border: 1px solid var(--ink); border-radius: 6px; }
.skip-link:focus { top: 8px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.subline { display: block; color: var(--muted); font-size: 12.5px; }
.number { font-variant-numeric: tabular-nums; white-space: nowrap; }
.time { white-space: nowrap; }
.identifier { word-break: break-all; }

/* Shell: a fixed rail for where you are, one page beside it. */
.shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 12px 16px; background: var(--rail); color: var(--rail-ink); }
.brand { padding: 0 10px; }
.brand h1 { font-size: 21px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; }
#console-mode { font-size: 12px; color: var(--rail-muted); }
nav { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.nav-group { font-size: 12px; color: var(--rail-muted); margin: 14px 10px 4px; }
nav a { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 6px; color: var(--rail-ink); text-decoration: none; }
nav a:hover { background: var(--rail-line); }
nav a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 600; }
nav a span { font-size: 12px; color: var(--rail-muted); font-variant-numeric: tabular-nums; font-weight: 400; }
nav a[aria-current="page"] span { color: var(--muted); }
.refresh-controls { margin-top: auto; display: grid; gap: 8px; padding: 14px 10px 0; border-top: 1px solid var(--rail-line); font-size: 12.5px; color: var(--rail-muted); }
.refresh-controls label { color: var(--rail-ink); }
.rail button { background: transparent; color: var(--rail-ink); border-color: #44566399; }
.rail button:hover:not(:disabled) { background: var(--rail-line); border-color: var(--rail-muted); }
.rail button:disabled { background: transparent; color: var(--rail-muted); }
.rail :focus-visible { outline-color: #fff; }
main { width: 100%; max-width: 1340px; padding: 30px 36px 56px; }
main:focus { outline: none; }
.service-strip { padding: 10px 14px; margin-bottom: 20px; background: var(--bad-bg); color: var(--bad); border-radius: 8px; font-weight: 550; }

/* Page headline: the title, then the answer in a sentence. */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 14px 32px; margin-bottom: 22px; }
h2 { font-size: 27px; line-height: 1.2; font-weight: 650; letter-spacing: -0.02em; }
.lede { max-width: 74ch; margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.lede:empty { display: none; }
.page-meta { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.back-link { display: inline-block; margin-bottom: 10px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back-link::before { content: "‹ "; }
.back-link:hover { color: var(--ink); text-decoration: underline; }
.field { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.field input, .field select { color: var(--ink); font-size: 14px; }
.field input[type="search"] { width: 220px; }

/* Grid and panels. */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.grid > * { grid-column: span 12; min-width: 0; }
.grid > .span-8 { grid-column: span 8; }
.grid > .span-7 { grid-column: span 7; }
.grid > .span-6 { grid-column: span 6; }
.grid > .span-5 { grid-column: span 5; }
.grid > .span-4 { grid-column: span 4; }
.panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px 18px; }
.panel > .source-line { margin-top: auto; padding-top: 12px; }
.panel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; font-weight: 650; }
.panel-note { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.panel-link { margin-left: auto; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.panel h4 { font-size: 13px; font-weight: 650; margin: 18px 0 10px; }
.footnote { max-width: 86ch; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.notice { padding: 10px 14px; background: var(--warn-bg); color: var(--ink); border-radius: 8px; overflow-wrap: anywhere; }
.empty { color: var(--muted); padding: 8px 0; }
.empty-state { max-width: 640px; padding: 28px 28px 26px; background: var(--surface); border: 1px dashed #b9c3cb; border-radius: 10px; }
.empty-state h3 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.empty-state p { color: var(--ink-2); }
.empty-actions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.panel .empty-state { max-width: none; padding: 6px 0 2px; border: 0; background: none; }
.panel .empty-state h3 { font-size: 14px; margin-bottom: 2px; }
.panel .empty-state p { color: var(--muted); font-size: 13px; }
.button-link { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); text-decoration: none; font-weight: 550; }
.button-link:hover { border-color: var(--muted); background: var(--subtle); }

/* Status: a dot and a word, the same everywhere. */
.state { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; background: var(--subtle); color: var(--ink-2); font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.state::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.state.evidence { background: var(--good-bg); color: var(--good); }
.state.failed { background: var(--bad-bg); color: var(--bad); }
.state.stale { background: var(--warn-bg); color: var(--warn); }
.state.evidence::before, .state.failed::before, .state.stale::before { opacity: 1; }
.state.simulated { background: none; border: 1px dashed var(--ink-2); color: var(--ink); }
.state.unavailable, .state.unsupported { background: none; border: 1px dashed var(--line); }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.source-line { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.aged { display: flex; align-items: center; gap: 7px; }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }
.dot.fresh { background: var(--good); border-color: var(--good); }
.dot.stale { background: var(--warn-bright); border-color: var(--warn-bright); }
.when { white-space: nowrap; }

/* The signal path: the one dark surface, a track with a node per stage. */
.panel.primary { background: var(--rail); border-color: var(--rail); color: var(--rail-ink); padding: 18px 24px 18px; }
.panel.primary .panel-note, .panel.primary .footnote, .panel.primary .source-line { color: var(--rail-muted); }
.panel.primary .panel-head { margin-bottom: 18px; }
.path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.path.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stage { position: relative; display: block; padding: 26px 24px 2px 0; color: inherit; text-decoration: none; }
.stage::before { content: ""; position: absolute; left: 12px; right: 0; top: 5px; border-top: 2px solid #4b5f6e; }
.stage:last-child::before { display: none; }
.stage:has(+ .unlinked)::before { border-top-style: dashed; left: 18px; right: 6px; }
.stage::after { content: ""; position: absolute; left: 0; top: 0; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--rail-muted); background: var(--rail); }
.stage.fresh::after { background: var(--good-bright); border-color: var(--good-bright); }
.stage.stale::after { background: var(--warn-bright); border-color: var(--warn-bright); }
.stage h4 { margin: 0; font-size: 13px; font-weight: 500; color: var(--rail-muted); }
.stage-value { margin-top: 2px; font-size: 36px; line-height: 1.15; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stage-unit { font-size: 14px; margin-bottom: 10px; }
.stage-line { font-size: 12.5px; color: var(--rail-muted); }
.stage:hover .stage-value { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.panel.primary .dot { border-color: var(--rail-muted); }
.panel.primary .dot.fresh { background: var(--good-bright); border-color: var(--good-bright); }
.panel.primary :focus-visible { outline-color: #fff; }

/* Numbers. */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.kpi { padding: 14px 20px 15px; border-left: 1px solid var(--line-soft); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi-value { font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-sub { font-size: 12px; color: var(--muted); }
.panel .kpis { margin: 14px -20px; border-width: 1px 0; border-color: var(--line-soft); border-radius: 0; }
.panel .kpi-value { font-size: 22px; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 28px; margin-bottom: 14px; }
.fact { font-size: 13px; color: var(--muted); }
.fact strong { font-size: 20px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
dl.defs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.defs dt, .defs dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.defs dt:first-of-type, .defs dd:first-of-type { border-top: 0; padding-top: 0; }
.defs dt { color: var(--muted); padding-right: 12px; }
.defs dd { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.state + .radio-line, .radio-line { margin-top: 8px; }
.panel > .state + .radio-line { margin-bottom: 14px; }

/* Charts: one hue for magnitude, values always written beside the mark. */
.hist { display: flex; align-items: flex-end; gap: 2px; flex: 1 0 128px; min-height: 128px; border-bottom: 1px solid var(--line); }
.hist-slot { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; }
.hist-slot:hover { background: var(--subtle); }
.hist-bar { width: 100%; background: var(--good); border-radius: 3px 3px 0 0; }
.axis { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(48px, 1fr) minmax(64px, auto); gap: 14px; align-items: center; }
.bar-name > span:first-child { display: block; font-weight: 550; }
.bar-track { display: block; height: 8px; background: var(--subtle); border-radius: 4px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--good); border-radius: 0 4px 4px 0; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.trend { margin-bottom: 14px; }
.spark { display: block; width: 100%; height: 52px; }
.spark polyline { fill: none; stroke: var(--good); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend-label { margin-top: 6px; font-size: 13px; color: var(--muted); }
.trend-label strong { font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
#tip { position: fixed; z-index: 30; max-width: 300px; padding: 5px 9px; background: var(--ink); color: #fff; border-radius: 5px; font-size: 12.5px; pointer-events: none; }

/* Overview pieces. */
.radio { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 12px; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.radio:first-child { border-top: 0; padding-top: 0; }
.radio:last-child { padding-bottom: 0; }
.radio h4 { margin: 2px 0 0; font-size: 14px; grid-row: span 3; }
.radio .state { justify-self: start; }
.radio .radio-line { margin-top: 6px; }
.radio .source-line { margin-top: 4px; }
.marks { display: flex; flex-wrap: wrap; gap: 4px; }
.mark { display: inline-block; width: 13px; height: 24px; padding: 0; border: 1.5px solid #9aa7b1; border-radius: 3px; background: var(--surface); }
.mark.pass { background: var(--good); border-color: var(--good); }
button.mark { cursor: pointer; }
button.mark:hover { border-color: var(--ink); background: var(--subtle); }
button.mark.pass:hover { background: #075a4f; }
.mark.current { outline: 2px solid var(--ink); outline-offset: 2px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.legend .mark { width: 8px; height: 13px; margin-left: 10px; border-radius: 2px; }
.legend .mark:first-child { margin-left: 0; }
.legend-range { margin-left: auto; }
.run-list { margin-top: 14px; }
.run-list.scroll { margin-top: 0; max-height: 560px; overflow: auto; }
.run-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 9px 8px; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; background: none; color: inherit; font: inherit; font-weight: 400; text-align: left; text-decoration: none; cursor: pointer; }
.run-row:first-child { border-top: 0; }
.run-row.device { grid-template-columns: minmax(0, 1fr) auto; }
.run-list.flush { margin-top: 0; }
.run-row:hover:not(:disabled) { background: var(--subtle); border-color: var(--line-soft); }
.run-row.current { background: var(--subtle); box-shadow: inset 3px 0 0 var(--ink); }
.run-main strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.run-side { text-align: right; font-size: 13px; }
.feed { list-style: none; padding: 0; }
.feed-item { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 8px 0 8px 18px; }
.feed-item::before { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; border-left: 2px solid var(--line-soft); }
.feed-item::after { content: ""; position: absolute; left: 0; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 1.5px solid #9aa7b1; }
.feed-item.good::after { background: var(--good); border-color: var(--good); }
.feed-item.bad::after { background: var(--bad); border-color: var(--bad); }
.feed-time { font-size: 12.5px; color: var(--muted); }
.feed-text strong { font-weight: 600; }
.feed-link { font-size: 13px; color: var(--ink-2); white-space: nowrap; }

/* Lists of like things: whole-row links, no table chrome. */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.list-head, .list-row { display: grid; gap: 18px; align-items: center; padding: 10px 20px; }
.list-head { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.list-row { padding: 13px 20px; border-top: 1px solid var(--line-soft); color: inherit; text-decoration: none; }
.list-head + .list-row { border-top: 0; }
a.list-row:hover { background: var(--subtle); }
.list-cell { min-width: 0; overflow-wrap: anywhere; }
.list-cell strong { font-weight: 600; }
.list-cell .when { display: block; font-size: 12.5px; color: var(--muted); }
.device-card { display: grid; grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr)); gap: 24px; align-items: start; margin-bottom: 12px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.device-card:hover { border-color: var(--ink-2); }
.device-id { display: grid; gap: 8px; justify-items: start; }
.device-id strong { font-size: 15px; }
.cell-label { display: block; font-size: 12px; color: var(--muted); }
.device-cell strong { display: block; font-size: 19px; line-height: 1.3; font-weight: 650; font-variant-numeric: tabular-nums; }
.device-cell .chips { margin-top: 4px; }
.stream-row { display: grid; grid-template-columns: minmax(0, 1.1fr) 0.7fr auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.stream-row:first-child { border-top: 0; padding-top: 0; }
.stream-row strong { font-weight: 600; }
.stream-row > :last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Radios page. */
.outage, .session { padding: 16px 0 4px; border-top: 1px solid var(--line-soft); }
.outage:first-of-type, .session:first-of-type { border-top: 0; padding-top: 0; }
.outage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 12px; }
.outage-head .when { color: var(--muted); font-size: 13px; }
.phases { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.phase { display: grid; gap: 8px; align-content: start; justify-items: start; padding: 14px 18px 16px; border-left: 1px solid var(--line-soft); }
.phase:first-child { border-left: 0; }
.phase.offline { background: var(--subtle); }
.phase h4 { margin: 0; }
.phase .bar-track { width: 100%; background: #dfe5ea; }
.phase-value { font-size: 13px; color: var(--muted); }
.phase-value strong { font-size: 24px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 8px; list-style: none; padding: 0; counter-reset: step; }
.step { counter-increment: step; padding: 8px 8px 10px; border-top: 3px solid var(--line); min-width: 0; }
.step.done { border-top-color: var(--good); }
.step.blocked { border-top-color: var(--bad); background: var(--bad-bg); border-radius: 0 0 6px 6px; }
.step-name { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.step-name::before { content: counter(step) ". "; color: var(--muted); font-weight: 400; }
.step-outcome, .step-reason { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.step.done .step-outcome { color: var(--good); font-weight: 550; }
.step.blocked .step-outcome { color: var(--bad); font-weight: 650; }

/* Test run detail. */
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.detail-head button { margin-left: auto; }
.detail-reason { margin-top: 10px; font-size: 15px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 24px; }
.check { display: flex; align-items: baseline; gap: 9px; }
.check-mark { flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; transform: translateY(2px); }
.check.yes .check-mark { background: var(--good-bg); color: var(--good); }
.check.no .check-mark { background: var(--bad); color: #fff; }
.check.no .check-name { font-weight: 650; }
.check.maybe .check-mark { background: var(--subtle); color: var(--muted); }

/* Tables, kept for record lists, the evidence drawer and the control view. */
.table-scroll { overflow-x: auto; margin: 4px 0 10px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
caption { text-align: left; padding: 0 0 6px; font-size: 12.5px; color: var(--muted); }
th { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:last-child > td { border-bottom: 0; }
table.compact td { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
table.compact td:last-child { text-align: right; padding-right: 0; }
table.compact button { border: 0; padding: 2px 0; background: none; color: var(--ink-2); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
table.compact button:hover { color: var(--ink); background: none; }
.sort-button { border: 0; padding: 0; background: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.field-table td:first-child { width: 44%; color: var(--muted); }
.row-toggle { font-size: 12.5px; padding: 3px 10px; }
.row-detail > td { padding: 0 0 12px; }
details { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
summary { padding: 8px 12px; cursor: pointer; overflow-wrap: anywhere; }
.detail-body { padding: 8px 14px 14px; }
.provenance { margin: 8px 0; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
#scrim { position: fixed; inset: 0; z-index: 19; background: rgba(16, 28, 38, 0.3); }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 20; width: min(580px, 100vw); padding: 0 22px 28px; overflow: auto; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(16, 28, 38, 0.18); }
.drawer-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; padding: 16px 0 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; letter-spacing: 0; overflow-wrap: anywhere; }
#drawer h3 { font-size: 14px; font-weight: 650; margin: 20px 0 6px; }
.section-heading { margin-bottom: 14px; }
.control-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 16px 0; }
.control-form label { font-size: 13px; }
#operator-secret { width: min(360px, 100%); }
#policy-revision { width: 160px; }

@media (max-width: 1100px) {
  .grid > .span-8, .grid > .span-7, .grid > .span-5, .grid > .span-4 { grid-column: span 12; }
  .device-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-id { grid-column: span 2; }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 14px; }
  .brand { padding: 0; display: flex; align-items: baseline; gap: 8px; }
  nav { order: 3; flex-basis: 100%; flex-direction: row; margin-top: 0; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .nav-group { display: none; }
  .refresh-controls { margin: 0 0 0 auto; padding: 0; border: 0; display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
  main { padding: 20px 14px 40px; }
  h2 { font-size: 23px; }
  .grid { gap: 14px; }
  .grid > .span-6 { grid-column: span 12; }
  .path, .path.three { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 0; }
  .stage::before { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
  .phases { grid-template-columns: minmax(0, 1fr); }
  .phase { border-left: 0; border-top: 1px solid var(--line-soft); }
  .phase:first-child { border-top: 0; }
  .list-head { display: none; }
  .list-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px 16px; }
  .list-cell::before { content: attr(data-label); display: block; font-size: 12px; color: var(--muted); }
  .checks { grid-template-columns: minmax(0, 1fr); }
  .field input[type="search"] { width: 100%; }
}
@media (max-width: 520px) {
  .path, .path.three { grid-template-columns: minmax(0, 1fr); }
  .stage-value { font-size: 30px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .device-card { grid-template-columns: minmax(0, 1fr); }
  .device-id { grid-column: auto; }
  .run-row { grid-template-columns: minmax(0, 1fr) auto; }
  .run-row .state { grid-column: span 2; justify-self: start; }
  .feed-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bar-row .bar-track { grid-column: span 2; order: 3; }
  .stream-row { grid-template-columns: minmax(0, 1fr) auto; }
  .legend-range { margin-left: 0; flex-basis: 100%; }
  .control-form { align-items: stretch; flex-direction: column; }
  .control-form input, #operator-secret, #policy-revision { width: 100%; }
}
