/* Development Control Room (contracts/hq/dcr_live_v1.md). Colour is never the only carrier of meaning:
   every state has a glyph shape and a text label. Motion only marks a recorded change, and stops under
   prefers-reduced-motion. */
:root {
  --bg: #0b0f14; --bg-2: #0f141b; --panel: #121922; --panel-2: #172030; --line: #243041; --line-2: #2f3d52;
  --text: #e7edf4; --text-2: #c3cdd8; --muted: #9aa8b8; --faint: #8796a8; --field: #7f8ea0;
  --accent: #5cc8ff; --accent-ink: #04121c;
  --active: #5cc8ff; --eval: #b9a2ff; --integrate: #55e0cf; --waiting: #9fb0c2; --attention: #ffc24d;
  --problem: #ff7a7a; --gate: #ffc24d; --done: #52d69a; --neutral: #8b98a8;
  --demo: #ff6fd8; --demo-bg: #2a1028;
  --live: #52d69a; --stale: #ff7a7a; --late: #ffc24d;
  --shadow: 0 1px 0 rgb(255 255 255 / 3%) inset, 0 8px 24px rgb(0 0 0 / 35%);
  --radius: 10px; --radius-sm: 6px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef1f5; --bg-2: #e6eaf0; --panel: #ffffff; --panel-2: #f5f7fa; --line: #d6dde6; --line-2: #c4cedb;
    --text: #111821; --text-2: #2b3746; --muted: #4f5d6e; --faint: #5c6a7b; --field: #6b7888;
    --accent: #0a62b8; --accent-ink: #ffffff;
    --active: #0a62b8; --eval: #6b46c1; --integrate: #0f766e; --waiting: #5b6b7d; --attention: #9a5b00;
    --problem: #c22b2b; --gate: #9a5b00; --done: #1c7c4c; --neutral: #5b6b7d;
    --demo: #a3127e; --demo-bg: #fde7f6;
    --live: #1c7c4c; --stale: #c22b2b; --late: #9a5b00;
    --shadow: 0 1px 2px rgb(16 24 40 / 6%), 0 4px 16px rgb(16 24 40 / 6%);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body.dcr {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "tnum" 1, "cv11" 1;
  min-height: 100vh;
}
.mono { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent); }

/* ---- buttons ------------------------------------------------------------------------------------ */
.btn { font: inherit; font-weight: 600; font-size: 13px; color: var(--accent-ink); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }
.btn.small { padding: 4px 10px; font-size: 12.5px; min-height: 28px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---- mission bar -------------------------------------------------------------------------------- */
.mc-bar { position: sticky; top: 0; z-index: 20; display: grid; align-items: center; gap: 16px;
  grid-template-columns: auto auto 1fr auto; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.mc-brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark { width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--integrate)); box-shadow: 0 0 0 3px rgb(92 200 255 / 15%); }
.mc-brand-name { font-weight: 700; }
.mc-brand-room { color: var(--muted); font-weight: 500; padding-left: 10px; border-left: 1px solid var(--line-2); }
.mc-views { display: flex; flex-wrap: wrap; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.mc-view { font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); background: transparent; border: 0;
  border-radius: 6px; padding: 6px 12px; cursor: pointer; min-height: 30px; }
.mc-view[aria-current="page"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.mc-status { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.mc-actions { display: flex; gap: 8px; }
.source-badge { font-weight: 800; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 8px;
  border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.source-badge.live { color: var(--live); }
.source-badge.stale, .source-badge.snapshot, .source-badge.unavailable { color: var(--attention); }
.source-badge.fixture { color: var(--demo); background: var(--demo-bg); }
.mc-fresh, .mc-conductor { color: var(--text-2); font-size: 12.5px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.mc-conductor .k { color: var(--muted); }

/* ---- demo band ---------------------------------------------------------------------------------- */
.demo-band { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 10px 24px;
  background: repeating-linear-gradient(135deg, var(--demo-bg), var(--demo-bg) 14px,
    color-mix(in srgb, var(--demo-bg) 80%, var(--demo)) 14px, color-mix(in srgb, var(--demo-bg) 80%, var(--demo)) 16px);
  border-bottom: 2px solid var(--demo); color: var(--text); }
.demo-flag { display: flex; flex-direction: column; }
.demo-flag strong { color: var(--demo); letter-spacing: .14em; font-size: 13px; }
.demo-flag span { font-size: 12px; color: var(--text-2); }
.demo-step { display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.demo-count { font-weight: 800; white-space: nowrap; color: var(--demo); }
.demo-caption { color: var(--text); }
.demo-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.demo-range input { width: 160px; accent-color: var(--demo); }

.mc-error { margin: 0; padding: 0 24px; color: var(--problem); }
.mc-error:empty { display: none; }
.mc-main { padding: 20px 24px 64px; max-width: 1680px; margin: 0 auto; outline: none; }
.mc-unavailable { max-width: 720px; margin: 64px auto; padding: 32px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); }
.mc-unavailable h1 { font-size: 22px; margin-bottom: 8px; }

/* ---- panels ------------------------------------------------------------------------------------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2, .sub { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.sub { margin: 16px 0 8px; font-size: 12px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.eyebrow-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.view-title { font-size: 20px; }

/* ---- overview ----------------------------------------------------------------------------------- */
.ov-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.ov-objective { grid-column: span 8; padding: 20px 22px; }
.ov-health { grid-column: span 4; padding: 20px 22px; }
.ov-triad { grid-column: span 12; display: grid; grid-template-columns: 1fr 28px 1fr 28px 1fr; align-items: stretch; padding: 0; }
.ov-gates { grid-column: span 12; }
.ov-workstreams { grid-column: span 8; }
.ov-capacity { grid-column: span 4; }
.ov-exceptions { grid-column: span 6; }
.ov-recent { grid-column: span 6; }
.ov-lifecycle { grid-column: span 12; }
.ov-held { grid-column: span 12; }
@media (max-width: 1100px) {
  .ov-objective, .ov-health, .ov-workstreams, .ov-capacity, .ov-exceptions, .ov-recent,
  .ov-lifecycle, .ov-held { grid-column: span 12; }
  .mc-bar { grid-template-columns: 1fr auto; }
  .mc-status { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 720px) {
  .ov-triad { grid-template-columns: 1fr; }
  .triad-arrow { display: none; }
  .mc-main, .mc-bar, .demo-band { padding-left: 16px; padding-right: 16px; }
  .demo-band { grid-template-columns: 1fr; }
  .mc-views { grid-column: 1 / -1; }
}
.obj-title { font-size: 26px; line-height: 1.2; margin: 10px 0 8px; font-weight: 700; }
.obj-outcome { color: var(--text-2); margin: 0 0 16px; max-width: 72ch; }
.obj-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.obj-progress .figure { font-size: 22px; font-weight: 800; }
.obj-progress .figure small { font-size: 13px; color: var(--muted); font-weight: 600; }
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; flex: 1; height: 10px; }
.segments span { border-radius: 3px; background: var(--line); }
.segments span.achieved { background: var(--done); }
.segments span.not_achieved { background: var(--problem); }
.criteria { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.criteria li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); }
.crit-mark { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--waiting); margin-top: 1px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; }
.crit-mark.achieved { border-color: var(--done); background: var(--done); color: var(--bg); }
.crit-mark.not_achieved { border-color: var(--problem); color: var(--problem); }
.crit-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.crit-state.achieved { color: var(--done); }

.health-verdict { font-size: 28px; font-weight: 800; margin: 8px 0 4px; display: flex; align-items: center; gap: 10px; }
.health-verdict.healthy { color: var(--done); }
.health-verdict.attention { color: var(--attention); }
.health-verdict.degraded { color: var(--problem); }
.health-verdict.idle, .health-verdict.unknown, .health-verdict.not_running { color: var(--text-2); }
.health-moving { color: var(--text-2); margin: 0 0 10px; }
.reasons { margin: 0; padding-left: 18px; color: var(--text-2); display: grid; gap: 4px; }

.triad-cell { padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.triad-cell .eyebrow { display: flex; justify-content: space-between; gap: 8px; }
.triad-figure { font-size: 24px; font-weight: 800; line-height: 1.1; }
.triad-figure small { font-size: 13px; font-weight: 600; color: var(--muted); }
.triad-note { color: var(--text-2); font-size: 13px; }
.triad-arrow { position: relative; border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel-2); }
.triad-arrow::after { content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -6px;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }
.mini-states { display: flex; flex-wrap: wrap; gap: 6px; }

/* gates */
.gate-quiet { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border: 1px dashed var(--line-2);
  border-radius: var(--radius); color: var(--muted); }
.gate-card { border: 1px solid var(--gate); border-left-width: 6px; border-radius: var(--radius); background:
  linear-gradient(90deg, color-mix(in srgb, var(--gate) 12%, var(--panel)), var(--panel) 45%); padding: 18px 20px;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px 28px; box-shadow: var(--shadow); }
.gate-card + .gate-card { margin-top: 12px; }
.gate-card h3 { font-size: 20px; margin: 4px 0 6px; }
.gate-card .gate-eyebrow { color: var(--gate); font-weight: 800; letter-spacing: .12em; font-size: 12px; text-transform: uppercase; }
.gate-card dl { margin: 0; display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; }
.gate-card dt { color: var(--muted); font-size: 12.5px; }
.gate-card dd { margin: 0; color: var(--text); }
.gate-card .continues { border-left: 1px solid var(--line-2); padding-left: 20px; }
.gate-card .continues h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.gate-card.released { border-color: var(--line-2); background: var(--panel); }
.gate-card.released .gate-eyebrow { color: var(--done); }
@media (max-width: 900px) { .gate-card { grid-template-columns: 1fr; } .gate-card .continues { border-left: 0; padding-left: 0; } }

/* workstreams */
.ws-scale, .ws-track { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.ws-scale { margin-left: 200px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.ws-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ws-row { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 4px; align-items: center; }
.ws-name { display: flex; flex-direction: column; min-width: 0; }
.ws-name strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-name span { font-size: 12px; color: var(--muted); }
.ws-cell { min-height: 30px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); display: flex;
  flex-wrap: wrap; gap: 4px; padding: 4px; align-content: center; }
.ws-dot { font: inherit; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); background: var(--panel);
  border-radius: 4px; padding: 1px 6px 1px 4px; cursor: pointer; color: var(--text-2); font-size: 11.5px; min-height: 22px; }
.ws-dot:hover { border-color: var(--accent); color: var(--text); }
@media (max-width: 720px) { .ws-scale { display: none; } .ws-row { grid-template-columns: 1fr; } }

/* capacity */
.cap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cap-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.cap-row .cap-name { font-weight: 700; }
.cap-row .cap-meta { color: var(--muted); font-size: 12px; }
.cap-slots { grid-column: 1 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; }
.slot { height: 26px; border-radius: 4px; border: 1px dashed var(--line-2); font-size: 11.5px; display: flex; align-items: center;
  padding: 0 6px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.slot.busy { border-style: solid; border-color: color-mix(in srgb, var(--active) 60%, var(--line)); background: color-mix(in srgb, var(--active) 14%, var(--panel)); color: var(--text); cursor: pointer; font: inherit; font-size: 11.5px; }
.slot.unavailable { background: repeating-linear-gradient(135deg, var(--panel-2), var(--panel-2) 6px, var(--line) 6px, var(--line) 7px); }
.role-badge { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--text-2); }
.role-badge.verify { color: var(--eval); border-color: color-mix(in srgb, var(--eval) 50%, var(--line)); }
.idle-list, .exc-list, .recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.idle-list li { font-size: 12.5px; color: var(--text-2); display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.idle-list .free { font-weight: 700; color: var(--text); white-space: nowrap; }

/* exceptions and recent */
.exc-list li, .recent-list li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.exc-list li button, .recent-list li button { font: inherit; text-align: left; background: none; border: 0; color: var(--text); padding: 0; cursor: pointer; }
.exc-why, .rec-meta { color: var(--muted); font-size: 12.5px; display: block; }
.empty-line { color: var(--muted); font-style: italic; }
.time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---- glyphs, chips, heartbeat -------------------------------------------------------------------- */
.glyph { display: inline-block; width: 11px; height: 11px; flex: none; vertical-align: middle; }
.g-active { border-radius: 50%; background: var(--active); }
.g-eval { border-radius: 50%; background: var(--eval); }
.g-integrate { border-radius: 50%; background: var(--integrate); }
.g-waiting { border-radius: 50%; border: 2px solid var(--waiting); }
.g-attention { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 11px solid var(--attention); }
.g-problem { background: var(--problem); border-radius: 2px; }
.g-gate { width: 10px; height: 10px; border: 2px solid var(--gate); transform: rotate(45deg); }
.g-done { width: 6px; height: 11px; border-right: 3px solid var(--done); border-bottom: 3px solid var(--done); transform: rotate(40deg) translate(-1px, -2px); }
.g-neutral { border-radius: 50%; border: 2px dotted var(--neutral); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; border: 1px solid var(--line-2); color: var(--text-2); white-space: nowrap; }
.chip.f-active { color: var(--active); border-color: color-mix(in srgb, var(--active) 45%, var(--line)); }
.chip.f-eval { color: var(--eval); border-color: color-mix(in srgb, var(--eval) 45%, var(--line)); }
.chip.f-integrate { color: var(--integrate); border-color: color-mix(in srgb, var(--integrate) 45%, var(--line)); }
.chip.f-attention, .chip.f-gate { color: var(--attention); border-color: color-mix(in srgb, var(--attention) 45%, var(--line)); }
.chip.f-problem { color: var(--problem); border-color: color-mix(in srgb, var(--problem) 45%, var(--line)); }
.chip.f-done { color: var(--done); border-color: color-mix(in srgb, var(--done) 45%, var(--line)); }
.hb { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
/* Heartbeat: shape and colour both carry the state (live filled circle, late ring, overdue square, none hollow,
   not observable dotted). The pulse animates a compositor-only ring, and only while the view is live. */
.hb { position: relative; }
.hb-live { background: var(--live); }
.hb-live.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live);
  animation: beat 2.4s ease-out infinite; }
.hb-late { border: 3px solid var(--late); background: transparent; }
.hb-stale { background: var(--stale); border-radius: 1px; }
.hb-none { border: 2px solid var(--faint); }
.hb-unknown { border: 2px dotted var(--faint); }
@keyframes beat { 0% { transform: scale(.6); opacity: .9; } 80% { transform: scale(1.4); opacity: 0; } 100% { opacity: 0; } }
.na { color: var(--muted); }
/* Lifecycle stages: every status is a word and a mark shape, never colour alone; nothing here moves. */
.lc-list, .lc-unobserved, .held-list, .res-unknown, .ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lc-list li, .ladder li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.lc-unobserved li, .held-list li, .res-unknown li { display: grid; gap: 2px; }
.st-mark { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; border-radius: 4px; border: 1px solid var(--line); }
.st-observed { color: var(--done); border-style: solid; }
.st-no_record { color: var(--muted); border-style: dotted; }
.st-unobserved { color: var(--attention); border-style: dashed; }
.st-not_applicable { color: var(--muted); border-style: double; }
.st-current { color: var(--accent); border-width: 2px; }
.lc-list button { font: inherit; text-align: left; background: none; border: 0; color: var(--text); padding: 0; cursor: pointer; text-decoration: underline; }
.res-box summary, #held-box summary { cursor: pointer; font-weight: 700; }
.st-word { font-size: 12px; font-weight: 700; color: var(--text-2); }
.ladder .why, .lc-unobserved .why, .held-list .why, .res-unknown .why { display: block; font-size: 12px; color: var(--muted); }
.warn-line { color: var(--problem); font-weight: 700; }
.na .na-label { font-weight: 700; color: var(--text-2); }
.na .na-why { display: block; font-size: 12px; }

/* ---- operations floor ------------------------------------------------------------------------------ */
.ops-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.ops-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); }
.seg-btn { font: inherit; font-size: 12.5px; font-weight: 600; background: none; border: 0; color: var(--muted); padding: 5px 10px; border-radius: 6px; cursor: pointer; min-height: 28px; }
.seg-btn[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.ops-search input, input[type="search"] { font: inherit; background: var(--panel); color: var(--text); border: 1px solid var(--field);
  border-radius: 6px; padding: 6px 10px; min-width: 0; width: 240px; max-width: 100%; min-height: 32px; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 13px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.lg { display: inline-flex; gap: 6px; align-items: center; }
.line { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--line-2); }
.line.l-dep { border-top-color: var(--faint); }
.line.l-col { border-top: 2px dashed var(--attention); }
.floor-wrap { position: relative; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background:
  radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 0) 0 0 / 18px 18px, var(--bg-2); }
.floor { position: relative; z-index: 1; display: grid; grid-template-columns: 170px repeat(6, minmax(190px, 1fr)); min-width: 1320px; }
.floor-links { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: visible; }
.floor-links path { fill: none; stroke-width: 1.5; }
.floor-links path.depends { stroke: var(--faint); }
.floor-links path.collision { stroke: var(--attention); stroke-dasharray: 5 4; }
.floor-links path.focus { stroke: var(--accent); stroke-width: 2; }
.lane-head, .zone-head { position: relative; z-index: 1; }
.zone-head { position: sticky; top: 0; padding: 10px 12px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-2); border-bottom: 1px solid var(--line); background: var(--panel);
  display: flex; justify-content: space-between; gap: 8px; }
.zone-head .n { color: var(--muted); font-weight: 600; }
.zone-head.z-gate { color: var(--gate); }
.lane-head { padding: 12px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel);
  display: flex; flex-direction: column; gap: 2px; }
.lane-head strong { font-size: 13px; }
.lane-head span { font-size: 12px; color: var(--muted); }
.cell { position: relative; padding: 8px; border-bottom: 1px solid var(--line); border-right: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  display: flex; flex-direction: column; gap: 8px; min-height: 72px; }
.cell.z-gate { background: color-mix(in srgb, var(--gate) 4%, transparent); }
.tile { font: inherit; text-align: left; color: var(--text); background: var(--panel); border: 1px solid var(--line-2);
  border-left: 4px solid var(--neutral); border-radius: 8px; padding: 8px 10px; cursor: pointer; display: grid; gap: 4px;
  box-shadow: var(--shadow); position: relative; }
.tile:hover { border-color: var(--accent); }
.tile[aria-current="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.tile.f-active { border-left-color: var(--active); }
.tile.f-eval { border-left-color: var(--eval); }
.tile.f-integrate { border-left-color: var(--integrate); }
.tile.f-waiting { border-left-color: var(--waiting); background: color-mix(in srgb, var(--panel) 85%, var(--bg)); }
.tile.f-attention { border-left-color: var(--attention); }
.tile.f-gate { border-left-color: var(--gate); }
.tile.f-problem { border-left-color: var(--problem); }
.tile.f-done { border-left-color: var(--done); background: color-mix(in srgb, var(--panel) 80%, var(--bg)); }
.tile .t-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.tile .t-id { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted); }
.tile .t-title { font-weight: 650; font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.tile .t-state { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); }
.tile .t-agent { display: block; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.tile .t-agent.late { color: var(--late); font-weight: 700; }
.tile .t-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--text); }
.badge.rework { border-color: var(--attention); }
.badge.recover { border-color: var(--problem); }
.tile.changed::after { content: ""; position: absolute; inset: -3px; border-radius: 10px; border: 2px solid var(--accent); animation: changed 1.6s ease-out forwards; pointer-events: none; }
@keyframes changed { from { opacity: 1; } to { opacity: 0; } }
.ops-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-top: 16px; }
@media (max-width: 1100px) { .ops-lower { grid-template-columns: 1fr; } }
.rack { display: grid; gap: 12px; }
.roster { display: grid; gap: 14px; max-height: 520px; overflow: auto; }
.roster h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.agent-card { font: inherit; text-align: left; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px;
  color: var(--text); cursor: pointer; display: grid; gap: 2px; }
.agent-card:hover { border-color: var(--accent); }
.agent-card .a-top { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.agent-card .a-role { font-weight: 650; font-size: 12.5px; }
.agent-card .a-meta { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }

/* ---- evidence log ------------------------------------------------------------------------------------ */
.ev-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ev-wrap { overflow-x: auto; }
.ev-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2);
  padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.ev-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13px; }
.ev-table td:first-child { white-space: nowrap; color: var(--muted); }
.ev-table tr.t-bad td:last-child { color: var(--problem); }
.ev-table tr.t-good td:last-child { color: var(--done); }
.ev-table tr.t-gate td:last-child { color: var(--attention); }
.ev-table button { font: inherit; background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; }
.raw { margin-top: 16px; }
.raw pre { max-height: 480px; overflow: auto; background: var(--panel); border: 1px solid var(--line); padding: 12px; border-radius: var(--radius-sm); white-space: pre-wrap; }

/* ---- inspector --------------------------------------------------------------------------------------- */
.inspector { position: fixed; top: var(--ins-top, 0px); right: 0; bottom: 0; width: var(--ins-w); z-index: 30; background: var(--panel);
  border-left: 1px solid var(--line-2); box-shadow: -12px 0 32px rgb(0 0 0 / 35%); display: flex; flex-direction: column; }
.ins-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.ins-head h2 { font-size: 19px; margin: 4px 0; outline: none; }
.ins-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 2px; padding: 6px 12px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs [role="tab"] { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 8px 10px; cursor: pointer; white-space: nowrap; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ins-panel { padding: 14px 18px 40px; overflow: auto; flex: 1; }
.ins-head .btn { align-self: flex-start; }
.ins-panel h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); margin: 18px 0 8px; }
.ins-panel h3:first-child { margin-top: 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.plain { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.finding { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; margin-bottom: 6px; background: var(--panel-2); }
.finding .sev { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.sev.High, .sev.Critical { color: var(--problem); }
.sev.Medium { color: var(--attention); }
.sev.Low { color: var(--muted); }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stepper li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 5px; }
.stepper li .n { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-flex; align-items: center;
  justify-content: center; font-size: 11px; color: var(--muted); }
.stepper li.proven { background: var(--panel-2); }
.stepper li.proven .n { background: var(--done); border-color: var(--done); color: var(--bg); font-weight: 800; }
.stepper li.absent { color: var(--muted); }
.ins-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ins-table th, .ins-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ins-table th { color: var(--muted); font-weight: 600; }
.ins-panel pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; overflow: auto; max-height: 360px; white-space: pre-wrap; }
.agent-block { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--panel-2); }
.agent-block.current { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.agent-block h4 { margin: 0 0 6px; font-size: 13.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.linklike { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.linklike:hover { text-decoration-color: var(--accent); }
.tile .t-agent.overdue { color: var(--problem); font-weight: 700; }
.tile .t-agent.overdue { white-space: normal; }
.gate-card > div { min-width: 0; }
.gate-card dd, .kv dd, .criteria li span { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 720px) {
  .gate-card dl, .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .gate-card dd, .kv dd { margin-bottom: 6px; }
  .mc-actions { flex-wrap: wrap; }
}

/* ---- review round 1 additions ------------------------------------------------------------------------- */
.mc-notlive { margin: 0; padding: 8px 24px; background: color-mix(in srgb, var(--attention) 14%, var(--bg)); color: var(--text);
  border-bottom: 1px solid var(--attention); font-weight: 600; }
.demo-future { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-2); }
.demo-future summary { cursor: pointer; font-weight: 700; }
.demo-future ul { margin: 4px 0 0; padding-left: 18px; }
.demo-flag strong { background: var(--panel); padding: 0 6px; border-radius: 3px; align-self: flex-start; }
.ov-gates.waiting { order: -1; }
.gate-ahead { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.gate-ahead li { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; padding: 8px 12px;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); color: var(--text-2); }
.gate-more { margin-top: 10px; }
.gate-more summary { cursor: pointer; font-weight: 700; color: var(--gate); }
.ws-more { font-size: 12px; color: var(--muted); align-self: center; padding: 0 4px; }
.lane-head { margin: 0; font-size: inherit; font-weight: inherit; }
.ins-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
:root { --ins-w: clamp(380px, 40vw, 560px); }
@media (min-width: 901px) { body.ins-open .mc-main { margin-right: var(--ins-w); } }
@media (max-width: 900px) { .inspector { top: 0; width: 100vw; } }
@media (max-width: 720px), (max-height: 560px) {
  .mc-bar { position: static; }
  .mc-fresh { white-space: normal; }
  .mc-notlive { padding: 8px 16px; }
}
@media (max-width: 720px) {
  .mc-bar { grid-template-columns: minmax(0, 1fr); }
  .mc-views, .mc-status, .mc-actions { min-width: 0; max-width: 100%; }
  .mc-status { flex-wrap: wrap; justify-content: flex-start; }
  .obj-progress { flex-wrap: wrap; }
  .obj-progress .segments { flex-basis: 100%; }
  .mc-view { padding: 6px 8px; }
}
html, body.dcr { overflow-x: clip; }  /* decorative glyph transforms only; no content box exceeds the viewport (tested at 320 px) */

html { scroll-padding-top: var(--bar-h, 0px); }
#main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gate-card h3 { overflow-wrap: anywhere; }
.demo-count { background: var(--panel); padding: 0 6px; border-radius: 3px; }
@media (max-width: 1400px) {
  .demo-band { grid-template-columns: minmax(0, 1fr) auto; }
  .demo-step { grid-column: 1 / -1; order: 3; }
  .demo-future { order: 4; }
}
