/* Import Car Hub design system - 2026 redesign.

   The look: a calm white page, one condensed display face (Archivo), cars
   and facts first, no decoration. Colour has jobs:
     --primary    the one brand colour (set per tenant in Admin). Main
                  actions and small accents only - never a large surface.
     --dark       warm near-black ink: the footer, the closing band, solid
                  buttons, selected filters and icons. Page tops are cream.
     --card-warm  cream: cards on white, and every other page section as a
                  full-width band (cards inside a band turn white).
     neutrals     everything else: text, borders.
   Four colours carry the whole site: ink, cream, white and --primary.
   Tenant branding injects --primary (and --secondary, which the design no
   longer uses). Do not hard-code a brand colour anywhere below.

   Main layout breakpoints:
     1040px  tablet: multi-column layouts collapse
      860px  small tablet: dashboard sidebar becomes a drawer
      680px  mobile: grids go single-column
   Component breakpoints also adapt filters, galleries and comparisons.
   CSS media queries require literal thresholds; design values live in :root. */

:root {
  --primary: #c62f25;
  --secondary: #14213f;
  --primary-soft: color-mix(in srgb, var(--primary) 10%, var(--surface));
  /* ---- Neutrals --------------------------------------------------------- */
  --page: var(--surface);      /* white page, warm editorial panels */
  --surface: #ffffff;
  --soft: #f4f3ef;          /* quiet bands: tools strip, spec tiles, table heads */
  --card-warm: #f3efe7;
  --card-warm-hover: #ebe5da;
  --ink: #1b1417;           /* headings and body text: a warm near-black */
  --dark: var(--ink);       /* heroes, footer, dark bands, solid buttons */
  --card: var(--card-warm); /* card surface; white inside a cream band */
  --ink-soft: #3b3f46;      /* lead text and descriptions */
  --muted: #5d6168;         /* captions, labels: 6.1:1 on white */
  --line: #e4e3de;          /* hairlines and card borders */
  --line-strong: #c9c8c1;   /* inputs */
  --ink-on-dark: #d5d9e3;   /* body text on --dark surfaces */
  --good: #11804a;
  --good-soft: #e8f6ee;
  --warn: #a35e07;
  --warn-soft: #fff4df;
  --bad: #c42323;
  --bad-soft: #ffeded;
  --info: #1d5fc4;
  --info-soft: #eaf2ff;
  /* ---- Shape: near-square corners, pills and circles. ---------------------------------------- */
  --radius-sm: 4px;      /* buttons, inputs, chips, tags, thumbnails */
  --radius: 4px;        /* cards, panels, media */
  --pill: 999px;         /* count bubbles and section links */
  --round: 50%;          /* circles: save heart, avatars */
  /* ---- Elevation. Flat by default; shadows only on things that float or
     respond to hover. --------------------------------------------------- */
  --shadow: 0 8px 22px rgba(20, 33, 63, .12);       /* hover, popovers */
  --shadow-panel: none;                         /* flat search panels */
  --shadow-up: 0 -6px 20px rgba(20, 22, 26, .12);   /* bars fixed to the bottom */
  --ring: 0 0 0 3px color-mix(in srgb, var(--dark) 25%, transparent); /* focus */
  /* ---- Layout ------------------------------------------------------------ */
  --maxw: 1300px;
  --gutter: clamp(16px, 4vw, 40px);
  /* Full-bleed bands line their content up with the page container. */
  --bleed-pad: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
  /* Five spacing steps. Names are the actual pixel values, not aliases. */
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-48: 48px;
  --gap: var(--space-24);                            /* default grid gutter */
  --section-gap: clamp(var(--space-24), 4vw, var(--space-48));         /* between page sections */
  --card-pad: var(--space-16);
  --card-pad-lg: var(--space-24);
  /* ---- Type: one main family, six sizes, four weights, four line heights.
     Nothing outside :root may use
     a raw font-size, font-weight, line-height or letter-spacing. --------- */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --stretch-display: 68%;   /* condensed cut for headings, prices, wordmark */
  --text-sm: .875rem;       /* 14px: all metadata, labels and small controls */
  --text-md: 1.125rem;      /* 18px: body and lead text */
  --display: clamp(2.5rem, 1.6rem + 3vw, 4rem);            /* page and section headings */
  --display-hero: clamp(3rem, 1.5rem + 5.5vw, 5.5rem);     /* page titles and heroes */
  --card-title: 1.75rem;    /* 28px: card titles, prices, small headings */
  --weight-regular: 400;
  --weight-medium: 600;    /* navigation, labels and controls */
  --weight-section: 800;   /* H2 section headings */
  --weight-display: 900;   /* headings and prices */
  --leading-display: .92;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  --tracking-display: -.005em;
  --word-gap-display: .06em;
  --tracking-caps: .06em;    /* number plates, uppercase labels */
  /* aliases used by older components */
  /* Fixed colour roles: contrast, number plates and translucent overlays. */
  --black: #000;
  --plate-yellow: #f4c542;
  --plate-blue: #003399;
  --plate-placeholder: rgba(17, 17, 17, .48);
  --on-dark-line: rgba(255,255,255,.12);
  --on-dark-hover: rgba(255,255,255,.08);
  --on-dark-badge: rgba(255, 255, 255, .22);
  --overlay-filter: rgba(10, 16, 32, .5);
  --overlay-control: rgba(10, 16, 32, .55);
  --overlay-control-hover: rgba(10, 16, 32, .8);
  --overlay-caption: rgba(10, 16, 32, .65);
  --overlay-lightbox: rgba(10, 16, 32, .94);
  --overlay-modal: rgba(10, 16, 32, .62);
  --overlay-sidebar: rgba(10, 16, 32, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* clip, not hidden: stops a full-bleed band widening the page without
     turning the body into a scroll container (which breaks position:sticky). */
  overflow-x: clip;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
/* The hidden attribute must win over any author display rule. */
[hidden] { display: none !important; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: var(--leading-display); }
h1, h2 { font-stretch: var(--stretch-display); letter-spacing: var(--tracking-display); font-weight: var(--weight-display); word-spacing: var(--word-gap-display); line-height: var(--leading-display); }
h1 { font-size: var(--display); }
h2 { font-size: var(--card-title); }
h3 { font-size: var(--card-title); font-weight: var(--weight-display); line-height: var(--leading-snug); }
h4 { font-size: var(--text-md); font-weight: var(--weight-display); }
p { margin-bottom: var(--space-16); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.muted { color: var(--muted); }
.faint { color: color-mix(in srgb, var(--muted) 70%, var(--surface)); }
.sub { color: var(--ink-soft); font-size: var(--text-md); line-height: var(--leading-snug); }
.compact { margin: 0; }
.mt-sm { margin-top: var(--space-8); }
.mt-md { margin-top: var(--space-16); }
.mb-md { margin-bottom: var(--space-16); }
.stack { display: grid; gap: var(--space-12); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
.action-row { display: flex; align-items: center; gap: var(--space-12); flex-wrap: wrap; }
.form-narrow { width: min(100%, 560px); }
.section-code { display: block; white-space: pre-wrap; padding: var(--space-12); line-height: var(--leading-relaxed); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.content-section { margin-bottom: var(--section-gap); }

/* ---- Buttons: TWO styles only, one shape ---------------------------------
   .btn           Secondary: solid ink, white text. Everything that is not
                  the main action.
   .btn-primary   Primary: solid --primary, white text. The main action in a
                  section (at most one per section).
   .is-active     A toggled button (Saved, Selected) takes the primary look.
   Sizes: default (48px) and .btn-sm for dense rows. Width: .btn-block.
   On a dark band the secondary button turns white so it stays visible.
   Do not add other variants. */
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-24);
  border: 2px solid var(--dark);
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: var(--surface);
  font: inherit;
  font-weight: var(--weight-medium);
  line-height: var(--leading-display);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover {
  background: color-mix(in srgb, var(--dark) 80%, var(--surface));
  border-color: color-mix(in srgb, var(--dark) 80%, var(--surface));
  color: var(--surface);
  text-decoration: none;
}
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--dark) 40%, transparent); outline-offset: 2px; }
.btn-primary,
.btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--surface);
}
.btn-primary:hover,
.btn.is-active:hover {
  background: color-mix(in srgb, var(--primary) 86%, var(--black));
  border-color: color-mix(in srgb, var(--primary) 86%, var(--black));
  color: var(--surface);
}
.btn-sm { min-height: 40px; padding: var(--space-8) var(--space-16); font-size: var(--text-sm); }
.btn-block { width: 100%; }

/* On a dark band the secondary button is white. */
:is(.closing-cta, .site-footer) .btn:not(.btn-primary) {
  background: var(--surface);
  border-color: var(--surface);
  color: var(--dark);
}
:is(.closing-cta, .site-footer) .btn:not(.btn-primary):hover {
  background: var(--card);
  border-color: var(--card-warm);
  color: var(--dark);
}
/* ---- Forms -------------------------------------------------------------- */
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-8) var(--space-12);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--dark);
  box-shadow: var(--ring);
}
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--dark);
}
label {
  display: block;
  margin-bottom: var(--space-8);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.field { margin-bottom: var(--space-16); }
.inline-form { display: inline; }
.form-error,
.form-ok {
  margin: 0 0 var(--space-16);
  padding: var(--space-12);
  border-radius: var(--radius-sm);
  font-size: var(--text-md);
}
.form-error { border: 1px solid color-mix(in srgb, var(--bad) 25%, var(--surface)); background: var(--bad-soft); color: var(--bad); }
.form-ok { border: 1px solid color-mix(in srgb, var(--good) 25%, var(--surface)); background: var(--good-soft); color: var(--good); }

/* ---- Surfaces -------------------------------------------------------------
   One card: white, a hairline border, the standard radius, no shadow. */
.card,
.panel,
.panel-card,
.chart-card,
.live,
.auth-card,
.stat,
.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel-card { padding: var(--card-pad); position: relative; }
.panel,
.chart-card,
.live { padding: var(--card-pad); margin-bottom: var(--gap); }
.panel-head,
.dash-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  flex-wrap: wrap;
}
.panel-head { margin-bottom: var(--space-16); }
.panel-head > * { min-width: 0; }
.panel-head > .muted { overflow-wrap: anywhere; }
.panel-head h2 { font-size: var(--card-title); }
.dash-head { margin-bottom: var(--space-16); }
.section-head { align-items: flex-end; margin-bottom: var(--space-24); }
.section-head > div { display: grid; gap: var(--space-8); }
.section-head .eyebrow,
.section-head h2 { margin: 0; }
.section-head > div > .muted { margin: 0; }
.panel-head h2,
.dash-head h1,
.dash-head p,
.section-head h2 { margin-bottom: 0; }

/* A public page section: no box, just room. */
:is(.section-panel, .tool-section, .band) > .section-head {
  align-items: baseline;
  padding-bottom: var(--space-12);
  margin-bottom: var(--space-16);
  border-bottom: 1px solid var(--ink);
}
/* Every section heading on the public site is the same size. */
main.container .section-head h2,
.about-panel h2,
.split-row h2,
.closing-cta h2 { font-size: var(--display); }

.section-panel, .tool-section, .band { position: relative; margin-bottom: var(--section-gap); }

/* Page sections alternate: white, then a full-width cream band with the
   same padding every time. Cards inside a band turn white. */
:is(.section-panel, .tool-section, .band):nth-child(even of :is(.section-panel, .tool-section, .band):not([hidden])) {
  margin-inline: calc(50% - 50vw);
  padding: var(--section-gap) var(--bleed-pad);
  background: var(--card-warm);
  --card: var(--surface);
}

/* Small label above a heading. Sentence case, quiet. */
.eyebrow,
.card-kicker { margin: 0 0 var(--space-8); color: var(--primary); font-size: var(--text-sm); font-weight: var(--weight-display); }

/* Tags: small, square-ish, neutral. Colour variants keep their meaning. */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px var(--space-8);
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.badge.green { background: var(--good-soft); color: var(--good); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--bad-soft); color: var(--bad); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.fuel-electric { background: var(--good); color: var(--surface); }

/* ---- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.table-wrap + p { margin-top: var(--space-16); }
.table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: var(--text-sm); }
.table th,
.table td { text-align: left; padding: var(--space-12) var(--space-16); border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { background: var(--soft); color: var(--ink-soft); font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; white-space: nowrap; }
.table thead th.no-sort { cursor: default; }
.table tbody tr:hover { background: color-mix(in srgb, var(--dark) 4%, var(--surface)); }
.table tbody tr:last-child td { border-bottom: 0; }
.guide-admin-table tr.revision-child td { background: color-mix(in srgb, var(--info-soft) 42%, var(--surface)); }
.guide-admin-table tr.revision-child td:nth-child(2) { padding-left: calc(var(--space-16) + var(--space-16)); }
.guide-admin-table tr.revision-child td:nth-child(2)::before { content: "\21b3"; margin-left: calc(-1 * var(--space-16)); margin-right: var(--space-8); color: var(--dark); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.hl td { background: var(--info-soft); font-weight: var(--weight-medium); }
.table-tools { display: flex; gap: var(--space-12); align-items: center; margin-bottom: var(--space-12); flex-wrap: wrap; }
.table-tools input { max-width: 300px; }
th[data-dir="asc"]::after { content: " ^"; color: var(--muted); }
th[data-dir="desc"]::after { content: " v"; color: var(--muted); }

/* A code chip. */
.code-inline {
  display: inline-block;
  font-family: inherit;
  font-size: var(--text-sm);
  background: var(--soft);
  border-radius: var(--radius-sm);
  padding: 1px var(--space-8);
  overflow-wrap: anywhere;
}
td.code-inline,
th.code-inline {
  display: table-cell;
  background: none;
  border-radius: 0;
  padding: var(--space-12) var(--space-16);
  color: var(--muted);
}
.swatch-input { width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); vertical-align: middle; }

/* Segmented choice: pick one of two or three options (Manual / Automatic).
   Buttons inside; the chosen one has aria-pressed="true" and fills dark. */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 2px solid var(--dark); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.segmented button { min-height: 48px; padding: var(--space-12) var(--space-16); border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: var(--weight-medium); cursor: pointer; }
.segmented button + button { border-left: 2px solid var(--dark); }
.segmented button[aria-pressed="true"] { background: var(--dark); color: var(--surface); }
.segmented button:focus-visible { outline: 3px solid color-mix(in srgb, var(--dark) 40%, transparent); outline-offset: -3px; }

/* UK number plate. Yellow and blue are real plate colours, not theme colours. */
.reg-input {
  display: flex;
  align-items: stretch;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--plate-yellow);
}
.reg-input:focus-within { box-shadow: var(--ring); }
.reg-input-band {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-8);
  background: var(--plate-blue);
  color: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-display);
}
.reg-input-label { display: block; margin-bottom: var(--space-8); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.plate-input {
  flex: 1;
  min-width: 0;
  min-height: 64px;
  padding: var(--space-12) var(--space-16);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--card-title);
  font-weight: var(--weight-display);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}
.plate-input:focus { border: 0; box-shadow: none; }
.plate-input::placeholder { color: var(--plate-placeholder); }
.reg-input-sm { border-width: 2px; }
.reg-input-sm .plate-input { min-height: 40px; padding: var(--space-8) var(--space-12); font-size: var(--card-title); }
.reg-plate {
  justify-self: start;
  display: inline-block;
  padding: var(--space-8) var(--space-16);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--plate-yellow);
  color: var(--ink);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}
.reg-plate-small { font-size: var(--text-sm); padding: 2px var(--space-12); }

/* ==== Site header =========================================================== */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-24); padding-top: var(--space-12); padding-bottom: var(--space-12); }
.brand { display: inline-flex; align-items: center; min-height: 40px; gap: var(--space-8); color: var(--ink); font-size: var(--card-title); font-stretch: var(--stretch-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display); line-height: var(--leading-display); }
.brand:hover { text-decoration: none; }
.brand-lockup { display: inline-flex; align-items: center; min-height: 40px; gap: var(--space-12); flex: 0 0 auto; }
.brand-logo-box { display: inline-flex; align-items: center; justify-content: center; height: 38px; min-height: 38px; flex: 0 0 auto; }
/* "dark" logos are drawn in white, so they sit on their own brand colour. */
.tenant-logo-box { max-width: 160px; min-height: 44px; }
.platform-logo-box { min-height: 44px; }
.brand-logo-box.is-dark { padding: var(--space-8) var(--space-12); border-radius: var(--radius-sm); background: var(--primary); }
.platform-logo-box.is-dark,
.sidebar-platform-logo-box.is-dark { background: var(--platform-primary, var(--primary)); }
.avatar.has-logo.is-dark { background: var(--primary); border-color: transparent; }
.brand-logo { display: block; width: auto; height: auto; object-fit: contain; background: transparent; }
.tenant-logo-box .brand-logo { max-width: 160px; max-height: 40px; }
.platform-logo-box .brand-logo { max-width: 130px; max-height: 36px; }
.brand-divider { display: inline-flex; align-items: center; height: 38px; color: var(--line-strong); font-size: var(--card-title); line-height: var(--leading-display); }
.platform-brand { gap: var(--space-8); }
.tenant-brand { min-width: 0; }
.tenant-fallback { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-name { white-space: nowrap; }
.platform-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--dark);
  color: var(--surface);
  font-size: var(--text-sm);
  font-stretch: 100%;
}
.sidebar-platform-logo-box { width: auto; height: 32px; min-height: 32px; }
.sidebar-platform-brand .brand-logo { max-width: 130px; max-height: 28px; }
.sidebar-platform-brand { padding-bottom: var(--space-12) !important; }
.sidebar-tenant-brand { display: flex; align-items: center; gap: var(--space-8); margin: 0 var(--space-12) var(--space-8); padding: var(--space-8) 0 var(--space-12); border-bottom: 1px solid var(--on-dark-line); color: var(--surface); font-size: var(--text-md); font-weight: var(--weight-medium); }
.sidebar-tenant-brand .brand-logo { max-width: 100px; max-height: 32px; }

.nav-toggle { display: none; }
.hamburger { position: relative; width: 18px; height: 12px; display: inline-block; border-top: 2px solid currentColor; }
.hamburger::before,
.hamburger::after { content: ""; position: absolute; left: 0; width: 18px; border-top: 2px solid currentColor; }
.hamburger::before { top: 3px; }
.hamburger::after { top: 8px; }
.nav { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: var(--space-8) var(--space-16); flex-wrap: nowrap; }
.nav .inline-form { display: inline-flex; }
/* Nav links are plain text. Real .btn elements (Sign out) keep their style. */
.nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.nav a:hover { text-decoration: underline; text-underline-offset: 6px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; text-decoration-color: var(--primary); }
.nav .inline-form .btn { min-height: 40px; }

.breadcrumbs { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; margin: var(--space-16) 0 var(--space-16); color: var(--muted); font-size: var(--text-sm); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--ink); }
/* inline-block so a link's hover underline does not run under the "/". */
.breadcrumbs > * + *::before { content: "/"; display: inline-block; margin-right: var(--space-8); color: var(--line-strong); }

/* ==== Page heads ===========================================================
   Three kinds, and only three:
   .home-hero    full-width cream band; headline left, a white search panel
                 right. Home page only.
   .tool-hero    full-width cream band; copy left, a white calculator panel
                 right. Tool pages.
   .hero /
   .browse-head  editorial: a compact heading on a cream band. Every other
                 page (browse, saved, guides, directory, tools index). */

.hero h1,
.browse-head h1 { margin: 0 0 var(--space-12); max-width: 22ch; font-size: var(--display-hero); }
.hero .sub,
.browse-head .sub { max-width: 60ch; margin: 0; }
.hero .eyebrow,
.browse-head .eyebrow { margin-bottom: var(--space-8); }
.hero .action-row { margin-top: var(--space-16); }
.hero form.action-row { width: min(100%, 640px); }
.hero form.action-row input { flex: 1 1 280px; min-width: 0; }
.browse-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-16) var(--space-48); align-items: end; }
.browse-head-compact { margin-bottom: var(--space-24); }
.hero-makes { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--space-8); max-width: 460px; }
.hero-makes span { width: 100%; text-align: right; color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.hero-panel { margin-top: var(--space-48); }
.hero-panel h1 { max-width: 22ch; }

/* Bands that run edge to edge, inside the page container. */
.home-hero,
.tool-hero {
  margin-inline: calc(50% - 50vw);
  padding-inline: var(--bleed-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 480px);
  gap: var(--space-24) var(--space-48);
  align-items: center;
  padding-block: var(--space-48);
  margin-bottom: var(--section-gap);
}

.home-hero { margin-top: 0; background: var(--card-warm); }
.home-hero-compact { padding-block: var(--space-24); }
.tool-hero { margin-top: var(--space-8); background: var(--card-warm); }
.home-hero h1 { max-width: 16ch; margin-bottom: var(--space-16); font-size: var(--display-hero); line-height: var(--leading-display); }
.tool-hero h1 { max-width: 18ch; margin-bottom: var(--space-16); }
.home-hero .sub,
.tool-hero .sub { max-width: 44ch; margin-bottom: 0; }
.tool-hero .sub + .sub { margin-top: var(--space-16); }
.home-hero-copy a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; }

/* Tick list in a band (tool heroes). */
.hero-checks { list-style: none; margin: var(--space-16) 0 0; padding: 0; display: grid; gap: var(--space-8); }
.hero-checks li { position: relative; padding-left: 30px; font-size: var(--text-md); }
.hero-checks li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: var(--round);
  background: var(--dark);
  color: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-display);
}

/* ---- The search / calculator panel on a band ----------------------------- */
.hero-search {
  display: grid;
  gap: var(--space-12);
  padding: var(--card-pad);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  background: var(--surface);
  color: var(--ink);
}
.hero-search h2 { margin: 0; font-size: var(--card-title); }
.hero-search-sub { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.hero-search-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
.hero-field { display: grid; gap: var(--space-8); min-width: 0; align-content: end; }
.hero-field label { margin: 0; }
.hero-field label span { font-weight: var(--weight-regular); }
.hero-search select,
.hero-search input { width: 100%; min-width: 0; min-height: 48px; }
.hero-search .hero-search-go { width: 100%; min-height: 48px; }
.home-hero-compact .hero-search-submit { grid-column: 1 / -1; }
.hero-quick { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8) var(--space-16); font-size: var(--text-sm); }
.hero-quick > span { color: var(--muted); }
.hero-quick a { text-decoration: underline; text-underline-offset: 3px; }
/* Plain-English search at the top of the hero panel (find.go). */
.hero-find-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); }
.hero-search .hero-find-row .btn { min-height: 48px; }
.hero-find-or { display: flex; align-items: center; gap: var(--space-12); margin: 0; color: var(--muted); font-size: var(--text-sm); }
.hero-find-or::before,
.hero-find-or::after { content: ""; flex: 1; border-top: 1px solid currentColor; opacity: .35; }
.tool-card-embed .tool-form { grid-template-columns: 1fr; max-width: none; }
.tool-card-embed .tool-divider { max-width: none; margin: var(--space-8) 0; }
.tool-card-embed .tool-result { max-width: none; margin-top: var(--space-8); padding: var(--space-16); }
.tool-card-embed .eyebrow { margin-bottom: 0; }
.tool-card-embed .tool-note { margin: var(--space-8) 0 0; font-size: var(--text-sm); color: var(--muted); }
.tool-card-embed > p[id$="LookupMsg"] { margin: 0; }
.tool-card-embed h2 { font-size: var(--card-title); }

/* ---- Trust strip: the white strip under the home hero ---------------------- */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-24) 0;
  margin: calc(var(--section-gap) * -1) calc(50% - 50vw) var(--section-gap);
  padding: var(--space-24) var(--bleed-pad);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.trust-strip li { min-width: 0; padding: 0 var(--space-24); border-left: 1px solid var(--line-strong); }
.trust-strip li:first-child { padding-left: 0; border-left: 0; }
.trust-strip svg { display: none; }
.trust-strip strong { display: block; margin-bottom: var(--space-8); font-size: var(--card-title); font-stretch: var(--stretch-display); font-weight: var(--weight-display); line-height: var(--leading-display); }
.trust-strip span { color: var(--ink-soft); }
.home-import-links a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--primary); text-decoration-thickness: 2px; text-underline-offset: 4px; }
@media (max-width: 720px) {
  .trust-strip li { padding: var(--space-16) 0 0; border-left: 0; border-top: 1px solid var(--line-strong); }
  .trust-strip li:first-child { padding-top: 0; border-top: 0; }
}

/* Home sections share the same heading scale and warm card surfaces. */

/* Tools: flat warm panels with a title, description and arrow. */
.tool-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 var(--space-48); margin: 0; padding: 0; list-style: none; }
.tool-list a { display: flex; justify-content: space-between; gap: var(--space-16); height: 100%; padding: var(--space-16) 0; border-top: 1px solid var(--line-strong); color: var(--ink); }
.tool-list a:hover { text-decoration: none; }
.tool-list a:hover strong { text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 4px; }
.tool-list strong { display: block; font-size: var(--card-title); font-weight: var(--weight-display); line-height: var(--leading-display); font-stretch: var(--stretch-display); }
.tool-list .tool-soon { display: inline-block; white-space: nowrap; margin-left: var(--space-8); color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.tool-list a > div > span { display: block; margin-top: var(--space-8); color: var(--ink-soft); }

/* ---- Directory teaser / wide call-out: one white panel -------------------- */
.split-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-16) var(--space-48);
}
.split-row > div { flex: 1 1 420px; }
.split-row h2 { margin-bottom: var(--space-8); }
.split-row .sub { margin: 0; max-width: 62ch; font-size: var(--text-md); }

/* ---- Closing call-out (tool pages) ---------------------------------------- */
.closing-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--gap);
  align-items: center;
  margin: 0 calc(50% - 50vw) var(--section-gap);
  padding: var(--section-gap) var(--bleed-pad);
  color: var(--surface);
  background: var(--dark);
}
.closing-cta h2,
.closing-cta .sub,
.closing-cta .eyebrow { color: var(--surface); }
.closing-cta .eyebrow { opacity: .8; }
.closing-cta h2 { margin-bottom: var(--space-8); }
.closing-cta .sub { max-width: 680px; margin-bottom: 0; font-size: var(--text-md); }

/* ==== Footer ================================================================ */
.site-footer {
  margin-top: var(--section-gap);
  padding: var(--space-48) 0;
  background: var(--dark);
  color: var(--ink-on-dark);
}
.site-footer a { color: var(--surface); }
.site-footer strong { color: var(--surface); }
.footer-inner > div:first-child strong { font-size: var(--card-title); font-stretch: var(--stretch-display); }
.footer-inner { display: grid; gap: var(--space-16); }
.footer-inner > div,
.footer-links { display: flex; gap: var(--space-8) var(--space-24); flex-wrap: wrap; align-items: baseline; }
.footer-disclaimer { max-width: 80ch; margin: 0; }
.footer-company-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-8) var(--space-16); padding-top: var(--space-16); border-top: 1px solid color-mix(in srgb, var(--surface) 16%, transparent); color: color-mix(in srgb, var(--ink-on-dark) 80%, var(--dark)); line-height: var(--leading-relaxed); }
.footer-company-heading { color: var(--surface); }
/* A tool hero with no calculator beside it (auction decoder). */
.tool-hero:not(:has(.hero-search)) { grid-template-columns: minmax(0, 1fr); }

/* ---- About panel (master home): heading left, text right ------------------ */
.about-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-16) var(--space-48);
}
.about-panel h2 { margin: 0; }
.about-panel p { max-width: 64ch; color: var(--ink-soft); font-size: var(--text-md); line-height: var(--leading-relaxed); }
.about-panel p:last-child { margin-bottom: 0; }
@media (max-width: 900px) { .about-panel { grid-template-columns: minmax(0, 1fr); } }

/* ==== Browse: filter chip row ===============================================
   Filters sit above the results. Each chip is a native <details>, so it opens
   with no JavaScript. The dock (chip row + applied tags) sticks under the
   header; "All filters" reflows the same chips into one panel. */
.browse-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.filter-dock {
  position: sticky; top: var(--header-h, 65px); z-index: 25;
  margin-bottom: var(--space-16); padding-bottom: var(--space-12);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
body.filters-open .filter-dock { z-index: 80; margin-bottom: 0; padding-bottom: 0; background: transparent; border-bottom: 0; }
body.filters-open .active-filters { display: none; }
.chip-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); padding-top: var(--space-12); }
.chip-search { flex: 1 1 220px; min-width: 180px; }
.chip-search .search { width: 100%; min-height: 48px; }
.chip { position: relative; }
.chip > summary {
  display: inline-flex; align-items: center; gap: var(--space-8);
  min-height: 48px; padding: var(--space-8) var(--space-16);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  cursor: pointer; white-space: nowrap; list-style: none;
}
.chip > summary::-webkit-details-marker { display: none; }
.chip > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.chip[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.chip > summary:hover,
.chip[open] > summary { border-color: var(--dark); }
/* A filter in use takes the secondary colour. */
.chip.is-on > summary { background: var(--dark); border-color: var(--dark); color: var(--surface); }
.chip.is-on > summary .chip-value { background: var(--surface); color: var(--dark); }
/* The count on the red "All filters" button. */
.btn-primary .chip-value { background: var(--surface); color: var(--primary); }
.chip-value { padding: 0 var(--space-8); border-radius: var(--pill); background: var(--soft); font-variant-numeric: tabular-nums; }
.chip-panel {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  display: grid; gap: var(--space-12);
  width: max-content; min-width: 240px; max-width: 320px;
  max-height: 60vh; overflow-y: auto;
  padding: var(--space-16);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.chip.is-flipped .chip-panel { left: auto; right: 0; }
.chip-panel label { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.chip-panel select,
.chip-panel input { min-height: 40px; }
.range-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); }
.location-actions { display: flex; gap: var(--space-8); }
.location-actions [data-set-location] { flex: 1; }
.filters-foot { display: flex; align-items: center; gap: var(--space-8); margin-left: auto; }

/* ---- "All filters" panel -------------------------------------------------- */
.filters-open-btn { white-space: nowrap; }
.burger {
  display: none; width: 14px; height: 10px; flex: 0 0 auto;
  background:
    linear-gradient(currentColor, currentColor) top / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) bottom / 100% 2px no-repeat;
}
.filters-scrim { display: none; position: fixed; inset: 0; z-index: 60; background: var(--overlay-filter); }
body.filters-open .filters-scrim { display: block; }
body.filters-open { overflow: hidden; }
body.filters-open .chip-bar {
  position: fixed; z-index: 70; inset: auto 0 0 0;
  display: block; overflow-y: auto; overscroll-behavior: contain;
  max-height: 88vh; margin: 0; padding: 0 var(--space-16);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
@media (min-width: 721px) {
  body.filters-open .chip-bar {
    inset: 50% auto auto 50%; transform: translate(-50%, -50%);
    width: min(560px, calc(100vw - 2 * var(--gutter)));
    max-height: 82vh; border-radius: var(--radius);
  }
}
body.filters-open .chip { display: block; margin-bottom: var(--space-12); }
body.filters-open .chip > summary { width: 100%; justify-content: space-between; }
body.filters-open .chip-panel {
  position: static; width: auto; max-width: none; max-height: none;
  margin-top: var(--space-8); box-shadow: none; background: transparent; border: 0; padding: 0 0 0 var(--space-8);
}
body.filters-open .chip-search { margin-bottom: var(--space-16); }
body.filters-open .filters-open-btn { display: none; }
.filters-head { display: none; }
body.filters-open .filters-head {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  margin-bottom: var(--space-16); padding: var(--space-16) 0 var(--space-12);
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-size: var(--card-title); font-weight: var(--weight-display);
}
.filters-x {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line-strong); border-radius: var(--round);
  background: var(--surface); color: var(--ink);
  font-size: var(--card-title); line-height: var(--leading-display); cursor: pointer;
}
.filters-x:hover { background: var(--dark); border-color: var(--dark); color: var(--surface); }
.filters-done { display: none; }
body.filters-open .filters-foot {
  position: sticky; bottom: 0; z-index: 3;
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--space-16); margin: var(--space-16) 0 0;
  padding: var(--space-12) 0 calc(var(--space-16) + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
body.filters-open .filters-done { display: inline-flex; order: 1; width: 100%; min-width: 0; }
body.filters-open .chip-clear { order: 2; justify-self: stretch; width: 100%; min-width: 0; padding-inline: var(--space-8); }

/* ---- Applied filter tags --------------------------------------------------- */
.active-filters { display: flex; flex-wrap: wrap; gap: var(--space-8); margin: var(--space-12) 0 0; }
.active-filters:empty { display: none; }
.filter-tag {
  display: inline-flex; align-items: center; gap: var(--space-8);
  min-height: 40px; padding: var(--space-8) var(--space-8) var(--space-8) var(--space-12);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--ink); font-size: var(--text-sm);
}
.filter-tag b { font-weight: var(--weight-medium); }
.filter-tag button {
  display: grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border: 0; border-radius: var(--round); background: transparent;
  color: var(--ink-soft); font-size: var(--text-md); line-height: var(--leading-display); cursor: pointer;
}
.filter-tag button:hover { background: var(--dark); color: var(--surface); }

@media (max-width: 720px) {
  /* Phones get a search box and one Filters button; everything else lives
     in the full-screen panel. */
  .chip-bar { flex-wrap: nowrap; }
  body:not(.filters-open) .chip-bar > .chip,
  body:not(.filters-open) .chip-clear,
  body:not(.filters-open) .filters-btn-text { display: none; }
  .chip-search { flex: 1 1 auto; min-width: 0; }
  .filters-foot { margin-left: 0; }
  .filters-open-btn { flex: 0 0 auto; padding-left: var(--space-12); padding-right: var(--space-12); }
  .burger { display: inline-block; }
  body.filters-open .chip-bar { inset: 0; max-height: none; padding: 0 var(--gutter); border: 0; border-radius: 0; }
  body.filters-open .facet-list { max-height: 44vh; }
  .active-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .active-filters::-webkit-scrollbar { display: none; }
  .filter-tag { flex: 0 0 auto; }
}

/* ---- Sidebar filters (directory) ------------------------------------------- */
.browse-filters { position: sticky; top: calc(var(--header-h, 65px) + var(--space-16)); padding: var(--space-16); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.browse-filters h2 { margin-bottom: var(--space-16); font-size: var(--card-title); font-stretch: 100%; letter-spacing: 0; }
.browse-filters .filter-bar { display: grid; grid-template-columns: 1fr; gap: var(--space-16); max-width: none; margin: 0; padding: 0; background: transparent; border-radius: 0; box-shadow: none; }
.browse-filters .filter-bar input,
.browse-filters .filter-bar select { min-height: 48px; padding: var(--space-8) var(--space-12); border: 1px solid var(--line-strong); }
.browse-filters .directory-search { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-12); width: 100%; margin: 0; padding: 0; background: transparent; border-radius: 0; box-shadow: none; }
.browse-filters .directory-search .search,
.browse-filters .directory-search .btn { width: 100%; min-width: 0; }
.directory-hero { margin-bottom: var(--space-24); }
.directory-layout .browse-results { min-width: 0; }
.directory-layout .browse-results .section-head { margin-bottom: var(--space-16); }
.check-list { display: grid; gap: var(--space-8); max-height: 190px; margin-top: var(--space-12); overflow-y: auto; }
.facet-panel { gap: var(--space-8); }
.facet-search { width: 100%; min-height: 40px; }
.facet-list { max-height: 300px; overflow-y: auto; margin-top: 0; }
.facet-empty { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.facet-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-count { margin-left: auto; padding-left: var(--space-8); color: var(--muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.facet-toggle { margin-top: var(--space-8); }
.check-option { display: flex; align-items: center; gap: var(--space-8); margin: 0; color: var(--ink); font-weight: var(--weight-regular); cursor: pointer; }
.check-option input { width: 18px; min-height: 18px; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1.8fr) repeat(4, minmax(130px, 1fr)); gap: var(--space-12); margin: 0 auto var(--space-24); padding: var(--space-16); background: var(--soft); border-radius: var(--radius); }

/* ---- Results ---------------------------------------------------------------- */
.results-count { margin: 0 0 var(--space-12); color: var(--ink-soft); font-size: var(--text-md); font-weight: var(--weight-medium); }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); margin-bottom: var(--space-16); }
.results-toolbar .results-count { margin: 0; }
.results-sort { display: inline-flex; align-items: center; gap: var(--space-8); margin: 0; color: var(--muted); font-size: var(--text-sm); white-space: nowrap; }
.results-sort select { width: auto; min-width: 170px; min-height: 40px; }
.results-pagination { display: flex; align-items: center; justify-content: center; gap: var(--space-16); margin-top: var(--space-24); color: var(--ink-soft); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gap) var(--space-16); }
.grid > * { min-width: 0; }
#results .grid,
.browse-results .grid { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.empty { grid-column: 1 / -1; padding: var(--space-48) var(--space-16); text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.section-more { display: flex; justify-content: center; margin-top: var(--space-24); }

/* ==== Car card ==============================================================
   Photo, then the price first and biggest (with the save heart beside it),
   the car, one line of specs, and the location under a hairline. */
.car-card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.car-link { display: flex; flex: 1; flex-direction: column; color: inherit; }
.car-link:hover { text-decoration: none; }
.car-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--soft); }
.car-media img { width: 100%; height: 100%; object-fit: cover; }
.car-body { display: flex; flex: 1; flex-direction: column; padding: var(--space-16); }
.car-title { margin: 0; font-size: var(--card-title); font-weight: var(--weight-display); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.car-variant { display: block; overflow: hidden; color: var(--ink-soft); font-size: var(--text-md); font-weight: var(--weight-regular); text-overflow: ellipsis; white-space: nowrap; }
.car-price { color: var(--ink); font-size: var(--card-title); font-stretch: var(--stretch-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display); line-height: var(--leading-display); font-variant-numeric: tabular-nums; }
/* Year, mileage, fuel and transmission, separated by middle dots. */
.car-specs { display: flex; flex-wrap: wrap; margin: var(--space-8) 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: var(--text-sm); }
/* The dot hangs off the end of each item, so a wrapped line never starts with one. */
.car-specs li:not(:last-child)::after { content: "\00a0\00b7\00a0"; color: var(--muted); }
.car-specs .fuel-electric { color: var(--good); font-weight: var(--weight-medium); }
.car-loc { display: flex; align-items: center; gap: var(--space-8); min-width: 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-snug); overflow-wrap: anywhere; }
.car-loc svg { flex: 0 0 auto; width: 15px; height: 15px; }

.listing-card {
  container-type: inline-size;
  overflow: hidden;
  transition: background .18s;
}
.listing-card .car-body { gap: 2px; padding: var(--space-12) var(--space-16) var(--space-16); }
/* Room on the right of the price for the heart. */
.listing-card .car-price { padding-right: 44px; }
.listing-card .car-loc { margin-top: auto; padding-top: var(--space-12); border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent); }
.listing-card .car-specs { margin-bottom: var(--space-12); }
.listing-card .car-media img { transition: transform .25s ease; }
.listing-card .car-link:hover .car-media img { transform: scale(1.03); }
.listing-card .car-link:hover .car-title { text-decoration: underline; text-underline-offset: 3px; }
.listing-card .car-link:focus-visible { outline: 3px solid var(--dark); outline-offset: -3px; }
@media (prefers-reduced-motion: reduce) {
  .listing-card,
  .listing-card .car-media img { transition: none; }
  .listing-card:hover { transform: none; }
  .listing-card .car-link:hover .car-media img { transform: none; }
}
/* The save heart sits beside the price: just under the 4:3 photo, whose
   height is three quarters of the card width (75cqw). */
.listing-card .card-save {
  position: absolute;
  top: calc(75cqw + var(--space-8));
  right: var(--space-8);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--round);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.listing-card .card-save svg { width: 22px; height: 22px; }
.listing-card .card-save:hover { background: var(--surface); color: var(--primary); }
.listing-card .card-save.is-active,
.listing-card .card-save.is-active:hover { color: var(--primary); }
.listing-card .card-save.is-active svg { fill: currentColor; }
.listing-card .card-save:focus-visible { outline: 3px solid var(--dark); outline-offset: 0; }
.car-card.is-comparing { border-color: var(--dark); box-shadow: var(--ring); }

/* ---- Guide cards: flat warm panels with headline-first previews. -------------------------- */
.guide-card { overflow: hidden; transition: background .18s; }
.guide-card .car-media { aspect-ratio: 16 / 9; }
.guide-card .car-media img { transition: transform .25s ease; }
.guide-card .car-link:hover .car-media img { transform: scale(1.03); }
.guide-card .car-body { gap: var(--space-8); padding: var(--space-16); }
.guide-card .card-kicker { margin: 0; }
.guide-card .card-date { color: var(--muted); font-size: var(--text-sm); }
.guide-card .car-link:hover .car-title { text-decoration: underline; text-underline-offset: 3px; }
.guide-card .car-body p { margin: 0; color: var(--ink-soft); }
.guide-image-container { position: relative; }
.guide-image-fallback { position: absolute; inset: 0; display: grid; place-items: center; background: var(--soft); color: var(--muted); font-size: var(--text-sm); }

/* ---- Category cards (guide categories, tool index) ------------------------ */
.category-card { transition: background .18s; background: var(--card); border-color: transparent; }
.category-card:hover { border-color: transparent; box-shadow: none; background: var(--card-warm-hover); }
.category-card .car-link { height: 100%; }
.category-card .car-body { gap: var(--space-8); padding: var(--space-16); }
.category-card .action-row { gap: var(--space-8); font-size: var(--text-sm); }
.category-card .car-body > p:last-child { margin-bottom: 0; }
.category-card .car-link:hover .car-title { text-decoration: underline; text-underline-offset: 3px; }

.listing-card, .guide-card { background: var(--card); border-color: transparent; }

.listing-card:hover, .guide-card:hover { transform: none; box-shadow: none; border-color: transparent; background: var(--card-warm-hover); }

.car-card .car-title { font-size: var(--card-title); font-stretch: var(--stretch-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display); line-height: var(--leading-display); }

.car-card .car-price { font-weight: var(--weight-display); }

.category-card .car-title { font-stretch: var(--stretch-display);
  font-size: var(--card-title);
  font-weight: var(--weight-display);
  line-height: var(--leading-display); }

.category-card .car-body > p { color: var(--ink-soft); }

.guide-card .car-body > p { display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: var(--text-sm); }

@media (prefers-reduced-motion: reduce) {
  .guide-card .car-media img { transition: none; }
  .guide-card .car-link:hover .car-media img { transform: none; }
}

/* ---- Info cards (style guide) --------------------------------------------- */
.feature-row { position: relative; }
.how-it-works { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin: 0 0 var(--section-gap); }
.info-card { padding: var(--card-pad); }
.step { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: var(--space-12); border-radius: var(--round); background: var(--dark); color: var(--surface); font-weight: var(--weight-display); }
.info-card h2 { font-size: var(--card-title); }
.info-card p { margin-bottom: 0; color: var(--ink-soft); }

/* ==== Listing detail ========================================================
   Three grid children: gallery, the price card, then the panels. On desktop
   the gallery and panels stack in column 1 with the card sticky beside them;
   on a phone the DOM order puts the price card straight under the photos. */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: var(--gap) var(--space-24); margin: var(--space-8) 0 var(--section-gap); align-items: start; }
.detail-gallery { min-width: 0; grid-column: 1; grid-row: 1; }
.detail-main { min-width: 0; grid-column: 1; grid-row: 2; display: grid; gap: var(--section-gap); align-content: start; }
.detail-info { position: sticky; top: calc(var(--header-h, 65px) + var(--space-16)); min-width: 0; grid-column: 2; grid-row: 1 / span 2; align-self: start; padding: var(--card-pad); background: var(--card); border-color: transparent; }
.detail-info h1 { margin: 0; font-size: var(--card-title); line-height: var(--leading-display); }
.detail-kicker { margin: var(--space-8) 0 0; color: var(--muted); font-size: var(--text-md); }
.detail-info .car-price { margin: var(--space-16) 0 0; font-size: var(--display); line-height: var(--leading-display); }
.detail-main > .panel { padding: 0; margin: 0; border: 0; background: transparent; }
.detail-main .panel-head { padding-bottom: var(--space-12); margin-bottom: var(--space-16); border-bottom: 1px solid var(--ink); }
.detail-main > .detail-dealer { padding: var(--space-24); background: var(--card); }
.detail .spec-tile { background: var(--card); }
.detail-info .car-specs { margin: var(--space-12) 0 var(--space-16); font-size: var(--text-md); }
.detail-actions { margin-bottom: var(--space-16); gap: var(--space-8); }
.detail-actions .btn { flex: 1 1 auto; max-width: 100%; padding-inline: var(--space-16); }
.detail-info > p.muted { margin-bottom: var(--space-16); }
.listing-photo-credit,
.dealer-removal-link { margin: var(--space-8) 0 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--leading-normal); }
.listing-photo-credit a,
.dealer-removal-link a { color: var(--ink); font-weight: var(--weight-medium); text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 3px; }
.gallery,
.gallery-main { min-width: 0; }
.detail-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--soft); }
.detail-media img { width: 100%; height: 100%; min-width: 0; object-fit: cover; }
/* Spec rows: label left (muted), value right, hairlines only. */
.specs { list-style: none; padding: 0; margin: 0 0 var(--space-16); }
.specs li { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-16); padding: var(--space-12) 0; border-bottom: 1px solid var(--line); font-size: var(--text-md); font-weight: var(--weight-medium); text-align: right; }
.specs li span:first-child { color: var(--muted); font-weight: var(--weight-regular); text-align: left; }
.detail-specs { columns: 2; column-gap: var(--space-24); }
.detail-specs li { break-inside: avoid; }
.spec-colour { display: inline-flex; align-items: center; gap: var(--space-8); }
.colour-dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: var(--round); background: var(--dot, var(--soft)); border: 1px solid var(--line-strong); }
/* Features: same rows as the specs, a small tick instead of a label. */
.feature-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-24);
  font-size: var(--text-md);
}
.feature-list li { display: flex; align-items: baseline; gap: var(--space-12); padding: var(--space-12) 0; border-bottom: 1px solid var(--line); line-height: var(--leading-snug); }
.feature-list li::before {
  content: ""; flex: 0 0 auto; width: 5px; height: 10px; margin: 0 3px 0 4px;
  border: solid var(--dark); border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.feature-toggle-input:not(:checked) ~ .feature-list .feature-extra,
.feature-toggle-input:checked ~ .feature-toggle .feature-toggle-more,
.feature-toggle-input:not(:checked) ~ .feature-toggle .feature-toggle-less { display: none; }
.feature-toggle { margin-top: var(--space-16); cursor: pointer; }
.feature-toggle-input:focus-visible ~ .feature-toggle { outline: 3px solid var(--dark); outline-offset: 2px; }
/* Key-spec tiles above the spec rows. */
.spec-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: var(--space-8); margin-bottom: var(--space-16); }
.spec-tile { display: grid; gap: var(--space-8); align-content: start; padding: var(--space-12); background: var(--soft); border-radius: var(--radius-sm); }
.spec-tile svg { width: 20px; height: 20px; color: var(--dark); }
.spec-tile span { color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.spec-tile strong { font-weight: var(--weight-display); }
.detail-description { margin: 0; font-size: var(--text-md); line-height: var(--leading-relaxed); white-space: pre-line; }
.listing-source-disclosure { margin-top: var(--space-16); padding-top: var(--space-12); border-top: 1px solid var(--line); }
.listing-source-disclosure summary { display: inline-flex; align-items: center; gap: var(--space-8); color: var(--muted); cursor: pointer; font-size: var(--text-sm); font-weight: var(--weight-medium); list-style: none; }
.listing-source-disclosure summary::-webkit-details-marker { display: none; }
.listing-source-disclosure summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.listing-source-disclosure summary:focus-visible { border-radius: var(--radius-sm); outline: 2px solid var(--dark); outline-offset: 3px; }
.listing-source-disclosure p { margin: var(--space-8) 0 0; color: var(--muted); font-size: var(--text-sm); }
.seller-stock { margin-top: var(--section-gap); }

/* ---- Dealer box ("Sold by") ------------------------------------------------- */
.dealer-box { display: flex; align-items: center; gap: var(--space-16); }
.dealer-box .profile-logo { flex: 0 0 auto; width: 64px; height: 64px; }
.dealer-box-info { min-width: 0; display: grid; gap: var(--space-8); font-size: var(--text-md); }
.dealer-box-info .action-row { margin-top: var(--space-8); }

/* ---- Photo gallery -------------------------------------------------------- */
.gallery-main { position: relative; cursor: zoom-in; }
/* Sideways swipes change photo; up/down still scrolls the page. */
.gallery-main > [data-vehicle-image] { touch-action: pan-y; width: 100%; height: 100%; object-fit: cover; }
.gallery-main > .vehicle-image-fallback { position: absolute; }
/* Round overlay controls for imagery. No :active transform: a button that
   moves under the pointer loses its click. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--round);
  background: var(--overlay-control);
  color: var(--surface);
  font: inherit;
  font-size: var(--card-title);
  line-height: var(--leading-display);
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:hover { background: var(--overlay-control-hover); color: var(--surface); }
/* Photo actions: Save / Compare / Share as round overlay controls in the
   photo's top-right corner, each with its label beside the icon. Same overlay
   colours as .icon-btn. Under 600px the labels collapse to icons only (they
   stay readable to screen readers). A saved / selected control turns primary. */
.photo-actions { position: absolute; top: var(--space-12); right: var(--space-12); z-index: 2; display: flex; gap: var(--space-8); }
.photo-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: 44px;
  padding: 0 var(--space-16) 0 var(--space-12);
  border: 0;
  border-radius: var(--pill);
  background: var(--overlay-control);
  color: var(--surface);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-display);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.photo-btn:hover { background: var(--overlay-control-hover); color: var(--surface); }
.photo-btn:focus-visible { outline: 3px solid var(--surface); outline-offset: 2px; }
.photo-btn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.photo-btn.is-active { background: var(--primary); }
.photo-btn.is-active.js-save svg { fill: currentColor; }
@media (max-width: 600px) {
  .photo-btn { padding: 0; width: 44px; justify-content: center; }
  .photo-btn-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
.gallery-prev,
.gallery-next { position: absolute; top: calc(50% - 22px); z-index: 2; }
.gallery-prev { left: var(--space-12); }
.gallery-next { right: var(--space-12); }
.gallery-thumbs { display: flex; gap: var(--space-8); margin-top: var(--space-12); overflow-x: auto; padding-bottom: var(--space-8); }
.gallery-thumb {
  flex: 0 0 auto;
  width: 88px;
  height: 66px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--soft);
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s, border-color .15s;
}
.gallery-thumb:hover,
.gallery-thumb.is-active { opacity: 1; }
.gallery-thumb.is-active { border-color: var(--dark); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.has-image-error { background: var(--soft); }
.gallery-thumb.has-image-error::after { content: "No photo"; color: var(--muted); font-size: var(--text-sm); }
.gallery-count,
.lightbox-count {
  position: absolute;
  left: var(--space-12);
  bottom: var(--space-12);
  z-index: 2;
  padding: var(--space-8);
  border-radius: var(--radius-sm);
  background: var(--overlay-caption);
  color: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.vehicle-image-fallback { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: var(--space-8); color: var(--muted); background: var(--soft); font-size: var(--text-sm); font-weight: var(--weight-medium); text-align: center; }
.vehicle-fallback-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--round); background: var(--dark); color: var(--surface); font-size: var(--card-title); font-weight: var(--weight-display); }
.compare-media { position: relative; }

/* ---- Lightbox --------------------------------------------------------------- */
.lightbox[hidden] { display: none; }
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; }
.lightbox-backdrop { position: absolute; inset: 0; background: var(--overlay-lightbox); }
.lightbox-stage { position: relative; z-index: 1; width: 100vw; height: 100vh; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.lightbox-stage img {
  max-width: calc(100vw - var(--space-48) * 2);
  max-height: calc(100vh - var(--space-48) * 2);
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-stage img.is-zoomed { cursor: grab; }
.lightbox-stage img.is-panning { cursor: grabbing; }
.lightbox .icon-btn { position: absolute; z-index: 2; }
.lightbox-close { top: var(--space-16); right: var(--space-16); }
.lightbox-prev { left: var(--space-16); top: calc(50% - 22px); }
.lightbox-next { right: var(--space-16); top: calc(50% - 22px); }
.lightbox-zoom { display: flex; flex-direction: column; gap: var(--space-8); position: absolute; z-index: 2; top: calc(var(--space-16) + 44px + var(--space-8)); right: var(--space-16); }
.lightbox-zoom .icon-btn { position: static; }
.lightbox-count { top: var(--space-16); left: var(--space-16); bottom: auto; }
.lightbox-thumbs {
  position: absolute;
  z-index: 2;
  bottom: var(--space-16);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: var(--space-8);
  max-width: calc(100vw - var(--space-48) * 2);
  overflow-x: auto;
  padding-bottom: var(--space-8);
}
.lightbox.has-thumbs .lightbox-stage img { max-height: calc(100vh - 66px - var(--space-48) * 2); }

/* ---- Phone action bar ------------------------------------------------------
   Hidden on desktop, where the price card is sticky. On a phone it slides up
   once the real buttons scroll off. */
.sticky-cta { display: none; }
.sticky-cta-info { display: grid; flex: 1 1 auto; min-width: 0; gap: 1px; text-decoration: none; color: inherit; }
.sticky-cta-info strong,
.sticky-cta-specs,
.sticky-cta-price { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-cta-specs { color: var(--muted); font-size: var(--text-sm); }
.sticky-cta-specs i + i::before { content: "\00a0\00b7\00a0"; }
.sticky-cta-specs i { font-style: normal; }
.sticky-cta-price { color: var(--ink); font-weight: var(--weight-display); }
.sticky-cta-actions { display: flex; align-items: center; gap: var(--space-8); flex: 0 0 auto; }

/* ---- Enquiry modal ---------------------------------------------------------- */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--gutter); }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay-modal); }
.modal-panel { position: relative; width: min(100%, 620px); max-height: calc(100vh - 40px); overflow: auto; padding: var(--card-pad-lg); background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-panel); }
.modal-close { position: absolute; right: 16px; top: 16px; }
.modal-open { overflow: hidden; }
.enquiry-done { margin-top: 0; padding: 0; border: 0; background: transparent; }
.modal-success { display: grid; gap: var(--space-12); }
.modal-success h3,
.modal-success p { margin-bottom: 0; }
.dealer-phone { display: inline-flex; margin: var(--space-8) 0 var(--space-16); padding: var(--space-12) var(--space-16); border-radius: var(--radius-sm); background: var(--dark); color: var(--surface); font-size: var(--card-title); font-weight: var(--weight-display); }
.dealer-phone a { color: inherit; text-decoration: none; }
.dealer-phone a:hover { text-decoration: underline; }

/* ---- Compare ----------------------------------------------------------------- */
.compare-tray[hidden] { display: none; }
.compare-tray { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--gutter); pointer-events: none; }
.compare-status {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 92;
  width: min(calc(100% - 32px), 620px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-12) var(--space-16);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  pointer-events: auto;
}
.compare-backdrop { position: absolute; inset: 0; background: var(--overlay-modal); pointer-events: auto; }
.compare-panel {
  position: relative;
  z-index: 91;
  width: min(calc(100% - 32px), 860px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  margin: 0;
  padding: var(--card-pad-lg);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  pointer-events: auto;
}
.compare-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-16); margin-bottom: var(--space-16); }
.compare-head h2,
.compare-head .eyebrow { margin-bottom: 0; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.compare-card { position: relative; overflow: hidden; padding: var(--space-16); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.compare-media { aspect-ratio: 4 / 3; margin: 0 0 var(--space-16); overflow: hidden; border-radius: var(--radius-sm); background: var(--soft); }
.compare-media img { width: 100%; height: 100%; object-fit: cover; }
.compare-card h3 { margin-top: var(--space-8); }
.compare-card .car-price { font-size: var(--card-title); }
.compare-actions { margin-top: var(--space-16); display: flex; justify-content: flex-end; }
.compare-rich { width: min(calc(100% - 24px), 1100px); }
.compare-rich .compare-media { display: block; }
.compare-card-actions { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-top: var(--space-16); }
.compare-highlights { padding: var(--space-16) var(--space-16) var(--space-16) var(--space-24); background: var(--soft); border-radius: var(--radius); }
.compare-highlights li + li { margin-top: var(--space-8); }
.compare-controls { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; margin: var(--space-16) 0 var(--space-12); }
.compare-controls label { display: inline-flex; align-items: center; gap: var(--space-8); margin: 0; font-weight: var(--weight-medium); white-space: nowrap; }
.compare-controls input { flex: 0 0 18px; }
.compare-controls p { flex: 1 1 280px; margin: 0; font-size: var(--text-sm); }
.compare-table-scroll { overflow-x: auto; }
.compare-table { width: 100%; min-width: 540px; table-layout: fixed; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: var(--space-12); text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.compare-table th:first-child { width: 30%; }
.compare-table thead th { background: var(--surface); }
.compare-table .compare-group th { background: var(--soft); padding-top: var(--space-16); font-size: var(--text-md); }
.compare-table .compare-different td { background: color-mix(in srgb, var(--dark) 6%, var(--surface)); }
.compare-only-differences .compare-same { display: none; }
.compare-only-differences tbody:not(:has(.compare-different)) { display: none; }
.compare-rich .compare-actions { gap: var(--space-12); flex-wrap: wrap; }
.unavailable-car { padding: var(--space-24); align-self: start; }
.shortlist-notice { position: fixed; bottom: 16px; left: 16px; max-width: min(440px, calc(100vw - 32px)); z-index: 110; padding: var(--space-16); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ==== Dashboard, admin and directory (ported) ============================ */
/* ---- Sub-company cards -------------------------------------------------
   One card per brand instead of a ten-column table. A table forced every
   field to share one narrow column, so the values people actually need to
   read - the domain, the slug, the logo URL - were clipped to a few
   characters. A card gives each field a real label and room for its value. */
.brand-cards { display: grid; gap: var(--space-16); }
.brand-card {
  display: grid; gap: var(--space-16);
  padding: var(--space-16);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.brand-card-new { margin-top: var(--space-16); }

.brand-card-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12);
  padding-bottom: var(--space-12);
  border-bottom: 1px solid var(--line);
}
/* Both brand colours at a glance, so a card is identifiable before reading. */
.brand-swatch {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
}
.brand-card-title { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.brand-card-title strong { font-size: var(--card-title); }
.brand-card-title .code-inline { justify-self: start; max-width: 100%; overflow-wrap: anywhere; }
.brand-card-head .check-field { margin-left: auto; padding: 0; }

/* Two comfortable columns on a desktop, one on a phone. */
.brand-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-16); }
.brand-fields .field { margin-bottom: 0; }
.brand-fields .field input,
.brand-fields .field select { width: 100%; }
.brand-fields .field small { display: block; margin-top: var(--space-8); color: var(--muted); font-size: var(--text-sm); }
.swatch-pair { display: flex; align-items: center; gap: var(--space-12); min-height: 40px; }

.brand-subsection { padding-top: var(--space-16); border-top: 1px solid var(--line); }
.brand-subsection h4 { margin: 0 0 var(--space-8); font-size: var(--text-sm); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--muted); }
.brand-subsection > p.muted { margin: 0 0 var(--space-12); }
.section-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-12); }
.section-modes .field { margin-bottom: 0; }
.section-modes select { width: 100%; }

.brand-card-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-12);
  padding-top: var(--space-16); border-top: 1px solid var(--line);
}
.brand-card-foot form { margin-left: auto; }

@media (max-width: 720px) {
  .brand-card { padding: var(--space-16); }
  .brand-card-head .check-field { margin-left: 0; }
}

.settings-list { display: grid; gap: var(--space-12); max-width: 760px; }
.settings-option { display: flex; align-items: flex-start; gap: var(--space-12); padding: var(--space-16); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.settings-option span { display: grid; gap: var(--space-8); }
.settings-option small { color: var(--muted); }
th[data-dir="asc"]::after { content: " ^"; color: var(--muted); }
th[data-dir="desc"]::after { content: " v"; color: var(--muted); }

/* ---- Admin table filters ------------------------------------------------
   A wrapping row of small controls above a wide table. Every control is part
   of one form so the filters combine, and the table is horizontally
   scrollable because these views show every column. */
.admin-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-8); margin: var(--space-16) 0 var(--space-12); }
.admin-filters input,
.admin-filters select { min-height: 40px; padding: var(--space-8); font-size: var(--text-sm); }
.admin-filters select { max-width: 190px; }
.admin-filters input[type="number"] { width: 92px; }
.admin-filter-search { flex: 1 1 240px; min-width: 200px; }
.admin-filter-count { margin-left: auto; white-space: nowrap; }
.admin-filters .check-option { white-space: nowrap; }
.admin-listings-table td,
.admin-dealers-table td,
.admin-listings-table th,
.admin-dealers-table th { white-space: nowrap; }
.admin-listings-table .muted,
.admin-dealers-table .muted { font-size: var(--text-sm); }

.app-shell { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; background: var(--page); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--space-8); padding: var(--space-16); color: var(--ink-on-dark); background: var(--dark); }
.sidebar .brand { color: var(--surface); padding: var(--space-8) var(--space-12) var(--space-16); }
.side-section { padding: var(--space-16) var(--space-12) var(--space-8); color: color-mix(in srgb, var(--surface) 48%, var(--dark)); font-size: var(--text-sm); font-weight: var(--weight-display); }
.side-link { display: flex; align-items: center; gap: var(--space-12); min-height: 40px; padding: var(--space-8) var(--space-12); border-radius: var(--pill); color: var(--ink-on-dark); font-weight: var(--weight-medium); font-size: var(--text-md); }
.side-link:hover { color: var(--surface); background: var(--on-dark-hover); text-decoration: none; }
.side-link.active { color: var(--surface); background: var(--primary); }
.side-spacer { flex: 1; }
.side-foot { border-top: 1px solid var(--on-dark-line); padding: var(--space-12) var(--space-12) 0; color: var(--ink-on-dark); font-size: var(--text-sm); }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); padding: 0 var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-left,
.topbar-right { display: flex; align-items: center; gap: var(--space-12); min-width: 0; }
.topbar-right { justify-content: flex-end; }
.page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--card-title); font-weight: var(--weight-display); }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; overflow: hidden; border-radius: var(--round); color: var(--surface); background: var(--primary); font-size: var(--text-sm); font-weight: var(--weight-display); }
.avatar img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
/* A logo needs a light plate behind it; an initial keeps the brand colour. */
.avatar.has-logo { background: var(--surface); border: 1px solid var(--line); }
.app-content { width: 100%; max-width: 1240px; margin: 0 auto; padding: var(--gutter); }
.mobile-nav-toggle { display: none; width: 40px; height: 40px; padding: 0; font-size: var(--card-title); }
.scrim { display: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-16); margin-bottom: var(--gap); }
.stat { padding: var(--space-16) var(--card-pad); }
.stat .label { color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.stat .value { margin-top: var(--space-8); color: var(--ink); font-size: var(--card-title); font-weight: var(--weight-display); line-height: var(--leading-display); font-variant-numeric: tabular-nums; }
.chart-card canvas { width: 100%; max-height: 280px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); }
.row-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-12); align-items: end; margin: var(--space-16) 0; }
.dropzone { display: block; padding: var(--space-24); text-align: center; background: var(--surface); border: 2px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.dropzone:hover,
.dropzone.drag { border-color: var(--primary); box-shadow: var(--ring); }
.dropzone input[type=file] { display: none; }

.admin-create-form { display: grid; gap: var(--space-16); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-12); align-items: end; }
.check-field { min-height: 40px; display: inline-flex; align-items: center; gap: var(--space-8); margin: 0; padding: var(--space-12) 0; }
.check-field input { width: auto; min-height: auto; }

/* ---- Dashboard tabs (layout only - the buttons are global .btn) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: var(--space-12); margin-bottom: var(--space-16); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
/* Before the tab script runs (or without JS), show the first panel. */
body:not(.tabs-ready) .tab-panel:first-of-type { display: block; }

/* ---- Enquiry cards (dealer dashboard) ------------------------------------ */
/* enquiry-card is a global .card; only layout + the "new" accent live here. */

/* ---- Dealer profile ------------------------------------------------------- */
.profile-form { display: grid; gap: var(--space-16); }
/* Two swatches plus a reset, sitting on one line inside a form field. */
.colour-pair { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }
.colour-pair input[type="color"] { flex: 0 0 auto; }
/* Stack the admin panels on a tab with more than one panel. */
.tab-panel > .panel + .panel { margin-top: var(--space-16); }
.profile-form label { display: block; margin-bottom: var(--space-8); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.profile-head { display: grid; grid-template-columns: 84px 1fr; gap: var(--space-16); align-items: center; }
.profile-head > div:last-child { min-width: 0; }
.profile-head h1 { margin-bottom: var(--space-8); }
.profile-logo {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  overflow: hidden;
}
.profile-logo img { width: 100%; height: 100%; object-fit: contain; }
.profile-logo-empty { font-size: var(--card-title); font-weight: var(--weight-display); color: var(--muted); }

/* ---- Directory result cards ---------------------------------------------- */
.directory-card-layout {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: var(--space-16);
  align-items: center;
  padding: var(--space-16);
}
.directory-card .profile-logo { width: 72px; height: 72px; }
.directory-card-info { min-width: 0; }
.directory-card-info h3 { margin-bottom: var(--space-8); }
.directory-card-info p { margin-bottom: var(--space-8); }
.directory-card-side { display: grid; justify-items: end; gap: var(--space-12); min-width: 150px; }
.directory-card-side p { margin: 0; text-align: right; }
@media (max-width: 900px) {
  .directory-card-layout { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-16); padding: var(--space-16); }
  .directory-card-side { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; min-width: 0; }
  .directory-card-side p { text-align: left; }
}

/* ---- Profile + dashboard mobile ------------------------------------------- */
@media (max-width: 720px) {
  .profile-head { grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-12); }
  .profile-head .profile-logo { width: 64px; height: 64px; }
  .app-content { padding: var(--space-16); }
  .tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--page);
    margin: 0 calc(var(--space-16) * -1) var(--space-16);
    padding: var(--space-8) var(--space-16);
  }
  .tabs .btn { width: auto; flex: 0 0 auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-12); }
  .stat { padding: var(--space-12) var(--space-16); }
  .panel { padding: var(--space-16); }
  .panel-head { flex-wrap: wrap; gap: var(--space-8); }
          .row-form { grid-template-columns: 1fr; }
}

/* ---- Form grid extras ----------------------------------------------------- */
.form-grid .form-wide { grid-column: 1 / -1; }
.form-grid textarea { width: 100%; resize: vertical; }

/* ---- Style guide (/styles) -------------------------------------------------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-12); }
.swatch {
  height: 74px;
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  padding: var(--space-8) var(--space-12);
  color: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.swatch-light { color: var(--ink); }
.style-block { margin-bottom: var(--space-24); padding-top: var(--space-16); border-top: 1px dashed var(--line); }
.style-block:first-of-type { border-top: 0; padding-top: 0; }
.style-spec { margin: 0 0 var(--space-12); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted); }
.style-grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 320px)); }

/* ---- Style guide type scale --------------------------------------------------- */
.type-scale { display: grid; }
.type-row { display: grid; grid-template-columns: minmax(200px, 250px) 1fr; align-items: baseline; gap: var(--space-16); padding: var(--space-12) 0; border-bottom: 1px dashed var(--line); }
.type-row:last-child { border-bottom: 0; }
.type-label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) { .type-row { grid-template-columns: 1fr; gap: var(--space-8); } }

/* ---- Token editor (/styles, admin only) --------------------------------------- */
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-16); margin-bottom: var(--space-16); }
.token-field { display: flex; flex-direction: column; gap: var(--space-8); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted); }
.token-field input[type="color"] { width: 100%; height: 40px; padding: var(--space-8); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.token-field input[type="text"] { min-height: 40px; }
.token-actions { margin-top: var(--space-8); }

/* ---- Admin category editor ---------------------------------------------------- */
.cat-edit-cell { padding: var(--space-12); }
.cat-edit-row { display: grid; grid-template-columns: 110px 1.2fr 1fr 2fr 74px auto auto; gap: var(--space-8); align-items: center; }
.cat-edit-row .cat-sort { width: 70px; }
.cat-sites { grid-column: 1 / -2; display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-16); padding: var(--space-8) var(--space-12); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cat-sites legend { padding: 0 var(--space-8); color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.cat-sites .check-field { padding: 0; }
.cat-delete { margin-top: var(--space-8); text-align: right; }
@media (max-width: 1040px) { .cat-edit-row { grid-template-columns: 1fr 1fr; } }

/* ---- Directory spacing rhythm -------------------------------------------------- */
.service-chips { display: flex; flex-wrap: wrap; gap: var(--space-8); }
.directory-card-info .service-chips { margin-top: var(--space-12); }
.profile-head { margin-bottom: var(--space-16); }
.profile-desc { margin: 0 0 var(--space-16); max-width: 860px; }
.panel-card .service-chips { margin-bottom: var(--space-16); }
.directory-card-info > div .eyebrow { margin-bottom: var(--space-8); }
.directory-card-info h3 { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; }

/* ---- Directory sidebar (Yelp-style) ------------------------------------------- */
.filter-cats { margin-top: var(--space-24); padding-top: var(--space-16); border-top: 1px solid var(--line); }
.filter-cats h2 { margin-bottom: var(--space-12); }
.cat-links { display: grid; gap: var(--space-8); }
.cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-12);
  padding: var(--space-8) var(--space-12);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: var(--weight-medium);
  font-size: var(--text-md);
}
.cat-link:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.cat-link.on { background: var(--dark); color: var(--surface); }
.cat-link.on .cat-count { background: var(--on-dark-badge); color: var(--surface); }
.cat-count {
  flex: 0 0 auto;
  min-width: 26px;
  text-align: center;
  padding: var(--space-8);
  border-radius: var(--pill);
  background: var(--soft);
  font-size: var(--text-sm);
}
.directory-card-side { min-width: 132px; }
.directory-card-side .btn { width: 100%; }

/* ---- Tool calculators ---------------------------------------------------------- */
.tool-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-16); align-items: end; max-width: 880px; }
.tool-form .tool-field { display: flex; flex-direction: column; gap: var(--space-8); }
.tool-form label { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted); }
.tool-divider { display: flex; align-items: center; gap: var(--space-12); margin: var(--space-16) 0; color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-medium); max-width: 880px; }
.tool-divider::before, .tool-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tool-result { margin-top: var(--space-16); padding: var(--space-16) var(--space-24); border-radius: var(--radius); border: 1px solid var(--line); border-left: 6px solid var(--muted); background: var(--surface); max-width: 880px; }
.tool-result h3 { margin: 0 0 var(--space-8); }
.tool-result p { margin: 0; color: var(--muted); }
.tool-result.good { border-left-color: var(--good); background: var(--good-soft); }
.tool-result.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.tool-result.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.tool-result .badge { margin-bottom: var(--space-8); }
.table tr.hl td { background: var(--info-soft); font-weight: var(--weight-medium); }

/* Live listings strip inside a guide (views/components/guide-listings.html).
   Undo the prose styles meant for article text. */
.guide-prose .guide-listings { margin: var(--section-gap) 0; }
.guide-prose .guide-listings h2 { margin: 0; padding: 0; border-top: 0; }
.guide-prose .guide-listings h3 { margin-top: 0; }
.guide-prose .guide-listings p { margin: 0; max-width: none; }
.guide-prose .guide-listings a,
.guide-prose .guide-listings a:hover { text-decoration: none; }
.guide-prose .guide-listings img { border-radius: 0; }
.guide-prose .guide-listings .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }

/* Header photo of a live car (views/pages/article.html): link to its advert. */
.guide-header-media { position: relative; }
.guide-header-media > a { display: block; height: 100%; }
.guide-header-car a { color: inherit; text-decoration: none; }
.guide-header-car {
  position: absolute;
  left: var(--space-8);
  bottom: var(--space-8);
  max-width: calc(100% - 2 * var(--space-8));
  padding: var(--space-8);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  color: var(--surface);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==== Sign in =============================================================== */
.auth-wrap { min-height: 64vh; display: grid; place-items: center; padding: var(--space-48) 0; }
.auth-card { width: min(100%, 440px); padding: var(--card-pad-lg); box-shadow: var(--shadow); }
.auth-card h1 { font-size: var(--card-title); }
.hint { color: var(--muted); font-size: var(--text-sm); margin-top: var(--space-16); line-height: var(--leading-relaxed); }

/* ==== Reg lookup (DVLA/DVSA) ================================================= */
.reg-card { display: grid; gap: var(--space-12); padding: var(--space-16); }
.reg-card h3 { margin: 0 0 var(--space-8); }
.reg-card-error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, var(--surface)); }
.reg-card-error p { margin: 0; color: var(--bad); }
.reg-card .btn,
.reg-card .reg-plate { justify-self: start; }
.reg-specs { display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-12); margin: 0; padding: 0; list-style: none; }
.reg-specs li { color: var(--ink-soft); }
.reg-specs li:not(:last-child)::after { content: "\00B7"; margin-left: var(--space-12); color: var(--muted); }
.reg-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-12);
  margin: 0 0 var(--space-16);
  padding: var(--space-12) var(--space-16);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.reg-banner p { flex: 1 1 260px; margin: 0; }
.reg-banner .btn { margin-left: auto; }
.reg-banner-error { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, var(--surface)); }
.reg-banner-error p,
p.reg-banner-error { color: var(--bad); }

/* ==== FAQs: plain rows, a plus that turns into a minus. ===================== */
.home-faqs { margin: 0 0 var(--section-gap); }
.faq-list { display: grid; max-width: 860px; border-bottom: 1px solid var(--ink); }
.tool-faq .faq-list {
  max-width: none;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
}
.faq-item { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding: var(--space-16) 0;
  cursor: pointer;
  color: var(--ink);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.faq-toggle { flex: 0 0 auto; position: relative; width: 14px; height: 14px; }
.faq-toggle::before,
.faq-toggle::after { content: ""; position: absolute; inset: 0; margin: auto; background: var(--ink); transition: transform .18s; }
.faq-toggle::before { width: 14px; height: 2px; }
.faq-toggle::after { width: 2px; height: 14px; }
.faq-item[open] .faq-toggle::after { transform: rotate(90deg); }
.faq-item > p { margin: 0; padding: 0 0 var(--space-16); color: var(--ink-soft); line-height: var(--leading-relaxed); max-width: 72ch; }
.faq-answer-cell { max-width: 420px; white-space: normal; }

/* ==== Guide (article) pages ================================================== */
.guide-page { margin-top: 0; }
.guide-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-24);
  align-items: start;
  margin-bottom: var(--space-24);
  padding-block: var(--space-8) var(--space-24);
  border-bottom: 1px solid var(--line);
}
.guide-header.guide-header-has-media { grid-template-columns: minmax(0, 1fr) minmax(240px, 380px); }
.guide-header h1 { margin: var(--space-12) 0 var(--space-16); }
.guide-header-copy > .action-row { font-size: var(--text-sm); }
.guide-header-copy > .action-row > a.badge { padding: 0; background: transparent; color: var(--primary); }
.guide-summary {
  max-width: 60ch;
  margin-bottom: 0;
  font-size: var(--text-md);
  line-height: var(--leading-normal);
}
.guide-header-media { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--soft); }
.guide-header-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.guide-layout { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--space-48); align-items: start; }
.guide-layout-single { grid-template-columns: minmax(0, 1fr); }
.guide-toc {
  position: sticky;
  top: calc(var(--header-h, 65px) + var(--space-16));
  padding: 0 var(--space-16) 0 0;
  border: 0;
  border-radius: 0;
  border-inline-end: 1px solid var(--line);
}
.guide-toc > .eyebrow { color: var(--ink); margin-bottom: var(--space-12); }
.guide-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-8); }
.guide-toc a { color: var(--ink-soft); font-size: var(--text-sm); line-height: var(--leading-snug); }
.guide-toc a:hover { color: var(--ink); }
.guide-toc .toc-level-2 > a { font-weight: var(--weight-medium); }
.guide-toc .toc-level-3 { padding-left: var(--space-16); }
/* Prose sits on the page: no card around the article. */
.guide-prose { min-width: 0; padding: 0; background: transparent; border: 0; border-radius: var(--radius); font-size: var(--text-md); }
.legal-copy { white-space: pre-wrap; overflow-wrap: anywhere; line-height: var(--leading-relaxed); }
.guide-prose p { line-height: var(--leading-relaxed); margin-bottom: var(--space-16); max-width: 72ch; }
.guide-prose h2 { max-width: 72ch; margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); scroll-margin-top: 100px; }
.guide-prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.guide-prose h3 { margin-top: 1.6em; scroll-margin-top: 100px; }
.guide-prose ul, .guide-prose ol { padding-left: var(--space-24); line-height: var(--leading-relaxed); max-width: 72ch; }
.guide-layout > .guide-prose > h2 {
  margin-block: var(--space-48) var(--space-16);
  padding-top: var(--space-16);
  line-height: var(--leading-snug);
}
.guide-layout > .guide-prose > h2:first-child { margin-top: 0; padding-top: 0; }
.guide-layout > .guide-prose h2 { font-weight: var(--weight-section); }
.guide-prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.guide-prose figure { width: min(100%, 620px); margin: var(--space-24) 0; }
.guide-prose figure img { width: 100%; }
.guide-prose figure a { display: block; line-height: 0; }
.guide-prose .guide-listing-card { margin: var(--space-24) 0; max-width: 420px; }
.guide-prose .guide-listing-card a,
.guide-prose .guide-listing-card a:hover { color: inherit; text-decoration: none; }
.guide-prose .guide-listing-card .car-title { margin-top: 0; padding-top: 0; border-top: 0; }
.guide-prose figcaption { margin-top: var(--space-8); color: var(--muted); font-size: var(--text-sm); }
.guide-prose .panel-card { margin: var(--space-24) 0; background: var(--soft); border: 0; }
.guide-page .guide-prose > .panel-card .badge.blue { background: var(--primary-soft); color: var(--ink); }
.guide-prose .panel-card h2,
.guide-prose .panel-card h3 { margin-top: 0; padding-top: 0; border-top: 0; }
.guide-prose .tool-result { margin: var(--space-16) 0; max-width: none; }
.guide-prose .grid-2 { align-items: stretch; margin: var(--space-16) 0; }
.guide-prose .grid-2 > .panel-card { margin: 0; }
.guide-prose .table-wrap { margin: var(--space-24) 0; }
.guide-prose .table { min-width: 620px; }
.guide-prose .table th { color: var(--ink); background: var(--soft); }
.guide-prose .table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--soft) 50%, var(--surface)); }
.guide-prose a:not([class]),
:is(.tool-hero, .tool-section) p a:not([class]) { color: var(--dark); text-decoration: underline; text-underline-offset: 3px; }
/* Car cards inside a guide keep their own layout, not the article list styles. */
.guide-prose .car-specs { max-width: none; padding-left: 0; line-height: var(--leading-snug); }
.guide-actions { margin: var(--space-16) 0 0; }
:is(.section-panel, .tool-section, .band) .guide-prose { max-width: 900px; }
:is(.section-panel, .tool-section, .band) .guide-prose h2:first-child { margin-top: 0; }
:is(.content-section, .tool-section) .feature-row { margin: 0; }

/* ---- Guide article: editorial layout ---------------------------------------
   Cream header band (title left, photo right), a reading column with the
   contents rail on the right, larger body type, and plain callouts.
   Article bodies use: p, h2, h3, ul/ol, .panel-card, a bare div (key
   takeaway), .grid-2 of .tool-result good/warn (pros and cons), .table. */
.breadcrumbs:has(+ .guide-page) { background: var(--card-warm); }
.guide-page > .guide-header {
  margin: 0 calc(50% - 50vw) var(--section-gap);
  padding: var(--space-8) var(--bleed-pad) var(--space-48);
  gap: var(--space-24) var(--space-48);
  align-items: center;
  background: var(--card-warm);
  border-bottom: 0;
}
.guide-page > .guide-header.guide-header-has-media { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.guide-page .guide-header-copy > .action-row > a.badge { font-weight: var(--weight-display); }
.guide-page .guide-summary { max-width: 46ch; color: var(--ink); font-size: var(--text-md); line-height: var(--leading-snug); }
/* Buttons under the header summary (the summary has no bottom margin of its own): same gap as the hero tick-list buttons. */
.guide-header-actions { margin-top: var(--space-24); }
.guide-page .guide-header-media { aspect-ratio: 3 / 2; }

.guide-page .guide-layout { grid-template-columns: minmax(0, 45rem) minmax(220px, 300px); justify-content: space-between; }
.guide-page .guide-layout-single { grid-template-columns: minmax(0, 45rem); }
.guide-page .guide-toc { order: 2; padding: var(--card-pad-lg); background: var(--card); border: 0; border-radius: var(--radius); }
.guide-page .guide-toc > .eyebrow { color: var(--primary); }
.guide-page .guide-toc ol { gap: 0; }
.guide-page .guide-toc li + li { border-top: 1px solid var(--line); }
.guide-page .guide-toc a { display: block; padding: var(--space-12) 0; color: var(--ink); }
.guide-page .guide-toc a:hover { color: var(--primary); }
.guide-page .guide-toc .toc-level-3 > a { color: var(--ink-soft); }

.guide-page .guide-prose { font-size: var(--text-md); }
.guide-page .guide-layout > .guide-prose > h2 {
  margin-block: var(--space-48) var(--space-16);
  padding-top: 0;
  border-top: 0;
  font-size: var(--card-title);
  font-weight: var(--weight-display);
  line-height: calc(var(--leading-display) * 1.15);
}
.guide-page .guide-layout > .guide-prose > h2:first-child { margin-top: 0; }
.guide-page .guide-prose h3:not(.car-title) {
  margin: var(--space-24) 0 var(--space-12);
  font-stretch: var(--stretch-display);
  letter-spacing: var(--tracking-display);
  word-spacing: var(--word-gap-display);
  line-height: calc(var(--leading-display) * 1.15);
}
.guide-page .guide-prose :is(ul, ol):not([class]) > li + li { margin-top: var(--space-8); }
.guide-page .guide-prose :is(ul, ol):not([class]) > li::marker { color: var(--primary); font-weight: var(--weight-display); }
.guide-page .guide-prose a:not([class]),
:is(.tool-hero, .tool-section) p a:not([class]) { text-decoration-color: var(--primary); text-decoration-thickness: 2px; }
.guide-page .guide-prose a:not([class]):hover,
:is(.tool-hero, .tool-section) p a:not([class]):is(:hover, :focus-visible) { color: var(--primary); }

/* Callouts: a panel, or a bare div that opens with a bold label. */
.guide-page .guide-prose > :is(.panel-card, div:not([class])) {
  margin: var(--space-24) 0;
  padding: var(--card-pad-lg);
  background: var(--card);
  border: 0;
  border-inline-start: 4px solid var(--primary);
  border-radius: 0;
}
.guide-page .guide-prose > div:not([class]) > strong:first-child { display: block; margin-bottom: var(--space-8); color: var(--primary); font-size: var(--text-sm); font-weight: var(--weight-display); }
.guide-page .guide-prose > :is(.panel-card, div:not([class])) > :is(h2, h3):first-child { margin-top: 0; }
.guide-page .guide-prose > :is(.panel-card, div:not([class])) > :last-child { margin-bottom: 0; }

/* Pros and cons: two cream cards, colour only on the top rule. */
.guide-page .guide-prose .grid-2 { gap: var(--gap); margin: var(--space-24) 0; }
.guide-page .guide-prose .grid-2 > .panel-card { padding: 0; background: transparent; }
.guide-page .guide-prose .tool-result {
  margin: var(--space-24) 0;
  padding: var(--card-pad-lg);
  background: var(--card);
  border: 0;
  border-top: 4px solid var(--muted);
  border-radius: 0;
}
.guide-page .guide-prose .grid-2 .tool-result { height: 100%; margin: 0; }
.guide-page .guide-prose .tool-result.good { border-top-color: var(--good); }
.guide-page .guide-prose .tool-result.warn { border-top-color: var(--warn); }
.guide-page .guide-prose .tool-result.bad { border-top-color: var(--bad); }
.guide-page .guide-prose .tool-result > :is(h2, h3):first-child { margin-top: 0; }
.guide-page .guide-prose .tool-result :is(p, ul, ol) { margin-bottom: 0; color: var(--ink); }

.guide-page .guide-prose .guide-listings .section-head h2 { font-size: var(--card-title); }
.guide-page .guide-prose .guide-listings .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }

.guide-page .guide-prose .table { font-size: var(--text-md); }
.guide-page .guide-actions { margin-top: var(--space-48); padding-top: var(--space-24); border-top: 1px solid var(--line); }

@media (max-width: 900px) {
  .guide-page > .guide-header.guide-header-has-media,
  .guide-page .guide-layout,
  .guide-page .guide-layout-single { grid-template-columns: minmax(0, 1fr); }
  .guide-page > .guide-header { padding-bottom: var(--space-24); }
  .guide-page .guide-header-media { aspect-ratio: 16 / 9; }
  .guide-page .guide-toc { order: 0; padding: var(--card-pad); }
}

/* ==== Responsive ============================================================ */
.guide-prose .guide-listings a:not(.btn) { color: inherit; }

@media (max-width: 1040px) {
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar .search { grid-column: 1 / -1; }
  .home-hero,
  .tool-hero,
  .browse-head,
  .browse-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-makes { justify-content: flex-start; max-width: none; }
  .hero-makes span { text-align: left; }
  .detail { grid-template-columns: minmax(0, 1fr); }
  .detail-gallery,
  .detail-info,
  .detail-main { width: 100%; grid-column: 1; grid-row: auto; }
  .detail-info { position: relative; top: auto; margin: 0; }
  .browse-filters { position: relative; top: auto; }
  .directory-layout { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-24); }
  .sticky-cta {
    position: fixed; z-index: 55; inset: auto 0 0 0;
    display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
    padding: var(--space-12) var(--gutter) calc(var(--space-12) + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: var(--shadow-up);
    overflow: hidden;
    visibility: hidden; transform: translateY(110%);
    transition: transform .2s ease, visibility .2s ease;
  }
  .sticky-cta.is-on { visibility: visible; transform: translateY(0); }
  body.has-sticky-cta { padding-bottom: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .sticky-cta { transition: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 45;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--space-8) var(--gutter) var(--space-16);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-header.nav-open .nav { display: flex; }
  .nav a:not(.btn) { width: 100%; min-height: 48px; border-bottom: 1px solid var(--line); }
  .nav .inline-form { width: 100%; padding-top: var(--space-12); }
  .nav .btn { width: 100%; }
  .header-inner { position: relative; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 90; width: min(82vw, 280px); transform: translateX(-100%); transition: transform .2s ease; }
  .app-shell.nav-open .sidebar { transform: translateX(0); box-shadow: var(--shadow); }
  .scrim { position: fixed; inset: 0; z-index: 80; background: var(--overlay-sidebar); }
  .app-shell.nav-open .scrim { display: block; }
  .mobile-nav-toggle { display: inline-flex; }
  .topbar-right .muted { display: none; }
  .guide-layout,
  .guide-layout-single,
  .guide-header.guide-header-has-media { grid-template-columns: 1fr; }
  .guide-layout { gap: var(--space-24); }
  .guide-toc { position: static; padding: 0 0 var(--space-16); border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .guide-header-media { aspect-ratio: 16 / 9; }
}

@media (max-width: 720px) {
  .header-inner { gap: var(--space-12); }
  .brand-lockup { gap: var(--space-8); }
  .tenant-logo-box { max-width: 120px; }
  .tenant-logo-box .brand-logo { max-width: 120px; max-height: 36px; }
  .platform-logo-box .brand-logo { max-width: 100px; max-height: 30px; }
  .platform-brand .brand-name { display: none; }
  .tenant-fallback { max-width: 140px; }
  .filter-bar,
  .grid-2,
  .how-it-works,
  .hero-search-row { grid-template-columns: minmax(0, 1fr); }
  .home-hero .hero-search { margin-inline: calc(var(--space-8) * -1); }
  .closing-cta { grid-template-columns: 1fr; }
  .split-row .btn { width: 100%; }
  /* Two cars across on a phone would squash the price; one is clearer. */
  .grid,
  #results .grid,
  .browse-results .grid { grid-template-columns: minmax(0, 1fr); }
  .detail-specs { columns: 1; }
  .feature-list { grid-template-columns: 1fr; }
  .compare-status .btn { width: 100%; }
  .compare-status { align-items: stretch; flex-direction: column; }
  .compare-grid { grid-template-columns: 1fr; }
  .sticky-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-8);
    padding-left: max(var(--space-12), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-12), env(safe-area-inset-right, 0px));
  }
  .sticky-cta-actions .btn { min-width: 0; min-height: 40px; padding-inline: var(--space-12); }
  .topbar { padding-top: var(--space-8); padding-bottom: var(--space-8); min-height: 56px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .compare-rich { padding: var(--space-16); }
  .compare-rich .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
  .compare-rich .compare-card { min-width: 0; padding: var(--space-8); }
  .compare-rich .compare-card h3 { font-size: var(--text-md); overflow-wrap: anywhere; }
  .compare-rich .compare-card-actions .btn { width: 100%; font-size: var(--text-sm); }
  .compare-rich .compare-table { min-width: 0; font-size: var(--text-sm); }
  .compare-rich .compare-table th, .compare-rich .compare-table td { padding: var(--space-8); }
}

/* ==== Full-width page bands ===============================================
   White page and navigation; pale brand headers and warm editorial cards.
   Home and calculator heroes retain their tenant brand colour bands. */

/* Margins of the last section stay inside main, then the footer follows. */
main.container { display: flow-root; }
.site-footer { margin-top: 0; }

/* ---- Page headers ------------------------------------------------------- */
.breadcrumbs {
  margin: 0 calc(50% - 50vw);
  padding: var(--space-16) var(--bleed-pad) var(--space-16);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero,
.browse-head,
.hero-panel {
  margin: 0 calc(50% - 50vw) var(--section-gap);
  padding: var(--space-8) var(--bleed-pad) var(--space-48);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
/* A title and its breadcrumbs share one continuous header band. */
.breadcrumbs:has(+ :is(.hero, .browse-head, .hero-panel, .tool-hero, .guide-page, .content-section:has(> .hero:first-child))) { border-bottom: 0; }
/* Breadcrumbs alone at the top (car page, business, sign in): grey gap below. */
.breadcrumbs + :is(.detail, .business-page) { margin-top: var(--space-24); }
.tool-hero { margin-top: 0; }
/* Browse: title, popular makes and filters share the header tint. */
.browse-head:has(+ .filter-dock) { margin-bottom: 0; padding-bottom: var(--space-16); border-bottom: 0; }
.filter-dock {
  margin: 0 calc(50% - 50vw) var(--space-24);
  padding-inline: var(--bleed-pad);
}

.breadcrumbs:has(+ :is(.hero, .browse-head, .hero-panel, .tool-hero, .content-section:has(> .hero:first-child))),
.hero,
.browse-head,
.hero-panel,
.browse-head + .filter-dock { background: var(--card-warm); }

.hero .sub { max-width: 70ch; font-size: var(--text-md); line-height: var(--leading-normal); }

.hero,
.browse-head { padding-bottom: var(--space-24); }
.hero,
.browse-head + .filter-dock { border-bottom-color: var(--line-strong); }

/* ---- Content panels ----------------------------------------------------- */
.business-page { padding: var(--card-pad-lg); }
.business-page h1 { font-size: var(--card-title); }
.business-page .profile-head { margin-bottom: var(--space-16); }
.hero-panel h1 { margin-top: var(--space-16); }
/* Results end with the same gap above the footer as every other page. */
#results,
#saved-grid { margin-bottom: var(--section-gap); }

/* /data page: live counts and the sample request form */
.data-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--gap); }
.data-stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--card-pad); }
.data-stat strong { display: block; font-size: var(--card-title); line-height: var(--leading-display); }
.data-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* /data form grouping */
.data-fieldset { border: 0; padding: 0; margin: 0 0 var(--space-24); }
.data-fieldset legend { font-weight: var(--weight-medium); margin-bottom: var(--space-8); }
.data-radios { display: grid; gap: var(--space-8); margin-bottom: var(--space-12); }

/* Advertised by box, text only (no logo) */
.dealer-box--text { display: block; }
.dealer-box--text .dealer-box-info strong { display: block; font-size: var(--card-title); }
.dealer-box--text .dealer-box-info .muted { display: block; margin-top: var(--space-8); }
.dealer-box--text .action-row { margin-top: var(--space-16); }

/* Car page: About this car section */
.features-heading { margin: var(--space-16) 0 var(--space-8); font-size: var(--text-md); }

/* Car page: smaller photo so price and key facts show sooner; external-link icon */
.detail-gallery .gallery-main { aspect-ratio: 4 / 3; height: auto; overflow: hidden; }
.detail-gallery #galleryMain { width: 100%; height: 100%; object-fit: cover; }
.ext-icon { width: 14px; height: 14px; margin-left: 6px; vertical-align: -2px; flex: 0 0 auto; }

/* Car page spacing: one rhythm (photo, button, features, link) */
.detail-gallery .btn-block { margin-top: var(--space-12); }
.feature-list { margin: 0; }
.feature-toggle { margin-top: var(--space-12); }
.panel p:has(> a.btn) { margin: var(--space-16) 0 0; }

/* Buttons: text cannot be highlighted by accident when clicking or tapping */
.btn, .icon-btn, .feature-toggle, .chip > summary { -webkit-user-select: none; user-select: none; }

/* CarVx affiliate banner (car page) and Japan history tool */
.carvx-banner { display: block; max-width: 468px; }
.carvx-banner img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.carvx-note { margin: var(--space-12) 0 0; color: var(--muted); font-size: var(--text-sm); }
.carvx-box p:first-of-type { margin: 0 0 var(--space-16); }
.carvx-tool-banner { display: block; width: 250px; max-width: 100%; }
.carvx-tool-banner img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }

/* CarVx: square banner in its own card under the price card (wide screens only).
   The wide banner in the page (under Vehicle details) shows on every screen. */
.detail-side { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: calc(var(--header-h, 65px) + var(--space-16)); min-width: 0; display: grid; gap: var(--gap); }
.detail-side .detail-info { position: static; grid-column: auto; grid-row: auto; }
.carvx-square { display: block; width: 250px; max-width: 100%; justify-self: center; }
.carvx-square img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.carvx-actions { margin-top: var(--space-16); }
@media (max-width: 1040px) {
  .detail-side { grid-column: 1; grid-row: auto; position: relative; top: auto; width: 100%; }
  .carvx-square { display: none; }
}

/* Buttons that follow text or a list get the same gap above them everywhere
   (the hero "All tools" button was touching the tick list). */
:is(p, ul, ol, form, table, .table-wrap) + .action-row { margin-top: var(--space-16); }
.tool-hero .hero-checks + .action-row,
.hero .hero-checks + .action-row { margin-top: var(--space-24); }

/* CarVx square banner centred in the tool card */
.tool-card-embed .carvx-tool-banner { margin: 0 auto; }

/* CarVx sample report: top of the long image, faded out at the bottom */
.carvx-sample { position: relative; max-height: 560px; overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.carvx-sample img { display: block; width: 100%; height: auto; }
.carvx-sample::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(to bottom, transparent, var(--surface)); pointer-events: none; }

/* Card rows with 2 or 4 cards (the base row is 3 across; one column on phones) */
@media (min-width: 721px) {
  .how-it-works--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .how-it-works--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1041px) {
  .how-it-works--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
:is(.content-section, .tool-section) .how-it-works + .how-it-works { margin-top: var(--gap); }
:is(.content-section, .tool-section) .sub + .how-it-works { margin-top: var(--space-24); }
:is(.content-section, .tool-section) .how-it-works + .muted { margin: var(--space-16) 0 0; }

.tool-section .info-card {
  padding: var(--card-pad-lg);
  background: var(--card);
  border-color: transparent;
  border-radius: var(--radius-sm);
}
.tool-section .info-card:has(> .step) {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: var(--space-8) var(--space-12);
  padding: 0;
  background: transparent;
  border: 0;
}
.tool-section .info-card > .step {
  grid-row: 1 / span 2;
  margin: 0;
  background: var(--card);
  color: var(--ink);
}
.tool-section .info-card:has(> .step) > :is(h2, p) { margin: 0; }

/* Car page on a phone: a long dealer web address in a button must wrap, not
   push the whole column wider than the screen. */
.detail-main { grid-template-columns: minmax(0, 1fr); }
.detail-main > * { min-width: 0; }
.detail-gallery .btn,
.detail-main .btn { white-space: normal; text-align: center; overflow-wrap: anywhere; line-height: var(--leading-snug); }

/* CarVx logo in the home page trust strip */
.trust-strip .carvx-strip-banner { display: block; width: 320px; max-width: 100%; margin-top: var(--space-12); }
.trust-strip .carvx-strip-banner img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
/* The News by Wire logo is white and pink, made for dark backgrounds, so it sits on the same dark as the solid buttons. */
.trust-strip .featured-logo { display: block; box-sizing: border-box; width: 220px; max-width: 100%; margin: var(--space-12) 0; padding: var(--space-12) var(--space-16); background: var(--dark); color: var(--surface); border-radius: var(--radius); }
.trust-strip .featured-logo img { display: block; width: 100%; height: auto; }
.closing-cta .sub a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Car valuation tool ------------------------------------------------- */
.val-choice-field { border: 0; margin: 0; padding: 0; }
.val-choice-field legend { padding: 0; margin-bottom: var(--space-8); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--muted); }
.val-ladder { margin-bottom: var(--space-16); }
.val-examples { list-style: none; margin: 0 0 var(--space-24); padding: 0; display: grid; gap: var(--space-8); }
.val-examples a { display: flex; justify-content: space-between; gap: var(--space-16); padding: var(--space-12) var(--space-16); background: var(--card); color: var(--ink); text-decoration: none; }
.val-examples a:hover { background: var(--card-warm-hover); }
@media (max-width: 720px) { .val-ladder { grid-template-columns: 1fr; } }

/* Jumping to a section (e.g. the valuation result) stops below the sticky header. */
.content-section[id] { scroll-margin-top: calc(var(--header-h, 65px) + var(--space-24)); }

/* Sub-companies: one table row per brand */
.brand-table .brand-swatch { display: inline-block; vertical-align: middle; margin-right: var(--space-8); }
.brand-table td input:not([type="checkbox"]) { width: 100%; min-width: 120px; }
.brand-row-actions { white-space: nowrap; }
.brand-row-actions form { display: inline; }
.brand-more > summary { cursor: pointer; color: var(--ink-soft); font-size: var(--text-sm); }
.brand-more[open] > summary { margin-bottom: var(--space-16); }
.brand-more .brand-subsection { margin-top: var(--space-16); }
.brand-add { display: flex; flex-wrap: wrap; gap: var(--space-12); align-items: center; }
.brand-add input:not([type="checkbox"]) { flex: 1 1 180px; }
.brand-inline { display: flex; flex-wrap: wrap; gap: var(--space-16); }
.brand-inline .check-field { padding: 0; }
