/* Typefaces, served from this site (SIL Open Font License; licenses are in /fonts). No third-party request, so nothing waits on another company's server. */
@font-face { font-family: "Archivo"; font-style: normal; font-weight: 500 800; font-display: swap; src: url("/fonts/archivo.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/source-sans-3.woff2") format("woff2"); }

/* Card Chaser
   Palette: cool binder-page grey with Pacific Blue as the working accent.
   The one loud element is the score slab, which turns holo-foil on great deals. */

:root {
  /* Bold primaries (red, yellow, blue) on a soft, bright page. */
  --bg: #F3F5FC;
  --surface: #FFFFFF;
  --sunken: #E8EBF7;
  --ink: #1B1D2E;
  --muted: #5D6279;
  --line: #D9DDEE;
  --accent: #3B4CCA;
  --accent-ink: #FFFFFF;
  --red: #E3350D;
  --yellow: #FFCB05;
  /* The four colors: red, yellow, green, blue. Used for graphics and borders, never as the only way to tell things apart. */
  --c-red: #C0392B;
  --c-yellow: #B8892A;
  --c-green: #2E8B57;
  --c-blue: #3B4CCA;
  --c-yellow-bright: #FFCB05;
  --good: #16845A;
  --bad: #C62F1F;
  --warn: #8A6500;
  --focus: #FFCB05;
  --radius-row: 16px;
  --radius-ctl: 12px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --display: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --holo: linear-gradient(120deg, #8fd9ff 0%, #c9a8ff 28%, #ffd48f 52%, #95f0c6 76%, #8fd9ff 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-red: #E5685B;
    --c-yellow: #E3B341;
    --c-green: #4CBF86;
    --c-blue: #8D9BFF;
    --bg: #11131F;
    --surface: #1A1D2E;
    --sunken: #232740;
    --ink: #ECEEF8;
    --muted: #A2A8C4;
    --line: #2D3250;
    --accent: #8C9BFF;
    --accent-ink: #0B0D1E;
    --red: #FF6A4D;
    --yellow: #FFDE00;
    --good: #5CD6A0;
    --bad: #FF8A7A;
    --warn: #FFD54F;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  padding-top: env(safe-area-inset-top, 0px);
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { max-width: 920px; margin: 0 auto; padding: 0 16px 96px; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 18px 0 14px;
}
.wordmark {
  font-family: var(--display); font-weight: 800; font-size: 28px; line-height: 1;
  letter-spacing: -0.03em; margin: 0; white-space: nowrap;
}
@media (min-width: 760px) { .wordmark { font-size: 34px; } }
.wordmark .mark { width: .85em; height: .85em; margin-left: .22em; vertical-align: -.08em; color: var(--accent); }
.topbar .status { color: var(--muted); font-size: 13px; text-align: right; line-height: 1.3; }

/* Tabs sit at the top on every screen so Netlify's corner badge never covers them. */
.tabs {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 6px 0; margin: 0 0 14px;
}
.tabs button {
  border: 0; background: none; padding: 6px 2px; min-height: 48px; border-radius: 10px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: -0.005em; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; min-width: 0;
}
.tabs button[aria-current="page"] { color: var(--ink); background: var(--sunken); box-shadow: inset 0 -3px 0 var(--yellow); }
.tabs .count { font-family: var(--body); font-weight: 400; font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

@media (min-width: 760px) {
  .tabs { display: flex; padding: 8px 0; }
  .tabs button { padding: 8px 16px; flex-direction: row; gap: 6px; min-height: 40px; }
  .tabs .count { display: inline; }
}

h2 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin: 8px 0 12px; }
h3 { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--radius-ctl);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-decoration: none;
  color: var(--ink); font-weight: 700; font-size: 15px;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 70%, #000); }
.btn.primary:active { transform: translateY(1px); box-shadow: none; }
.btn.quiet { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 8px; }
.btn.quiet:hover { color: var(--ink); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: 14px; }

input[type="text"], input[type="search"], input[type="number"], input[type="password"], input[type="url"], select {
  min-height: 40px; padding: 7px 10px; border-radius: var(--radius-ctl);
  border: 1px solid var(--line); background: var(--surface); width: 100%;
}
select { padding-right: 28px; }
label.field { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 15px; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

.filters {
  display: grid; gap: 8px; grid-template-columns: 1fr auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row);
  padding: 10px; margin-bottom: 12px;
}
.filters .wide { grid-column: 1 / -1; }
.filter-more { grid-column: 1 / -1; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; align-items: center; }
.filter-more[hidden] { display: none; }
@media (min-width: 760px) {
  .filters { grid-template-columns: 2fr 1fr auto; }
  .filters .wide { grid-column: auto; }
  .filter-more { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.listing {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 12px;
}
.listing.top { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.thumb {
  width: 76px; height: 104px; border-radius: 6px; object-fit: cover; background: var(--sunken);
  display: block;
}
a:has(> .thumb) { align-self: start; }
.listing-main { min-width: 0; display: grid; gap: 6px; }
.listing-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.card-line { font-family: var(--display); font-weight: 700; font-size: 18px; line-height: 1.2; margin: 0; }
.card-line .num { color: var(--muted); font-weight: 500; }
.ebay-title { font-size: 14px; color: var(--muted); margin: 0; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.set-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 2px 8px 2px 6px; border-radius: 999px; background: var(--sunken); white-space: nowrap;
}
.set-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--set, var(--muted)); }

/* Score slab: shaped like the label on a graded card. */
.slab {
  flex: none; min-width: 52px; text-align: center; border-radius: 7px; padding: 3px 6px 4px;
  background: var(--sunken); border: 1px solid var(--line);
}
.slab b { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1; }
.slab small { display: block; font-size: 11px; color: var(--muted); }
.slab.good { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }
.slab.good b { color: var(--good); }
.slab.holo { background: var(--holo); background-size: 220% 220%; border-color: transparent; color: #1a1f2b; animation: foil 7s ease-in-out infinite alternate; }
.slab.holo small { color: #2b3240; }
@keyframes foil { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { .slab.holo { animation: none; } }

.price-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.price { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.ship, .market { font-size: 14px; color: var(--muted); }
.delta.under { color: var(--good); font-weight: 700; }
.delta.over { color: var(--bad); font-weight: 700; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.tag.hot { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); color: var(--bad); }
.tag.fav { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent); background: color-mix(in srgb, var(--yellow) 14%, transparent); }
.tag.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); color: var(--warn); }

.listing-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
@media (min-width: 560px) {
  .listing { grid-template-columns: 92px 1fr; }
  .thumb { width: 92px; height: 126px; }
}

.empty {
  text-align: center; padding: 40px 16px; border: 1px dashed var(--line); border-radius: var(--radius-row); color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-family: var(--display); font-size: 20px; margin-bottom: 4px; }

/* ---------- Sets ---------- */
.set-group { display: grid; gap: 8px; margin-bottom: 20px; }
.set-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 12px 14px;
  border-left: 6px solid var(--set);
}
.set-row:hover { border-color: var(--muted); border-left-color: var(--set); }
.set-name { font-family: var(--display); font-weight: 700; font-size: 18px; }
.set-count { font-family: var(--display); font-weight: 800; font-size: 18px; }
.bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--set); border-radius: 99px; }

.checklist-head { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 0; display: grid; gap: 8px; }
.checklist-head { top: calc(var(--tabs-h, 62px) + env(safe-area-inset-top, 0px)); }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-ctl); overflow: hidden; background: var(--surface); }
.segmented button { border: 0; background: none; padding: 9px 12px; min-height: 40px; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--sunken); color: var(--ink); }

.cards { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); }
.card-item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 4px;
  padding: 4px 8px 4px 2px; border-top: 1px solid var(--line);
}
.card-item:first-child { border-top: 0; }
.card-item .own { display: grid; place-items: center; width: 44px; height: 52px; cursor: pointer; }
.card-open {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; text-align: left;
  border: 0; background: none; padding: 4px 0; cursor: pointer; color: inherit; min-width: 0;
}
.mini { width: 36px; height: 50px; border-radius: 4px; object-fit: cover; background: var(--sunken); display: block; }
.mini.blank { border: 1px dashed var(--line); background: none; }
.card-item .nm { min-width: 0; display: grid; gap: 1px; }
.card-item .nm b { font-weight: 700; overflow-wrap: anywhere; }
.card-item .num-line { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-item .nm .sub { display: block; font-size: 13px; color: var(--muted); }
.card-item .nm .sub:empty { display: none; }
.card-item.holo-rare .nm b { color: var(--set); }
.card-item.owned .nm b { color: var(--muted); font-weight: 400; }
.card-item.owned .mini { opacity: .45; }
.card-tools { display: flex; align-items: center; }
.icon-btn { border: 0; background: none; width: 40px; height: 44px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 18px; }
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: var(--warn); }
@media (max-width: 420px) { .card-tools .icon-btn { width: 34px; } }
.max-tag { font-size: 12px; color: var(--accent); font-weight: 700; }

/* ---------- Stores ---------- */
.shop {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 14px;
  display: grid; gap: 6px;
}
.shops { display: grid; gap: 10px; }
@media (min-width: 760px) { .shops { grid-template-columns: 1fr 1fr; } }
.shop-name { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0; }
.open { color: var(--good); font-weight: 700; }
.closed { color: var(--bad); font-weight: 700; }
.week { font-size: 13px; color: var(--muted); display: grid; grid-template-columns: auto 1fr; gap: 0 10px; }
.week .today { color: var(--ink); font-weight: 700; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }

.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.event { display: grid; grid-template-columns: 56px 1fr; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 10px; }
.event.match { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.event img, .event .ph { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--sunken); }
.event-title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- Settings / panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 14px; display: grid; gap: 10px; margin-bottom: 12px; }
.panel h3 { margin: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.errors { color: var(--bad); font-size: 14px; margin: 0; padding-left: 18px; }

/* ---------- Modal ---------- */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); width: min(640px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); }
dialog::backdrop { background: rgb(8 15 22 / .45); }
.dialog-body { padding: 18px; display: grid; gap: 12px; overflow: auto; max-height: calc(100dvh - 140px); }
.dialog-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.map-row:first-child { border-top: 0; }

/* ---------- Lock screen ---------- */
.lock { min-height: 80dvh; display: grid; place-content: center; gap: 16px; max-width: 360px; margin: 0 auto; padding: 24px; }
.lock .wordmark { font-size: 48px; }
.lock p { margin: 0; color: var(--muted); }
.lock form { display: grid; gap: 10px; }
.error-text { color: var(--bad); font-size: 14px; margin: 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* Market sources under each listing */
.market-note { display: block; }
.conf { font-weight: 600; }
.conf.high { color: var(--good, #2e7d4f); }
.conf.medium { color: inherit; }
.conf.low { color: var(--bad, #b0413e); }
ul.plain { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 2px; }
textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, transparent); color: inherit; box-sizing: border-box; }
.elsewhere { margin-top: 4px; }
.elsewhere summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.elsewhere-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
ol.setup { padding-left: 20px; display: grid; gap: 6px; }
ol.setup code { word-break: break-all; }

/* ---------- Chases and binders ---------- */
.chase-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.chase-stats div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); display: grid; gap: 2px; }
.chase-stats b { font-size: 22px; }
.chase-stats span { color: var(--muted); font-size: 13px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.badge { border: 1px dashed var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: baseline; }
.badge small { font-size: 12px; opacity: .8; }
.badge.got { border-style: solid; border-color: color-mix(in srgb, var(--good) 50%, var(--line)); color: var(--good); font-weight: 600; }
.chase-grid { display: grid; gap: 10px; }
.chase-row { text-align: left; display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--set); border-radius: 12px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.chase-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chase-row .bar, .bar.big { display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.chase-row .bar i, .bar.big i { display: block; height: 100%; background: var(--set, var(--accent)); border-radius: 99px; }
.bar.big { height: 12px; margin-top: 8px; }

/* The binder: pages of nine sleeve pockets, like the real thing. */
.binder { display: grid; gap: 18px; margin-top: 14px; }
.binder-page { position: relative; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, var(--surface)); border: 1px solid var(--line); }
.pockets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pocket { position: relative; aspect-ratio: 63 / 88; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); background: color-mix(in srgb, var(--surface) 70%, transparent); padding: 0; overflow: hidden; cursor: pointer; }
.pocket img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pocket.missing img { filter: grayscale(1); opacity: .35; }
.pocket.owned { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .25); }
.pocket-name { display: grid; place-items: center; height: 100%; padding: 6px; font-size: 12px; color: var(--muted); }
.pocket-price { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 4px; border-radius: 4px; background: var(--surface); color: var(--ink); text-align: center; }
.pocket-price.deal { color: var(--good); }
.empty-pocket { cursor: default; }
.page-no { position: absolute; right: 12px; bottom: -16px; font-size: 12px; color: var(--muted); }
.sheet-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: start; }
.sheet-card img { width: 110px; border-radius: 6px; }
.celebrate-pct { font-size: 64px; font-weight: 800; line-height: 1; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  dialog.celebrate[open] .celebrate-pct { animation: pop .5s ease-out; }
  @keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
}
.cat-list { max-height: 55dvh; overflow: auto; gap: 0; }
.cat-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
details.era { border-bottom: 1px solid var(--line); padding: 6px 0; }
details.era summary { cursor: pointer; padding: 6px 0; list-style-position: inside; }
details.era .cat-row:last-child { border-bottom: 0; }
.pocket-variant { position: absolute; top: 4px; left: 4px; right: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; padding: 2px 4px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 85%, transparent); color: var(--accent-ink); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-shelf { margin-top: 10px; }
.cat-shelf details.era summary { display: flex; justify-content: space-between; align-items: center; list-style: none; padding: 12px 4px; }
.cat-shelf details.era summary::-webkit-details-marker { display: none; }
.cat-shelf .chev { font-size: 22px; color: var(--muted); transition: transform .15s; }
.cat-shelf details[open] .chev { transform: rotate(90deg); }
.cat-shelf .cat-row { padding: 10px 4px; }
.segmented select { border: 0; background: transparent; font: inherit; padding: 6px 10px; color: var(--muted); }
.segmented select.on { color: var(--ink); font-weight: 600; }

/* ---------- Polish ---------- */
.btn.icon { min-width: 34px; padding-inline: 8px; font-size: 16px; }
.btn.icon[aria-pressed="true"] { color: var(--warn); }
details.more { position: relative; }
details.more summary.btn { list-style: none; color: var(--muted); }
details.more summary.btn::-webkit-details-marker { display: none; }
details.more summary.btn::after { content: "▾"; font-size: 11px; }
details.more[open] summary.btn::after { content: "▴"; }
.more-menu { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
details.more[open] { flex-basis: 100%; }

.skeleton { pointer-events: none; }
.skeleton .thumb { background: var(--sunken); }
.sk-lines { display: grid; gap: 10px; align-content: start; padding-top: 6px; }
.sk-lines i { display: block; height: 14px; border-radius: 6px; background: var(--sunken); }
.sk-lines i:nth-child(1) { width: 60%; height: 18px; }
.sk-lines i:nth-child(3) { width: 40%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton .thumb, .sk-lines i { animation: sk 1.2s ease-in-out infinite alternate; }
  @keyframes sk { from { opacity: .55; } to { opacity: 1; } }
}
@media (hover: none) { .btn:hover { border-color: var(--line); } }
.topbar .status { max-width: 50%; }

/* ---------- Pop: full cards everywhere ---------- */
.shelf { grid-column: 1 / -1; display: flex; height: 92px; overflow: hidden; padding: 4px 0 0 4px; margin: 2px 0 4px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.shelf img { width: 64px; height: 90px; flex: none; border-radius: 5px; object-fit: cover; margin-left: -20px; background: var(--sunken);
  box-shadow: 0 3px 10px rgb(0 0 0 / .28); transform: rotate(calc((var(--i) - 3) * 1.6deg)) translateY(calc(var(--i) % 2 * 3px)); }
.shelf img:first-child { margin-left: 0; }
.shelf img.ghost { filter: grayscale(1); opacity: .4; box-shadow: none; }
.chase-row .shelf { margin-top: 0; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 12px; cursor: pointer; text-align: left; min-height: 48px; }
.chip b { display: block; font-family: var(--display); font-size: 14px; }
.chip small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

.pocket { box-shadow: 0 2px 6px rgb(0 0 0 / .18); transition: transform .12s ease; }
.pocket:active { transform: scale(.97); }
.pocket.owned img { box-shadow: none; }
.pocket-check { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: var(--good); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.pocket.dex.missing img.sprite { object-fit: contain; padding: 14% 10% 22%; filter: grayscale(1) contrast(.6); opacity: .28; }
.pocket.dex.owned img.sprite { object-fit: contain; padding: 14% 10% 22%; }
.pocket .dex-label { font-size: 10.5px; padding: 2px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pocket.dex.missing { background: color-mix(in srgb, var(--surface) 85%, transparent); }

.pocket.rare::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: var(--holo); background-size: 240% 240%; mix-blend-mode: soft-light; opacity: .55; }
@media (prefers-reduced-motion: no-preference) { .pocket.rare::after { animation: foil 6s ease-in-out infinite alternate; } }
.cards.as-binder { background: none; border: 0; }
.binder-li { list-style: none; }
.cards.as-binder .binder { margin-top: 4px; }

.sheet-card { display: grid; grid-template-columns: 1fr; gap: 12px; }
.sheet-hero { display: grid; place-items: center; perspective: 900px; padding: 4px 0 2px; }
.tilt { position: relative; width: min(250px, 62vw); border-radius: 12px; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .15s ease-out; touch-action: none; box-shadow: 0 14px 30px rgb(0 0 0 / .35); }
.tilt img { display: block; width: 100%; height: auto; border-radius: 12px; }
.tilt img.sprite.big { width: 75%; margin: 0 auto; padding: 16px 0; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .25)); }
.sheen { position: absolute; inset: 0; border-radius: 12px; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / .55), transparent 55%), var(--holo); background-blend-mode: soft-light; }
.tilt:hover .sheen, .tilt:active .sheen { opacity: .7; }
@media (prefers-reduced-motion: reduce) { .tilt { transition: none; } }

.picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; overflow: auto; max-height: 56dvh; padding: 2px; }
@media (min-width: 560px) { .picker { grid-template-columns: repeat(4, 1fr); } }
.pick { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px; cursor: pointer; display: grid; gap: 3px; text-align: center; }
.pick img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 5px; background: var(--sunken); }
.pick small { font-size: 11px; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick:hover, .pick:focus-visible { border-color: var(--accent); }
.error-text { color: var(--bad); }

dialog.celebrate { overflow: hidden; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 14px; background: var(--c); transform: rotate(var(--r)); opacity: 0; border-radius: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .confetti i { animation: fall 2.2s ease-in var(--d) forwards; }
  @keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(var(--r)); } 100% { opacity: 0; transform: translateY(360px) rotate(calc(var(--r) + 540deg)); } }
}
.set-row .shelf { margin: 4px 0; }

/* ---------- Chases home and the new-chase picker ---------- */
.group-title { margin: 22px 0 8px; display: flex; align-items: baseline; gap: 6px; }
.chase-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chase-row { position: relative; }
.chase-row:hover { border-color: var(--muted); border-left-color: var(--set); }

dialog.wiz { width: min(560px, calc(100vw - 24px)); }
.wiz-step { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px; cursor: pointer; display: grid; gap: 2px; min-height: 76px; align-content: start; }
.tile b { font-family: var(--display); font-size: 17px; }
.tile small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.tile:hover, .tile:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding-top: 2px; }
.chips.wrap .chip { min-height: 38px; padding: 4px 10px; }
.pick-list { display: grid; gap: 4px; overflow: auto; max-height: 46dvh; }
.pick-row { display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 8px 4px; cursor: pointer; min-height: 52px; color: inherit; }
.pick-row:hover, .pick-row:focus-visible { background: var(--sunken); }
.pick-row img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.pick-row b { display: block; }
.pick-row small { display: block; color: var(--muted); font-size: 13px; }
.pick-row .dot { width: 18px; height: 18px; border-radius: 50%; flex: none; margin: 0 13px; }
.pick-row .pr-main { display: none; }

/* ---------- Trade checker ---------- */
.verdict { border: 1px solid var(--line); border-left-width: 6px; border-radius: var(--radius-row); background: var(--surface); padding: 12px 14px; display: grid; gap: 4px; margin-bottom: 12px; }
.verdict > b { font-family: var(--display); font-size: 22px; letter-spacing: -.01em; }
.verdict.fair { border-left-color: var(--good); } .verdict.fair > b { color: var(--good); }
.verdict.close { border-left-color: var(--warn); } .verdict.close > b { color: var(--warn); }
.verdict.uneven { border-left-color: var(--bad); } .verdict.uneven > b { color: var(--bad); }
.verdict.idle { border-left-color: var(--line); } .verdict.idle > b { color: var(--muted); font-size: 18px; }
.vsplit { display: flex; gap: 18px; font-size: 14px; color: var(--muted); margin-top: 4px; }
.vsplit b { color: var(--ink); }
.trade-side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.side-total { font-family: var(--display); font-size: 20px; }
.trade-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.trade-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.trade-item:first-child { border-top: 0; }
.trade-item .mini { width: 40px; height: 56px; }
.mini.cash { display: grid; place-items: center; background: color-mix(in srgb, var(--good) 18%, var(--sunken)); color: var(--good); font-weight: 800; font-size: 20px; border-radius: 6px; }
.ti-main { display: grid; gap: 2px; min-width: 0; }
.ti-main b { overflow-wrap: anywhere; }
.ti-main small { color: var(--muted); font-size: 13px; }
.ti-main .cond { width: auto; min-height: 34px; padding: 3px 24px 3px 8px; font-size: 14px; justify-self: start; }
.qty { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; }
.qty button { width: 34px; height: 34px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; }
.qty span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.ti-price { display: flex; align-items: center; gap: 2px; }
.price-btn { border: 0; background: none; font-family: var(--display); font-weight: 800; font-size: 17px; cursor: pointer; padding: 8px 4px; color: var(--ink); text-decoration: underline dotted; text-underline-offset: 4px; }
.x { border: 0; background: none; color: var(--muted); font-size: 22px; width: 36px; height: 40px; cursor: pointer; }
.trade-impact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: 12px; }
.trade-impact .up { color: var(--good); font-weight: 800; } .trade-impact .down { color: var(--bad); font-weight: 800; }
.cash-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }


/* ---------- Spacing, back bar, and fixes ---------- */
h2 { margin: var(--sp-3) 0 var(--sp-3); }
h3 { margin: var(--sp-5) 0 var(--sp-2); }
.shell > #view > * + * { margin-top: var(--sp-3); }
.shell > #view > .row-between { margin-top: var(--sp-4); }
.filters { padding: var(--sp-3); gap: var(--sp-3); margin-bottom: var(--sp-4); }
.listing { padding: var(--sp-4); gap: var(--sp-4); }
.listing-main { gap: var(--sp-2); }
.listing-actions { gap: var(--sp-2); margin-top: var(--sp-1); }
.tags { gap: var(--sp-2); }
.chase-grid { gap: var(--sp-3); }
.chase-row { padding: var(--sp-4); gap: var(--sp-2); }
.chase-stats { gap: var(--sp-3); margin: var(--sp-4) 0; }
.chase-stats div { padding: var(--sp-3) var(--sp-4); }
.trade-side, .trade-impact, .verdict { padding: var(--sp-4); }
.dialog-body { padding: 20px; gap: var(--sp-4); }
.dialog-foot { padding: var(--sp-3) 20px; gap: var(--sp-2); }
label.field { gap: 6px; }
label.check { gap: 10px; padding: 6px 0; }
.inline-field { display: flex; align-items: center; gap: var(--sp-3); font-size: 14px; color: var(--muted); }
.inline-field input { width: 104px; }
.segmented { display: flex; width: 100%; max-width: 100%; overflow: hidden; }
.segmented button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.2; padding: 9px 8px; }
.segmented select { flex: 1 1 0; min-width: 0; }

/* A clear way back on every detail screen. */
.back-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin: 0 0 var(--sp-2); }
.back-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 16px 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--accent); font-family: var(--display); font-weight: 600; font-size: 16px; cursor: pointer; box-shadow: 0 1px 0 var(--line); }
.back-btn::before { content: ""; width: 10px; height: 10px; border-left: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: rotate(45deg); margin: 0 0 0 6px; }
.back-btn:hover { border-color: var(--accent); }
.back-bar .back-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }

/* The card tilt: a lot of tilt, a little shine. */
.tilt { transform: perspective(700px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--sc, 1)); transition: transform .12s ease-out; }
.sheen { background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgb(255 255 255 / .28), transparent 50%); background-blend-mode: normal; }
.tilt:hover .sheen, .tilt:active .sheen { opacity: .35; }
.pocket.rare::after { opacity: .22; }

.lock { max-width: 420px; margin: 0 auto; padding: 56px 20px; display: grid; gap: var(--sp-4); }
.lock form { display: grid; gap: var(--sp-4); }
.lock p { margin: 0; }
.error-text { color: var(--bad); font-weight: 600; }

/* ---------- Trophy case ---------- */
.top-right { display: flex; align-items: center; gap: var(--sp-3); }
.gear { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.gear:hover, .gear[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.case-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); margin: var(--sp-3) 0; }
@media (min-width: 620px) { .case-stats { grid-template-columns: repeat(4, 1fr); } }
.case-stats div { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-row); padding: var(--sp-3) var(--sp-4); display: grid; gap: 2px; }
.case-stats b { font-family: var(--display); font-size: 24px; }
.case-stats b small { font-size: 15px; color: var(--muted); font-weight: 500; }
.case-stats span { color: var(--muted); font-size: 13px; }
.case { margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--radius-row); border: 1px solid var(--line);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 60%); display: grid; gap: var(--sp-3); }
.shelf-row { display: flex; gap: var(--sp-3); overflow-x: auto; padding: var(--sp-2) 2px var(--sp-3); scroll-snap-type: x proximity; scrollbar-width: thin;
  border-bottom: 4px solid color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 0 0 4px 4px; }
.shelf-row.center { justify-content: center; flex-wrap: wrap; border-bottom: 0; overflow: visible; }
.trophy { flex: none; width: 96px; scroll-snap-align: start; border: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 0 0 var(--sp-1); color: inherit; text-align: center; }
.trophy .medal { width: 78px; height: auto; filter: drop-shadow(0 4px 6px rgb(0 0 0 / .22)); transition: transform .15s; }
.trophy:hover .medal, .trophy:focus-visible .medal { transform: translateY(-3px) rotate(-3deg); }
.trophy b { font-family: var(--display); font-size: 13.5px; line-height: 1.15; font-weight: 600; }
.trophy small { color: var(--muted); font-size: 12px; }
.trophy.locked .medal, .medal.locked { filter: grayscale(1) opacity(.38); }
.trophy.locked b { color: var(--muted); font-weight: 500; }
.trophy.tier-holo.earned .medal .rim, .mtile.tier-holo.earned .medal .rim { animation: foil 6s ease-in-out infinite alternate; }
.big-medal { display: grid; place-items: center; }
.big-medal .medal { width: 150px; height: auto; filter: drop-shadow(0 8px 12px rgb(0 0 0 / .3)); }
.acct { display: grid; gap: var(--sp-2); }
.acct li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.section-gap { margin-top: var(--sp-6); }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ---------- Sources ---------- */
.sources { display: grid; gap: var(--sp-2); }
.source-row { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: var(--sp-3) var(--sp-4); }
.source-row.is-off { opacity: .6; }
.src-main { display: grid; gap: 2px; min-width: 0; }
.src-main small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.src-actions { display: flex; gap: var(--sp-2); margin-top: 2px; }
.src-more summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 6px 0; }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line); transition: background .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .15s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.add-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); }
details.local-shops { padding: var(--sp-3) var(--sp-4); margin-top: var(--sp-4); }
details.local-shops summary { cursor: pointer; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { border-color: var(--bad); }
fieldset.lang-list { border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: var(--sp-3) var(--sp-4) var(--sp-4); margin: 0; min-width: 0; }
fieldset.lang-list legend { padding: 0 var(--sp-2); font-weight: 700; font-size: 14px; }

.slab { cursor: pointer; font: inherit; color: inherit; }
.slab:hover { transform: translateY(-1px); }
.filter-more .checks { grid-column: 1 / -1; display: grid; gap: var(--sp-1); }
.filter-more label.field > span { font-size: 13px; }
.filter-more { gap: var(--sp-3); }
.row-actions { display: inline-flex; gap: var(--sp-2); align-items: center; }
ul.points { display: grid; gap: var(--sp-3); }
ul.points li { display: grid; grid-template-columns: 78px 1fr; gap: var(--sp-3); align-items: start; }
ul.points .pts { font-family: var(--display); font-weight: 600; color: var(--accent); text-align: right; }
ul.points small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.35; }
ul.why { display: grid; gap: var(--sp-1); } ul.why li::before { content: "• "; color: var(--accent); }

.legal { margin: var(--sp-6) 0 0; padding-top: var(--sp-4); border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.dex-ph { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 2px; border: 2px dashed color-mix(in srgb, var(--ink) 18%, transparent); border-radius: inherit; color: color-mix(in srgb, var(--ink) 38%, transparent); }
.dex-ph b { font-family: var(--display); font-size: 22px; letter-spacing: -.02em; }
.tilt .dex-ph { position: relative; aspect-ratio: 63 / 88; width: 100%; background: var(--surface); }
.tilt .dex-ph b { font-size: 44px; }
.tilt .dex-ph small { font-size: 16px; }
.dex-num { flex: none; width: 52px; text-align: center; font-family: var(--display); font-weight: 700; color: var(--muted); font-size: 15px; }

/* ---------- Trade page ---------- */
.prefixed { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-ctl); background: var(--surface); overflow: hidden; }
.prefixed > span { padding: 0 0 0 var(--sp-3); color: var(--muted); white-space: nowrap; font-size: 14px; }
.prefixed input { border: 0; border-radius: 0; min-width: 0; }
.qr-panel { justify-items: center; }
.qr-box { background: #fff; padding: var(--sp-3); border-radius: var(--radius-row); border: 1px solid var(--line); width: min(260px, 70vw); }
.qr-box svg { display: block; width: 100%; height: auto; }
.spares { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.spares li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.spares li:first-child { border-top: 0; }
.spares .mini { width: 40px; height: 56px; }
.want-chip { flex: none; width: 64px; display: grid; gap: 2px; justify-items: center; text-align: center; }
.want-chip small { font-size: 11.5px; line-height: 1.15; color: var(--muted); }

.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(4, 1fr); } }
.ptile { position: relative; display: grid; gap: 2px; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius-ctl); padding: var(--sp-2); cursor: pointer; color: inherit; align-content: start; }
.ptile img, .ptile .ph { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 6px; background: var(--sunken); display: block; }
.ptile b { font-family: var(--display); font-size: 13.5px; line-height: 1.15; margin-top: 4px; overflow-wrap: anywhere; }
.ptile small { color: var(--muted); font-size: 11.5px; line-height: 1.2; }
.ptile .pp { color: var(--ink); font-weight: 600; }
.ptile.on { border-color: var(--good); background: color-mix(in srgb, var(--good) 9%, var(--surface)); }
.ptile .tick { position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; border-radius: 50%; background: var(--good); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.ptile .tick:empty { display: none; }
.sticky-actions { position: sticky; bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px)); z-index: 5; padding: var(--sp-3); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius-row); }
.cta { margin-top: var(--sp-5); }

/* ---------- Welcome, guest, onboarding ---------- */
.lock.welcome { padding-top: 72px; }
.tagline { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; margin: var(--sp-2) 0 0; }
.btn.big { min-height: 54px; font-size: 18px; width: 100%; }
.welcome-links { display: grid; justify-items: center; }
.guest-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; background: color-mix(in srgb, var(--yellow) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--yellow) 60%, var(--line)); border-radius: var(--radius-row); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); font-size: 14.5px; }
.guest-bar span { flex: 1 1 220px; }
details.idle-sets { margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4); }
details.idle-sets summary { cursor: pointer; }
details.idle-sets ul { margin-top: var(--sp-3); display: grid; gap: var(--sp-2); }
details.idle-sets li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-top: 1px solid var(--line); }
.ob-steps { display: flex; gap: 6px; margin: 0 0 var(--sp-1); }
.ob-steps i { height: 6px; flex: 1; border-radius: 99px; background: var(--line); }
.ob-steps i.on { background: var(--accent); }
.ob-group { display: grid; gap: var(--sp-2); }
.ob-group h3 { margin: var(--sp-3) 0 0; font-size: 16px; }
.ob-status { display: grid; gap: var(--sp-2); }
.ob-status li { display: flex; gap: var(--sp-2); align-items: center; }
.ob-status li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.ob-status li.done::before { background: var(--good); border-color: var(--good); }
.ob-status li.busy::before { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ob-status li.busy::before { animation: none; } }
.aff-note { flex-basis: 100%; font-size: 12px; }

/* ---------- Public pages, offline bar, safety ---------- */
.doc { max-width: 720px; }
.doc main { padding-bottom: var(--sp-5); }
.doc h1 { font-family: var(--display); font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; margin: var(--sp-4) 0 var(--sp-3); }
.doc h2 { font-size: 22px; margin: var(--sp-6) 0 var(--sp-2); }
.doc p, .doc li { line-height: 1.6; }
.doc .lead { font-size: 18px; color: var(--ink); }
.doc ul, .doc ol { padding-left: 22px; display: grid; gap: var(--sp-2); }
.doc .steps li::marker { font-family: var(--display); font-weight: 700; color: var(--accent); }
.doc-links { margin-bottom: var(--sp-2); }
.doc-links a { color: var(--muted); }
.legal p { margin: 0; }
.fallback { max-width: 560px; margin: 0 auto; padding: 56px 20px; }
.offline-bar { display: none; background: var(--ink); color: var(--bg); text-align: center; font-size: 14px; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-ctl); margin-bottom: var(--sp-3); }
body.is-offline .offline-bar { display: block; }
.warn-box { margin: 0; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-ctl); border: 1px solid color-mix(in srgb, var(--red) 55%, var(--line)); background: color-mix(in srgb, var(--red) 8%, var(--surface)); font-size: 14.5px; }
.safety { margin: var(--sp-4) 0 0; }

.a2hs-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius-row); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); font-size: 14.5px; }

/* ---------- UX pass: cards first ---------- */
/* Feed controls: one search row, one sort row. */
.filters.compact { background: none; border: 0; padding: 0; margin: 0 0 var(--sp-3); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
.feed-search { display: flex; gap: var(--sp-2); }
.feed-search .grow { flex: 1; min-width: 0; }
.feed-sort { display: flex; align-items: center; gap: var(--sp-3); }
.feed-sort .field { flex: 0 1 auto; min-width: 0; }
select.pill { width: auto; max-width: 52vw; min-height: 40px; border-radius: 999px; padding: 0 34px 0 16px; font-weight: 600; background-color: var(--surface); }
.feed-sort #feed-count { margin-left: auto; white-space: nowrap; }
.filters.compact .filter-more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: var(--sp-3); }
details.menu { position: relative; }
details.menu summary { list-style: none; cursor: pointer; font-size: 20px; line-height: 1; min-width: 40px; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: grid; gap: var(--sp-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: var(--sp-2); box-shadow: 0 10px 28px rgb(0 0 0 / .18); min-width: 180px; }
.aff-note { margin: var(--sp-4) 0 0; text-align: center; }

/* Bigger card art on listings, one clear main action. */
.listing { grid-template-columns: 96px 1fr; }
.thumb { width: 96px; height: 134px; }
@media (min-width: 560px) { .listing { grid-template-columns: 112px 1fr; } .thumb { width: 112px; height: 156px; } }
.listing-actions .btn.primary { flex: 1 1 100%; min-height: 44px; font-size: 16px; }
.more-tag { background: var(--sunken); }

/* Binders: title, progress, and the cards. Everything else lives under Manage. */
.checklist-head { position: static; display: grid; gap: var(--sp-3); padding: 0 0 var(--sp-2); }
.title-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.title-row h2 { margin: 0; }
.manage { display: grid; gap: var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); }
.manage[hidden] { display: none; }
.manage-label { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cl-strip { position: sticky; top: calc(var(--tabs-h, 62px) + env(safe-area-inset-top, 0px)); z-index: 5; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); padding: var(--sp-2) 0; display: grid; gap: var(--sp-2); }
.strip-row { display: flex; gap: var(--sp-2); align-items: center; }
.strip-row input { flex: 1; min-width: 0; }
.segmented.icons { width: auto; flex: none; }
.segmented.icons button { flex: none; width: 44px; padding: 0; font-size: 18px; }

/* My trade page */
details.settings-fold > summary { cursor: pointer; display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; list-style: none; }
details.settings-fold > summary::-webkit-details-marker { display: none; }
details.settings-fold[open] > summary { margin-bottom: var(--sp-3); }
details.help { margin-top: var(--sp-2); }
details.help summary { cursor: pointer; color: var(--accent); font-size: 14.5px; padding: 6px 0; }

/* Welcome */
.hero { width: min(300px, 80%); height: auto; margin: 0 auto var(--sp-2); display: block; filter: drop-shadow(0 10px 18px rgb(0 0 0 / .18)); }
.lock.welcome { padding-top: 40px; }

.feed-sort { min-width: 0; }
.feed-sort #feed-count { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chases-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: nowrap; }
.chases-head h2 { margin: 0; font-size: 22px; }
.chases-head .listing-actions { margin: 0; flex-wrap: nowrap; }

/* ---------- Marking, importing, finishing ---------- */
#toast.show { pointer-events: auto; }
#toast .toast-btn { margin-left: var(--sp-3); border: 0; background: none; color: var(--yellow); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 4px 6px; }
.linklike { border: 0; background: none; padding: 0 2px; color: var(--accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.quick-toggle { width: 44px; padding: 0; font-size: 20px; flex: none; }
.quick-toggle.on { background: var(--good); border-color: var(--good); color: #fff; }
.quick-hint { margin: 0; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-ctl); background: color-mix(in srgb, var(--good) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--good) 40%, var(--line)); font-size: 14px; }
.binder.quick .pocket { cursor: pointer; }
.binder.quick .pocket.missing { outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -2px; }
.page-actions { display: flex; gap: var(--sp-2); justify-content: center; padding-top: var(--sp-2); }
.pocket.just-owned { animation: pop .38s cubic-bezier(.2, 1.6, .4, 1); }
.pocket.just-owned .pocket-check { animation: tick .38s ease-out; }
@keyframes pop { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes tick { from { transform: scale(0); } to { transform: scale(1); } }
.binder-page.page-done { box-shadow: 0 0 0 2px var(--yellow), 0 6px 22px color-mix(in srgb, var(--yellow) 45%, transparent); }
.binder-page.page-done .page-no::after { content: " ★"; color: #C99A00; }
@media (prefers-reduced-motion: reduce) { .pocket.just-owned, .pocket.just-owned .pocket-check { animation: none; } }

.qa-preview { display: flex; flex-wrap: wrap; gap: 6px; min-height: 8px; }
.qa-card { width: 46px; text-align: center; font-size: 12px; color: var(--ink); font-weight: 600; }
.qa-card img { display: block; width: 46px; height: 64px; object-fit: cover; border-radius: 4px; background: var(--sunken); box-shadow: 0 1px 4px rgb(0 0 0 / .25); }
.qa-card.have img { opacity: .4; }
.qa-card.have small::after { content: " ✓"; }
dialog.quick-add .dialog-body input#qa-input { font-size: 22px; min-height: 52px; letter-spacing: .02em; }
#pl-text { width: 100%; padding: var(--sp-3); border-radius: var(--radius-ctl); border: 1px solid var(--line); background: var(--surface); font: inherit; resize: vertical; }
.hub { display: grid; gap: var(--sp-3); }
.hub-opt { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-row); padding: var(--sp-4); display: grid; gap: 4px; cursor: pointer; color: inherit; }
.hub-opt b { font-family: var(--display); font-size: 17px; }
.hub-opt small { color: var(--muted); font-size: 14px; line-height: 1.35; }
button.hub-opt:hover, button.hub-opt:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.hub-opt.static { cursor: default; }
.hub-opt.static .chips { padding-top: var(--sp-2); }

.new-tag { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 800; letter-spacing: .04em; }
.listing.is-new { border-left: 4px solid var(--accent); }

dialog.ceremony { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; margin: 0; padding: 0; overflow: auto;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--yellow) 38%, #1B1D2E), #11131F 70%); color: #fff; }
dialog.ceremony::backdrop { background: #000; }
.cer-body { position: relative; z-index: 1; min-height: 100%; padding: calc(var(--sp-6) + env(safe-area-inset-top, 0px)) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); display: grid; align-content: center; justify-items: center; gap: var(--sp-4); text-align: center; }
.cer-kicker { margin: 0; font-family: var(--display); letter-spacing: .3em; text-transform: uppercase; font-size: 14px; color: var(--yellow); }
.cer-title { margin: 0; font-size: clamp(32px, 9vw, 52px); line-height: 1.05; letter-spacing: -0.02em; }
.cer-grid { display: grid; grid-template-columns: repeat(var(--cols, 8), 1fr); gap: 6px; width: min(100%, calc(var(--cols, 8) * 92px), 560px); margin: 0 auto; }
.cer-grid img { width: 100%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 3px; box-shadow: 0 2px 6px rgb(0 0 0 / .5); animation: cerIn .55s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--i) * 40ms + 200ms); }
@keyframes cerIn { from { opacity: 0; transform: translateY(14px) scale(.5) rotate(-8deg); } to { opacity: 1; transform: none; } }
.cer-stats { margin: 0; font-size: 18px; }
.cer-medal .medal { width: 120px; }
.cer-actions { display: flex; gap: var(--sp-3); }
dialog.ceremony .btn { min-height: 48px; }
@media (prefers-reduced-motion: reduce) { .cer-grid img { animation: none; } }

.new-count { color: var(--accent); }
#pl-first { justify-self: start; }

/* The card owns its touches: dragging on it tilts it, never scrolls the page. */
.tilt { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tilt img { pointer-events: none; -webkit-user-drag: none; }
/* Nothing behind an open sheet scrolls. */
html:has(dialog[open]), body:has(dialog[open]) { overflow: hidden; }
dialog { overscroll-behavior: contain; }

/* ---------- Finger-sized targets ---------- */
/* 44px is the size a thumb can hit on the first try, in a crowd, with one hand. */
.btn.small { min-height: 44px; padding: 6px 14px; }
.btn.small.quiet { padding-inline: 12px; }
.btn.icon { min-width: 44px; }
details.menu summary { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
details > summary:not(.btn) { min-height: 44px; display: flex; align-items: center; gap: var(--sp-2); }
details.settings-fold > summary { display: flex; }
.qty button { width: 44px; height: 44px; }
.x { width: 44px; height: 44px; }
.ti-main .cond { min-height: 44px; }
.legal a, .legal-links a { display: inline-block; padding: 13px 6px; }
.linklike { min-height: 44px; padding: 0 6px; }
.quick-hint .linklike { min-height: 0; padding: 12px 8px; margin: -12px 0; }
.doc-links a { display: inline-block; padding: 13px 6px; }

/* Disclosure arrow for plain summaries (the browser's own disappears once the summary is flex). */
details > summary:not(.btn)::before { content: "▸"; display: inline-block; width: 1em; flex: none; color: var(--muted); transition: transform .15s; }
details[open] > summary:not(.btn)::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { details > summary:not(.btn)::before { transition: none; } }
details.settings-fold > summary h3 { color: var(--ink); }
details.settings-fold > summary .muted { font-weight: 400; }

/* The little menu on an owned card in marking mode */
.pocket-menu { position: fixed; z-index: 60; display: grid; gap: 6px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); box-shadow: 0 12px 32px rgb(0 0 0 / .28); max-width: calc(100vw - 16px); }
.pocket-menu .pm-title { font-size: 13px; color: var(--muted); padding: 2px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pocket-menu .pm-row { display: flex; gap: 6px; }
.pocket.menu-open { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 2; }
.pocket-spare { position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--accent); color: var(--accent-ink); font: 800 12px/1 var(--display); padding: 4px 6px; border-radius: 999px; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }

/* ---------- Trade page: the result stays with you ---------- */
.verdict.idle { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.verdict.idle > b { color: var(--ink); font-size: 20px; }
.jump { display: flex; gap: var(--sp-2); margin: 0 0 var(--sp-3); flex-wrap: wrap; }
.jump .chip { flex: 1 1 140px; display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); text-align: left; }
#sec-wants, #sec-haves { scroll-margin-top: 12px; }
.ptile { position: relative; }
.qty-badge { position: absolute; top: 8px; left: 8px; z-index: 2; background: var(--accent); color: var(--accent-ink); font: 800 12px/1 var(--display); padding: 4px 7px; border-radius: 999px; box-shadow: 0 1px 4px rgb(0 0 0 / .35); }
.trade-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; max-width: 720px; margin: 0 auto; display: grid; gap: 6px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border: 1px solid var(--line); border-bottom: 0; border-top: 5px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgb(0 0 0 / .16); }
.trade-bar.fair { border-top-color: var(--good); } .trade-bar.close { border-top-color: var(--warn); } .trade-bar.uneven { border-top-color: var(--bad); } .trade-bar.idle { border-top-color: var(--accent); }
.tb-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.tb-head > b { font-family: var(--display); font-size: 20px; letter-spacing: -.01em; }
.trade-bar.fair .tb-head > b { color: var(--good); } .trade-bar.close .tb-head > b { color: var(--warn); } .trade-bar.uneven .tb-head > b { color: var(--bad); }
.tb-sums { font-size: 14px; color: var(--muted); }
.tb-sums b { color: var(--ink); }
.tb-detail { margin: 0; font-size: 14px; color: var(--muted); }
.tb-actions { display: flex; gap: var(--sp-2); }
.tb-actions .primary { flex: 1; min-height: 48px; }
body.has-bar main { padding-bottom: 190px; }
.qty-inline { font: 800 12px/1 var(--display); font-style: normal; background: var(--accent); color: var(--accent-ink); padding: 3px 6px; border-radius: 999px; vertical-align: 2px; }

/* Unsent changes */
.save-pill { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top, 0px) + 8px); max-width: calc(100vw - 24px); padding: 8px 14px; border-radius: 999px; background: #1B1D2E; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 20px rgb(0 0 0 / .3); text-align: center; border: 2px solid var(--yellow); }

/* Show my QR: always black on white, whatever the theme, so any phone camera reads it */
dialog.qr-show { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; background: #fff; color: #111; }
dialog.qr-show::backdrop { background: #fff; }
.qs-body { min-height: 100%; display: grid; align-content: center; justify-items: center; gap: var(--sp-3); padding: calc(var(--sp-5) + env(safe-area-inset-top, 0px)) var(--sp-5) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); text-align: center; }
.qs-kicker { margin: 0; font-family: var(--display); letter-spacing: .22em; text-transform: uppercase; font-size: 13px; color: #555; }
.qs-name { margin: 0; font-size: clamp(30px, 9vw, 48px); line-height: 1.05; color: #111; }
.qs-note { margin: 0; font-size: 18px; color: #333; }
.qs-code { background: #fff; line-height: 0; }
.qs-code svg { width: min(88vw, 56dvh, 460px); height: auto; display: block; }
.qs-link { margin: 0; font-weight: 700; font-size: 18px; color: #111; word-break: break-all; }
.qs-warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: #FDE8E4; color: #7A1F10; font-size: 14px; max-width: 420px; }
.qs-tip { margin: 0; font-size: 14px; color: #555; }
dialog.qr-show .btn { min-width: 180px; }

.ob-import { display: grid; gap: 2px; text-align: left; width: 100%; padding: var(--sp-3) var(--sp-4); border-style: dashed; }
.ob-import b { font-family: var(--display); font-size: 16px; }
.ob-import small { color: var(--muted); font-size: 14px; }

/* Guests get one slim reminder, not a banner on every tab */
.guest-bar { display: flex; align-items: center; gap: var(--sp-2); padding: 6px 6px 6px 12px; margin: 0 0 var(--sp-3); border-radius: 999px; background: color-mix(in srgb, var(--yellow) 28%, var(--surface)); border: 1px solid color-mix(in srgb, var(--yellow) 60%, var(--line)); font-size: 14px; }
.guest-bar span { flex: 1; min-width: 0; line-height: 1.25; }
.guest-bar .btn { flex: none; min-height: 40px; padding: 4px 12px; }
.guest-x { flex: none; width: 36px; height: 36px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%; }

/* Owner tools fold away */
.owner-head { display: flex; align-items: baseline; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-2); }
.owner-head small { font-size: 14px; font-weight: 400; }
details.panel.fold { padding: 0; }
details.panel.fold > summary { padding: var(--sp-4); }
details.panel.fold > summary h3 { display: inline; margin: 0; }
.fold-body { display: grid; gap: 10px; padding: 0 var(--sp-4); }
details.panel.fold[open] { padding-bottom: var(--sp-4); }
details.panel.fold[open] > summary { padding-bottom: var(--sp-2); }
details.panel.fold > summary h3 { color: var(--ink); }
@media (min-width: 720px) { .binder-page { max-width: 540px; margin-inline: auto; } }

/* Loading placeholders */
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--sunken) 25%, color-mix(in srgb, var(--sunken) 55%, var(--surface)) 50%, var(--sunken) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel-card { display: flex; gap: var(--sp-3); padding: var(--sp-4); margin-bottom: var(--sp-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

/* ---------- Price check ---------- */
.why-btn { justify-self: start; border: 0; background: none; padding: 0 2px; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font: 700 15px/1.2 var(--body); cursor: pointer; }
.why-btn:hover, .why-btn:focus-visible { text-decoration: underline; }
dialog.price-check .dialog-body { gap: var(--sp-4); }
.pc-verdict { --tone: var(--muted); display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font: 800 14px/1.2 var(--display); letter-spacing: .01em; background: var(--sunken); color: var(--ink); }
.pc-verdict::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tone); }
.pc-verdict.good { --tone: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--surface)); }
.pc-verdict.high { --tone: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.pc-verdict.warn { --tone: var(--warn); background: color-mix(in srgb, var(--warn) 20%, var(--surface)); border: 1px solid var(--warn); }
.pc-sentence { font-size: 17px; line-height: 1.4; }
.pr { width: 100%; height: auto; display: block; overflow: visible; }
.pr-track { fill: var(--sunken); stroke: var(--line); }
.pr-zone { fill: color-mix(in srgb, var(--good) 22%, transparent); stroke: color-mix(in srgb, var(--good) 55%, transparent); }
.pr-tick { stroke: var(--ink); stroke-width: 2; }
.pr-t { fill: var(--ink); font: 600 12.5px var(--body); }
.pr-you { font: 800 13.5px var(--display); }
.pr-pin.good { fill: var(--good); } .pr-pin.high { fill: var(--bad); }
.pc-legend { display: flex; align-items: center; gap: 6px; }
.pc-legend .zone { width: 22px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--good) 22%, transparent); border: 1px solid color-mix(in srgb, var(--good) 55%, transparent); display: inline-block; }
.pc-sec { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.pc-sec h3 { margin: 0; font-size: 16px; }
.pc-src li, .pc-inc li, .pc-watch li { display: grid; gap: 2px; padding: 4px 0; }
.pc-src small { color: var(--muted); font-size: 14px; }
.pc-conf { padding: 8px 10px; border-radius: var(--radius-ctl); background: var(--sunken); font-size: 14.5px; }
.pc-conf.high { border-left: 4px solid var(--good); } .pc-conf.medium { border-left: 4px solid var(--warn); } .pc-conf.low { border-left: 4px solid var(--bad); }
.pc-others a { display: flex; gap: var(--sp-3); align-items: baseline; min-height: 44px; align-content: center; color: var(--accent); }
.pc-others a b { font-family: var(--display); }
.pc-others a span { color: var(--ink); }
.pts.up { color: var(--good); } .pts.down { color: var(--bad); }
.pts-total { border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.pc-watch { border-top-color: var(--warn); }
.pc-watch li::before { content: "•"; color: var(--warn); font-weight: 800; margin-right: 6px; }
.pc-watch li { display: block; }

.pr-lead { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
ul.points .pts.up { color: var(--good); }
ul.points .pts.down { color: var(--bad); }
.pc-inc li { display: block; }

/* ---------- The four colors ---------- */
.colorbar { height: 4px; border-radius: 2px; margin: 2px 0 var(--sp-3); background: linear-gradient(90deg, #C0392B 0 25%, #FFCB05 25% 50%, #2E8B57 50% 75%, #3B4CCA 75% 100%); }
.tabs button[data-tab="feed"] { --tab: var(--c-blue); }
.tabs button[data-tab="chases"] { --tab: var(--c-red); }
.tabs button[data-tab="trade"] { --tab: var(--c-green); }
.tabs button[data-tab="trophies"] { --tab: var(--c-yellow); }
.tabs button[data-tab="sources"] { --tab: var(--c-blue); }
.tabs button { box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--tab, var(--line)) 30%, transparent); }
.tabs button[aria-current="page"] { background: color-mix(in srgb, var(--tab, var(--accent)) 13%, var(--surface)); box-shadow: inset 0 -4px 0 var(--tab, var(--yellow)); }
.group-title { display: flex; align-items: center; gap: 8px; }
.group-title .gdot { width: 12px; height: 12px; border-radius: 4px; background: var(--g); flex: none; }
.case-stats div { border-top-width: 4px; }
.case-stats div:nth-child(1) { border-top-color: var(--c-red); }
.case-stats div:nth-child(2) { border-top-color: var(--c-yellow); }
.case-stats div:nth-child(3) { border-top-color: var(--c-green); }
.case-stats div:nth-child(4) { border-top-color: var(--c-blue); }

/* ---------- Pockets that have no picture ---------- */
.pocket-fallback { display: grid; align-content: center; justify-items: center; gap: 4px; height: 100%; padding: 10px 8px 30px; text-align: center; color: var(--ink); background: linear-gradient(160deg, color-mix(in srgb, var(--set, var(--c-blue)) 18%, var(--surface)), var(--surface)); }
.pocket-fallback b { font: 700 15px/1.15 var(--display); overflow-wrap: anywhere; }
.pocket-fallback small { font-size: 12.5px; color: var(--muted); line-height: 1.2; }
.pocket.missing .pocket-fallback { opacity: .9; }

/* ---------- Header: name and scan status on the left, the cog on the right edge ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.brand-col { display: grid; gap: 2px; min-width: 0; }
.brand-col .status { font-size: 13px; color: var(--muted); }
.topbar .gear { flex: none; margin-left: auto; }

/* ---------- Trophies: medals, luck, layout ---------- */
.medal { overflow: visible; }
.medal.rank-crit { filter: drop-shadow(0 0 6px rgb(255 203 5 / .75)); }
.medal.rank-shiny { filter: drop-shadow(0 0 7px rgb(160 120 255 / .7)); animation: shinyHue 7s linear infinite; }
.medal.locked.rank-crit, .medal.locked.rank-shiny { filter: grayscale(1) opacity(.38); animation: none; }
@keyframes shinyHue { from { filter: drop-shadow(0 0 7px rgb(160 120 255 / .7)) hue-rotate(0deg); } to { filter: drop-shadow(0 0 7px rgb(160 120 255 / .7)) hue-rotate(360deg); } }
.sparkle { transform-box: fill-box; transform-origin: center; animation: twinkle 2s ease-in-out infinite; }
@keyframes twinkle { 0%, 100% { transform: scale(.6) rotate(0); opacity: .55; } 50% { transform: scale(1.15) rotate(20deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .medal.rank-shiny, .sparkle { animation: none; } .sparkle { opacity: 1; } }

.rank-tag { display: inline-block; font: 800 11px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 999px; border: 1px solid transparent; }
.rank-tag.crit { background: #FFF1B8; color: #4A3500; border-color: #C99A00; }
.rank-tag.shiny { background: linear-gradient(90deg, #FFD6D6, #FFF3B0, #D3F5DC, #D2E4FF, #EBD6FF); color: #2A1F4D; border-color: #8A6BE0; }
.rank-tag.big { font-size: 14px; padding: 6px 12px; }

.mtile { border: 0; background: none; cursor: pointer; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 4px 0; min-width: 0; color: inherit; font: inherit; }
.mtile .medal { width: 100%; max-width: 72px; height: auto; filter: drop-shadow(0 3px 5px rgb(0 0 0 / .2)); transition: transform .15s; }
.mtile .medal.rank-crit { filter: drop-shadow(0 0 5px rgb(255 203 5 / .75)); }
.mtile .medal.rank-shiny { filter: drop-shadow(0 0 6px rgb(160 120 255 / .7)); }
.mtile.locked .medal { filter: grayscale(1) opacity(.38); }
.mtile:hover .medal, .mtile:focus-visible .medal { transform: translateY(-3px) rotate(-3deg); }
.mtile b { font: 600 12.5px/1.15 var(--display); text-align: center; overflow-wrap: anywhere; }
.mtile.locked b { color: var(--muted); font-weight: 500; }
.mtile small { color: var(--muted); font-size: 11.5px; text-align: center; }
.medal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-1); }
@media (min-width: 560px) { .medal-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.case .group-title .gdot { background: var(--g); }
.showcase, .nextup { display: grid; gap: var(--sp-2); margin: var(--sp-4) 0; }
.nextup ul { display: grid; gap: var(--sp-2); }
.nu { width: 100%; display: grid; grid-template-columns: 52px 1fr auto; align-items: center; gap: var(--sp-3); text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-row); padding: var(--sp-2) var(--sp-3); cursor: pointer; color: inherit; font: inherit; min-height: 64px; }
.nu .medal { width: 48px; height: auto; filter: grayscale(.6) opacity(.7); }
.nu-main { display: grid; gap: 2px; min-width: 0; }
.nu-main b { font: 600 15px/1.2 var(--display); }
.nu-main small { color: var(--muted); font-size: 13px; }
.nu-left { text-align: center; line-height: 1.1; }
.nu-left b { font: 700 20px var(--display); display: block; }
.nu-left small { color: var(--muted); font-size: 12px; }
.how-luck { margin-top: var(--sp-5); }
.chips[aria-label="Show trophies"] { margin: var(--sp-3) 0; }
.brand-col .status, .topbar .brand-col .status { max-width: none; text-align: left; white-space: nowrap; }

/* ---------- Price history ---------- */
.stat-link { text-align: left; font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line); border-top-width: 4px; background: var(--surface); border-radius: var(--radius-row); padding: var(--sp-3) var(--sp-4); display: grid; gap: 2px; }
.stat-link b { font-family: var(--display); font-size: 24px; }
.stat-link span { color: var(--accent); font-size: 13px; font-weight: 700; }
.vh-head { display: grid; gap: 2px; margin: var(--sp-2) 0 var(--sp-3); }
.vh-now { font: 800 34px/1.05 var(--display); letter-spacing: -.02em; }
.vh-change { font-weight: 700; }
.vh-change.up, .vh-tiles .up > b, .vh-delta.up { color: var(--good); }
.vh-change.down, .vh-tiles .down > b, .vh-delta.down { color: var(--bad); }
.vc-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-row); padding: var(--sp-3) var(--sp-2) var(--sp-1); margin: var(--sp-3) 0; }
.vc { width: 100%; height: auto; display: block; overflow: visible; }
.vc-axis { stroke: var(--line); stroke-width: 1; }
.vc-area { fill: color-mix(in srgb, var(--c-blue) 14%, transparent); }
.vc-line { fill: none; stroke: var(--c-blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.vc-dot { fill: var(--surface); stroke: var(--c-blue); stroke-width: 2; }
.vc-now { fill: var(--c-blue); stroke: var(--surface); stroke-width: 2.5; }
.vc-t { fill: var(--ink); font: 700 12px var(--body); }
.vc-d { fill: var(--muted); font-weight: 500; }
.vh-sec { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }
.vh-sec h3 { margin: 0; }
.vh-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
.vh-tiles div { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-ctl); padding: var(--sp-3); display: grid; gap: 2px; }
.vh-tiles b { font: 700 20px var(--display); }
.vh-tiles span { color: var(--muted); font-size: 13px; }
.vh-list { display: grid; gap: var(--sp-2); }
.vh-row { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; gap: var(--sp-3); align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-ctl); padding: var(--sp-2) var(--sp-3); cursor: pointer; color: inherit; font: inherit; min-height: 64px; }
.vh-row img, .vh-ph { width: 44px; height: 61px; object-fit: cover; border-radius: 4px; background: var(--sunken); }
.vh-main { display: grid; gap: 2px; min-width: 0; }
.vh-main b { font: 600 15px/1.2 var(--display); }
.vh-main small { color: var(--muted); font-size: 13px; }
.vh-delta { text-align: right; display: grid; gap: 2px; }
.vh-delta b { font: 700 16px var(--display); color: var(--ink); }
.vh-delta small { font-size: 13px; font-weight: 700; }
.vh-bars li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: var(--sp-2); align-items: center; padding: 4px 0; }
.vb-name { display: flex; align-items: center; gap: 6px; font-size: 14.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-bar { height: 10px; border-radius: 5px; background: var(--sunken); overflow: hidden; }
.vb-bar i { display: block; height: 100%; border-radius: 5px; }
.vh-bars b { font: 700 14px var(--display); }
.gdot { width: 12px; height: 12px; border-radius: 4px; background: var(--g); flex: none; display: inline-block; }

/* ---------- Search and the Feed's quick filters ---------- */
.qchips { display: flex; gap: var(--sp-2); overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.qchips::-webkit-scrollbar { display: none; }
.qchips .chip { flex: none; min-height: 40px; }
.topbar .find-btn { margin-left: auto; margin-right: var(--sp-2); }
.topbar .find-btn + .gear { margin-left: 0; }
dialog.find { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: var(--sp-4); border: 0; border-radius: 0; background: var(--bg); color: var(--ink); display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: var(--sp-3); }
dialog.find:not([open]) { display: none; }
.find-top { display: flex; gap: var(--sp-2); align-items: center; padding-top: env(safe-area-inset-top, 0px); }
.find-top .grow { flex: 1; min-width: 0; }
.find-top input { font-size: 18px; min-height: 48px; }
.find-out { overflow-y: auto; padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); }
.find-list { display: grid; gap: var(--sp-2); }
.find-row { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: var(--sp-2); align-items: stretch; }
.find-main { display: grid; grid-template-columns: 48px 1fr; gap: var(--sp-3); align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-ctl); padding: var(--sp-2) var(--sp-3); cursor: pointer; color: inherit; font: inherit; min-height: 72px; }
.find-main img, .find-ph { width: 48px; height: 67px; object-fit: cover; border-radius: 4px; background: var(--sunken); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.find-text { display: grid; gap: 2px; min-width: 0; }
.find-text b { font: 600 16px/1.2 var(--display); }
.find-text small { color: var(--muted); font-size: 13.5px; }
.find-have { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-ctl); font: 800 22px var(--display); cursor: pointer; color: var(--accent); }
.find-have.on { background: var(--c-green); border-color: var(--c-green); color: #fff; }

/* ---------- Landscape: the binder as a book ---------- */
dialog.spread:focus { outline: none; }
dialog.spread { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: env(safe-area-inset-top, 0px) max(10px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px)); border: 0; border-radius: 0; background: color-mix(in srgb, var(--set, var(--c-blue)) 22%, var(--bg)); color: var(--ink); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 4px; overflow: hidden; }
dialog.spread:not([open]) { display: none; }
.sp-bar { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; }
.sp-bar .sp-foot { flex: 1; text-align: center; font-size: 13px; color: var(--muted); }
.sp-title { font: 700 17px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-prog { font: 600 15px var(--display); color: var(--muted); }
.sp-bar-r { margin-left: auto; display: flex; gap: var(--sp-2); }
.sp-bar .quick-toggle { width: 44px; }
.sp-book { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: stretch; gap: 4px; min-height: 0; }
.sp-arrow { border: 0; background: none; font: 800 36px/1 var(--display); color: var(--ink); cursor: pointer; border-radius: 12px; min-height: 44px; }
.sp-arrow:disabled { opacity: .22; cursor: default; }
.sp-arrow:not(:disabled):hover, .sp-arrow:not(:disabled):focus-visible { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.sp-leaves { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); min-height: 0; perspective: 1500px; filter: drop-shadow(0 8px 18px rgb(0 0 0 / .28)); }
.sp-leaves .leaf { min-height: 0; min-width: 0; display: grid; }
.spine { background: linear-gradient(90deg, rgb(0 0 0 / .28), rgb(0 0 0 / .08) 50%, rgb(0 0 0 / .28)); border-radius: 2px; }
.sp-leaves .binder-page { margin: 0; padding: 8px; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr); border-radius: 8px; background: color-mix(in srgb, var(--ink) 7%, var(--surface)); }
.sp-leaves .leaf.left .binder-page { border-radius: 10px 4px 4px 10px; }
.sp-leaves .leaf.right .binder-page { border-radius: 4px 10px 10px 4px; }
.sp-leaves .binder-page.blank { background: transparent; border-color: transparent; box-shadow: none; }
.sp-leaves .pockets { height: 100%; min-height: 0; grid-template-columns: repeat(3, auto); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 6px; justify-content: center; }
.sp-leaves .pocket { height: 100%; width: auto; aspect-ratio: 63 / 88; justify-self: center; min-height: 0; }
.sp-leaves .page-no { position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); background: var(--surface); padding: 0 6px; border-radius: 6px; }
.sp-leaves .pocket-price { font-size: 10px; padding: 1px 3px; }
.sp-leaves .pocket-fallback { padding: 4px 3px 18px; } .sp-leaves .pocket-fallback b { font-size: 11px; } .sp-leaves .pocket-fallback small { font-size: 10px; }
dialog.spread.marking .pocket { cursor: pointer; }
dialog.spread.marking .pocket.missing { outline: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
/* the page being turned: a leaf hinged on the spine, with the old page on its front and the new one on its back */
.turning { position: absolute; top: 0; bottom: 0; width: calc(50% - 6px); transform-style: preserve-3d; z-index: 3; pointer-events: none; }
.turning.right { left: calc(50% + 6px); transform-origin: left center; }
.turning.left { left: 0; transform-origin: right center; }
.turning .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: grid; }
.turning .face.back { transform: rotateY(180deg); }
.turning .face .binder-page { height: 100%; width: 100%; }
@media (prefers-reduced-motion: reduce) { .turning { display: none; } }

/* ---------- Landscape on a phone: use the width ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  .shell { max-width: none; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  ul.feed, .chase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); align-items: start; }
  ul.feed > li.empty, ul.feed > li.skel-card { grid-column: 1 / -1; }
  .case-stats { grid-template-columns: repeat(4, 1fr); }
  .medal-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .pgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  dialog:not(.spread):not(.find):not(.ceremony):not(.qr-show) { max-height: 96dvh; width: min(92vw, 760px); }
  dialog .sheet-card { grid-template-columns: 220px 1fr; align-items: center; gap: var(--sp-4); }
  dialog .sheet-card .tilt { width: 150px; }
  dialog .dialog-body { gap: var(--sp-3); }
  .cer-grid { width: min(100%, 420px); }
  .vh-tiles { grid-template-columns: repeat(4, 1fr); }
  .trade-bar { max-width: none; }
}

/* Text colors that stay readable on tinted and pale backgrounds */
.vh-change.up, .vh-delta.up, .vh-tiles .up > b { color: color-mix(in srgb, var(--good) 78%, var(--ink)); }
.vh-change.down, .vh-delta.down, .vh-tiles .down > b { color: color-mix(in srgb, var(--bad) 85%, var(--ink)); }
.sp-prog, .sp-bar .sp-foot { color: var(--ink); }

/* ---------- Favorites ---------- */
.favs { display: grid; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c-yellow); border-radius: var(--radius-row); }
.fav-row { display: flex; gap: var(--sp-3); overflow-x: auto; scroll-snap-type: x proximity; padding: 4px 2px var(--sp-2); scrollbar-width: thin; }
.fave-card { flex: none; width: 128px; scroll-snap-align: start; display: grid; gap: 3px; justify-items: center; align-content: start; text-align: center; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }
.fave-card img, .fave-card .pocket-fallback { width: 128px; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 8px; box-shadow: 0 6px 14px rgb(0 0 0 / .3); background: var(--sunken); transition: transform .15s; }
.fave-card:hover img, .fave-card:focus-visible img { transform: translateY(-4px) rotate(-1.5deg); }
.fave-card b { font: 700 14px/1.2 var(--display); margin-top: 4px; }
.fave-card small { color: var(--muted); font-size: 12.5px; line-height: 1.25; }
@media (min-width: 640px) { .fav-row { justify-content: center; } }
dialog.fav-large .dialog-body img { width: min(78vw, 340px); border-radius: 12px; box-shadow: 0 14px 34px rgb(0 0 0 / .4); margin: 0 auto; display: block; }
@media (orientation: landscape) and (max-height: 560px) { dialog.fav-large .dialog-body img { width: auto; max-height: 56dvh; } }
.fav-list { display: grid; gap: var(--sp-2); }
.fav-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--sp-3); align-items: center; border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: var(--sp-2) var(--sp-3); background: var(--surface); }
.fav-item img, .fav-ph { width: 44px; height: 61px; object-fit: cover; border-radius: 4px; background: var(--sunken); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.fav-text { display: grid; gap: 2px; min-width: 0; }
.fav-text b { font: 600 15px/1.2 var(--display); }
.fav-text small { color: var(--muted); font-size: 13px; }
.fav-ctl { display: flex; gap: 4px; }
.find-main.static { cursor: default; }
button[data-act="fav"][aria-pressed="true"] { background: color-mix(in srgb, var(--c-yellow) 22%, var(--surface)); border-color: var(--c-yellow); }

/* ---------- Trophies on the public page ---------- */
.tcase { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-4); padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--c-red); border-radius: var(--radius-row); }
.tcase .shelf-row { padding-bottom: var(--sp-1); }
.tcase .trophy { width: 104px; }
.tcase .trophy .medal { width: 84px; }
@media (min-width: 640px) { .tcase .shelf-row { justify-content: center; } }

/* ---------- Feed cards: the picture sits beside the headline, and everything below gets the full width ---------- */
ul.feed > li.listing { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: var(--sp-3); row-gap: var(--sp-2); align-items: start; }
ul.feed > li.listing > a:has(> .thumb) { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
ul.feed > li.listing > .listing-main { display: contents; }
ul.feed > li.listing > .listing-main > * { grid-column: 1 / -1; min-width: 0; }
ul.feed > li.listing > .listing-main > .listing-head,
ul.feed > li.listing > .listing-main > .price-line { grid-column: 2; }
@media (min-width: 560px) { ul.feed > li.listing { grid-template-columns: 112px minmax(0, 1fr); } }
/* Chips are as wide as their words and as tall as one line, however many sit in the row (a row of chips used to stretch each one to the tallest). */
.tags { align-items: flex-start; align-content: flex-start; }
.tag { width: fit-content; max-width: 100%; line-height: 1.5; }
.tag.fav, .tag.hot, .tag.warn { padding: 1px 8px; }
.why-btn { justify-self: start; }
