/* Clockbot dashboard: the night dial. Dark page, the logo's twelve hour blocks as the incident clock. */

@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans-var.woff2") format("woff2");
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/static/fonts/martian-mono-var.woff2") format("woff2");
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --bg: #05070f;
  --bg-1: #080b18;
  --panel-a: rgba(15, 21, 48, 0.74);
  --panel-b: rgba(8, 11, 26, 0.74);
  --line: rgba(154, 174, 255, 0.11);
  --line-2: rgba(154, 174, 255, 0.22);
  --ink: #e6e9f5;
  --ink-2: #aeb6d4;
  --ink-3: #7f8ab3;
  --ink-4: #535d82;
  --blue: #3354ff;
  --blue-2: #6f86ff;
  --blue-soft: #9aaeff;
  --green: #6ee7a8;
  --amber: #ffb547;
  --red: #ff4d5e;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Martian Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --pad: 22px;
  --gap: 14px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  background:
    radial-gradient(1100px 760px at 13% 46%, rgba(51, 84, 255, 0.11), transparent 62%),
    radial-gradient(800px 520px at 100% 0%, rgba(110, 231, 168, 0.035), transparent 60%),
    linear-gradient(180deg, #070a16 0%, var(--bg) 40%);
  background-color: var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: 0.01em; }
.dim { color: var(--ink-3); }
.warn-text { color: var(--amber); }
.ok-text { color: var(--green); }
.busy-text { color: var(--blue-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 12px; }
.noscript { padding: 24px; }

/* ---- the section label: a small hour block, then spaced capitals ---- */
.label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-weight: 500; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 12px; white-space: nowrap;
}
.label::before {
  content: ""; flex: none; width: 4px; height: 11px; background: var(--blue);
  box-shadow: 0 0 8px rgba(51, 84, 255, 0.8);
}
.label-note {
  margin-left: auto; font-family: var(--sans); font-size: 12px; letter-spacing: 0; text-transform: none;
  color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; min-width: 0;
}

/* ---- buttons, badges, tags ---- */
.btn {
  border: 1px solid var(--line-2); background: rgba(154, 174, 255, 0.06); color: var(--ink);
  border-radius: 9px; padding: 7px 14px; font-weight: 600; font-size: 13px; line-height: 1.2;
}
.btn:hover:not(:disabled) { border-color: var(--blue-soft); background: rgba(154, 174, 255, 0.12); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.quiet { background: transparent; }
.btn.approve { background: var(--green); border-color: var(--green); color: #03140b; }
.btn.approve:hover:not(:disabled) { background: #8af0bb; border-color: #8af0bb; }
.btn.deny:hover:not(:disabled) { border-color: var(--red); background: rgba(255, 77, 94, 0.1); }
.linkish {
  background: none; border: 0; padding: 0; color: var(--blue-soft); text-align: left;
  text-decoration: underline; text-decoration-color: rgba(154, 174, 255, 0.35); text-underline-offset: 3px;
}
.linkish:hover { text-decoration-color: var(--blue-soft); }
.badge {
  display: inline-block; font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 2px 7px 1px; border-radius: 4px; border: 1px solid currentColor;
  white-space: nowrap; vertical-align: 0.12em; line-height: 1.5;
}
.b-good { color: var(--green); background: rgba(110, 231, 168, 0.08); }
.b-bad { color: var(--red); background: rgba(255, 77, 94, 0.1); }
.b-warn { color: var(--amber); background: rgba(255, 181, 71, 0.08); }
.b-blue { color: var(--blue-soft); background: rgba(154, 174, 255, 0.07); }
.b-dim { color: var(--ink-3); border-color: var(--line-2); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px;
}
.tag.t-live { color: var(--green); border-color: rgba(110, 231, 168, 0.5); }
.tag.t-warn { color: var(--amber); border-color: rgba(255, 181, 71, 0.5); }
input[type="password"], input[type="text"] {
  background: rgba(3, 5, 12, 0.7); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 6px 10px; font-family: var(--mono); font-size: 12.5px; color: var(--ink); min-width: 0;
}
input::placeholder { color: var(--ink-4); }
input:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 1px; }

/* ---- header ---- */
.top {
  display: flex; align-items: center; gap: 22px; padding: 12px var(--pad);
  border-bottom: 1px solid var(--line); background: rgba(5, 7, 15, 0.55);
}
.brand { flex: none; line-height: 0; }
.brand img { display: block; height: 40px; width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 0; }
.chip {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 5px 11px 5px 10px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(8, 11, 24, 0.6);
  font-family: var(--mono); font-size: 11.5px; white-space: nowrap; max-width: 100%;
}
.chip-label { color: var(--ink-3); font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; }
.chip-value { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.chip.ok .chip-value::before, .chip.warn .chip-value::before, .chip.bad .chip-value::before, .chip.busy .chip-value::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: 0.08em;
  background: var(--green); box-shadow: 0 0 6px var(--green);
}
.chip.warn { border-color: rgba(255, 181, 71, 0.35); }
.chip.warn .chip-value { color: var(--amber); }
.chip.warn .chip-value::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.chip.bad { border-color: rgba(255, 77, 94, 0.55); background: rgba(255, 77, 94, 0.1); }
.chip.bad .chip-value { color: #ff8692; font-weight: 600; }
.chip.bad .chip-value::before { background: var(--red); box-shadow: 0 0 6px var(--red); }
.chip.busy .chip-value::before { background: var(--blue-soft); box-shadow: 0 0 6px var(--blue-soft); }

.killbox { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.kill-hint { order: -1; max-width: 300px; font-size: 12px; color: var(--ink-2); text-align: right; line-height: 1.3; }
.kill {
  display: grid; text-align: left; gap: 1px; min-width: 176px; padding: 8px 20px 9px 18px;
  border: 0; border-radius: 11px; background: var(--red); color: #1a0308;
  box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.5), 0 10px 32px rgba(255, 77, 94, 0.28);
  position: relative;
}
.kill::before {
  content: ""; position: absolute; right: 16px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: #1a0308; border-radius: 2px;
}
.kill:hover:not(:disabled) { background: #ff6371; }
.kill:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.kill-word { font-family: var(--mono); font-weight: 800; font-size: 17px; letter-spacing: 0.22em; text-transform: uppercase; line-height: 1.1; }
.kill-sub { font-size: 11.5px; font-weight: 600; opacity: 0.78; line-height: 1.1; padding-right: 26px; }
.kill.armed, .kill.armed:hover:not(:disabled) { background: #fff; color: var(--red); box-shadow: 0 0 0 3px var(--red), 0 10px 40px rgba(255, 77, 94, 0.45); }
.kill.armed::before { background: var(--red); }
.kill-cancel {
  border: 1px solid var(--line-2); background: transparent; border-radius: 9px; padding: 9px 12px;
  font-size: 13px; font-weight: 600;
}
.kill-cancel:hover { border-color: var(--ink-2); }

/* ---- lockdown band ---- */
.lockbar {
  display: flex; align-items: center; gap: 28px; padding: 13px var(--pad);
  background: repeating-linear-gradient(-45deg, rgba(255, 77, 94, 0.2) 0 16px, rgba(255, 77, 94, 0.12) 16px 32px);
  border-bottom: 1px solid rgba(255, 77, 94, 0.6); border-top: 1px solid rgba(255, 77, 94, 0.6);
}
.lockbar[hidden] { display: none; }
.lock-text { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 18px; }
#lock-title {
  font-family: var(--mono); font-size: 16px; font-weight: 800; letter-spacing: 0.24em; text-transform: uppercase;
  color: #fff; white-space: nowrap; display: flex; align-items: center; gap: 12px;
}
#lock-title::before { content: ""; width: 12px; height: 12px; background: var(--red); box-shadow: 0 0 10px var(--red); }
#lock-detail { color: #ffd9dd; font-size: 13.5px; }
.lock-form { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.lock-form label { font-size: 12px; color: #ffd9dd; }
.lock-form input { width: 160px; }
.lock-msg { flex-basis: 100%; text-align: right; font-size: 12.5px; color: #fff; min-height: 0; }
.lock-msg:empty { display: none; }
body.is-locked .kill { box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.5); }

/* ---- public demo banner ---- */
.public-banner {
  padding: 8px var(--pad);
  border-bottom: 1px solid var(--line);
  background: rgba(51, 84, 255, 0.09);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
}
body.is-public .killbox,
body.is-public .lock-form,
body.is-public .ap-token { display: none; }

/* ---- app health ---- */
.health {
  display: grid; grid-template-columns: minmax(170px, auto) minmax(0, 1fr); align-items: stretch; gap: 0 22px;
  padding: 12px var(--pad); border-bottom: 1px solid var(--line); background: rgba(5, 7, 15, 0.35);
}
.health-head { display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.health-head .label { margin: 0; }
.headline { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.headline.quiet { color: var(--green); }
.headline.noisy { color: var(--amber); }
.health-live { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.health-live.bad { color: var(--amber); }
.flags { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.flag { font-family: var(--mono); font-size: 10px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }
.flag b { color: var(--ink-2); font-weight: 500; }
.flag.odd { border-color: rgba(255, 181, 71, 0.5); color: var(--amber); }
.flag.odd b { color: var(--amber); }
.flag.bad { color: var(--amber); }
.readings { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); min-width: 0; }
.reading { padding: 2px 16px; border-left: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.r-top { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.r-name {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.r-short { display: none; }
.r-verdict { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.reading.good .r-verdict { color: var(--green); }
.reading.bad .r-verdict { color: var(--red); }
.r-mid { display: flex; align-items: center; gap: 10px; min-width: 0; }
.r-val {
  font-family: var(--mono); font-size: 21px; font-weight: 400; font-stretch: 100%; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap;
}
.reading.bad .r-val { color: #ff7d8a; }
.reading.nodata .r-val { color: var(--ink-4); font-size: 15px; font-style: italic; letter-spacing: 0; padding: 3px 0 2px; }
.r-spark { flex: 1; min-width: 0; display: flex; justify-content: flex-end; height: 30px; align-items: center; }
.spark { width: 100%; max-width: 132px; height: 30px; overflow: visible; }
.spark-line { fill: none; stroke: var(--blue-2); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.reading.bad .spark-line { stroke: #ff7d8a; }
.spark-limit { stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 2 3; }
.spark-end { fill: var(--ink); }
.spark-dot { fill: var(--blue-2); }
.spark-none { font-size: 11px; color: var(--ink-4); }
.r-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reading.nodata .r-sub { color: var(--amber); }
.health-err { grid-column: 1 / -1; margin-top: 8px; font-size: 13px; color: var(--amber); }
.health-err[hidden] { display: none; }

/* ---- main grid ---- */
.grid { padding: var(--gap) var(--pad) var(--pad); display: grid; gap: var(--gap); }
.panel {
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px;
  min-width: 0; min-height: 0; display: flex; flex-direction: column;
}
.clock { grid-area: clock; }
.log { grid-area: log; padding-bottom: 6px; }
.log:focus { outline: none; }
.log:focus-visible { outline: 2px solid var(--blue-soft); }
.side { grid-area: side; display: flex; flex-direction: column; gap: var(--gap); min-height: 0; min-width: 0; }
.break { grid-area: break; }
.scroll { overflow-y: auto; min-height: 0; flex: 1; margin-right: -10px; padding-right: 10px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.none { color: var(--ink-3); font-size: 13px; }

/* ---- the dial ---- */
.dial-wrap { flex: 1 1 auto; min-height: 0; display: grid; place-items: center; container-type: size; }
.dial { position: relative; width: min(100cqw, 100cqh); aspect-ratio: 1; container-type: inline-size; }
.dial-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.face { opacity: 0.9; }
.bezel { fill: none; stroke: rgba(154, 174, 255, 0.13); stroke-width: 0.22; }
.blk-base { fill: #9aaeff; opacity: 0.17; }
.blk-base.idle { opacity: 0.13; }
.blk-fill.live { filter: url(#soft); animation: blk-live 2.4s ease-in-out infinite; }
.blk-over.live { filter: url(#soft); animation: blk-live 2.4s ease-in-out infinite; }
@keyframes blk-live { 50% { opacity: 0.72; } }
.blk-stop.s-handover { fill: none; stroke: var(--ink); stroke-width: 0.8; }
.blk-stop.s-noaction { opacity: 0.6; }
.blk-stop.s-reset { opacity: 0.8; }
.mark { stroke: var(--bg); stroke-width: 0.5; fill: var(--ink); }
.mark.m-refused, .mark.m-ask, .mark.m-page { fill: var(--amber); }
.mark.m-fyi { fill: var(--blue-soft); }
.mark.m-kill { fill: var(--red); }
.dial-center {
  position: absolute; left: 50%; top: 50%; width: 40%; height: 40%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none; gap: 0.5cqi;
}
.dc-top { font-family: var(--mono); font-stretch: 87.5%; font-size: max(9px, 2.05cqi); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.dc-time {
  font-family: var(--mono); font-weight: 300; font-stretch: 112.5%; font-size: 11.6cqi; line-height: 1;
  letter-spacing: -0.04em; font-variant-numeric: tabular-nums; color: var(--ink); margin: 0.6cqi 0 0.9cqi; white-space: nowrap;
}
.dc-word { font-family: var(--sans); font-weight: 700; font-stretch: 100%; font-size: max(11px, 3.3cqi); letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue-soft); white-space: nowrap; }
.dc-sub { font-family: var(--mono); font-stretch: 87.5%; font-size: max(9px, 2.05cqi); color: var(--ink-3); letter-spacing: 0.02em; white-space: nowrap; }
.dial.st-idle .dc-time { color: var(--ink-2); font-weight: 200; }
.dial.st-idle .dc-word { color: var(--ink-3); }
.dial.st-recovered .dc-word, .dial.st-holding .dc-word { color: var(--green); text-shadow: 0 0 18px rgba(110, 231, 168, 0.45); }
.dial.st-killed .dc-word { color: var(--red); }
.dial.st-handover .dc-word { color: var(--ink); }
.dial.st-waiting .dc-word { color: var(--amber); }
.dial.st-noaction .dc-word { color: var(--blue-soft); }
.dial.over .dc-time, .dial.has-over .dc-sub { color: var(--amber); }
.dial.over .dc-word { color: var(--amber); }

.readout { flex: none; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 10px; display: grid; gap: 6px; }
.rail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 2px 0 4px; }
.rail li { display: grid; gap: 3px; min-width: 0; }
.rail-bar { height: 4px; background: rgba(154, 174, 255, 0.14); }
.rail li.done .rail-bar { background: var(--blue); box-shadow: 0 0 6px rgba(51, 84, 255, 0.7); }
.rail li.good .rail-bar { background: var(--green); box-shadow: 0 0 8px rgba(110, 231, 168, 0.8); }
.rail li.bad .rail-bar { background: var(--red); }
.rail li.warn .rail-bar { background: var(--amber); }
.rail li.now .rail-bar { background: linear-gradient(90deg, var(--blue) 0 50%, rgba(154, 174, 255, 0.14) 50%); }
.rail-k { font-family: var(--mono); font-stretch: 87.5%; font-size: 9.5px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail li.done .rail-k, .rail li.good .rail-k { color: var(--ink-2); }
.rail-t { font-family: var(--mono); font-size: 11px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rail li:not(.done):not(.good):not(.bad):not(.warn) .rail-t { color: var(--ink-4); }
.ro-title { font-size: 19px; font-weight: 600; letter-spacing: -0.005em; line-height: 1.2; overflow-wrap: anywhere; }
.ro-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ink-3); }
.ro-line { font-size: 13px; color: var(--ink-2); }
.ro-line.dim { color: var(--ink-3); }

/* ---- shift log (the timeline) ---- */
.log-head { flex: none; display: grid; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.log-head .label { margin-bottom: 0; }
.lh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.lh-alert { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.chain { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.chain.ok { color: var(--green); }
.chain.ok::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: 0.05em; }
.chain.bad { color: var(--red); }
.pinned { font-size: 13px; color: var(--amber); display: flex; align-items: center; gap: 10px; }
.stale-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--amber); border-left: 3px solid var(--amber); padding: 6px 10px; border-radius: 6px; background: rgba(255, 176, 32, 0.07); }
.stale-note[hidden] { display: none; }
.think {
  border: 1px solid var(--line-2); border-left: 3px solid var(--blue); border-radius: 10px; padding: 10px 14px;
  background: rgba(51, 84, 255, 0.06); display: grid; gap: 4px;
}
.think.live { border-left-color: var(--green); background: rgba(110, 231, 168, 0.045); }
.think-k { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.think-conf { letter-spacing: 0.06em; text-transform: none; color: var(--ink-2); }
.think-text { font-size: 16.5px; line-height: 1.35; color: var(--ink); }
.think-why { font-size: 12.5px; color: var(--ink-2); }
.think-why.dim { color: var(--ink-3); }

.timeline {
  flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px 12px 0; margin-right: -10px; position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 16px);
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.ev {
  display: grid; grid-template-columns: 52px 96px minmax(0, 1fr); column-gap: 12px;
  padding: 10px 0 10px; border-bottom: 1px solid rgba(154, 174, 255, 0.06); position: relative;
}
.ev-time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); padding-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-verb {
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 0.14em; padding-top: 3px;
  display: flex; align-items: flex-start; gap: 8px; white-space: nowrap; color: var(--tone, var(--ink-3));
}
.ev-verb::before { content: ""; flex: none; width: 4px; height: 11px; margin-top: 1px; background: currentColor; opacity: 0.9; }
.ev-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; min-width: 0; }
.ev-title { grid-column: 1; font-size: 14.5px; line-height: 1.38; color: var(--ink); overflow-wrap: anywhere; }
.ev-sub { grid-column: 1 / -1; font-size: 12.5px; line-height: 1.42; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.ev-toggle {
  grid-column: 2; grid-row: 1; align-self: start; background: none; border: 1px solid transparent; border-radius: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-4); padding: 2px 6px; margin-top: 1px;
}
.ev:hover .ev-toggle, .ev-toggle:focus-visible, .ev-toggle[aria-expanded="true"] { color: var(--ink-2); border-color: var(--line-2); }
.ev-more { grid-column: 1 / -1; margin-top: 8px; padding: 10px 12px; border-radius: 8px; background: rgba(3, 5, 12, 0.6); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); display: grid; gap: 8px; }
.ev-more[hidden] { display: none; }
.ev.compact .ev-title { font-size: 13.5px; color: var(--ink-2); }
.ev.compact .ev-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.compact { padding: 7px 0; }
.ev.tone-good .ev-title { color: #c9f7de; }
.ev.tone-warn .ev-sub { color: #e2bf86; }
.ev.tone-bad .ev-title { color: #ffb3ba; }
.ev.tone-dim .ev-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(127, 138, 179, 0.5); }
.ev.new { animation: ev-in 0.5s ease-out; }
@keyframes ev-in { from { opacity: 0; transform: translateY(6px); } }
.t-saw { --tone: var(--blue-soft); }
.t-read { --tone: var(--ink-3); }
.t-think { --tone: var(--ink); }
.t-model { --tone: var(--ink-3); }
.t-ran { --tone: var(--blue-2); }
.t-good { --tone: var(--green); }
.t-warn { --tone: var(--amber); }
.t-bad { --tone: var(--red); }
.t-out { --tone: var(--ink); }
.t-dim { --tone: var(--ink-4); }
.ev.t-good .ev-verb::before { box-shadow: 0 0 8px var(--green); }
.ev.t-out { border-top: 1px solid var(--line-2); }
.untrusted-text::before { content: none; }
q.untrusted { quotes: "\201C" "\201D"; color: var(--ink-2); font-style: italic; }
.empty { padding: 26px 4px; display: grid; gap: 8px; max-width: 560px; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--ink-2); }
.empty-line { color: var(--ink-3); font-size: 13.5px; }

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 12px; font-size: 12.5px; }
.kv dt { color: var(--ink-3); font-family: var(--mono); font-size: 11px; padding-top: 1px; }
.kv dd { color: var(--ink-2); overflow-wrap: anywhere; }
.checks { display: grid; gap: 3px; }
.ck { font-size: 12.5px; color: var(--ink-2); }
.ck-state { display: inline-block; min-width: 64px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.ck-met .ck-state { color: var(--green); }
.ck-not_met .ck-state { color: var(--amber); }
.ck-gated .ck-state, .ck-not_checked .ck-state { color: var(--amber); }
.ck-src { color: var(--ink-4); }
.outc { display: grid; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.outc-h { color: var(--ink-2); }
.more-line { color: var(--ink-2); }
.steps { display: grid; gap: 2px; font-size: 12px; }
.steps li.bad { color: var(--amber); }
.steps b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--ink-2); margin-right: 4px; }
.evid { display: grid; gap: 6px; }
.ev-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 2px 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ev-id { font-family: var(--mono); font-size: 10.5px; color: var(--blue-soft); }
.ev-src { font-size: 12px; color: var(--ink-2); }
.ev-flags { font-family: var(--mono); font-size: 10px; color: var(--amber); text-transform: uppercase; letter-spacing: 0.06em; }
.ev-text { grid-column: 2 / -1; font-family: var(--mono); font-size: 11px; color: var(--ink-3); white-space: pre-wrap; overflow-wrap: anywhere; }
.ev-item.untr .ev-text { color: #c7b48e; border-left: 2px solid rgba(255, 181, 71, 0.4); padding-left: 8px; }
.ev-err { grid-column: 2 / -1; font-size: 11.5px; color: var(--amber); }
.cites { display: grid; gap: 5px; }
.cites li { display: grid; grid-template-columns: 40px 72px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.cite-state { font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); }
.cites li.missing .cite-state { color: var(--amber); }
details.raw summary { cursor: pointer; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
details.raw summary:hover { color: var(--ink-2); }
details.raw pre {
  margin: 8px 0 0; max-height: 320px; overflow: auto; font-family: var(--mono); font-size: 10.5px; line-height: 1.5;
  color: var(--ink-3); white-space: pre-wrap; overflow-wrap: anywhere;
}
.plain { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.report { margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 10px; background: rgba(3, 5, 12, 0.45); display: grid; gap: 8px; }
.report .label { margin-bottom: 0; }
.rp-state { font-size: 14px; color: var(--ink); }
.rp-need { font-size: 13px; color: var(--ink-2); }
.rp-times { margin-top: 2px; }

/* ---- approvals ---- */
.approvals { flex: none; }
.approvals .label { margin-bottom: 8px; }
.approvals.has-pending {
  border-color: rgba(255, 181, 71, 0.6);
  box-shadow: 0 0 0 1px rgba(255, 181, 71, 0.18), 0 14px 44px rgba(255, 181, 71, 0.09);
  background: linear-gradient(180deg, rgba(48, 34, 14, 0.55), rgba(12, 12, 22, 0.8));
}
.approvals.has-pending .label { color: var(--amber); }
.approvals.has-pending .label::before { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.ap-token { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ap-token label { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.ap-token input { flex: 1; }
.approvals:not(.has-pending) .ap-token { display: none; }
.ap-none { font-size: 13px; color: var(--ink-3); }
.ap-card { padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 8px; display: grid; gap: 8px; }
.ap-q { font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.ap-pick { font-size: 13px; color: var(--ink-2); }
.ap-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-actions .btn { min-width: 92px; }
.ap-timer { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--amber); }
.ap-msg { font-size: 12.5px; color: var(--ink-2); }
.ap-msg:empty { display: none; }
.ap-card.done-ok .ap-msg { color: var(--green); }

/* ---- pages ---- */
.pages { flex: 1 1 42%; }
.past { flex: 1 1 58%; }
.page { padding: 10px 0 11px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.page:first-child { padding-top: 0; }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pg-time { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.pg-title { font-weight: 600; font-size: 14px; }
.pg-title .linkish { color: var(--ink); }
.pg-line { font-size: 12.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.pg-line + .pg-line { color: var(--ink-3); }
.pg-delivery { font-size: 11.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.pg-delivery.warn-text { color: var(--amber); }
.pg-sig { font-family: var(--mono); font-size: 10px; color: var(--ink-4); margin-top: 4px; }
.page details.raw { display: grid; gap: 3px; }

/* ---- past incidents ---- */
.past { container-type: inline-size; }
.past-list { display: grid; gap: 1px; }
.past-row {
  width: 100%; display: grid; grid-template-columns: 74px minmax(0, 1fr) auto 40px; gap: 10px; align-items: center;
  padding: 7px 8px; background: none; border: 0; border-radius: 7px; text-align: left; font-size: 13px; color: var(--ink);
}
.past-row:hover { background: rgba(154, 174, 255, 0.06); }
.past-row.current { background: rgba(51, 84, 255, 0.15); box-shadow: inset 2px 0 0 var(--blue); }
.pr-time { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.pr-alert { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.pr-took { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pr-mode { font-family: var(--mono); font-size: 9px; color: var(--amber); margin-left: 6px; letter-spacing: 0.06em; }
@container (max-width: 380px) {
  .past-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "alert badge" "time took"; row-gap: 1px; padding: 6px 8px; }
  .pr-alert { grid-area: alert; }
  .past-row .badge { grid-area: badge; justify-self: end; }
  .pr-time { grid-area: time; }
  .pr-took { grid-area: took; }
}

/* ---- break it ---- */
.break { gap: 0; }
.break .label { margin-bottom: 10px; }
.break-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.brk {
  position: relative; display: grid; align-content: start; gap: 3px; text-align: left; padding: 10px 12px 11px 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: rgba(5, 7, 15, 0.55); color: var(--ink); min-width: 0;
  transition: border-color 0.15s, background 0.15s;
}
.brk::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: rgba(255, 181, 71, 0.55); }
.brk:hover:not(:disabled) { border-color: rgba(255, 181, 71, 0.65); background: rgba(255, 181, 71, 0.07); }
.brk-h { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.brk-t { font-size: 11.5px; line-height: 1.3; color: var(--ink-3); }
.break-msg { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); min-height: 1.45em; }
.break[hidden] { display: none; }

/* ---- the independent check: the grader's voice, set apart from Clockbot's own panels ----
   A dashed edge and a hollow marker instead of Clockbot's hour block: this panel is not Clockbot speaking. */
.card { grid-area: card; gap: 8px; border-style: dashed; border-color: var(--line-2); background: linear-gradient(180deg, rgba(9, 12, 26, 0.86), rgba(4, 6, 13, 0.86)); }
.card[hidden] { display: none; }
.card .label { margin-bottom: 0; }
.card .label::before { width: 9px; height: 9px; background: transparent; border: 1.5px solid var(--ink-2); border-radius: 1px; box-shadow: none; }
.vc { display: grid; gap: 7px; min-width: 0; }
.vc-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.vc-word {
  font-family: var(--mono); font-weight: 700; font-stretch: 112.5%; font-size: 19px; letter-spacing: 0.14em; line-height: 1;
  padding: 6px 9px 5px 11px; border: 2px solid currentColor; border-radius: 6px; color: var(--ink-2); white-space: nowrap;
}
.vc-what { font-size: 13px; color: var(--ink-3); min-width: 0; overflow-wrap: anywhere; }
.vc-what b { color: var(--ink); font-weight: 600; }
.vc-line { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.vp-good { color: var(--green); }
.vp-bad { color: var(--red); font-weight: 650; }
.vp-warn { color: var(--amber); }
.vp-dim { color: var(--ink-2); }
.vp-report { font-style: italic; text-decoration: underline dotted; text-underline-offset: 3px; }
.vc-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; }
.vc-ready { font-size: 12px; }
.vc-none, .vc-idle { font-size: 13px; color: var(--ink-3); }
.vc-past { display: grid; gap: 1px; }
.vc-past:empty { display: none; }
.vc-row {
  width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 4px 6px; background: none; border: 0; border-radius: 6px; text-align: left; font-size: 12.5px; color: var(--ink-2);
}
.vc-row:hover { background: rgba(154, 174, 255, 0.06); }
.vc-row-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-row-w { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.vc-foot { font-family: var(--mono); font-size: 9.5px; line-height: 1.5; color: var(--ink-4); letter-spacing: 0.01em; }
.card.st-pass { border-color: rgba(110, 231, 168, 0.6); }
.card.st-pass .vc-word { color: var(--green); box-shadow: 0 0 14px rgba(110, 231, 168, 0.25); }
.card.st-fail { border-color: rgba(255, 77, 94, 0.75); }
.card.st-fail .vc-word { color: var(--red); }
.card.st-unknown { border-color: rgba(255, 181, 71, 0.65); }
.card.st-unknown .vc-word { color: var(--amber); }
.card.st-running .vc-word { color: var(--blue-soft); border-style: dashed; }
/* unsafe: a solid red panel with a glow; it cannot be read as anything else */
.card.st-unsafe {
  border: 2px solid var(--red); background: linear-gradient(180deg, rgba(96, 12, 26, 0.95), rgba(44, 5, 12, 0.95));
  box-shadow: 0 0 0 1px rgba(255, 77, 94, 0.35), 0 0 42px rgba(255, 77, 94, 0.38);
}
.card.st-unsafe .label, .card.st-unsafe .label-note { color: #ffd2d7; }
.card.st-unsafe .label::before { border-color: #ffd2d7; }
.card.st-unsafe .vc-word { color: #fff; background: var(--red); border-color: var(--red); }
.card.st-unsafe .vc-line, .card.st-unsafe .vp-dim, .card.st-unsafe .vc-what { color: #f3c9ce; }
.card.st-unsafe .vp-bad { color: #fff; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.5); text-underline-offset: 3px; }
.card.st-unsafe .vc-foot { color: #c98a93; }
.card.stale .vc-line { opacity: 0.6; }

dialog.vc-dialog {
  width: min(880px, 94vw); max-height: 88vh; padding: 0; overflow: auto; color: var(--ink); background: var(--bg-1);
  border: 1px dashed var(--line-2); border-radius: var(--r); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
dialog.vc-dialog::backdrop { background: rgba(2, 3, 8, 0.72); }
.vcd-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; background: var(--bg-1); border-bottom: 1px solid var(--line); }
.vcd-head .label { margin-bottom: 0; white-space: normal; letter-spacing: 0.14em; }
.vcd-head .label::before { width: 9px; height: 9px; background: transparent; border: 1.5px solid var(--ink-2); box-shadow: none; }
.vcd-body { display: grid; gap: 12px; padding: 14px 18px 18px; }
.vcd-trace { display: grid; gap: 4px; }
.vcd-trace .label { margin-bottom: 0; }

/* ---- layout: one screen on a desktop ---- */
@media (min-width: 1100px) {
  html, body { height: 100%; }
  body { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; }
  body.is-public { grid-template-rows: auto auto auto auto minmax(0, 1fr); }
  .grid {
    min-height: 0;
    grid-template-columns: clamp(330px, 27vw, 540px) minmax(0, 1fr) clamp(320px, 23.5vw, 450px);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas: "clock log side" "break break side";
  }
  /* with the independent check: it sits under the clock (Clockbot's own "Recovered"), Break it under the log */
  .grid.has-card { grid-template-areas: "clock log side" "card break side"; }
}
@media (min-width: 1100px) and (max-width: 1919px) {
  .grid.has-card .break-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.grid.has-card .brk-h { overflow-wrap: anywhere; }
@media (min-width: 1100px) and (max-height: 960px) {
  .vc-past { display: none; }   /* the newest check keeps its room; the dial keeps its own */
}
@media (min-width: 1100px) and (max-height: 860px) {
  :root { --pad: 16px; --gap: 10px; }
  .top { padding-top: 8px; padding-bottom: 8px; }
  .brand img { height: 28px; }
  .health { padding-top: 8px; padding-bottom: 8px; }
  .r-val { font-size: 18px; }
  .r-sub { display: none; }
  .reading.nodata .r-sub { display: block; }
  .panel { padding: 12px 14px; }
  .readout { padding-top: 8px; margin-top: 6px; gap: 4px; }
  .ro-title { font-size: 16px; }
  .brk { padding: 8px 10px 9px 12px; }
  .brk-t { font-size: 11px; }
  .label { margin-bottom: 8px; }
  .think-text { font-size: 15px; }
  .readout .ro-line.dim { display: none; }
  .break-msg:empty { display: none; }
  .break-msg { margin-top: 6px; }
  .vc-past li:nth-child(n+2) { display: none; }
  .vc-word { font-size: 16px; padding: 5px 8px 4px 10px; }
  .vc-line { font-size: 12.5px; line-height: 1.42; }
}
@media (min-width: 1100px) and (max-width: 1500px) {
  .r-full, .r-color { display: none; }
  .r-short { display: inline; }
  .readings .reading { padding: 2px 11px; }
  .r-spark .spark { max-width: 84px; }
  .chip { font-size: 11px; padding: 4px 9px; }
  .kill { min-width: 150px; padding-left: 14px; }
  .kill-hint { max-width: 190px; }
  .lh-alert { font-size: 18px; }
}

/* ---- tablets ---- */
@media (min-width: 760px) and (max-width: 1099px) {
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-areas: "clock log" "break break" "side side"; }
  .grid.has-card { grid-template-areas: "clock log" "card card" "break break" "side side"; }
  .log { max-height: 760px; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
  .approvals { grid-column: 1 / -1; }
  .scroll { max-height: 420px; }
  .readings { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
  .break-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dial-wrap { container-type: inline-size; }
  .dial { width: min(100%, 460px); }
}

/* ---- phones ---- */
@media (max-width: 759px) {
  :root { --pad: 12px; --gap: 12px; }
  .top { flex-wrap: wrap; gap: 10px 12px; }
  .brand img { height: 26px; }
  .chips { order: 5; flex-basis: 100%; gap: 6px; }
  .chip { font-size: 10.5px; padding: 3px 8px; }
  .killbox { display: contents; }
  .kill { order: 2; margin-left: auto; min-width: 0; padding: 7px 40px 7px 14px; }
  .kill-cancel { order: 3; }
  .kill-sub { display: none; }
  .kill-hint { order: 4; flex-basis: 100%; max-width: none; text-align: left; }
  .kill-hint:empty { display: none; }
  .r-full { display: none; }
  .r-short { display: inline; }
  .lockbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .lock-text { flex-direction: column; gap: 4px; }
  .lock-form { justify-content: flex-start; }
  .lock-form input { flex: 1; width: auto; }
  .lock-msg { text-align: left; }
  .health { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .readings { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .reading { padding: 2px 10px; }
  .reading:nth-child(odd) { border-left: 0; padding-left: 0; }
  .r-val { font-size: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "clock" "break" "log" "side"; }
  .grid.has-card { grid-template-areas: "clock" "card" "break" "log" "side"; }
  .dial-wrap { container-type: inline-size; }
  .dial { width: min(100%, 360px); }
  .log { max-height: 80vh; }
  .ev { grid-template-columns: 44px minmax(0, 1fr); }
  .ev-verb { grid-column: 2; grid-row: 1; padding-bottom: 2px; }
  .ev-body { grid-column: 2; }
  .ev-time { grid-row: 1 / span 2; }
  .break-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scroll { max-height: 420px; }
  .label-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .blk-fill.live, .blk-over.live { filter: none; }
}

/* ---- responsive layout fixes (dash-layout) ---- */
.reading { overflow: hidden; }
.r-top { gap: 4px; overflow: hidden; }
.r-name { min-width: 0; flex: 1 1 auto; }
.r-verdict { flex: none; white-space: nowrap; }
.r-mid { min-width: 0; gap: 6px; overflow: hidden; }
.r-val { min-width: 0; font-size: clamp(15px, 1.35vw, 21px); }
.dial-center { gap: max(2px, 0.7cqi); }
.dc-top, .dc-word, .dc-sub { line-height: 1.1; }
.dc-time { line-height: 1.05; margin: max(1px, 0.5cqi) 0 max(2px, 0.7cqi); }

@media (min-width: 1100px) {
  .health { grid-template-columns: clamp(230px, 37%, 540px) minmax(0, 1fr); gap: 0 16px; }
  .readings { grid-template-columns: repeat(auto-fit, minmax(124px, 1fr)); row-gap: 8px; }
  .panel { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
  .dial-wrap { min-height: 112px; overflow: hidden; }
  .grid.has-card .break-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.has-card .brk-h { overflow-wrap: break-word; }
}

@media (min-width: 1100px) and (max-width: 1500px) {
  .readings .reading { padding: 2px 10px; }
  .r-name { letter-spacing: 0.06em; }
  .r-val { font-size: clamp(15px, 1.25vw, 18px); }
}

@media (min-width: 1100px) and (max-width: 1380px), (min-width: 1100px) and (max-height: 680px) {
  .clock .label-note { display: none; }
}

@media (min-width: 1100px) and (max-height: 700px) {
  .top { padding: 5px var(--pad); gap: 6px 12px; }
  .brand img { height: 24px; }
  .chip { padding: 3px 8px; font-size: 10.5px; }
  .kill { padding: 5px 16px 5px 14px; min-width: 136px; }
  .health { padding: 5px var(--pad); }
  .health-head { gap: 2px; }
  .headline, .health-live { font-size: 11.5px; line-height: 1.28; }
  .flags { gap: 2px 4px; }
  .flag { font-size: 9.5px; padding: 0 4px; }
  .r-val { font-size: 16px; }
  .grid { padding: 7px var(--pad) 9px; gap: 7px; }
  .panel { padding: 8px 12px; }
  .clock .label { margin-bottom: 4px; }
  .dial-wrap { min-height: 108px; }
  .dial-center { gap: 2px; }
  .dc-top, .dc-sub { font-size: clamp(7.5px, 1.95cqi, 10px); }
  .dc-word { font-size: clamp(9px, 3cqi, 13px); }
  .dc-time { margin: 2px 0; }
  .readout { padding-top: 5px; margin-top: 3px; gap: 2px; }
  .ro-title { font-size: 14.5px; }
  .ro-meta { gap: 4px 8px; }
  .ro-meta .tag { font-size: 9.5px; padding: 0 6px; }
  .rail { margin: 1px 0 2px; gap: 4px; }
  .rail-k { font-size: 8.5px; }
  .rail-t { font-size: 10px; }
  .log { padding-bottom: 6px; }
  .log-head { gap: 5px; padding-bottom: 6px; }
  .lh-alert { font-size: 16.5px; }
  .think { padding: 6px 10px; gap: 2px; }
  .think-text { font-size: 13px; line-height: 1.28; }
  .think-why { font-size: 11.5px; line-height: 1.28; }
  .card { gap: 4px; max-height: 138px; }
  .vc-word { font-size: 13.5px; padding: 3px 6px; }
  .vc-line { font-size: 11.5px; line-height: 1.3; }
  .vc-foot { font-size: 9px; line-height: 1.28; }
  .break .label { margin-bottom: 5px; }
  .break-grid { gap: 5px; }
  .brk { padding: 4px 8px 5px 10px; gap: 1px; }
  .brk-h { font-size: 11.5px; line-height: 1.18; }
  .brk-t { font-size: 10px; line-height: 1.18; }
  .break-msg { margin-top: 4px; font-size: 11px; line-height: 1.25; min-height: 0; }
}


/* ---- the guide (demo layout): the real dashboard, scrolling, with the break panel on top ----
   body.guide is set only where a fault injector is configured (chaos_url); the operator page never gets it. */
body.guide .grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "break" "health" "clock" "log" "card" "side"; }
body.guide .health {
  grid-area: health; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
}
body.guide .cap { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); max-width: 62ch; margin: -4px 0 12px; }
body.guide .health-head .cap { margin: 0; }
body.guide .log-head .cap { margin: -6px 0 0; }

/* the break panel: what this is, what is happening now, the one action */
body.guide .break { grid-area: break; padding: 18px 22px 20px; border-color: var(--line-2); }
body.guide .break .label { margin-bottom: 14px; }
body.guide .now { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
body.guide .now-h { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.012em; color: var(--ink); max-width: 30ch; text-wrap: balance; }
body.guide .now-sub { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 64ch; }
body.guide .now-sub:empty { display: none; }
body.guide .now-intro { margin-top: 16px; font-size: 13px; line-height: 1.5; color: var(--ink-3); max-width: 64ch; }
body.guide .now-intro a, body.guide .guide-foot a { color: var(--blue-soft); text-underline-offset: 3px; }
body.guide .now-intro a:hover, body.guide .guide-foot a:hover { color: var(--ink); }

/* where the run is: five blocks, the dial's own language (a lit block is blue, the current one is bright) */
body.guide .now-steps { margin-top: 18px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
body.guide .now-steps[hidden] { display: none; }
body.guide .now-steps li { display: grid; gap: 8px; font-size: 12.5px; line-height: 1.3; color: var(--ink-4); }
body.guide .now-steps li::before { content: ""; height: 6px; border-radius: 2px; background: rgba(154, 174, 255, 0.12); }
body.guide .now-steps li.is-done { color: var(--ink-3); }
body.guide .now-steps li.is-done::before { background: rgba(51, 84, 255, 0.55); }
body.guide .now-steps li.is-now { color: var(--ink); font-weight: 600; }
body.guide .now-steps li.is-skip { color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--ink-4); }
body.guide .now-steps li.is-now::before { background: var(--blue-2); box-shadow: 0 0 10px rgba(51, 84, 255, 0.7); animation: guide-now 1.6s ease-in-out infinite; }
@keyframes guide-now { 50% { opacity: 0.55; } }

/* the one action */
body.guide .now-side { display: grid; align-content: start; gap: 10px; }
body.guide .now-act { display: grid; gap: 10px; }
body.guide .go {
  display: grid; gap: 2px; text-align: left; width: 100%; cursor: pointer;
  padding: 14px 18px 16px; border-radius: 10px; border: 1px solid var(--amber);
  background: var(--amber); color: #1c1203;
}
body.guide .go-h { font-size: 18px; font-weight: 700; letter-spacing: -0.005em; line-height: 1.2; }
body.guide .go-t { font-size: 12.5px; color: rgba(28, 18, 3, 0.78); }
body.guide .go:hover:not(:disabled) { filter: brightness(1.08); }
body.guide .go:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
body.guide .go:disabled { cursor: not-allowed; background: rgba(255, 181, 71, 0.12); border-color: rgba(255, 181, 71, 0.3); color: var(--ink-3); }
body.guide .go:disabled .go-t { color: var(--ink-4); }
body.guide .pick-own > summary { cursor: pointer; font-size: 13px; color: var(--ink-2); width: max-content; max-width: 100%; }
body.guide .pick-own > summary:hover { color: var(--ink); }
body.guide .pick-own[open] > summary { margin-bottom: 10px; }
body.guide .pick-own .break-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body.guide .break-msg { margin-top: 0; }
body.guide .break-msg:empty { display: none; }
body.guide .break-msg.ok-text { display: none; }  /* the now line above already says the fault is in */
body.guide .now-limits { font-size: 12px; line-height: 1.45; color: var(--ink-3); }

body.guide .clock .label-note, body.guide .card .label-note, body.guide .break .label-note { display: none; }  /* the captions say it */
body.guide .guide-foot { padding: 4px var(--pad) 40px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-3); max-width: 900px; }

@media (max-width: 759px) {
  body.guide .now-h { font-size: 21px; }
  body.guide .chips li:nth-child(n+3) { display: none; }  /* model and cost: the operator's chips; the page leads with the action */
  body.guide .now-sub { font-size: 14px; }
  body.guide .now-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  body.guide .now-steps li { grid-template-columns: 6px minmax(0, 1fr); align-items: center; gap: 10px; }
  body.guide .now-steps li::before { height: 18px; }
  body.guide .break { padding: 16px; }
  body.guide .clock { min-height: 0; }
  body.guide .log { max-height: 78vh; }
}
@media (min-width: 760px) and (max-width: 1099px) {
  body.guide .grid, body.guide .grid.has-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); grid-template-areas: "break break" "health health" "clock log" "card card" "side side"; }
  body.guide .now { grid-template-columns: minmax(0, 1fr) minmax(260px, 0.7fr); gap: 28px; }
}
@media (min-width: 1100px) {
  /* the operator page is one screen with no page scroll; this one is a page, so it scrolls */
  html:has(body.guide), body.guide { height: auto; }
  body.guide { display: block; overflow: visible; }
  body.guide .grid, body.guide .grid.has-card {
    grid-template-columns: clamp(300px, 25vw, 460px) minmax(0, 1fr) clamp(300px, 24vw, 420px);
    grid-template-rows: auto auto minmax(430px, 62vh) auto;
    grid-template-areas: "break break break" "health health health" "clock log side" "card log side";
  }
  body.guide .log, body.guide .side { contain: size; }
  body.guide .now { grid-template-columns: minmax(0, 1fr) clamp(300px, 26vw, 400px); gap: 40px; align-items: start; }
  body.guide .now-h { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) { body.guide .now-steps li.is-now::before { animation: none; } }

/* the store's side: one plain line on top of the store panel, in shoppers' words */
body.guide .health-head .headline, body.guide .health-head .health-live, body.guide .health-head .flags { display: none; }  /* operator detail; the store line says it */
body.guide .store { display: grid; gap: 4px; padding-left: 12px; border-left: 3px solid var(--ink-4); margin-top: 2px; }
body.guide .store-word { font-size: 18px; line-height: 1.25; font-weight: 600; color: var(--ink); }
body.guide .store-sub { font-size: 13px; line-height: 1.45; color: var(--ink-2); max-width: 52ch; }
body.guide .store-sub:empty { display: none; }
body.guide .store[data-tone="ok"] { border-left-color: var(--green); }
body.guide .store[data-tone="ok"] .store-word { color: var(--green); }
body.guide .store[data-tone="bad"] { border-left-color: var(--red); }
body.guide .store[data-tone="bad"] .store-word { color: #ff8f9a; }
body.guide .store[data-tone="reset"] { border-left-color: var(--blue-soft); }
body.guide .store[data-tone="reset"] .store-word { color: var(--blue-soft); }
body.guide .r-words { display: block; font-size: 12.5px; line-height: 1.3; color: var(--ink-2); margin-bottom: 2px; }
/* while we reset the store after a run, its readings dip: shown neutral, never as the fault */
body.guide.is-resetting .reading.bad .r-val, body.guide.is-resetting .reading.bad .r-verdict { color: var(--ink-3); }
body.guide.is-resetting .stale-note { display: none; }
body.guide .cap.cap-last { color: var(--amber); }
body.guide .now-card { margin-top: 12px; font-size: 14px; }
body.guide .now-card a { color: var(--blue-soft); text-underline-offset: 3px; }
body.guide .now-card[hidden] { display: none; }
@media (min-width: 1100px) {
  body.guide .health { grid-template-columns: minmax(300px, 0.9fr) minmax(0, 2fr); }
}
@media (max-width: 759px) {
  /* a phone page stays a page: long lists scroll in their own box, operator-only panels step aside */
  body.guide.is-public #approvals { display: none; }
  body.guide .scroll { max-height: 220px; }
  body.guide .log { max-height: 70vh; }
  body.guide .vc-foot, body.guide .vc-past { display: none; }
  body.guide .readings .r-sub { display: none; }
}
body.guide .pg-earlier { flex-basis: 100%; font-size: 12px; color: var(--ink-3); }
body.guide .pg-head { flex-wrap: wrap; }

/* ---- round 3: fewer things, and the store card as the one loud thing when the store breaks ---- */
body.guide.is-public #approvals, body.guide.is-public .pages { display: none; }   /* approvals are off here; this run's page is one line */
body.guide .r-name { display: none; }            /* plain names only; the technical name is the tile's tooltip */
body.guide .r-words { font-size: 13px; color: var(--ink); }
body.guide .now-steps li { color: var(--ink-3); }
/* the log: what it thinks and the last 4 steps; the rest behind "Show the full log" */
body.guide:not(.log-open) #timeline > li:nth-last-child(n+5) { display: none; }
body.guide .log-more { align-self: flex-start; margin-top: 8px; }
/* the store card: calm when all is well, red-tinted and loud when shoppers feel it, blue while we reset */
body.guide .health { transition: background-color 0.3s, border-color 0.3s; }
body.guide .health[data-tone="bad"] { background: linear-gradient(180deg, rgba(255, 77, 94, 0.16), rgba(255, 77, 94, 0.06)); border-color: rgba(255, 77, 94, 0.55); }
body.guide .health[data-tone="reset"] { border-color: rgba(154, 174, 255, 0.4); }
body.guide .store { border-left: 0; padding-left: 0; gap: 6px; }
body.guide .store-word { font-size: 24px; line-height: 1.15; letter-spacing: -0.01em; }
body.guide .store[data-tone="bad"] .store-word { color: #ff6b79; }
body.guide .store[data-tone="bad"] .store-sub { color: var(--ink); }
body.guide .tape { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 2px; height: 22px; margin-top: 6px; }
body.guide .tape i { display: block; border-radius: 1px; background: rgba(154, 174, 255, 0.1); }
body.guide .tape i.t-ok { background: rgba(110, 231, 168, 0.55); }
body.guide .tape i.t-bad { background: var(--red); }
body.guide .tape i.t-reset { background: rgba(154, 174, 255, 0.55); }
body.guide .tape i.t-nodata { background: rgba(154, 174, 255, 0.18); }
body.guide .tape-l { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--ink-4); }
body.guide .health[data-tone="bad"] .reading.bad { background: rgba(255, 77, 94, 0.1); border-radius: 6px; }
body.guide .health[data-tone="bad"] .reading.bad .r-words, body.guide .health[data-tone="bad"] .reading.bad .r-val { color: #ff6b79; }
/* the side column held approvals, pages and past runs: on the public page it goes, and the log gets the width */
body.guide.is-public .side, body.guide.is-public .vc-foot, body.guide.is-public .vc-past, body.guide.is-public .vc-ready { display: none; }
body.guide.is-public .grid, body.guide.is-public .grid.has-card { grid-template-areas: "break" "health" "clock" "log" "card"; }
@media (min-width: 760px) and (max-width: 1099px) {
  body.guide.is-public .grid, body.guide.is-public .grid.has-card { grid-template-areas: "break break" "health health" "clock log" "card log"; }
}
@media (min-width: 1100px) {
  body.guide.is-public .grid, body.guide.is-public .grid.has-card {
    grid-template-columns: clamp(300px, 27vw, 460px) minmax(0, 1fr);
    grid-template-areas: "break break" "health health" "clock log" "card log";
  }
}
/* the store card already says the store is outside its limits; the clock and log say "last run": the amber note would say it a third time */
body.guide.is-public .stale-note { display: none; }
