:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --ink: #17191c;
  --muted: #5d636b;
  --line: #e2e2dc;
  --accent: #1d5bd8;
  --accent-ink: #ffffff;
  --ok: #157347;
  --ok-bg: #e6f4ec;
  --warn: #8a5300;
  --warn-bg: #fdf1dc;
  --base: #1d5bd8;
  --opt: #e0892b;
  --dest: #8d96a3;
  --diff: #fff7d6;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .04);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111315;
    --surface: #1a1d20;
    --ink: #eceef0;
    --muted: #a0a7b0;
    --line: #2c3035;
    --accent: #6f9cff;
    --accent-ink: #0d1117;
    --ok: #5fd39a;
    --ok-bg: #12291e;
    --warn: #f3b562;
    --warn-bg: #2d2313;
    --base: #6f9cff;
    --opt: #f0a556;
    --dest: #6b7480;
    --diff: #2b2814;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.logo-mark { color: var(--accent); font-size: 1.3rem; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.top nav a:hover { background: var(--bg); color: var(--ink); }

.hero { padding: 48px 0 28px; }
.hero-sm { padding: 36px 0 12px; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); margin: 6px 0 10px; }
.eyebrow { color: var(--muted); font-size: .9rem; margin: 0; }
.eyebrow a { color: inherit; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 720px; margin: 0 0 20px; }

.vin-form, .compare-form { display: flex; gap: 10px; max-width: 680px; }
.vin-form input, .compare-form textarea {
  flex: 1; min-width: 0; font: inherit; font-size: 1.1rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 14px 16px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
}
.compare-form { flex-direction: column; align-items: flex-start; }
.compare-form textarea { width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; }
.vin-form input:focus, .compare-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
button, .btn {
  font: inherit; font-weight: 600; border: 0; border-radius: var(--radius); padding: 12px 18px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); }
.hint { color: var(--muted); font-size: .9rem; margin-top: 8px; }

.band { padding: 28px 16px; }
.grid3 { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid3 h2 { font-size: 1.1rem; margin-bottom: 4px; }
.grid3 p { color: var(--muted); margin-top: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 8px 0 20px; }
.loading p { color: var(--muted); margin: 0; }
.progress { height: 8px; margin-top: 14px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.result-head h2 { margin: 2px 0 0; font-size: 1.5rem; }
.vin-chip { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; color: var(--muted); margin: 0; letter-spacing: .04em; }
.badge { font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.ok { color: var(--ok); }
.warn { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 8px; }

.found-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; margin-top: 12px; }
@media (max-width: 860px) { .found-grid { grid-template-columns: 1fr; } }
.pdf canvas { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 200px; }
.pdf p { margin: 6px 0 0; }
.msrp { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.msrp span { color: var(--muted); }
.msrp strong { font-size: 2rem; letter-spacing: -.02em; }
.bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: 14px 0 10px; background: var(--bg); }
.b-base { background: var(--base); }
.b-opt { background: var(--opt); }
.b-dest { background: var(--dest); }
.breakdown { margin: 0; }
.breakdown div { display: flex; justify-content: space-between; padding: 4px 0; }
.breakdown dt { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.breakdown dd { margin: 0; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

table { border-collapse: collapse; width: 100%; }
.options, .specs, .cov, .compare { margin-top: 14px; font-size: .95rem; }
.options th, .options td, .specs th, .specs td, .cov th, .cov td, .compare th, .compare td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.options td:last-child, .options th:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.specs caption { text-align: left; color: var(--muted); font-size: .85rem; padding-bottom: 4px; }
.specs th { color: var(--muted); font-weight: 500; width: 38%; }
.table-wrap { overflow-x: auto; }
.cov th, .compare thead th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.compare th { font-weight: 500; }
.compare td { font-variant-numeric: tabular-nums; }
.compare tr.differs td, .compare tr.differs th { background: var(--diff); }
.compare tr.section th { padding-top: 18px; font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--line); }
.compare tr.total td { font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 6px; }
.codes { margin-top: 12px; color: var(--muted); font-size: .85rem; }
.codes p { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word; }
.tips { color: var(--muted); }

.brand-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 24px; }
.brand-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--ink); }
.brand-card span { color: var(--muted); font-size: .85rem; }
.brand-card:hover { border-color: var(--accent); }

.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 8px 0 0; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; font-size: .9rem; }
.foot p { max-width: 760px; }

@media (max-width: 560px) {
  .vin-form { flex-direction: column; }
  .vin-form button { width: 100%; justify-content: center; }
  .msrp strong { font-size: 1.6rem; }
}

.listing { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.listing h3 { margin: 0 0 8px; font-size: 1.05rem; }
.listing textarea { width: 100%; font: .9rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; resize: vertical; }
.prose { max-width: 680px; }
.example { max-width: 460px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
