/* Hoopty-Matic — marketplace-clean: a calm neutral canvas, white cards with
   soft depth, a dark app bar and one confident accent (cobalt). Layout after
   Dribbble's "Auto.Hunt" car-marketplace search (filter rail + results head)
   and Behance rental-dashboard bento stats. */
:root {
  --bg: #F2F4F8; --bg-2: #E9ECF2; --card: #FFFFFF; --ink: #10131A; --ink-2: #444B59; --muted: #7C8394;
  --line: #E3E6ED; --line-2: #CDD2DC;
  --teal: #2F54EB; --teal-ink: #1F3FC4; --mustard: #E0A100; --orange: #F26B1D; --olive: #1E9E5A; --walnut: #8A5A36; --rose: #E5484D;
  --chip-teal: #E6ECFF; --chip-mustard: #FFF3D1; --chip-orange: #FFE6D6; --chip-olive: #DDF4E7; --chip-rose: #FDE1E1; --chip-slate: #EEF0F4;
  --data-a: #2F54EB; --data-b: #F26B1D;
  --bar: #10131A; --bar-ink: #F4F6FA; --bar-2: #1E2430;
  --radius: 20px; --radius-s: 12px;
  --shadow: 0 1px 2px rgba(16,19,26,.05), 0 10px 30px -14px rgba(16,19,26,.18);
  --shadow-hover: 0 2px 4px rgba(16,19,26,.06), 0 18px 40px -16px rgba(16,19,26,.28);
  --font: "Plus Jakarta Sans", -apple-system, system-ui, sans-serif; --display: "Plus Jakarta Sans", -apple-system, system-ui, sans-serif; --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
html[data-theme="dark"] {
  --bg: #0B0D12; --bg-2: #151922; --card: #161A23; --ink: #EEF1F7; --ink-2: #BAC1CF; --muted: #8189A0;
  --line: #242A36; --line-2: #343C4C;
  --teal: #6F8BFF; --teal-ink: #A9B9FF; --mustard: #F2B84B; --orange: #FF8A4C; --olive: #3CC47C; --walnut: #C08A5E; --rose: #FF6B70;
  --chip-teal: #1C2547; --chip-mustard: #3A2F12; --chip-orange: #3F2414; --chip-olive: #12311F; --chip-rose: #3D1A1C; --chip-slate: #1F2430;
  --data-a: #6F8BFF; --data-b: #FF8A4C;
  --bar: #07090D; --bar-2: #1A1F2A;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 32px -16px rgba(0,0,0,.8);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 18px 40px -16px rgba(0,0,0,.9);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--teal-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input, textarea { font: inherit; color: inherit; }
select { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; }
html:not([data-theme="dark"]) option { color: #10131A; background: #fff; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; letter-spacing: -.02em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }

/* App bar: dark in both themes */
.top { position: sticky; top: 0; z-index: 20; background: var(--bar); color: var(--bar-ink); }
.top-inner { max-width: 1360px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--bar-ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: url("icon.svg") center / cover no-repeat; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.nav { display: flex; gap: 2px; background: var(--bar-2); border-radius: 999px; padding: 3px; }
.nav a { padding: 6px 14px; border-radius: 999px; color: #AEB6C6; font-weight: 600; font-size: 14px; }
.nav a.active { background: var(--bar-ink); color: var(--bar); }
.nav a:hover { text-decoration: none; color: #fff; }
.nav a.active:hover { color: var(--bar); }
.spacer { flex: 1; }
.search { background: var(--bar-2); color: var(--bar-ink); border: 1px solid transparent; border-radius: 999px; padding: 8px 16px; width: 280px; outline: none; }
.search::placeholder { color: #8A93A6; }
.search:focus { border-color: var(--teal); }
.top .iconbtn { border: 0; background: var(--bar-2); color: var(--bar-ink); border-radius: 999px; width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; }
.top .btn { background: var(--bar-ink); color: var(--bar); border-color: var(--bar-ink); }
.mode-pill { font-size: 12px; padding: 5px 11px; border-radius: 999px; background: var(--bar-2); color: #AEB6C6; white-space: nowrap; }
.mode-pill.local { color: #9FE5BE; }
.mode-pill.warn { color: #FFB4A8; }

/* Layout */
.wrap { max-width: 1360px; margin: 0 auto; padding: 26px 20px 80px; }
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.hero p { margin: 6px 0 0; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.tile { background: var(--card); border-radius: var(--radius-s); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.tile .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--muted); }
.tiles.bento { margin: 0; flex: 1 1 560px; max-width: 760px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.tiles.bento .tile.lead { background: var(--teal); color: #fff; }
.tiles.bento .tile.lead .k, .tiles.bento .tile.lead .s { color: rgba(255,255,255,.8); }

/* Board: filter rail + results */
.board-body { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 22px; align-items: start; }
.rail { position: sticky; top: 74px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 16px 14px; max-height: calc(100vh - 92px); overflow: auto; }
.rail > summary { list-style: none; cursor: pointer; font-weight: 800; font-size: 16px; padding: 10px 0 4px; }
.rail > summary::-webkit-details-marker { display: none; }
.rail > summary { display: flex; justify-content: space-between; align-items: center; }
.rail-toggle::before { content: "‹"; font-size: 20px; line-height: 1; color: var(--ink-2); padding: 0 2px; }
.rail:not([open]) .rail-toggle::before { content: "›"; }
.board-body.rail-collapsed { grid-template-columns: 44px minmax(0, 1fr); }
.rail-collapsed .rail { padding: 6px 0; overflow: visible; }
.rail-collapsed .rail > summary { flex-direction: column-reverse; justify-content: flex-end; gap: 10px; padding: 10px 0; }
.rail-collapsed .rail-title { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 14px; }
.rail-sec { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.rail-sec:first-of-type { border-top: 0; }
.rail-sec h4 { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.rail-sec h4 .small { font-size: 11px; font-weight: 500; }
.rail select { width: 100%; }
.rail label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.rail label.check { justify-content: flex-start; }
.rail input.num { width: 118px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-family: var(--mono); font-size: 13px; outline: none; }
.rail input.num:focus { border-color: var(--teal); }
.results-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.results-head h2 { font-size: 24px; }
.sortby { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.board-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.board-actions .opt { font-weight: 500; opacity: .8; font-size: 12px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--bg-2); border-radius: 999px; }
/* Rail toggles: natural-width buttons that wrap instead of overlapping (5 roles don't fit one row). */
.seg.wide { display: flex; flex-wrap: wrap; gap: 3px; border-radius: 14px; }
.seg.wide button { flex: 1 1 auto; padding: 5px 9px; font-size: 12.5px; white-space: nowrap; }
.hidden-note { margin: 0 0 10px; }
.hidden-note a { font-weight: 700; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 5px 11px; cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(16,19,26,.15); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.stack { flex-direction: column; align-items: stretch; }
.chips button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 5px 11px; cursor: pointer; color: var(--ink-2); font-size: 13px; text-align: left; display: flex; justify-content: space-between; gap: 8px; }
.chips.stack button { border-radius: 10px; }
.chips button:hover { border-color: var(--line-2); }
.chips button.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.chips button.off { background: var(--chip-rose); border-color: transparent; color: #9B1C1F; text-decoration: line-through; }
html[data-theme="dark"] .chips button.off { color: #FFB4B6; }
.chips button .n { font-family: var(--mono); font-size: 11px; opacity: .7; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; position: relative; padding: 10px 10px 0; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card.was-open { box-shadow: 0 0 0 2px var(--teal), var(--shadow); }
.card .photo { aspect-ratio: 16/11; background: var(--bg-2); position: relative; overflow: hidden; border-radius: 14px; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .photo .nophoto { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 40px; }
.nophoto.expired { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.nophoto.expired small { font-size: 12px; }
.gallery .main .nophoto.expired { min-height: 240px; color: var(--muted); font-size: 40px; }
.card .score { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 4px; }
.score-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; background: var(--card); color: var(--ink-2); border-radius: 999px; padding: 2px 7px; box-shadow: var(--shadow); }
.card .site { position: absolute; top: 10px; right: 10px; }
a.src { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
a.src.on-photo { background: rgba(16,19,26,.72); color: #fff; padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(6px); }
a.src.on-photo:hover { background: var(--teal); text-decoration: none; }
.card .body { padding: 12px 6px 14px; display: flex; flex-direction: column; gap: 6px; }
.card .title { font-weight: 700; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
.card .price { font-size: 21px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card .price small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.card .meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.card .foot { display: flex; align-items: flex-start; justify-content: space-between; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); gap: 8px; }
.card .cmp { display: inline-flex; align-items: center; }
.card .foot > .row:last-child { flex-wrap: nowrap; }
.card.comp { opacity: .88; }
.card.comp .photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(16,19,26,.45)); }

.pager { display: inline-flex; align-items: center; gap: 2px; }
.pager .btn { padding: 4px 11px; font-size: 16px; line-height: 1; }
.pager .btn.disabled { opacity: .35; pointer-events: none; }

@media (max-width: 900px) {
  .board-body { grid-template-columns: 1fr; }
  .rail { position: static; max-height: none; }
  .rail-toggle { display: none; }
  .tiles.bento { grid-template-columns: repeat(2, 1fr); flex-basis: 100%; }
  .top-inner { flex-wrap: wrap; gap: 10px 12px; }
  .top .spacer { display: none; }
  .search { order: 5; width: 100%; }
}
@media (max-width: 520px) {
  .wrap { padding: 18px 16px 80px; }
  .top-inner { padding: 10px 16px; }
  .nav a { padding: 6px 10px; }
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
}

/* Chips & badges */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--chip-slate); color: var(--ink-2); }
.chip.teal { background: var(--chip-teal); color: var(--teal-ink); }
/* Your call as a menu on the card: looks like a chip, with a caret */
select.call-select { appearance: none; -webkit-appearance: none; border: 1px dashed var(--line); cursor: pointer; font-family: inherit; padding-right: 22px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 11px) 55%, calc(100% - 7px) 55%; background-size: 4px 4px; background-repeat: no-repeat; }
select.call-select.olive, select.call-select.rose, select.call-select.teal { border-style: solid; border-color: transparent; }
select.call-select:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; }
.chip.mustard { background: var(--chip-mustard); color: #6B4E0A; }
.chip.orange { background: var(--chip-orange); color: #7A3418; }
.chip.olive { background: var(--chip-olive); color: #3B5424; }
.chip.rose { background: var(--chip-rose); color: #7A241B; }
html[data-theme="dark"] .chip.mustard { color: #F0D28A; } html[data-theme="dark"] .chip.orange { color: #F4B49A; }
html[data-theme="dark"] .chip.olive { color: #C2D6A6; } html[data-theme="dark"] .chip.rose { color: #F2A99F; }
.chip.dark { background: var(--ink); color: var(--bg); }
.badge { display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 8px; border-radius: 999px; font-family: var(--mono); font-weight: 700; font-size: 15px; color: #10131A; background: #FFD66B; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.badge.hi { background: #7BE0A6; } .badge.mid { background: #FFD66B; } .badge.lo { background: #FFA99A; } .badge.none { background: var(--chip-slate); color: var(--muted); font-weight: 500; font-size: 12px; }
.badge.prelim { border: 2px dashed rgba(16,19,26,.3); font-weight: 600; }
.badge.fit + .score-tag { margin-left: 4px; }
.pill-status { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 10px; font-size: 12px; }

/* Buttons */
.btn { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 8px 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.btn:hover { border-color: var(--line-2); text-decoration: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.warm { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.sm.warm { color: #fff; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }

/* Detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
/* Grid children may shrink below their content; long selects, links and drafts wrap
   (a 520px profile <select> pushed phone listing pages to 1,560px, found in E2E 2026-09-24). */
.detail > *, .board-body > * { min-width: 0; }
.panel select, .rail select { max-width: 100%; }
.panel pre, .panel a { overflow-wrap: anywhere; }
.panel label { max-width: 100%; }
.gallery { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery .main { aspect-ratio: 16/10; background: var(--bg-2); display: grid; place-items: center; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.gallery .thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.gallery .thumbs img { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; opacity: .75; border: 2px solid transparent; }
.gallery .thumbs img.on { opacity: 1; border-color: var(--teal); }
.panel { background: var(--card); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.panel.accent-teal { border-left: 4px solid var(--teal); } .panel.accent-mustard { border-left: 4px solid var(--mustard); }
.panel.accent-orange { border-left: 4px solid var(--orange); } .panel.accent-olive { border-left: 4px solid var(--olive); }
.panel.accent-rose { border-left: 4px solid var(--rose); } .panel.accent-walnut { border-left: 4px solid var(--walnut); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; }
.facts .k { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.facts .v { font-weight: 500; }
.headline { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; }
.headline .price { font-family: var(--mono); font-size: 30px; font-weight: 700; }
.list { margin: 0; padding-left: 18px; } .list li { margin: 4px 0; }
.scores { display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 130px 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.score-row .bar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.score-row .bar i { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.score-row .bar i.prelim { background: var(--mustard); }
.checks { width: 100%; border-collapse: collapse; font-size: 14px; }
.checks td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.checks td:first-child { width: 90px; }
.st-pass { color: var(--olive); font-weight: 600; } .st-concern { color: #A0631A; font-weight: 600; } .st-fail { color: var(--rose); font-weight: 600; } .st-unknown { color: var(--muted); }
textarea.notes { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; background: var(--bg); resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }
.dial { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--teal) calc(var(--pct) * 1%), var(--bg-2) 0); position: relative; }
.dial::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--card); }
.dial span { position: relative; z-index: 1; font-family: var(--mono); font-weight: 700; font-size: 24px; }
.dial small { position: absolute; z-index: 1; bottom: 12px; font-size: 10px; color: var(--muted); }
.verdict { font-family: var(--display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.dial.prelim { background: conic-gradient(var(--mustard) calc(var(--pct) * 1%), var(--bg-2) 0); }
/* Fit leads the listing page as it does the cards; same green / yellow / salmon as the card badge. */
.dial.fit.hi { background: conic-gradient(#7BE0A6 calc(var(--pct) * 1%), var(--bg-2) 0); }
.dial.fit.mid { background: conic-gradient(#FFD66B calc(var(--pct) * 1%), var(--bg-2) 0); }
.dial.fit.lo { background: conic-gradient(#FFA99A calc(var(--pct) * 1%), var(--bg-2) 0); }
.dial.sm { width: 72px; height: 72px; }
.dial.sm::after { inset: 7px; }
.dial.sm span { font-size: 20px; }
.dial.sm small { bottom: 9px; }
.dial.prelim::after { border: 2px dashed var(--line-2); inset: 7px; }
.catstrip { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 16px; }
.catstrip .cat { position: relative; background: var(--card); box-shadow: var(--shadow); border-radius: 12px; padding: 6px 10px 9px; font-size: 12px; color: var(--ink-2); min-width: 118px; overflow: hidden; }
.catstrip .cat b { font-weight: 600; margin-right: 4px; }
.catstrip .cat i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--teal); }
.verdict.Pursue { color: var(--olive); } .verdict.Maybe { color: #A0631A; } .verdict.Reject, .verdict.Do { color: var(--rose); }
textarea.mono { font-family: var(--mono); font-size: 12px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); margin-bottom: 8px; }
.empty ol { text-align: left; display: inline-block; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; z-index: 50; box-shadow: var(--shadow); }
.tray { position: fixed; bottom: 22px; right: 22px; background: var(--card); border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 8px 8px 16px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); z-index: 40; }

/* Tables */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); border-radius: var(--radius-s); overflow: hidden; box-shadow: var(--shadow); }
table.data th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; }
table.data td { padding: 9px 10px; border-top: 1px solid var(--line); }
table.data tr:hover td { background: var(--bg-2); }
.tablewrap { overflow-x: auto; }

/* Charts */
.chart { width: 100%; height: 320px; }
.chart svg { width: 100%; height: 100%; display: block; }
.chart .axis line, .chart .axis path { stroke: var(--line-2); }
.chart .grid line { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.spark { width: 100%; height: 56px; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: 8px; font-size: 12px; z-index: 60; white-space: nowrap; }

/* Compare */
.compare { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.compare .col { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px; }
.compare .col img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }

/* Profiles */
details.profile { background: var(--card); box-shadow: var(--shadow); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; }
details.profile summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 600; list-style: none; }
details.profile summary::-webkit-details-marker { display: none; }
.weights { display: flex; flex-wrap: wrap; gap: 6px; }

/* Running-task banner */
.taskbar { position: sticky; top: 56px; z-index: 19; background: var(--mustard); color: #1F1D1A; padding: 10px 20px; display: flex; align-items: center; gap: 14px; font-weight: 500; box-shadow: 0 6px 18px -10px rgba(0,0,0,.4); }
.taskbar.done { background: #7FCB9F; }
.taskbar.failed { background: #EFA68F; }
.taskbar .spin { width: 18px; height: 18px; border: 3px solid rgba(31,29,26,.25); border-top-color: #1F1D1A; border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
.taskbar.done .spin, .taskbar.failed .spin { display: none; }
.taskbar .bar { flex: 1; height: 8px; background: rgba(31,29,26,.18); border-radius: 999px; overflow: hidden; max-width: 320px; }
.taskbar .bar i { display: block; height: 100%; background: #1F1D1A; transition: width .4s; }
.taskbar .mono { color: #1F1D1A; opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }
button.busy, .btn.busy { opacity: .5; pointer-events: none; }

/* Keyboard focus ring, site-wide (cards, chips, buttons, inputs...). */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
.card:focus-visible { outline-offset: -2px; border-radius: var(--radius); }

/* Initial-load skeleton (docs/index.html), replaced by the first route(). */
.skeleton-hero { height: 90px; border-radius: var(--radius); background: var(--bg-2); margin-bottom: 18px; }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.skeleton-card { height: 260px; border-radius: var(--radius); background: var(--bg-2); }
.skeleton-hero, .skeleton-card { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

/* Screen-reader-only label (e.g. the search input's <label>). */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* A [hidden] element must actually disappear — some rules (.btn, .taskbar,
   etc.) declare `display` at equal specificity and would otherwise win. */
[hidden] { display: none !important; }

/* Path to pursue (detail page) */
.stepper { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
.stepper li { padding: 4px 12px; border-radius: 999px; background: var(--chip-slate); color: var(--ink-2); font-size: 13px; }
.stepper li.done { background: var(--chip-olive); color: #3B5424; }
.stepper li.current { background: var(--teal); color: #fff; font-weight: 600; }
html[data-theme="dark"] .stepper li.done { color: #C2D6A6; }
.path-section { margin-top: 8px; }
.score-tag.upside { color: var(--muted); font-weight: 600; margin-left: 4px; }

/* deterministic one-line assessment headline (policy engine, not model prose) */
.headline-line { font-weight: 600; margin: 4px 0 6px; }
.card .headline { font-size: 12.5px; color: var(--ink-2); margin: 4px 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 1.8.0 next step + walk-away */
.card .walk { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -4px; }
.card .walk.near { color: var(--mustard); }
.card .walk.over { color: var(--rose); font-weight: 600; }
.chip.next { font-weight: 700; }
.next-panel .next-action { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.panel.accent-olive.next-panel { border-left-width: 6px; }
.grid-divider { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; padding: 14px 4px 2px; border-top: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; }
.grid-divider span { font-weight: 800; color: var(--ink); font-size: 15px; }
/* Curiosities: followed out of interest, not serious candidates */
.chip.curiosity { background: var(--chip-slate); color: var(--ink-2); font-weight: 700; font-style: italic; }
.card.curiosity { opacity: .92; }
.card.curiosity .photo { filter: saturate(.75); }
.vin-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; flex-wrap: wrap; }
.vin-line .vin { font-size: 15px; font-weight: 700; letter-spacing: .06em; user-select: all; }

/* Live auction countdown on cards and the listing page: quiet until the last day. */
.ends { margin-left: 8px; font-size: 11px; font-weight: 600; font-family: var(--mono); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.ends.today { color: #E0A200; }
.ends.soon, .ends.over { color: #E5533D; }
