/* Inglewood Car Search — styled after pika.art: warm off-white canvas, ink
   black, soft tinted panels, uppercase pill controls and an extended
   grotesque for display type. Colour comes from the car photos. */
:root {
  --canvas: #faf8f4;
  --panel: #f2efea;
  --paper: #ffffff;
  --ink: #111111;
  --ink-2: #2e2e2e;
  --muted: #67645f;
  --faint: #9a968f;
  --line: #e6e1d9;
  --line-strong: #d3cdc3;
  --night: #111111;
  --night-2: #1b1b1b;
  --night-ink: #fcfaf7;
  --night-muted: rgba(252, 250, 247, .72);
  --on-ink: #fcfaf7;
  --good: #2c6a44;
  --good-soft: #e3efe5;
  --warn: #8a5a12;
  --warn-soft: #f4ead9;
  --bad: #a3322a;
  --bad-soft: #f6e2de;
  --focus: #111111;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05), 0 12px 32px rgba(17, 17, 17, .08);
  --sheet-shadow: 0 -8px 40px rgba(17, 17, 17, .18);
  --r-card: 18px;
  --r-media: 12px;
  --gutter: clamp(16px, 3vw, 40px);
  --header-h: 60px;
  --display: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #0e0e0d; --panel: #1a1918; --paper: #1f1e1c; --ink: #f4f1ec; --ink-2: #e7e3dc; --muted: #aaa59d; --faint: #7d7973;
    --line: #2b2a27; --line-strong: #3a3935; --night: #070707; --night-2: #151514; --on-ink: #111111; --focus: #f4f1ec;
    --good: #79c796; --good-soft: #17271c; --warn: #e3b366; --warn-soft: #2d2413; --bad: #ef8a80; --bad-soft: #2f1916;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35); --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #0e0e0d; --panel: #1a1918; --paper: #1f1e1c; --ink: #f4f1ec; --ink-2: #e7e3dc; --muted: #aaa59d; --faint: #7d7973;
  --line: #2b2a27; --line-strong: #3a3935; --night: #070707; --night-2: #151514; --on-ink: #111111; --focus: #f4f1ec;
  --good: #79c796; --good-soft: #17271c; --warn: #e3b366; --warn-soft: #2d2413; --bad: #ef8a80; --bad-soft: #2f1916;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35); --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 72px); }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 15px/1.5 var(--body); font-stretch: 100%; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--on-ink); padding: 8px 14px; border-radius: 999px; }
.skip:focus { left: 16px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Pills — Pika's uppercase, letter-spaced buttons */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease; }
.pill:active { transform: scale(.98); }
.pill.dark { background: var(--ink); color: var(--on-ink); }
.pill.dark:hover { background: var(--ink-2); }
.pill.light { background: #fff; color: #111; }
.pill.glass { background: rgba(252, 250, 247, .14); color: #fcfaf7; border-color: rgba(252, 250, 247, .22); backdrop-filter: blur(8px); }
.pill.outline { background: var(--paper); border-color: var(--line-strong); color: var(--ink); text-transform: none; letter-spacing: .01em; font-size: 14px; padding: 0 16px; }
.pill.outline:hover { border-color: var(--ink); }
.pill.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.pill.small { min-height: 36px; padding: 0 14px; font-size: 12px; }
.pill.wide { width: 100%; }
.pill .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 12px; letter-spacing: 0; display: inline-grid; place-items: center; }
.round-button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; flex: none; }
.text-button { border: 0; background: none; padding: 8px 4px; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink); }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: var(--header-h); display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter); background: color-mix(in srgb, var(--canvas) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.wordmark { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 17px; letter-spacing: .01em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
.wordmark span { font-weight: 500; }
.snapshot { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; text-align: right; line-height: 1.25; }
.header-sources { flex: none; }

/* Hero */
/* Wide screens: the SUV sits on the right, the headline on a dark field to
   its left. Phones: the photo sits above the headline. */
.hero { position: relative; margin: 12px var(--gutter) 0; border-radius: 24px; overflow: hidden; background: #0d0d0c; color: var(--night-ink); min-height: clamp(320px, 38vw, 520px); display: flex; align-items: flex-end; isolation: isolate; }
.hero-photo { position: absolute; top: 0; right: 0; bottom: 0; width: 74%; height: 100%; object-fit: cover; object-position: 50% 64%; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #0d0d0c 0%, #0d0d0c 24%, rgba(13, 13, 12, .78) 38%, rgba(13, 13, 12, .18) 58%, rgba(13, 13, 12, 0) 72%), linear-gradient(0deg, rgba(13, 13, 12, .55) 0%, rgba(13, 13, 12, 0) 38%); }
.hero-credit { position: absolute; right: 14px; bottom: 12px; z-index: 1; font-size: 11px; letter-spacing: .02em; color: rgba(252, 250, 247, .78); text-decoration: none; padding: 3px 9px; border-radius: 999px; background: rgba(13, 13, 12, .35); backdrop-filter: blur(6px); }
.hero-credit:hover { color: #fff; }
.hero-inner { padding: clamp(20px, 4vw, 48px); max-width: min(680px, 60%); }
.kicker { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--night-muted); }
.hero h1 { margin: 0 0 16px; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(34px, 4.8vw, 72px); line-height: .94; letter-spacing: .005em; text-transform: uppercase; text-wrap: balance; }
.rule-list { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rule-list li { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: rgba(252, 250, 247, .12); border: 1px solid rgba(252, 250, 247, .2); color: #fcfaf7; backdrop-filter: blur(6px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Tabs */
.tabs { display: flex; gap: 4px; margin: 20px var(--gutter) 0; padding: 4px; background: var(--panel); border-radius: 999px; width: fit-content; max-width: calc(100% - 2 * var(--gutter)); }
.tab { border: 0; background: transparent; border-radius: 999px; min-height: 40px; padding: 0 18px; font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.tab.active { background: var(--ink); color: var(--on-ink); }
.tab-count { font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }

/* Toolbar: search + controls in one sticky row on wide screens; on phones
   the search scrolls away and only the Filters/Sort row stays pinned. */
.tools { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--header-h)); z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px var(--gutter); background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(14px); margin-top: 8px; }
.search { flex: 1 1 320px; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px 0 16px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line-strong); }
.search:focus-within { border-color: var(--ink); }
.search svg { color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.clear-search { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--panel); cursor: pointer; font-size: 18px; line-height: 1; }
.controls { display: flex; align-items: center; gap: 8px; flex: none; }
.layout-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel); flex: none; }
.layout-switch button { width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.layout-switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

/* Quick chips */
.quick { display: flex; gap: 8px; padding: 2px var(--gutter) 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
.quick::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.chip .n { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.chip:disabled { opacity: .45; cursor: default; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 0 var(--gutter) 48px; align-items: start; }

/* Filters: bottom sheet on small screens, sidebar on large ones */
.filters { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: min(88vh, 100%); display: flex; flex-direction: column; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--sheet-shadow); transform: translateY(105%); transition: transform .26s cubic-bezier(.2, .8, .2, 1); visibility: hidden; }
.filters.open { transform: none; visibility: visible; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; }
.sheet-head h2 { margin: 0; flex: 1; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .02em; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 12px; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--paper); }
.group { border-top: 1px solid var(--line); }
.group:first-child { border-top: 0; }
.group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; cursor: pointer; font-weight: 600; font-size: 15px; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::after { content: ""; width: 9px; height: 9px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s ease; flex: none; }
.group[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.group summary .value { margin-left: auto; color: var(--muted); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.group-body { padding: 0 0 16px; display: grid; gap: 10px; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button, .option-chips button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--paper); font-size: 14px; cursor: pointer; }
.segmented button[aria-pressed="true"], .option-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.option-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.option-chips .n { color: var(--faint); font-size: 12px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.option-chips button[aria-pressed="true"] .n { color: inherit; opacity: .7; }
.checklist { display: grid; gap: 2px; }
.checklist.two { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; font-size: 15px; min-width: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; margin: 0; }
.check .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check .n { color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.check.zero { color: var(--faint); }
.make-search { min-height: 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--canvas); padding: 0 14px; font-size: 15px; width: 100%; }

/* Dual range */
.range { position: relative; height: 34px; }
.range input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; height: 34px; }
.range input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); cursor: grab; position: relative; z-index: 2; }
.range input[type=range]::-moz-range-thumb { pointer-events: auto; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); cursor: grab; }
.range input[type=range]::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.range input[type=range]::-moz-range-track { background: transparent; }
.range .track { position: absolute; left: 13px; right: 13px; top: 15px; height: 4px; border-radius: 4px; background: var(--line-strong); }
.range .fill { position: absolute; top: 15px; height: 4px; border-radius: 4px; background: var(--ink); }
.range-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Results */
.results { min-width: 0; }
.results-head { display: grid; gap: 10px; margin-bottom: 14px; }
.results-title { margin: 0; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(20px, 2.6vw, 28px); text-transform: uppercase; letter-spacing: .01em; }
.results-title small { font-family: var(--body); font-stretch: 100%; font-weight: 500; font-size: 14px; color: var(--muted); text-transform: none; letter-spacing: 0; margin-left: 6px; }
.active { display: flex; flex-wrap: wrap; gap: 6px; }
.active:empty { display: none; }
.active button { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--panel); font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.active button::after { content: "×"; font-size: 16px; color: var(--muted); }
.active .clear { background: transparent; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.active .clear::after { content: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 18px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--panel); border-radius: var(--r-card); padding: 8px; min-width: 0; }
.card.is-hidden { opacity: .5; }
.media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-media); overflow: hidden; background: var(--line); border: 0; padding: 0; cursor: pointer; }
.media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.card:hover .media img { transform: scale(1.03); }
.media .nophoto { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.media .flags { position: absolute; z-index: 2; left: 10px; top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.flag { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: #fff; color: #111; }
.flag.dark { background: rgba(17, 17, 17, .86); color: #fcfaf7; }
.media .photos { position: absolute; z-index: 2; right: 10px; bottom: 10px; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(17, 17, 17, .7); color: #fff; }
.save { position: absolute; z-index: 3; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .94); color: #111; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.save svg { width: 20px; height: 20px; }
.save[aria-pressed="true"] { background: #111; color: #fcfaf7; }
.save[aria-pressed="true"] svg { fill: currentColor; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 8px 6px; flex: 1; }
.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.price { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.otd { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.otd strong { color: var(--ink); font-weight: 700; }
.car-title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
.car-title button { all: unset; cursor: pointer; }
.car-title button:hover { text-decoration: underline; text-underline-offset: 3px; }
.facts { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.facts b { color: var(--ink); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--paper); color: var(--muted); white-space: nowrap; }
.tag.good { background: var(--good-soft); color: var(--good); font-weight: 600; }
.tag.warn { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.tag.bad { background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.note.warn { color: var(--warn); }
.card-actions { display: grid; gap: 4px; margin-top: auto; padding-top: 6px; }
.card-actions .pill { width: 100%; min-width: 0; min-height: 44px; }
.card-actions .pill span { overflow: hidden; text-overflow: ellipsis; }
.minor { display: flex; align-items: center; gap: 14px; min-width: 0; }
.minor .text-button { font-size: 14px; padding: 8px 2px; min-height: 40px; }
.also { margin-left: auto; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.gallery-more { position: absolute; left: 12px; bottom: 12px; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: #111; text-decoration: none; font-weight: 600; }

/* List layout */
.cards.list { grid-template-columns: 1fr; gap: 10px; }
.cards.list .card { flex-direction: row; gap: 14px; align-items: stretch; }
.cards.list .media { width: clamp(120px, 24vw, 220px); aspect-ratio: 4 / 3; flex: none; align-self: center; }
.cards.list .card-body { padding: 6px 8px 6px 0; }
.cards.list .note, .cards.list .also { display: none; }
.cards.list .card-actions { grid-template-columns: minmax(0, 260px) auto; align-items: center; column-gap: 12px; }
.cards.list .save { top: 14px; right: auto; left: 14px; width: 34px; height: 34px; }
.cards.list .media .flags { left: auto; right: 8px; }

.empty { text-align: center; padding: 48px 20px; background: var(--panel); border-radius: var(--r-card); display: grid; gap: 10px; justify-items: center; }
.empty-title { margin: 0; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 20px; text-transform: uppercase; }
.empty p { margin: 0; max-width: 46ch; color: var(--muted); }

/* Sheets and drawer */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 10, 10, .45); backdrop-filter: blur(2px); }
.sort-sheet { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: var(--sheet-shadow); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.sort-options { display: grid; padding: 0 10px 8px; }
.sort-option { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; text-align: left; font-size: 16px; cursor: pointer; }
.sort-option:hover { background: var(--panel); }
.sort-option .dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: grid; place-items: center; }
.sort-option[aria-checked="true"] { font-weight: 700; }
.sort-option[aria-checked="true"] .dot { border-color: var(--ink); }
.sort-option[aria-checked="true"] .dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.sort-option .hint { margin-left: auto; color: var(--faint); font-size: 13px; font-weight: 400; }

.drawer { position: fixed; z-index: 70; inset: 0; background: var(--canvas); overflow-y: auto; overscroll-behavior: contain; }
.drawer-top { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.drawer-top h2 { margin: 0; flex: 1; min-width: 0; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery { position: relative; background: #0b0b0b; }
.gallery-main { display: block; width: 100%; aspect-ratio: 4 / 3; max-height: 62vh; object-fit: contain; background: #0b0b0b; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .9); color: #111; font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-count { position: absolute; right: 12px; bottom: 12px; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(17, 17, 17, .7); color: #fff; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 14px; background: var(--panel); scrollbar-width: thin; }
.thumbs button { flex: none; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--ink); }
.thumbs img { width: 76px; height: 57px; object-fit: cover; display: block; }
.detail { padding: 18px var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 22px; max-width: 880px; margin: 0 auto; }
.detail-head { display: grid; gap: 6px; }
.detail-head h3 { margin: 0; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(22px, 4vw, 32px); line-height: 1.02; text-transform: uppercase; text-wrap: balance; }
.detail-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.detail-price .price { font-size: 34px; }
.block { background: var(--panel); border-radius: var(--r-card); padding: 16px; }
.block h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr; margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.cost { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.cost td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.cost td:last-child { text-align: right; font-weight: 600; white-space: nowrap; padding-left: 12px; }
.cost tr.total td { border-bottom: 0; font-weight: 800; font-size: 18px; }
.vin { font-family: var(--mono); font-size: 14px; letter-spacing: .05em; overflow-wrap: anywhere; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 15px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; }
.reasons li::before { content: "✓"; font-weight: 700; color: var(--good); flex: none; width: 16px; }
.reasons li.warn::before { content: "!"; color: var(--warn); text-align: center; }
.reasons li.warn { color: var(--warn); }
.where { display: grid; gap: 8px; }
.where a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--paper); text-decoration: none; }
.where a:hover { outline: 1px solid var(--line-strong); }
.where .site { font-weight: 600; flex: 1; min-width: 0; }
.where .site small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.where .num { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; white-space: nowrap; }
.where .num strong { color: var(--ink); }
.desc { margin: 0; white-space: pre-line; font-size: 15px; line-height: 1.55; max-height: 320px; overflow: auto; }
.checklist-plain { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 15px; }
.drawer-actions { position: fixed; z-index: 72; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--canvas) 94%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.drawer-actions .pill.dark { flex: 1; min-width: 0; }
.drawer-actions .pill.dark span { overflow: hidden; text-overflow: ellipsis; }

/* Sources */
.sources { padding: 8px var(--gutter) 48px; }
.section-title { margin: 8px 0 6px; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: clamp(24px, 3.4vw, 36px); line-height: 1; text-transform: uppercase; }
.section-lede { margin: 0 0 18px; color: var(--muted); max-width: 70ch; }
.source-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 12px; }
.source { background: var(--panel); border-radius: var(--r-card); padding: 16px; display: grid; gap: 8px; align-content: start; }
.source-top { display: flex; align-items: center; gap: 10px; }
.source-name { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; }
.status { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status.ok { background: var(--good-soft); color: var(--good); }
.status.partial, .status.via { background: var(--warn-soft); color: var(--warn); }
.status.blocked, .status.error { background: var(--bad-soft); color: var(--bad); }
.status.none, .status.manual { background: var(--paper); color: var(--muted); }
.source-stats { display: flex; gap: 18px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.source-stats b { color: var(--ink); font-size: 18px; font-weight: 700; display: block; }
.source-note { margin: 0; font-size: 14px; color: var(--muted); }
.source a { font-size: 14px; font-weight: 600; text-underline-offset: 3px; }
.excluded { margin-top: 18px; background: var(--night); color: var(--night-ink); border-radius: var(--r-card); padding: 20px; }
.excluded h3 { margin: 0 0 6px; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 18px; text-transform: uppercase; }
.excluded p { margin: 0 0 12px; color: var(--night-muted); font-size: 14px; }
.excluded ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 24px; }
.excluded li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(252, 250, 247, .12); font-size: 14px; font-variant-numeric: tabular-nums; }

.to-top { position: fixed; z-index: 25; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--ink); color: var(--on-ink); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }

.site-footer { background: var(--night); color: var(--night-muted); padding: 32px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
.site-footer p { margin: 0; max-width: 80ch; }
.footer-title { color: var(--night-ink); font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 16px; text-transform: uppercase; margin-bottom: 6px !important; }

/* Tablets and phones: the photo sits above the headline */
@media (max-width: 1023px) {
  .hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .hero-photo { position: relative; width: 100%; height: auto; aspect-ratio: 16 / 9; object-position: 50% 62%; z-index: 0; }
  .hero-shade { display: none; }
  .hero-credit { top: 10px; right: 10px; bottom: auto; }
  .hero-inner { max-width: none; width: 100%; }
  .hero h1 { font-size: clamp(28px, 7vw, 56px); }
}

/* Phones and small tablets */
@media (max-width: 719px) {
  .site-header { position: relative; top: 0; }
  .tools { display: contents; }
  .search { margin: 12px var(--gutter) 0; flex: none; }
  .controls { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; margin-top: 4px; padding: 10px var(--gutter); background: color-mix(in srgb, var(--canvas) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .controls .pill.outline { flex: 1; min-width: 0; padding: 0 12px; }
  .controls .pill.outline span:not(.badge) { overflow: hidden; text-overflow: ellipsis; }
  .quick { padding-top: 10px; }
  html { scroll-padding-top: 76px; }
  .hero-inner { padding: 20px 18px 18px; }
  .hero h1 { font-size: clamp(28px, 8.4vw, 40px); margin-bottom: 12px; }
  .kicker { letter-spacing: .1em; }
  .rule-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 16px; padding: 0 18px; }
  .rule-list::-webkit-scrollbar { display: none; }
  .rule-list li { flex: none; font-size: 12px; padding: 4px 10px; }
  .hero-actions .pill.glass { display: none; }
  .hero-actions .pill { flex: 1; }
}
@media (max-width: 480px) {
  .snapshot { display: none; }
  .wordmark span { display: none; }
  .header-sources { margin-left: auto; }
  .hero { margin-top: 8px; border-radius: 20px; }
  .hero-actions .pill { flex: 1; }
  .tabs { width: auto; }
  .tab { flex: 1; justify-content: center; padding: 0 10px; }
  .cards { gap: 14px; }
  .checklist.two { grid-template-columns: 1fr; }
  .cards.list .card { gap: 10px; }
  .cards.list .media { width: 112px; }
  .cards.list .price { font-size: 20px; }
  .cards.list .tags, .cards.list .card-actions { display: none; }
  .card-actions .pill.ghost { padding: 0 12px; }
}
@media (max-width: 420px) {
  .controls { gap: 6px; }
  .controls .pill.outline { padding: 0 10px; gap: 6px; font-size: 13px; }
}
@media (max-width: 360px) {
  .layout-switch { display: none; }
  .hero h1 { font-size: 30px; }
}

/* Tablets and up: sort becomes a popover under its button */
@media (min-width: 720px) {
  .sort-sheet { left: auto; right: var(--gutter); bottom: auto; top: calc(var(--header-h) + 64px); width: 320px; border-radius: 18px; box-shadow: var(--shadow); border: 1px solid var(--line); padding-bottom: 8px; }
  .kv { grid-template-columns: 1fr 1fr; column-gap: 24px; }
  .kv div:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
  .drawer { inset: 0 0 0 auto; width: min(760px, 100%); box-shadow: -12px 0 48px rgba(0, 0, 0, .18); }
  .drawer-actions { left: auto; width: min(760px, 100%); }
  .detail { padding-left: 24px; padding-right: 24px; }
}

/* Desktop: filters become a sticky sidebar */
@media (min-width: 1100px) {
  .layout { grid-template-columns: 300px minmax(0, 1fr); }
  .filters { position: sticky; top: calc(var(--header-h) + 76px); z-index: 1; max-height: calc(100vh - var(--header-h) - 92px); transform: none; visibility: visible; border-radius: var(--r-card); background: var(--panel); box-shadow: none; transition: none; }
  .filters .sheet-close, .filters .sheet-foot { display: none; }
  .filters .sheet-head { padding: 16px 18px 6px; }
  #open-filters { display: none; }
  .quick { flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 1700px) {
  .cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
