/* envita bench console. Every colour, size, radius and duration is a token from tokens.css (light on
   :root, the one dark block on [data-scheme="dark"]). Rules: boldness in one place (the headline over
   the 3D view), everything else quiet; no backdrop blur (the canvas renders under it), no pill-shaped
   999px radii (the brand radius is 5 px), no uppercase tracked labels, no gradient washes; a status is
   always colour + shape + word (glyphs.js). Layout: desktop 1440x900, projector 1280x720 and ?wall=1,
   phone 390. */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-3) / var(--lh-3) var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }
code, .mono { font-family: var(--font-mono); font-weight: 500; font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-1); }
.error { color: var(--st-fail); font-size: var(--fs-2); }

/* ---- status tones: a class sets --tone; marks (glyphs, bar segments, timeline marks) use it ---- */
.t-pass { --tone: var(--st-pass); }
.t-fail { --tone: var(--st-fail); }
.t-warn { --tone: var(--st-warn); }
.t-ota { --tone: var(--st-ota); }
.t-run { --tone: var(--st-run); }
.t-neutral { --tone: var(--st-neutral); }
.t-off { --tone: var(--st-off); }
.t-offline { --tone: var(--st-offline); }
.gl { width: 12px; height: 12px; flex: none; color: var(--tone, var(--st-neutral)); display: inline-block; vertical-align: -1px; }

/* ---- scene ---- */
#scene {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; touch-action: none; outline: none;
}
#scene:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.no-webgl #scene { display: none; }
.is-stale #scene { filter: saturate(0.35); transition: filter var(--dur-4); }

#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 1; }
.tag { position: absolute; left: 0; top: 0; will-change: transform; }
.tag-hover { z-index: 2; }
.tag-in {
  transform: translate(-50%, calc(-100% - 4px));
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 2px 8px; border-radius: var(--r-2);
  background: var(--surface-float); color: var(--ink); border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  font: 500 var(--fs-1) / var(--lh-1) var(--font-sans); white-space: nowrap;
}
.tag-in b { font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.tag-in span { color: var(--ink-2); font-weight: 400; font-size: 11px; }
.tag-in .tag-id { font: 500 11px / 1.4 var(--font-mono); color: var(--ink); }
.tag-in .tag-more { color: var(--ink-2); font-size: 11px; }
.tag-in.tag-row { flex-direction: row; gap: 6px; align-items: baseline; }
.tag-sensor .tag-in { padding: 1px 6px; flex-direction: row; gap: 4px; }
.tag-hover .tag-in { padding: 6px 10px; align-items: flex-start; box-shadow: var(--shadow-2); }
.tag-cloud .tag-in { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.tag-group .tag-in { background: var(--surface); }
.ico-lock { width: 10px; height: 10px; color: var(--ink-2); flex: none; display: inline-block; vertical-align: -1px; }

/* status dots on scene labels (colour + the word in the label / tooltip) */
.sdot { width: 7px; height: 7px; border-radius: var(--r-round); display: inline-block; flex: none; background: var(--st-neutral); }
.s-ok, .s-idle, .s-active, .s-online { background: var(--st-pass); }
.s-testing, .s-flashing, .s-driving { background: var(--st-run); }
.s-fail, .s-fault { background: var(--st-fail); }
.s-ota, .s-booting { background: var(--st-ota); }
.s-rebooting { background: var(--st-warn); }
.s-unknown { background: transparent; box-shadow: inset 0 0 0 1.5px var(--st-neutral); }
.s-off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--st-off); }
.s-offline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--st-neutral); }

/* ---- header: lockup, station, feed + freshness (+ demo chip), language, account ---- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  height: calc(var(--top-h) + var(--safe-t));
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--safe-t) calc(var(--sp-5) + var(--safe-r)) 0 calc(var(--sp-5) + var(--safe-l));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.lockup { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; flex: none; border-radius: var(--r-2); }
.flame { width: auto; height: 26px; }
.flame-a { fill: var(--terracotta); }
.flame-b { fill: var(--flame-fold); }
:root[data-scheme="dark"] .flame-a { fill: var(--coral); }
:root[data-scheme="dark"] .flame-b { fill: var(--terracotta); }
.wordmark { font: 700 24px / 1 var(--font-sans); color: var(--navy); }
:root[data-scheme="dark"] .wordmark { color: var(--ink); }
.wordmark .dot { color: var(--coral); }
.station { font-size: var(--fs-2); color: var(--ink-2); white-space: nowrap; padding-left: var(--sp-4); border-left: 1px solid var(--line); }
.status-group { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; flex-wrap: wrap; }
.tools { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; flex: none; }
.demo-chip {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-1);
  background: var(--st-warn-soft); color: var(--ink); border: 1px solid var(--st-warn);
  font-size: var(--fs-1); font-weight: 500; white-space: nowrap;
}
.is-demo::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 6; pointer-events: none;
  background: var(--st-warn);
}
.feed {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px;
  border-radius: var(--r-1); font-size: var(--fs-1); font-weight: 500;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
}
.feed::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-round); background: var(--st-neutral); }
.feed-live::before, .feed-liveQuiet::before { background: var(--st-pass); }
.feed-live::before { animation: pulse 2s ease-in-out infinite; }
.feed-delayed::before { background: var(--st-warn); }
.feed-noFeed::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--st-neutral); }
.updated { font-size: var(--fs-1); color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.updated.is-warn, .updated.is-error {
  display: inline-block; padding: 1px var(--sp-2); border-radius: var(--r-1); font-weight: 500; white-space: normal; color: var(--ink);
}
.updated.is-warn { background: var(--st-warn-soft); box-shadow: inset 2px 0 0 var(--st-warn); }
.updated.is-error { background: var(--st-fail-soft); box-shadow: inset 2px 0 0 var(--st-fail); }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-2); border: 0; display: grid; place-items: center;
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background var(--dur-1);
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn svg { width: 18px; height: 18px; }
.text-btn { width: auto; min-width: 36px; padding: 0 var(--sp-3); font-size: var(--fs-2); font-weight: 500; }
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 44px; min-width: 232px; padding: var(--sp-2); max-height: calc(100dvh - 90px); overflow: auto;
  background: var(--surface); border-radius: var(--r-3); box-shadow: var(--shadow-3);
  border: 1px solid var(--line); z-index: 7;
}
.menu-note { margin: 6px 10px 6px; font-size: var(--fs-1); color: var(--ink-2); }
.menu button, .menu a[role="menuitem"] {
  display: block; width: 100%; text-align: left; padding: var(--sp-2) 10px; border: 0; border-radius: var(--r-2);
  background: transparent; cursor: pointer; font-size: var(--fs-2); color: var(--ink); min-height: 36px;
}
.menu button:hover, .menu button:focus-visible { background: var(--surface-3); }
.menu-group { border-top: 1px solid var(--line); margin-top: 6px; padding-top: var(--sp-1); }
.menu-radio[aria-checked="true"] { font-weight: 500; }
.menu-radio[aria-checked="true"]::after { content: " \2713"; color: var(--ink); }
.menu-legend { padding: 0 10px 6px; }
/* the header's menus open over the side panel and the drawer */
.top:has(#acctMenu:not([hidden])) { z-index: 7; }

/* ---- the headline over the 3D view: the one bold thing on the page ---- */
.hero {
  position: fixed; z-index: 2; pointer-events: none;
  top: calc(var(--top-h) + var(--safe-t) + var(--sp-5)); left: calc(var(--sp-6) + var(--safe-l));
  width: min(56vw, 780px);
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2);
}
.hero > * { pointer-events: auto; }
#headline {
  margin: 0; font: 700 var(--fs-6) / var(--lh-6) var(--font-sans);
  color: var(--ink); max-width: 24ch; text-wrap: balance;
}
.is-stale #headline { color: var(--ink-2); }
.hero-sub { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.head-detail { margin: 0; font-size: var(--fs-4); line-height: var(--lh-4); color: var(--ink-2); max-width: 46ch; }
.runs-more-wrap { position: relative; }
.runs-more {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 28px;
  padding: 1px 10px; border-radius: var(--r-2); font-size: var(--fs-1); font-weight: 500; font-variant-numeric: tabular-nums;
}
.runs-list { left: 0; right: auto; top: 32px; min-width: 280px; text-align: left; }
.runs-list a {
  display: grid; gap: 1px; padding: var(--sp-2) 10px; border-radius: var(--r-2); color: var(--ink); text-decoration: none; font-size: var(--fs-2);
}
.runs-list a:hover, .runs-list a:focus-visible { background: var(--surface-3); }
.runs-list a span { color: var(--ink-2); font-size: var(--fs-1); }
.runs-list a code { color: var(--ink-2); font-size: 11px; }
.progress { display: flex; gap: 2px; width: min(440px, 100%); height: 4px; margin-top: 2px; }
.pseg { flex: 1; position: relative; overflow: hidden; border-radius: 1px; background: var(--surface-3); }
.pseg i { position: absolute; inset: 0; background: var(--st-run); transform-origin: left center; transform: scaleX(0); transition: transform 1.8s linear; }
.progress.is-stopping .pseg i { background: var(--st-warn); }
.detail {
  margin: 0; min-height: var(--lh-2); font-size: var(--fs-2); color: var(--ink-2);
  opacity: 0; transform: translateY(-3px); transition: opacity var(--dur-4), transform var(--dur-4) var(--ease);
}
.detail.is-on { opacity: 1; transform: none; }
.detail.tone-fail { color: var(--st-fail); }
.detail.tone-pass { color: var(--st-pass); }
.detail.tone-warn { color: var(--ink); }

/* ---- fleet health strip (Memfault style), top right ---- */
.fleet {
  position: fixed; z-index: 2; top: calc(var(--top-h) + var(--safe-t) + var(--sp-4)); right: calc(var(--sp-5) + var(--safe-r));
  width: 320px; padding: var(--sp-3) 14px; display: flex; flex-direction: column; gap: var(--sp-2);
  background: var(--surface-float); border: 1px solid var(--line); border-radius: var(--r-4); box-shadow: var(--shadow-1);
  transition: opacity var(--dur-2);
}
.panel-open .fleet, .drawer-open .fleet { opacity: 0; pointer-events: none; }
.fl-body { display: flex; flex-direction: column; gap: var(--sp-2); }
.fl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: var(--fs-1); }
.fl-head { justify-content: space-between; }
.fleet button {
  border: 1px solid transparent; background: transparent; color: var(--ink); cursor: pointer; border-radius: var(--r-2);
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; min-height: 28px; font-size: var(--fs-1);
}
.fleet button:hover { background: var(--surface-3); }
.fleet b { font-weight: 700; font-variant-numeric: tabular-nums; }
.fl-total { font-size: var(--fs-2) !important; padding-left: 2px !important; }
.fl-total b { font-size: var(--fs-4); }
.fl-ok { display: inline-flex; gap: 4px; align-items: center; color: var(--ink-2); }
.fl-bar { display: flex; gap: 2px; height: 8px; }
.fl-bar .seg { min-width: 3px; flex: 1 1 0; border-radius: 1px; background: var(--tone); }
.fl-counts { gap: 2px; }
.fl-k { color: var(--ink-2); min-width: 32px; }
.fleet .fl-chip { border-color: var(--line); background: var(--surface); }
.fl-chip b { font-weight: 500; color: var(--ink-2); }
.fl-chip.is-expected { border-color: var(--line-strong); }
.fl-chip.is-expected .mono { font-weight: 700; }
.fl-legend { border-top: 1px solid var(--line); padding-top: var(--sp-2); font-size: var(--fs-1); }
.fl-legend summary { cursor: pointer; color: var(--ink-2); min-height: 24px; display: flex; align-items: center; }
.fl-legend[open] summary { color: var(--ink); margin-bottom: 6px; }

.legend-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: var(--fs-1); color: var(--ink); }
.legend-list li { display: flex; align-items: center; gap: 9px; }
.lg { width: 14px; height: 14px; flex: none; position: relative; display: inline-block; }
.lg-active { border-radius: var(--r-1); background: var(--coral); }
.lg-off { border-radius: var(--r-1); background: var(--st-off); }
.lg-booting { border-radius: var(--r-round); border: 2px solid var(--st-ota); border-left-color: transparent; }
.lg-offline { border-radius: var(--r-1); background: var(--st-offline-soft); border: 1px dashed var(--st-neutral); }
.lg-offline::after { content: ""; position: absolute; right: -2px; top: -2px; width: 6px; height: 6px; border-radius: var(--r-round); background: var(--st-warn); }
.lg-low::after { content: ""; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: var(--r-round); background: var(--st-ota); opacity: 0.6; }
.lg-testing { border-radius: var(--r-round); border: 2px solid var(--st-run); }
.lg-fail { border-radius: var(--r-round); border: 2px solid var(--st-fail); }
.lg-battery { height: 5px; border-radius: var(--r-1); background: var(--surface-3); box-shadow: inset 10px 0 0 var(--st-pass); }
.lg-report::after, .lg-farewell::after { content: ""; position: absolute; left: 3px; top: 3px; width: 8px; height: 8px; border-radius: var(--r-round); }
.lg-report::after { background: var(--coral); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--coral); }
.lg-farewell::after { background: var(--st-neutral); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--st-neutral); }

/* ---- action bar ---- */
.actionbar {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%); z-index: 3;
  display: flex; gap: var(--sp-1); padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-2);
  transition: opacity var(--dur-2);
}
.btn {
  height: 40px; padding: 0 18px; border-radius: var(--r-2); border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-size: var(--fs-2); font-weight: 500; text-decoration: none; white-space: nowrap;
  background: var(--surface-2); color: var(--ink);
  transition: background var(--dur-1), color var(--dur-1), opacity var(--dur-1);
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--btn-primary); color: var(--btn-primary-ink); font-weight: 700; }
.btn-primary:hover:not(:disabled) { background: var(--btn-primary-hover); }
.btn-danger { background: transparent; color: var(--st-fail); border-color: var(--st-fail); }
.btn-danger:hover:not(:disabled) { background: var(--st-fail-soft); }
.sheet .btn-danger { background: var(--btn-danger); color: var(--btn-danger-ink); border-color: var(--btn-danger); font-weight: 700; }
.btn-quiet { background: transparent; }
.btn-quiet:hover:not(:disabled) { background: var(--surface-3); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); }
.btn-block { width: 100%; margin: var(--sp-4) 0 6px; }

@keyframes pulse { 50% { transform: scale(1.5); opacity: 0.55; } }

/* ---- side panel ---- */
.panel {
  position: fixed; top: calc(var(--top-h) + var(--safe-t) + 16px); right: calc(20px + var(--safe-r)); bottom: calc(88px + var(--safe-b)); z-index: 4;
  width: min(400px, calc(100vw - 40px));
  background: var(--surface); border-radius: var(--r-4); box-shadow: var(--shadow-3); border: 1px solid var(--line);
  transform: translateX(calc(100% + 40px)); opacity: 0;
  transition: transform var(--dur-3) var(--ease), opacity var(--dur-2);
  display: flex; flex-direction: column;
}
.panel.is-open { transform: none; opacity: 1; }
.panel[data-kind="run"] { width: min(460px, calc(100vw - 40px)); }
.panel-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; }
.panel-body { overflow: auto; padding: var(--sp-5) var(--sp-5) 22px; flex: 1; overscroll-behavior: contain; }
.p-head { padding-right: 34px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.p-head .eyebrow { flex-basis: 100%; }
.p-head h2:focus { outline: none; }
.p-head h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.eyebrow { margin: 0 0 var(--sp-1); font-size: var(--fs-2); font-weight: 500; color: var(--accent-ink); }
.p-head h2 { margin: 0; font: 700 var(--fs-5) / var(--lh-5) var(--font-sans); overflow-wrap: anywhere; }
.p-head h2.mono-title { font: 500 var(--fs-4) / var(--lh-4) var(--font-mono); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: var(--r-1); font-size: var(--fs-1); font-weight: 500;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
}
.rows { margin: 0; }
.row { display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-3); padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row dt { color: var(--ink-2); font-size: var(--fs-2); }
.row dd { margin: 0; font-size: var(--fs-2); overflow-wrap: anywhere; }
.row dd small { display: block; color: var(--ink-2); font-size: var(--fs-1); margin-top: 1px; }
.row dd small.inline { display: inline; margin-left: 4px; }
.chip {
  display: inline-block; padding: 2px var(--sp-2); margin: 2px var(--sp-1) 2px 0; border-radius: var(--r-2);
  background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-1); color: var(--ink); text-decoration: none;
}
a.chip:hover { background: var(--surface-3); }
.chip-loop { border-color: var(--line-strong); }
.chip-low { border-color: var(--st-ota); }
.ota-head { display: flex; justify-content: space-between; font-size: var(--fs-2); }
.meter { height: 4px; border-radius: var(--r-1); background: var(--surface-3); overflow: hidden; margin: 6px 0 2px; }
.meter i { display: block; height: 100%; background: var(--st-ota); transform-origin: left; transform: scaleX(0); transition: transform 1.5s linear; }
.batbar { display: inline-block; vertical-align: middle; margin-left: var(--sp-2); width: 64px; height: 5px; border-radius: var(--r-1); background: var(--surface-3); overflow: hidden; }
.batbar i { display: block; height: 100%; background: var(--st-pass); transform-origin: left; transform: scaleX(0); }
.panel h3, .sheet h3 { margin: 22px 0 var(--sp-2); font-size: var(--fs-2); font-weight: 500; color: var(--ink-2); }
.demo-note {
  margin: 18px 0 0; padding: 10px var(--sp-3); border-radius: var(--r-2); font-size: var(--fs-1);
  background: var(--st-warn-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--st-warn);
}
.inline-error { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-error .error { margin: 0; }

/* the run panel (GitHub Actions style) */
.countbar { display: flex; height: 8px; gap: 2px; margin: var(--sp-1) 0 var(--sp-2); }
.countbar .seg { display: block; border-radius: 1px; min-width: 3px; background: var(--tone, var(--st-neutral)); }
.counts { display: flex; flex-wrap: wrap; gap: var(--sp-1) 14px; font-size: var(--fs-1); color: var(--ink-2); margin-bottom: var(--sp-3); }
.cnt { display: inline-flex; align-items: center; gap: 4px; }
.cnt b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.run-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.cases { list-style: none; margin: 0; padding: 0; }
.case {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: baseline; padding: 7px 0;
  border-bottom: 1px solid var(--line); font-size: var(--fs-2);
}
.case > .gl { align-self: center; }
.case-main { min-width: 0; }
.case-title { color: var(--ink); }
.case code { color: var(--ink-2); font-size: 11px; margin-left: 2px; }
.case details { margin-top: 2px; }
.case details summary { cursor: pointer; font-size: var(--fs-1); color: var(--ink-2); }
.case details p { margin: 4px 0 0; font-size: var(--fs-1); color: var(--ink); }
.case.is-fail .case-title { font-weight: 500; }
.case em { font-style: normal; color: var(--ink-2); font-size: var(--fs-1); font-variant-numeric: tabular-nums; text-align: right; }
.case div b { font-weight: 500; }
.case div span { color: var(--ink-2); }
.stage {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; padding: 6px 8px; margin: 10px -8px 0;
  background: var(--surface-2); border-radius: var(--r-2); font-size: var(--fs-2);
}
.stage b { font: 500 var(--fs-2) var(--font-mono); }
.stage em { font-style: normal; color: var(--ink-2); font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.artifacts { list-style: none; margin: 0; padding: 0; }
.artifacts li { display: flex; justify-content: space-between; gap: var(--sp-3); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-2); }
.artifacts a { color: var(--ink); font-family: var(--font-mono); font-size: var(--fs-1); }
.log summary { cursor: pointer; margin-top: 18px; font-size: var(--fs-2); color: var(--ink-2); }
.log pre {
  margin: var(--sp-2) 0 0; padding: var(--sp-3); border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line);
  font: 500 11.5px/1.5 var(--font-mono); max-height: 260px; overflow: auto; white-space: pre-wrap;
}
.live-log pre, .live-pre {
  margin: var(--sp-2) 0 0; padding: var(--sp-3); border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line);
  font: 500 11.5px/1.5 var(--font-mono); height: 320px; max-height: 50vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.evlog { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto; font-size: var(--fs-1); }
.evlog li { display: grid; grid-template-columns: 112px auto 1fr; gap: var(--sp-2); padding: 6px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.evlog li.muted, .evlog li.error { display: block; }
.evlog time { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.evlog code { font-size: 11.5px; }
.evlog span { color: var(--ink-2); overflow-wrap: anywhere; }
.evlog li.error .mini-btn, .p-sparks-error .mini-btn { margin-left: var(--sp-2); }

/* ---- sheets: centred 560 / 1040, title 24/700, Cancel left and the primary action right ---- */
.scrim {
  position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: var(--sp-4);
  background: var(--scrim);
  opacity: 0; transition: opacity var(--dur-2);
}
.scrim.is-open { opacity: 1; }
/* While it fades out (ui.closeSheet keeps it for 300 ms) it must not catch clicks: the action bar behind it is live again. */
.scrim:not(.is-open) { pointer-events: none; }
.sheet {
  width: min(560px, 100%); max-height: min(86dvh, 780px); overflow: auto;
  background: var(--surface); border-radius: var(--r-4); box-shadow: var(--shadow-3);
  padding: var(--sp-5) 28px 20px; transform: translateY(12px);
  transition: transform var(--dur-3) var(--ease); overscroll-behavior: contain;
}
.scrim.is-open .sheet { transform: none; }
.sheet.sheet-wide { width: min(1040px, 100%); max-height: min(90dvh, 980px); }
.s-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.s-head h2 { margin: 0; font: 700 var(--fs-5) / var(--lh-5) var(--font-sans); }
.s-head .icon-btn { width: 32px; height: 32px; }
.s-foot { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: 20px; }
.s-foot > :only-child { margin-left: auto; }
.s-note { margin: 14px 0 0; font-size: var(--fs-2); color: var(--ink-2); }
.form fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.form legend { padding: 0; margin-bottom: 10px; font-size: var(--fs-2); font-weight: 500; color: var(--ink-2); }
.legend-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.segs { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: inline-block; padding: var(--sp-2) var(--sp-4); border-radius: var(--r-2); border: 1px solid var(--line-strong);
  font-size: var(--fs-2); transition: background var(--dur-1), color var(--dur-1);
}
.seg input:checked + span { background: var(--btn-primary); color: var(--btn-primary-ink); border-color: var(--btn-primary); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.checks.compact { flex-direction: row; flex-wrap: wrap; margin-top: 10px; }
.checks.compact .check { padding: 7px var(--sp-3); }
.check {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px var(--sp-3); border-radius: var(--r-2);
  border: 1px solid var(--line); cursor: pointer; background: var(--surface);
}
.check input { margin: 3px 0 0; accent-color: var(--btn-primary); width: 16px; height: 16px; flex: none; }
.check-main { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.check-main b { font-weight: 500; font-size: var(--fs-2); }
.affects .chip { font-size: 11px; padding: 1px 7px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-3); flex: 1; min-width: 0; }
.field > span { font-size: var(--fs-2); color: var(--ink-2); }
.field small { color: var(--ink-3); }
.field input, .field select {
  height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-2); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: var(--fs-2); width: 100%;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.field-row { display: flex; gap: 10px; align-items: flex-end; }
.field-row .to { padding-bottom: 22px; color: var(--ink-2); font-size: var(--fs-2); }
.switch { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span {
  width: 38px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; transition: background var(--dur-2);
  border: 1px solid var(--line-strong);
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: var(--r-round);
  background: var(--surface); box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease);
}
.switch input:checked + span { background: var(--btn-primary); border-color: var(--btn-primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + span { opacity: 0.5; }
.switch em { font-style: normal; font-size: var(--fs-2); color: var(--ink-2); }
.summary { padding: 14px var(--sp-4); border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); }
.summary p { margin: 2px 0; }
.devlist { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.devlist li { padding: 6px var(--sp-3); border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-2); }
.devlist li b { font-weight: 500; }
.devlist li small { display: block; font-size: 11.5px; color: var(--ink); }
.devlist li.warn { border-color: var(--st-warn); box-shadow: inset 3px 0 0 var(--st-warn); }
.error-box { margin-top: 18px; padding: var(--sp-3) 14px; border-radius: var(--r-2); background: var(--st-fail-soft); color: var(--ink); font-size: var(--fs-2); box-shadow: inset 3px 0 0 var(--st-fail); }
.error-box b { color: var(--st-fail); }
.error-box p { margin: var(--sp-1) 0 0; display: flex; gap: 6px; align-items: center; }
.error-box .ico-lock { color: var(--st-fail); }

/* ---- toast ---- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--toast-anchor, 76px) + 16px); z-index: 8; transform: translate(-50%, 10px);
  display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px));
  padding: 10px 18px; border-radius: var(--r-3); background: var(--btn-primary); color: var(--btn-primary-ink);
  font-size: var(--fs-2); box-shadow: var(--shadow-3); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-2), transform var(--dur-2) var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.tone-error {
  background: var(--surface); color: var(--ink); padding: 10px var(--sp-3) 10px var(--sp-4);
  box-shadow: inset 3px 0 0 var(--st-fail), var(--shadow-3); border: 1px solid var(--line);
}
.toast.tone-error.is-on { pointer-events: auto; }
.toast-msg { flex: 1; min-width: 0; }
.toast-btn {
  border: 1px solid var(--line-strong); background: transparent; color: inherit; cursor: pointer;
  padding: 4px 10px; border-radius: var(--r-2); font: inherit; font-size: var(--fs-2); white-space: nowrap; min-height: 32px;
}
.toast-btn:hover { background: var(--surface-3); }
.noscript { position: fixed; top: 40%; width: 100%; text-align: center; }

/* ---- charts ---- */
.chart { position: relative; width: 100%; }
.chart-plot { position: relative; width: 100%; }
.chart-plot canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.chart-overlay { touch-action: pan-y; cursor: crosshair; }
.chart-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; min-width: 140px; max-width: 280px;
  padding: 7px 10px; border-radius: var(--r-2); background: var(--surface); box-shadow: var(--shadow-2);
  font-size: var(--fs-1); display: grid; gap: 2px; border: 1px solid var(--line);
}
.chart-tip .tip-head { font-weight: 500; margin-bottom: 2px; }
.chart-tip small { font-weight: 400; color: var(--ink-2); }
.chart-tip .tip-row { display: grid; grid-template-columns: 16px auto 1fr; gap: 6px; align-items: center; }
.chart-tip .tip-row strong { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }
.chart-tip .tip-row em { font-style: normal; color: var(--ink-2); font-family: var(--font-mono); font-size: 11px; }
.chart-tip .tip-row.hl em { color: var(--ink); }
.chart-tip .more { color: var(--ink-2); }
.lg-key { width: 16px; height: 6px; flex: none; overflow: visible; }
.p-chart { margin-top: 18px; }
.seg-mini { display: inline-flex; padding: 2px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--line); }
.seg-mini button {
  border: 0; background: transparent; cursor: pointer; padding: var(--sp-1) 10px; border-radius: var(--r-1);
  font-size: var(--fs-1); color: var(--ink-2); min-height: 28px;
}
.seg-mini button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 500; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 2px var(--sp-1); margin-top: 6px; }
.lg-item {
  border: 0; background: transparent; cursor: default; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 6px; border-radius: var(--r-1); font: 500 11px/1.4 var(--font-mono); color: var(--ink-2);
}
button.lg-item { cursor: pointer; }
button.lg-item:hover, button.lg-item:focus-visible { background: var(--surface-3); color: var(--ink); }
.lg-item[aria-pressed="false"] { opacity: 0.4; text-decoration: line-through; }
.lg-all { font-family: var(--font-sans) !important; color: var(--ink) !important; border: 1px solid var(--line) !important; }
.lg-item i { width: 10px; height: 2.5px; border-radius: 1px; display: inline-block; }
.lg-band i { height: 10px !important; width: 12px !important; background: var(--band) !important; border-radius: 2px; }
.lg-fw i { width: 8px !important; height: 8px !important; border-radius: var(--r-round) !important; border: 1.5px solid var(--ink-2); background: transparent !important; }
.lg-set i { height: 0 !important; width: 14px !important; border-top: 1px solid var(--reference); opacity: 0.7; }
.cc-bar { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-1); }
.cc-zone { margin-left: auto; }
.cc .cc-chart { transition: opacity var(--dur-2); }
.cc.is-loading .cc-chart { opacity: 0.5; }
.chart-error {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: var(--sp-2) 0 0; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-2); background: var(--st-fail-soft); box-shadow: inset 3px 0 0 var(--st-fail); font-size: var(--fs-1); color: var(--ink);
}
.chart-error-msg { flex: 1; min-width: 0; }
.mini-btn {
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer;
  padding: 3px 10px; border-radius: var(--r-2); font-size: var(--fs-1); min-height: 28px;
}
.mini-btn:hover { background: var(--surface-3); }
a.mini-btn { display: inline-block; text-decoration: none; }
.p-sparks { margin-top: var(--sp-4); display: grid; gap: 10px; }
.p-sparks-error { margin: 0; }
.spark-card { padding: var(--sp-2) 10px var(--sp-1); border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); }
.spark-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); }
.spark-head h3 { margin: 0 !important; font-size: var(--fs-1) !important; }
.spark-value { font-size: var(--fs-1); font-variant-numeric: tabular-nums; color: var(--ink); }
.spark canvas { display: block; width: 100%; }
.p-events h3 { margin-top: 20px; }

/* ---- devices drawer + table ---- */
.drawer {
  position: fixed; left: 16px; right: 16px; bottom: calc(12px + var(--safe-b)); height: var(--drawer-h); z-index: 4;
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-4); box-shadow: var(--shadow-3); border: 1px solid var(--line);
  transform: translateY(calc(100% + 24px)); transition: transform var(--dur-3) var(--ease);
}
.drawer.is-open { transform: none; }
.drawer-open .actionbar { opacity: 0; pointer-events: none; }
.drawer-open .panel { bottom: calc(var(--drawer-h) + 24px); }
.dr-head { display: flex; align-items: center; gap: 10px; padding: var(--sp-3) 14px 10px 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.dr-head h2 { margin: 0; font: 700 var(--fs-4) / var(--lh-4) var(--font-sans); }
.dr-count { font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.dr-chips { display: flex; gap: var(--sp-1); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; flex: 1; min-width: 0; padding: 2px 0; }
.fchip {
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); cursor: pointer;
  padding: 3px 10px; border-radius: var(--r-2); font-size: var(--fs-1); display: inline-flex; gap: 6px; align-items: baseline; white-space: nowrap; min-height: 30px;
}
.fchip b { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.fchip[aria-pressed="true"] { background: var(--btn-primary); color: var(--btn-primary-ink); border-color: var(--btn-primary); }
.fchip[aria-pressed="true"] b { color: inherit; }
.fchip.warn b { color: var(--st-fail); }
.fchip.warn[aria-pressed="true"] b { color: inherit; }
.dr-search {
  height: 32px; width: 220px; padding: 0 var(--sp-3); border-radius: var(--r-2); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: var(--fs-2);
}
.dr-close { width: 32px; height: 32px; }
.cols-menu { right: 0; top: 36px; }
.dr-scroll { flex: 1; overflow: auto; overscroll-behavior: contain; border-radius: 0 0 var(--r-4) var(--r-4); }
.dr-empty { padding: var(--sp-6) var(--sp-4); text-align: center; color: var(--ink-2); font-size: var(--fs-2); }
.dr-empty p { margin: 0 0 var(--sp-3); }
.dtable { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-2); white-space: nowrap; }
.dtable thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-weight: 500;
  border-bottom: 1px solid var(--line); padding: 0;
}
.dtable th button {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--fs-1); cursor: pointer;
  padding: var(--sp-2) 10px; width: 100%; text-align: inherit; display: inline-flex; gap: var(--sp-1); align-items: center;
}
.dtable th[aria-sort="ascending"] button, .dtable th[aria-sort="descending"] button { color: var(--ink); font-weight: 500; }
.dtable th button i { width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; opacity: 0; }
.dtable th[aria-sort="ascending"] button i { border-bottom: 4px solid currentColor; opacity: 1; }
.dtable th[aria-sort="descending"] button i { border-top: 4px solid currentColor; opacity: 1; }
.dtable th.num button { justify-content: flex-end; }
.dtable td, .dtable tbody th { padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; font-weight: 400; background: var(--surface); }
/* the id column comes first and stays put when the table scrolls sideways */
.dtable .c-id { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--line); }
.dtable thead th.c-id { z-index: 3; }
.dtable tbody tr { cursor: pointer; }
.dtable tbody tr:hover > * { background: var(--surface-2); }
.dtable tbody tr.is-gw > * { background: var(--surface-2); }
.dtable tbody tr.is-sel > * { background: var(--surface-3); }
.dtable tbody tr.is-sel > .c-id { box-shadow: inset 3px 0 0 var(--ink), inset -1px 0 0 var(--line); }
.dtable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable td small { color: var(--ink-2); }
.dtable.hide-state .c-state, .dtable.hide-type .c-type, .dtable.hide-loop .c-loop, .dtable.hide-gateway .c-gateway,
.dtable.hide-seen .c-seen, .dtable.hide-rssi .c-rssi, .dtable.hide-supply .c-supply, .dtable.hide-fw .c-fw,
.dtable.hide-hw .c-hw, .dtable.hide-low .c-low, .dtable.hide-usb .c-usb, .dtable.hide-flags .c-flags,
.dtable.hide-lock .c-lock { display: none; }
.idbtn { border: 0; background: transparent; padding: 0; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2); }
.idbtn .mono { font-size: var(--fs-2); }
.idbtn:hover .mono { text-decoration: underline; }
.is-problem .c-state { color: var(--ink); font-weight: 500; }
.bars { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 11px; margin-right: 6px; vertical-align: -1px; }
.bars i { width: 3px; background: var(--surface-3); border-radius: 1px; }
.bars i:nth-child(1) { height: 3px; }
.bars i:nth-child(2) { height: 5.5px; }
.bars i:nth-child(3) { height: 8px; }
.bars i:nth-child(4) { height: 11px; }
.bars.lv-good i.on { background: var(--st-pass); }
.bars.lv-fair i.on { background: var(--st-warn); }
.bars.lv-poor i.on { background: var(--st-fail); }
.v-fair { color: var(--ink); text-decoration: underline dotted var(--st-warn); }
.v-poor { color: var(--st-fail); }
.tchip { display: inline-block; padding: 1px 6px; margin-right: 3px; border-radius: var(--r-1); font-size: 11px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.tchip.f-protected, .tchip.f-bench-sim, .tchip.f-locked, .tchip.f-locked-ccfg { color: var(--ink); }
.tchip.f-uart-dead { color: var(--st-fail); border-color: var(--st-fail); }
.tchip.f-low { color: var(--ink); border-color: var(--st-ota); }

/* ---- the 2D bench map (fallback2d.js): no WebGL, three.js missing, ?view=2d ---- */
.view-2d #scene, .view-2d #labels { display: none; }
.benchmap {
  position: fixed; z-index: 1; overflow: auto; overscroll-behavior: contain;
  top: calc(var(--top-h) + var(--safe-t) + 190px); bottom: calc(120px + var(--safe-b) + var(--inset-y, 0px));
  left: calc(var(--sp-5) + var(--safe-l)); right: calc(var(--sp-5) + var(--safe-r) + var(--inset-x, 0px));
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); padding: var(--sp-2);
  transition: right var(--dur-3) var(--ease), bottom var(--dur-3) var(--ease);
}
.benchmap.is-stale { filter: saturate(0.35); }
.bm-top { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.bm-gws, .bm-zones { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2) var(--sp-4); }
.bm-zones { align-items: flex-start; width: 100%; }
.bm-cloud, .bm-gw, .bm-loop, .bm-tile {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: var(--r-2); cursor: pointer; min-height: 32px; padding: 4px 10px; font-size: var(--fs-2);
}
.bm-cloud { background: var(--navy); color: var(--warm-white); border-color: var(--navy); font-weight: 700; }
.bm-gw span, .bm-loop span { color: var(--ink-2); font-size: var(--fs-1); }
.bm-zone {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-4); padding: var(--sp-3);
  box-shadow: var(--shadow-1); flex: 1 1 340px; max-width: 720px;
}
.bm-loop { border: 0; background: transparent; padding: 0 0 var(--sp-2); width: 100%; font-weight: 500; }
.bm-loop em, .bm-tile em { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: var(--fs-1); }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.bm-tile { min-height: 36px; font-size: var(--fs-1); }
.bm-tile .mono { font-size: 12px; }
.bm-tile[data-state="offline"] { opacity: 0.6; border-style: dashed; }
.bm-tile[data-state="fail"] { border-color: var(--st-fail); }
.bm-tile.is-low { box-shadow: inset 0 -2px 0 var(--st-ota); }
.bm-tile.is-sel, .bm-gw.is-sel, .bm-loop.is-sel { outline: 2px solid var(--focus); outline-offset: 1px; }
.bm-tile:hover, .bm-gw:hover { background: var(--surface-3); }
.bm-tile.is-ping { animation: bm-ping 0.9s ease-out; }
@keyframes bm-ping { 0% { box-shadow: 0 0 0 0 var(--coral); } 100% { box-shadow: 0 0 0 6px transparent; } }

/* ---- projector (1280x720 and shorter): a 52 px bar, a one-line headline, a two-row fleet strip ---- */
@media (max-height: 760px) and (min-width: 701px) {
  :root { --top-h: 52px; }
  .hero { top: calc(var(--top-h) + var(--safe-t) + var(--sp-3)); }
  #headline { font-size: 36px; max-width: 32ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .head-detail { font-size: var(--fs-3); }
  .fleet { top: calc(var(--top-h) + var(--safe-t) + var(--sp-3)); padding: var(--sp-2) var(--sp-3); gap: 6px; }
  .fl-hw, .fl-legend { display: none; }
  .actionbar { bottom: calc(14px + var(--safe-b)); }
  .panel { top: calc(var(--top-h) + var(--safe-t) + 10px); bottom: calc(78px + var(--safe-b)); }
  .sheet { max-height: 90dvh; }
  .tag-in { font-size: 12px; }
}

/* ---- ?wall=1: a screen on the wall - no controls, the cursor hides when still ---- */
:root[data-wall] .actionbar, :root[data-wall] .tools { display: none; }
:root[data-wall] .fl-legend { display: none; }
:root[data-wall] body.cursor-idle, :root[data-wall] body.cursor-idle * { cursor: none !important; }

/* ---- phones: the header, the headline in two lines, the 3D view, icon actions ---- */
@media (max-width: 700px) {
  :root { --top-h: 52px; --drawer-h: calc(100dvh - 24px); }
  .top { gap: var(--sp-2); padding-left: calc(var(--sp-4) + var(--safe-l)); padding-right: calc(var(--sp-2) + var(--safe-r)); }
  .flame { height: 22px; }
  .wordmark { font-size: 21px; }
  .station { display: none; }
  .updated:not(.is-warn):not(.is-error) { display: none; }
  .demo-chip { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }
  .hero { left: calc(var(--sp-4) + var(--safe-l)); right: calc(var(--sp-4) + var(--safe-r)); width: auto; top: calc(var(--top-h) + var(--safe-t) + var(--sp-3)); }
  #headline { font-size: 26px; line-height: 1.15; max-width: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .head-detail { font-size: var(--fs-2); line-height: var(--lh-2); }
  /* the fleet strip folds to its head and bar under the headline; the colour key is in the account menu */
  .fleet {
    top: auto; bottom: calc(96px + var(--safe-b)); left: calc(var(--sp-4) + var(--safe-l)); right: calc(var(--sp-4) + var(--safe-r));
    width: auto; padding: 6px 10px; gap: 4px;
  }
  .fl-counts, .fl-gws, .fl-fw, .fl-hw, .fl-legend { display: none; }
  .actionbar { bottom: calc(12px + var(--safe-b)); max-width: calc(100vw - 24px); height: 64px; align-items: center; }
  .actionbar .btn { height: 52px; min-width: 52px; padding: 0 var(--sp-3); }
  .actionbar .btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .actionbar .btn svg { width: 20px; height: 20px; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0; width: 100% !important; max-height: 86dvh;
    border-radius: var(--r-4) var(--r-4) 0 0; transform: translateY(100%);
  }
  .panel::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line-strong); }
  .panel.is-open { transform: none; }
  .panel-body { padding: var(--sp-5) 18px calc(18px + var(--safe-b)); }
  .scrim { place-items: end center; padding: 0; }
  .sheet { width: 100%; max-height: 86dvh; border-radius: var(--r-4) var(--r-4) 0 0; padding: 22px 18px calc(18px + var(--safe-b)); }
  .sheet.sheet-wide { width: 100%; }
  .row { grid-template-columns: 104px 1fr; }
  .field-row { flex-wrap: wrap; }
  .drawer { left: 0; right: 0; bottom: 0; border-radius: var(--r-4) var(--r-4) 0 0; }
  .dr-search { width: 100%; order: 5; }
  .dr-chips { order: 6; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .dtable td, .dtable tbody th { height: 44px; }
  .benchmap { top: calc(var(--top-h) + var(--safe-t) + 120px); left: var(--sp-2); right: var(--sp-2); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
/* ?still=1 (screenshots, tests): reduced motion whatever the system says */
html[data-still] *, html[data-still] *::before, html[data-still] *::after { transition-duration: 0.01ms !important; animation: none !important; }

/* ---- chart reading aids (F-11): legend stats table, search, data table, notes, custom range ---- */
.chart-plot:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-1); }
.lg-tools { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: 6px; font-size: var(--fs-1); }
.lg-search {
  height: 28px; width: 180px; padding: 0 var(--sp-2); border-radius: var(--r-2); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: var(--fs-1);
}
.lg-only { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); cursor: pointer; }
.lg-only input { accent-color: var(--btn-primary); }
.chart-legend.is-table { display: block; max-height: 240px; overflow: auto; }
.chart-legend.is-table thead th { position: sticky; top: 0; background: var(--surface); }
.lg-table { border-collapse: collapse; font-size: var(--fs-1); width: 100%; max-width: 640px; margin-top: 4px; }
.lg-table th, .lg-table td { padding: 2px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.lg-table td.num, .lg-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.lg-table thead th { font-weight: 500; color: var(--ink-2); }
.lg-table thead button { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: 2px 0; min-height: 24px; }
.lg-table thead th[aria-sort="ascending"] button::after { content: " \25B4"; }
.lg-table thead th[aria-sort="descending"] button::after { content: " \25BE"; }
.lg-table tbody th { font-weight: 500; }
.lg-table tr.is-off { opacity: 0.45; }
.lg-table tbody tr:hover { background: var(--surface-2); }
.lg-toggle { border: 0; background: transparent; cursor: pointer; padding: 4px; display: grid; place-items: center; min-width: 28px; min-height: 24px; border-radius: var(--r-1); }
.lg-toggle[aria-pressed="false"] .lg-key { opacity: 0.3; }
.lg-note { margin: 4px 0 0; }
.lg-extras { display: flex; flex-wrap: wrap; gap: 2px var(--sp-1); margin-top: 4px; }
.chart-tip .tip-note { color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 2px; margin-top: 2px; }
.chart-table { margin-top: var(--sp-2); }
.ct-scroll { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-2); }
.dtable.ct { font-size: var(--fs-1); }
.dtable.ct thead th { padding: 4px 8px; color: var(--ink-2); }
.dtable.ct td, .dtable.ct tbody th { padding: 3px 8px; cursor: default; }
.cc-range, #chartsRange { display: inline-flex; align-items: center; gap: 4px; }
.cc-range input {
  height: 28px; padding: 0 6px; border-radius: var(--r-2); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-1);
}
.mini-btn[aria-pressed="true"], .mini-btn[aria-expanded="true"] { background: var(--btn-primary); color: var(--btn-primary-ink); border-color: var(--btn-primary); }
/* zoom mode is for touch; a mouse drags to zoom anyway */
@media (pointer: fine) { .cc-zoom { display: none; } }

/* ---- accessibility (F-12): touch targets, forced colours ---- */
@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .mini-btn, .fchip, .seg-mini button, .toast-btn, .runs-more, .fleet button, .lg-item, .lg-toggle,
  .menu button, .menu a[role="menuitem"], .bm-tile, .bm-gw, .dr-search, .lg-search { min-height: 44px; }
  .seg span, .check { min-height: 44px; }
  .dtable td, .dtable tbody th { height: 44px; }
}
@media (forced-colors: active) {
  .gl, .lg-key { forced-color-adjust: auto; }
  .btn, .mini-btn, .fchip, .icon-btn, .seg span, .menu, .panel, .sheet, .drawer, .fleet, .actionbar, .tag-in, .pill, .feed,
  .demo-chip, .updated.is-warn, .updated.is-error, .toast, .chart-tip { border: 1px solid CanvasText; }
  .btn-primary, .fchip[aria-pressed="true"], .seg input:checked + span, .mini-btn[aria-pressed="true"] { background: Highlight; color: HighlightText; }
  .pseg, .fl-bar .seg, .countbar .seg, .batbar, .meter, .bars i { border: 1px solid CanvasText; background: Canvas; }
  .pseg i, .fl-bar .seg, .countbar .seg, .batbar i, .meter i, .bars i.on { background: CanvasText; }
  .sdot, .feed::before { background: CanvasText; box-shadow: none; }
  :focus-visible { outline: 2px solid Highlight; }
  .is-demo::before { background: CanvasText; }
}

/* ---- the sign-in gate (F-8): a navy-700 brand page, warm-white text, the flame lockup ---- */
.gate {
  position: fixed; inset: 0; z-index: 9; overflow: auto;
  background: var(--navy-700); color: var(--warm-white);
  display: flex; align-items: center;
  padding: calc(var(--sp-7) + var(--safe-t)) calc(var(--sp-7) + var(--safe-r)) calc(var(--sp-7) + var(--safe-b)) calc(var(--sp-7) + var(--safe-l));
}
.gate-panel { max-width: 640px; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
.gate-lockup { display: inline-flex; align-items: center; gap: 12px; margin-bottom: var(--sp-5); }
.gate-lockup .flame { height: 40px; }
.gate-lockup .flame-a { fill: var(--coral); }
.gate-lockup .flame-b { fill: var(--terracotta); }
.gate-lockup .wordmark { font-size: 36px; color: var(--warm-white); }
.gate-eyebrow { margin: 0; font-size: var(--fs-3); font-weight: 500; color: var(--warm-white); opacity: 0.8; }
.gate h1 { margin: 0; font: 700 clamp(32px, 3vw + 18px, 56px) / 1.08 var(--font-sans); color: var(--warm-white); }
.gate-lead { margin: 0; font-size: var(--fs-4); line-height: 1.45; max-width: 36em; color: var(--warm-white); }
.gate-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-3); }
.btn-gate { height: 48px; padding: 0 var(--sp-5); background: var(--warm-white); color: var(--navy); font-weight: 700; font-size: var(--fs-3); }
.btn-gate:hover { background: #FFFFFF; }
.btn-gate-quiet { height: 48px; padding: 0 var(--sp-5); background: transparent; color: var(--warm-white); border-color: rgba(244, 242, 240, 0.6); font-size: var(--fs-3); }
.btn-gate-quiet:hover { background: rgba(244, 242, 240, 0.1); }
.gate :focus-visible { outline-color: var(--coral); }
.gate-note { margin: var(--sp-5) 0 0; font-size: var(--fs-2); color: var(--warm-white); opacity: 0.75; }
.gate-open .top, .gate-open .hero, .gate-open .fleet, .gate-open .actionbar { visibility: hidden; }

/* the session ended while the page was live: a strip under the header, the page stays */
.session-banner {
  position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); top: calc(var(--top-h) + var(--safe-t) + 8px);
  display: flex; align-items: center; gap: var(--sp-3); padding: 8px 10px 8px 14px; max-width: calc(100vw - 32px);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-3);
  box-shadow: inset 3px 0 0 var(--st-warn), var(--shadow-2); font-size: var(--fs-2);
}
@media (max-width: 700px) {
  .gate { padding: calc(var(--sp-6) + var(--safe-t)) var(--sp-5) calc(var(--sp-6) + var(--safe-b)); align-items: flex-start; }
  .gate-lockup { margin-bottom: var(--sp-3); }
  .gate-actions .btn { width: 100%; }
}

/* bench health monitor rows in the cloud panel (hyptest health): a word in a status colour, never colour alone */
.hc { font: 500 var(--fs-2) / 1 var(--font-mono); padding: 2px 6px; border-radius: var(--r-1); color: var(--ink-inverse); }
.hc-ok { background: var(--st-pass); }
.hc-warn { background: var(--st-warn); color: var(--ink); }
.hc-bad { background: var(--st-fail); }

/* ---- charts sheet (owner 2026-10-07: one chart, the loop as a segmented switch, the rest in ⋯) ---- */
.sheet.sheet-charts { overflow: visible; display: flex; flex-direction: column; height: min(88dvh, 860px); }
.ch-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: 2px; }
.ch-head h2 { margin-right: var(--sp-2); }
.ch-gap { flex: 1; }
.ch-sub { margin: 0 0 var(--sp-3); }
.ch-menu { top: 40px; min-width: 200px; }
.sheet-charts .chart-table { max-height: 26vh; overflow: auto; }
.seg-mini.ch-loops button { font-size: var(--fs-2); padding: var(--sp-1) 14px; }
.cc.cc-bare { position: relative; }
.cc-out-float { position: absolute; top: 6px; right: 6px; z-index: 2; background: var(--surface); }
.chart-legend { gap: 2px 2px; margin-top: var(--sp-2); }
.sheet-charts .chart-legend .lg-item { padding: 3px 8px; font-size: 12px; }
.lg-key line { stroke-linecap: round; }

/* ---- sensor panel: the reading large, the chart, two tiles, the facts in two columns ---- */
.p-hero { margin: -4px 0 var(--sp-2); }
.panel[data-kind="device"] .panel-body { padding-top: 20px; padding-bottom: 16px; }
.panel .demo-note { margin-top: var(--sp-3); padding: 6px var(--sp-3); }
.p-big { margin: 0; display: flex; align-items: baseline; gap: 6px; line-height: 1; }
.p-big .num { font: 700 44px / 1 var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: var(--ink); }
.p-big .unit { font: 500 var(--fs-4) / 1 var(--font-sans); color: var(--ink-2); }
.p-big .chip { align-self: center; margin-left: var(--sp-2); }
.p-big.is-none .num { color: var(--ink-3); }
.p-when { margin: 6px 0 0; font-size: var(--fs-1); }
.p-chart { margin-top: var(--sp-2); }
.p-range { margin-bottom: var(--sp-2); }
.p-sparks { margin-top: var(--sp-3); grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.p-sparks .p-sparks-error { grid-column: 1 / -1; }
.p-sparks .spark-head { flex-direction: column; align-items: flex-start; gap: 0; }
.p-sparks .spark-value { font: 700 var(--fs-3) / 1.3 var(--font-sans); font-variant-numeric: tabular-nums; }
.p-sparks .spark-card { padding: 6px 10px 4px; }
.facts { margin: var(--sp-3) 0 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sp-4); }
.facts .row { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.facts .row.wide { grid-column: 1 / -1; }
.facts .row dt { font-size: var(--fs-1); }
.facts .row dd { margin-top: 1px; }
.facts .row:last-child { border-bottom: 0; }
.panel[data-kind="device"] .facts:first-of-type { margin-top: 0; }

/* ---- the sensor cutaway (cutaway.js): the head's 剖面 button, the view under the reading ---- */
.p-head .cut-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.cut-btn svg { width: 15px; height: 15px; flex: none; }
.p-cut { margin: var(--sp-2) 0 var(--sp-3); }
.cut-stage {
  position: relative; aspect-ratio: 16 / 10; max-height: 320px; overflow: hidden;
  border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line);
}
.cut-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.cut-canvas:active { cursor: grabbing; }
.cut-tags { position: absolute; inset: 0; pointer-events: none; }
.cut-tag {
  position: absolute; left: 0; top: 0; padding: 1px 6px; border-radius: var(--r-1); white-space: nowrap;
  background: var(--surface-float); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  font-size: 11px; line-height: 16px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.cut-tag small { font-size: 11px; color: var(--ink-2); }
.cut-tag b { font-weight: 700; }
.cut-note { position: absolute; left: 10px; right: 10px; bottom: 6px; margin: 0; font-size: var(--fs-1); color: var(--ink-2); }
.cut-hint { position: absolute; right: 8px; top: 6px; font-size: 11px; color: var(--ink-3); pointer-events: none; }
.cut-sketch { position: absolute; inset: 4px 4px 24px; }
.cut-svg { display: block; width: 100%; height: 100%; }
.cut-story { margin: var(--sp-2) 0 0; font-size: var(--fs-2); line-height: var(--lh-2); color: var(--ink-2); }
.cut-facts { margin: var(--sp-2) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0 var(--sp-3); }
.cut-row { padding: 5px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.cut-row dt { font-size: var(--fs-1); color: var(--ink-2); }
.cut-row dd { margin: 1px 0 0; font-size: var(--fs-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cut-row.cut-duty { grid-column: span 2; }
/* the sketch (no WebGL, no model): token colours; the level and the light take the tone classes (.t-*) */
.cx-cable { stroke: var(--scene-cable); stroke-width: 7; stroke-linecap: round; fill: none; }
.cx-core { stroke: var(--ink-3); stroke-width: 6; fill: none; }
.cx-can { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.cx-chip { fill: var(--ink-3); stroke: var(--line-strong); stroke-width: 1.5; }
.cx-level, .cx-led { fill: var(--tone, var(--st-neutral)); }
.cx-led.is-dark { fill: var(--surface-3); }
.cx-flow { fill: none; stroke: var(--scene-glow); stroke-width: 2.2; stroke-dasharray: 4 5; opacity: 0.25; }
.cx-flow.is-on { opacity: 1; animation: cx-dash 1.2s linear infinite; }
@keyframes cx-dash { to { stroke-dashoffset: -18; } }
.cx-ant { stroke: var(--ink-2); stroke-width: 2.5; stroke-linecap: round; }
.cx-waves path { fill: none; stroke: var(--scene-glow); stroke-width: 2; stroke-linecap: round; opacity: 0.25; }
.cx-waves.is-ping path { animation: cx-ping 0.9s var(--ease); }
.cx-waves.is-neutral path { stroke: var(--st-neutral); }
.cx-waves.is-fail path { stroke: var(--st-fail); }
@keyframes cx-ping { 30% { opacity: 1; } }
.cx-t { font: 500 11px var(--font-sans); fill: var(--ink-2); text-anchor: middle; }
.cx-strong { font-weight: 700; fill: var(--ink); }

/* ---- run history (the list that replaced the 30-day strip) ---- */
#historyBtn { position: relative; }
#historyBtn.has-alert::after {
  content: ""; position: absolute; top: 8px; right: 10px; width: 7px; height: 7px; border-radius: var(--r-round);
  background: var(--st-fail); box-shadow: 0 0 0 2px var(--surface);
}
.hist-sum { margin: -6px 0 var(--sp-2); }
.hist-day h3 { margin: var(--sp-4) 0 var(--sp-1); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li + li { border-top: 1px solid var(--line); }
.hist-row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: 10px var(--sp-2); margin: 0 calc(-1 * var(--sp-2));
  border: 0; background: transparent; border-radius: var(--r-2); cursor: pointer; text-align: left; color: var(--ink); font: inherit;
  box-sizing: content-box;
}
.hist-row:hover, .hist-row:focus-visible { background: var(--surface-2); }
.hist-row .gl { width: 14px; height: 14px; flex: none; }
.hist-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hist-main b { font-weight: 500; font-size: var(--fs-2); }
.hist-main .muted { font-size: var(--fs-1); }
.hist-detail { font-size: var(--fs-1); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-head .run-id { flex-basis: 100%; margin: 4px 0 0; overflow-wrap: anywhere; }
.run-why { margin: -6px 0 var(--sp-2); }
.run-cmd { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-1); }
.hist-v { font-size: var(--fs-1); font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.hist-v.t-fail { color: var(--st-fail); }

/* ---- history: tabs, filters, operations (F-HYPTEST-077) ---- */
.hist-tabs { margin-left: var(--sp-3); }
.hist-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; margin: 0 0 var(--sp-3); }
.hist-filters select { font: inherit; font-size: var(--fs-1); padding: 5px 8px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.hist-filters .dr-search { flex: 1 1 160px; min-width: 120px; }
.hist-more { text-align: center; margin: var(--sp-3) 0 0; }
.op-row { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; }
.op-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.op-main b { font-weight: 500; font-size: var(--fs-2); overflow-wrap: anywhere; }
.op-main .muted { font-size: var(--fs-1); }

/* ---- case trends (F-HYPTEST-079) ---- */
.strip { display: inline-flex; gap: 2px; vertical-align: middle; margin: 0 var(--sp-2); }
.strip .sq { display: inline-block; width: 8px; height: 12px; border-radius: 2px; border: 0; padding: 0; background: var(--surface-3); }
.strip button.sq { cursor: pointer; }
.strip button.sq:hover, .strip button.sq:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.strip .t-pass { background: var(--st-pass); }
.strip .t-fail { background: var(--st-fail); }
.strip .t-known, .strip .t-warn { background: var(--st-ota); }
.trend-tag { display: inline-block; font-size: 11px; line-height: 16px; padding: 0 6px; border-radius: var(--r-2); margin-left: var(--sp-1); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.trend-tag.t-new_fail { color: var(--st-fail); border-color: var(--st-fail); font-weight: 500; }
.trend-tag.t-still_fail { color: var(--st-fail); border-color: var(--line-strong); }
.trend-tag.t-flaky, .trend-tag.t-known { color: var(--ink); border-color: var(--st-ota); }
.trend-tag.t-fixed { color: var(--st-pass); border-color: var(--st-pass); }
.run-compare { margin: -2px 0 var(--sp-2); color: var(--ink-2); }
.case-trends .case-main, .builds .case-main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-1); }
.case-trends .case-main > .muted, .builds .case-main > .muted, .strip-row { flex-basis: 100%; }
.strip-row .strip { margin: 4px 0 0; }
.case-trends .case em, .builds .case em { white-space: nowrap; }
.case-sum { display: block; flex-basis: 100%; color: var(--ink-2); overflow-wrap: anywhere; }
.p-tests { margin-top: var(--sp-4); }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.autopilot-chip[data-mode="active"] { border-color: var(--st-pass); }
.autopilot-chip[data-mode="unknown"] { border-color: var(--st-fail); }
@media (max-width: 700px) { .autopilot-chip { display: none; } }   /* the phone top bar has no room; desktop shows it */

/* ---- bench mode: paused (F-HYPTEST-077) ---- */
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
body.bench-paused #headline { color: var(--ink-2); }
body.bench-paused #headline::before {
  content: ""; display: inline-block; width: 0.42em; height: 0.8em; margin-right: 0.35em; vertical-align: -0.04em;
  border-left: 0.13em solid currentColor; border-right: 0.13em solid currentColor; box-sizing: border-box;
}
.chips-row { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin: -4px 0 var(--sp-3); }
.pause-effects { margin-top: var(--sp-3); }
.pause-effects ul { margin: var(--sp-1) 0 0; padding-left: 1.2em; color: var(--ink-2); }
.pause-effects li + li { margin-top: 2px; }
.resume-issues { list-style: none; margin: 0 0 var(--sp-2); padding: 0; }
.resume-issues li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.resume-issues li b { font-weight: 500; font-size: var(--fs-2); color: var(--st-fail); }
.warn { color: var(--st-fail); }
.ok-line { display: flex; align-items: center; gap: var(--sp-2); color: var(--st-pass); }
.ok-line svg { width: 16px; height: 16px; flex: none; }

/* ---- reset view: shown once the visitor has moved the camera (scene.onViewChange) ---- */
.view-reset {
  position: fixed; left: calc(20px + var(--safe-l)); bottom: calc(24px + var(--safe-b)); z-index: 3;
  width: 40px; height: 40px; border-radius: var(--r-3); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2);
}
.view-reset svg { width: 18px; height: 18px; }
.drawer-open .view-reset, .gate-open .view-reset { display: none; }
@media (max-width: 700px) { .view-reset { bottom: calc(88px + var(--safe-b)); left: calc(12px + var(--safe-l)); } }

/* ---- new sensors: the fleet card's offer and the register sheet ---- */
.fl-new { border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.fl-newbtn {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; cursor: pointer; padding: 2px 0;
  font-size: var(--fs-1); font-weight: 500; color: var(--ink);
}
.fl-newbtn:hover span, .fl-newbtn:focus-visible span { transform: translateX(2px); }
.fl-newbtn span { color: var(--ink-2); transition: transform var(--dur-1); }
.fl-newdot { width: 7px; height: 7px; border-radius: var(--r-round); background: var(--st-ota); }
.units { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.unit-row { border-top: 1px solid var(--line); padding: 10px 0; }
.unit-main { display: flex; align-items: center; gap: var(--sp-2); }
.unit-main .gl { width: 12px; height: 12px; flex: none; }
.unit-id { font-weight: 500; }
.unit-main .small { flex: 1; min-width: 0; }
.unit-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-3); margin-top: var(--sp-3); }
.unit-form .unit-note { grid-column: 1 / -1; }
.unit-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: var(--sp-2); }
.unit-form .error { grid-column: 1 / -1; margin: 0; }

/* ---- start sheet: a test's note, multi-choice parameters ---- */
.start-note { margin: 0 0 var(--sp-3); line-height: var(--lh-2); }
.field.multi { border: 0; padding: 0; margin: 0 0 var(--sp-3); min-width: 0; }
.field.multi legend { font-size: var(--fs-2); color: var(--ink-2); margin-bottom: 6px; padding: 0; }
.multi-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px var(--sp-2); }
.multi-item { display: flex; align-items: center; gap: 6px; font-size: var(--fs-2); cursor: pointer; padding: 3px 0; }
.field.multi .multi-item input { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; border: 0; accent-color: var(--btn-primary); }

.unit-main .mini-btn + .mini-btn { margin-left: 2px; }
.units-ignored { margin-top: var(--sp-4); font-size: var(--fs-2); }
.units-ignored summary { cursor: pointer; color: var(--ink-2); }
