/* The Coming soon screen (#502, design/502/SPEC.md): the red Pokédex with its
   big lens slowly lighting up. Blue sky 2.0 tokens; the only motion is the lens. */
.cs {
  --cs-bg: #f7f8f5;
  --cs-ink: #141414;
  --cs-mut: #6b6f66;
  --cs-quiet: rgba(0, 0, 0, 0.06);
  --cs-red: #c8102e;
  --cs-focus: #2f6fb0;
  --cs-sh: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.06);
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #e3123a, #c8102e 55%, #a30c26);
  font-family: var(--font-ui);
  color: var(--cs-ink);
  font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .cs {
    --cs-bg: #121614;
    --cs-ink: #eef2ec;
    --cs-mut: #9aa59c;
    --cs-quiet: rgba(255, 255, 255, 0.08);
    --cs-red: #ff6b7d;
    --cs-focus: #4a8fd6;
  }
}
:root[data-theme='dark'] .cs {
  --cs-bg: #121614;
  --cs-ink: #eef2ec;
  --cs-mut: #9aa59c;
  --cs-quiet: rgba(255, 255, 255, 0.08);
  --cs-red: #ff6b7d;
  --cs-focus: #4a8fd6;
}
.cs-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  border-radius: 46px;
  overflow: hidden;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.25),
    inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.cs-top {
  height: 84px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px 0 10px;
}
.cs-lens {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}
.cs-lens i {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6efff, #6fb2e8 38%, #2f6fb0);
  box-shadow: 0 0 0 2px #163656;
  animation: cs-glow 3.2s ease-in-out infinite;
}
.cs-led {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.cs-led--red {
  background: #e3123a;
}
.cs-led--gold {
  background: #f2b632;
}
.cs-led--green {
  background: #3fae57;
}
.cs-screen {
  flex: 1;
  min-height: 0;
  background: var(--cs-bg);
  border-radius: 26px 26px 18px 18px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 24px 16px;
  gap: clamp(12px, 3.2dvh, 24px);
}
.cs-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 3.2dvh, 24px);
  max-width: 560px;
  margin: auto;
}
/* The signature: the Dex's big lens waking up. */
.cs-big {
  width: clamp(88px, 19dvh, 148px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    var(--cs-sh),
    0 3px 0 rgba(0, 0, 0, 0.18);
}
.cs-big-l {
  position: relative;
  width: 74%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5b6b7c, #2c3947 45%, #1b2631);
  box-shadow: 0 0 0 3px #163656;
}
.cs-big-l::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d6efff, #6fb2e8 38%, #2f6fb0);
  animation:
    cs-wake 2.6s 0.5s cubic-bezier(0.4, 0, 0.2, 1) both,
    cs-glow 3.2s 3.1s ease-in-out infinite;
}
.cs-big-l::after {
  content: '';
  position: absolute;
  left: 20%;
  top: 16%;
  width: 26%;
  height: 18%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(-30deg);
  opacity: 0.9;
}
@keyframes cs-wake {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes cs-glow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(111, 178, 232, 0);
  }
  50% {
    box-shadow: 0 0 18px 6px rgba(111, 178, 232, 0.7);
  }
}
.cs-title {
  font-family: var(--font-moment);
  font-weight: 400;
  font-size: clamp(14px, 2.2vw + 8px, 20px);
  line-height: 1.6;
  color: var(--cs-red);
  letter-spacing: 0.5px;
  text-wrap: balance;
  margin: 0;
}
.cs-line {
  font-size: 12px;
  line-height: 1.45;
  color: var(--cs-mut);
  max-width: 34ch;
  text-wrap: balance;
  margin: 0;
}
.cs-foot {
  flex: none;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.cs-quiet {
  min-height: 44px;
  min-width: 88px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--cs-quiet);
  color: var(--cs-ink);
  font: 600 15px/1 var(--font-ui);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s;
}
.cs-quiet:active {
  transform: scale(0.97);
}
.cs-quiet:focus-visible {
  outline: 3px solid var(--cs-focus);
  outline-offset: 2px;
}
/* Reduce motion: lit at once and still, nothing lost. */
@media (prefers-reduced-motion: reduce) {
  .cs-big-l::before {
    animation: none;
    opacity: 1;
  }
  .cs-lens i {
    animation: none;
  }
}
.rm .cs-big-l::before {
  animation: none;
  opacity: 1;
}
.rm .cs-lens i {
  animation: none;
}
@media (min-width: 600px) {
  .cs-shell {
    padding: 0 16px;
  }
  .cs-screen {
    padding: 32px;
  }
}
@media (min-width: 1025px) {
  .cs-line {
    font-size: 13px;
  }
}

/* The quiet ‹ Back on the sign-in screen, back to Coming soon. */
.cs-back {
  align-self: flex-start;
  margin-bottom: 8px;
}
/* help: styles used only by this feature (src/features/help). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Get the app (Add to Home Screen) ---- */
.install-intro, .install-done { font-size: 12px; line-height: 1.45; margin: 0 0 6px; }
.install-done { color: var(--money); font-weight: bold; }
.install-steps { padding-left: 24px; margin: 0 0 10px; font-size: 12px; line-height: 1.5; }
.install-steps li { margin-bottom: 8px; }
.share-icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; color: var(--link); }
@media (max-width: 600px) {
  .install-steps, .install-intro, .install-done { font-size: 13px; }
}

/* ---- Slab scanning ---- */
.about-list { margin: 0 0 12px; padding: 0; list-style: none; }
.about-list li { position: relative; padding-left: 20px; margin: 0 0 6px; line-height: 1.4; }
.about-list li::before {
  content: ''; position: absolute; left: 3px; top: 0.5em; width: 7px; height: 7px;
  background: var(--red-text); transform: rotate(45deg);
}
.about-join { width: 100%; margin-top: 4px; }
/* auth: styles used only by this feature (src/features/auth). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Login ---------------------------------------------------------------- */
.login-form { display: flex; flex-direction: column; gap: 14px; max-width: 280px; margin: 0 auto; text-align: center; }
/* Sign-in / join / reset text is centred throughout, wrapped lines included. */
.login-form input, #forgot-form input { text-align: center; }
#forgot-form { text-align: center; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.login-form input { min-height: var(--button-h); }
@media (max-width: 600px) {
  .login-form label { font-size: 14px; }
}

/* ---- Pokédex chrome ---- */
.dex-screen--login > .auth-foot { padding-top: 28px; }
/* The free space is shared equally: above the title, between the title and
   the form, and between the form and the footer. */
.dex-screen--login > .brand { margin-top: auto; }
.dex-screen--login > .auth-body { margin-block: auto; }

/* Block margins only: the side margins stay auto (style.css) so the brand
   column is centred over the form at tablet and desktop widths. */
.brand { font-size: 22px; color: var(--red-text); margin-block: 6px 8px; }
.brand-sub { margin-block: 0 24px; opacity: 0.7; font-size: 16px; }

/* ---- Accounts: sign in / register tabs, name prompt, account modal ---- */
.auth-tabs { display: flex; max-width: 280px; margin: 0 auto 18px; border: 2px solid var(--edge); border-radius: 8px; overflow: hidden; }
.auth-tab {
  flex: 1; font-family: var(--font-moment); font-size: 10px; padding: 10px 4px;
  background: var(--surface); border: 0; color: var(--ink);
}
.auth-tab + .auth-tab { border-left: 2px solid var(--edge); }
.auth-tab.active { background: var(--red-dark); color: #fff; }
.forgot-done { width: 100%; }

/* ---- Leaderboard ---- */

@media (max-width: 600px) {
  .auth-tab { font-size: 11px; padding: 12px 4px; }
}

/* ---- Phone layout ---- */
@media (max-width: 600px) {
  .dex-screen--login { padding: 28px 18px; }
}
/* A short phone (375x667) has no room for the sign-in error under the form
   (#465): tighter padding above and below keeps the screen from scrolling. */
@media (max-width: 600px) and (max-height: 700px) {
  .dex-screen--login { padding-block: 16px 12px; }
  .dex-screen--login > .auth-foot { padding-top: 16px; }
}

/* ---- Wishlist tab ---- */
@media (max-width: 600px) {
  .dex-screen:not(.dex-screen--login) { box-sizing: border-box; min-height: calc(100dvh - var(--topbar-h, 56px)); }
}

/* ---- Requests (join / new password), approved by an admin ---- */
.auth-intro { margin: 0; }
/* Open sign-up: Cloudflare Turnstile's box on the Join form (usually empty). */
.turnstile:empty { display: none; }

/* ---- Slab scanning ---- */
.auth-foot { max-width: 320px; margin: 0 auto; text-align: center; }
.auth-foot-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px; color: var(--muted); }
.auth-foot-links .link-btn { display: inline-block; margin: 0; font-size: 12px; }
.auth-foot-legal { margin: 4px 0 0; font-size: 12px; line-height: 1.3; color: var(--muted); }
/* "A … app": who runs this install, when OPERATOR_NAME is set (2026-09-26). */
.auth-foot-made { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 600px) {
  .auth-foot-links .link-btn { font-size: 12px; }
  .auth-foot-legal { font-size: 12px; }
}

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {

  /* Sign-in: larger brand, form and footer to suit the taller card. */
  .brand { font-size: 28px; margin-bottom: 10px; }
  .brand-sub { font-size: 18px; margin-bottom: 30px; }
  .login-form, .auth-tabs { max-width: 340px; }
  .login-form label, .login-form input { font-size: 16px; }
  .auth-tab { font-size: 12px; padding: 12px 4px; }
  .auth-foot { max-width: 420px; }
  .auth-foot-links .link-btn { font-size: 13px; }
  .auth-foot-made { font-size: 12px; }
  .auth-foot-legal { font-size: 12px; }
}
/* wants: styles used only by this feature (src/features/wants). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Wishlist tab ---- */
.wish-summary {
  margin: 0 0 12px;
  font-size: 12px;
}
.wish-tile {
  gap: 6px;
}
.wish-card {
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* ---- Wants: binder / slabs switch, and slab wants ---- */
.wants-seg {
  margin: 0 0 14px;
}
.slab-want-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slab-want-cell .wish-actions {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 4px;
}

/* ---- Trades tab (tiles shared with profiles: components/TradeTile.tsx) ---- */
.trade-edit {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {
  .wish-summary {
    font-size: 13px;
  }
  /* The app spans the window on a desktop. Keep List view rows at the
     phone/tablet column width so a card's name stays near its price and
     buttons. Tiles view still fills the width. */
  .wish-list {
    max-width: 900px;
  }
}

/* ---- Wants ⋯ page, groups and list view ---- */
.wish-menu-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}
.wish-menu-body .wish-sort {
  margin: 0;
}
.wish-group {
  margin: 0 0 18px;
}
.wish-group-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 8px 0;
  font-size: 13px;
  /* The pixel heading font has almost no line gap: without this a wrapped
     heading prints its lines over each other. */
  line-height: 1.4;
}
/* The count and price get their own line, in the body font. */
.wish-group-head .card-meta {
  flex-basis: 100%;
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: normal;
  line-height: 1.2;
}
.wish-group-logo {
  height: 28px;
  width: auto;
}
.wish-group-cover {
  display: inline-block;
  width: 18px;
  height: 26px;
  border-radius: 3px;
}
.wish-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* A list row is a grid: the picture on the left, the name and set beside it
   (free to wrap), then the price and buttons. Phones stack the price and the
   buttons under the name; wider screens keep them on the right. */
.wish-list .wish-tile {
  display: grid;
  grid-template-columns: 56px auto minmax(0, 1fr) auto;
  grid-template-areas:
    'pic name name star'
    'pic meta meta meta'
    'pic price move move'
    'pic acts acts acts';
  align-items: center;
  gap: 4px 10px;
  text-align: left;
}
.wish-list .wish-card {
  grid-area: pic;
  align-self: start;
}
.wish-list .wish-card img {
  width: 56px;
  height: auto;
  display: block;
}
.wish-list .wish-tile > strong {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
}
.wish-list .wish-tile > .card-meta {
  grid-area: meta;
  min-width: 0;
  overflow-wrap: anywhere;
}
.wish-list .wish-tile > .price {
  grid-area: price;
}
.wish-list .wish-tile > .price-move {
  grid-area: move;
  min-width: 0;
}
/* In a row the star takes its own cell rather than floating over the buttons. */
.wish-list .must-star {
  grid-area: star;
  position: static;
  align-self: start;
}
.wish-list .wish-tile .wish-actions {
  grid-area: acts;
  margin-top: 0;
}
.wish-list .wish-tile .wish-actions [data-got] {
  flex: 0 1 auto;
}
@media (min-width: 601px) {
  .wish-list .wish-tile {
    grid-template-columns: 56px minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      'pic name price acts star'
      'pic meta move acts star';
  }
  .wish-list .wish-tile > .price,
  .wish-list .wish-tile > .price-move {
    justify-self: end;
    text-align: right;
  }
}
/* ---- Wants: price move since added (features/wants/priceMove.ts). A drop is good news for a buyer. ---- */
.price-move {
  font-size: 12px;
  color: var(--muted);
}
.price-move--down {
  color: var(--green-text);
}
.price-move--up {
  color: var(--red-text);
}

/* ---- Share my wants (features/share) ---- */
.share-qr {
  display: block;
  width: 220px;
  max-width: 100%;
  margin: 12px auto;
  border-radius: 6px;
}
.share-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0;
}
.share-link-label {
  display: block;
  margin: 8px 0 4px;
  font-weight: 700;
}
.share-link {
  width: 100%;
  margin-bottom: 8px;
}
/* The shared wants page (/w/<token>) sits in the Pokédex frame (DexFrame). */
.public-wants h1 {
  font-size: 20px;
  margin: 0 0 12px;
}
.public-wants h2 {
  font-size: 15px;
}
/* ---- ★ Must-haves ---- */
.must-star {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  background: var(--want-bg);
  border: 2px solid var(--edge);
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
}
.must-star.on {
  color: var(--gold);
  background: var(--want-on-bg);
  border-color: #7a5c0d;
}
.slab-want-cell {
  position: relative;
}
.must-chip {
  margin: 0 0 10px;
}

/* ---- Group tiles (#333): one per set or binder ----
   Built on the Sets tab's .tile-grid.open and .set-tile, so the columns
   (2 on a phone, 4 on a tablet, 6 on a desktop), the 64px logo frame and the
   no-logo fallback (.set-tile-nologo) are the ones the app already has. */
.wish-tiles {
  margin: 0 0 12px;
}
.wish-tiles .set-tile {
  gap: 2px;
  padding: 10px 8px;
}
.wish-tiles .set-tile-name {
  font-size: 13px;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* The count sits on the same line in every tile of a row, whatever the name's length. */
.wish-tile-count {
  margin-top: auto;
  padding-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.wish-tiles .price {
  font-size: 13px;
}
.wish-tiles .set-tile:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--ring);
}
/* Group by Binder: the binder's cover colour in the logo frame. */
.wish-tiles .binder-cover {
  width: 44px;
  height: 56px;
}

/* ---- An opened set or binder: the way back, then what you opened ---- */
.wish-open {
  margin: 0 0 12px;
}
.wish-open-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}
.wish-open .wish-group-head {
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}
/* Focused by script on open, not a control. */
.wish-open .wish-group-head:focus {
  outline: none;
}
.wish-open .wish-group-logo {
  flex: none;
  height: auto;
  max-height: 44px;
  max-width: 110px;
  object-fit: contain;
}
.wish-open .wish-group-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.wish-open-meta {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .wish-open .wish-group-head {
    font-size: 12px;
  }
}
/* tutorial: styles used only by this feature (src/features/tutorial). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Wishlist tab ---- */
.tutorial-step { text-align: center; padding: 6px 4px 0; flex: 1; }
.tutorial-sprite { width: 96px; height: 96px; image-rendering: pixelated; }
.tutorial-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--rule); }
.tutorial-nav { display: flex; gap: 10px; }
@media (max-width: 600px) {
  .tutorial-step { padding-top: 24px; }
  .tutorial-nav { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* ---- Tab strip: a copy of the tab bar with the step's tab lit (#351) ----
   Drawn like the real bar (#395): the red strip with its top edge, the
   icons, and a white pill on the step's tab, on every size. It shrinks to
   the popup's width rather than hang over the red frame. */
.tut-bar { display: flex; justify-content: center; gap: 0; margin: 2px auto 12px; padding: 6px 4px; background: var(--red-dark); border-top: 3px solid #a3021f; border-radius: 8px; max-width: 360px; box-sizing: border-box; overflow: hidden; }
.tut-tab { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; color: #ffd5db; }
.tut-tab .view-tab-icon { display: flex; align-items: center; justify-content: center; width: min(56px, 100%); height: 34px; border-radius: 17px; --tab-icon-hole: var(--red-dark); }
.tut-tab .view-tab-icon svg { display: block; width: 24px; height: 24px; }
.tut-tab.on { color: var(--red-dark); }
.tut-tab.on .view-tab-icon { background: #fff; --tab-icon-hole: #fff; }
.tut-name { display: none; }
/* slabs: styles used only by this feature (src/features/slabs). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Slabs ---- */
.slab-sort { margin: 0 0 10px; }

/* ---- Slab scanning ---- */
.slab-scanned { margin: 8px 0 0; }

/* ---- Case: value strip, chips, the slab grid ---- */
.case-strip { margin-bottom: 10px; }
/* 2.0 (#530): three soft tiles across at every width, the amount centred and
   big over a small muted label; worth in the money green.
   minmax(0, 1fr), not 1fr: a 1fr column won't shrink below its text, so a big
   total widened the page, and on a phone every full-screen sheet with it
   (Edit slab's Close went off the edge, #340). Long amounts wrap instead. */
.case-strip .stat-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.case-strip .stat-tile {
  background: var(--surf); border: 0; border-radius: var(--radius-tile); box-shadow: var(--sh);
  padding: 10px 8px; align-items: center; gap: 2px; text-align: center;
}
.case-strip .stat-value {
  font-family: var(--font-ui); font-size: 20px; font-weight: 800; letter-spacing: -1px;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.case-strip [data-strip="worth"] .stat-value { color: var(--money); }
.case-strip .stat-label { font-size: 12px; font-weight: 500; color: var(--mut); opacity: 1; text-transform: lowercase; }
.case-note { margin: 6px 0 0; }
.case-gain--up { color: var(--green-text); }
.case-gain--down { color: var(--red-text); }
.case-filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.case-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* The slabs on their own: 2 across on a phone, 3 on a tablet, 5 on a desktop
   (with the filter panel beside them). */
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; justify-items: center; }
.case-slot { position: relative; width: 100%; max-width: 150px; }
.case-verified {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1;
  background: var(--green-text); color: #fff; border: 2px solid #fff;
}
/* The verified tick sits on the label's left on a 2.0 case tile, clear of the grade. */
.case-slot:has(.slab--case) .case-verified { top: -6px; left: -6px; right: auto; z-index: 2; }
@media (min-width: 601px) {
  .case-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
/* Desktop: filters move to a side panel, 5 across. */
@media (min-width: 1024px) {
  .case-layout { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: start; }
  .case-filters { margin: 0; position: sticky; top: 8px; }
  .case-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
}
/* The 2.0 case tile (#530): a silver case, a short white label with the
   grader and the grade in red, the card in a dark window. 150 x 196 as the
   hand-off. */
.slab.slab--case {
  aspect-ratio: 150 / 196; padding: 6px; gap: 5px; border: 0; border-radius: 12px;
  background: linear-gradient(180deg, #f4f6f8, #dfe4e8);
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,0.12), 0 8px 18px rgba(0,0,0,0.18);
}
.slab-lbl {
  height: 26px; flex-shrink: 0; border-radius: 6px; background: #fff; color: #141414;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
  font-size: 10px; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}
.slab-lbl b { font-size: 14px; color: #c8102e; }
.slab-win {
  position: relative; flex: 1; min-height: 0; border-radius: 6px; overflow: hidden;
  background: #0d1012; display: grid; place-items: center;
}
.slab-win img { width: 86%; height: 94%; object-fit: contain; }
/* The mini case on a trainer profile (#277): smaller slabs, as many across as
   fit the profile's width. After the media queries so it wins at every size. */
.case-grid--mini { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }

/* ---- Cert lookup link, under the cert number in the slab editor ---- */
.cert-lookup {
  align-self: flex-start; display: inline-flex; align-items: center;
  min-height: 44px; margin: -8px 0; font-size: 12px; color: var(--link);
  text-decoration: underline; text-underline-offset: 3px;
}
.cert-lookup:hover { color: var(--link-hover); }

/* ---- At grading (#264) ---- */
#slab-panes { margin-bottom: 12px; }
.grading-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.grading-card {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px;
}
.grading-top { display: flex; justify-content: space-between; gap: 8px; }
.grading-meta { margin: 4px 0 10px; }
.grading-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.grading-step {
  width: 100%; min-height: 44px; padding: 4px; font-size: 12px; border-radius: 6px;
  border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer;
}
.grading-step--done { background: var(--green-text); color: var(--on-ink); border-color: transparent; }
.grading-step[aria-current] { font-weight: 700; outline: 2px solid var(--green-text); outline-offset: 1px; }
.grading-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.grading-pick { border: 0; padding: 0; margin: 0; }
.grading-pick ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 40vh; overflow: auto; }
.grading-pick-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.grading-pick-row img { width: 32px; height: auto; }
.grading-back-row { border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 0 0 8px; }
.grading-remove-raw { display: flex; align-items: center; gap: 8px; min-height: 44px; }

/* ---- Sold (#265): Made and Profit, then one row per slab that went ---- */
#sold-strip .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#sold-strip [data-strip="profit"] { grid-column: auto; }
.sold-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sold-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.sold-pic { width: 48px; height: auto; border-radius: 4px; }
.sold-main, .sold-money { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sold-money { align-items: flex-end; text-align: right; }
.sold-name { overflow-wrap: anywhere; }
.sold-meta { font-size: 0.85em; color: var(--muted); overflow-wrap: anywhere; }
.sold-back { margin-top: 4px; }
.sold-how { border: 0; padding: 0; margin: 0 0 10px; }
.sold-how legend { padding: 0; margin-bottom: 4px; }
/* scanner: styles used only by this feature (src/features/scanner). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Card scanner ---- */
.scan-stage {
  position: relative; width: 100%; height: min(62vh, 560px); overflow: hidden;
  background: #111; border-radius: 10px;
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .2s; }
/* Hidden while a freshly opened camera settles (Scanner.tsx, SETTLE_FRAMES). */
.scan-stage video.scan-video--settling { opacity: 0; transition: none; }
.scan-stage--off video { display: none; }
.scan-stage--off .scan-guide, .scan-stage--off .snap-reticle { display: none; }
.scan-tip {
  position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center;
  color: #fff; font-size: 12px; text-shadow: 0 1px 3px #000; pointer-events: none;
}
.scan-stage--off .scan-tip { top: 50%; bottom: auto; transform: translateY(-50%); padding: 0 16px; }
@media (max-width: 600px) {
  .scan-stage { height: 58vh; border-radius: 0; margin: 0 -14px; width: calc(100% + 28px); }
  /* The camera fills the sheet and the shutter row sits at the bottom, in thumb reach. */
  .modal.scan-modal { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
  .scan-modal .scan-stage { flex: 1; height: auto; min-height: 0; }
  .scan-modal .scan-actions { margin: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); }
}

/* Pokémon Snap-style viewfinder: corner brackets, reticle, film counter, shutter. */
.scan-stage::after { /* faint scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px);
}
.scan-guide { position: absolute; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); pointer-events: none; }
.scan-guide i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--gold); filter: drop-shadow(0 0 2px #000); }
.scan-guide i:nth-child(1) { top: -4px; left: -4px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan-guide i:nth-child(2) { top: -4px; right: -4px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan-guide i:nth-child(3) { bottom: -4px; left: -4px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan-guide i:nth-child(4) { bottom: -4px; right: -4px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.snap-reticle {
  position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,0.75); border-radius: 50%; pointer-events: none;
}
.snap-reticle::before, .snap-reticle::after { content: ""; position: absolute; background: rgba(255,255,255,0.75); }
.snap-reticle::before { left: 50%; top: -10px; bottom: -10px; width: 2px; transform: translateX(-50%); }
.snap-reticle::after { top: 50%; left: -10px; right: -10px; height: 2px; transform: translateY(-50%); }
.snap-hud {
  position: absolute; top: 10px; font-family: var(--font-moment); font-size: 11px; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 1px #000; pointer-events: none; letter-spacing: 1px;
}
.snap-hud--tl { left: 12px; }
.snap-hud--tr { right: 12px; }
.snap-rec { color: #ff3b3b; animation: snap-blink 1.2s steps(1) infinite; }
@keyframes snap-blink { 50% { opacity: 0; } }
.snap-shutter-fx { position: absolute; inset: 0; pointer-events: none; }
.snap-shutter-fx span { position: absolute; left: 0; right: 0; height: 50%; background: #000; transform: scaleY(0); }
.snap-shutter-fx span:first-child { top: 0; transform-origin: top; }
.snap-shutter-fx span:last-child { bottom: 0; transform-origin: bottom; }
.snap-shutter-fx.go { animation: snap-flash 0.45s ease-out; }
.snap-shutter-fx.go span { animation: snap-blades 0.28s ease-in-out; }
@keyframes snap-flash { 0% { background: rgba(255,255,255,0.95); } 100% { background: transparent; } }
@keyframes snap-blades { 0%, 100% { transform: scaleY(0); } 45%, 55% { transform: scaleY(1); } }

.scan-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
/* 📷 on the left; an empty 48px twin on the right keeps the shutter centred (#398). */
.scan-photo { flex: 0 0 48px; width: 48px; }
.snap-shutter {
  width: 74px; height: 74px; border-radius: 50%; padding: 0; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(#e3350d 0 47%, #111 47% 53%, #f4f4f4 53%);
  border: 4px solid #111; box-shadow: 0 4px 0 #111; position: relative;
}
.snap-shutter span {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%);
  background: #f4f4f4; border: 4px solid #111; border-radius: 50%;
}
.snap-shutter:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #111; }
.snap-shutter:disabled { filter: grayscale(1); opacity: 0.5; }

.snap-check-title {
  font-family: var(--font-moment); font-size: 13px; text-align: center; margin: 6px 0 10px;
  letter-spacing: 2px; color: var(--ink);
}
.snap-oak {
  display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; padding: 10px 12px;
  background: var(--surface); border: 3px solid var(--edge); border-radius: 8px; min-height: 58px; font-size: 12px;
}
.snap-oak-name { font-family: var(--font-moment); font-size: 9px; color: var(--danger-text); }
@media (prefers-reduced-motion: reduce) {
  .snap-shutter-fx.go, .snap-shutter-fx.go span, .snap-rec { animation: none; }
}

/* ---- Slab scanning ---- */
.scan-guide-label {
  position: absolute; left: 0; right: 0; top: 0; height: 21%;
  border-bottom: 2px dashed rgba(255, 215, 0, 0.8);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-moment); font-size: 10px; letter-spacing: 2px;
  color: rgba(255, 215, 0, 0.85); font-weight: normal; pointer-events: none;
}
.slab-read { margin: 6px 0 10px; font-size: 13px; }
.scan-tip .link-btn { display: inline; min-height: 0; margin: 0; color: inherit; text-decoration: underline; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* Scanner Photo check popup (2026-09-24): results over the camera. */
.scan-find { margin: 16px 0 8px; padding: 12px; border: 2px solid var(--line); border-radius: 8px; background: var(--surface); }
.scan-find label { display: block; margin-bottom: 6px; }
.scan-find-row { display: flex; gap: 8px; }
.scan-find-row input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 0 14px; }
.scan-find .field-hint { margin: 6px 0 0; }
.scan-browse { width: 100%; margin-top: 4px; }
.scan-results-actions { display: flex; justify-content: center; margin-top: 12px; }
.scan-results-actions .btn { min-width: 60%; }
.scan-more { width: 100%; margin-top: 8px; }
/* catch: styles used only by this feature (src/features/catch). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Cutscene --------------------------------------------------------------- */
.cutscene {
  position: fixed; inset: 0; background: #1b1f1c; z-index: 100;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  color: #eee; text-align: center; overflow: hidden;
}
.encounter { position: relative; display: flex; justify-content: center; }
.encounter-base {
  position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 230px; height: 56px; border-radius: 50%;
  background: var(--base, radial-gradient(ellipse at 50% 38%, #b6e889 0 38%, #8fd068 62%, #6cae4f 100%));
  box-shadow: 0 5px 0 var(--base-edge, #4b8a3a), inset 0 -4px 0 rgba(0,0,0,0.08);
}

.encounter-sprite {
  width: 160px; height: 160px; object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(0,0,0,0.5));
  animation: encounter-pop 0.5s ease-out;
}

.ball {
  width: 46px; height: 46px; border-radius: 50%;
  position: relative;
  background: linear-gradient(180deg, var(--ball-top, #d33) 0 48%, #111 48% 52%, #fff 52% 100%);
  border: 3px solid #111;
}
.ball::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  background: #fff; border: 3px solid #111; border-radius: 50%; transform: translate(-50%, -50%);
}
.ball--poke { --ball-top: #dc0a2d; }
.ball--great { --ball-top: #2f6fb0; }
.ball--ultra { --ball-top: #f2b632; }
.ball--master { --ball-top: #6a2fb0; }

.ball-throw { animation: ball-arc 0.9s ease-in forwards; }
.ball-shake { animation: ball-shake 0.55s ease-in-out; }
@keyframes ball-shake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-18deg); }
  40% { transform: rotate(16deg); }
  60% { transform: rotate(-12deg); }
  80% { transform: rotate(8deg); }
}
.ball-flash {
  position: absolute; inset: -30px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.9), rgba(255,255,255,0) 70%);
  animation: ball-flash 0.5s ease-out forwards;
}

/* ---- Type-themed catch scenes ---------------------------------------------------
   The meadow above is the default (Normal/Grass). Each scene only swaps the
   palette variables; night scenes also replace the clouds with stars.
   .cutscene-fx carries weather (snow, embers, rain…) above the backdrop and
   below the Pokémon. */

.cutscene[data-scene="forest"] {
  --sky: linear-gradient(180deg, #7cc4a8 0%, #b5e0c2 25%, #dff2df 42%);
  --field: linear-gradient(180deg, #5da047 0%, #4a8a3a 40%, #3c7430 100%);
  --tree-dark: #174a1f; --tree-light: #23602a;
  --grass-filter: brightness(0.85);
}

.cutscene[data-scene="volcano"] {
  --sky: linear-gradient(180deg, #2a0707 0%, #8f1f0d 28%, #f07a2a 42%);
  --field: linear-gradient(180deg, #6a2c18 0%, #45190f 45%, #2c0f09 100%);
  --tree-dark: #2a0d08; --tree-light: #4a1a0f;
  --grass-filter: hue-rotate(-95deg) saturate(1.6) brightness(0.95);
  --base: radial-gradient(ellipse at 50% 38%, #b3542a 0 38%, #8a3a1c 62%, #5e2412 100%);
  --base-edge: #3a140a;
}

.cutscene[data-scene="sea"] {
  --field:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.18) 0 3px, transparent 3px 22px),
    linear-gradient(180deg, #3aa6dc 0%, #1f73b8 45%, #124f8a 100%);
  --tree-dark: transparent; --tree-light: transparent;
  --base: radial-gradient(ellipse at 50% 38%, #fbe7b0 0 38%, #efd08a 62%, #d8b265 100%);
  --base-edge: #b89048;
}

.cutscene[data-scene="snow"] {
  --sky: linear-gradient(180deg, #8fb4cf 0%, #c6dcea 25%, #eef6fb 42%);
  --field: linear-gradient(180deg, #f7fbfe 0%, #e3eef5 45%, #cddfea 100%);
  --tree-dark: #5f8599; --tree-light: #93b6c8;
  --grass-filter: hue-rotate(95deg) saturate(0.35) brightness(1.7);
  --base: radial-gradient(ellipse at 50% 38%, #ffffff 0 38%, #e3eff7 62%, #c3d9e8 100%);
  --base-edge: #9dbcd1;
}

.cutscene[data-scene="storm"] {
  --sky: linear-gradient(180deg, #232738 0%, #444a66 28%, #7d839e 42%);
  --field: linear-gradient(180deg, #b9ad48 0%, #978b2c 45%, #726821 100%);
  --tree-dark: #2e3522; --tree-light: #414a2e;
  --grass-filter: hue-rotate(-38deg) saturate(1.3) brightness(0.95);
  --base: radial-gradient(ellipse at 50% 38%, #f3de5a 0 38%, #d7bd33 62%, #ab931c 100%);
  --base-edge: #7c6a12;
}
.cutscene[data-scene="night"] {
  --sky: linear-gradient(180deg, #04060f 0%, #111a38 28%, #27325c 42%);
  --field: linear-gradient(180deg, #2a3a26 0%, #1c2919 45%, #121b10 100%);
  --tree-dark: #070d07; --tree-light: #0f1a0f;
  --grass-filter: brightness(0.45);
  --base: radial-gradient(ellipse at 50% 38%, #4f6b3d 0 38%, #3b5230 62%, #2a3b22 100%);
  --base-edge: #18230f;
}
.cutscene[data-scene="haunted"] {
  --sky: linear-gradient(180deg, #0f0920 0%, #2b1a4a 28%, #4d3472 42%);
  --field: linear-gradient(180deg, #312b40 0%, #221e2e 45%, #16131f 100%);
  --tree-dark: #0e0b15; --tree-light: #1b1626;
  --grass-filter: hue-rotate(150deg) saturate(0.5) brightness(0.5);
  --base: radial-gradient(ellipse at 50% 38%, #5d4f75 0 38%, #463a5c 62%, #2f2640 100%);
  --base-edge: #1c1528;
}

.cutscene[data-scene="mystic"] {
  --sky: linear-gradient(180deg, #e46fb1 0%, #f2a8d3 25%, #fde2f1 42%);
  --field: linear-gradient(180deg, #c49ada 0%, #a076c2 45%, #7d55a0 100%);
  --tree-dark: #6a3f8c; --tree-light: #8b5fae;
  --grass-filter: hue-rotate(165deg) saturate(0.9);
  --base: radial-gradient(ellipse at 50% 38%, #f1d4fa 0 38%, #dcb2ee 62%, #b98bd6 100%);
  --base-edge: #8a5fae;
}
.cutscene[data-scene="fairy"] {
  --sky: linear-gradient(180deg, #ffb9dc 0%, #ffd6ea 25%, #fff2f8 42%);
  --field: linear-gradient(180deg, #f8bdd6 0%, #ef9dc1 45%, #e07fab 100%);
  --tree-dark: #e0689d; --tree-light: #f292bb;
  --grass-filter: hue-rotate(215deg) saturate(0.8) brightness(1.15);
  --base: radial-gradient(ellipse at 50% 38%, #fff0f7 0 38%, #fbd3e6 62%, #f2afcf 100%);
  --base-edge: #d9749f;
}

.cutscene[data-scene="desert"] {
  --sky: linear-gradient(180deg, #e9a95a 0%, #f3cb8a 25%, #f9e6bf 42%);
  --field:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.08) 0 10px, transparent 10px 26px),
    linear-gradient(180deg, #ddab66 0%, #c38b48 45%, #a06c33 100%);
  --tree-dark: #93522a; --tree-light: #b0693a;
  --grass-filter: hue-rotate(-62deg) saturate(0.55) brightness(1.15);
  --base: radial-gradient(ellipse at 50% 38%, #edc58c 0 38%, #d9a96a 62%, #bd8a4b 100%);
  --base-edge: #93612d;
}

.cutscene[data-scene="mountain"] {
  --sky: linear-gradient(180deg, #d9502f 0%, #f0934c 26%, #fbd08c 42%);
  --field: linear-gradient(180deg, #b98a50 0%, #93683a 45%, #6e4b28 100%);
  --tree-dark: #5b3222; --tree-light: #7a4630;
  --grass-filter: hue-rotate(-50deg) saturate(0.8);
  --base: radial-gradient(ellipse at 50% 38%, #d8b07a 0 38%, #bf935b 62%, #9c7340 100%);
  --base-edge: #6e4b28;
}

.cutscene[data-scene="swamp"] {
  --sky: linear-gradient(180deg, #5b4c78 0%, #8a7ba8 26%, #b7aecb 42%);
  --field: linear-gradient(180deg, #56643c 0%, #414c2c 45%, #2f381f 100%);
  --tree-dark: #262f1b; --tree-light: #36422a;
  --grass-filter: hue-rotate(35deg) saturate(0.6) brightness(0.8);
  --base: radial-gradient(ellipse at 50% 38%, #8a6bb0 0 38%, #6f5294 62%, #533c73 100%);
  --base-edge: #3a2852;
}

.cutscene[data-scene="sky"] {
  --sky: linear-gradient(180deg, #3f9fdc 0%, #79c3ee 40%, #bfe4f8 70%);
  --field:
    radial-gradient(ellipse 90px 30px at 15% 10%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 120px 34px at 70% 5%, #fff 62%, transparent 64%),
    linear-gradient(180deg, #f4fbff 0%, #dff1fb 100%);
  --tree-dark: transparent; --tree-light: transparent;
  --base: radial-gradient(ellipse at 50% 38%, #ffffff 0 45%, #eaf6fd 70%, #cfe7f5 100%);
  --base-edge: #b3d4ea;
}

.cutscene[data-scene="dusk"] {
  --sky: linear-gradient(180deg, #1b1a4d 0%, #57388a 24%, #e07a4f 42%);
  --field: linear-gradient(180deg, #4b5a7c 0%, #36425f 45%, #242c42 100%);
  --tree-dark: #221d40; --tree-light: #332b58;
  --grass-filter: hue-rotate(190deg) saturate(0.5) brightness(0.6);
  --base: radial-gradient(ellipse at 50% 38%, #8290b3 0 38%, #69779a 62%, #4c587a 100%);
  --base-edge: #2e3753;
}

.cutscene[data-scene="city"] {
  --sky: linear-gradient(180deg, #9aa7b4 0%, #c3ccd5 26%, #e3e8ed 42%);
  --field:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.06) 0 2px, transparent 2px 48px),
    linear-gradient(180deg, #a3abb3 0%, #8a939b 45%, #6f7880 100%);
  --base: radial-gradient(ellipse at 50% 38%, #dfe4e8 0 38%, #c3cad0 62%, #9ea7ae 100%);
  --base-edge: #6f7880;
}
@media (prefers-reduced-motion: reduce) {
  .cutscene-fx, .cutscene-fx::after, .cutscene-sky { animation: none !important; }
}

/* ---- Shiny pulls ------------------------------------------------------------------ */
.ball-flash--shiny {
  inset: -60px;
  background: radial-gradient(circle, #fffbe0 0%, rgba(255,215,64,0.95) 30%, rgba(255,120,200,0.5) 55%, rgba(255,255,255,0) 72%);
  animation: ball-flash 0.9s ease-out forwards;
}
.shiny-pull { animation: screen-shake 0.45s ease-in-out 0.1s 1 both; }
@keyframes screen-shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
.sparkle-burst span {
  position: absolute; width: 12px; height: 12px; margin: -6px;
  background: radial-gradient(circle, #fff 0 25%, #ffd84d 45%, transparent 70%);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  transform: rotate(var(--a)) translateY(0) scale(0.4); opacity: 0;
  animation: sparkle-out 1.1s ease-out forwards;
}

/* ---- Cutscene ---- */
/* Battle-scene backdrop, drawn in CSS: sky + clouds, tree line on the
   horizon, a mown field, tall grass in the foreground, and the oval grass
   platform the wild Pokémon stands on. */
.cutscene-sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70px 20px at 16% 12%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 48px 16px at 22% 9%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 90px 22px at 80% 20%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 56px 18px at 73% 17%, #fff 62%, transparent 64%),
    radial-gradient(ellipse 50px 14px at 52% 30%, rgba(255,255,255,0.85) 62%, transparent 64%),
    var(--sky, linear-gradient(180deg, #5fbde9 0%, #93d4f3 25%, #d4effa 42%));
}
.cutscene-field {
  position: absolute; left: 0; right: 0; top: 42%; bottom: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,0.07) 0 16px, transparent 16px 32px),
    var(--field, linear-gradient(180deg, #8bd466 0%, #6cc04f 35%, #57a943 100%));
}
/* Tree line: two rows of round canopies sitting on the horizon. */
.cutscene-field::before {
  content: ''; position: absolute; left: 0; right: 0; top: -34px; height: 36px;
  background:
    radial-gradient(circle at 50% 100%, var(--tree-dark, #2c6e31) 0 20px, transparent 21px) 0 4px / 44px 36px repeat-x,
    radial-gradient(circle at 50% 100%, var(--tree-light, #3b8a3c) 0 16px, transparent 17px) 22px 0 / 44px 36px repeat-x;
}
.cutscene-grass {
  position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  filter: var(--grass-filter, none);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 90'%3E%3Cpath d='M0 90L5 34L10 90ZM8 90L15 18L21 90ZM19 90L25 40L30 90ZM28 90L36 12L42 90ZM40 90L46 30L51 90ZM49 90L56 20L62 90ZM58 90L62 38L64 90Z' fill='%232f7d33'/%3E%3Cpath d='M3 90L9 52L14 90ZM13 90L20 44L26 90ZM24 90L31 56L36 90ZM34 90L41 46L47 90ZM45 90L52 54L57 90ZM55 90L60 48L64 90Z' fill='%234aa845'/%3E%3C/svg%3E") 0 100% / 64px 110px repeat-x;
}
.cutscene-grass::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -12px; height: 70px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 90'%3E%3Cpath d='M0 90L5 34L10 90ZM8 90L15 18L21 90ZM19 90L25 40L30 90ZM28 90L36 12L42 90ZM40 90L46 30L51 90ZM49 90L56 20L62 90ZM58 90L62 38L64 90Z' fill='%232f7d33'/%3E%3Cpath d='M3 90L9 52L14 90ZM13 90L20 44L26 90ZM24 90L31 56L36 90ZM34 90L41 46L47 90ZM45 90L52 54L57 90ZM55 90L60 48L64 90Z' fill='%234aa845'/%3E%3C/svg%3E") 30px 100% / 52px 70px repeat-x;
  filter: brightness(1.12);
}
.encounter .encounter-sprite { position: relative; }
.cutscene-stage { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; }
@keyframes encounter-pop {
  0% { transform: scale(0.2) translateY(40px); opacity: 0; }
  70% { transform: scale(1.1) translateY(-6px); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}

.cutscene-text {
  font-family: var(--font-moment);
  font-size: 14px;
  background: #fff; color: #111; padding: 14px 18px; border-radius: 6px;
  border: 3px solid #111; min-height: 1.4em; min-width: 260px;
}
@keyframes ball-arc {
  0% { transform: translate(-120px, 60px) scale(0.6) rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(0, 0) scale(1) rotate(420deg); opacity: 1; }
}
@keyframes ball-flash { 0% { opacity: 0; transform: scale(0.3); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(2.4); } }

/* Solid, so it shows on dark scenes (rain, electric) too. */
.cutscene-skip { position: absolute; top: 14px; right: 14px; z-index: 3; background: rgba(255,255,255,0.92); color: #111; border-color: #111; }

.catch-result { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.catch-result img.card-final { width: 160px; border-radius: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.6); }
/* A pill, so the rarity reads on any scene. */
.catch-banner { font-family: var(--font-moment); font-size: 13px; color: var(--gold); background: rgba(0,0,0,0.72); padding: 6px 10px; border-radius: 6px; text-shadow: 0 1px 0 #000; }

/* ---- Views: Pokédex / Sets / Stats ---- */

/* Cutscene result buttons */
.catch-actions { display: flex; gap: 10px; }

/* ---- Mobile readability (2026-09-21) ---- */
@media (max-width: 600px) {
  .catch-banner { font-size: 13px; }
}

/* ---- Type-themed catch scenes ---- */
.cutscene-fx { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cutscene[data-scene="forest"] .cutscene-field::before { top: -58px; height: 60px; background-size: 30px 60px, 30px 60px; }
.cutscene[data-scene="volcano"] .cutscene-sky { filter: saturate(0.6) brightness(0.8); }
.cutscene[data-scene="volcano"] .cutscene-fx {
  background:
    radial-gradient(circle 2px at 20% 30%, #ffb347 90%, transparent),
    radial-gradient(circle 1.5px at 60% 70%, #ff7a1a 90%, transparent),
    radial-gradient(circle 2px at 85% 50%, #ffd27a 90%, transparent);
  background-size: 140px 160px, 110px 130px, 170px 190px;
  animation: fx-rise 4s linear infinite;
}
.cutscene[data-scene="sea"] .cutscene-grass,
.cutscene[data-scene="sky"] .cutscene-grass,
.cutscene[data-scene="city"] .cutscene-grass { display: none; }
.cutscene[data-scene="sea"] .cutscene-fx {
  background:
    radial-gradient(circle 5px at 30% 40%, transparent 60%, rgba(255,255,255,0.7) 65%, transparent 80%),
    radial-gradient(circle 3px at 70% 80%, transparent 55%, rgba(255,255,255,0.6) 62%, transparent 80%);
  background-size: 130px 170px, 90px 120px;
  animation: fx-rise 6s linear infinite;
}
.cutscene[data-scene="snow"] .cutscene-fx {
  background:
    radial-gradient(circle 3px at 25% 20%, #fff 90%, transparent),
    radial-gradient(circle 2px at 70% 60%, #fff 90%, transparent),
    radial-gradient(circle 2.5px at 45% 85%, rgba(255,255,255,0.9) 90%, transparent);
  background-size: 120px 140px, 90px 110px, 160px 170px;
  animation: fx-fall 7s linear infinite;
}
.cutscene[data-scene="storm"] .cutscene-sky { filter: grayscale(0.7) brightness(0.75); }
.cutscene[data-scene="storm"] .cutscene-fx {
  background: repeating-linear-gradient(105deg, transparent 0 14px, rgba(200,215,255,0.35) 14px 15px, transparent 15px 34px);
  background-size: 200px 200px;
  animation: fx-rain 0.5s linear infinite;
}
.cutscene[data-scene="storm"] .cutscene-fx::after {
  content: ''; position: absolute; inset: 0; background: #fffbe0; opacity: 0;
  animation: fx-lightning 5s infinite;
}

/* Night scenes: stars and a moon instead of clouds. */
.cutscene[data-scene="night"] .cutscene-sky,
.cutscene[data-scene="haunted"] .cutscene-sky {
  background:
    radial-gradient(circle 22px at 80% 14%, #fff8d6 90%, transparent 100%),
    radial-gradient(circle 1.5px at 12% 10%, #fff 90%, transparent),
    radial-gradient(circle 1px at 30% 24%, #fff 90%, transparent),
    radial-gradient(circle 1.5px at 48% 8%, #fff 90%, transparent),
    radial-gradient(circle 1px at 62% 30%, #fff 90%, transparent),
    radial-gradient(circle 1px at 92% 34%, #fff 90%, transparent),
    radial-gradient(circle 1.5px at 22% 36%, #fff 90%, transparent),
    var(--sky);
}
.cutscene[data-scene="haunted"] .cutscene-fx {
  background: radial-gradient(ellipse 60% 18% at 50% 72%, rgba(200,180,255,0.18), transparent 70%);
  animation: fx-fog 6s ease-in-out infinite alternate;
}
.cutscene[data-scene="night"] .cutscene-fx,
.cutscene[data-scene="haunted"] .cutscene-sky { animation: fx-twinkle 3s ease-in-out infinite alternate; }
.cutscene[data-scene="mystic"] .cutscene-fx,
.cutscene[data-scene="fairy"] .cutscene-fx {
  background:
    radial-gradient(circle 2px at 20% 30%, #fff 90%, transparent),
    radial-gradient(circle 1.5px at 70% 65%, #fff6c9 90%, transparent),
    radial-gradient(circle 2px at 45% 80%, #fff 90%, transparent);
  background-size: 110px 130px, 150px 120px, 90px 170px;
  animation: fx-twinkle 1.6s ease-in-out infinite alternate, fx-rise 9s linear infinite;
}
.cutscene[data-scene="desert"] .cutscene-field::before { background-size: 70px 36px, 90px 36px; }
.cutscene[data-scene="mountain"] .cutscene-field::before {
  top: -70px; height: 72px;
  background:
    linear-gradient(135deg, transparent 50%, var(--tree-dark) 50%) 0 0 / 72px 72px repeat-x,
    linear-gradient(225deg, transparent 50%, var(--tree-dark) 50%) 36px 0 / 72px 72px repeat-x;
}
.cutscene[data-scene="swamp"] .cutscene-fx {
  background:
    radial-gradient(circle 5px at 30% 60%, rgba(190,120,230,0.55) 80%, transparent),
    radial-gradient(circle 3px at 75% 85%, rgba(160,220,90,0.5) 80%, transparent);
  background-size: 150px 180px, 110px 140px;
  animation: fx-rise 7s linear infinite;
}
.cutscene[data-scene="dusk"] .cutscene-fx { background: radial-gradient(circle 1px at 30% 10%, #fff 90%, transparent) 0 0 / 80px 60px; opacity: 0.7; }
.cutscene[data-scene="city"] .cutscene-field::before {
  top: -64px; height: 66px;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, #5b646c 8px 40px, transparent 40px 58px) 0 100% / 100% 42px no-repeat,
    repeating-linear-gradient(90deg, #7a848d 0 24px, transparent 24px 76px) 0 0 / 100% 66px no-repeat;
}

@keyframes fx-fall { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 30px 140px, -20px 110px, 20px 170px; } }
@keyframes fx-rise { from { background-position: 0 0, 0 0, 0 0; } to { background-position: 10px -160px, -10px -130px, 0 -190px; } }
@keyframes fx-rain { from { background-position: 0 0; } to { background-position: -40px 200px; } }
@keyframes fx-lightning { 0%, 88%, 92%, 100% { opacity: 0; } 89% { opacity: 0.55; } 91% { opacity: 0.25; } }
@keyframes fx-twinkle { from { opacity: 0.65; } to { opacity: 1; } }
@keyframes fx-fog { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
/* Keep the catch-scene text box off the screen edges on phones. */
.cutscene-text { max-width: calc(100vw - 32px); box-sizing: border-box; }

/* ---- Shiny pulls ---- */
.card-final-wrap { position: relative; border-radius: 8px; overflow: hidden; line-height: 0; }
.card-final-wrap.holo::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.55) 38%, rgba(160,220,255,0.45) 45%, rgba(255,180,240,0.45) 52%, transparent 70%);
  background-size: 250% 100%; animation: holo-sweep 2.4s ease-in-out infinite;
}
.card-final-wrap.shiny { box-shadow: 0 0 0 3px #ffd84d, 0 0 28px 6px rgba(255,216,77,0.75); animation: shiny-pulse 1.6s ease-in-out infinite; }
@keyframes holo-sweep { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
@keyframes shiny-pulse { 50% { box-shadow: 0 0 0 3px #fff3b0, 0 0 40px 12px rgba(255,216,77,0.95); } }
.sparkle-burst { position: absolute; left: 50%; top: 42%; width: 0; height: 0; z-index: 3; pointer-events: none; }
@keyframes sparkle-out {
  20% { opacity: 1; }
  100% { transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(1.6); opacity: 0; }
}
.catch-extra {
  font-family: var(--font-moment); font-size: 11px; line-height: 1.6; color: #fff;
  background: rgba(20,20,40,0.82); border: 2px solid var(--gold); border-radius: 6px; padding: 8px 12px;
  max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center;
}
.badge-unlock { animation: badge-pop 0.5s ease-out both; }
@keyframes badge-pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---- Card scanner ---- */

.badge-unlock-icon { width: 32px; height: 32px; vertical-align: middle; image-rendering: pixelated; margin: -6px 2px -6px 0; }

/* ---- Pokédex filter ---- */
/* Add details · Scan next side by side, Done centred on its own line under
   them when they don't all fit (#398: Done sat off-centre). */
.catch-actions { flex-wrap: wrap; justify-content: center; width: 100%; max-width: 520px; }
.catch-actions .btn { flex: 1 1 140px; max-width: 220px; }
.catch-actions #continue-btn { margin-inline: auto; }

/* Wild-encounter transition before the catch scene (encounterWipe). */
.encounter-wipe {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  animation: encounter-flash 0.3s steps(1) 1;
}
.encounter-wipe i {
  flex: 1; background: #1b1f1c; transform: scaleX(0); transform-origin: left;
  animation: encounter-bar 0.3s ease-in 0.3s forwards;
}
.encounter-wipe i:nth-child(even) { transform-origin: right; }
@keyframes encounter-flash {
  0%, 50% { background: #fff; }
  25%, 75%, 100% { background: transparent; }
}
@keyframes encounter-bar { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .encounter-wipe { animation: none; background: #1b1f1c; }
  .encounter-wipe i { animation: none; }
}

/* ---- Wishlist tab ---- */
.toast .toast-scan { background: #fff; border-color: #fff; color: #222; }

/* ---- Slab scanning ---- */
.badge-unlock-row { display: flex; justify-content: center; margin-bottom: 6px; }
.badge-unlock-row .badge-unlock-icon { margin: -6px -6px -6px 0; }

/* ---- After a catch, with the scene Off or Quick (issue #55) ---- */
/* Off: the after-catch bar. The "Logged" toast in two rows: what was logged
   (and any new badge, which wraps instead of being cut off), then the same
   next steps as the catch scene. */
.toast.toast--catch { flex-direction: column; align-items: stretch; gap: 8px;
  width: calc(100vw - 32px); max-width: 440px; padding: 8px 8px 12px 16px; overflow: hidden; }
.toast--catch .toast-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.toast--catch .toast-head > span { flex: 1; min-width: 0; font-size: 13px; white-space: normal; }
.toast--catch .toast-extra { display: block; white-space: normal; color: var(--gold); font-size: 12px; } /* #e8b923 on #222: 8.6:1 */
.toast--catch .toast-close { flex-shrink: 0; width: 44px; height: 44px; background: transparent; border: 0; box-shadow: none;
  color: #fff; font-size: 15px; padding: 0; }
.toast--catch .toast-actions { display: flex; gap: 8px; padding-right: 8px; }
.toast--catch .toast-details { background: #fff; border-color: #fff; color: #222; }
.toast--catch .toast-scan { background: var(--gold); border-color: #7a5c0d; color: #222; }
.toast--catch .toast-undo { background: transparent; border-color: rgba(255,255,255,0.55); color: #fff; box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast--catch { outline: 1px solid rgba(255,255,255,0.18); } }
:root[data-theme="dark"] .toast--catch { outline: 1px solid rgba(255,255,255,0.18); }
.catch-sheet { width: 100%; max-width: 480px; background: var(--screen-bg); color: var(--ink);
  border: 4px solid #111; border-bottom: 0; border-radius: 10px 10px 0 0;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  animation: sheet-up 160ms ease-out; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .catch-sheet { animation: none; } }
.catch-sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.catch-sheet-head .ball { width: 28px; height: 28px; border-width: 2px; flex-shrink: 0; }
.catch-sheet-head .ball::after { width: 8px; height: 8px; border-width: 2px; }
.catch-sheet-head .btn { min-height: 44px; }
.catch-sheet-body { display: flex; gap: 14px; align-items: flex-start; }
.catch-sheet-body .card-final-wrap { width: 112px; flex-shrink: 0; line-height: normal; }
.catch-sheet-body .card-final { display: block; width: 100%; height: auto; }
.catch-sheet-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13px; }
.catch-sheet-meta strong { font-size: 15px; }
.catch-sheet-meta .muted { color: var(--muted); }
.catch-tier { display: inline-flex; align-items: center; gap: 8px; }
.catch-tier .dex-slot-tier { position: static; display: inline-block; }
.catch-sheet-note { margin-top: 6px; padding: 6px 10px; border-radius: 6px; font-size: 13px;
  background: var(--rare-tint); border: 2px solid var(--gold); color: var(--ink); }
.catch-sheet-note strong { font-size: inherit; }
.catch-sheet .catch-actions { margin-top: 16px; }
@media (min-width: 601px) {
  .catch-sheet { max-width: 440px; border-bottom: 4px solid #111; border-radius: 10px; }
}
/* Put it in: which binder a new card goes in */
.put-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.4rem; }
.put-row { display: grid; grid-template-columns: auto 1fr; column-gap: 0.6rem; align-items: center; padding: 0.6rem 0.75rem; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; }
.put-row.current { border-color: var(--gold, #d4a017); }
.put-row-name { font-weight: 600; }
.put-row-where { grid-column: 2; font-size: 12px; color: var(--muted); }
button.put-row { width: 100%; grid-template-columns: 1fr; text-align: left; background: none; color: inherit; font: inherit; }

/* Where your copies are, on the card preview (features/logging/WhereCopies.tsx). */
.where-copies { width: 100%; margin: 0.5rem 0; display: grid; gap: 0.5rem; }
.where-title { margin: 0; font-size: 12px; }
.where-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.where-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.65rem; border: 1px solid var(--line); border-radius: 10px; }
.where-at { min-width: 0; overflow-wrap: anywhere; }
.where-loading { margin: 0; color: var(--muted); }
.where-actions { display: grid; gap: 0.4rem; }

/* Tablet and desktop: the scene and its wipe-in sit inside the Pokédex screen
   (#465). frame.ts sets top, left, width and height; the corners follow the
   screen's rounded bottom (10px outside the 4px border). */
.cutscene.in-frame, .encounter-wipe.in-frame {
  right: auto; bottom: auto; overflow: hidden; border-radius: 0 0 6px 6px;
}
/* logging: styles used only by this feature (src/features/logging). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Search modal ---- */

.pmon-list { display: flex; flex-direction: column; gap: 4px; }
.pmon-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 2px solid transparent;
  border-radius: 6px; background: var(--surface); text-align: left;
  font-size: 14px; color: var(--ink); width: 100%;
}
.pmon-row:hover { border-color: var(--link); }

/* ---- 2.0 + Log (#528, docs/design/blue-sky-2 screens log and pick) ----
   The search box is the hand-off's field: 50px, radius 14, a 1.5px line,
   the magnifier inside on the left and a blue ring when focused. The input
   itself is bare; the wrapper draws the box so the ring wraps the icon too. */
.log-search {
  display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 14px;
  border-radius: 14px; background: var(--surf); color: var(--mut);
  box-shadow: inset 0 0 0 1.5px var(--pline);
}
.log-search:focus-within {
  box-shadow: inset 0 0 0 2px var(--blue), 0 0 0 4px rgba(47, 111, 176, 0.15);
}
.log-search svg { flex-shrink: 0; }
.log-search #pmon-search {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--ink); font-size: 16px;
}
/* The ring is on the wrapper, so the input's own focus outline would double it. */
.log-search #pmon-search:focus-visible { outline: none; }

/* The matching Pokémon are the hand-off's pills, one per row here (each has
   its sprite, so a row reads better than wrapped pills). */
.pmon-list { gap: 8px; }
.pmon-row {
  min-height: 44px; padding: 4px 14px 4px 6px; border: 0; border-radius: 999px;
  background: var(--surf); box-shadow: var(--sh); font-weight: 600; font-size: 13px;
}
.pmon-row:hover { border: 0; box-shadow: var(--sh), inset 0 0 0 2px var(--link); }
.pmon-row img { width: 36px; height: 36px; }

/* The print picker's results: the card itself with the hand-off's card
   shadow (radius 10), and its set and number underneath, with no tile
   behind it. Only in the picker: the set checklist keeps its tiles. */
#picker-grid .card-tile {
  align-items: center; padding: 0; border: 0; background: transparent;
  font-size: 12px; font-weight: 600; color: var(--ink);
}
#picker-grid .card-tile img {
  border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  margin-bottom: 4px;
}
#picker-grid .card-tile strong { font-weight: 600; }
#picker-grid .card-tile .card-meta,
#picker-grid .card-tile .rarity { color: var(--mut); font-weight: 500; opacity: 1; }
/* Owned: the tick on the card says so; the green ring goes round the card
   now there's no tile border to colour. */
#picker-grid .card-tile.owned img { outline: 3px solid var(--green); outline-offset: 2px; }

/* ---- Shiny pulls ---- */
@media (max-width: 600px) {
  .pmon-row { font-size: 16px; }
}

/* ---- Dex toolbar: Filter / Search / Log ---- */

/* Browse-mode card preview */
.card-preview { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.card-preview-stage {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center;
  gap: 8px; width: 100%;
}
.card-preview-art { position: relative; grid-column: 2; grid-row: 1; justify-self: center; width: min(100%, 300px); }
/* ‹ › beside the card, not over its art (#396). */
.card-preview-stage .pager-nav {
  position: static; transform: none; grid-row: 1; border-radius: 8px;
  background: var(--track); color: var(--ink);
}
.card-preview-stage .pager-nav:hover, .card-preview-stage .pager-nav:focus-visible { background: var(--grey); }
.card-preview-stage .pager-nav--prev { grid-column: 1; }
.card-preview-stage .pager-nav--next { grid-column: 3; }
/* Tablet and desktop: the card as large as the screen allows, up to 60% of
   the screen's height (a card is 63 x 88). */
@media (min-width: 601px) {
  .card-preview-art { width: min(100%, calc(var(--screen-h, 100vh) * 0.6 * 63 / 88)); }
}
/* One row of icon buttons under the card. */
.icon-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.card-preview-meta { margin: 0; font-size: 13px; }
@media (max-width: 600px) {
  .card-preview-meta { font-size: 14px; }
}

/* ---- Pokédex filter ---- */
.log-or { text-align: center; margin: 14px 0 8px; opacity: 0.7; }

/* ---- Slab scanning ---- */

.nowrap { white-space: nowrap; }

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {
  .card-preview-meta { font-size: 15px; }
}

/* A must-have's gold star on the card preview (#257). */
.must-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  color: var(--gold);
  background: var(--want-on-bg);
  border: 2px solid #7a5c0d;
  border-radius: 50%;
}
/* friends: styles used only by this feature (src/features/friends). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Friends (friend codes and requests) ---- */
.friend-code-box { display: flex; flex-direction: column; gap: 8px; }
.friend-code {
  font-family: var(--font-moment); font-size: 18px; letter-spacing: 2px; text-align: center;
  padding: 12px 8px; border: 2px dashed var(--edge); border-radius: 6px; background: var(--surface-2); user-select: all;
}
.friend-newcode { align-self: flex-start; }

/* Friend and request tiles: name on the left, small buttons on the right. */
.friend-tile {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--surface-2);
}
.friend-tile .mini-row-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.friend-tile-btn { min-width: 40px; }
.friend-tile-done { grid-column: 1 / -1; }
.friend-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.friend-qr .share-qr { width: 160px; height: 160px; }
/* ranks: styles used only by this feature (src/features/ranks). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Leaderboard ---- */
.lb-main > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-score {
  font-family: var(--font-moment);
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
}

/* ---- Feed ---- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.feed-item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
}
.feed-item img {
  width: 40px;
  border-radius: 3px;
  cursor: zoom-in;
}
.feed-icon img {
  width: 36px;
  height: 36px;
  margin: 0 -6px;
  image-rendering: pixelated;
}
.feed-sub {
  font-size: 12px;
  opacity: 0.7;
}
.feed-when {
  font-size: 12px;
  color: var(--muted);
}
/* Feed: one opened pack = one item, with a strip of the cards. */
.feed-strip {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin: 6px 0 2px;
  scrollbar-width: none;
}
.feed-strip::-webkit-scrollbar {
  display: none;
}
.feed-strip img {
  width: 44px;
  flex-shrink: 0;
  border-radius: 3px;
  cursor: zoom-in;
}
@media (max-width: 600px) {
  .feed-sub,
  .feed-when {
    font-size: 12px;
  }
}

/* ---- Mobile readability (2026-09-21) ---- */
/* ---- Leaderboard ---- */
/* .lb-list is a .tile-list (style.css), but its rows carry a name, a line of
   six stats and a score, so they need the full width: one row per line at
   every size (the shared reflow squeezed them to one word per line, #463). */
.lb-list.tile-list {
  grid-template-columns: minmax(0, 1fr);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.lb-row.me {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 185, 35, 0.35);
}
.lb-rank {
  font-size: 13px;
  min-width: 38px;
  text-align: center;
  font-family: var(--font-moment);
}
.lb-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.lb-sub {
  font-size: 12px;
  opacity: 0.7;
}
/* Each stat stays whole: the line wraps between stats, never inside one. */
.lb-stat {
  white-space: nowrap;
}

@media (max-width: 600px) {
  .lb-main {
    font-size: 15px;
  }
  .lb-sub {
    font-size: 12px;
  }
  .lb-score {
    font-size: 11px;
  }
}

/* ---- Leaderboard buttons, feed, profiles ---- */
button.lb-row {
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.feed-item--rare {
  border-color: var(--gold);
  background: linear-gradient(90deg, var(--rare-tint), var(--surface));
}
.feed-item--badge {
  background: var(--badge-tint);
  border-color: var(--badge-line);
}
.feed-icon {
  display: flex;
  min-width: 40px;
  max-width: 72px;
  justify-content: center;
}
.feed-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.15;
}
.profile-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}
/* Binder covers on a shelf (#277), as on the Dex's binder shelf. */
.profile-binders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
}
.profile-binder {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
/* Tapping a cover opens the binder read-only (FriendBinder). */
.profile-binder-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.profile-binder-name {
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-card {
  margin: 0;
}
.profile-card figcaption {
  font-size: 12px;
  text-align: center;
  opacity: 0.75;
  margin-top: 2px;
}
.trade-meta {
  display: block;
  font-size: 12px;
}
.profile-card.holo img {
  box-shadow: 0 0 0 2px var(--gold);
}

/* ---- Shiny pulls ---- */
@media (max-width: 600px) {
  .feed-text {
    font-size: 13px;
  }
  .profile-card figcaption {
    font-size: 12px;
  }
}

/* ---- Header (all sizes): one line — lens, count, account button ---- */

/* ---- Phone layout ---- */
@media (max-width: 600px) {
  /* Leaderboard rows: name + score on top, stats underneath at full width. */
  .lb-row {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    grid-template-areas: 'rank main score';
    column-gap: 10px;
    padding: 10px;
  }
  .lb-rank {
    grid-area: rank;
    min-width: 0;
  }
  .lb-main {
    grid-area: main;
  }
  .lb-score {
    grid-area: score;
    align-self: start;
    padding-top: 4px;
  }
  .lb-sub {
    font-size: 12px;
  }
}

/* ---- Slabs ---- */
.feed-item--slab {
  border-color: #9aa6ae;
  background: linear-gradient(90deg, var(--slab-tint), var(--surface));
}

/* ---- Wishlist tab ---- */
.feed-item--pack .feed-text {
  min-width: 0;
}
.feed-strip-more {
  align-self: center;
  flex-shrink: 0;
  font-size: 12px;
  opacity: 0.7;
  padding: 0 4px;
}

/* ---- Slab scanning ---- */
/* The feed's thumbnail strip scrolls sideways: fade the edge to show there's more. */
.feed-strip--more {
  -webkit-mask-image: linear-gradient(to right, #000 82%, transparent);
  mask-image: linear-gradient(to right, #000 82%, transparent);
}

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {
  /* Ranks, feed, trainer profiles */
  .lb-main {
    font-size: 15px;
  }
  .lb-sub {
    font-size: 12px;
  }
  .feed-text {
    font-size: 13px;
  }
  .feed-sub,
  .feed-when {
    font-size: 12px;
  }
  .profile-card figcaption {
    font-size: 12px;
  }
}

/* ---- Ranks: Feed · Leaderboard · Friends (RanksView) ----
   Phone: one at a time, by the switch. Tablet: the feed and leaderboard side
   by side, so the switch drops Leaderboard (Feed shows both). Desktop:
   friends · feed · leaderboard in three columns and no switch. */
.ranks-seg {
  margin: 0 0 14px;
}
.seg-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 6px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--gold);
  border: 1px solid #1c1c1c;
}
.ranks-col {
  min-width: 0;
}
.ranks-col > .section-title:first-child {
  margin-top: 0;
}
/* An empty feed fills the rest of its column, centred in it. */
#feed {
  display: flex;
  flex-direction: column;
  flex: 1;
}
#feed > .feed,
.feed > .empty-screen {
  flex: 1;
}
.ranks:not([data-panel='feed']) .ranks-col--feed,
.ranks:not([data-panel='leaderboard']) .ranks-col--leaderboard,
.ranks:not([data-panel='friends']) .ranks-col--friends {
  display: none;
}

@media (min-width: 601px) and (max-width: 1024px) {
  /* Feed shows the leaderboard too here, so Feed reads as open for either. */
  .ranks-seg .pill:nth-of-type(2) {
    display: none;
  }
  .ranks-seg:has(.pill:nth-of-type(2)[aria-current='true']) .pill:nth-of-type(1) {
    background: var(--blue);
    color: #fff;
    border-color: #163656;
    font-weight: 600;
  }
  .ranks:not([data-panel='friends']) {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--space-4);
    /* Side by side at the same height (#442): both columns stretch to the
       taller one, so their tops and bottoms line up. */
    align-items: stretch;
  }
  .ranks:not([data-panel='friends']) :is(.ranks-col--feed, .ranks-col--leaderboard) {
    display: flex;
    flex-direction: column;
  }
}

@media (min-width: 1025px) {
  #view-body[data-view='ranks'] {
    max-width: 1500px;
  }
  .ranks-seg {
    display: none;
  }
  .ranks {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: var(--space-5);
    align-items: stretch;
  }
  .ranks[data-panel] .ranks-col.ranks-col {
    display: flex;
    flex-direction: column;
  }
  /* The friends column is only a third of the width, so its tiles (and the
     request tiles) stack one to a row; the shared three-column reflow would
     squeeze the names to nothing and push the buttons over them. */
  .ranks-col--friends .tile-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---- Picture feed: bigger pack pictures, and big pulls ---- */
.feed-strip img {
  width: 56px;
}
.feed-item--big {
  align-items: flex-start;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 185, 35, 0.35);
  background: linear-gradient(90deg, var(--rare-tint), var(--surface));
}
.feed-item--big > .feed-sleeve {
  width: 96px;
}
.feed-big-tag {
  align-self: flex-start;
  font-family: var(--font-moment);
  font-size: 10px;
  background: var(--gold);
  color: #1c1c1c;
  border: 1px solid #1c1c1c;
  border-radius: 4px;
  padding: 3px 5px;
  margin-bottom: 4px;
}
.feed-price {
  font-family: var(--font-moment);
  font-size: 12px;
  color: var(--ink);
  margin: 4px 0 2px;
}
@media (max-width: 600px) {
  .feed-item--big > .feed-sleeve {
    width: 88px;
  }
}
@media (min-width: 1025px) {
  .feed-big-tag {
    font-size: 10px;
  }
  .feed-price {
    font-size: 13px;
  }
}

/* Reactions (#408): press and hold a tile (or right-click it, or press R) and
   it turns into the picker; reactions given show as stamps under the text. */
.feed-item {
  position: relative;
}
.feed-item--reactable {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.feed-item--reactable img {
  -webkit-user-drag: none;
}
.feed-item--picking {
  justify-content: center;
  border-color: var(--gold);
}
.feed-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}
.feed-picker-title {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.feed-picker-row {
  display: flex;
  gap: 12px;
}
.feed-react {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-width: 76px;
  height: 52px;
  padding: 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.feed-react .stamp-icon {
  width: 24px;
  height: 24px;
}
.feed-react--on {
  border-color: #f58220;
}

/* ---- Leaderboard top three: trainer cards (#493) ---- */
/* 1st is full width with the counter as the hero; 2nd and 3rd sit side by
   side. The edge stripe is decoration: the place is also written (1ST). */
.lb-podium {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.lb-card-1 {
  grid-column: 1 / -1;
}
.lb-card > button {
  --stripe: var(--red);
  position: relative;
  width: 100%;
  min-height: 44px;
  display: grid;
  gap: 10px;
  padding: 14px 12px 12px 18px;
  background: var(--surf);
  border: 0;
  border-radius: var(--radius-tile);
  box-shadow: var(--sh);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.lb-card > button::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--stripe);
}
.lb-card-1 > button {
  --stripe: var(--gold);
}
.lb-card-2 > button {
  --stripe: #aab3bb; /* silver, decorative */
}
.lb-card-3 > button {
  --stripe: #c08050; /* bronze, decorative */
}
.lb-card.me > button {
  background: var(--goldbg);
}
.lb-place {
  position: absolute;
  top: 10px;
  right: 12px;
  font: 10px var(--font-moment);
  color: var(--mut);
}
.lb-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-right: 30px;
}
.lb-card-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.lb-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 48px;
  border-radius: 8px;
  background: var(--quiet);
  font-weight: 800;
  font-size: 18px;
  overflow: hidden;
}
.lb-card-1 .lb-avatar {
  width: 52px;
  height: 62px;
  border-radius: 10px;
  font-size: 22px;
}
.lb-card-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.2;
}
.lb-counter {
  font: 11px/1.4 var(--font-moment);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-card-1 .lb-counter {
  font-size: 18px;
}
.lb-counter-of {
  font-size: 10px;
  color: var(--mut);
}
/* 2nd and 3rd are half width on a phone: the "/ 1025" doesn't fit. */
.lb-card:not(.lb-card-1) .lb-counter-of {
  display: none;
}
/* On a narrow phone (360px) a half card has about 150px. Put the 2ND / 3RD
   label above the row instead of beside the name, so the name gets the
   whole width next to the avatar rather than losing 30px to the label. */
.lb-card:not(.lb-card-1) > button {
  padding: 26px 10px 12px 14px;
}
.lb-card:not(.lb-card-1) .lb-card-top {
  padding-right: 0;
}
.lb-card:not(.lb-card-1) .lb-avatar {
  width: 34px;
  height: 42px;
  font-size: 16px;
}
.lb-dexbar {
  display: block;
  height: 6px;
  border-radius: 99px;
  background: var(--quiet2);
  overflow: hidden;
}
.lb-dexbar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--red);
}
/* Your own row stays in view at the bottom while it's scrolled off. */
.lb-list .lb-row.me {
  position: sticky;
  bottom: 8px;
  z-index: 1;
}

/* Compare with a friend: You | friend columns, the better number in green. */
.compare-grid {
  display: grid;
  gap: 0.25rem;
}
.compare-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--rule);
}
.compare-val {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.compare-win {
  color: var(--green-text);
}

/* ---- Weekly challenge (#280): the feed banner and its popup ---- */
.challenge-banner {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 8px;
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
}
.challenge-banner > img,
.challenge-head img {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  flex: none;
}
.challenge-banner .feed-text {
  flex: 1;
  min-width: 0;
}
.challenge-bar {
  width: 100%;
  flex: none;
}
.challenge-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: var(--space-3);
}
.challenge-title {
  font-weight: bold;
  margin: 0;
}
.challenge-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.challenge-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
/* The sprite fills its box (.trainer-sprite is 100% wide), so the row needs
   a fixed-size box around it or it takes the whole row. */
.challenge-avatar {
  flex: none;
  overflow: hidden;
}
.challenge-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.challenge-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.challenge-count {
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* ---- Feed: cards in sleeves, reactions as Poké Ball stamps (#493) ---- */
/* The sleeve is a clear plastic edge with a soft glare across the card; a
   rare card or big pull adds a still holo sheen (no motion, so nothing to
   turn off for reduced motion). */
.feed-sleeve {
  position: relative;
  flex: none;
  width: 54px;
  padding: 2px;
  border-radius: 8px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0.35)
  );
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    0 4px 10px rgba(0, 0, 0, 0.18);
}
.feed-sleeve img,
.feed-item .feed-sleeve img {
  display: block;
  width: 100%;
  border-radius: 6px;
}
.feed-sleeve::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 56%
  );
  pointer-events: none;
}
.feed-sleeve--holo::before {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: linear-gradient(
    120deg,
    rgba(255, 80, 120, 0.3),
    rgba(80, 220, 255, 0.3),
    rgba(255, 230, 80, 0.3)
  );
  mix-blend-mode: screen;
  pointer-events: none;
}
.feed-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.feed-stamp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 8px 0 3px;
  border-radius: 999px;
  background: var(--quiet, var(--surface));
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* The stamps you gave: a ring, not a colour alone (the picker says which). */
.feed-stamp--mine {
  box-shadow: inset 0 0 0 2px var(--gold);
}
.feed-stamp .stamp-icon {
  width: 18px;
  height: 18px;
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .feed-stamp {
    animation: stamp-in 0.12s ease-out;
  }
}
@keyframes stamp-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
/* account: styles used only by this feature (src/features/account). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Wishlist tab ---- */

/* Account → Trainers (admins): reset links */
.admin-trainer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 10px;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 8px;
  padding: 8px 10px;
}
.admin-trainer .set-row-sub {
  overflow-wrap: anywhere;
}
/* On a phone the name and email get the full row; the buttons sit on their own
   line below instead of squeezing the email into a sliver. */
@media (max-width: 480px) {
  .admin-trainer {
    grid-template-columns: 1fr;
  }
  .admin-trainer > .reset-actions .btn {
    flex: 1;
  }
}
.reset-out {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- Requests (join / new password), approved by an admin ---- */
.request-warn {
  font-size: 12px;
  color: var(--warn-text);
}
/* Open sign-up: today's new accounts against the cap (Account → Requests). */
.signups-status {
  margin: 0 0 8px;
}
.signups-full {
  color: var(--warn-text);
}

/* ---- In-app confirm / alert (askConfirm) ---- */

/* Filter: "Only" toggles read as tick boxes, not as another pick-one choice. */

/* Account → Help */
.acct-help {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ---- Binder pages (Settings → Binder pages / Page numbers) ---- */

.binder-size {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.binder-size > span[aria-hidden] {
  font-size: 14px;
  padding-bottom: 6px;
}
.binder-size .field-hint {
  padding-bottom: 8px;
}

/* ---- Account menu (a short list; each row opens its own page) ---- */
.acct-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 14px;
  border: 2px solid var(--edge);
  border-radius: 10px;
  background: var(--surface);
}
.acct-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-family: var(--font-moment);
  font-size: 16px;
  border: 2px solid var(--edge);
}
.acct-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 12px;
}
.acct-card-text span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  border: 2px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}
.acct-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  text-align: left;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
}
.acct-row:last-child {
  border-bottom: 0;
}
.acct-row:hover {
  background: var(--surface-2);
}
.acct-row:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--ring-inset);
}
.acct-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.acct-row-main span {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-row-go {
  font-size: 15px;
  color: var(--muted);
}
.acct-count {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #1c1c1c;
  font-family: var(--font-ui);
  font-size: 12px;
}
.acct-subhead h2 {
  text-align: center;
}
.acct-help--stack {
  grid-template-columns: 1fr;
}

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {
  /* Account */
  .acct-card-text {
    font-size: 13px;
  }
  .acct-row-main {
    font-size: 13px;
  }
  .acct-row-main span {
    font-size: 12px;
  }
  .binder-size label {
    font-size: 13px;
  }
}

/* ---- Admin switches (#112) ---- */
.switch-field {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

/* ---- Account → Switches (admins only) ---- */
.switch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 14px;
  min-height: 64px;
  border-bottom: 1px solid var(--rule);
}
.switch-row:last-child {
  border-bottom: 0;
}
.switch-row .acct-row-main span {
  white-space: normal;
} /* the sub-line may wrap */
/* A source under "Card pictures": indented, on the softer surface. */
.switch-row--sub {
  padding-left: 30px;
  background: var(--surface-2);
}

/* The On / Off control is the app's .seg, narrower, and Off reads as a
   warning when it's picked: white on --red-dark is 5.9:1. */
.seg--switch {
  width: 132px;
}
.seg--switch label {
  padding: 9px 4px;
}
.seg--switch input[value='off']:checked + label {
  background: var(--red-dark);
  color: #fff;
}
.seg--switch input:disabled + label {
  cursor: default;
}
.seg--switch:has(input:disabled) {
  opacity: 0.5;
}

/* Account menu: the row's sub-line when anything is off. */
.acct-row-main span.acct-warn {
  color: var(--warn-text);
}

/* Recent changes */
.switch-log {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.switch-log .mini-row {
  cursor: default;
}
.switch-log .mini-row-main span {
  font-size: 12px;
  color: var(--muted);
}
.switch-log .mini-row-main strong .is-off {
  font-size: inherit;
  color: var(--red-text);
}
.switch-log .mini-row-main strong .is-on {
  font-size: inherit;
  color: var(--green-text);
}

/* Import cards (ImportCards.tsx): Account → Your data. Existing tokens only. */
.import-file {
  position: relative;
  cursor: pointer;
}
.import-busy {
  padding: 12px 0;
}
.import-bar {
  animation: import-busy 1.2s ease-in-out infinite alternate;
}
@keyframes import-busy {
  from {
    opacity: 0.4;
  }
  to {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .import-bar {
    animation: none;
    opacity: 0.5;
  }
}
.import-group {
  margin-top: 18px;
}
.import-group .section-title {
  margin-bottom: 6px;
}
.import-select {
  margin: 0 0 8px;
  text-align: right;
  font-size: 16px;
}
.import-row {
  min-height: 56px;
  flex-wrap: wrap;
  background: var(--surface);
}
.import-row--off {
  border-style: dashed;
  color: var(--muted);
}
.import-row--missing {
  color: var(--red-text);
  gap: 8px;
}
.import-row-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  text-align: center;
  cursor: pointer;
}
.import-row-main .import-tick {
  order: 3;
  margin-left: auto;
}
.import-row-main input {
  accent-color: var(--blue);
  width: 22px;
  height: 22px;
  flex: none;
}
.import-row small {
  color: var(--muted);
  font-size: 12px;
}
.import-row .import-warn {
  color: var(--warn-text);
}
.import-row .btn--sm {
  min-height: 44px;
}
.import-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  width: 100%;
}
.import-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.import-tile img {
  width: 64px;
}
.import-tile[aria-pressed='true'] {
  border: 3px solid var(--link);
}
.import-tile[aria-pressed='true']::after {
  content: '✓';
  color: var(--link);
}
.import-foot {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--rule);
  background: var(--screen-bg);
  margin-top: 12px;
}
.import-headline {
  font-family: var(--font-moment);
  color: var(--red-text);
}
.import-newdex {
  color: var(--money);
  font-size: 15px;
}
.import-missing .mini-row {
  color: var(--red-text);
}

/* Profile picture (#410): Initial or Pokémon, then a grid of round sprites.
   The chosen one gets the same blue as other choices (.seg). */
.acct-picture {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.acct-picture-label {
  font-weight: 600;
}
.avpick {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: var(--space-1);
}
.avpick button {
  aspect-ratio: 1;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.avpick button.on {
  box-shadow: 0 0 0 3px var(--blue);
}
.avpick button:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--ring);
}
.avpick img {
  width: 90%;
  image-rendering: pixelated;
}
@media (max-width: 600px) {
  .avpick {
    grid-template-columns: repeat(5, 1fr);
    max-width: 280px;
    margin: 0 auto;
  }
}
/* dex: styles used only by this feature (src/features/dex). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Dex grid ---- */

.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.dex-slot {
  background: var(--surface); border: 2px solid var(--line); border-radius: 8px; padding: 6px 4px;
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  position: relative;
}
.dex-slot.caught { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(232,185,35,0.35); } /* zoomed sprites stay inside (no sideways scroll) */
/* Zoomed to the Pokémon's own bounding box by spriteFit() in src/lib/sprites.ts */
.dex-slot .dex-sprite img { position: absolute; max-width: none; height: auto; image-rendering: pixelated; }
.dex-slot-num { font-size: 12px; color: var(--muted); } /* --muted on --surface is 7:1 light, 6.5:1 Night; the old 0.6 opacity was 4.48:1 */
.dex-slot-name { font-size: 13px; line-height: 1.1; }

/* ---- Dex entry ---- */
.catch-history { display: flex; flex-direction: column; gap: 8px; }
.catch-item { display: flex; gap: 10px; align-items: center; background: var(--surface); border: 2px solid var(--line); border-radius: 8px; padding: 8px; }
.catch-item.best { border-color: var(--gold); }
.catch-item .meta { flex: 1; font-size: 12px; }
.catch-item .best-tag { color: var(--gold-text); font-size: 12px; }

@media (max-width: 480px) {
  .dex-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .dex-sprite { width: 46px; height: 46px; }
}

/* ---- Views: Pokédex / Sets / Stats ---- */

/* Dex entry copies */
.catch-item { align-items: flex-start; }
.catch-item-actions { display: flex; flex-direction: column; gap: 4px; }
.copy-details { font-size: 12px; color: var(--link); }
.copy-money { font-size: 12px; color: var(--ink); }
.copy-notes { font-size: 12px; font-style: italic; opacity: 0.8; }

/* ---- Mobile readability (2026-09-21) ---- */
@media (max-width: 600px) {
  .dex-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .dex-slot-num { font-size: 12px; }
  .dex-slot-name { font-size: 13px; }
  .catch-item .meta { font-size: 13px; }
  .catch-item .best-tag { font-size: 12px; }
  .copy-details, .copy-money, .copy-notes { font-size: 13px; }
}

/* ---- Card zoom (tap a logged card's thumbnail) ---- */
.catch-item img.zoomable { cursor: zoom-in; }

/* ---- Type-themed catch scenes ---- */

/* Type badges (dex entry). Official game colours. */
.type-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.type-badge {
  font-family: var(--font-moment); font-size: 9px; text-transform: uppercase;
  color: #fff; padding: 5px 8px; border-radius: 4px; text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  background: #a8a77a;
} /* #d685ad -> #d685ad, 6.3:1 */
.type-badge { background: var(--tc, #a8a77a); color: var(--tt, #1c1c1c); text-shadow: none; }
@media (max-width: 600px) { .type-badge { font-size: 10px; } }

/* ---- Dex toolbar: Filter / Search / Log ---- */
.dex-toolbar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.btn--active { background: var(--ink); color: var(--on-ink); }

/* ---- Phone layout ---- */
@media (max-width: 600px) {

  /* Dex entry: card thumbnail a bit bigger, buttons side by side under the text. */
  .catch-item { flex-wrap: wrap; }
  .catch-item .meta { flex: 1 1 60%; }
  .catch-item-actions { flex-direction: row; width: 100%; }
  .dex-grid { gap: 8px; }
}

/* ---- The row under the toolbar (desktop only): "Turn to" and full screen ---- */
.dex-mode-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 10px; }
/* "Turn to" menu: desktop flip-book only (DexView). */
.binder-jump { margin-right: auto; display: flex; align-items: center; gap: 8px; font-size: 13px; }
/* Full screen on/off: a round icon button at the end of that row. */
.binder-full-btn {
  position: relative; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; box-sizing: border-box;
  border: 2px solid var(--edge); border-radius: 50%; background: var(--surface); color: var(--ink);
  font-size: 12px; line-height: 1;
}
.binder-full-btn svg { width: 16px; height: 16px; }
/* Drawn at 29px to sit with the "Turn to" row, but the tap area is 44x44
   (#489): an invisible layer takes the taps. It is placed from inside the 2px
   border (a 25px box), so 9.5px each side. */
.binder-full-btn::after { content: ''; position: absolute; inset: -9.5px; border-radius: 50%; }
.binder-full-btn:hover { background: var(--surface-2); }
.binder-full-btn:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }

/* 2.0 pockets (components.md, Pocket): 63:88, 8px radius, the --pocket fill
   with a --pline inset line, straight on the screen colour. The card fills its
   pocket with a soft shadow and the sleeve sheen; an empty pocket shows the
   silhouette, the number and the name. Labels use --ink: --mut on --pocket is
   4.47:1 at 11px, just under AA (tokens.md). */
.dex-grid--binder {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; padding: 0; background: none; box-shadow: none;
}
.binder-slot {
  position: relative; aspect-ratio: 63 / 88; padding: 0; border: 0; border-radius: 8px;
  background: var(--pocket); overflow: hidden; color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--pline);
}
.binder-slot.caught:not(.no-art) { box-shadow: var(--sh); }
/* Sleeve sheen over the card */
.binder-slot.caught:not(.no-art)::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 35%);
}
.binder-slot .dex-slot-tier { top: 8px; right: 8px; }
.binder-pocket {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: inherit;
  font-weight: 600; line-height: 1.1; text-align: center; padding: 0 4px;
}
.binder-pocket .dex-slot-num { opacity: 1; color: inherit; }
.binder-sprite { position: relative; width: 78%; aspect-ratio: 1; flex-shrink: 0; }
.binder-pocket .binder-sprite img { position: absolute; max-width: none; height: auto; image-rendering: pixelated; }
.binder-slot.uncaught .binder-pocket img { filter: var(--silhouette); opacity: 0.18; }
.binder-slot:hover { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (max-width: 600px) {
  .dex-grid--binder { grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 8px; padding: 8px; }
  .binder-pocket .dex-slot-name { font-size: 12px; }
  .binder-pocket .dex-slot-num { font-size: 12px; }
}

/* Flash the Pokémon you just logged, after the dex scrolls to it. */
.dex-slot.just-caught, .binder-slot.just-caught { animation: just-caught 0.9s ease-in-out 1; position: relative; z-index: 1; }
@keyframes just-caught {
  40% { transform: scale(1.08); box-shadow: 0 0 0 3px var(--gold), 0 0 16px 4px rgba(232,185,35,0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .dex-slot.just-caught, .binder-slot.just-caught { animation: none; box-shadow: 0 0 0 3px var(--gold); }
}

/* Generation tabs + Filter/Search/Log stay pinned under the top bar, so they
   can be reached from the bottom of the dex without scrolling back up.
   --topbar-h is set by syncTopbarHeight() (the top bar is only sticky on phones). */
.dex-controls {
  position: sticky; top: calc(var(--topbar-h, 0px) + var(--tabs-h, 0px)); z-index: 15;
  background: var(--screen-bg);
  margin: 0 -16px 10px; padding: 8px 16px 2px;
  box-shadow: 0 6px 6px -6px rgba(0, 0, 0, 0.25);
}
@media (max-width: 600px) {
  .dex-controls {
    margin: 0 -14px 10px; padding: 8px 14px 2px;
    /* Redraw the screen's dark side lines the bar covers (#372). */
    box-shadow: inset 2px 0 0 #1c1c1c, inset -2px 0 0 #1c1c1c, 0 6px 6px -6px rgba(0, 0, 0, 0.25);
  }
}

/* ---- Card scanner ---- */
.dex-toolbar { grid-template-columns: repeat(3, 1fr); }

/* ---- Pokédex filter ---- */
.filter-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px;
}
.filter-summary[hidden] { display: none; }
.summary-chip {
  font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 2px solid var(--edge);
}
.summary-chip:not(.type-chip) { background: var(--surface); }
.summary-clear { font-size: 12px; padding: 4px 6px; background: none; border: 0; color: var(--link); text-decoration: underline; }
.filter-count { font-size: 12px; opacity: 0.7; }
.filter-sheet-inner {
  display: flex; flex-direction: column; width: 100%; max-width: 640px; height: 100%;
}
.filter-sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  border-bottom: 2px solid var(--rule);
}
.filter-sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 20px; }
.filter-sheet-foot {
  display: flex; gap: 8px; padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--rule);
}
.filter-sheet-foot #filter-done { flex: 2; }
.filter-label { font-size: 12px; font-weight: bold; margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }

/* Type chips reuse the official type colours, faded until selected. */
.type-chip {
  font-size: 12px; padding: 6px 10px; border-radius: 6px; text-transform: capitalize;
  background: var(--surface); color: var(--ink); border: 2px solid var(--tc, #a8a77a); text-shadow: none;
}
.type-chip.on { background: var(--tc, #a8a77a); color: var(--tt, #1c1c1c); border-color: var(--edge); box-shadow: 0 2px 0 rgba(0,0,0,0.3); }

@media (max-width: 600px) {
  .summary-chip, .summary-clear, .filter-count { font-size: 12px; }
  .type-chip { font-size: 12px; padding: 8px 6px; }
  .filter-label { font-size: 12px; }
}

/* Wishlist filter: the wished-for card in each pocket, marked with a star. */
.wish-mark {
  position: absolute; bottom: 5px; right: 5px; z-index: 1;
  width: 22px; height: 22px; line-height: 20px; text-align: center; font-size: 12px;
  color: var(--gold); background: rgba(20,20,40,0.8); border: 1px solid var(--gold); border-radius: 50%;
}

/* Details editor straight after a catch: Save / Save & scan next. */
.edit-actions { display: flex; gap: 8px; }

/* ---- A pocket, opened (entries.tsx) ----
   One surface from the title bar to the pocket strip (the screen colour), the
   card large in a glossy sleeve, then the text and two rows of same-sized
   buttons (#332). Centred on tablet and desktop; the phone layouts are further
   down. Theme tokens only, so it reads in light and dark (#339). */
.pager-page.pocket-page { color: var(--ink); padding-top: 10px; text-align: center; }
/* Title: the binder's name (cut with … when long) over "Page 1 · pocket 1". */
.modal--pocket .modal-header h2 { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pocket-title-binder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pocket-title-spot { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0; color: var(--muted); }
.modal--pocket .modal-header .btn { min-height: var(--tap); min-width: 64px; }
.sleeve {
  position: relative; width: min(64vw, 260px); aspect-ratio: 63 / 88; margin: 0 auto;
  border-radius: 10px; padding: 6px; box-sizing: border-box;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line), 0 8px 18px rgba(0,0,0,0.3);
}
/* The gloss: a soft diagonal shine over the card. */
.sleeve::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,0.28) 0%, rgba(255,255,255,0.05) 30%, transparent 55%, rgba(255,255,255,0.08) 100%);
}
.sleeve img.zoomable { width: 100%; height: 100%; object-fit: contain; border-radius: 6px; cursor: zoom-in; }
/* Empty: the Pokémon's faint outline, nothing more. */
.sleeve--empty { display: grid; place-items: center; }
/* An empty pocket reads as empty: a dashed outline inside the sleeve. */
.sleeve--empty::before { content: ''; position: absolute; inset: 10px; border: 2px dashed var(--line); border-radius: 6px; }
.sleeve-outline { position: relative; width: 80%; aspect-ratio: 1; }
.sleeve-outline img {
  position: absolute; max-width: none; height: auto; image-rendering: pixelated;
  filter: var(--silhouette); opacity: 0.18;
}
.pocket-name { margin: 12px 0 4px; font-size: 15px; line-height: 1.4; text-wrap: balance; }
.pocket-set { margin: 0; font-size: 12px; }
.pocket-meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
/* Lines break at a dot, never in the middle of an item. */
.pocket-set span, .pocket-meta span { white-space: nowrap; }
/* One button style: the app's .btn, equal widths, 44px tall. */
.pocket-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; margin: 12px auto 0; max-width: 440px; }
.pocket-row .btn { min-height: var(--tap); padding: 8px 6px; white-space: nowrap; }
/* On (Wanted) or open (copies, Collecting): pressed in. The words change too. */
.pocket-row .btn:is([aria-pressed="true"], [aria-expanded="true"]) {
  background: var(--track); box-shadow: inset 0 2px 0 rgba(0,0,0,0.25); transform: translateY(2px);
}
.pocket-row .btn:focus-visible, .pocket-strip .pager-nav:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
/* "Every Bulbasaur card": says what Checklist and Collect are about. */
.pocket-about { margin: 12px 0 0; font-size: 0.8em; color: var(--muted); }
.pocket-about + .pocket-row { margin-top: 4px; }
.pocket-row .collect-toggle { display: grid; }
.pocket-copies { width: 100%; margin-top: 10px; text-align: left; color: var(--ink); }
.pocket-copies > .btn--ghost { align-self: flex-start; }
/* The Pager's ‹ › sit at the two ends of the strip. */
.pocket-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  margin-top: 14px; font-size: 12px;
}
.pocket-strip .pager-nav { position: static; transform: none; width: 44px; height: 44px; border-radius: 8px; background: var(--track); color: var(--ink); }
.pocket-strip .pager-nav:hover, .pocket-strip .pager-nav:focus-visible { background: var(--grey); }

/* ---- Slab scanning ---- */

/* Skip link past the Dex grid: hidden until focused by keyboard (2026-09-24). */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { position: static; display: block; margin: 6px 0; padding: 8px; background: var(--surface); border: 2px solid var(--edge); border-radius: 6px; text-align: center; color: var(--ink); }
@media (max-width: 600px), (pointer: coarse) {
  .skip-link:focus { min-height: var(--tap); box-sizing: border-box; display: flex; align-items: center; justify-content: center; }
}
/* First run: what to do with 1,025 empty slots. */
.first-run { margin: 8px 0 12px; padding: 12px; border: 2px dashed var(--edge); border-radius: 8px; background: var(--surface); text-align: center; }
.first-run p { margin: 0 0 8px; }
.first-run-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
/* Phones, upright: the card as large as fits, the strip pinned to the bottom. */
@media (max-width: 600px) and (orientation: portrait), (max-width: 600px) and (min-height: 501px) {
  .modal.modal--pocket { display: flex; flex-direction: column; padding-bottom: 0; }
  .modal--pocket .modal-header { padding-top: 6px; padding-bottom: 6px; margin-bottom: 0; }
  .pocket-name { font-size: 12px; }
  .pocket-set { font-size: 12px; }
  .pocket-meta, .pocket-in, .pocket-about, .pocket-strip { font-size: 12px; }
  .pocket-row .btn { font-size: 13px; }
  .modal--pocket > .pager-track { flex: 1 0 auto; display: flex; }
  .modal--pocket .pocket-page { flex: 1; display: flex; flex-direction: column; text-align: left; }
  /* A neighbour riding in on a swipe is as tall as the page it replaces. */
  .modal--pocket .pocket-page.pager-page--float { min-height: 100%; }
  /* The sleeve takes the height the text and buttons leave, never under 180px.
     cqh / cqw measure the box it sits in (a size container), not the screen. */
  .sleeve-fit { flex: 1 1 0; min-height: 180px; container-type: size; display: grid; place-items: center; margin-top: 10px; }
  .sleeve-fit .sleeve { width: auto; height: min(100cqh, 100cqw * 88 / 63); }
  .pocket-error { flex: 1; }
  .pocket-row { max-width: none; margin: 10px 0 0; }
  .pocket-strip {
    position: sticky; bottom: 0; z-index: 4; margin: 12px -14px 0; padding: 8px 14px;
    background: var(--screen-bg); border-top: 2px solid var(--rule);
    box-shadow: inset 2px 0 0 #1c1c1c, inset -2px 0 0 #1c1c1c;
  }
}
/* A phone held sideways: the card on the left, everything else beside it. */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-backdrop:has(.modal--pocket) { padding: 8px; }
  .modal.modal--pocket { max-width: 660px; max-height: calc(100dvh - 16px); padding: 8px 14px 10px; }
  .modal--pocket .modal-header { margin-bottom: 6px; }
  .modal--pocket .modal-header h2 { flex-direction: row; align-items: baseline; gap: 10px; }
  .modal--pocket .pocket-page {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px;
    align-content: start; text-align: left; padding-top: 0;
  }
  .modal--pocket .pocket-page > * { grid-column: 2; }
  .modal--pocket .pocket-page > .sleeve-fit { grid-column: 1; grid-row: 1 / span 8; }
  /* The window's height less the popup's margins, padding, border and title. */
  .sleeve-fit .sleeve { width: auto; height: calc(100dvh - 16px - 8px - 18px - 62px); margin: 0; }
  .pocket-title-spot { white-space: nowrap; flex: none; }
  .pocket-name { margin: 0 0 2px; font-size: 12px; }
  .pocket-set, .pocket-meta, .pocket-in, .pocket-about, .pocket-strip { font-size: 12px; }
  .pocket-row .btn { font-size: 12px; }
  .pocket-row { margin: 6px 0 0; max-width: none; }
  .pocket-about { margin-top: 6px; }
  .pocket-about + .pocket-row { margin-top: 2px; }
  .pocket-strip { margin-top: 8px; }
}

/* ---- Filter sheet, tidied (2026-09-24) ---- */
.filter-sheet-body { padding: 14px 16px 20px; }
.filter-sec { margin-top: 18px; }
.filter-sec .filter-label { margin: 0 0 8px; }
.filter-grid { display: grid; gap: 6px; }
.filter-grid--gens { grid-template-columns: repeat(5, 1fr); }
.filter-grid--types { grid-template-columns: repeat(3, 1fr); }
.filter-grid--two { grid-template-columns: 1fr 1fr; }
.ftile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 44px; padding: 4px 6px; border-radius: 8px;
  background: var(--surface); color: var(--ink); border: 2px solid var(--edge);
  font-family: inherit; font-size: 12px; line-height: 1.1; cursor: pointer;
}
.ftile small { font-size: 12px; opacity: 0.7; }
.ftile.on { background: var(--blue); color: #fff; border-color: #163656; }
.ftile.on small { opacity: 0.9; }
.ftile--gen span { font-family: var(--font-moment); font-size: 11px; }
/* Types: the type colour as the border, filled when picked. */
.ftile--type { border-color: var(--tc, #a8a77a); text-transform: capitalize; }
.ftile--type.on { background: var(--tc, #a8a77a); color: var(--tt, #1c1c1c); border-color: var(--edge); }
/* A tick for the two on/off options. */
.ftile--check { flex-direction: row; gap: 8px; }
.ftile--check::before {
  content: ''; width: 16px; height: 16px; flex-shrink: 0; border: 2px solid currentColor; border-radius: 3px;
  font-size: 12px; line-height: 14px; text-align: center;
}
/* Show: one segmented switch. */
.filter-seg { display: grid; grid-template-columns: repeat(3, 1fr); }
.filter-seg .ftile { border-radius: 0; }
.filter-seg .ftile + .ftile { border-left-width: 0; }
.filter-seg .ftile:first-child { border-radius: 8px 0 0 8px; }
.filter-seg .ftile:last-child { border-radius: 0 8px 8px 0; }
@media (min-width: 700px) {
  .filter-sheet-inner {
    height: auto; max-height: min(88vh, 760px); max-width: 560px;
    background: var(--screen-bg); border: 3px solid var(--edge); border-radius: 12px; overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  }
  .filter-grid--gens { grid-template-columns: repeat(10, 1fr); }
  .filter-grid--gens .ftile { padding: 4px 2px; }
  .filter-grid--types { grid-template-columns: repeat(6, 1fr); }
  .ftile { font-size: 12px; }
}
/* Section names are real headings (for screen readers) but stay small, quiet
   labels, not the pixel heading font. */
.filter-sec h3.filter-label {
  font-family: var(--font-ui); font-size: 12px; font-weight: normal;
  text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75;
}
.ftile--gen small { font-size: 12px; }

/* ---- Binder pages (Settings → Binder pages / Page numbers) ---- */
.dex-grid--pages {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px; background: none; box-shadow: none; padding: 0;
}
/* 2.0: no dark sheet behind the pockets; they sit on the screen colour. */
.binder-page { background: none; padding: 8px 10px 10px; }
.binder-page-label {
  margin: 0 0 8px; font-family: var(--font-ui); font-weight: 600; font-size: 13px;
  color: var(--muted); text-align: center;
}
.binder-page-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 8px; }

/* Swipe across (phones and tablets, Settings → Turning pages; SwipeBinder.tsx):
   one page at a time. pan-y leaves vertical scrolling to the browser and hands
   sideways drags to the pager; overflow: clip keeps the neighbour out of sight
   until it slides in. The page is as wide as the screen allows and no taller
   than what's left of it (--spread-h): 100dvh, the height visible right now,
   so a phone browser's address bar sliding in or out resizes the page with no
   re-measure, less the space above and below the grid, which useSwipeFit()
   measures (100vh first for browsers without dvh). There is no minimum: on a
   short screen the pockets shrink rather than the page scrolling (#133; a
   phone held sideways shows two pages instead, see below). Pockets keep
   their card shape (63:88). The sum takes the larger vertical padding (8px +
   10px on tablets) and the smaller sideways one (6px + 6px on phones), so a
   rounding slip makes the page smaller, never taller. */
.binder-swipe {
  position: relative; display: block; overflow: clip; touch-action: pan-y pinch-zoom;
  --spread-h: max(0px, calc(100vh - var(--swipe-above, 185px) - var(--swipe-below, 70px)));
  --spread-h: max(0px, calc(100dvh - var(--swipe-above, 185px) - var(--swipe-below, 70px)));
  --pocket-h: max(0px, calc((var(--spread-h) - 30px - 18px - (var(--rows, 3) - 1) * 8px) / var(--rows, 3)));
  --page-w: calc(var(--pocket-h) * 63 / 88 * var(--cols, 3) + (var(--cols, 3) - 1) * 8px + 12px);
}
.binder-swipe .binder-page { width: min(100%, var(--page-w)); margin: 0 auto; box-sizing: border-box; }
/* While a finger drags, the next page rides in beside it. */
.binder-swipe-pg--peek { position: absolute; top: 0; left: 0; right: 0; }

/* The turn bar under the page: ‹  3 of 114 ▼  ›, at thumb height. */
.binder-turn { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 2px; }
.binder-turn-btn {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0 0 4px; box-sizing: border-box;
  border: 2px solid var(--edge); border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: 0 3px 0 rgba(0,0,0,0.3);
  font-family: var(--font-ui); font-size: 24px; line-height: 1; cursor: pointer;
  /* Holding an arrow jumps 10 pages (#491): no text selection or callout menu on a long press. */
  -webkit-touch-callout: none; user-select: none;
}
.binder-turn-btn:active { transform: translateY(2px); box-shadow: none; }
.binder-turn-btn:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
/* At either end the arrow goes but keeps its space, so the counter stays put. */
.binder-turn-btn:disabled { visibility: hidden; }
/* The counter is a "Turn to" menu: the real <select> sits invisibly on top, so a tap opens the phone's own page list. */
.binder-turn-where {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 132px; min-height: 44px; padding: 0 12px; box-sizing: border-box;
  border: 0; border-radius: var(--radius-pill); background: var(--surf); box-shadow: var(--sh);
  font-family: var(--font-ui); font-size: 16px; font-weight: 600; color: var(--ink);
  /* Tabular figures on one line, so "268 of 334" keeps its width as the page changes (#491). */
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.binder-turn-where .caret { font-size: 12px; color: var(--muted); }
.binder-turn-where:has(select:focus-visible) { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
@media (max-height: 500px) and (orientation: landscape) {
  body:has(.binder-spread--land) { padding: 0; }
  body:has(.binder-spread--land) .app { max-width: none; }
  .binder-spread--land {
    --land-gutter: 56px;
    --spread-h: max(0px, calc(100vh - 32px - 42px - 2px));
    --spread-h: max(0px, calc(100dvh - 32px - 42px - 2px));
    /* Page box: padding 6px + 8px, 6px gaps, no label. Pockets keep their card shape (63:88). */
    --pocket-h: max(0px, calc((var(--spread-h) - 14px - (var(--rows, 3) - 1) * 6px) / var(--rows, 3)));
    --page-w: calc(var(--pocket-h) * 63 / 88 * var(--cols, 3) + (var(--cols, 3) - 1) * 6px + 12px);
    display: grid; align-items: center; gap: 6px 0;
    grid-template-columns: minmax(var(--land-gutter), 1fr) auto minmax(var(--land-gutter), 1fr);
    grid-template-rows: 36px auto;
    touch-action: pan-y pinch-zoom; overflow: clip;
  }
  .binder-land-where { grid-column: 1 / -1; grid-row: 1; justify-self: center; min-height: 36px; font-size: 13px; }
  /* The invisible menu reaches 4px above and below: still a 44px tap. */
  .binder-land-where select { inset: -4px 0; height: auto; }
  .binder-spread--land .binder-turn-btn { grid-row: 2; align-self: center; justify-self: center; }
  .binder-land-prev { grid-column: 1; }
  .binder-land-next { grid-column: 3; }
  /* The spread slides within its own box; the next one rides in beside it while a finger drags. */
  .binder-land-view { grid-column: 2; grid-row: 2; position: relative; overflow: clip; }
  .binder-spread--land .binder-page-pair {
    display: grid; column-gap: 8px; align-items: start;
    grid-template-columns: repeat(2, min(var(--page-w), calc((100vw - 20px - 2 * var(--land-gutter) - 8px) / 2)));
  }
  .binder-spread--land .binder-page { padding: 6px 6px 8px; }
  .binder-spread--land .binder-page-label { display: none; }
  .binder-spread--land .binder-page-grid { gap: 6px; }
  .binder-spread--land .binder-page--blank { visibility: hidden; }
  /* The 4-across phone label sizes for every layout; 5 or 6 across, number only. */
  .binder-spread--land .binder-pocket :is(.dex-slot-name, .dex-slot-num) { font-size: 12px; }
  .binder-spread--land .binder-slot .dex-slot-tier { top: 4px; right: 4px; }
  .binder-spread--land .binder-page-grid:is([data-cols="5"], [data-cols="6"]) .binder-pocket .dex-slot-name { display: none; }
}
.binder-slot--empty { display: block; opacity: 0.35; }
@media (max-width: 600px) {
  .binder-page { padding: 6px 6px 8px; }
  .binder-page-grid:is([data-cols="4"], [data-cols="5"], [data-cols="6"]) { gap: 5px; }
  .binder-page-grid:is([data-cols="4"], [data-cols="5"], [data-cols="6"]) .binder-pocket .dex-slot-name { font-size: 12px; }
  .binder-page-grid:is([data-cols="4"], [data-cols="5"], [data-cols="6"]) .binder-pocket .dex-slot-num { font-size: 12px; }
  .binder-page-grid:is([data-cols="4"], [data-cols="5"], [data-cols="6"]) .binder-slot .dex-slot-tier { top: 4px; right: 4px; }
  /* Five or six across: pockets are too small for a name, so number only. */
  .binder-page-grid:is([data-cols="5"], [data-cols="6"]) .binder-pocket .dex-slot-name { display: none; }
}

/* ---- Desktop width (wider than 1024px) ---- */
@media (min-width: 1025px) {
  /* Binder pages: always two across, like an open binder, each taking half the
     width so the pair fills the Pokédex. On a wide window a page can be taller
     than the screen; scrolling reaches its bottom row. */
  .dex-grid--pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* The flip-book (DexGrid FlipBook): one spread of two facing pages, each as
     large as fits the height DexGrid measures (--spread-h, the window below
     the grid's top) and half the width, with the page-turn arrows in the space
     either side. The height sum mirrors the page box: label 22px + 8px margin,
     padding 8px + 10px, 8px gaps, card-shaped (63:88) pockets. */
  .dex-grid--spread {
    --pocket-h: calc((var(--spread-h, 640px) - 30px - 18px - (var(--rows, 3) - 1) * 8px) / var(--rows, 3));
    --page-w: calc(var(--pocket-h) * 63 / 88 * var(--cols, 3) + (var(--cols, 3) - 1) * 8px + 20px);
    grid-template-columns: minmax(48px, 1fr) repeat(2, min(var(--page-w), calc((100% - 96px - 42px) / 2))) minmax(48px, 1fr);
    align-items: start;
  }
  .binder-page--blank { visibility: hidden; }
  .binder-flip {
    align-self: stretch; justify-self: center; width: 100%; max-width: 140px; padding: 0;
    border: 0; border-radius: 12px; background: none; color: var(--muted); cursor: pointer;
    font-family: var(--font-ui); font-size: 50px; line-height: 1;
  }
  .binder-flip:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
  .binder-flip:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring-inset); }
  .binder-flip:disabled { visibility: hidden; }
  html.binder-full :is(.topbar, .tabs-bar, .dex-controls, .first-run, .install-tip) { display: none; }
  .binder-page-label { font-size: 15px; line-height: 1; }
  /* Labels and the rarity mark grow with the pocket, never below their usual size. */
  .binder-page .binder-slot { container-type: inline-size; }
  .binder-page .binder-pocket .dex-slot-name { font-size: clamp(13px, 15cqi, 20px); }
  .binder-page .binder-pocket .dex-slot-num { font-size: clamp(12px, 13cqi, 17px); }
  .binder-page .binder-slot .dex-slot-tier { width: clamp(9px, 7cqi, 16px); height: clamp(9px, 7cqi, 16px); top: clamp(8px, 6.5cqi, 14px); right: clamp(8px, 6.5cqi, 14px); }
}

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {
  /* Filter sheet */
  .ftile { font-size: 13px; }
  .ftile small, .ftile--gen small { font-size: 12px; }
  .filter-label { font-size: 12px; }
  .modal .type-badge { font-size: 12px; padding: 6px 10px; }
  /* The 300px card shrinks a little on a short window so the buttons stay in view. */
  .sleeve { width: min(300px, 28vh); }
  .pocket-name { font-size: 18px; }
  .pocket-set { font-size: 13px; }
  .pocket-meta, .pocket-strip { font-size: 13px; }
  .modal .catch-item .meta { font-size: 15px; }
  .modal .catch-item .best-tag { font-size: 13px; }
  .modal :is(.copy-details, .copy-money, .copy-notes) { font-size: 14px; }
}

/* ---- What trainers see with pictures switched off ---- */

/* Binder pocket, card pictures off: a text card in the pocket instead of the
   picture. Themed (surface + ink), so it reads in light and dark. */
.binder-slot.text-card {
  background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--pline), var(--sh);
}
.text-card-body {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  gap: 4px; padding: 10px 8px; text-align: center;
}
.text-card-body .dex-slot-name { font-size: 13px; }
.text-card-body .text-card-set,
.text-card-body .text-card-num { font-size: 12px; color: var(--muted); line-height: 1.1; }

/* Keyboard focus on a pocket (#489). The caught, text-card and list-slot rules
   above set their own box-shadow with a more specific selector, so the plain
   .binder-slot:focus-visible lost to them and no ring showed. Name each one
   here, after them, so the ring always wins. */
.binder-slot:focus-visible,
.binder-slot.caught:not(.no-art):focus-visible,
.binder-slot.text-card:focus-visible,
.dex-slot.caught:focus-visible {
  outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring);
}

/* Uncaught sprites: the real image sits under a CSS filter, so stop the browser
   from dragging it, long-press-saving it or selecting it (which would reveal it).
   pointer-events: none lets the tap fall through to the slot button. */
.dex-slot.uncaught img,
.binder-slot.uncaught .binder-pocket img,
.sleeve-outline img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
  pointer-events: none;
}
.copy-where { font-size: 12px; color: var(--muted); }
.copy-where.here { color: var(--gold-text); }
.pocket-copies-title { margin: 0 0 6px; font-weight: 600; }
.sleeve--elsewhere img { opacity: .45; }
.pocket-in { margin: 0; font-size: 12px; color: var(--muted); }

/* ---- Your binders: switcher, shelf, Edit ▾, New binder (Binders.tsx) ---- */
.dex-toolbar { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
.binder-switcher { display: flex; align-items: center; gap: 8px; width: 100%; margin: 0 0 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.binder-switcher-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binder-switcher-meta { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
@media (min-width: 601px) {
  .dex-controls:has(.binder-switcher) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 10px; align-items: start; }
  .dex-controls:has(.binder-switcher) .filter-summary { grid-column: 1 / -1; }
}
.binder-cover { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 4px 6px 6px 4px; box-shadow: inset 4px 0 0 rgba(0,0,0,.2); }
.binder-cover--mini { width: 26px; height: 32px; }
.binder-cover--big { width: 100%; aspect-ratio: 4 / 5; border-radius: 6px 10px 10px 6px; box-shadow: inset 10px 0 0 rgba(0,0,0,.2); }
.binder-cover-label { display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 4px; width: 60%; aspect-ratio: 1; }
.binder-cover-label svg, .binder-cover-label img { width: 80%; height: 80%; object-fit: contain; }
.binder-cover-set { font-size: 11px; color: #222; overflow: hidden; }
.binder-shelf { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.binder-shelf-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 6px; border: 2px solid transparent; border-radius: 12px; background: none; color: inherit; font: inherit; cursor: pointer; }
.binder-shelf-item.current { border-color: var(--gold, #d4a017); }
.binder-shelf-name { font-weight: 600; text-align: center; }
.binder-shelf-progress { font-size: 12px; color: var(--muted); }
.binder-edit { display: flex; flex-direction: column; gap: 12px; }
.binder-field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; }
.binder-field legend, .binder-field > label, .binder-field > span:first-child { font-weight: 600; padding: 0; margin-bottom: 6px; }
.binder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.binder-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; gap: 10px; }
.binder-more { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.binder-more input { width: 32px; height: 32px; padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.binder-more input.on { border-color: var(--ink); }
.binder-swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.binder-swatch.on { border-color: var(--ink); box-shadow: 0 0 0 2px var(--screen-bg) inset; }
.binder-kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 480px) { .binder-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.binder-kind { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid var(--line, rgba(0,0,0,.15)); border-radius: 10px; background: none; color: inherit; font: inherit; cursor: pointer; }
.binder-kind:disabled { opacity: .5; cursor: default; }
.binder-kind small { font-size: 11px; color: var(--muted); }
/* Desktop, two or more binders: the side menu (BinderSideMenu) beside the Dex. */
.dex-with-side { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: start; }
.dex-main { min-width: 0; }
.binder-side { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 8px; }
.binder-side-title { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.binder-side ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.binder-side-item { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; width: 100%; padding: 6px 8px; border: 2px solid transparent; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.binder-side-item .binder-cover { grid-row: 1 / 3; }
.binder-side-item:hover { background: var(--surface-2); }
.binder-side-item.current { border-color: var(--gold, #d4a017); }
.binder-side-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.binder-side-progress { font-size: 12px; color: var(--muted); }
html.binder-full .binder-side { display: none; }
html.binder-full .dex-with-side { display: block; }
/* Set and Pokémon binders (CardBinder.tsx): a pocket per card. */
.card-binder { display: flex; flex-direction: column; gap: 16px; }
.card-binder-progress { margin: 0; font-weight: 600; }
.card-binder-page-title { margin: 0 0 6px; font-size: 0.63rem; opacity: .7; }
.card-binder-grid { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; border-radius: 10px; background: var(--line, rgba(0,0,0,.06)); }
.card-pocket { position: relative; aspect-ratio: 63 / 88; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 0.52rem; }
.card-pocket img { width: 100%; height: 100%; object-fit: cover; }
.card-pocket--empty { border: 2px dashed var(--line, rgba(0,0,0,.2)); padding: 4px; opacity: .8; }
.card-pocket--blank { visibility: hidden; }
.card-pocket--elsewhere img { opacity: .35; filter: grayscale(.6); }
.card-pocket-in { position: absolute; left: 4px; right: 4px; bottom: 4px; padding: 2px 4px; border-radius: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: 0.49rem; }
.binder-hits { list-style: none; margin: 4px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.binder-hits button { width: 100%; text-align: left; padding: 8px; border: 0; border-bottom: 1px solid var(--line, rgba(0,0,0,.1)); background: none; color: inherit; font: inherit; cursor: pointer; }
.binder-picked { margin: 4px 0 0; font-size: 0.59rem; }
/* Free binders (#253): + in empty pockets, Rearrange by drag or keyboard. */
.free-pocket { all: unset; box-sizing: border-box; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 6px; }
.free-pocket:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.free-pocket:disabled { cursor: default; }
.free-pocket > span[aria-hidden] { font-size: 1.12rem; opacity: .6; }
.free-pocket img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.free-binder .card-pocket--placed { border: 0; }
.free-binder .card-pocket--empty { padding: 0; }
.free-rearrange { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--line, rgba(0,0,0,.06)); position: sticky; top: 0; z-index: 2; }
.free-rearrange ~ .card-binder-page .free-pocket { touch-action: none; cursor: grab; }
.card-pocket--held { opacity: .45; }
.card-pocket--over { outline: 3px solid var(--gold, #d4a017); outline-offset: 1px; }
#free-add-page { align-self: flex-start; }
.free-picker-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.free-picker-list button { all: unset; box-sizing: border-box; width: 100%; display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: 6px; cursor: pointer; }
.free-picker-list button:hover, .free-picker-list button:focus-visible { background: var(--line, rgba(0,0,0,.06)); }
.free-picker-list button:disabled { opacity: .5; cursor: default; }
.free-picker-list img { width: 40px; border-radius: 3px; }
.free-picker-list span { display: flex; flex-direction: column; }
.free-picker-where { color: var(--muted, #777); }

/* ---- Full screen on phones and tablets (#331, design/331) ----
   The button is the last one in the pinned toolbar: icon only, 44px square,
   so it is in reach from any page. Desktop has its round button in the
   "Turn to" row instead (DexView draws one or the other). */
.dex-toolbar { display: flex; gap: 8px; }
.dex-toolbar .btn { flex: 1 1 0; min-width: 0; }
.dex-toolbar .btn.binder-full-bar {
  flex: 0 0 var(--tap); min-height: var(--tap); padding: 0;
  display: grid; place-items: center;
}
.binder-full-bar svg, .binder-full-exit svg, .binder-land-full svg { width: 20px; height: 20px; display: block; }
.binder-full-bar:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
@media (max-width: 339px) { .dex-toolbar { gap: 6px; } }
.binder-land-full, .binder-land-short { display: none; }

/* Leaving full screen: one round ✕, fixed in the bottom-right corner, clear
   of the home indicator and a sideways notch. The ring is --ink, not --edge:
   it sits over the pockets, and --ink holds its contrast in light and Night. */
.binder-full-exit {
  position: fixed; z-index: 25;
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; box-sizing: border-box;
  border: 2px solid var(--ink); border-radius: 50%; background: var(--surface); color: var(--ink);
  box-shadow: 0 3px 0 rgba(0,0,0,0.3); cursor: pointer;
}
.binder-full-exit:active { transform: translateY(2px); box-shadow: none; }
.binder-full-exit:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }

/* Full screen below desktop width: the top bar, the toolbar and filter chips,
   the tab bar, the tips and the red frame go; the pages keep their place. */
@media (max-width: 1024px) {
  html.binder-full body { padding: 0; }
  html.binder-full :is(.topbar, .tabs-bar, .dex-controls, .first-run, .install-tip) { display: none; }
  html.binder-full .dex-shell { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--screen-bg); min-height: 100dvh; }
  html.binder-full .dex-screen:not(.dex-screen--login) {
    border: 0; border-radius: 0; box-shadow: none;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  /* Scroll down: the last row can scroll clear of the ✕. */
  html.binder-full .dex-grid--pages:not(.binder-swipe):not(.binder-spread--land) { padding-bottom: 60px; }
  /* Set, Pokémon and Free binders scroll the same way, so they get the same room. */
  html.binder-full .card-binder { padding-bottom: 60px; }
  /* Swipe across: the turn bar pins to the bottom edge, level with the ✕,
     and the page sits in the middle of the space above it. */
  html.binder-full .dex-screen:has(.binder-swipe) { display: flex; flex-direction: column; min-height: 100dvh; box-sizing: border-box; }
  html.binder-full .dex-screen:has(.binder-swipe) main { flex: 1; display: flex; flex-direction: column; }
  html.binder-full .dex-screen:has(.binder-swipe) #view-body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-bottom: 56px; }
  html.binder-full .binder-turn {
    position: fixed; left: 0; right: 0; margin: 0;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}
/* A popup opened from full screen covers the whole screen: the bars it
   normally sits between (#373) are hidden. */
@media (max-width: 600px) {
  html.binder-full body:has(.tabs-bar) :is(.modal-backdrop, .filter-sheet, .sheet-backdrop, .cutscene, .encounter-wipe, .card-zoom) {
    top: 0; bottom: 0; left: 0; right: 0;
  }
}
/* Narrow phones: a slimmer turn bar, so it stays 16px clear of the ✕. */
@media (max-width: 374px) {
  html.binder-full .binder-turn { gap: 8px; }
  html.binder-full .binder-turn-where { min-width: 108px; padding: 0 8px; }
}

/* A phone held sideways (SwipeBinder.tsx, .binder-spread--land). */
@media (max-height: 500px) and (orientation: landscape) {
  /* In the red frame: the full screen button sits at the bottom of the
     right-hand gutter, under ›. */
  .binder-land-full {
    grid-column: 3; grid-row: 2; align-self: end; justify-self: center;
    display: grid; place-items: center; width: 44px; height: 44px; padding: 0; box-sizing: border-box;
    border: 2px solid var(--edge); border-radius: 50%; background: var(--surface); color: var(--ink);
    box-shadow: 0 3px 0 rgba(0,0,0,0.3); cursor: pointer;
  }
  .binder-land-full:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }

  /* Full screen: the frame and the "Turn to" row go and the two pages take
     the whole height. "Turn to" becomes a short pill (page numbers only) at
     the bottom of the left gutter; ✕ sits opposite it, under ›, in the middle
     of the 68px gutter. */
  html.binder-full body:has(.binder-spread--land) .dex-shell { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--screen-bg); }
  html.binder-full body:has(.binder-spread--land) .dex-screen:not(.dex-screen--login) {
    border: 0; border-radius: 0;
    padding: 4px env(safe-area-inset-right, 0px) 4px env(safe-area-inset-left, 0px);
    display: flex; flex-direction: column; justify-content: center;
  }
  html.binder-full .binder-spread--land {
    --land-gutter: 68px;
    --spread-h: max(0px, calc(100vh - 8px));
    --spread-h: max(0px, calc(100dvh - 8px));
    grid-template-rows: auto; align-items: stretch;
  }
  html.binder-full .binder-spread--land :is(.binder-turn-btn, .binder-land-view) { grid-row: 1; }
  html.binder-full .binder-land-view { align-self: center; }
  html.binder-full body:has(.binder-spread--land) .binder-full-exit {
    right: calc(12px + env(safe-area-inset-right, 0px)); bottom: 12px;
  }
  html.binder-full .binder-land-where {
    grid-column: 1; grid-row: 1; align-self: end; justify-self: center; margin-bottom: 8px;
    min-width: 44px; min-height: 44px; padding: 0 6px; gap: 4px; font-size: 13px;
  }
  html.binder-full .binder-land-where .caret { font-size: 11px; }
  html.binder-full .binder-land-where select { inset: 0; }
  html.binder-full .binder-land-title { display: none; }
  html.binder-full .binder-land-short { display: inline; }
}

/* "Open ›" from Where your copies are: the copy's pocket, highlighted (#252). */
.pocket-here { animation: just-caught 0.9s ease-in-out 2; box-shadow: 0 0 0 3px var(--gold); position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .pocket-here { animation: none; } }

/* #347: bigger, clearer binder forms. Choices are flat .pill buttons (style.css), actions the raised .btn. */
.binder-edit { gap: 18px; }
.binder-field legend, .binder-field > label, .binder-field > span:first-child { font-size: 12px; margin-bottom: 8px; }
.field-hint { font-size: 12px; color: var(--muted); margin: 0; }
.binder-field input, .binder-field select, .binder-other select {
  box-sizing: border-box; width: 100%; min-height: 48px; font-family: inherit; font-size: 16px;
  padding: 8px 12px; border: 2px solid var(--edge); border-radius: 4px; background-color: var(--surface); color: var(--ink);
}
.binder-field input:focus-visible, .binder-field select:focus-visible, .binder-other select:focus-visible { outline: 2px solid transparent; outline-offset: 2px; box-shadow: var(--ring); }
.binder-field select, .binder-other select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.binder-name-row { display: flex; gap: 8px; align-items: stretch; }
.binder-name-row input { flex: 1 1 auto; min-width: 0; }
.binder-name-row .btn { min-height: 48px; flex: none; }
@media (max-width: 480px) { .binder-name-row { flex-direction: column; } .binder-name-row .btn { width: 100%; } }
.binder-pills .pill { min-height: 48px; font-size: 14px; flex: 1 1 0; min-width: 0; }
.binder-other { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.binder-other label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.binder-other .field-hint { grid-column: 1 / -1; }
.binder-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .binder-kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.binder-kind.pill { flex-direction: column; justify-content: center; min-height: 72px; padding: 10px 8px; text-align: center; }
.binder-kind.pill { border-radius: 12px; }
.binder-kind.pill::before { content: none; }
.binder-kind[aria-pressed='true'] strong::before { content: '✓ '; }
.binder-kind strong { font-size: 13px; }
.binder-kind small { font-size: 12px; color: var(--muted); line-height: 1.1; }
.binder-kind[aria-pressed='true'] small { color: #fff; }
.binder-swatch { width: 44px; height: 44px; border: 2px solid var(--edge); position: relative; }
.binder-swatch.on { box-shadow: 0 0 0 3px var(--screen-bg), 0 0 0 5px var(--ink); }
.binder-swatch.on::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; text-shadow: 0 0 3px #000; }
.binder-move { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.binder-move .btn, .binder-actions .btn { min-height: 48px; }
.binder-actions { display: flex; flex-direction: column; gap: 10px; border-top: 2px solid var(--rule); padding-top: 16px; }
.binder-actions .btn { width: 100%; }
.binder-create { width: 100%; font-size: 14px; min-height: 48px; }
.binder-foot { position: sticky; bottom: -18px; margin: 0 -18px -18px; padding: 12px 18px; background: var(--screen-bg); border-top: 2px solid var(--rule); }
.modal-header .btn { min-width: 44px; min-height: 44px; }

/* ---- Edit a copy: the card as on the copies page, paired fields, pill toggles ---- */
.copy-card {
  margin-bottom: 10px;
}
.edit-form .form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.edit-form .form-pair label {
  min-width: 0;
}
.pill-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.edit-form .pill-toggle {
  position: relative;
  flex-direction: row;
  display: inline-flex;
}
.pill-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.pill-toggle span {
  padding: 8px 14px;
  border: 2px solid var(--edge);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
}
.pill-toggle input:checked + span {
  background: var(--green-text);
  border-color: var(--green-text);
  color: #fff;
  font-weight: 700;
}
.pill-toggle input:focus-visible + span {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: var(--ring);
}
/* sets: styles used only by this feature (src/features/sets). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Dex grid ---- */

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

/* ---- Views: Pokédex / Sets / Stats ---- */

/* Sets */
.set-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.set-row:hover {
  border-color: var(--link);
}
.set-logo {
  display: block;
  max-width: 220px;
  max-height: 80px;
  margin: 0 auto 8px;
  object-fit: contain;
}
.set-progress-label {
  margin: 4px 0;
  text-align: center;
}
.set-info {
  margin: 2px 0;
  text-align: center;
  opacity: 0.75;
}
.set-show {
  flex: 0 0 auto;
}
.set-show label {
  padding: 6px 12px;
}
.card-tile .have-tick {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.set-to-complete {
  margin: 4px 0;
  text-align: center;
}

/* Main set / Master set toggle */
.set-scope {
  display: flex;
  flex-wrap: wrap; /* three chips since Master set + variants (#243) */
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
}
/* My sets: the scope toggle and the Completed filter on one row (#241). */
.set-filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0 0 10px;
}
.set-filter-row .set-scope {
  margin: 0;
}

/* "Complete · Mar 2026" on a finished set's row, tile and page (#241). */
.set-complete {
  align-self: flex-start;
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
/* Each part stays whole; the badge wraps between them when the row is narrow. */
.set-complete-part {
  white-space: nowrap;
}
.recent-tile .set-complete {
  align-self: center;
}
.set-tile .set-complete {
  align-self: center;
}
.set-complete-row {
  margin: 6px 0 0;
  text-align: center;
}

/* ---- Wishlist tab ---- */
.series > .set-list {
  padding: 8px;
}

/* ---- Filter sheet, tidied (2026-09-24) ---- */
/* A section heading with its sort menu on the same line (Sets tab). */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.section-head .wish-sort {
  margin: 0;
}
.section-head {
  margin: 20px 0 10px;
}
.section-head .section-title {
  margin: 0;
}

/* ---- Sets tab: switch, tools, slim two-line rows ---- */
.sets-layout {
  display: block;
}
.sets-seg {
  margin-bottom: 12px;
}
.sets-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.sets-tools input[type='text'] {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  padding: 8px 10px;
  border: 2px solid var(--edge);
  border-radius: 4px;
}
.sets-tools .wish-sort {
  margin: 0;
}
@media (max-width: 600px) {
  .sets-tools {
    flex-wrap: wrap;
  }
  .sets-tools input[type='text'] {
    flex: 1 1 100%;
  }
}
.set-row {
  padding: 6px 10px;
}
.set-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.set-row-top strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-row-count {
  font-size: 12px;
  opacity: 0.7;
  flex-shrink: 0;
}
.set-row .bar {
  height: 8px;
}
.set-symbol:not(img) {
  display: inline-block;
}

/* A My sets tile in 2.0 (docs/design/blue-sky-2, screen `sets`): a soft white
   tile, symbol and year on top, the name on up to two lines, then the bar and
   the count. Two classes so it beats the plain .set-row rules above. */
.set-row.set-card {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-height: 128px;
  padding: 12px;
  border: 0;
  border-radius: var(--radius-tile);
  background: var(--surf);
  box-shadow: var(--sh);
}
.set-row.set-card.set-row--done {
  box-shadow:
    0 0 0 2px var(--gold),
    var(--sh);
}
.set-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.set-card .set-symbol {
  width: 26px;
  height: 26px;
}
.set-card-year {
  color: var(--mut);
  font-size: 12px;
}
/* The whole name shows, wrapping as it needs to (#476). */
.set-card-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.set-card .bar {
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--quiet);
}
.set-card .bar-fill {
  border-radius: 4px;
}
.set-card-count {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* A finished set says when, in gold text, where the count was. */
.set-card .set-complete {
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--gt);
  font-size: 12px;
  font-weight: 700;
}

/* Phone: My sets shows two per row (#399). */
@media (max-width: 699px) {
  #my-sets:has(> .set-row) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Tablet: one column of sections. */
@media (min-width: 601px) {
  .sets-layout {
    display: grid;
    grid-template-columns: 1fr;
  }
}
/* Set rows reflow with every list of tiles (#399): 2 columns from 700px,
   3 from 1100px. */
@media (min-width: 700px) {
  .set-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .set-list:has(> .series),
  .series > .set-list:not(:has(> .set-row)) {
    display: flex;
  }
  .set-list > .empty-state,
  .set-list > .empty-screen,
  .set-list > .series {
    grid-column: 1 / -1;
  }
}

/* Desktop (1025px and wider): the switch becomes a side menu. */
@media (min-width: 1025px) {
  .sets-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .sets-seg {
    flex-direction: column;
    flex-wrap: nowrap;
    max-width: none;
    margin: 0;
    position: sticky;
    top: 12px;
  }
  .sets-seg .pill {
    text-align: left;
  }
}
@media (min-width: 1100px) {
  .set-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .set-list:has(> .series) {
    display: flex;
  }
}

/* ---- Explore: set logo tiles ---- */
.explore-heading {
  margin: 16px 0 6px;
  font-size: 14px;
}
.series-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.series-head .explore-heading {
  margin: 16px 0 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.series-head .see-all {
  flex-shrink: 0;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .explore-heading {
    font-size: 12px;
  }
}
.series-block {
  margin-bottom: 8px;
}
.see-all {
  background: none;
  border: 0;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  padding: 4px 0;
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
/* Phone: the newest sets scroll sideways. */
.tile-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.tile-strip .set-tile {
  flex: 0 0 150px;
  scroll-snap-align: start;
}
/* Closed series: one row only (2 tiles on a phone). */
.tile-grid:not(.open) .set-tile:nth-child(n + 3) {
  display: none;
}
.set-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  text-align: center;
  padding: 8px;
  min-width: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 8px;
}
.set-tile:hover {
  border-color: var(--link);
}
.set-tile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 64px;
}
.set-tile-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
/* A set with no logo: its name, once, in the logo frame. */
.set-tile-nologo {
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.set-tile-name {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.set-tile-bar {
  width: 100%;
  height: 6px;
  border-width: 1px;
}

@media (min-width: 601px) {
  .tile-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .tile-grid:not(.open) .set-tile:nth-child(n + 5) {
    display: none;
  }
  .tile-grid:not(.open) .set-tile:nth-child(-n + 4) {
    display: flex;
  }
  .tile-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    overflow: visible;
  }
  .tile-strip .set-tile:nth-child(n + 5) {
    display: none;
  }
}
@media (min-width: 1025px) {
  .tile-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  .tile-grid:not(.open) .set-tile:nth-child(n + 7) {
    display: none;
  }
  .tile-grid:not(.open) .set-tile:nth-child(-n + 6) {
    display: flex;
  }
  .tile-strip {
    grid-template-columns: repeat(6, 1fr);
  }
  .tile-strip .set-tile:nth-child(n + 5) {
    display: flex;
  }
  .tile-strip .set-tile:nth-child(n + 7) {
    display: none;
  }
}

/* ---- A set name that opens the set (SetLink) ---- */
.set-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  text-align: inherit;
}
.set-link:hover {
  color: var(--link-hover);
}
.card-cell--flash > .card-tile {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
/* ---- Opt-in collections (#235) ---- */
.chips {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.chips .btn.active {
  border-color: var(--link);
}
.set-row--new {
  border-style: dashed;
  justify-content: center;
  text-align: center;
}
.collect-row {
  margin: 4px 0 8px;
  text-align: center;
}
.collect-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.collect-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* My sets: the "Recently added" row, up to 4 compact tiles. */
.recent-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.recent-tile {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  text-align: center;
  padding: 8px;
  min-width: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 2px solid var(--edge);
  border-radius: 8px;
}
.recent-tile:hover {
  border-color: var(--link);
}
.recent-tile-name {
  font-size: 12px;
  overflow-wrap: anywhere;
}
@media (min-width: 601px) {
  .recent-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Friends on a set page (#240): a short list under the progress bar. */
.set-friends {
  margin: var(--space-2) 0 0;
}
.set-friends ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.set-friend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: 4px 8px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.set-friend-avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--edge);
  background: var(--line);
  font-size: 12px;
}
.set-friend-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.set-friend-count {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.set-friends-more {
  display: block;
  margin: var(--space-2) auto 0;
}

/* Master set + variants (#243): a card's prints under it, the held ones
   ticked. Wraps between prints so a narrow tile never overflows. */
.card-prints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  font-size: 12px;
  color: var(--muted);
}
.card-print {
  white-space: nowrap;
}
.card-print--have {
  color: var(--green-text);
  font-weight: 600;
}
/* The slab view (SlabView.tsx). Shared slab styles are in public/css/style.css. */
.slab-flip { display: grid; max-width: 280px; margin: 0 auto 12px; perspective: 1200px; }
/* Both sides share one grid cell. The front turns away as the back turns in,
   so the slab looks like one object rotating about its upright axis. */
.slab-face {
  grid-area: 1 / 1;
  transition: transform 0.6s cubic-bezier(0.3, 0.7, 0.3, 1);
  backface-visibility: hidden;
}
.slab-face--back { transform: rotateY(-180deg); }
.slab-flip.is-flipped .slab-face--front { transform: rotateY(180deg); }
.slab-flip.is-flipped .slab-face--back { transform: rotateY(0deg); }
/* Reduced motion (the device setting or Settings → Motion): the side swaps at
   once, with no turn. */
.slab-flip--still .slab-face { transition: none; }

/* The back of a Pokémon card, drawn in CSS: blue border and swirl, the
   Poké Ball in the middle, the yellow word across the top. */
.card-back {
  position: relative; display: block; width: 100%; aspect-ratio: 63 / 88; overflow: hidden;
  border: 6px solid #2a5aa8; border-radius: 6px; background-color: #3466af;
  background-image:
    radial-gradient(circle at 50% 50%, #fff 0 9%, #1c1c1c 9% 12%, transparent 12%),
    linear-gradient(180deg, #e3350d 0 47%, #1c1c1c 47% 53%, #f4f4f4 53%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.card-back::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(30, 70, 150, 0.95) 31%);
}
.card-back-word {
  position: absolute; top: 14%; left: 0; right: 0; z-index: 1; text-align: center; line-height: 1;
  font-family: var(--font-moment); font-size: 13px; color: #ffcb05;
  text-shadow: 2px 2px 0 #2a5aa8; transform: rotate(-12deg);
}
.slab-actions { display: flex; justify-content: center; gap: 10px; margin-bottom: 12px; }
.slab-stale {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; padding: 10px 12px; border-radius: 8px;
  background: #fff3bf; color: #5c4400; border: 1px solid #e0b73c;
}
.slab-details { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
.slab-details dt { color: var(--muted); }
.slab-details dd { margin: 0; }
.slab-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.slab-notes--none { color: var(--muted); }
.slab-gain { color: var(--money); }
.slab-loss { color: var(--danger-text); }
/* stats: styles used only by this feature (src/features/stats). Shared styles,
   the palette and fonts are in public/css/style.css, which loads first. */

/* ---- Views: Pokédex / Sets / Stats ---- */
.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 64px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.bar-num {
  text-align: right;
  opacity: 0.75;
}

@media (max-width: 480px) {
  .bar-row {
    grid-template-columns: 96px 1fr 56px;
  }
}

/* ---- Mobile readability (2026-09-21) ---- */
@media (max-width: 600px) {
  .bar-row {
    font-size: 13px;
    grid-template-columns: 104px 1fr 64px;
  }
}

/* Recently logged: the row opens the dex entry, ✕ removes that copy. */
.mini-row-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

/* ---- Tablet and desktop readability (601px and up, #398) ---- */
@media (min-width: 601px) {
  .bar-row {
    font-size: 13px;
    grid-template-columns: 140px 1fr 72px;
  }
}

/* ---- Achievements: earned grid, up-next grid, badge sheet ---- */
.ach-strip {
  margin-bottom: 10px;
}
.ach-tile {
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
}
.ach-next {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.ach-sheet {
  text-align: center;
}
.ach-missing {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ach-missing li {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---- Breakdown ---- */
.gen-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.gen-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--edge);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}
.gen-name {
  font-size: 12px;
}
.ring {
  width: 64px;
  height: 64px;
}
.ring-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 5;
}
.ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 5;
  stroke-linecap: butt;
}
.ring-fill--done {
  stroke: var(--gold);
}
.ring-pct {
  font-size: 10px;
  font-weight: bold;
  fill: var(--ink);
}

.rarity-legend {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px 12px;
}
.rarity-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* The rarity symbol printed in a card's corner (#492): ● ◆ ★, gold ★ from holo rare up. */
.rarity-glyph {
  width: 18px;
  text-align: center;
  color: var(--ink);
  flex: none;
}
.rarity-glyph--gold {
  color: var(--gt);
}
.rarity-name {
  flex: 1;
}
.rarity-count {
  opacity: 0.75;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.type-chips .type-chip {
  cursor: default;
}
.type-chips .type-chip.none {
  opacity: 0.45;
}

/* Your sets (#492): symbol, name, bar, and the count set like a printed card
   number (129/203). Bars are blue; a finished set's bar is gold. */
.top-sets-title small {
  font-size: 12px;
  font-weight: normal;
  color: var(--mut);
}
.top-set {
  min-height: 44px;
  background: var(--surf);
  border-color: var(--line);
  border-radius: 14px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.top-set-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
/* Long set names wrap to two lines; the card number stays on one. */
.top-set-name strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.top-set .bar-fill {
  background: var(--blue);
}
.top-set .bar-fill--gold {
  background: var(--gold);
}
.top-set-number {
  flex: none;
  font-size: 15px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.top-set-number i {
  font-style: normal;
  font-weight: normal;
  color: var(--mut);
}
.chip-gold {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--goldbg);
  color: var(--gt);
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
}
.top-sets-all {
  display: block;
  width: 100%;
  margin: 8px auto 0;
}

@media (max-width: 600px) {
  .gen-name {
    font-size: 13px;
  }
}
@media (min-width: 700px) {
  .gen-tiles {
    grid-template-columns: repeat(5, 1fr);
  }
}
/* ---- Activity grid: 7 rows (Monday top to Sunday bottom), a column a week, this week on the right ---- */
.activity-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  margin-top: 8px;
}
.activity-day {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--track);
}
.activity-day--1 {
  background: color-mix(in srgb, var(--green) 35%, var(--track));
}
.activity-day--2 {
  background: color-mix(in srgb, var(--green) 60%, var(--track));
}
.activity-day--3 {
  background: var(--green);
}
.activity-day--4 {
  background: var(--green-text);
}
.activity-day--empty {
  background: transparent;
}
.activity-day--today {
  outline: 2px solid var(--edge);
  outline-offset: 1px;
}

/* ---- Overview: one column, two on a tablet, three on a desktop ---- */
.overview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
  align-items: start;
}
.overview-col > .section-title:first-child {
  margin-top: 18px;
}
.overview-wide {
  display: none;
}
@media (min-width: 700px) {
  .overview {
    grid-template-columns: 1fr 1fr;
  }
  .overview-col--money {
    grid-column: 1 / -1;
  }
}
@media (min-width: 1025px) {
  .overview {
    grid-template-columns: 1.3fr 1fr 1fr;
  }
  .overview-col--money {
    grid-column: auto;
  }
  .overview-wide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }
}

/* Top pulls (#492): sleeved cards on a binder sheet, a price tag under each. */
.pull-sheet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-tile);
  background: var(--pocket);
  box-shadow: inset 0 0 0 1.5px var(--pline);
}
.pull {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: 0;
}
.pull-sleeve {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  padding: 3px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55),
    rgba(255, 255, 255, 0.1) 40%,
    rgba(255, 255, 255, 0.35)
  );
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.12),
    0 6px 12px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}
.pull-sleeve img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
/* The sleeve's sheen; holo cards get a still foil over the art. */
.pull-sleeve::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 8px;
  background: linear-gradient(
    115deg,
    transparent 40%,
    rgba(255, 255, 255, 0.28) 48%,
    transparent 56%
  );
  pointer-events: none;
}
.pull-sleeve.holo::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 8px;
  background: linear-gradient(
    120deg,
    rgba(255, 80, 120, 0.3),
    rgba(80, 220, 255, 0.3),
    rgba(255, 230, 80, 0.3)
  );
  mix-blend-mode: screen;
  pointer-events: none;
}
.pull figcaption {
  padding: 3px 0;
  border-radius: 6px;
  background: var(--surf);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pull-pocket {
  aspect-ratio: 63 / 88;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1.5px var(--pline);
}

/* Four number tiles, always two by two. */
.stat-tiles.stat-tiles--pairs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.stat-tiles--pairs .stat-tile {
  align-items: center;
  text-align: center;
}
/* Empty Stats: one pocket, so the screen fits without scrolling. */
.pull-pocket--lone {
  width: 96px;
  background: var(--pocket);
}

/* Worth: a plain tile, the same surface as the rows. No accent edge. */
.worth-tile {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-tile);
  background: var(--surf);
  box-shadow: var(--sh);
  color: var(--ink);
}
.worth-tile-label {
  color: var(--mut);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.worth-total {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.worth-sum {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.worth-own {
  margin: 10px 0 0;
  color: var(--mut);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.worth-own small {
  display: block;
}
.worth-note {
  text-align: center;
}

/* Value history: a row that opens the chart on its own page. */
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--surf);
  box-shadow: var(--sh);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.history-row-range {
  color: var(--mut);
  font-weight: 500;
}
.value-history .section-title {
  margin-top: 12px;
}

.overview-empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.overview-empty .pull-sheet {
  width: 100%;
  margin-bottom: 8px;
}

.worth-changes {
  margin: 0 0 8px;
  font-size: 13px;
}
.worth-change--up,
.worth-gain {
  color: var(--green-text);
}
.worth-change--down,
.worth-loss {
  color: var(--red-text);
}

.value-chart {
  margin-top: 10px;
}
.value-ranges {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.value-plot {
  position: relative;
  height: 140px;
  border: 2px solid var(--edge);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.value-plot svg {
  display: block;
  width: 100%;
  height: 100%;
}
.value-area {
  fill: color-mix(in srgb, var(--green) 30%, transparent);
}
.value-line {
  fill: none;
  stroke: var(--green-text);
  stroke-width: 2;
}
.value-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border: 2px solid var(--edge);
  border-radius: 50%;
  background: var(--gold);
}
.value-mark {
  position: absolute;
  transform: translate(8px, -50%);
  max-width: 60%;
  padding: 2px 6px;
  border: 1px solid var(--edge);
  border-radius: 4px;
  background: var(--surface);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.value-mark--left {
  transform: translate(calc(-100% - 8px), -50%);
}
.value-chart-wait {
  margin: 10px 0 0;
  padding: 16px;
  border: 2px dashed var(--edge);
  border-radius: 8px;
  text-align: center;
}

.next-badge {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 2px solid var(--edge);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.next-badge .badge-icon {
  flex: none;
  margin: 0;
}
.next-badge-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  /* Rarity and type live on Breakdown on a phone. */
  .overview-wide {
    display: none;
  }
  .value-mark {
    font-size: 12px;
  }
}

/* ---- Your <year>: the banner and the full-screen story ---- */
.yir-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: linear-gradient(90deg, var(--rare-tint), var(--surface));
  border: 2px solid var(--gold);
  border-radius: 8px;
}
.yir-banner strong {
  font-size: 14px;
}
.yir-banner span {
  font-size: 12px;
  opacity: 0.8;
}
.yir-backdrop {
  padding: 0;
}
.modal.yir-modal {
  max-width: none;
  max-height: none;
  height: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  --yir-ink: #f4f1e8;
  background: var(--screen-dark);
  color: var(--yir-ink);
}
.yir {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 12px 14px 20px;
}
.yir-segments {
  display: flex;
  gap: 4px;
}
.yir-seg {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.yir-seg--done,
.yir-seg-fill {
  background: var(--yir-ink);
}
.yir-seg-fill {
  display: block;
  height: 100%;
  width: 100%;
}
.yir-seg-fill--run {
  width: 0;
  animation-name: yir-fill;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes yir-fill {
  to {
    width: 100%;
  }
}
.yir-header {
  margin: 12px 0 0;
  background: none;
  border: 0;
  position: static;
  padding: 0;
}
.yir-header h2 {
  font-size: 15px;
  line-height: 1.6;
  color: var(--yir-ink);
}
.yir-header .btn {
  color: var(--yir-ink);
  border-color: rgba(255, 255, 255, 0.5);
}
.yir-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  min-height: 0;
}
.yir-kicker {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: normal;
  opacity: 0.85;
}
.yir-huge {
  margin: 0;
  font-size: 50px;
  line-height: 1;
  color: var(--gold);
}
.yir-big {
  margin: 0;
  font-size: 21px;
  line-height: 1.5;
  color: var(--gold);
}
.yir-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.85;
}
.yir-pic {
  max-height: 46vh;
  max-width: 80%;
  border-radius: 8px;
}
.yir-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}
.yir-badges img {
  width: 40px;
  height: 40px;
}
.yir-nav {
  display: flex;
  gap: 10px;
}
.yir-nav .btn {
  flex: 1;
  font-size: 13px;
}
.yir-nav .btn--ghost {
  color: var(--yir-ink);
  border-color: rgba(255, 255, 255, 0.5);
}
.feed-item--review {
  background: var(--rare-tint);
  border-color: var(--gold);
}
@media (prefers-reduced-motion: reduce) {
  .yir-seg-fill--run {
    animation: none;
    width: 100%;
  }
}

/* Tappable number squares and the folded locked badges */
.stat-tile--tap {
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.stat-info-value {
  font-family: var(--font-moment);
  font-size: 16px;
  text-align: center;
}
.ach-group {
  margin: 8px 0 4px;
  font-size: 12px;
  opacity: 0.7;
}
.ach-locked {
  margin-top: 8px;
}
.ach-locked summary {
  cursor: pointer;
  padding: 8px 0;
  text-align: center;
}
