/* 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: #eaf04f;            /* warnings: a hi-vis lemon, never amber / pink / camera red / ALPR blue */
  --you: #ffb22e;             /* amber = you: your own cameras, your gates */
  --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; }
button, a, input { touch-action: manipulation; }
[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: var(--bg);
  border-bottom: 1px solid var(--line);
}
.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.primary small { color: rgba(0, 21, 18, 0.75); }
.btn.primary:disabled small { color: var(--mute); }
.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); }
.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="dash"] .btn, .board-off .tab[data-tab="dash"] .toggle, .board-off #goSend, .board-off #camAdd,
.board-off .pad { opacity: 0.45; }

/* ---------- key / value pairs ---------- */
.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); }
.ts { font-size: 13px; color: var(--dim); letter-spacing: 0.08em; }
.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; }

/* ---------- dash: quick controls ---------- */
#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; }

.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 ---------- */
/* The PAD tab fills the screen between the top bar and the tabs and never scrolls. The pad
   itself is a size container: every control is sized in cqw / cqh of the space it has, so
   one layout fits a 360 px portrait phone and an 844 px landscape one. */
.padtab {
  position: fixed; left: 0; right: 0; top: var(--toph); bottom: calc(var(--tabh) + var(--safe-b));
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px max(10px, env(safe-area-inset-left, 0px)) 6px max(10px, env(safe-area-inset-right, 0px));
  user-select: none; -webkit-user-select: none; animation: none;
}
.mock .padtab { bottom: calc(var(--tabh) + var(--safe-b) + 36px); }
.board-off .padtab { top: calc(var(--toph) + 64px); }
.padbar, .logbar { display: flex; gap: 6px; align-items: stretch; }
.padbar { flex: none; }
.vpadind { display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 40px; 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; min-width: 0; display: flex; align-items: center; padding: 0 12px; min-height: 40px;
  border: 1px solid var(--line); font: 400 12.5px var(--mono); color: var(--dim); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.padread.live { color: var(--acc); border-color: rgba(47, 227, 211, 0.4); }
.rotate { flex: none; margin: 0; text-align: center; font-size: 13px; color: var(--dim); letter-spacing: 0.06em; }

.padbox { flex: 1; min-height: 0; container: pad / size; touch-action: none; }
.pad {
  width: 100%; height: 100%; touch-action: none;
  display: grid; gap: 2cqh 2.5cqw;
  /* portrait: shoulders + triggers on top, then left stick / ABXY, then d-pad / right stick */
  grid-template-columns: 15cqw 1fr 1fr 15cqw;
  grid-template-rows: 11cqh 12cqh 1fr 1fr;
  grid-template-areas:
    "lt lb rb rt"
    "lt mid mid rt"
    "ls ls ab ab"
    "dp dp rs rs";
  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; padding: 0;
  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: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.pb.sh { font-size: 17px; }
.pb small { font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: var(--dim); }
.pb.down small { color: var(--acc); }
.mid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 6px; width: 100%; height: 100%; }
.pb.sm { font-size: 18px; font-weight: 500; color: var(--dim); }
.pb.xb { font-size: 18px; color: var(--ok); border-color: rgba(75, 227, 143, 0.45); }
.pb.xb.down { background: rgba(75, 227, 143, 0.16); color: var(--ok); border-color: var(--ok); box-shadow: 0 0 16px rgba(75, 227, 143, 0.4); }

/* circles: meaningful here -- they are a controller's sticks and face buttons */
.stick, .abxy { position: relative; width: 100%; max-width: 38cqh; 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: 12%; bottom: 12%; width: 1px; }
.stick .ring::after { top: 50%; left: 12%; right: 12%; height: 1px; }
/* the dead zone, drawn: a faint inner circle */
.stick::after { content: ""; position: absolute; left: 44%; top: 44%; width: 12%; height: 12%; border-radius: 50%; border: 1px dashed var(--line2); pointer-events: none; }
.stick .knob { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%; background: #1a2230; border: 1px solid var(--line2); transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none; z-index: 1; }
.stick.down .knob { background: #13303a; border-color: var(--acc); }
.stick.live .knob { background: var(--acc-dim); box-shadow: 0 0 18px rgba(47, 227, 211, 0.45); }
.stick .lab { position: absolute; left: 4%; top: 2%; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--mute); pointer-events: none; }
.pb.circ { position: absolute; width: 35%; height: 35%; border-radius: 50%; font-size: 20px; }
.pb.circ.y { left: 32.5%; top: 0; } .pb.circ.a { left: 32.5%; bottom: 0; }
.pb.circ.x { left: 0; top: 32.5%; } .pb.circ.b { right: 0; top: 32.5%; }
.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: 86%; max-width: 32cqh; 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); }
.trig { position: relative; width: 100%; height: 100%; 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: 6px; 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::after { content: "\25BC"; position: absolute; left: 0; right: 0; top: 50%; text-align: center; font-size: 12px; color: var(--line2); }
.trig.down { border-color: var(--acc); }
.trig.down::after { color: transparent; }

/* landscape: the Xbox layout. Left stick high, d-pad low; ABXY high, right stick low;
   VIEW / XBOX / MENU between; triggers as full-height slides at the edges. */
@container pad (orientation: landscape) {
  .pad {
    gap: 2cqh 1.4cqw;
    grid-template-columns: 7cqw 1fr 1fr 12cqw 1fr 1fr 7cqw;
    grid-template-rows: 15cqh 1fr;
    grid-template-areas:
      "lt lb lb mid rb rb rt"
      "lt ls dp mid rs ab rt";
  }
  .mid { grid-template-columns: 1fr; grid-template-rows: 1fr 1.3fr 1fr; height: 70cqh; align-self: start; }
  .stick, .abxy { max-width: 62cqh; }
  .stick[data-ax="l"], .abxy { align-self: start; margin-top: 1cqh; }
  .stick[data-ax="r"], .dpad { align-self: end; }
  .dpad { max-width: 46cqh; width: 92%; }
}

/* landscape phone: no header on the pad, a slimmer tab bar */
@media (orientation: landscape) and (max-height: 560px) {
  [data-tab="pad"] .top { display: none; }
  [data-tab="pad"] .padtab { top: 0; }
  [data-tab="pad"].board-off .padtab { top: 64px; }
  [data-tab="pad"] { --tabh: 0px; }
  .padbar .btn, .padread, .vpadind { min-height: 34px; }
  .rotate { display: none; }
}
@media (orientation: landscape) { .rotate { display: none; } }

/* ---------- events: the driver's timeline ---------- */
.evlist { display: flex; flex-direction: column; }
.evgrp { margin-top: 16px; }
.evgrp:first-child { margin-top: 4px; }
.evg {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 8px 0 6px; border-bottom: 1px solid var(--line2);
}
.evgl { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.evgl b { font-size: 13px; font-weight: 600; letter-spacing: 0.24em; color: var(--dim); }
.evg.live .evgl b { color: var(--acc); }
.evgt { font: 400 13px var(--mono); color: var(--text); }
.evgn { font: 400 12px var(--mono); color: var(--dim); }
.ev {
  --tone: var(--mute);
  position: relative;
  display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 10px 0 10px 10px; border-bottom: 1px solid var(--line); border-left: 2px solid var(--tone);
}
.ev.t-alert { --tone: var(--bad); }
.ev.t-surv { --tone: #5aa9ff; }
.ev.t-score { --tone: #ffd45e; }
.ev.t-warn { --tone: var(--warn); }
.evb {
  font: 600 12px/1 var(--mono); letter-spacing: 0.04em; color: var(--tone);
  border: 1px solid var(--tone); padding: 4px 0; text-align: center; margin-top: 2px;
}
.ev.t-info .evb { color: var(--dim); border-color: var(--line2); }
.evm { min-width: 0; }
.evt { font-size: 17px; font-weight: 600; line-height: 1.2; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.ev.t-alert .evt { color: #ff7d8d; }
.evd { font-size: 14px; color: var(--dim); margin-top: 2px; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.evw { font: 400 12px var(--mono); color: var(--dim); white-space: nowrap; padding-top: 4px; }
.ev.fresh::before {
  content: ""; position: absolute; inset: 0; background: var(--tone); opacity: 0; pointer-events: none;
  animation: evin 1.8s ease-out;
}
@keyframes evin { 0% { opacity: 0.22; } 100% { opacity: 0; } }
.evempty { margin-top: 14px; padding: 20px 16px; border: 1px dashed var(--line2); }
.evempty b { font-size: 15px; letter-spacing: 0.22em; color: var(--dim); }
.evempty p { margin: 8px 0 0; font-size: 15px; color: var(--dim); max-width: 46ch; }
.tabs button i.evnew { color: var(--bad); }

/* DIAGNOSTICS: the raw serial log, folded away under the timeline */
.diagbtn {
  width: 100%; margin-top: 28px; min-height: 58px; padding: 8px 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line);
  cursor: pointer; touch-action: manipulation;
}
.diagbtn .dt { display: flex; flex-direction: column; gap: 1px; }
.diagbtn b { font-size: 15px; letter-spacing: 0.22em; color: var(--dim); }
.diagbtn small { font-size: 13px; color: var(--dim); letter-spacing: 0.03em; }
.diagbtn.on b { color: var(--acc); }
.dplus { position: relative; width: 14px; height: 14px; flex: none; margin-right: 6px; }
.dplus::before, .dplus::after { content: ""; position: absolute; background: var(--dim); }
.dplus::before { left: 0; right: 0; top: 6px; height: 2px; }
.dplus::after { top: 0; bottom: 0; left: 6px; width: 2px; transition: transform 0.15s; }
.diagbtn.on .dplus::before { background: var(--acc); }
.diagbtn.on .dplus::after { transform: scaleY(0); }
.diagbtn:focus-visible { outline: 1px solid var(--acc); outline-offset: -3px; }
.diag { padding-top: 10px; }
#teleBtn { justify-content: flex-start; min-height: 54px; }
#teleBtn .tt2 { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
#teleBtn .tt2 b { font-size: 14px; }
#teleBtn .tt2 small { font: 400 12px var(--mono); text-transform: none; letter-spacing: 0; text-align: left; }

/* ---------- log ---------- */
.logbar .btn { flex: 1; font-size: 14px; }
.logview {
  margin-top: 8px; height: min(60dvh, 520px); min-height: 240px;
  overflow-y: auto; background: #04060a; border: 1px solid var(--line);
  font: 400 12.5px/1.5 var(--mono); padding: 6px 0;
}
.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); }

/* ---------- shared bits for the batch-1 tabs ---------- */
.mt { margin-top: 8px; }
.wfull { width: 100%; }
.btn.danger { color: var(--bad); border-color: rgba(255, 84, 104, 0.45); }
.btn.armed { background: rgba(255, 84, 104, 0.16); border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: 0.5; cursor: default; }
.warnnote { color: var(--warn); border-left: 2px solid var(--warn); padding-left: 10px; }
.empty { margin: 8px 0 0; font-size: 15px; color: var(--dim); }
h3.sec.first { margin-top: 12px; }
code { font: 400 13px var(--mono); color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.seg .btn { border-left-width: 0; font-size: 15px; }
.seg .btn:first-child { border-left-width: 1px; }
.seg.many { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0; }
.seg.many .btn { border-left-width: 1px; margin: 0 -1px -1px 0; }

/* offline banner: the hotspot hint */
.offline .otxt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.offline .otxt b { font-weight: 600; }
.offline .otxt small { font-size: 13px; letter-spacing: 0.03em; color: #ffc2ca; line-height: 1.3; }
.offline .otxt em { font-style: normal; color: var(--text); font-weight: 600; }
.offline .sq { flex: none; align-self: flex-start; margin-top: 4px; }

/* ---------- DRIVE ---------- */
.chips { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 10px; }
.chips .btn.chip { align-items: flex-start; text-align: left; padding: 8px 10px; min-height: 58px; }
.chips .btn.chip b { font-size: 15px; letter-spacing: 0.08em; }
.chips .btn.chip small { text-transform: none; letter-spacing: 0.02em; font-size: 12px; }
.chips .btn.chip:not(.on) { color: var(--dim); }
.chips .btn.chip:not(.on) b { text-decoration: line-through; text-decoration-color: var(--mute); }
.chips.off { opacity: 0.45; }
.lastsaid { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l t" "q t"; gap: 2px 10px; align-items: center; margin-top: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lastsaid span { grid-area: l; font-size: 12px; letter-spacing: 0.22em; color: var(--dim); }
.lastsaid b { grid-area: q; font-size: 16px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.lastsaid .btn { grid-area: t; min-width: 76px; }
.lastdrive .ld-when { font: 400 13px var(--mono); color: var(--text); margin-bottom: 8px; }
.ld-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.ld-c { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ld-c b { font-size: 28px; font-variant-numeric: tabular-nums; color: var(--dim); }
.ld-c span { font-size: 12px; letter-spacing: 0.14em; color: var(--dim); }
.ld-c.alert b { color: #ff7d8d; } .ld-c.surv b { color: #5aa9ff; } .ld-c.score b { color: #ffd45e; } .ld-c.warn b { color: var(--warn); }
.ld-foot { font-size: 14px; color: var(--dim); margin-top: 8px; }
.park-row { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: center; }
.park-arrow { position: relative; width: 84px; height: 84px; border: 1px solid var(--line2); background: var(--panel); }
.park-arrow i { position: absolute; left: 50%; top: 12%; bottom: 12%; width: 0; transform-origin: 50% 50%; transition: transform 0.3s; }
.park-arrow i::before { content: ""; position: absolute; left: -2px; top: 10px; bottom: 0; width: 4px; background: var(--acc); }
.park-arrow i::after { content: ""; position: absolute; left: -11px; top: 0; border: 11px solid transparent; border-top: 0; border-bottom: 16px solid var(--acc); }
.park-arrow i { margin-left: 0; }
.park-txt { display: flex; flex-direction: column; gap: 3px; }
.park-txt b { font-size: 20px; letter-spacing: 0.03em; }
.park-txt small { font-size: 13px; color: var(--dim); }

/* ---------- GO ---------- */
.search { margin-top: 0; }
.search input { height: 54px; font-size: 16px; }
.gostat { min-height: 22px; margin-top: 6px; font-size: 14px; color: var(--dim); letter-spacing: 0.04em; }
.gostat.info { color: var(--acc); }
.gostat.ok { color: var(--ok); }
.gostat.warn { color: var(--warn); }
.gostat.err { color: var(--bad); }
.plist { display: flex; flex-direction: column; }
.place { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.place .pmain {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  min-height: 58px; padding: 8px 4px; text-align: left; background: none; border: 0; cursor: pointer; touch-action: manipulation;
}
.place .pmain:active { background: var(--panel2); }
.pmark { color: var(--acc); font-size: 15px; text-align: center; }
.place.fav .pmark { color: #ffd45e; }
.ptxt { display: flex; flex-direction: column; min-width: 0; }
.ptxt b { font-size: 17px; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptxt small { font-size: 13px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdist { font: 400 12px var(--mono); color: var(--dim); font-style: normal; white-space: nowrap; }
.pdist.far { color: var(--warn); }
.place .btn.hold.pdel { width: 84px; flex: none; min-height: 48px; padding: 2px 4px; border: 0; border-left: 1px solid var(--line); font-size: 12px; letter-spacing: 0.06em; line-height: 1.15; }
.pick { margin-top: 14px; padding: 14px; border: 1px solid var(--acc); background: var(--acc-dim); display: flex; flex-direction: column; gap: 3px; }
.pk-tag { font-size: 12px; letter-spacing: 0.26em; color: var(--acc); }
.pk-name { font-size: 24px; letter-spacing: 0.02em; line-height: 1.15; overflow-wrap: anywhere; }
.pk-sub { font-size: 14px; color: var(--dim); }
.pk-meta { font: 400 13px var(--mono); color: var(--text); margin-top: 2px; }
.pk-meta.far { color: var(--warn); }
.pk-note { font-size: 13px; color: var(--warn); min-height: 0; }
.pick .inrow input { background: var(--bg); }
.reply { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line2); border-left: 4px solid var(--dim); display: flex; flex-direction: column; gap: 2px; }
.reply b { font-size: 20px; letter-spacing: 0.1em; }
.reply span { font-size: 15px; color: var(--dim); }
.reply.ok { border-left-color: var(--ok); } .reply.ok b { color: var(--ok); }
.reply.err { border-left-color: var(--bad); } .reply.err b { color: var(--bad); }
.reply.warn { border-left-color: var(--warn); } .reply.warn b { color: var(--warn); }
.reply.info b { color: var(--acc); }
.kv b.good { color: var(--ok); }

/* ---------- CAMS ---------- */
.stage-note { margin-top: 12px; padding: 12px 14px; border: 1px dashed rgba(234, 240, 79, 0.6); }
.stage-note p { margin: 8px 0 0; font-size: 15px; color: var(--dim); }
.stage-tag { display: inline-block; font: 600 12px var(--mono); color: var(--warn); border: 1px solid rgba(234, 240, 79, 0.5); padding: 4px 8px; letter-spacing: 0.1em; }
.camdir { display: grid; grid-template-columns: minmax(120px, 150px) 1fr; gap: 12px; margin-top: 12px; align-items: start; }
.dial { position: relative; aspect-ratio: 1; border: 1px solid var(--line2); background:
  linear-gradient(var(--line), var(--line)) 50% 0 / 1px 100% no-repeat,
  linear-gradient(var(--line), var(--line)) 0 50% / 100% 1px no-repeat, var(--panel);
  touch-action: none; cursor: crosshair; }
.dial span { position: absolute; font-size: 13px; font-weight: 700; color: var(--dim); letter-spacing: 0.1em; background: var(--panel); padding: 0 3px; }
.dial .dn { left: 50%; top: 3px; transform: translateX(-50%); color: var(--acc); }
.dial .ds { left: 50%; bottom: 3px; transform: translateX(-50%); }
.dial .de { right: 3px; top: 50%; transform: translateY(-50%); }
.dial .dw { left: 3px; top: 50%; transform: translateY(-50%); }
.dial .arrow { position: absolute; left: 50%; top: 14%; bottom: 50%; width: 0; transform-origin: 50% 100%; pointer-events: none; }
.dial .arrow::before { content: ""; position: absolute; left: -2px; top: 12px; bottom: 0; width: 4px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.dial .arrow::after { content: ""; position: absolute; left: -10px; top: 0; border: 10px solid transparent; border-top: 0; border-bottom: 16px solid var(--acc); }
.dial .omni-mark { display: none; position: absolute; inset: 30%; align-items: center; justify-content: center; font: 600 13px var(--mono); font-style: normal; color: var(--acc); border: 1px dashed var(--acc); }
.dial.omni .omni-mark { display: flex; }
.dirside { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dirval { font: 600 16px var(--mono); color: var(--acc); min-height: 22px; }
#camDirs .btn { min-height: 44px; min-width: 44px; font-size: 14px; padding: 4px 0; }
.dirside .btn.sw { font-size: 13px; padding: 0 6px; gap: 6px; letter-spacing: 0.04em; min-width: 0; overflow: hidden; }
.dirside .swbox { width: 24px; flex: none; }
.dirside .btn.sw[data-state="on"] .swbox::after { left: 8px; }
.rule { border-left: 2px solid var(--line2); padding-left: 10px; }
.camedit { margin-top: 8px; padding: 12px; border: 1px solid var(--acc); display: flex; flex-direction: column; gap: 8px; }
.camedit b { font-size: 16px; letter-spacing: 0.14em; color: var(--acc); }
.camrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px 0 8px 8px; border-bottom: 1px solid var(--line); border-left: 2px solid var(--bad); }
.camrow.k1, .camrow.k2 { border-left-color: #5aa9ff; }
.camrow.editing { background: rgba(255, 63, 180, 0.08); }
.camid { font: 600 13px var(--mono); color: var(--dim); }
.camtxt { display: flex; flex-direction: column; min-width: 0; }
.camtxt b { font-size: 16px; letter-spacing: 0.08em; }
.camtxt small { font-size: 13px; color: var(--dim); }
.camrow .btn { min-height: 44px; font-size: 13px; padding: 4px 8px; }

/* ---------- DASH: the settings mirror ---------- */
.cfgstate { margin: 0 0 6px; font-size: 14px; color: var(--dim); min-height: 0; }
.cfgstate:empty { display: none; }
.cfgstate.loading { color: var(--acc); }
.cfgstate.unsupported, .cfgstate.error { color: var(--warn); border-left: 2px solid var(--warn); padding-left: 10px; }
.cfggrp { margin-top: 14px; }
.cfgg { margin: 0; padding: 6px 0; display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; letter-spacing: 0.24em; color: var(--acc); border-bottom: 1px solid var(--line2); }
.cfgg small { font: 400 12px var(--mono); letter-spacing: 0; color: var(--dim); }
.cfgrow { position: relative; border-bottom: 1px solid var(--line); }
.cfgrow .cfgkey { font: 400 12px var(--mono); color: var(--mute); letter-spacing: 0; }
.cfgrow.pending { border-left: 2px dashed var(--warn); padding-left: 8px; }
.cfgrow.pending .cfgv { color: var(--warn); }
.cfgrow.saved { animation: cfgok 0.9s ease-out; }
@keyframes cfgok { 0% { background: rgba(75, 227, 143, 0.18); } 100% { background: transparent; } }
.cfgint, .cfgenum { padding: 10px 2px 12px; display: flex; flex-direction: column; gap: 8px; }
.cfgh { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cfgh .tt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cfgh .tt b { font-size: 17px; letter-spacing: 0.1em; }
.cfgh .cfgv { font: 600 15px var(--mono); color: var(--acc); white-space: nowrap; }
.toggle.cfgrow .tt small.cfgkey { font-size: 12px; }
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 0; }
.stepper .btn { font-size: 24px; font-weight: 500; min-height: 46px; }
.stepper input[type="range"] { margin: 0 12px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; width: auto; min-width: 0; height: 46px; background: transparent; touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: var(--line2); }
input[type="range"]::-moz-range-track { height: 4px; background: var(--line2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 30px; margin-top: -13px; background: var(--acc); border: 0; border-radius: 0; box-shadow: 0 0 10px rgba(47, 227, 211, 0.5); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 30px; background: var(--acc); border: 0; border-radius: 0; }
input[type="range"]:focus { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 1px solid var(--text); }

/* ---------- tabs: bottom, in thumb reach ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  height: calc(var(--tabh) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--bg); border-top: 1px solid var(--line);
  transition: transform 0.2s ease-out;
}
.tabs button {
  position: relative; background: none; border: 0; border-right: 1px solid var(--line);
  font-size: 14px; font-weight: 600; letter-spacing: 0.06em; color: var(--dim); padding: 0;
  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); }

/* 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(234, 240, 79, 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(234, 240, 79, 0.3); }
.mockbar button { background: none; border: 0; border-right: 1px solid rgba(234, 240, 79, 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(234, 240, 79, 0.9), 0 0 22px rgba(234, 240, 79, 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; }
}

/* ---------- DASH > UPDATE (js/ota.js) ---------- */
.otacmp { display: grid; grid-template-columns: 48px 1fr; }
.otacmp .oc-g { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0 4px; }
.otacmp .oc-l { font-size: 13px; letter-spacing: 0.22em; color: var(--dim); }
.otacmp .oc-g em { font: normal 600 12px var(--font); letter-spacing: 0.2em; color: var(--acc); }
.otacmp .oc-r { display: contents; }
.otacmp .oc-r span { font-size: 12px; letter-spacing: 0.18em; color: var(--mute); padding: 4px 0; border-bottom: 1px solid var(--line); }
.otacmp .oc-r b { font: 600 14px var(--mono); padding: 3px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.otacmp .oc-r b.newer { color: var(--ok); }
.otacmp .oc-r b.same { color: var(--dim); }
.otacmp .oc-r b.older { color: var(--warn); }
.btn.filepick { cursor: pointer; }
.btn.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn.filepick:focus-within { outline: 1px solid var(--acc); outline-offset: -3px; }
.otafile { margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--line2); }
.otafile .kvlist .kv b { overflow-wrap: anywhere; }
.otawarn { font-size: 14px; line-height: 1.45; }
.otawarn b { color: var(--warn); letter-spacing: 0.08em; }
.otawarn em { font-style: normal; color: var(--text); }
.otarun { margin-top: 14px; }
.otasteps { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; border-left: 1px solid var(--line); }
.otasteps li { flex: 1 1 auto; text-align: center; padding: 7px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--mute); border: 1px solid var(--line); border-left: 0; white-space: nowrap; }
.otasteps li[data-st="done"] { color: var(--ok); }
.otasteps li[data-st="on"] { color: var(--acc); background: var(--acc-dim); box-shadow: inset 0 -2px 0 var(--acc); }
.otasteps li[data-st="fail"] { color: var(--bad); background: rgba(255, 84, 104, 0.12); box-shadow: inset 0 -2px 0 var(--bad); }
.otabar { position: relative; height: 10px; background: var(--panel); border: 1px solid var(--line2); }
.otabar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--acc); box-shadow: 0 0 12px rgba(47, 227, 211, 0.55); transition: width 0.25s linear; }
.otabar i.warn { background: var(--warn); box-shadow: none; }
.otabar i.bad { background: var(--bad); box-shadow: none; }
.otabar i.good { background: var(--ok); }
.otanums { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-top: 8px; font: 400 13px var(--mono); color: var(--dim); }
.otanums b { font: 700 22px var(--font); color: var(--text); letter-spacing: 0.04em; min-width: 3ch; }
.otamsg { margin: 10px 0 0; min-height: 20px; font-size: 15px; letter-spacing: 0.05em; line-height: 1.4; }
.otamsg.info { color: var(--text); }
.otamsg.ok { color: var(--ok); text-shadow: 0 0 10px rgba(75, 227, 143, 0.45); }
.otamsg.warn { color: var(--warn); text-shadow: 0 0 10px rgba(234, 240, 79, 0.4); }
.otamsg.err { color: var(--bad); text-shadow: 0 0 10px rgba(255, 84, 104, 0.45); }
.otamsg.rise { animation: otarise 0.45s cubic-bezier(.2, .7, .3, 1); }
@keyframes otarise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .otamsg.rise { animation: none; } .otabar i { transition: none; } }

/* ---------- TRIPS (js/trips.js, js/tripmap.js) ---------- */
.tpstat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px; }
.tprec { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: 0.14em; color: var(--dim); min-width: 0; }
.tprec .sq { width: 10px; height: 10px; flex: none; background: var(--line2); }
.tprec[data-state="rec"] { color: var(--bad); }
.tprec[data-state="rec"] .sq { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: beat 1.4s infinite; }
.tprec[data-state="idle"] { color: var(--ok); }
.tprec[data-state="idle"] .sq { background: var(--ok); }
.tprec[data-state="off"] { color: var(--warn); }
.tprec[data-state="off"] .sq { background: var(--warn); }
.tpspace { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tpspace span { font-size: 12px; letter-spacing: 0.22em; color: var(--dim); }
.tpspace b { font: 600 13px var(--mono); white-space: nowrap; }
.tpbar { height: 6px; }
.tpstat .note { margin: 0; }
.tpdl .otabar[hidden] + .otamsg { margin-top: 0; }
.tpdl { margin-top: 12px; padding: 10px 12px 8px; border: 1px solid var(--line2); border-left: 3px solid var(--acc); }
.tpdl-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.tpdl-h b { font-size: 14px; letter-spacing: 0.14em; }
.tpdl-h span { font: 400 12px var(--mono); color: var(--dim); }
.tpdl .otamsg { margin-top: 8px; font-size: 14px; min-height: 0; }
.tplist { display: flex; flex-direction: column; }
.tprow {
  --tone: var(--acc);
  width: 100%; display: flex; flex-direction: column; gap: 3px; text-align: left;
  padding: 10px 4px 10px 12px; background: none; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid var(--tone);
  cursor: pointer; touch-action: manipulation;
}
.tprow:active { background: var(--panel2); }
.tprow.s-phoneonly { --tone: var(--dim); }
.tprow.s-dl, .tprow.s-queued { --tone: var(--warn); }
.tprow.s-rec, .tprow.s-fail { --tone: var(--bad); }
.tprow.s-skip { --tone: var(--line2); }
/* GHOSTS (js/ghosts.js): a ghost still only on the dash is quiet; the armed one is pink, like ghost B lines */
.ghrow.s-dash { --tone: var(--dim); }
.tag.armed { --tone: #ff3fb4; color: #ff3fb4; text-shadow: 0 0 8px rgba(255, 63, 180, 0.5); }
#ghStop { margin-top: 10px; border-color: #ff3fb4; color: #ff3fb4; }
#ghMsg:empty { display: none; }
.gharm { display: flex; align-items: center; gap: 10px; font-size: 16px; letter-spacing: 0.14em; color: var(--dim); min-width: 0; padding: 6px 0; }
.gharm .sq { width: 10px; height: 10px; flex: none; background: var(--line2); }
.gharm[data-state="on"] { color: #ff3fb4; }
.gharm[data-state="on"] .sq { background: #ff3fb4; box-shadow: 0 0 10px #ff3fb4; animation: beat 1.4s infinite; }
.gharm[data-state="off"] { color: var(--text); }
.ghcmp { display: flex; flex-direction: column; gap: 6px; }
.ghcmp .btn { width: 100%; text-align: left; }
.ghcmp .btn small { text-transform: none; }
#ghSplits .ltr.split:active { background: var(--panel2); }
.tpr-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tpr-h b { font-size: 17px; letter-spacing: 0.04em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpr-tags { display: flex; gap: 4px; flex: none; }
.tag { font: normal 600 12px/1 var(--mono); letter-spacing: 0.04em; padding: 3px 5px; border: 1px solid var(--tone); color: var(--tone); }
.tag.pin { --tone: #ffd45e; }
.tag.sim { --tone: #c58bff; }
.tprow.s-phoneonly .tag.st, .tprow.s-skip .tag.st { color: var(--dim); border-color: var(--line2); }
.tpr-s { font: 400 13px var(--mono); color: var(--dim); }
.tprow.s-phone .tpr-s, .tprow.s-phoneonly .tpr-s { color: var(--text); }
.tpr-bar { position: relative; height: 3px; background: var(--line); margin-top: 3px; }
.tpr-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--warn); transition: width 0.25s linear; }
.tphead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 10px; }
.tpback { min-height: 44px; font-size: 14px; padding: 4px 12px; }
.tptitle { display: flex; flex-direction: column; min-width: 0; }
.tptitle b { font-size: 20px; letter-spacing: 0.06em; line-height: 1.1; overflow-wrap: anywhere; }
.tptitle small { font-size: 13px; color: var(--dim); letter-spacing: 0.03em; }
.tmapwrap { position: relative; margin: 0 -16px; height: min(52vh, 440px); min-height: 240px; background: #06080b; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tmap { position: absolute; inset: 0; overflow: hidden; }
.tmap-cv { width: 100%; height: 100%; display: block; }
.tpfit { position: absolute; right: 10px; top: 10px; z-index: 2; min-height: 44px; min-width: 52px; font-size: 13px; padding: 4px 12px; background: rgba(6, 8, 11, 0.85); }
.tmap-attr { font-size: 12px; color: var(--mute); text-align: right; padding: 4px 0 0; letter-spacing: 0.02em; }
.tmap .maplibregl-canvas:focus { outline: none; }
.tpmodes { margin-top: 10px; }
.tpmodes .btn { font-size: 14px; padding: 4px 2px; letter-spacing: 0.06em; min-height: 44px; }
.tplegend { margin-top: 10px; }
.tpl-bar { position: relative; height: 10px; border: 1px solid var(--line2); }
.tpl-lim { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); }
.tpl-ticks { position: relative; height: 18px; margin: 3px 0 0; font: 400 12px var(--mono); color: var(--dim); }
.tpl-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.tpl-ticks span:first-child { transform: none; }
.tpl-ticks span:last-child { transform: translateX(-100%); }
.tpl-note { font-size: 12px; color: var(--mute); letter-spacing: 0.03em; min-height: 0; }
.tpread { margin-top: 12px; display: flex; flex-direction: column; gap: 1px; }
.tpread b { font: 600 14px var(--mono); color: var(--text); }
.tpread span { font: 400 12px var(--mono); color: var(--dim); min-height: 15px; }
.tpgraph { display: block; width: 100%; height: 150px; margin-top: 6px; touch-action: pan-y; cursor: ew-resize; background: var(--panel); border: 1px solid var(--line); }
.tpkey { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--mute); letter-spacing: 0.04em; }
.tpkey .k-spd { color: var(--acc); } .tpkey .k-rpm { color: #c58bff; }
.tpstats { margin-top: 12px; }
.tpstats .ld-c b { color: var(--text); font-size: 24px; }
.tpstats .ld-c.hi b { color: var(--acc); }
.tpstats .ld-c.warn b { color: var(--warn); }
.tptab .grid .btn.hold span { font-size: 14px; }
.tptab .btn small { text-transform: none; }

/* ---------- LAPS (js/lapui.js): DRIVE panel, TRACKS, the lap table, compare, drawing a gate ---------- */
.lappanel { margin-top: 12px; padding: 10px 12px 12px; border: 1px solid var(--line2); border-left: 3px solid var(--acc); background: var(--panel); }
.lp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lp-h b { font-size: 16px; letter-spacing: 0.16em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-h span { font: 600 13px var(--mono); color: var(--dim); white-space: nowrap; }
.lp-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 6px; }
.lp-cur, .lp-delta { display: flex; flex-direction: column; min-width: 0; }
.lp-cur span, .lp-delta span { font-size: 12px; letter-spacing: 0.22em; color: var(--dim); }
.lp-cur b { font: 600 34px/1.1 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lp-delta { text-align: right; align-items: flex-end; }
.lp-delta b { font: 700 52px/1 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; }
.lp-delta[data-tone="good"] b { color: var(--ok); text-shadow: 0 0 18px rgba(75, 227, 143, 0.45); }
.lp-delta[data-tone="bad"] b { color: var(--bad); text-shadow: 0 0 18px rgba(255, 84, 104, 0.45); }
.lp-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.lp-row .kv b { font-size: 20px; font-variant-numeric: tabular-nums; }
.lappanel .btn.hold { min-height: 40px; font-size: 13px; margin-top: 10px; }

.lklist { display: flex; flex-direction: column; gap: 8px; }
.lktrack { padding: 10px 12px; border: 1px solid var(--line2); border-left: 3px solid var(--line2); }
.lktrack.on { border-left-color: var(--acc); }
.lk-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.lk-h b { font-size: 18px; letter-spacing: 0.08em; min-width: 0; overflow-wrap: anywhere; }
.tag.on { --tone: var(--acc); }
.lk-s { display: block; font: 400 13px var(--mono); color: var(--dim); margin-top: 2px; }
.lkg { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 6px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.lkg b { font: 600 14px var(--mono); color: var(--you); }
.lkg span { font: 400 13px var(--mono); color: var(--dim); }
.lkg .btn { min-height: 44px; min-width: 64px; font-size: 13px; padding: 4px 10px; }
.lktrack .grid .btn { font-size: 14px; }
.lktrack .btn small { text-transform: none; }

.laptable { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
.ltr { display: grid; gap: 0; width: 100%; min-width: max-content; padding: 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.ltr span { padding: 8px 6px; font: 400 14px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ltr.lth { cursor: default; }
.ltr.lth span { font: 600 12px var(--font); letter-spacing: 0.2em; color: var(--dim); padding: 6px; }
.ltr.lap:active { background: var(--panel2); }
.ltr .lk { color: var(--dim); }
.ltr .best { color: var(--acc); font-weight: 600; }
.ltr .bs { color: #c58bff; font-weight: 600; }
.ltr .flag { color: var(--warn); }
.ltr.picked { background: var(--panel); }
.k-best { color: var(--acc); } .k-bs { color: #c58bff; }
.tpkey .k-a { color: var(--acc); } .tpkey .k-b { color: #c58bff; } .tpkey .k-good { color: var(--ok); } .tpkey .k-bad { color: var(--bad); }
.tlcmp { margin-top: 12px; }
.cmpkey { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cmpkey b { font: 600 14px var(--mono); padding-left: 10px; border-left: 4px solid currentColor; }
.cmpkey .ca { color: var(--acc); } .cmpkey .cb { color: #c58bff; }
.tpgraph.cmpg { height: 130px; }
.tlcmp .tpkey { margin-bottom: 6px; }
.tldraw { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line2); border-left: 3px solid var(--acc); }
.tldraw .otamsg { margin: 0; min-height: 0; }
.tldraw .seg .btn { font-size: 14px; letter-spacing: 0.06em; }
.tldraw .seg .btn small { text-transform: none; }
#tlDrawBtn small { text-transform: none; }
.tpexp .btn { font-size: 14px; letter-spacing: 0.05em; padding: 6px 4px; }
.tphint b { color: var(--text); }
.kv b.good { color: var(--ok); }

/* ---------- wider screens ---------- */
@media (min-width: 560px) {
  .g3 { grid-template-columns: repeat(4, 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; }
}

/* MAKE GHOST (js/ghostmake.js): sharp, inline, no popups */
.mgpanel { margin-top: 10px; padding: 12px; border: 1px solid var(--line2); background: var(--panel); }
.mgpanel .ld-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .mgpanel .ld-grid { grid-template-columns: repeat(2, 1fr); } }
.mgpanel .tpstats .ld-c b { font-size: 20px; }
.mgprev { display: block; width: 100%; height: 170px; margin-top: 6px; background: var(--panel); border: 1px solid var(--line); }
.mgrun { margin-top: 12px; }
.mghandle { width: 22px; height: 22px; box-sizing: border-box; border: 2px solid #ffffff; background: #06080b; color: #ffffff;
  font: 700 12px/18px var(--mono); text-align: center; cursor: grab; touch-action: none; box-shadow: 0 0 10px rgba(255, 255, 255, 0.35); }
.mghandle:active { cursor: grabbing; }
.tpwarn { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--warn); border-left-width: 3px; color: var(--warn); }
.tpwarn b { display: block; font-size: 15px; letter-spacing: 0.08em; }
.tpwarn p { margin: 6px 0 0; font-size: 13px; color: var(--dim); }
.tpwarn .btn { margin-top: 8px; }
/* settings search: a hit that lives in another tab (js/cfg.js jumpRow) */
.cfgjump { display: block; width: 100%; text-align: left; margin-top: -1px; }
.cfgjump b { display: block; font-size: 15px; }
.cfgjump small { text-transform: none; }
.cfgtab .cfglist { margin-top: 4px; }
/* EVENTS: SAVE AS NEW GHOST on the newest ghost race result */
.evact { margin-top: 8px; min-height: 40px; font-size: 14px; }

/* ---------- DRIVE: the second screen (js/drivelive.js, js/livemap.js) ----------
   Full-bleed live screen on top, sized to the viewport between the bars; the rest of DRIVE below it in the
   usual 720 px column. Sharp rectangles and hairlines; the key numbers big; old values grey, dead ones "--". */
#app[data-tab="drive"] main { max-width: none; }
.tab[data-tab="drive"] > :not(#live) { max-width: 688px; margin-left: auto; margin-right: auto; }
#live {
  --lvh: calc(100dvh - var(--toph) - var(--tabh) - var(--safe-b));
  margin: -12px -16px 0; height: var(--lvh); min-height: 300px;
  display: flex; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line2);
  transition: opacity 0.15s ease-out;
}
.mock #live { --lvh: calc(100dvh - var(--toph) - var(--tabh) - var(--safe-b) - 36px); }
#live.xf { opacity: 0; }
.lv-top {
  flex: none; height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden;
}
#lvClock { font: 700 19px var(--font); letter-spacing: 0.06em; }
.lv-chip { font: 600 13px var(--mono); color: var(--dim); letter-spacing: 0; }
.lv-chip.old { color: var(--warn); }
.lv-chip.dead { color: var(--mute); }
.lv-fill { flex: 1; }
.lv-link { padding: 3px 7px; border: 1px solid var(--line2); color: var(--ok); }
.lv-link[data-state="old"] { color: var(--warn); border-color: rgba(234, 240, 79, 0.5); }
.lv-link[data-state="stale"], .lv-link[data-state="none"], .lv-link[data-state="off"] { color: var(--mute); border-style: dashed; }
/* the uplink path inside the LINK chip: a hairline-divided tag, square, no fill (WIFI = the board's radio, PI = the bridge) */
.lv-via { font: 700 13px var(--mono); padding-right: 6px; margin-right: 6px; border-right: 1px solid var(--line2); color: var(--dim); }
.lv-via[data-via="pi"] { color: var(--acc); }
#sUp[data-via="pi"] { color: var(--acc); }
#live[data-orient="port"] .lv-eta { display: none; }

.lv-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.lv-mapwrap { position: relative; flex: 1 1 auto; min-height: 150px; overflow: hidden; background: var(--bg); }
.lv-map, .lvm-base, .lvm-cv { position: absolute; inset: 0; width: 100%; height: 100%; }
.lvm-cv { display: block; }
.lvm-attr { position: absolute; right: 0; bottom: 0; z-index: 2; padding: 1px 6px; font: 500 12px var(--font); color: var(--mute); background: rgba(6, 8, 11, 0.75); }
.lv-side { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; }   /* shrinks (and scrolls) on a short phone: the map keeps its 330 px */
#live[data-orient="port"] .lv-side { max-height: 48%; }      /* the map a little taller (owner, 2026-11-25); the panels scroll */
#live[data-layout="parked"] .lv-side, #live[data-layout="parked"] .lv-foot { display: none; }
#live[data-layout="parked"] { height: auto; min-height: 0; }
#live[data-layout="parked"] .lv-mapwrap { flex: none; height: 34vh; min-height: 190px; }
#live[data-orient="land"][data-layout="parked"] .lv-mapwrap { flex: 1 1 auto; }   /* a row in landscape: the map needs a width (it had 0 on a desktop) */

.lv-p { padding: 8px 12px 9px; border-bottom: 1px solid var(--line); }
.lv-side .lv-p:last-child { border-bottom: 0; }
.lv-p h4 {
  margin: 0 0 4px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font: 600 12px var(--font); letter-spacing: 0.22em; color: var(--dim);
}
.age { font: 400 12px var(--mono); font-style: normal; color: var(--mute); letter-spacing: 0; white-space: nowrap; }
.age.old { color: var(--warn); }
.lv-note { font-size: 12px; color: var(--mute); letter-spacing: 0.04em; font-weight: 500; }
.lv-p.old b, .lv-p.old .lv-big, .lv-foot.old .lv-v, .lv-turn.old b { color: var(--mute) !important; }
.lv-p.dead b, .lv-foot.dead .lv-v, .lv-turn.dead b { color: var(--mute) !important; }

.lv-list { display: flex; flex-direction: column; }
.lv-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 0; }
.lv-row b { font: 700 21px var(--font); letter-spacing: 0.06em; }
.lv-row span { font: 600 18px var(--mono); color: var(--text); letter-spacing: 0; }
#live[data-orient="port"] .lv-row:nth-child(n+3) { display: none; }
.lv-kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lv-kv3 b { font: 700 24px var(--font); letter-spacing: 0.04em; }
.lv-kv2 { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 2px 10px; align-items: baseline; margin-top: 6px; }
.lv-kv2 span { font-size: 12px; letter-spacing: 0.2em; color: var(--dim); }
.lv-kv2 b { font: 700 22px var(--font); letter-spacing: 0.03em; }
[data-tone="good"] { color: var(--ok); }
[data-tone="bad"] { color: var(--bad); }
.lv-strip { display: block; width: 100%; height: 54px; }
.lv-then { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lv-then b { font: 700 22px var(--font); letter-spacing: 0.04em; }
.lv-then span { font: 600 16px var(--mono); color: var(--dim); }
.lv-big { display: block; font: 700 58px/1 var(--font); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.lv-table { font: 400 13px var(--mono); }
.lv-tr { display: grid; grid-template-columns: var(--lvcols, 34px 1.5fr 1fr 1fr 1fr); gap: 4px; padding: 2px 0; border-bottom: 1px solid var(--line); }
.lv-tr b { font-weight: 600; }
.lv-tr.best b, .lv-tr .bs { color: var(--ok); }
.lv-th { color: var(--dim); font-size: 12px; }

.lv-foot { flex: none; height: 44px; display: flex; align-items: center; gap: 14px; padding: 0 12px; border-top: 1px solid var(--line); }
.lv-v { font: 700 24px var(--font); letter-spacing: 0.05em; font-variant-numeric: tabular-nums; }
.lv-foot { overflow: hidden; white-space: nowrap; }
#live[data-orient="port"][data-layout="passenger"] #lvRpm { display: none; }
.lv-foot .btn { min-height: 34px; padding: 0 14px; font-size: 14px; }

/* over the map */
.lv-band {
  --tone: var(--bad);
  position: absolute; left: 0; right: 0; top: 0; z-index: 3; padding: 8px 12px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  background: rgba(36, 6, 12, 0.9); border-bottom: 3px solid var(--tone);
}
.lv-band.t-surv { --tone: #5aa9ff; background: rgba(6, 16, 36, 0.9); }
.lv-band b { font: 700 25px/1.05 var(--font); letter-spacing: 0.06em; color: var(--tone); text-transform: uppercase; }
.lv-band.slow b { font-size: 32px; }
.lv-band span { font-size: 16px; color: var(--text); }
#live[data-layout="nav"] .lv-band { top: auto; bottom: 0; border-bottom: 0; border-top: 3px solid var(--tone); }
.lv-turn {
  position: absolute; left: 0; top: 0; z-index: 2; max-width: 100%;
  display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px;
  background: rgba(6, 8, 11, 0.92); border-right: 1px solid var(--line2); border-bottom: 1px solid var(--line2);
}
.lv-turn canvas { width: 72px; height: 72px; flex: none; }
.lv-turn-t { display: flex; flex-direction: column; min-width: 0; }
.lv-turn-t b { font: 700 46px/1 var(--font); letter-spacing: 0.02em; }
.lv-turn-t span { font-size: 17px; letter-spacing: 0.06em; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-mode { position: absolute; left: 8px; bottom: 8px; z-index: 2; padding: 2px 6px; font: 600 12px var(--mono); color: var(--dim); background: rgba(6, 8, 11, 0.8); }
#live[data-layout="nav"] .lv-mode { display: none; }
.lv-mbtn {
  position: absolute; right: 8px; bottom: 8px; z-index: 2; min-height: 44px; min-width: 96px; padding: 0 10px;
  background: rgba(6, 8, 11, 0.86); border: 1px solid var(--line2); color: var(--text);
  font: 600 12px var(--mono); letter-spacing: 0.06em; cursor: pointer;
}
.lv-mbtn.on { color: var(--acc); border-color: var(--acc); }
.lv-centre { right: auto; left: 50%; transform: translateX(-50%); color: var(--acc); border-color: var(--acc); }
#live[data-layout="track"] .lv-mbtn:not(.lv-centre):not(.m3d-car):not(.m3d-chase) { display: none; }
.lv-dim {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px; text-align: center; background: rgba(6, 8, 11, 0.64);
}
.lv-dim b { font: 700 30px var(--font); letter-spacing: 0.2em; color: var(--text); }
.lv-dim span { font-size: 15px; color: var(--dim); letter-spacing: 0.04em; }
#live.stale .lv-side, #live.stale .lv-foot { opacity: 0.5; }

/* landscape: map left, panels right */
#live[data-orient="land"] .lv-body { flex-direction: row; }
#live[data-orient="land"] .lv-side { width: 36%; max-width: 420px; border-top: 0; border-left: 1px solid var(--line); }
#live[data-orient="land"][data-layout="track"] .lv-side { width: 46%; max-width: 520px; }
#live[data-orient="land"] .lv-turn canvas { width: 88px; height: 88px; }
#live[data-orient="land"] .lv-turn-t b { font-size: 58px; }
@media (orientation: landscape) and (max-height: 560px) {
  [data-tab="drive"] .top { display: none; }
  [data-tab="drive"] { --toph: 0px; --tabh: 44px; }
  .lander[data-tab="drive"] { --tabh: 0px; }
  .lander.chrome[data-tab="drive"] { --tabh: 44px; }
  .lv-top { height: 34px; }
  .lv-foot { height: 38px; }
  .lv-v { font-size: 21px; }
  .lv-big { font-size: 46px; }
  .lv-strip { height: 44px; }
  .lv-p { padding: 5px 12px 6px; }
}

/* ---------- every camera on the maps (js/cammap.js): a toggle per kind, the swatch = the map's marker ---------- */
.camkey { margin-top: 10px; }
.camkey .btn.ck { min-height: 44px; }
.ck-t { display: inline-flex; align-items: center; gap: 7px; }
.ck-sw { width: 12px; height: 12px; flex: none; background: var(--c); outline: 2px solid #000; }
.camkey .btn.ck.on { color: var(--text); border-color: var(--line2); background: var(--panel2); box-shadow: inset 0 -2px 0 var(--acc); }
.camkey .btn.ck.off { color: var(--mute); }
.camkey .btn.ck.off .ck-sw { background: transparent; outline: 1px solid var(--line2); }
.camkey .ck-n { text-transform: none; }
.camkey .ck-note { margin-top: 6px; }

/* ---------- JOIN: one ride the dash split at a long stop ---------- */
.tpjoin { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--acc); border-left-width: 3px; animation: joinin 0.5s ease-out; }
.tpjoin b { display: block; font-size: 15px; letter-spacing: 0.08em; color: var(--acc); text-shadow: 0 0 10px rgba(47, 227, 211, 0.45); }
.tpjoin p { margin: 6px 0 8px; font-size: 13px; color: var(--dim); }
@keyframes joinin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#tpJoinMsg { margin: 0 0 8px; color: var(--acc); text-shadow: 0 0 10px rgba(47, 227, 211, 0.4); }
.tag.join { --tone: var(--acc); }
.tpjoined { margin-top: 8px; }
.tpjoined .note { margin: 0; }

/* ---------- a ghost race, live (js/ghostlive.js): DRIVE's #lvGhost and the spectator page ---------- */
.gl-panel .gl-gap { font-size: 54px; }
.gl-gap.gl-word { font-size: 34px; letter-spacing: 0.06em; }
.gl-sub { min-height: 16px; margin-top: 3px; font: 600 13px var(--mono); color: var(--dim); letter-spacing: 0; }
.gl-splits { margin-top: 4px; }
.gl-split { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: baseline; padding: 2px 0; border-top: 1px solid var(--line); }
.gl-split span { font: 600 13px var(--mono); color: var(--dim); letter-spacing: 0; }
.gl-split b { font: 700 21px var(--font); letter-spacing: 0.03em; }
.gl-strip { margin-top: 5px; height: 46px; }
/* the result: glowing text that slides up over the map and fades -- never a box */
.gl-host { position: absolute; left: 0; right: 0; bottom: 16%; z-index: 5; display: flex; justify-content: center; pointer-events: none; }
.gl-res { display: flex; flex-direction: column; align-items: center; padding: 0 12px; text-align: center; animation: glres 6.5s cubic-bezier(.2, .7, .3, 1) forwards; }
.gl-res b { font: 700 56px/1 var(--font); letter-spacing: 0.08em; }
.gl-res span { margin-top: 6px; font: 600 16px var(--mono); color: var(--text); letter-spacing: 0; text-shadow: 0 0 6px #000, 0 0 2px #000; }
.gl-res.good b { color: var(--ok); text-shadow: 0 0 10px rgba(75, 227, 143, 0.95), 0 0 34px rgba(75, 227, 143, 0.55), 0 0 2px #000; }
.gl-res.bad b { color: var(--bad); text-shadow: 0 0 10px rgba(255, 84, 104, 0.95), 0 0 34px rgba(255, 84, 104, 0.55), 0 0 2px #000; }
@keyframes glres {
  0% { opacity: 0; transform: translateY(30px); }
  9% { opacity: 1; transform: none; }
  80% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-28px); }
}
@media (prefers-reduced-motion: reduce) { .gl-res { animation: fade 6.5s forwards; } }

/* ---------- SHARE LIVE (js/share.js) ---------- */
.lv-watch { color: var(--acc); }
.lv-watch.old { color: var(--warn); }
.seg5 .btn { padding-left: 2px; padding-right: 2px; font-size: 14px; letter-spacing: 0.04em; }
#shUrl { width: 100%; font: 400 13px var(--mono); letter-spacing: 0; }

/* ====================================================================================================================
   RESTRUCTURE (audit 2026-11-21): six tabs, sub-tabs, folds, the trip's panes, landscape DRIVE. Sharp rectangles,
   hairlines; every tap target 44 px or more.
   ==================================================================================================================== */
/* sub-tabs: a segmented row at the top of TRIPS and DASH */
.subtabs { position: sticky; top: var(--toph); z-index: 12; margin: -12px -16px 10px; padding: 8px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.subtabs .btn { min-height: 44px; font-size: 14px; letter-spacing: 0.08em; padding: 4px 2px; }
.subpane { animation: tabin 0.15s ease-out; }
.subpane > h3.sec.first:first-child, .subpane > .stage-note:first-child + h3.sec { margin-top: 4px; }

/* folds: a section that opens and closes; the closed head says what is inside */
.folds { display: flex; flex-direction: column; margin-top: 10px; }
.fold { border-bottom: 1px solid var(--line); }
.fold-h { position: relative; display: flex; align-items: center; width: 100%; min-height: 56px; padding: 8px 44px 8px 0; background: none; border: 0;
  text-align: left; cursor: pointer; color: var(--text); }
.fold-t { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.fold-t b { font-size: 16px; letter-spacing: 0.16em; }
.fold-s { font: 500 13px var(--mono); color: var(--dim); letter-spacing: 0; overflow-wrap: anywhere; }
.fold.open > .fold-h b { color: var(--acc); }
.fold.need .fold-s { color: var(--warn); }
.fold.live .fold-s { color: var(--acc); }
.fold-h .dplus { right: 12px; }
.fold.open > .fold-h .dplus::after { transform: rotate(90deg); opacity: 0; }
.fold-b { padding: 0 0 14px; }
.fold-b > h3.sec:first-child { margin-top: 2px; }
#fdSetup { order: 1; } #fdVoice { order: 2; } #fdShare { order: 3; } #fdPark { order: 4; }
#live[data-layout="parked"] ~ .folds #fdPark { order: 0; }          /* parked: WHERE I PARKED comes first */
.onehint { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.onehint .btn { min-height: 44px; padding: 4px 14px; font-size: 14px; flex: none; }

/* DRIVE: the camera key chip and the landscape edge handle over the live map */
.lv-keychip { position: absolute; right: 8px; top: 8px; z-index: 2; display: flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 8px;
  background: rgba(6, 8, 11, 0.86); border: 1px solid var(--line2); color: var(--dim); font: 600 12px var(--mono); letter-spacing: 0; cursor: pointer; }
.lv-keychip i { width: 9px; height: 9px; background: var(--c); margin-left: 3px; }
#live[data-layout="nav"] .lv-keychip, #live[data-layout="track"] .lv-keychip { top: auto; bottom: 8px; right: auto; left: 50%; transform: translateX(-50%); }
#live[data-layout="nav"] .lv-keychip { display: none; }
.lv-edge { display: none; position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; min-height: 64px; padding: 0;
  background: rgba(6, 8, 11, 0.86); border: 1px solid var(--line2); border-right: 0; color: var(--dim); font: 600 12px var(--mono); writing-mode: vertical-rl; letter-spacing: 0.12em; cursor: pointer; }
/* landscape DRIVE (D3): no tab bar, no top strip -- the speed / gear line always; TABS or an edge tap brings them back */
.lander .lv-edge { display: block; }
.lander[data-tab="drive"] .tabs { transform: translateY(110%); }
.lander.chrome[data-tab="drive"] .tabs { transform: none; }
.lander[data-tab="drive"] .lv-top { display: none; }
.lander.chrome[data-tab="drive"] .lv-top { display: flex; }
.lander[data-tab="drive"] .mockbar { display: none; }
.lander[data-tab="drive"] #live { --lvh: calc(100dvh - var(--tabh) - var(--safe-b)); }
.lander[data-tab="drive"] main { padding-bottom: calc(var(--tabh) + var(--safe-b)); }

/* GO */
.place .btn.hold.pdel > span { white-space: normal; }

/* DASH > SCREEN: zoom is minus / value / plus */
.zoom { display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; gap: 0; align-items: stretch; }
.zread { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line2); border-left: 0; border-right: 0; min-height: 56px; }
.zread b { font: 700 24px var(--font); letter-spacing: 0.06em; color: var(--acc); }
.zread small { font: 400 12px var(--mono); color: var(--dim); }
/* SETTINGS: the raw cfg key only in search results; CAMS' settings without group headers */
.cfgkey { display: none !important; }
#cfgList.filtering .cfgkey { display: block !important; }
.nogroups .cfgg { display: none; }
.nogroups .cfggrp { margin-top: 0; }
/* PAD: full screen from DASH > TOOLS */
[data-tab="pad"] .tabs, [data-tab="pad"] .mockbar { display: none; }
[data-tab="pad"] .padtab { bottom: var(--safe-b); }
.padback { flex: none; min-height: 40px; padding: 0 12px; font-size: 14px; }

/* EVENTS: filter chips; every drive opens with its summary */
.evfilt { margin: 0 0 6px; }
.evfilt .btn { min-height: 44px; font-size: 14px; letter-spacing: 0.08em; }
.evgrp .lastdrive { margin: 4px 0 8px; }
.evgrp .ld-grid .ld-c b { font-size: 22px; }
.ev[data-n] .evd { color: var(--dim); }
.evnone { margin: 6px 0; }

/* TRIPS: the list */
.tpstat { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.tpstat .tpbar { flex: 1 0 100%; }
.tphrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: end; }
.tphrow h3.sec { margin-bottom: 6px; }
.tphrow .btn { min-height: 44px; font-size: 13px; padding: 4px 10px; margin-bottom: 4px; }
.tpweek { margin: 12px 0 4px; font: 600 12px var(--font); letter-spacing: 0.22em; color: var(--dim); }
.tplist > .tpweek:first-child { margin-top: 2px; }
.tpolder { margin-top: 6px; border-top: 1px solid var(--line); }
.tpnotes { font-size: 13px; }
.srlive { justify-content: flex-start; text-align: left; min-height: 56px; }
.srlive b { font: 600 14px var(--mono); letter-spacing: 0; }

/* TRIPS > a trip: sticky head + panes; the map on top of every pane */
.tpsticky { position: sticky; top: var(--toph); z-index: 12; margin: -12px -16px 0; padding: 8px 16px 0; background: var(--bg); }
.tpsticky .tphead { margin-bottom: 6px; }
.tppanes { margin: 0 -16px; padding: 0 16px 8px; border-bottom: 1px solid var(--line); }
.tppanes .btn { min-height: 44px; font-size: 13px; letter-spacing: 0.04em; padding: 4px 0; }
.pane-off { display: none !important; }
.tmapwrap .tpmodes { position: absolute; left: 8px; right: 70px; top: 10px; z-index: 2; margin: 0; }
.tmapwrap .tpmodes .btn { background: rgba(6, 8, 11, 0.86); font-size: 12px; letter-spacing: 0.02em; }
.rp-on #tpModes { display: none !important; }              /* the replay's own trail picker drives both (one picker) */
#hlHost { margin-top: 10px; }
.hl-grid { display: flex !important; grid-template-columns: none !important; overflow-x: auto; overscroll-behavior-x: contain; gap: 0; scrollbar-width: none; }
.hl-grid::-webkit-scrollbar { display: none; }
.hl-grid .hl-t { flex: 0 0 auto; min-width: 128px; max-width: 168px; }
.hl-cardrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.tpkeep .btn { min-height: 56px; font-size: 13px; }
#tlSave { font-size: 14px; }
#mgSpacing { white-space: normal; overflow-wrap: anywhere; }
/* lap table: never loses its last column at 360 px -- tighter cells, the table scrolls inside itself if it must */
.laptable .ltr span { padding: 8px 4px; font-size: 13px; }
/* corner squares on the map: the 24 px mark, a 44 px hit area */
.ckmark { position: relative; }
.ckmark::before { content: ""; position: absolute; inset: -10px; }
@media (orientation: landscape) and (max-height: 560px) {
  .tabs button { min-height: 44px; }
  /* a trip: map left, the pane right */
  #tpDetail:not([hidden]) .tpbody { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 0 14px; align-items: start; }
  #tpDetail .tpmapcol { position: sticky; top: calc(var(--toph) + 104px); }
  #tpDetail .tmapwrap { margin: 0; height: calc(100dvh - var(--toph) - var(--tabh) - 120px); min-height: 180px; }
  #tpDetail .tptitle small { display: none; }
}
/* the camera-key chip steps aside for an alert band */
.lv-band:not([hidden]) ~ .lv-keychip { display: none; }
.tpnotes span:not(:empty)::after { content: " · "; }
/* drawing a gate: the instruction on the map itself */
.tldrawhint { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 8px 12px; background: rgba(6, 8, 11, 0.9); border-top: 2px solid var(--acc);
  font: 600 14px var(--font); letter-spacing: 0.04em; color: var(--text); }
.tldrawhint.warn { border-top-color: var(--warn); color: var(--warn); }
.tldrawhint.ok { border-top-color: var(--ok); }
.dirside .grid.g2 { grid-template-columns: 1fr; }
.padback { min-height: 44px; }
.padbar .vpadind, .padbar .padread { min-height: 44px; }
.lv-foot .btn { min-height: 44px; }
@media (orientation: landscape) and (max-height: 560px) { .lv-foot { height: 44px; } }

/* ---------- reactions rising over a live map (the spectator page's #wPop, DRIVE's #lvChat): glowing text, no box ---------- */
.rx-pop { position: absolute; left: 10px; right: 10px; bottom: 58px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start;
  gap: 2px; pointer-events: none; }
.rx-line { display: flex; align-items: baseline; gap: 8px; max-width: 100%; white-space: nowrap; overflow: hidden;
  animation: rxrise 6s cubic-bezier(.2, .7, .3, 1) forwards; }
.rx-line b { font: 700 15px var(--font); letter-spacing: 0.14em; color: var(--acc); text-shadow: 0 0 8px rgba(47, 227, 211, 0.9), 0 0 3px #000, 0 0 2px #000; }
.rx-line span { font: 700 20px var(--font); letter-spacing: 0.08em; color: var(--text); overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(230, 236, 243, 0.7), 0 0 3px #000, 0 0 2px #000; }
@keyframes rxrise {
  0% { opacity: 0; transform: translateY(14px); }
  8% { opacity: 1; transform: none; }
  75% { opacity: 1; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-30px); }
}
@media (prefers-reduced-motion: reduce) { .rx-line { animation: fade 6s forwards; } }

/* ---------- SHARE LIVE: who is watching, the chat (js/sharechat.js) ---------- */
.lv-chat { bottom: 54px; }            /* above CRUISE · AUTO and TRACK-UP */
.sh-viewers { border-top: 1px solid var(--line); }
.sh-v { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; min-height: 52px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.sh-v b { font: 700 17px var(--font); letter-spacing: 0.12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-v span { font: 600 13px var(--mono); color: var(--dim); letter-spacing: 0; }
.sh-v.muted b { color: var(--mute); }
.sh-v.muted span { color: var(--warn); }
.sh-mute { min-height: 40px; min-width: 88px; font-size: 14px; }
.w-feed { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-height: 252px; overflow-y: auto; overscroll-behavior: contain; }
.w-feed0 { margin: 0; padding: 10px 2px; font-size: 13px; color: var(--mute); letter-spacing: 0.03em; }
.w-fl { display: flex; align-items: baseline; gap: 10px; min-height: 34px; padding: 6px 2px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.w-fl b { flex: none; font: 700 15px var(--font); letter-spacing: 0.12em; color: var(--dim); }
.w-fl span { font: 700 17px var(--font); letter-spacing: 0.08em; color: var(--text); }
/* SHARE LIVE: the ride replay for viewers (relay 2026-11-23.1) */
.sh-ride { border-top: 1px solid var(--line); padding-top: 8px; }
.sh-ride .note { margin: 4px 0 6px; }
#shEnd small { display: block; }

/* ---------- the map control (js/map3d.js): ONE row on every map -- VIEW · CAMERA · HEADING, each with what is on.
   A tap opens that one's options in a sharp panel right above the row (over the bottom of the map; a choice or the same
   button again folds it). Lit = on / open, dashed = not available here (a tap says why, as glowing text). Along the
   map's bottom edge (thumb reach), the map running under it as before; --m3dh = the row's height, fixed here (no
   measuring: nothing moves when it opens), and what sits on that edge stands above it. */
.m3d-host { --m3dh: 53px; }
.m3d { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 4px; background: rgba(6, 8, 11, 0.9); border-top: 1px solid var(--line2); }
.m3d.over { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; }
.m3d-g { display: flex; gap: 4px; }
.m3d-row > .m3d-b { flex: 1 1 0; min-width: 0; }
.m3d-b {
  min-height: 44px; min-width: 44px; padding: 0 4px; background: transparent; border: 1px solid var(--line2);
  color: var(--dim); font: 600 12px var(--mono); letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation;
  white-space: nowrap; overflow: hidden; text-overflow: clip;
}
.m3d-b.on { color: var(--acc); border-color: var(--acc); background: var(--acc-dim); }
.m3d-b.off { color: var(--mute); border-style: dashed; }
.m3d-b.on.off { background: transparent; }
.m3d-b:active { border-color: var(--acc); }
/* the row's buttons: the caption small, what is on under it */
.m3d-m { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.15; }
.m3d-m small { font: 600 12px var(--mono); letter-spacing: 0.08em; color: var(--mute); }
.m3d-m b { font: 600 12px var(--mono); color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.m3d-m.on b, .m3d-m.on small { color: var(--acc); }
.m3d-m.off b { color: var(--mute); }
/* a panel: right above the row, over the bottom of the map */
.m3d-pan {
  position: absolute; left: 0; right: 0; bottom: 100%; z-index: 5; display: flex; flex-direction: column; gap: 4px;
  padding: 6px 4px 4px; background: rgba(6, 8, 11, 0.96); border-top: 1px solid var(--acc);
}
.m3d-pan[hidden] { display: none; }
.m3d-set-h { font: 600 11px var(--mono); letter-spacing: 0.08em; color: var(--mute); }
.m3d-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.m3d-th {
  display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; background: transparent; border: 1px solid var(--line2);
  color: var(--dim); font: 600 12px var(--mono); cursor: pointer; text-align: left; touch-action: manipulation;
}
.m3d-th.on { color: var(--acc); border-color: var(--acc); background: var(--acc-dim); }
.m3d-sw { flex: none; width: 26px; height: 26px; border: 1px solid var(--line2); }
.m3d-th b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* BROWSE: the way back, where RE-CENTRE sits (RE-CENTRE itself has nothing to do then) */
.m3d-car { right: auto; left: 50%; transform: translateX(-50%); color: var(--acc); border-color: var(--acc); bottom: calc(var(--m3dh, 53px) + 8px); z-index: 3; }
.m3d-browsing .lv-centre, .m3d-browsing .rprecentre { display: none !important; }
/* 3RD ORBIT: the way back to the chase angle, where RE-CENTRE sits (it has nothing to do then); off the car in the middle */
.m3d-chase { left: auto; right: 8px; transform: none; color: var(--acc); border-color: var(--acc); bottom: calc(var(--m3dh, 53px) + 8px); z-index: 3; }
.m3d-orbit3 .lv-centre, .m3d-orbit3 .rprecentre { display: none !important; }
.fs-on .m3d-chase { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
/* MOTION / ROAD: a labelled row in the VIEW panel */
.m3d-lab { align-items: stretch; }
.m3d-rl { flex: 0 0 62px; display: flex; align-items: center; font: 600 11px var(--mono); letter-spacing: 0.08em; color: var(--mute); }
#lvMapWrap .lv-mbtn, #lvMapWrap .lv-mode, #wMapWrap .lv-mbtn { bottom: calc(var(--m3dh, 53px) + 8px); }
#lvMapWrap .lvm-attr, #wMapWrap .lvm-attr { bottom: calc(var(--m3dh, 53px) + 1px); left: 0; text-align: right; }
/* the attribution (two lines with SAT + TERRAIN) sits on the row; the chips and buttons step over it */
#lvMapWrap:has(.lvm-attr:not([hidden])) .lv-mbtn, #lvMapWrap:has(.lvm-attr:not([hidden])) .lv-mode, #wMapWrap:has(.lvm-attr:not([hidden])) .lv-mbtn { bottom: calc(var(--m3dh, 53px) + 46px); }
#lvMapWrap .lv-chat { bottom: calc(var(--m3dh, 53px) + 54px); }
#lvMapWrap .rx-pop, #wMapWrap .rx-pop { bottom: calc(var(--m3dh, 53px) + 58px); }
#live[data-layout="nav"] #lvMapWrap .lv-band { bottom: var(--m3dh, 53px); }
#live[data-layout="track"] #lvMapWrap .lv-keychip { bottom: calc(var(--m3dh, 53px) + 8px); }
.tmapwrap .rprecentre { bottom: calc(var(--m3dh, 53px) + 10px); }
/* every map tall enough for the control's tallest panel (VIEW) to open in full above the row (owner, 2026-11-25: "the
   settings buttons are cut off by the top of the map") */
.lv-mapwrap.m3d-host { min-height: 330px; }
#live[data-layout="parked"] .lv-mapwrap.m3d-host { height: max(34vh, 330px); }
.w-mapwrap.m3d-host { min-height: 330px; }
.tmapwrap.m3d-host { min-height: 330px; }
@media (orientation: landscape) and (max-height: 560px) { .lv-mapwrap.m3d-host { min-height: 0; } }

/* ---------- FULLSCREEN (js/fullmap.js): the map fills the screen, the page's data rides over it as a HUD ----------
   FULL / EXIT at the end of the control's row; in fullscreen the row folds to MAP + EXIT at the bottom-right corner (MAP
   unfolds it). The HUD slots: a strip on top (time, GPS, link), a column at the side (landscape / desktop) or a sheet
   above the foot (portrait), the speed line at the foot, REPLAY's player at the bottom. Sharp translucent panels with
   hairlines, readable over any theme and SAT. */
.m3d-row > .m3d-fs { flex: 0 0 56px; }
.m3d-mini { display: none; }
.fs-on { background: #000; }
.fs-css { position: fixed !important; inset: 0 !important; z-index: 2000; width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  min-height: 0 !important; max-height: none !important; margin: 0 !important; }
html.fs-open, html.fs-open body { overflow: hidden; }
.fs-on .lv-map, .fs-on .tmap { inset: 0; height: 100%; }
.fs-on .m3d.over { z-index: 8; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
.fs-on .m3d-mini { display: flex; flex: 0 0 64px; align-items: center; justify-content: center; }
.fs-on .m3d:not(.m3d-unfold) .m3d-main > .m3d-m { display: none; }
.fs-on .m3d.over:not(.m3d-unfold) { left: auto; right: max(8px, env(safe-area-inset-right)); bottom: max(8px, env(safe-area-inset-bottom)); border: 1px solid var(--line2); }
.fs-on .m3d-car { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
.fs-hud { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.fs-slot { position: absolute; pointer-events: auto; background: rgba(6, 8, 11, 0.62); border: 1px solid rgba(44, 56, 70, 0.9); overflow: auto; overscroll-behavior: contain; }
.fs-slot[hidden] { display: none; }
.fs-top { top: 0; left: 0; right: 0; border-width: 0 0 1px; padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); overflow: hidden; }
.fs-top .lv-top { background: transparent; border: 0; }
.fs-foot { left: max(8px, env(safe-area-inset-left)); bottom: max(8px, env(safe-area-inset-bottom)); overflow: hidden; }
.fs-foot .lv-foot { background: transparent; border: 0; height: auto; min-height: 44px; padding: 4px 12px; }
.fs-foot .lv-foot .lv-fill, .fs-foot #lvMounted { display: none; }
/* the side: one compact box at the top right by default -- the nearest camera ahead (the lap clock / the ghost race when
   they run), a MORE chip; MORE opens the column (landscape / desktop) or the sheet (portrait) with the rest */
.fs-side { right: max(8px, env(safe-area-inset-right)); top: 52px; width: auto; min-width: 58px; min-height: 48px; max-width: min(320px, 46%); max-height: 34%; padding-right: 56px; }
.fs-side.fs-more { bottom: 66px; width: min(340px, 34%); max-height: none; padding-right: 0; padding-top: 48px; }
.fs-more-b { position: absolute; top: 4px; right: 4px; min-width: 48px; min-height: 40px; padding: 0 6px; background: transparent;
  border: 1px solid var(--line2); color: var(--dim); font: 600 12px var(--mono); cursor: pointer; z-index: 1; }
.fs-more .fs-more-b { color: var(--acc); border-color: var(--acc); }
.fs-side:not(.fs-more) .lv-side > .lv-p:not(#lvAhead):not(#lvLap):not(#lvGhost) { display: none !important; }
.fs-side:not(.fs-more) .lv-side { display: block !important; zoom: 1 !important; }
.fs-side:not(.fs-more) .lv-p { border: 0; padding: 4px 10px; }
.fs-side:not(.fs-more) .lv-p h4 { display: none; }
.fs-side:not(.fs-more) .w-feed, .fs-side:not(.fs-more) .w-info:empty { display: none !important; }

.fs-side .lv-side { max-height: none !important; width: auto !important; border: 0; overflow: visible; }
.fs-side .lv-p { background: transparent; border-bottom: 1px solid rgba(44, 56, 70, 0.7); }
/* the HUD's AHEAD: only the nearest camera (kind, limit, distance); nothing at all when none is ahead (owner, 2026-11-25:
   "the map not crowded") -- the list under the map stays whole */
.fs-side #lvAhead[data-n="0"] { display: none; }
.fs-side #lvAheadList > .lv-row:not(:first-child) { display: none; }
.fs-bottom { left: max(8px, env(safe-area-inset-left)); bottom: 66px; width: min(560px, calc(100% - 16px)); max-height: calc(100% - 130px); padding: 6px 8px 8px; }
.fs-bottom .rp { margin: 0; }
.fs-bottom .rp > :not(.rpdash):not(.rpread):not(.rpscrub):not(.rpctl):not(.rprace) { display: none !important; }
.fs-bottom .rprace > :not(.rpdelta) { display: none !important; }
.fs-bottom .rpdash { height: 112px; }
.fs-bottom .rpscrub { height: 64px; }
.fs-bottom .rpdelta { height: 72px; }
.fs-bottom .rpctl { margin-top: 6px; }
/* the warning band: glowing text over the map, never a filled box (the owner's SLOW DOWN rule) */
.fs-on .lv-band { top: 52px; background: transparent !important; border: 0 !important; pointer-events: none; }
.fs-on .lv-band b { text-shadow: 0 0 10px var(--tone), 0 0 26px var(--tone); }
.fs-on .lv-band span { text-shadow: 0 0 6px #000, 0 0 12px #000; }
.fs-on .lv-keychip { top: 52px; }
/* the spectator's gauges + reactions */
.fs-foot .w-gauges { background: transparent; border: 0; }
.fs-side .w-feed { max-height: none; border: 0; }
.fs-side .w-info { background: transparent; }
.fs-on .lv-mode, .fs-on .lv-edge { display: none !important; }
.fs-on .w-legend { top: 52px; }
.fs-on .w-fit { top: auto; right: auto; left: max(8px, env(safe-area-inset-left)); bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
/* portrait: the panels drop down from under the top strip (the car rides low in the view: TRACK puts it 2/3 down), the
   warning glows above the speed line */
@media (orientation: portrait) {
  .fs-side.fs-more { left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); width: auto; top: 44px; bottom: auto; max-height: 40%; }
  .fs-side:not(.fs-more) { top: 44px; max-width: min(300px, 76%); }
  .fs-more .lv-side { display: grid; grid-template-columns: 1fr 1fr; }
  .fs-side .lv-side > .lv-p[hidden] { display: none; }
  .fs-more .lv-side { zoom: 0.8; }                     /* two columns on a phone: the panels' own type, a size down */
  .fs-bottom { right: max(8px, env(safe-area-inset-right)); width: auto; max-height: 56%; }
  .fs-on .lv-band { top: auto; bottom: 130px; }
  .fs-on .w-legend { top: 52px; left: 8px; }
}
.tmapwrap .ckmark { z-index: 2; }
/* MY CAR (DRIVE SETUP): the 14 models, two columns */
.mycar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 10px; }
.mycar-b { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 52px; padding: 6px 10px; text-align: left; }
.mycar-b b { font: 700 16px var(--font); letter-spacing: 0.08em; }
.mycar-b small { font: 500 12px var(--mono); letter-spacing: 0; text-transform: none; color: var(--mute); }

/* a route planned on this phone (js/webroute.js): the turn card says so, with the router's credit (FOSSGIS usage policy) */
.lv-turn-src { margin-top: 3px; font: 600 11px var(--mono); letter-spacing: 0.03em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-turn-src.warn { color: var(--warn); }
.lv-turn.web { border-left: 3px solid var(--route); }
.reply .btn { margin-top: 8px; }
.reply .credit, .credit { margin-top: 6px; font: 600 11px var(--mono); letter-spacing: 0.03em; color: var(--mute); }
/* the fullscreen HUD: the next turn as ONE line under the strip (the HUD's own style: a hairline, the map through it) --
   a small arrow, the distance, the maneuver and street; the phone route's credit trails it, smaller */
.fs-on .lv-turn { top: 52px; left: max(8px, env(safe-area-inset-left)); max-width: calc(54% - 16px); padding: 3px 10px 3px 4px; gap: 8px;
  background: rgba(6, 8, 11, 0.62); border: 1px solid rgba(44, 56, 70, 0.9); }
.fs-on .lv-turn.web { border-left: 3px solid var(--route); }
.fs-on .lv-turn canvas, #live[data-orient="land"] .fs-on .lv-turn canvas { width: 30px; height: 30px; }
.fs-on .lv-turn-t { flex-direction: row; align-items: baseline; gap: 10px; white-space: nowrap; }
.fs-on .lv-turn-t b, #live[data-orient="land"] .fs-on .lv-turn-t b { font-size: 26px; text-shadow: 0 0 8px rgba(0, 0, 0, 0.9); }
.fs-on .lv-turn-t span { font-size: 15px; min-width: 0; }
.fs-on .lv-turn-t .age { display: none; }
.fs-on .lv-turn-t span { flex: 1 1 auto; }
/* the credit rides just under the line, like a map's attribution (glowing text, no box), so the line stays one line */
.fs-on .lv-turn-src { position: absolute; left: 0; top: 100%; margin-top: 3px; font-size: 10px; color: var(--dim); text-shadow: 0 0 4px #000, 0 0 2px #000; }
@media (orientation: portrait) {
  .fs-on .lv-turn { top: 98px; right: max(8px, env(safe-area-inset-right)); max-width: none; }
}
/* js/update.js: a newer publish exists -- one slim sharp button, top-right, over every tab (never a popup) */
.newver { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 8px); right: 8px; z-index: 9999;
  padding: 8px 12px; background: var(--bg); color: var(--acc); border: 1px solid var(--acc); border-radius: 0;
  font: 600 12px var(--mono); letter-spacing: 0.12em; box-shadow: 0 0 12px var(--acc); cursor: pointer; }

/* ---------- TRIPS > VAULT: the encrypted trip backup (js/vault.js) ---------- */
.vault { --vault: #cfd8e3; }
.vastat { display: flex; align-items: center; gap: 10px; padding: 10px 0 4px; font-size: 16px; letter-spacing: 0.14em; }
.vastat .sq { width: 10px; height: 10px; flex: none; background: var(--line2); }
.vastat[data-state="open"] { color: var(--ok); }
.vastat[data-state="open"] .sq { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.vastat[data-state="locked"] .sq { background: var(--vault); box-shadow: 0 0 8px var(--vault); }
.vastat[data-state="none"] { color: var(--dim); }
.vafp { margin-left: auto; font: 600 13px var(--mono); letter-spacing: 0.08em; color: var(--vault); }
.vaform { display: flex; flex-direction: column; gap: 12px; padding: 6px 0 10px; }
.vawarn { margin: 0; padding: 10px 12px; border-left: 3px solid var(--warn); background: var(--panel); font-size: 15px; line-height: 1.35; color: var(--text); }
.vawarn b { display: block; color: var(--warn); letter-spacing: 0.06em; margin-bottom: 4px; }
.vameter { position: relative; height: 6px; background: var(--panel); border: 1px solid var(--line2); margin-top: -4px; }
.vameter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--bad); transition: width 0.2s linear; }
.vameter[data-level="fair"] i { background: var(--warn); }
.vameter[data-level="good"] i, .vameter[data-level="strong"] i { background: var(--ok); box-shadow: 0 0 10px rgba(75, 227, 143, 0.5); }
.vameter-t { font: 400 12px var(--mono); color: var(--dim); margin-top: -6px; }
#vaRememberNote:empty, #vaMsg:empty { display: none; }
#vaOpenBits, #vaDashPush { margin: 6px 0; }
#vaReset { margin-top: 10px; }
.tag.vault { --tone: var(--ok); }
.tprow.s-vault { --tone: #cfd8e3; }
.tprow.s-vault .tag.st { --tone: #cfd8e3; }
@media (prefers-reduced-motion: reduce) { .vameter i { transition: none; } }
/* THE KEY ALERT (js/vault.js paintAlert, docs/SECURITY-REVIEW-VAULT-RELAY.md M1): on every tab, loud, square, red hairlines */
.vaalert { margin: 10px 0 4px; padding: 12px 14px; border: 1px solid var(--bad); border-left: 4px solid var(--bad); background: #1a0b0f;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 0 18px rgba(255, 84, 104, 0.18); }
.vaalert[data-kind="ask"] { border-color: var(--warn); background: var(--panel); box-shadow: none; }
.vaalert-h { font-size: 18px; letter-spacing: 0.12em; line-height: 1.25; color: var(--bad); }
.vaalert[data-kind="ask"] .vaalert-h { color: var(--warn); }
.vaalert-fp { font: 600 15px var(--mono); letter-spacing: 0.08em; color: var(--text); }
.vaalert-s { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.4; color: var(--text); }
.vaalert-s li { margin: 2px 0; }
.vaalert .btn { margin: 2px 0 0; }
.vaalert .otamsg:empty { display: none; }
#tpDlUnlock { margin: 8px 0 2px; }

/* TRIP QUALITY (js/tripq.js): the CHECK badge, the trip view's line, the off-road dash on the map is in js/tripmap.js */
.tag.chk { --tone: var(--warn); }
.tpr-q { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font: 400 12px var(--mono); color: var(--dim); }
.tpr-q .tag { white-space: nowrap; }
.tpqual { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--ok); font: 400 13px/1.35 var(--mono); color: var(--dim); }
.tpqual[data-state="check"] { border-left-color: var(--warn); color: var(--text); }
.tpqual[data-state="check"] b { color: var(--warn); font-weight: 600; letter-spacing: 0.04em; }
.tpqual b { color: var(--ok); font-weight: 600; letter-spacing: 0.04em; }
/* SELECT: several trips at once (delete from the phone / the vault) */
.tpsel { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--line2); border-left: 3px solid var(--warn); display: flex; flex-direction: column; gap: 8px; }
.tpsel-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tpsel-h b { font-size: 15px; letter-spacing: 0.12em; }
.tpsel-h span { font: 400 12px var(--mono); color: var(--dim); }
.tpsel .grid { margin: 0; }
.tpsel .otamsg:empty { display: none; }
.tplist.selecting .tprow { padding-left: 34px; position: relative; }
.tplist.selecting .tprow::before { content: ""; position: absolute; left: 9px; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1px solid var(--line2); background: none; }
.tplist.selecting .tprow.picked::before { border-color: var(--warn); background: var(--warn); box-shadow: inset 0 0 0 3px var(--bg, #06080b); }
.tplist.selecting .tprow.picked { background: var(--panel); }
#tpSelBtn[aria-pressed="true"] { border-color: var(--warn); color: var(--warn); }
.tpdelall { margin-top: 10px; }
.tpdelall small { display: block; font-size: 12px; letter-spacing: 0.03em; text-transform: none; color: var(--dim); }
