:root {
  color-scheme: dark;
  --bg: #030507;
  --panel: #070b10;
  --line: #141c25;
  --line-2: #1f2a36;
  --ink: #eef2f6;
  --ink-2: #a3aeba;
  --muted: #64707c;
  --grid: #1a232d;
  --axis: #2b3743;
  --prp: #3987e5;
  --tf: #199e70;
  --good: #0ca30c;
  --warn: #fab219;
  --crit: #d03b3b;
  --din: "DIN Alternate", "Bahnschrift", "D-DIN", "DIN 2014", "Roboto Condensed", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100vh; }
sup { line-height: 0; }
:focus-visible { outline: 2px solid var(--prp); outline-offset: 2px; }
button { font: inherit; color: var(--ink-2); background: transparent; border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 10px; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; font-family: var(--din); }
button:hover { color: var(--ink); border-color: var(--axis); }

/* ---------- top bar */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 10px 18px; background: rgba(3,5,7,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--din); font-size: 15px; letter-spacing: .18em; text-transform: uppercase; }
.brand .slash { color: var(--muted); }
.mark { width: 10px; height: 10px; border: 2px solid var(--ink); transform: rotate(45deg); }
.badge { font-size: 10px; letter-spacing: .14em; color: var(--warn); border: 1px solid currentColor; border-radius: 2px; padding: 1px 6px; }
.clocks { display: flex; gap: 28px; margin: 0; }
.clocks div { display: flex; flex-direction: column; }
.clocks dt { font-family: var(--din); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.clocks dd { margin: 0; font-family: var(--din); font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }

/* ---------- board */
.board { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; padding: 10px 14px 14px; max-width: 1760px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px 16px; min-width: 0; position: relative; }
.panel::before, .panel::after { content: ""; position: absolute; width: 8px; height: 8px; border-color: var(--axis); border-style: solid; }
.panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; } .s12 { grid-column: span 12; }
.ph { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; font-family: var(--din); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.ph-r { font-weight: 400; letter-spacing: .08em; color: var(--muted); text-transform: none; font-size: 12px; display: inline-flex; gap: 6px; align-items: center; }
.fine { font-size: 12px; color: var(--ink-2); margin: 8px 0 0; }
.callout { color: var(--ink); border-left: 2px solid var(--tf); padding-left: 10px; }
.icon { font-size: 10px; line-height: 1; display: inline-block; width: 12px; text-align: center; }
.icon.good { color: var(--good); } .icon.warn { color: var(--warn); } .icon.crit { color: var(--crit); } .icon.muted { color: var(--muted); }

/* ---------- target */
.exp { font-family: var(--din); font-size: clamp(54px, 6.4vw, 104px); line-height: 1; letter-spacing: -.01em; white-space: nowrap; margin: 6px 0 18px; }
.exp sup { font-size: .36em; vertical-align: top; position: relative; top: .55em; margin-left: .04em; letter-spacing: .02em; }
.exp .minus { margin: 0 .16em 0 .14em; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.kv dt, .readouts dt, .sl, .rl { font-family: var(--din); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-family: var(--din); font-size: 17px; font-variant-numeric: tabular-nums; }
.kv dd small, .readouts dd small { display: block; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }

/* ---------- main progress */
.huge { font-family: var(--din); font-size: clamp(64px, 6.8vw, 112px); line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.01em; margin: 2px 0 14px; }
.huge .u { font-size: .4em; color: var(--ink-2); margin-left: 4px; }
.track { position: relative; height: 10px; background: var(--grid); border-radius: 2px; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; min-width: 3px; border-radius: 2px; background: var(--prp); }
.track .fill.tf { background: var(--tf); }
.track .tick { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-2); }
.trackscale { display: flex; justify-content: space-between; font-family: var(--din); font-size: 11px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.countdown { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; font-family: var(--din); font-variant-numeric: tabular-nums; }
.countdown .lbl { font-size: 18px; color: var(--ink-2); }
.countdown #countdown { font-size: clamp(30px, 3vw, 44px); letter-spacing: .03em; }

/* ---------- go / no-go */
.gonogo { list-style: none; margin: 0; padding: 0; }
.gonogo li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); }
.gonogo li:last-child { border-bottom: 0; }
.gonogo .n { font-family: var(--din); letter-spacing: .06em; font-size: 13px; }
.gonogo .d { display: block; font-size: 11.5px; color: var(--ink-2); }
.gonogo .w { font-family: var(--din); font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--ink); }

/* ---------- timeline */
.timeline { position: relative; }
.tl-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 210px; gap: 14px; align-items: center; min-height: 26px; }
.tl-name { font-family: var(--din); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; height: 10px; }
.tl-track::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--grid); }
.tl-bar { position: absolute; top: 0; bottom: 0; min-width: 3px; border-radius: 2px; }
.tl-bar.done { background: var(--ink-2); }
.tl-bar.active.prp { background: var(--prp); } .tl-bar.active.tf { background: var(--tf); } .tl-bar.active.neutral { background: var(--ink); }
.tl-bar.plan { background: transparent; border: 1px dashed var(--ink-2); }
.tl-when { font-family: var(--din); font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-axis { position: relative; height: 18px; margin-top: 6px; }
.tl-axis span { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--din); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tl-grid { position: absolute; top: 0; bottom: 18px; width: 1px; background: var(--line); }
.tl-now { position: absolute; top: -4px; bottom: 14px; width: 2px; background: var(--ink); z-index: 2; }
.tl-now::after { content: "NOW"; position: absolute; bottom: -14px; left: 50%; transform: translateX(-50%); font-family: var(--din); font-size: 10px; letter-spacing: .14em; color: var(--ink); }

/* ---------- readouts */
.readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0; }
.readouts dd { margin: 2px 0 0; font-family: var(--din); font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.residue { display: grid; grid-template-columns: minmax(0, 1fr) 176px; gap: 18px; align-items: start; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.hex { font-family: var(--mono); font-size: 20px; letter-spacing: .04em; margin-top: 4px; }
.bits { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.bit { aspect-ratio: 1; border-radius: 1px; background: var(--grid); }
.bit.on { background: var(--prp); }

/* ---------- trial factoring */
.tfhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.big { font-family: var(--din); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.big .u { font-size: .45em; color: var(--ink-2); margin-left: 3px; }
.classes { display: grid; grid-template-columns: repeat(48, minmax(0, 1fr)); gap: 2px; margin: 14px 0 16px; }
.cls { aspect-ratio: 1; background: var(--grid); border-radius: 1px; }
.cls.on { background: var(--tf); }
.cls.cur { background: var(--ink); }
#tfReadouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- odds */
.odds { list-style: none; margin: 0; padding: 0; }
.odds li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.odds li:last-child { border-bottom: 0; }
.odds .ol { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.odds .ov { font-family: var(--din); font-size: 20px; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.odds .ob { height: 4px; background: var(--grid); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.odds .ob i { display: block; height: 100%; background: var(--ink-2); border-radius: 2px; min-width: 2px; }

/* ---------- GPU strips and charts */
.strips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.sv { font-family: var(--din); font-size: 28px; line-height: 1.1; margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.sv span { font-size: 13px; color: var(--ink-2); margin-left: 3px; }
.state { display: flex; gap: 8px; align-items: baseline; margin: 14px 0 0; font-size: 12.5px; color: var(--ink-2); }
.spaced { margin-top: 16px; }
.chart { position: relative; }
.chart svg { display: block; overflow: visible; }
.gridl { stroke: var(--grid); stroke-width: 1; }
.base { stroke: var(--axis); stroke-width: 1; }
.tk { fill: var(--muted); font-size: 10px; font-family: var(--din); font-variant-numeric: tabular-nums; }
.ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ln.prp { stroke: var(--prp); } .ln.gpu { stroke: var(--ink-2); } .ln.tf { stroke: var(--tf); }
.xhair { stroke: var(--axis); stroke-width: 1; }
.hdot { stroke: var(--panel); stroke-width: 2; }
.hdot.prp, .pt { fill: var(--prp); } .hdot.gpu { fill: var(--ink-2); } .hdot.tf { fill: var(--tf); }
.pt { stroke: var(--panel); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: #0d131a; color: var(--ink); border: 1px solid var(--line-2); border-radius: 3px; padding: 4px 8px; font-size: 11.5px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); display: none; z-index: 3; font-variant-numeric: tabular-nums; }
.tip b { font-weight: 600; }

/* ---------- system, feed, terminal */
details { margin-top: 12px; font-size: 12px; color: var(--ink-2); }
summary { cursor: pointer; }
table { border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
th, td { padding: 3px 14px 3px 0; text-align: right; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
th:first-child, td:first-child { text-align: left; }
.feed { list-style: none; margin: 0; padding: 0; max-height: 452px; overflow: auto; }
.feed li { display: grid; grid-template-columns: 44px 92px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: baseline; }
.feed .t { font-family: var(--din); color: var(--muted); font-variant-numeric: tabular-nums; }
.feed .src { font-family: var(--din); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.feed .msg { color: var(--ink); overflow-wrap: anywhere; }
.tabs { display: inline-flex; gap: 6px; }
.tab[aria-selected="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
pre { margin: 0; height: 300px; overflow: auto; background: #04070a; border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px; font: 12px/1.55 var(--mono); color: var(--ink-2); white-space: pre; }
.foot { max-width: 1760px; margin: 0 auto; padding: 4px 18px 24px; font-size: 11.5px; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .cls.cur { animation: blink 1.6s steps(2, start) infinite; }
  @keyframes blink { to { visibility: hidden; } }
}
@media (max-width: 1280px) {
  .s3, .s4, .s5 { grid-column: span 6; }
  .strips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .s3, .s4, .s5 { grid-column: span 12; }
  .strips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-row { grid-template-columns: 120px minmax(0, 1fr); }
  .tl-when { display: none; }
  .clocks { gap: 16px; }
}
