:root {
  --porcelain: #EEF1F0;
  --paper: #F8FAF9;
  --graphite: #1D2327;
  --graphite-2: #2A3237;
  --ink: #1D2327;
  --ink-2: #4A555B;
  --line: #CCD4D2;
  --amber: #C9780A;
  --amber-ink: #8A4F00;
  --teal: #1C7C6B;
  --red: #B3362B;
  --gutter: max(40px, calc((100vw - 1360px) / 2));
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--porcelain); color: var(--ink);
  font-family: Geologica, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px; line-height: 1.55; font-weight: 300;
}
h1, h2, h3 { margin: 0; line-height: 1.12; font-weight: 700; }
h1 { font-size: clamp(34px, 4.6vw, 60px); letter-spacing: -0.02em; max-width: 18ch; }
h2 { font-size: 24px; letter-spacing: -0.01em; margin-bottom: 10px; }
h3 { font-size: 17px; margin: 14px 0 8px; font-weight: 500; }
p { margin: 0 0 12px; max-width: 68ch; }
strong { font-weight: 500; }
a { color: var(--teal); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.lead { font-size: 20px; line-height: 1.45; }
.small { font-size: 14px; color: var(--ink-2); }
.boot { padding: 40px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--paper); padding: 8px 12px; z-index: 10; }
main:focus { outline: none; }

.sim-band { max-width: none; margin: 0; padding: 7px var(--gutter); background: var(--graphite); color: #E8ECEB; font-size: 14px; }
.top { display: flex; align-items: center; gap: 28px; padding: 14px var(--gutter); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current='page'] { border-bottom-color: var(--graphite); font-weight: 500; }
.top-tools { display: flex; gap: 8px; }
.foot { padding: 28px var(--gutter) 40px; border-top: 1px solid var(--line); margin-top: 48px; color: var(--ink-2); font-size: 14px; }

.btn {
  font: inherit; font-size: 16px; font-weight: 400; display: inline-block; min-height: 44px; padding: 9px 16px;
  background: transparent; color: var(--ink); border: 1.5px solid var(--graphite); border-radius: 4px; cursor: pointer;
  text-decoration: none; text-align: center;
}
.btn:hover { background: #DFE5E3; }
.btn-primary { background: var(--graphite); color: #fff; }
.btn-primary:hover { background: var(--graphite-2); }
.btn-off { border-color: var(--red); color: var(--red); font-weight: 500; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.chip {
  font: inherit; font-size: 15px; min-height: 40px; padding: 7px 13px; background: transparent; color: var(--ink);
  border: 1px solid var(--line); border-radius: 20px; cursor: pointer;
}
.chip[aria-pressed='true'] { background: var(--graphite); color: #fff; border-color: var(--graphite); }

.screen { padding: 36px var(--gutter) 0; }
.screen > .lead { margin-top: 12px; }
.panel { margin-top: 28px; padding-top: 22px; border-top: 2px solid var(--graphite); }
details.panel > summary { cursor: pointer; font-weight: 500; font-size: 18px; min-height: 32px; }
.strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }

.guide { margin-top: 18px; padding: 18px 20px; background: var(--graphite); color: #F2F5F4; border-radius: 4px; }
.guide-step { font-size: 14px; color: #B9C4C1; margin-bottom: 4px; }
.guide-say { font-size: 20px; line-height: 1.4; font-weight: 400; margin-bottom: 14px; max-width: 62ch; }
.guide-say:focus { outline: none; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.guide .btn { color: #fff; border-color: #8D9A97; }
.guide .btn:hover { background: var(--graphite-2); }
.guide .btn-primary { background: var(--amber); border-color: var(--amber); color: #1A1204; font-weight: 500; }
.guide .btn-primary:hover { background: #DB8A1C; }

.twin { display: grid; grid-template-columns: 1fr 200px 1fr; gap: 0; margin-top: 22px; align-items: stretch; }
.twin.is-stale { opacity: 0.4; }
.side { padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); min-height: 220px; }
.side h2 { font-size: 16px; font-weight: 500; margin-bottom: 14px; }
.side-truth { background: #E2E8E6; border-style: dashed; }
.status-word { font-size: clamp(56px, 7vw, 96px); line-height: 1; font-weight: 900; letter-spacing: -0.03em; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.status-word[data-state='on'] { color: var(--teal); }
.status-word[data-state='off'] { color: var(--graphite); }
.status-word[data-state='unknown'], .hatch {
  color: var(--amber-ink);
  background-image: repeating-linear-gradient(135deg, var(--amber-ink) 0 5px, #E9B15E 5px 9px);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hatch { font-weight: 900; font-size: 1.15em; background-image: repeating-linear-gradient(135deg, var(--amber-ink) 0 2px, #D08A26 2px 4px); }
@media (forced-colors: active) {
  .status-word[data-state='unknown'], .hatch { -webkit-text-fill-color: CanvasText; background: none; text-decoration: underline wavy; }
}
.status-detail { font-size: 16px; min-height: 1.5em; }
.truth-word { font-size: clamp(28px, 3vw, 40px); line-height: 1.05; font-weight: 500; margin-bottom: 10px; }
.truth-word[data-on='true'] { color: var(--teal); }
.wire { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 0 14px; }
.lane-name { display: block; font-size: 14px; margin-bottom: 4px; }
.lane-line { display: block; height: 4px; background: var(--teal); position: relative; border-radius: 2px; }
.lane:last-of-type .lane-line::after { transform: rotate(180deg); }
.lane .lane-line::before { content: ''; position: absolute; right: -1px; top: -4px; border-left: 9px solid var(--teal); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.lane:nth-of-type(2) .lane-line::before { right: auto; left: -1px; border-left: 0; border-right: 9px solid var(--teal); }
.lane.is-broken .lane-line { background: repeating-linear-gradient(90deg, var(--red) 0 8px, transparent 8px 16px); }
.lane.is-broken .lane-line::before { display: none; }
.lane.is-broken .lane-name::after { content: ' ✕'; color: var(--red); font-weight: 700; }
.lane.is-busy .lane-line::after {
  content: ''; position: absolute; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--amber);
  animation: travel 1.1s linear infinite;
}
@keyframes travel { from { left: 0; } to { left: calc(100% - 10px); } }
@media (prefers-reduced-motion: reduce) { .lane.is-busy .lane-line::after { animation: none; left: 45%; } }
.wire-note { font-size: 14px; margin: 0; }

.control-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.refusal { min-height: 1.5em; margin: 6px 0; color: var(--red); font-weight: 400; }
.clock-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 10px; }
.clock { font-variant-numeric: tabular-nums; font-weight: 500; }
.speeds { display: flex; gap: 6px; }

table.data { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
table.data caption { text-align: left; font-size: 14px; color: var(--ink-2); padding-bottom: 8px; }
table.data th { text-align: left; font-weight: 500; padding: 7px 12px 7px 0; border-bottom: 1.5px solid var(--graphite); }
table.data td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; margin-top: 16px; }
.cmd-state { white-space: nowrap; font-weight: 400; }
tr[data-state='acknowledged'] .cmd-state { color: var(--teal); }
tr[data-state='failed'] .cmd-state { color: var(--red); }
tr[data-state='unknown'] .cmd-state { color: var(--amber-ink); }

.programs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 8px; }
.bank h3 { margin-top: 0; }
.prog {
  display: block; width: 100%; font: inherit; text-align: left; padding: 8px 10px; background: transparent; color: var(--ink);
  border: 0; border-top: 1px solid var(--line); cursor: pointer; min-height: 44px;
}
.prog:hover { background: #E2E8E6; }
.prog[aria-pressed='true'] { background: var(--graphite); color: #fff; }
.prog-name { display: block; font-size: 15px; font-weight: 400; }
.prog-values { display: block; font-size: 13px; opacity: 0.8; font-variant-numeric: tabular-nums; }

.timeline { margin-top: 22px; padding: 16px 20px; background: var(--paper); border: 1px solid var(--line); }
.timeline h3 { margin-top: 0; }
.tl-scale { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); margin-left: 190px; }
.tl-lane { display: grid; grid-template-columns: 190px 1fr; align-items: center; margin-top: 8px; }
.tl-name { margin: 0; font-size: 15px; }
.tl-track { display: flex; align-items: center; gap: 10px; min-height: 34px; background: #E7ECEA; padding: 3px 0; }
.tl-bar { min-height: 28px; padding: 3px 10px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.tl-bar-wait { background: var(--red); color: #fff; }
.tl-bar-fix { background: var(--teal); padding: 3px 0; min-width: 8px; }
.tl-note { font-size: 14px; }

.session-panel .timer-label { font-size: 15px; margin: 0 0 4px; }
.timer { font-size: clamp(56px, 10vw, 128px); line-height: 1; font-weight: 900; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 0 0 16px; }
.timer[data-state='due'] { color: var(--amber-ink); }
.timer[data-state='off_unconfirmed'], .timer[data-state='off_failed'] { color: var(--red); }
.track { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0 0 14px; }
.track li { padding: 6px 14px 6px 0; margin-right: 14px; border-top: 4px solid var(--line); font-size: 15px; color: var(--ink-2); min-width: 120px; }
.track li.is-done { border-top-color: var(--graphite); color: var(--ink); font-weight: 400; }
.reminder-line { font-size: 22px; font-weight: 400; min-height: 1.5em; }

.overview { padding: 0 var(--gutter); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; padding-top: 40px; align-items: stretch; }
.hero-copy h1 { margin-bottom: 20px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 14px; }
.stage { margin: 0; background: var(--graphite); color: #E8ECEB; border-radius: 4px; display: flex; flex-direction: column; min-height: 420px; overflow: hidden; }
.stage-canvas { flex: 1; min-height: 380px; position: relative; }
.stage-canvas-small { min-height: 340px; }
.stage-canvas canvas { display: block; max-width: 100%; }
.stage figcaption { padding: 10px 16px; border-top: 1px solid #3A444A; }
.stage-label { margin: 0; font-size: 14px; }
.stage-error, .stage-wait { padding: 24px; }
.overview > section:not(.hero) { margin-top: 48px; padding-top: 22px; border-top: 2px solid var(--graphite); }
.scene { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 32px; align-items: center; margin: 12px 0 24px; }
.scene-fig { margin: 0; }
.scene-img { position: relative; }
.scene-img img { display: block; width: 100%; height: auto; }
.scene-mark {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; background: var(--graphite); color: var(--paper);
  display: grid; place-items: center; font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.scene-path { margin: 0; padding: 0; list-style: none; counter-reset: part; }
.scene-path li { counter-increment: part; display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.scene-path li::before {
  content: counter(part); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--graphite); color: var(--paper);
  display: grid; place-items: center; font-size: 15px; font-weight: 500;
}
.scene-path strong { font-size: 20px; font-weight: 500; }
.scene-path span { color: var(--ink-2); }
.idea-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.idea-cell { padding: 18px 20px; background: var(--paper); border: 1px solid var(--line); }
.idea-case { font-weight: 500; }
.idea-cell .hatch { display: block; font-size: 44px; line-height: 1.1; margin-top: 4px; }
.idea-cell strong:not(.hatch) { display: block; font-size: 22px; font-weight: 500; }
.idea-cell p:last-child { margin-bottom: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.plain { margin: 0; padding-left: 20px; }
.plain li { margin-bottom: 8px; }

.gait { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; margin-top: 14px; }
.scrub { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.scrub input { flex: 1; min-width: 140px; accent-color: var(--graphite); }
.stack > .chart { margin-top: 14px; }

.chart { margin: 0; }
.chart figcaption { font-weight: 500; font-size: 16px; margin-bottom: 4px; }
.chart-box { position: relative; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #D6DDDB; stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart .baseline { stroke: var(--ink-2); stroke-dasharray: 4 4; }
.chart .cross { stroke: var(--graphite); stroke-width: 1; }
.chart .range { cursor: pointer; }
.chart-tip {
  position: absolute; top: 4px; background: var(--paper); border: 1px solid var(--graphite); border-radius: 3px; padding: 6px 9px;
  font-size: 13px; pointer-events: none; font-variant-numeric: tabular-nums; max-width: 260px; z-index: 2;
}
.chart-note { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.more { margin-top: 8px; }
.more > summary { cursor: pointer; font-size: 15px; min-height: 32px; padding: 4px 0; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; padding: 0; margin: 6px 0 0; font-size: 14px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.archive { list-style: none; padding: 0; margin: 8px 0 0; columns: 3; column-gap: 28px; }
.archive li { padding: 5px 0; break-inside: avoid; }

.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); max-width: 100vw; border: 0; padding: 0;
  background: var(--paper); color: var(--ink);
}
.drawer[open] { display: flex; flex-direction: column; }
.drawer::backdrop { background: rgba(29, 35, 39, 0.45); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; }
.drawer-log { flex: 1; overflow-y: auto; padding: 16px 18px; }
.msg { font-size: 16px; white-space: pre-wrap; }
.msg-you { font-weight: 500; }
.drawer-form { padding: 14px 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.drawer-form label { grid-column: 1 / -1; font-size: 14px; }
.drawer-form input { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--graphite); border-radius: 4px; background: #fff; min-width: 0; }

/* What the screen said against what the implant did, on one time axis. */
.trace-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.trace-sum { font-size: 20px; font-weight: 500; margin: 0; }
.trace-sum[data-apart='true'] { color: var(--red); }
.trace-grid { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; align-items: center; margin-top: 14px; }
.trace-name { font-size: 14px; margin: 0; line-height: 1.25; }
.trace-track { position: relative; height: 34px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; }
.trace-track-thin { height: 12px; }
.seg { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.seg-on { background: var(--teal); }
.seg-off { background: #C3CDCB; }
.seg-wait { background: repeating-linear-gradient(90deg, var(--teal) 0 3px, #A9D0C7 3px 6px); }
.seg-unknown { background: repeating-linear-gradient(135deg, var(--amber) 0 5px, #F0D29F 5px 10px); }
.seg-apart { background: var(--red); }
.trace-axis { grid-column: 2; display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trace-key { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; margin: 12px 0; font-size: 14px; }
.trace-key li { display: flex; align-items: center; gap: 7px; }
.trace-key .seg { position: static; display: inline-block; width: 22px; height: 12px; border-radius: 2px; }
.trace-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.trace-tools details { flex-basis: 100%; }

@media (max-width: 960px) {
  .trace-grid { grid-template-columns: 1fr; gap: 3px; }
  .trace-name { margin-top: 8px; }
  .trace-axis { grid-column: 1; }
  :root { --gutter: 16px; }
  .ledger thead { display: none; }
  .ledger tr { display: grid; grid-template-columns: 72px 1fr auto; column-gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .ledger td { border: 0; padding: 0; }
  .ledger td:nth-child(4) { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; }
  .ledger td:empty { display: none; }
  table.data:not(.ledger) thead { display: none; }
  table.data:not(.ledger) tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.data:not(.ledger) td { display: flex; justify-content: space-between; gap: 16px; border: 0; padding: 2px 0; }
  table.data:not(.ledger) td:first-child { font-weight: 600; }
  table.data:not(.ledger) td:not(:first-child)::before { content: attr(data-label); color: var(--ink-2); }
  .hero, .gait, .two-col { grid-template-columns: 1fr; }
  .twin { grid-template-columns: 1fr; }
  .wire { padding: 14px 4px; flex-direction: row; flex-wrap: wrap; }
  .lane { flex: 1; min-width: 120px; }
  .wire-note { flex-basis: 100%; }
  .programs { grid-template-columns: 1fr; }
  .archive { columns: 2; }
  .side { min-height: 0; }
  .top { gap: 8px 14px; }
  .nav { order: 3; flex-basis: 100%; }
  .brand { flex: 1; }
  .nav a { padding: 8px 8px; font-size: 16px; }
  .btn { font-size: 15px; }
  .lead { font-size: 18px; }
  .guide-say { font-size: 18px; }
  .idea-grid { grid-template-columns: 1fr; }
  .scene { grid-template-columns: 1fr; gap: 12px; }
  .scene-mark { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 13px; }
  .tl-scale { margin-left: 0; font-size: 11px; }
  .tl-lane { grid-template-columns: 1fr; }
  .tl-bar { white-space: normal; }
  .tl-track { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

.tick-over { paint-order: stroke; stroke: var(--porcelain); stroke-width: 4px; stroke-linejoin: round; }
