/* =============================================================
   Mighty Drive — styles.css
   Car-first: designed for a wide landscape touchscreen, then
   adapted down to desktop and mobile.
   ============================================================= */

/* ---------- Design tokens ----------
   One place for the visual system. Everything below composes from these.

   The palette is deliberately cold: near-black charcoal ground, a frost
   accent around hue 200 (icy, silver-blue — not cyan, not neon), and
   borders tinted with that same frost rather than plain white, which is
   what makes surfaces read as iced glass instead of grey plastic.
   ---------------------------------------------------------------- */
:root {
  /* Ground */
  --bg:          #06090F;
  --bg-2:        #0A0E16;

  /* Surfaces, low to high elevation */
  --surface:     rgba(173, 220, 242, 0.035);
  --surface-2:   rgba(173, 220, 242, 0.055);
  --surface-hi:  rgba(173, 220, 242, 0.090);
  /* A faint frost veil for the cards that should read as iced glass. */
  --veil:        linear-gradient(162deg, rgba(173, 220, 242, 0.052) 0%, rgba(173, 220, 242, 0.012) 62%);
  /* Inner top highlight — one line of light along a card's top edge. */
  --edge:        inset 0 1px 0 rgba(214, 238, 250, 0.055);

  /* Borders */
  --line:        rgba(173, 220, 242, 0.11);
  --line-hi:     rgba(173, 220, 242, 0.20);
  --line-frost:  rgba(124, 190, 224, 0.38);

  /* Text — three clear tiers, all readable from the driver's seat */
  --text:        #F1F6FA;
  --text-2:      #BAC8D6;
  --text-3:      #8A9AAB;

  /* Frost accent */
  --accent:      #79BEE0;
  --accent-rgb:  121 190 224;
  --accent-2:    #ADDCF2;
  --accent-ink:  #04121B;
  --accent-soft: rgba(121, 190, 224, 0.15);
  --accent-glow: rgba(121, 190, 224, 0.34);

  /* Ambient background glows — deliberately faint. */
  --glow-1:      rgba(121, 190, 224, 0.17);
  --glow-2:      rgba(173, 220, 242, 0.075);

  --danger:      #FF9B9B;

  /* Radius scale */
  --r-xs: 10px;
  --r-sm: 13px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  /* Spacing scale */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 20px;
  --s-5: 28px;

  /* Layout rhythm (density-aware) */
  --gap:      20px;
  --pad:      28px;
  --tile-h:   116px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Accent palette ----------
   Nine curated accents. The charcoal ground never changes — only the
   accent ramp does, so the app keeps one identity in every colour.

   Each accent defines the same eight tokens and nothing else:
     --accent       the colour itself, at a luminance that stays legible
                      on near-black. Brand-true hues are lifted where they
                      would otherwise go muddy (Red, Violet).
     --accent-2     a lighter tint for headings and focus rings.
     --accent-ink   near-black, for text ON a filled accent surface.
     --accent-soft  a low-alpha wash for selected states.
     --accent-glow  the shadow/halo colour.
     --line-frost   the accent-tinted border on forward cards.
     --glow-1/2     the two ambient background glows.

   Warm accents (Red, Orange, Gold, Pink) get slightly lower glow alpha:
   warm light reads brighter than cool at the same value, and the point
   is restraint. No hex picker — a curated set is what keeps every
   combination looking deliberate.

   `graphite` is the pre-V1.12 key for what is now Silver; it is kept as
   an alias so saved settings survive. */
[data-theme="silver"],
[data-theme="graphite"] {
  --accent:      #AFC0D0;
  --accent-rgb:  175 192 208;
  --accent-2:    #DCE7F1;
  --accent-soft: rgba(175, 192, 208, 0.13);
  --accent-glow: rgba(175, 192, 208, 0.24);
  --accent-ink:  #0A0E14;
  --line-frost:  rgba(175, 192, 208, 0.32);
  --glow-1:      rgba(175, 192, 208, 0.12);
  --glow-2:      rgba(220, 231, 241, 0.055);
}
[data-theme="violet"] {
  --accent:      #A48CE8;
  --accent-rgb:  164 140 232;
  --accent-2:    #CFC0F5;
  --accent-soft: rgba(164, 140, 232, 0.15);
  --accent-glow: rgba(164, 140, 232, 0.32);
  --accent-ink:  #0D0820;
  --line-frost:  rgba(164, 140, 232, 0.38);
  --glow-1:      rgba(164, 140, 232, 0.16);
  --glow-2:      rgba(207, 192, 245, 0.075);
}
[data-theme="emerald"] {
  --accent:      #46C79A;
  --accent-rgb:  70 199 154;
  --accent-2:    #A6E9CF;
  --accent-soft: rgba(70, 199, 154, 0.14);
  --accent-glow: rgba(70, 199, 154, 0.30);
  --accent-ink:  #04150F;
  --line-frost:  rgba(70, 199, 154, 0.36);
  --glow-1:      rgba(70, 199, 154, 0.15);
  --glow-2:      rgba(166, 233, 207, 0.070);
}
[data-theme="green"] {
  --accent:      #8CD45F;
  --accent-rgb:  140 212 95;
  --accent-2:    #C9EDAC;
  --accent-soft: rgba(140, 212, 95, 0.14);
  --accent-glow: rgba(140, 212, 95, 0.28);
  --accent-ink:  #0B1605;
  --line-frost:  rgba(140, 212, 95, 0.34);
  --glow-1:      rgba(140, 212, 95, 0.14);
  --glow-2:      rgba(201, 237, 172, 0.065);
}
[data-theme="red"] {
  --accent:      #F0757A;
  --accent-rgb:  240 117 122;
  --accent-2:    #FBB6B9;
  --accent-soft: rgba(240, 117, 122, 0.14);
  --accent-glow: rgba(240, 117, 122, 0.28);
  --accent-ink:  #1A0507;
  --line-frost:  rgba(240, 117, 122, 0.34);
  --glow-1:      rgba(240, 117, 122, 0.13);
  --glow-2:      rgba(251, 182, 185, 0.060);
}
[data-theme="orange"] {
  --accent:      #F2A15C;
  --accent-rgb:  242 161 92;
  --accent-2:    #FBD0A6;
  --accent-soft: rgba(242, 161, 92, 0.14);
  --accent-glow: rgba(242, 161, 92, 0.28);
  --accent-ink:  #170C03;
  --line-frost:  rgba(242, 161, 92, 0.34);
  --glow-1:      rgba(242, 161, 92, 0.13);
  --glow-2:      rgba(251, 208, 166, 0.060);
}
[data-theme="pink"] {
  --accent:      #F08BC0;
  --accent-rgb:  240 139 192;
  --accent-2:    #FBC2DE;
  --accent-soft: rgba(240, 139, 192, 0.14);
  --accent-glow: rgba(240, 139, 192, 0.28);
  --accent-ink:  #190614;
  --line-frost:  rgba(240, 139, 192, 0.34);
  --glow-1:      rgba(240, 139, 192, 0.13);
  --glow-2:      rgba(251, 194, 222, 0.060);
}
[data-theme="gold"] {
  --accent:      #E3BC6A;
  --accent-rgb:  227 188 106;
  --accent-2:    #F5DEAC;
  --accent-soft: rgba(227, 188, 106, 0.14);
  --accent-glow: rgba(227, 188, 106, 0.26);
  --accent-ink:  #150F02;
  --line-frost:  rgba(227, 188, 106, 0.32);
  --glow-1:      rgba(227, 188, 106, 0.12);
  --glow-2:      rgba(245, 222, 172, 0.058);
}

[data-density="compact"] {
  --gap:     14px;
  --pad:     20px;
  --tile-h:  94px;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }

/* Must win over any display rule below. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(88% 66% at 100% 0%, rgba(173, 220, 242, 0.032) 0%, transparent 56%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 64%);
}

/* ---------- Ambient background ----------
   Two very soft frost-blue glows drifting behind everything. CSS only:
   no canvas, no WebGL, no JS loop. Each layer animates `transform`
   alone, so it stays on the compositor and never repaints content —
   which is what keeps the car browser smooth. One full cycle is ~54s
   and ~72s, slow enough to register subconsciously.
   Turn it off with data-motion="off" (Customize) and the glow stays,
   simply stationary. Same for prefers-reduced-motion. */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.bg__a,
.bg__b {
  position: absolute;
  display: block;
  border-radius: 50%;
  will-change: transform;
}
.bg__a {
  width: 78vmax;
  height: 78vmax;
  left: -24vmax;
  top: -28vmax;
  background: radial-gradient(circle closest-side, var(--glow-1), transparent 72%);
  animation: drift-a 54s ease-in-out infinite alternate;
}
.bg__b {
  width: 64vmax;
  height: 64vmax;
  right: -22vmax;
  bottom: -26vmax;
  background: radial-gradient(circle closest-side, var(--glow-2), transparent 74%);
  animation: drift-b 72s ease-in-out infinite alternate;
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(7vmax, 4vmax, 0); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-6vmax, -5vmax, 0); }
}
[data-motion="off"] .bg__a,
[data-motion="off"] .bg__b {
  animation: none;
  will-change: auto;
}

h1, h2, h3, p { margin: 0; }

a { color: inherit; text-decoration: none; }

button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 8px;
}

.ico {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico--fill { fill: currentColor; }

/* ---------- Layout ---------- */
.app {
  min-height: 100%;
  display: flex;
}

.main {
  flex: 1;
  min-width: 0;
  padding: var(--pad);
  padding-bottom: calc(var(--pad) + 88px);
}

/* ---------- Left rail (car / desktop) ---------- */
.rail {
  display: none;
  width: 132px;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 12px 18px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
  position: sticky;
  top: 0;
  height: 100vh;
  /* Six nav items fit a car screen, but scroll rather than clip if not. */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { width: 0; height: 0; }

.rail__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
/* The real canonical Mighty Drive app icon — never recoloured by the
   accent. The accent shows up only as a restrained halo around the
   container, same idea as every other "is-mighty" mark in the app. */
.rail__mark {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 13px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 0 0 1px var(--line-frost), 0 8px 20px -8px var(--accent-glow);
}
.rail__mark-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rail__brandtext {
  display: block;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.14em;
  font-size: 10px;
}
.rail__brandtext b { display: block; color: var(--text-2); font-weight: 700; }
.rail__brandtext i { display: block; font-style: normal; font-weight: 700; color: var(--text); }

.rail__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.navbtn {
  /* 70px: seven nav items plus the ecosystem footer have to clear a 900px
     viewport without the rail scrolling. Still a very large target. */
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.navbtn:active { background: var(--surface-2); }
.navbtn.is-active {
  color: var(--text);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.17), rgb(var(--accent-rgb) / 0.055));
  box-shadow:
    inset 0 0 0 1px var(--line-frost),
    0 10px 26px -20px var(--accent-glow);
}
.navbtn.is-active .ico { color: var(--accent-2); }

/* ---------- Shared Mighty ecosystem footer ----------
   The quiet utility area at the bottom of the rail. Deliberately generic
   class names: the same block is meant to drop into the other Mighty
   apps unchanged, with each app keeping its own palette. */
.mightyfoot {
  margin-top: auto;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  /* The divider fades at the edges rather than cutting straight across. */
  border-image: linear-gradient(90deg, transparent, var(--line-hi) 22%, var(--line-hi) 78%, transparent) 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}
.mightyfoot__link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 6px;
  border-radius: 11px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.mightyfoot__link:active { background: var(--surface-2); color: var(--text-2); }
.mightyfoot__link.is-active { color: var(--text-2); background: var(--surface-2); }
.mightyfoot__safety {
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--text-3);
  text-align: center;
  opacity: 0.85;
}
.mightyfoot__sig {
  margin-top: 8px;
  line-height: 1.6;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: center;
  opacity: 0.55;
}

/* Below 900px the fixed tab bar overlays the last ~80px of the viewport.
   Without this, the browser's own scroll-into-view (Tab-key focus, an
   in-page anchor jump) can land a mid-page control — Reset appearance,
   say — directly behind the bar instead of above it. Reserves that
   clearance for any native scroll, not just this one button. */
@media (max-width: 899px) {
  html { scroll-padding-bottom: 96px; }
}

/* ---------- Bottom tab bar (narrow) ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  gap: 2px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 10, 16, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
}
.tab .ico { width: 22px; height: 22px; }
.tab.is-active { color: var(--text); background: var(--accent-soft); }
.tab.is-active .ico { color: var(--accent-2); }

/* ---------- Views ---------- */
.view { animation: rise 0.26s var(--ease); }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.viewhead { margin-bottom: 22px; }
.viewhead h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.viewhead p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 15px;
  max-width: 62ch;
}

/* ---------- Home glance ---------- */
/* The hero: the one place typography is allowed to be loud. A hairline
   separates it from the sections instead of a heavier divider. */
.glance {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
}
.glance__greet {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}
.glance__greet::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.85;
}
.glance__ask {
  margin-top: 10px;
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.03;
  color: var(--text);
}
.glance__right { text-align: right; }
.glance__time {
  font-size: clamp(30px, 3.4vw, 44px);
  font-weight: 300;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.glance__date {
  margin-top: 7px;
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- Panels ---------- */
.panel {
  position: relative;
  background: var(--surface);
  background-image: var(--veil);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--edge);
  padding: var(--pad);
  margin-bottom: var(--gap);
}
.panel--quiet {
  background: transparent;
  background-image: none;
  border-color: transparent;
  box-shadow: none;
  padding: 4px 2px 0;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.panel__title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 16px;
}
.panel__head .panel__title { margin-bottom: 0; }
.panel__title--sm { font-size: 11.5px; }
.panel__note--tight { margin-bottom: 12px; font-size: 13.5px; }
.panel__note {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 14px;
  max-width: 70ch;
}
/* Section eyebrows on the Links and Ecosystem pages share the panel title
   scale so headings line up across the app. */
.linkgroup__title,
.ecofamily__title { font-size: 12.5px; letter-spacing: 0.14em; opacity: 1; }

.note {
  margin-top: 18px;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

/* ---------- Home grid ----------
   Quick launch and Charge Mode share the top row: one column on a
   phone, side by side from a tablet up. */
.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
  align-items: start;
}
.home-grid > .panel { margin-bottom: 0; }

/* ---------- Quick launch ----------
   Category membership is curated and fixed (data.js), so the grid holds
   anywhere from two destinations (Shopping) to nine (Mighty). auto-fill
   — not auto-fit — is what makes that work: empty tracks are left alone
   instead of being stretched to fill the row, so a short category reads
   as intentional negative space rather than an awkwardly blown-up tile. */
.tilegrid.tilegrid--launch { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }
.tilegrid--launch .tile { min-height: calc(var(--tile-h) + 6px); }

/* Category pills. Large, instant, no page change — selecting one just
   re-renders the grid above. */
.qlcats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.qlcat {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.qlcat:active { background: var(--surface-hi); }
.qlcat.is-on {
  border-color: var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.22), rgb(var(--accent-rgb) / 0.08));
  box-shadow: inset 0 0 0 1px var(--line-frost);
  color: var(--text);
}

/* A quick, quiet re-entry when the category switches — never a slide,
   never anything long enough to feel like a page change. */
.tilegrid--launch.is-fresh { animation: ql-fade 0.2s var(--ease); }
@keyframes ql-fade {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}

/* Phones: let the row scroll rather than wrap into three cramped lines,
   and hide the scrollbar so it does not sit under every thumb pass. */
@media (max-width: 699px) {
  .qlcats {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 calc(var(--pad) * -1) 16px;
    padding: 0 var(--pad);
  }
  .qlcats::-webkit-scrollbar { display: none; }
  .tilegrid.tilegrid--launch { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---------- Charge Mode ----------
   The one card allowed to sit slightly forward: a frost border, a soft
   ambient shadow and an accent heading. No animation, no size increase. */
.panel--charge {
  border-color: var(--line-frost);
  background-image: linear-gradient(162deg, rgb(var(--accent-rgb) / 0.085) 0%, rgb(var(--accent-rgb) / 0.015) 60%);
  box-shadow: var(--edge), 0 22px 50px -34px var(--accent-glow);
}
.panel--charge .panel__title { color: var(--accent-2); }

/* ---------- Tiles ---------- */
.tilegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 14px;
}
.tilegrid--lg { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

.tile {
  position: relative;
  min-height: var(--tile-h);
  display: flex;
  flex-direction: column;
  /* Top-aligned, not centred: a two-line description on one tile must not
     push its neighbours' titles out of line across a row. */
  justify-content: flex-start;
  gap: var(--s-2);
  padding: 16px 46px 16px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--edge);
  cursor: pointer;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.tile:active {
  transform: scale(0.985);
  border-color: var(--line-hi);
  background: var(--surface-hi);
}
/* The whole tile is the hit target; the pin sits above it. */
.tile__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.tile__body { position: relative; z-index: 0; }
.tile__mark {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  overflow: hidden;
  /* Third-party services: a solid tinted chip. */
  background: var(--tint, var(--accent));
  color: #0A0E16;
}

/* ---------- Mighty product marks ----------
   Deliberately a different family from third-party services: a glassy
   tinted chip with a ring, rather than a solid block. When the icon set
   in assets/mighty-icons/ is installed the artwork sits inside it. */
.tile__mark.is-mighty,
.favrow__mark.is-mighty {
  background: color-mix(in srgb, var(--tint) 17%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tint) 48%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: var(--tint);
}
/* Fallback for engines without color-mix: still distinct, still on-brand. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .tile__mark.is-mighty,
  .favrow__mark.is-mighty {
    background: var(--surface-hi);
    box-shadow: inset 0 0 0 1px var(--line-hi);
    color: var(--tint);
  }
}
/* Whatever the chain resolves to, the container is the same size — that
   is what keeps a logo tile and an initials tile looking related.
   Real logos sit on a neutral plate instead of the brand-tinted chip:
   a coloured mark on a coloured chip is unreadable, and it also stops
   40 different brand colours from fighting each other across a grid. */
.tile__mark.has-logo,
.favrow__mark.has-logo,
.chip__mark.has-logo,
.tile__mark.has-word,
.favrow__mark.has-word,
.chip__mark.has-word {
  background: rgba(226, 240, 250, 0.075);
  box-shadow: inset 0 0 0 1px var(--line), var(--edge);
}

/* Name plate: the brand's name set in the app's own type, for the
   destinations with no authentic mark available. Reads far better at a
   glance than two initials, and is plainly type rather than a logo. */
.tile__mark.has-word,
.favrow__mark.has-word,
.chip__mark.has-word { color: var(--tint, var(--accent)); }
.mark__word {
  display: block;
  padding: 0 2px;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-align: center;
  /* Break only where data.js puts a newline — never mid-word, which
     turns "Peacock" into "Peaco / ck". */
  white-space: pre-line;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}
.tilegrid--links .tile__mark .mark__word { font-size: 7px; padding: 0 1px; }
.favrow__mark .mark__word { font-size: 7.5px; }
.chip__mark .mark__word { font-size: 5.5px; letter-spacing: -0.03em; }
/* App-icon artwork: fills the chip, clipped to its radius, with a hairline
   so a white icon still has an edge against the dark tile. */
.tile__mark.has-tile,
.favrow__mark.has-tile,
.chip__mark.has-tile {
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.10);
}
.mark__img {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* never stretch or crop a logo */
  object-position: center;
  display: block;
  padding: 6px;
}
.has-tile .mark__img { padding: 0; }
.mark__glyph {
  width: 74%;
  height: 74%;
  stroke-width: 1.6;
  color: var(--tint, var(--accent));
}
/* Third-party marks sit on their solid chip, so the glyph inks dark. */
.tile__mark:not(.is-mighty) .mark__glyph,
.favrow__mark:not(.is-mighty) .mark__glyph { color: #0A0E16; }
.tile__mark.is-mighty .mark__img,
.favrow__mark.is-mighty .mark__img { padding: 5px; }
/* Recent chips carry the same mark, just small. */
.chip__mark {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
  background: var(--tint, var(--accent));
  color: #0A0E16;
}
.chip__mark.is-mighty {
  background: color-mix(in srgb, var(--tint) 18%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint) 46%, transparent);
  color: var(--tint);
}
.chip__mark .mark__img { padding: 3px; }
.chip__mark .mark__glyph { width: 78%; height: 78%; stroke-width: 1.8; }
.tile__name {
  font-size: 16.5px;
  font-weight: 620;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.tile__desc {
  margin-top: 4px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}
.tile__note {
  margin-top: 7px;
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.tile__tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
}

.pin {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--text-3);
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}
.pin:active { background: var(--surface-hi); }
.pin.is-on {
  color: var(--accent-2);
  filter: drop-shadow(0 0 8px var(--accent-glow));
}
.pin .ico { width: 20px; height: 20px; }

/* ---------- Link groups ----------
   Light sections rather than boxed panels: less chrome, less height,
   and the page reads as "what do you want to do?" rather than a list. */
.linkgroup { margin-bottom: calc(var(--gap) + 6px); }
.linkgroup:last-child { margin-bottom: 0; }
.linkgroup__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-left: 2px;
}
.linkgroup__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent-2);
  opacity: 0.9;
}
.linkgroup__note {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
}

/* Links tiles are launchers, not cards: a denser horizontal row so the
   whole hub fits a car screen with little scrolling. */
.tilegrid--links {
  grid-template-columns: repeat(auto-fill, minmax(172px, 250px));
  justify-content: start;
}
.tilegrid--links .tile {
  min-height: 78px;
  justify-content: center;
  padding: 12px 44px 12px 14px;
}
.tilegrid--links .tile__body {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tilegrid--links .tile__mark { width: 34px; height: 34px; border-radius: 10px; font-size: 12px; }
.tilegrid--links .tile__name { font-size: 15px; }
.tilegrid--links .tile__desc { font-size: 11.5px; }
.tilegrid--links .tile__note { margin-top: 5px; }
.tilegrid--links .pin { top: 4px; right: 2px; }

/* ---------- Prose pages (About) ---------- */
.prose { max-width: 760px; }
.prose__lead {
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.pointlist {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pointlist li {
  position: relative;
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.pointlist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  opacity: 0.8;
}
.prose__fine {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
}
.prose__sig {
  margin-top: 16px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0.55;
}

/* ---------- Ecosystem page ----------
   Roster with roles, not a launcher: compact rows, no pins, no big tiles. */
.ecofamily { margin-bottom: calc(var(--gap) + 4px); }
.ecofamily__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-left: 2px;
}
.ecofamily__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent-2);
  opacity: 0.9;
}
.ecofamily__note { color: var(--text-3); font-size: 13px; font-weight: 500; }
.ecogrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.ecorow {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--edge);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
a.ecorow:active { border-color: var(--line-hi); background: var(--surface-hi); }
.ecorow--self {
  /* The only row in its group, so it takes the full row rather than
     wrapping the name under a cramped single grid track. */
  grid-column: 1 / -1;
  border-style: dashed;
  border-color: var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.15), rgb(var(--accent-rgb) / 0.05));
}
.ecorow__text { min-width: 0; }
.ecorow__name { font-size: 15px; font-weight: 620; letter-spacing: -0.01em; }
.ecorow__role { margin-top: 3px; color: var(--text-3); font-size: 12.5px; font-weight: 500; line-height: 1.35; }
.ecorow__here {
  margin-left: auto;
  padding-left: 12px;
  white-space: nowrap;
  flex: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  opacity: 0.85;
}
/* ---------- Follow the Ecosystem / Meet the Creator ----------
   One quiet action row below the ecosystem map: two equal, restrained
   outline pills (never the app's filled/primary .btn treatment) plus a
   single muted info line underneath. Deliberately the least prominent
   control on the page — a footnote to the ecosystem groups above it,
   not a second set of competing CTAs. */
.ecoactions {
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 460px;
  margin: calc(var(--gap) - 2px) auto 0;
  padding-top: calc(var(--gap) - 4px);
  border-top: 1px solid var(--line);
}
.ecoaction {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), background 0.16s var(--ease);
}
.ecoaction:active {
  background: rgb(var(--accent-rgb) / 0.10);
  border-color: rgb(var(--accent-rgb) / 0.4);
  color: var(--accent-2);
}
.ecoaction__arrow { width: 13px; height: 13px; flex: none; opacity: 0.75; }
.ecoline {
  max-width: 460px;
  margin: 10px auto 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-2);
  opacity: 0.82;
}
@media (max-width: 699px) {
  .ecoactions { flex-direction: column; max-width: none; }
  .ecoaction { width: 100%; }
  .ecoline { max-width: none; }
}

/* ---------- Empty state ---------- */
.empty {
  border: 1px dashed var(--line-hi);
  border-radius: var(--r-md);
  padding: 22px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}
.empty b { color: var(--text-2); font-weight: 600; }

/* ---------- Chips ---------- */
.chiprow { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 46px;
  box-shadow: var(--edge);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.chip:active { border-color: var(--line-hi); color: var(--text); }
.chip__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.chip--sym { font-variant-numeric: tabular-nums; letter-spacing: 0.03em; font-weight: 650; }
.chiprow--edit .chip { min-height: 52px; padding-right: 5px; }
.chip__x {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 50%;
  color: var(--text-3);
  cursor: pointer;
}
.chip__x .ico { width: 16px; height: 16px; }

/* ---------- Durations ---------- */
.durations {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: var(--gap);
}
.duration {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-1);
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--edge);
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease),
              background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.duration:active { transform: scale(0.985); border-color: var(--line-hi); }
.duration.is-on {
  border-color: var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.22), rgb(var(--accent-rgb) / 0.075));
  box-shadow: var(--edge), 0 14px 30px -22px var(--accent-glow);
  color: var(--text);
}
.duration b {
  font-size: clamp(21px, 2.2vw, 27px);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}
.duration span { color: var(--text-3); font-size: 13px; font-weight: 500; }
.duration.is-on span { color: var(--accent-2); font-weight: 600; }

/* Compact variant used on Home */
.durations--home {
  margin-bottom: 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.durations--home .duration { min-height: 96px; padding: 16px; }
.durations--home .duration b { font-size: clamp(19px, 1.8vw, 23px); }

/* ---------- Customize ---------- */
.cust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  align-items: start;
}
.cust-grid > .panel { margin-bottom: 0; }

.favlist { display: flex; flex-direction: column; gap: 10px; }
.favrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.favrow__mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px; font-weight: 700;
  background: var(--tint, var(--accent));
  color: #0A0E16;
}
.favrow__name { flex: 1; min-width: 0; font-size: 15px; font-weight: 560; }
.favrow__acts { display: flex; gap: 4px; }

.iconbtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.iconbtn:active { background: var(--surface-hi); }
.iconbtn[disabled] { opacity: 0.3; cursor: default; }
.iconbtn--danger { color: var(--danger); }
.iconbtn--sm { width: 44px; height: 44px; border-color: transparent; color: var(--text-3); }
.iconbtn--sm .ico { width: 19px; height: 19px; }

.optlist { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
}
.opt:last-child { border-bottom: 0; }
.opt__label { font-size: 15px; font-weight: 550; }

.switch {
  width: 76px;
  height: 44px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line-hi);
  background: var(--surface-2);
  position: relative;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--text-3);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.switch[aria-checked="true"] {
  background: var(--accent-soft);
  border-color: var(--line-frost);
}
.switch[aria-checked="true"]::after {
  transform: translateX(32px);
  background: var(--accent-2);
}

.segment {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.segment button {
  /* 44px, not 40: this is the minimum comfortable touch target, and these
     are the controls someone taps with a thumb from the driver's seat. */
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  color: var(--text-3);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.segment button.is-on {
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.20), rgb(var(--accent-rgb) / 0.07));
  box-shadow: inset 0 0 0 1px var(--line-frost);
  color: var(--text);
}

.addrow { display: flex; gap: 10px; margin-bottom: 14px; }
.input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-hi);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.input::placeholder { color: var(--text-3); letter-spacing: 0; text-transform: none; font-weight: 500; }

.btn {
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.20), rgb(var(--accent-rgb) / 0.07));
  box-shadow: var(--edge);
  color: var(--text);
  font-size: 15px;
  font-weight: 620;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.btn:active { background: var(--surface-hi); border-color: var(--line-hi); }
.btn--danger {
  color: var(--danger);
  background: transparent;
  box-shadow: none;
  border-color: var(--line-hi);
}

.ghostbtn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.ghostbtn:active { background: var(--surface-hi); }

.aboutrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.attrib {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--text-3);
  font-weight: 600;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 80;
  transform: translate(-50%, 14px);
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-hi);
  background: rgba(12, 17, 25, 0.96);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =============================================================
   Breakpoints — wide car display is the primary target
   ============================================================= */

/* Narrow: stack the glance, keep it left-aligned */
@media (max-width: 699px) {
  .glance { flex-direction: column; align-items: stretch; gap: 12px; }
  .glance__right { text-align: left; }
}

/* Tablet-ish and up */
@media (min-width: 700px) {
  /* Home's side-by-side split needs real room to avoid squeezing Charge
     Mode's four duration buttons into a sliver column — that room isn't
     reliably there yet at this width (a half-screen/split-screen window
     often lands right here), so Quick launch and Charge Mode stay
     stacked full-width until the 1100px breakpoint below, which is
     where the two-column split actually turns on. Charge Mode's
     duration grid still goes 2-up here, now at full panel width instead
     of a cramped one, which is what keeps it a clean 2x2 instead of a
     compressed row. */
  .panel--charge .durations--home { grid-template-columns: repeat(2, 1fr); }
  .cust-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Car display / desktop: left rail replaces the tab bar */
@media (min-width: 900px) {
  .rail { display: flex; }
  .tabbar { display: none; }
  .main { padding-bottom: var(--pad); }
  .toast { bottom: 34px; }
}

/* Tesla-class wide landscape: more air, bigger targets, less scrolling.
   There is no second rail claiming space here any more, so the main
   column is free to breathe a little wider than it used to. */
@media (min-width: 1100px) {
  :root { --pad: 34px; --gap: 22px; }
  .rail { width: 148px; }
  .main { max-width: 1760px; margin: 0 auto; }
  /* Roughly 66 / 34. Quick launch is what you came for; Charge Mode is a
     four-button question that does not need half the screen to ask it.
     The old 51/49 split gave equal weight to unequal jobs and left both
     halves looking cramped. */
  .home-grid { grid-template-columns: minmax(0, 1.95fr) minmax(0, 1fr); }
  /* With the extra width, category rows read better with fuller-width
     tiles — still auto-fill, so a short category (Food, Shopping) still
     leaves honest negative space instead of stretching to fill the row. */
  .tilegrid.tilegrid--launch { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .tilegrid--launch .tile { min-height: calc(var(--tile-h) - 8px); }
  .cust-grid { grid-template-columns: repeat(2, 1fr); }
  .tilegrid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .tilegrid--lg { grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); }
}

@media (min-width: 1500px) {
  .cust-grid { grid-template-columns: repeat(3, 1fr); }
  .cust-grid > .panel--wide { grid-column: span 2; }
}


/* Short landscape (typical car screen): keep the fold useful.
   Quick launch and Charge Mode should both clear the fold. */
@media (min-width: 900px) and (max-height: 820px) {
  :root { --tile-h: 102px; --gap: 16px; --pad: 26px; }
  /* SEVEN nav items plus the footer on a short car screen — Quote made it
     seven, and at the old 64px the rail started scrolling at 750px tall,
     which is a typical Tesla viewport. Everything gives a few pixels; the
     targets stay far above the 44px floor. */
  .rail { padding: 14px 10px 10px; gap: 6px; }
  .rail__brand { margin-bottom: 2px; }
  .navbtn { min-height: 58px; gap: 4px; font-size: 11.5px; }
  .navbtn .ico { width: 22px; height: 22px; }
  .rail__items { gap: 5px; }
  .mightyfoot { padding-top: 8px; }
  .mightyfoot__safety { margin-top: 4px; }
  .mightyfoot__sig { margin-top: 2px; }
  .glance { margin-bottom: 16px; }
  .glance__ask { font-size: clamp(26px, 2.7vw, 34px); }
  .glance__time { font-size: clamp(26px, 2.7vw, 36px); }
  .durations--home .duration { min-height: 84px; padding: 14px; }
}

/* Small phones */
@media (max-width: 420px) {
  :root { --pad: 18px; --gap: 14px; }
  .tilegrid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
  .tilegrid--lg { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  /* Keep the ambient glow, just stop it moving. Without this the
     blanket rule above would run it at an absurd rate instead. */
  .bg__a, .bg__b {
    animation: none !important;
    will-change: auto;
  }
}

/* The quote view covers everything, so the rail and tab bar go with it. */
[data-route="quote"] .rail,
[data-route="quote"] .tabbar { visibility: hidden; }

/* =============================================================
   ACCENT SWATCHES (Customize -> Appearance)
   ============================================================= */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.swatch {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease);
}
.swatch__dot {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.swatch__name { min-width: 0; }
.swatch:active { background: var(--surface-2); }
.swatch.is-on {
  color: var(--text);
  border-color: var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.16), rgb(var(--accent-rgb) / 0.05));
  box-shadow: 0 10px 26px -20px var(--accent-glow);
}
.swatch.is-on .swatch__dot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 0 3px var(--accent-soft); }

.custgroup {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 4px 0 14px;
}
.cust-grid + .custgroup { margin-top: 30px; }

.btn--quiet {
  background: none;
  border: 1px solid var(--line-hi);
  color: var(--text-2);
  box-shadow: none;
}
.btn--quiet:active { background: var(--surface-2); }

/* =============================================================
   QUOTE — Mighty 444
   -------------------------------------------------------------
   A full-viewport moment. The view escapes the main column entirely
   rather than sitting inside it, because a quote framed by a nav rail
   and a scrollbar is a card, not a moment.
   ============================================================= */
.view--quote {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.quote {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(28px, 5vw, 72px);
  text-align: center;
}

/* The one place the accent is allowed to be a light source rather than
   a line. Still faint — a wash behind the words, not a spotlight. */
.quote__glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 44% at 50% 34%, var(--accent-glow) 0%, transparent 70%),
    radial-gradient(70% 50% at 50% 100%, var(--glow-2) 0%, transparent 72%);
  opacity: 0.42;
}
[data-motion="on"] .quote__glow {
  animation: quote-breathe 46s ease-in-out infinite alternate;
  will-change: opacity, transform;
}
@keyframes quote-breathe {
  from { opacity: 0.34; transform: translate3d(0, 0, 0) scale(1); }
  to   { opacity: 0.50; transform: translate3d(0, -2.5vmin, 0) scale(1.06); }
}

.quote__close {
  position: absolute;
  top: clamp(16px, 2.4vw, 30px);
  right: clamp(16px, 2.4vw, 30px);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  z-index: 2;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.quote__close:active { background: var(--surface-hi); color: var(--text); }

.quote__stage,
.quote__picker {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vh, 34px);
}

.quote__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
  opacity: 0.85;
}

/* Four size buckets, set from the text length in app.js. Each is a
   clamp() so it still tracks the viewport — the bucket decides how
   ambitious the upper bound is allowed to be. `balance` keeps short
   quotes from breaking into a lonely one-word last line. */
.quote__text {
  margin: 0;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--text);
  text-wrap: balance;
  overflow-wrap: break-word;
  max-width: 20ch;
}
.quote__text[data-len="xs"] { font-size: clamp(38px, 8.4vw, 108px); max-width: 15ch; }
.quote__text[data-len="s"]  { font-size: clamp(31px, 6.0vw, 78px);  max-width: 20ch; }
.quote__text[data-len="m"]  { font-size: clamp(25px, 4.1vw, 54px);  max-width: 26ch; line-height: 1.2; }
.quote__text[data-len="l"]  { font-size: clamp(21px, 2.9vw, 38px);  max-width: 34ch; line-height: 1.28; }

.quote__attrib { display: flex; flex-direction: column; gap: 5px; }
.quote__credit {
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.quote__source {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.quote__credit:empty, .quote__source:empty { display: none; }

.quote__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: clamp(6px, 2vh, 20px);
}
.quote__act {
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--line-hi);
  border-radius: 999px;
  background: none;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.quote__act:active { background: var(--surface-2); color: var(--text); }
.quote__act--strong {
  border-color: var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.20), rgb(var(--accent-rgb) / 0.07));
  color: var(--text);
}

.quote__pickertitle {
  font-size: clamp(23px, 3vw, 36px);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Flex rather than grid: seven items never divide evenly into a row, and
   a grid leaves the short last row jammed against the left edge. Wrapping
   flex centres every row, so 4 + 3 reads as deliberate. */
.vibegrid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 860px;
}
.vibe {
  flex: 1 1 180px;
  max-width: 240px;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  background-image: var(--veil);
  box-shadow: var(--edge);
  color: var(--text);
  font-size: 16.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.vibe:active {
  border-color: var(--line-frost);
  background: linear-gradient(155deg, rgb(var(--accent-rgb) / 0.16), rgb(var(--accent-rgb) / 0.05));
}
.vibe__name { text-align: center; }

/* Phones: keep the moment, lose the ambition. */
@media (max-width: 699px) {
  .quote { padding: 64px 22px 36px; justify-content: flex-start; padding-top: 92px; }
  .quote__text[data-len="xs"] { font-size: clamp(34px, 10vw, 56px); }
  .quote__text[data-len="s"]  { font-size: clamp(28px, 8vw, 44px); }
  .quote__text[data-len="m"]  { font-size: clamp(23px, 6.4vw, 34px); }
  .quote__text[data-len="l"]  { font-size: clamp(19px, 5.2vw, 27px); }
  .quote__close { width: 46px; height: 46px; }
  .vibegrid { gap: 10px; }
  .vibe { flex: 1 1 132px; max-width: none; min-height: 76px; font-size: 15px; }
  /* The actions row shrink-wraps inside a centred column, so the buttons
     need the row to span before they can. Stacked full-width beats three
     pills crowding one thumb-width line. */
  .quote__actions { flex-direction: column; width: 100%; max-width: 340px; }
  .quote__act { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .quote__glow { animation: none !important; opacity: 0.42; }
}

