/* Jimmy's Ride — mobile companion
   A 390 × 844 canvas held in a hardware frame. All inner dimensions are
   expressed in container units, so the mockup stays proportional when it
   is scaled down for desktop review. */

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

.mobile-stage {
  display: grid;
  grid-template-columns: auto minmax(280px, 360px);
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 76px);
  padding: 18px clamp(18px, 3vw, 40px);
}

/* ---------- Hardware ---------- */

.phone {
  --pw: min(390px, calc((100svh - 188px) * 0.4621));
  position: relative;
  width: calc(var(--pw) + 18px);
  flex: none;
}

.phone-frame {
  position: relative;
  padding: 9px;
  border-radius: calc(var(--pw) * 0.115 + 9px);
  background: linear-gradient(158deg, #2b3746 0%, #070b11 36%, #0b131d 68%, #35424f 100%);
  box-shadow:
    0 44px 100px -40px rgba(0, 0, 0, 0.95),
    0 0 90px -32px rgba(56, 189, 248, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone-frame::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: calc(var(--pw) * 0.115 + 7px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.phone-side {
  position: absolute;
  z-index: 2;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #3b4a5a, #101922 70%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.phone-side--power {
  right: -2px;
  top: 26%;
  height: 10%;
}

.phone-side--volume {
  left: -2px;
  top: 20%;
  height: 12%;
}

.phone-screen {
  position: relative;
  width: var(--pw);
  aspect-ratio: 390 / 844;
  overflow: hidden;
  /* Card type ladder at phone scale. The four roles are fixed in
     components.css; only their values change here, in cqw of this canvas. */
  --card-label: 2.6cqw;
  --card-body: 3cqw;
  --card-value: 4.9cqw;
  --card-primary: 10cqw;
  /* Card padding, in one place: the stat rows use the same inset so their
     figures line up with card content, not with the card edge. */
  --card-inset: 4.8cqw;
  border-radius: calc(var(--pw) * 0.115);
  background:
    radial-gradient(70% 46% at 50% 12%, rgba(10, 76, 130, 0.34), transparent 66%),
    radial-gradient(54% 30% at 50% 102%, rgba(56, 189, 248, 0.1), transparent 72%),
    #05080d;
  color: var(--ink);
  font-family: var(--font);
  isolation: isolate;
  container-type: inline-size;
}

.phone-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 34%, transparent 46%, rgba(0, 0, 0, 0.34) 100%);
}

/* ---------- Phone chrome ---------- */

.phone-island {
  position: absolute;
  left: 50%;
  top: 2.4cqw;
  z-index: 30;
  width: 24cqw;
  height: 7cqw;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #010306;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.m-status {
  position: absolute;
  inset: 0 0 auto;
  z-index: 25;
  height: 12.8cqw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4cqw 8cqw 0;
  font: 600 3.6cqw/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.m-status-icons {
  display: flex;
  align-items: center;
  gap: 1.6cqw;
}

.m-status-icons svg {
  width: 4.6cqw;
  height: auto;
  color: var(--ink);
}

.m-status-icons svg:first-child {
  width: 4.4cqw;
}

.m-status-icons svg:last-child {
  width: 6.2cqw;
}

/* Mobile policy (v0.4.13): inner pages scroll vertically. The phone canvas
   never scrolls horizontally and keeps its status bar and tab bar fixed.
   Content uses the breathing-space numbers and grows past the viewport
   instead of compressing padding, gaps or line-heights. */
.m-views {
  position: absolute;
  inset: 12.8cqw 0 25.4cqw;
  padding: 3.6cqw 5.1cqw 3.4cqw;
  z-index: 5;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.m-views::-webkit-scrollbar {
  display: none;
}

.m-view {
  display: flex;
  flex-direction: column;
  gap: max(10px, 3cqw);
  min-height: 100%;
  animation: screenIn 0.32s var(--ease) both;
}

.m-view[hidden] {
  display: none;
}

/* The control page carries live readings and four controls; it gets a wider
   rhythm between blocks than the list pages. Nothing is compressed to fit.
   The extra top padding gives the status line and the car room to breathe. */
.m-view--roomy {
  gap: max(18px, 7.2cqw);
  padding-top: 2.4cqw;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(2cqw); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Bottom tab bar ---------- */

/* The bar is the screen's frame, not a floating pill: it runs edge to edge
   and closes the canvas with a hairline along its top. The active item marks
   itself with one thing only — a cyan disc behind its icon, drawn by the
   icon's own padding box (5.4 + 1.4 + 1.4 = 8.2cqw). The rail is short
   enough that a second marker under the label would sit directly beneath the
   disc and read as a duplicate, so the line is not carried over: the disc
   hugs the icon the user actually tapped and stays legible at 320. */
.m-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  height: 22.4cqw;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 2.4cqw 5.2cqw;
  border-top: 1px solid var(--hair);
  background: linear-gradient(180deg, rgba(8, 14, 24, 0.86), rgba(5, 8, 13, 0.98));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.m-tab {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 2.4cqw;
  min-height: 13cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1cqw;
  padding: 0;
  color: var(--muted);
  font-family: var(--font);
  font-size: 3.6cqw;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

/* The disc is the icon's padding box, so it cannot drift from the glyph and
   needs no extra wrapper in the markup. */
.m-tab svg {
  box-sizing: content-box;
  width: 5.4cqw;
  height: 5.4cqw;
  padding: 1.4cqw;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.m-tab span {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.m-tab.is-active {
  color: var(--text-value);
}

.m-tab.is-active svg {
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.13);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.24);
}

.m-tab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -3px;
}

.m-home-bar {
  position: absolute;
  left: 50%;
  bottom: 2.3cqw;
  z-index: 26;
  width: 34%;
  height: 0.7cqw;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(232, 241, 251, 0.4);
}

/* A one-off message about the tap that just happened, floating above the tab
   bar. It explains why nothing changed; the tile's own reading is untouched. */
.m-hint {
  position: absolute;
  left: 50%;
  bottom: 25.6cqw;
  z-index: 24;
  max-width: 78%;
  padding: 2.2cqw 3.6cqw;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(9, 16, 26, 0.94);
  box-shadow: 0 10px 26px -14px rgba(0, 0, 0, 0.9);
  color: var(--text-value);
  font: 500 var(--card-body)/1.2 var(--font);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 1.2cqw);
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

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

/* ---------- Shared mobile primitives ---------- */

.m-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4cqw;
  flex: none;
  padding: 0.5cqw 0 1.2cqw;
}

.m-kicker {
  margin: 0 0 1.8cqw;
  font: 600 2.9cqw/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.m-head h1 {
  margin: 0;
  font-size: 9.2cqw;
  font-weight: 250;
  line-height: 1.02;
  letter-spacing: 0.01em;
  color: var(--text-value);
}

/* The heading is the vehicle switcher: the car's name sits at the top of the
   page and the chevron says another car can be picked from the garage. It
   stays a label above the hero — the speed below is the page's figure. */
.m-vehicle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 1.4cqw;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2cqw;
  background: none;
  color: var(--text-value);
  font: inherit;
  font-size: 6.4cqw;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.m-vehicle-go {
  width: 3.6cqw;
  height: 3.6cqw;
  flex: none;
  color: var(--cyan);
}

.m-vehicle:hover .m-vehicle-go {
  color: var(--text-value);
}

.m-vehicle:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Identity photo on Me only. It is a non-interactive image: no button,
   no pointer/hover affordance, and no sheet behind it. */
.m-avatar {
  display: block;
  width: 10.3cqw;
  height: 10.3cqw;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--avatar-ring);
  border-radius: 50%;
  background: var(--avatar-wash);
  flex: none;
  pointer-events: none;
}

.m-avatar--lg {
  width: 15.2cqw;
  height: 15.2cqw;
}

.m-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The person's page: portrait and name are one block, not a title bar. The
   bar keeps the height the 16.4cqw portrait used to set — that portrait plus
   the 1.6cqw bottom padding — so a smaller portrait neither changes the bar
   nor moves the name beside it. */
.m-head--person {
  align-items: center;
  justify-content: flex-start;
  gap: 4.4cqw;
  min-height: 18cqw;
  padding-bottom: 1.6cqw;
}

.m-person-sub {
  margin: 1.6cqw 0 0;
  font-size: var(--card-body);
  line-height: 1;
  color: var(--text-label);
}

/* Page heading with a live reading beside it — the speed after "Driving". */
.m-head-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1.2cqw 2.6cqw;
}

.m-head-speed {
  font-size: var(--card-value);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
}

.m-head-speed em {
  font-size: 0.6em;
  font-style: normal;
  font-weight: 500;
  color: var(--text-unit);
}

/* P rule: 14.6 px here (4.8cqw) — above the 12 px floor at the 390 px
   canvas. The card grows with its content; it never squeezes this padding. */
.m-card {
  position: relative;
  overflow: hidden;
  padding: var(--card-inset);
  border: 1px solid var(--hair);
  border-radius: 3.6cqw;
  background: var(--glass);
  box-shadow: 0 3cqw 7cqw -4cqw rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.m-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;
}

.m-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3cqw;
}

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

.m-note {
  margin: 1.8cqw 0 0;
  font-size: var(--card-body);
  line-height: 1.45;
  color: var(--text-prose);
}

.m-note .u {
  font-size: 0.85em;
}

/* Status labels stay bare where they sit inside a row or a value: there they
   are read as part of that line, not as a separate control. */
.status {
  font-size: var(--card-label);
  line-height: 1;
}

/* A state that has to stand on its own — the hero corner, or beside a value —
   takes a chip: hairline ring, faint fill, the same pill language as the map
   badge, so no third shape is invented. The healthy state keeps its green
   ink. */
.m-status-tag {
  display: inline-flex;
  align-items: center;
  padding: 1.1cqw 2.4cqw;
  border: 1px solid rgba(122, 174, 255, 0.24);
  border-radius: 999px;
  background: rgba(122, 174, 255, 0.07);
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-label);
  white-space: nowrap;
}

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

/* The speed is this page's reading: a small live word sits over one large
   number, so the switcher above it is no longer the biggest thing in view.
   The live word is chrome and takes the live ink; only km/h is a unit. */
.m-status-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5cqw;
  font: 600 var(--card-body)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-live);
  white-space: nowrap;
}

.m-chip-word {
  font: 600 var(--card-body)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-live);
}

.m-chip-figure {
  font: 300 11.2cqw/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--text-value);
}

.m-chip-unit {
  font: 500 0.42em/1 var(--font);
  font-style: normal;
  letter-spacing: 0.02em;
  color: var(--text-unit);
}

/* ---------- Home ---------- */

/* The car is the page: full-bleed on the open surface, no card, no frame. */
.m-hero {
  flex: none;
  margin-inline: -5.1cqw;
}

.m-hero-top,
.m-hero-read {
  padding-inline: 5.1cqw;
}

.m-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3cqw;
}

/* The tag rides on the small word's line, not the number's. Its chip shape
   comes from .m-status-tag. */
.m-hero-tag {
  flex: none;
}

.m-hero-car {
  display: block;
  width: 100%;
  height: auto;
  margin: 3.2cqw 0 -0.4cqw;
}

.m-hero-read {
  padding-top: 0.6cqw;
}

/* The range is the second reading on the page: a clear step under the speed,
   so only one figure carries the hero size. */
.m-hero-range {
  margin: 1.2cqw 0 0;
  font: 300 7.6cqw/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--text-value);
}

.m-hero-range strong {
  font-weight: 300;
}

.m-hero-range em {
  font-size: 0.6em;
  font-weight: 500;
}

.m-hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4cqw 4.8cqw;
  margin-top: 3.4cqw;
}

.m-hero-facts > span {
  display: inline-flex;
  align-items: baseline;
  gap: 1.5cqw;
  white-space: nowrap;
}

.m-hero-facts b {
  font: 500 var(--card-value)/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
}

.m-hero-facts em {
  font-size: 0.6em;
  font-weight: 500;
}

/* A footnote under the battery pair, not a competitor: body size, body ink,
   numbers only as figures inside the sentence. The rule and the text share
   the reading column, so this line starts on the same left edge as the
   range and the battery pair above it. */
/* Two readings on one footnote line. The trip figure opens at the reading
   edge; the consumption average closes against the page's right edge. They
   wrap as whole units if the line gets tight, and the second one keeps its
   right alignment on its own line. */
.m-hero-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.2cqw 3.2cqw;
  margin: 4.4cqw 5.1cqw 0;
  padding-top: 3.2cqw;
  border-top: 1px solid rgba(122, 174, 255, 0.1);
  font-size: var(--card-body);
  line-height: 1.4;
  color: var(--text-label);
}

.m-hero-trip,
.m-hero-avg {
  white-space: nowrap;
}

.m-hero-avg {
  margin-left: auto;
  text-align: right;
}

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

.m-hero-note em {
  font-style: normal;
  font-weight: 500;
  color: var(--text-unit);
}

/* One control block instead of a button row plus two state cards: each cell is
   a disc and the state it changes, so a press happens on the thing it alters.
   Every row uses the same two columns, so Fan sits directly under Windows and
   no cell's x depends on a neighbour's label. */
.m-controls-card {
  padding: 5.4cqw;
}

.m-ctl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2cqw 2.4cqw;
}

/* The rules are grid items of their own so a row can be separated without
   wrapping its cells and giving them a second column system. */
.m-ctl-rule {
  grid-column: 1 / -1;
  height: 0;
  border-top: 1px solid rgba(122, 174, 255, 0.08);
}

/* A group in name and semantics only: it draws no box, so AC and Fan are
   placed by the card's grid, in the same columns as Lock and Windows. */
.m-climate-row {
  display: contents;
}

.m-ctl-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1cqw 3.2cqw;
  margin-top: 0.4cqw;
}

.m-ctl {
  appearance: none;
  display: flex;
  align-items: flex-start;
  gap: 2.6cqw;
  min-width: 0;
  padding: 1.4cqw 0;
  border: 0;
  border-radius: 3cqw;
  background: none;
  color: var(--text-label);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}

/* Charge owns the last row of the block, so it spans the grid and takes the
   same hairline as the climate row above it. */
.m-ctl--charge {
  grid-column: 1 / -1;
  padding: 0;
}

.m-ctl-disc {
  flex: none;
  display: grid;
  place-items: center;
  width: 11.8cqw;
  height: 11.8cqw;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: rgba(10, 18, 29, 0.62);
  color: var(--ink-dim);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.m-ctl svg {
  width: 5.2cqw;
  height: 5.2cqw;
}

.m-ctl-body {
  display: flex;
  flex-direction: column;
  gap: 0.7cqw;
  min-width: 0;
  padding-top: 0.4cqw;
}

.m-ctl-name {
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-label);
  white-space: nowrap;
}

.m-ctl-go {
  width: 3.2cqw;
  height: 3.2cqw;
  color: var(--muted);
}

.m-ctl-state {
  font: 500 var(--card-value)/1.05 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--text-value);
  white-space: nowrap;
}

.m-ctl-state b {
  font-weight: 500;
}

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

/* Fixed state slot. In the climate row the controls share the card's columns,
   so a label swap must not resize a cell or its row. Each state owns a column
   wide enough for the longest label (On, Off, Auto) at both 390 and 320. */
.m-climate-row .m-ctl-state {
  min-inline-size: 1.5em;
}

.m-ctl-detail {
  font-size: var(--card-body);
  line-height: 1.3;
  color: var(--text-label);
}

.m-ctl-detail:empty {
  display: none;
}

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

.m-ctl-detail em {
  font-style: normal;
  font-weight: 500;
  color: var(--text-unit);
}

.m-ctl[aria-pressed="true"] .m-ctl-disc,
.m-ctl[data-on="true"] .m-ctl-disc {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
}

.m-ctl[aria-pressed="false"] .m-ctl-disc,
.m-ctl[data-on="false"] .m-ctl-disc {
  color: var(--muted);
}

.m-ctl:active .m-ctl-disc {
  background: rgba(56, 189, 248, 0.18);
}

.m-ctl:focus-visible {
  outline: none;
}

.m-ctl:focus-visible .m-ctl-disc {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

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

/* Charge plan sheet: the four facts the tile summarises, then the sentence
   that explains what the plan does, then the two ways to act on it. */
.m-plan-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.4cqw 3cqw;
  margin-top: 3.4cqw;
}

.m-plan-facts > div {
  display: flex;
  flex-direction: column;
  gap: 1.2cqw;
  min-width: 0;
}

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

.m-plan-facts strong b {
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text-value);
}

.m-plan-facts strong em {
  font: 500 0.6em/1 var(--font);
  font-style: normal;
  color: var(--text-unit);
}

.m-plan-copy {
  margin: 3.2cqw 0 0;
  font-size: var(--card-body);
  line-height: 1.5;
  color: var(--text-prose);
}

.m-plan-copy span {
  color: var(--text-value);
  font-variant-numeric: tabular-nums;
}

.m-plan-label {
  margin: 4cqw 0 0;
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-label);
}

.m-plan-times {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2cqw;
  margin-top: 2.2cqw;
}

.m-plan-time {
  appearance: none;
  min-height: 11.2cqw;
  padding: 1.4cqw 0;
  border: 1px solid var(--hair);
  border-radius: 2.6cqw;
  background: rgba(9, 16, 26, 0.55);
  color: var(--text-value);
  font: 500 var(--card-body)/1 var(--font);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.m-plan-time.is-current,
.m-plan-time[aria-pressed="true"] {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.12);
}

.m-plan-time:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.m-plan-now {
  appearance: none;
  width: 100%;
  min-height: 12.6cqw;
  margin-top: 3.4cqw;
  border: 1px solid rgba(56, 189, 248, 0.34);
  border-radius: 3cqw;
  background: rgba(56, 189, 248, 0.08);
  color: var(--text-label);
  font: 500 var(--card-body)/1 var(--font);
  cursor: pointer;
}

.m-plan-now:active {
  background: rgba(56, 189, 248, 0.16);
}

.m-plan-now:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Me ---------- */

/* Vehicle management is a door, not a list: one row names the current car and
   states that the switch lives inside it. The cars themselves are in the
   garage sheet, shared with the switcher at the top of the vehicle page. */
.m-vehicle-entry {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 3cqw;
  width: 100%;
  padding: 3.4cqw;
  border: 1px solid var(--hair);
  border-radius: 3.6cqw;
  background: var(--glass);
  color: var(--ink);
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3cqw 7cqw -4cqw rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s var(--ease);
}

.m-vehicle-entry .m-vehicle-info {
  flex: 1;
}

.m-vehicle-entry .m-vehicle-go {
  width: 4.2cqw;
  height: 4.2cqw;
  color: var(--cyan);
}

.m-vehicle-entry:hover,
.m-vehicle-entry:focus-visible {
  border-color: rgba(56, 189, 248, 0.4);
  outline: none;
}

/* History first, details second: one segmented control, so the pair reads as
   a control before it is touched. The track is a hairline capsule with a 6%
   wash; the two segments are equal columns, so the longer label can never
   shift the pair when the tab changes.

   The active segment is carried by the segment surface itself — a cyan wash
   with a 1px ring — plus weight and colour, and no underline: the underline
   language belongs to the filter legend inside the Activity card, one level
   down. Track 46.44 / 38.47px tall, segments 168.88 × 37.44 / 138.38 ×
   30.72px, all inside the panel's own width at both canvases. */
.m-subtabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9cqw;
  padding: 0.9cqw;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: rgba(122, 174, 255, 0.06);
}

.m-subtab {
  appearance: none;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 9.6cqw;
  padding: 0 1cqw;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-label);
  font: 500 var(--card-body)/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.m-subtab.is-current {
  background: rgba(56, 189, 248, 0.14);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.26);
  color: var(--text-value);
  font-weight: 600;
}

.m-subtab:not(.is-current):hover {
  color: var(--text-prose);
}

.m-subtab:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.m-me-panel {
  display: flex;
  flex-direction: column;
  gap: max(10px, 3cqw);
}

.m-me-panel[hidden] {
  display: none;
}

.m-garage-list {
  display: flex;
  flex-direction: column;
  gap: 2.2cqw;
  margin-top: 2.6cqw;
}

.m-garage-list .m-vehicle-row {
  margin-top: 0;
}

/* ---------- History ---------- */

/* The filter is part of the list, seated under its Activity header. It is a
   text legend on a rule, not a second segmented control: no frame, no fill,
   label-size type, a shorter row than the History / Vehicle details track
   above, and one 1px hairline under the whole group instead of a capsule
   border. The rule is absolutely positioned, so it adds no height to the row;
   the active label lights its own 1px segment of that same rule — the
   opposite gesture to the primary track's filled segment, which keeps the two
   levels from reading as the same kind of control.

   It still only narrows the feed: the summary and the record count are derived
   from the same visible rows, so they cannot disagree with the list. */
.m-filter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7cqw;
  margin-top: 1.4cqw;
}

.m-filter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hair);
  pointer-events: none;
}

.m-filter-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 8.4cqw;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-label);
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.m-filter-btn.is-current {
  color: var(--text-value);
}

.m-filter-btn.is-current::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--cyan);
}

.m-filter-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* One row of three figures, shared by Location (range / arrival / battery)
   and Me (trips / distance / charged). Both pages use this component, so
   type, separators and rhythm cannot drift apart.

   The row carries the same inset as a card's content, so its figures line up
   with the labels inside the cards above and below instead of hugging the
   page edge. It also takes one extra beat above and below on top of the
   view's own gap: at either canvas that makes 18px to its neighbours. */
.m-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.4cqw;
  align-items: start;
  padding-inline: calc(var(--card-inset) + 1px);
  margin-block: max(8px, 2.4cqw);
}

/* Every column reserves exactly one label line, so the three values start
   on the same baseline even when a caption is long. Captions never wrap. */
.m-stats > div {
  display: grid;
  grid-template-rows: 3.48cqw 5.4cqw;
  gap: 2.6cqw;
  min-width: 0;
}

.m-stats .m-label {
  overflow: visible;
  white-space: nowrap;
}

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

.m-stats strong em,
.m-stats strong .u {
  font: 500 0.6em/1 var(--font);
  font-style: normal;
  color: var(--text-unit);
}

.m-log {
  list-style: none;
  margin: 2.4cqw 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Each record is led by a kind glyph — a navigation arrow for a trip, a plug
   for a charge — so the two kinds separate before the label is read. The
   glyph owns a fixed 4.4cqw column with a 2.4cqw gutter, and both text lines
   sit in the second column, so the row's left and right edges, and the
   alignment between the label line and the route line, stay as they were.
   Both glyphs are drawn on the same 24 grid at 1.6 stroke, which lands on
   about 1.1px at 390 and 0.95px at 320 — the weight the rest of the mobile
   icon set renders (Honk, Flash, the vehicle chevron). */
.m-log-row {
  display: grid;
  grid-template-columns: 4.4cqw minmax(0, 1fr);
  column-gap: 2.4cqw;
  row-gap: 1.2cqw;
  align-items: start;
  padding: 2.4cqw 0;
  border-bottom: 1px solid rgba(122, 174, 255, 0.08);
}

.m-log-row::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  width: 4.4cqw;
  height: 4.4cqw;
  background-color: var(--text-label);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.m-log-row[data-km]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M12%203.2%2019%2020.4l-7-4.3-7%204.3L12%203.2Z'%20fill='none'%20stroke='%23000'%20stroke-width='1.6'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M12%203.2%2019%2020.4l-7-4.3-7%204.3L12%203.2Z'%20fill='none'%20stroke='%23000'%20stroke-width='1.6'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.m-log-row[data-kwh]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M9%203.4v4.6M15%203.4v4.6M6.2%208.2h11.6v2.6a5.8%205.8%200%200%201-11.6%200V8.2ZM12%2016.6v3.8'%20fill='none'%20stroke='%23000'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%3E%3Cpath%20d='M9%203.4v4.6M15%203.4v4.6M6.2%208.2h11.6v2.6a5.8%205.8%200%200%201-11.6%200V8.2ZM12%2016.6v3.8'%20fill='none'%20stroke='%23000'%20stroke-width='1.6'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
}

.m-log-row:last-child,
.m-log-row.is-last {
  padding-bottom: 0;
  border-bottom: 0;
}

.m-log-row[hidden] {
  display: none;
}

.m-log-top {
  display: flex;
  align-items: baseline;
  gap: 1.6cqw;
}

.m-log-kind + .m-log-when::before {
  content: "·";
  margin-right: 1.6cqw;
}

.m-log-kind {
  font: 600 var(--card-label)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--text-label);
}

.m-log-when {
  font-size: var(--card-body);
  line-height: 1;
  color: var(--text-label);
}

.m-log-core {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2.4cqw;
  min-width: 0;
}

.m-log-what {
  font-size: var(--card-body);
  line-height: 1.35;
  color: var(--text-prose);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m-log-core strong {
  flex: none;
  font: 500 var(--card-value)/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
  white-space: nowrap;
}

.m-log-core strong em {
  font: 500 0.6em/1 var(--font);
  font-style: normal;
  color: var(--text-unit);
}

/* ---------- Location ---------- */

.m-map-card {
  padding: 4.8cqw;
}

.m-map {
  position: relative;
  height: 68cqw;
  overflow: hidden;
  border: 1px solid rgba(122, 174, 255, 0.1);
  border-radius: 2.8cqw;
  background: #060b12;
  /* The phone window is 765 units wide, so 28-unit labels render at
     9.3 px — above the 9 px mobile floor without touching the shared
     SVG payload. */
  --map-label-size: 28px;
}

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

.m-map .map-blocks .b--landmark {
  stroke-width: 1.3;
}

.m-map .map-bank {
  stroke-width: 0.8;
}

.m-map .map-roads path {
  stroke-width: 1;
}

.m-map .map-roads path.is-major {
  stroke-width: 2;
}

.m-map .map-label.is-landmark {
  font-size: 6.6cqw;
}

.m-map .map-label.is-district {
  font-size: 5.6cqw;
}

.m-map .map-label.is-road {
  font-size: 5.6cqw;
}

.m-map .map-label.is-water {
  font-size: 5.3cqw;
}

/* Driven leg: same stroke width as the bright leg, no glow, 50% cyan. */
.m-map .map-route-travelled {
  stroke-width: 4;
  opacity: 0.5;
}

.m-map .map-route-travelled-core {
  stroke-width: 1.5;
}

.m-map .map-route {
  stroke-width: 4;
  /* Keep the shared SVG routeGlow; a CSS filter would overwrite it. */
}

.m-map .map-route-core {
  stroke-width: 1.5;
}

.m-map .map-dest .ring {
  stroke-width: 1.5;
}

/* The phone used to hide the shared vehicle marker. It now renders the
   same halo + arrow as the cockpit, scaled only by the map window. */
.m-map .map-vehicle {
  display: block;
}

/* Remote-action feedback: the marker on this map is the state the
   confirmation line names, so every action changes it visibly. */
.m-map.is-found .map-vehicle .halo {
  stroke: var(--cyan-bright);
  stroke-width: 2.6;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.85));
  animation: m-found-pulse 0.9s ease-in-out 2;
}

.m-map.is-found .map-vehicle .arrow {
  fill: #ffffff;
}

@keyframes m-found-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.m-map.is-honking .map-vehicle .halo {
  animation: m-honk-shake 0.28s ease-in-out 3;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes m-honk-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.m-map.is-flashing .map-vehicle .halo {
  stroke: #ffffff;
  stroke-width: 3;
  animation: m-flash 0.38s ease-out 3;
}

.m-map.is-flashing .map-vehicle .arrow {
  animation: m-flash-arrow 0.38s ease-out 3;
}

@keyframes m-flash {
  0% { opacity: 0.3; }
  35% { opacity: 1; }
  100% { opacity: 0.45; }
}

@keyframes m-flash-arrow {
  0% { fill: #eaf8ff; }
  35% { fill: #ffffff; }
  100% { fill: #eaf8ff; }
}

/* The phone window is too narrow for all nine labels. Keep the five
   that carry the composition — Huanshi East Rd, Huaxia Rd, Pazhou Ave,
   Canton Tower and Pearl River — and drop the rest without forking
   the SVG payload. */
.m-map .map-labels text:nth-child(3),
.m-map .map-labels text:nth-child(5),
.m-map .map-labels text:nth-child(6),
.m-map .map-labels text:nth-child(9) {
  display: none;
}

.m-map-badge {
  position: absolute;
  right: 3.8cqw;
  top: 3.4cqw;
  padding: 1.5cqw 2.4cqw;
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 2cqw;
  background: rgba(5, 12, 20, 0.86);
  font: 500 var(--card-body)/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.m-map-compass {
  left: 3.8cqw;
  top: 3.4cqw;
  width: 7cqw;
  height: 7cqw;
  font-size: 2.9cqw;
}

.m-map-scale {
  left: 3.8cqw;
  bottom: 3.4cqw;
  font-size: 2.9cqw;
}

.m-map-scale::before {
  width: var(--scale-len, 26px);
  height: 4px;
}

/* Find car is a control on the map, not a row in the action bar. Its disc
   matches the compass in the opposite corner exactly — the same 7cqw
   diameter, the same 1px ring, the same fill and colour, and the same
   3.8/3.4cqw insets — so the two corners read as a pair. The 11.6cqw
   transparent hit area keeps the 44px touch target without making this
   control look heavier than the compass. */
.m-map-find {
  position: absolute;
  right: 3.8cqw;
  bottom: 3.4cqw;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 7cqw;
  height: 7cqw;
  padding: 0;
  border: 1px solid rgba(122, 174, 255, 0.16);
  border-radius: 50%;
  background: rgba(5, 10, 16, 0.62);
  color: #38bdf8;
  cursor: pointer;
}

/* The touch target, not the control: invisible, wholly inside the map. */
.m-map-find::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11.6cqw;
  height: 11.6cqw;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.m-map-find svg {
  position: relative;
  z-index: 1;
  width: 4.2cqw;
  height: 4.2cqw;
}

.m-map-find:active {
  background: rgba(56, 189, 248, 0.16);
}

.m-map-find:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.m-address {
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  padding: 3.4cqw 1.4cqw 0;
}

.m-address strong {
  font-size: var(--card-value);
  font-weight: 400;
  color: var(--ink);
}

.m-address span {
  font-size: var(--card-body);
  line-height: 1.4;
  color: var(--text-prose);
}

/* Honk and flash: Find car left this row for the map itself, so the two
   remaining controls share the width they used to split three ways. */
.m-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.4cqw;
  align-items: stretch;
}

.m-action-group {
  display: flex;
  flex-direction: column;
  gap: 2.2cqw;
}

/* Reserved status line for the two remote buttons that report a result.
   Find car answers on the map itself and writes nothing here. */
.m-action-note {
  min-height: 3.4cqw;
  margin: 0;
  font-size: 3.2cqw;
  line-height: 1.1;
  text-align: center;
  color: var(--text-prose);
  opacity: 0;
  transition: opacity 0.18s var(--ease);
}

.m-action-note.is-visible {
  opacity: 1;
}

/* Valet mode: the app's row language, with its own mark. On is expressed the
   way the other controls express on — the mark takes the live cyan — while the
   state line stays in the row's label ink, so the row never shouts louder
   than the page it sits on. */
.m-valet-mark {
  display: grid;
  place-items: center;
  width: 10cqw;
  height: 10cqw;
  flex: none;
  border: 1px solid var(--hair);
  border-radius: 2.6cqw;
  background: rgba(10, 18, 29, 0.62);
  color: var(--ink-dim);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.m-valet-mark svg {
  width: 5.4cqw;
  height: 5.4cqw;
}

.m-valet-entry[data-on="true"] .m-valet-mark {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(56, 189, 248, 0.12);
  color: var(--cyan);
}

/* Strict cell: one fixed icon slot, one label slot, both on the cell's
   vertical centre, so all three controls share an icon centre and a text
   baseline by construction rather than by intrinsic content width. */
.m-action-btn {
  appearance: none;
  display: grid;
  grid-template-columns: 4.8cqw minmax(0, auto);
  align-items: center;
  justify-content: center;
  column-gap: 1.6cqw;
  height: 16cqw;
  min-height: 16cqw;
  padding: 0 1.5cqw;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 3cqw;
  background: rgba(56, 189, 248, 0.06);
  color: var(--ink-dim);
  font-size: 3.6cqw;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.m-action-btn svg {
  display: block;
  width: 4.8cqw;
  height: 4.8cqw;
  align-self: center;
  color: var(--cyan);
}

.m-action-btn span {
  line-height: 1;
  color: var(--text-label);
}

.m-action-btn:active {
  background: rgba(56, 189, 248, 0.12);
}

.m-footnote {
  margin: 0;
  font-size: var(--card-body);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Card title ---------- */

.m-card-title {
  margin: 2.2cqw 0 0;
  font-size: 4.1cqw;
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--ink);
}

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

.m-head h1 + .m-kicker,
.m-identity-card .m-row strong {
  font-variant-numeric: tabular-nums;
}

/* Tyre card: four wheels in a 2×2 grid, in the same card language as the
   desktop and in-car cards — a hairline over each wheel, label above value,
   no per-wheel tile. */
.m-tyre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.4cqw 3cqw;
  margin-top: 2cqw;
}

.m-tyre-cell {
  display: flex;
  flex-direction: column;
  gap: 1.4cqw;
  min-width: 0;
  padding-top: 1.8cqw;
  border-top: 1px solid rgba(122, 174, 255, 0.1);
  white-space: nowrap;
}

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

.m-tyre-cell strong {
  display: flex;
  align-items: baseline;
  gap: 1.2cqw;
  font: 500 var(--card-value)/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--ink);
}

.m-tyre-cell .u {
  font-size: 0.6em;
  font-weight: 500;
  letter-spacing: 0;
}

.m-identity-card {
  display: flex;
  flex-direction: column;
  gap: 2cqw;
}

.m-identity-card .m-row {
  padding-bottom: 1.4cqw;
  border-bottom: 1px solid rgba(122, 174, 255, 0.08);
}

.m-identity-card .m-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.m-identity-card strong {
  font: 500 var(--card-value)/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-value);
}

/* Identifiers keep mono on this surface too: the plate and the build string. */
.m-identity-card strong[data-vehicle-plate],
.m-value b.mono-id {
  font-family: var(--mono);
}

.m-identity-card strong .u {
  font-size: 0.6em;
}

.m-spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2cqw;
}

.m-spec-grid > div {
  display: flex;
  flex-direction: column;
  gap: 1.6cqw;
  min-height: 15.4cqw;
  justify-content: center;
  padding: 1.9cqw 3cqw;
  border: 1px solid rgba(122, 174, 255, 0.11);
  border-radius: 3cqw;
  background: rgba(11, 19, 30, 0.52);
}

.m-spec-grid strong {
  display: flex;
  align-items: baseline;
  gap: 0.8cqw;
  font: 500 var(--card-value)/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

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

.m-setup-card {
  display: flex;
  flex-direction: column;
  gap: 1.8cqw;
}

.m-setup-card .m-row {
  padding-bottom: 1.8cqw;
  border-bottom: 1px solid rgba(122, 174, 255, 0.08);
}

.m-setup-card .m-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.m-value {
  display: inline-flex;
  align-items: baseline;
  gap: 1.6cqw;
  font-size: var(--card-value);
  font-weight: 500;
  color: var(--text-value);
}

.m-value b {
  font: 500 var(--card-value)/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-value);
}

.m-setup-card .u {
  font-size: 0.6em;
}

.m-reading {
  display: inline;
  white-space: nowrap;
}

.m-paint-chip {
  display: inline-block;
  width: 3.4cqw;
  height: 3.4cqw;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  /* Material treatment: components.css (.paint-orb), shared with the
     desktop swatches and the design-system specimen. */
}

/* ---------- Garage and account sheets ---------- */

/* Sheets live inside the phone screen, so opening one never grows the page
   or the phone canvas. The scrim dims the app; the panel is a card. */
.m-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.m-sheet[hidden] {
  display: none;
}

.m-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 9, 0.66);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.m-panel {
  position: relative;
  margin: 0 3.4cqw 7.4cqw;
  padding: 4.4cqw;
  border: 1px solid var(--hair);
  border-radius: 4.6cqw;
  background: linear-gradient(180deg, rgba(15, 26, 40, 0.97), rgba(6, 11, 19, 0.99));
  box-shadow:
    0 10cqw 24cqw -10cqw rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: sheetIn 0.26s var(--ease) both;
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(6cqw); }
  to { opacity: 1; transform: translateY(0); }
}

.m-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3cqw;
}

/* A sheet title, not a hero: one step under the page heading, above the
   sheet's body copy. */
.m-sheet-head h2 {
  margin: 1.2cqw 0 0;
  font-size: 6.4cqw;
  font-weight: 250;
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--text-value);
}

/* A bare icon, not a pill: no disc, no border, no fill. Same touch box and
   glyph as before, so the header height holds and the header keeps its
   top-right corner distance. */
.m-sheet-close {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: 9.6cqw;
  height: 9.6cqw;
  padding: 0;
  border: 0;
  border-radius: 2.4cqw;
  background: none;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease);
}

.m-sheet-close svg {
  width: 4.6cqw;
  height: 4.6cqw;
}

.m-sheet-close:hover,
.m-sheet-close:focus-visible {
  color: var(--cyan);
  outline: none;
}

.m-sheet-close:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.m-vehicle-row {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 3cqw;
  width: 100%;
  margin-top: 2.4cqw;
  padding: 2.6cqw 2.8cqw;
  border: 1px solid rgba(122, 174, 255, 0.12);
  border-radius: 3.2cqw;
  background: rgba(9, 16, 26, 0.55);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.m-vehicle-row.is-current {
  border-color: rgba(56, 189, 248, 0.32);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(9, 16, 26, 0.5));
}

.m-vehicle-row:hover,
.m-vehicle-row:focus-visible {
  border-color: rgba(56, 189, 248, 0.4);
  outline: none;
}

.m-vehicle-badge {
  display: grid;
  place-items: center;
  width: 10cqw;
  height: 10cqw;
  flex: none;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 2.6cqw;
  background: rgba(56, 189, 248, 0.07);
  color: var(--cyan);
  font: 600 2.9cqw/1 var(--mono);
  letter-spacing: 0.08em;
}

.m-vehicle-info {
  display: flex;
  flex-direction: column;
  gap: 1cqw;
  min-width: 0;
}

.m-vehicle-info strong {
  font-size: 4.1cqw;
  font-weight: 400;
  color: var(--text-value);
}

.m-vehicle-info em {
  font-style: normal;
  font-size: 2.9cqw;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-vehicle-state {
  margin-left: auto;
  font: 600 2.9cqw/1 var(--font);
  letter-spacing: 0.08em;
  color: var(--cyan);
  white-space: nowrap;
}

.m-vehicle-row:not(.is-current) .m-vehicle-state {
  color: var(--muted);
}

.m-sheet-note {
  margin: 3cqw 0 0;
  font-size: 3cqw;
  line-height: 1.45;
  color: var(--muted);
}

/* The three restrictions valet mode applies, one short line each. Prose ink
   and a hairline tick keep the same quiet voice as the sheet notes instead of
   introducing a second list style. */
.m-valet-limits {
  display: flex;
  flex-direction: column;
  gap: 1.8cqw;
  margin: 3.2cqw 0 0;
  padding: 0;
  list-style: none;
}

.m-valet-limits[hidden] {
  display: none;
}

.m-valet-limits li {
  position: relative;
  padding-left: 3.4cqw;
  font-size: var(--card-body);
  line-height: 1.3;
  color: var(--text-prose);
}

.m-valet-limits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 1.4cqw;
  height: 1px;
  background: var(--cyan);
}

/* Sentences that explain an immediate effect rather than a limit: the same
   note line, at reading ink so they are not skimmed as another bullet. */
.m-valet-now,
.m-valet-msg {
  color: var(--text-value);
}

.m-valet-msg:empty {
  display: none;
}

/* Ambient reading under the two steppers: the second number the climate
   sheet keeps visible, rendered from the same state as the controls. */
.m-sheet-read {
  display: flex;
  align-items: baseline;
  gap: 1.2cqw;
  margin: 3cqw 0 0;
  font-size: var(--card-body);
  line-height: 1.2;
  color: var(--text-label);
}

.m-sheet-read b {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
}

.m-sheet-read em {
  font-style: normal;
  font-size: 0.9em;
  font-weight: 500;
  color: var(--text-unit);
}

/* The app's one confirmation step: unlocking while the car is moving. Two
   flat buttons under the sentence, cancel first so the safe choice leads. */
.m-confirm-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2cqw;
  margin-top: 3.4cqw;
}

.m-confirm-btn {
  appearance: none;
  min-height: 11.2cqw;
  padding: 1.4cqw 0;
  border: 1px solid var(--hair);
  border-radius: 2.6cqw;
  background: rgba(9, 16, 26, 0.55);
  color: var(--text-value);
  font: 500 var(--card-body)/1 var(--font);
  cursor: pointer;
}

.m-confirm-btn--go {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.12);
}

.m-confirm-btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* AC mode: three positions in one row. On, Off and Auto are separate states,
   so the selected segment is the mode, not a prettier toggle. */
.m-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2cqw;
  margin-top: 3.4cqw;
  padding: 1.2cqw;
  border: 1px solid var(--hair);
  border-radius: 3.2cqw;
  background: rgba(8, 14, 24, 0.55);
}

.m-mode {
  appearance: none;
  min-height: 9.6cqw;
  padding: 1cqw 0;
  border: 0;
  border-radius: 2.4cqw;
  background: none;
  color: var(--text-label);
  font: 500 var(--card-body)/1 var(--font);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.m-mode.is-current {
  background: rgba(56, 189, 248, 0.14);
  color: var(--text-value);
}

.m-mode:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Both climate sheets are built the same way: one centred readout with air
   above it, then the − / slider / + row. The gap is the same in both, so the
   readout and the track keep the same vertical relationship whichever sheet
   is open. */
.m-climate-control {
  min-width: 0;
  margin-top: 7cqw;
}

/* AC off: the setpoint is still stored but nothing is running, so the stepper
   is disabled by the script and dimmed here. No control looks live. */
.m-climate-control.is-off .m-stepper {
  opacity: 0.4;
}

.m-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2cqw;
  margin-top: 2cqw;
}

.m-step {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: 9.6cqw;
  height: 9.6cqw;
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 50%;
  background: rgba(9, 16, 26, 0.55);
  color: var(--ink-dim);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease),
    color 0.2s var(--ease), opacity 0.2s var(--ease);
}

.m-step svg {
  width: 4.2cqw;
  height: 4.2cqw;
}

.m-step:active {
  background: rgba(56, 189, 248, 0.16);
}

.m-step:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.m-step:disabled {
  opacity: 0.4;
  cursor: default;
}

/* The readout is the panel's one figure: centred over the track, with no
   label beside it. Both sheets use this same block, so the temperature and
   the fan level sit in the same place. */
.m-climate-value {
  display: block;
  text-align: center;
  font: 300 var(--card-primary)/1 var(--font);
  font-variant-numeric: tabular-nums;
  color: var(--text-value);
  white-space: nowrap;
}

.m-climate-value b {
  font-weight: 300;
}

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

/* A real range input, not a drawn rail: dragging it changes the same state the
   − / + buttons and the tiles read. Same row height as the buttons, so the
   sheet keeps its size. The filled part follows --fill, written on render. */
.m-slider {
  flex: 1 1 auto;
  min-width: 0;
  height: 9.6cqw;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  cursor: pointer;
}

.m-slider::-webkit-slider-runnable-track {
  height: 0.6cqw;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--cyan) 0 var(--fill, 0%),
    rgba(111, 130, 152, 0.32) var(--fill, 0%) 100%
  );
}

.m-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 4.6cqw;
  height: 4.6cqw;
  margin-top: -2cqw;
  border: 0;
  border-radius: 50%;
  background: var(--text-value);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.55);
}

.m-slider::-moz-range-track {
  height: 0.6cqw;
  border-radius: 999px;
  background: rgba(111, 130, 152, 0.32);
}

.m-slider::-moz-range-progress {
  height: 0.6cqw;
  border-radius: 999px;
  background: var(--cyan);
}

.m-slider::-moz-range-thumb {
  width: 4.6cqw;
  height: 4.6cqw;
  border: 0;
  border-radius: 50%;
  background: var(--text-value);
}

.m-slider:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 999px;
}

/* ---------- Review rail ---------- */

.screen-rail {
  max-width: 360px;
}

.rail-kicker {
  margin: 0 0 12px;
  font: 600 9.5px/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.screen-rail h1 {
  margin: 0 0 14px;
  font-size: 34px;
  font-weight: 250;
  line-height: 1.08;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.rail-copy {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

.screen-index {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screen-item {
  appearance: none;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 11px 13px;
  border: 1px solid rgba(122, 174, 255, 0.12);
  border-radius: 10px;
  background: rgba(9, 16, 26, 0.5);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.22s var(--ease), background 0.22s var(--ease);
}

.screen-item .idx {
  font: 600 9px/1 var(--font);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.screen-item .item-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.screen-item strong {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-dim);
}

.screen-item em {
  font-style: normal;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

.screen-item .arrow {
  font-size: 12px;
  color: var(--muted);
  transition: color 0.22s var(--ease);
}

.screen-item:hover,
.screen-item:focus-visible {
  border-color: rgba(56, 189, 248, 0.34);
  background: rgba(56, 189, 248, 0.05);
  outline: none;
}

.screen-item.is-active {
  border-color: rgba(56, 189, 248, 0.42);
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.09), rgba(10, 18, 29, 0.5));
  box-shadow: inset 2px 0 0 rgba(56, 189, 248, 0.56);
}

.screen-item.is-active strong,
.screen-item.is-active .idx,
.screen-item.is-active .arrow {
  color: var(--cyan);
}

.rail-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}

.rail-specs dt {
  font: 600 8.5px/1 var(--font);
  letter-spacing: 0.02em;
  color: var(--muted);
}

.rail-specs dd {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

/* ---------- Narrow ---------- */

@media (max-width: 1000px) {
  .mobile-stage {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 36px;
    padding: 24px 18px 28px;
  }

  .phone {
    --pw: min(390px, calc((100svh - 228px) * 0.4621));
  }

  .screen-rail {
    width: 100%;
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  .mobile-stage {
    padding: 12px 12px 8px;
    gap: 0;
  }

  .screen-rail {
    display: none;
  }

  .phone {
    --pw: min(348px, calc((100svh - 186px) * 0.4621));
  }
}

@media (prefers-reduced-motion: reduce) {
  .m-view,
  .m-panel {
    animation: none;
  }
}
