/* UsedCarWise styles. One file per Figma component under css/components/. */
/* Fonts, served from usedcarwise.com (Latin subset from Google Fonts, SIL Open Font License).
   Hosting them here saves two connections to Google on every first visit. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/fraunces-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Design tokens — mirror the Figma "Color" (Light) and "Spacing" collections.
   The site is always light: easier to read outdoors and on the go. */
:root {
  --bg: #fbfaf7;          /* color/bg/page */
  --surface: #ffffff;     /* color/bg/surface */
  --surface-2: #f2f0eb;   /* color/bg/subtle */
  --road: #23282b;        /* color/bg/road */
  --text: #15171a;        /* color/text/primary */
  --muted: #5d6068;       /* color/text/secondary */
  --line: #e7e3db;        /* color/border/default */
  --brand: #0b5d43;       /* color/brand/default */
  --brand-ink: #ffffff;   /* color/brand/on */
  --brand-soft: #e2efe9;  /* color/brand/soft */
  --hl: #f2c14e;          /* color/accent/highlight */
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --s1: #0b6e4f;
  --s2: #d0640c;
  --s3: #5b4bc4;

  --radius-sm: 10px;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(20 20 10 / 0.05), 0 8px 24px -12px rgb(20 20 10 / 0.12); /* Elevation/Card */
  --header-h: 60px;

  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
/* Reset, typography, page layout, header and footer. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.02em; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { left: 8px; }
.label, .eyebrow, .kicker { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0; }
.kicker { color: var(--brand); }
.fine { color: var(--muted); font-size: 13px; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 8px; }
.card-title h3 { font-size: 16px; }
.card-title p { color: var(--muted); font-size: 13px; margin: 0; }
.input-affix { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 0 12px; }
.input-affix:focus-within { border-color: var(--brand); background: var(--surface); }
.input-affix input { width: 100%; min-width: 0; border: 0; background: none; padding: 10px 2px; font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
.input-affix b, .input-affix i { color: var(--muted); font-style: normal; font-weight: 500; font-size: 14px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 20px/1 var(--serif); color: var(--text); text-decoration: none; }
.brand svg { width: 30px; height: 30px; flex: none; }
.mark-bg { fill: var(--brand); }
.mark-road { stroke: var(--brand-ink); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.mark-lane { stroke: var(--hl); stroke-width: 2; stroke-linecap: round; fill: none; }
.site-header nav { display: flex; align-items: center; gap: 24px; }
.nav-link { color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav-link:hover { color: var(--text); }

/* Intro + numbered steps */
.compare { padding: 16px 0 56px; }
.intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; margin-bottom: 8px; }
.intro-text { display: grid; gap: 12px; }
.intro-points { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 6px 0 0; padding: 0; font-size: 14px; font-weight: 500; }
.intro-points li { display: inline-flex; align-items: center; gap: 6px; }
.intro-points .icon { width: 18px; height: 18px; color: var(--brand); }
.intro h1 { font-size: clamp(32px, 5.4vw, 56px); line-height: 1.04; max-width: 20ch; }
.lede { color: var(--muted); font-size: clamp(16px, 2vw, 18px); max-width: 60ch; margin: 0; }
.intro-link { display: inline-block; margin-top: 14px; font-weight: 600; font-size: 15px; text-decoration: none; }
.intro-link:hover { text-decoration: underline; }
.step { margin-top: 32px; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 14px; }
.step-head h2 { font-size: 24px; }
.step-head p { color: var(--muted); font-size: 14px; margin: 0; flex-basis: auto; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font: 600 14px/1 var(--sans); }

/* Results area */
.results { display: grid; gap: 16px; min-height: 160px; transition: opacity .2s; }
.results.loading { opacity: .55; }
.empty { display: grid; justify-items: center; gap: 12px; color: var(--muted); text-align: center; padding: 40px 16px; border: 1.5px dashed var(--line); border-radius: var(--radius); }
.empty p { margin: 0; max-width: 44ch; }
.empty-art { width: 120px; }
.chart-slot { display: grid; gap: 12px; justify-items: start; }
.chart-wrap { width: 100%; }
.details-list { display: grid; gap: 10px; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* Bands (rankings, method) */
.band { padding: 72px 0 48px; border-top: 1px solid var(--line); }
.band-head { margin-bottom: 24px; display: grid; gap: 8px; }
.band-head h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; max-width: 24ch; }
.band-head p:not(.kicker) { color: var(--muted); margin: 0; max-width: 62ch; }
.steps { list-style: none; padding: 0; margin: 0 0 48px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--text); padding-top: 16px; }
.steps li::before { content: "0" counter(step); font-weight: 600; font-size: 14px; color: var(--brand); float: right; }
.step-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); margin-bottom: 4px; }
.step-icon .icon { width: 26px; height: 26px; }
.steps h3 { font-size: 18px; margin: 6px 0 8px; }
.steps p { color: var(--muted); margin: 0; font-size: 15px; }
.faq { max-width: 760px; }
.faq h3 { font: 600 24px/1.2 var(--serif); margin-bottom: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--muted); font-size: 14px; background: var(--surface); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.footer-row p { max-width: 52ch; margin: 8px 0 0; }
.footer-brand { font: 600 18px var(--serif); color: var(--text); margin: 0 !important; }
.footer-links { display: grid; gap: 8px; align-content: start; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* Legal pages */
.doc { max-width: 720px; padding-top: 48px; padding-bottom: 64px; }
.doc h1 { font-size: clamp(32px, 5vw, 48px); margin-bottom: 8px; }
.doc h2 { font-size: 22px; margin: 36px 0 8px; }
.doc p, .doc li { color: var(--muted); }
.doc p strong { color: var(--text); }
.doc .updated { font-size: 14px; }

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; gap: 20px; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .site-header .nav-link { display: none; }
  .compare { padding-top: 28px; }
  .intro { margin-bottom: 8px; }
  .intro-points { display: none; }
  .step-head h2 { font-size: 22px; }
  .step-head p { flex-basis: 100%; }
  .band { padding: 48px 0 32px; }
}

/* Step status line (e.g. "2 cars added") */
.step-head p.is-done { color: var(--good); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.step-head p.is-done .icon { width: 16px; height: 16px; }

/* Photo credits table */
.credits { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 24px; }
.credits th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.credits td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.credits td:first-child { color: var(--text); min-width: 150px; }
.credits td img { display: block; width: 120px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.credits :target { background: var(--brand-soft); }
@media (max-width: 720px) {
  .credits thead { display: none; }
  .credits tr { display: grid; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .credits td { border: 0; padding: 2px 0; }
}

/* Estimate disclaimers */
.disclaimer { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--hl) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--hl) 45%, var(--line)); font-size: 13.5px; line-height: 1.45; color: var(--text); max-width: none !important; }
.disclaimer .icon { width: 18px; height: 18px; flex: none; color: var(--warn); margin-top: 1px; }
.est-note { margin: -2px 0 0; font-size: 12px; color: var(--warn); font-weight: 600; }
.est-tag { display: inline-block; width: fit-content; margin-top: 4px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
/* Icon + Car illustration (Figma: Icon, Car illustration) */
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.icon-cat { color: var(--brand); }
.car-art { display: block; flex: none; height: auto; }
/* Button (Figma: Button — Style × Size) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, filter .15s;
}
.btn-m { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn-s { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-quiet { background: none; color: var(--brand); padding-left: 4px; padding-right: 4px; }
.btn-quiet:hover { text-decoration: underline; }
/* Info tip (Figma: Info tip) */
.tip { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -4px 0 -4px 2px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; vertical-align: middle; }
.tip .icon { width: 16px; height: 16px; }
.tip:hover, .tip[aria-expanded=true] { color: var(--brand); background: var(--brand-soft); }
.tip-body[hidden] { display: none; }
.tip-body { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--brand-soft); color: var(--text); font-size: 13px; font-weight: 400; line-height: 1.45; max-width: 36ch; }
/* Badge (Figma: Badge — Tone) */
.badge { display: inline-block; width: fit-content; font-size: 12px; font-weight: 600; line-height: 1.4; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.badge-best { background: var(--hl); color: #3a2a00; }
.badge-warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge-good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
/* Vehicle slot (Figma: Vehicle slot — Empty / Typing / Selected) */
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.slot { position: relative; display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.slot::before { content: ""; position: absolute; inset: -1px -1px auto; height: 4px; border-radius: var(--radius) var(--radius) 0 0; background: var(--c); }
.slot-head { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.slot-title { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; }
.slot-title .optional { color: var(--muted); font-weight: 400; }
.icon-btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; display: grid; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.slot-facts { margin: 0; color: var(--muted); font-size: 14px; }
.slot-change { justify-self: start; }
.engine-picker { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 0 0 0 12px; font-size: 14px; }
.engine-picker span { color: var(--muted); }
.engine-picker select {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 30px 10px 4px; font-size: 14px; font-weight: 600; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px;
}
.search { position: relative; display: grid; gap: 8px; }
.search-field { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 0 12px; }
.search-field:focus-within { background: var(--surface); border-color: var(--brand); }
.search-icon { width: 18px; height: 18px; flex: none; stroke: var(--muted); stroke-width: 1.8; fill: none; stroke-linecap: round; }
.search-input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; font-size: 16px; outline: none; }
.search-input::placeholder { color: var(--muted); }
.search-hint { margin: 0; font-size: 13px; color: var(--muted); }
.search-hint.err { color: var(--bad); }
.suggestions {
  position: absolute; z-index: 5; top: 50px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px -8px rgb(0 0 0 / .2);
  max-height: 320px; overflow-y: auto;
}
.suggestions li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.suggestions li span { color: var(--muted); font-size: 12px; text-align: right; }
.suggestions li[aria-selected=true] { background: var(--brand-soft); }
.suggestions li.none { cursor: default; color: var(--muted); }
.add-slot {
  display: grid; place-items: center; align-content: center; gap: 8px; min-height: 152px; padding: 16px;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.add-slot svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }
.add-slot:hover { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 720px) {
  .add-slot { min-height: 0; grid-auto-flow: column; padding: 14px; }
  .add-slot svg { width: 20px; height: 20px; }
}
.slot-art { width: 46px; margin: -2px 0; }
.suggestions li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; }
.suggestions li > svg { grid-row: span 2; }
.suggestions li span { text-align: left; }
.suggestions li.none { display: block; }
.sug-art { width: 40px; }
.sug-icon { width: 22px; height: 22px; color: var(--brand); }
.slot-basic { display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 13px; color: var(--muted); } .slot-basic .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--brand); }
.sug-basic { color: var(--muted); font-style: italic; }
/* Segmented control (Figma: Segment) + fuel field, inside the driving card */
.driving { display: flex; flex-wrap: wrap; gap: 24px 36px; padding: 20px 24px; }
.segmented { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; align-content: start; }
.segmented legend, .fuel-field .legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.segments { display: flex; gap: 8px; flex-wrap: wrap; }
.segment { position: relative; display: grid; justify-items: center; gap: 1px; min-width: 92px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; text-align: center; }
.segment input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-label { font-weight: 600; font-size: 14px; }
.seg-detail { font-size: 12px; color: var(--muted); }
.segment:hover { border-color: var(--line); }
.segment:has(input:checked) { background: var(--brand-soft); border-color: var(--brand); }
.segment:has(input:checked) .seg-label { color: var(--brand); }
.segment:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.custom-field[hidden] { display: none; }
.custom-field { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.custom-field .input-affix { width: 150px; }
.fuel-field { display: grid; align-content: start; gap: 0; }
.fuel-field .input-affix { width: 150px; }
.fuel-field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
@media (max-width: 720px) {
  .driving { padding: 16px; gap: 20px; flex-direction: column; }
  .segments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .segments:has(.segment:nth-child(4):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .segment { min-width: 0; padding: 8px 4px; }
  .seg-label { font-size: 13px; }
  .seg-detail { font-size: 11px; }
  /* "Custom" gets its own slim row so four presets fit across a phone */
  .segment:has(input[value=custom]) { grid-column: 1 / -1; grid-auto-flow: column; justify-content: center; gap: 6px; padding: 6px; }
  .fuel-field { grid-template-columns: 1fr auto; align-items: center; }
  .fuel-field .legend { margin: 0; }
  .fuel-field .input-affix { width: 130px; grid-row: span 2; }
  .fuel-field .hint { margin: 0; }
}

/* Driving summary: on phones the panel collapses to one tappable line */
.drive-summary { display: none; }
@media (max-width: 720px) {
  .drive-summary {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 15px;
  }
  .drive-summary .icon { color: var(--brand); width: 22px; height: 22px; }
  .drive-summary span:first-of-type { flex: 1; }
  .ds-go { font-weight: 700; color: var(--brand); }
  .drive-summary[aria-expanded=true] { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: transparent; box-shadow: none; }
  .driving.is-collapsed { display: none; }
  .drive-summary[aria-expanded=true] + .driving { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
}
/* Verdict banner (Figma: Verdict banner) */
.verdict { display: grid; gap: 8px; padding: 24px; border-radius: var(--radius); background: var(--brand); color: var(--brand-ink); }
.verdict-eyebrow { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; opacity: .8; }
.verdict-headline { font: 600 clamp(22px, 3.2vw, 34px)/1.18 var(--serif); letter-spacing: -0.02em; max-width: 40ch; }
.verdict-headline strong { color: var(--hl); font-weight: 600; }
.verdict-note { margin: 0; font-size: 15px; opacity: .9; max-width: 72ch; }
@media (max-width: 720px) { .verdict { padding: 18px; } }
.verdict { position: relative; overflow: hidden; }
.verdict-art { position: absolute; right: 24px; bottom: 18px; width: 150px; opacity: .95; }
.verdict-headline, .verdict-note { position: relative; max-width: min(40ch, calc(100% - 170px)); }
.verdict-note { max-width: min(72ch, calc(100% - 170px)); }
@media (max-width: 720px) {
  .verdict-art { position: static; width: 72px; order: -1; margin-bottom: 2px; }
  .verdict-headline, .verdict-note { max-width: none; }
}
/* Compare table (Figma: Compare table — Desktop / Mobile) */
.compare-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ct-row { display: grid; grid-template-columns: 240px repeat(var(--cols), minmax(0, 1fr)); gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.ct-row:last-child { border-bottom: 0; }
.ct-label { display: grid; gap: 2px; align-content: start; }
.ct-label b { font-size: 14px; font-weight: 600; }
.ct-label span:not(.label) { font-size: 12px; color: var(--muted); }
.ct-cell { display: grid; gap: 4px; align-content: start; min-width: 0; }
.ct-head { position: sticky; top: var(--header-h); z-index: 2; background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; }
.ct-car { display: flex; align-items: center; gap: 8px; }
.ct-car b { font-size: 16px; }
.ct-engine { font-size: 12px; color: var(--muted); }
.ct-big { font: 600 24px/1.1 var(--serif); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.ct-total .ct-big { font-size: 28px; }
.ct-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-text { font-weight: 500; }
.ct-sub { font-size: 13px; color: var(--muted); }
.tone-good { color: var(--good); font-weight: 600; }
.tone-warn { color: var(--warn); font-weight: 600; }
.tone-bad { color: var(--bad); font-weight: 600; }
.tone-neutral { color: var(--muted); font-weight: 600; }
@media (max-width: 720px) {
  .ct-row { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px 12px; padding: 12px; }
  .ct-row .ct-label { grid-column: 1 / -1; }
  .ct-label span:not(.label):not(:has(.ct-key)):not(.ct-key) { display: none; }
  .ct-head .ct-label { display: none; }
  .ct-head { box-shadow: 0 6px 12px -10px rgb(0 0 0 / .3); }
  .ct-car b { font-size: 14px; }
  .ct-big, .ct-total .ct-big { font-size: 22px; }
}

/* Visuals: car art, bars, mini meter, risk icons */
.ct-art { width: 72px; margin-bottom: 4px; }
.ct-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.ct-bar { display: block; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin: 4px 0 2px; }
.ct-bar span { display: block; height: 100%; border-radius: 4px; background: var(--c); }
.ct-bar.light span { background: color-mix(in srgb, var(--c) 45%, var(--surface-2)); }
.ct-stack { display: flex; gap: 2px; height: 12px; margin: 6px 0 2px; min-width: 24px; }
.ct-stack span { border-radius: 3px; min-width: 2px; }
.ct-stack .rep { background: var(--c); }
.ct-stack .fuel { background: color-mix(in srgb, var(--c) 40%, var(--surface-2)); }
.ct-score { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mini-meter { position: relative; display: block; height: 6px; border-radius: 3px; margin: 8px 6px 4px 0; max-width: 180px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--bad) 35%, var(--surface-2)), var(--surface-2) 50%, color-mix(in srgb, var(--good) 35%, var(--surface-2))); --pc: var(--muted); }
.mini-meter.tone-good { --pc: var(--good); } .mini-meter.tone-warn { --pc: var(--warn); } .mini-meter.tone-bad { --pc: var(--bad); }
.mm-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: var(--muted); opacity: .4; }
.mm-pin { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--pc); transform: translate(-50%, -50%); }
.ct-risk { display: flex; align-items: flex-start; gap: 8px; }
.ct-risk > span { display: grid; }
.ct-risk .icon { width: 22px; height: 22px; margin-top: 1px; }
.ct-risk.tone-warn .icon { color: var(--warn); }
.ct-risk.tone-good .icon { color: var(--good); }
.ct-risk.tone-warn .ct-val, .ct-risk.tone-good .ct-val { color: var(--text); font-weight: 500; }
@media (max-width: 720px) {
  .ct-art { width: 52px; }
  .ct-risk .icon { width: 18px; height: 18px; }
}

/* Price rows */
.ct-stack .lost, .ct-bar.lost span, .ct-key .k-lost {
  background: repeating-linear-gradient(135deg, var(--c, var(--muted)) 0 3px, color-mix(in srgb, var(--c, var(--muted)) 50%, var(--surface)) 3px 6px);
}
.ct-bar.neutral span { background: color-mix(in srgb, var(--text) 55%, var(--surface-2)); }
.ct-key { display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ct-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; --c: var(--muted); }
.ct-key i:not(:first-child) { margin-left: 6px; }
.ct-key .k-rep { background: var(--muted); }
.ct-key .k-fuel { background: color-mix(in srgb, var(--muted) 40%, var(--surface-2)); }
.price-source { display: inline-flex; width: fit-content; margin-top: 2px; font-size: 11px; font-weight: 600; letter-spacing: .02em; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.price-source.marketcheck { background: var(--brand-soft); color: var(--brand); }
@media (max-width: 720px) {
  .ct-row:has(.ct-key) .ct-label span.ct-key { display: flex !important; }
}
.ct-unrated { color: var(--muted); font-style: italic; }
/* Score meter (Figma: Score meter — Good / Average / Poor) */
.score-meter { display: grid; gap: 8px; --pc: var(--muted); }
.score-meter.tone-good { --pc: var(--good); }
.score-meter.tone-warn { --pc: var(--warn); }
.score-meter.tone-bad { --pc: var(--bad); }
.sm-top { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sm-num { font: 600 36px/1 var(--serif); letter-spacing: -0.02em; }
.sm-of { color: var(--muted); font-size: 14px; }
.sm-label { color: var(--pc); font-weight: 600; font-size: 14px; margin-left: 4px; }
.sm-track { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); margin: 4px 0; }
.sm-mid { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; border-radius: 1px; background: var(--muted); opacity: .4; }
.sm-pin { position: absolute; top: 50%; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 4px solid var(--pc); transform: translate(-50%, -50%); }
.sm-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.sm-context { margin: 0; font-size: 12px; color: var(--muted); }
/* Cost split bar (Figma: Cost split bar) */
.cost-split { display: grid; gap: 8px; }
.cs-bar { display: flex; gap: 2px; height: 10px; }
.cs-bar span { border-radius: 3px; }
.cs-rep { background: var(--c); }
.cs-fuel { background: color-mix(in srgb, var(--c) 30%, var(--surface-2)); }
.cs-bar .cs-fuel { flex: 1; }
.cs-keys { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
.cs-key { display: inline-flex; align-items: center; gap: 6px; }
.cs-key i { width: 10px; height: 10px; border-radius: 3px; }
.cs-key b { color: var(--text); font-variant-numeric: tabular-nums; }
/* Cost chart (Figma: Cost chart) */
.cost-chart { padding: 20px 20px 16px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .grid line.base { stroke: var(--muted); stroke-opacity: .5; }
.chart text { fill: var(--muted); font: 12px var(--sans); font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 16px; height: 3px; border-radius: 2px; background: var(--c); }
/* Per-car breakdown (Score meter + Cost split bar + categories + recalls) */
.car-details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.car-details summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.car-details summary::-webkit-details-marker { display: none; }
.car-details summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; color: var(--muted); }
.car-details[open] summary::after { content: "–"; }
.cd-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding: 4px 18px 20px; }
.cd-block { display: grid; gap: 8px; align-content: start; }
.cd-total { margin: 0; font: 600 28px/1.1 var(--serif); }
.cats { display: grid; gap: 9px; }
.cat { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 14px; }
.cat b { font-variant-numeric: tabular-nums; }
.cat .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.cat .bar span { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.recall { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.recall b { display: block; }
.recall p { margin: 2px 0 4px; color: var(--muted); }
.recalls .fine { margin-top: 8px; }
.cd-art { width: 44px; }
.cat-name { display: inline-flex; align-items: center; gap: 8px; }
.cat-name .icon { width: 18px; height: 18px; }
/* Best & worst cars (Figma: Tab + Ranking row) */
.rankings { display: grid; gap: 16px; justify-items: start; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; max-width: 100%; overflow-x: auto; }
.tab { border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tab[aria-selected=true] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.rank-switch { display: none; }
.rank-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; }
.rank-card { padding: 8px 20px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.rank-card h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 12px 0 4px; }
.rank-card h3 i { width: 8px; height: 8px; border-radius: 50%; }
.rank-card-best h3 i { background: var(--good); }
.rank-card-worst h3 i { background: var(--bad); }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { display: grid; grid-template-columns: 28px 1fr 72px auto; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.rank-row:first-child { border-top: 0; }
.rank-n { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-name { min-width: 0; display: grid; gap: 2px; }
.rank-name b { font-weight: 600; line-height: 1.3; }
.rank-name span { color: var(--muted); font-size: 12px; }
.rank-score { display: grid; gap: 4px; }
.rs-num { font: 600 20px/1 var(--serif); font-variant-numeric: tabular-nums; }
.rs-bar { height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.rs-bar span { display: block; height: 100%; }
.rank-best .rs-bar span { background: var(--good); }
.rank-worst .rs-bar span { background: var(--bad); }
@media (max-width: 720px) {
  .tabs { width: calc(100% + 32px); margin: 0 -16px; border-radius: 0; padding: 4px 16px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; padding: 8px 12px; font-size: 13px; }
  .rank-switch { display: flex; gap: 4px; }
  .rank-switch button { border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
  .rank-switch button[aria-pressed=true] { color: var(--text); background: var(--surface-2); }
  .rank-cols { grid-template-columns: 1fr; }
  .rank-cols[data-show=best] .rank-card-worst, .rank-cols[data-show=worst] .rank-card-best { display: none; }
  .rank-card { padding: 4px 14px; }
  .rank-card h3 { display: none; }
  .rank-all h3 { display: block; }
  .rank-row { grid-template-columns: 1fr 44px auto; gap: 10px; }
  .rank-n { display: none; }
}
.rank-row { grid-template-columns: 28px 44px 1fr 72px auto; }
.rank-art { width: 44px; opacity: .9; }
@media (max-width: 720px) {
  .rank-row { grid-template-columns: 36px 1fr 44px auto; }
  .rank-art { width: 36px; }
}
.rank-row { grid-template-columns: 28px 64px 1fr 72px auto; }
.rank-row .car-photo-thumb { width: 64px; }
@media (max-width: 720px) {
  .rank-row { grid-template-columns: 56px 1fr 40px auto; gap: 10px; }
  .rank-row .car-photo-thumb { width: 56px; }
}
/* Accordion item (Figma: Accordion item — Closed / Open) */
.accordion { border-bottom: 1px solid var(--line); }
.accordion summary { position: relative; padding: 16px 36px 16px 0; font-weight: 600; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 22px; font-weight: 400; color: var(--muted); }
.accordion[open] summary::after { content: "–"; }
.accordion p { color: var(--muted); margin: 0 0 16px; max-width: 65ch; }
/* Quick pick chip (Figma: Quick pick chip) */
.quick-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.qp-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-right: 4px; }
.qp-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.qp-chip small { color: var(--muted); font-weight: 500; font-size: 12px; }
.qp-chip:hover { border-color: var(--brand); background: var(--brand-soft); }
.qp-art { width: 34px; }
@media (max-width: 720px) {
  .quick-picks { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
  .quick-picks::-webkit-scrollbar { display: none; }
  .qp-label { display: none; }
  .qp-chip { flex: none; }
}
/* Answer bar (Figma: Answer bar) — phones only */
.answer-bar { display: none; }
@media (max-width: 720px) {
  .answer-bar:not([hidden]) {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px;
    background: var(--brand); color: var(--brand-ink); text-decoration: none; box-shadow: 0 10px 30px -8px rgb(0 0 0 / .45);
    animation: ab-in .2s ease-out;
  }
  .ab-text { font-weight: 600; font-size: 14px; line-height: 1.3; }
  .ab-go { display: inline-flex; align-items: center; gap: 4px; flex: none; font-size: 13px; font-weight: 600; color: var(--hl); }
  .ab-go .icon { width: 16px; height: 16px; }
  @keyframes ab-in { from { transform: translateY(20px); opacity: 0; } }
}
/* Hero (Figma: Hero) — search-first, centred */
.hero { position: relative; padding: 56px 0 0; background:
  radial-gradient(1200px 380px at 50% -40px, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%), var(--bg); }
.hero-inner { display: grid; justify-items: center; text-align: center; gap: 14px; }
.hero h1 { font-size: clamp(34px, 5.6vw, 60px); line-height: 1.04; max-width: 17ch; }
.hero .hl { color: var(--brand); background: linear-gradient(transparent 68%, color-mix(in srgb, var(--hl) 55%, transparent) 68% 92%, transparent 92%); padding: 0 .05em; }
.hero .lede { max-width: 54ch; margin: 0 auto; }
.hero-search { width: min(680px, 100%); margin-top: 10px; text-align: left; }
.hero .quick-picks { justify-content: center; margin: 2px 0 0; }
.hero .intro-points { justify-content: center; margin-top: 4px; }

@media (max-width: 860px) {
  .hero { padding-top: 32px; }
}
@media (max-width: 720px) {
  .hero .intro-points { display: none; }
  .hero .quick-picks { justify-content: flex-start; width: calc(100% + 32px); }
}
/* Search box, large variant (Figma: Search box — Large) */
.search-lg .search-field { padding: 6px 6px 6px 18px; border-radius: 16px; background: var(--surface); border: 1.5px solid var(--line); box-shadow: 0 10px 30px -12px rgb(20 30 25 / .25); }
.search-lg .search-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent), 0 10px 30px -12px rgb(20 30 25 / .25); }
.search-lg .search-icon { width: 22px; height: 22px; }
.search-lg .search-input { font-size: 17px; padding: 12px 4px; }
.search-lg .suggestions { top: 66px; }
.search-lg .search-hint { text-align: center; }
.search-go { flex: none; border-radius: 12px; }
@media (max-width: 720px) {
  .search-lg .search-input { font-size: 16px; }
  .search-go { padding: 0 14px; }
}
/* Browse by type (Figma: Type card) */
.browse { padding: 40px 0 8px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-title h2 { font-size: 24px; }
.section-title a { font-weight: 600; font-size: 14px; text-decoration: none; }
.type-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (min-width: 721px) { .type-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); } }
.type-card {
  display: grid; justify-items: start; gap: 4px; padding: 18px 18px 16px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.type-card:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 14px 30px -18px rgb(20 30 25 / .4); }
.tc-art { width: 120px; margin: 0 0 8px -4px; }
.tc-name { font: 600 22px/1.1 var(--serif); }
.tc-blurb { font-size: 13px; color: var(--muted); }
.tc-best { font-size: 14px; margin-top: 6px; }
.tc-go { font-size: 14px; font-weight: 600; color: var(--brand); margin-top: 4px; }
@media (max-width: 720px) {
  .type-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .type-cards::-webkit-scrollbar { display: none; }
  .type-card { scroll-snap-align: start; }
  .tc-art { width: 96px; }
}
@media (prefers-reduced-motion: reduce) { .type-card { transition: none; } .type-card:hover { transform: none; } }
/* Summary card (Figma: Summary card) */
.summary-cards { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; }
.summary-card { position: relative; display: grid; gap: 4px; align-content: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.summary-card.is-best { border: 2px solid var(--brand); padding: 17px; }
.sc-ribbon { position: absolute; top: -12px; left: 16px; padding: 3px 10px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sc-art { width: 84px; }
.sc-name { margin: 0; font-size: 17px; }
.sc-label { margin: 8px 0 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sc-big { margin: 0; font: 600 34px/1.05 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.sc-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 20px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.sc-facts div { display: grid; gap: 1px; }
.sc-facts dt { font-size: 12px; color: var(--muted); }
.sc-facts dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-facts small { font-weight: 500; color: var(--muted); }
.sc-source { margin: 8px 0 0; font-size: 11px; color: var(--muted); }
.results-sub { font: 600 18px var(--sans); margin: 10px 0 -4px; }
@media (max-width: 720px) {
  .summary-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; margin: 0 -16px; padding: 14px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .summary-cards::-webkit-scrollbar { display: none; }
  .summary-card { scroll-snap-align: start; }
  .summary-cards[style*="--n:1"] { grid-auto-columns: 100%; }
}
/* Buy rating (Figma: Buy rating) — colour-coded verdict pill */
.buy-rating { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 3px 9px 3px 6px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.buy-rating .icon { width: 14px; height: 14px; }
.br-great { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.br-good { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.br-fair { background: color-mix(in srgb, var(--warn) 16%, transparent); color: #8a3d07; }   /* darker than --warn: 4.5:1 on the tint */
.br-poor { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.rank-name .buy-rating { margin-top: 4px; }
.br-none { background: var(--surface-2); color: var(--muted); }
/* Tab bar (Figma: Tab bar) — phones only */
.tab-bar { display: none; }
@media (max-width: 720px) {
  .tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px -14px rgb(0 0 0 / .25);
  }
  .tab-bar a { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; min-height: 52px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
  .tab-bar a .icon { width: 24px; height: 24px; }
  .tab-bar a[aria-current] { color: var(--brand); background: var(--brand-soft); }
  .tb-count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 11px; line-height: 18px; text-align: center; }
  body.has-tab-bar { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  /* The verdict bar floats just above the tab bar */
  body.has-tab-bar .answer-bar:not([hidden]) { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* The tab bar's Search replaces the header button on phones */
  .site-header [data-start-comparing] { display: none; }
}
/* Car photo (Figma: Car photo) */
.car-photo { position: relative; margin: 0; overflow: hidden; background: var(--surface-2); border-radius: 12px; }
.car-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.car-photo.is-art { display: grid; place-items: center; }
.car-photo.is-art .car-art { width: 72%; }
.car-photo-card { aspect-ratio: 16 / 10; width: 100%; }
.car-photo-hero { aspect-ratio: 4 / 3; width: 100%; border-radius: 18px; }
.car-photo-thumb { width: 64px; aspect-ratio: 4 / 3; flex: none; border-radius: 8px; }
.car-photo figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px;
  padding: 18px 8px 5px; font-size: 10.5px; line-height: 1.25; color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / .55));
}
.cp-year { font-weight: 600; }
.cp-credit { margin-left: auto; color: rgb(255 255 255 / .85); text-decoration: none; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
a.cp-credit { display: inline-flex; align-items: center; min-height: 24px; margin-bottom: -5px; }   /* big enough to tap */
.cp-credit:hover { color: #fff; text-decoration: underline; }

/* Placement */
.slot .car-photo-card { aspect-ratio: 16 / 9; }
.summary-card > .car-photo { margin: -18px -18px 10px; width: calc(100% + 36px); border-radius: 19px 19px 0 0; }
.summary-card.is-best > .car-photo { margin: -17px -17px 10px; width: calc(100% + 34px); }
.type-card > .car-photo { margin: -18px -18px 12px; width: calc(100% + 36px); border-radius: 19px 19px 0 0; }
.ct-cell > .car-photo-thumb { width: min(100%, 180px); margin-bottom: 6px; }
.suggestions .car-photo-thumb { width: 52px; grid-row: span 2; }
.rank-row .car-photo-thumb { width: 56px; }
.car-details summary .car-photo-thumb { width: 56px; }
.qp-chip .car-photo-thumb { width: 40px; aspect-ratio: 1; border-radius: 50%; }
.qp-chip { padding-left: 4px; }
.verdict-photo { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 170px; }
.verdict-photo .car-photo-thumb { width: 100%; border-radius: 14px; box-shadow: 0 10px 30px -10px rgb(0 0 0 / .45); border: 3px solid rgb(255 255 255 / .9); }
@media (max-width: 720px) {
  .verdict-photo { position: static; transform: none; width: 96px; order: -1; }
  .ct-cell > .car-photo-thumb { width: 100%; }
}
.summary-card > .car-photo { aspect-ratio: 16 / 8; }
.slot .car-photo-card { aspect-ratio: 16 / 8; }
.sc-ribbon { z-index: 2; }
/* Hero photos (Figma: Hero photos) */
.hero-photos { max-width: 1120px; margin: 32px auto 0; padding: 0 16px 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.hp-tile { position: relative; }
.hp-tile .car-photo { box-shadow: 0 18px 40px -22px rgb(20 30 25 / .5); }
/* Credit along the top edge, clear of the info card at the bottom */
.hp-tile .car-photo figcaption { top: 0; bottom: auto; padding: 4px 10px; background: none; align-items: flex-start; }
.hp-tile .cp-credit { margin-bottom: 0; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }
.hp-info {
  position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  padding: 10px 12px; text-align: left; cursor: pointer; border: 0; border-radius: 14px;
  background: rgb(255 255 255 / .94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 8px 20px -10px rgb(0 0 0 / .35);
}
.hp-kind { grid-column: 1; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.hp-info b { grid-column: 1; font-size: 15px; }
.hp-info .buy-rating { grid-column: 2; grid-row: 1; justify-self: end; }
.hp-go { grid-column: 2; grid-row: 2; justify-self: end; font-size: 13px; font-weight: 700; color: var(--brand); }
.hp-info:hover .hp-go { text-decoration: underline; }
@media (max-width: 720px) {
  .hero-photos { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 82%; overflow-x: auto; margin-top: 22px; padding: 0 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hero-photos::-webkit-scrollbar { display: none; }
  .hp-tile { scroll-snap-align: center; }
}
/* Where to buy (Figma: Where to buy) */
.where-to-buy { padding: 20px; display: grid; gap: 14px; scroll-margin-top: calc(var(--header-h) + 12px); }
.wtb-head h3 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0; }
.wtb-head h3 .icon { color: var(--brand); }
.wtb-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.wtb-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.wtb-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.wtb-form input, .wtb-form select { font-size: 16px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); min-height: 44px; }
.wtb-zip input { width: 130px; font-variant-numeric: tabular-nums; }
.wtb-form input:focus, .wtb-form select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.wtb-msg { margin: 0; font-size: 13px; color: var(--muted); min-height: 1em; }
.wtb-msg.err { color: var(--bad); font-weight: 600; }
.wtb-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.wtb-results:empty { display: none; }
.wtb-car { display: grid; gap: 10px; align-content: start; padding: 14px; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--radius-sm); background: var(--surface); }
.wtb-car h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 15px; }
.wtb-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--good); }
.wtb-list { list-style: none; margin: 0; padding: 0; display: grid; }
.wtb-list li + li { border-top: 1px solid var(--line); }
.wtb-list a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; text-decoration: none; color: var(--text); }
.wtb-list a:hover b { color: var(--brand); text-decoration: underline; }
.wl-dealer, .wl-car { display: grid; gap: 1px; font-size: 14px; }
.wl-dealer span, .wl-car span { font-size: 12px; color: var(--muted); }
.wl-car { text-align: right; font-variant-numeric: tabular-nums; }
.wtb-list .none { padding: 8px 0; font-size: 13px; color: var(--muted); }
.wtb-links { display: flex; flex-wrap: wrap; gap: 8px; }
.wtb-links .icon.ext { width: 14px; height: 14px; transform: rotate(-135deg); }
.sc-buy { margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--brand); text-decoration: none; }
.sc-buy:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .where-to-buy { padding: 16px; }
  .wtb-form { display: grid; grid-template-columns: 1fr 1fr; }
  .wtb-zip input { width: 100%; }
  .wtb-form .btn { grid-column: 1 / -1; }
}
/* Partner links (Figma: Partner links) — history report, insurance, loans */
.sc-partners { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 6px 0 0; font-size: 13px; }
.sc-partners a { color: var(--muted); }
.sc-partners a:hover { color: var(--brand); }
.sc-partners span { color: var(--line); }
.partner-disclosure { margin: -4px 0 0; font-size: 12px; }
.partner-history { font-weight: 600; }
.slot-history { margin: 8px 0 0; font-size: 14px; }
.slot-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; }
.search-hint .partner-history { white-space: nowrap; }
/* Report sign-up (Figma: Report sign-up) — email capture for the PDF report */
.report-signup { padding: 18px; display: grid; gap: 12px; border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.rs-head { display: flex; gap: 12px; align-items: flex-start; }
.rs-head h3 { margin: 0 0 2px; font: 600 20px/1.2 var(--serif); }
.rs-head p { margin: 0; color: var(--muted); font-size: 14px; }
.rs-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); }
.rs-icon svg { width: 22px; height: 22px; }
.rs-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: end; }
.rs-email { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.rs-email input { min-height: 44px; padding: 0 12px; font: inherit; font-size: 16px; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rs-email input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.rs-consent { grid-column: 1 / -1; display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.rs-consent input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }
.rs-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.rs-msg { margin: 0; font-size: 14px; min-height: 0; }
.rs-msg:empty { display: none; }
.rs-msg.err { color: var(--bad); }
.rs-done { margin: 0; display: flex; gap: 8px; align-items: center; font-weight: 500; color: var(--good); }
.rs-done svg { width: 18px; height: 18px; flex: none; }
.rs-fine { font-size: 12.5px; }
@media (max-width: 560px) {
  .rs-form { grid-template-columns: 1fr; }
  .rs-form .btn { width: 100%; }
}