/* canary-local/assets/canary-local.css — Quiet Glass, on the web.
   Palette lifted from the display firmware's theme.h so the page and the
   glass feel like one product: bg #000, surface #141414, edge #262626,
   text #EDEDED, muted #8A8A8A, canary #FFD44F. */

:root {
  --bg: #000;
  --surface: #141414;
  --surface-2: #1b1b1d;
  --edge: #262626;
  --text: #ededed;
  --muted: #8a8a8a;
  --faint: #4a4a4a;
  --canary: #ffd44f;
  --canary-deep: #e3b33c;
  --ok: #43a047;
  --warn: #fb8c00;
  --alert: #e53935;
  --signed: #03a9f4;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 700px at 50% -200px, #17140a 0%, var(--bg) 55%);
  color: var(--text);
  font: 16px/1.55 -apple-system, "SF Pro Text", "Segoe UI", Roboto, Inter, sans-serif;
  min-height: 100vh;
}
body.locked { overflow: hidden; }

a { color: var(--canary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--surface); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }

/* ── hero ── */
#hero { max-width: 880px; margin: 0 auto; padding: 56px 24px 8px; text-align: center; }
#hero .mark { display: inline-block; filter: drop-shadow(0 6px 24px rgba(255, 212, 79, 0.25)); }
#hero h1 { font-size: 44px; letter-spacing: 0.5px; margin: 10px 0 0; font-weight: 650; }
#hero h1 .dot { color: var(--canary); }
.lede { color: #c9c9c9; max-width: 560px; margin: 14px auto 0; }
.lede-sub { color: var(--muted); font-size: 14.5px; max-width: 520px; margin: 8px auto 0; }
.lede em { color: var(--canary); font-style: normal; }
.fineprint { color: var(--faint); font-size: 13px; margin-top: 10px; }

/* ── cards ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  max-width: 1180px;
  margin: 36px auto 80px;
  padding: 0 24px;
}
.card {
  appearance: none;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, var(--surface-2) 0%, #101012 100%);
  border-radius: var(--radius);
  padding: 14px 14px 18px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), border-color 0.25s, box-shadow 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #3a3a3a;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), 0 2px 16px rgba(255, 212, 79, 0.07);
}
.card-3d { width: 100%; height: 190px; display: block; touch-action: none; }
.card-name { font-weight: 640; font-size: 18px; margin-top: 8px; }
.card-tag { color: var(--muted); font-size: 13.5px; margin-top: 2px; min-height: 2.6em; }
.card-chips { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; letter-spacing: 0.4px; text-transform: uppercase;
  border: 1px solid var(--edge); color: var(--muted);
  border-radius: 999px; padding: 2.5px 9px;
}
.chip-dim { border-color: #202020; color: var(--faint); }
.chip-live { border-color: rgba(255, 212, 79, 0.5); color: var(--canary); }

/* ── sheet (the pairing card) ── */
#sheet-root { position: fixed; inset: 0; display: none; z-index: 40; }
#sheet-root.open { display: block; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(14px) saturate(0.8); }
.sheet {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 6%);
  width: min(1160px, calc(100vw - 16px)); height: min(92vh, 900px);
  background: linear-gradient(180deg, #1a1a1c 0%, #0e0e10 100%);
  border: 1px solid #2c2c2e; border-bottom: none;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -30px 90px rgba(0, 0, 0, 0.7);
  display: grid;
  grid-template: "grab grab" auto "head head" auto "stage side" 1fr / minmax(320px, 46%) 1fr;
  gap: 0 22px;
  padding: 8px 22px 18px;
  opacity: 0; transition: transform 0.34s cubic-bezier(0.2, 0.9, 0.25, 1.05), opacity 0.3s;
}
.sheet.up { transform: translate(-50%, 0); opacity: 1; }
.grab { grid-area: grab; width: 44px; height: 5px; border-radius: 3px; background: #333; margin: 6px auto 2px; }
.sheet-head { grid-area: head; position: relative; padding: 4px 0 10px; }
.sheet-head h2 { margin: 0; font-size: 26px; }
.sheet-head .muted { margin: 2px 0 0; }
.close {
  position: absolute; right: 0; top: 4px; appearance: none; border: 1px solid var(--edge);
  background: var(--surface); color: var(--muted); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 15px;
}
.close:hover { color: var(--text); border-color: #3a3a3a; }

.stage { grid-area: stage; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.stage-3d { width: 100%; flex: 1 1 55%; min-height: 220px; touch-action: none;
  background: radial-gradient(420px 260px at 50% 42%, rgba(255, 212, 79, 0.05), transparent 70%); border-radius: 16px; }
.glass-wrap { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 4px; }
.glass { background: #000; border: 1px solid #222; touch-action: none; cursor: pointer;
  max-width: 100%; height: auto; box-shadow: 0 8px 40px rgba(0,0,0,0.6); }
.glass.round { border-radius: 50%; }
canvas.glass { width: 232px; }
.glass-hint { color: var(--faint); font-size: 12px; }

.side { grid-area: side; display: flex; flex-direction: column; min-height: 0; }
.tabs, .subtabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 12px; }
.tab {
  appearance: none; cursor: pointer; border: 1px solid var(--edge);
  background: transparent; color: var(--muted); font-size: 13.5px;
  padding: 6px 14px; border-radius: 999px;
}
.tab.on { color: #111; background: var(--canary); border-color: var(--canary); font-weight: 600; }
.panel { overflow-y: auto; min-height: 0; flex: 1; padding-right: 6px; }

.tour h3 { margin: 4px 0 6px; font-size: 20px; }
.body { color: #cfcfcf; }
.note { color: var(--canary-deep); font-size: 13px; min-height: 1.2em; margin-top: 8px; }
.tour-nav { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
button.primary, button.ghost, button.danger {
  appearance: none; cursor: pointer; border-radius: 12px; font-size: 14px;
  padding: 9px 16px; border: 1px solid var(--edge); background: var(--surface); color: var(--text);
}
button.primary { background: var(--canary); border-color: var(--canary); color: #151204; font-weight: 640; }
button.primary:hover { filter: brightness(1.06); }
button.ghost:hover { border-color: #3a3a3a; }
button.danger { border-color: rgba(229, 57, 53, 0.5); color: #ff8a80; }
button.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: 0.35; cursor: default; }

.fixes .fix { border: 1px solid var(--edge); border-radius: 14px; margin: 10px 0; background: var(--surface); }
.fixes summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.fix-step { padding: 4px 16px 14px; border-top: 1px solid #1e1e1e; }
.fix-step h4 { margin: 10px 0 4px; }
.ondevice { border-left: 3px solid var(--canary-deep); padding: 6px 10px; background: #191712; border-radius: 0 8px 8px 0; color: #d8cfae; font-size: 14px; }

.try-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; }

.log {
  background: #050507; border: 1px solid #222; border-radius: 12px; padding: 10px 12px;
  font: 11px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color: #b8c7b8; height: 100%; min-height: 260px; overflow-y: auto; white-space: pre-wrap; margin: 0;
}
.wire-holder { flex: 1; min-height: 260px; display: flex; }
.wire-holder > * { flex: 1; }
.wirelog { background: #050507; border: 1px solid #222; border-radius: 12px; padding: 8px; overflow-y: auto; min-height: 260px;
  font: 11px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.wire { display: flex; gap: 8px; padding: 1.5px 4px; border-radius: 6px; }
.wire-dir { color: var(--faint); min-width: 38px; }
.wire-in .wire-dir { color: var(--signed); }
.wire-out .wire-dir { color: var(--canary-deep); }
.wire-lwt .wire-dir { color: var(--alert); }
.wire-topic { color: #9ad19a; }
.wire-pay { color: #777; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.specs dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 16px; }
.specs dt { color: var(--faint); }
.specs dd { margin: 0; color: #d6d6d6; }

.led-demo { display: flex; align-items: center; gap: 16px; padding: 18px 6px; }
.led-dot { width: 26px; height: 26px; border-radius: 50%; background: #2a2a20; transition: background 0.05s, box-shadow 0.05s; }
.led-dot.on { background: var(--canary); box-shadow: 0 0 24px 6px rgba(255, 212, 79, 0.55); }
.led-cap { color: var(--muted); font-size: 14px; }
.led-list { display: flex; flex-direction: column; gap: 6px; }
.led-row {
  appearance: none; cursor: pointer; display: flex; justify-content: space-between; gap: 14px;
  text-align: left; border: 1px solid var(--edge); background: var(--surface);
  color: var(--text); border-radius: 10px; padding: 9px 14px; font-size: 14px;
}
.led-row:hover { border-color: #3a3a3a; }
.led-pat { color: var(--canary-deep); }
.led-mean { color: var(--muted); }

.muted { color: var(--muted); }

/* ── hero CTA ── */
.cta-row {
  margin: 22px auto 4px; display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; max-width: 660px;
}
.cta {
  display: inline-flex; align-items: baseline; gap: 8px;
  background: var(--canary); color: #151204;
  font-weight: 650; padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(255, 212, 79, 0.22);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.cta:hover { transform: translateY(-2px); text-decoration: none;
  box-shadow: 0 12px 40px rgba(255, 212, 79, 0.3); }
.cta .cta-hint { font-weight: 450; font-size: 12.5px; opacity: 0.72; }
.cta.alt {
  background: var(--surface); color: var(--canary);
  border: 1px solid rgba(255, 212, 79, 0.28); box-shadow: none;
}
.cta.alt:hover { border-color: rgba(255, 212, 79, 0.6); box-shadow: none; }
.cta.alt .cta-hint { color: var(--muted); opacity: 1; }
@media (max-width: 560px) {
  .cta-row { flex-direction: column; align-items: stretch; max-width: 340px; }
  .cta { justify-content: center; padding: 12px 18px; }
}

/* ── enclosure lab ── */
.enclab .pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.pill {
  appearance: none; cursor: pointer; border: 1px solid var(--edge);
  background: var(--surface); color: var(--muted); font-size: 13px;
  padding: 6px 13px; border-radius: 999px;
}
.pill.on { color: #111; background: var(--canary); border-color: var(--canary); font-weight: 600; }
.pill-uni { border-style: dashed; }
.enclab-stage { position: relative; }
.enclab-3d { width: 100%; height: 260px; touch-action: none; border-radius: 14px;
  background: radial-gradient(400px 200px at 50% 45%, rgba(255,212,79,0.05), transparent 70%); }
.enclab-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); padding: 4px 2px 8px; }
.enclab-legend .leg { display: inline-flex; align-items: center; gap: 6px; }
.enclab-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.enclab-status { font-size: 12.5px; padding: 6px 12px; border-radius: 9px; margin: 6px 0 8px; }
.enclab-status.ok { background: rgba(67, 160, 71, 0.12); color: #7fd184; border: 1px solid rgba(67,160,71,0.35); }
.enclab-status.dev { background: rgba(251, 140, 0, 0.1); color: #ffb45e; border: 1px solid rgba(251,140,0,0.3); }
.enclab-files a { margin-right: 10px; }
.params h4 { margin: 16px 0 6px; }
.pgroup { border: 1px solid var(--edge); border-radius: 10px; margin: 6px 0; background: var(--surface); }
.pgroup summary { cursor: pointer; padding: 8px 12px; font-size: 14px; }
.prow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline;
  padding: 5px 12px 5px 20px; border-top: 1px solid #1d1d1d; font-size: 13px; }
.prow code { color: var(--canary-deep); background: none; padding: 0; }
.pdefault { color: var(--text); }
.penum { color: var(--signed); font-size: 12px; }
.pcomment { color: var(--muted); flex-basis: 100%; padding-left: 2px; }

/* ── enclosure lab: filament + print guide ── */
.enclab-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin: 2px 0 8px; }

/* ── board viewer (vendor CAD) ─────────────────────────────────────────── */
.board-ribbon { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 2px; font-size: 16px; }
.board-prov { margin: 6px 0 10px; }
.boardlab-stage { position: relative; }
.boardlab-3d { width: 100%; height: 320px; touch-action: none; border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 20%, #2a2f39 0%, #1b1f27 48%, #0e1116 100%); }
.boardlab-legend { display: flex; justify-content: flex-end; font-size: 12px; color: var(--muted); padding: 4px 4px 8px; }
.boardlab-facts { font-size: 12.5px; margin: 2px 0 10px; }
.pin-table { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 10px; }
.pin-row { display: grid; grid-template-columns: 1.1fr 0.9fr 1.1fr 2fr; gap: 8px; align-items: baseline;
  font-size: 13px; padding: 5px 8px; border-radius: 8px; background: #17151055; }
.pin-label { font-weight: 600; color: #e8ddb8; }
.pin-pin, .pin-gpio { font-size: 12px; color: var(--canary); }
.pin-gpio { color: #9fb0c4; }
.pin-use { font-size: 12px; }
.pin-planned { opacity: 0.72; }
.pin-tag { margin-left: 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: #ffb45e; background: rgba(251,140,0,0.12); border: 1px solid rgba(251,140,0,0.3); border-radius: 6px; padding: 1px 5px; }
.boardlab-links a { margin-right: 4px; }
@media (max-width: 520px) { .pin-row { grid-template-columns: 1fr 1fr; } .pin-use { grid-column: 1 / -1; } }

/* ── assemble tab (guided build) ───────────────────────────────────────── */
.asm-prov { margin: 4px 0 10px; }
.asmlab-stage { position: relative; }
.asmlab-3d { width: 100%; height: 400px; touch-action: none; border-radius: 14px; outline: none;
  background: radial-gradient(120% 95% at 50% 16%, #2b303a 0%, #1b1f27 46%, #0e1116 100%); }
.asmlab-hint { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: var(--muted); pointer-events: none; }
.asm-controls { margin: 10px 0 6px; display: flex; flex-direction: column; gap: 10px; }
.asm-mode { align-self: flex-start; }
.asm-explode { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.asm-slider { flex: 1; accent-color: var(--canary); }
.asm-step { display: flex; flex-direction: column; gap: 10px; }
.asm-rail { display: flex; gap: 7px; align-items: center; }
.asm-dot { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #4a4f59; background: transparent; padding: 0; cursor: pointer; transition: transform .15s, background .15s; }
.asm-dot.on { background: var(--canary); border-color: var(--canary); }
.asm-dot.active { transform: scale(1.5); box-shadow: 0 0 0 3px rgba(255,212,79,0.18); }
.asm-nav { display: flex; align-items: center; gap: 10px; }
.asm-counter { margin: 0 2px; }
.asm-card { background: #16151055; border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 12px 14px; margin-top: 4px; }
.asm-step-n { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.asm-title { margin: 3px 0 6px; }
.asm-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.asm-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 4px 9px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); color: #e8ddb8; }
.asm-qty { font-weight: 700; color: var(--canary); }
.asm-ref { font-size: 11px; color: var(--muted); }

/* the drafting gate — the CI ordering rules, surfaced */
.asm-gate { font-size: 12.5px; margin: 2px 0 10px; padding: 7px 11px; border-radius: 10px; border: 1px solid; }
.asm-gate.ok { color: #9ad8a9; border-color: rgba(120, 220, 150, 0.25); background: rgba(60, 160, 90, 0.08); }
.asm-gate.bad { color: #f0b9a0; border-color: rgba(240, 150, 100, 0.3); background: rgba(200, 100, 50, 0.1); }
.asm-gate strong { margin-right: 5px; }

/* item balloons over the exploded drawing (numbers match the parts list) */
.asm-balloons { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.asm-balloons[hidden] { display: none; }
.asm-balloon { position: absolute; display: none; align-items: center; justify-content: center;
  width: 23px; height: 23px; margin: -30px 0 0 10px; border-radius: 50%;
  border: 1.5px solid #8b90a0; background: rgba(12, 12, 10, 0.82); color: #e8e6df;
  font: 700 11.5px/1 system-ui, sans-serif; cursor: pointer; pointer-events: auto;
  transition: border-color .15s, color .15s, transform .15s; }
.asm-balloon::after { content: ""; position: absolute; left: -9px; top: 26px; width: 10px; height: 1px;
  background: #8b90a0; transform: rotate(38deg); opacity: 0.7; }
.asm-balloon:hover { border-color: var(--canary); color: var(--canary); transform: scale(1.18); }

/* the parts list — item · part · ref · qty · caliper size */
.asm-bomhead { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.asm-units { font-variant-numeric: tabular-nums; }
.asm-envelope { font-size: 12.5px; color: var(--muted); margin: 6px 0 8px; font-variant-numeric: tabular-nums; }
.asm-bom { overflow-x: auto; }
.asm-bomtab { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 480px; }
.asm-bomtab th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 5px 10px 5px 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.asm-bomtab td { padding: 6px 10px 6px 0; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.asm-bomtab tr { cursor: pointer; }
.asm-bomtab tr.flash td { background: rgba(255, 212, 79, 0.1); }
.asm-bom-n { font-weight: 700; color: var(--canary); }
.asm-bom-size { font-variant-numeric: tabular-nums; white-space: nowrap; color: #cfcdc5; }
.asm-cls { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; padding: 1px 6px; margin-left: 4px; }

/* caliper rows elsewhere (Specs) — tap to cycle mm / in / all */
.unit-cycle { cursor: pointer; font-variant-numeric: tabular-nums; text-decoration: underline dotted rgba(255,255,255,0.25); text-underline-offset: 3px; }
.unit-cycle:hover { color: var(--canary); }
.filaments { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fil-label { font-size: 12px; }
button.fil {
  appearance: none; cursor: pointer; width: 22px; height: 22px;
  border-radius: 50%; border: 2px solid #333; padding: 0; font-size: 11px;
  line-height: 1; background: var(--surface); color: var(--muted);
}
button.fil.on { border-color: var(--canary); box-shadow: 0 0 0 2px rgba(255,212,79,0.25); }
button.fil-multi { display: inline-flex; align-items: center; justify-content: center; }
input.fil-custom { width: 26px; height: 24px; padding: 0; border: 2px solid #333;
  border-radius: 7px; background: none; cursor: pointer; }
.print-ctl { margin-top: 4px; }
.print-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 2px; }
.layer-slider { flex: 1 1 220px; accent-color: var(--canary); }
.layer-readout { color: var(--canary-deep); font-size: 12.5px; min-width: 150px; }
.over-toggle { color: var(--muted); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.over-toggle input { accent-color: var(--alert); }
.print-card { border: 1px solid var(--edge); border-radius: 12px; background: var(--surface);
  padding: 12px 16px; margin-top: 10px; }
.print-card h4 { margin: 0 0 8px; }
.print-card dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 14px; font-size: 13.5px; }
.print-card dt { color: var(--faint); }
.print-card dd { margin: 0; color: #d6d6d6; }
.print-notes { margin: 10px 0 4px; padding-left: 18px; font-size: 13px; color: #c9c9c9; }
.print-notes li { margin: 3px 0; }

/* ── print estimate + watch-it-print ── */
.print-play { flex: 0 0 auto; border: 1px solid var(--canary-deep); border-radius: 8px;
  background: rgba(255, 212, 79, 0.08); color: var(--canary); font-size: 12.5px;
  padding: 6px 12px; cursor: pointer; font-weight: 600; letter-spacing: 0.2px;
  transition: background 0.15s, color 0.15s; }
.print-play:hover { background: rgba(255, 212, 79, 0.16); }
.print-play.on { background: var(--canary); color: #17140a; border-color: var(--canary); }
.print-hud { display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 6px 2px 2px; }
.phud-stat { display: inline-flex; flex-direction: column; line-height: 1.15; }
.phud-stat b { font-size: 13.5px; color: var(--canary-deep); font-variant-numeric: tabular-nums; }
.phud-stat i { font-size: 10.5px; color: var(--faint); font-style: normal; text-transform: uppercase; letter-spacing: 0.5px; }

.est-basis { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.est-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.est-sel, .est-elec { background: var(--surface-2, #16161a); color: #e6e6e6; border: 1px solid var(--edge);
  border-radius: 6px; padding: 4px 6px; font-size: 12.5px; }
.est-elec { width: 68px; }
.est-note { font-size: 11.5px; }
.est-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  margin-bottom: 12px; }
.est-big { border: 1px solid var(--edge); border-radius: 10px; padding: 9px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent); }
.est-big b { display: block; font-size: 19px; color: #f2f2f2; font-variant-numeric: tabular-nums; }
.est-big i { display: block; font-size: 11px; color: var(--faint); font-style: normal; margin-top: 2px; }
.est-big.est-cost { border-color: var(--canary-deep); background: rgba(255, 212, 79, 0.06); }
.est-big.est-cost b { color: var(--canary); }
.est-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 10px; }
.est-table th { text-align: left; color: var(--faint); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.4px; padding: 2px 8px 6px; border-bottom: 1px solid var(--edge); }
.est-table td { padding: 5px 8px; color: #d6d6d6; border-bottom: 1px solid rgba(255,255,255,0.04); }
.est-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.est-slice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 2px 0 10px; }
.est-slice-btn { border: 1px solid var(--canary-deep); border-radius: 8px; background: rgba(255,212,79,0.08);
  color: var(--canary); font-size: 12.5px; font-weight: 600; padding: 5px 11px; cursor: pointer; }
.est-slice-btn:hover:not(:disabled) { background: rgba(255,212,79,0.16); }
.est-slice-btn:disabled { opacity: 0.6; cursor: default; }
.est-slice-note { font-size: 12px; }
.est-build { margin: 12px 0 4px; padding-top: 12px; border-top: 1px solid var(--edge); }
.est-build h4 { margin: 0 0 6px; }
.est-build-unit { font-size: 13.5px; margin: 0 0 8px; color: #d6d6d6; }
.est-build-unit b { color: var(--canary); font-size: 15px; }
.est-fleet { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 8px; }
.est-qty { width: 60px; background: var(--surface-2, #16161a); color: #e6e6e6; border: 1px solid var(--edge);
  border-radius: 6px; padding: 4px 6px; font-size: 12.5px; }
.est-fleet-out { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.est-tco { font-size: 12.5px; line-height: 1.5; margin: 6px 0 4px; color: #cfcfcf;
  border-left: 2px solid var(--canary-deep); padding-left: 10px; }
.est-tco strong { color: var(--canary); }
.est-build-foot { font-size: 11.5px; line-height: 1.5; margin: 4px 0 0; }
.est-prov { font-size: 11.5px; line-height: 1.5; margin: 4px 0 0; }
.print-handoff { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--edge); font-size: 12.5px; }

/* ── chooser ── */
.quiz { max-width: 880px; margin: 0 auto 70px; padding: 0 24px; }
.q { border: 1px solid var(--edge); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), #101012);
  padding: 18px 20px; margin: 14px 0; }
.q h3 { margin: 0 0 4px; }
.q-hint { color: var(--faint); font-size: 12px; margin: 0 0 6px; }
.q-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.q-opt {
  appearance: none; cursor: pointer; border: 1px solid var(--edge);
  background: var(--surface); color: var(--text); font-size: 14px;
  padding: 9px 16px; border-radius: 12px; text-align: left;
}
.q-opt:hover { border-color: #3a3a3a; }
.q-opt.on { background: var(--canary); border-color: var(--canary); color: #151204; font-weight: 600; }
.results h2 { margin: 26px 0 6px; }
.match { border: 1px solid #2c2c2e; border-radius: var(--radius);
  background: linear-gradient(180deg, #1a1a1c, #0e0e10); padding: 18px 20px; margin: 12px 0;
  box-shadow: 0 14px 44px rgba(0,0,0,0.4); }
.match-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.match-head h3 { margin: 0; }
.match-preview { max-width: 300px; border-radius: 12px; border: 1px solid var(--edge); margin-top: 8px; background: #f5f5f5; }
.match-doors { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px 0 0; }
.match-doors .door { text-decoration: none; }
.match-comp { border-style: dashed; }
.chip-dev { border-color: rgba(251, 140, 0, 0.5); color: #ffb45e; }
a.primary.small { display: inline-block; }

footer { border-top: 1px solid #161616; color: var(--faint); font-size: 13px; text-align: center; padding: 26px 20px 40px; }
footer p { max-width: 720px; margin: 0 auto; }

@media (max-width: 900px) {
  /* One scroll surface: the sheet itself scrolls; rows take their natural
     height and the inner .panel stops being a (tiny, easily-missed) nested
     scroller. Without this, the 3D stage + glass fill the screen and the
     only scrollable region is a sliver at the bottom. */
  .sheet {
    /* block flow, not grid: grid track sizing under-measured the stage row
       (the emulator glass canvas gets its intrinsic size after first
       layout), which let the glass paint over — and steal touches from —
       the tabs and panel below it */
    display: block;
    height: 94vh; height: 94dvh;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .stage { margin-bottom: 14px; }
  .stage-3d { min-height: 180px; height: 200px; flex: none; }
  .side { min-height: auto; }
  .panel { overflow: visible; flex: none; padding-right: 0; }
}

/* ── build-it tab ── */
.buildit h4 { margin: 18px 0 8px; }
.bom-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.bom-totals { color: var(--canary-deep); font-size: 14px; }
.bom-toggle { margin: 2px 0 10px; display: inline-flex; }
.bom-table { display: flex; flex-direction: column; gap: 6px; }
.bom-row { border: 1px solid var(--edge); border-radius: 10px; background: var(--surface); padding: 8px 12px; }
.bom-has-note { cursor: pointer; }
.bom-has-note:hover { border-color: #3a3a3a; }
.bom-opt { opacity: 0.75; }
.bom-row-top { display: flex; gap: 10px; align-items: baseline; }
.bom-ref { color: var(--canary-deep); background: none; padding: 0; min-width: 46px; }
.bom-desc { flex: 1; font-size: 14px; }
.bom-usd { color: var(--text); font-size: 13px; }
.bom-row-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--muted); }
.bom-note { border-top: 1px solid #1e1e1e; margin-top: 8px; padding-top: 7px; font-size: 12.5px; color: #b9b09a; }
.asm-steps { padding-left: 20px; color: #cfcfcf; }
.asm-steps li { margin: 7px 0; }

/* ── The Workshop (workshop.html) — Tesla-configurator journey ───────── */
#workshop { max-width: 1180px; margin: 0 auto; padding: 0 22px 60px; }
.ws-hero .lede { max-width: 760px; }

.ws-devices { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 14px; }
.ws-device { display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: var(--surface); color: var(--text); border: 1px solid var(--edge);
  border-radius: 14px; padding: 10px 14px; cursor: pointer; font: inherit; }
.ws-device .muted { font-size: 12px; }
.ws-device.on { border-color: var(--canary); box-shadow: 0 0 0 1px var(--canary); }

.ws-mode { display: flex; gap: 8px; margin: 0 0 16px; }

.ws-rail { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px;
  border-bottom: 1px solid var(--edge); padding-bottom: 12px; }
.ws-stagebtn { display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--edge); border-radius: 999px;
  color: var(--muted); padding: 7px 14px; cursor: pointer; font: inherit; }
.ws-stagebtn.on { color: var(--text); border-color: var(--canary); }
.ws-stageno { display: inline-grid; place-items: center; width: 20px; height: 20px;
  border-radius: 50%; background: var(--surface-2); font-size: 12px; }
.ws-stagebtn.on .ws-stageno { background: var(--canary); color: #141414; }

.ws-configure { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(360px, 6fr);
  gap: 26px; }
@media (max-width: 900px) { .ws-configure { grid-template-columns: 1fr; } }

.ws-pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px; margin: 8px 0 4px; }
.ws-pkg { display: flex; flex-direction: column; gap: 4px; text-align: left;
  background: var(--surface); border: 1px solid var(--edge); border-radius: 14px;
  color: var(--text); padding: 10px; cursor: pointer; font: inherit; }
.ws-pkg img { width: 100%; border-radius: 8px; background: #0a0a0a; }
.ws-pkg:hover { border-color: var(--canary-deep); }
.ws-dims { color: var(--canary); font-size: 12.5px; }
.ws-contents { color: var(--muted); font-size: 12.5px; }

.ws-optgroup { margin: 14px 0 4px; }
.ws-optgroup h4, .ws-check h4 { margin: 10px 0 6px; color: var(--canary-deep);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.ws-opt { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px;
  border: 1px solid var(--edge); border-radius: 13px; cursor: pointer;
  background: var(--surface); margin: 8px 0;
  transition: border-color 0.18s, box-shadow 0.18s; }
.ws-opt:hover { border-color: #3a3a3a; }
.ws-picked { border-color: rgba(255, 212, 79, 0.55);
  box-shadow: 0 0 0 1px rgba(255, 212, 79, 0.25), 0 6px 24px rgba(0,0,0,0.35); }
.ws-benefit { color: var(--canary-deep); font-size: 13.5px; }
.ws-delta { margin-left: auto; color: var(--text); font-size: 13.5px;
  font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 2px; }
.ws-groupsub { color: var(--faint); text-transform: none; letter-spacing: 0;
  font-weight: 400; }
.ws-from { color: var(--canary); font-size: 13px; font-weight: 600; }
.ws-ticker { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap;
  border: 1px solid var(--edge); background: #101010; border-radius: 12px;
  padding: 9px 14px; margin: 4px 0 10px; }
.ws-tickbig { font-size: 19px; color: var(--canary); font-variant-numeric: tabular-nums; }
.ws-ticksep { color: var(--faint); }
.ws-opt input { margin-top: 3px; accent-color: var(--canary); }
.ws-optbody { display: flex; flex-direction: column; gap: 2px; }
.ws-conseq { color: var(--muted); font-size: 12.5px; }
.ws-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.ws-ref, .ws-flag { font-size: 11px; background: var(--surface-2); color: #b9b09a;
  border: 1px solid var(--edge); border-radius: 6px; padding: 1px 6px; }
.ws-flag { color: #7fb7d9; }
.ws-addon { border: 1px dashed var(--edge); border-radius: 12px; margin-top: 10px; }
.ws-gated { opacity: 0.45; }
.ws-opt-enum select { background: var(--surface-2); color: var(--text);
  border: 1px solid var(--edge); border-radius: 8px; padding: 4px 8px; font: inherit; }
.ws-optlabel { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

.ws-stage { position: relative; background: var(--surface); border: 1px solid var(--edge);
  border-radius: var(--radius); overflow: hidden; }
.ws-canvas { width: 100%; height: 400px; display: block; touch-action: none; }
.ws-ribbon { position: absolute; left: 12px; top: 12px; font-size: 12.5px;
  background: #000a; border: 1px solid var(--edge); border-radius: 999px;
  padding: 4px 12px; color: var(--muted); backdrop-filter: blur(4px); }
.ws-ribbon.ws-exact { color: #9ccc9c; border-color: #2e4d2e; }
.ws-ribbon.ws-custom { color: var(--canary); border-color: #4d431f; }
.ws-meshnote { font-size: 12px; white-space: nowrap; }

.ws-check { background: var(--surface); border: 1px solid var(--edge);
  border-radius: var(--radius); padding: 14px 18px; margin-top: 14px; }
.ws-partlist, .ws-bomlist, .ws-flaglist { list-style: none; margin: 4px 0; padding: 0; }
.ws-partlist li, .ws-bomlist li, .ws-flaglist li { margin: 5px 0; font-size: 13.5px; }
.ws-because { color: var(--canary-deep); font-size: 12px; }
.ws-alt { opacity: 0.6; }
.ws-warn { color: var(--warn); }
.ws-on .ws-flag { color: #9ccc9c; }
.ws-off .ws-flag { color: var(--warn); }
.ws-dl { background: var(--canary); color: #141414; border: none; border-radius: 999px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; margin-top: 10px; }
.ws-dl:hover { background: #ffdf7a; }

.ws-stagebody { animation: wsfade 0.25s ease; }
@keyframes wsfade { from { opacity: 0; transform: translateY(4px); } }

.ws-printlist { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.ws-printrow { background: var(--surface); border: 1px solid var(--edge);
  border-radius: 12px; padding: 10px 14px; }
.ws-printhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ws-printrow p { margin: 5px 0 0; font-size: 13px; }
.ws-stl { margin-left: auto; color: var(--canary); text-decoration: none; }
.ws-settings { background: var(--surface); border: 1px solid var(--edge);
  border-radius: 12px; padding: 10px 16px; margin: 12px 0; }
.ws-settings ul { margin: 6px 0; padding-left: 18px; color: #cfcfcf; font-size: 13.5px; }

.ws-gathertotal { font-size: 17px; margin: 6px 0 10px; }
.ws-recipes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px; margin: 8px 0; }
.ws-recipe { display: flex; flex-direction: column; gap: 3px; background: var(--surface);
  border: 1px solid var(--edge); border-radius: 12px; padding: 10px 14px; font-size: 13px; }

.ws-templates { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px; margin: 10px 0; }
.ws-template { display: flex; flex-direction: column; gap: 5px; background: var(--surface);
  border: 1px solid var(--edge); border-radius: 12px; padding: 10px; font-size: 13px; }
.ws-template img { width: 100%; border-radius: 8px; background: #fff; }

.ws-flavors { display: flex; gap: 8px; margin: 6px 0 10px; }
.ws-allflags { columns: 2; }
@media (max-width: 700px) { .ws-allflags { columns: 1; } }

.ws-card { background: var(--surface); border: 1px solid var(--canary-deep);
  border-radius: var(--radius); padding: 18px 22px; }
.ws-cardacts { display: flex; gap: 10px; }

/* audience: dreaming hides the deep sheet (refs, flags, formulas) */
.ws-dreaming .b-only { display: none !important; }

@media print {
  body { background: #fff; color: #000; }
  #hero, .ws-devices, .ws-mode, .ws-rail, .ws-cardacts, #foot { display: none !important; }
  .ws-card { border-color: #000; color: #000; background: #fff; }
  .ws-card .muted, .ws-card .body { color: #222; }
}

/* ── the style rail: the firmware's Character ring, on the page ── */
.style-rail { margin: 14px 0 4px; }
.style-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px; margin: 10px 0; }
.style-chip { text-align: left; padding: 9px 11px; border-radius: 10px;
  border: 1px solid #2a2a2a; background: #161616; color: inherit; cursor: pointer; }
.style-chip strong { display: block; font-size: 13.5px; }
.style-chip span { display: block; font-size: 11px; color: #9a9a9a; margin-top: 2px; }
.style-chip:hover { border-color: #3a3a3a; }
/* .on carries no styles: the selection glow is painted inline in the
   chip's own accent (app.js paint()); the class remains as state. */

/* ── Workshop polish: inspect mode, fullscreen, honest empty states ──── */
.ws-fullbtn { position: absolute; right: 10px; top: 10px; background: #000a;
  border: 1px solid var(--edge); border-radius: 10px; color: var(--text);
  font: inherit; font-size: 16px; padding: 4px 10px; cursor: pointer;
  backdrop-filter: blur(4px); }
.ws-fullbtn:hover { border-color: var(--canary); }
.ws-dock { border-top: 1px solid var(--edge); background: #0c0c0c; }
.ws-dockrow { display: flex; align-items: center; gap: 10px; padding: 8px 12px; }
.ws-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.ws-chip { background: #000a; border: 1px solid var(--edge); border-radius: 999px;
  color: var(--muted); font: inherit; font-size: 12px; padding: 3px 11px;
  cursor: pointer; backdrop-filter: blur(4px); }
.ws-chip.on { color: #141414; background: var(--canary); border-color: var(--canary); }
.ws-specs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--muted); padding: 0 12px 9px; }
.ws-spec { background: var(--surface-2); border-radius: 8px; padding: 2px 8px; }
.ws-viewhint { margin: 6px 2px 0; }
.ws-stage:fullscreen { border-radius: 0; display: flex; flex-direction: column; }
.ws-stage:fullscreen .ws-canvas { flex: 1; height: auto; }
.ws-soon { border: 1px dashed var(--canary-deep); border-radius: 12px;
  padding: 12px 16px; margin: 14px 0; background: #17140a; }
.ws-soon p { margin: 0 0 8px; }
.ws-request { color: var(--canary); text-decoration: none; font-size: 13.5px; }
.ws-request:hover { text-decoration: underline; }

/* ── The Board Room: ECAD board viewer + wiring bench ────────────────── */
.br-hero .lede { max-width: 720px; }
.broom { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.broom .pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.broom-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.broom-pads-toggle { font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.broom-stage { position: relative; }
.broom-3d { width: 100%; height: 420px; touch-action: none; border-radius: 14px;
  background: radial-gradient(120% 90% at 50% 20%, #1a1a1e 0%, #0d0d10 70%); display: block; }
.broom-overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.broom-leaders { position: absolute; inset: 0; width: 100%; height: 100%; }
.pin-leader { stroke: #cdb96a; stroke-width: 1; opacity: 0.75; }
.pin-leader.planned { stroke-dasharray: 3 3; opacity: 0.55; }
.pin-leader.minor { stroke: #5d616b; opacity: 0.5; }
.pin-leader.back { opacity: 0.12; }
.pin-flag { position: absolute; left: 0; top: 0; pointer-events: auto; cursor: default;
  font-family: ui-monospace, monospace; font-size: 11px; line-height: 1;
  color: #f2e6b8; background: #16151099; border: 1px solid #cdb96a66;
  border-radius: 7px; padding: 3px 6px; backdrop-filter: blur(3px);
  white-space: nowrap; transition: opacity 120ms; }
.pin-flag.planned { border-style: dashed; color: #cbc3a4; }
.pin-flag.minor { font-size: 10px; color: #9aa0ab; border-color: #5d616b55; padding: 2px 4px; }
.pin-flag.back { opacity: 0.18; }
.pin-flag.on { background: var(--canary); color: #151204; border-color: var(--canary); }
.broom-legend { display: flex; justify-content: flex-end; font-size: 12px;
  color: var(--muted); padding: 4px 4px 8px; }
.broom-info { margin-top: 4px; }
.pin-row.has-flag { cursor: default; }
.pin-row.hi { background: #1d1b12; border-radius: 8px; }
.wire-nav { margin: 8px 0 12px; }
.wire-counter { min-width: 110px; text-align: center; }
.wire-step-card { border: 1px solid var(--edge); border-radius: 12px;
  padding: 10px 14px; margin: 8px 0; cursor: pointer; transition: border-color 120ms; }
.wire-step-card:hover { border-color: #3a3a3a; }
.wire-step-card.on { border-color: var(--canary); background: #141208; }
.wire-step-card h5 { margin: 0 0 4px; font-size: 13.5px; }
.wire-step-card > p { margin: 0 0 6px; font-size: 12.5px; }
.wire-list { display: flex; flex-direction: column; gap: 3px; }
.wire-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; flex-wrap: wrap; }
.wire-chip { width: 14px; height: 5px; border-radius: 3px; align-self: center; flex: none; }
.wire-from { font-weight: 600; color: #e8ddb8; }
.wire-arrow { color: var(--muted); }
.wire-note { font-size: 12px; }
@media (max-width: 560px) { .broom-3d { height: 320px; } }
/* ── the hub (homeassistant.html) ───────────────────────────────────── */
#hub { max-width: 980px; margin: 0 auto 90px; padding: 0 24px; }
.hub-hero .lede { max-width: 680px; }
#hub-versions { margin-top: 18px; }
.hub-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hub-chips .chip { text-transform: none; letter-spacing: 0.2px; font-size: 12px; padding: 4px 12px; }
.hub-chip-k { color: var(--faint); }
.hub-chips strong { color: var(--text); font-weight: 620; }
.hub-fresh { margin-top: 10px; }
.hub-fresh.stale { color: var(--warn); }

.hub-section { margin: 64px 0 0; }
.hub-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--canary-deep); }
.hub-section h2 { font-size: 30px; margin: 6px 0 8px; font-weight: 650; }
.hub-lede { color: #c9c9c9; max-width: 640px; margin: 0 0 18px; }

.hub-why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.hub-why-card { border: 1px solid var(--edge); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2) 0%, #101012 100%); padding: 16px 16px 18px; }
.hub-why-card h3 { margin: 0 0 6px; font-size: 16.5px; }
.hub-why-card p { margin: 0; font-size: 14px; }

.hub-needs { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.hub-need { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); padding: 9px 14px; }
.hub-need strong { font-weight: 620; }
.hub-need .muted { font-size: 13px; flex: 1; min-width: 220px; }
.hub-need-src { text-transform: none; letter-spacing: 0.2px; }
.hub-stage .asmlab-3d { height: 440px; }

/* the bench terminal */
.hub-term { margin-top: 6px; }
.hub-term-tabs { padding-bottom: 10px; }
.hub-term-win { border: 1px solid #2c2c2e; border-radius: 14px; overflow: hidden;
  background: #0a0a0c; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5); outline: none; }
.hub-term-win:focus-visible { border-color: rgba(255, 212, 79, 0.5); }
.hub-term-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #141416; border-bottom: 1px solid #232325; }
.hub-term-dots { display: inline-flex; gap: 5px; }
.hub-term-dots i { width: 10px; height: 10px; border-radius: 50%; background: #333; display: inline-block; }
.hub-term-dots i:first-child { background: #5a3d3d; }
.hub-term-dots i:nth-child(2) { background: #5a533d; }
.hub-term-dots i:nth-child(3) { background: #3d5a44; }
.hub-term-title { color: var(--muted); font-size: 12.5px; }
.hub-term-sim { margin-left: auto; color: var(--faint); font-size: 11px; }
.hub-term-scroll { height: 300px; overflow-y: auto; padding: 12px 14px;
  font: 13px/1.55 "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.hub-line { white-space: pre-wrap; word-break: break-word; color: #d8d8d8; }
.hub-prompt { color: var(--canary); }
.hub-cmd { color: #f0f0f0; }
.hub-caret { color: var(--canary); animation: hub-blink 1s steps(1) infinite; }
@keyframes hub-blink { 50% { opacity: 0; } }
.hub-out { color: #9fb2a4; }
.hub-intro, .hub-replay { color: var(--faint); }
.hub-done { color: var(--ok); margin-top: 4px; }
.hub-term-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-top: 1px solid #232325; background: #101012; }
.hub-term-controls .primary { font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; }
.hub-term-note { margin-top: 10px; min-height: 2.4em; }
/* one-tap copy — always visible (mobile has no hover), comfortable tap target */
.hub-copy { margin-left: 8px; padding: 2px 9px; min-width: 34px; min-height: 24px;
  border: 1px solid #2c2c2e; border-radius: 7px; background: #17171a; color: #9a9aa2;
  font: 12px/1.4 "SF Mono", ui-monospace, Menlo, monospace; cursor: pointer;
  vertical-align: baseline; transition: color 0.15s, border-color 0.15s; }
.hub-copy:hover, .hub-copy:focus-visible { color: var(--canary); border-color: rgba(255, 212, 79, 0.5); }
.hub-copy.copied { color: var(--ok); border-color: var(--ok); }
@media (pointer: coarse) { .hub-copy { min-width: 44px; min-height: 32px; font-size: 13px; } }

/* the Home Assistant sketch */
.hub-ha { position: relative; margin-top: 6px; }
.hub-ha-chrome { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: #141416; border: 1px solid #2c2c2e; border-bottom: none; border-radius: 14px 14px 0 0; }
.hub-ha-url { background: #0a0a0c; border: 1px solid #232325; color: var(--muted);
  font-size: 12px; border-radius: 8px; padding: 3px 12px; flex: 1; max-width: 420px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-ha-app { display: flex; min-height: 460px; border: 1px solid #2c2c2e; border-radius: 0 0 14px 14px;
  overflow: hidden; background: #111318; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5); }
.hub-ha-side { width: 148px; flex: 0 0 auto; background: #0d0f13; border-right: 1px solid #1d2027; padding: 10px 8px; }
.hub-ha-nav { display: flex; align-items: center; gap: 9px; color: #9aa0aa; font-size: 13px;
  padding: 7px 10px; border-radius: 9px; }
.hub-ha-nav.on { background: rgba(3, 169, 244, 0.14); color: #e8f4fb; }
.hub-ha-glyph { width: 18px; text-align: center; }
.hub-ha-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-ha-top { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px;
  background: var(--signed); color: #08222e; }
.hub-ha-title { font-weight: 650; font-size: 15px; }
.hub-ha-ver { margin-left: auto; font-size: 12px; opacity: 0.75; }
.hub-ha-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; padding: 14px; overflow-y: auto; }
.hub-ha-card { background: #171a20; border: 1px solid #232833; border-radius: 12px; padding: 12px 14px; min-width: 0; }
.hub-ha-card h4 { margin: 0 0 8px; font-size: 13.5px; color: #dfe3ea; }
.hub-ha-wait { color: #7c8492; font-size: 12px; margin: 0 0 8px; font-family: ui-monospace, Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-ha-rows { display: flex; flex-direction: column; }
.hub-ha-row { display: flex; align-items: center; gap: 10px; padding: 6px 2px;
  border-top: 1px solid #1e232d; font-size: 13px; color: #c8cdd6;
  transition: background 0.5s, opacity 0.4s, transform 0.4s; flex-wrap: wrap; }
.hub-ha-row.landing { opacity: 0; transform: translateY(6px); }
.hub-ha-row.alert { background: rgba(229, 57, 53, 0.12); }
.hub-ha-row.alert .hub-ha-value { color: #ff8a80; font-weight: 650; }
.hub-ha-icon { width: 20px; text-align: center; flex: 0 0 auto; }
.hub-ha-name { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hub-ha-desc { color: #69707c; font-size: 11px; }
.hub-ha-value { margin-left: auto; color: #e8ecf2; font-variant-numeric: tabular-nums; }
.hub-ha-row.has-attrs { cursor: pointer; }
.hub-ha-attrs { display: none; width: 100%; padding: 2px 0 4px 30px; }
.hub-ha-row.open .hub-ha-attrs { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-ha-attrs code { background: #0d0f13; color: #8fd0f0; font-size: 11px; }
.hub-ha-switch { appearance: none; width: 38px; height: 21px; border-radius: 999px; border: 1px solid #39404d;
  background: #232833; position: relative; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.hub-ha-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #9aa0aa; transition: transform 0.2s, background 0.2s; }
.hub-ha-switch.on { background: rgba(3, 169, 244, 0.35); border-color: var(--signed); }
.hub-ha-switch.on::after { transform: translateX(17px); background: var(--signed); }
.hub-ha-chain { font-size: 12px; color: var(--signed); margin: 0 0 8px; font-family: ui-monospace, Menlo, monospace; }
.hub-ha-tl { display: flex; flex-direction: column; }
.hub-ha-tlrow { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; color: #c8cdd6;
  padding: 5px 0; border-top: 1px solid #1e232d; }
.hub-ha-tlrow.warn .hub-ha-tltext { color: #ffcf86; }
.hub-ha-tlrow.alert .hub-ha-tltext { color: #ff8a80; }
.hub-ha-tltime { color: #69707c; font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.hub-ha-tltext { flex: 1; min-width: 0; }
.hub-ha-tlsig { color: var(--signed); font-size: 11px; flex: 0 0 auto; }
.hub-ha-auto { font-size: 12.5px; border-radius: 8px; padding: 5px 10px; display: inline-block; }
.hub-ha-auto.idle { background: #1e232d; color: #9aa0aa; }
.hub-ha-auto.firing { background: rgba(229, 57, 53, 0.18); color: #ff8a80; }
.hub-ha-trace { margin: 8px 0; display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: #9fb2a4; font-family: ui-monospace, Menlo, monospace; }
.hub-ha-drill { margin-top: 4px; }
.hub-ha-toast { position: absolute; top: 100px; right: 22px; width: min(300px, 74%);
  background: #1c1f26; border: 1px solid #39414f; border-radius: 14px; padding: 10px 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.75);
  opacity: 0; transform: translateY(-12px); pointer-events: none;
  transition: opacity 0.3s, transform 0.3s; z-index: 5; }
.hub-ha-toast.show { opacity: 1; transform: translateY(0); }
.hub-ha-toast-app { color: #8a909a; font-size: 11px; margin-bottom: 3px; }
.hub-ha-toast-title { font-weight: 650; font-size: 13.5px; color: #f0f2f5; }
.hub-ha-toast-body { font-size: 12.5px; color: #b9bec7; margin-top: 2px; }
.hub-ha-note { margin-top: 12px; }

.hub-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.hub-link { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--edge);
  border-radius: 14px; background: var(--surface); padding: 13px 15px; color: inherit; }
.hub-link:hover { text-decoration: none; border-color: rgba(255, 212, 79, 0.45); }
.hub-link strong { color: var(--canary); font-weight: 620; }
.hub-link .muted { font-size: 13px; }
.hub-link code { background: transparent; padding: 0; color: var(--faint); }

@media (max-width: 640px) {
  .hub-ha-side { display: none; }
  .hub-term-sim { display: none; }
}

/* ── the Bench: power plane, straps, hardwired lights ── */
.glass-holder { position: relative; display: inline-block; max-width: 100%; }
.glass-shade {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(4, 4, 4, 0.88); border: 1px solid #222; color: var(--faint);
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  pointer-events: none;
}
.glass-shade.round { border-radius: 50%; }
.glass-shade.on { display: flex; }

.bench-ribbon {
  border: 1px solid var(--edge); border-left: 3px solid var(--canary);
  background: var(--surface); border-radius: 10px; padding: 9px 12px;
  color: var(--muted); font-size: 13px;
}

.bench-leds { display: flex; gap: 22px; align-items: flex-end; padding: 14px 4px 4px; }
.bench-led { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bench-led-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #241414; border: 1px solid #333;
  transition: background 0.12s, box-shadow 0.12s;
}
.bench-led-dot.led-red.on { background: var(--alert); box-shadow: 0 0 14px 3px rgba(229, 57, 53, 0.6); }
.bench-led-dot.led-amber { background: #262014; }
.bench-led-dot.led-amber.on { background: var(--canary); box-shadow: 0 0 14px 3px rgba(255, 212, 79, 0.55); }
.bench-led-dot.flicker { animation: bench-flicker 0.9s steps(2, jump-none) infinite; }
@keyframes bench-flicker {
  0% { background: var(--canary); box-shadow: 0 0 12px 2px rgba(255, 212, 79, 0.5); }
  50% { background: #262014; box-shadow: none; }
  100% { background: var(--canary); box-shadow: 0 0 12px 2px rgba(255, 212, 79, 0.5); }
}
.bench-led-label { font-size: 10.5px; letter-spacing: 0.12em; color: var(--muted); }
.bench-cap { color: var(--faint); font-size: 12px; margin: 4px 0 0; }

.bench-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: stretch; }
.bench-chip {
  appearance: none; cursor: pointer; text-align: left;
  border: 1px solid var(--edge); border-radius: 10px;
  background: var(--surface); color: var(--text); padding: 8px 12px; min-width: 110px;
}
.bench-chip strong { display: block; font-size: 12.5px; }
.bench-chip .bench-chip-state { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.bench-chip.on { border-color: var(--canary-deep); }
.bench-chip.on .bench-chip-state { color: var(--canary); }
.bench-chip:hover { border-color: #3a3a3a; }
.bench-chip.on:hover { border-color: var(--canary); }
.bench-momentary:active, .bench-momentary.pressed { transform: translateY(1px); border-color: var(--canary); }
.bench-switch.on { box-shadow: inset 0 0 0 1px var(--canary-deep); }
.bench-soc { height: 4px; border-radius: 2px; background: #262626; margin-top: 6px; overflow: hidden; }
.bench-soc-fill { height: 100%; background: var(--ok); transition: width 0.3s; }
.bench-soc-fill.low { background: var(--alert); }
.bench-ff { align-self: center; }
.bench-ff.on { color: var(--canary); border-color: var(--canary-deep); }
button.ghost.small.bench-ff { font-size: 12px; }

.bench-diag {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 16px;
  border: 1px solid var(--edge); border-radius: 12px; background: var(--surface);
  padding: 12px 14px; margin: 16px 0 0; font-size: 13px;
}
.bench-diag dt { color: var(--muted); }
.bench-diag dd { margin: 0; font-variant-numeric: tabular-nums; }

.bench-trouble { margin-top: 16px; }
.bench-trouble > summary { cursor: pointer; color: var(--canary); font-size: 14px; padding: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  .bench-led-dot.flicker { animation: none; background: var(--canary); opacity: 0.55; }
}

/* ======================================================================== *
 *  The WAP bench (wap.html) — first-boot, captive portal, serial, MQTT.
 *  Reuses .hub-term-*, .hub-ha-chrome, .card, .chip, .tab, .ondevice.
 * ======================================================================== */

.wap-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.wap-two-col { min-width: 0; }
.wap-col-h { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: 0.06em; }
.wap-note { margin-top: 12px; min-height: 1.5em; }

/* ── serial console ── */
.wap-term { border: 1px solid #2c2c2e; border-radius: 14px; overflow: hidden;
  background: #08080a; box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5); }
.wap-term-scroll { height: 340px; overflow-y: auto; padding: 12px 14px; white-space: pre;
  font: 12px/1.5 "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.wap-line { white-space: pre-wrap; word-break: break-word; color: #c9d1cb; }
.wap-b { color: #8a94a6; }                    /* banner / box art */
.wap-ok { color: var(--ok); }
.wap-warn { color: var(--warn); }
.wap-faint { color: var(--faint); }
.wap-net { color: var(--signed); }            /* [WIFI] / [MQTT] */
.wap-prov { color: var(--canary-deep); }      /* [PROV] */
.wap-tbl { color: #93a7b6; }

/* ── the phone ── */
.wap-phone-wrap { display: flex; flex-direction: column; align-items: center; }
.wap-phone { width: 300px; max-width: 100%; border-radius: 34px; padding: 10px;
  background: linear-gradient(160deg, #1c1c1f, #0c0c0e); border: 1px solid #2c2c2e;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8), inset 0 0 0 2px #000; }
.wap-phone-status { display: flex; justify-content: space-between; align-items: center;
  padding: 4px 14px 8px; font-size: 11px; color: #cfcfcf; }
.wap-phone-net { color: var(--canary); }
.wap-phone-screen { height: 500px; border-radius: 26px; overflow: hidden; background: #0b0d10;
  border: 1px solid #000; display: flex; flex-direction: column; }
.wap-screen { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.wap-screen-wait { align-items: center; justify-content: center; text-align: center; gap: 14px; }
.wap-big { font-size: 44px; opacity: 0.5; }
.wap-ios-title { font-size: 22px; font-weight: 700; color: #f0f2f5; margin: 2px 0 6px; }
.wap-wifi-list { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09); }
.wap-wifi-row { display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: rgba(255, 255, 255, 0.04); border: none; color: #eef1f5;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 14px; text-align: left; cursor: pointer; }
.wap-wifi-row:last-child { border-bottom: none; }
.wap-wifi-own { background: rgba(124, 220, 255, 0.14); color: #cfefff; font-weight: 600; }
.wap-wifi-own:hover { background: rgba(124, 220, 255, 0.22); }
.wap-wifi-dim { color: #8a919c; cursor: default; }
.wap-wifi-meta { font-size: 12px; opacity: 0.8; }

.wap-screen-browser { padding: 0; }
.wap-browser-chrome { display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: #17191d; border-bottom: 1px solid #000; font: 12px ui-monospace, Menlo, monospace; }
.wap-browser-lock { color: var(--ok); font-size: 11px; }
.wap-browser-url { color: #c7ccd3; }
.wap-captive-head { padding: 10px 14px; font-size: 12px; color: #9aa2ad;
  background: #101216; border-bottom: 1px solid #000; }
.wap-captive-frame { width: 100%; height: 330px; border: 0; background: #0b0d10; }
.wap-captive-go { margin: 12px 14px; }

/* wizard */
.wap-wiz { padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.wap-wiz-prog { display: flex; gap: 6px; margin-bottom: 4px; }
.wap-wiz-dot { flex: 1; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.wap-wiz-dot.on { background: var(--canary); }
.wap-wiz-h { margin: 0; font-size: 17px; color: #f2f4f7; }
.wap-wiz-sub { margin: 0; font-size: 13px; }
.wap-wiz-go { align-self: stretch; }
.wap-wiz-nets { display: flex; flex-direction: column; gap: 6px; }
.wap-wiz-net { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px;
  color: #eef1f5; font-size: 14px; cursor: pointer; }
.wap-wiz-net:hover { background: rgba(255, 255, 255, 0.09); }
.wap-wiz-btns { display: flex; gap: 8px; }
.wap-wiz-btns .primary, .wap-wiz-btns .ghost { flex: 1; }
.wap-input { width: 100%; padding: 11px 13px; border-radius: 10px; background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14); color: #f0f2f5; font-size: 14px; }
.wap-chip { align-self: flex-start; }
.wap-spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--canary); animation: wap-spin 0.8s linear infinite; }
@keyframes wap-spin { to { transform: rotate(360deg); } }
.wap-wiz-done { align-items: flex-start; }
.wap-check { width: 40px; height: 40px; border-radius: 50%; background: rgba(67, 160, 71, 0.18);
  color: var(--ok); font-size: 22px; display: flex; align-items: center; justify-content: center; }
.wap-ha-block { margin-top: 6px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 10px; width: 100%; }
.wap-ha-block h5 { margin: 0; font-size: 13px; color: #dfe3e8; }
.wap-preflight { margin-top: 6px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03); width: 100%; }
.wap-preflight h5 { margin: 0 0 8px; font-size: 13px; color: #dfe3e8; }
.wap-checks { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.wap-check-row { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #cdd3da; }
.wap-check-ok { color: var(--ok); font-weight: 700; }

/* ── facts strip ── */
.wap-facts { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.wap-fact { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--edge); font-size: 13px; }
.wap-fact-k { flex: none; width: 76px; color: var(--canary); font-weight: 600; }
.wap-fact-v { color: var(--text); font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

/* ── dashboard sketch ── */
.wap-dash { border: 1px solid #2c2c2e; border-radius: 14px; overflow: hidden; background: #0c0e12; }
.wap-dash-app { padding: 0; }
.wap-dash-tabs { padding: 10px 12px 0; }
.wap-dash-body { padding: 16px; min-height: 260px; }
.wap-pill { display: inline-block; padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 18px;
  border: 1px solid transparent; }
.wap-pill-off { background: #1a1c20; color: #7c8492; border-color: #2a2d33; }
.wap-pill-quiet { background: rgba(3, 169, 244, 0.14); color: #67c7f5; border-color: rgba(3, 169, 244, 0.35); }
.wap-pill-presence { background: rgba(67, 160, 71, 0.16); color: #6bd06f; border-color: rgba(67, 160, 71, 0.4); }
.wap-pill-motion { background: rgba(251, 140, 0, 0.16); color: #ffb04d; border-color: rgba(251, 140, 0, 0.4); }
.wap-pill-active { background: rgba(229, 57, 53, 0.16); color: #ff7a76; border-color: rgba(229, 57, 53, 0.4); }
.wap-gauges { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.wap-gauge { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; }
.wap-gauge-k { font-size: 12px; color: var(--muted); }
.wap-gauge-bar { height: 8px; border-radius: 5px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.wap-gauge-fill { height: 100%; width: 8%; border-radius: 5px; background: var(--canary);
  transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.wap-spectrum { display: flex; align-items: flex-end; gap: 4px; height: 60px; margin-top: 6px; }
.wap-spectrum i { flex: 1; background: linear-gradient(var(--canary), var(--canary-deep)); border-radius: 3px 3px 0 0;
  height: 8%; transition: height 0.35s ease; }
.wap-ac-card { padding: 14px; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface-2); }
.wap-ac-pill { font-weight: 700; margin-bottom: 8px; color: var(--ok); }
.wap-ac-card.alarm { border-color: var(--alert); background: rgba(229, 57, 53, 0.12); }
.wap-ac-card.alarm .wap-ac-pill { color: #ff7a76; }
.wap-ac-card.muted .wap-ac-pill { color: var(--muted); }

/* ── MQTT explorer ── */
.wap-mqtt { border: 1px solid #2c2c2e; border-radius: 14px; overflow: hidden; background: #08080a; }
.wap-mqtt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #1a1a1c; }
.wap-mqtt-col { background: #0a0a0c; padding: 10px 12px; min-width: 0; }
.wap-mqtt-h { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted);
  margin-bottom: 8px; }
.wap-mqtt-tree, .wap-mqtt-stream { display: flex; flex-direction: column; gap: 5px; min-height: 150px; }
.wap-mqtt-row, .wap-mqtt-ev { display: flex; flex-direction: column; gap: 2px; padding: 5px 7px;
  border-radius: 7px; background: rgba(255, 255, 255, 0.03); }
.wap-mqtt-ev.live { border-left: 2px solid var(--signed); }
.wap-mqtt-ev.disc { border-left: 2px solid var(--ok); }
.wap-mqtt-topic { font: 11px ui-monospace, Menlo, monospace; color: var(--canary); word-break: break-all; }
.wap-mqtt-payload { font: 11px ui-monospace, Menlo, monospace; color: #9fb2a4; word-break: break-all; }
.wap-mqtt-disc { margin: 0; border-top: 1px solid #1a1a1c; }
.wap-mqtt-disc > summary { cursor: pointer; padding: 10px 14px; color: var(--signed); font-size: 12.5px; }
.wap-mqtt-ents { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 12px 12px; }
.wap-ent { display: flex; flex-direction: column; gap: 1px; padding: 5px 7px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.03); }
.wap-ent-comp { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.wap-ent-name { font-size: 12px; color: var(--text); }
.wap-ent-topic { font: 9.5px ui-monospace, Menlo, monospace; color: #6f8a99; word-break: break-all; }

/* ── sandbox ── */
.wap-sandbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.wap-sand-card { display: flex; flex-direction: column; gap: 5px; text-align: left; cursor: pointer;
  align-items: flex-start; transition: transform 0.12s ease, border-color 0.12s ease; }
.wap-sand-card:hover { transform: translateY(-2px); border-color: var(--canary-deep); }
.wap-sand-card strong { color: var(--text); }
.wap-sand-ha { color: var(--signed); }
.wap-sandbox-read { margin-top: 14px; min-height: 1.4em; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

@media (max-width: 720px) {
  .wap-two, .wap-facts, .wap-mqtt-cols, .wap-mqtt-ents { grid-template-columns: 1fr; }
  .wap-mqtt-cols { gap: 10px; background: transparent; }
}

/* the Get Started guide (start.html) */
.start-picker { margin-top: 6px; }
.start-missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 12px; }
.start-mission { display: flex; align-items: flex-start; gap: 12px; text-align: left;
  background: #141416; border: 1px solid #2c2c2e; border-radius: 14px; padding: 14px 16px;
  color: inherit; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.start-mission:hover, .start-mission:focus-visible { border-color: rgba(255, 212, 79, 0.5); transform: translateY(-2px); }
.start-mission.on { border-color: var(--canary); }
.start-glyph { font-size: 24px; line-height: 1.2; }
.start-mission-body { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.start-mission-body strong { font-size: 14.5px; }
.start-meta { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.start-osrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.start-osrow .tab { min-height: 36px; }
@media (pointer: coarse) { .start-osrow .tab { min-height: 44px; } }
.start-bar { height: 8px; border-radius: 999px; background: #232325; overflow: hidden; margin-top: 12px; }
.start-bar-fill { height: 100%; width: 0; border-radius: 999px; background: var(--canary); transition: width 0.4s; }
.start-score { margin: 6px 0 0; font-size: 13px; display: inline-block; }
.start-bird { font-size: 20px; margin-left: 8px; vertical-align: middle; }
.start-chapter h3 { margin-bottom: 4px; }
.start-step { background: #101012; border: 1px solid #232325; border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.start-step.done { border-color: rgba(74, 222, 128, 0.35); }
.start-step.done > .start-step-row h4 { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(74, 222, 128, 0.5); }
.start-step-row { display: flex; align-items: center; gap: 10px; }
.start-step-row h4 { margin: 0; font-size: 14.5px; flex: 1; }
.start-check { width: 26px; height: 26px; min-width: 26px; border-radius: 8px; border: 1px solid #2c2c2e;
  background: #17171a; color: var(--ok); font-size: 14px; cursor: pointer; }
.start-check.on { border-color: var(--ok); background: rgba(74, 222, 128, 0.12); }
@media (pointer: coarse) { .start-check { width: 34px; height: 34px; min-width: 34px; } }
.start-bullet { margin: 8px 0 0; font-size: 13.5px; }
.start-danger { margin: 8px 0 0; font-size: 13px; color: #f0b429; }
.start-cmd { background: #0a0a0c; border: 1px solid #232325; border-radius: 10px; padding: 8px 12px; margin-top: 8px;
  font: 13px/1.55 "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; }
.start-cmd-note { margin: 4px 0 0; }
.start-expect { margin-top: 4px; }
.start-expect summary { cursor: pointer; color: var(--faint); font-size: 12px; }
.start-doc { margin-left: auto; white-space: nowrap; }
.start-link { display: inline-block; margin: 8px 12px 0 0; font-size: 13.5px; }
.start-note { margin-top: 10px; }
@media (max-width: 560px) {
  .start-doc { margin-left: 0; }
  .start-step-row { flex-wrap: wrap; }
}
/* copy → gate feedback */
.start-check.pulse { animation: start-pulse 0.9s ease 2; }
@keyframes start-pulse {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 5px rgba(255, 212, 79, 0.35); border-color: var(--canary); }
}
.start-live { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 8px);
  background: #141416; border: 1px solid var(--canary); border-radius: 999px;
  color: #f0f0f0; font-size: 13px; padding: 8px 18px; opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; z-index: 40; max-width: min(92vw, 480px); text-align: center; }
.start-live.show { opacity: 1; transform: translate(-50%, 0); }
.start-resume { display: flex; align-items: center; gap: 12px; margin-top: 14px;
  background: rgba(255, 212, 79, 0.06); border: 1px solid rgba(255, 212, 79, 0.35);
  border-radius: 14px; padding: 12px 16px; flex-wrap: wrap; }
.start-resume .start-mission-body { flex: 1; min-width: 180px; }
.start-complete { text-align: center; border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 14px; background: rgba(74, 222, 128, 0.05); padding: 22px 18px; }
.start-complete-bird { font-size: 34px; animation: start-hatch 0.7s ease; }
@keyframes start-hatch { 0% { transform: scale(0.4) rotate(-14deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.start-complete-row { display: flex; gap: 14px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .start-check.pulse, .start-complete-bird { animation: none; }
  .start-bar-fill { transition: none; }
}

/* ======================================================================== *
 *  The Vault explainer (vault.html) — vault · sealed · quorum.
 *  Reuses .hub-section, .hub-chips, .chip, .ondevice, .hub-term-*, .hub-links.
 * ======================================================================== */

.vault-concepts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.vault-concept { padding: 18px; border-radius: var(--radius); border: 1px solid var(--edge);
  background: var(--surface); border-top: 3px solid var(--canary-deep); }
.vault-concept h3 { margin: 0 0 8px; color: var(--canary); }

.vault-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; margin-top: 16px; }
.vault-two-col { min-width: 0; }
.vault-col-h { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 10px;
  text-transform: uppercase; letter-spacing: 0.06em; }
.vault-note { margin-top: 12px; }
.vault-off { margin-bottom: 8px; }

/* fail-closed decision table */
.vault-decisions { display: flex; flex-direction: column; border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; }
.vault-decision { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 12px; border-bottom: 1px solid var(--edge); font-size: 13px; }
.vault-decision:last-child { border-bottom: none; }
.vault-decision.cap { background: rgba(67, 160, 71, 0.08); }
.vault-cond { color: var(--text); }
.vault-dec { font: 11px ui-monospace, Menlo, monospace; color: var(--muted); white-space: nowrap; }
.vault-decision.cap .vault-dec { color: var(--ok); }

.vault-facts { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.vault-fact { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--edge); font-size: 13px; }
.vault-fact-k { flex: none; width: 84px; color: var(--canary); font-weight: 600; }
.vault-fact-v { color: var(--muted); }

/* seal walkthrough */
.vault-seal { margin-top: 8px; }
.vault-steps { display: flex; flex-direction: column; gap: 8px; }
.vault-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--edge); background: var(--surface); opacity: 0.5; transition: opacity 0.3s, border-color 0.3s; }
.vault-step.on { opacity: 1; border-color: var(--canary-deep); background: var(--surface-2); }
.vault-step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--canary);
  color: #000; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.vault-step-b { display: flex; flex-direction: column; gap: 2px; }
.vault-step-b strong { color: var(--text); }
.vault-derived { font: 11px ui-monospace, Menlo, monospace; color: var(--signed); }

.vault-hdr { margin-top: 16px; padding: 14px; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface); }
.vault-hdr-h { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.vault-hdr-table { display: flex; flex-direction: column; gap: 3px; }
.vault-hdr-cell { display: grid; grid-template-columns: 44px 34px 1fr; gap: 8px; align-items: center;
  padding: 5px 8px; border-radius: 7px; background: rgba(255, 255, 255, 0.03); font-size: 12px; }
.vault-hdr-off { color: var(--canary); font: 11px ui-monospace, Menlo, monospace; }
.vault-hdr-size { color: var(--muted); font: 11px ui-monospace, Menlo, monospace; }
.vault-hdr-field { color: var(--text); }
.vault-tamper { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vault-tamper-out { font-size: 12px; }
.vault-tamper.bad .vault-hdr-cell { }
.vault-tamper-out.bad { color: var(--alert); }

.vault-kernel { margin-top: 20px; padding: 16px; border-radius: var(--radius); border: 1px solid var(--edge);
  background: var(--surface); }
.vault-kernel .hub-chips { margin: 12px 0; }

/* quorum demo */
.vault-quorum { margin-top: 8px; }
.vault-evidence { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 14px;
  border: 1px solid var(--edge); background: var(--surface); transition: all 0.4s; }
.vault-evidence.sealed { border-color: var(--signed); background: rgba(3, 169, 244, 0.06); }
.vault-evidence.open { border-color: var(--ok); background: rgba(67, 160, 71, 0.1); }
.vault-evidence-icon { font-size: 34px; }
.vault-evidence-label { font: 13px ui-monospace, Menlo, monospace; color: var(--text); }
.vault-q-status { margin: 14px 0 6px; }
.vault-q-bar { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.vault-q-fill { height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--signed), var(--ok));
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.vault-q-count { display: inline-block; margin-top: 6px; font: 13px ui-monospace, Menlo, monospace; color: var(--muted); }
.vault-trustees { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.vault-trustee { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--edge); background: var(--surface); }
.vault-trustee-name { font-weight: 600; color: var(--text); min-width: 110px; }
.vault-trustee-key { font: 11px ui-monospace, Menlo, monospace; flex: 1; }
.vault-approve { background: var(--canary); color: #000; border: none; border-radius: 8px; padding: 6px 14px;
  font-weight: 600; cursor: pointer; }
.vault-approve:disabled { opacity: 0.4; cursor: default; }
.vault-approve.done { background: transparent; color: var(--ok); border: 1px solid var(--ok); }
.vault-q-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.vault-unseal { }
.vault-unseal:disabled { opacity: 0.45; cursor: default; }
.vault-receipts { border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; }
.vault-receipts-h { padding: 8px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--edge); }
.vault-receipts-rows { display: flex; flex-direction: column; min-height: 40px; }
.vault-receipt { display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 12px;
  border-bottom: 1px solid var(--edge); }
.vault-receipt:last-child { border-bottom: none; }
.vault-receipt-o { font-weight: 700; font-size: 11px; padding: 1px 7px; border-radius: 5px; }
.vault-receipt.ok .vault-receipt-o { color: var(--ok); background: rgba(67, 160, 71, 0.14); }
.vault-receipt.deny .vault-receipt-o { color: var(--alert); background: rgba(229, 57, 53, 0.14); }
.vault-receipt-d { flex: 1; color: var(--muted); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
.vault-receipt-sig { color: var(--signed); font-size: 11px; }

.vault-guards { margin-top: 20px; }
.vault-guard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.vault-guard { padding: 14px; border-radius: 12px; border: 1px solid var(--edge); background: var(--surface);
  display: flex; flex-direction: column; gap: 5px; }
.vault-guard strong { color: var(--text); }

/* operator routes */
.vault-routes { display: flex; flex-direction: column; gap: 4px; }
.vault-route { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.03); }
.vault-m { font: 10.5px ui-monospace, Menlo, monospace; color: var(--canary); min-width: 82px; text-transform: uppercase; }
.vault-p { font: 11.5px ui-monospace, Menlo, monospace; color: var(--text); word-break: break-all; }

/* invariants */
.vault-invariants { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.vault-invariant { padding: 18px; border-radius: var(--radius); border: 1px solid var(--edge);
  background: var(--surface); border-left: 3px solid var(--canary); }
.vault-inv-id { font: 11px ui-monospace, Menlo, monospace; color: var(--canary); text-transform: uppercase; letter-spacing: 0.06em; }
.vault-invariant h4 { margin: 6px 0 8px; color: var(--text); }

@media (max-width: 760px) {
  .vault-concepts, .vault-two, .vault-invariants { grid-template-columns: 1fr; }
}

/* Kept at end of file: must win the cascade over every canvas rule above
   (.ws-canvas and .broom-3d re-declare touch-action:none at equal
   specificity later in the file than the sheet rules do). */
@media (pointer: coarse) {
  /* touch-action:none on the interactive canvases makes scrolling
     impossible when a finger lands on them — and on a phone they are most
     of the sheet. pan-y hands vertical pans back to the browser (the
     pointer handlers already recover via pointercancel/lostpointercapture);
     horizontal drags still orbit, taps and long-presses still land, and
     two-finger pinch still zooms the 3D scenes. */
  .card-3d, .stage-3d, .glass, .enclab-3d, .boardlab-3d, .asmlab-3d,
  .ws-canvas, .broom-3d { touch-action: pan-y; }
}

/* concept cards: coming-soon wears teal, dashed — never mistakable for shipped */
.chip-soon { border-color: rgba(111, 214, 195, 0.55); border-style: dashed; color: #6fd6c3; }
.concept-plan { margin: 8px 0 0 18px; padding: 0; }
.concept-plan li { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }

/* ── WAP: plug it in (the 3D device + the laptop/wall choice) ─────────── */
.wap-plug { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; align-items: stretch; margin-bottom: 22px; }
.wap-plug-stage { position: relative; border-radius: 14px; background: radial-gradient(120% 100% at 50% 0%, #191817 0%, #121110 60%, #0d0c0b 100%); border: 1px solid rgba(255,255,255,0.06); min-height: 280px; }
.wap-plug-3d { width: 100%; height: 100%; min-height: 280px; display: block; touch-action: none; }
/* this rule lands after the global coarse-pointer pan-y override, so it
   needs its own — a phone finger must still scroll past the 3D card */
@media (pointer: coarse) { .wap-plug-3d { touch-action: pan-y; } }
.wap-plug-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.wap-plug-card { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: #16151055; cursor: pointer; transition: border-color .15s, background .15s; }
.wap-plug-card:hover { border-color: rgba(255, 212, 79, 0.4); }
.wap-plug-card.on { border-color: var(--canary); background: rgba(255, 212, 79, 0.07); }
.wap-plug-card .muted { font-size: 12.5px; }
.wap-plug-card strong { color: #f0eee6; font-size: 14.5px; }
.wap-plug-icon { font-size: 20px; }
.wap-plug-verdict { min-height: 2.4em; margin-top: 8px; }

/* wall power: the console lines happen — to nobody */
.wap-term-ghost .wap-term-scroll { opacity: 0.55; }
.wap-term-ghost .hub-term-title::after { content: "  ·  nobody listening"; color: var(--muted); font-weight: 400; }

/* ── WAP: flashing — buttons, ritual, toolchains, trainer ─────────────── */
.wap-flash .wap-col-h { margin-top: 22px; }
.wap-flash-h { margin: 4px 0 8px; font-size: 14.5px; }
.wap-btn-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wap-btn-card { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px 14px; background: #16151055; }
.wap-btn-card .muted { font-size: 12.5px; }
.wap-btn-chip { display: inline-block; font: 700 12px ui-monospace, monospace; letter-spacing: 0.08em; color: #141414; background: var(--canary); border-radius: 6px; padding: 3px 9px; margin-bottom: 6px; }
.wap-btn-gestures { margin: 6px 0 0 16px; padding: 0; }
.wap-btn-gestures li { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.wap-ritual { margin: 6px 0 8px 18px; padding: 0; }
.wap-ritual li { font-size: 13px; margin-bottom: 6px; }
.wap-prereqs a { color: var(--canary); }
.wap-cmds { font: 12.5px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; background: #0c0b0a; border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 10px 14px; margin: 10px 0; overflow-x: auto; }
.wap-cmd { color: #e6e2d8; white-space: pre; }
.wap-cmd-note { color: #6f6a60; white-space: pre; }
.wap-url { display: block; font-size: 11.5px; word-break: break-all; background: #0c0b0a; border-radius: 8px; padding: 6px 10px; margin: 6px 0; }
.wap-tool-panel { margin-top: 10px; }
.wap-boardcfg { margin-top: 8px; }
.wap-trouble details { margin-bottom: 8px; }

/* the strap trainer */
.wap-bench { border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px; background: #131210; }
.wap-bench-row { display: flex; gap: 8px; flex-wrap: wrap; }
.wap-bench-status { font-size: 12.5px; color: var(--canary); margin: 8px 0 6px; min-height: 1.2em; }
.wap-bench-console { font: 11.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #b9b4a8; background: #0c0b0a; border-radius: 8px; padding: 8px 10px; min-height: 108px; max-height: 150px; overflow-y: auto; white-space: pre-wrap; margin: 0; }

@media (max-width: 760px) {
  .wap-plug, .wap-btn-cards, .wap-plug-choices { grid-template-columns: 1fr; }
  .wap-plug-stage { min-height: 220px; }
}

/* ── The Vision page (vision.html) ─────────────────────────────────────── */

/* the two-port picker */
.vis-ports { display: grid; grid-template-columns: minmax(260px, 1fr) 1.2fr; gap: 22px; align-items: start; }
.vis-ports-diagram { position: sticky; top: 16px; }
.vis-mod { position: relative; border: 2px solid #3a4150; border-radius: 16px; background: #14171c;
  padding: 18px 18px 16px; min-height: 250px; }
.vis-mod-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.vis-mod-cam { position: absolute; top: 52px; left: 18px; font-size: 11px; color: var(--faint);
  border: 1px dashed #3a4150; border-radius: 8px; padding: 4px 8px; }
.vis-mod-grove { position: absolute; top: 96px; left: 18px; font-size: 11px; color: var(--faint);
  border: 1px dashed #3a4150; border-radius: 8px; padding: 4px 8px; }
.vis-xiao { position: relative; margin: 66px 12px 8px 44%; border: 2px solid #2f3a33; border-radius: 12px;
  background: #101512; padding: 12px 12px 34px; }
.vis-xiao-label { font-size: 11px; color: var(--muted); }
.vis-port { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 1px;
  border: 2px solid #4a5262; border-radius: 8px; background: #1c2027; color: var(--text);
  padding: 5px 10px; cursor: pointer; font: inherit; transition: border-color .15s, box-shadow .15s; }
.vis-port:hover { border-color: var(--canary); }
.vis-port-name { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.vis-port-sub { font-size: 10px; color: var(--faint); }
.vis-port-module { right: -14px; top: 46px; }
.vis-port-xiao { right: -14px; bottom: -14px; }
.vis-port.good { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(76, 175, 110, 0.25); }
.vis-port.bad { border-color: #e05353; box-shadow: 0 0 0 3px rgba(224, 83, 83, 0.22); }
.vis-port.pulse { animation: vis-pulse 0.9s ease-out; }
@keyframes vis-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 212, 79, 0.5); } 100% { box-shadow: 0 0 0 12px rgba(255, 212, 79, 0); } }
.vis-ports-tasks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.vis-task { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--edge);
  border-radius: 12px; background: var(--surface); color: var(--text); padding: 11px 13px; cursor: pointer; font: inherit; }
.vis-task:hover { border-color: #3a3a3a; }
.vis-task.on { border-color: var(--canary); box-shadow: 0 0 0 2px rgba(255, 212, 79, 0.22); }
.vis-task strong { font-size: 13.5px; }
.vis-task .muted { font-size: 12px; }
.vis-ports-verdict { min-height: 2.6em; margin-top: 10px; }

/* the staged SenseCraft workspace */
.vis-load { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.vis-ws { border: 1px solid #2c2c2e; border-radius: 14px; overflow: hidden; background: #101114; }
.vis-ws-body { min-height: 330px; display: flex; flex-direction: column; padding: 16px; }
.vis-ws-center { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 12px;
  align-items: center; max-width: 420px; }
.vis-ws-port { border: 1px solid var(--edge); border-radius: 10px; background: var(--surface);
  color: var(--text); padding: 12px 18px; cursor: pointer; font: inherit; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.vis-ws-port:hover { border-color: var(--canary); }
.vis-ws-models { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.vis-ws-model { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 1px solid var(--edge);
  border-radius: 12px; background: var(--surface); color: var(--text); padding: 11px 13px; cursor: pointer; font: inherit; }
.vis-ws-model.on { border-color: var(--canary); box-shadow: 0 0 0 2px rgba(255, 212, 79, 0.25); }
.vis-ws-model.dim { opacity: 0.55; }
.vis-ws-model.shake { animation: vis-shake 0.35s; }
@keyframes vis-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.vis-progress { width: 100%; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.vis-progress-fill { height: 100%; width: 0; background: var(--canary); transition: width 0.1s linear; }
.vis-ws-preview-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.vis-preview-stage { border-radius: 10px; overflow: hidden; border: 1px solid #23252b; }
.vis-preview-cv { display: block; width: 100%; }
.vis-preview-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.vis-slider { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.vis-slider input[type="range"] { width: 100%; accent-color: var(--canary); }
.vis-slider output { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--canary); min-width: 52px; text-align: right; }
.vis-preview-cast { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.vis-load-rail { min-width: 0; }
.vis-steps { margin: 0; padding: 0 0 0 20px; display: flex; flex-direction: column; gap: 9px; }
.vis-steps li { padding-left: 4px; }
.vis-steps li::marker { color: var(--faint); }
.vis-steps li strong { display: block; font-size: 14px; }
.vis-steps li .muted { display: block; font-size: 12.5px; }
.vis-steps li.on strong { color: var(--canary); }
.vis-steps li.on::marker { color: var(--canary); }

/* mqtt explorer */
.vis-mqtt-scroll { height: 300px; white-space: normal; display: flex; flex-direction: column; gap: 8px; }
.vis-mqtt-row { border: 1px solid #22242a; border-radius: 10px; padding: 8px 10px; background: #101114; }
.vis-mqtt-row.tick { animation: vis-tick 0.7s; }
@keyframes vis-tick { 0% { border-color: var(--canary); } 100% { border-color: #22242a; } }
.vis-mqtt-topic { display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #cfd6df; }
.vis-mqtt-payload { display: block; margin-top: 4px; font-size: 11.5px; color: #93a7b6; word-break: break-all; }
.vis-ret { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ok);
  border: 1px solid rgba(76, 175, 110, 0.4); border-radius: 999px; padding: 1px 8px; }
.vis-ret-no { color: var(--signed); border-color: rgba(124, 220, 255, 0.35); }
.vis-topics { display: flex; flex-direction: column; }
.vis-topic { display: grid; grid-template-columns: minmax(210px, auto) auto 1fr; gap: 12px; align-items: baseline;
  padding: 7px 14px; border-bottom: 1px solid var(--edge); font-size: 12.5px; }
.vis-topic code { font-size: 12px; }
.vis-topic:last-child { border-bottom: none; }
.vis-topics-det { margin-top: 12px; }
.vis-entities { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 12px 14px; }
.vis-entity { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--edge); border-radius: 10px; padding: 9px 11px; }
.vis-entity-kind { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--faint); }
.vis-entity strong { font-size: 13.5px; }
.vis-entity .muted { font-size: 12px; }

/* aim card */
.vis-aim { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.vis-aim-card { border: 1px solid #2c2c2e; border-radius: 14px; background: #0c0d10; padding: 14px; }
.vis-aim-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.vis-aim-switch { border: 1px solid var(--edge); border-radius: 999px; background: var(--surface);
  color: var(--text); padding: 8px 16px; cursor: pointer; font: inherit; font-weight: 620; }
.vis-aim-switch.on { background: var(--canary); border-color: var(--canary); color: #151204; }
.vis-aim-cv { display: block; width: 100%; border-radius: 10px; }
.vis-aim-ticker { display: block; margin-top: 10px; font-size: 11px; color: #93a7b6; word-break: break-all; min-height: 2.6em; }
.vis-aim-side { min-width: 0; }

/* sandbox + tuning */
.vis-play { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: start; }
.vis-play-left { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.vis-cast { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.vis-verdict { display: flex; flex-wrap: wrap; gap: 8px; }
.vis-pill { font-size: 12.5px; font-weight: 620; border: 1px solid var(--edge); border-radius: 999px;
  padding: 4px 12px; color: var(--muted); }
.vis-pill-on { color: #151204; background: var(--canary); border-color: var(--canary); }
.vis-pill-dwell { color: #061007; background: var(--ok); border-color: var(--ok); }
.vis-pill-ev { color: var(--signed); border-color: rgba(124, 220, 255, 0.35); }
.vis-pill-dim { color: var(--faint); }
.vis-evlog { border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; }
.vis-evlog-head { padding: 8px 12px; font-size: 12px; color: var(--muted); background: #131418;
  border-bottom: 1px solid var(--edge); }
.vis-evlog-body { padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; min-height: 70px; }
.vis-evlog-row { display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; flex-wrap: wrap; }
.vis-evlog-row code { color: var(--canary); }
.vis-tune { border: 1px solid var(--edge); border-radius: 14px; background: var(--surface); padding: 16px; }
.vis-tune-row { margin: 10px 0; }
.vis-tune-row > span:first-child { min-width: 118px; }
.vis-tune-why { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.vis-tune-whyrow { display: flex; flex-direction: column; gap: 1px; font-size: 12.5px;
  border-top: 1px solid var(--edge); padding-top: 8px; }

/* placement */
.vis-usecases { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.vis-uc { text-align: left; cursor: pointer; font: inherit; color: var(--text); display: flex;
  flex-direction: column; gap: 6px; }
.vis-uc.on { border-color: var(--canary); box-shadow: 0 0 0 2px rgba(255, 212, 79, 0.22); }
.vis-uc-verdict { min-height: 2.4em; margin-top: 10px; }

/* flash */
.vis-flash-cmds { height: auto; white-space: normal; display: flex; flex-direction: column; gap: 6px; }
.vis-cmd { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.vis-cmd code { font-size: 12.5px; color: #d6dde6; word-break: break-all; }
.vis-roadmap { border: 1px dashed #3a4150; border-radius: 12px; padding: 12px 14px; display: flex;
  flex-direction: column; gap: 8px; font-size: 13.5px; }
.vis-roadmap .vis-ret { align-self: flex-start; color: var(--warn); border-color: rgba(224, 168, 83, 0.4); }

@media (max-width: 860px) {
  .vis-ports, .vis-load, .vis-aim, .vis-play { grid-template-columns: 1fr; }
  .vis-ports-diagram { position: static; }
  .vis-ports-tasks, .vis-ws-models, .vis-preview-controls { grid-template-columns: 1fr; }
}
/* ══ The Sense page (sense.html) — radar school ══════════════════════════ */

/* source badges — where a claim comes from */
.sense-src { display: inline-block; font-size: 10px; letter-spacing: 0.04em; padding: 2px 8px;
  border-radius: 999px; border: 1px solid; vertical-align: middle; white-space: nowrap; }
.sense-src-repo { color: #6bd06f; border-color: rgba(67, 160, 71, 0.45); background: rgba(67, 160, 71, 0.10); }
.sense-src-seeed { color: #67c7f5; border-color: rgba(3, 169, 244, 0.4); background: rgba(3, 169, 244, 0.08); }
.sense-src-esphome { color: #b8a6f5; border-color: rgba(140, 110, 245, 0.4); background: rgba(140, 110, 245, 0.08); }
.sense-src-community { color: #ffb04d; border-color: rgba(251, 140, 0, 0.4); background: rgba(251, 140, 0, 0.08); }

/* the device section */
.sense-device .wap-plug-side { min-width: 0; }
.sense-leds { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 8px 0; }
.sense-led { border: 1px solid var(--edge); border-radius: 12px; padding: 10px 12px; display: grid; gap: 3px; font-size: 13px; }
.sense-led i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; opacity: 0.45; transition: all 0.25s; }
.sense-led i.on { opacity: 1; box-shadow: 0 0 14px currentColor; }
.sense-proto { margin-top: 14px; }

/* provisioning */
.sense-prov .wap-cmds { margin-top: 6px; }
.sense-secrets .wap-fact-k { min-width: 170px; }
.sense-flavors { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.sense-flavor { padding: 12px 14px; display: grid; gap: 5px; font-size: 13px; cursor: default; }
.sense-nvs { margin-top: 14px; }
.sense-trackb { margin-top: 16px; }

/* the placement lab */
.sense-lab { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.sense-lab-stage { position: relative; border: 1px solid var(--edge); border-radius: var(--radius);
  background: radial-gradient(700px 340px at 18% 50%, #131b16 0%, #0b0d10 70%); overflow: hidden; }
.sense-lab-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.sense-lab-canvas:active { cursor: grabbing; }
.sense-lab-pillrow { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sense-lab-led { width: 16px; height: 16px; border-radius: 50%; background: #e0a03c; box-shadow: 0 0 12px rgba(224, 160, 60, 0.5); transition: all 0.3s; }
.sense-lab-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.sense-toggle { display: grid; gap: 2px; text-align: left; padding: 8px 12px; cursor: pointer; border-radius: 12px; }
.sense-toggle.on { border-color: var(--canary); background: rgba(255, 212, 79, 0.08); }
.sense-toggle strong { font-size: 13px; }

/* placement + use cases */
.sense-mounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 12px; margin: 10px 0; }
.sense-mount { padding: 14px 16px; display: grid; gap: 8px; cursor: default; align-content: start; }
.sense-mount .wap-fact-k { min-width: 74px; }
.sense-avoid details { margin-bottom: 8px; }

/* tuning */
.sense-knobs { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin: 10px 0 18px; }
.sense-knob { padding: 13px 15px; display: grid; gap: 6px; cursor: default; align-content: start; }
.sense-knob-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sense-knob-val { color: var(--canary); }
.sense-kv strong { color: #c9c9c9; }
.sense-errs details { margin-bottom: 8px; }
.sense-err-kind { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 6px; margin-right: 6px; }
.sense-err-falsepositive .sense-err-kind { background: rgba(251, 140, 0, 0.15); color: #ffb04d; }
.sense-err-falsenegative .sense-err-kind { background: rgba(3, 169, 244, 0.15); color: #67c7f5; }
.sense-err-wrongvalue .sense-err-kind { background: rgba(229, 57, 53, 0.15); color: #ff7a76; }

/* capability + reality tables */
.sense-captable { border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; margin: 10px 0; font-size: 13px; }
.sense-caprow { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.1fr; gap: 10px; padding: 8px 14px; border-top: 1px solid rgba(255,255,255,0.05); align-items: baseline; }
.sense-caprow:first-child { border-top: 0; }
.sense-caphead { background: var(--surface); color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }
.sense-reality .sense-caprow { grid-template-columns: 0.8fr 1.9fr auto; }
.sense-reality { margin-top: 22px; }

/* HA entity flavors */
.sense-ent-well { border-left: 2px solid rgba(140, 110, 245, 0.6); padding-left: 8px; }
.sense-ents .subtabs { margin-bottom: 8px; }

@media (max-width: 860px) {
  .sense-lab { grid-template-columns: 1fr; }
  .sense-caprow { grid-template-columns: 1fr 1fr; }
  .sense-caprow > :nth-child(3), .sense-caprow > :nth-child(4) { grid-column: auto; }
}

/* sense page container (the workshop's width — the lab wants room) */
#sense { max-width: 1180px; margin: 0 auto 90px; padding: 0 24px; }

/* ========================================================================
 *  The Sense Lab (senselab.html) — placement bench, pipeline, cards, power.
 *  Reuses .hub-*, .wap-two, .wap-facts, .wap-term, .card, .chip, .ondevice.
 * ======================================================================== */

#senselab { max-width: 1080px; margin: 0 auto 90px; padding: 0 24px; }

.slab-mono { font: 12.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.slab-3d { width: 100%; max-width: 420px; height: 320px; border-radius: var(--radius);
  background: radial-gradient(120% 100% at 50% 0%, #17171a 0%, #0a0a0c 100%);
  border: 1px solid var(--edge); touch-action: none; cursor: grab; }

/* ── protocol ── */
.slab-frames { width: 100%; border-collapse: collapse; margin-top: 12px; }
.slab-frames th, .slab-frames td { text-align: left; padding: 6px 10px;
  border-bottom: 1px solid var(--edge); font-size: 13px; }
.slab-frames th { color: var(--faint); font-weight: 600; text-transform: uppercase;
  font-size: 11px; letter-spacing: 0.08em; }
.slab-bench { margin-top: 16px; border: 1px solid rgba(251, 140, 0, 0.35);
  border-radius: var(--radius); padding: 14px 16px; background: rgba(251, 140, 0, 0.05); }
.slab-bench h4 { margin: 0 0 8px; font-size: 14px; color: var(--warn); }
.slab-bench ul { margin: 0 0 8px; padding-left: 18px; }
.slab-bench li { font-size: 13px; margin: 4px 0; color: #d8cdbb; }
.slab-dropped { margin-top: 22px; }
.slab-dropped h4 { margin: 0 0 4px; font-size: 14px; }

/* ── placement stage ── */
.slab-stage { margin-top: 6px; }
.slab-stage-ctl { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.slab-ctl-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.slab-ctl-k { min-width: 110px; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.06em; }
.slab-ctl-v { font: 12.5px ui-monospace, Menlo, monospace; color: var(--canary); min-width: 76px; }
.slab-ctl-row input[type="range"] { flex: 1; min-width: 140px; max-width: 300px; accent-color: var(--canary); }
.slab-sel { background: var(--surface-2); color: var(--text); border: 1px solid var(--edge);
  border-radius: 9px; padding: 5px 8px; font-size: 13px; }
.slab-toggles button.on, .slab-stage-ctl button.on, .slab-knobs button.on {
  border-color: var(--canary); color: var(--canary); }
.slab-views { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slab-view-box { min-width: 0; }
.slab-view-h { font-size: 12px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 6px; }
.slab-view { width: 100%; border: 1px solid var(--edge); border-radius: var(--radius);
  background: linear-gradient(180deg, #101013 0%, #0a0a0c 100%); touch-action: none; }
.slab-grid { stroke: #1d1d20; stroke-width: 1; }
.slab-grid-t { fill: var(--faint); font-size: 10px; text-anchor: middle; }
.slab-floor { stroke: #2c2c2e; stroke-width: 1.5; }
.slab-fov { fill: rgba(201, 164, 240, 0.09); stroke: rgba(201, 164, 240, 0.5);
  stroke-width: 1.2; stroke-dasharray: 5 4; }
.slab-band { fill: none; stroke-width: 1; stroke-dasharray: 2 5; }
.slab-band-near { stroke: rgba(67, 160, 71, 0.6); }
.slab-band-mid { stroke: rgba(251, 140, 0, 0.5); }
.slab-vitals-ring { fill: none; stroke: rgba(143, 211, 168, 0.75); stroke-width: 1.6; }
.slab-radar { fill: #ffd44f; }
.slab-person circle, .slab-person rect { fill: #3a3a40; stroke: #55555c; stroke-width: 1; }
.slab-person.on circle, .slab-person.on rect { fill: #2e4638; stroke: #8fd3a8; }
.slab-person2 { fill: #46303c; stroke: #d08fb0; stroke-width: 1; }
.slab-chest { fill: #8fd3a8; }
.slab-breath-ring { fill: none; stroke: #8fd3a8; stroke-width: 1;
  animation: slab-breathe 3.6s ease-out infinite; opacity: 0; }
@keyframes slab-breathe { 0% { opacity: 0.7; } 70% { opacity: 0; } 100% { opacity: 0; } }
.slab-fan circle { fill: none; stroke: #d08fb0; stroke-width: 1.2; }
.slab-fan-blade { stroke: #d08fb0; stroke-width: 1.2; transform-box: fill-box;
  transform-origin: center; animation: slab-spin 1.1s linear infinite; }
@keyframes slab-spin { to { transform: rotate(360deg); } }

.slab-quality { margin-top: 16px; }
.slab-quality h4 { margin: 0 0 8px; font-size: 14px; }
.slab-qbar { height: 10px; border-radius: 6px; background: #1a1a1d; border: 1px solid var(--edge);
  overflow: hidden; }
.slab-qfill { height: 100%; width: 0; border-radius: 6px; transition: width 0.25s ease; }
.slab-qfill.q-ok { background: linear-gradient(90deg, #2e7d32, #43a047); }
.slab-qfill.q-warn { background: linear-gradient(90deg, #a86200, #fb8c00); }
.slab-qfill.q-bad { background: linear-gradient(90deg, #7f2723, #e53935); }
.slab-qlabel { margin-top: 8px; font: 12.5px ui-monospace, Menlo, monospace; color: var(--muted); }
.slab-qwhy { margin: 6px 0 0; padding-left: 18px; }
.slab-qwhy li { font-size: 13px; color: #cba; margin: 3px 0; }
.slab-qwhy .slab-q-good { color: var(--ok); }

/* ── knobs ── */
.slab-knobs { margin: 4px 0 14px; }
.slab-knob-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px 18px; margin-top: 10px; }
.slab-knob { display: flex; align-items: center; gap: 8px; }
.slab-knob .slab-ctl-k { min-width: 118px; }
.slab-knob input[type="range"] { flex: 1; min-width: 80px; accent-color: var(--canary); }

/* ── console ── */
.slab-console { margin-top: 8px; }
.slab-con-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.slab-con-col h4, .slab-events h4 { margin: 0 0 8px; font-size: 13px; color: var(--muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.slab-hex-scroll { height: 190px; font-size: 11px; }
.slab-f-presence { color: #9fb2a4; }
.slab-f-vitals { color: #8fd3a8; }

.slab-choke { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch;
  margin-top: 18px; }
.slab-choke-side { border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface); padding: 12px 14px; min-width: 0; }
.slab-choke-h { font-size: 11.5px; color: var(--faint); text-transform: uppercase;
  letter-spacing: 0.07em; margin-bottom: 8px; }
.slab-choke-row { display: flex; gap: 10px; align-items: baseline; padding: 3px 0;
  font-size: 12.5px; flex-wrap: wrap; }
.slab-choke-row.dropped { color: var(--faint); text-decoration: line-through; }
.slab-choke-row.dropped .slab-choke-x { text-decoration: none; color: var(--warn);
  font-size: 11px; }
.slab-choke-row.out { color: #cfe8d6; }
.slab-choke-k { color: var(--muted); min-width: 110px; }
.slab-choke-wall { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 0 6px; border-left: 2px dashed rgba(255, 212, 79, 0.5);
  border-right: 2px dashed rgba(255, 212, 79, 0.5); color: var(--canary-deep);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; writing-mode: horizontal-tb; }

.slab-events { margin-top: 18px; }
.slab-evlog { display: flex; flex-direction: column; gap: 8px; }
.slab-ev { padding: 10px 14px; }
.slab-ev-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.slab-ev-sig { margin-left: auto; font-size: 12px; }
.slab-ev-canon, .slab-ev-b64 { display: block; margin-top: 5px; word-break: break-all;
  color: #93a7b6; }

/* ── Canary Cards ── */
.ccard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 12px; margin-top: 10px; }
.ccard { border: 1px solid var(--edge); border-radius: var(--radius); padding: 12px 14px;
  background: linear-gradient(180deg, var(--surface-2) 0%, #101012 100%);
  display: flex; flex-direction: column; gap: 8px; min-height: 108px; }
.ccard-absent { opacity: 0.55; border-style: dashed; }
.ccard-invalid { border-color: var(--alert); }
.ccard-head { display: flex; align-items: center; gap: 8px; }
.ccard-ic { width: 16px; height: 16px; color: var(--canary-deep); flex: none; }
.ccard-title { margin: 0; font-size: 13px; font-weight: 620; flex: 1; }
.ccard-priv { font-size: 10px; padding: 1px 7px; border-radius: 8px; border: 1px solid var(--edge);
  color: var(--muted); letter-spacing: 0.06em; }
.ccard-priv-p1 { border-color: rgba(3, 169, 244, 0.5); color: var(--signed); }
.ccard-priv-p2 { border-color: rgba(251, 140, 0, 0.5); color: var(--warn); }
.ccard-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.ccard-pill { padding: 3px 12px; border-radius: 11px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--edge); }
.cc-ok { color: var(--ok); border-color: rgba(67, 160, 71, 0.5); }
.cc-notice { color: var(--signed); border-color: rgba(3, 169, 244, 0.5); }
.cc-warn { color: var(--warn); border-color: rgba(251, 140, 0, 0.5); }
.cc-alert { color: var(--alert); border-color: rgba(229, 57, 53, 0.55); }
.cc-idle { color: var(--muted); }
.cc-null { color: var(--faint); }
.ccard-stat strong { font-size: 26px; font-weight: 650; }
.ccard-unit { color: var(--muted); font-size: 13px; }
.ccard-band { display: flex; gap: 6px; flex-wrap: wrap; }
.ccard-slot { padding: 2px 10px; border-radius: 9px; border: 1px solid var(--edge);
  font-size: 12px; color: var(--faint); }
.ccard-slot.on { color: var(--text); border-color: currentColor; }
.ccard-spark { width: 120px; height: 28px; color: var(--signed); }
.ccard-event { font-size: 12.5px; color: #cfe8d6; word-break: break-all; }
.ccard-signed { font-size: 11.5px; }
.ccard-chain { color: var(--muted); font-size: 12.5px; }
.ccard-foot { margin: 0; font-size: 11px; color: var(--faint); line-height: 1.45; }

/* ── glass bridge ── */
.slab-glass-stage { display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin-top: 14px; }
.slab-glass-canvas { width: 240px; height: 240px; image-rendering: pixelated; background: #000;
  border: 1px solid var(--edge); }
.slab-glass-canvas.round { border-radius: 50%; }
.slab-glass-status { text-align: center; max-width: 520px; }

/* ── power lab ── */
.slab-power { margin-top: 8px; }
.slab-pbars { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; }
.slab-pbar { display: grid; grid-template-columns: 200px 1fr 90px; align-items: center; gap: 10px; }
.slab-pbar-k { font-size: 12.5px; color: var(--muted); }
.slab-pbar-track { height: 12px; border-radius: 7px; background: #17171a;
  border: 1px solid var(--edge); overflow: hidden; }
.slab-pbar-fill { height: 100%; background: linear-gradient(90deg, var(--canary-deep), var(--canary));
  border-radius: 7px; transition: width 0.25s ease; }
.slab-pbar-v { font: 12px ui-monospace, Menlo, monospace; color: var(--text); text-align: right; }
.slab-ptotals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.slab-pnotes { margin-top: 12px; }

@media (max-width: 820px) {
  .slab-views, .slab-con-cols { grid-template-columns: 1fr; }
  .slab-choke { grid-template-columns: 1fr; }
  .slab-choke-wall { border: none; border-top: 2px dashed rgba(255, 212, 79, 0.5);
    border-bottom: 2px dashed rgba(255, 212, 79, 0.5); padding: 6px 0; flex-direction: row; gap: 6px; }
  .slab-pbar { grid-template-columns: 130px 1fr 76px; }
}
