/* MotorLedger, Apple OS treatment: base, shell components and pages.
   Design Taste · macrostructure: app (car page, home, catalog) · tone: luxury, exact · anchor hue: navy 255
   Glass only on the navigation layer (glass.css); content is solid. Motion: transform and opacity only, Apple springs
   (tokens.css curves, motion.js for gestures). Every hover sits behind (hover: hover) and (pointer: fine). */

/* ---------- Base and the browser surfaces nobody draws ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; scrollbar-gutter: stable; background: var(--bg); }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink); font: var(--t-body); letter-spacing: var(--tr-body); font-synthesis-weight: none; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; font-style: normal; }
p { text-wrap: pretty; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { touch-action: manipulation; cursor: pointer; }
input, textarea, select { font-size: max(16px, 1em); }
[hidden] { display: none !important; }
::selection { background: var(--select); color: var(--ink); }
input { caret-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.glass.photo:focus-visible, .on-photo :focus-visible { outline-color: #FFFFFF; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.tnum { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* a hyphenated word kept whole (shell.js keepWhole); it reads as the text around it */
.kw { white-space: nowrap; }
svg text { font-family: var(--font); font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.muted { color: var(--ink-2); }
.hover { --hv: color-mix(in srgb, var(--ink) 6%, transparent); }

/* ---------- Buttons: 44px capsules; the press answers on pointer-down with a spring ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  font: 600 15px/1 var(--font); letter-spacing: -0.01em; white-space: nowrap; text-decoration: none; user-select: none;
  background: var(--bg-3); color: var(--ink);
  transition: transform var(--d-press-out) var(--ease-spring-15), background-color 200ms ease-out; }
.btn:active { transform: scale(.97); transition-duration: var(--d-press-in), 0ms; transition-timing-function: var(--ease-spring-0), linear; }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: color-mix(in srgb, var(--bg-3) 82%, var(--ink)); }
  .btn.primary:hover { background: var(--accent-fill-hover); }
  .btn[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
}
.ibtn { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  transition: transform var(--d-press-out) var(--ease-spring-15), background-color 200ms ease-out; }
.ibtn svg { width: 20px; height: 20px; }
.ibtn:active { transform: scale(.92); transition-duration: var(--d-press-in), 0ms; transition-timing-function: var(--ease-spring-0), linear; }
@media (hover: hover) and (pointer: fine) { .ibtn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); } }
.ibtn.photo { width: 44px; height: 44px; }
.ibtn.photo:active, .glass.photo:active { transform: scale(.92); }
.count { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--accent-fill); color: #fff; font: 700 11px/17px var(--font); text-align: center;
  transform: scale(0); transition: transform var(--d-press-out) var(--ease-spring-30); }
.count.on { transform: scale(1); }

/* ---------- Verdict pill: green only for BUY and ACCUMULATE ---------- */
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font: 700 12px/1 var(--font); letter-spacing: .02em; white-space: nowrap; flex: none; }
.pill.g { background: var(--pos-bg); color: var(--pos); }
.pill.n { background: var(--neu-bg); color: var(--neu); }

/* ---------- The nav pill (desktop), floating over the stage ---------- */
.nav { position: fixed; z-index: 50; top: var(--nav-top); left: 50%; translate: -50% 0;
  width: min(calc(var(--wrap) - 24px), calc(100vw - 2 * var(--gutter) - 24px)); height: var(--nav-h); border-radius: 999px;
  display: grid; grid-template-areas: "x"; align-items: center; padding: 0 8px 0 18px;
  transition: translate var(--d-dock) var(--ease-spring-0); }
.nav.away { translate: -50% calc(-100% - var(--nav-top) - 4px); }
.nav > .row { grid-area: x; display: flex; align-items: center; gap: 6px; min-width: 0;
  transition: opacity 220ms ease-out, transform var(--d-menu-open) var(--ease-spring-0); }
.nav .row.car { opacity: 0; transform: translateY(8px); pointer-events: none; visibility: hidden; transition: opacity 180ms ease-out, transform var(--d-menu-close) var(--ease-spring-0), visibility 0s 220ms; }
.nav.car-on .row.main { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.nav.car-on .row.car { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition-delay: 60ms, 60ms, 0s; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font: 800 17px/1 var(--font-brand); letter-spacing: -0.015em; white-space: nowrap; flex: none; }
.brand img { width: 28px; height: 28px; border-radius: 22%; }
.links { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.links > a, .links > button { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink);
  font: 500 14px/1 var(--font); letter-spacing: -0.006em; text-decoration: none; white-space: nowrap; transition: background-color 200ms ease-out; }
.links svg { width: 12px; height: 12px; transition: transform var(--d-menu-open) var(--ease-spring-0); }
.links [aria-expanded="true"] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
/* the section the visitor is in: a hairline under its label, never a fill (the fill marks an open menu); research/nav:
   Baymard finds 96% of sites leave this out */
.links [aria-current] { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 7px; text-decoration-color: color-mix(in srgb, var(--ink) 55%, transparent); }
/* the Cars menu: two columns, Browse and By verdict, each under its small heading */
.menu .mega { display: grid; grid-template-columns: repeat(2, minmax(220px, 290px)); gap: 0 6px; }
/* the Watchlist named itself from 1200 up (Ali's yes, 2026-10-26) until the appearance button needed its room the same
   day: an icon with its count at every width now (the word stays in the markup for the label's return) */
.wl-t { display: none; }
.links [aria-expanded="true"] svg { transform: rotate(180deg); }
@media (hover: hover) and (pointer: fine) { .links > a:hover, .links > button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); } }
.nav .end { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.find { display: inline-flex; align-items: center; gap: 8px; height: 38px; width: 230px; padding: 0 12px; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); font: 400 14px/1 var(--font); text-align: left; }
.find svg { width: 16px; height: 16px; flex: none; }
.find kbd { margin-left: auto; font: 500 11px/1 var(--font); color: var(--ink-3); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 5px; }
.nav .row.car .nm { font: 600 15px/1.2 var(--font); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav .row.car .fv { font: 500 14px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.nav .row.car .fv b { color: var(--ink); font-weight: 600; }
.nav .row.car .sep { width: 1px; height: 18px; background: var(--line-2); flex: none; }

.nav .only-s { display: none; }
/* small laptops: the search field gives up its shortcut hint before anything else in the pill gets squeezed */
/* the pill is capped at the page's width (1096 px from 1168 up), so its room is fixed; measured 2026-10-26 with Ali's
   pick A (Cars, Check a price, Deals, Bid Advisor, How we score) and the appearance button (46 px with its gap). From
   1200 up the search gives up its Ctrl K hint (the shortcut still works) */
@media (min-width: 1200px) {
  .find { width: 176px; } .find kbd { display: none; }
  .links > a, .links > button { padding: 0 10px; }
}
@media (max-width: 1199px) and (min-width: 901px) { .find { width: 172px; } .find kbd { display: none; } .links { margin-left: 10px; } .links > a, .links > button { padding: 0 10px; } }
/* narrower laptops and half-screen windows (960 on a 1920 screen): the five links cannot shrink, so the search field
   becomes its glass button (from 1150 down since the appearance button came: 1081 ran 18 px over) and the links' sides
   tighten (every window from 901 to about 1050 had overflowed: no sweep had a width there) */
@media (max-width: 1150px) and (min-width: 901px) {
  .find { width: 38px; padding: 0; justify-content: center; }
  .find span { display: none; }
}
@media (max-width: 1080px) and (min-width: 901px) { .links > a, .links > button { padding: 0 8px; } }
/* half-screen windows: Sign in becomes the account's round button, as on a phone (901 ran 24 px over) */
@media (max-width: 960px) and (min-width: 901px) {
  .links > a, .links > button { padding: 0 6px; }
  .nav .btn.hide-s { display: none; }
  .nav .only-s { display: inline-grid; }
}
/* phone: the pill keeps only the brand and two buttons; navigation lives in the tab bar */
@media (max-width: 900px) {
  .nav .only-s { display: inline-grid; }
  .links, .find kbd, .nav .hide-s { display: none; }
  .find { width: 38px; padding: 0; justify-content: center; }
  .find span { display: none; }
  .nav { padding: 0 6px 0 14px; width: calc(100vw - 2 * var(--gutter) - (var(--nav-top) * 2)); }
  .nav .row.car .fv span, .nav .row.car .hide-car { display: none; }
}
/* phones: one search per screen (Ali's rule: never the same button twice on one screen). Search sits in the pill where
   the "?" was (Ali, 2026-10-26), as a plain round button like the account's beside it, in both rows on a car page; help
   is the bubble over the tab bar's Cars */
@media (max-width: 900px) {
  .nav .find { width: 40px; height: 40px; background: transparent; color: var(--ink); }
  .nav .find svg { width: 20px; height: 20px; }
  .nav .gd-door { display: none; }
}

/* ---------- Scrim (dims, never blurs) ---------- */
.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); opacity: 0; transition: opacity 300ms ease-out; }
.scrim.on { opacity: 1; }
.scrim.clear { background: transparent; }

/* ---------- Menus grow out of their trigger ---------- */
.menu { position: fixed; z-index: 80; min-width: 300px; max-width: calc(100vw - 24px); padding: 8px; border-radius: 22px;
  transform-origin: var(--ox, 50%) var(--oy, 0); opacity: 0; transform: translateY(-6px) scale(.94); visibility: hidden;
  transition: transform var(--d-menu-close) var(--ease-spring-0), opacity 150ms ease-in, visibility 0s linear var(--d-menu-close); }
.menu.on { opacity: 1; transform: none; visibility: visible; transition: transform var(--d-menu-open) var(--ease-spring-15), opacity 180ms ease-out, visibility 0s; }
.menu a, .menu button.mi { display: grid; gap: 2px; width: 100%; padding: 10px 12px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); text-align: left; text-decoration: none; }
.menu a b, .menu .mi b { font: 600 15px/1.3 var(--font); letter-spacing: -0.008em; }
.menu a span, .menu .mi span { font: 400 13px/1.35 var(--font); color: var(--ink-2); }
.menu a:focus-visible, .menu .mi:focus-visible { outline-offset: -2px; }
.menu .mi[aria-checked="true"] { display: flex; justify-content: space-between; align-items: center; }
.menu .mi svg { width: 16px; height: 16px; color: var(--accent); }
.menu hr { border: 0; height: 1px; background: var(--line); margin: 6px 12px; }
@media (hover: hover) and (pointer: fine) { .menu a:hover, .menu .mi:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); } }

/* ---------- Command palette ---------- */
.pal { position: fixed; z-index: 90; top: 88px; left: 50%; width: min(640px, calc(100vw - 24px)); border-radius: 26px; overflow: hidden;
  translate: -50% 0; opacity: 0; transform: translateY(-10px) scale(.97); visibility: hidden;
  transition: transform var(--d-menu-close) var(--ease-spring-0), opacity 150ms ease-in, visibility 0s linear var(--d-menu-close); }
.pal.on { opacity: 1; transform: none; visibility: visible; transition: transform var(--d-menu-open) var(--ease-spring-15), opacity 180ms ease-out, visibility 0s; }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 58px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 20px; height: 20px; color: var(--ink-2); flex: none; }
.pal-in input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font: 400 18px/1 var(--font); letter-spacing: -0.012em; }
.pal-in input::placeholder { color: var(--ink-3); }
.pal-list { max-height: min(430px, 60dvh); overflow: auto; overscroll-behavior: contain; padding: 8px; }
.pal-group { padding: 10px 10px 6px; font: 600 12px/1 var(--font); color: var(--ink-2); }
.pal-opt { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.pal-opt[aria-selected="true"] { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.pal-ico { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); }
.pal-ico svg { width: 18px; height: 18px; }
.pal-ico img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.o-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.o-t b { font: 600 15px/1.3 var(--font); letter-spacing: -0.008em; }
.o-t span { font: 400 13px/1.35 var(--font); color: var(--ink-2); }
.o-r { display: flex; align-items: center; gap: 8px; flex: none; font: 600 13px/1 var(--font); color: var(--ink-2); }
.o-r svg { width: 14px; height: 14px; }
.pal-empty { padding: 22px 16px; color: var(--ink-2); font: 400 15px/1.45 var(--font); }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font: 500 12px/1 var(--font); color: var(--ink-3); }
@media (max-width: 720px), (hover: none) { .pal-foot { display: none; } }
@media (max-width: 720px) { .pal { top: 8px; } }
.o-t i { font-style: normal; }
/* phone: the name gets its own line; meta and verdict share the second, the pill alone carries the verdict */
@media (max-width: 520px) {
  .pal { width: calc(100vw - 16px); }
  .pal-opt { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; }
  .pal-opt .pal-ico { grid-column: 1; grid-row: 1 / 3; align-self: center; }
  .pal-opt .o-t { display: contents; }
  .pal-opt .o-t b { grid-column: 2 / 4; grid-row: 1; }
  .pal-opt .o-t > span { grid-column: 2; grid-row: 2; }
  .pal-opt .o-r { grid-column: 3; grid-row: 2; }
  /* rows without a verdict (pages, Ask) keep their arrow centred on the right */
  .pal-opt:not(:has(.pill)) .o-t b { grid-column: 2; }
  .pal-opt:not(:has(.pill)) .o-r { grid-row: 1 / 3; }
  .o-r .sc, .o-t .xs-hide { display: none; }
}

/* ---------- Doorways: side panel (desktop), full-size sheet (phone), centred modal ---------- */
.door { position: fixed; z-index: 85; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); border-radius: 28px;
  display: flex; flex-direction: column; overflow: hidden; touch-action: pan-y; }
.door.modal { top: 50%; bottom: auto; right: auto; left: 50%; width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 48px); translate: -50% -50%; }
/* a panel that holds a table of cars side by side (Compare) takes the room a table needs */
.door.wide { width: min(880px, calc(100vw - 24px)); }
.door-head { display: flex; align-items: center; gap: 12px; padding: 18px 14px 12px 24px; flex: none; }
.door-head h2 { font: var(--t-title3); letter-spacing: var(--tr-title3); flex: 1; min-width: 0; }
.door-head .ibtn { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.grab { display: none; }
.door-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 4px 24px 32px; }
/* content scrolled under a fixed header softens into it instead of stopping at a hard edge (Ali, 2026-10-26: "just
   enough to get rid of that abrupt cutoff feeling"). The scroller's top 16 px fade, only once it has scrolled, coming in
   over its first 24 px of scroll; a mask rather than a colour band, so the glass shows through in both themes. Only on
   scrollers under a header that stays put (doors, the search list): the Guide panel and Quick look scroll whole, and a
   mask there would fade their own glass. Where scroll timelines are missing the edge simply stays as it was. */
@property --top-fade { syntax: '<length>'; inherits: false; initial-value: 0px; }
@keyframes top-fade { to { --top-fade: 16px; } }
@supports (animation-timeline: scroll()) {
  .door-body, .pal-list { mask-image: linear-gradient(to bottom, transparent, #000 var(--top-fade)); animation: top-fade linear both; animation-timeline: scroll(self); animation-range: 0 24px; }
}
/* the same soft edge above a sheet's foot (the menu's appearance switch, a door's buttons): 16 px while there is more
   below, gone over the last 24 px of scroll. A body that does not scroll keeps it over its own bottom padding only */
@property --foot-fade { syntax: '<length>'; inherits: false; initial-value: 16px; }
@keyframes foot-fade { to { --foot-fade: 0px; } }
@supports (animation-timeline: scroll()) {
  .door:has(.door-foot:not([hidden])) .door-body { mask-image: linear-gradient(to bottom, transparent, #000 var(--top-fade), #000 calc(100% - var(--foot-fade)), transparent);
    animation: top-fade linear both, foot-fade linear both; animation-timeline: scroll(self), scroll(self); animation-range: 0 24px, calc(100% - 24px) 100%; }
}
.door-body .lede { color: var(--ink-2); font: var(--t-callout); }
.door-body h3 { font: var(--t-head); margin: 28px 0 10px; }
/* a door's own actions stay pinned under its content (the Filters sheet's "Show 12 cars") */
.door-foot { flex: none; border-top: 1px solid var(--line); padding: 12px 24px 14px; }
.door-foot-in { display: flex; gap: 10px; }
@media (max-width: 720px) {
  /* the sheet hugs short content (sign-in, ask) and stops 8px under the top for long content, like an iOS sheet */
  .door, .door.modal, .door.wide { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: calc(100dvh - 8px); translate: none; border-radius: var(--r-sheet) var(--r-sheet) 0 0; }
  .door-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .door:has(.door-foot:not([hidden])) .door-body { padding-bottom: 20px; }
  .door-head { padding: 8px 12px 10px 20px; flex-wrap: wrap; touch-action: none; }
  .grab { display: block; width: 100%; height: 14px; position: relative; flex: none; }
  .grab::before { content: ""; position: absolute; left: 50%; top: 4px; width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); translate: -50% 0; }
  .door-body { padding: 4px 20px calc(32px + env(safe-area-inset-bottom)); }
}

/* ---------- The phone menu (the tab bar's round button): every destination, grouped as on the desk, and Appearance ----------
   Tiles drawn in hairlines, never fills (Ali's rule for highlights); the visitor's tile wears the accent hairline; a press
   sinks the tile a little on the spring, a pointer lifts it 1 px with an accent hairline. Bento (Ali's pick over an even
   grid, 2026-10-26): a wide tile leads each group, half tiles pair under it */
.mn { display: grid; gap: 22px; padding-top: 2px; }
.mn-h { margin: 0 0 10px; font: 600 12px/1.3 var(--font); color: var(--ink-2); }
.mn-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mn-t { position: relative; display: grid; align-content: space-between; justify-items: start; gap: 16px; min-width: 0; min-height: 92px; padding: 14px 14px 13px;
  border: 1px solid var(--line-2); border-radius: 18px; background: none; color: var(--ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer;
  transition: border-color 200ms ease-out, color 200ms ease-out, transform var(--d-press-out) var(--ease-spring-15); }
.mn-t b { display: block; max-width: 100%; font: 600 15px/1.25 var(--font); letter-spacing: -0.012em; }
.mn-t small { display: block; font: 400 13px/1.3 var(--font); color: var(--ink-2); }
.mn-ic { display: block; line-height: 0; }
/* every icon sits in a hairline ring (the JOB "A Cards" move Ali picked, 2026-10-11), drawn at 22 px in 42 */
.mn-i { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: 50%; transition: border-color 200ms ease-out; }
.mn-t svg { width: 22px; height: 22px; }
/* a wide tile leads its group: the ring, the name, and one line of what is there */
.mn-t.w { grid-column: 1 / -1; grid-template-columns: 42px minmax(0, 1fr); align-items: center; align-content: center; gap: 14px; min-height: 76px; padding: 14px 16px 14px 14px; }
.mn-tx { min-width: 0; }
.mn-tx b, .mn-tx small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mn-tx small { margin-top: 3px; }
/* a verdict list is a row: its bands, the pills the catalog uses, and how many cars are in it at the far end (side by
   side the three grey bands stacked three high at 320) */
.mn-t.vd { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) auto; align-items: center; align-content: center; gap: 12px; min-height: 64px; }
.mn-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.mn-t.vd small { font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* All tools closes the Check group as a quiet link, not a fifth tile */
.mn-more { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 2px; padding: 0 2px; border: 0; background: none; color: var(--ink-2);
  font: 500 15px/1.2 var(--font); text-decoration: none; transition: color 200ms ease-out; }
.mn-more > span:not(.mn-ic) { flex: 1; min-width: 0; }
.mn-more svg { width: 20px; height: 20px; }
.mn-more > svg:last-child { width: 16px; height: 16px; color: var(--ink-3); }
.mn-t[aria-current="page"], .mn-more[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.mn-t[aria-current="page"] .mn-i { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.mn-t:active { transform: scale(.97); transition-duration: 200ms, 200ms, var(--d-press-in); }
.mn-more:active { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .mn-t:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-1px); }
  .mn-t:hover .mn-i { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
  .mn-more:hover { color: var(--ink); }
}
.mn-t:focus-visible, .mn-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* the first opening on a page: each icon draws itself, tile by tile (pathLength 1, a gap of 2 so no cap shows before its
   turn); a menu opened again on the page opens still */
.mn.draw [pathLength] { stroke-dasharray: 1 2; animation: mn-draw 620ms cubic-bezier(.3, .7, .25, 1) both; animation-delay: calc(140ms + var(--i, 0) * 26ms); }
@keyframes mn-draw { 0% { stroke-dashoffset: 1; visibility: hidden; } 0.1% { visibility: visible; } 100% { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .mn.draw [pathLength] { animation: none; } }
.mn-theme { flex: 1; min-width: 0; }
.mn-theme .seg { background: color-mix(in srgb, var(--ink) 6%, transparent); }   /* the track shows on the glass, as on Tools */
.mn-theme .seg { display: flex; width: 100%; }
.th-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg.th-seg button svg { width: 15px; height: 15px; }
.mn-theme .th-seg button { flex: 1; height: 40px; }
/* the desk's appearance menu: three choices under the pill's round button, the pick checked */
.menu:has(> .ap) { min-width: 0; width: 212px; }
.menu .ap .mi { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.menu .ap-l { display: inline-flex; align-items: center; gap: 10px; }
.menu .ap-l svg { width: 18px; height: 18px; color: var(--ink-2); }
.menu .ap .mi[aria-checked="true"] .ap-l svg { color: var(--ink); }

/* ---------- Toast: stays while it carries Undo ---------- */
.toast { position: fixed; z-index: 95; left: 50%; bottom: 24px; width: max-content; max-width: calc(100vw - 24px); display: flex; align-items: center; gap: 6px;
  min-height: 52px; padding: 6px 6px 6px 16px; border-radius: 999px; white-space: nowrap;
  translate: -50% 0; opacity: 0; transform: translateY(16px) scale(.96); visibility: hidden;
  transition: transform var(--d-menu-close) var(--ease-spring-0), opacity 160ms ease-in, visibility 0s linear var(--d-menu-close); }
.toast.on { opacity: 1; transform: none; visibility: visible; transition: transform var(--d-menu-open) var(--ease-spring-15), opacity 200ms ease-out, visibility 0s; }
.toast > svg { width: 18px; height: 18px; color: var(--pos); flex: none; }
.toast > span { font: 500 15px/1.2 var(--font); margin-right: 6px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.toast .btn, .toast .ibtn { flex: none; }
.toast .t-short { display: none; }
@media (max-width: 520px) {
  .toast .t-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .toast .t-short { display: inline; }
}
.toast .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
@media (max-width: 900px) { .toast { bottom: calc(96px + env(safe-area-inset-bottom)); } body.has-acc .toast { bottom: calc(158px + env(safe-area-inset-bottom)); } }
/* on the review build the board strip sits at the bottom; the toast rises above it rather than over it */
@media (min-width: 901px) { body:has(> .board) .toast { bottom: 68px; } }

/* ---------- Receipts popover on a number ---------- */
.rcpt { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 0.16em; }
.pop { position: fixed; z-index: 88; width: min(320px, calc(100vw - 32px)); padding: 16px 18px; border-radius: var(--r-pop);
  transform-origin: var(--ox, 50%) var(--oy, 0); opacity: 0; transform: scale(.94); visibility: hidden;
  transition: transform var(--d-menu-close) var(--ease-spring-0), opacity 140ms ease-in, visibility 0s linear var(--d-menu-close); }
.pop.on { opacity: 1; transform: none; visibility: visible; transition: transform var(--d-pop) var(--ease-spring-10), opacity 160ms ease-out, visibility 0s; }
.pop .p-k { font: 600 12px/1 var(--font); color: var(--ink-2); }
.pop .p-v { margin-top: 6px; font: 700 24px/1.1 var(--font); letter-spacing: -0.025em; }
.pop p:not(.p-k):not(.p-v) { margin-top: 8px; font: 400 14px/1.45 var(--font); color: var(--ink-2); }
.pop .btn { margin-top: 12px; }

/* ---------- Phone tab bar, its menu button, the help bubble, and the accessory above it ---------- */
.tabbar, .tab-menu, .gd-bubble, .acc { display: none; }
@media (max-width: 900px) {
  /* the page's end clears the floating chrome: the bar, and the help bubble over it (84 + 44 + 12), and on a car page
     the bubble lifted over the price bar (148 + 44 + 12) */
  body { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  body.has-acc { padding-bottom: calc(204px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; z-index: 50; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); right: calc(12px + 62px + 10px); height: 62px;
    border-radius: 999px; padding: 4px; gap: 2px; align-items: stretch; transition: transform var(--d-dock) var(--ease-spring-0); }
  .tabbar a { flex: 1; display: grid; place-items: center; align-content: center; gap: 3px; min-width: 0; border-radius: 999px; color: var(--ink); text-decoration: none; font: 600 10px/1 var(--font); letter-spacing: .01em;
    transition: background-color 200ms ease-out, transform var(--d-press-out) var(--ease-spring-15); }
  .tabbar a svg { width: 23px; height: 23px; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--ink) 7%, transparent); }
  .tabbar a:active { transform: scale(.94); transition-duration: 200ms, var(--d-press-in); }
  .tab-menu { display: grid; place-items: center; position: fixed; z-index: 50; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border: 0; border-radius: 50%; padding: 0; color: var(--ink);
    transition: transform var(--d-dock) var(--ease-spring-0); }
  .tab-menu svg { width: 24px; height: 24px; }
  .tab-menu:active { transform: scale(.94); transition-duration: var(--d-press-in); }
  /* help, a small bubble centred over Cars (the bar's first of four tabs: its 4 px inset plus half a tab), 10 px above
     the bar; over the car's price bar once that shows; it leaves with the bar on a scroll down, and steps aside while a
     Guide stop's card holds the foot of the screen */
  .gd-bubble { display: grid; place-items: center; position: fixed; z-index: 50; width: 44px; height: 44px; border: 0; border-radius: 50%; padding: 0; color: var(--ink);
    left: calc(12px + 4px + (100vw - 12px - 62px - 10px - 12px - 8px - 6px) / 8 - 22px); bottom: calc(12px + 62px + 10px + env(safe-area-inset-bottom));
    transition: transform var(--d-dock) var(--ease-spring-0), opacity 180ms ease-out, visibility 0s; }
  .gd-bubble svg { width: 20px; height: 20px; }
  .gd-bubble:active { scale: .92; }
  body.car-on .gd-bubble { transform: translateY(calc(-54px - 10px)); }
  /* keyed to the card's .on, not its hidden flag: a path's end hands focus back to the bubble at once, while the card is
     still fading, and a hidden bubble cannot take it */
  body.tucked .gd-bubble, body:has(.gd-step.on) .gd-bubble, body:has(.toast.on) .gd-bubble { transform: translateY(calc(44px + 84px + 24px)); opacity: 0; visibility: hidden;
    transition: transform var(--d-dock) var(--ease-spring-0), opacity 180ms ease-out, visibility 0s linear var(--d-dock); }
  .acc { display: flex; position: fixed; z-index: 49; left: 12px; right: 12px; bottom: calc(12px + 62px + 10px + env(safe-area-inset-bottom)); height: 54px; border-radius: 999px;
    align-items: center; gap: 10px; padding: 0 6px 0 14px;
    opacity: 0; visibility: hidden; transform: translateY(calc(62px + 10px));
    transition: transform var(--d-dock) var(--ease-spring-0), opacity 180ms ease-out, visibility 0s linear var(--d-dock); }
  /* it repeats the page's own price and action, so it waits until those scroll away (and blurs nothing until then) */
  body.car-on .acc { opacity: 1; visibility: visible; transform: none; transition: transform var(--d-dock) var(--ease-spring-0), opacity 220ms ease-out, visibility 0s; }
  .acc .fv { display: grid; gap: 2px; min-width: 0; }
  .acc .fv b { font: 650 15px/1 var(--font); letter-spacing: -0.01em; }
  .acc .fv small { font: 500 11px/1.1 var(--font); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .acc .btn { margin-left: auto; }
  body.tucked .tabbar, body.tucked .tab-menu { transform: translateY(calc(100% + 24px)); }
  body.car-on.tucked .acc { transform: translateY(calc(62px + 10px)); }
  /* phone: the nav's car row is identity (name, verdict); the accessory is value and action. Neither repeats the other */
  .nav .row.car .fv, .nav .row.car .end, .acc .pill { display: none; }
  .nav .row.car .nm { flex: 1; }
  .nav .row.car .pill { margin-right: 4px; }
  .nav .tab-hide { display: none; }
}

/* ---------- Page glides: the content slides a little and fades; the nav and tab bar stay put ---------- */
@view-transition { navigation: auto; }
.nav { view-transition-name: nav; } .tabbar { view-transition-name: tabbar; } .tab-menu { view-transition-name: tabmenu; } .gd-bubble { view-transition-name: gdbubble; }
::view-transition-group(nav), ::view-transition-group(tabbar), ::view-transition-group(tabmenu), ::view-transition-group(gdbubble) { animation: none; }
::view-transition-old(root) { animation: vt-out var(--d-page) var(--ease-spring-0) both; }
::view-transition-new(root) { animation: vt-in var(--d-page) var(--ease-spring-0) both; }
html:active-view-transition-type(back)::view-transition-old(root) { animation-name: vt-out-back; }
html:active-view-transition-type(back)::view-transition-new(root) { animation-name: vt-in-back; }
/* the appearance switch: the new colours dissolve in over the old, nothing slides (shell.js setTheme marks it) */
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: vt-dissolve 280ms ease-out both; }
@keyframes vt-dissolve { from { opacity: 0; } }
@keyframes vt-out { to { opacity: 0; transform: translateX(-3%); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(5%); } }
@keyframes vt-out-back { to { opacity: 0; transform: translateX(3%); } }
@keyframes vt-in-back { from { opacity: 0; transform: translateX(-5%); } }
/* the photo morph: the group sits at its final size and one transform carries it (b2: never animate width) */
::view-transition-group(hero) { animation-duration: var(--d-page); animation-timing-function: var(--ease-spring-0); }
::view-transition-old(hero), ::view-transition-new(hero) { animation-duration: var(--d-page); animation-timing-function: var(--ease-spring-0); height: 100%; object-fit: cover; }
/* the card grows into the stage on the browser's own group animation (position, width and height: the real box, never a
   stretch, so a card and a stage of different shapes never squash the photo); only its timing is ours. A script version
   measured the stage in the first frame and forced a second style pass there, the one long frame of the morph */
.vt-flip::view-transition-group(hero) { animation-duration: var(--d-morph); animation-timing-function: var(--ease-spring-0); border-radius: var(--r-stage); overflow: hidden; }
.vt-flip::view-transition-old(hero), .vt-flip::view-transition-new(hero) { height: 100%; width: 100%; object-fit: cover; animation-duration: var(--d-morph); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  ::view-transition-group(*) { animation-duration: 0s !important; }
}

/* ---------- Board controls (review only, never part of the design) ---------- */
.board { position: fixed; z-index: 200; left: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 14px;
  background: #FFFFFF; color: #111; box-shadow: 0 0 0 1px rgb(0 0 0 / .14), 0 8px 24px rgb(0 0 0 / .12); font: 500 12px/1 var(--font); }
.board b { padding: 0 6px; font-weight: 700; }
/* folded to its "Board" pill until pointed at, focused or tapped open, so it never covers the page's own controls */
.board .bd-t { padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: #111; font: 700 12px/1 var(--font); cursor: pointer; }
.board > :not(.bd-t) { display: none; }
.board:hover > :not(.bd-t), .board:focus-within > :not(.bd-t), .board.open > :not(.bd-t) { display: revert; }
.board > .sep { width: 1px; height: 16px; }
.board a { padding: 7px 9px; border-radius: 8px; color: #111; text-decoration: none; }
.board a[aria-current] { background: #111; color: #fff; }
.board .sep { width: 1px; height: 16px; background: rgb(0 0 0 / .14); }
@media (max-width: 900px) { .board { display: none; } }
.capture .board { display: none; }

/* ---------- The switch (moved from account.css: the Guide's switches use it on every page) ---------- */
.ac-sw { position: relative; flex: none; width: 48px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: var(--bg-3); box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; transition: background-color 200ms ease-out; }
.ac-sw::after { content: ""; position: absolute; inset: -8px; }   /* a 44 px hit area around the 28 px track */
.ac-sw span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgb(0 0 0 / .2);   /* white in both themes (a black knob in dark read as off) */ transition: transform var(--d-press-out) var(--ease-spring-15); }
.ac-sw[aria-checked="true"] { background: var(--accent-fill); box-shadow: none; }
.ac-sw[aria-checked="true"] span { transform: translateX(20px); }
.ac-sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- The Guide (guide.js; research/guide/plan.md, Ali's direction B) ----------
   One quiet door in the nav. On a desk a glass panel grows out of it like the menus; on a phone the bottom sheet. Hairlines
   for what is chosen or marked, never a fill for emphasis; nothing pulses; nothing moves the page. */
.gd-door[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.gd { position: fixed; z-index: 80; width: min(380px, calc(100vw - 24px)); padding: 14px 8px 8px; border-radius: 22px; overflow: auto; overscroll-behavior: contain;
  transform-origin: var(--ox, 90%) 0; opacity: 0; transform: translateY(-6px) scale(.96); visibility: hidden;
  transition: transform var(--d-menu-close) var(--ease-spring-0), opacity 150ms ease-in, visibility 0s linear var(--d-menu-close); }
.gd.on { opacity: 1; transform: none; visibility: visible; transition: transform var(--d-menu-open) var(--ease-spring-15), opacity 180ms ease-out, visibility 0s; }
.gd-top { display: flex; align-items: center; justify-content: space-between; padding: 0 0 0 12px; }
.gd-top h2 { font: 700 20px/1.2 var(--font); letter-spacing: -0.02em; }
.gd-top h2:focus { outline: none; }
.gd-top .ibtn { width: 36px; height: 36px; }
.gd-lede { margin: 2px 12px 0; font: 400 14px/1.45 var(--font); color: var(--ink-2); }
.gd-sec { margin: 14px 12px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.gd-h { margin: 0 0 10px; font: 600 12px/1.3 var(--font); color: var(--ink-2); }
.gd-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-chip { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink);
  font: 500 13.5px/1 var(--font); white-space: nowrap; cursor: pointer; transition: background-color 160ms ease-out, color 160ms ease-out; }
.gd-chip[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
@media (hover: hover) and (pointer: fine) { .gd-chip:not([aria-expanded="true"]):hover { background: color-mix(in srgb, var(--ink) 10%, transparent); } }
@media (pointer: coarse) { .gd-chip { height: 40px; padding: 0 14px; } }
.gd-def { margin-top: 12px; padding: 12px 14px 12px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line-2); }
.gd-def b { font: 600 14px/1.3 var(--font); }
.gd-def p { margin-top: 4px; font: 400 14px/1.45 var(--font); color: var(--ink-2); }
.gd-def .t-open { margin: 8px 0 0; }
.gd-paths { display: grid; margin: 0 -12px; padding: 0; list-style: none; }
.gd-path { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 14px;
  background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.gd-path b { font: 600 15px/1.3 var(--font); letter-spacing: -0.008em; }
.gd-path small { grid-column: 1; font: 400 13px/1.35 var(--font); color: var(--ink-2); }
.gd-path .gd-st { grid-column: 2; grid-row: 1 / span 2; font: 500 13px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.gd-path .gd-st svg { width: 16px; height: 16px; color: var(--ink-2); }
.gd-path:focus-visible { outline-offset: -2px; }
@media (hover: hover) and (pointer: fine) { .gd-path:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); } }
.gd-swr { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 0; }
.gd-swr b { display: block; font: 600 15px/1.3 var(--font); }
.gd-swr small { display: block; margin-top: 2px; font: 400 13px/1.35 var(--font); color: var(--ink-2); }
.gd-foot { display: flex; justify-content: flex-end; padding: 10px 0 6px; }
.gd-foot .t-open { margin: 0; }
/* on a phone the same contents sit in the bottom sheet, which brings its own title and close */
.door .gd-in .gd-lede, .door .gd-in .gd-sec { margin-left: 0; margin-right: 0; }
.door .gd-in .gd-h { margin: 0 0 10px; font: 600 12px/1.3 var(--font); }   /* the sheet's own h3 rule (17 px, 28 px above) is for its sections */
/* in the car row the door sits beside the row's action, as it sits beside Sign in on the main row */
.nav .row.car .gd-door { margin-left: auto; }
.nav .row.car .gd-door + .end { margin-left: 4px; }
.door .gd-in .gd-paths { margin: 0 -12px; }

/* a path: the card beside its target and a hairline round the target; under any door or menu the visitor opens */
.gd-ring { position: fixed; z-index: 59; pointer-events: none; box-shadow: 0 0 0 1px var(--accent); opacity: 0; transition: opacity 180ms ease-out; }
.gd-ring.on { opacity: 1; }
.gd-step { position: fixed; z-index: 60; width: min(340px, calc(100vw - 32px)); padding: 14px 16px 14px 18px; border-radius: 20px; opacity: 0; transform: translateY(4px);
  transition: opacity 180ms ease-out, transform 180ms ease-out; }
.gd-step.on { opacity: 1; transform: none; }
/* the card takes focus only so a screen reader starts reading it; it is not a control, so it draws no ring of its own
   (arriving on a path from another page drew one round the card, competing with the ring round the stop). Its buttons
   keep theirs */
.gd-step:focus, .gd-step:focus-visible { outline: none; }
.gd-step .gd-x { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; }
.gd-step .gd-k { padding-right: 34px; font: 600 12px/1.3 var(--font); color: var(--ink-2); }
.gd-step h3 { margin-top: 6px; font: 700 17px/1.25 var(--font); letter-spacing: -0.015em; }
.gd-step p:not(.gd-k) { margin-top: 6px; font: 400 14.5px/1.45 var(--font); color: var(--ink-2); }
.gd-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.gd-then { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.gd-then .t-open { margin: 0; }

/* Explain as I go: the site's own words open their meaning, marked like the receipts */
.gd-term { padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: inherit; cursor: pointer;
  text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-decoration-thickness: 1.5px; text-underline-offset: 0.16em; }
.gd-term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.gd-pop .t-open { margin: 10px 0 0; }
@media (prefers-reduced-motion: reduce) { .gd, .gd.on, .gd-step, .gd-step.on, .gd-ring, .gd-ring.on, .gd-chip { transition: none; } }
