/* Build runners dashboard, "Rack" design: each runner is a hardware unit with BUSY / HOLD / FAULT
   lights, LCD screens and segmented meters, in warm aluminium (light) or dark anodised (dark).
   Fonts are served from /fonts (the CSP allows nothing else). */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Azeret Mono";
  src: url("/fonts/azeret-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --acc: #FF5A1F; --acc-t: #B83A0B; --acc-lcd: #FF5A1F;
  --bg: #D9D7D2; --panel: #E9E7E2; --pborder: #C9C6BF; --phi: #F7F6F3; --pshadow: 0 1px 2px rgba(0,0,0,.06);
  --unit: #F5F4F0; --uborder: #CFCCC5; --uhi: #FFFFFF;
  --key: #E6E4DF; --kborder: #BEBAB2; --kshadow: #BEBAB2; --keyon: #F6F5F2;
  --nav: #E2E0DA; --navb: #C9C6BF;
  --ink: #141414; --ink2: #3A3834; --mute: #57544E; --mute2: #6B6862; --faint: #8E8A82;
  --div: #D3D0C9; --screw: #CBC8C1; --ledoff: #C4C0B8; --moff: #CCC9C2; --mother: #3A3834;
  --lcd: #161714; --lcd-edge: transparent; --lcd-t: #ECEAE3; --lcd-m: #9B988F; --lcd-d: #B9B6AD; --lcd-grid: #2A2B27; --seg-off: #3A3934; --seg-mid: #6B6A63;
  --pass: #2FA36B; --pass-t: #1F7A4D; --fail: #E0362A; --fail-t: #B3261C; --hold: #F2B705; --hold-t: #7A5D00;
  --lcd-pass: #7FD6A3; --lcd-fail: #FF8A7A; --lcd-hold: #F2C94C;
  --field: #FBFAF7; --field-b: #BEBAB2; --scrim: rgba(38,36,32,.45); --pop: #F8F7F4;
  --hatch: rgba(0,0,0,.07);
  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --acc-t: #FF7A45;
  --bg: #121311; --panel: #1C1D1A; --pborder: #2D2E2A; --phi: #272824; --pshadow: 0 1px 2px rgba(0,0,0,.5);
  --unit: #252622; --uborder: #363732; --uhi: #2F302B;
  --key: #2E2F2B; --kborder: #42433D; --kshadow: #0A0A09; --keyon: #3A3B36;
  --nav: #20211E; --navb: #31322D;
  --ink: #ECEAE3; --ink2: #CFCCC4; --mute: #A3A097; --mute2: #8C897F; --faint: #6F6C64;
  --div: #2F302B; --screw: #3C3D38; --ledoff: #45463F; --moff: #30312C; --mother: #9B988F;
  --lcd: #0A0B09; --lcd-edge: #2C2D29; --lcd-m: #8F8C83; --lcd-grid: #232420; --seg-off: #2E2F2A; --seg-mid: #5E5D57;
  --pass: #3DBE7D; --pass-t: #6FD39C; --fail: #FF4D3D; --fail-t: #FF8A7A; --hold: #F2B705; --hold-t: #F2C94C;
  --field: #141513; --field-b: #42433D; --scrim: rgba(0,0,0,.6); --pop: #262723;
  --hatch: rgba(255,255,255,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --acc-t: #FF7A45;
    --bg: #121311; --panel: #1C1D1A; --pborder: #2D2E2A; --phi: #272824; --pshadow: 0 1px 2px rgba(0,0,0,.5);
    --unit: #252622; --uborder: #363732; --uhi: #2F302B;
    --key: #2E2F2B; --kborder: #42433D; --kshadow: #0A0A09; --keyon: #3A3B36;
    --nav: #20211E; --navb: #31322D;
    --ink: #ECEAE3; --ink2: #CFCCC4; --mute: #A3A097; --mute2: #8C897F; --faint: #6F6C64;
    --div: #2F302B; --screw: #3C3D38; --ledoff: #45463F; --moff: #30312C; --mother: #9B988F;
    --lcd: #0A0B09; --lcd-edge: #2C2D29; --lcd-m: #8F8C83; --lcd-grid: #232420; --seg-off: #2E2F2A; --seg-mid: #5E5D57;
    --pass: #3DBE7D; --pass-t: #6FD39C; --fail: #FF4D3D; --fail-t: #FF8A7A; --hold: #F2B705; --hold-t: #F2C94C;
    --field: #141513; --field-b: #42433D; --scrim: rgba(0,0,0,.6); --pop: #262723;
    --hatch: rgba(255,255,255,.06);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 14px/1.45 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cond { font-stretch: 75%; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--mute); }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.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: 50; padding: 10px 14px; border-radius: 7px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }
.ic { width: 16px; height: 16px; flex: none; display: block; }
.ic.sm { width: 13px; height: 13px; }
.ic.lg { width: 17px; height: 17px; }
.spin { transform-origin: 12px 12px; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } * { transition: none !important; } }

/* ---------- surfaces ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--pborder); border-radius: 12px;
  box-shadow: inset 0 1px 0 var(--phi), var(--pshadow);
}
.unit-skin { background: var(--unit); border: 1px solid var(--uborder); border-radius: 8px; box-shadow: inset 0 1px 0 var(--uhi); }
.lcd {
  background: var(--lcd); color: var(--lcd-t); font-family: var(--mono); border-radius: 8px;
  outline: 1px solid var(--lcd-edge); outline-offset: -1px; box-shadow: inset 0 2px 6px rgba(0,0,0,.55);
}
.screw { width: 9px; height: 9px; border-radius: 50%; background: var(--screw); box-shadow: inset 0 1px 1px rgba(0,0,0,.25); flex: none; }
.screw.sm { width: 7px; height: 7px; }
.screws { display: flex; flex-direction: column; justify-content: space-between; align-self: stretch; padding: 14px 0; }

/* panel heading */
.ph { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 32px; }
.ph h2 { font-stretch: 75%; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: 15px; }
.ph .ph-meta { font: 400 11px var(--mono); color: var(--mute); text-transform: uppercase; }
.ph .ph-right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.more-link { display: inline-flex; align-items: center; gap: 4px; font-stretch: 85%; font-weight: 700; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); border-radius: 4px; }
.more-link:hover { color: var(--ink); }
.lbl { font-stretch: 75%; font-weight: 700; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }

/* ---------- keys (buttons) ---------- */
.key {
  --h: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 13px;
  border-radius: 7px; border: 1px solid var(--kborder); background: var(--key); box-shadow: 0 2px 0 var(--kshadow);
  color: var(--ink2); font-stretch: 85%; font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; cursor: pointer; user-select: none; position: relative;
  transition: background .12s, color .12s, transform .06s, box-shadow .06s;
}
.key:hover { background: var(--keyon); color: var(--ink); }
.key:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--kshadow); }
.key.is-on, .key[aria-pressed="true"], .key[aria-expanded="true"] { background: var(--keyon); color: var(--ink); }
.key.k-icon { width: var(--h); padding: 0; flex: none; }
.key.k-sm { --h: 34px; font-size: 10.5px; padding: 0 11px; gap: 6px; }
.key.k-md { --h: 36px; font-size: 11px; }
.key.k-lg { --h: 44px; font-size: 11.5px; }
.key.k-xs { --h: 30px; font-size: 10.5px; padding: 0 10px; }
.key.k-sm.k-icon, .key.k-xs.k-icon, .key.k-md.k-icon { padding: 0; }
.key.k-flat { background: var(--nav); border-color: var(--navb); box-shadow: none; color: var(--mute); }
.key.k-flat:hover { color: var(--ink); background: var(--key); }
.key.k-flat:active { transform: none; }
.key.k-primary { background: var(--ink); border-color: var(--ink); box-shadow: 0 2px 0 #000; color: var(--bg); }
.key.k-primary:hover { background: var(--ink2); color: var(--bg); }
.key.k-accent { background: var(--acc); border-color: rgba(0,0,0,.22); box-shadow: 0 2px 0 rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.28); color: #fff; }
.key.k-accent:hover { background: #F04E14; color: #fff; }
.key.k-danger { background: var(--fail); border-color: rgba(0,0,0,.22); box-shadow: 0 2px 0 rgba(0,0,0,.35); color: #fff; }
.key.k-danger:hover { background: #C92B20; color: #fff; }
.key:disabled, .key[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.key:disabled:hover { background: var(--key); color: var(--ink2); }
.key.k-accent:disabled:hover { background: var(--acc); color: #fff; }
.key .kdot { width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.key .caret { margin-left: auto; color: var(--mute); }
a.key { text-decoration: none; }

/* ---------- lights ---------- */
.led { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ledoff); box-shadow: inset 0 1px 1px rgba(0,0,0,.25); }
.led.sm { width: 7px; height: 7px; }
.led.md { width: 8px; height: 8px; }
.led.busy, .led.run { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.led.hold, .led.lost { background: var(--hold); box-shadow: 0 0 6px var(--hold); }
.led.fault, .led.fail { background: var(--fail); box-shadow: 0 0 6px var(--fail); }
.led.fail { box-shadow: none; }
.led.pass { background: var(--pass); box-shadow: none; }
.led.cncl, .led.skip, .led.done { background: var(--faint); box-shadow: none; }
.led.lost { box-shadow: none; }
.led.blink { animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .led.blink { animation: none; } }
.leds { display: grid; grid-template-columns: 9px auto; gap: 4px 6px; align-items: center; font-stretch: 75%; font-weight: 700; font-size: 10px; letter-spacing: .06em; color: var(--mute); }
.leds-row { display: flex; gap: 12px; font-stretch: 75%; font-weight: 700; font-size: 10px; letter-spacing: .06em; color: var(--mute); }
.leds-row span { display: flex; align-items: center; gap: 5px; }

/* ---------- small parts ---------- */
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 4px; border: 1px solid var(--kborder); background: var(--key); font: 400 10px var(--mono); color: var(--mute); white-space: nowrap; }
.tag.t-ink { color: var(--ink); font-size: 10.5px; text-transform: uppercase; }
a.tag:hover { color: var(--ink); }
.chip { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 4px; background: var(--lcd); font: 400 11px var(--mono); color: var(--lcd-t); letter-spacing: 0; }
.chip.c-fail { color: var(--lcd-fail); } .chip.c-pass { color: var(--lcd-pass); } .chip.c-acc { color: var(--acc); } .chip.c-m { color: var(--lcd-m); } .chip.c-hold { color: var(--lcd-hold); }
.verdict { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 5px; background: var(--lcd); color: var(--lcd-t); font-stretch: 85%; font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.verdict i { width: 7px; height: 7px; border-radius: 50%; }
.verdict.v-pass i { background: var(--pass); }
.verdict.v-warn i { background: var(--hold); box-shadow: 0 0 6px var(--hold); }
.verdict.v-fail i { background: var(--fail); box-shadow: 0 0 6px var(--fail); }
.verdict.v-acc i { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 5px; background: var(--key); border: 1px solid var(--kborder); box-shadow: 0 2px 0 var(--kshadow); font: 400 11.5px var(--mono); color: var(--ink2); }
.res { display: flex; align-items: center; gap: 9px; }
.res-t { font: 600 12px var(--mono); color: var(--ink); }
.res-t.pass { color: var(--pass-t); } .res-t.fail { color: var(--fail-t); } .res-t.cncl, .res-t.skip, .res-t.done { color: var(--mute); } .res-t.lost { color: var(--hold-t); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--fail); color: #fff; font: 600 10.5px var(--mono); letter-spacing: 0; display: inline-grid; place-items: center; }
.sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--mute); padding: 0 4px; }
.legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend .sw-bar { width: 14px; height: 10px; border-radius: 2px; }
.legend .sw-line { width: 14px; height: 2px; }
.empty { color: var(--mute); padding: 10px 4px; }

/* segmented meter */
.seg { position: relative; display: grid; grid-template-columns: repeat(var(--n, 24), minmax(0, 1fr)); gap: var(--g, 3px); height: var(--sh, 34px); }
.seg > span { border-radius: var(--sr, 2px); background: var(--moff); }
.seg > .s-acc { background: var(--acc); }
.seg > .s-other { background: var(--mother); }
.seg > .s-hold { background: var(--hold); }
.seg > .s-pass { background: var(--pass); }
.seg > .s-fail { background: var(--fail); }
.seg > .s-lcdoff { background: var(--seg-off); }
.seg > .s-lcdmid { background: var(--seg-mid); }
.seg > .seg-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 0; }
.seg > .seg-mark.m-hold { background: var(--hold); }
.seg > .seg-mark.m-lcd { background: var(--lcd-t); }
.stepbar { flex: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 6px; min-width: 40px; }
.stepbar > span { background: var(--seg-off); }
.stepbar > .on { background: var(--acc); }
.stepbar > .mid { background: var(--seg-mid); }

/* text field (search) */
.field {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; min-width: 0;
  background: var(--field); border: 1px solid var(--field-b); border-radius: 8px; box-shadow: inset 0 2px 3px rgba(0,0,0,.08); color: var(--mute);
}
.field:focus-within { outline: 2px solid var(--acc); outline-offset: 2px; }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: 400 13px var(--mono); color: var(--ink); padding: 0; height: 100%; }
.field input::placeholder { color: var(--mute2); opacity: 1; }
.field input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---------- custom dropdown (button + listbox) ---------- */
.dd { position: relative; display: inline-flex; }
.dd-btn { justify-content: space-between; }
.dd-btn .dd-value { overflow: hidden; text-overflow: ellipsis; }
.dd-list {
  position: absolute; z-index: 40; top: calc(100% + 8px); left: 0; min-width: 100%; width: max-content; max-width: min(320px, 90vw); max-height: 320px; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--pop); border: 1px solid var(--kborder); border-radius: 9px; box-shadow: 0 14px 34px rgba(0,0,0,.2);
}
.dd-list.is-right { left: auto; right: 0; }
.dd-list:focus { outline: none; }
.dd-opt { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; }
.dd-opt[aria-selected="true"] { font-weight: 700; }
.dd-opt.is-active { background: var(--key); box-shadow: inset 3px 0 0 var(--acc); }
.dd-opt .dd-hint { font: 400 11px var(--mono); color: var(--mute); }
.dd-opt .dd-check { margin-left: auto; color: var(--acc); display: grid; }
.dd-opt .dd-check:empty { display: none; }

/* ---------- header ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 24px 40px 48px; display: flex; flex-direction: column; gap: 20px; }
.top { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; min-height: 72px; padding: 0 20px; }
.brand { display: flex; align-items: center; gap: 14px; border-radius: 6px; }
.dots { display: grid; grid-template-columns: repeat(4, 4px); gap: 3px; flex: none; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); }
.dots i:last-child { background: var(--acc); }
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-stretch: 75%; font-weight: 800; font-size: 17px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; }
.brand-site { font: 400 10.5px var(--mono); color: var(--mute); text-transform: uppercase; }
.nav { display: flex; gap: 6px; }
.navkey {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 7px;
  background: var(--nav); border: 1px solid var(--navb); color: var(--mute);
  font-stretch: 85%; font-weight: 600; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; position: relative;
}
.navkey:hover { color: var(--ink); }
.navkey[aria-current="page"] { background: var(--keyon); border-color: var(--kborder); box-shadow: 0 2px 0 var(--kshadow); color: var(--ink); font-weight: 700; }
.navkey .kdot { display: none; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
.navkey[aria-current="page"] .kdot { display: block; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.clock { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px; border-radius: 7px; background: var(--lcd); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); outline: 1px solid var(--lcd-edge); outline-offset: -1px; font: 400 17px var(--mono); color: var(--lcd-t); letter-spacing: .04em; }
.clock .led { width: 7px; height: 7px; box-shadow: 0 0 8px var(--acc); }
.clock.is-lost .led { background: var(--fail); box-shadow: 0 0 8px var(--fail); }
.clock.is-lost { color: var(--lcd-fail); }
.logout { display: contents; }
.view { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
#main:focus { outline: none; }

/* status strips: alerts, connection lost, sign-in messages */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alerts:empty { display: none; }
.status { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 10px 14px; border-radius: 7px; font-size: 12px; line-height: 1.4; }
.status > span { color: var(--lcd-t); }
.status.is-bad > span { color: var(--lcd-fail); }
.status.is-warn > span { color: var(--lcd-hold); }
.status.is-info > span { color: var(--lcd-d); }
.status b { color: var(--lcd-t); font-weight: 600; }
.status .st-detail { color: var(--lcd-m); }
.status .st-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.status .key.k-flat { background: transparent; border-color: var(--seg-off); color: var(--lcd-d); }
.status .key.k-flat:hover { color: var(--lcd-t); background: var(--seg-off); }

/* ---------- overview: master panel ---------- */
.master { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 18px; }
.ms { grid-column: span 2; min-height: 168px; padding: 18px 22px; border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.ms-k { font-size: 11px; color: var(--lcd-m); letter-spacing: .1em; text-transform: uppercase; }
.ms-big { font-size: 30px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; }
.ms-big .dim { color: var(--lcd-m); }
.ms-line { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--lcd-d); }
.ms-line.acc { color: var(--acc); }
.ms-line .pass { color: var(--lcd-pass); }
.ms-line button { all: unset; cursor: pointer; color: var(--lcd-pass); border-radius: 3px; }
.ms-line button:hover { text-decoration: underline; }
.ms-line button:focus-visible { outline: 2px solid var(--acc); }
.gauge { display: flex; flex-direction: column; gap: 12px; padding: 6px 4px; min-width: 0; }
.gauge-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gauge-head .lbl { font-size: 12px; }
.gauge-val { font: 500 26px var(--mono); }
.gauge-val small { font-size: 14px; color: var(--mute2); }
.gauge-legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--mute); }
.gauge-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.gauge-legend .end { margin-left: auto; font-weight: 600; color: var(--ink); }
.gauge-legend .tick { width: 2px; height: 10px; background: var(--hold); }

/* ---------- overview: racks of 1U units ---------- */
.racks { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.chassis { flex: 1 1 600px; min-width: 0; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.chassis > .ph { padding: 2px 6px 6px; }
.chassis .ph h2 { font-size: 16px; }
.units { display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.u1 { display: grid; grid-template-columns: 14px 124px 64px minmax(0, 1fr) 92px 14px; gap: 12px; align-items: center; height: 88px; padding: 0 10px; }
.u1 .screws { padding: 15px 0; height: 88px; }
.u1-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.u1-name b { font-stretch: 75%; font-weight: 800; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.u1-name span { font: 400 10.5px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u1-keys { display: flex; gap: 6px; justify-content: flex-end; }
.u1-keys .k-primary { font-size: 11px; }
.u1-keys .k-primary .ic { display: none; }
.scr { height: 62px; padding: 9px 14px; border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.scr-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.scr-top > :first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.scr-top.dim { color: var(--lcd-m); }
.scr-bot { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--acc); min-width: 0; }
.scr-bot > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-bot .stepbar { max-width: 200px; margin-left: auto; }
.scr-bot.pass { color: var(--lcd-pass); } .scr-bot.fail { color: var(--lcd-fail); } .scr-bot.hold { color: var(--lcd-hold); } .scr-bot.mute { color: var(--lcd-m); }
.scr-sub { font-size: 10.5px; color: var(--lcd-m); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcd button.lcd-link { all: unset; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 3px; }
.lcd button.lcd-link:hover { text-decoration: underline; }
.lcd button.lcd-link:focus-visible { outline: 2px solid var(--acc); }
.tray {
  display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 16px; border: 1.5px dashed var(--faint); border-radius: 8px;
  background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 7px); font: 400 12px var(--mono);
}
.tray b { font: 800 12px var(--sans); font-stretch: 75%; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.tray .tray-text { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tray .tray-end { margin-left: auto; color: var(--mute); white-space: nowrap; }
/* A narrow chassis (phone, or a half-width column) turns each unit into a compact row. */
@container (max-width: 540px) {
  .u1 { grid-template-columns: 9px 96px minmax(0, 1fr) auto; height: auto; min-height: 60px; padding: 8px 10px; gap: 10px; }
  .u1 .screws, .u1 .leds { display: none; }
  .u1 .u1-led { display: inline-block; }
  .u1-name b { font-size: 14px; }
  .u1-name span { display: none; }
  .u1-name b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .u1-keys .k-primary { width: var(--h); padding: 0; }
  .u1-keys .k-primary .ic { display: block; }
  .u1-keys .k-primary .key-text { display: none; }
  .scr { height: 44px; padding: 5px 10px; border-radius: 5px; }
  .scr-top { font-size: 11px; }
  .scr-bot { font-size: 10px; }
  .scr-bot .stepbar { display: none; }
  .u1-keys .key { --h: 34px; }
  .tray { min-height: 40px; font-size: 11px; gap: 10px; }
  .tray .tray-end { display: none; }
}
.u1-led { display: none; }

/* ---------- recorder (activity on an LCD) ---------- */
.block { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.block > .ph { padding: 0 4px; }
.rec { padding: 12px 18px 10px; border-radius: 10px; }
.rec-group { font-size: 10.5px; color: var(--lcd-m); letter-spacing: .1em; height: 22px; display: flex; align-items: center; text-transform: uppercase; }
.rec-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: center; height: 24px; }
.rec-row.sat { height: 22px; }
.rec-name { font-size: 11.5px; color: var(--lcd-d); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-row.sat .rec-name { font-size: 10.5px; color: var(--lcd-m); }
.rec-track { position: relative; height: 100%; border-right: 2px solid var(--acc); }
.rec-track.past { border-right-color: transparent; }
.rec-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lcd-grid); }
.rec-bar { all: unset; position: absolute; top: 5px; height: 14px; min-width: 3px; border-radius: 2px; background: var(--lcd-pass); cursor: pointer; }
.rec-bar.fail { background: var(--lcd-fail); }
.rec-bar.run { background: var(--acc); }
.rec-bar.cncl, .rec-bar.skip, .rec-bar.done { background: var(--seg-mid); }
.rec-bar.lost { background: var(--lcd-hold); }
.rec-bar.open { border-radius: 2px 0 0 2px; }
.rec-bar:hover { filter: brightness(1.15); }
.rec-bar:focus-visible { outline: 2px solid var(--lcd-t); outline-offset: 1px; }
.rec-hatch { position: absolute; top: 5px; bottom: 5px; min-width: 5px; border-radius: 2px; background: repeating-linear-gradient(135deg, rgba(255,255,255,.22) 0 3px, transparent 3px 7px); box-shadow: inset 0 0 0 1px var(--lcd-d); }
.rec-axis { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; height: 18px; margin-top: 6px; font-size: 10px; color: var(--lcd-m); }
.rec-axis > span:last-child { position: relative; }
.rec-axis .tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.rec-axis .now { position: absolute; right: 0; color: var(--acc); }
.sw-hatch { background: repeating-linear-gradient(135deg, rgba(255,255,255,.22) 0 3px, transparent 3px 7px), var(--lcd); box-shadow: inset 0 0 0 1px var(--lcd-d); }

/* ---------- scopes (line charts on an LCD) ---------- */
.scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.scope-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.scope-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px; }
.scope-head .lbl { font-size: 12px; }
.scope-head .v { font: 400 12.5px var(--mono); color: var(--ink2); }
.scope { padding: 10px 12px 6px; border-radius: 10px; min-height: 120px; }
.scope svg { display: block; width: 100%; overflow: visible; }
.scope .grid line { stroke: var(--lcd-grid); stroke-width: 1; }
.scope text { fill: var(--lcd-m); font: 400 10px var(--mono); }
.scope .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.scope .ln.ci { stroke: var(--acc); }
.scope .ln.other { stroke: var(--lcd-d); }
.scope .area.ci { fill: var(--acc); opacity: .16; }
.scope .cap { stroke: var(--lcd-d); stroke-width: 1.2; stroke-dasharray: 5 4; }
.scope .cap-t { fill: var(--lcd-d); }
.scope .warn { stroke: var(--lcd-hold); stroke-width: 1; stroke-dasharray: 2 4; opacity: .8; }
.scope .warn-t { fill: var(--lcd-hold); }
.scope .cross { stroke: var(--lcd-t); stroke-width: 1; opacity: .5; }
.scope .dot.ci { fill: var(--acc); } .scope .dot.other { fill: var(--lcd-d); }
.scope .dot { stroke: var(--lcd); stroke-width: 2; }
.scope-empty { display: grid; place-items: center; color: var(--lcd-m); font-size: 11.5px; text-align: center; padding: 0 12px; }
.sw-ci { background: var(--acc); } .sw-other { background: var(--lcd-d); }
.legend .note { margin-left: auto; }

/* ---------- log ---------- */
.log { padding: 16px 20px; }
.log-rows { display: flex; flex-direction: column; font: 400 12.5px var(--mono); margin-top: 8px; }
.log-row { all: unset; display: grid; grid-template-columns: 10px 56px 64px minmax(0, 1.4fr) minmax(0, 1fr) 90px 60px; gap: 14px; align-items: center; height: 34px; border-top: 1px solid var(--div); cursor: pointer; border-radius: 2px; }
.log-row:hover { background: color-mix(in srgb, var(--unit) 70%, transparent); }
.log-row:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.log-row > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.log-row .m { color: var(--mute); }
.log-row .r { text-align: right; }

/* ---------- jobs ---------- */
.jtool { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.jt-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.jt-row .field { flex: 1 1 360px; }
.jt-row .dd .key { min-width: 150px; }
.jt-res { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.jt-sum { margin-left: auto; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: 7px; font-size: 11.5px; white-space: nowrap; text-transform: uppercase; overflow: hidden; }
.jt-sum .dim { color: var(--lcd-m); }
.jtable { padding: 6px 10px 12px; }
table.jobs { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.jobs col.c-res { width: 92px; } table.jobs col.c-ref { width: 26%; } table.jobs col.c-run { width: 112px; }
table.jobs col.c-start { width: 84px; } table.jobs col.c-took { width: 118px; } table.jobs col.c-cpu { width: 76px; } table.jobs col.c-mem { width: 104px; }
table.jobs th { height: 40px; padding: 0 7px; text-align: left; font-stretch: 75%; font-weight: 700; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); white-space: nowrap; }
table.jobs th:first-child, table.jobs td:first-child { padding-left: 12px; }
table.jobs th.r, table.jobs td.r { text-align: right; }
table.jobs th[aria-sort="ascending"], table.jobs th[aria-sort="descending"] { color: var(--ink); }
.th-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; border-radius: 3px; }
.th-sort:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.th-sort:hover { color: var(--ink); }
th.r .th-sort { flex-direction: row-reverse; }
table.jobs tr.day th { height: 38px; border-top: 1px solid var(--div); padding: 0 12px; }
.day-cell { display: flex; align-items: center; gap: 12px; font-size: 11px; }
.day-cell::after { content: ""; flex: 1; height: 1px; background: var(--div); }
tr.jrow { cursor: pointer; }
tr.jrow td { height: 54px; padding: 6px 7px; border-top: 1px solid var(--div); vertical-align: middle; }
tr.jrow:hover td { background: color-mix(in srgb, var(--unit) 70%, transparent); }
tr.jrow:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.cell-t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-s { font: 400 10.5px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.cell-ref { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cell-ref .br { font: 400 12px var(--mono); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cell-m { font: 400 12.5px var(--mono); }
.took { display: flex; flex-direction: column; gap: 2px; font: 400 12.5px var(--mono); }
.took.run > span:first-child { color: var(--acc-t); }
.took-s { font-size: 10.5px; color: var(--mute); white-space: nowrap; }
.took-s.slow { color: var(--fail-t); }
.took-s.run { color: var(--acc-t); }
.jmore { display: flex; align-items: center; gap: 14px; padding: 16px 12px 4px; border-top: 1px solid var(--div); font: 400 11.5px var(--mono); color: var(--mute); text-transform: uppercase; }
.m-only { display: none; }

/* ---------- job panel (drawer) ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
.drawer {
  position: fixed; z-index: 31; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--pborder); box-shadow: -18px 0 40px rgba(0,0,0,.22);
}
.dr-head { display: flex; align-items: flex-start; gap: 16px; padding: 24px 28px 18px; border-bottom: 1px solid var(--div); }
.dr-screws { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.dr-title { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dr-title h2 { font-size: 24px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.dr-title .dr-sub { font: 400 11.5px var(--mono); color: var(--mute); }
.dr-head .dr-close { margin-left: auto; }
.dr-back { display: none; }
.stamp { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 5px; background: var(--lcd); font: 600 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--lcd-t); }
.stamp.fail { color: var(--lcd-fail); } .stamp.pass { color: var(--lcd-pass); } .stamp.run { color: var(--acc); } .stamp.lost { color: var(--lcd-hold); } .stamp.cncl { color: var(--lcd-m); }
.dr-body { flex: 1; overflow: auto; padding: 18px 28px 28px; display: flex; flex-direction: column; gap: 14px; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plate { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; padding: 16px 18px; border-radius: 10px; }
.plate > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.plate .lbl { font-size: 10px; }
.plate .v { font: 400 12.5px var(--mono); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate .s { font: 400 10.5px var(--mono); color: var(--mute); }
.plate .s.slow { color: var(--fail-t); }
.h3 { margin: 6px 0 0; font-stretch: 75%; font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.steps { padding: 8px 6px; border-radius: 10px; display: flex; flex-direction: column; margin: 0; list-style: none; }
.step { display: grid; grid-template-columns: 20px 16px minmax(0, 1fr) 62px 180px; gap: 10px; align-items: center; height: 28px; padding: 0 10px; border-radius: 4px; }
.step.fail { background: rgba(255,90,70,.10); }
.step .n { color: var(--lcd-m); font-size: 10.5px; }
.step .si { display: grid; color: var(--lcd-pass); }
.step .nm { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step .d { font-size: 12px; color: var(--lcd-d); text-align: right; }
.step .tr { position: relative; height: 8px; background: var(--lcd-grid); border-radius: 2px; }
.step .tr > span { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--lcd-pass); }
.step.fail .si, .step.fail .nm, .step.fail .d { color: var(--lcd-fail); } .step.fail .tr > span { background: var(--lcd-fail); }
.step.skip .si, .step.skip .nm, .step.cncl .si, .step.cncl .nm { color: var(--lcd-m); } .step.skip .tr > span, .step.cncl .tr > span { background: var(--seg-mid); }
.step.run .si, .step.run .nm { color: var(--acc); } .step.run .tr > span { background: var(--acc); }
.res-nums { display: flex; gap: 18px; flex-wrap: wrap; font: 400 12px var(--mono); color: var(--mute); text-transform: uppercase; }
.res-nums b { color: var(--ink); font-weight: 600; text-transform: none; }
.minis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.minis .scope { padding: 8px 10px 2px; min-height: 0; }
.minis .mini-k { font-size: 10px; color: var(--lcd-m); letter-spacing: .1em; padding: 0 2px 4px; text-transform: uppercase; }
.runs { padding: 14px 14px 10px; border-radius: 10px; }
.runs-bars { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.runbar { all: unset; flex: 1; min-width: 3px; border-radius: 2px 2px 0 0; background: var(--lcd-pass); opacity: .78; cursor: pointer; }
.runbar.fail { background: var(--lcd-fail); } .runbar.run { background: var(--acc); } .runbar.cncl, .runbar.skip, .runbar.done { background: var(--seg-mid); } .runbar.lost { background: var(--lcd-hold); }
.runbar.cur { opacity: 1; box-shadow: 0 0 0 2px var(--lcd), 0 0 0 3px var(--lcd-t); }
.runbar:hover { opacity: 1; }
.runbar:focus-visible { outline: 2px solid var(--lcd-t); outline-offset: 1px; }
.runs-usual { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--lcd-d); pointer-events: none; }
.runs-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 10px; color: var(--lcd-m); text-transform: uppercase; }
.runs-axis .cur { color: var(--lcd-t); }
.small { font-size: 12.5px; }
.note-p { margin: -6px 0 0; font-size: 12.5px; color: var(--mute); }
.drawer-loading { display: flex; align-items: center; gap: 10px; padding: 28px; color: var(--mute); }
body.has-drawer { overflow: hidden; }

/* ---------- runners ---------- */
.bar { padding: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sumlcd { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 7px; font-size: 12px; white-space: nowrap; text-transform: uppercase; overflow: hidden; min-width: 0; }
.sumlcd .dim { color: var(--lcd-m); }
.sumlcd .sep, .ms-big .sep { margin: 0 .45em; color: var(--lcd-m); }
.sumlcd .sep.lead { margin-left: 0; }
.sumlcd .acc { color: var(--acc); }
.bar .bar-end { margin-left: auto; display: flex; gap: 6px; }
.rack { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rack > .ph { padding: 2px 6px 4px; }
.rack .ph h2 { font-size: 16px; }
.blades { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.blade { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 20px 20px 16px; border-radius: 10px; }
.blade .corner { position: absolute; display: flex; }
.blade .corner.tl { top: 8px; left: 8px; } .blade .corner.tr { top: 8px; right: 8px; } .blade .corner.bl { bottom: 8px; left: 8px; } .blade .corner.br { bottom: 8px; right: 8px; }
.blade-head { display: flex; align-items: flex-start; gap: 12px; }
.blade-head .nm { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.blade-head .nm b { font-stretch: 75%; font-weight: 800; font-size: 22px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.05; }
.blade-head .tags { display: flex; gap: 5px; flex-wrap: wrap; }
.blade-head .leds-row { margin-left: auto; padding-top: 4px; }
.bscr { height: 84px; padding: 10px 14px; border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.reads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 12px; }
.read { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.read .lbl { font-size: 9.5px; }
.read .v { font: 500 16px var(--mono); white-space: nowrap; }
.read .v small { font-size: 11px; color: var(--mute); font-weight: 400; }
.read .s { font: 400 9.5px var(--mono); color: var(--mute); line-height: 1.35; }
.read.ph-only, .sm-only { display: none; }
.lane24 { display: flex; flex-direction: column; gap: 4px; }
.lane24 .strip { padding: 0 8px; border-radius: 5px; }
.lane24 .strip > span { position: relative; display: block; height: 16px; }
.lane24 .g { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--lcd-grid); }
.lane24 .b { position: absolute; top: 3px; bottom: 3px; min-width: 2px; border-radius: 1px; background: var(--lcd-pass); }
.lane24 .b.fail { background: var(--lcd-fail); } .lane24 .b.run { background: var(--acc); } .lane24 .b.cncl, .lane24 .b.skip, .lane24 .b.done { background: var(--seg-mid); } .lane24 .b.lost { background: var(--lcd-hold); }
.lane24 .ax { display: flex; justify-content: space-between; font: 400 9.5px var(--mono); color: var(--mute); }
.blade-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--div); }
.blade-foot .up { font: 400 10px var(--mono); color: var(--mute); text-transform: uppercase; }
.blade-foot .keys { margin-left: auto; display: flex; gap: 6px; }
.actions { padding: 16px 20px 10px; }
.act-head, .act-row { display: grid; grid-template-columns: 170px 150px 110px minmax(0, 1fr) 110px; gap: 14px; align-items: center; }
.act-head { height: 34px; margin-top: 6px; }
.act-row { min-height: 42px; border-top: 1px solid var(--div); font: 400 12.5px var(--mono); }
.act-row .a { font: 600 13.5px var(--sans); }
.act-row .ok { display: flex; align-items: center; gap: 9px; min-width: 0; }
.act-row .ok b { font-weight: 600; color: var(--pass-t); }
.act-row .ok.no b { color: var(--fail-t); }
.act-row .ok span { color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-row .m { color: var(--mute); }

/* ---------- capacity ---------- */
.caprepos { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.caprepos > .ph { padding: 0 6px 6px; }
.crow { display: grid; grid-template-columns: 14px 170px minmax(0, 1fr) 250px 14px; gap: 18px; align-items: center; min-height: 92px; padding: 0 12px; }
.crow .screws { height: 92px; padding: 16px 0; }
.crow-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crow-name b { font-stretch: 75%; font-weight: 800; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; overflow-wrap: anywhere; }
.crow-name span { font: 400 10.5px var(--mono); color: var(--mute); text-transform: uppercase; }
.crow-reads { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.crow-reads .v { font-size: 15px; }
.crow-v { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 12px; color: var(--ink2); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.conc { padding: 16px 18px 18px; }
.conc-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.conc-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 52px 92px; gap: 12px; align-items: center; }
.conc-row .lbl { color: var(--ink2); }
.conc-row .p { font: 400 12px var(--mono); text-align: right; }
.conc-row .d { font: 400 11px var(--mono); color: var(--mute); text-align: right; }
.heat { padding: 16px 16px 12px; margin-top: 8px; border-radius: 10px; }
.heat-grid { display: grid; grid-template-columns: 36px repeat(24, minmax(0, 1fr)); gap: 7px 2px; }
.heat-grid .hk { font-size: 10px; color: var(--lcd-m); align-self: center; }
.heat-grid .hh { font-size: 9.5px; color: var(--lcd-m); text-align: center; }
.hdot { width: 13px; height: 13px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; justify-self: center; align-self: center; background: var(--lcd-grid); }
.hdot.l1 { background: var(--acc); opacity: .3; } .hdot.l2 { background: var(--acc); opacity: .55; } .hdot.l3 { background: var(--acc); opacity: .8; } .hdot.l4 { background: var(--acc); box-shadow: 0 0 6px var(--acc); }
.heat-scale { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--mute); }
.heat-scale .hdot { width: 11px; height: 11px; }
.proj { padding: 16px 18px 6px; }
.proj-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 4px 16px; }
.proj-head .lbl { font-size: 12px; color: var(--ink); }
.proj-head p { font-size: 12.5px; color: var(--mute); max-width: 560px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper output { display: grid; place-items: center; width: 64px; height: 44px; border-radius: 7px; font: 500 22px var(--mono); }
.proj-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 420px; gap: 28px; align-items: center; padding: 18px 4px; border-top: 1px solid var(--div); }
.proj-row .pl { display: flex; flex-direction: column; gap: 4px; }
.proj-row .pl b { font-stretch: 75%; font-weight: 800; font-size: 16px; letter-spacing: .08em; text-transform: uppercase; }
.proj-row .pl span { font: 400 12.5px var(--mono); color: var(--mute); }
.proj-row .pm { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.proj-axis { position: relative; display: flex; justify-content: space-between; font: 400 10.5px var(--mono); color: var(--mute); text-transform: uppercase; }
.proj-axis .mid { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; }
.proj-row .pv { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.proj-row .pv p { font-size: 13px; line-height: 1.45; color: var(--ink2); }

/* ---------- dialogs, menus, toasts, tooltip ---------- */
dialog.dlg {
  width: min(520px, calc(100vw - 32px)); padding: 22px 22px 20px; border: 1px solid var(--pborder); border-radius: 12px;
  background: var(--panel); color: var(--ink); box-shadow: inset 0 1px 0 var(--phi), 0 24px 60px rgba(0,0,0,.28);
}
dialog.dlg::backdrop { background: var(--scrim); }
.dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.dlg-head h2 { font-stretch: 75%; font-weight: 800; font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
.dlg-head .key { margin-left: auto; }
.dlg-body { display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.dlg-body b { color: var(--ink); }
.dlg-body .mono-note { font: 400 11.5px var(--mono); color: var(--mute); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.keys-list { display: flex; flex-direction: column; margin: 0; }
.keys-list > div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--div); }
.keys-list dt, .keys-list dd { margin: 0; }
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 28px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.4; box-shadow: inset 0 2px 6px rgba(0,0,0,.55), 0 10px 24px rgba(0,0,0,.18); transition: opacity .25s, transform .25s; }
.toast > span { flex: 1; }
.toast button { all: unset; display: grid; color: var(--lcd-m); cursor: pointer; border-radius: 3px; }
.toast button:hover { color: var(--lcd-t); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }
.tip { position: fixed; z-index: 70; pointer-events: none; max-width: 300px; padding: 9px 11px; border-radius: 7px; background: var(--lcd); color: var(--lcd-t); font: 400 11.5px/1.45 var(--mono); box-shadow: 0 10px 24px rgba(0,0,0,.25); outline: 1px solid var(--lcd-edge); }
.tip-title { font-weight: 600; margin-bottom: 2px; }
.tip-sub { color: var(--lcd-m); }
.tip-row { display: flex; justify-content: space-between; gap: 14px; }
.tip-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--lcd-d); }
.tip-row b { font-weight: 500; }

/* ---------- sign-in ---------- */
body.login { display: grid; place-items: center; padding: 48px 40px; }
.faceplate { width: 100%; max-width: 1120px; display: grid; grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr) 40px; overflow: hidden; border-radius: 14px; }
.ear { display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 26px 0; }
.ear.l { border-right: 1px solid var(--pborder); } .ear.r { border-left: 1px solid var(--pborder); }
.slot { width: 10px; height: 18px; border-radius: 5px; background: var(--screw); box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.face { display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 48px 48px 40px; }
.face-brand { display: flex; flex-direction: column; gap: 18px; }
.face-brand > div { display: flex; align-items: center; gap: 16px; }
.face-brand .dots { transform: scale(1.6); transform-origin: left center; margin-right: 14px; }
.face-brand b { font-stretch: 75%; font-weight: 800; font-size: 40px; letter-spacing: .05em; line-height: 1; text-transform: uppercase; }
.face-brand span { font: 400 12px var(--mono); color: var(--mute); text-transform: uppercase; }
.slots { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: 10px; }
.slot-row { display: grid; grid-template-columns: 26px 9px minmax(0, 1fr) 9px; gap: 12px; align-items: center; font: 400 10.5px var(--mono); color: var(--mute); }
.slot-row .lcd { height: 12px; border-radius: 3px; }
.face-copy { display: flex; flex-direction: column; gap: 10px; }
.face-copy h2 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; max-width: 440px; text-wrap: balance; }
.face-copy p { font-size: 14px; line-height: 1.5; color: var(--mute); max-width: 440px; }
.power { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 400 11px var(--mono); color: var(--mute); text-transform: uppercase; }
.form-side { padding: 48px 52px 40px; border-radius: 0; border-width: 0 0 0 1px; display: flex; flex-direction: column; gap: 18px; }
.form-side h1 { font-stretch: 75%; font-weight: 800; font-size: 32px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; }
.form-side .lead { font-size: 14.5px; line-height: 1.45; color: var(--mute); margin-top: 6px; }
.login-form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.lf { display: flex; flex-direction: column; gap: 7px; }
.lf label { font-stretch: 75%; font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink2); }
.inbox { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 6px 0 14px; background: var(--field); border: 1px solid var(--field-b); border-radius: 8px; box-shadow: inset 0 2px 3px rgba(0,0,0,.08); }
.inbox:focus-within { outline: 2px solid var(--acc); outline-offset: 2px; }
.inbox input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; padding: 0; font: 400 15px var(--mono); color: var(--ink); }
.inbox input[type="password"] { letter-spacing: .18em; }
.inbox .key { --h: 36px; }
.form-side:has(.status.is-bad:not([data-unlock-at])) .inbox { border-color: var(--fail); }
.caps { display: flex; align-items: center; gap: 7px; font: 400 11.5px var(--mono); color: var(--hold-t); }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14px; color: var(--ink2); width: fit-content; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; flex: none; width: 46px; height: 26px; border-radius: 13px; background: var(--lcd); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); outline: 1px solid var(--lcd-edge); outline-offset: -1px; }
.switch .track::before { content: ""; position: absolute; top: 10px; left: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 6px var(--acc); opacity: 0; transition: opacity .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--keyon); border: 1px solid var(--kborder); box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .15s; }
.switch input:checked + .track::after { left: 23px; }
.switch input:checked + .track::before { opacity: 1; }
.switch input:focus-visible + .track { outline: 2px solid var(--acc); outline-offset: 2px; }
.btn-login { --h: 54px; width: 100%; font-size: 14px; margin-top: 4px; }
.btn-login .spin-ic { display: none; }
.btn-login[aria-busy="true"] .spin-ic { display: block; }
.login-foot { font: 400 11px var(--mono); line-height: 1.6; color: var(--mute); }
.login-top { display: none; }

/* ---------- smaller screens ---------- */
@media (max-width: 1180px) {
  .master { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .crow { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 16px; min-height: 0; }
  .crow .screws { display: none; }
  .crow-reads { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crow-v { grid-column: 1 / -1; grid-row: 3; flex-direction: row; align-items: center; gap: 10px; }
  .proj-row { grid-template-columns: 130px minmax(0, 1fr); }
  .proj-row .pv { grid-column: 1 / -1; }
  .two { grid-template-columns: minmax(0, 1fr); }
  .act-head, .act-row { grid-template-columns: 120px 130px 90px minmax(0, 1fr) 80px; }
}
@media (max-width: 900px) {
  .scopes { grid-template-columns: minmax(0, 1fr); }
  .log-row { grid-template-columns: 10px 48px minmax(0, 1fr) 70px 54px; }
  .log-row .h-md { display: none; }
  table.jobs col.c-cpu, table.jobs col.c-mem { width: 0; }
  table.jobs .h-md { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .page { padding: 12px 14px 112px; gap: 10px; }
  .view { gap: 10px; }
  .top { min-height: 0; padding: 8px 4px 2px; gap: 10px; background: none; border: 0; box-shadow: none; flex-wrap: nowrap; }
  .brand { gap: 10px; }
  .brand-name { font-size: 16px; }
  .brand-site { display: none; }
  .tools { gap: 6px; }
  .tools .key { --h: 32px; }
  .tools .hide-sm, .tools .dd { display: none; }
  .clock { height: 32px; padding: 0 10px; font-size: 14px; gap: 7px; }
  .clock .sec { display: none; }
  .nav { position: fixed; z-index: 20; left: 14px; right: 14px; bottom: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .nav::before { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 130px; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--bg) 55%); }
  .navkey { height: 48px; justify-content: center; padding: 0 4px; font-size: 11.5px; gap: 6px; }
  .navkey .kdot { width: 5px; height: 5px; }
  .navkey .badge { position: absolute; top: 5px; right: 6px; min-width: 0; width: 7px; height: 7px; padding: 0; font-size: 0; }
  .master { grid-template-columns: minmax(0, 1fr); padding: 0; background: none; border: 0; box-shadow: none; gap: 10px; }
  .ms { grid-column: auto; min-height: 0; padding: 14px 16px; gap: 8px; }
  .ms-big { font-size: 22px; }
  .ms-line { font-size: 11px; }
  .gauge { padding: 12px 14px; background: var(--panel); border: 1px solid var(--pborder); border-radius: 10px; }
  .gauge .seg { --sh: 14px; --g: 2px; }
  .gauge-val { font-size: 20px; }
  .chassis, .rack, .block, .jtool, .bar, .caprepos, .conc, .proj, .actions, .log { padding: 12px; border-radius: 10px; }
  .chassis { flex-basis: 100%; }
  .chassis .ph-right { display: none; }
  .rec { padding: 10px 12px 8px; }
  .rec-row, .rec-axis { grid-template-columns: 70px minmax(0, 1fr); gap: 8px; }
  .scope-head .v { display: none; }
  .legend .note { display: none; }
  .jt-row .field { flex: 1 1 100%; }
  .jt-row .dd { flex: 1 1 0; min-width: 0; }
  .jt-row .dd .key { min-width: 0; width: 100%; font-size: 10.5px; padding: 0 8px; }
  .jt-row .k-export { display: none; }
  .jt-res .key { flex: 1 1 auto; padding: 0 6px; gap: 5px; font-size: 10.5px; min-width: 0; }
  .jt-res .key .chip { min-width: 0; padding: 0 4px; }
  .jt-res .is-extra { display: none; }
  .jt-sum { display: none; }
  .jtable { padding: 0 4px 8px; background: none; border: 0; box-shadow: none; }
  table.jobs, table.jobs tbody { display: block; }
  table.jobs thead, table.jobs colgroup { display: none; }
  table.jobs tr.day { display: block; }
  table.jobs tr.day th { display: block; padding: 0 4px; }
  tr.jrow { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--div); }
  tr.jrow td { display: block; height: auto; padding: 0; border: 0; }
  tr.jrow td:first-child { padding: 0; grid-row: 1; grid-column: 1; }
  tr.jrow .res-t { display: none; }
  tr.jrow td.c-job { grid-row: 1; grid-column: 2; min-width: 0; }
  tr.jrow td.c-job .cell-s { display: none; }
  tr.jrow td.c-took { grid-row: 1; grid-column: 3; text-align: right; }
  tr.jrow td.c-took .took-s { display: none; }
  tr.jrow td.c-ref, tr.jrow td.c-run, tr.jrow td.c-cpu, tr.jrow td.c-mem { display: none; }
  tr.jrow td.c-start { grid-row: 2; grid-column: 3; text-align: right; font-size: 10.5px; color: var(--mute); }
  tr.jrow .m-only { display: block; grid-row: 2; grid-column: 2; font: 400 10.5px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .jmore { padding: 12px 4px 0; }
  .drawer { width: 100vw; border-left: 0; }
  .dr-head { padding: 16px 14px 14px; flex-wrap: wrap; gap: 12px; }
  .dr-screws, .dr-close { display: none; }
  .dr-back { display: flex; width: 100%; justify-content: space-between; }
  .dr-title h2 { font-size: 22px; }
  .dr-body { padding: 14px 14px 32px; }
  .plate { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step { grid-template-columns: 20px 16px minmax(0, 1fr) 56px; height: 26px; }
  .step .tr { display: none; }
  .minis { grid-template-columns: minmax(0, 1fr); }
  .bar { gap: 8px; flex-wrap: nowrap; align-items: stretch; }
  .sumlcd { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; white-space: normal; font-size: 11.5px; padding: 8px 14px; flex: 1; }
  .sumlcd .sep.lead { display: none; }
  .sumlcd .sep { margin: 0 .3em; }
  .status .st-detail { display: none; }
  .jt-res .lg-only { display: none; }
  .jt-res .sm-only { display: inline; }
  .bar .bar-end > .key .key-text { display: none; }
  .bar .bar-end > .key { --h: 56px; width: 56px; padding: 0; }
  .bar .bar-end .jt-res .key { --h: 56px; padding: 0 12px; }
  .blades { grid-template-columns: minmax(0, 1fr); }
  .blade { padding: 14px; gap: 10px; }
  .blade .corner { display: none; }
  .blade-head .nm b { font-size: 17px; }
  .blade-head .tags { display: none; }
  .bscr { height: 60px; }
  .bscr .scr-sub { display: none; }
  .reads .read.extra { display: none; }
  .reads .read.ph-only { display: flex; }
  .read .v { font-size: 14px; }
  .read .s { display: none; }
  .lane24 { display: none; }
  .blade-foot { padding-top: 0; border: 0; }
  .blade-foot .up { display: none; }
  .blade-foot .keys { margin: 0; width: 100%; }
  .blade-foot .keys .key { flex: 1; }
  .act-head { display: none; }
  .act-row { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; }
  .act-row > :nth-child(1) { grid-column: 2; grid-row: 1; text-align: right; color: var(--mute); font-size: 11px; }
  .act-row > :nth-child(2) { grid-column: 1; grid-row: 1; }
  .act-row > :nth-child(3) { display: none; }
  .act-row > :nth-child(4) { grid-column: 1 / -1; grid-row: 2; }
  .act-row > :nth-child(5) { display: none; }
  .crow-reads { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crow-reads .extra { display: none; }
  .conc-row { grid-template-columns: 74px minmax(0, 1fr) 52px; }
  .conc-row .d { display: none; }
  .heat-grid { gap: 5px 1px; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); }
  .hdot { width: 9px; height: 9px; }
  .proj-head { padding: 10px 0 12px; }
  .proj-head p { display: none; }
  .proj-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px 0; }
  .toasts { right: 14px; bottom: 96px; }
  dialog.dlg { padding: 18px 16px 16px; }
  /* sign-in */
  body.login { padding: 56px 14px 24px; place-items: start stretch; }
  .faceplate { display: block; background: none; border: 0; box-shadow: none; }
  .ear, .face { display: none; }
  .login-top { display: flex; align-items: center; gap: 10px; padding: 0 4px 12px; }
  .login-top b { font-stretch: 75%; font-weight: 800; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; }
  .login-top span { margin-left: auto; font: 400 10.5px var(--mono); color: var(--mute); text-transform: uppercase; }
  .form-side { padding: 22px 18px 20px; border-width: 1px; border-radius: 12px; background: var(--panel); border-color: var(--pborder); box-shadow: inset 0 1px 0 var(--phi), var(--pshadow); }
  .form-side h1 { font-size: 28px; }
}
@media (max-width: 420px) {
  .u1-keys .key + .key { display: none; }
}
@media (forced-colors: active) {
  .led, .seg > span, .stepbar > span, .rec-bar, .runbar, .hdot, .lane24 .b { forced-color-adjust: none; }
}
