/* ==========================================================================
   ORION E-Scooter UI
   Design system — dark, neutral, precise.
   Tokens first, one spacing rhythm (4/8), real type hierarchy, restrained
   motion. Every functional selector from previous versions is preserved.
   ========================================================================== */

@font-face {
  font-family: Montserrat;
  src: url("escooter/assets/fonts/montserrat-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url("escooter/assets/fonts/montserrat-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url("escooter/assets/fonts/montserrat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: Montserrat;
  src: url("escooter/assets/fonts/montserrat-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces */
  --bg: #0e0e10;
  --panel: #151518;
  --panel-2: #1b1b1f;
  --sunken: #121215;
  /* lines */
  --line: #26262b;
  --line-2: #34343b;
  /* type */
  --text: #f2f2f4;
  --muted: #9d9da7;
  --muted-2: #73737d;
  --fg: #0e0e10;
  /* status (semantic only — never decorative) */
  --ok: #31c48d;
  --ok-dim: #1c4a37;
  --wait: #d9a50f;
  --danger: #e5484d;
  /* geometry */
  --sans: Montserrat, system-ui, -apple-system, sans-serif;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .22);
  --dur: .16s;
}

* { box-sizing: border-box; }
html {
  color-scheme: dark;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  min-height: 100svh;
}
body.is-pairing,
body.is-modal { overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: #2e2e36; color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2c2c32; border-radius: 99px; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* buttons and tappables: no grey flash, no accidental refresh */
button, .btn, .tabs button, .seg button, .sw, .chk, .faq summary {
  touch-action: manipulation;
}

/* —— app frame —— */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
}

/* —— top bar —— */
.top {
  position: sticky; top: 0; z-index: 40;
  background: rgba(14, 14, 16, .96);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0);
}
.top-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
  padding: 12px 20px 10px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 16px;
  letter-spacing: -0.02em;
  min-width: 0;
}
.logo {
  width: 30px; height: 30px;
  display: block;
  object-fit: contain;
  background: transparent;
  filter: none !important;
}
.logo.lg {
  width: 68px; height: 68px;
  margin: 0 auto 16px;
  animation: logoIn .4s ease-out;
}
.brand .ver {
  color: var(--muted); font-weight: 500; font-size: 11px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  letter-spacing: 0;
}
.meta {
  display: flex; gap: 8px; align-items: center;
  color: var(--muted); font-size: 12px; font-weight: 500;
  flex-wrap: wrap; justify-content: flex-end;
}
.sn {
  max-width: 11ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--sunken);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
body.is-live .status-chip {
  border-color: #23503f;
  color: var(--ok);
  background: #0f1c17;
}
body.is-pairing .status-chip {
  border-color: #51420f;
  color: var(--wait);
}
.pill.charge { color: var(--ok); border-color: #23503f; background: #0f1c17; }
.pill.unlock { color: var(--ok); border-color: #23503f; }
.pill.lock { color: var(--muted); }
.cells {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.cell {
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 2px;
  text-align: center;
}
.cell b { display: block; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cell span { color: var(--muted); font-size: 10px; font-weight: 500; }
.cell.low { border-color: #55242b; color: #ff8a93; background: #190d10; }
.cell.hi { border-color: #23503f; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #3c3c44; transition: background .2s ease; flex: 0 0 auto; }
.dot.on { background: var(--ok); animation: glow 2.4s ease-in-out infinite; }
.dot.wait { background: var(--wait); animation: pulse 1.1s ease-in-out infinite; }

.banner {
  display: none; margin: 0; padding: 9px 20px; font-size: 12px; font-weight: 500;
  background: #26120f; color: #ffb3ae; border-bottom: 1px solid #48201d;
}
.banner.show { display: block; animation: dropIn .2s ease; }
.banner.ok {
  background: #0f211a;
  color: #93e6c0;
  border-bottom-color: #23503f;
}

/* —— tabs (desktop strip / mobile bottom bar) —— */
/* bottom app bar — every viewport, like a native app */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; gap: 0; padding: 0 0 env(safe-area-inset-bottom, 0px);
  background: rgba(14, 14, 16, .96);
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 1 0; min-width: 52px;
  border: 0; background: transparent; color: var(--muted-2);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 2px 7px; font-weight: 600; font-size: 10.5px; letter-spacing: .01em;
  white-space: nowrap; border-bottom: 0;
  transition: color .15s ease;
  user-select: none;
}
.tabs button:hover { color: var(--muted); }
.tabs button.active { color: var(--text); }
.tabs button .tab-ic { display: block; width: 22px; height: 22px; }
.tab-ink {
  display: none;
  position: absolute; bottom: 0; left: 0; height: 2px; width: 0;
  pointer-events: none; opacity: 0;
  background: var(--text);
  border-radius: 2px 2px 0 0;
  transition: transform .3s cubic-bezier(.3, .9, .4, 1), width .3s cubic-bezier(.3, .9, .4, 1), opacity .25s ease;
}
.tab-ink.ready { opacity: 1; }

/* nav progress bar */
.vex-bar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  z-index: 90; pointer-events: none; opacity: 0;
  background: rgba(242, 242, 244, .85);
  transition: width .42s cubic-bezier(.2, .9, .25, 1), opacity .3s ease;
}
.vex-bar.go { opacity: .9; }

/* —— main column —— */
.main {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 24px 22px 96px;
  flex: 1;
  position: relative;
}
.view { display: none !important; }
.view.active, .view.leave { display: block !important; }
.view.active { animation: viewIn .26s ease-out; }
.view.leave {
  position: absolute; left: 0; right: 0; top: 0;
  pointer-events: none;
  animation: viewOut .2s ease-in forwards;
}

.page-head { margin-bottom: 20px; }
h2 { font-size: 24px; margin: 0 0 6px; font-weight: 600; letter-spacing: -0.02em; }
h2 .ver { color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: 0; }
.lead { color: var(--muted); margin: 0 0 18px; font-size: 13px; font-weight: 400; }
.page-head .lead { margin: 0; }
.note { color: var(--muted); font-size: 12px; margin: 10px 0 0; font-weight: 400; }
.note:empty { display: none; }
.note.ok { color: var(--ok); }
.note.err { color: #ff8a93; }
.warn {
  color: #eba3a7;
  font-size: 12px;
  margin: 10px 0 0;
  font-weight: 400;
  line-height: 1.55;
}

/* —— cards —— */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  margin-bottom: 12px;
  transition: border-color var(--dur) ease;
}
.card:hover { border-color: var(--line-2); }
.card h3 {
  margin: 0 0 14px; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.card.fold { padding-bottom: 14px; }
.card.fold > h3 {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  padding: 2px 0;
  min-height: 28px;
  border-radius: 6px;
  transition: color .15s ease;
}
.card.fold > h3:hover { color: var(--text); }
.card.fold > h3:after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .22s ease, border-color .15s ease;
  flex: 0 0 auto;
}
.card.fold > h3:hover:after { border-color: var(--text); }
.card.fold.is-open > h3 { margin-bottom: 14px; }
.card.fold.is-open > h3:after { transform: rotate(225deg); }
.card.fold.is-open > :not(h3) { animation: foldIn .3s ease-out; }
.card.fold:not(.is-open) > :not(h3) { display: none !important; }
.card.fold .fold-hint {
  display: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  margin-left: auto;
  margin-right: 10px;
}
.card.fold:not(.is-open) > h3 .fold-hint { display: inline; }
.card.is-locked { position: relative; }

/* —— rows, buttons, segmented —— */
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.wrap { margin-top: 12px; }
.k {
  color: var(--muted); font-size: 12px; font-weight: 500;
  min-width: 44px;
}
.actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 0 1 auto; }

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  min-height: 40px;
  font-weight: 600; font-size: 13px;
  background: var(--text); color: var(--fg);
  transition: background var(--dur) ease, border-color var(--dur) ease, color var(--dur) ease, opacity var(--dur) ease, transform .08s ease;
}
.btn:hover { background: #e4e4e7; }
.btn:active { transform: scale(.985); }
.btn.ghost {
  background: transparent; color: var(--text);
  border-color: var(--line-2);
}
.btn.ghost:hover { background: var(--panel-2); border-color: #43434c; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #f05a5f; }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 12px; border-radius: var(--r-sm); }
.btn.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; min-width: 36px;
  height: 36px; min-height: 36px;
  padding: 0;
}
.btn.ico svg { display: block; }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; }
.btn.is-on, .seg button.is-on {
  background: var(--text); color: var(--fg); border-color: var(--text);
}
.btn.is-on:hover { background: #e4e4e7; }
a.btn { display: inline-block; text-decoration: none; text-align: center; }

.seg {
  display: flex; gap: 3px; flex-wrap: wrap;
  padding: 3px; background: var(--sunken);
  border: 1px solid var(--line); border-radius: 11px;
}
.seg button {
  flex: 1; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  padding: 9px 8px; font-size: 12px; font-weight: 600;
  transition: color .15s ease, background .15s ease;
  min-width: 64px;
}
.seg button:hover { color: var(--text); }
.seg button.is-on { background: var(--text); color: var(--fg); }
.seg button:disabled { opacity: .38; cursor: not-allowed; }
.model-seg { margin: 0 auto 14px; max-width: 380px; }
.lang-seg { padding: 2px; gap: 2px; }
.lang-seg button { min-width: 36px; padding: 6px 8px; font-size: 11px; }

.foc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 12px;
  margin: 8px 0 4px;
}
.foc-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.foc-grid input {
  width: 100%;
  background: var(--sunken);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 9px;
  font-variant-numeric: tabular-nums;
}

/* body states: HUD / kiosk / hidden SN */
body.is-hud .tabs, body.is-hud .stats, body.is-hud .card, body.is-hud .foot,
body.is-kiosk .tabs button:not([data-view="dash"]) { display: none !important; }
body.is-kiosk .tabs button[data-view="dash"] { pointer-events: none; }
body.hide-sn .sn, body.hide-sn #liveSn, body.hide-sn #fcSn { filter: blur(6px); }
body.is-hud .cluster { margin: 0; border: 0; background: transparent; box-shadow: none; }
.kv-stack#tripHist div, .kv-stack#flashHist div { font-size: 12px; }

/* —— controls (sliders, selects) —— */
.ctrl {
  display: grid; grid-template-columns: 1fr auto;
  gap: 4px 12px; align-items: baseline; margin: 0 0 14px;
}
.ctrl label { font-weight: 500; font-size: 13px; }
.ctrl .val { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.ctrl input[type=range] {
  grid-column: 1 / -1;
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 99px;
  background: #2c2c32; outline: none;
}
.ctrl input[type=range].hot { background: #55242b; }
.ctrl input[type=range].hot::-webkit-slider-thumb { background: var(--danger); }
.ctrl input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); border: 0;
  box-shadow: 0 0 0 3px rgba(242, 242, 244, .1);
}
.ctrl input[type=range]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); border: 0;
}
.ctrl select {
  grid-column: 1 / -1;
  width: 100%;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.ctrl select:focus { outline: none; border-color: var(--muted); }
.ctrl input[type=text] {
  grid-column: 1 / -1; width: 100%;
  background: var(--sunken); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px;
  padding: 10px 12px; font: inherit; font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ctrl input[type=text]:focus { outline: none; border-color: var(--muted); }
input[type=file] { display: none !important; }

/* —— key/value lists —— */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.kv div {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: baseline; border-bottom: 1px solid #1e1e23; padding: 9px 0;
  border-radius: 6px;
  transition: background .15s ease;
}
.kv div:hover { background: rgba(255, 255, 255, .02); }
.kv span { color: var(--muted); font-size: 12px; font-weight: 400; }
.kv b { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.kv b.cfw { color: var(--ok); }
.kv a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); padding-bottom: 1px; }
.kv a:hover { border-bottom-color: var(--text); }

.swatch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; }
.swatch.dense { grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .swatch, .kv { grid-template-columns: 1fr; } }

/* switches — neutral: white = on */
.sw { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; padding: 8px 0; }
.sw input { position: absolute; opacity: 0; pointer-events: none; }
.sw i {
  flex: 0 0 36px; height: 20px; border-radius: 99px;
  background: #2c2c32; position: relative;
  transition: background .16s ease;
}
.sw i:after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #9d9da7; top: 2px; left: 2px; transition: transform .16s ease, background .16s ease;
}
.sw input:checked + i { background: var(--text); }
.sw input:checked + i:after { transform: translateX(16px); background: var(--fg); }
.sw span { font-size: 13px; }

/* —— live cluster (speedometer) —— */
.cluster {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px; padding: 8px 12px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.gauge {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 260 / 178;
  height: auto;
  overflow: visible;
}
.gauge svg { width: 100%; height: 100%; display: block; overflow: visible; position: relative; z-index: 1; }
.g-track, .g-fill { fill: none; stroke-width: 11; stroke-linecap: round; }
.g-track { stroke: #1f1f24; }
.g-fill {
  stroke: var(--text);
  stroke-dasharray: 427;
  stroke-dashoffset: 427;
  transition: stroke-dashoffset .12s linear, stroke .2s ease;
}
.g-ptrack, .g-pfill { fill: none; stroke-width: 5; stroke-linecap: round; }
.g-ptrack { stroke: #1b1b20; }
.g-pfill {
  stroke: var(--muted);
  stroke-dasharray: 352;
  stroke-dashoffset: 352;
  transition: stroke-dashoffset .2s linear, stroke .2s ease;
}
.g-tick { stroke: #3e3e46; stroke-width: 1.5; stroke-linecap: round; }
.g-tick.maj { stroke: #8b8b95; stroke-width: 2.2; }
.g-lab {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: middle;
}
.g-lim { fill: var(--text); stroke: var(--bg); stroke-width: 1.5; opacity: 0; }
.gauge .readout {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 54%;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.speed {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: clamp(48px, 14vw, 72px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.speed small {
  font-size: 10px;
  color: var(--muted);
  margin: 4px 0 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.watts {
  margin-top: 6px;
  font-size: clamp(15px, 4.6vw, 20px);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.watts small { font-size: 10px; color: var(--muted); margin-left: 4px; font-weight: 500; }
.watts.hot { color: var(--danger); }
.sess {
  margin: 2px 0 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.spark { display: block; width: 100%; height: 44px; margin: 0 0 8px; }
.trip {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid #1e1e23;
}
.trip-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.trip-k { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.trip-time {
  margin-right: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 13px; font-weight: 600;
}
#btnTripRec.is-on {
  background: var(--danger); color: #fff; border-color: var(--danger);
  animation: recPulse 1.6s ease-in-out infinite;
}
.trip-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px;
}
.trip-grid div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.trip-grid b {
  font-size: 18px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.trip-grid span { color: var(--muted); font-size: 11px; font-weight: 400; }
.meta-line {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 10px 0 0; color: var(--muted); font-size: 12px;
}
.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600; font-size: 11px;
  background: var(--sunken);
}

/* —— stat tiles —— */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
@media (max-width: 640px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 12px 12px;
  transition: border-color var(--dur) ease;
}
.stat:hover { border-color: var(--line-2); }
.stat .n { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .n small { font-size: 11px; color: var(--muted); margin-left: 4px; font-weight: 500; letter-spacing: 0; }
.stat .l {
  color: var(--muted); font-size: 10px; font-weight: 600;
  margin-top: 4px; letter-spacing: 0.09em; text-transform: uppercase;
}
.bat {
  height: 3px; background: #2c2c32; border-radius: 99px;
  margin-top: 10px; overflow: hidden;
}
.bat > i {
  display: block; height: 100%; width: 0;
  background: var(--ok);
  transition: width .45s ease, background .3s ease;
}
.stat.low .n { color: #ff8a93; }
.stat.low .bat > i { background: var(--danger); }
.tick { animation: tick .28s ease; }

/* —— gate (connect screen) —— */
.center { text-align: center; padding: 36px 0 28px; animation: viewIn .26s ease-out; }
.gate-shot {
  background: transparent;
  border-radius: 0;
  padding: 4px 8px 8px;
  margin: 0 auto 18px;
  max-width: 360px;
  box-shadow: none;
  perspective: 900px;
}
/* el hero fijo está retirado: en su lugar vive el carrusel .ring.
   #gateShot queda en el DOM (app.js le escribe) pero NUNCA se pinta. */
#gateShot { display: none !important; }
#gateTitle { font-size: 26px; margin-bottom: 8px; }
#idleActions { margin-top: 6px; }
#idleActions .btn { min-height: 44px; min-width: 112px; }
#btnConnect { min-width: 156px; padding: 12px 22px; }
#live.enter { animation: viewIn .26s ease-out; }

.bar { height: 4px; background: #1f1f24; border-radius: 99px; overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--text); transition: width .15s linear; }
.ota-bar { height: 6px; margin: 18px 0 10px; }

.drop {
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  padding: 28px; text-align: center; color: var(--muted); margin-bottom: 12px;
  transition: border-color var(--dur) ease, color var(--dur) ease, background var(--dur) ease;
}
.drop:hover, .drop.over { border-color: #5a5a64; color: var(--text); background: var(--panel-2); }

.log {
  font-size: 12px; background: var(--sunken);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px;
  min-height: 220px; max-height: 440px; overflow: auto; color: #a2a2ab; white-space: pre-wrap;
  font-weight: 400;
}
.log .err { color: #ff8a93; }
.log .ok { color: var(--ok); }
.diag {
  font-size: 11px;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 12px 0 0;
  max-height: 280px;
  overflow: auto;
  color: #a2a2ab;
  white-space: pre-wrap;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  background: var(--sunken);
  transition: color .15s ease, border-color .15s ease;
}
.chip button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font-size: 14px;
  line-height: 1;
}

/* —— footer —— */
.foot {
  border-top: 1px solid var(--line);
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  color: var(--muted); font-size: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.foot-links { display: inline-flex; gap: 6px; align-items: center; }
.linklike { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12px; padding: 0; }
.linklike:hover, .linklike:focus-visible { color: var(--text); }

/* —— about —— */
.about-head { text-align: center; margin-bottom: 24px; }
.about-logo {
  width: 64px; height: 64px;
  margin: 8px auto 14px;
  display: block;
  background: transparent;
  filter: none !important;
}
.about-copy {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  margin: 0;
}
.card .about-copy + .actions { margin-top: 16px; }
.kv-stack { grid-template-columns: 1fr; }
.people { display: grid; gap: 0; }
.people > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 12px 0;
}
.people > div + div { border-top: 1px solid var(--line); }
.p-who { display: grid; gap: 3px; }
.p-who span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.p-who b { font-weight: 600; font-size: 19px; letter-spacing: -0.02em; }
.p-dc {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.p-dc svg { width: 14px; height: 14px; flex: none; color: #5865f2; }

/* —— overlays & sheets —— */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: center;
  background: rgba(8, 8, 10, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn .16s ease;
  overflow: auto;
  padding: 16px 0;
}
.overlay.legal {
  z-index: 100;
  background: var(--bg);
  padding: 24px 16px;
  align-items: start;
  overflow: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.legal-sheet {
  width: min(480px, calc(100% - 32px));
  margin: auto;
  text-align: left;
  padding: 32px 28px 26px;
}
.legal-sheet h2 { text-align: center; }
.legal-sheet .about-logo { margin-bottom: 10px; }
.legal-body {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  margin: 14px 0 0;
}
.legal-body p { margin: 0 0 12px; }
.legal-body p:last-child { margin-bottom: 0; }
.legal-sheet .warn { text-align: center; margin: 16px 0 12px; }
.legal-sheet #legalGo { width: 100%; min-height: 44px; margin-top: 0; }
.legal-agree { padding: 10px 0 0; }
.legal-agree span { color: var(--text); }
.overlay[hidden] { display: none !important; }
body:not(.is-legal) #legalOverlay { display: none !important; }

.sheet {
  width: min(360px, calc(100% - 24px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px 26px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: sheetIn .2s ease-out;
}
.sheet h2 { margin-bottom: 6px; }
.sheet .lead { margin: 0 0 8px; min-height: 1.3em; white-space: pre-wrap; word-break: break-word; }
.sheet .btn { margin-top: 8px; min-width: 120px; }
#btnCancelWait { position: relative; z-index: 2; min-height: 44px; width: 100%; }
.sheet.danger { border-color: #55242b; }
.sheet.danger h2 { color: #ff8a93; }

/* —— pairing visuals —— */
.pair-visual {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
}
.pair-visual > * {
  grid-area: 1 / 1;
  place-self: center;
}
.spin-wrap {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  animation: spin .8s linear infinite;
}
.spin { width: 44px; height: 44px; display: block; }
.spin-wrap[hidden], .pwr[hidden] { display: none !important; }
.spin .track { fill: none; stroke: #2c2c32; stroke-width: 3; }
.spin .arc {
  fill: none; stroke: var(--text); stroke-width: 3;
  stroke-linecap: round; stroke-dasharray: 34 80;
}
.pwr {
  position: relative;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  color: var(--text);
}
.pwr svg { width: 22px; height: 22px; position: relative; z-index: 1; }
.pwr-pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--text);
  animation: radar 1.6s ease-out infinite;
}
.pwr-pulse:before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--text);
  animation: radar 1.6s ease-out infinite .45s;
}
.steps {
  display: flex; justify-content: center; align-items: center;
  gap: 8px; margin: 18px 0 22px; height: 8px;
}
.steps i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3c3c44;
  transition: background .2s ease, transform .2s ease;
}
.steps i.done { background: var(--text); }
.steps i.now { background: var(--text); transform: scale(1.3); }

/* —— model grid (legacy picker + overlays) —— */
.models {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 560px) {
  .models { grid-template-columns: 1fr 1fr 1fr; }
}
.model {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
  transition: border-color var(--dur) ease;
}
.model:hover { border-color: var(--line-2); }
.model.is-now { border-color: #4a4a54; }
.model-shot {
  background: var(--sunken);
  height: 118px;
  display: grid;
  place-items: center;
  padding: 8px 10px;
}
.model-shot img {
  max-width: 100%;
  max-height: 102px;
  object-fit: contain;
  display: block;
}
.model-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 10px 12px 12px;
}
.model-meta b { font-size: 13px; font-weight: 600; }
.model-meta span { color: var(--muted); font-size: 11px; font-weight: 500; }
.model.is-now .model-meta span { color: var(--ok); }
body:not(.model-g3):not(.model-f3pro) [data-g3-only] { display: none !important; }
body:not(.model-zt3) [data-zt3-only] { display: none !important; }
body:not(.model-f3) [data-f3-only] { display: none !important; }
body:not(.model-g3):not(.model-f3):not(.model-zt3) [data-stock-only] { display: none !important; }
body:not(.model-g3):not(.model-zt3) [data-flash-only] { display: none !important; }
body.model-g3 [data-nocfw], body.model-zt3 [data-nocfw] { display: none !important; }
body:not(.model-g3):not(.model-f3) [data-cble] { display: none !important; }

/* card: custom BLE studio */
.card.cble { border-color: var(--line); }
.card.cble .btn { text-decoration: none; display: inline-block; }
.card.cble .cble-tag {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 99px;
  border: 1px solid var(--line-2); color: var(--muted);
  font-size: 10px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
}

/* —— keyframes —— */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(49, 196, 141, .09); }
  50% { box-shadow: 0 0 0 6px rgba(49, 196, 141, .14); }
}
@keyframes radar {
  0% { transform: scale(1); opacity: .5; }
  100% { transform: scale(1.55); opacity: 0; }
}
@keyframes viewIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes viewOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translate3d(0, -6px, 0); }
}
@keyframes foldIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes tick {
  0% { opacity: .4; }
  100% { opacity: 1; }
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .35); }
  50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes vexRing {
  0%   { transform: scale(.72); opacity: 0; }
  35%  { opacity: .5; }
  100% { transform: scale(1.25); opacity: 0; }
}
@keyframes vexLogoIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes vexLoad {
  0%   { transform: translateX(-105%); }
  100% { transform: translateX(260%); }
}
@keyframes vexDrop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes vexUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes whichIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* staggered card entrance (polish.js) */
.vex-in { animation: riseIn .4s ease-out both; animation-delay: calc(var(--i, 0) * 24ms); }
/* live numbers: intentionally no pop — calm, formal */

/* boot entrance */
html.vex-ready .main { animation: vexUp .55s .05s ease-out both; }

/* —— guide & help (v1600) —— */
.help {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: #a6a6af;
  font-size: 12.5px;
  line-height: 1.6;
  font-weight: 400;
  margin: -4px 0 14px;
  text-align: left;
}
.help:empty { display: none; }
.help:before {
  content: "i";
  flex: 0 0 auto;
  width: 15px; height: 15px; margin-top: 1px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 600;
  color: var(--muted);
}
.gate-help { max-width: 480px; margin: 16px auto 0; }

.link-quiet {
  display: inline-block;
  margin-top: 18px;
  background: none; border: 0;
  color: var(--muted);
  font-size: 12.5px; font-weight: 500;
  border-bottom: 1px dashed var(--line-2);
  padding: 2px 0;
  transition: color .15s ease, border-color .15s ease;
}
.link-quiet:hover { color: var(--text); border-bottom-color: var(--text); }
.link-quiet.sm { margin: 0 0 16px; font-size: 12px; }

.steps-list { list-style: none; counter-reset: st; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps-list li {
  counter-increment: st;
  position: relative;
  padding: 11px 13px 11px 44px;
  border-radius: 10px;
  background: var(--sunken);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.55;
  transition: border-color var(--dur) ease;
}
.steps-list li:hover { border-color: var(--line-2); }
.steps-list li:before {
  content: counter(st);
  position: absolute;
  left: 12px; top: 11px;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--text); color: var(--fg);
  font-size: 11px; font-weight: 600;
}

.checklist { display: grid; gap: 8px; }
.chk {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunken);
  cursor: pointer;
  font-size: 13px;
  transition: border-color var(--dur) ease;
}
.chk:hover { border-color: var(--line-2); }
.chk input { position: absolute; opacity: 0; pointer-events: none; }
.chk i {
  width: 19px; height: 19px; flex: 0 0 auto;
  border: 1.5px solid var(--line-2);
  border-radius: 6px;
  display: grid; place-items: center;
  transition: background .15s ease, border-color .15s ease;
}
.chk i:after {
  content: "";
  width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid var(--fg);
  border-bottom: 2px solid var(--fg);
  transform: rotate(-45deg) scale(.4);
  opacity: 0;
  transition: opacity .12s ease, transform .18s ease;
}
.chk input:checked + i { background: var(--text); border-color: var(--text); }
.chk input:checked + i:after { opacity: 1; transform: rotate(-45deg) scale(1); }
.chk input:checked ~ span { color: var(--muted); text-decoration: line-through; text-decoration-color: #45454e; }
.chk:focus-within { border-color: var(--line-2); }

.glist, .gloss { display: grid; gap: 8px; }
.glist > div, .gloss > div {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--sunken);
  transition: border-color var(--dur) ease;
}
.glist > div:hover, .gloss > div:hover { border-color: var(--line-2); }
.glist b, .gloss b { font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; }
.glist span, .gloss span { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.gloss > div { grid-template-columns: 120px 1fr; }
.gloss b { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
@media (max-width: 560px) {
  .glist > div, .gloss > div { grid-template-columns: 1fr; gap: 5px; }
}

.bullets { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.bullets li { position: relative; padding-left: 20px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.bullets li:before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 5px; height: 5px; border-radius: 50%; background: #4a4a53;
}

.faq { display: grid; gap: 8px; }
.faq details { border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 12px 14px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  transition: color .15s ease;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:after {
  content: ""; width: 7px; height: 7px; flex: 0 0 auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .22s ease, border-color .15s ease;
}
.faq details[open] summary:after { transform: rotate(225deg); }
.faq summary:hover { color: var(--text); }
.faq p { margin: 0; padding: 0 14px 14px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.faq details[open] p { animation: foldIn .25s ease-out; }

/* —— consent —— */
.consent { position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 80; display: flex; justify-content: center; padding: 12px; pointer-events: none; }
.consent[hidden] { display: none !important; }
.consent-card { pointer-events: auto; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; max-width: 620px; width: 100%; box-shadow: var(--shadow); display: grid; gap: 10px; }
.consent-card b { font-size: 14px; color: var(--text); }
.consent-card p { margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* —— model picker (gate, list style) —— */
.pick { display: flex; align-items: stretch; justify-content: center; gap: 10px; margin: 18px 0 6px; }
.pick-strip { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; max-height: 280px; width: min(430px, 88vw); padding: 2px; }
.pick-strip::-webkit-scrollbar { display: none; }
.pick-side { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.pick-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 0; transition: border-color .15s ease, color .15s ease; }
.pick-nav:hover { border-color: var(--line-2); color: var(--text); }
.pick-card { scroll-snap-align: start; display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--line); border-radius: 14px; background: transparent; padding: 11px 16px; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease; animation: rowIn .3s ease-out backwards; }
.pick-card img { width: 48px; height: 44px; object-fit: contain; flex: 0 0 auto; }
.pick-card b { font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; letter-spacing: .01em; }
.pick-card:hover { border-color: var(--line-2); }
.pick-card:active { background: var(--panel-2); }
.pick-card.is-on { border-color: var(--text); background: var(--panel-2); }
.pick-card.is-on b { color: var(--text); font-weight: 600; }
.pick-chev { margin-left: auto; color: var(--muted); font-size: 16px; line-height: 1; transition: transform .16s ease, color .15s ease; }
.pick-card:hover .pick-chev { color: var(--text); }
.pick-card.is-open .pick-chev { transform: rotate(90deg); color: var(--text); }
.pick-card:nth-child(1) { animation-delay: .02s; }
.pick-card:nth-child(2) { animation-delay: .05s; }
.pick-card:nth-child(3) { animation-delay: .08s; }
.pick-card:nth-child(4) { animation-delay: .11s; }
.pick-card:nth-child(5) { animation-delay: .14s; }
.pick-card:nth-child(6) { animation-delay: .17s; }
.pick-which { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 2px; flex-wrap: wrap; }
.pick-which[hidden] { display: none; }
.pick-which:not([hidden]) { animation: whichIn .18s ease-out; }
.pick-which > span { font-size: 13px; color: var(--muted); }
.pick-which .btn.pick-on { border-color: var(--text); color: var(--text); background: var(--panel-2); }
.pick-card:disabled { opacity: .45; cursor: not-allowed; }
.pick-card:disabled:hover { border-color: var(--line); }
.pick-card:disabled .pick-chev { display: none; }
.pick-soon { margin-left: auto; font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }

/* —— toast —— */
.vtoast {
  position: fixed; left: 50%; bottom: calc(66px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(8px);
  background: var(--panel-2); color: #e6e6ea;
  border: 1px solid var(--line-2); border-radius: 12px;
  padding: 10px 16px; font-size: 13px;
  z-index: 95; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 90vw; text-align: center;
}
.vtoast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }


/* —— boot screen (pantalla de carga) —— */
#vexBoot .vex-boot {
  position: absolute; inset: 0;
  display: grid; place-items: center; align-content: center;
  gap: 16px; text-align: center;
  transition: opacity .5s ease, transform .5s ease, filter .5s ease;
}
#vexBoot.is-done { pointer-events: none; }
#vexBoot.is-done .vex-boot { opacity: 0; transform: scale(1.04); filter: blur(6px); }
.vex-boot-mark { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.vex-boot-mark img { width: 58px; height: 58px; object-fit: contain; animation: vexLogoIn .5s ease-out both; }
.vex-boot-mark:before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .13);
  animation: vexRing 2.4s cubic-bezier(.2, .7, .3, 1) infinite;
}
.vex-boot-word {
  font-size: 15px; font-weight: 700; letter-spacing: .42em; text-transform: uppercase;
  padding-left: .42em; color: var(--text);
  animation: vexLogoIn .5s .08s ease-out both;
}
.vex-boot-bar { width: min(180px, 50vw); height: 2px; border-radius: 2px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.vex-boot-bar i { display: block; height: 100%; width: 40%; background: var(--text); border-radius: 2px; animation: vexLoad 1.15s ease-in-out infinite; }
.vex-boot-note { color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; }

/* —— gate: escáner estilo SHU —— */
.scan-state { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 4px auto 16px; }
.scan-ring { width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--line-2); position: relative; display: grid; place-items: center; }
.scan-ring:before { content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 1.5px solid var(--muted); animation: radar 1.9s ease-out infinite; }
.scan-ring:after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--text); }
#scanStatus { margin: 0; font-size: 12.5px; }

.found-card {
  display: flex; align-items: center; gap: 14px;
  width: min(430px, 88vw); margin: 14px auto 4px;
  padding: 12px 14px;
  border: 1px solid var(--text); border-radius: 14px;
  background: var(--panel-2);
  animation: sheetIn .2s ease-out;
}
.found-card[hidden] { display: none !important; }
.found-card img { width: 56px; height: 50px; object-fit: contain; flex: 0 0 auto; }
.found-meta { flex: 1; display: grid; gap: 2px; text-align: left; min-width: 0; }
.found-meta b { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.found-sn { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* —— gate: carrusel 3D showroom (5 modelos, giro lento) —— */
.ring {
  width: min(330px, 82vw); height: 172px;
  margin: 0 auto;
  perspective: 1050px;
  display: grid; place-items: center;
}
.ring-stage {
  position: relative; width: 118px; height: 132px;
  transform-style: preserve-3d;
  animation: ringSpin 26s linear infinite;
  --rz: 104px;
}
.ring:hover .ring-stage { animation-play-state: paused; }
.ring-tile {
  position: absolute; inset: 0; margin: 0;
  transform: rotateY(var(--a)) translateZ(var(--rz));
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.gate-shot .ring-tile img {
  width: 112px; height: 92px; max-height: none;
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .45));
}
.ring-tile figcaption {
  font-size: 10px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; white-space: nowrap;
}
@keyframes ringSpin {
  from { transform: rotateX(-7deg) rotateY(0deg); }
  to   { transform: rotateX(-7deg) rotateY(360deg); }
}
@media (max-width: 640px) {
  .ring { height: 150px; }
  .ring-stage { --rz: 86px; }
  .gate-shot .ring-tile img { width: 94px; height: 78px; }
}

.gate-links { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 20px; }
.gate-links .link-quiet { margin-top: 0; }

/* gate 100% SHU: sin selector manual visible (queda en DOM por compatibilidad) */
#modelPick, #pickWhich, .pick-divider { display: none !important; }

.pick-divider {
  display: flex; align-items: center; gap: 10px;
  width: min(430px, 88vw); margin: 18px auto 4px;
  color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600;
}
.pick-divider:before, .pick-divider:after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* —— iconos de plataforma (Android / Apple) —— */
svg.pi { width: 16px; height: 16px; flex: 0 0 auto; }
.btn.pi { display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.link-quiet.gate-apk { display: inline-flex; align-items: center; gap: 7px; }

/* ==========================================================================
   MOBILE — app-like bottom navigation (≤ 640 px)
   ========================================================================== */
@media (max-width: 640px) {
  .top-row { padding: 10px 12px 8px; gap: 8px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand .ver { display: none; }
  .meta { flex-wrap: nowrap; gap: 6px; }
  .status-chip { max-width: 42vw; overflow: hidden; }
  #status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .main { padding: 16px 12px 96px; }
  .cluster { padding: 4px 8px 14px; border-radius: 16px; }
  .center { padding: 16px 0 12px; }
  #gateTitle { font-size: 24px; }
  #idleActions .btn { min-width: 0; flex: 1 1 42%; }
}

/* narrow phones: lighter cards, full-width actions */
@media (max-width: 560px) {
  .card { padding: 14px 14px 13px; }
  .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .actions .btn { flex: 1 1 auto; }
  .foc-grid { grid-template-columns: 1fr 1fr; gap: 10px 10px; }
  .foc-grid input { padding: 10px 10px; }
  .kv b, .kv span { overflow-wrap: anywhere; }
  .overlay { padding: 12px; }
}

/* touch devices: real target sizes, no zoom-on-focus, sticky-hover removed */
@media (hover: none) {
  .btn:hover { background: var(--text); }
  .btn.ghost:hover { background: transparent; border-color: var(--line-2); }
  .faq summary:hover { color: inherit; }
  .card:hover, .stat:hover, .model:hover, .glist > div:hover, .gloss > div:hover,
  .steps-list li:hover, .kv div:hover { border-color: var(--line); background: var(--panel); }
  .kv div:hover { background: transparent; }
}
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn.sm { min-height: 38px; padding: 8px 12px; }
  .btn.ico { min-width: 44px; }
  .sw { padding: 12px 0; }
  .sw i { flex-basis: 44px; height: 26px; }
  .sw i:after { width: 20px; height: 20px; top: 3px; left: 3px; }
  .sw input:checked + i:after { transform: translateX(18px); }
  .chk { padding: 12px 12px; }
  .chk i { width: 24px; height: 24px; }
  .chk i:after { width: 11px; height: 6px; border-width: 2.5px; }
  .faq summary { padding: 15px 14px; }
  .ctrl input[type=range] { padding: 15px 0; background-clip: content-box; }
  .ctrl input[type=range]::-webkit-slider-thumb { width: 26px; height: 26px; }
  .ctrl input[type=range]::-moz-range-thumb { width: 26px; height: 26px; }
  input[type=text], input[type=number], input[type=password],
  input[type=tel], input[type=email], select, textarea { font-size: 16px; }
}

/* —— reduced motion: everything essential stays visible —— */
@media (prefers-reduced-motion: reduce) {
  .spin-wrap, .pwr-pulse, .pwr-pulse:before, .dot.wait, .dot.on,
  .view.active, .view.leave, .center, #live.enter, .overlay, .sheet, .logo.lg, .tick, .banner.show,
  #btnTripRec.is-on, .vex-in, .tab-ink, .vex-bar,
  html.vex-ready .top, html.vex-ready .main,
  .vex-boot-mark img, .vex-boot-mark:before, .vex-boot-mark:after, .vex-boot-bar i,
  .gate-shot img.shot-in, .pick-card, .pick-which:not([hidden]),
  .faq details[open] p {
    animation: none !important;
  }
  #vexBoot { display: none !important; }
  .btn:active { transform: none; }
  html { scroll-behavior: auto; }
  .ring-stage { animation: none; }
}

/* —— ORION E-Scooter overrides —— */
.orion-brand-link { display: inline-flex; margin-right: 2px; }
.orion-brand-link .logo { width: 26px; height: 26px; }
#gateTitle { font-size: clamp(1.35rem, 4vw, 1.65rem); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
#heroModelImg { display: none !important; }

/* —— Tune tab —— */
#view-tune.active { padding-bottom: 8px; }
.tune-shell { display: flex; flex-direction: column; gap: 14px; max-width: 520px; margin: 0 auto; }
.tune-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tune-kicker { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2); }
.tune-title { margin: 2px 0 0; font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.tune-lead { margin: -6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.tune-status-pill {
  flex: 0 0 auto; margin-top: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--line); color: var(--muted); background: var(--sunken);
}
body.is-linked .tune-status-pill { border-color: rgba(49, 196, 141, 0.45); color: #9ef0c0; background: rgba(49, 196, 141, 0.1); }

.tune-hero {
  position: relative; overflow: hidden; border-radius: 20px;
  border: 1px solid var(--line); background: linear-gradient(165deg, #1a1a20 0%, #101014 55%, #0e0e10 100%);
  padding: 18px 16px 14px; text-align: center;
}
.tune-hero-glow {
  position: absolute; inset: -40% -20% auto; height: 70%;
  background: radial-gradient(ellipse at 50% 80%, rgba(242, 242, 244, 0.09), transparent 62%);
  pointer-events: none;
}
.tune-hero-model {
  position: relative; z-index: 1; width: min(200px, 58vw); height: 72px;
  object-fit: contain; margin: 0 auto 4px; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.55));
}
.tune-model-badge {
  position: relative; z-index: 1; display: inline-block; margin-top: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.tune-dial { position: relative; width: min(280px, 88vw); margin: 0 auto; height: 118px; }
.tune-dial-svg { width: 100%; height: auto; display: block; }
.tune-dial-track { fill: none; stroke: #2a2a32; stroke-width: 10; stroke-linecap: round; }
.tune-dial-fill {
  fill: none; stroke: #f2f2f4; stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 0.22s ease, stroke 0.2s ease;
  filter: drop-shadow(0 0 8px rgba(242, 242, 244, 0.25));
}
body.is-linked .tune-dial-fill { stroke: #31c48d; filter: drop-shadow(0 0 10px rgba(49, 196, 141, 0.35)); }
.tune-dial-readout {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 0;
}
.tune-dial-num {
  font-size: clamp(2.4rem, 9vw, 3rem); font-weight: 600; letter-spacing: -0.04em;
  line-height: 1; font-variant-numeric: tabular-nums;
}
.tune-dial-unit { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }

.tune-panel {
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  padding: 14px 14px 12px;
}
.tune-panel-title {
  margin: 0 0 12px; font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.tune-preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.tune-preset-chip {
  border: 1px solid var(--line); border-radius: 12px; background: var(--sunken);
  padding: 10px 6px 8px; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}
.tune-preset-chip:active { transform: scale(0.98); }
.tune-preset-chip:hover { border-color: var(--line-2); }
.tune-preset-chip.is-on { border-color: var(--text); background: var(--panel-2); }
.tune-preset-chip b { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.tune-preset-chip small { font-size: 9px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.tune-preset-flag {
  font-size: 9px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted-2);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin-bottom: 2px;
}
.tune-preset-chip.is-on .tune-preset-flag { color: var(--text); border-color: var(--line-2); }
.tune-preset-wide { grid-column: span 4; flex-direction: row; justify-content: center; gap: 10px; padding: 10px 12px; }
.tune-preset-wide b { font-size: 15px; }
.tune-preset-wide small { align-self: center; }

.tune-slider { margin-bottom: 12px; }
.tune-slider:last-child { margin-bottom: 0; }
.tune-slider-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.tune-slider-meta span { font-size: 13px; color: var(--muted); }
.tune-slider-meta strong { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tune-slider-track {
  position: relative; height: 36px; border-radius: 999px; background: var(--sunken);
  border: 1px solid var(--line); overflow: hidden;
}
.tune-slider-track::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--fill, 50%);
  background: linear-gradient(90deg, rgba(242, 242, 244, 0.12), rgba(242, 242, 244, 0.28));
  border-radius: 999px; pointer-events: none; transition: width 0.12s ease;
}
body.is-linked .tune-slider-track::before {
  background: linear-gradient(90deg, rgba(49, 196, 141, 0.15), rgba(49, 196, 141, 0.35));
}
.tune-slider-track input[type="range"] {
  position: relative; z-index: 1; width: 100%; height: 36px; margin: 0;
  background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.tune-slider-track input[type="range"]::-webkit-slider-runnable-track { height: 36px; background: transparent; }
.tune-slider-track input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--text); border: 2px solid #0e0e10; margin-top: -3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.tune-slider-track input[type="range"]::-moz-range-track { height: 36px; background: transparent; border: 0; }
.tune-slider-track input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--text);
  border: 2px solid #0e0e10; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.tune-options { display: grid; gap: 8px; }
.tune-option {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer;
}
.tune-option input { position: absolute; opacity: 0; pointer-events: none; }
.tune-option-box {
  width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line-2);
  background: var(--sunken); display: grid; place-items: center; flex: 0 0 auto;
}
.tune-option-box i {
  width: 10px; height: 6px; border-left: 2px solid transparent; border-bottom: 2px solid transparent;
  transform: rotate(-45deg) scale(0.5); opacity: 0; transition: opacity 0.12s ease, transform 0.12s ease;
}
.tune-option input:checked + .tune-option-box { background: rgba(49, 196, 141, 0.15); border-color: var(--ok); }
.tune-option input:checked + .tune-option-box i { border-color: var(--ok); opacity: 1; transform: rotate(-45deg) scale(1); }
.tune-option-text { display: grid; gap: 2px; }
.tune-option-text b { font-size: 14px; font-weight: 500; }
.tune-option-text small { font-size: 12px; color: var(--muted); }

.tune-send-bar {
  position: sticky; bottom: calc(58px + env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 15; padding: 12px 0 4px;
  background: linear-gradient(to top, #0e0e10 65%, transparent);
}
.tune-send-hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-align: center; }
body.is-linked .tune-send-hint { display: none; }
.tune-send-btn {
  width: 100%; min-height: 52px; padding: 10px 16px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tune-send-label { font-size: 15px; font-weight: 600; }
.tune-send-sub { font-size: 11px; font-weight: 500; opacity: 0.75; letter-spacing: 0.02em; }
body.is-linked .tune-send-sub { opacity: 0.9; }

@media (max-width: 400px) {
  .tune-preset-row { grid-template-columns: repeat(2, 1fr); }
  .tune-preset-wide { grid-column: span 2; }
}
.orion-preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.orion-preset { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 14px; text-align: left; cursor: pointer; transition: border-color .15s ease; }
.orion-preset:hover { border-color: var(--line-2); }
.orion-preset img { width: 64px; height: 52px; object-fit: contain; display: block; margin-bottom: 8px; }
.orion-preset b { display: block; font-size: 14px; margin-bottom: 4px; }
.orion-preset span { font-size: 12px; color: var(--muted); }
body.orion-escooter { --bg: #07080c; --dash-accent: #6d8cff; --dash-violet: #8b5cf6; }

/* —— Tune Pro + Anzeigetafel —— */
.tune-shell-pro { max-width: 440px; gap: 12px; }
.tune-head-pro { align-items: center; }
.tune-head-pro .tune-lead { margin: 6px 0 0; font-size: 12px; }
.tune-hint-compact { margin: 0 0 4px; padding: 10px 12px; font-size: 12px; }

.tune-segments {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.tune-seg {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; border: 0; border-radius: 11px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; cursor: pointer; transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.tune-seg .tab-ic { width: 16px; height: 16px; opacity: 0.75; }
.tune-seg.is-on {
  color: var(--text); background: linear-gradient(145deg, rgba(109, 140, 255, 0.22), rgba(139, 92, 246, 0.12));
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tune-pane[hidden] { display: none !important; }

.tune-setup-hero {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(135deg, rgba(109, 140, 255, 0.08), transparent 55%);
}
.tune-hero-model-sm { width: 72px; height: 58px; object-fit: contain; flex-shrink: 0; }
.tune-setup-meta { display: grid; gap: 6px; }
.tune-limit-readout { display: flex; align-items: baseline; gap: 8px; }
.tune-panel-pro {
  border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 18, 24, 0.85); backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.dash-wrap { display: grid; gap: 14px; }
.dash-live-badge {
  align-self: center; font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
body.is-linked .dash-live-badge {
  color: #9ef0c0; border-color: rgba(49, 196, 141, 0.45); background: rgba(49, 196, 141, 0.08);
}

.dash-stage {
  position: relative; aspect-ratio: 1; max-height: 320px; margin: 0 auto; width: min(100%, 340px);
  display: grid; place-items: center; border-radius: 24px; overflow: hidden;
  background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(45, 70, 140, 0.35), rgba(7, 8, 12, 0.95) 70%);
  border: 1px solid rgba(109, 140, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 0 80px rgba(109, 140, 255, 0.06);
}
.dash-nebula {
  position: absolute; inset: -20%; background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(139, 92, 246, 0.6), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(56, 189, 248, 0.5), transparent);
  opacity: 0.7; animation: dashTwinkle 8s ease-in-out infinite alternate;
}
@keyframes dashTwinkle { from { opacity: 0.45; transform: scale(1); } to { opacity: 0.85; transform: scale(1.03); } }
.dash-orbit {
  position: absolute; border-radius: 50%; border: 1px solid rgba(109, 140, 255, 0.12);
  pointer-events: none;
}
.dash-orbit-a { inset: 8%; animation: dashSpin 28s linear infinite; }
.dash-orbit-b { inset: 18%; border-color: rgba(139, 92, 246, 0.18); animation: dashSpin 36s linear infinite reverse; }
.dash-orbit-c { inset: 28%; border-style: dashed; opacity: 0.5; animation: dashSpin 48s linear infinite; }
@keyframes dashSpin { to { transform: rotate(360deg); } }

.dash-ring-svg { width: 88%; height: auto; position: relative; z-index: 2; }
.dash-ring-track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 3; }
.dash-ring-glow { fill: none; stroke: url(#dashRingGrad); stroke-width: 8; opacity: 0.35; }
.dash-ring-progress {
  fill: none; stroke: url(#dashRingGrad); stroke-width: 6; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
  stroke-dasharray: 615.75; stroke-dashoffset: 615.75;
  filter: drop-shadow(0 0 12px rgba(109, 140, 255, 0.45));
  transition: stroke-dashoffset 0.35s ease;
}

.dash-speed-core {
  position: absolute; z-index: 3; text-align: center; display: grid; gap: 2px;
}
.dash-unit { font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.dash-speed {
  font-size: clamp(42px, 12vw, 56px); font-weight: 700; letter-spacing: -0.04em; line-height: 1;
  font-variant-numeric: tabular-nums; color: #f4f6ff;
  text-shadow: 0 0 40px rgba(109, 140, 255, 0.35);
}

.dash-watt {
  position: absolute; right: 6%; bottom: 14%; z-index: 4; width: 72px; height: 72px;
  display: grid; place-items: center;
}
.dash-watt svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.dash-watt-track { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 3; }
.dash-watt-arc {
  fill: none; stroke: #38bdf8; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 125.6; stroke-dashoffset: 125.6; transition: stroke-dashoffset 0.35s ease;
}
.dash-watt-readout { position: relative; z-index: 1; text-align: center; font-variant-numeric: tabular-nums; }
.dash-watt-readout span { display: block; font-size: 15px; font-weight: 700; line-height: 1.1; }
.dash-watt-readout small { font-size: 10px; color: var(--muted); letter-spacing: 0.08em; }

.dash-range-bar {
  position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px 12px;
  padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(109, 140, 255, 0.22), rgba(139, 92, 246, 0.18));
  border: 1px solid rgba(139, 92, 246, 0.25);
}
.dash-range-label { font-size: 12px; color: rgba(255, 255, 255, 0.75); grid-column: 1; }
.dash-range-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dash-range-bat { font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.dash-range-fill {
  grid-column: 1 / -1; height: 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); overflow: hidden;
}
.dash-range-fill i {
  display: block; height: 100%; width: 0%; border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6); transition: width 0.4s ease;
}

.dash-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.dash-tile {
  padding: 14px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(16, 16, 22, 0.92); min-height: 78px; display: grid; align-content: start; gap: 4px;
}
.dash-tile b {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1;
}
.dash-tile b small { font-size: 11px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.dash-tile span { font-size: 11px; color: var(--muted); line-height: 1.35; }
.dash-foot { margin: 0; font-size: 11px; color: var(--muted-2); text-align: center; line-height: 1.45; }

body.orion-escooter { --bg: #0e0e10; }

.orion-pair-sheet { width: min(400px, calc(100% - 24px)); padding: 28px 22px 22px; }
.orion-pair-sheet .pair-step[hidden] { display: none !important; }
.orion-pair-sheet h2 { font-size: 20px; margin-bottom: 8px; }
.orion-pair-sheet .lead { font-size: 13px; line-height: 1.55; color: var(--muted); margin-bottom: 16px; }
.orion-pair-sheet .btn { width: 100%; min-height: 44px; margin-top: 6px; }
.orion-pair-sheet #scanStatus { color: var(--muted); font-size: 13px; }
.orion-found-card { width: 100%; margin: 0 0 16px; box-sizing: border-box; }
.orion-found-card img { width: 72px; height: 64px; }
.sheet-danger-icon {
  width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 14px;
  border: 1px solid #55242b; color: #ff8a93; font-size: 22px; font-weight: 700;
  display: grid; place-items: center; background: rgba(229, 72, 77, 0.08);
}
body.is-pairing { overflow: hidden; }
body.is-pairing .tabs { pointer-events: none; opacity: 0.5; }

.nearby-list-wrap {
  max-height: min(42vh, 280px);
  overflow: auto;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--sunken);
  text-align: left;
}
.nearby-list { list-style: none; margin: 0; padding: 6px; display: grid; gap: 6px; }
.nearby-empty { margin: 0; padding: 16px 12px; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.5; }
.nearby-item {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  padding: 10px 12px; display: flex; align-items: center; gap: 10px; cursor: pointer; text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nearby-item:hover { border-color: var(--line-2); background: var(--panel-2); }
.nearby-item img { width: 44px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.nearby-item-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.nearby-item-meta b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nearby-item-meta span { font-size: 11px; color: var(--muted); }
.nearby-rssi { font-size: 11px; font-weight: 600; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.nearby-item.is-scooter {
  border-color: rgba(49, 196, 141, 0.55);
  box-shadow: 0 0 0 1px rgba(49, 196, 141, 0.15);
}
.nearby-item.is-scooter b { color: var(--text); }
.orion-hint {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--sunken);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.55;
}
body.is-linked .orion-hint { display: none; }
body.is-linked #connBanner { display: none !important; }
body:not(.is-linked) #connBanner.show { display: block; }
#btnApply:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.2); }

/* ==========================================================================
   ESC UI PRO — global shell (all tabs)
   ========================================================================== */
body.esc-ui {
  --bg: #06070b;
  --panel: rgba(18, 19, 26, 0.88);
  --panel-2: rgba(24, 26, 34, 0.95);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --esc-accent: #6d8cff;
  --esc-accent-2: #8b5cf6;
  background: var(--bg);
}
body.esc-ui .esc-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, rgba(109, 140, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 40%, rgba(139, 92, 246, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(56, 189, 248, 0.06), transparent 45%);
}
body.esc-ui .esc-app {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  min-height: 100dvh; min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.esc-ui .app.esc-app { padding-bottom: env(safe-area-inset-bottom, 0px) !important; }
body.esc-ui .esc-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 28px);
  width: 100%;
  padding: 8px 14px 20px;
  min-height: 0;
}
body.esc-ui .esc-stage .esc-main {
  flex: 0 1 auto;
  width: min(560px, 100%);
  max-height: min(72vh, 720px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

body.esc-ui .esc-top {
  background: rgba(6, 7, 11, 0.82);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(109, 140, 255, 0.08);
}
body.esc-ui .esc-brand-text { font-size: 15px; letter-spacing: -0.03em; }
body.esc-ui .esc-brand-text em { font-style: normal; color: var(--muted); font-weight: 500; font-size: 13px; }
body.esc-ui .esc-ver {
  border-color: rgba(109, 140, 255, 0.35);
  color: #b8c8ff;
  background: rgba(109, 140, 255, 0.1);
}
body.esc-ui .esc-status { background: rgba(255, 255, 255, 0.03); }
body.esc-ui .esc-banner {
  background: rgba(109, 140, 255, 0.08);
  color: #c5d4ff;
  border-bottom-color: rgba(109, 140, 255, 0.2);
  font-size: 11.5px;
  text-align: center;
}
body.esc-ui .esc-disc { border-radius: 999px; }

body.esc-ui .esc-view-inner { animation: viewIn 0.32s ease-out; }
body.esc-ui .esc-view-tune { padding: 0; }

body.esc-ui .esc-page-head { margin-bottom: 18px; }
body.esc-ui .esc-page-head-center { text-align: center; }
body.esc-ui .esc-kicker {
  margin: 0 0 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--esc-accent);
}
body.esc-ui .esc-title {
  margin: 0; font-size: clamp(22px, 5.5vw, 28px); font-weight: 700;
  letter-spacing: -0.035em; line-height: 1.15;
}
body.esc-ui .esc-sub {
  margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 36ch;
}
body.esc-ui .esc-page-head-center .esc-sub { margin-left: auto; margin-right: auto; }

body.esc-ui .esc-glass {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(22, 24, 32, 0.92), rgba(12, 13, 18, 0.88));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
}
body.esc-ui .esc-gate-card {
  padding: 20px 16px 18px;
  margin: 0 auto;
  max-width: 440px;
}
body.esc-ui .esc-gate-visual { margin-bottom: 8px; }
body.esc-ui #gateTitle.esc-title { font-size: clamp(20px, 5vw, 24px); }
body.esc-ui .link-shell .esc-page-head { margin-bottom: 14px; }

body.esc-ui .esc-model-panel {
  margin: 12px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  width: min(430px, 100%);
}
body.esc-ui .esc-panel-label {
  margin: 0 0 8px; text-align: left; font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted-2);
}
body.esc-ui .pick-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line);
}
body.esc-ui .pick-card.is-on {
  border-color: rgba(109, 140, 255, 0.55);
  background: linear-gradient(90deg, rgba(109, 140, 255, 0.12), rgba(139, 92, 246, 0.06));
  box-shadow: 0 0 0 1px rgba(109, 140, 255, 0.12);
}
body.esc-ui .pick-card.is-on b { color: #eef1ff; }

body.esc-ui .esc-connect-row { margin-top: 18px; }
body.esc-ui .esc-cta {
  width: 100%; max-width: 320px; min-height: 50px; border-radius: 14px; border: 0;
  background: linear-gradient(135deg, #eef1ff 0%, #c8d4ff 100%);
  color: #0a0b10; font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 32px rgba(109, 140, 255, 0.25);
}
body.esc-ui .esc-cta:hover { background: linear-gradient(135deg, #fff 0%, #d8e0ff 100%); }
body.esc-ui .esc-footnote {
  margin: 14px auto 0; max-width: 36ch; font-size: 11.5px; color: var(--muted); line-height: 1.55;
}
body.esc-ui .esc-legal {
  margin: 10px auto 0; max-width: 36ch; font-size: 10.5px; color: var(--muted-2); line-height: 1.5;
}

body.esc-ui .esc-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  margin-top: 16px; max-width: 440px; margin-left: auto; margin-right: auto;
}
body.esc-ui .esc-stat {
  border-radius: 16px;
  background: rgba(18, 19, 26, 0.9);
  border: 1px solid var(--line);
  padding: 14px;
}
body.esc-ui .esc-stat-wide { grid-column: 1 / -1; }
body.esc-ui .esc-device-name { font-size: 14px !important; word-break: break-all; }

body.esc-ui .esc-hint {
  border-color: rgba(109, 140, 255, 0.2);
  background: rgba(109, 140, 255, 0.06);
  border-radius: 12px;
  font-size: 12px;
}

body.esc-ui .esc-preset-grid { gap: 12px; }
body.esc-ui .orion-preset {
  border-radius: 16px;
  background: rgba(18, 19, 26, 0.85);
  border-color: var(--line);
  padding: 16px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
body.esc-ui .orion-preset:hover {
  border-color: rgba(109, 140, 255, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}
body.esc-ui .orion-preset b { font-size: 15px; }

body.esc-ui .esc-steps {
  list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px;
}
body.esc-ui .esc-steps li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px; border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 19, 26, 0.75);
}
body.esc-ui .esc-step-n {
  flex: 0 0 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, rgba(109, 140, 255, 0.35), rgba(139, 92, 246, 0.2));
  color: #eef1ff;
}
body.esc-ui .esc-steps li div { display: grid; gap: 3px; min-width: 0; }
body.esc-ui .esc-steps li b { font-size: 14px; font-weight: 600; }
body.esc-ui .esc-steps li span { font-size: 12px; color: var(--muted); line-height: 1.45; }
body.esc-ui .esc-models-card {
  padding: 16px 18px;
}
body.esc-ui .esc-models-card h3 {
  margin: 0 0 10px; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}

body.esc-ui .esc-log-wrap {
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line);
  background: #0a0b0f;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}
body.esc-ui .esc-log-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
body.esc-ui .esc-log-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--esc-accent);
  box-shadow: 0 0 8px rgba(109, 140, 255, 0.6);
}
body.esc-ui .esc-log {
  min-height: 260px; max-height: 50vh; margin: 0; border: 0; border-radius: 0;
  background: transparent; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11px; line-height: 1.55; padding: 14px;
}

body.esc-ui .esc-tabs,
body.esc-ui .esc-tabs-center {
  position: relative;
  left: auto; right: auto; bottom: auto; top: auto;
  transform: none;
  width: min(520px, 100%);
  margin: 0 auto;
  flex-shrink: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 14, 22, 0.92);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(109, 140, 255, 0.08);
  padding: 6px 4px;
}
body.esc-ui .esc-tabs button {
  position: relative;
  border-radius: 14px;
  padding: 8px 2px 6px;
  color: var(--muted-2);
  transition: color 0.2s, background 0.2s;
}
body.esc-ui .esc-tabs button .esc-tab-glow {
  position: absolute; inset: 4px 6px; border-radius: 12px; opacity: 0;
  background: linear-gradient(135deg, rgba(109, 140, 255, 0.22), rgba(139, 92, 246, 0.12));
  transition: opacity 0.2s ease;
  z-index: 0;
}
body.esc-ui .esc-tabs button .tab-ic,
body.esc-ui .esc-tabs button span:last-child { position: relative; z-index: 1; }
body.esc-ui .esc-tabs button.active {
  color: #f0f2ff;
}
body.esc-ui .esc-tabs button.active .esc-tab-glow { opacity: 1; }
body.esc-ui .esc-tabs button.active .tab-ic { filter: drop-shadow(0 0 6px rgba(109, 140, 255, 0.45)); }

body.esc-ui .esc-pair-sheet {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(22, 24, 32, 0.98), rgba(10, 11, 15, 0.98));
  box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
}
body.esc-ui .nearby-list-wrap {
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}
body.esc-ui .nearby-item {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}
body.esc-ui .nearby-item.is-scooter {
  border-color: rgba(49, 196, 141, 0.5);
  background: rgba(49, 196, 141, 0.06);
}

body.esc-ui .center { padding: 8px 0 4px; }
body.esc-ui .btn {
  border-radius: 12px;
}
body.esc-ui .btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line-2);
  color: var(--text);
}
body.esc-ui #view-tune.active { padding-bottom: 0; }

@media (max-height: 740px) {
  body.esc-ui .esc-stage { justify-content: flex-start; padding-top: 4px; }
}

/* —— Link tab layout fix (stats vs tab bar) —— */
#linkStats[hidden],
.stats[hidden],
.esc-live-strip[hidden] { display: none !important; }

body.esc-ui .link-shell {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%;
}
body.esc-ui .esc-gate-card {
  width: 100%; max-width: none; margin: 0 auto;
  padding: 22px 20px 20px;
  display: flex; flex-direction: column; gap: 0;
}
body.esc-ui .esc-gate-head .esc-title { font-size: clamp(24px, 6vw, 30px); }
body.esc-ui .esc-gate-head .esc-sub { font-size: 14px; }
body.esc-ui .esc-gate-head {
  text-align: center; margin-bottom: 12px;
}
body.esc-ui .esc-gate-head .esc-sub { margin-left: auto; margin-right: auto; max-width: 28ch; }

body.esc-ui .esc-live-strip {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 14px;
}
body.esc-ui .esc-stat-mini {
  padding: 10px 8px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin: 0;
}
body.esc-ui .esc-stat-mini .n { font-size: 17px; }
body.esc-ui .esc-stat-mini .l { font-size: 9px; margin-top: 2px; }
body.esc-ui .esc-stat-device .n { font-size: 11px !important; line-height: 1.25; }
body.esc-ui .esc-stat-mini .bat { margin-top: 6px; height: 2px; }

body.esc-ui .esc-hero-stage {
  position: relative; display: grid; place-items: center;
  min-height: 120px; margin: 0 0 8px;
  padding: 8px 0 4px;
}
body.esc-ui .esc-ring-hidden { display: none !important; }
body.esc-ui .esc-hero-img {
  width: min(260px, 62vw); height: auto; object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.55));
  transition: transform 0.35s ease, opacity 0.35s ease;
}
body.esc-ui .esc-hero-stage { min-height: 140px; margin-bottom: 12px; }
body.esc-ui #gate.is-linked .esc-hero-img { transform: scale(0.92); opacity: 0.95; }

body.esc-ui .esc-model-panel {
  width: 100%; margin: 0; padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
body.esc-ui .esc-pick-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px; max-height: none; width: 100%; padding: 0;
  overflow: visible;
}
body.esc-ui .esc-pick-grid .pick-card {
  min-height: 64px; padding: 12px 14px;
}
body.esc-ui .esc-pick-grid .pick-card img { width: 48px; height: 42px; }
body.esc-ui .esc-pick-grid .pick-card b { font-size: 13px; white-space: normal; line-height: 1.25; }
body.esc-ui .esc-pick-grid .pick-card[data-model="e3"] { opacity: 0.55; grid-column: span 2; }

body.esc-ui .esc-connect-row { margin-top: 14px; }
body.esc-ui .esc-connect-row .esc-cta {
  max-width: none; width: 100%; min-height: 56px; font-size: 16px; border-radius: 16px;
}
body.esc-ui .esc-footnote {
  margin-top: 12px; text-align: center; font-size: 11px; color: var(--muted-2);
}
body.esc-ui .esc-legal { display: none; }

body.esc-ui .esc-main {
  width: min(560px, 100%);
  padding: 8px 4px 0;
  margin: 0;
}

body.esc-ui .esc-tabs button {
  min-height: 52px; padding: 10px 4px 8px;
}
body.esc-ui .esc-tabs button span:last-child {
  font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase;
}
body.esc-ui .esc-tabs button .tab-ic { width: 22px; height: 22px; }

body.esc-ui .tune-shell-pro { max-width: 100%; }
body.esc-ui .tune-head-pro { padding-bottom: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
body.esc-ui .tune-segments { margin-top: 8px; }

body.esc-ui .esc-top .top-row { padding: 10px 16px 8px; }
body.esc-ui .banner.esc-banner { padding: 7px 14px; }

@media (min-width: 768px) {
  body.esc-ui .esc-stage { padding-left: 24px; padding-right: 24px; }
  body.esc-ui .esc-stage .esc-main { width: min(580px, 100%); }
  body.esc-ui .esc-tabs-center { width: min(540px, 100%); }
  body.esc-ui .esc-gate-card { padding: 26px 24px 22px; }
  body.esc-ui .esc-hero-img { width: 280px; }
  body.esc-ui .tune-shell-pro { max-width: 580px; }
}
