/* CarPaintCode: neutral warm-grey chrome so swatches read true; one petrol accent for actions. */
:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --ink: #1c1b1a;
  --muted: #5d5954;
  --line: #e2dfd9;
  --accent: #0b5d6b;
  --accent-ink: #ffffff;
  --accent-hover: #084955;
  --warn-bg: #fff4e0;
  --warn-ink: #6b4300;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 27, 26, .06), 0 4px 14px rgba(28, 27, 26, .06);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: .95em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); margin: .2em 0 .35em; }
h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); margin: 0 0 .7em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 70ch; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* header / footer */
.top { background: var(--ink); color: #fff; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand b { font-family: var(--mono); font-weight: 700; color: #f2c14e; margin-left: 1px; }
.brand:hover { color: inherit; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: #e9e6e1; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.foot { margin-top: 64px; background: #eceae5; border-top: 1px solid var(--line); }
.foot-in { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; padding-top: 32px; padding-bottom: 40px; }
.foot nav { display: grid; gap: 6px; align-content: start; }
.foot .brand { color: var(--ink); }
.foot .brand b { color: var(--accent); }
.foot p { max-width: 52ch; font-size: .9rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* hero + finder */
.hero { background: linear-gradient(180deg, #1c1b1a 0, #2a2826 100%); color: #fff; padding: 48px 0 56px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.hero h1 { color: #fff; }
.hero .lead { color: #d8d4ce; }
.hero-note { color: #b9b4ad; font-size: .9rem; }
.finder { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; background: rgba(255, 255, 255, .06); padding: 16px; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .1); }
.finder label { display: grid; gap: 6px; font-size: .85rem; color: #d8d4ce; font-weight: 500; }
select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 1rem var(--sans); width: 100%; }
select:disabled { opacity: .6; }
.hero-art { position: relative; height: 260px; }
.chip { position: absolute; left: 50%; bottom: 10px; width: 64px; height: 230px; margin-left: -32px; border-radius: 12px 12px 8px 8px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 75%, #fff) 0, var(--c) 40%, color-mix(in srgb, var(--c) 70%, #000) 100%); box-shadow: 0 6px 18px rgba(0, 0, 0, .35); transform-origin: 50% 92%; transform: rotate(calc(-48deg + var(--i) * 16deg)); }
.chip::after { content: ""; position: absolute; bottom: 14px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #1c1b1a; box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }

/* blocks */
.block { margin-top: 40px; }
.band { background: #ebe8e2; margin-top: 48px; padding: 8px 0 40px; }
.band .block { margin-top: 32px; }
.steps ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 0; list-style: none; counter-reset: s; }
.steps li { background: var(--surface); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; margin-bottom: 10px; }
.steps strong { display: block; }
.more { font-weight: 600; }

.makes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.make-card { display: grid; gap: 4px; padding: 0 0 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .15s; }
.make-card:hover { transform: translateY(-2px); color: var(--ink); }
.make-card strong, .make-card small { padding: 0 14px; }
.make-card small { color: var(--muted); }
.strip { display: flex; height: 28px; margin-bottom: 8px; }
.strip i { flex: 1; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { display: grid; gap: 6px; padding: 18px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.card span { color: var(--muted); font-size: .95rem; }
.card:hover { color: var(--ink); outline: 2px solid var(--accent); }

/* breadcrumbs + page head */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 20px 0 0; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.page-head { margin-top: 8px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters label { display: grid; gap: 4px; font-size: .85rem; font-weight: 600; color: var(--muted); min-width: 160px; }

/* swatches */
.sw { display: block; background: var(--c, #ccc); }
.sw-metallic { background: linear-gradient(135deg, color-mix(in srgb, var(--c) 72%, #fff) 0, var(--c) 42%, color-mix(in srgb, var(--c) 78%, #000) 100%); }
.sw-pearl { background: radial-gradient(120% 90% at 20% 15%, color-mix(in srgb, var(--c) 65%, #fff) 0, transparent 55%), linear-gradient(135deg, var(--c) 0, color-mix(in srgb, var(--c) 82%, #6a5acd) 100%); }
.sw-matte { background: var(--c); filter: saturate(.9); }
.sw-none { background: repeating-linear-gradient(45deg, #e9e6e1 0 8px, #f5f4f1 8px 16px) !important; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile { display: grid; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .15s; }
.tile:hover { transform: translateY(-2px); color: var(--ink); }
.tile-sw { height: 72px; }
.tile-t { display: grid; padding: 10px 12px 12px; gap: 2px; font-size: .9rem; overflow-wrap: anywhere; }
.tile-t code { font-weight: 700; font-size: 1rem; }
.tile-t small { color: var(--muted); }

.colours { list-style: none; padding: 0; margin: 24px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.colours li > a, .colours li > div { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-height: 84px; }
.colours li > a:hover { outline: 2px solid var(--accent); }
.colours li.hit > a, .colours li.hit > div { outline: 3px solid #f2c14e; }
.col-sw { width: 64px; height: 64px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.col-t { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.col-t strong { font-size: .95rem; line-height: 1.3; }
.col-t small, .col-t em { color: var(--muted); font-size: .85rem; }
.empty { padding: 16px; background: var(--surface); border-radius: var(--radius); }

.models { list-style: none; padding: 0; columns: 4 200px; column-gap: 24px; }
.models li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--line); }
.models a { text-decoration: none; font-weight: 500; }
.models small { color: var(--muted); }

.shade { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 10px; }
.shade summary { padding: 14px 16px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 10px; min-height: 44px; }
.shade summary small { color: var(--muted); font-weight: 400; }
.codes { list-style: none; padding: 0 16px 16px; margin: 0; columns: 3 240px; column-gap: 24px; }
.codes li { break-inside: avoid; padding: 3px 0; }
.codes a { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--ink); }
.codes a:hover code { color: var(--accent); }
.mini { width: 16px; height: 16px; border-radius: 4px; background: var(--c, #ddd); flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.dot-white { background: #f4f4f2; } .dot-silver { background: #c3c6c8; } .dot-grey { background: #6e7275; } .dot-black { background: #161616; }
.dot-blue { background: #1f4e9a; } .dot-red { background: #b3161f; } .dot-green { background: #2f6b3a; } .dot-yellow { background: #e7c21b; }
.dot-orange { background: #e0661b; } .dot-brown { background: #6b4226; } .dot-beige { background: #d8c6a0; } .dot-purple { background: #5b2e7a; }
.dot-pink { background: #e88fb0; } .dot-unknown { background: repeating-linear-gradient(45deg, #ccc 0 3px, #fff 3px 6px); }

/* code page */
.code-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; margin-top: 16px; align-items: start; }
.big-sw { min-height: 300px; border-radius: 18px; padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, .06); color: #111; }
.big-code { font: 700 2.4rem/1 var(--mono); }
.big-name { font-size: 1.1rem; font-weight: 600; opacity: .9; }
.code-facts h1 code { background: var(--ink); color: #f2c14e; padding: 0 .25em; border-radius: 6px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 16px 0 0; padding: 16px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; }
.warn { background: var(--warn-bg); color: var(--warn-ink); padding: 12px 14px; border-radius: 10px; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { background: #f0eee9; font-weight: 600; }
td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.callout { background: var(--surface); padding: 20px; border-radius: var(--radius); border-left: 5px solid var(--accent); box-shadow: var(--shadow); }
.callout h2 { margin-bottom: .4em; }

/* prose + diagram */
.prose { max-width: 75ch; }
.prose.wide { max-width: 860px; }
.prose li { margin: .35em 0; }
.prose code { background: #ebe8e2; padding: .05em .35em; border-radius: 5px; }
.diagram { margin: 24px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.diagram .car { fill: #d9d6d0; stroke: #8a857e; stroke-width: 2; }
.diagram .glass { fill: #f5f4f1; stroke: #8a857e; stroke-width: 1.5; }
.diagram .seam { stroke: #8a857e; stroke-width: 1.5; stroke-dasharray: 4 3; }
.diagram .wheel { fill: #2a2826; } .diagram .hub { fill: #a9a49c; }
.diagram .spot circle { fill: var(--accent); stroke: #fff; stroke-width: 3; }
.diagram .spot text { fill: #fff; font: 700 15px var(--sans); text-anchor: middle; }
.diagram figcaption ol { margin: 8px 0 0; }

@media (max-width: 860px) {
  .hero-in, .code-hero, .foot-in { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .finder { grid-template-columns: 1fr; }
  .steps ol { grid-template-columns: 1fr; }
  .big-sw { min-height: 200px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
