/* poi-lab bench — TE front-panel design language.
   plastic panels on neutral ground, one signal accent, silkscreen labels. */

:root {
  --ground: #aca89c;
  --ground-2: #a09c90;
  --panel: #f4f1ea;
  --panel-2: #e6e2d8;
  --panel-3: #dcd7cb;
  --ink: #171614;
  --ink-2: #46433c;
  --muted: #8b8578;
  --seam: #c8c2b3;
  --seam-hard: #a7a091;
  --accent: #ff4d00;
  --accent-dim: #ffdfd2;
  --accent-2: #2f6b78;
  --led-green: #46c46b;
  --led-amber: #ffab00;
  --led-red: #e33;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Segoe UI Mono", "DejaVu Sans Mono", monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --r: 7px;
  --r-sm: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }

/* ---------------------------------------------------------------- silkscreen */
.lbl {
  font-family: var(--mono);
  font-size: 9.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.lbl--ink { color: var(--ink); }
.lbl--accent { color: var(--accent); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.mono { font-family: var(--mono); }

/* ------------------------------------------------------------------- chrome */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--seam-hard);
}
.brand {
  display: flex; align-items: center; gap: 9px;
  background: var(--ink); color: var(--panel);
  border-radius: var(--r-sm);
  padding: 7px 10px 6px;
}
.brand b { font-family: var(--mono); font-size: 12px; letter-spacing: .18em; font-weight: 700; }
.brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; }
.crumbs a, .crumbs span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.crumbs a { color: var(--ink-2); border-bottom: 1px solid var(--seam-hard); padding-bottom: 1px; }
.crumbs a:hover { color: var(--accent); border-color: var(--accent); }
.crumbs .sep { color: var(--muted); }
.crumbs .now { color: var(--ink); font-weight: 700; }

.spacer { flex: 1 1 auto; }

.pulse {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 9px;
  border: 1px solid var(--seam); border-radius: var(--r-sm);
  background: var(--panel-2);
}
.pulse .txt { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }

.screws { position: relative; }
.screws::before, .screws::after {
  content: ""; position: absolute; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--seam-hard); transform: translateY(-50%);
}
.screws::before { left: 5px; }
.screws::after { right: 5px; }

/* --------------------------------------------------------------------- leds */
.led {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--panel-3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .28);
  flex: none;
}
.led--on { background: var(--accent); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), 0 0 4px rgba(255, 77, 0, .55); }
.led--green { background: var(--led-green); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), 0 0 4px rgba(70, 196, 107, .5); }
.led--amber { background: var(--led-amber); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), 0 0 4px rgba(255, 171, 0, .5); }
.led--red { background: var(--led-red); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3), 0 0 4px rgba(238, 51, 51, .5); }
.led--blink { animation: blink 1.1s steps(1, end) infinite; }
@keyframes blink { 0%, 60% { opacity: 1 } 61%, 100% { opacity: .25 } }

/* ------------------------------------------------------------------- panels */
.wrap { padding: 14px; max-width: 1720px; margin: 0 auto; }
.panel {
  background: var(--panel);
  border: 1px solid var(--seam-hard);
  border-radius: var(--r);
  min-width: 0;
}
.panel__hd::before {
  content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--seam-hard); flex: none;
}
.panel__hd:has(.lbl--accent)::before { background: var(--accent); }
.panel__hd {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--seam);
  background: var(--panel);
  border-radius: var(--r) var(--r) 0 0;
}
.panel__bd { padding: 11px; }
.panel__bd--flush { padding: 0; }
.panel--recess { background: var(--panel-2); }

.grid { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.rule { height: 1px; background: var(--seam); margin: 10px 0; }

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 13px; }
p { margin: 0 0 8px; line-height: 1.5; }

/* ------------------------------------------------------------------ controls */
.seg {
  display: inline-flex; border: 1px solid var(--ink); border-radius: var(--r-sm);
  overflow: hidden; background: var(--panel);
}
.seg > button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: 6px 11px; color: var(--ink-2);
  border-right: 1px solid var(--ink); line-height: 1.1;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg > button:last-child { border-right: 0; }
.seg > button:hover { background: var(--panel-2); }
.seg > button[aria-pressed="true"] { background: var(--ink); color: var(--panel); }
.seg > button[aria-pressed="true"]:hover { background: var(--ink); }
.seg--accent > button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.btn {
  appearance: none; cursor: pointer;
  background: var(--panel); border: 1px solid var(--ink); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; padding: 6px 11px; line-height: 1.1;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--accent:hover { background: #e64500; }
.btn--ghost { border-color: var(--seam-hard); color: var(--ink-2); }
.btn[disabled] { opacity: .45; cursor: default; }

.tog { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.tog__track {
  width: 34px; height: 18px; border-radius: 3px; background: var(--panel-3);
  border: 1px solid var(--seam-hard); position: relative; flex: none;
}
.tog__knob {
  position: absolute; top: 1px; left: 1px; width: 14px; height: 14px; border-radius: 2px;
  background: var(--panel); border: 1px solid var(--ink); transition: left .09s ease-out;
}
.tog[aria-pressed="true"] .tog__track { background: var(--accent); border-color: #c93d00; }
.tog[aria-pressed="true"] .tog__knob { left: 17px; }

/* chunky latching key — LOCK. sits proud, sinks and goes orange when engaged. */
.latch {
  appearance: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--panel-2); border: 1px solid var(--ink); border-radius: var(--r-sm);
  padding: 7px 13px 7px 8px; line-height: 1;
  box-shadow: 0 2px 0 var(--seam-hard);
  transition: background .08s linear;
}
.latch:hover { background: var(--panel-3); }
.latch__cap {
  width: 24px; height: 24px; border-radius: 3px; flex: none;
  background: var(--panel); border: 1px solid var(--ink);
  display: grid; place-items: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .07);
}
.latch__led {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--panel-3); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .3);
}
.latch .lbl { color: var(--ink); }
.latch:active { transform: translateY(2px); box-shadow: 0 0 0 var(--seam-hard); }
.latch[aria-pressed="true"] {
  background: var(--accent); border-color: #a83300;
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--seam-hard), inset 0 1px 3px rgba(0, 0, 0, .3);
}
.latch[aria-pressed="true"]:hover { background: #f04800; }
.latch[aria-pressed="true"] .lbl { color: #fff; }
.latch[aria-pressed="true"] .latch__cap { background: #7a2600; border-color: #4d1800; box-shadow: none; }
.latch[aria-pressed="true"] .latch__led {
  background: #ffd9c8; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 5px rgba(255, 226, 210, .95);
}

input[type="range"] { -webkit-appearance: none; appearance: none; height: 20px; background: transparent; width: 100%; }
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--panel-3); border: 1px solid var(--seam-hard); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 20px; margin-top: -9px;
  background: var(--panel); border: 1px solid var(--ink); border-radius: 2px;
}
input[type="text"], input[type="number"], textarea, select {
  background: var(--panel-2); border: 1px solid var(--seam-hard); border-radius: var(--r-sm);
  padding: 7px 8px; font-size: 12.5px; width: 100%;
}
textarea { font-family: var(--sans); line-height: 1.45; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* knob */
.knob { display: flex; flex-direction: column; align-items: center; gap: 5px; user-select: none; }
.knob svg { cursor: ns-resize; display: block; }
.knob .knob__val { font-family: var(--mono); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- fleet cards */
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; overflow: hidden; }
.card:hover { border-color: var(--ink); }
.card__thumb {
  aspect-ratio: 16/10; background: var(--panel-3); position: relative; overflow: hidden;
  border-bottom: 1px solid var(--seam);
}
.card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__id {
  position: absolute; left: 7px; top: 7px;
  background: var(--ink); color: var(--panel); padding: 3px 6px; border-radius: 3px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .13em;
}
.card__bd { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__name { font-size: 14px; font-weight: 650; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--seam-hard); border-radius: 3px; background: var(--panel-2);
  padding: 3px 6px; font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2);
}
.chip--on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip--empty { color: var(--muted); background: transparent; border-style: dashed; }

.meter { display: flex; gap: 2px; height: 6px; }
.meter i { flex: 1; background: var(--panel-3); border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.meter i.on { background: var(--accent); }
.meter i.g { background: var(--led-green); }
.meter i.a { background: var(--led-amber); }
.meter i.r { background: var(--led-red); }

/* ---------------------------------------------------------------- run lists */
.runlist { display: flex; flex-direction: column; }
.runrow {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 11px; border-bottom: 1px solid var(--seam); cursor: pointer;
}
.runrow:last-child { border-bottom: 0; }
.runrow:hover { background: var(--panel-2); }
.runrow.is-active { background: var(--accent-dim); box-shadow: inset 3px 0 0 var(--accent); }
.runrow__id { font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.runrow__meta { display: flex; gap: 6px; margin-top: 3px; }
.armbadge {
  width: 22px; height: 22px; border-radius: 3px; background: var(--ink); color: var(--panel);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.armbadge--b { background: var(--accent-2); }

/* ------------------------------------------------------------------- images */
.imgframe { background: var(--panel-3); border: 1px solid var(--seam); border-radius: var(--r-sm); overflow: hidden; }
.imgframe img { display: block; width: 100%; }
.strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.strip figure { margin: 0; }
.strip figcaption { margin-top: 4px; }
.thumbbtn { display: block; width: 100%; padding: 0; border: 1px solid var(--seam-hard); border-radius: var(--r-sm); overflow: hidden; background: var(--panel-3); cursor: pointer; }
.thumbbtn img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.thumbbtn[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }

/* --------------------------------------------------------------------- prose */
.prose { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.prose h1 { font-size: 16px; color: var(--ink); margin: 0 0 8px; }
.prose h2 { font-size: 13.5px; color: var(--ink); margin: 14px 0 6px; }
.prose h3 { font-size: 12.5px; color: var(--ink); margin: 12px 0 5px; }
.prose ul { margin: 0 0 8px; padding-left: 17px; }
.prose li { margin: 2px 0; }
.prose code { font-family: var(--mono); font-size: 11.5px; background: var(--panel-2); padding: 1px 4px; border-radius: 3px; }
.prose pre { font-family: var(--mono); font-size: 11px; background: var(--panel-2); border: 1px solid var(--seam); border-radius: var(--r-sm); padding: 9px; overflow: auto; }
.prose strong { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--seam); margin: 12px 0; }
.prose a { color: var(--accent-2); border-bottom: 1px solid var(--seam-hard); }

/* -------------------------------------------------------------------- table */
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
table.tbl th {
  text-align: left; font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding: 7px 9px; border-bottom: 1px solid var(--seam-hard); white-space: nowrap;
  position: sticky; top: 0; background: var(--panel);
}
table.tbl td { padding: 7px 9px; border-bottom: 1px solid var(--seam); vertical-align: top; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.hero td { background: rgba(255, 77, 0, .045); }
table.tbl tr.is-sel td { background: var(--accent-dim); }
table.tbl tr:hover td { background: var(--panel-2); }
table.tbl tr.hero:hover td { background: rgba(255, 77, 0, .09); }
td.id { font-family: var(--mono); font-weight: 700; font-size: 11.5px; white-space: nowrap; }
td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.ev { color: var(--ink-2); font-size: 11.5px; max-width: 340px; }
.rolepill {
  display: inline-block; padding: 2px 5px; border-radius: 3px;
  font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.rolepill--hero { background: var(--accent); color: #fff; }
.rolepill--fill { background: var(--panel-3); color: var(--ink-2); }

/* ------------------------------------------------------------------- overlay */
.ovwrap { position: relative; background: var(--panel-3); overflow: hidden; border-radius: var(--r-sm); }
.ovwrap img.base { display: block; width: 100%; }
.ovlayer { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% 50%; }
.ovlayer img { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: none; }
.ovbar { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.nudge { display: grid; grid-template-columns: repeat(3, 26px); gap: 3px; }
.nudge button {
  width: 26px; height: 24px; border: 1px solid var(--ink); background: var(--panel); border-radius: 3px;
  cursor: pointer; font-family: var(--mono); font-size: 11px; line-height: 1; padding: 0;
}
.nudge button:hover { background: var(--panel-2); }
.nudge .blank { visibility: hidden; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field input { width: 84px; text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11.5px; }
.field--lock { justify-content: flex-end; margin-left: auto; }
.regled { display: inline-flex; align-items: center; gap: 5px; flex: none; }

/* registration locked: the alignment controls go inert and read as inert */
.ovbar.is-locked .field--reg { opacity: .5; }
.ovbar.is-locked .field--reg .lbl { color: var(--seam-hard); }
.nudge button[disabled] { opacity: .45; cursor: default; background: var(--panel-2); }
.nudge button[disabled]:hover { background: var(--panel-2); }
.seg > button[disabled] { cursor: default; color: var(--seam-hard); }
.seg > button[disabled]:hover { background: transparent; }
.seg > button[disabled][aria-pressed="true"] { background: var(--seam-hard); color: var(--panel); }
input[disabled], textarea[disabled] { background: var(--panel-3); color: var(--muted); cursor: default; }
/* the frame has to sit ABOVE the aerial, so it is a pseudo-element, not a shadow */
.ovwrap.is-locked::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--r-sm);
}
.stagetag.ovlock { display: none; left: auto; right: 8px; z-index: 1; }
.ovwrap.is-locked .stagetag.ovlock { display: block; }

/* ------------------------------------------------------------------- compare */
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.flipwrap { position: relative; background: var(--panel-3); border-radius: var(--r-sm); overflow: hidden; }
.flipwrap img { display: block; width: 100%; }
.flipwrap img.b { position: absolute; inset: 0; }
.flipstage { display: block; width: fit-content; max-width: 100%; margin: 0 auto; }
.flipstage img { max-height: 62vh; width: auto; max-width: 100%; object-fit: contain; }
.flipstage img.b { width: 100%; height: 100%; }
.svgframe img { max-height: 640px; width: auto; max-width: 100%; margin: 0 auto; }
.cmp { align-items: start; }
.cmp .empty { min-height: 200px; display: grid; place-items: center; }
.stagetag {
  position: absolute; left: 8px; top: 8px; background: var(--ink); color: var(--panel);
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  padding: 3px 6px; border-radius: 3px;
}
.stagetag--accent { background: var(--accent); color: #fff; }

/* ------------------------------------------------------------------- review */
.verdict { display: flex; gap: 7px; }
.vbtn {
  flex: 1; cursor: pointer; background: var(--panel); border: 1px solid var(--ink);
  border-radius: var(--r-sm); padding: 9px 8px; display: flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.vbtn:hover { background: var(--panel-2); }
.vbtn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.vbtn[aria-pressed="true"] .led { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 0 5px rgba(255, 255, 255, .6); }

.savebar { display: flex; align-items: center; gap: 10px; }
.saved { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------------- misc */
.empty {
  border: 1px dashed var(--seam-hard); border-radius: var(--r-sm); background: var(--panel-2);
  padding: 14px; text-align: center; color: var(--muted);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
}
.warn {
  border: 1px solid var(--accent); border-left-width: 4px; background: var(--accent-dim);
  border-radius: var(--r-sm); padding: 9px 11px; font-size: 12.5px; color: var(--ink);
}
.warn .lbl { color: var(--accent); display: block; margin-bottom: 3px; }
.scenebox { width: 100%; aspect-ratio: 16/10; background: var(--panel-3); border-radius: var(--r-sm); overflow: hidden; position: relative; }
.scenebox canvas, .scenebox iframe { display: block; width: 100%; height: 100%; border: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline; }
.kv dt { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 0; font-size: 12.5px; }
.scroll { overflow: auto; }
.lightbox {
  position: fixed; inset: 0; z-index: 90; background: rgba(23, 22, 20, .88);
  display: grid; place-items: center; padding: 30px;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: var(--r-sm); }
.lightbox .close { position: absolute; right: 16px; top: 16px; }
