/* Slabdex — design tokens.
   Paper = the cool grey of a grading label, acrylic = the slab case, ink = label print.
   One signature: the holographic authenticity seal real slabs carry (--holo). */
:root {
  /* Theme A "galerie": warm cream paper, ivory cards, one deep-green accent (Chrono24 / Etsy family). */
  --paper: #f3ede2;
  --acrylic: #fffdf8;
  --acrylic-2: #f3eee4;
  --ink: #1c1a16;
  --graphite: #6b655b;
  --hairline: #e0d7c6;
  --signal: #1f5a3c;         /* the one accent: links, focus, active controls */
  --signal-ink: #ffffff;
  --under: #1f7a4a;          /* below market / sales */
  --over: #c23a2b;           /* above */
  --warn: #a8731c;           /* partial data */
  --window: linear-gradient(170deg, #f1ece2, #e7e0d3);
  --shadow: 0 1px 1px rgba(40, 30, 10, .04), 0 10px 28px -10px rgba(40, 30, 10, .18);
  --holo: linear-gradient(115deg, #7cf3ff 0%, #b49bff 22%, #ff9ad5 42%, #ffe58a 62%, #8dffc4 80%, #7cf3ff 100%);
  /* Same hues, deep enough to read as text on paper. */
  --holo-ink: linear-gradient(100deg, #0e8fb0 0%, #5b3df0 35%, #c02f86 65%, #b87400 100%);
  --g-psa: #d7262e;
  --g-bgs: #a67c1d;
  --g-cgc: #0b5dae;
  --g-sgc: #127a3c;
  --g-tag: #6c3bd1;
  --g-arena: #c2410c;
  --g-raw: #6b7280;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b0d10; --acrylic: #15181d; --acrylic-2: #1b1f25; --ink: #eef0f3; --graphite: #9aa3ad;
    --hairline: #262b32; --signal: #6aa3ff; --under: #3ccf8a; --over: #ff6f61; --warn: #e0a83a;
    --window: linear-gradient(170deg, #161a24, #0d1017);
    --shadow: 0 1px 1px rgba(0, 0, 0, .5), 0 14px 32px -12px rgba(0, 0, 0, .7); color-scheme: dark; --holo-ink: var(--holo);
  }
}
:root[data-theme="dark"] {
  --paper: #0b0d10; --acrylic: #15181d; --acrylic-2: #1b1f25; --ink: #eef0f3; --graphite: #9aa3ad;
  --hairline: #262b32; --signal: #6aa3ff; --under: #3ccf8a; --over: #ff6f61; --warn: #e0a83a;
  --window: linear-gradient(170deg, #161a24, #0d1017);
  --shadow: 0 1px 1px rgba(0, 0, 0, .5), 0 14px 32px -12px rgba(0, 0, 0, .7); color-scheme: dark; --holo-ink: var(--holo);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.only-mobile { display: none !important; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.pm { width: 20px; height: 20px; padding: 2px; border-radius: 5px; background: #fff; border: 1px solid var(--hairline); object-fit: contain; flex-shrink: 0; display: inline-block; vertical-align: middle; }
.who .pm, .dt-eyebrow .pm { margin-right: 6px; }
/* Label typography: condensed caps, as printed on grading labels. */
.caps { font-family: var(--display); font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- holographic seal (signature) ---------- */
.seal {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; background: var(--holo); background-size: 300% 300%;
  background-position: 0% 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .55), 0 0 0 1px rgba(10, 14, 26, .08);
  transition: background-position .9s ease;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 18px; padding: 12px 28px;
  background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--hairline);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand .seal { width: 26px; height: 26px; }
.brand:hover .seal { background-position: 100% 50%; }
.brand-name { font: 800 22px/1 var(--display); font-stretch: 125%; letter-spacing: -.02em; }
.search {
  flex: 1; max-width: 760px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  background: var(--acrylic); border: 1px solid var(--hairline); border-radius: 12px; color: var(--graphite);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--signal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 14%, transparent); }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); min-width: 0; font-size: 15px; }
.search kbd { font: 500 11px var(--mono); border: 1px solid var(--hairline); border-radius: 5px; padding: 1px 6px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--hairline); background: var(--acrylic); cursor: pointer;
}
.icon-btn:hover { border-color: var(--graphite); }
.topbar .lang { margin-left: auto; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--acrylic); font-weight: 600; cursor: pointer; flex-shrink: 0; }
/* Same two-tab section nav on every page; the current page is the dark one. */
.sitenav { display: flex; gap: 6px; flex-shrink: 0; }
.sitenav .btn { height: 40px; padding: 0 16px; }
.sitenav .btn[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sitenav .btn[aria-current="page"]:hover { background: var(--ink); color: var(--paper); }

/* ---------- thesis + vault rail ---------- */
.hero { padding: 30px 28px 6px; }
.hero h1 {
  margin: 0; max-width: 900px; font: 800 clamp(26px, 3.4vw, 44px)/1.04 var(--display); font-stretch: 118%; letter-spacing: -.025em;
}
.hero h1 em { font-style: normal; color: var(--signal); }
.hero p { margin: 10px 0 0; color: var(--graphite); font-size: 14px; }
.hero p b { font: 700 14px var(--mono); color: var(--ink); }
body.filtering .hero { display: none; }

.vaults { display: flex; gap: 8px; padding: 18px 28px 4px; overflow-x: auto; scrollbar-width: none; }
.vault {
  display: flex; align-items: center; gap: 9px; flex-shrink: 0; padding: 7px 12px 7px 8px; cursor: pointer;
  background: var(--acrylic); border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; text-align: left;
}
/* Platform mark: each logo sits on the same white rounded tile so marks of different shapes line up. */
.vault .vl { width: 26px; height: 26px; padding: 3px; border-radius: 7px; background: #fff; border: 1px solid var(--hairline); object-fit: contain; flex-shrink: 0; }
.vault .vn { font-size: 13px; }
.vault .vc { font: 700 13px var(--mono); }
.vault .vf { font: 500 11px var(--mono); color: var(--graphite); }
.vault:hover { border-color: var(--graphite); }
.vault[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 28px; padding: 14px 28px 56px; align-items: start; }
.results { min-width: 0; }
.sidebar { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; padding-right: 4px; }

.facet { border-bottom: 1px solid var(--hairline); }
.facet > summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 14px 2px; cursor: pointer;
  user-select: none; font-family: var(--display); font-stretch: 75%; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; font-size: 13px;
}
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--graphite); border-bottom: 2px solid var(--graphite); transform: rotate(45deg); transition: transform .15s; }
.facet[open] > summary::after { transform: rotate(-135deg); }
.badge { margin-left: 8px; font: 700 11px var(--mono); background: var(--signal); color: var(--signal-ink); border-radius: 99px; padding: 1px 7px; letter-spacing: 0; }
.facet-body { padding: 0 2px 14px; }
.facet-filter { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--acrylic); margin-bottom: 8px; }
.opts { max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.opt { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; cursor: pointer; }
.opt[hidden] { display: none; }
.opt:hover { background: var(--acrylic); }
.opt input { accent-color: var(--signal); width: 16px; height: 16px; margin: 0; }
.opt .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt .n { font: 500 12px var(--mono); color: var(--graphite); }
.opt.zero { opacity: .45; }
.range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.range input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--acrylic); font-family: var(--mono); font-size: 13px; }
.range span { color: var(--graphite); }
.grade-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gchip { font: 700 13px var(--mono); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--hairline); background: var(--acrylic); cursor: pointer; }
.gchip small { font: 500 10px var(--mono); color: var(--graphite); margin-left: 4px; }
.gchip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.gchip[aria-pressed="true"] small { color: inherit; opacity: .7; }
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--hairline); cursor: pointer; font-weight: 600; }
.toggle input { accent-color: var(--signal); width: 18px; height: 18px; flex-shrink: 0; }
.toggle small { display: block; color: var(--graphite); font-weight: 400; font-size: 12px; }

/* ---------- category tabs ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--hairline); margin-bottom: 14px; }
.tab {
  flex-shrink: 0; display: inline-flex; align-items: baseline; gap: 6px; padding: 10px 12px; border: 0; background: none;
  font-weight: 600; color: var(--graphite); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab small { font: 500 11px var(--mono); }
.tab:hover { color: var(--ink); }
.tab[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; min-height: 44px; }
.count { font: 700 15px var(--mono); white-space: nowrap; }
.count small { font: 500 14px var(--body); color: var(--graphite); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px 5px 12px; border-radius: 99px;
  background: var(--acrylic); border: 1px solid var(--hairline); font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip::after { content: "✕"; font-size: 10px; color: var(--graphite); }
.chip:hover { border-color: var(--graphite); }
.chip.clear { background: transparent; border-color: transparent; color: var(--signal); }
.chip.clear::after { content: none; }
.toolbar-right { display: flex; gap: 8px; margin-left: auto; }
.select select {
  height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--acrylic);
  appearance: none; cursor: pointer; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, var(--graphite) 50%), linear-gradient(135deg, var(--graphite) 50%, transparent 50%);
  background-position: right 16px top 18px, right 11px top 18px; background-size: 5px 5px; background-repeat: no-repeat;
}
.seg { display: flex; border: 1px solid var(--hairline); border-radius: 10px; overflow: hidden; background: var(--acrylic); }
.seg button { width: 40px; height: 38px; border: 0; background: transparent; cursor: pointer; color: var(--graphite); display: grid; place-items: center; }
.seg button svg { fill: currentColor; }
.seg button[aria-checked="true"] { background: var(--acrylic-2); color: var(--ink); }
.seg.text button { width: auto; padding: 0 14px; font-weight: 600; font-size: 13px; }
.seg.text button[aria-checked="true"] { background: var(--signal); color: var(--signal-ink); }

/* ---------- tiles: image → meta → name → PRICE (Chrono24 hierarchy); neutrals + one accent ---------- */
.grid { display: grid; gap: 18px; }
/* Dense by default: at 1536 css px (1920 @125 %) six columns, so the price sits above the fold. */
.view-large { grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 14px; }
.view-small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.view-small .tile-body .sub, .view-small .sold-line, .view-small .group-line { display: none; }

.tile {
  position: relative; display: flex; flex-direction: column; padding: 0; text-align: left; cursor: pointer;
  background: var(--acrylic); border: 1px solid var(--hairline); border-radius: var(--r); overflow: hidden;
  transition: transform .18s cubic-bezier(.2, .7, .2, 1), box-shadow .18s, border-color .18s;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--ink) 25%, var(--hairline)); }

.window { position: relative; aspect-ratio: 3 / 4; margin: 10px 10px 0; border-radius: 8px; overflow: hidden; background: var(--window); }
.window img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; transition: opacity .25s, transform .35s cubic-bezier(.2, .7, .2, 1); }
.window img.back { opacity: 0; }
.tile:hover .window img.front.has-back { opacity: 0; }
.tile:hover .window img.back { opacity: 1; }
.tile:hover .window img.front:not(.has-back) { transform: scale(1.035); }
/* Two pips: front / back, like Vinted's carousel dots. */
.window .pips { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 4px; }
.window .pips i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 25%, transparent); }
.window .pips i:first-child { background: var(--ink); }
.tile:hover .window .pips i:first-child { background: color-mix(in srgb, var(--ink) 25%, transparent); }
.tile:hover .window .pips i:last-child { background: var(--ink); }
.window .grade-badge {
  position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 7px;
  border-radius: 6px; background: var(--acrylic); border: 1px solid var(--hairline); font: 700 11px var(--mono); color: var(--ink);
}
.window .grade-badge .who { color: var(--gcolor, var(--g-raw)); font-family: var(--display); font-stretch: 75%; letter-spacing: .06em; font-size: 10px; text-transform: uppercase; }

.tile-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.tile-body .meta { font: 500 11px var(--mono); color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-body .name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
.price { min-width: 0; font: 800 22px/1.05 var(--display); font-stretch: 112%; letter-spacing: -.02em; }
.price .from { font: 600 12px var(--body); color: var(--graphite); letter-spacing: 0; }
.tile-body .sub { font-size: 12px; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { font: 700 11px var(--mono); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.delta.under { color: var(--under); background: color-mix(in srgb, var(--under) 12%, transparent); }
.delta.over { color: var(--over); background: color-mix(in srgb, var(--over) 10%, transparent); }
.sold-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 12px 10px; font-size: 12px; color: var(--graphite); }
.sold-line b { color: var(--ink); font: 700 12px var(--mono); }
.sold-line .vs { font: 700 11px var(--mono); white-space: nowrap; }
.sold-line .vs.under { color: var(--under); }
.sold-line .vs.over { color: var(--over); }
.sold-line .vs.typ { color: var(--graphite); }
.group-line { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px dashed var(--hairline); font-size: 12px; color: var(--graphite); }
.group-line .dots { display: inline-flex; gap: 3px; }

@media (max-width: 480px) {
  .price-row { flex-wrap: wrap; }
  .price { font-size: 20px; }
}
/* "Load more" instead of infinite scroll (Baymard: infinite scroll hurts search results). */
.more { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 0 8px; color: var(--graphite); font: 500 13px var(--mono); }
.more .btn { min-width: 240px; }
/* Zero-result recovery, Airbnb style: what you'd get by dropping one filter. */
.relax { margin: 14px 0 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.relax p { width: 100%; margin: 0 0 4px; font-size: 13px; }
.relax-chip { display: inline-flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--acrylic); font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.relax-chip:hover { border-color: var(--signal); color: var(--signal); }
.relax-chip b { font: 700 12px var(--mono); color: var(--signal); }

.skeleton { pointer-events: none; }
.skeleton .window, .skeleton .bar { background: linear-gradient(90deg, var(--acrylic-2), var(--hairline), var(--acrylic-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton .bar { height: 12px; border-radius: 6px; margin: 6px 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- table view ---------- */
.view-table { display: block; background: var(--acrylic); border: 1px solid var(--hairline); border-radius: var(--r); overflow-x: auto; }
.view-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.view-table th { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; color: var(--graphite); font-family: var(--display); font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; }
.view-table td { padding: 8px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.view-table tr:hover td { background: var(--acrylic-2); cursor: pointer; }
.view-table td.nm { max-width: 420px; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.view-table img { width: 34px; height: 46px; object-fit: contain; vertical-align: middle; border-radius: 3px; }
.view-table .num { font-family: var(--mono); text-align: right; }
.gpill { font: 700 12px var(--mono); padding: 2px 7px; border-radius: 6px; color: #fff; background: var(--gcolor, var(--g-raw)); }

.empty { grid-column: 1 / -1; text-align: center; padding: 72px 16px; color: var(--graphite); }
.empty b { display: block; color: var(--ink); font: 800 22px var(--display); font-stretch: 112%; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--hairline); background: var(--acrylic); font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }

/* ---------- detail dialog ---------- */
dialog#detail {
  width: min(1060px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--hairline);
  border-radius: 18px; background: var(--acrylic); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
dialog#detail::backdrop { background: rgba(5, 8, 14, .55); backdrop-filter: blur(4px); }
.dt { display: grid; grid-template-columns: 1.15fr 1fr; }
.dt-media { background: var(--window); padding: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-right: 1px solid var(--hairline); min-height: 0; }
.dt-media .big { width: 100%; max-width: 100%; height: 100%; max-height: calc(100vh - 150px); object-fit: contain; cursor: zoom-in; }
.dt-media .zoom-hint { font: 500 11px var(--mono); color: var(--graphite); }
.dt-media .flip { display: flex; gap: 6px; }
.dt-info { position: relative; padding: 28px; overflow-y: auto; max-height: calc(100vh - 50px); }
.dt-nav { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; align-items: center; }
.dt-nav .dt-back { height: 40px; padding: 0 14px; }
.dt-nav .dt-close { position: static; }
.dt-close { position: absolute; top: 14px; right: 14px; }
.dt-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--graphite); }
.dt-info h2 { font: 800 26px/1.12 var(--display); font-stretch: 108%; letter-spacing: -.02em; margin: 8px 0 16px; padding-right: 44px; }
.buybox { border: 1px solid var(--hairline); border-radius: 14px; padding: 16px; margin-bottom: 18px; background: var(--acrylic-2); }
.buybox .k { color: var(--graphite); font-size: 12px; }
.buybox .p { font: 800 36px/1.05 var(--display); font-stretch: 115%; letter-spacing: -.02em; }
.buybox .p small { font: 500 14px var(--mono); color: var(--graphite); margin-left: 8px; letter-spacing: 0; }
.buybox .line { margin-top: 6px; font-size: 13px; color: var(--graphite); }
.buybox .line b { color: var(--ink); }
.buybox .row { display: flex; gap: 8px; margin-top: 14px; }
.buybox .row .btn { flex: 1; }
.warn { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--over) 12%, transparent); color: var(--over); font-size: 13px; font-weight: 600; }
.attrs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 22px; }
.attr { background: var(--acrylic-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.attr span { display: block; color: var(--graphite); font-size: 11px; }
.attr b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr.mono b { font-family: var(--mono); font-size: 13px; }
.dt-info h3 { font-size: 13px; margin: 0 0 4px; }
.dt-info .hint { margin: 0 0 12px; font-size: 12px; color: var(--graphite); }

/* Real sales (comps): verdict + dot plot + table. */
.comps { margin-bottom: 22px; }
.verdict { display: flex; gap: 10px; align-items: baseline; padding: 10px 12px; border-radius: 10px; margin: 6px 0 10px; font-size: 13px; color: var(--graphite); }
.verdict > b { font: 800 22px/1 var(--display); font-stretch: 112%; white-space: nowrap; }
.verdict span b { color: var(--ink); }
.verdict.under { background: color-mix(in srgb, var(--under) 10%, transparent); }
.verdict.under > b { color: var(--under); }
.verdict.over { background: color-mix(in srgb, var(--over) 9%, transparent); }
.verdict.over > b { color: var(--over); }
.verdict.typ { background: color-mix(in srgb, var(--graphite) 8%, transparent); }
.verdict .mark { font-style: normal; font-weight: 700; white-space: nowrap; color: var(--ink); }
.chart { margin: 0 0 8px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .tick line { stroke: var(--hairline); stroke-width: 1; }
.chart text { font: 500 10px var(--mono); fill: var(--graphite); }
.chart .ask { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .ask-l { fill: var(--ink); font-weight: 700; }
.chart .dotm { fill: var(--signal); stroke: var(--acrylic); stroke-width: 2; pointer-events: none; }
.chart .hit { fill: transparent; cursor: help; }
.chart .pt:hover .dotm { r: 6; }
.sales summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--signal); padding: 4px 0; }
.sales table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.sales th { text-align: left; color: var(--graphite); font-weight: 600; font-size: 11px; padding: 4px 6px; border-bottom: 1px solid var(--hairline); }
.sales td { padding: 5px 6px; border-bottom: 1px solid var(--hairline); }
.sales .num { text-align: right; font-family: var(--mono); }

/* Price ladder: every listing of the same card + grade, cheapest first. */
.ladder { display: flex; flex-direction: column; gap: 6px; }
.rung {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 10px 6px 6px;
  border: 1px solid var(--hairline); border-radius: 10px; background: var(--acrylic); cursor: pointer; text-align: left;
}
.rung:hover { border-color: var(--graphite); }
.rung.self { border-color: var(--ink); cursor: default; }
.rung img { width: 36px; height: 48px; object-fit: contain; }
.rung .body { display: block; min-width: 0; }
.rung .who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.rung .who em { font-style: normal; font: 600 10px var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--ink); color: var(--paper); }
.rung .who em.best { background: var(--under); color: #fff; }
.rung .meter { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--acrylic-2); overflow: hidden; }
.rung .meter i { display: block; height: 100%; border-radius: inherit; background: var(--vc, var(--graphite)); }
.rung .pp { font: 700 14px var(--mono); text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .only-mobile { display: grid !important; }
  .sidebar-head.only-mobile { display: flex !important; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .sitenav .btn { height: 36px; padding: 0 10px; font-size: 13px; }
  .topbar .lang { height: 36px; padding: 0 6px; font-size: 13px; }
  .brand-name, .search kbd { display: none; }
  .hero { padding: 20px 16px 0; }
  .vaults { padding: 14px 16px 0; }
  .vault .vf { display: none; }
  .layout { grid-template-columns: 1fr; padding: 12px 16px 40px; gap: 0; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; top: 0; width: min(340px, 88vw); max-height: none; z-index: 50; background: var(--paper);
    padding: 12px 16px 24px; transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .sidebar-head { justify-content: space-between; align-items: center; padding-bottom: 8px; font: 800 18px var(--display); }
  .scrim { position: fixed; inset: 0; background: rgba(5, 8, 14, .5); z-index: 40; }
  .view-large { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .view-small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .view-small .tile-body, .view-small .label-top .what, .view-small .label-sub { display: none; }
  .label-sub .bars { display: none; }
  .tile-foot { flex-direction: column; align-items: start; gap: 4px; }
  .toolbar-right { margin-left: 0; width: 100%; }
  .toolbar-right .select { flex: 1; }
  .toolbar-right select { width: 100%; }
  .dt { grid-template-columns: 1fr; }
  .dt-media { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 20px; }
  .dt-media .big { max-height: 70vh; }
  .dt-info { max-height: none; padding: 20px; }
  .attrs { grid-template-columns: repeat(2, 1fr); }
  dialog#detail { max-height: calc(100vh - 24px); overflow-y: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- lightbox: the native image, zoomable ---------- */
dialog.lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(5, 8, 14, .92); overflow: hidden; touch-action: none; color: #fff; }
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; cursor: zoom-in; user-select: none; transition: transform .12s ease-out; will-change: transform; }
.lightbox.zoomed img { cursor: grab; transition: none; }
.lightbox.dragging img { cursor: grabbing; }
.lightbox .lb-close { position: fixed; top: 14px; right: 14px; color: #111; background: #fff; }
.lightbox .lb-flip { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.lightbox .lb-flip .gchip { background: #fff; color: #111; }
.lightbox .lb-hint { position: fixed; bottom: 18px; right: 18px; font: 500 11px var(--mono); color: #c8ccd3; }

/* ---------- fees: all-in prices ---------- */
.fees-wrap { position: relative; }
.fees-btn { height: 46px; padding: 0 14px; }
.fees-btn[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.fees-pop { position: absolute; right: 0; top: 54px; z-index: 20; width: min(640px, calc(100vw - 32px)); padding: 18px; background: var(--acrylic); border: 1px solid var(--hairline); border-radius: var(--r); box-shadow: var(--shadow); text-align: left; }
.fees-pop h3 { margin: 0 0 4px; font-size: 15px; }
.fees-pop .hint { font-size: 12px; color: var(--graphite); margin: 0 0 12px; }
.fee-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
.fee-opts b { display: block; font-size: 12px; margin-bottom: 4px; }
.fee-opts .opt { padding: 4px 2px; }
.fee-opts input { accent-color: var(--signal); }
.fees-pop summary { cursor: pointer; font-weight: 600; font-size: 13px; margin: 6px 0; }
.fee-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
.fee-table th, .fee-table td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.fee-table th { color: var(--graphite); font-weight: 600; }
.fee-table i, .fee-lines i { color: var(--warn); font-style: normal; font-size: 11px; }
.fee-table .pm { width: 18px; height: 18px; }
.price .fee-tag { display: block; font: 500 10px var(--mono); color: var(--graphite); letter-spacing: 0; margin-top: 2px; }
.fee-lines { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 6px 0 10px; font-size: 12px; color: var(--graphite); }
.fee-lines b { color: var(--ink); font: 600 12px var(--mono); text-align: right; }
.ladder .pp small { display: block; font: 500 10px var(--mono); color: var(--graphite); }
@media (max-width: 760px) { .fee-opts { grid-template-columns: 1fr; } .fees-pop { right: auto; left: 0; } }
.fee-toggle { margin: 0 0 10px; }
.fee-inline { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--acrylic); }
.fee-inline .fee-opts { margin-bottom: 0; }
.fee-toggle::after { content: none; }

/* ---------- pending states: never the same look as a final message ---------- */
.pending { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 12px; color: var(--signal); font-weight: 600; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--signal) 25%, transparent); border-top-color: var(--signal); animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel-lines { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.skel-lines i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--acrylic-2) 25%, var(--hairline) 50%, var(--acrylic-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .spinner, .skel-lines i { animation: none; } }
.sales.excluded summary { color: var(--warn); }

/* audit round 1 */
.range input.invalid { border-color: var(--over) !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--over) 25%, transparent); }
.count .spinner { display: inline-block; vertical-align: middle; }
.grid.view-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sidebar { overscroll-behavior: contain; }

/* ---------------------------------------------------------------- comparator */
.window .cmp-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .94);
  color: #222; font: 600 12px var(--body, sans-serif); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); opacity: 0; transition: opacity .15s; cursor: pointer; }
.tile:hover .window .cmp-toggle, .tile:focus-within .window .cmp-toggle, .window .cmp-toggle.on { opacity: 1; }
.cmp-toggle.on { background: var(--ink); color: var(--paper); }
@media (hover: none) { .window .cmp-toggle { opacity: 1; } }
.buybox .row .cmp-toggle { display: inline-flex; align-items: center; padding: 0 14px; min-height: 40px; border: 1px solid var(--hairline); border-radius: 10px; cursor: pointer; font-weight: 600; margin-left: 8px; }
.cmp-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px; background: var(--paper); border: 1px solid var(--hairline); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); max-width: calc(100vw - 32px); }
.cmp-bar[hidden] { display: none; }
.cmp-thumbs { display: flex; gap: 6px; }
.cmp-th { position: relative; width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--acrylic-2, #f3f3f3); flex: none; }
.cmp-th.empty { border: 1.5px dashed var(--hairline); background: transparent; }
.cmp-th img { width: 100%; height: 100%; object-fit: cover; }
.cmp-x { position: absolute; top: 1px; right: 1px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 10px; line-height: 18px; padding: 0; cursor: pointer; }
.cmp-bar .btn { white-space: nowrap; }
.cmp-bar .btn[disabled] { opacity: .45; cursor: default; }
.cmp-msg { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: var(--paper); padding: 6px 10px; border-radius: 8px; font-size: 13px; }
dialog.cmp-dlg { width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 18px; background: var(--paper); color: var(--ink); overflow: auto; }
dialog.cmp-dlg::backdrop { background: rgba(5, 8, 14, .55); backdrop-filter: blur(4px); }
.cmp-wrap { padding: 18px 20px 22px; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cmp-wrap h2 { margin: 0; font-size: 20px; }
.cmp-scroll { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: calc(110px + var(--cols) * 190px); }
.cmp-table th { width: 110px; text-align: left; font-size: 12px; color: var(--graphite); font-weight: 600; vertical-align: top; padding: 9px 8px 9px 0; }
.cmp-table td { padding: 9px 8px; border-top: 1px solid var(--hairline); vertical-align: top; font-size: 14px; overflow-wrap: anywhere; }
.cmp-table tr.pics td { border-top: 0; }
.cmp-table tr.pics img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: var(--window, #f3f3f3); }
.cmp-table .pr { font-size: 20px; }
.cmp-table .pr.best { color: var(--under); }
.cmp-table .btn { margin: 0 6px 6px 0; }
.cmp-table .vs { font-weight: 700; font-size: 12px; }
.cmp-table .vs.under { color: var(--under); } .cmp-table .vs.over { color: var(--over); } .cmp-table .vs.typ { color: var(--graphite); }
@media (max-width: 640px) { .cmp-bar { bottom: 10px; gap: 6px; padding: 8px; } .cmp-th { width: 36px; height: 36px; } .cmp-table th { width: 80px; } }

/* ---------------------------------------------------------------- eBay / auction houses in the card detail */
.ext { margin-top: 18px; }
.ext-list { display: grid; gap: 6px; }
.ext-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 10px; color: inherit; text-decoration: none; }
.ext-row:hover { border-color: var(--ink); }
.ext-row img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; }
.ext-row .t { min-width: 0; font-size: 13px; }
.ext-row .t small { display: block; color: var(--graphite); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ext-row .auc { color: var(--warn); font-weight: 600; }
.ext-row .p { text-align: right; font-weight: 700; white-space: nowrap; }
.ext-row .p small { display: block; font-weight: 400; color: var(--graphite); font-size: 11px; }

.alert-btn { display: inline-flex; align-items: center; gap: 7px; }
.alert-btn .ico { flex: none; }

/* ---------------------------------------------------------------- Premium (alerts) dialog */
dialog.pm-dlg { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); overflow: auto; }
dialog.pm-dlg::backdrop { background: rgba(5, 8, 14, .55); backdrop-filter: blur(4px); }
.pmw { position: relative; padding: 34px 34px 26px; }
.pm-close { position: absolute; top: 16px; right: 16px; }
.pm-hero { text-align: center; max-width: 660px; margin: 0 auto 22px; }
.pm-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--signal) 12%, transparent); color: var(--signal); font-weight: 700; font-size: 13px; }
.pm-hero h2 { font-size: 30px; line-height: 1.15; margin: 14px 0 10px; letter-spacing: -.02em; }
.pm-hero p { color: var(--graphite); font-size: 15px; line-height: 1.5; margin: 0; }
.pm-hero .pm-search { margin-top: 10px; font-size: 14px; }
.pm-hero .pm-search b { color: var(--ink); }
.pm-feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.pm-feat { display: flex; gap: 10px; padding: 14px; border: 1px solid var(--hairline); border-radius: 14px; }
.pm-feat b { display: block; font-size: 14px; margin-bottom: 3px; }
.pm-feat small { color: var(--graphite); font-size: 12.5px; line-height: 1.4; }
.pm-ico { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--acrylic-2, #f5f5f5); color: var(--ink); }
.pm-how { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--graphite); font-size: 13.5px; margin: 6px 0 20px; text-align: center; }
.pm-billing { display: flex; width: max-content; margin: 0 auto 18px; padding: 4px; border-radius: 999px; background: var(--acrylic-2, #f3f3f3); }
.pm-billing button { border: 0; background: none; padding: 8px 18px; border-radius: 999px; font: 600 14px var(--body, sans-serif); color: var(--graphite); cursor: pointer; }
.pm-billing button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.pm-billing em { font-style: normal; color: var(--under); font-size: 12px; margin-left: 4px; }
.pm-plans { display: grid; grid-template-columns: repeat(3, 1fr) .85fr; gap: 14px; align-items: stretch; }
.pm-plan { position: relative; display: flex; flex-direction: column; padding: 22px 20px 18px; border: 1px solid var(--hairline); border-radius: 16px; }
.pm-plan.best { border: 2px solid var(--ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .1); }
.pm-pop { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--signal); color: var(--signal-ink, #fff); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pm-plan h3 { margin: 0 0 8px; font-size: 18px; }
.pm-price { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.pm-price small { font-size: 14px; font-weight: 500; color: var(--graphite); margin-left: 4px; }
.pm-bill { color: var(--graphite); font-size: 12.5px; margin: 2px 0 14px; }
.pm-plan ul { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; align-content: start; font-size: 14px; flex: 1; }
.pm-plan li { padding-left: 22px; position: relative; }
.pm-plan li::before { content: "✓"; position: absolute; left: 0; color: var(--under); font-weight: 800; }
.pm-plan .btn { width: 100%; justify-content: center; min-height: 44px; }
.pm-pass { text-align: center; color: var(--graphite); font-size: 13.5px; margin: 16px 0 6px; }
.pm-msg { text-align: center; margin: 8px auto; padding: 10px 14px; border-radius: 10px; max-width: 560px; background: color-mix(in srgb, var(--under) 10%, transparent); font-size: 14px; }
.pm-foot { text-align: center; color: var(--graphite); font-size: 12px; margin: 8px 0 0; }
@media (max-width: 980px) { .pm-plans { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .pm-feats { grid-template-columns: 1fr 1fr; } .pm-plans { grid-template-columns: 1fr; } .pmw { padding: 26px 16px 20px; } .pm-hero h2 { font-size: 24px; } }
@media (max-width: 480px) { .pm-feats { grid-template-columns: 1fr; } }

/* X (Twitter) link in the top bar */
.topbar .xlink { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 21px; border: 1px solid var(--hairline); background: var(--paper); color: var(--ink); }
.topbar .xlink:hover { border-color: var(--ink); }
@media (max-width: 640px) { .topbar .xlink { width: 36px; height: 36px; } }

.pm-head { text-align: center; margin: 8px 0 14px; }
.pm-head h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.01em; }
.pm-head p { margin: 0; color: var(--graphite); font-size: 14px; }
.pm-tag { color: var(--graphite); font-size: 13px; line-height: 1.4; margin: 0 0 14px; min-height: 36px; }
.pm-off { display: inline-block; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--under) 12%, transparent); color: var(--under); font-weight: 700; }
.pm-plan .pm-choose { margin: 4px 0 14px; }
.pm-quota { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--acrylic-2, #f5f5f5); font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.pm-plan.pass { background: var(--acrylic-2, #fafafa); border-style: dashed; }
.pm-plan.pass .pm-quota { background: var(--paper); }
.pm-cmp-toggle { display: block; margin: 18px auto 6px; border: 0; background: none; font: 600 14px var(--body, sans-serif); color: var(--ink); text-decoration: underline; cursor: pointer; }
.pm-cmp-wrap { overflow-x: auto; margin: 8px 0 4px; }
.pm-cmp { width: 100%; border-collapse: collapse; min-width: 520px; font-size: 14px; }
.pm-cmp th, .pm-cmp td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); text-align: center; }
.pm-cmp tbody th { text-align: left; font-weight: 500; color: var(--graphite); }
.pm-cmp thead th { font-size: 15px; }
.pm-cmp thead th small { display: block; font-weight: 500; color: var(--graphite); font-size: 12px; }
.pm-cmp .yes { color: var(--under); font-weight: 800; }
.pm-cmp .no { color: var(--hairline); }
.pm-foot a { color: var(--ink); font-weight: 600; }

/* site footer (cards, packs): FAQ + X */
.site-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 40px 0 24px; padding-top: 20px; border-top: 1px solid var(--hairline); color: var(--graphite); font-size: 13px; }
.sf-links { display: flex; gap: 18px; align-items: center; }
.sf-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; text-decoration: none; }
.sf-links a:hover { text-decoration: underline; }

@media (max-width: 480px) { .topbar .xlink { display: none; } }   /* the footer keeps the X link: the top bar stays on one line */

.sf-links { flex-wrap: wrap; }   /* FAQ, X, Terms, Privacy, Legal notice wrap on phones */
