:root {
  /* ---- shared across themes ---- */
  --accent: #5b8cff;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-slab: 16px;
  --radius-inner: 9px;
  --gradient-holo: linear-gradient(135deg,
    rgba(255, 0, 128, .12) 0%, rgba(255, 140, 0, .12) 25%, rgba(0, 224, 208, .12) 50%,
    rgba(120, 0, 255, .12) 75%, rgba(255, 0, 128, .12) 100%);
  --violet: #a78bfa; --pink: #f472b6; --cyan: #22d3ee; --sun: #fbbf24;
  --gradient-holo-text: linear-gradient(100deg, var(--cyan), var(--violet) 42%, var(--pink) 72%, var(--sun));
  --content-w: 1120px;

  /* ---- LIGHT theme (default) ---- */
  --bg: #e9ebf2; --panel: #ffffff; --panel2: #eef0f6; --line: #e1e4ec;
  --text: #1b1d23; --muted: #5d616c; --faint: #9a9ea9; --track: #e1e4ec;
  --green: #12a972; --amber: #c98a1e; --red: #e23a57; --gold: #b9912f;
  --page-bg:
    radial-gradient(820px 560px at 9% 1%, rgba(167,139,250,.20), transparent 56%),
    radial-gradient(760px 520px at 93% 5%, rgba(34,211,238,.15), transparent 56%),
    radial-gradient(880px 600px at 82% 99%, rgba(244,114,182,.14), transparent 60%),
    linear-gradient(180deg, #edeff6 0%, #e6e8f2 100%);
  --bar-bg: rgba(255, 255, 255, .72);
  --media-bg: #e9ebf1;
  --slab-glass: rgba(255, 255, 255, .72);
  --slab-border: rgba(20, 24, 40, .10);
  --slab-glow: 0 10px 30px rgba(30, 40, 80, .10);
}

/* ---- DARK theme (OLED black) ---- */
:root[data-theme="dark"] {
  --bg: #000000; --panel: #121317; --panel2: #1b1d22; --line: #2a2c33;
  --text: #ededf0; --muted: #9a9ca6; --faint: #6b6d78; --track: #2a2c33;
  --green: #34d399; --amber: #f0b54a; --red: #f0566e; --gold: #e8be55;
  --page-bg: #000000;
  --bar-bg: rgba(0, 0, 0, .66);
  --media-bg: #0a0a0c;
  --slab-glass: rgba(20, 21, 26, .62);
  --slab-border: rgba(255, 255, 255, .12);
  --slab-glow: 0 8px 32px rgba(0, 0, 0, .5);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); color: var(--text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: var(--page-bg); background-attachment: fixed; min-height: 100vh;
  transition: background-color .35s ease, color .35s ease; }
/* whimsical ambient color — soft pastel glows drifting behind everything */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 480px at 12% 4%, rgba(167,139,250,.14), transparent 60%),
    radial-gradient(560px 420px at 90% 0%, rgba(34,211,238,.10), transparent 58%),
    radial-gradient(680px 520px at 78% 96%, rgba(244,114,182,.09), transparent 62%);
  animation: auroraDrift 22s ease-in-out infinite alternate; }
@keyframes auroraDrift { from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(1.5%, 1.2%, 0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
a { color: inherit; text-decoration: none; }
.t-ask, .th-ask, .th-psa10, .th-profit, .t-psa10, .t-profit, .score-num, .cbar-val, .prices td,
.hp-fin .profit, .mbar .mv { font-variant-numeric: tabular-nums; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 13px 26px; background: var(--bar-bg); backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.18em; letter-spacing: -.01em; }
/* shimmering, sparkling wordmark — the holo gradient always fills the text (never blanks);
   a white shine band sweeps across while the colors gently pan = glimmer + shimmer */
.brand .bw { position: relative; display: inline-block;
  background:
    linear-gradient(100deg, transparent 32%, rgba(255,255,255,.9) 50%, transparent 68%),
    linear-gradient(100deg, #0a93a6, #6d4fd6 42%, #cf3d8f 72%, #c07e0a);
  background-size: 250% 100%, 160% 100%; background-repeat: no-repeat;
  background-position: 200% 0, 0% 50%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  animation: bwShine 3.6s linear infinite; }
@keyframes bwShine {
  0%   { background-position: 200% 0,   0% 50%; }
  100% { background-position: -120% 0, 100% 50%; } }
/* twinkling sparkle stars around the wordmark */
.brand .bw::before, .brand .bw::after { position: absolute; -webkit-text-fill-color: initial;
  pointer-events: none; animation: twinkle 1.9s ease-in-out infinite; }
.brand .bw::after { content: "✦"; top: -7px; right: -15px; font-size: .62em; color: #fff; text-shadow: 0 0 6px var(--cyan); }
.brand .bw::before { content: "✦"; bottom: -3px; left: -11px; font-size: .46em; color: var(--violet);
  text-shadow: 0 0 6px var(--violet); animation-delay: .7s; animation-duration: 2.4s; }
@keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.6) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) {
  .brand .bw { animation: none; background-position: 200% 0, 0% 50%; }
  .brand .bw::before, .brand .bw::after { animation: none; opacity: .8; } }
.topbar nav { display: flex; align-items: center; flex-wrap: nowrap; flex-shrink: 0; }
.topbar nav a { margin-left: 20px; color: var(--muted); font-size: .92em; transition: color .15s; white-space: nowrap; }
.topbar nav a:hover { color: var(--text); }
.theme-toggle { margin-left: 20px; width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; cursor: pointer; font-size: 15px; line-height: 1;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), border-color .2s, background .2s; }
.theme-toggle:hover { transform: rotate(-18deg) scale(1.08); border-color: var(--accent); }

main { padding: 22px 34px; max-width: var(--content-w); margin: 0 auto; }
.foot { text-align: center; color: var(--muted); padding: 24px; font-size: .85em; }

/* ---------- top filter bar ---------- */
.filterbar { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 26px; position: sticky; top: 60px; z-index: 15; }
.fb-main { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filterbar .fb-search { flex: 1 1 200px; min-width: 140px; position: relative; }
.filterbar .fb-search input { width: 100%; padding: 11px 14px; font-size: 14px; }
.filterbar .fb-field { display: flex; align-items: center; gap: 8px; font-size: .7em;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.filterbar input, .filterbar select { background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: 9px 11px; font-size: 13px;
  text-transform: none; letter-spacing: 0; }
.filterbar input:focus, .filterbar select:focus { outline: none; border-color: var(--accent); }
.filterbar .fb-check { display: flex; align-items: center; gap: 7px; font-size: .82em;
  color: var(--muted); white-space: nowrap; }
.filterbar .fb-check input { width: auto; }
.filterbar .fb-graders { gap: 12px; }
.filterbar .fb-graders .fb-check { font-size: .82rem; }
.fb-toggles { margin-left: auto; display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: nowrap; }
.fb-toggle { background: var(--panel2); border: 1px solid var(--line);
  color: var(--muted); border-radius: 9px; padding: 9px 16px; font-size: .82em; font-weight: 600;
  cursor: pointer; white-space: nowrap; }
.fb-toggle:hover { border-color: #555; color: var(--text); }
.filterbar.adv-open .fb-toggle { color: var(--accent); border-color: var(--accent); }
/* advanced numeric filters — collapsed by default */
.fb-adv { display: none; flex-wrap: wrap; gap: 14px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line); }
.filterbar.adv-open .fb-adv { display: flex; }
.fb-adv .fb-field.sm { flex-direction: column; align-items: flex-start; gap: 5px; width: 104px; }
.fb-adv .fb-field.sm input { width: 100%; }
.primary { background: var(--accent); color: #fff; border: none; border-radius: 9px;
  padding: 10px 18px; font-weight: 600; cursor: pointer; }
.primary:hover { filter: brightness(1.1); }

/* quick-sort chips — surfaced sort intents (design.md §2: one tap, not a dropdown) */
.qsort { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qsort-chip { font-size: .78em; font-weight: 600; padding: 6px 13px; border-radius: 20px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
  font-family: inherit; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.qsort-chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.qsort-chip.on { background: var(--text); border-color: var(--text); color: var(--panel); font-weight: 700; }
.qsort-chip.qsort-filter.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.results-head { color: var(--muted); margin-bottom: 18px; font-size: .8em; text-transform: uppercase; letter-spacing: .1em; }
.results-head b { color: var(--text); }

/* ---------- gallery grid (image-forward) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 40px 32px; }
.card { background: transparent; border: none; display: flex; flex-direction: column; }
/* verdict color drives the media base rail + chip accents (design.md §2: the verdict leads) */
.card.v-green { --vc: var(--green); }
.card.v-amber { --vc: var(--amber); }
.card.v-red   { --vc: var(--red); }
.card-media { position: relative; border-radius: var(--radius-slab); overflow: hidden; background: var(--media-bg);
  aspect-ratio: 3/4; box-shadow: 0 10px 30px rgba(0,0,0,.35);
  border-bottom: 3px solid var(--vc, var(--line));
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), box-shadow .3s ease; }
.card:hover .card-media { transform: translateY(-7px); box-shadow: 0 14px 32px rgba(0,0,0,.18), 0 0 24px rgba(167,139,250,.22); }
@media (prefers-reduced-motion: reduce) { .card-media { transition: box-shadow .3s ease; }
  .card:hover .card-media { transform: none; } }

/* whimsical rainbow frame on hover — highlights the card without dimming it */
.card-media::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 6px; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(115deg, #ff3b5c, #ffb13b, #ffe14d, #34d399, #22d3ee, #a78bfa, #f472b6, #ff3b5c);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
.card:hover .card-media::after { opacity: 1; animation: rainbowFlow 3s linear infinite; }
@keyframes rainbowFlow { to { background-position: 300% 0; } }
@media (prefers-reduced-motion: reduce) { .card:hover .card-media::after { animation: none; } }
.card-img { position: absolute; inset: 0; display: block; }
.card-img img { width: 100%; height: 100%; object-fit: contain; }
.noimg { color: var(--muted); display: grid; place-items: center; height: 100%; font-size: .8em; }

/* tags pinned on the image */
.grade-tag { position: absolute; top: 12px; left: 12px; z-index: 3; font-size: .68em; font-weight: 700;
  letter-spacing: .03em; padding: 4px 9px; border-radius: 8px; background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px); color: #fff; }
.status-tag { position: absolute; bottom: 12px; left: 12px; z-index: 3; font-size: .62em; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; padding: 4px 8px; border-radius: 8px; }
.status-tag.delisted { background: #555; color: #ddd; }
.status-tag.sold { background: var(--red); color: #fff; }
/* freshness — top-right-ish overlay (below the fav icon); solid backgrounds so
   the text stays legible over any card art regardless of page theme. */
.fresh-tag { position: absolute; top: 12px; right: 52px; z-index: 3; font-size: .62em; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; padding: 4px 9px; border-radius: 8px;
  backdrop-filter: blur(4px); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.fresh-tag.fresh-just { background: var(--green); color: #052e21; }
.fresh-tag.fresh-new { background: var(--accent); color: #fff; }

/* favorite — small unobtrusive corner icon, always visible (auth-aware via _fav_button.html) */
.fav-icon { position: absolute; top: 11px; right: 11px; z-index: 4; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%; background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px); color: #fff; border: 1px solid rgba(255,255,255,.14);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 0; text-decoration: none;
  transition: background .15s ease, transform .15s ease, color .15s ease; }
.fav-icon:hover { background: rgba(0,0,0,.8); transform: scale(1.1); }
.fav-icon.on { color: var(--gold); border-color: rgba(227,179,65,.55); }

/* hover overlay — secondary info + eBay action */
.hover-panel { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 12px; padding: 16px;
  background: linear-gradient(to top, rgba(8,9,14,.9) 0%, rgba(8,9,14,.66) 20%, rgba(8,9,14,.18) 40%, rgba(8,9,14,0) 56%);
  text-shadow: 0 1px 6px rgba(0,0,0,.6); opacity: 0; transition: opacity .22s ease; pointer-events: none; }
.card:hover .hover-panel { opacity: 1; }
.hover-panel * { pointer-events: none; }
.hover-panel .hp-actions a { pointer-events: auto; }
.microbars { display: flex; flex-direction: column; gap: 6px; }
.mbar { display: grid; grid-template-columns: 34px 1fr 40px; align-items: center; gap: 8px; }
.mbar .ml { font-size: .62em; color: var(--muted); letter-spacing: .03em; }
.mbar .mv { font-size: .62em; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mtrack { position: relative; height: 5px; background: rgba(255,255,255,.12); border-radius: 3px; }
.mtrack .mcenter { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255,255,255,.45); }
.mtrack .mmark { position: absolute; top: 50%; width: 8px; height: 8px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--green); box-shadow: 0 0 0 2px rgba(10,10,10,.6); }
.mtrack .mmark.off { background: var(--amber); }
.mtrack .mmark.bad { background: var(--red); }
.hp-corners { font-size: .68em; color: var(--muted); font-style: italic; }
.hp-method { font-size: .64em; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 6px; }
.hp-actions { display: flex; gap: 8px; }
.hp-actions .ebay { flex: 1; text-align: center; font-size: .8em; font-weight: 600; padding: 8px 6px;
  border-radius: 8px; background: var(--accent); color: #fff; }
.hp-actions .ebay:hover { filter: brightness(1.12); }
.badge { position: absolute; top: 8px; left: 8px; font-size: .7em; font-weight: 700; padding: 3px 7px; border-radius: 20px; background: #000a; }
.badge.psa { background: #2d6cdf; } .badge.tag { background: #7a52d6; }
.badge.inactive { background: #555; left: auto; right: 8px; top: 8px; }
.badge.sold { background: #c0392b; left: auto; right: 8px; top: 34px; }
.badge.active { background: var(--green); } .badge.src { background: #444; }
.badge.inline { position: static; display: inline-block; margin-left: 8px; }
/* The data slab — glassmorphic case beneath the card image */
.card-body { margin: 8px 6px 0; position: relative; z-index: 3; padding: 13px 14px;
  display: flex; flex-direction: column; gap: 3px;
  background: var(--slab-glass); backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--slab-border); border-radius: var(--radius-slab);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--slab-glow);
  transition: border-color .25s ease, box-shadow .25s ease, background-image .3s ease; }
.card:hover .card-body { border-color: rgba(255,255,255,.2); }
.card-media { margin: 0 6px; }

/* Holographic sheen — top contenders glow at rest, any slab on hover (design.md §2) */
.card.top-contender .card-body {
  border-color: rgba(0,224,208,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--slab-glow), 0 0 14px rgba(0,224,208,.12); }
.card.top-contender:hover .card-body, .card:hover .card-body {
  background-image: var(--gradient-holo); background-size: 200% 200%;
  animation: holoShift 4s ease infinite; }
.card.top-contender:hover .card-body {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--slab-glow), 0 0 18px rgba(0,224,208,.22); }
@keyframes holoShift {
  0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Grade Gap — current grade bridged to target grade */
.grade-gap { display: flex; align-items: center; gap: 9px; margin: 9px 0 11px; }
.gg-from { font-size: .72em; font-weight: 700; letter-spacing: .03em; color: var(--muted);
  background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; }
.gg-bridge { flex: 1; height: 2px; border-radius: 2px; position: relative;
  background: linear-gradient(90deg, var(--line), var(--cyan), var(--violet)); }
.gg-bridge::after { content: ""; position: absolute; right: -1px; top: 50%; transform: translateY(-50%);
  border-left: 6px solid var(--violet); border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
.gg-to { font-family: var(--display); font-size: .78em; font-weight: 700; letter-spacing: .02em;
  background: var(--gradient-holo-text); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  border: 1px solid rgba(167,139,250,.4); border-radius: 8px; padding: 3px 10px;
  box-shadow: 0 0 14px rgba(167,139,250,.18); }

/* Financial block inside the slab — stacked trade ticket */
.slab-fin { display: flex; flex-direction: column; gap: 9px; }
.slab-fin .score-ring-inner { background: var(--panel); }
.spread { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.02; }
.spread-val { font-family: var(--display); font-weight: 700; font-size: 1.72em; color: var(--green);
  letter-spacing: -.01em; font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(52,211,153,.3); }
.spread-lab { font-size: .58em; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-top: 3px; }
.fin-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.defect-chip { display: flex; flex-direction: column; align-items: flex-end; gap: 3px;
  flex: 0 0 auto; }
.dc-centering { font-size: .64em; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.dc-warn { color: var(--amber); background: rgba(240,181,74,.12); border: 1px solid rgba(240,181,74,.32); }
.dc-bad { color: var(--red); background: rgba(240,86,110,.12); border: 1px solid rgba(240,86,110,.34); }
.dc-count { font-size: .62em; font-weight: 600; color: var(--muted); text-transform: uppercase;
  letter-spacing: .03em; white-space: nowrap; }
.dc-loc { color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
/* floor → ceiling, contrasted as a trade (design.md §2/§3) */
.floor-ceiling { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  padding-top: 9px; border-top: 1px solid var(--slab-border); }
.fc-floor, .fc-ceiling { display: flex; flex-direction: column; line-height: 1.12; font-variant-numeric: tabular-nums; }
.fc-ceiling { text-align: right; }
.fc-floor { color: var(--red); font-weight: 700; font-size: .98em; }
.fc-ceiling { color: var(--text); font-weight: 700; font-size: .98em; }
.fc-floor small, .fc-ceiling small { font-size: .56em; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--faint); margin-top: 2px; }
.fc-floor small.fc-over { color: var(--red); font-weight: 700; }
.fc-arrow { color: var(--muted); font-size: .95em; align-self: center; }
/* CGC 10 fallback comp — subtle pill under the PSA 10 ceiling, secondary to it */
.fc-cgc { align-self: flex-end; display: inline-flex; align-items: baseline; gap: 4px; margin-top: 6px;
  font-size: .68em; font-weight: 700; color: var(--muted); background: var(--panel2);
  border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.fc-cgc b { color: var(--text); }
.title { font-weight: 600; font-size: 1.02em; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.setline { color: var(--muted); font-size: .78em; margin-bottom: 9px; }
.favbtn { background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 8px 14px; cursor: pointer; font-size: .82em; }
.favbtn:hover { border-color: #555; }
.favbtn.on { color: var(--gold); border-color: var(--gold); }
.card-body .favbtn { margin-top: 8px; width: 100%; text-align: center; }
.empty { color: var(--muted); padding: 30px; text-align: center; }

/* ============ Redesign: verdict-led card (trade block + always-on CTA) ============ */
/* Overlays repositioned so the verdict chip owns the top-right; status stacks under the
   grade tag; fresh + fav drop to the bottom corners — nothing collides. */
.status-tag { top: 40px; left: 12px; bottom: auto; }
.fresh-tag { top: auto; right: auto; bottom: 12px; left: 12px; }
.card-media .fav-icon { top: auto; bottom: 11px; right: 11px; }

/* Verdict chip — glassy pill on the image: score ring + decision word. */
.v-chip-link { position: absolute; top: 10px; right: 10px; z-index: 4; display: block; }
.v-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px;
  border-radius: 22px; background: var(--slab-glass); backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%); border: 1px solid var(--vc, var(--line));
  box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.card.v-green .v-chip { border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.card.v-amber .v-chip { border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.v-chip-ring { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--vc) calc(var(--pct) * 1%), var(--track) 0); }
.v-chip-ring > span { width: 19px; height: 19px; border-radius: 50%; background: var(--panel);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 11px;
  color: var(--vc); line-height: 1; font-variant-numeric: tabular-nums; }
.v-chip-word { font-family: var(--display); font-weight: 700; font-size: 10.5px; letter-spacing: .04em; color: var(--vc); }

/* Card body: more air than the old dense slab; the trade block is the hero. */
.card-body { gap: 0; }
.card-body .title { margin-top: 1px; }
.card-body .setline { margin-bottom: 11px; }

/* The Trade — net-profit hero + buy → fees → comp ladder. */
.trade { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 11px; }
.trade-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.trade-lab { font-size: .62em; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 700; }
.trade-roi { font-size: .68em; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.trade-net { font-family: var(--display); font-weight: 700; font-size: 1.9em; color: var(--green);
  line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; text-shadow: 0 0 10px rgba(52,211,153,.22); }
.trade-ladder { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.trade-ladder .tl-buy, .trade-ladder .tl-comp { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.trade-ladder .tl-comp { text-align: right; align-items: flex-end; }
.trade-ladder .tl-mid { display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; }
.trade-ladder b { font-size: .96em; font-weight: 700; }
.trade-ladder .tl-buy b { color: var(--red); }
.trade-ladder .tl-comp b { color: var(--text); }
.trade-ladder small { font-size: .58em; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); font-weight: 600; margin-top: 2px; white-space: nowrap; }
.trade-ladder .tl-arrow { color: var(--faint); font-size: .96em; line-height: 1; }
.trade-ladder .tl-mid small { text-transform: none; letter-spacing: 0; }
/* No usable gem-mint comp — same trade layout, unknown figures shown as a yellow shrug. */
.shrug { color: var(--amber); font-family: var(--font); white-space: nowrap; }
.trade-net.shrug { font-size: 1.15em; font-weight: 700; letter-spacing: 0; text-shadow: none; }
.trade-roi.shrug { color: var(--amber); font-weight: 700; }
.tl-comp b.shrug { font-size: .82em; }
body.view-split .trade-net.shrug { font-size: 1.05em; }

/* Condition chips — always visible (no hover dependency). */
.cond-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; margin-bottom: 11px; }
.cchip { font-size: .62em; font-weight: 600; color: var(--muted); background: var(--panel2);
  border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.cchip-green { color: var(--green); font-weight: 700; background: color-mix(in srgb, var(--green) 10%, transparent);
  border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.cchip-amber { color: var(--amber); font-weight: 700; background: color-mix(in srgb, var(--amber) 12%, transparent);
  border-color: color-mix(in srgb, var(--amber) 32%, transparent); }
.cchip-red { color: var(--red); font-weight: 700; background: color-mix(in srgb, var(--red) 10%, transparent);
  border-color: color-mix(in srgb, var(--red) 30%, transparent); }

/* Always-on primary CTA — no longer hidden behind hover (which failed on mobile). */
.card-cta { display: block; text-align: center; font-size: .84em; font-weight: 700; padding: 11px;
  border-radius: 10px; background: var(--accent); color: #fff; margin-top: auto;
  box-shadow: 0 6px 16px rgba(91,140,255,.30); transition: filter .15s ease, transform .15s ease; }
.card-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* ---------- compact "split slab" view toggle — photo left, stats right ---------- */
.fb-toggle.on { color: var(--accent); border-color: var(--accent); }
body.view-split #results .grid { grid-template-columns: repeat(auto-fill, minmax(min(500px, 100%), 1fr)); gap: 22px 24px; }
/* Unified slab: media flush-left (with the colored verdict rail) + body flush-right read as ONE
   card, not two floating tiles. The card container owns the border/radius/shadow; the media drops
   its own so the rail sits cleanly against the card's rounded edge. */
body.view-split .card { position: relative; flex-direction: row; gap: 0; overflow: hidden;
  background: var(--slab-glass); backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--slab-border); border-radius: var(--radius-slab); box-shadow: var(--slab-glow);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, border-color .25s ease; }
body.view-split .card-media { flex: 0 0 172px; width: 172px; aspect-ratio: 5/7; align-self: stretch;
  margin: 10px 0 10px 10px; border-radius: var(--radius-inner); box-shadow: none;
  border-bottom: none; border-left: none; }
body.view-split .card:hover .card-media { transform: none; }
body.view-split .card-media::after { display: none; }
/* verdict-tinted frame around the whole slab (replaces the one-sided rail), glow for contenders */
body.view-split .card.v-green { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
body.view-split .card.v-amber { border-color: color-mix(in srgb, var(--amber) 55%, var(--line)); }
body.view-split .card.v-red   { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); }
body.view-split .card.top-contender { box-shadow: var(--slab-glow), 0 0 16px rgba(52,211,153,.16); }
/* rainbow highlight frame on hover — the full-card version of the gallery sheen */
body.view-split .card:hover { transform: translateY(-3px); box-shadow: var(--slab-glow), 0 0 22px rgba(167,139,250,.24); }
body.view-split .card::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  padding: 2px; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(115deg, #ff3b5c, #ffb13b, #ffe14d, #34d399, #22d3ee, #a78bfa, #f472b6, #ff3b5c);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
body.view-split .card:hover::after { opacity: 1; animation: rainbowFlow 3s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  body.view-split .card:hover { transform: none; }
  body.view-split .card:hover::after { animation: none; }
}
body.view-split .card-body, body.view-split .card.top-contender .card-body {
  flex: 1; margin: 0; min-width: 0; justify-content: center; padding: 14px 16px;
  background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
  border: none; border-radius: 0; box-shadow: none; }
body.view-split .card:hover .card-body { background-image: none; }
/* Ring-only verdict chip in the narrow media so it never collides with the grade tag. */
body.view-split .v-chip-word { display: none; }
body.view-split .v-chip { padding: 4px; }
body.view-split .title { white-space: nowrap; text-overflow: ellipsis; }
body.view-split .setline { margin-bottom: 9px; }
body.view-split .trade { margin-bottom: 9px; }
body.view-split .trade-net { font-size: 1.55em; }
body.view-split .card-cta { align-self: flex-start; padding: 9px 20px; }
@media (max-width: 560px) {
  body.view-split .card { flex-direction: column; }
  body.view-split .card-media { width: auto; aspect-ratio: 3/4; margin: 10px 10px 0;
    border-left: none; border-bottom: none; }
  body.view-split .v-chip-word { display: inline; }
  body.view-split .v-chip { padding: 4px 11px 4px 5px; }
  body.view-split .card-cta { margin: auto 0 0; width: 100%; }
}

/* detail */
.back { color: var(--muted); display: inline-block; margin-bottom: 14px; }
.detail { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 44px; align-items: start; }
.detail-images { position: sticky; top: 86px; min-width: 0; }
.detail-info { min-width: 0; }
.main-imgs { display: flex; gap: 12px; }
.main-imgs img { flex: 1; min-width: 0; border-radius: 14px; background: var(--media-bg); object-fit: contain;
  max-height: 600px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.corner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-width: 320px; }
.corner { position: relative; background: var(--media-bg); border-radius: 8px; border: 2px solid transparent; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.corner.damaged { border-color: #e0556b; }
.corner img { width: 100%; height: 100%; object-fit: contain; }
.cprob { position: absolute; bottom: 4px; right: 4px; background: #000b; font-size: .7em; padding: 1px 6px; border-radius: 10px; }
.detail-info h1 { margin: 8px 0 3px; font-family: var(--display); font-weight: 700; font-size: 1.7em; letter-spacing: -.015em; }
.detail-info h1 a { color: inherit; text-decoration: none; }
.detail-info h1 a:hover { color: var(--accent); text-decoration: underline; }
.rawtitle { color: var(--muted); font-size: .8em; margin: 6px 0 14px; }
.badges { display: flex; gap: 8px; }
.badges .badge { position: static; }
.prices { width: 100%; border-collapse: collapse; margin: 8px 0 14px; }
.prices th { text-align: left; color: var(--muted); font-weight: 500; font-size: .82em; padding: 6px 8px; width: 90px; }
.prices td { padding: 6px 8px; font-weight: 600; }
.prices .ask { font-size: 1.1em; } .prices .profit { color: var(--green); }
.defect-summary { color: var(--gold); font-size: .9em; margin-bottom: 16px; }
.defect-summary b { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions-secondary { margin-top: 10px; }
.btn { background: var(--panel2); border: 1px solid var(--line); color: var(--text);
  padding: 9px 14px; border-radius: 8px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { border-color: #555; }
.btn.primary { background: var(--accent); color: #fff; border: none; }
.btn-ebay { font-size: 1.12em; font-weight: 700; padding: 14px 24px; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(91,140,255,.4); }
.btn-ebay:hover { filter: brightness(1.1); box-shadow: 0 8px 26px rgba(91,140,255,.55); }
.soldbtn { background: color-mix(in srgb, var(--red) 12%, var(--panel2)); border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line)); color: var(--red); border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.soldbtn:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 20%, var(--panel2)); }
@media (max-width: 760px) {
  .detail { grid-template-columns: minmax(0, 1fr); }
  main { padding: 16px; }
  .filterbar { gap: 10px; }
  .filterbar .fb-field.sm { width: calc(50% - 6px); }
}

/* ============ Dashboard: score badge, trinity, centering bars ============ */
.verdict { display: flex; align-items: center; gap: 10px; }
.verdict.v-green { --rc: var(--green); }
.verdict.v-amber { --rc: var(--amber); }
.verdict.v-red { --rc: var(--red); }
.score-ring { width: var(--size); height: var(--size); flex: 0 0 var(--size);
  border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--rc) calc(var(--pct) * 1%), var(--track) 0); }
.score-ring-inner { width: calc(var(--size) - 9px); height: calc(var(--size) - 9px);
  border-radius: 50%; background: var(--panel); display: grid; place-items: center; }
.score-num { font-family: var(--display); font-weight: 700; font-size: calc(var(--size) * .36); color: var(--rc);
  line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.verdict-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.decision { font-family: var(--display); font-weight: 700; font-size: .82em; letter-spacing: .04em; color: var(--rc); }
.verdict-sub { font-size: .64em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ltd { margin-top: 2px; font-size: .64em; font-weight: 600; letter-spacing: .01em;
  border-radius: 5px; padding: 1px 6px; align-self: flex-start; white-space: nowrap; }
.ltd-limited { color: var(--amber); background: rgba(240,181,74,.12); border: 1px solid rgba(240,181,74,.35); }
.ltd-full { color: var(--green); background: rgba(52,211,153,.10); border: 1px solid rgba(52,211,153,.28); }
.slab-fin .verdict { gap: 8px; }
.slab-fin .verdict-sub { display: none; }
.slab-fin .decision { font-size: .72em; letter-spacing: .05em; }
.slab-fin .ltd { font-size: .6em; }

/* Centering bars */
.centering { display: flex; flex-direction: column; gap: 5px; }
.centering.compact { gap: 4px; }
.cbar { display: grid; grid-template-columns: 28px 1fr 44px; align-items: center; gap: 8px; }
.cbar-lab { font-size: .66em; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cbar-track { position: relative; height: 7px; background: var(--track); border-radius: 4px; overflow: hidden; }
.centering.compact .cbar-track { height: 5px; }
.cbar-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; }
.cbar.ok .cbar-fill { background: var(--green); }
.cbar.warn .cbar-fill { background: var(--amber); }
.cbar.bad .cbar-fill { background: var(--red); }
.cbar-mid { position: absolute; left: 50%; top: -1px; bottom: -1px; width: 2px;
  background: var(--text); opacity: .7; transform: translateX(-1px); z-index: 2; }
.cbar-val { font-size: .68em; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.cbar.bad .cbar-val { color: var(--red); }

/* Detail page: verdict panel + full centering + reasons */
.verdict-panel { display: flex; align-items: center; gap: 22px; background: var(--panel);
  border-radius: 12px; padding: 16px 20px; margin: 14px 0; flex-wrap: wrap; }
.trinity-head { display: flex; gap: 28px; flex-wrap: wrap; }
.th-item { display: flex; flex-direction: column; gap: 3px; }
.th-lab { font-size: .68em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.th-note { text-transform: none; letter-spacing: 0; color: var(--faint); font-weight: 400; }
.th-ask { font-family: var(--display); font-size: 1.55em; font-weight: 700; color: var(--text); line-height: 1; }
.th-psa10 { font-size: 1.1em; font-weight: 600; color: var(--muted); line-height: 1; }
.th-profit { font-size: 1.1em; font-weight: 700; color: var(--green); line-height: 1; }

/* Ding report beside the regrade score. trinity-head takes its own row below. */
.verdict-panel .trinity-head { flex-basis: 100%; }
.ding-panel { margin-left: auto; align-self: stretch; min-width: 172px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-inner, 9px);
  padding: 10px 14px; }
.ding-head { font-size: .68em; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; margin-bottom: 8px; }
.ding-head span { color: var(--gold); font-weight: 700; margin-left: 4px; }
.ding-grid { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ding-grid th { font-size: .64em; color: var(--faint); text-transform: uppercase; letter-spacing: .05em;
  font-weight: 700; text-align: center; padding: 0 0 4px; }
.ding-grid th:first-child { text-align: left; }
.ding-grid .dg-lab { font-size: .78em; color: var(--muted); padding: 3px 8px 3px 0; }
.ding-grid .dg-n { font-family: var(--display); font-size: .95em; font-weight: 700; text-align: center;
  padding: 3px 6px; width: 34px; }
.ding-grid .dg-n.hit { color: var(--red); }
.ding-grid .dg-n.zero { color: var(--faint); }
.ding-lines { display: flex; flex-direction: column; gap: 5px; font-size: .82em; color: var(--muted); }
.ding-lines b { color: var(--text); font-family: var(--display); }
.ding-clean { font-size: .8em; color: var(--green); }
.centering.full { background: var(--panel); border-radius: 12px; padding: 14px 18px; margin: 14px 0; gap: 10px; }
.cen-head { font-weight: 700; font-size: .9em; margin-bottom: 2px; }
.cen-head span { font-weight: 400; color: var(--muted); font-size: .82em; margin-left: 6px; }
.cen-group { display: flex; flex-direction: column; gap: 6px; }
.cen-gl { font-size: .72em; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.centering.full .cbar { grid-template-columns: 34px 1fr 52px; }
.centering.full .cbar-track { height: 9px; }
.methodology-note { color: var(--muted); font-size: .85em; margin: 4px 0 14px; line-height: 1.4; }
.reasons-panel { background: var(--panel); border-radius: 12px; padding: 12px 18px; margin: 14px 0; }
.rp-head { font-weight: 700; font-size: .82em; color: var(--gold); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.reasons-panel ul { margin: 0; padding-left: 18px; color: var(--text); font-size: .88em; }
.reasons-panel li { margin: 3px 0; }

/* ============ Detail: "The Trade" ledger (net-profit hero + honest breakdown) ============ */
.ledger { --vc: var(--green); border: 1px solid var(--line); border-radius: var(--radius-slab);
  overflow: hidden; margin: 4px 0 18px; box-shadow: 0 14px 34px rgba(30,40,80,.16); }
.ledger.v-amber { --vc: var(--amber); }
.ledger.v-red { --vc: var(--red); }
.ledger-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; background: linear-gradient(100deg, color-mix(in srgb, var(--green) 74%, #000), var(--green)); }
.lh-lab { font-size: .66em; text-transform: uppercase; letter-spacing: .09em; color: rgba(255,255,255,.85); font-weight: 700; }
.lh-net { font-family: var(--display); font-weight: 700; font-size: 2.3em; color: #fff; line-height: 1.05;
  letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lh-sub { font-size: .78em; color: rgba(255,255,255,.92); font-weight: 600; }
.lh-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px 6px 6px;
  border-radius: 24px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); }
.lh-ring { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--pct) * 1%), rgba(255,255,255,.28) 0); }
.lh-ring > span { width: 25px; height: 25px; border-radius: 50%; background: color-mix(in srgb, var(--green) 70%, #000);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 13px; color: #fff;
  line-height: 1; font-variant-numeric: tabular-nums; }
.lh-word { font-family: var(--display); font-weight: 700; font-size: .82em; letter-spacing: .04em; color: #fff; }
.ledger-rows { background: var(--panel); padding: 6px 20px 12px; }
.lr { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--panel2); font-size: .9em; color: var(--muted);
  font-variant-numeric: tabular-nums; }
.lr span:last-child { font-weight: 700; }
.lr-cost { color: var(--red); }
.lr-neg { color: var(--muted); font-weight: 600 !important; }
.lr-strong { color: var(--text) !important; font-weight: 700; }
.lr-total { border-bottom: none; padding-bottom: 2px; color: var(--text); font-weight: 700; }
.lr-net { color: var(--green); font-size: 1.15em; }
.ledger-down { background: var(--panel2); border-top: 1px solid var(--line); padding: 11px 20px;
  display: flex; align-items: baseline; gap: 10px; }
.ld-lab { font-size: .66em; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); font-weight: 700; }
.ld-val { font-size: .92em; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ld-val.neg { color: var(--red); }
.ld-val em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .88em; }
.ledger-foot { background: var(--panel); border-top: 1px solid var(--panel2); padding: 10px 20px;
  font-size: .74em; color: var(--faint); line-height: 1.45; }
/* No usable gem-mint comp on the detail ledger — same layout, unknown figures shown as a yellow
   shrug, and an amber hero (not the profit-green one) since there's no net to celebrate yet. */
.ledger-nodata .ledger-hero { background: linear-gradient(100deg, color-mix(in srgb, var(--amber) 72%, #000), var(--amber)); }
.ledger-nodata .lh-ring > span { background: color-mix(in srgb, var(--amber) 70%, #000); }
.ledger-nodata .lh-net.shrug { color: #fff; font-family: var(--font); }
.lr .lr-shrug, .lr .shrug { color: var(--amber); }
.lr-net.shrug { color: var(--amber); font-size: 1em; }

/* ============ Round 5: depth, states, micro-interactions ============ */
.verdict-panel, .centering.full, .reasons-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0) 55%), var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 10px 26px rgba(0,0,0,.28);
}
.verdict-panel { padding: 18px 22px; gap: 24px; }
.card-img img { transition: transform .45s cubic-bezier(.2,.6,.2,1); }
.card:hover .card-img img { transform: scale(1.045); }
@property --pct { syntax: "<number>"; inherits: false; initial-value: 0; }
@keyframes ring-grow { from { --pct: 0; } }
.score-ring { animation: ring-grow .9s cubic-bezier(.22,.61,.36,1) both; }

/* loading bar + skeleton (during HTMX search) */
#loadbar { height: 2px; margin: -14px 0 16px; border-radius: 2px; overflow: hidden; opacity: 0; transition: opacity .2s; }
.filterbar.htmx-request ~ #loadbar { opacity: 1; }
#loadbar span { display: block; height: 100%; width: 38%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loadbar 1s infinite ease-in-out; }
@keyframes loadbar { 0%{transform:translateX(-120%)} 100%{transform:translateX(360%)} }
#skeleton { display: none; }
.filterbar.htmx-request ~ #skeleton { display: grid; }
.filterbar.htmx-request ~ #results { display: none; }
.skel-card { display: flex; flex-direction: column; }
.skel { border-radius: 8px; background: var(--panel);
  background-image: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.06) 40%, rgba(255,255,255,.06) 50%, transparent 70%);
  background-size: 220% 100%; animation: shimmer 1.25s infinite linear; }
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skel-img { aspect-ratio: 3/4; border-radius: 14px; }
.skel-line { height: 12px; }
.skel-line.lg { width: 78%; margin-top: 14px; }
.skel-line.sm { width: 52%; height: 9px; margin-top: 8px; }
.skel-line.md { flex: 1; height: 12px; }
.skel-row { display: flex; align-items: center; gap: 11px; margin-top: 14px; }
.skel-ring { width: 46px; height: 46px; border-radius: 50%; flex: 0 0 46px; }

/* ============ Touch devices: no :hover, so reveal the slab overlay permanently ============ */
/* The eBay CTA + centering microbars live in .hover-panel (hover-only on desktop). On touch
   there is no hover, so pin the overlay open with a darker gradient to keep it legible. */
@media (hover: none) {
  .hover-panel { opacity: 1;
    background: linear-gradient(to top,
      rgba(8,9,14,.94) 0%, rgba(8,9,14,.82) 24%, rgba(8,9,14,.42) 46%, rgba(8,9,14,0) 66%); }
  .hover-panel .hp-actions a { pointer-events: auto; }
  .hp-actions .ebay { padding: 11px 8px; }        /* comfortable tap target */
}

/* ============ Phone layout pass ============ */
@media (max-width: 640px) {
  /* --- topbar: tighter, no crowding of brand + nav + toggle --- */
  .topbar { padding: 10px 12px; gap: 6px; }
  .brand { font-size: .82em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar nav a { margin-left: 10px; font-size: .82em; }
  .theme-toggle { margin-left: 10px; width: 32px; height: 32px; }

  /* --- content padding & grid --- */
  main { padding: 14px 12px; }
  .grid { gap: 22px 16px; }

  /* --- filter bar: still sticky (kept per design choice), stacks & wraps --- */
  .filterbar { position: sticky; top: 52px; padding: 11px 12px; margin-bottom: 18px; }
  .fb-main { gap: 10px; }
  .filterbar .fb-search { flex: 1 1 100%; }
  .fb-toggles { margin-left: 0; flex-wrap: wrap; }
  .fb-toggle { flex: 1 1 auto; text-align: center; padding: 10px 12px; }
  /* compact/gallery render identically in one column on phones — the toggle is redundant, hide it
     so the sticky bar stays short */
  #layoutToggle { display: none; }
  /* quick-sort chips scroll horizontally in one row (design intent) instead of wrapping to two,
     keeping the sticky bar from eating the screen */
  .qsort { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin: 12px -12px 0; padding: 0 12px; }
  .qsort::-webkit-scrollbar { display: none; }
  .qsort-chip { flex: 0 0 auto; }
  /* 16px inputs prevent iOS auto-zoom on focus */
  .filterbar input, .filterbar select, .filterbar .fb-search input { font-size: 16px; }

  /* --- bigger tap targets --- */
  .fav-icon { width: 38px; height: 38px; }
  .pager a, .pager button { padding: 10px 14px; }

  /* --- detail page: tighten spacing at phone width --- */
  .detail { gap: 22px; }
  .detail-images { position: static; }
  .main-imgs { gap: 8px; }
  .detail-info h1 { font-size: 1.4em; }
  .verdict-panel { padding: 14px 16px; gap: 16px; }
  .trinity-head { gap: 18px; }
  .ding-panel { margin-left: 0; width: 100%; box-sizing: border-box; }
  .corner-grid { max-width: none; }
  .actions .btn, .actions .soldbtn { flex: 1 1 auto; justify-content: center; }
}

/* richer empty state */
.empty { color: var(--muted); text-align: center; padding: 72px 20px; font-size: .95em; }
.empty strong { display: block; color: var(--text); font-family: var(--display); font-size: 1.25em;
  margin-bottom: 6px; font-weight: 600; }
.empty .eicon { display: block; font-size: 2em; margin-bottom: 12px; opacity: .55; }

/* ============ production extras: nav, auth, pager, button states ============ */
.navform { display: inline; margin: 0 0 0 20px; }
.linkbtn { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linkbtn:hover { color: var(--text); }
.muted { color: var(--muted); }

.btn.disabled, .btn:disabled { color: var(--muted); cursor: not-allowed; opacity: .6; }
.btn.disabled:hover { border-color: var(--line); color: var(--muted); }
.soldwrap { display: inline-flex; align-items: center; gap: 9px; }
.soldbtn.on { color: var(--red); border-color: var(--red); }
.badge.sold.inline { position: static; background: var(--red); color: #fff; }
/* "Report cooked" — community downvote; burnt-amber to sit apart from the red sold action */
.cookedwrap { display: inline-flex; align-items: center; gap: 9px; }
.cookedbtn { background: color-mix(in srgb, var(--amber) 12%, var(--panel2));
  border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line)); color: var(--amber);
  border-radius: 8px; padding: 9px 12px; cursor: pointer; }
.cookedbtn:hover { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 20%, var(--panel2)); }
.cookedbtn.on { color: var(--amber); border-color: var(--amber);
  background: color-mix(in srgb, var(--amber) 22%, var(--panel2)); }
.loginhint { color: var(--muted); font-size: .85em; margin: 12px 0 0; }
.loginhint a { color: var(--accent); }
.seen { color: var(--faint); font-size: .78em; margin: 8px 0 0; }
.noimg.big { width: 100%; aspect-ratio: 3/4; border-radius: 14px; border: 1px solid var(--line); }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 34px 0 4px; }
.pager .pageinfo { color: var(--muted); font-size: .85em; }

/* watchlist */
.favhead { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 22px; gap: 14px; flex-wrap: wrap; }
.favhead h1 { font-family: var(--display); font-size: 1.5em; margin: 0; }
.favhead h1 .count { color: var(--muted); font-size: .7em; }

/* auth pages */
.authpage { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 880px; margin: 30px auto; }
.authpage.single { grid-template-columns: 1fr; max-width: 600px; }
.authcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.authcard h2 { margin: 0 0 8px; font-family: var(--display); font-size: 1.12em; }
.authcard form { margin-top: 16px; }
.authcard input[type=text] { width: 100%; margin-top: 5px; background: var(--panel2); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 10px 12px; }
.authcard input[type=text]:focus { outline: none; border-color: var(--accent); }
.authcard label { display: block; font-size: .82em; color: var(--muted); margin-bottom: 12px; }
.authcard .primary { margin-top: 8px; }
.authcard code { color: var(--gold); font-size: .9em; }
.autherror { grid-column: 1 / -1; background: rgba(240,86,110,.12); border: 1px solid var(--red); color: var(--text); padding: 11px 15px; border-radius: 8px; font-size: .9em; }
.warn { background: rgba(232,190,85,.13); border: 1px solid var(--gold); color: var(--text); padding: 11px 15px; border-radius: 8px; font-size: .86em; }
.warn b { color: var(--gold); }
.credlabel { display: block; color: var(--muted); font-size: .7em; letter-spacing: .12em; text-transform: uppercase; margin: 16px 0 5px; }
.credbox { display: flex; gap: 8px; }
.credbox input { flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--gold); border-radius: 8px; padding: 10px 12px; }

/* ============ temporary feedback widget ============ */
#feedback-widget { position: fixed; right: 22px; bottom: 22px; z-index: 50; }

/* ---------- first-visit splash ---------- */
.splash-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(10,10,14,.6);
  backdrop-filter: blur(10px) saturate(120%); -webkit-backdrop-filter: blur(10px) saturate(120%); }
.splash-overlay[hidden] { display: none; }
.splash-card { max-width: 460px; width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-slab); padding: 28px 26px; box-shadow: var(--slab-glow); }
.splash-badge { display: inline-block; font-family: var(--display); font-size: .68em; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent); background: rgba(91,140,255,.12);
  border: 1px solid rgba(91,140,255,.3); border-radius: 20px; padding: 4px 12px; margin-bottom: 14px; }
.splash-card h2 { margin: 0 0 10px; font-family: var(--display); font-size: 1.3em; color: var(--text); }
.splash-card p { color: var(--muted); font-size: .92em; line-height: 1.5; margin: 0 0 16px; }
.splash-methods { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.splash-methods li { font-size: .88em; color: var(--text); line-height: 1.45; padding: 10px 12px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.splash-methods li b { color: var(--gold); }
.splash-methods .soon { color: var(--faint); font-size: .92em; }
.splash-check { display: flex; align-items: center; gap: 8px; font-size: .85em; color: var(--muted);
  margin-bottom: 18px; cursor: pointer; }
.splash-check input { width: auto; }
.splash-ok { width: 100%; padding: 12px; font-size: .95em; }
@media (max-width: 520px) { .splash-card { padding: 22px 18px; } }
.fb-fab { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 11px 17px; border-radius: 999px; border: none; color: #fff; font: inherit;
  font-weight: 700; font-size: .9em; letter-spacing: .01em;
  background: linear-gradient(100deg, #0a93a6, #6d4fd6 45%, #cf3d8f 80%); background-size: 160% 100%;
  box-shadow: 0 8px 24px rgba(109,79,214,.34); transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s; }
.fb-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 30px rgba(109,79,214,.45); }
.fb-fab-icon { font-size: 1.05em; }
.fb-panel { position: absolute; right: 0; bottom: 58px; width: 320px; max-width: 78vw;
  background: var(--slab-glass); backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--slab-border); border-radius: var(--radius-slab); padding: 16px;
  box-shadow: var(--slab-glow); transform: translateY(8px) scale(.97); transform-origin: bottom right;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s cubic-bezier(.34,1.4,.64,1); }
#feedback-widget.open .fb-panel { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.fb-head { font-family: var(--display); font-weight: 700; font-size: .98em; margin-bottom: 10px; }
.fb-head span { display: block; font-family: var(--font); font-weight: 400; font-size: .68em;
  color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.fb-form textarea { width: 100%; resize: vertical; min-height: 74px; font: inherit; font-size: .92em;
  color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.fb-form textarea:focus { outline: none; border-color: var(--accent); }
.fb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-err { color: var(--red); font-size: .8em; margin-top: 8px; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.fb-cancel { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .86em; padding: 8px 10px; }
.fb-cancel:hover { color: var(--text); }
.fb-send { cursor: pointer; font: inherit; font-weight: 700; font-size: .86em; color: #fff; border: none;
  border-radius: 9px; padding: 8px 16px; background: linear-gradient(100deg, #6d4fd6, #cf3d8f); }
.fb-send:hover { filter: brightness(1.08); }
.fb-thanks { text-align: center; padding: 8px 4px 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fb-thanks-emoji { font-size: 1.8em; }
.fb-thanks strong { font-family: var(--display); }
.fb-thanks span { font-size: .82em; color: var(--muted); }
.fb-thanks .fb-send { margin-top: 8px; }
/* not-logged-in: feedback is login-gated, so prompt to log in instead of the form */
.fb-login-msg { font-size: .88em; color: var(--muted); line-height: 1.5; margin: 10px 0 0; }
.fb-login-msg a { color: var(--accent); font-weight: 600; }
a.fb-send { display: inline-flex; align-items: center; text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .fb-fab, .fb-panel { transition: opacity .2s ease; } }

/* feedback read page */
.fb-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.fb-item { background: var(--slab-glass); border: 1px solid var(--slab-border); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--slab-glow); }
.fb-item-body { font-size: 1.02em; line-height: 1.45; }
.fb-item-meta { margin-top: 8px; font-size: .74em; color: var(--muted); }
.fb-item-page { color: var(--faint); word-break: break-all; }

/* ---------- rubric (public scoring explainer) page ---------- */
/* Legal docs (Termly-generated privacy/terms): the exported HTML carries its own hardcoded
   dark-on-light colors, so render it on a white "paper" card that stays legible in both the light
   and dark site themes, inside a readable measure. */
.legal-doc {
    max-width: 820px;
    margin: 24px auto 48px;
    padding: 40px clamp(20px, 5vw, 56px);
    background: #ffffff;
    color: #333333;
    border: 1px solid var(--line);
    border-radius: var(--radius-slab, 14px);
    box-shadow: var(--slab-glow, 0 8px 32px rgba(0,0,0,.37));
    line-height: 1.6;
    overflow-wrap: break-word;
}
.legal-doc a { color: #3030f1; }
.legal-doc img, .legal-doc table { max-width: 100%; }
/* Plain-text legal export (no HTML markup): preserve its line breaks/paragraphs and wrap. */
.legal-doc--plain {
    white-space: pre-wrap;
    font-family: var(--font);
    font-size: 0.95rem;
}

.rubric { max-width: 720px; margin: 0 auto; padding-bottom: 40px; }
.rubric h1 { font-family: var(--display); font-size: 1.7em; margin: 6px 0 16px; }
.rubric h2 { font-family: var(--display); font-size: 1.15em; margin: 30px 0 10px; }
.rubric p { color: var(--text); line-height: 1.6; margin: 0 0 14px; }
.rubric-lede { font-size: 1.05em; color: var(--muted); }
.rubric-table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-slab); overflow: hidden; margin: 0 0 20px; box-shadow: var(--slab-glow); }
.rubric-table th, .rubric-table td { text-align: left; padding: 12px 16px; font-size: .92em; }
.rubric-table th { background: var(--panel2); color: var(--muted); font-size: .72em; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 700; }
.rubric-table td { border-top: 1px solid var(--line); }
.rubric-table .rt-score { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rubric-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rubric-list li { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  color: var(--text); line-height: 1.55; font-size: .94em; }
.rubric-list li .ltd, .rubric-list li .dc-centering { margin-right: 8px; }
.rubric-list .soon { color: var(--faint); font-size: .88em; }
.rubric-list.plain li { background: transparent; border: none; padding: 4px 0; }
.rubric-note { background: var(--panel2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--muted); font-size: .9em; line-height: 1.55; margin-top: 24px; }

/* ---------- footer (disclosure + legal links) ---------- */
.foot-line { margin: 0 0 6px; }
.foot-line:last-child { margin-bottom: 0; }
.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.foot a:hover { color: var(--text); }
.foot-affiliate { color: var(--faint); }
.foot-links { margin-top: 10px; }
.foot-sep { color: var(--faint); margin: 0 4px; }

/* ---------- policy pages (privacy / terms) DRAFT banner ---------- */
.policy-draft { background: var(--panel2); border: 1px dashed var(--gold); border-radius: 12px;
  padding: 12px 16px; color: var(--muted); font-size: .88em; line-height: 1.55; margin-bottom: 22px; }
.policy-draft b { color: var(--gold); }
