/* RoadNav car page. Rules from the owner: sharp corners everywhere (circles only on
   the gamepad's sticks and face buttons), hairlines, dark, no popups. */
:root {
  --bg: #06080b;
  --panel: #0b0f15;
  --panel2: #10161f;
  --line: #1e2732;
  --line2: #2c3846;
  --text: #e6ecf3;
  --dim: #a3b0c0;
  --mute: #7d8a9c;
  --acc: #2fe3d3;
  --acc-dim: rgba(47, 227, 211, 0.12);
  --route: #ff3fb4;
  --ok: #4be38f;
  --warn: #ffb22e;
  --bad: #ff5468;
  --font: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --tabh: 58px;
  --toph: 48px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 500 15px/1.35 var(--font);
  letter-spacing: 0.02em;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh; min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
b { font-weight: 700; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  height: var(--toph);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: rgba(6, 8, 11, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: baseline; gap: 10px; font-size: 18px; letter-spacing: 0.12em; }
.brand .mark { width: 10px; height: 10px; background: var(--acc); align-self: center; box-shadow: 0 0 10px var(--acc); }
.brand .unit { font: 400 12px var(--mono); color: var(--dim); letter-spacing: 0; }
.presence { display: flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: 0.14em; color: var(--dim); }
.presence .sq, .offline .sq { width: 9px; height: 9px; background: var(--mute); }
.presence[data-state="on"] { color: var(--ok); }
.presence[data-state="on"] .sq { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: beat 2s infinite; }
.presence[data-state="stale"] { color: var(--warn); }
.presence[data-state="stale"] .sq { background: var(--warn); }
.presence[data-state="off"] { color: var(--bad); }
.presence[data-state="off"] .sq { background: var(--bad); box-shadow: 0 0 10px var(--bad); }
@keyframes beat { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- login ---------- */
.login { min-height: calc(100dvh - var(--toph)); display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; }
.login-title { font-size: 44px; font-weight: 700; letter-spacing: 0.16em; line-height: 1; border-left: 3px solid var(--acc); padding-left: 14px; }
.login-title span { display: block; font-size: 14px; color: var(--dim); letter-spacing: 0.34em; margin-top: 8px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.flabel { font-size: 13px; letter-spacing: 0.22em; color: var(--dim); }
.pass-row { display: flex; }
.pass-row input { flex: 1; min-width: 0; }
input[type="password"], input[type="text"], input[type="search"] {
  height: 52px; padding: 0 14px;
  background: var(--panel); border: 1px solid var(--line2);
  font: 400 17px var(--mono); letter-spacing: 0.06em; color: var(--text);
  outline: none; -webkit-appearance: none; appearance: none;
}
input:focus { border-color: var(--acc); box-shadow: inset 0 -2px 0 var(--acc); }
input::placeholder { color: var(--mute); }
.pass-row .btn { height: 52px; border-left: 0; min-width: 72px; }
.check { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: 0.14em; color: var(--dim); min-height: 40px; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box { width: 20px; height: 20px; border: 1px solid var(--line2); background: var(--panel); position: relative; }
.check input:checked + .box { border-color: var(--acc); }
.check input:checked + .box::after { content: ""; position: absolute; inset: 4px; background: var(--acc); }
.check input:focus-visible + .box { outline: 1px solid var(--acc); outline-offset: 2px; }
.login-msg { min-height: 22px; font-size: 15px; letter-spacing: 0.12em; }
.login-msg.err { color: var(--bad); text-shadow: 0 0 12px rgba(255, 84, 104, 0.45); }
.login-msg.info { color: var(--acc); }
.hint { font-size: 13px; color: var(--dim); letter-spacing: 0.04em; border-top: 1px solid var(--line); padding-top: 12px; }
.hint b { color: var(--warn); font-family: var(--mono); font-weight: 400; }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; padding: 6px 10px;
  background: var(--panel); border: 1px solid var(--line2);
  font-size: 16px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn small { font-size: 12px; font-weight: 500; color: var(--dim); letter-spacing: 0.12em; text-transform: lowercase; }
.btn:active { background: var(--panel2); border-color: var(--acc); }
.btn.on { border-color: var(--acc); color: var(--acc); background: var(--acc-dim); box-shadow: inset 0 0 0 1px var(--acc); }
.btn.busy::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--acc); animation: busy 0.7s linear infinite; }
@keyframes busy { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.btn.primary { background: var(--acc); color: #001512; border-color: var(--acc); font-size: 19px; letter-spacing: 0.24em; }
.btn.primary:active { background: #6ff1e5; }
.btn.primary:disabled { background: var(--panel2); color: var(--mute); border-color: var(--line2); }
.btn.big { min-height: 56px; font-size: 18px; }
.btn.ghost { background: transparent; color: var(--dim); }
.btn.wide { width: 100%; margin-top: 8px; }
.btn:focus-visible, .toggle:focus-visible, .tabs button:focus-visible { outline: 1px solid var(--acc); outline-offset: -3px; }

/* hold-to-confirm */
.btn.hold > i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc-dim); pointer-events: none; }
.btn.hold.holding > i { border-right: 1px solid var(--acc); }
.btn.hold > span { position: relative; }
.btn.hold.danger { color: var(--bad); border-color: rgba(255, 84, 104, 0.45); }
.btn.hold.danger > i { background: rgba(255, 84, 104, 0.16); }
.btn.hold.danger.holding > i { border-right-color: var(--bad); }
.btn.hold.holding { border-color: var(--acc); }
.btn.hold.danger.holding { border-color: var(--bad); }

/* switch-style buttons (FOLLOW, PAUSE, VPAD) */
.btn.sw { flex-direction: row; gap: 10px; padding: 0 14px; }
.swbox { width: 30px; height: 14px; border: 1px solid var(--line2); position: relative; }
.swbox::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 8px; background: var(--mute); transition: left 0.15s, background 0.15s; }
.btn.sw[data-state="on"] { color: var(--acc); border-color: var(--acc); }
.btn.sw[data-state="on"] .swbox { border-color: var(--acc); }
.btn.sw[data-state="on"] .swbox::after { left: 14px; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.btn.sw[data-state="unknown"] .swbox::after { left: 8px; background: var(--line2); }

/* ---------- layout ---------- */
main { padding: 0 16px calc(var(--tabh) + var(--safe-b) + 24px); max-width: 720px; margin: 0 auto; }
.mock main { padding-bottom: calc(var(--tabh) + var(--safe-b) + 64px); }
.tab { padding-top: 12px; animation: tabin 0.18s ease-out; }
@keyframes tabin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h3.sec {
  margin: 26px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: 0.26em; color: var(--dim);
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); padding-bottom: 6px;
}
.sec-note { font-size: 12px; letter-spacing: 0.08em; color: var(--mute); font-weight: 500; text-transform: none; }
.grid { display: grid; gap: 6px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.row3 .btn { font-size: 14px; }
.inrow { display: flex; gap: 0; margin-top: 8px; }
.inrow input { flex: 1; min-width: 0; height: 48px; font-size: 15px; }
.inrow .btn { border-left: 0; min-width: 76px; }
.note { font-size: 13px; color: var(--dim); margin: 10px 0 0; letter-spacing: 0.03em; }

/* offline banner: a hairline strip, not a modal */
.offline {
  position: sticky; top: var(--toph); z-index: 15;
  margin: 0 -16px; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  background: #1a0b0f; border-bottom: 1px solid rgba(255, 84, 104, 0.5);
  color: var(--bad); font-size: 14px; letter-spacing: 0.16em;
}
.offline .sq { background: var(--bad); }
.board-off .tab[data-tab="control"] .btn, .board-off .tab[data-tab="control"] .toggle,
.board-off .pad, .board-off .row3 .btn, .board-off .hero .speed, .board-off .tiles { opacity: 0.45; }

/* ---------- status ---------- */
.hero { display: flex; align-items: stretch; justify-content: space-between; gap: 16px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.speed { display: flex; align-items: baseline; gap: 8px; }
.speed span { font: 700 96px/0.9 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; min-width: 1.1ch; }
.speed small { font-size: 18px; letter-spacing: 0.24em; color: var(--dim); }
.hero-side { display: flex; flex-direction: column; justify-content: center; gap: 10px; text-align: right; }
.kv { display: flex; flex-direction: column; gap: 1px; }
.kv span { font-size: 12px; letter-spacing: 0.22em; color: var(--dim); }
.kv b { font: 600 18px var(--mono); letter-spacing: 0; }
.kv b.warn { color: var(--warn); }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin-top: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 92px; }
.tl { font-size: 12px; letter-spacing: 0.24em; color: var(--dim); }
.tile b { font-size: 26px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.tile b.good { color: var(--ok); }
.tile b.warn { color: var(--warn); }
.tile b.bad { color: var(--bad); }
.ts { font-size: 13px; color: var(--dim); letter-spacing: 0.08em; }
.meter { position: absolute; left: 12px; right: 12px; bottom: 10px; height: 3px; background: var(--line); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc); transition: width 0.4s; }
.meter i.warn { background: var(--warn); }
.meter em { position: absolute; left: 66.6%; top: -3px; bottom: -3px; width: 1px; background: var(--dim); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 18px; margin-top: 2px; }
.bars i { width: 7px; background: var(--line2); }
.bars i:nth-child(1) { height: 25%; } .bars i:nth-child(2) { height: 50%; }
.bars i:nth-child(3) { height: 75%; } .bars i:nth-child(4) { height: 100%; }
.bars i.on { background: var(--acc); }
.kvlist { display: grid; grid-template-columns: 1fr; gap: 10px; }
.kvlist .kv { flex-direction: row; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.kvlist .kv b { font-size: 14px; text-align: right; }
.out { margin: 10px 0 0; padding: 12px; background: var(--panel); border: 1px solid var(--line); font: 400 12.5px/1.55 var(--mono); color: var(--dim); white-space: pre-wrap; word-break: break-word; word-spacing: 0.4em; max-height: 260px; overflow: auto; }
.shot { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.shot canvas { width: 320px; max-width: 100%; height: auto; aspect-ratio: 160 / 128; image-rendering: pixelated; border: 1px solid var(--line2); background: #000; }

/* ---------- control ---------- */
#cScreens .btn, #cViews .btn, #cThemes .btn { font-size: 15px; }
.zoom { display: grid; grid-template-columns: 56px 1fr 56px; }
.zoom > .btn { font-size: 26px; font-weight: 500; }
.zstrip { display: grid; grid-template-columns: repeat(8, 1fr); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); }
.zstrip .btn { border: 0; border-right: 1px solid var(--line); min-height: 54px; padding: 4px 0; font-size: 17px; }
.zstrip .btn:last-child { border-right: 0; }
.zstrip .btn small { font: 400 12px var(--mono); letter-spacing: 0; color: var(--dim); text-transform: none; }
.zstrip .btn.on { box-shadow: inset 0 -3px 0 var(--acc); background: var(--acc-dim); }
.zstrip .btn.on small { color: var(--acc); }

.toggles { border-top: 1px solid var(--line); }
.toggle {
  width: 100%; display: grid; grid-template-columns: 1fr auto 34px; align-items: center; gap: 12px;
  min-height: 60px; padding: 8px 2px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  cursor: pointer; touch-action: manipulation;
}
.toggle .tt { display: flex; flex-direction: column; gap: 1px; }
.toggle .tt b { font-size: 17px; letter-spacing: 0.1em; }
.toggle .tt small { font-size: 13px; color: var(--dim); letter-spacing: 0.03em; }
.sw2 { width: 52px; height: 26px; border: 1px solid var(--line2); position: relative; background: var(--panel); }
.sw2 i { position: absolute; top: 3px; left: 3px; width: 22px; height: 18px; background: var(--mute); transition: left 0.15s, background 0.15s; }
.toggle[data-state="on"] .sw2 { border-color: var(--acc); }
.toggle[data-state="on"] .sw2 i { left: 25px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.toggle[data-state="unknown"] .sw2 { border-style: dashed; }
.toggle[data-state="unknown"] .sw2 i { left: 14px; background: var(--line2); }
.tv { font: 600 12px var(--mono); color: var(--dim); text-align: right; }
.toggle[data-state="on"] .tv { color: var(--acc); }

/* ---------- pad ---------- */
.padtab { user-select: none; -webkit-user-select: none; }
.padbar, .logbar { display: flex; gap: 6px; align-items: stretch; }
.vpadind { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 48px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; letter-spacing: 0.14em; color: var(--mute); }
.vpadind .sq { width: 8px; height: 8px; background: var(--line2); }
.vpadind[data-state="on"] { color: var(--acc); border-color: rgba(47, 227, 211, 0.4); }
.vpadind[data-state="on"] .sq { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.padread {
  flex: 1; display: flex; align-items: center; padding: 0 12px; min-height: 48px;
  border: 1px solid var(--line); font: 400 12.5px var(--mono); color: var(--mute); overflow: hidden; white-space: nowrap;
}
.padread.live { color: var(--acc); border-color: rgba(47, 227, 211, 0.4); }
.pad {
  touch-action: none;
  display: grid; gap: 22px 10px; margin-top: 12px;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "lb rb"
    "mid mid"
    "stick abxy"
    "dpad trig";
  align-items: center; justify-items: center;
}
.pb {
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: var(--panel); border: 1px solid var(--line2); color: var(--text);
  font-size: 18px; font-weight: 700; letter-spacing: 0.1em; cursor: pointer;
  transition: background 0.06s, border-color 0.06s, box-shadow 0.06s;
}
.pb.down { background: var(--acc-dim); border-color: var(--acc); color: var(--acc); box-shadow: 0 0 16px rgba(47, 227, 211, 0.35); }
.pb.rect { width: 100%; height: 52px; }
.mid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; }
.pb.sm { height: 40px; font-size: 13px; letter-spacing: 0.14em; color: var(--dim); }
/* circles: meaningful here -- they are a controller's sticks and face buttons */
.stick { position: relative; width: min(44vw, 200px); aspect-ratio: 1; touch-action: none; }
.stick .ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line2); background: radial-gradient(circle, var(--panel2) 0%, var(--panel) 70%); }
.stick .ring::before, .stick .ring::after { content: ""; position: absolute; background: var(--line); }
.stick .ring::before { left: 50%; top: 10%; bottom: 10%; width: 1px; }
.stick .ring::after { top: 50%; left: 10%; right: 10%; height: 1px; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; margin: -21% 0 0 -21%; border-radius: 50%; background: #1a2230; border: 1px solid var(--line2); transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; }
.stick.down .knob { background: var(--acc-dim); border-color: var(--acc); box-shadow: 0 0 18px rgba(47, 227, 211, 0.4); }
.stick .lab { position: absolute; left: 0; right: 0; bottom: -20px; text-align: center; font-size: 12px; letter-spacing: 0.2em; color: var(--mute); }
.abxy { position: relative; width: min(44vw, 200px); aspect-ratio: 1; }
.pb.circ { position: absolute; width: 36%; height: 36%; border-radius: 50%; font-size: 20px; }
.pb.circ.y { left: 32%; top: 0; } .pb.circ.a { left: 32%; bottom: 0; }
.pb.circ.x { left: 0; top: 32%; } .pb.circ.b { right: 0; top: 32%; }
.pb.circ.a { color: #6fe39a; border-color: rgba(111, 227, 154, 0.5); }
.pb.circ.b { color: #ff7383; border-color: rgba(255, 115, 131, 0.5); }
.pb.circ.x { color: #6eb6ff; border-color: rgba(110, 182, 255, 0.5); }
.pb.circ.y { color: #ffd45e; border-color: rgba(255, 212, 94, 0.5); }
.pb.circ.down { color: var(--bg); }
.pb.circ.a.down { background: #6fe39a; box-shadow: 0 0 22px rgba(111, 227, 154, 0.6); }
.pb.circ.b.down { background: #ff7383; box-shadow: 0 0 22px rgba(255, 115, 131, 0.6); }
.pb.circ.x.down { background: #6eb6ff; box-shadow: 0 0 22px rgba(110, 182, 255, 0.6); }
.pb.circ.y.down { background: #ffd45e; box-shadow: 0 0 22px rgba(255, 212, 94, 0.6); }
.dpad { position: relative; width: min(42vw, 180px); aspect-ratio: 1; }
.dpad .pb { position: absolute; width: 34%; height: 34%; font-size: 15px; color: var(--dim); }
.dpad .d-up { left: 33%; top: 0; } .dpad .d-down { left: 33%; bottom: 0; }
.dpad .d-left { left: 0; top: 33%; } .dpad .d-right { right: 0; top: 33%; }
.dpad .pb.down { color: var(--acc); }
.trigs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(42vw, 180px); height: min(48vw, 210px); }
.trig { position: relative; border: 1px solid var(--line2); background: var(--panel); touch-action: none; overflow: hidden; cursor: ns-resize; }
.trig i { position: absolute; left: 0; right: 0; top: 0; height: 0; background: linear-gradient(var(--acc-dim), rgba(47, 227, 211, 0.4)); border-bottom: 2px solid var(--acc); }
.trig span { position: absolute; left: 0; right: 0; top: 8px; text-align: center; font-weight: 700; letter-spacing: 0.12em; }
.trig em { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font: 400 12px var(--mono); color: var(--dim); font-style: normal; }
.trig.down { border-color: var(--acc); }

/* landscape phone: header hidden on the pad, everything in one band, triggers at the edges */
@media (orientation: landscape) and (max-height: 560px) {
  [data-tab="pad"] .top { display: none; }
  [data-tab="pad"] .tab { padding-top: 8px; }
  .padbar .btn, .padread, .vpadind { min-height: 38px; }
  .pad {
    gap: 10px 14px; margin-top: 8px;
    grid-template-columns: 64px 1fr 1fr 1fr 64px;
    grid-template-areas:
      "lt lb mid rb rt"
      "lt stick dpad abxy rt";
  }
  .pb.rect { height: 40px; }
  .pb.sm { height: 36px; }
  .trigs { display: contents; }
  .trig[data-tr="lt"] { grid-area: lt; } .trig[data-tr="rt"] { grid-area: rt; }
  .trig { width: 100%; height: 100%; }
  .stick, .abxy { width: min(calc(100dvh - 190px), 190px); }
  .mock .stick, .mock .abxy { width: min(calc(100dvh - 226px), 190px); }
  .dpad { width: min(calc(100dvh - 210px), 160px); }
  .mock .dpad { width: min(calc(100dvh - 246px), 160px); }
}

/* ---------- log ---------- */
.logtab { display: flex; flex-direction: column; }
.logbar .btn { flex: 1; font-size: 14px; }
.logview {
  margin-top: 8px; height: calc(100dvh - var(--toph) - var(--tabh) - 260px); min-height: 220px;
  overflow-y: auto; background: #04060a; border: 1px solid var(--line);
  font: 400 12.5px/1.5 var(--mono); padding: 6px 0;
}
.mock .logview { height: calc(100dvh - var(--toph) - var(--tabh) - 300px); }
.ll { padding: 1px 10px; white-space: pre-wrap; word-break: break-word; color: #c9d3df; }
.ll .lt { color: var(--mute); margin-right: 8px; }
.ll.tx { color: var(--acc); }
.ll.rx { color: #9fdcd5; }
.ll.err { color: var(--bad); }
.ll.sys { color: var(--warn); }
.logfoot { display: flex; justify-content: space-between; font: 400 12px var(--mono); color: var(--dim); padding: 6px 2px 0; }
#logNew { color: var(--warn); }
.console .prompt { display: flex; align-items: center; justify-content: center; width: 32px; border: 1px solid var(--line2); border-right: 0; color: var(--acc); font: 600 16px var(--mono); background: var(--panel); }

/* ---------- stage 3 placeholders ---------- */
.stage { padding: 28px 0; }
.stage-tag { display: inline-block; font: 600 12px var(--mono); color: var(--warn); border: 1px solid rgba(255, 178, 46, 0.5); padding: 4px 8px; letter-spacing: 0.1em; }
.stage h2 { font-size: 32px; letter-spacing: 0.16em; margin: 14px 0 8px; }
.stage p { color: var(--dim); font-size: 16px; max-width: 46ch; margin: 0 0 24px; }
.ghost-ui { border: 1px dashed var(--line2); padding: 16px; display: flex; flex-direction: column; gap: 12px; opacity: 0.6; }
.ghost-in { height: 48px; border: 1px solid var(--line2); display: flex; align-items: center; padding: 0 12px; color: var(--mute); letter-spacing: 0.2em; font-size: 13px; }
.ghost-line { height: 10px; background: var(--line); width: 100%; }
.ghost-line.s { width: 60%; }
.ghost-row { display: flex; align-items: center; gap: 12px; }
.ghost-row span { width: 12px; height: 12px; border: 1px solid var(--route); flex: none; }
.ghost-btn { height: 48px; border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center; color: var(--mute); letter-spacing: 0.2em; font-size: 14px; }

/* ---------- tabs: bottom, in thumb reach ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabh) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(6, 8, 11, 0.97); border-top: 1px solid var(--line);
}
.tabs button {
  position: relative; background: none; border: 0; border-right: 1px solid var(--line);
  font-size: 14px; font-weight: 600; letter-spacing: 0.1em; color: var(--dim);
  cursor: pointer; touch-action: manipulation;
}
.tabs button:last-child { border-right: 0; }
.tabs button.on { color: var(--acc); box-shadow: inset 0 2px 0 var(--acc); background: var(--acc-dim); }
.tabs button i { position: absolute; top: 4px; right: 5px; font: 400 12px var(--mono); font-style: normal; color: var(--warn); }
.tabs button[data-go="nav"], .tabs button[data-go="cams"] { color: var(--mute); }
.tabs button[data-go="nav"].on, .tabs button[data-go="cams"].on { color: var(--acc); }

/* mock strip: sits right above the tabs */
.mockbar {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabh) + var(--safe-b)); z-index: 29;
  display: flex; align-items: stretch; height: 36px;
  background: #140f04; border-top: 1px solid rgba(255, 178, 46, 0.45);
  font: 600 12px var(--mono); color: var(--warn); letter-spacing: 0.1em;
}
.signed-out .mockbar { bottom: 0; }
.mockbar span { display: flex; align-items: center; padding: 0 12px; border-right: 1px solid rgba(255, 178, 46, 0.3); }
.mockbar button { background: none; border: 0; border-right: 1px solid rgba(255, 178, 46, 0.3); color: var(--warn); font: inherit; padding: 0 12px; cursor: pointer; }
.mockbar button.on { color: var(--ok); }
.signed-out #signOut, .signed-out #mockOnline { display: none; }

/* ---------- glow feedback ---------- */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.fx {
  position: fixed; white-space: nowrap;
  font: 700 16px var(--font); letter-spacing: 0.16em;
  color: var(--acc); text-shadow: 0 0 8px rgba(47, 227, 211, 0.9), 0 0 22px rgba(47, 227, 211, 0.5);
  animation: rise 1.5s cubic-bezier(.2, .7, .3, 1) forwards;
}
.fx.err { color: var(--bad); text-shadow: 0 0 8px rgba(255, 84, 104, 0.9), 0 0 22px rgba(255, 84, 104, 0.5); }
.fx.warn { color: var(--warn); text-shadow: 0 0 8px rgba(255, 178, 46, 0.9), 0 0 22px rgba(255, 178, 46, 0.5); }
.fx.info { color: var(--text); text-shadow: 0 0 8px rgba(230, 236, 243, 0.6); }
@keyframes rise {
  0% { opacity: 0; transform: translateY(6px); }
  12% { opacity: 1; transform: translateY(-4px); }
  65% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-40px); }
}
@media (prefers-reduced-motion: reduce) {
  .fx { animation: fade 1.4s forwards; }
  @keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
  .tab { animation: none; }
}

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  .g3 { grid-template-columns: repeat(4, 1fr); }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  main { max-width: 960px; }
  .tabs { left: 50%; right: auto; width: 720px; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
  .speed span { font-size: 120px; }
  .pad { max-width: 640px; margin: 10px auto 0; }
}
