/* ============================================================
   SlabChart v3 — design system
   Light Pokémon world + two signature materials:
   (1) the SLAB   — acrylic case, holo sheen, rarity aura
   (2) the BOARD  — the hardware's phosphor display, reused in the UI
   ============================================================ */
:root {
  --bg: #F6F5F1;
  --bg-soft: #EDEBE4;
  --bg-sink: #E4E1D8;
  --card: #FFFFFF;
  --ink: #17181A;
  --ink-2: #57565C;
  --ink-3: #928F8A;
  --line: #E6E2DA;
  --line-2: #D8D3C8;

  --red: #E3350D;
  --red-deep: #BE2A08;
  --red-soft: #FDEAE4;
  --yellow: #FFCB05;
  --yellow-deep: #C99700;
  --yellow-soft: #FFF3C4;
  --blue: #2A75BB;
  --blue-soft: #E4EEF8;
  --green: #16A05C;
  --green-soft: #E1F4EA;
  --loss: #D53F2F;
  --loss-soft: #FBE9E6;
  --violet: #7C4DD6;

  /* the hardware display */
  --lcd-bg: #06110C;
  --lcd-ink: #3BE58F;
  --lcd-dim: #1C6B45;
  --lcd-loss: #FF7A63;
  --lcd-b: 1; /* brightness 0..1 */

  --radius: 20px;
  --radius-sm: 13px;
  --radius-xs: 9px;
  --shadow-1: 0 2px 6px rgba(23, 24, 26, .05), 0 10px 28px rgba(23, 24, 26, .07);
  --shadow-2: 0 4px 10px rgba(23, 24, 26, .07), 0 18px 44px rgba(23, 24, 26, .13);
  --shadow-slab: 0 3px 8px rgba(0, 0, 0, .18), 0 14px 34px rgba(0, 0, 0, .28);

  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .25, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior-y: none;
  font-feature-settings: "ss01";
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
input, select { font: inherit; color: inherit; }
img { display: block; }

/* browser surfaces theming */
::selection { background: var(--yellow); color: #3A2A00; }
:focus-visible { outline: 2.5px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
*::-webkit-scrollbar-track { background: transparent; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; overflow-x: clip; }
main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.screen { display: none; padding: 0 17px; }
.screen.active { display: block; animation: screenIn .34s var(--ease-out); }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- header / titles ---------------- */
.apphead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 14px; padding-top: calc(16px + env(safe-area-inset-top));
}
.apphead .hello { font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.apphead .hname { font-size: 25px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.avatar {
  width: 43px; height: 43px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 32% 28%, #FFEE9B, #FFCB05 45%, #E39C00 100%);
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; color: #6B4E00;
  border: 2.5px solid #fff; box-shadow: var(--shadow-1);
}
.screentitle {
  font-size: 28px; font-weight: 800; letter-spacing: -.035em;
  padding: 18px 0 3px; padding-top: calc(20px + env(safe-area-inset-top));
}
.screensub { color: var(--ink-2); font-size: 13.5px; margin-bottom: 16px; line-height: 1.45; }

/* ---------------- surfaces ---------------- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 17px;
  margin-bottom: 13px; position: relative;
}
.card > h3 {
  font-size: 14.5px; font-weight: 700; letter-spacing: -.01em;
  margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card > h3 .more { font-size: 12.5px; color: var(--red); font-weight: 700; flex: none; }
.card > h3 .hint { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; font-weight: 700; font-size: 14.5px; padding: 14px 20px;
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn:active { transform: scale(.965); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 3px 8px rgba(227, 53, 13, .2), 0 12px 26px rgba(227, 53, 13, .28); }
.btn-red:active { background: var(--red-deep); }
.btn-ghost { background: var(--bg-soft); color: var(--ink); }
.btn-ghost:active { background: var(--bg-sink); }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .16), 0 12px 26px rgba(0, 0, 0, .18); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 15px; font-size: 13px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.iconbtn {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: grid; place-items: center; background: var(--bg-soft);
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn:active { transform: scale(.9); }
.iconbtn.on { background: var(--red); color: #fff; }

/* ============================================================
   THE SLAB — graded case with rarity-aware light
   sizing driven by --sw (slab width)
   ============================================================ */
.slab {
  --sw: 108px;
  --glow: #C9BFAE;
  width: var(--sw);
  aspect-ratio: 62 / 88;
  position: relative;
  border-radius: calc(var(--sw) * .055);
  background: linear-gradient(158deg, #FBFAF7 0%, #E9E6DE 46%, #FDFCFA 100%);
  padding: calc(var(--sw) * .038);
  box-shadow: var(--shadow-slab), inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -1px 2px rgba(0, 0, 0, .12);
  isolation: isolate;
  flex: none;
}
.slab-inner {
  position: absolute; inset: calc(var(--sw) * .038);
  border-radius: calc(var(--sw) * .03);
  overflow: hidden;
  background: #DED9CF;
  display: grid; grid-template-rows: calc(var(--sw) * .155) 1fr;
}
/* PSA label strip */
.slab-label {
  background: linear-gradient(180deg, #FFFFFF, #F1EEE7);
  border-bottom: 1px solid rgba(0, 0, 0, .12);
  display: flex; align-items: center; gap: calc(var(--sw) * .025);
  padding: 0 calc(var(--sw) * .04);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: calc(var(--sw) * .058); font-weight: 700; color: #2B2B2B;
  letter-spacing: -.01em; overflow: hidden;
}
.slab-label .psa {
  background: #C8102E; color: #fff; font-weight: 700;
  padding: 0 calc(var(--sw) * .028); border-radius: calc(var(--sw) * .014);
  font-size: calc(var(--sw) * .055); letter-spacing: .04em; flex: none;
}
.slab-label .sl-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; color: #4A4A4A; }
.slab-label .sl-grade { flex: none; font-weight: 700; letter-spacing: -.02em; }
.slab.raw .slab-label .psa { background: #6C6A66; }
/* the low-res thumb sits behind the hi-res art so a slow load never shows an empty case */
.slab-art { position: relative; overflow: hidden; background: #CFC9BE center/cover no-repeat; }
.slab-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slab-art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #A8A19A; }
.slab-art .ph svg { width: 34%; height: 34%; opacity: .55; }

/* acrylic top light + edge */
.slab::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 4;
  background:
    linear-gradient(158deg, rgba(255, 255, 255, .62) 0%, rgba(255, 255, 255, 0) 26%),
    linear-gradient(20deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, 0) 34%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}
/* specular sweep — plays on mount and on tap */
.slab::after {
  content: ""; position: absolute; inset: -12%; z-index: 5; pointer-events: none;
  background: linear-gradient(102deg,
    transparent 34%, rgba(255, 255, 255, .06) 42%, rgba(255, 255, 255, .58) 49%,
    rgba(255, 255, 255, .1) 55%, transparent 64%);
  background-size: 260% 100%; background-repeat: no-repeat;
  background-position: 190% 0; opacity: 0;
  mix-blend-mode: screen;
}
.slab.sweep::after { animation: sweep 1.15s var(--ease-out); }
@keyframes sweep {
  0% { background-position: 190% 0; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { background-position: -110% 0; opacity: 0; }
}

/* rainbow holo for chase + grail: crisp iridescent lines inside a narrow band
   that travels over the case. No blur and no full-surface tint — at any moment
   most of the artwork is untouched, exactly like real foil catching the light. */
.slab-holo {
  position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
  overflow: hidden; border-radius: inherit;
}
.slab[data-tier="chase"] .slab-holo, .slab[data-tier="grail"] .slab-holo { opacity: 1; }
/* the foil lives INSIDE a travelling band, never on the whole surface —
   at rest the artwork is untouched, the rainbow only appears where light hits */
.slab-holo::before, .slab-holo::after {
  content: ""; position: absolute; top: -24%; bottom: -24%; left: -44%; width: 40%;
  background-image:
    repeating-linear-gradient(116deg,
      rgba(255, 86, 140, .42) 0 1px, rgba(255, 208, 96, .36) 1px 2px,
      rgba(96, 240, 188, .36) 2px 3px, rgba(96, 176, 255, .42) 3px 4px,
      rgba(196, 130, 255, .36) 4px 5px),
    linear-gradient(100deg, transparent 8%, rgba(255, 255, 255, .5) 50%, transparent 92%);
  mix-blend-mode: screen; opacity: .8;
  -webkit-mask-image: linear-gradient(100deg, transparent 3%, #000 42%, #000 58%, transparent 97%);
  mask-image: linear-gradient(100deg, transparent 3%, #000 42%, #000 58%, transparent 97%);
  animation: holoBand 6.4s cubic-bezier(.42, 0, .58, 1) infinite;
}
/* the second, wider band comes later and from a different angle */
.slab-holo::before {
  width: 58%; left: -62%; opacity: .5;
  animation-duration: 11s; animation-delay: 3.2s;
}
.slab[data-tier="grail"] .slab-holo::after { animation-duration: 5.2s; }
.slab[data-tier="grail"] .slab-holo::before { animation-duration: 9s; }
/* thumbnails: keep the artwork readable, the foil is invisible at that size anyway */
.slab.mini .slab-holo, .slab.mini .slab-glit { display: none; }
@keyframes holoBand {
  0% { transform: translateX(0) rotate(7deg); }
  58%, 100% { transform: translateX(300%) rotate(7deg); }
}
/* glitter — grails and chases earn it */
.slab-glit { position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: 0; overflow: hidden; border-radius: inherit; }
.slab[data-tier="grail"] .slab-glit { opacity: 1; }
.slab[data-tier="chase"] .slab-glit { opacity: .78; }
.slab-glit::before, .slab-glit::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: screen;
  background-repeat: no-repeat;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .95) 0, transparent 55%),
    radial-gradient(circle, rgba(255, 240, 190, .9) 0, transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, .8) 0, transparent 55%),
    radial-gradient(circle, rgba(200, 240, 255, .85) 0, transparent 55%),
    radial-gradient(circle, rgba(255, 255, 255, .7) 0, transparent 55%);
  background-size: 3.5px 3.5px, 3px 3px, 2.5px 2.5px, 4px 4px, 2px 2px;
  background-position: 22% 18%, 68% 32%, 44% 61%, 80% 74%, 15% 82%;
  animation: twinkle 2.6s ease-in-out infinite;
}
.slab-glit::after {
  background-position: 55% 12%, 30% 44%, 86% 52%, 12% 66%, 62% 88%;
  animation-delay: 1.3s; animation-duration: 3.4s;
}
@keyframes twinkle {
  0%, 100% { opacity: .18; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}
/* glare — the specular highlight that follows the finger */
.slab-glare {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  overflow: hidden; border-radius: inherit;
  opacity: 0; transition: opacity .28s var(--ease);
}
/* pure white light, no colour cast — the colour belongs to the holo bands */
.slab-glare::before {
  content: ""; position: absolute; inset: -20%;
  background:
    radial-gradient(34% 26% at var(--gx, 50%) var(--gy, 40%), rgba(255, 255, 255, .82) 0%, rgba(255, 255, 255, .2) 42%, transparent 70%),
    radial-gradient(74% 58% at var(--gx, 50%) var(--gy, 40%), rgba(255, 255, 255, .3) 0%, transparent 72%);
  mix-blend-mode: screen; opacity: .95;
}
.slab.tilting .slab-glare { opacity: 1; }
.slab[data-tier="plain"].tilting .slab-glare { opacity: .55; }

/* tiltable slabs follow the finger in 3D */
.slab.tiltable {
  transform-style: preserve-3d; will-change: transform;
  transition: transform .5s var(--ease-out);
}
.slab.tilting { transition: transform .06s linear; }

/* light pool under the case on dark stages — neutral white, never a colour glow */
.slab-aura {
  position: absolute; inset: -16%; z-index: -1; pointer-events: none;
  background: radial-gradient(circle at 50% 56%, rgba(255, 255, 255, .5) 0%, transparent 66%);
  opacity: 0; filter: blur(18px);
  transition: opacity .5s var(--ease);
}
.on-dark .slab .slab-aura { opacity: .16; }
.on-dark .slab[data-tier="grail"] .slab-aura { opacity: .24; }

@media (prefers-reduced-motion: reduce) {
  .slab-holo::before, .slab-holo::after, .slab-glit::before, .slab-glit::after { animation: none; }
  .slab.sweep::after { animation: none; }
  .slab.tiltable { transition: none; }
}

/* ============================================================
   THE BOARD — the hardware display, reused across the UI
   ============================================================ */
.board {
  background: var(--lcd-bg);
  border-radius: var(--radius-xs);
  padding: 8px 10px 9px;
  position: relative; overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(120, 255, 190, .07);
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
/* dot matrix + glass curvature */
.board::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .045) .5px, transparent .5px);
  background-size: 3px 3px;
}
.board::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(158deg, rgba(190, 255, 225, .11) 0 22%, transparent 46%);
}
.board .b-inner { position: relative; z-index: 1; opacity: calc(.22 + .78 * var(--lcd-b)); transition: opacity .3s var(--ease); }
.board .b-name {
  color: var(--lcd-dim); font-size: 8.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.board .b-price {
  color: var(--lcd-ink); font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  margin-top: 2px; text-shadow: 0 0 10px rgba(59, 229, 143, .55);
  white-space: nowrap; overflow: hidden;
}
.board .b-delta { color: var(--lcd-ink); font-size: 9px; font-weight: 600; margin-top: 2px; opacity: .82; }
.board.loss .b-price { color: var(--lcd-loss); text-shadow: 0 0 10px rgba(255, 122, 99, .5); }
.board.loss .b-delta { color: var(--lcd-loss); }
.board .b-idle { color: #2E5C48; font-size: 9.5px; letter-spacing: .16em; text-align: center; padding: 7px 0; text-transform: uppercase; }
.board.asleep .b-inner { opacity: .1; }
.board .b-flash { animation: bflash .55s var(--ease-out); }
@keyframes bflash { 0% { opacity: .2; filter: brightness(2.2); } 100% { opacity: 1; filter: none; } }
.board .b-scan {
  position: absolute; left: 0; right: 0; height: 40%; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(59, 229, 143, .07), transparent);
  animation: bscan 5.5s linear infinite;
}
@keyframes bscan { from { top: -40%; } to { top: 100%; } }

/* board size variants */
.board.b-lg { padding: 12px 15px 26px; border-radius: 12px; }
.board.b-lg .b-name { font-size: 10px; }
.board.b-lg .b-price { font-size: 26px; }
.board.b-lg .b-delta { font-size: 11px; }
.board.b-xs { padding: 6px 8px 7px; }
.board.b-xs .b-name { font-size: 7.5px; letter-spacing: .1em; }
.board.b-xs .b-price { font-size: 13.5px; }
.board.b-xs .b-delta { font-size: 8px; }

/* ---------------- scan hero ---------------- */
.scanhero {
  border-radius: 22px; padding: 20px; margin-bottom: 13px; color: #fff;
  background: linear-gradient(142deg, #F04A19 0%, #E3350D 52%, #B62306 100%);
  box-shadow: 0 4px 12px rgba(227, 53, 13, .22), 0 18px 40px rgba(227, 53, 13, .3);
  position: relative; overflow: hidden;
}
.scanhero::before {
  content: ""; position: absolute; right: -54px; top: -58px; width: 176px; height: 176px;
  border-radius: 50%; border: 25px solid rgba(255, 255, 255, .13);
}
.scanhero::after {
  content: ""; position: absolute; left: -30px; bottom: -70px; width: 130px; height: 130px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 203, 5, .3), transparent 68%);
}
.scanhero .sh-title {
  font-size: 21px; font-weight: 800; letter-spacing: -.03em; line-height: 1.18;
  max-width: 232px; position: relative; z-index: 1; margin-bottom: 13px;
}
.scanhero .btn { background: #fff; color: var(--red); box-shadow: 0 6px 16px rgba(90, 12, 0, .28); position: relative; z-index: 1; }

/* ---------------- value card ---------------- */
.valuecard { padding-bottom: 6px; overflow: hidden; }
.vc-label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; }
.vc-value { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 31px; font-weight: 700; letter-spacing: -.04em; margin: 3px 0 4px; }
.vc-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pill {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
}
.pill.up { color: #0E7C45; background: var(--green-soft); }
.pill.down { color: #B3271A; background: var(--loss-soft); }
.pill.neutral { color: var(--ink-2); background: var(--bg-soft); }
.up { color: var(--green); }
.down { color: var(--loss); }
svg.spark { display: block; width: 100%; height: auto; }
.valuecard svg.spark { margin: 8px -17px -6px; width: calc(100% + 34px); }

.statpills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 13px; }
.statpill { background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-1); padding: 12px 9px; }
.statpill .sp-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; letter-spacing: -.03em; }
.statpill .sp-lbl { font-size: 11px; color: var(--ink-2); font-weight: 600; margin-top: 1px; }
.statpill.p-red .sp-num { color: var(--red); }
.statpill.p-blue .sp-num { color: var(--blue); }
.statpill.p-green .sp-num { color: var(--green); }
.statpill.p-loss .sp-num { color: var(--loss); }

/* ---------------- list rows ---------------- */
.rowitem {
  display: flex; align-items: center; gap: 11px; padding: 10px 0;
  border-bottom: 1px solid var(--line); width: 100%;
  transition: opacity .15s var(--ease);
}
.rowitem:last-child { border-bottom: 0; }
.rowitem:active { opacity: .55; }
.rowitem .thumb {
  width: 42px; aspect-ratio: 62/88; border-radius: 6px; object-fit: cover;
  background: var(--bg-soft); box-shadow: 0 2px 7px rgba(0, 0, 0, .16); flex: none;
}
.rowitem .ri-main { flex: 1; min-width: 0; }
.rowitem .ri-name { font-weight: 700; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowitem .ri-sub { font-size: 12px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rowitem .ri-end { text-align: right; flex: none; }
.rowitem .ri-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; letter-spacing: -.02em; }
.rowitem .ri-trend { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: 600; }
.rowitem .rankno { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 700; width: 16px; flex: none; }

/* ---------------- grade badge ---------------- */
.gradebadge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 10.5px; font-weight: 700; letter-spacing: .02em;
  padding: 3px 7px; border-radius: 6px; background: var(--ink); color: var(--yellow);
}
.gradebadge.raw { background: var(--bg-sink); color: var(--ink-2); }
.raritytag {
  display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; letter-spacing: .02em;
  background: var(--bg-soft); color: var(--ink-2);
}
.raritytag[data-tier="grail"] { background: linear-gradient(100deg, #FFE8A3, #FFD1E8 45%, #C7E5FF); color: #6A4A00; }
.raritytag[data-tier="chase"] { background: var(--yellow-soft); color: #7A5C00; }
.raritytag[data-tier="holo"] { background: var(--blue-soft); color: #1B527F; }

/* ---------------- segments / chips ---------------- */
.segments { display: flex; gap: 5px; background: var(--bg-soft); border-radius: 999px; padding: 4px; margin: 13px 0; }
.segments button {
  flex: 1; padding: 9px 4px; border-radius: 999px; text-align: center;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.segments button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .09); }

.chiprow { display: flex; gap: 7px; overflow-x: auto; padding: 2px 17px 12px; margin: 0 -17px; scrollbar-width: none; }
.chiprow::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--card); color: var(--ink-2); box-shadow: var(--shadow-1); white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease), transform .16s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip[aria-selected="true"] { background: var(--ink); color: #fff; }

.sortrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.sortrow .count { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.sortbtn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  background: var(--card); border-radius: 999px; padding: 8px 13px; box-shadow: var(--shadow-1);
}
.sortbtn svg { width: 13px; height: 13px; }

/* ============================================================
   COLLECTION — slab + board = a shelf of tiny scoreboards
   ============================================================ */
.cardgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding-bottom: 6px; }
.shelfcard {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 11px 11px 12px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  position: relative; overflow: hidden;
}
.shelfcard:active { transform: scale(.975); box-shadow: var(--shadow-2); }
.shelfcard .sc-stage {
  position: relative; display: grid; place-items: center;
  padding: 12px 0 14px; margin-bottom: 10px;
  border-radius: 14px;
  background: radial-gradient(120% 78% at 50% 8%, #2F3634 0%, #191D1C 58%, #0E1110 100%);
  overflow: hidden;
}
.shelfcard .sc-stage .slab { --sw: 84px; }
.shelfcard .sc-floor {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .06));
}
.shelfcard .sc-badges { position: absolute; top: 7px; left: 7px; right: 7px; display: flex; justify-content: space-between; gap: 6px; z-index: 6; }
.shelfcard .sc-onair {
  width: 21px; height: 21px; border-radius: 7px; background: var(--green); color: #fff;
  display: grid; place-items: center; box-shadow: 0 0 0 3px rgba(22, 160, 92, .25);
}
.shelfcard .sc-onair svg { width: 12px; height: 12px; }
/* the plate — an engraved museum label under every slab */
.shelfcard .sc-plate {
  display: block; margin-top: 9px; padding: 8px 9px 7px;
  border-radius: 12px;
  background: linear-gradient(180deg, #FCFBF8, #F1EFE8);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 #fff;
}
.shelfcard .sc-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.shelfcard .sc-tierdot {
  width: 6px; height: 6px; border-radius: 50%; flex: none;
  background: var(--glow, var(--ink-3)); box-shadow: 0 0 0 2px rgba(0, 0, 0, .05);
}
.shelfcard .sc-name {
  display: block; flex: 1; min-width: 0;
  font-weight: 800; font-size: 13px; letter-spacing: -.03em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelfcard .sc-set {
  display: block; margin-top: 3px;
  font-family: var(--mono); font-size: 9px; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelfcard .sc-foot {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 6px; min-width: 0;
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line);
}
.shelfcard .sc-val {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 12.5px; font-weight: 700; letter-spacing: -.03em;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shelfcard .sc-pl {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 9.5px; font-weight: 700; flex: none;
  padding: 2px 5px; border-radius: 6px;
}
.shelfcard .sc-pl.up { color: var(--green); background: var(--green-soft); }
.shelfcard .sc-pl.down { color: var(--loss); background: var(--loss-soft); }

.emptybox { text-align: center; padding: 40px 22px; color: var(--ink-2); }
.emptybox .eb-ball { width: 58px; height: 58px; margin: 0 auto 14px; opacity: .42; }
.emptybox h4 { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 5px; letter-spacing: -.02em; }
.emptybox p { font-size: 13.5px; margin-bottom: 16px; line-height: 1.5; }

/* ============================================================
   MARKET
   ============================================================ */
.searchbar {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow-1);
  padding: 3px 6px 3px 16px; margin-bottom: 12px;
}
.searchbar svg { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.searchbar input { flex: 1; border: 0; outline: 0; background: none; font-size: 15px; padding: 12px 0; min-width: 0; }
.searchbar input::placeholder { color: var(--ink-3); }
.searchbar .clr { flex: none; }

.mktrow {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  transition: opacity .15s var(--ease);
}
.mktrow:last-child { border-bottom: 0; }
.mktrow:active { opacity: .55; }
.mktrow .mr-slab { --sw: 40px; }
.mktrow .mr-main { flex: 1; min-width: 0; }
.mktrow .mr-name { font-weight: 700; font-size: 13.5px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mktrow .mr-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mktrow .mr-end { flex: none; text-align: right; }
.mktrow .mr-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; letter-spacing: -.02em; }
.mktrow .mr-trend { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 600; margin-top: 1px; }
.mktrow .mr-own { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: var(--green); margin-top: 2px; }
.mktrow .mr-own svg { width: 10px; height: 10px; }
.loadmore { width: 100%; text-align: center; padding: 14px; font-size: 13px; font-weight: 700; color: var(--red); }

.mkthero {
  border-radius: 22px; padding: 17px; margin-bottom: 13px;
  background: radial-gradient(130% 100% at 12% 0%, #2A3230 0%, #171B1A 55%, #0D100F 100%);
  color: #fff; position: relative; overflow: hidden;
}
.mkthero .mh-lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7E8A85; }
.mkthero .mh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 11px; }
.mkthero .mh-k { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 700; letter-spacing: -.03em; }
.mkthero .mh-s { font-size: 10.5px; color: #8D9792; font-weight: 600; margin-top: 2px; }
.mkthero .mh-k.up { color: #46E293; }
.mkthero .mh-k.down { color: #FF8873; }

/* market analytics */
.rangetoggle { display: flex; gap: 5px; }
.rangetoggle button {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; color: var(--ink-2); background: var(--bg-soft);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.rangetoggle button[aria-selected="true"] { background: var(--ink); color: #fff; }
.chartbox svg { display: block; width: 100%; height: auto; }
.chartmeta { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; flex-wrap: wrap; }
.chartmeta .cm-val { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 25px; font-weight: 700; letter-spacing: -.04em; }

.distbars { display: grid; gap: 11px; }
.distbar .db-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; }
.distbar .db-top span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.distbar .db-val { font-family: var(--mono); color: var(--ink-2); font-weight: 600; font-size: 11.5px; flex: none; }
.distbar .db-track { height: 9px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.distbar .db-fill { height: 100%; border-radius: 999px; transform-origin: left; animation: growx .7s var(--ease-out); }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.donutwrap { display: flex; align-items: center; gap: 17px; }
.donut { width: 104px; height: 104px; border-radius: 50%; position: relative; flex: none; }
.donut::after { content: ""; position: absolute; inset: 21px; background: var(--card); border-radius: 50%; }
.donutlegend { display: grid; gap: 8px; flex: 1; min-width: 0; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.dl-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dl-val { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }

/* ============================================================
   CARD PAGE
   ============================================================ */
.cp-stage {
  position: relative; padding: 18px 0 34px;
  display: grid; place-items: center;
  background: radial-gradient(105% 72% at 50% 4%, #333B39 0%, #1A1E1D 52%, #0C0F0E 100%);
  overflow: hidden;
}
.cp-stage .slab { --sw: 186px; z-index: 2; transition: transform .5s var(--ease-out); }
/* the reflection hangs out of the flow, the stage padding decides how much shows */
.cp-slabwrap { position: relative; }
.cp-stage .cp-reflect {
  position: absolute; top: 100%; left: 0;
  width: 186px; margin-top: -4px; opacity: .22;
  transform: scaleY(-1); filter: blur(1.5px);
  /* the mask lives in pre-transform space, so it fades from the far end */
  -webkit-mask-image: linear-gradient(transparent 46%, #000);
  mask-image: linear-gradient(transparent 46%, #000);
  pointer-events: none;
}
.cp-stage .cp-reflect img { width: 100%; border-radius: 8px; }
.cp-stage .cp-zoom {
  position: absolute; right: 14px; top: 14px; z-index: 4;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.cp-stage .cp-zoom svg { width: 16px; height: 16px; }
.cp-head { padding: 16px 17px 0; }
.cp-title { font-size: 24px; font-weight: 800; letter-spacing: -.035em; line-height: 1.14; }
.cp-sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.cp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.cp-body { padding: 0 17px; }
.cp-pricehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 15px 0 0; }
.cp-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 30px; font-weight: 700; letter-spacing: -.04em; }
.cp-pricelbl { font-size: 11.5px; color: var(--ink-2); font-weight: 600; }

.gradepills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 13px 0; }
.gradepill {
  border-radius: var(--radius-sm); padding: 9px 4px; text-align: center;
  background: var(--bg-soft); border: 2px solid transparent;
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease);
}
.gradepill:active { transform: scale(.96); }
.gradepill[aria-selected="true"] { background: #fff; border-color: var(--red); box-shadow: var(--shadow-1); }
.gradepill .gp-g { font-weight: 800; font-size: 12.5px; }
.gradepill .gp-p { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 10.5px; color: var(--ink-2); margin-top: 2px; }

.kvrow { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kvrow:last-child { border-bottom: 0; }
.kvrow .k { color: var(--ink-2); font-weight: 600; flex: none; }
.kvrow .v { font-weight: 700; text-align: right; min-width: 0; }
.kvrow .v.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }

.salerow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.salerow:last-child { border-bottom: 0; }
.salerow .sr-mkt { font-size: 13px; font-weight: 700; }
.salerow .sr-when { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.salerow .sr-price { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13.5px; font-weight: 700; }

.buylist { display: grid; gap: 8px; }
.buyrow {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px;
  transition: transform .16s var(--ease), background .16s var(--ease);
  color: inherit; text-decoration: none;
}
.buyrow:active { transform: scale(.98); background: var(--bg-sink); }
.buyrow .by-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none; background: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-1);
}
.buyrow .by-name { font-weight: 700; font-size: 13.5px; }
.buyrow .by-sub { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.buyrow .by-go { margin-left: auto; color: var(--ink-3); flex: none; }
.buyrow .by-go svg { width: 16px; height: 16px; }
.spreadrow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; text-align: center; }
.spreadrow > div { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 11px 6px; }
.spreadrow .sp-k { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14.5px; font-weight: 700; letter-spacing: -.03em; }
.spreadrow .sp-l { font-size: 10.5px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }

.actionbar {
  position: sticky; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  padding: 12px 17px calc(14px + env(safe-area-inset-bottom));
  margin: 8px -17px 0;
  background: linear-gradient(180deg, rgba(246, 245, 241, 0), var(--bg) 34%);
}
.actionbar.one { grid-template-columns: 1fr; }
.actionbar.three { grid-template-columns: 1fr 1fr auto; }
/* a flush sheet has no side padding left to cancel out */
.sheet.flush .actionbar { margin-left: 0; margin-right: 0; }

/* fullscreen card viewer */
.viewer {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: rgba(8, 10, 9, .93); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .3s var(--ease); padding: 30px;
}
.viewer.show { opacity: 1; }
.viewer .slab { --sw: min(84vw, 380px); transform: scale(.9); transition: transform .45s var(--ease-out); }
.viewer.show .slab { transform: scale(1); }
.viewer .vw-hint { position: absolute; bottom: calc(26px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #7C8480; font-size: 12px; font-weight: 600; }
.viewer .vw-close { position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; }

/* ============================================================
   DEVICES — the product, rendered properly
   ============================================================ */
.devcard { padding: 0; overflow: hidden; }
.devstage {
  position: relative; overflow: hidden;
  padding: 18px 18px 14px;
  display: grid; place-items: center;
  background: radial-gradient(110% 80% at 50% 0%, #343C3A 0%, #1B201F 48%, #0B0E0D 100%);
}
.devstage .slab { --sw: 104px; z-index: 3; }
.devstage.big .slab { --sw: 112px; }
/* neutral spotlight over the case — white light, no coloured haze */
.devstage .amb {
  position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 70%; height: 64%; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, .42) 0%, transparent 68%);
  opacity: .34; filter: blur(24px);
}
/* the stand */
.stand { position: relative; z-index: 3; width: 192px; margin-top: -11px; }
.devstage.big .stand { width: 208px; }
.stand-body {
  border-radius: 14px; padding: 10px 11px 12px;
  background: linear-gradient(178deg, #4A5250 0%, #333A38 18%, #232827 62%, #171B1A 100%);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5), 0 20px 40px rgba(0, 0, 0, .55),
              inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -2px 4px rgba(0, 0, 0, .5);
  position: relative;
}
/* slot the slab sits in */
.stand-body::before {
  content: ""; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  width: 58%; height: 8px; border-radius: 4px;
  background: linear-gradient(180deg, #0A0C0B, #1E2322);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .9), 0 1px 0 rgba(255, 255, 255, .1);
}
.stand-foot {
  height: 7px; margin: 0 16px; border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #1B1F1E, #0D100F);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .6);
}
.stand .usb {
  position: absolute; right: 8px; bottom: 4px; width: 12px; height: 3px; border-radius: 2px;
  background: #0B0D0C; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .9);
}
/* mirror on the plinth */
/* the reflection fades out long before it ends, so it must not claim that space */
.devstage .mirror {
  width: 104px; margin-top: 5px; margin-bottom: -92px; z-index: 2; opacity: .18;
  transform: scaleY(-1); filter: blur(2px);
  /* the mask lives in pre-transform space, so it fades from the far end */
  -webkit-mask-image: linear-gradient(transparent 42%, #000);
  mask-image: linear-gradient(transparent 42%, #000);
  pointer-events: none;
}
.devstage.big .mirror { width: 112px; }
.devstage .mirror img { width: 100%; border-radius: 7px; }

.devmeta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.devmeta .dm-end { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.iconbtn.sm { width: 30px; height: 30px; }
.iconbtn.sm svg { width: 15px; height: 15px; }
.dc-settings { margin-top: 4px; border-top: 1px solid var(--line); }
.devmeta .dm-name { font-weight: 800; font-size: 16.5px; letter-spacing: -.025em; }
.devmeta .dm-serial { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-top: 2px; letter-spacing: .02em; }
.devstatus { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--green); flex: none; }
.devstatus .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); animation: pulseDot 2.4s ease-in-out infinite; }
.devstatus.off { color: var(--ink-3); }
.devstatus.off .dot { background: var(--ink-3); box-shadow: 0 0 0 3px var(--bg-soft); animation: none; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 3px var(--green-soft); } 50% { box-shadow: 0 0 0 6px rgba(22, 160, 92, .12); } }
.dc-body { padding: 16px 17px 17px; }
.devstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 4px; }
.devstats div { background: var(--bg-soft); border-radius: var(--radius-xs); padding: 9px 8px; }
.devstats .ds-k { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 700; }
.devstats .ds-l { font-size: 10px; color: var(--ink-2); font-weight: 600; margin-top: 1px; }

.ctrlrow { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ctrlrow:last-of-type { border-bottom: 0; }
.ctrlrow .cr-lbl { font-size: 13.5px; font-weight: 600; }
.ctrlrow .cr-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 132px; height: 5px; border-radius: 999px; background: var(--bg-sink); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 21px; height: 21px; border-radius: 50%;
  background: var(--red); border: 3px solid #fff; box-shadow: 0 2px 7px rgba(0, 0, 0, .28); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 21px; height: 21px; border-radius: 50%; background: var(--red); border: 3px solid #fff;
}
.switch { position: relative; width: 48px; height: 29px; border-radius: 999px; background: var(--bg-sink); transition: background .22s var(--ease); flex: none; }
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .22); transition: transform .24s var(--ease);
}
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

/* display view picker inside device settings */
.ctrlrow.stack { display: block; }
.ctrlrow.stack .cr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.segments.mini { margin: 0; padding: 3px; flex: none; }
.segments.mini button { flex: none; padding: 7px 11px; font-size: 11.5px; }
.screenchips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.chip.sm { padding: 7px 12px; font-size: 12px; box-shadow: none; background: var(--bg-soft); }
.chip.sm[aria-selected="true"] { background: var(--ink); color: #fff; }
.cr-takt { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; }
.cr-takt span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.cr-takt b { color: var(--ink); font-variant-numeric: tabular-nums; }
.devrowbtns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
/* the empty acrylic slot when no slab is inserted */
.emptyslot {
  z-index: 3; width: 104px; aspect-ratio: 62 / 88; border-radius: 8px;
  border: 2px dashed rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04);
  display: grid; place-items: center; align-content: center; gap: 7px;
  color: rgba(255, 255, 255, .42);
}
.emptyslot svg { width: 24px; height: 24px; }
.emptyslot span { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.devstage.big .emptyslot { width: 112px; }

/* ============================================================
   PAIRING RITUAL
   ============================================================ */
.radar {
  width: 184px; height: 184px; margin: 24px auto 16px;
  border-radius: 50%; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle, var(--red-soft) 0%, transparent 70%);
}
.radar .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); opacity: 0; animation: ping 2.2s var(--ease-out) infinite; }
.radar .ring:nth-child(2) { animation-delay: .73s; }
.radar .ring:nth-child(3) { animation-delay: 1.46s; }
@keyframes ping { 0% { transform: scale(.32); opacity: .75; } 100% { transform: scale(1.06); opacity: 0; } }
.radar .core {
  width: 70px; height: 70px; border-radius: 50%; background: var(--red);
  display: grid; place-items: center; box-shadow: 0 8px 24px rgba(227, 53, 13, .42);
}
.radar .core svg { width: 32px; height: 32px; color: #fff; }

.foundlist { display: grid; gap: 9px; }
.founditem {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border-radius: var(--radius-sm); padding: 13px;
  box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease); animation: screenIn .4s var(--ease-out) backwards;
}
.founditem:active { transform: scale(.98); }
.founditem .fi-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--bg-soft); display: grid; place-items: center; flex: none; }
.founditem .fi-icon svg { width: 21px; height: 21px; }
.founditem .fi-name { font-weight: 700; font-size: 14px; }
.founditem .fi-sub { font-size: 11.5px; color: var(--ink-2); font-family: var(--mono); margin-top: 1px; }
.founditem .fi-sig { margin-left: auto; display: flex; gap: 2.5px; align-items: flex-end; flex: none; }
.founditem .fi-sig i { width: 4px; border-radius: 2px; background: var(--line-2); }
.founditem .fi-sig i.on { background: var(--green); }
.founditem .fi-sig i:nth-child(1) { height: 6px; }
.founditem .fi-sig i:nth-child(2) { height: 10px; }
.founditem .fi-sig i:nth-child(3) { height: 14px; }

.connectsteps { display: grid; gap: 13px; padding: 6px 0 2px; }
.cstep { display: flex; align-items: center; gap: 12px; }
.cstep .cs-ic {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--bg-soft); color: var(--ink-3); font-family: var(--mono); font-size: 12px; font-weight: 700;
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.cstep .cs-ic svg { width: 15px; height: 15px; }
.cstep.active .cs-ic { background: var(--yellow); color: #6B4E00; transform: scale(1.1); }
.cstep.done .cs-ic { background: var(--green); color: #fff; }
.cstep .cs-lbl { font-size: 13.5px; font-weight: 600; color: var(--ink-3); transition: color .3s var(--ease); }
.cstep.done .cs-lbl, .cstep.active .cs-lbl { color: var(--ink); }
.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* the authored moment: card materialises on the stand */
.ritual {
  position: fixed; inset: 0; z-index: 90; overflow: hidden;
  background: radial-gradient(115% 85% at 50% 22%, #2C3432 0%, #141817 45%, #050706 100%);
  display: grid; place-items: center; grid-template-rows: 1fr auto;
  opacity: 0; animation: fadeIn .45s var(--ease-out) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
.ritual .rt-scene { position: relative; display: grid; place-items: center; align-self: end; padding-bottom: 6px; }
.ritual .rt-slab {
  position: relative; z-index: 4;
  animation: slabRise 1.5s var(--ease-out) .35s backwards;
}
.ritual .slab { --sw: 168px; }
@keyframes slabRise {
  0% { transform: translateY(58px) scale(.82); opacity: 0; filter: blur(14px); }
  60% { opacity: 1; filter: blur(0); }
  100% { transform: none; opacity: 1; filter: blur(0); }
}
.ritual .rt-stand { width: 216px; margin-top: -14px; z-index: 5; position: relative; animation: standIn .8s var(--ease-out) both; }
@keyframes standIn { from { transform: translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }
.ritual .rt-burst {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 220px; height: 220px; border-radius: 50%; z-index: 1; pointer-events: none;
  background: radial-gradient(circle, var(--glow, #fff) 0%, transparent 62%);
  opacity: 0; animation: burst 2.1s var(--ease-out) .5s;
}
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  22% { opacity: .85; }
  100% { opacity: .16; transform: translate(-50%, -50%) scale(1.7); }
}
.ritual .rt-shock {
  position: absolute; left: 50%; top: 46%; z-index: 2; pointer-events: none;
  width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%;
  border: 2px solid var(--glow, #fff); opacity: 0;
  animation: shock 1.5s var(--ease-out) .55s;
}
.ritual .rt-shock.b { animation-delay: .85s; }
@keyframes shock { 0% { transform: scale(.2); opacity: .9; } 100% { transform: scale(3.1); opacity: 0; } }
/* smoke */
.ritual .rt-smoke { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.ritual .rt-smoke i {
  position: absolute; bottom: 22%; left: 50%; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, var(--glow, #fff) 0%, transparent 60%);
  opacity: 0; filter: blur(22px);
  animation: smoke 3.4s ease-out .45s forwards;
}
.ritual .rt-smoke i:nth-child(1) { margin-left: -130px; animation-delay: .45s; }
.ritual .rt-smoke i:nth-child(2) { margin-left: -30px; animation-delay: .65s; animation-duration: 4s; }
.ritual .rt-smoke i:nth-child(3) { margin-left: 46px; animation-delay: .85s; }
@keyframes smoke {
  0% { opacity: 0; transform: translateY(30px) scale(.5); }
  25% { opacity: .5; }
  100% { opacity: 0; transform: translateY(-130px) scale(2.1); }
}
/* sparks */
.ritual .rt-spark { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.ritual .rt-spark i {
  position: absolute; left: 50%; top: 52%; width: 4px; height: 4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 8px 2px var(--glow, #fff); opacity: 0;
  animation: spark 1.7s var(--ease-out) forwards;
}
@keyframes spark {
  0% { opacity: 0; transform: translate(0, 0) scale(.3); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.25); }
}
.ritual .rt-copy { text-align: center; padding: 20px 26px calc(30px + env(safe-area-inset-bottom)); align-self: start; }
.ritual .rt-copy .rc-t { color: #fff; font-size: 21px; font-weight: 800; letter-spacing: -.03em; animation: screenIn .6s var(--ease-out) 1.3s backwards; }
.ritual .rt-copy .rc-s { color: #8C9691; font-size: 13px; margin-top: 6px; font-weight: 500; animation: screenIn .6s var(--ease-out) 1.5s backwards; }
.ritual .rt-copy .btn { margin-top: 18px; animation: screenIn .6s var(--ease-out) 1.9s backwards; }
.ritual .rt-flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; z-index: 8; pointer-events: none;
  animation: flash .7s ease-out .5s;
}
@keyframes flash { 0% { opacity: 0; } 8% { opacity: .55; } 100% { opacity: 0; } }

/* ============================================================
   SCAN
   ============================================================ */
.camstage {
  border-radius: var(--radius); overflow: hidden; background: #0E110F;
  aspect-ratio: 3/4; position: relative; margin-bottom: 14px;
}
.camstage video { width: 100%; height: 100%; object-fit: cover; }
.camstage .cam-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: #8A938E; font-size: 13px; padding: 24px; line-height: 1.5;
}
.camframe {
  position: absolute; inset: 11% 15%; border-radius: 12px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .42);
}
.camframe i { position: absolute; width: 22px; height: 22px; border: 3px solid #fff; }
.camframe i:nth-child(1) { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.camframe i:nth-child(2) { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.camframe i:nth-child(3) { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.camframe i:nth-child(4) { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.scanline {
  position: absolute; left: 15%; right: 15%; height: 2px; z-index: 2;
  background: var(--yellow); border-radius: 999px; box-shadow: 0 0 16px 3px rgba(255, 203, 5, .8);
  animation: scanline 1.5s ease-in-out infinite alternate; top: 13%;
}
@keyframes scanline { from { top: 13%; } to { top: 84%; } }
.shutterrow { display: grid; place-items: center; margin-bottom: 8px; }
.shutter {
  width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 5px solid var(--red);
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(227, 53, 13, .34);
  transition: transform .16s var(--ease);
}
.shutter:active { transform: scale(.92); }
.shutter svg { width: 28px; height: 28px; }

.candidates { display: grid; gap: 9px; }
.candidate {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border-radius: var(--radius-sm); box-shadow: var(--shadow-1);
  padding: 11px; border: 2px solid transparent;
  transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.candidate:active { transform: scale(.98); }
.candidate.best { border-color: var(--yellow); }
.candidate .slab { --sw: 46px; }
.candidate .cd-main { flex: 1; min-width: 0; }
.candidate .cd-name { font-weight: 700; font-size: 14px; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candidate .cd-set { font-size: 11.5px; color: var(--ink-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.candidate .cd-conf { text-align: right; flex: none; }
.candidate .cd-pct { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14.5px; color: var(--green); }
.candidate .cd-pct.mid { color: var(--yellow-deep); }
.candidate .cd-pct.low { color: var(--ink-3); }
.candidate .cd-conflbl { font-size: 10px; color: var(--ink-3); font-weight: 600; }

.successbox { text-align: center; padding: 22px 10px 6px; }
.successbox .ok {
  width: 70px; height: 70px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; margin: 0 auto 15px;
  box-shadow: 0 10px 26px rgba(22, 160, 92, .38); animation: pop .5s var(--ease-out);
}
.successbox .ok svg { width: 33px; height: 33px; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 65% { transform: scale(1.1); } 100% { transform: scale(1); opacity: 1; } }
.successbox h4 { font-size: 18.5px; font-weight: 800; letter-spacing: -.025em; }
.successbox p { color: var(--ink-2); font-size: 13.5px; margin: 6px 0 16px; }

/* ---------------- sheets ---------------- */
.sheetback {
  position: fixed; inset: 0; z-index: 40; background: rgba(15, 16, 18, .5);
  opacity: 0; transition: opacity .26s var(--ease); backdrop-filter: blur(3px);
}
.sheetback.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 480px; margin: 0 auto; background: var(--bg);
  border-radius: 26px 26px 0 0; transform: translateY(100%);
  transition: transform .34s var(--ease-out);
  max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 9px 17px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -14px 44px rgba(0, 0, 0, .22);
}
.sheet.full { height: 96dvh; max-height: 96dvh; }
.sheet.show { transform: none; }
/* flush sheets run edge to edge; the sticky action bar brings its own safe area */
.sheet.flush { padding: 9px 0 0; }
.sheet.flush > .grab { margin-bottom: 6px; }
.grab { width: 40px; height: 4px; border-radius: 999px; background: var(--line-2); margin: 4px auto 13px; }
.sheethead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.sheethead.pad { padding: 0 17px; }
.sheethead .st { font-size: 18.5px; font-weight: 800; letter-spacing: -.03em; }
.sheethead .close { width: 33px; height: 33px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; flex: none; }
.sheethead .close svg { width: 15px; height: 15px; }

.dtabs { display: flex; gap: 5px; background: var(--bg-soft); border-radius: 999px; padding: 4px; margin: 14px 0 13px; }
.dtabs button { flex: 1; padding: 9px 4px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); text-align: center; }
.dtabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .09); }

/* ---------------- wishlist ---------------- */
.watchrow { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); width: 100%; }
.watchrow:last-child { border-bottom: 0; }
.watchrow:active { opacity: .55; }
.watchrow .slab { --sw: 38px; }
.watchrow .wr-bar { flex: 1; min-width: 0; }
.watchrow .wr-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; }
.watchrow .wr-top .wr-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watchrow .wr-target { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); font-size: 11.5px; flex: none; }
.watchrow .wr-track { height: 6px; border-radius: 999px; background: var(--bg-soft); margin-top: 7px; overflow: hidden; }
.watchrow .wr-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--yellow), var(--green)); transform-origin: left; animation: growx .8s var(--ease-out); }
.watchrow .wr-fill.hit { background: var(--green); }
.watchrow .wr-note { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 5px; }
.watchrow .wr-note.hit { color: var(--green); }

/* ---------------- tabbar ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: rgba(255, 255, 255, .9); backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
}
.tab {
  display: grid; justify-items: center; gap: 3px; text-align: center;
  font-size: 10px; font-weight: 700; color: var(--ink-3); padding: 4px 0;
  transition: color .16s var(--ease);
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-selected="true"] { color: var(--red); }
.tab-scan { padding: 0; }
.tab-scan .pokeball {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  margin-top: -25px; background: #fff;
  box-shadow: 0 8px 22px rgba(227, 53, 13, .32), 0 0 0 6px var(--bg);
  transition: transform .18s var(--ease);
}
.tab-scan:active .pokeball { transform: scale(.92) rotate(-12deg); }
.tab-scan .pokeball svg { width: 50px; height: 50px; }

/* ---------------- toast ---------------- */
#toast {
  position: fixed; left: 50%; bottom: calc(102px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none; z-index: 95;
  transition: opacity .24s var(--ease), transform .24s var(--ease);
  max-width: calc(100% - 40px); text-align: center; line-height: 1.35;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- inputs ---------------- */
.textfield {
  width: 100%; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--card); padding: 13px 15px; font-size: 15px; outline: none;
  transition: border-color .16s var(--ease);
}
.textfield:focus { border-color: var(--red); }
.fieldlbl { font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin: 14px 0 6px; display: block; }
.inputrow { display: flex; align-items: center; gap: 9px; }
.inputrow .suffix { font-family: var(--mono); font-weight: 700; color: var(--ink-2); flex: none; }

/* ============================================================
   LIVE CATALOGUE — search, set browser, data provenance
   ============================================================ */
.scanhero .sh-ways { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.scanhero .sh-ways .btn-ghost {
  background: rgba(255, 255, 255, .14); color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55);
  backdrop-filter: blur(3px);
}
.scanhero .sh-ways .btn-ghost:active { background: rgba(255, 255, 255, .26); }

/* ---------------- alternative entry points ---------------- */
.orway { display: flex; align-items: center; gap: 12px; margin: 20px 2px 14px; }
.orway::before, .orway::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.orway span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .09em; }

.waybtns { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.waybtns.two { margin-bottom: 14px; }
.waybtn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 13px 13px 14px; border-radius: var(--radius-sm); text-align: left;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 6px 16px rgba(23, 24, 26, .05);
  transition: transform .13s ease, box-shadow .13s ease;
}
.waybtn:active { transform: translateY(1px) scale(.985); box-shadow: 0 1px 3px rgba(23, 24, 26, .07); }
.waybtn svg { width: 19px; height: 19px; color: var(--red); margin-bottom: 5px; }
.waybtn b { font-size: 13.5px; font-weight: 700; letter-spacing: -.015em; }
.waybtn i { font-size: 11.5px; font-style: normal; color: var(--ink-2); line-height: 1.3; }

/* ---------------- loading ---------------- */
.loadbox { display: flex; flex-direction: column; align-items: center; gap: 13px; padding: 42px 20px; text-align: center; }
.loadbox p { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--bg-sink); border-top-color: var(--red);
  animation: spin .72s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- live search hits ---------------- */
.hitart {
  width: 40px; height: 56px; object-fit: contain; display: block;
  border-radius: 4px; background: var(--bg-soft);
}
.mr-praw { display: block; font-size: 10px; font-weight: 600; color: var(--ink-3); margin-top: 1px; letter-spacing: 0; }
.mktrow.busy { opacity: .5; pointer-events: none; }

/* ---------------- set browser ---------------- */
.serieh {
  font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .07em;
  text-transform: uppercase; margin: 20px 2px 9px;
}
.setgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.settile {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 11px 12px; border-radius: var(--radius-sm); text-align: center;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(23, 24, 26, .04), 0 6px 16px rgba(23, 24, 26, .05);
  transition: transform .13s ease;
}
.settile:active { transform: translateY(1px) scale(.985); }
.st-logo { height: 34px; width: 100%; object-fit: contain; margin-bottom: 5px; }
.st-sym { height: 24px; width: 100%; object-fit: contain; margin: 5px 0 10px; opacity: .8; }
.st-none {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 800;
  color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase;
}
.st-name { font-size: 12.5px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.st-meta { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.st-bar { display: block; width: 100%; height: 4px; border-radius: 3px; background: var(--bg-sink); margin: 7px 0 4px; overflow: hidden; }
.st-bar i { display: block; height: 100%; border-radius: 3px; background: var(--red); transition: width .3s ease; }
.st-have { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ink-2); }

.sethero { text-align: center; padding: 6px 0 18px; }
.sethero img { height: 62px; max-width: 74%; object-fit: contain; }
.sethero h2 { font-size: 25px; font-weight: 800; letter-spacing: -.035em; }
.sethero .sh-meta { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-top: 7px; }
.sethero .sh-prog { height: 6px; border-radius: 4px; background: var(--bg-sink); margin: 13px auto 6px; max-width: 230px; overflow: hidden; }
.sethero .sh-prog i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--red), #F0721A); transition: width .3s ease; }
.sethero .sh-have { font-family: var(--mono); font-size: 12px; color: var(--ink-2); font-weight: 600; }
.sethero .sh-have b { color: var(--ink); font-size: 14px; }

.cardgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gridcard {
  position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 62 / 88;
  background: var(--bg-soft); transition: transform .13s ease;
}
.gridcard:active { transform: scale(.955); }
.gridcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-num {
  position: absolute; left: 4px; top: 4px; padding: 2px 5px; border-radius: 5px;
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  background: rgba(0, 0, 0, .62); color: #fff; backdrop-filter: blur(2px);
}
.gc-add {
  position: absolute; right: 4px; bottom: 4px; width: 21px; height: 21px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(23, 24, 26, .74); color: #fff;
  backdrop-filter: blur(2px);
}
.gc-add svg { width: 13px; height: 13px; }
.gridcard.owned .gc-add { background: var(--green); }

/* ---------------- provenance ---------------- */
.srcbox .srcnote {
  font-size: 11.5px; line-height: 1.45; color: var(--ink-2);
  background: var(--yellow-soft); border-radius: 9px; padding: 9px 11px; margin-top: 10px;
}

/* Such-Vorschlaege (Markt) */
.searchwrap { position: relative; }
.suggest {
  position: absolute; top: calc(100% - 6px); left: 0; right: 0; z-index: 40;
  background: var(--card); border-radius: 20px; box-shadow: var(--shadow-2);
  padding: 5px 10px; max-height: 348px; overflow: auto; overscroll-behavior: contain;
}
.sug {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 8px 4px; border-bottom: 1px solid var(--line);
}
.sug:last-child { border-bottom: 0; }
.sug:active { opacity: .55; }
.sug-art { width: 30px; height: 42px; object-fit: contain; border-radius: 4px; flex: none; background: var(--bg); }
.sug-main { flex: 1; min-width: 0; }
.sug-main b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-main i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-price { flex: none; font-family: "JetBrains Mono", monospace; font-size: 12.5px; font-weight: 700; }

/* Filter-Dropdowns (Markt) */
.filterrow { display: flex; gap: 8px; margin-bottom: 12px; }
.dd { position: relative; flex: 1; min-width: 0; }
.sortrow .dd { flex: none; width: auto; }
.ddbtn {
  display: flex; align-items: center; gap: 6px; width: 100%;
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-1);
  padding: 8px 10px 8px 12px; text-align: left;
  transition: transform .15s var(--ease);
}
.ddbtn:active { transform: scale(.97); }
.ddbtn.on { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--ink); }
.ddbtn .ddtxt { flex: 1; min-width: 0; }
.dd-l { display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.dd-v { display: block; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ddbtn .dd-c { flex: none; width: 15px; height: 15px; color: var(--ink-3); transform: rotate(90deg); transition: transform .2s var(--ease); }
.ddbtn .dd-c svg { width: 100%; height: 100%; display: block; }
.ddbtn[aria-expanded="true"] .dd-c { transform: rotate(-90deg); }
.ddmenu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 45;
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow-2);
  padding: 5px; max-height: 310px; overflow: auto; overscroll-behavior: contain;
}
.sortrow .ddmenu { left: auto; right: 0; min-width: 176px; }
.ddopt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; padding: 10px 11px; border-radius: 11px;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.ddopt svg { width: 14px; height: 14px; color: var(--red); flex: none; }
.ddopt[aria-selected="true"] { background: var(--bg-soft); font-weight: 700; }
.ddopt:active { background: var(--bg-soft); }
.filterreset {
  display: inline-flex; align-items: center; gap: 5px; margin: -4px 0 10px;
  font-size: 12px; font-weight: 700; color: var(--red); padding: 4px 2px;
}
.filterreset svg { width: 12px; height: 12px; }
.sortrow { align-items: center; }

/* Halter: RGB-Rahmen passend zur Karte, Underglow, Sparkline im Display */
.devstage .board, .stand .board {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .9),
              0 0 0 1.5px color-mix(in srgb, var(--glow, #3BE58F) 55%, #10201A),
              0 0 18px color-mix(in srgb, var(--glow, #3BE58F) 30%, transparent);
}
.stand-foot { position: relative; }
.stand-foot::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -11px; width: 150px; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--glow, #3BE58F) 42%, transparent), transparent 70%);
  filter: blur(6px); opacity: .75; pointer-events: none;
}
.board .b-spark { position: absolute; left: 6px; right: 6px; bottom: 3px; height: 24px; opacity: .55; pointer-events: none; }
.board .b-spark .spark { width: 100%; height: 100%; display: block; }

/* ---- v11: investment block on card page ---- */
.investcard { box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--green-soft); }
.ivitem + .ivitem { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.iv-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 13px; border-radius: 12px; margin-bottom: 9px;
}
.iv-hero.up { background: var(--green-soft); }
.iv-hero.down { background: var(--loss-soft); }
.iv-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-3);
}
.iv-hero.up .iv-lbl { color: #0E7C45; }
.iv-hero.down .iv-lbl { color: var(--loss); }
.iv-big {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: 23px; font-weight: 800; letter-spacing: -.04em; margin-top: 2px;
}
.iv-hero.up .iv-big { color: var(--green); }
.iv-hero.down .iv-big { color: var(--loss); }

/* ---- v12: grail tag ---- */
.raritytag.grailtag {
  background: linear-gradient(135deg, #F6E27A, #D9A62E);
  color: #4A3505; font-weight: 800; letter-spacing: .08em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45), 0 1px 4px rgba(217, 166, 46, .4);
}

/* ---- v13: verkaufen/entfernen ---- */
.iv-actions { display: flex; gap: 8px; margin-top: 11px; }
.iv-actions .btn { flex: 1; }
.iv-actions .iv-del { color: #E0402B; }
.sheetnote { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); margin: 8px 2px 2px; }
.rowitem .ri-end .pill { margin-top: 3px; }
/* v13.1: rowitem-Zeilen sauber stacken (inline-Spans liefen ineinander/unter den Preis) */
.rowitem .ri-name, .rowitem .ri-sub { display: block; }
.rowitem .ri-end { display: flex; flex-direction: column; align-items: flex-end; }
