/* Jimmy's Ride — owner dashboard
   Instrument Glass system: dark cockpit surfaces, one cyan accent,
   mono micro-labels and large thin numerals. */

:root {
  --bg: #05070c;
  --bg-soft: #070b12;
  --ink: #e8f1fb;
  --ink-dim: #9aacc0;
  --muted: #6c7e93;
  --blue: #0a84ff;
  --cyan: #38bdf8;
  --cyan-soft: rgba(56, 189, 248, 0.14);
  --positive: #4ade80;
  --amber: #ffc46b;
  --tag-ok-bg: #0b241d;
  --tag-ok-line: #2fbf8f;
  --tag-ok-ink: #a9e6cf;
  /* Minimum clear space between a caption and the value it names.
     Spacing rule shared with base.css and design-system.css. */
  --caption-gap: 0.9em;
  /* Breathing space — v0.4.13. Inviolable floors: when content does not
     fit, remove content; never reduce these insets. */
  --bs-display: 16px;
  --bs-display-pct: 4%;
  --bs-panel: 12px;
  --bs-panel-pct: 2.5%;
  --bs-gap: 10px;
  --bs-gap-pct: 1.6%;
  --bs-balance: 2%;
  --hair: rgba(122, 174, 255, 0.16);
  --hair-strong: rgba(122, 174, 255, 0.32);
  --glass: linear-gradient(155deg, rgba(17, 28, 43, 0.72), rgba(6, 11, 19, 0.58));
  --shadow: 0 22px 60px -34px rgba(0, 0, 0, 0.95);
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "SF Pro Display", "SF Pro Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  /* Semantic text colours — identical to the shared set in base.css.
     Value digits are ink; every unit is the same light grey as prose;
     labels and bare state words are muted; prose is ink-dim; cyan is
     otherwise live chrome only. */
  --text-value: var(--ink);
  --text-unit: var(--ink-dim);
  --text-label: var(--muted);
  --text-prose: var(--ink-dim);
  --text-live: var(--cyan);

  /* Type scale — six roles. Desktop canvas is 1440 × 900; sizes below are
     CSS px at that canvas. Mono is only for a value, its unit, or a clock
     time; never for a sentence, a label or a verb. */
  --t-display: 32px;
  --t-title: 22px;
  --t-value: 14px;
  --t-secondary: 13px;
  --t-note: 10.5px;
  --t-label: 9.5px;
  --tr-label: 0.1em;

  /* Spacing — one 4 px base, five steps. Card padding 16, stacked rows 8,
     groups 12, sections 24. The only 6 px gap is icon-to-text. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --pad-card: 16px;
}

/* Inline unit token. One unit, one colour, one face — used wherever a unit
   sits inside a value row or a sentence instead of its own styled element. */
.u {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
  /* v0.4.14: the gap is the real space in the text, not a per-selector margin. */
  margin-left: 0 !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(56, 189, 248, 0.28);
  color: #fff;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

/* ---------- Backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(85% 68% at 50% 36%, rgba(10, 132, 255, 0.15), rgba(10, 60, 120, 0.05) 44%, transparent 72%),
    radial-gradient(52% 38% at 50% 98%, rgba(56, 189, 248, 0.1), transparent 70%),
    linear-gradient(180deg, #05070c 0%, #060a11 46%, #05070c 100%);
}

.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(90, 150, 255, 0.028) 1px, transparent 1px),
    linear-gradient(rgba(90, 150, 255, 0.022) 1px, transparent 1px);
  background-size: 120px 120px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 12%, transparent 76%);
  mask-image: radial-gradient(ellipse at 50% 42%, #000 12%, transparent 76%);
}

.backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 34%, rgba(0, 0, 0, 0.42) 100%);
}

/* ---------- Top bar ---------- */

.topbar {
  position: relative;
  z-index: 50;
  flex: none;
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(18px, 2.4vw, 32px);
  border-bottom: 1px solid rgba(122, 174, 255, 0.1);
  background: linear-gradient(180deg, rgba(5, 7, 12, 0.9), rgba(5, 7, 12, 0.4));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 10.5px/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
  white-space: nowrap;
}

.nav-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  flex: none;
}

.nav-sep {
  width: 1px;
  height: 12px;
  background: var(--hair);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-dim);
  letter-spacing: 0.14em;
}

.nav-user i {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.08);
  color: var(--cyan);
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0;
}

/* ---------- Layout ---------- */

.app-main {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  padding: var(--content-gap) clamp(18px, 2vw, 28px) 12px;
}

/* ---------- Desktop dashboard ---------- */

/* One page: trip and charging read on the left, the car owns the centre,
   live battery and health close on the right. Nothing needs a second tab
   or an internal scrollbar at 1280×800 and above. */
.dashboard {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(280px, 330px);
  gap: 16px;
  height: 100%;
  min-height: 0;
}

.dash-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  min-height: 0;
}

.dash-col--center {
  min-width: 0;
}

/* Live driving status owns the top-left corner: the state word is a small
   label, the speed is the value the eye lands on. */
.dash-drive {
  padding: 11px 16px 10px;
  flex: none;
}

.drive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drive-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--cyan);
}

.drive-mode {
  font: 500 var(--card-label)/1 var(--font);
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

.drive-speed {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 9px;
  line-height: 0.92;
}

.drive-speed strong {
  font-size: 46px;
  font-weight: 200;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
  text-shadow: 0 0 34px rgba(56, 189, 248, 0.18);
}

.drive-speed span {
  font: 500 12px/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-unit);
}

.drive-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid rgba(122, 174, 255, 0.09);
  font-size: var(--card-body);
  color: var(--muted);
  white-space: nowrap;
}

.drive-foot > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.drive-time {
  font: 500 var(--card-body)/1 var(--font);
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

.dash-location {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--pad-card);
}

/* Fixed rows keep their size; the map absorbs the column's spare height, so
   the trip card never clips its keys at 1280×800. */
.dash-location > * {
  flex: none;
}

.dash-location > .dash-map {
  flex: 1 1 auto;
  min-height: 92px;
  aspect-ratio: auto;
}

.dash-dest {
  margin: 0 0 var(--sp-1);
  font-size: var(--t-title);
  font-weight: 350;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text-value);
}

.dash-sub {
  margin: 0 0 var(--sp-3);
  font-size: var(--card-body);
  line-height: 1.4;
  color: var(--text-prose);
}

.dash-map {
  margin: 0;
  aspect-ratio: 974 / 540;
  --map-label-size: 30px;
}

.dash-map .map-labels text:nth-child(3),
.dash-map .map-labels text:nth-child(5),
.dash-map .map-labels text:nth-child(6),
.dash-map .map-labels text:nth-child(9) {
  display: none;
}

.dash-kv {
  margin-top: 8px;
}

.dash-charge .next-copy {
  margin-bottom: 10px;
}

.dash-car-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px 16px 14px;
}

.dash-car-card .car-stage {
  flex: 1;
  min-height: 0;
}

.dash-car-card .car-foot {
  padding-top: 2px;
}

.view {
  height: 100%;
}

.view-grid {
  display: grid;
  height: 100%;
  min-height: 0;
  gap: 16px;
}

/* Overview is a two-column reading: navigation on the left, charging and
   vehicle status on the right. The left column is deliberately narrow so the
   map card stays the size of the phone's map card instead of filling a rail. */
.overview-layout {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
}

.overview-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 174, 255, 0.28) transparent;
}

.overview-nav > * {
  flex: none;
}

.overview-nav::-webkit-scrollbar {
  width: 4px;
}

.overview-nav::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(122, 174, 255, 0.28);
}

.overview-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 174, 255, 0.28) transparent;
}

.overview-status::-webkit-scrollbar {
  width: 4px;
}

.overview-status::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(122, 174, 255, 0.28);
}

/* Controls keeps every card an action surface: four equal action columns
   plus one alert rail. */
.controls-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(240px, 292px);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 174, 255, 0.28) transparent;
}

.rail > * {
  flex: none;
}

.rail::-webkit-scrollbar {
  width: 4px;
}

.rail::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(122, 174, 255, 0.28);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

/* ---------- Shared surfaces ---------- */

.glass {
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.panel-card {
  position: relative;
  padding: var(--pad-card);
  overflow: hidden;
}

.panel-card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(160, 210, 255, 0.22), transparent);
  pointer-events: none;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

/* Section labels are sans: mono is reserved for values, units and
   timestamps, never for headings or labels. */
.micro {
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.micro.is-cyan {
  color: var(--cyan);
}

/* Status is a label first. Modes, schedules, connectivity and states inside a
   labelled row take no border, fill, padding or radius, so they cannot be
   mistaken for controls. A whole-card verdict adds .is-chip below; that chip
   is a hairline pill, never interactive, never a button. */
.status {
  display: inline-flex;
  align-items: center;
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-label);
  white-space: nowrap;
}

/* Whole-system healthy state keeps the green ink of the old OK tag. */
.status.is-ok {
  color: var(--tag-ok-ink);
}

/* A verdict about the whole card — All OK, Secured, Up to date — carries a
   chip so it scans on its own. Same pill language as the mobile status tag
   and the map badge, at desktop density: label size unchanged, 2 × 7 px pad.
   Modes, schedules and inline row states stay bare labels. A chip is never a
   control: no hover, no pointer cursor, no focus ring. */
.status.is-chip {
  padding: 2px 7px;
  border: 1px solid rgba(122, 174, 255, 0.24);
  border-radius: 999px;
  background: rgba(122, 174, 255, 0.07);
  color: var(--text-label);
}

.status.is-chip.is-ok {
  border-color: rgba(47, 191, 143, 0.34);
  background: rgba(47, 191, 143, 0.1);
  color: var(--tag-ok-ink);
}

/* The health list sets 1.2 line-height on its spans; a chip keeps the same
   15.5 px height it has in a card head wherever it sits. */
.health-list .status.is-chip {
  line-height: 1;
}

/* ---------- Overview: left rail ---------- */

.greet {
  padding: 4px 2px 6px;
}

.greet h1 {
  margin: 8px 0 6px;
  font-size: 34px;
  font-weight: 250;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text-value);
}

.greet .lede {
  margin: 0;
  max-width: 100%;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.lock-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
}

.lock-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.07);
  color: var(--cyan);
  box-shadow: inset 0 0 18px rgba(56, 189, 248, 0.12);
  flex: none;
}

.lock-icon svg {
  width: 19px;
  height: 19px;
}

.lock-row strong {
  display: block;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.lock-row span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}

.kv {
  margin: 0;
  border-top: 1px solid rgba(122, 174, 255, 0.09);
}

.kv > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(122, 174, 255, 0.07);
}

.kv > div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kv dt {
  font: 600 var(--card-label)/1.2 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.kv dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 var(--card-value)/1 var(--font);
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.kv dd .u {
  font-size: 0.6em;
}

/* Two readings share the row without a dot: one ink for both numbers, cyan
   for both units, and the flex gap does the separating. */
.kv-reading {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}

.soc-big {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.soc-big span {
  font-size: 52px;
  font-weight: 200;
  line-height: 0.9;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
  text-shadow: 0 0 32px rgba(56, 189, 248, 0.16);
}

.soc-big em {
  font: 500 11px/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--text-unit);
}

.soc-caption {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.soc-track {
  position: relative;
  height: 4px;
  margin-top: 12px;
  border-radius: 3px;
  background: rgba(120, 170, 255, 0.13);
}

.soc-track span {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.34), var(--cyan));
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.soc-track i {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 12px;
  background: rgba(232, 241, 251, 0.5);
  box-shadow: 0 0 6px rgba(232, 241, 251, 0.4);
}

.soc-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font: 500 9px/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
}

/* ---------- Merged battery + charge card ---------- */

/* One block: state of charge and range lead, the scheduled charge is the
   supporting tier. The removed right-hand SOC card now lives here. */
.dash-energy {
  padding: 12px 16px;
  flex: none;
}

.energy-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.energy-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.energy-meta > div > span {
  display: block;
  font: 600 9px/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.energy-meta strong {
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.energy-meta em {
  font: 500 9.5px/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
}

.dash-energy .soc-scale span:nth-child(2) {
  color: var(--ink-dim);
}

.energy-next {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(122, 174, 255, 0.1);
}

.energy-next-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.energy-next-main strong {
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

.energy-next-note {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.energy-targets {
  display: flex;
  gap: 12px;
  margin: 0;
  flex: none;
}

.energy-targets dt {
  font: 600 9px/1 var(--font);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.energy-targets dd {
  margin: 3px 0 0;
  font: 500 12px/1 var(--font);
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- Overview: hero greeting + mini 3D ---------- */

/* The greeting and the car share one 150 px card. The stage is 176 x 140,
   so the map card below and its three trip numbers keep their size while
   the hero still shows the actual model. */
.hero-greet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 150px;
  padding: 0 8px 0 16px;
  overflow: hidden;
}

.greet-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.greet-copy h1 {
  margin: 0;
}

/* The copy column is only ~132 px wide next to the 176 px stage, so the
   arrival line wraps to two lines instead of truncating mid-word. */
.hero-greet .lede {
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-stage {
  position: relative;
  flex: none;
  width: 176px;
  height: 140px;
}

.mini-stage .scene {
  z-index: 2;
}

.mini-aura,
.mini-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.mini-aura {
  z-index: 1;
  background: radial-gradient(58% 62% at 52% 66%, rgba(56, 140, 235, 0.28), rgba(10, 60, 120, 0.08) 52%, transparent 76%);
}

.mini-shade {
  z-index: 3;
  background: linear-gradient(180deg, transparent 50%, rgba(5, 7, 12, 0.5) 86%, rgba(5, 7, 12, 0.76) 100%);
}

.mini-tag {
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 4;
  font: 500 var(--t-label)/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.webgl-fallback.is-mini {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 0 12px;
  background: rgba(5, 8, 13, 0.78);
  font: 500 9px/1.4 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: center;
}

/* ---------- Overview: trip card ---------- */

.trip-card {
  padding: 14px 16px 12px;
}

.trip-dest {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
}

/* The map card mirrors the phone's map card: a small canvas, never a
   full-width panel. The desktop viewBox ratio drives the height. Its
   render scale is about 0.31 px per unit, so the label size is raised to
   30 units (9.3 px) and the four minor labels are dropped, matching the
   five-label set the phone card already uses. */
.trip-map {
  flex: none;
  min-height: 0;
  aspect-ratio: 974 / 540;
  margin: 12px 0 4px;
  --map-label-size: 30px;
}

.trip-map .map-labels text:nth-child(3),
.trip-map .map-labels text:nth-child(5),
.trip-map .map-labels text:nth-child(6),
.trip-map .map-labels text:nth-child(9) {
  display: none;
}

.trip-card .kv {
  margin-top: 10px;
}

/* The next manoeuvre is a strip inside the trip card, not a second card.
   It keeps the map, the trip numbers and the turn in one block that still
   fits a 800 px-tall window without a scrollbar. */
.turn-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(122, 174, 255, 0.1);
}

.turn-icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--cyan);
}

.turn-strip-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.turn-strip-main strong {
  font: 500 var(--card-value)/1 var(--font);
  letter-spacing: 0.01em;
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

.turn-strip-main strong .u {
  font-size: 0.6em;
}

.turn-strip-main span {
  font-size: var(--card-body);
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.turn-strip .micro {
  margin-left: auto;
  flex: none;
}

.charge-time {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.charge-time span {
  font-size: 38px;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-value);
  text-shadow: 0 0 26px rgba(56, 189, 248, 0.16);
}

.charge-time em {
  font: 500 11px/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--text-unit);
}

.service-big span {
  font-size: 40px;
}

.plate {
  padding: 6px 10px;
  border: 1px solid var(--hair);
  border-radius: 7px;
  background: rgba(9, 16, 26, 0.6);
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  white-space: nowrap;
}

.car-stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(122, 174, 255, 0.1);
  border-radius: 16px;
  background:
    radial-gradient(60% 70% at 50% 62%, rgba(10, 60, 120, 0.24), transparent 70%),
    linear-gradient(180deg, rgba(8, 15, 25, 0.52), rgba(5, 8, 13, 0.28));
}

.stage-chip {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(5, 9, 15, 0.6);
  font: 500 var(--t-label)/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--muted);
  backdrop-filter: blur(8px);
}

/* 3D scene (kept from the original showroom) */

.ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 0;
  width: min(76%, 520px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) scaleY(0.88);
  filter: drop-shadow(0 0 24px rgba(10, 132, 255, 0.24));
}

.ring svg {
  width: 100%;
  height: 100%;
}

.floor-glow {
  position: absolute;
  left: 50%;
  top: calc(50% + 58px);
  z-index: 1;
  width: 62%;
  height: 110px;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(56, 189, 248, 0.2), rgba(10, 132, 255, 0.08) 42%, transparent 70%);
  filter: blur(14px);
  pointer-events: none;
}

.floor-line {
  position: absolute;
  left: 50%;
  top: calc(50% + 58px);
  z-index: 1;
  width: 58%;
  height: 1px;
  transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.22), transparent);
  pointer-events: none;
}

.scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: grab;
  touch-action: none;
}

.scene canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.scene.is-dragging,
.scene.is-dragging canvas {
  cursor: grabbing;
}

/* A real frame of the car is visible immediately; the live canvas fades in
   over it the moment the model's first frame is drawn. */
.stage-poster {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.55s var(--ease);
}

.car-stage.is-ready .stage-poster {
  opacity: 0;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, transparent 34%, rgba(5, 7, 12, 0.35) 74%, rgba(5, 7, 12, 0.78) 100%);
}

.loader {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: opacity 0.45s var(--ease), visibility 0.45s;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-top-color: var(--cyan);
  box-shadow: 0 0 18px -4px rgba(56, 189, 248, 0.5);
  animation: spin 1.15s linear infinite;
}

.loader-text {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 9.5px/1 var(--font);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.loader-text span:last-child {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--cyan);
}

.loader-bar {
  width: 128px;
  height: 1px;
  background: rgba(120, 170, 255, 0.16);
  overflow: hidden;
}

.loader-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.5), var(--cyan));
  box-shadow: 0 0 10px var(--cyan);
  transition: width 0.2s linear;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.webgl-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 7;
  width: min(320px, 84%);
  transform: translate(-50%, -50%);
  padding: 22px 24px;
  text-align: center;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(18px);
}

.webgl-fallback p {
  margin: 0 0 8px;
  font: 600 10px/1.2 var(--font);
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.webgl-fallback span {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.car-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex: none;
  min-width: 0;
}

.paint-dock {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  min-width: 0;
}

.dock-label {
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.swatches {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  appearance: none;
  width: 19px;
  height: 19px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  /* The material treatment lives in components.css (.paint-orb), shared
     with the mobile chip and the design-system specimen. */
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.swatch:hover {
  transform: translateY(-1px) scale(1.06);
}

.swatch.is-active {
  transform: scale(1.06);
  box-shadow:
    0 0 0 2px rgba(5, 7, 12, 0.92),
    0 0 0 3px rgba(56, 189, 248, 0.82),
    0 0 16px rgba(56, 189, 248, 0.5),
    var(--paint-rim);
}

.swatch:focus-visible {
  outline: 1px solid var(--cyan);
  outline-offset: 4px;
}

.paint-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 92px;
  white-space: nowrap;
}

.paint-meta #paintName {
  font: 500 var(--card-body)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-value);
}

.paint-meta #paintKind {
  font: 500 var(--card-label)/1 var(--font);
  letter-spacing: 0.03em;
  color: var(--muted);
}

.drag-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 4px;
  color: var(--muted);
  font: 500 var(--card-label)/1 var(--font);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.drag-hint svg {
  width: 15px;
  height: 15px;
  color: rgba(56, 189, 248, 0.7);
}

/* ---------- Overview: right rail ---------- */

/* The right rail is a stack of natural-height cards. Each one stays sized to
   its own content; none of them grows into leftover column space. Density is
   handled per viewport instead. Battery and Next charge are two cards, so on a
   short screen the stack scrolls vertically; the gap and card insets are never
   compressed to make the sixth card fit. */
.dash-col--right {
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 174, 255, 0.28) transparent;
}

.dash-col--right::-webkit-scrollbar {
  width: 4px;
}

.dash-col--right::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(122, 174, 255, 0.28);
}

.dash-col--right > .panel-card {
  flex: 0 0 auto;
}

.health-stamp {
  margin: var(--sp-2) 0 0;
  padding-top: var(--sp-2);
  border-top: 1px solid rgba(122, 174, 255, 0.09);
  font-size: var(--card-body);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.health-stamp span {
  margin-left: 4px;
  font-family: var(--font);
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

.health-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(122, 174, 255, 0.09);
}

.health-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(122, 174, 255, 0.07);
}

.health-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.health-list span {
  font: 600 var(--card-label)/1.2 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.health-list em {
  font-family: var(--font);
  font-style: normal;
  font-weight: 500;
  font-size: var(--card-value);
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

.health-list .u {
  font-size: 0.6em;
}

.health-reading {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}

/* Tyre pressure: four wheels on one 2 × 2 grid, each with its own state. */
.tyre-card .card-head {
  margin-bottom: var(--sp-3);
}

.tyre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3) var(--sp-4);
}

.tyre {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(122, 174, 255, 0.1);
}

.tyre-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tyre-head span {
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.tyre-head b {
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.06em;
  color: var(--tag-ok-ink);
}

.tyre strong {
  font: 500 var(--card-value)/1 var(--font);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.tyre strong em {
  font: 500 0.6em/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
}

/* ---------- Battery & charge: compact rail variant ---------- */

/* Battery card. Ring and range only, matching the in-car centre display,
   where the charge plan is its own card beside it. */
.battery-card {
  padding: var(--pad-card);
}

/* Battery level — one shared component on desktop, in-car and mobile. The
   charge sits inside the ring, the remaining range is the hero figure, and
   the ring itself carries a marker at the 80% charge limit. Only the scale
   variables change per surface; the drawing and colour meaning are identical.
   The arc is an explicit dash in user units, so it paints identically in every
   engine without relying on pathLength normalisation. */
.soc-block {
  --soc-ring: 66px;
  --soc-gap: 12px;
  --soc-num: var(--card-value);
  --soc-pct: 8.5px;
  /* The range is the card's primary value, so it uses the ladder's top step. */
  --soc-range: var(--card-primary);
  --soc-unit: 10px;
  --soc-label: var(--card-body);
  --soc-meta: var(--card-label);
}

/* The ring is the card's left anchor; the readout column carries the range
   and, as its third line, the charge limit; the two supplementary readings
   form one footnote row under the band that reaches both card edges — the
   same label-left / value-right spread the other right-rail cards use, so the
   card has no empty corner. 412 is still the first and largest thing read.

   v0.8.30: the readout follows the ring at a fixed 24 px, not the band's
   right edge. The card keeps space to the right of the reading; that is
   calmer than stretching the ring-to-reading gap to fill the rail. */
.battery-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  column-gap: var(--sp-6);
  row-gap: var(--sp-3);
}

.battery-band > .soc-ring {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.battery-band > .soc-readout {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  justify-self: start;
}

/* The footnote row: 1.8 on the content's left edge, 14.9 on its right edge.
   If the rail ever gets too narrow for one line, it wraps to two left-aligned
   lines instead of overflowing. */
.battery-band > .energy-notes {
  grid-column: 1 / -1;
  grid-row: 2;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: var(--sp-3);
}

/* The reading pair uses the shared .energy-note recipe from components.css;
   only the size is set here. */
.battery-card .energy-notes {
  --energy-note-size: var(--card-body);
}

/* Next charge — the second half of the old combined card, unchanged in
   wording, now its own card like the in-car centre display. */
.next-card {
  padding: var(--pad-card);
}

.next-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

/* v0.8.30: "Ready by" shares the planned-stop line, anchored to the card's
   right edge, so the card loses one line of height. The row stretches to the
   content width while the time above keeps its own left edge. */
.next-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  width: 100%;
}

.next-time {
  margin: 2px 0 3px;
  font: 300 var(--card-primary)/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-value);
}

.bs-line {
  font-size: var(--card-body);
  line-height: 1.35;
  color: var(--text-label);
  white-space: nowrap;
}

.bs-line b {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-value);
}

.soc-layout {
  display: flex;
  align-items: center;
  gap: var(--soc-gap);
}

.soc-ring {
  position: relative;
  flex: none;
  width: var(--soc-ring);
  height: var(--soc-ring);
}

.soc-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.soc-ring-track {
  fill: none;
  stroke: rgba(120, 170, 255, 0.15);
  stroke-width: 6;
}

.soc-ring-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 6;
  stroke-linecap: round;
}

/* Separate unfiltered glow stroke. A CSS drop-shadow filter on the dashed
   stroke is what made the arc vanish in some renderers; a wider translucent
   stroke gives the same soft edge without a filter. */
.soc-ring-glow {
  fill: none;
  stroke: rgba(56, 189, 248, 0.28);
  stroke-width: 11;
  stroke-linecap: round;
}

.soc-ring-limit {
  fill: #05080d;
  stroke: var(--cyan);
  stroke-width: 2.2;
}

.soc-ring-value {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  align-content: center;
  justify-content: center;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* The pair sits in one inline box so the text space between the number and
   the % is a real space; the grid only centres the pair. */
.soc-ring-pair {
  display: inline;
  white-space: nowrap;
}

.soc-ring-value strong {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-size: var(--soc-num);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-value);
}

.soc-ring-value em {
  font: 500 calc(var(--soc-num) * 0.6)/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
}

.soc-readout {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.soc-range-hero {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 0.9;
}

.soc-range-hero strong {
  font-size: var(--soc-range);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--text-value);
  text-shadow: 0 0 26px rgba(56, 189, 248, 0.14);
}

.soc-range-hero em {
  font: 500 calc(var(--soc-range) * 0.6)/1 var(--font);
  font-variant-numeric: tabular-nums;
  font-style: normal;
  color: var(--text-unit);
}

/* Caption above a value: never let the caption's box touch the hero's box. */
.soc-range-label {
  margin: 0 0 var(--caption-gap);
  font-size: var(--soc-label);
  color: var(--muted);
}

/* The limit is the readout's third line — marker + "Charge limit 80 %" on
   one line, meta size, hanging from the same left edge as the range. */
.soc-limit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: var(--soc-meta);
  font-weight: 500;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
}

.soc-limit-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.soc-limit i {
  width: 6px;
  height: 6px;
  border: 1.5px solid var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(56, 189, 248, 0.5);
}

.soc-limit b {
  font: 500 var(--soc-meta)/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
}

.soc-limit em {
  font-style: normal;
  color: var(--text-unit);
}

.soc-limit-val {
  display: inline;
  white-space: nowrap;
}

.battery-source {
  margin: 9px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(122, 174, 255, 0.09);
  font-size: 10px;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* A reading group: every reading is one equal-width cell, label above value,
   one baseline, one type step. Climate (Cabin / Outside / Fan) and the door
   trio (Lock / Windows / Alarm) are this same component, so a state word in
   the value slot reads at value ink exactly like a number. */
.reading-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
  border-top: 1px solid rgba(122, 174, 255, 0.09);
}

.reading-group > div {
  display: flex;
  flex-direction: column;
  gap: var(--caption-gap);
  min-width: 0;
}

.reading-group span {
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-label);
  white-space: nowrap;
}

.reading-group strong {
  font: 500 var(--card-value)/1 var(--font);
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.reading-group .u {
  font-size: 0.6em;
}

/* Software & service: the same row rhythm as the health card. */
.service-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  border-top: 1px solid rgba(122, 174, 255, 0.09);
}

.service-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(122, 174, 255, 0.07);
}

.service-list > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.service-list dt {
  font: 600 var(--card-label)/1.2 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.service-list dd {
  margin: 0;
  font: 500 var(--card-value)/1 var(--font);
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

/* The one identifier in this card: the build string. Mono survives only for
   identifiers — plate, VIN, software version — never for a reading. */
.service-list dd.mono-id {
  font-family: var(--mono);
}

.service-list dd .u {
  font-size: 0.6em;
}

/* A short viewport loses the low-priority check timestamp before any card
   would ever be allowed to stretch. */
@media (max-height: 820px) {
  /* Compact density: the card inset stays at 16px (P rule floor is 12px).
     Content is dropped instead — see .health-stamp below. */
  :root {
    --pad-card: 16px;
  }

  .health-stamp {
    display: none;
  }

  /* The right rail keeps all six cards on an 800px-tall screen by closing
     the stack gap to 8px and letting the rail scroll; the service card is
     never clipped and the gap never drops below the 8px floor. */
  .dash-col--right {
    gap: var(--sp-2);
  }
}

.next-copy {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.next-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid rgba(122, 174, 255, 0.09);
  border-bottom: 1px solid rgba(122, 174, 255, 0.09);
}

.next-row span {
  display: block;
  margin-bottom: 6px;
  font: 500 9.5px/1 var(--font);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.next-row strong {
  font-size: 15px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.text-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin-top: var(--sp-3);
  font: 600 var(--t-label)/1 var(--font);
  letter-spacing: var(--tr-label);
  color: var(--cyan);
  cursor: pointer;
  transition: color 0.2s var(--ease), text-shadow 0.2s var(--ease);
}

.text-link:hover,
.text-link:focus-visible {
  color: #fff;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
  outline: none;
}

.trip-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font: 500 var(--t-note)/1 var(--font);
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

.trip-stats span + span::before {
  content: "·";
  margin-right: 10px;
  color: rgba(122, 174, 255, 0.4);
}

/* ---------- Map card ---------- */

/* `.map-canvas` no longer stretches: it is sized by the card that owns it. */
.map-canvas {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(122, 174, 255, 0.1);
  border-radius: 12px;
  /* Match the artwork ground so the viewBox overhang beyond the 900 x 620
     ground rect reads as the same map, not as a panel gutter. */
  background: #060b12;
  /* Bank strength follows the shared default: the old .32/.20 dial-down
     assumed a 1:1 px-per-unit canvas, which no longer holds at 304 px. */
}

.city-map {
  display: block;
  width: 100%;
  height: 100%;
}

/* Stroke weights are authored once in SVG user units and never re-scaled
   per surface: the artwork is one drawing, so a smaller render simply
   draws the same drawing at a smaller physical size. The cockpit's 4-unit
   route is the reference; desktop previously doubled it to 14 and that was
   the visible "light is too thick" difference. */
.city-map .map-route-travelled {
  stroke-width: 4;
  opacity: 0.5;
}

.city-map .map-route-travelled-core {
  stroke-width: 1.2;
}

.city-map .map-route {
  stroke-width: 4;
  /* No CSS filter here: it would replace the SVG routeGlow presentation
     attribute and kill the glow on the bright leg. */
}

.city-map .map-route-core {
  stroke-width: 1.2;
}

.city-map .map-dest .ring {
  /* The showroom's 3D stage also uses a `.ring` class. Its absolute
     positioning and percentage transform would drag this SVG circle
     out of the artwork, so reset the stage-only properties here. */
  position: static;
  left: auto;
  top: auto;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  transform: none;
  filter: none;
  stroke-width: 1.2;
}

/* The vehicle marker ships in the shared payload (halo ring + solid
   arrow). Desktop used to hide it and draw an HTML pin instead, which is
   why the ring was missing here. Show the real marker and let the shared
   artwork keep the three surfaces identical. */
.city-map .map-vehicle {
  display: block;
}

.map-compass {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: rgba(5, 10, 16, 0.62);
  color: var(--cyan);
  font: 600 9.5px/1 var(--font);
}

.map-compass i {
  margin-top: 8px;
  font-style: normal;
}

.map-scale {
  left: 14px;
  bottom: 12px;
  font: 500 9.5px/1 var(--font);
  font-variant-numeric: tabular-nums;
}

.remote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
}

.remote-grid.is-quad {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.remote-btn {
  appearance: none;
  min-height: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px;
  border: 1px solid rgba(122, 174, 255, 0.14);
  border-radius: 10px;
  background: rgba(10, 18, 29, 0.55);
  color: var(--ink-dim);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.remote-btn svg {
  width: 20px;
  height: 20px;
  color: var(--cyan);
}

.remote-btn:hover,
.remote-btn:focus-visible {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.08);
  color: var(--ink);
  outline: none;
}

.remote-btn:active {
  transform: translateY(1px);
}

.remote-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: rgba(122, 174, 255, 0.08);
  background: rgba(10, 18, 29, 0.3);
  color: var(--muted);
  transform: none;
}

.remote-btn:disabled svg {
  color: var(--muted);
}

.remote-note {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Controls ---------- */

.control-panel {
  padding: 20px 22px 18px;
  flex: none;
}

.control-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 250;
  letter-spacing: -0.01em;
  color: var(--text-value);
}

.control-copy {
  max-width: 560px;
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.card-head--sub {
  margin: 14px 0 4px;
}

.card-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Vehicle ---------- */

.vehicle-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.vehicle-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex: none;
  padding: 2px 2px 0;
}

.vehicle-head h1 {
  margin: 9px 0 0;
  font-size: 32px;
  font-weight: 250;
  letter-spacing: 0.01em;
}

.vehicle-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 16px;
}

/* The right side of Vehicle sets the appearance card beside the specs so the
   whole tab reads in one screen; it owns the scroll if a viewport is short. */
.vehicle-main {
  display: grid;
  grid-template-columns: minmax(340px, 1.08fr) minmax(340px, 1fr);
  align-items: start;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 174, 255, 0.28) transparent;
}

.vehicle-main::-webkit-scrollbar {
  width: 4px;
}

.vehicle-main::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: rgba(122, 174, 255, 0.28);
}

.appearance-card {
  flex: none;
  padding: 14px 16px 14px;
}

/* The stage keeps the showroom proportions it had on Overview, but now as a
   fixed-height block inside its own card. */
.appearance-card .car-stage {
  flex: none;
  height: clamp(280px, 38svh, 360px);
  min-height: 280px;
}

.spec-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 16px 28px;
  min-height: 0;
  overflow: visible;
  padding: 4px 4px 2px 0;
}

.spec-group h3 {
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair-strong);
  font: 600 10px/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--ink-dim);
}

.spec-list {
  margin: 0;
}

.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(122, 174, 255, 0.08);
}

.spec-row dt {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.spec-row dd {
  margin: 0;
  font-size: 14px;
  text-align: right;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.paint-chip {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
  vertical-align: 0;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 58px;
  z-index: 60;
  transform: translate(-50%, 8px);
  padding: 10px 16px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  background: rgba(6, 14, 24, 0.94);
  box-shadow: 0 10px 36px -14px rgba(0, 0, 0, 0.9);
  font: 600 var(--t-note)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--cyan);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0.24s;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.noscript {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--glass);
  font: 500 11px/1.4 var(--font);
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* The fifth status card closes the last row of the two-column grid
   instead of leaving an empty cell beside it. */
@media (min-width: 1001px) {
  .overview-status > :last-child {
    grid-column: 1 / -1;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: minmax(235px, 265px) minmax(0, 1fr) minmax(250px, 285px);
    gap: 12px;
  }
}

@media (max-width: 1000px) {
  body {
    height: auto;
    min-height: 100svh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .topbar {
    min-height: 0;
    padding: 10px 12px;
  }

  .app-main {
    flex: none;
    padding: var(--content-gap) 16px 14px;
  }

  .view {
    height: auto;
  }

  /* Narrow screens get one column: the car first, then the data cards. */
  .dashboard {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
  }

  .dash-col--center {
    order: -1;
  }

  .dash-car-card {
    flex: none;
  }

  .dash-car-card .car-stage {
    flex: none;
    height: clamp(300px, 46svh, 430px);
  }

  .dash-map {
    max-height: 260px;
  }

  .dash-location {
    flex: none;
  }

  .dash-location > .dash-map {
    flex: none;
    min-height: 0;
    aspect-ratio: 974 / 540;
  }
}

@media (max-width: 760px) {
  .nav-meta > span:not(.nav-user),
  .nav-meta .nav-sep {
    display: none;
  }

  .nav-meta {
    font-size: 9.5px;
  }

  .overview-status,
  .controls-grid > .rail,
  .vehicle-grid > .rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .spec-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .spec-group:nth-child(3) {
    grid-column: auto;
  }

  .toast {
    bottom: 56px;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 460px) {
  .app-main {
    padding: 10px 12px 12px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .nav-user {
    letter-spacing: 0.08em;
  }

  .nav-user i {
    width: 20px;
    height: 20px;
  }

  .tab {
    font-size: 9.5px;
    letter-spacing: 0.03em;
  }

  .greet h1 {
    font-size: 30px;
  }

  .soc-big span {
    font-size: 44px;
  }

  .car-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .paint-dock {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    border-radius: 14px;
  }

  .paint-meta {
    min-width: 0;
  }

  .paint-meta #paintKind {
    display: none;
  }

  .drag-hint {
    display: none;
  }

  .map-label {
    left: 8px;
    right: auto;
    top: -40px;
  }

  .map-label em {
    display: none;
  }

  .control-title {
    font-size: 30px;
  }

  .remote-btn {
    min-height: 56px;
    font-size: 12px;
  }

  .vehicle-head {
    display: block;
  }

  .vehicle-head .plate {
    display: inline-block;
    margin-top: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
