:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #16181d; --muted: #5d6573; --line: #e2e5ea;
  --accent: #1d4ed8; --accent-text: #ffffff;
  --g: #15803d; --g-bg: #e8f5ec; --a: #b45309; --a-bg: #fdf3e2; --r: #b91c1c; --r-bg: #fce9e9;
  --x: #475569; --x-bg: #edf0f4;
  --plate: #f7c600; --plate-text: #111;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1115; --surface: #171a20; --text: #e8eaee; --muted: #9aa3b2; --line: #2a2f38;
    --accent: #6c95ff; --accent-text: #0b0d12;
    --g: #4ade80; --g-bg: #12261a; --a: #fbbf24; --a-bg: #2a2111; --r: #f87171; --r-bg: #2c1515;
    --x: #a3aec0; --x-bg: #1e232b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a20; --text: #e8eaee; --muted: #9aa3b2; --line: #2a2f38;
  --accent: #6c95ff; --accent-text: #0b0d12;
  --g: #4ade80; --g-bg: #12261a; --a: #fbbf24; --a-bg: #2a2111; --r: #f87171; --r-bg: #2c1515;
  --x: #a3aec0; --x-bg: #1e232b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 4px; }
.lead { color: var(--muted); margin: 0 0 20px; }
form { display: flex; gap: 8px; }
.plate {
  flex: 1; min-width: 0; font: 700 1.5rem/1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: .08em; text-transform: uppercase; text-align: center;
  background: var(--plate); color: var(--plate-text); border: 2px solid #111; border-radius: 8px;
  padding: 12px 8px;
}
.plate::placeholder { color: rgba(0,0,0,.35); }
button {
  font: 600 1rem system-ui, sans-serif; padding: 0 20px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--accent-text); cursor: pointer;
}
button:focus-visible, .plate:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.privacy { font-size: .85rem; color: var(--muted); margin: 8px 0 24px; }
.msg { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.verdict { display: flex; gap: 14px; align-items: center; padding: 16px; }
.verdict .dot { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; }
.verdict strong { display: block; font-size: 1.25rem; }
.verdict span.sub { color: var(--muted); font-size: .95rem; }
.v-g .verdict { background: var(--g-bg); } .v-g .dot { background: var(--g); }
.v-a .verdict { background: var(--a-bg); } .v-a .dot { background: var(--a); }
.v-r .verdict { background: var(--r-bg); } .v-r .dot { background: var(--r); }
.v-x .verdict { background: var(--x-bg); } .v-x .dot { background: var(--x); }
section { padding: 16px; border-top: 1px solid var(--line); }
h2 { font-size: 1.2rem; margin: 0; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); font-size: .9rem; }
ul { margin: 0; padding: 0; list-style: none; }
.reasons li { padding: 6px 0 6px 26px; position: relative; }
.reasons li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.reasons .red::before { background: var(--r); } .reasons .amber::before { background: var(--a); }
.reasons .ok::before { background: var(--g); }
.bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.codes li { padding: 4px 0; }
.hist details, .hist .row { border-bottom: 1px solid var(--line); }
.hist summary, .hist .row { display: flex; flex-wrap: wrap; gap: 0 12px; padding: 8px 0; }
.hist summary { cursor: pointer; list-style: none; }
.hist summary::-webkit-details-marker { display: none; }
.hist summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.hist details[open] summary::after { content: "▴"; }
.hist .row { padding-right: 18px; }
.hist .when { font-weight: 600; min-width: 9.5em; }
.hist .what { color: var(--muted); }
.hist details .codes { padding: 0 0 10px; }
.hist details.more { border-bottom: 0; }
.hist details.more > summary { color: var(--accent); font-weight: 600; }
.hist details.more > summary::after { content: none; }
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.tag.defect { background: var(--r-bg); color: var(--r); } .tag.advisory { background: var(--a-bg); color: var(--a); }
.tag.same { background: var(--x-bg); color: var(--x); margin: 0 6px 0 0; }
.tag.wear { background: var(--x-bg); color: var(--x); margin: 0 0 0 6px; }
.codes .sys { display: block; font-size: .8rem; color: var(--muted); margin-left: 2px; }
.issues li { padding: 10px 0 10px 14px; border-left: 3px solid var(--line); margin-bottom: 8px; }
.issues .status { margin-top: 2px; font-size: .95rem; }
.issues .ok { border-color: var(--g); } .issues .warn { border-color: var(--a); }
.issues .seen { border-color: var(--x); } .issues .check { border-color: var(--accent); }
.recalls li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.recalls summary { cursor: pointer; color: var(--accent); font-size: .9rem; margin-top: 4px; }
.plain li { padding: 4px 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); font-size: .85rem; }
td.num, th.num { text-align: right; }
td:first-child { white-space: nowrap; }
dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; margin: 0; }
dt { color: var(--muted); } dd { margin: 0; overflow-wrap: anywhere; }
.cta { background: var(--x-bg); }
.btn { display: inline-block; margin-top: 8px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
footer { margin-top: 24px; font-size: .85rem; color: var(--muted); }
@media (max-width: 420px) { dl { grid-template-columns: 1fr; gap: 0; } dd { margin-bottom: 8px; } }

/* Model pages */
.brand { font-weight: 800; letter-spacing: .02em; color: var(--accent); margin: 0 0 8px; }
main.doc { max-width: 760px; }
.crumbs { font-size: .9rem; margin-bottom: 12px; }
.crumbs a, .doc a { color: var(--accent); }
.doc section { padding: 16px 0; }
.doc h2 { margin-bottom: 8px; }
.doc dl { margin-bottom: 8px; }
.scroll { overflow-x: auto; }
td.better { color: var(--g); font-weight: 600; } td.worse { color: var(--r); font-weight: 600; }
.doc .plain li { padding: 4px 0; }
.picker { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: end; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 16px; }
.picker label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); flex: 1 1 140px; }
.picker select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-top: 2px; }
#pk-out { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; }
#pk-out:empty { display: none; }
.doc details > summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 8px 0; }
