:root {
  /* Brand: black, brushed silver and check-mark green, from the TCG Trade-Check
     logo. Dark is the default; [data-theme="light"] below swaps the same tokens. */
  --bg: #030605;
  --bg-2: #080c0a;
  --surface: #101412;
  --surface-2: #181d1a;
  --surface-3: #232925;
  --border: #29302c;
  --track: #262d29;
  --text: #f3f5f4;
  --text-2: #c8cdca;
  --muted: #8b938e;
  --accent: #3ed45a;           /* green fills, outlines, focus */
  --accent-text: #52e06c;      /* green used as text */
  --accent-ink: #03140a;       /* text on green */
  --link: var(--accent-text);
  --brand-grad: linear-gradient(180deg, #8ef58a 0%, #3ed45a 55%, #1fa844 100%);
  --silver-grad: linear-gradient(180deg, #ffffff 0%, #d9dbde 45%, #9a9da2 55%, #e4e6e8 100%);
  --page-glow: radial-gradient(1100px 420px at 50% -140px, rgb(62 212 90 / 0.12), transparent 70%);
  --header-bg: rgb(3 6 5 / 0.82);
  --foil: #f5b82e;             /* holo printing chips (a card attribute, not the brand) */
  /* Side identity (validated categorical pair on --surface, both themes) */
  --give: #e8604f;
  --get: #249fcc;
  /* Status */
  --good: #34d399;
  --ok: #a3e635;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgb(0 0 0 / 0.35);
  --shadow-img: 0 4px 12px rgb(0 0 0 / 0.45);
  --font-display: 'Chakra Petch', Inter, system-ui, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f2f4f3;
  --bg-2: #fafbfa;
  --surface: #ffffff;
  --surface-2: #f1f3f2;
  --surface-3: #e4e8e6;
  --border: #d8dedb;
  --track: #e2e7e4;
  --text: #111513;
  --text-2: #3b423e;
  --muted: #646c67;
  --accent: #2cbf4c;
  --accent-text: #147a30;
  --brand-grad: linear-gradient(180deg, #74e67c 0%, #34c955 55%, #1c9f40 100%);
  --silver-grad: linear-gradient(180deg, #4a4f55 0%, #2a2e33 50%, #15181b 100%);
  --page-glow: radial-gradient(1100px 380px at 50% -160px, rgb(52 201 85 / 0.16), transparent 70%);
  --header-bg: rgb(250 251 250 / 0.85);
  --foil: #c98a0a;
  --give: #d4452f;
  --get: #1778aa;
  --good: #15803d;
  --ok: #4d7c0f;
  --warn: #a15c07;
  --bad: #c62828;
  --shadow: 0 6px 18px rgb(15 25 20 / 0.08);
  --shadow-img: 0 3px 10px rgb(15 25 20 / 0.22);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page-glow), linear-gradient(180deg, var(--bg-2), var(--bg) 420px);
  background-color: var(--bg);
  color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
/* Angular display face echoing the logo's lettering: headings, numbers, labels. */
.page-title, .verdict h2, .verdict-kicker, .panel-title, .h2h-title, .side h2, .kpi .k, .kpi .v, .col h3,
.ring .num b, .cc-value b, .rank, .rank-metric, .deal-save b, .sheet-head h3, .tab, .seg, button.primary,
.faq-item summary, .nav-list a, .nav-label { font-family: var(--font-display); }
a { color: var(--link); }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* Green hairline under the header, like the glow on the logo's check. */
.top::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent); opacity: 0.55; pointer-events: none; }
.brand { margin: 0; min-width: 0; line-height: 0; }
.brand a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { display: block; height: 34px; width: 34px; border-radius: 8px; box-shadow: 0 0 0 1px var(--border), 0 0 14px rgb(62 212 90 / 0.18); }
.brand-word { display: grid; gap: 3px; font: 700 17px/1 var(--font-display); letter-spacing: 0.02em; white-space: nowrap; }
.brand-word .bw-tcg { font-style: italic; font-weight: 700; letter-spacing: 0.04em; background: var(--silver-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-word .bw-sub { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; color: var(--text-2); }
.brand-word b { color: var(--accent-text); font-weight: 600; }
@media (max-width: 440px) { .top .brand-word { display: none; } }
.top-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
button.pill {
  min-height: 36px; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
button.pill[aria-pressed="true"] { background: color-mix(in srgb, var(--warn) 18%, transparent); border-color: var(--warn); color: var(--warn); }
button.pill[aria-pressed="true"] .pill-dot { background: var(--warn); }

main { max-width: 980px; margin: 0 auto; padding: 14px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }

.panel {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 88%, var(--bg)));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.panel-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }

/* ---------- Side-by-side builder ---------- */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: start; }
.swap { align-self: center; color: var(--muted); font-size: 18px; padding: 0 1px; }
.side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--side);
  border-radius: var(--radius);
  padding: 10px;
  min-width: 0;
  box-shadow: var(--shadow);
}
.give { --side: var(--give); }
.get { --side: var(--get); }
.side-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--side); flex-shrink: 0; }
.side-head { display: grid; gap: 2px; margin-bottom: 8px; }
.side h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.side-total { color: var(--muted); font-size: 12px; min-height: 16px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tile {
  display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; align-items: start;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm); padding: 6px; cursor: pointer;
}
.tile:hover, .tile:focus-visible { border-color: var(--side); outline: none; }
.tile img, .tile .thumb-ph { width: 38px; height: 53px; object-fit: cover; border-radius: 4px; background: var(--surface-3); }
.tile-body { min-width: 0; }
.tile-name { font-weight: 600; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-meta { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-ph { display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; padding: 10px 2px; text-align: center; }

.chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.chip { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip.graded { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent-text); }
.chip.good { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.chip.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.chip.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.qty { font-weight: 700; color: var(--muted); }

button { cursor: pointer; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); padding: 10px 14px; min-height: 44px; }
button.primary {
  background: var(--brand-grad); color: var(--accent-ink); border: 0; border-radius: 0; font-weight: 700; letter-spacing: 0.04em;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
button.primary:hover { filter: brightness(1.05); }
button.primary:disabled { opacity: 0.6; }
button.danger { color: var(--bad); background: transparent; }
button.link, a.link { background: none; border: 0; padding: 6px 0; min-height: 0; color: var(--link); text-decoration: underline; font-size: 14px; display: inline-block; }
button.add { width: 100%; margin-top: 8px; min-height: 40px; border-style: dashed; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; }
button.add:hover { color: var(--text); border-color: var(--side); }

/* ---------- Terms ---------- */
.terms { display: grid; gap: 10px; }
.term { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.term label { font-weight: 600; font-size: 14px; color: var(--text); }
.term.small label { font-weight: 500; color: var(--muted); font-size: 13px; }
.pct-input { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.pct-input input { width: 72px; text-align: right; font-weight: 700; }
input[type=range] { width: 100%; accent-color: var(--accent); min-height: 28px; padding: 0; background: none; border: 0; }

/* 16px minimum: iPhone Safari zooms the page into any smaller text box. */
input, select, textarea { font-size: max(16px, 1em); }
input, select {
  width: 100%; min-height: 44px; padding: 8px 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
label small { font-size: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.analyze-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.analyze-bar button { width: 100%; max-width: 728px; display: block; margin: 0 auto; font-size: 18px; min-height: 52px; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Sheet ---------- */
dialog {
  width: min(560px, 100vw); max-width: 100vw; max-height: 92dvh; margin: auto auto 0; padding: 0;
  border: 1px solid var(--border); border-radius: 14px 14px 0 0;
  background: var(--surface); color: var(--text);
}
@media (min-width: 600px) { dialog { margin: auto; border-radius: 14px; } }
dialog::backdrop { background: rgb(4 6 14 / 0.7); backdrop-filter: blur(2px); }
dialog form { display: grid; gap: 12px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-head h3 { font-size: 18px; }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; }
.sheet-actions .primary { flex: 1; }

.search-results { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-height: 42dvh; overflow-y: auto; }
.search-results li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; border: 1px solid transparent; }
.search-results li:hover, .search-results li:focus { border-color: var(--accent); outline: none; }
.search-results img, .search-results .thumb-ph { width: 40px; height: 56px; object-fit: cover; border-radius: 4px; background: var(--surface-3); }
.search-results .price { font-weight: 700; display: grid; justify-items: end; }
.search-results .price small { font-size: 10px; font-weight: 500; color: var(--muted); }
.search-note { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.picked { display: grid; grid-template-columns: 60px 1fr; gap: 12px; align-items: center; background: var(--surface-2); padding: 10px; border-radius: var(--radius-sm); }
.picked img, .picked .thumb-ph { width: 60px; height: 84px; object-fit: cover; border-radius: 5px; }

/* ---------- Results ---------- */
#results:empty { display: none; }
#results { display: grid; gap: 14px; }
.verdict { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; border-left: 4px solid var(--tone); }
.verdict.tone-good { --tone: var(--good); } .verdict.tone-ok { --tone: var(--ok); } .verdict.tone-warn { --tone: var(--warn); } .verdict.tone-bad { --tone: var(--bad); }
.verdict-kicker { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.verdict h2 { font-size: 26px; font-weight: 700; letter-spacing: 0.01em; color: var(--tone); display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.verdict-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 14px; background: color-mix(in srgb, var(--tone) 20%, transparent); }
.verdict ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .num b { font-size: 36px; font-weight: 700; line-height: 1; }
.ring .num small { font-size: 11px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.kpi .k, .ms .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.kpi .v { font-size: 24px; font-weight: 800; margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.pos, .up { color: var(--good); }
.neg, .down { color: var(--bad); }

.counter { border-left: 4px solid var(--warn); }
.counter ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.warnings { color: var(--warn); font-size: 13px; margin: 10px 0 0; }

/* Head to head */
.h2h { padding: 12px 10px; }
.h2h-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; padding: 0 4px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.h2h-head > div { font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.h2h-head .get { justify-content: flex-end; text-align: right; }
.h2h-head small { flex-basis: 100%; font-size: 11px; font-weight: 500; color: var(--muted); }
.h2h-head .give { --side: var(--give); }
.h2h-head .get { --side: var(--get); }
.h2h-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; padding-bottom: 2px; }
.h2h-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
.h2h-row:last-of-type { border-bottom: 0; }
.h2h-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 8px; }
.h2h-val { font-size: 15px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h2h-val.get { text-align: right; }
.h2h-val.wins { color: var(--text); font-weight: 800; }
.h2h-val.up { color: var(--good); } .h2h-val.down { color: var(--bad); }
.h2h-mid { text-align: center; min-width: 0; }
.h2h-label { font-size: 11px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.edge { font-size: 9px; }
.edge.give { color: var(--give); } .edge.get { color: var(--get); }
.h2h-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-top: 4px; }
.hb { height: 6px; background: var(--track); overflow: hidden; display: flex; }
.hb.give { justify-content: flex-end; border-radius: 4px 0 0 4px; }
.hb.get { border-radius: 0 4px 4px 0; }
.hb i { display: block; height: 100%; }
.hb.give i { background: var(--give); border-radius: 4px 0 0 4px; }
.hb.get i { background: var(--get); border-radius: 0 4px 4px 0; }

.bars { display: grid; gap: 9px; }
.bar { display: grid; grid-template-columns: 110px 1fr 30px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.bar .track { height: 8px; background: var(--track); border-radius: 99px; position: relative; overflow: hidden; }
.bar .track::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: 0.5; }
.bar .fill { height: 100%; border-radius: 99px; }
.bar b { color: var(--text); text-align: right; }

/* Side-by-side card columns */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: start; }
.col { display: grid; gap: 8px; min-width: 0; }
.col h3 { font-size: 12px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 6px; padding: 0 2px; }
.cc {
  background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--side);
  border-radius: var(--radius); padding: 10px; min-width: 0; display: grid; gap: 8px;
}
.cc-top { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 9px; align-items: start; }
.cc-top img, .cc-top .thumb-ph { width: 64px; height: 89px; object-fit: cover; border-radius: 6px; background: var(--surface-3); box-shadow: var(--shadow-img); }
.cc-id { min-width: 0; }
.cc-name { font-weight: 700; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-id .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; }
.cc-value b { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.cc-value > span:not(.chip) { font-size: 11px; color: var(--muted); }
.ms-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ms { background: var(--surface-2); border-radius: 8px; padding: 5px 7px; min-width: 0; }
.ms .k { font-size: 11px; text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms .v { font-size: 14px; font-weight: 700; color: var(--text); }
.ms .v.up { color: var(--good); } .ms .v.down { color: var(--bad); }
.spark-wrap { position: relative; touch-action: pan-y; }
.spark { width: 100%; height: 56px; display: block; }
.spark-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.spark-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); opacity: 0.6; pointer-events: none; }
.tip { position: absolute; z-index: 20; background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 12px; display: grid; pointer-events: none; box-shadow: var(--shadow); }
.tip span { color: var(--muted); font-size: 11px; }

/* "Show more" sections in trade results: collapsed until tapped. */
details.more > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '▾'; }
details.more[open] > summary::after { content: '▴'; }
.h2h details.more > summary { border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); }
details.score-more > summary { justify-content: space-between; font-family: var(--font-display); color: var(--text); font-size: 14px; min-height: 28px; }
details.score-more[open] > summary { margin-bottom: 8px; }
.cc details[open] > .ms-grid { margin-top: 10px; }
.cc details summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-2); list-style: none; padding: 6px 0 0; border-top: 1px solid var(--border); }
.cc details summary::-webkit-details-marker { display: none; }
.cc details summary::after { content: ' ▾'; color: var(--muted); }
.cc details[open] summary::after { content: ' ▴'; }
.cc-more { display: grid; gap: 10px; padding-top: 8px; }
.cc-more h4 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.kv-list { display: grid; gap: 3px; font-size: 12px; }
.kv-list div { display: flex; justify-content: space-between; gap: 6px; }
.kv-list span { color: var(--muted); }
.ladder div.current span, .ladder div.current b { color: var(--accent-text); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
td { padding: 5px 2px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
td.r { text-align: right; white-space: nowrap; font-weight: 600; }
tr.unused td { opacity: 0.45; text-decoration: line-through; }
td .sub { display: block; color: var(--muted); font-size: 11px; }
.reasons { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 12px; color: var(--text-2); }
.reasons li { display: grid; grid-template-columns: 26px 1fr; gap: 4px; }
.reasons .d { font-weight: 700; text-align: right; color: var(--warn); }
.reasons .d.up { color: var(--good); } .reasons .d.down { color: var(--bad); }
.links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }

.note { font-size: 12px; color: var(--muted); margin: 0; }
.note.center { text-align: center; }
.demo-banner { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; font-weight: 600; }
.error { color: var(--bad); }
.sources { color: var(--muted); font-size: 11px; text-align: center; }
.loading { display: flex; justify-content: center; align-items: center; gap: 10px; color: var(--muted); padding: 22px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--track); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }

/* Wider screens: more breathing room */
@media (min-width: 720px) {
  main { padding: 20px 16px; gap: 18px; }
  .builder { gap: 12px; }
  .side { padding: 14px; }
  .tile { grid-template-columns: 48px minmax(0, 1fr); }
  .tile img, .tile .thumb-ph { width: 48px; height: 67px; }
  .tile-name { font-size: 14px; }
  .columns { gap: 14px; }
  .ms-grid { grid-template-columns: repeat(4, 1fr); }
  .cc-top { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .cc-top img, .cc-top .thumb-ph { width: 96px; height: 134px; border-radius: 8px; }
  .cc-name { font-size: 15px; }
  .h2h-val { font-size: 17px; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 370px) {
  .cc-top { grid-template-columns: 52px minmax(0, 1fr); }
  .cc-top img, .cc-top .thumb-ph { width: 52px; height: 72px; }
  button.pill { padding: 6px 10px; }
  main { padding: 12px 8px; }
  .swap { display: none; }
  .builder { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .h2h-val { font-size: 13px; }
}
@media (max-width: 340px) { .brand { font-size: 15px; } .pill-dot { display: none; } }

/* ---------- Tap targets, zoom & explainer pop-ups ---------- */
img.zoomable { cursor: zoom-in; }
img.zoomable:hover, img.zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tappable { cursor: pointer; }
.tappable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.chev { font-style: normal; color: var(--muted); font-size: 11px; }
.bar.tappable { grid-template-columns: 110px 1fr 30px 10px; padding: 3px 4px; margin: 0 -4px; border-radius: 8px; }
.bar.tappable:hover { background: var(--surface-2); }
.row-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.info-link { background: none; border: 0; min-height: 0; padding: 4px 0; color: var(--link); font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.side-dot.give { background: var(--give); } .side-dot.get { background: var(--get); }

.counter.tone-good { border-left-color: var(--good); }
.counter .note { margin-top: 8px; }
.counter .note b { color: var(--text); }
.adj { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

dialog.zoom { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; background: rgb(4 6 14 / 0.94); padding: 0; }
dialog.zoom::backdrop { background: rgb(4 6 14 / 0.8); }
dialog.zoom form { height: 100%; display: grid; grid-template-rows: 1fr auto; place-items: center; padding: calc(56px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); gap: 10px; }
.zoom-hit { background: none; border: 0; padding: 0; min-height: 0; cursor: zoom-out; display: grid; place-items: center; max-height: 100%; }
/* One fixed card-shaped frame for every enlarged picture, whatever its pixel size. */
#zoom-img { width: min(92vw, 560px, calc((100dvh - 150px) * 5 / 7)); aspect-ratio: 5 / 7; height: auto; object-fit: contain; border-radius: 12px; filter: drop-shadow(0 20px 40px rgb(0 0 0 / 0.6)); }
.zoom-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.zoom-caption { color: var(--text-2); font-size: 14px; text-align: center; }

dialog.info { width: min(560px, 100vw); }
.info-body { display: grid; gap: 8px; font-size: 14px; color: var(--text-2); max-height: 72dvh; overflow-y: auto; }
.info-body p { margin: 0; }
.info-body h4 { margin: 8px 0 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.info-body table { font-size: 13px; }
.info-body td { color: var(--text); }
.info-body tr.total td { border-top: 2px solid var(--border); font-weight: 700; }
.info-body tr.tappable:hover td { background: var(--surface-2); }
.info-body .r.up { color: var(--good); } .info-body .r.down { color: var(--bad); }
.info-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-compare > div { background: var(--surface-2); border-radius: 10px; padding: 10px; border-top: 3px solid var(--side); display: grid; }
.info-compare .give { --side: var(--give); } .info-compare .get { --side: var(--get); text-align: right; }
.info-compare span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.info-compare b { font-size: 20px; color: var(--text); }
.verdict-line { color: var(--text); }
.by-card .side-dot { margin-right: 6px; }
ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* ---------- Menu & routing ---------- */
.menu-btn, .icon-btn { min-height: 40px; width: 40px; padding: 0; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); flex-shrink: 0; }
.top .brand { margin-right: auto; }
body:not([data-route="trade"]) { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

dialog.nav { width: min(320px, 86vw); max-width: 86vw; height: 100dvh; max-height: 100dvh; margin: 0 auto 0 0; border-radius: 0 14px 14px 0; border-left: 0; }
dialog.nav form { height: 100%; align-content: start; padding-top: calc(16px + env(safe-area-inset-top)); }
dialog.nav h3 { font-size: 17px; font-weight: 800; }
.nav-list { display: grid; gap: 2px; }
.nav-list a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: 0.02em; }
.nav-list a:hover { background: var(--surface-2); }
.nav-list a[aria-current] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); }
.nav-ic { width: 22px; text-align: center; color: var(--muted); font-size: 16px; }
.nav-list a[aria-current] .nav-ic { color: var(--accent-text); }
.nav-sub { display: grid; gap: 0; margin: -2px 0 4px 34px; border-left: 1px solid var(--border); padding-left: 8px; }
.nav-sub a { min-height: 38px; font-weight: 500; font-size: 14px; color: var(--text-2); }

/* ---------- Page chrome ---------- */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 36px; }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; }
.page-lede { margin: -6px 0 0; color: var(--text-2); font-size: 14px; }
.period { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.seg { min-height: 32px; padding: 4px 12px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.seg[aria-pressed="true"] { background: var(--brand-grad); color: var(--accent-ink); }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; min-height: 36px; display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 600; letter-spacing: 0.03em; }
.tab[aria-current] { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: var(--accent); color: var(--accent-text); }
#top-body { display: grid; gap: 12px; }
.panel.empty { color: var(--muted); text-align: center; }

/* ---------- Top 10 rows ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: 18px 52px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.rank { font-size: 15px; font-weight: 800; color: var(--muted); text-align: center; }
.rank-row:nth-child(-n+3) .rank { color: var(--accent-text); }
.rank-img img, .rank-img .thumb-ph { width: 52px; height: 72px; object-fit: cover; border-radius: 6px; background: var(--surface-3); box-shadow: var(--shadow-img); }
.rank-main { min-width: 0; }
.rank-name { font-weight: 700; font-size: 14px; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.rank-name:hover { text-decoration: underline; }
.rank-main .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-spark { margin-top: 4px; max-width: 220px; }
.rank-side { text-align: right; display: grid; gap: 1px; justify-items: end; min-width: 84px; }
.rank-metric { font-size: 18px; font-weight: 800; color: var(--text); white-space: nowrap; }
.rank-metric.up { color: var(--good); } .rank-metric.down { color: var(--bad); }
.rank-price { font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.rank-side .note { font-size: 11px; max-width: 150px; }

/* ---------- Deal Scanner ---------- */
.deal-controls { display: grid; gap: 12px; }
.deal-search { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.deal-search .primary { padding: 10px 18px; }
.deal-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--text); cursor: pointer; }
label.check input { width: 22px; height: 22px; min-height: 0; padding: 0; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.deal-count { margin: 0; font-size: 13px; color: var(--muted); }
.deal-count b { color: var(--text); }
.deal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.deal { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; }
.deal-img img, .deal-img .thumb-ph { width: 64px; height: 89px; object-fit: cover; border-radius: 6px; background: var(--surface-3); }
.deal-main { min-width: 0; display: grid; gap: 2px; }
.deal-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal-prices b { font-size: 16px; }
.deal-save { text-align: right; display: grid; justify-items: end; }
.deal-save b { font-size: 18px; font-weight: 800; color: var(--good); white-space: nowrap; }
.deal-save span { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* ---------- FAQ & contact ---------- */
.faq { display: grid; gap: 8px; }
.faq-item { padding: 0; }
.faq-item summary { cursor: pointer; list-style: none; padding: 14px 40px 14px 14px; font-weight: 700; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 0; padding: 0 14px 14px; color: var(--text-2); font-size: 14px; }
.contact { display: grid; gap: 12px; }
.contact p { margin: 0; color: var(--text-2); }
.contact-email { font-size: 18px; font-weight: 700; word-break: break-all; }
.contact-form { display: grid; gap: 12px; }
textarea { width: 100%; padding: 10px; font: inherit; color: inherit; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

@media (min-width: 720px) {
  .rank-row { grid-template-columns: 24px 64px minmax(0, 1fr) auto; padding: 12px 14px; }
  .rank-img img, .rank-img .thumb-ph { width: 64px; height: 89px; }
  .deal-filters { grid-template-columns: 1fr 1fr 1.2fr auto; }
  .deal { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .deal-img img, .deal-img .thumb-ph { width: 80px; height: 111px; }
}
@media (max-width: 370px) {
  .rank-row { grid-template-columns: 14px 44px minmax(0, 1fr) auto; gap: 8px; }
  .rank-img img, .rank-img .thumb-ph { width: 44px; height: 61px; }
  .rank-side { min-width: 70px; }
}

/* ---------- Theme switch & menu logo ---------- */
.icon-btn { background: var(--surface-2); color: var(--text); flex-shrink: 0; min-height: 36px; width: 36px; }
.icon-btn svg { display: none; }
:root[data-theme-pref="auto"] .icon-btn .ic-auto,
:root[data-theme-pref="light"] .icon-btn .ic-light,
:root[data-theme-pref="dark"] .icon-btn .ic-dark { display: block; }
:root:not([data-theme-pref]) .icon-btn .ic-auto { display: block; }
.nav-logo { display: flex; gap: 10px; align-items: center; text-decoration: none; }
.nav-logo .logo-img { height: 46px; width: 46px; border-radius: 11px; }
.nav-logo .brand-word { display: grid; font-size: 20px; }
.nav-theme { display: grid; gap: 8px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.nav-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; }
.nav-theme .period { justify-self: start; }
@media (max-width: 360px) { .top .icon-btn { display: none; } }

/* ---------- The Quick Check (single card) ---------- */
.page-head .page-kicker { font: italic 600 12px/1 var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent-text); white-space: nowrap; }
.nav-note { display: block; font-family: Inter, system-ui, sans-serif; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--muted); }
.nav-list a[aria-current] .nav-note { color: var(--accent-text); }
.qc-search { display: grid; gap: 10px; }
.qc-search-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.qc-search-row select { width: auto; max-width: 42vw; }
.qc-filter { display: grid; gap: 6px; }
.qc-filter .period { justify-self: start; flex-wrap: wrap; }
#qc-hint { margin: 0; }
.qc-results { max-height: 64dvh; margin: 0; }
.qc-results:empty { display: none; }
.qc-results li { align-items: start; }
.qc-result { min-width: 0; display: grid; gap: 2px; }
.qc-result strong { line-height: 1.25; }
.qc-results .price { font-family: var(--font-display); font-size: 15px; }
.search-results li.search-note { display: flex; align-items: center; gap: 8px; cursor: default; background: none; border-color: transparent; }

/* Printing chips: holo reads foil gold, reverse holo a foil shimmer, non-holo plain. */
.chip.pchip { border: 1px solid transparent; min-height: 0; padding: 1px 7px; font-size: 11px; font-weight: 700; cursor: default; }
button.chip.pchip { cursor: pointer; }
.chip.pchip.holo { background: color-mix(in srgb, var(--foil) 20%, transparent); color: var(--foil); border-color: color-mix(in srgb, var(--foil) 45%, transparent); }
.chip.pchip.reverse { background: linear-gradient(100deg, color-mix(in srgb, #8fb8ff 26%, transparent), color-mix(in srgb, #e59cff 20%, transparent) 50%, color-mix(in srgb, var(--foil) 24%, transparent)); color: var(--text); border-color: color-mix(in srgb, var(--text-2) 30%, transparent); }
.chip.pchip.normal { background: var(--surface-3); color: var(--text-2); }
.chip.pchip.dim { opacity: 0.45; }

.qc-report { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; transition: opacity 0.15s; }
.qc-report:empty { display: none; }
.qc-report.busy { opacity: 0.55; pointer-events: none; }
.qc-hero { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: start; border-top: 3px solid var(--accent); }
.qc-art img, .qc-art .thumb-ph { width: 116px; height: 162px; object-fit: cover; border-radius: 8px; background: var(--surface-3); box-shadow: var(--shadow-img); }
.qc-id { min-width: 0; display: grid; gap: 6px; }
.qc-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; line-height: 1.15; }
.qc-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-top: 2px; }
.qc-value b { font-family: var(--font-display); font-size: 34px; font-weight: 700; line-height: 1; }
.qc-value span { font-size: 12px; color: var(--muted); }
.qc-controls { display: grid; gap: 12px; }
.qc-field { display: grid; gap: 6px; }
.qc-field select { max-width: 320px; }
.qc-printings { display: flex; flex-wrap: wrap; gap: 6px; }
.qc-printings .seg { display: grid; justify-items: start; gap: 1px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.qc-printings .seg small { font-family: Inter, system-ui, sans-serif; font-size: 12px; font-weight: 600; color: var(--muted); }
.qc-printings .seg[aria-pressed="true"] { border-color: transparent; background: var(--brand-grad); color: var(--accent-ink); }
.qc-printings .seg[aria-pressed="true"] small { color: var(--accent-ink); }
.qc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.qc-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.qc-ebay { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.qc-ranges { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; margin-bottom: 10px; }
.qc-ranges::-webkit-scrollbar { display: none; }
.qc-ranges .seg { flex: 1 0 auto; min-height: 34px; padding: 4px 8px; font-size: 12px; }
.qc-chart-body { min-height: 150px; }
.qc-chart-body .loading { padding: 50px 0; }
.qc-chart-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 8px; }
.qc-chart-body .note { margin-top: 8px; }

/* Tap-to-explain numbers. */
button.chip { min-height: 0; padding: 1px 6px; border: 0; cursor: pointer; font-size: 11px; font-weight: 600; }
button.ms.qc-metric { display: block; width: 100%; min-height: 0; text-align: left; border: 1px solid transparent; border-radius: 8px; padding: 5px 7px; background: var(--surface-2); color: inherit; cursor: pointer; }
button.ms.qc-metric:hover, button.ms.qc-metric:focus-visible { border-color: var(--accent); }
.qc-metric .k .chev, .qc-value .chev { margin-left: 4px; font-size: 10px; opacity: 0.7; }
button.qc-value { background: none; border: 0; padding: 0; min-height: 0; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
button.qc-value:hover b { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.qc-drill-value { display: grid; gap: 2px; padding: 4px 0 2px; }
.qc-drill-value b { font-family: var(--font-display); font-size: 30px; line-height: 1.1; color: var(--text); }
.qc-drill-value b.up { color: var(--good); } .qc-drill-value b.down { color: var(--bad); }
.qc-drill-value span { font-size: 12px; color: var(--muted); }
.info-body .qc-table td { color: var(--text); }
.qc-table { font-size: 13px; }
.qc-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 2px 6px; border-bottom: 1px solid var(--border); }
.qc-table th.r { text-align: right; }
.qc-table td { vertical-align: middle; }
.qc-table td + td, .qc-table th + th { padding-left: 10px; }
.qc-table th { white-space: nowrap; }
.qc-table tr.tappable:hover td { background: var(--surface-2); }
.qc-table tr.current td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.qc-table tr.current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.qc-table tr.total td { border-top: 2px solid var(--border); font-weight: 700; }
.qc-table .sub a, a.sub { color: var(--link); }
.qc-listings { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.qc-listings li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.qc-listings a { color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qc-listings a:hover { text-decoration: underline; }
.qc-listings .note { grid-column: 2; text-align: right; }
.qc-actions { display: grid; gap: 10px; }
.qc-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qc-side { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; border-top: 3px solid var(--side); }
.qc-side:hover { border-color: var(--side); }
@media (min-width: 720px) {
  .qc-hero { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
  .qc-art img, .qc-art .thumb-ph { width: 180px; height: 251px; border-radius: 10px; }
  .qc-name { font-size: 26px; }
  .qc-value b { font-size: 44px; }
  .qc-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .qc-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 370px) {
  .qc-hero { grid-template-columns: 88px minmax(0, 1fr); }
  .qc-art img, .qc-art .thumb-ph { width: 88px; height: 123px; }
  .qc-value b { font-size: 28px; }
  .qc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Sell to TradeCheck (Price Check) ---------- */
.sell { border-top: 3px solid var(--accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface)); }
.sell.quote { border-top-color: var(--border); background: var(--surface); }
.sell-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sell-price { display: grid; gap: 2px; min-width: 0; }
.sell-price b { font: 700 30px/1.1 var(--font-display); color: var(--accent-text); }
.sell.quote .sell-price b { color: var(--text); font-size: 22px; }
.sell-price span { font-size: 13px; color: var(--text-2); }
.sell-what { font-size: 13px; color: var(--text-2); }
.payouts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.payout { position: relative; display: grid; gap: 2px; align-content: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.payout input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.payout:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); box-shadow: 0 0 0 1px var(--accent); }
.payout:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.payout-h { font: 600 13px/1.3 var(--font-display); color: var(--text); }
.payout b { font: 700 26px/1.1 var(--font-display); color: var(--text); }
.payout:has(input:checked) b { color: var(--accent-text); }
.payout small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.payout-tag { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--brand-grad); color: var(--accent-ink); font: 700 10px/1.5 Inter, system-ui, sans-serif; font-style: normal; white-space: nowrap; }
@media (max-width: 360px) { .payouts { grid-template-columns: 1fr; } }
.sell .primary { padding: 12px 22px; }
.sell .note { margin-top: 10px; }
.qc-quote { font-weight: 700; border-color: var(--accent); color: var(--accent-text); background: transparent; }
.reasons-list { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: grid; gap: 3px; }
@media (max-width: 480px) { .sell-row .primary, .sell-row .qc-quote { width: 100%; } }

/* ---------- Request dialog ---------- */
dialog.lead { width: min(520px, 100vw); }
.lead-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.lead-card img, .lead-card .thumb-ph { width: 56px; height: 78px; object-fit: cover; border-radius: 5px; background: var(--surface-3); }
.lead-offer { margin-top: 4px; font: 700 22px/1.2 var(--font-display); color: var(--accent-text); }
.lead-offer small { font: 500 12px/1 Inter, system-ui, sans-serif; color: var(--muted); }
.lead-fields { display: grid; gap: 12px; }
.lead-fields:empty, .lead-summary:empty { display: none; }
label.terms { align-items: flex-start; font-size: 13px; color: var(--text-2); min-height: 0; }
label.terms input { margin-top: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lead-error { margin: 0; color: var(--bad); font-size: 14px; font-weight: 600; }
.lead-done { display: grid; gap: 10px; padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); text-align: center; justify-items: center; }
.lead-done h3 { font: 700 22px/1.2 var(--font-display); }
.lead-done p { margin: 0; color: var(--text-2); }
.lead-done .primary { width: 100%; margin-top: 6px; }
.lead-done .reasons-list { text-align: left; }
.lead-check { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 800; background: var(--brand-grad); color: var(--accent-ink); box-shadow: 0 0 24px rgb(62 212 90 / 0.35); }
.lead-ref b { font-family: var(--font-display); color: var(--text); letter-spacing: 0.06em; }

/* ---------- Trade Desk ---------- */
.desk-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; counter-reset: step; }
.desk-steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.desk-steps li::before { content: counter(step); font: 700 12px/1 var(--font-display); color: var(--accent-ink); background: var(--brand-grad); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 4px; }
.desk-steps b { font-size: 14px; color: var(--text); }
@media (max-width: 560px) { .desk-steps { grid-template-columns: 1fr; } .desk-steps li { grid-template-columns: 20px 1fr; column-gap: 10px; } .desk-steps li::before { grid-row: span 2; margin: 0; } }
#desk-list { display: grid; gap: 10px; }
.desk-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.desk-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.desk-item.held { opacity: 0.7; }
.desk-img img, .desk-img .thumb-ph { width: 64px; height: 89px; object-fit: cover; border-radius: 6px; background: var(--surface-3); box-shadow: var(--shadow-img); }
.desk-main { min-width: 0; display: grid; gap: 3px; }
.desk-name { font-size: 15px; }
.desk-side { display: grid; gap: 6px; justify-items: end; }
.desk-price { font: 700 20px/1 var(--font-display); }
.desk-offer { padding: 8px 12px; min-height: 40px; font-size: 13px; white-space: nowrap; }
@media (max-width: 480px) {
  .desk-item { grid-template-columns: 56px minmax(0, 1fr); }
  .desk-img img, .desk-img .thumb-ph { width: 56px; height: 78px; }
  .desk-side { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; justify-items: stretch; }
  .desk-offer { justify-self: end; }
}
.desk-empty { display: grid; gap: 8px; justify-items: center; padding: 22px 16px; }
.desk-empty p { margin: 0; }
.desk-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.desk-cta .panel-title { margin-bottom: 4px; }
.desk-cta p { margin: 0; color: var(--text-2); font-size: 14px; }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: transparent; color: var(--accent-text); font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn-secondary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Deal Scanner: subtitle, source badges, time left */
.page-head-stack { display: grid; justify-content: start; gap: 4px; }
.page-subtitle { margin: 0; font: italic 600 13px/1.2 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); }
.deal .chip[class*="src-"] { font-size: 10px; padding: 1px 6px; margin-right: 4px; vertical-align: 1px; }
.chip.src-ebay { background: color-mix(in srgb, var(--get) 18%, transparent); color: var(--get); }
.chip.src-auction { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.chip.src-tcgplayer { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-text); }
.deal-time { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.deal-time b { color: var(--text); }
.deal-time.warn, .deal-time.warn b { color: var(--warn); }
.deal-time.bad, .deal-time.bad b { color: var(--bad); }
@media (min-width: 700px) { .deal-filters { grid-template-columns: 1fr 1fr 1.3fr 1.2fr auto; } }

/* Stock image on a deal (no usable listing photo): say so on the thumbnail. */
.deal-img { position: relative; align-self: start; }
.deal-img .stock-tag { display: none; position: absolute; left: 3px; bottom: 3px; padding: 1px 4px; border-radius: 4px; font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: rgb(0 0 0 / 0.65); color: #fff; pointer-events: none; }
.deal-img.stock .stock-tag { display: block; }

/* Listings with several photos: a count on the thumbnail, arrows in the viewer. */
.deal-img .photo-count { position: absolute; right: 3px; top: 3px; padding: 1px 5px; border-radius: 4px; font-size: 9px; font-weight: 700; background: rgb(0 0 0 / 0.7); color: #fff; pointer-events: none; }
button.pill.zoom-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 60px; padding: 0 0 4px; font-size: 38px; font-weight: 400; line-height: 1; justify-content: center; background: rgb(10 14 12 / 0.72); color: #fff; border: 1px solid rgb(255 255 255 / 0.22); }
button.pill.zoom-nav:hover { background: rgb(10 14 12 / 0.9); border-color: var(--accent); }
.zoom-nav.prev { left: 8px; }
.zoom-nav.next { right: 8px; }
.zoom-foot { display: grid; gap: 4px; justify-items: center; }
.zoom-count { color: #fff; font-size: 13px; font-weight: 700; }

/* Top 10: a row opens Price Check; TCGplayer is a secondary link. */
.rank-row[data-price-check] { cursor: pointer; transition: border-color 0.15s; }
.rank-row[data-price-check]:hover { border-color: var(--accent); }
.rank-name::after { content: ' →'; color: var(--accent-text); font-weight: 600; }
.rank-ext { font-size: 11px; color: var(--muted); text-decoration: underline; white-space: nowrap; }

/* Top 10 prices: blended value fills in over the TCGplayer price. */
.rank-price.pending .blend-v { opacity: 0.45; }
.rank-price .blend-v { transition: opacity 0.2s; }
.rank-tcg { font-size: 11px; }
