:root{color-scheme:light dark;--bg:#f6f6f8;--card:#fff;--text:#1a1a22;--muted:#666a78;--accent:#d7191f;--line:#e2e3e9}
@media(prefers-color-scheme:dark){:root{--bg:#121218;--card:#1c1c25;--text:#ececf2;--muted:#9a9eb0;--line:#2c2c38}}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.wrap{max-width:1100px;margin:0 auto;padding:0 16px}
.top{background:var(--card);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5;padding:16px 0}
h1{margin:0;font-size:1.6rem;display:flex;align-items:center;gap:10px}
.stripe{width:28px;height:8px;border-radius:4px;background:var(--accent)}
.sub{margin:2px 0 12px;color:var(--muted)}
.controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px}
#q{grid-column:1/-1}
.dd{position:relative;min-width:0}
.dd summary{list-style:none;cursor:pointer;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);display:flex;justify-content:space-between;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dd summary::-webkit-details-marker{display:none}
.dd summary::after{content:"▾";flex:none}
.dd.active summary{border-color:var(--accent)}
.ddmenu{position:absolute;z-index:20;top:calc(100% + 4px);left:0;min-width:100%;max-height:50vh;overflow:auto;background:var(--card);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.25);padding:4px}
.ddmenu button{display:block;width:100%;text-align:left;padding:6px 10px;border:0;border-radius:6px;background:none;color:var(--text);font:inherit;cursor:pointer}
.ddmenu button:hover{background:var(--bg)}
.ddmenu label{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:6px;cursor:pointer;white-space:nowrap}
.ddmenu label[hidden]{display:none}
.ddmenu label:hover{background:var(--bg)}
.ddmenu input{margin:0;accent-color:var(--accent)}
input:not([type=checkbox]),select{padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--text);font:inherit;min-width:0}
.count{color:var(--muted);margin:16px 0 8px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;padding-bottom:32px}
.card{display:block;text-decoration:none;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;color:inherit;transition:transform .12s,box-shadow .12s}
.card:hover,.card:focus-visible{transform:translateY(-2px);box-shadow:0 6px 18px rgba(0,0,0,.15);outline:2px solid var(--accent)}
.thumb{aspect-ratio:16/10;background:linear-gradient(135deg,var(--line),var(--bg));display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:2rem;overflow:hidden}
.thumb img{width:100%;height:100%;object-fit:cover}
.body{padding:12px 14px}
.body h2{margin:0;font-size:1.05rem}
.series{font-size:.9rem;font-weight:700;color:var(--muted);margin-top:2px}
.meta{color:var(--muted);font-size:.85rem}
.price{margin-top:6px;font-weight:600}
.empty{text-align:center;color:var(--muted);padding:40px 0}
.card[hidden]{display:none}
.yearhead{grid-column:1/-1;display:flex;align-items:center;gap:12px;margin-top:10px;font-size:.8rem;font-weight:600;letter-spacing:.08em;color:var(--muted)}
.yearhead::before,.yearhead::after{content:"";flex:1;border-top:1px solid var(--line)}
.detail{max-width:640px;padding-block:24px}
.detail h1{margin:16px 0}
.detail dl{display:grid;grid-template-columns:110px 1fr;gap:8px 12px}
.detail dt{color:var(--muted)}
.detail dd{margin:0}
.back{color:var(--accent);text-decoration:none;font-weight:600}
.thumb.big{aspect-ratio:5/3;border-radius:12px;margin-top:16px}
.foot{color:var(--muted);font-size:.85rem;padding-block:24px}
.detail h2{margin:28px 0 12px;font-size:1.15rem}
.badge{font-size:.72rem;font-weight:600;padding:2px 8px;border-radius:999px;white-space:nowrap;background:var(--line);color:var(--text)}
.r-0{background:#d8f0dc;color:#14532d}.r-1{background:#e3f0c8;color:#3f5a0f}
.r-2{background:#fdebb8;color:#7a5200}.r-3{background:#fbd1a8;color:#8a3b00}
.r-4{background:#f8b4b4;color:#8b0f0f}
.r-5{background:linear-gradient(#ffe48f,#f2b705);color:#3a2600;box-shadow:0 0 0 1px #c98f00}
.none{color:var(--muted);margin:0}
.hint{color:var(--muted);font-size:.85rem;margin:0 0 10px}
.tablewrap{margin-inline:auto;overflow-x:auto;background:var(--card);border:1px solid var(--line);border-radius:12px}
.colortable{width:100%;border-collapse:collapse}
.colortable th,.colortable td{text-align:left;padding:8px 12px;border-top:1px solid var(--line);white-space:nowrap}
.colortable thead th{border-top:0;color:var(--muted);font-weight:600;font-size:.85rem}
.cn{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.colortable .na{color:var(--muted)}
/* Spectraflame metallic look; enamels stay flat */
.swatch{width:20px;height:20px;border:0;border-radius:5px;flex:none;
  background:
    radial-gradient(circle at 32% 26%,rgba(255,255,255,.9) 0,rgba(255,255,255,.35) 22%,rgba(255,255,255,0) 45%),
    linear-gradient(145deg,rgba(255,255,255,.4) 0,rgba(255,255,255,0) 45%,rgba(0,0,0,.35) 100%),
    var(--c,var(--line));
  box-shadow:inset 0 -2px 3px rgba(0,0,0,.35),inset 0 1px 2px rgba(255,255,255,.45),0 1px 2px rgba(0,0,0,.25)}
/* Chrome: bright sky highlight, dark horizon band, mirror-bright band below it, dark bottom edge */
.swatch.chrome{background:
    linear-gradient(165deg,rgba(255,255,255,.5) 0,rgba(255,255,255,.2) 18%,rgba(255,255,255,0) 34%,rgba(0,0,0,.18) 49%,rgba(255,255,255,.4) 55%,rgba(255,255,255,.08) 72%,rgba(0,0,0,.2) 100%),
    var(--c,#c9ced6);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.2),inset 0 1px 1px rgba(255,255,255,.45),inset 0 -1px 2px rgba(0,0,0,.22),0 1px 2px rgba(0,0,0,.28)}
.swatch.enamel{background:var(--c,var(--line));box-shadow:inset 0 0 0 1px rgba(0,0,0,.18)}
/* Small screens: abbreviate variations and availability to their short forms */
.short{display:none}
/* fit.js adds .compact to the table wrapper only when the full-size table does not fit */
.compact .long{display:none}
.compact .short{display:inline}
.compact .colortable th,.compact .colortable td{padding:8px 4px}
.compact .colortable th:first-child,.compact .colortable td:first-child{padding-left:8px;gap:6px}
.compact .badge{padding:2px 7px}
/* used by fit.js to measure the natural full-size width */
.measure{table-layout:auto!important;width:max-content!important}
.measure th{width:auto!important}
.measure .cn{flex-wrap:nowrap!important;white-space:nowrap!important}
/* US and HK columns always get equal width; the color column takes the rest */
.colortable{table-layout:fixed}
.colortable th:first-child{width:var(--c1,40%)}
.colortable th:nth-child(n+2){width:var(--c2,30%)}
.compact .colortable td:nth-child(n+2),.compact .colortable th:nth-child(n+2){text-align:center}
.compact .colortable .badge{padding:2px 5px}

/* eBay listings on car pages */
.lctl{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:6px}
.lctl input,.lctl select,.lctl>button{font:inherit;font-size:.95rem;padding:7px 10px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text)}
.lctl input[type=search]{flex:1 1 130px;min-width:0}
.lctl .dd summary{padding:7px 10px;font-size:.95rem;background:var(--card);color:var(--text)}
.lctl .ddmenu button{white-space:nowrap}
.lctl input[type=number]{width:92px}
.lctl>button{cursor:pointer;color:var(--accent)}
.lcount{margin:4px 0 10px}
.lgrid{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.lgrid li[hidden]{display:none}
.lgrid a{display:flex;flex-direction:column;height:100%;border:1px solid var(--line);border-radius:10px;background:var(--card);color:inherit;text-decoration:none;overflow:hidden}
.lgrid a:hover{border-color:var(--muted)}
.lwrap{position:relative;display:block}
.ldots{position:absolute;left:0;right:0;bottom:6px;display:flex;justify-content:center;gap:5px;pointer-events:none}
.ldots i{width:6px;height:6px;border-radius:50%;background:#fff;opacity:.5;box-shadow:0 0 2px #0008}
.ldots i.on{opacity:1}
.lgrid img,.lgrid .noimg{width:100%;aspect-ratio:1;object-fit:cover;background:#8884;display:block}
.lgrid .lt{padding:10px 12px 0;font-size:.95rem;line-height:1.35;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;flex:1}
.lgrid .lp{padding:8px 12px 0;font-weight:700;font-size:1.1rem}
.lgrid .lc{padding:0 12px 11px;font-size:.85rem;color:var(--muted)}
.lgrid .lp:last-child{padding-bottom:11px}
.lmore{display:block;margin:14px auto 0;font:inherit;padding:9px 18px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text);cursor:pointer}
.lmore[hidden],.lclear[hidden],.lnone[hidden]{display:none}

/* Wide screens: eBay listings sit beside the car details and colors */
@media(min-width:1000px){
  .detail.wide{max-width:1360px;display:grid;grid-template-columns:minmax(380px,460px) minmax(0,1fr);gap:0 36px;align-items:start}
  .detail.wide .lgrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
  .detail.wide .rcol h2:first-child,.detail.wide .rcol #ebay>h2:first-child{margin-top:16px}
}
.lgrid .lend{padding:2px 12px 0;font-size:.85rem;font-weight:600}
.lgrid .lend.soon{color:var(--accent)}
.lgrid .lend.done{color:var(--muted);font-weight:400}
.lgrid .lp small{font-weight:400;font-size:.8rem;color:var(--muted)}
.related{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.related li{display:flex;gap:10px;align-items:baseline}
.related a{color:var(--text);font-weight:600}
@media(max-width:560px){.lctl input[type=search]{flex:1 1 100%}}

/* Car page: description, photo gallery and the jump-to-eBay link */
.jump{display:inline-block;margin:14px 0 0;color:var(--accent);font-weight:600;text-decoration:none}
.jump:hover{text-decoration:underline}
.abouttext p{margin:0 0 .8em;line-height:1.6}
.abouttext.clamp{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden}
.aboutmore{font:inherit;background:none;border:0;padding:4px 0;color:var(--accent);font-weight:600;cursor:pointer}
.aboutmore[hidden]{display:none}
.gallery{list-style:none;margin:0;padding:0;display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding-bottom:6px}
.gallery li{flex:0 0 78%;scroll-snap-align:start}
.gallery figure{margin:0}
.gallery img{display:block;width:100%;aspect-ratio:5/3;object-fit:cover;border-radius:10px;border:1px solid var(--line);background:var(--card)}
.gallery figcaption{font-size:.85rem;color:var(--muted);margin-top:6px}
@media(min-width:1000px){
  .jump{display:none}
  .abouttext.clamp{-webkit-line-clamp:8;line-clamp:8}
  .gallery{display:grid;grid-template-columns:1fr 1fr;overflow:visible;scroll-snap-type:none}
}

/* Arrow buttons on eBay card photos (touch screens and narrow windows only) */
.lnav{display:none;position:absolute;bottom:8px;width:44px;height:44px;border-radius:50%;background:rgba(0,0,0,.6);color:#fff;font-size:32px;line-height:40px;text-align:center;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;z-index:2}
.lnav.prev{left:8px}
.lnav.next{right:8px}
/* Invisible extra tap area around each arrow (more above and toward the middle) so a near miss changes the photo instead of opening the listing */
.lnav::before{content:"";position:absolute;top:-26px;bottom:-10px;left:-10px;right:-10px}
.lnav.prev::before{right:-16px}
.lnav.next::before{left:-16px}
.lwrap[data-pos=first] .lnav.prev,.lwrap[data-pos=last] .lnav.next{visibility:hidden}
@media(hover:none),(pointer:coarse),(max-width:700px){.lnav{display:block}}

/* Photo viewer: the tapped gallery photo enlarged over a darkened page, caption below */
.lb{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.88);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:56px 16px 24px;box-sizing:border-box}
.lb[hidden]{display:none}
.lb img{max-width:100%;max-height:calc(100vh - 190px);object-fit:contain;border-radius:8px;background:#fff}
.lbcap{margin:0;color:#fff;text-align:center;font-size:1rem;max-width:36rem}
.lbcount{margin:0;color:#b8bbc8;font-size:.85rem}
.lbclose,.lbnav{position:absolute;border:0;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;cursor:pointer;width:44px;height:44px;font:inherit;font-size:30px;line-height:40px;padding:0}
.lbclose{top:10px;right:10px}
.lbnav{top:50%;transform:translateY(-50%)}
.lbprev{left:8px}
.lbnext{right:8px}
.lbnav[hidden]{display:none}

/* Sortable color table headings: a faint up/down mark on every column, a solid arrow on the sorted one */
.colortable th button{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:4px;color:inherit;font:inherit}
.colortable th button:focus-visible{outline:2px solid var(--accent,#c0392b);outline-offset:2px;border-radius:4px}
.colortable th button::after{content:"\2195";opacity:.35;font-size:.8em}
.colortable th[aria-sort=ascending] button::after{content:"\25B2";opacity:1}
.colortable th[aria-sort=descending] button::after{content:"\25BC";opacity:1}
.colortable th[aria-sort=ascending],.colortable th[aria-sort=descending]{color:var(--text)}

/* Rating scale key under the table */
.legend{margin:0 0 12px;font-size:.88rem;color:var(--muted);line-height:1.5}
.legend p{margin:0 0 8px}
.legend ul{list-style:none;margin:0 0 8px;padding:0;display:flex;flex-wrap:wrap;gap:6px 14px}
.legend li{display:inline-flex;align-items:center;gap:6px}
.legend .range{white-space:nowrap}
.legendnote{font-size:.82rem}
