/* ═══════════════════════════════════════════════════════════════
   BLOXTRADEVIEW — "The Trading Desk"
   A market terminal printed on paper. Light paper base, ink text,
   market green/red reserved strictly for direction & verdict
   semantics (win / fair / lose, above / below list), neutral slate
   accents everywhere else, tabular mono numerals, thin ticker-rule
   dividers. The signature element is the value board.

   Type:  Schibsted Grotesk (display) · Public Sans (body)
          IBM Plex Mono (numerals, stamps, labels)
   ═══════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* — Paper surfaces — */
  --bg-0:        #f4f3ee;   /* the desk: warm-neutral paper       */
  --bg-1:        #fbfaf7;   /* sheets: boards, cards, panels      */
  --bg-2:        #ecebe3;   /* recessed wells                     */
  --bg-3:        #e2e0d5;   /* heavier recess                     */
  --bg-elevated: #fbfaf7;
  --bg-glass:    rgba(244, 243, 238, 0.92);

  /* — Rules & hairlines — */
  --line:        #dbd9cd;
  --line-soft:   #e6e4da;
  --line-strong: #b9b6a7;
  --line-bright: #6e7268;

  /* — Ink — */
  --ink-0: #1c2126;
  --ink-1: #40474e;
  --ink-2: #656c73;
  --ink-3: #8f959b;

  /* — Per-page accent (pv system). Default: slate. Never green/red. — */
  --pv-accent:        #46586a;
  --pv-accent-strong: #33424f;
  --pv-soft:          rgba(70, 88, 106, 0.10);

  /* Legacy accent names — wired to the pv accent so every consumer
     (links, focus, buttons) follows the page variant. */
  --accent:       var(--pv-accent);
  --accent-hover: var(--pv-accent-strong);
  --accent-soft:  var(--pv-soft);

  /* — Market semantics. Reserved: direction & verdict ONLY. — */
  --success:   #147a4c;                    /* win / above list  */
  --danger:    #b23c31;                    /* lose / below list */
  --info:      #3d5d7a;                    /* fair (steel blue) */
  --warning:   #96690f;
  --up:        var(--success);
  --down:      var(--danger);
  --up-soft:   rgba(20, 122, 76, 0.11);
  --down-soft: rgba(178, 60, 49, 0.11);

  /* — Board bar (the ink header of every value board) — */
  --board-bar:     #1f242a;
  --board-bar-ink: #f1efe8;

  /* — Type — */
  --display: "Schibsted Grotesk", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --sans:    "Public Sans", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* — Geometry (soft-square, ledger corners) — */
  --r-1: 3px;
  --r-2: 6px;
  --r-3: 10px;
  --r-4: 14px;
  --r-pill: 999px;

  /* — Shadows: paper sits flat; borders do the work — */
  --shadow-sm: 0 1px 2px rgba(28, 33, 38, 0.05);
  --shadow:    0 2px 10px rgba(28, 33, 38, 0.07);
  --shadow-lg: 0 20px 50px -12px rgba(28, 33, 38, 0.25);

  /* — Rhythm (8px base) — */
  --space-section: clamp(3.5rem, 8vw, 6rem);
  --topbar-h: 59px;               /* 2px index rule + 56 row + 1 hairline */

  --ad-min-mobile: 100px;
  --ad-min-desktop: 250px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-0:        #15181a;   /* the desk after close */
  --bg-1:        #1c2124;
  --bg-2:        #22282c;
  --bg-3:        #2b3237;
  --bg-elevated: #1c2124;
  --bg-glass:    rgba(21, 24, 26, 0.90);
  --line:        #32383e;
  --line-soft:   #2a3035;
  --line-strong: #4a525a;
  --line-bright: #8f959b;
  --ink-0: #eceae2;
  --ink-1: #c4c4bb;
  --ink-2: #94989c;
  --ink-3: #6f757b;

  --pv-accent:        #a3b8c9;
  --pv-accent-strong: #c2d2df;
  --pv-soft:          rgba(163, 184, 201, 0.13);

  --success: #4cc48c;
  --danger:  #e58175;
  --info:    #8db1cf;
  --warning: #d3a94e;
  --up-soft:   rgba(76, 196, 140, 0.13);
  --down-soft: rgba(229, 129, 117, 0.13);

  --board-bar:     #0d1013;
  --board-bar-ink: #d8d6cc;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow:    0 2px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
}

/* ─────────────────────────────────────────────────────────────
   PV VARIANTS — build-time art direction. prerender.py stamps
   pv-a{0..4}, pv-hero-{0..2}, pv-orn-{0..2} on <body>, keyed by
   md5 of the page slug (value lists keyed by game slug).
   Accents are a desk-neutral set: slate, steel blue, aubergine,
   olive, warm gray. All AA on the paper base. Green/red stay
   reserved for market semantics and are never page accents.
   ───────────────────────────────────────────────────────────── */
body.pv-a0 { --pv-accent: #46586a; --pv-accent-strong: #33424f; --pv-soft: rgba(70, 88, 106, 0.10); }   /* slate      */
body.pv-a1 { --pv-accent: #3c617f; --pv-accent-strong: #2b4a63; --pv-soft: rgba(60, 97, 127, 0.10); }   /* steel blue */
body.pv-a2 { --pv-accent: #5f4767; --pv-accent-strong: #48344e; --pv-soft: rgba(95, 71, 103, 0.10); }   /* aubergine  */
body.pv-a3 { --pv-accent: #59613a; --pv-accent-strong: #43492b; --pv-soft: rgba(89, 97, 58, 0.11); }    /* olive      */
body.pv-a4 { --pv-accent: #6b5d4e; --pv-accent-strong: #52463a; --pv-soft: rgba(107, 93, 78, 0.11); }   /* warm gray  */

:root[data-theme="dark"] body.pv-a0 { --pv-accent: #a3b8c9; --pv-accent-strong: #c2d2df; --pv-soft: rgba(163, 184, 201, 0.13); }
:root[data-theme="dark"] body.pv-a1 { --pv-accent: #8fb8d9; --pv-accent-strong: #b3d0e8; --pv-soft: rgba(143, 184, 217, 0.13); }
:root[data-theme="dark"] body.pv-a2 { --pv-accent: #c8aad0; --pv-accent-strong: #dcc6e2; --pv-soft: rgba(200, 170, 208, 0.13); }
:root[data-theme="dark"] body.pv-a3 { --pv-accent: #b8c18b; --pv-accent-strong: #cfd6ab; --pv-soft: rgba(184, 193, 139, 0.13); }
:root[data-theme="dark"] body.pv-a4 { --pv-accent: #c8b5a0; --pv-accent-strong: #dccdbd; --pv-soft: rgba(200, 181, 160, 0.13); }

/* — Reset — */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
[hidden] { display: none !important; }
::selection { background: var(--pv-accent); color: var(--bg-0); }

/* — Body — */
html, body {
  background: var(--bg-0);
  color: var(--ink-0);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* — Type — */
h1, h2, h3, h4 {
  color: var(--ink-0);
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.022em;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.375rem, 2.6vw, 1.75rem); margin-top: 2em; }
h3 { font-size: clamp(1.0625rem, 1.8vw, 1.1875rem); margin-top: 1.5em; letter-spacing: -0.012em; }
h4 { font-size: 1rem; margin-top: 1.5em; letter-spacing: -0.008em; }

p, li {
  color: var(--ink-1);
  font-size: 1rem;
  line-height: 1.6;
}

a {
  color: var(--pv-accent);
  text-decoration: none;
  transition: color 120ms ease;
}
a:hover {
  color: var(--pv-accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* Numerals: mono + tabular wherever numbers appear */
code, kbd, pre, .mono, .tnum, .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
}
code, kbd {
  background: var(--bg-2);
  color: var(--ink-0);
  padding: 0.1em 0.4em;
  border-radius: var(--r-1);
  font-size: 0.88em;
}
pre {
  background: var(--bg-2);
  padding: 1rem 1.25rem;
  border-radius: var(--r-2);
  border: 1px solid var(--line);
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* Ticker rule — the recurring divider of the desk: a hairline
   carrying a short accent tick. */
hr {
  border: none;
  height: 1px;
  background: var(--line);
  margin: 2.5rem 0;
  position: relative;
  overflow: visible;
}
hr::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 40px; height: 2px;
  background: var(--pv-accent);
}

:focus-visible {
  outline: 2px solid var(--pv-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* — Layout shell — */
.shell {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
}
.shell--narrow { max-width: 768px; }
.shell--wide   { max-width: 1280px; }
@media (min-width: 768px) { .shell { padding: 0 2rem; } }

main { flex: 1; padding: 1.5rem 0 var(--space-section); position: relative; }

/* ─────────────────────────────────────────────────────────────
   PV ORNAMENTS — quiet paper details, one per page variant.
   orn-0: plain paper. orn-1: faint graph-grid band under the
   masthead. orn-2: a ruler edge — fine tick marks along the top.
   ───────────────────────────────────────────────────────────── */
body.pv-orn-1 main::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 300px;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 92%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 92%);
}
body.pv-orn-2 main::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 12px;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right,
      var(--line-strong) 0 1px, transparent 1px 32px),
    linear-gradient(var(--line) 0 1px, transparent 1px);
  background-size: 100% 8px, 100% 1px;
  background-position: 8px 0, 0 0;
  background-repeat: no-repeat;
  opacity: 0.9;
}

/* — Top bar: the desk masthead. A 2px page-accent index rule sits
     above a solid paper bar with a hairline beneath. — */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-top: 2px solid var(--pv-accent);
  border-bottom: 1px solid var(--line);
}
.topbar__row {
  display: flex; align-items: center; gap: 0.5rem;
  min-height: 56px;
  padding: 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.015em;
  color: var(--ink-0);
}
.brand:hover { color: var(--ink-0); text-decoration: none; }
.brand__mark {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  background: var(--ink-0);
  color: var(--bg-0);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.5625rem;
  letter-spacing: 0.02em;
  border-radius: var(--r-1);
}
.brand__mark::before { content: "TV"; }

.nav__links {
  display: none;
  gap: 0;
  margin-left: 1.25rem;
}
@media (min-width: 860px) { .nav__links { display: inline-flex; } }
.nav__link {
  padding: 1.05rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-1);
}
.nav__link:hover { color: var(--ink-0); text-decoration: none; }
.nav__link[aria-current="page"] {
  color: var(--ink-0);
  box-shadow: inset 0 -2px 0 var(--pv-accent);
}

.nav__spacer { flex: 1; }
.nav__btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-1);
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-1);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.nav__btn:hover { color: var(--ink-0); border-color: var(--line-strong); }
.nav__btn kbd {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  font-size: 0.85em;
  border-radius: var(--r-1);
  color: var(--ink-2);
}
.nav__toggle {
  display: inline-grid; place-items: center;
  padding: 0.35rem 0.6rem;
  font-size: 1.1rem;
  border-color: var(--line);
}
@media (min-width: 860px) { .nav__toggle { display: none; } }
.nav__drawer {
  display: none;
  flex-direction: column;
  padding: 0.25rem 0 0.75rem;
  border-top: 1px solid var(--line);
}
.nav__drawer.is-open { display: flex; }
.nav__drawer .nav__link { padding: 0.65rem 0; font-size: 0.95rem; }
.nav__drawer .nav__link[aria-current="page"] {
  box-shadow: inset 2px 0 0 var(--pv-accent);
  padding-left: 0.75rem;
}

/* — Footer: the fine-print end of the sheet — */
.footer {
  background: var(--bg-2);
  padding: 3rem 0 2rem;
  margin-top: var(--space-section);
  border-top: 1px solid var(--line);
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 40px; height: 2px;
  background: var(--pv-accent);
}
.footer__grid {
  display: grid; gap: 2rem;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2.5rem; }
}
.footer__col h4 {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 0.875rem;
}
.footer__col a {
  display: block;
  padding: 0.3rem 0;
  color: var(--ink-1);
  font-size: 0.8rem;
}
.footer__col a:hover { color: var(--ink-0); text-decoration: underline; }
.footer__legal {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.72rem;
  line-height: 1.6;
}
.footer__legal .row { justify-content: space-between; gap: 1rem; }

/* — Buttons: ink blocks, terminal-labelled — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  background: var(--ink-0);
  color: var(--bg-0);
  padding: 0.6875rem 1.25rem;
  border: 1px solid var(--ink-0);
  border-radius: var(--r-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  text-decoration: none !important;
}
.btn:hover { background: var(--ink-1); border-color: var(--ink-1); color: var(--bg-0); }
.btn--ghost {
  background: transparent;
  color: var(--ink-0);
  border: 1px solid var(--line-strong);
}
.btn--ghost:hover { background: var(--bg-2); color: var(--ink-0); border-color: var(--ink-2); }
.btn--sm { padding: 0.4375rem 0.875rem; font-size: 0.7rem; }
.btn--lg { padding: 0.875rem 1.75rem; font-size: 0.82rem; }
:root[data-theme="dark"] .btn { background: var(--ink-0); color: var(--bg-0); }

/* — Forms — */
label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.4rem;
}
input[type="text"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--bg-1);
  color: var(--ink-0);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 0.6875rem 0.875rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  transition: border-color 120ms, box-shadow 120ms;
}
input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; }
input::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  border-color: var(--pv-accent);
  box-shadow: 0 0 0 3px var(--pv-soft);
  outline: none;
}
select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}
.input-group { display: grid; gap: 1rem; }
@media (min-width: 600px) {
  .input-group--2 { grid-template-columns: 1fr 1fr; }
  .input-group--3 { grid-template-columns: 1fr 1fr 1fr; }
}

/* — Chips: small ledger tags. Semantic chips keep market color. — */
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--bg-2);
  color: var(--ink-1);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-1);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.chip--accent  { background: var(--bg-1); color: var(--ink-0); border-color: var(--line-strong); font-weight: 600; }
.chip--success { background: var(--up-soft);   color: var(--success); border-color: transparent; }
.chip--warn    { background: rgba(150, 105, 15, 0.12); color: var(--warning); border-color: transparent; }
.chip--danger  { background: var(--down-soft); color: var(--danger);  border-color: transparent; }
.chip--game    { background: var(--bg-3); color: var(--ink-0); border-color: transparent; }

/* — The honest badge: "community estimate, as of <date>". A ledger
     stamp — bordered mono small-caps with a slate registration tick.
     Deliberately NOT green: freshness is metadata, not a verdict. — */
.updated-stamp {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 0.375rem 0.625rem 0.375rem 0.5rem;
  margin: 0.5rem 0 1rem;
  font-variant-numeric: tabular-nums;
}
.updated-stamp:empty { display: none; }
.updated-stamp::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--pv-accent);
  border-radius: 1px;
  flex-shrink: 0;
}

/* — Breadcrumb — */
.breadcrumb {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin-bottom: 1.5rem;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  align-items: baseline;
}
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--ink-0); text-decoration: underline; }
.breadcrumb__sep { color: var(--line-strong); }

/* ─────────────────────────────────────────────────────────────
   HERO SYSTEM — one quiet voice, three pv variations.
   Applies to .db-hero, .tool-header, .gd-hero, .lp-hero__inner.

   pv-hero-0 "masthead": open on paper under a strong ink rule
              that carries the page-accent tick (default).
   pv-hero-1 "sheet":    the hero is a bordered filing card with
              an accent top rule.
   pv-hero-2 "index tab": an accent spine on the left edge.
   ───────────────────────────────────────────────────────────── */
.db-hero, .tool-header, .gd-hero {
  position: relative;
  margin: 0.5rem 0 2rem;
  padding: 1.5rem 0 0;
  text-align: left;
}
/* masthead rule (variant 0 = default) */
.db-hero::before, .tool-header::before, .gd-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background:
    linear-gradient(var(--pv-accent), var(--pv-accent)) left top / 48px 2px no-repeat,
    linear-gradient(var(--ink-0), var(--ink-0)) left top / 100% 2px no-repeat;
}

/* variant 1: filing sheet */
body.pv-hero-1 .db-hero,
body.pv-hero-1 .tool-header,
body.pv-hero-1 .gd-hero {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
}
body.pv-hero-1 .db-hero::before,
body.pv-hero-1 .tool-header::before,
body.pv-hero-1 .gd-hero::before {
  border-radius: var(--r-3) var(--r-3) 0 0;
  background:
    linear-gradient(var(--pv-accent), var(--pv-accent)) left top / 48px 2px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left top / 100% 1px no-repeat;
}

/* variant 2: index tab spine */
body.pv-hero-2 .db-hero,
body.pv-hero-2 .tool-header,
body.pv-hero-2 .gd-hero {
  padding: 0.25rem 0 0.25rem clamp(1rem, 2.5vw, 1.5rem);
  border-left: 3px solid var(--pv-accent);
}
body.pv-hero-2 .db-hero::before,
body.pv-hero-2 .tool-header::before,
body.pv-hero-2 .gd-hero::before { display: none; }

/* — Shared hero typography — */
.tool-header h1 {
  margin: 0.25rem 0 0.625rem;
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.06;
  max-width: 24ch;
}
.tool-header__lede {
  color: var(--ink-1);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  max-width: 58ch;
  line-height: 1.55;
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   LANDING — body.lp. The masthead thesis: values, then whether
   your trade is fair. Quiet paper, one strong rule.
   ───────────────────────────────────────────────────────────── */
body.lp main { padding-top: 0.5rem; }
.lp-hero { padding: clamp(1.5rem, 4vw, 3rem) 0 0; }
.lp-hero__inner {
  position: relative;
  padding: 1.75rem 0 0;
}
.lp-hero__inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background:
    linear-gradient(var(--pv-accent), var(--pv-accent)) left top / 48px 2px no-repeat,
    linear-gradient(var(--ink-0), var(--ink-0)) left top / 100% 2px no-repeat;
}
body.pv-hero-1 .lp-hero__inner {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: clamp(1.75rem, 4vw, 3rem);
}
body.pv-hero-1 .lp-hero__inner::before { border-radius: var(--r-3) var(--r-3) 0 0; }
body.pv-hero-2 .lp-hero__inner {
  border-left: 3px solid var(--pv-accent);
  padding: 0.5rem 0 0.5rem clamp(1rem, 3vw, 2rem);
}
body.pv-hero-2 .lp-hero__inner::before { display: none; }

.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--r-1);
  padding: 0.375rem 0.625rem;
  margin-bottom: 1.25rem;
}
.lp-eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--pv-accent);
  border-radius: 1px;
}
.lp-hero__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.125rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  max-width: 21ch;
  color: var(--ink-0);
}
.lp-hero__lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--ink-1);
  max-width: 56ch;
  line-height: 1.6;
  margin: 0 0 1.75rem;
}
body.lp .lp-hero .row { margin-top: 0; }

/* Section titles on the landing page: ticker-rule heads */
.section-title {
  position: relative;
  font-size: clamp(1.1875rem, 2.2vw, 1.375rem);
  letter-spacing: -0.015em;
  margin: 3rem 0 1.25rem;
  padding-top: 0.75rem;
}
.section-title::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.section-title::after {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 40px; height: 2px;
  background: var(--pv-accent);
}

/* Listing cards (home directory of lists & calculators) */
.lp-tools {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
@media (min-width: 600px) { .lp-tools { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .lp-tools { grid-template-columns: repeat(4, 1fr); } }
.lp-tool {
  position: relative;
  display: flex; flex-direction: column; gap: 0.375rem;
  padding: 1.125rem 1.25rem 1.25rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-decoration: none !important;
  color: inherit;
  transition: border-color 140ms, background 140ms, box-shadow 140ms;
}
.lp-tool:hover {
  border-color: var(--line-strong);
  box-shadow: inset 0 2px 0 var(--pv-accent), var(--shadow-sm);
  color: inherit;
}
.lp-tool__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.625rem;
  margin-bottom: 0.25rem;
}
.lp-tool__cat {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pv-accent);
}
.lp-tool__cat::before {
  content: "";
  display: inline-block; width: 6px; height: 6px;
  background: var(--pv-accent);
  border-radius: 1px;
}
.lp-tool__game {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.lp-tool__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.014em;
  color: var(--ink-0);
  line-height: 1.2;
}
.lp-tool__desc {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0.125rem 0 0;
}

/* ─────────────────────────────────────────────────────────────
   THE VALUE BOARD — the signature element. Value lists render as
   a market board: one bordered sheet, a sticky ink header bar,
   rows with right-aligned mono numerals, rarity as a fill-gauge,
   demand chips carrying direction semantics (a high-demand item
   closes above list → green; low closes below → red).
   The row markup is finder.js's .db-card, remapped by CSS grid.
   ───────────────────────────────────────────────────────────── */
body.db-page main { padding-top: 1.25rem; }

/* Sticky column header (static markup on value-list pages, kept
   outside #finder-grid so JS re-renders never touch it). */
.board-head {
  position: sticky;
  top: var(--topbar-h);
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 7.5rem 7.25rem 8.25rem;
  gap: 0 0.75rem;
  align-items: center;
  background: var(--board-bar);
  color: var(--board-bar-ink);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border-radius: var(--r-2) var(--r-2) 0 0;
}
.board-head span:last-child { text-align: right; }
.board-head + #finder-grid,
.board-head + .db-grid { border-radius: 0 0 var(--r-2) var(--r-2); border-top: 0; }

.db-grid {
  display: block;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
}

.db-card {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 7.5rem 7.25rem 8.25rem;
  gap: 0 0.75rem;
  align-items: center;
  padding: 0.5625rem 1rem;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background 100ms, box-shadow 100ms;
}
.db-card:last-child { border-bottom: 0; }
.db-card:hover {
  background: var(--pv-soft);
  box-shadow: inset 2px 0 0 var(--pv-accent);
}
.db-card__head { display: contents; }
.db-card__name {
  grid-column: 1; grid-row: 1;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--ink-0);
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Rarity: a typographic fill-gauge, not a rainbow. The square
   marker's fill encodes the tier; the hue stays ink. */
.db-card__rarity {
  grid-column: 2; grid-row: 1;
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  white-space: nowrap;
}
.db-card__rarity::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border: 1px solid currentColor;
  border-radius: 1px;
  background: linear-gradient(to top, currentColor var(--rar-fill, 0%), transparent 0);
  flex-shrink: 0;
}
.db-card[data-rarity="mythic"]    .db-card__rarity,
.db-card[data-rarity="mythical"]  .db-card__rarity { color: var(--ink-0); font-weight: 600; --rar-fill: 100%; }
.db-card[data-rarity="legendary"] .db-card__rarity { color: var(--ink-1); --rar-fill: 75%; }
.db-card[data-rarity="ultra-rare"] .db-card__rarity { color: var(--ink-1); --rar-fill: 60%; }
.db-card[data-rarity="event"]     .db-card__rarity { color: var(--ink-1); --rar-fill: 100%; }
.db-card[data-rarity="event"]     .db-card__rarity::before { border-radius: 50%; }
.db-card[data-rarity="rare"]      .db-card__rarity { --rar-fill: 45%; }
.db-card[data-rarity="uncommon"]  .db-card__rarity { --rar-fill: 20%; }
.db-card[data-rarity="common"]    .db-card__rarity { --rar-fill: 0%; }

/* Demand: direction chips. The site's own rule — high demand
   closes above list, low below it — so these carry the market
   green/red legitimately. */
.db-card__demand {
  grid-column: 3; grid-row: 1;
  justify-self: start;
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.1875rem 0.4375rem;
  border-radius: var(--r-1);
  background: var(--bg-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.db-card__demand::before { font-size: 0.85em; line-height: 1; }
.db-card__demand[data-demand="insane"] {
  background: var(--up-soft); color: var(--up);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 35%, transparent);
}
.db-card__demand[data-demand="insane"]::before { content: "▲"; }
.db-card__demand[data-demand="high"] { background: var(--up-soft); color: var(--up); }
.db-card__demand[data-demand="high"]::before { content: "▲"; }
.db-card__demand[data-demand="medium"] { background: var(--bg-2); color: var(--ink-1); }
.db-card__demand[data-demand="medium"]::before { content: "–"; }
.db-card__demand[data-demand="low"] { background: var(--down-soft); color: var(--down); }
.db-card__demand[data-demand="low"]::before { content: "▼"; }
.db-card__demand[data-demand=""] { background: transparent; color: var(--ink-3); }

/* Value: right-aligned tabular mono — the point of the board */
.db-card__value-row {
  grid-column: 4; grid-row: 1;
  justify-self: end;
  display: inline-flex; align-items: baseline; gap: 0.375rem;
}
.db-card__value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
}
.db-card__value-label {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* Board at small widths: rarity column folds away at 620, the
   board stays a clean three-column tape down to 360. */
@media (max-width: 620px) {
  .board-head,
  .db-card { grid-template-columns: minmax(0, 1fr) 6.5rem 6.5rem; gap: 0 0.5rem; }
  .board-head span:nth-child(2),
  .db-card__rarity { display: none; }
  .db-card__demand { grid-column: 2; }
  .db-card__value-row { grid-column: 3; }
}
@media (max-width: 400px) {
  .board-head,
  .db-card { grid-template-columns: minmax(0, 1fr) 5.25rem 5.75rem; }
  .db-card__demand::before { content: none !important; }
}

.db-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--ink-2);
}
.db-empty__icon {
  font-family: var(--mono);
  font-size: 1.5rem;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.db-empty__msg {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* — Board hero (value-list pages) — */
.db-hero__top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.db-hero__game {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pv-accent);
}
.db-hero__game::before {
  content: "";
  display: inline-block; width: 7px; height: 7px;
  background: var(--pv-accent);
  border-radius: 1px;
}
/* the freshness half of the honest badge */
.db-hero__updated {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--r-1);
  padding: 0.3125rem 0.5625rem;
  font-variant-numeric: tabular-nums;
}
.db-hero__title {
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 0.75rem;
}
.db-hero__topline {
  display: flex; align-items: baseline; gap: 0.625rem;
  flex-wrap: wrap;
  margin: 0 0 0.875rem;
}
.db-hero__count {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.6vw, 2.125rem);
  line-height: 1;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.db-hero__counted {
  font-size: clamp(0.95rem, 1.5vw, 1.0625rem);
  color: var(--ink-1);
}
.db-hero__lede {
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  color: var(--ink-1);
  max-width: 60ch;
  line-height: 1.55;
  margin: 0 0 0.875rem;
}
/* the provenance half of the honest badge */
.db-hero__source {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  max-width: 74ch;
  line-height: 1.6;
  margin: 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--line-strong);
}
.db-hero__source::before {
  content: "Source · ";
  color: var(--pv-accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* — Board toolbar (search / filter / sort) — */
.db-toolbar {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 0.875rem 1rem;
  margin: 0 0 1rem;
}
.db-toolbar__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.625rem;
}
@media (min-width: 720px) {
  .db-toolbar__grid { grid-template-columns: 2fr 1fr 1fr 1fr; align-items: end; }
}
.db-field { display: flex; flex-direction: column; gap: 0.3125rem; }
.db-field label { margin: 0; }
.db-field input[type="search"],
.db-field select {
  font-size: 0.9rem;
  padding: 0.5625rem 0.75rem;
  background: var(--bg-0);
}
.db-field input[type="search"] {
  padding-left: 2.125rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f959b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><line x1='21' y1='21' x2='16.65' y2='16.65'/></svg>");
  background-repeat: no-repeat;
  background-position: 0.75rem 50%;
  background-size: 14px 14px;
}
.db-toolbar__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
}
.db-count {
  display: inline-flex; align-items: baseline; gap: 0.375rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.db-count strong { color: var(--ink-0); font-weight: 600; }
.db-count__total { color: var(--ink-3); }
.db-clear {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  cursor: pointer;
  padding: 0.125rem 0;
}
.db-clear:hover { color: var(--pv-accent-strong); border-color: currentColor; }

/* — Item detail (board row → dossier modal) — */
.finder-detail {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(28, 33, 38, 0.45);
  display: none; place-items: center;
  padding: 1rem;
}
:root[data-theme="dark"] .finder-detail { background: rgba(0, 0, 0, 0.6); }
.finder-detail.is-open { display: grid; }
.finder-detail__panel {
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  width: 100%; max-width: 480px;
  max-height: 86vh;
  overflow-y: auto;
  padding: 0;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.finder-detail__panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background:
    linear-gradient(var(--pv-accent), var(--pv-accent)) left top / 48px 2px no-repeat,
    linear-gradient(var(--ink-0), var(--ink-0)) left top / 100% 2px no-repeat;
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.db-detail__pad { padding: 1.5rem 1.5rem 1.25rem; }
.db-detail__rarity {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.5rem;
}
.db-detail__rarity::before {
  content: "";
  display: inline-block; width: 7px; height: 7px;
  border: 1px solid currentColor;
  border-radius: 1px;
  background: currentColor;
}
.db-detail__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink-0);
  margin: 0 0 1rem;
}
.db-detail__value {
  font-family: var(--mono);
  font-weight: 600;
  font-size: clamp(1.75rem, 5vw, 2.375rem);
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
}
/* "vp · community estimate" — honest badge, modal edition */
.db-detail__value-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--bg-0);
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
}
.db-detail__pills { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.875rem 0 0; }
.db-detail__pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.25rem 0.5625rem;
  background: var(--bg-2);
  border-radius: var(--r-1);
  color: var(--ink-1);
}
.db-detail__pill--demand[data-demand="insane"],
.db-detail__pill--demand[data-demand="high"]   { background: var(--up-soft);   color: var(--up); }
.db-detail__pill--demand[data-demand="insane"] { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--up) 35%, transparent); font-weight: 600; }
.db-detail__pill--demand[data-demand="insane"]::before,
.db-detail__pill--demand[data-demand="high"]::before { content: "▲"; font-size: 0.85em; }
.db-detail__pill--demand[data-demand="medium"] { background: var(--bg-2); color: var(--ink-1); }
.db-detail__pill--demand[data-demand="low"]    { background: var(--down-soft); color: var(--down); }
.db-detail__pill--demand[data-demand="low"]::before { content: "▼"; font-size: 0.85em; }
.db-detail__notes {
  margin: 1rem 0 0;
  padding: 0.75rem 0.875rem;
  background: var(--bg-0);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 var(--r-1) var(--r-1) 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink-1);
}
.db-detail__attrs {
  margin: 1rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}
.db-detail__attr { display: flex; flex-direction: column; gap: 0.125rem; }
.db-detail__attr-key {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.db-detail__attr-val {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
}
.db-detail__tags {
  margin-top: 0.875rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-3);
}
.db-detail__tags span { color: var(--ink-2); }
.db-detail__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap;
  padding: 0.875rem 1.5rem;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.db-detail__fullpage {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--pv-accent);
}
.db-detail__close {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.4375rem 0.875rem;
  background: var(--ink-0);
  color: var(--bg-0);
  border: 0;
  border-radius: var(--r-1);
  cursor: pointer;
  text-decoration: none !important;
  margin-left: auto;
}
.db-detail__close:hover { background: var(--ink-1); color: var(--bg-0); }

/* — A–Z index on value-list pages — */
.fruit-index__list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.125rem 1.25rem;
}
.fruit-index__list li {
  border-bottom: 1px solid var(--line-soft);
  padding: 0.25rem 0;
  margin: 0;
  font-size: 0.9rem;
}
.fruit-index__list a { text-decoration: none; color: var(--ink-1); }
.fruit-index__list a:hover { color: var(--pv-accent-strong); text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────
   FAIR-TRADE CHECKER & CALCULATORS — body.calc-page. The desk's
   instrument: two ledger baskets and a verdict tape. All element
   IDs and classes the JS targets are unchanged.
   ───────────────────────────────────────────────────────────── */
body.calc-page main { padding-top: 1.25rem; }

.tool-shell {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 1.25rem;
  margin-top: 1rem;
}
@media (min-width: 720px) { .tool-shell { padding: 2rem; } }
.tool-shell::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background:
    linear-gradient(var(--pv-accent), var(--pv-accent)) left top / 48px 2px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) left top / 100% 1px no-repeat;
  border-radius: var(--r-3) var(--r-3) 0 0;
}
.tool-shell h3 {
  font-size: 0.95rem;
  margin: 0 0 0.625rem;
}

/* Baskets: each side of the trade is a ledger well */
.trade-side {
  display: grid; gap: 0.5rem;
  min-height: 72px;
  padding: 0.625rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-2);
  background: var(--bg-0);
}
.trade-side .muted { font-size: 0.84rem; margin: 0.25rem 0.25rem 0; }
.trade-total {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.trade-total strong {
  color: var(--ink-0);
  font-weight: 600;
  font-size: 1.0625rem;
}

/* Basket line items (rendered by trade-value.js) */
.finder-card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  padding: 0.5rem 0.6875rem;
}
.finder-card__name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink-0);
}
.finder-card__meta {
  display: flex; align-items: center; gap: 0.375rem;
  flex-wrap: wrap;
  margin-top: 0.3125rem;
}
.finder-card__meta .btn { margin-left: auto; padding: 0.125rem 0.5rem; line-height: 1.4; }

/* The verdict tape */
.tool-result {
  margin-top: 1.5rem;
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 1.25rem 1.5rem;
  position: relative;
}
.tool-result::before {
  content: "";
  position: absolute;
  top: -1px; left: 1.5rem;
  width: 40px; height: 2px;
  background: var(--pv-accent);
}
.tool-result__label {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 0.375rem;
}
.tool-result__value {
  font-family: var(--display);
  font-size: clamp(1.75rem, 4.5vw, 2.375rem);
  font-weight: 700;
  color: var(--ink-0);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.tool-result__sub {
  font-family: var(--mono);
  color: var(--ink-2);
  font-size: 0.78rem;
  margin-top: 0.4375rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
}
.tool-result__grid {
  display: grid;
  gap: 1rem 2rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

/* — At-a-glance stat table (item pages) — */
.mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.mini-table th, .mini-table td {
  text-align: left;
  padding: 0.5rem 0.25rem;
  border-bottom: 1px solid var(--line-soft);
}
.mini-table th {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.mini-table td { color: var(--ink-1); }
.mini-table tbody tr:last-child td { border-bottom: 0; }
.mini-table .num {
  text-align: right;
  color: var(--ink-0);
  font-weight: 500;
  font-size: 0.88rem;
}

/* — Higher / lower value ladder (item pages) — */
.fruit-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.fruit-nav__slot {
  display: flex; flex-direction: column; gap: 0.1875rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-decoration: none !important;
  color: var(--ink-1);
  background: var(--bg-1);
  transition: border-color 120ms, box-shadow 120ms;
}
a.fruit-nav__slot:hover {
  border-color: var(--line-strong);
  box-shadow: inset 0 2px 0 var(--pv-accent);
  color: var(--ink-1);
}
.fruit-nav__dir {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}
.fruit-nav__slot:first-child .fruit-nav__dir::before { content: "↑ "; }
.fruit-nav__slot:last-child .fruit-nav__dir::before { content: "↓ "; }
.fruit-nav__name { font-family: var(--display); font-weight: 600; color: var(--ink-0); }
span.fruit-nav__slot { visibility: hidden; }

/* ─────────────────────────────────────────────────────────────
   LEARN INDEX — body.db-page + .gx-grid. Research notes filed
   as index cards.
   ───────────────────────────────────────────────────────────── */
.gx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px)  { .gx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .gx-grid { grid-template-columns: repeat(3, 1fr); } }

.gx-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 1.25rem 1.25rem 1.125rem;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  text-decoration: none !important;
  color: inherit;
  transition: border-color 140ms, box-shadow 140ms;
}
.gx-card:hover {
  border-color: var(--line-strong);
  box-shadow: inset 0 2px 0 var(--pv-accent), var(--shadow-sm);
  color: inherit;
}
.gx-card__tag {
  display: inline-flex; align-items: center; gap: 0.375rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pv-accent);
  margin-bottom: 0.625rem;
}
.gx-card__tag::before {
  content: "";
  width: 6px; height: 6px;
  background: var(--pv-accent);
  border-radius: 1px;
  flex-shrink: 0;
}
.gx-card__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.014em;
  line-height: 1.28;
  color: var(--ink-0);
  margin: 0 0 0.4375rem;
}
.gx-card__desc {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 1rem;
}
.gx-card__foot {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.gx-card__cta {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--pv-accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.gx-card__cta::after { content: "→"; }

/* ─────────────────────────────────────────────────────────────
   LEARN ARTICLES — body.guide-page. A reading desk: 62–74ch
   measure, ~1.7 leading, ticker-rule section heads.
   ───────────────────────────────────────────────────────────── */
body.guide-page main { padding-top: 1.25rem; }

.gd-hero { margin-bottom: 1.5rem; }
.gd-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pv-accent);
  margin-bottom: 0.875rem;
}
.gd-hero__eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--pv-accent);
  border-radius: 1px;
}
.gd-hero__title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4.4vw, 2.625rem);
  letter-spacing: -0.024em;
  line-height: 1.08;
  margin: 0 0 0.875rem;
  color: var(--ink-0);
  max-width: 26ch;
}
.gd-hero__lede {
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  color: var(--ink-1);
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 0 1.125rem;
}
.gd-meta { display: flex; align-items: center; gap: 0.875rem; flex-wrap: wrap; }
.gd-meta__byline { display: flex; flex-direction: column; gap: 0.375rem; }
/* article byline: the analyst's name above the date stamp */
.gd-meta__author {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-0);
}
/* published date, stamped like the rest of the caveats */
.gd-meta__sub {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--bg-1);
  border-radius: var(--r-1);
  padding: 0.3125rem 0.5625rem;
  font-variant-numeric: tabular-nums;
}
.gd-meta__sub::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--pv-accent);
  border-radius: 1px;
}

/* — Author box: end-of-article attribution, set like a ledger note — */
.author-box {
  margin: 1.75rem 0 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-1);
}
.author-box__label {
  display: block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin: 0 0 0.5rem;
}
.author-box__bio { margin: 0; font-size: 0.92rem; line-height: 1.6; color: var(--ink-1); }
.author-box__bio strong { color: var(--ink-0); font-weight: 600; }

/* Contents ledger */
.gd-toc {
  margin: 0.5rem 0 2rem;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-1);
}
.gd-toc__summary {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-0);
}
.gd-toc__summary::-webkit-details-marker { display: none; }
.gd-toc__summary:hover { background: var(--bg-2); }
.gd-toc__summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--pv-accent);
}
.gd-toc[open] .gd-toc__summary::after { content: "−"; }
.gd-toc__count {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-left: auto;
  margin-right: 0.5rem;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}
.gd-toc__list {
  list-style: none;
  margin: 0;
  padding: 0.375rem 0;
  border-top: 1px solid var(--line);
  counter-reset: gd-toc;
}
.gd-toc__item { counter-increment: gd-toc; margin: 0; }
.gd-toc__item a {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.4375rem 1rem;
  color: var(--ink-1);
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 100ms, color 100ms;
}
.gd-toc__item a::before {
  content: counter(gd-toc, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-3);
  flex-shrink: 0;
  width: 1.75em;
  font-variant-numeric: tabular-nums;
}
.gd-toc__item a:hover {
  background: var(--pv-soft);
  color: var(--ink-0);
  text-decoration: none;
}
.gd-toc__item a:hover::before { color: var(--pv-accent); }

/* ─────────────────────────────────────────────────────────────
   WRITEUP — long-form prose. Base measure 66ch; article pages
   run 68ch at 17px/1.7.
   ───────────────────────────────────────────────────────────── */
.writeup { margin-top: 2.5rem; max-width: 66ch; }
.writeup h2 {
  position: relative;
  font-size: clamp(1.25rem, 2.4vw, 1.5rem);
  letter-spacing: -0.016em;
  line-height: 1.2;
  margin: 2.25em 0 0.625em;
  padding-top: 0.6875rem;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.writeup h2::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--line);
}
.writeup h2::after {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 40px; height: 2px;
  background: var(--pv-accent);
}
.writeup h2:first-child { margin-top: 0; }
.writeup h3 {
  font-size: 1.0625rem;
  margin: 1.75em 0 0.5em;
  scroll-margin-top: calc(var(--topbar-h) + 1rem);
}
.writeup p, .writeup li {
  color: var(--ink-1);
  font-size: 1rem;
  line-height: 1.65;
}
.writeup ul, .writeup ol { padding-left: 1.375em; }
.writeup li { margin-bottom: 0.4375em; }
.writeup li::marker { color: var(--pv-accent); }
.writeup strong { color: var(--ink-0); font-weight: 600; }
.writeup blockquote {
  border-left: 2px solid var(--pv-accent);
  padding: 0.25rem 0 0.25rem 1.125rem;
  margin: 1.5em 0;
  color: var(--ink-0);
  font-size: 1.0625rem;
  line-height: 1.55;
}
.writeup table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.writeup th, .writeup td {
  text-align: left;
  padding: 0.5625rem 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}
.writeup th {
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--ink-0);
}
.writeup td:last-child { font-variant-numeric: tabular-nums; }

/* FAQ ledger rows */
.writeup details {
  border-top: 1px solid var(--line);
  padding: 0;
  margin: 0;
}
.writeup details:last-of-type { border-bottom: 1px solid var(--line); }
.writeup details summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink-0);
  list-style: none;
  display: flex; gap: 0.75rem; align-items: baseline;
  padding: 0.875rem 0.25rem;
}
.writeup details summary::-webkit-details-marker { display: none; }
.writeup details summary::before {
  content: "+";
  font-family: var(--mono);
  font-weight: 500;
  color: var(--pv-accent);
  flex-shrink: 0;
  width: 1em;
}
.writeup details[open] summary::before { content: "−"; }
.writeup details summary:hover { color: var(--pv-accent-strong); }
.writeup details > p { padding: 0 0.25rem 1rem 1.75rem; margin: 0; }

/* Article pages: the full reading measure */
body.guide-page .writeup {
  margin-top: 0;
  max-width: 68ch;
}
body.guide-page .writeup p,
body.guide-page .writeup li {
  font-size: 1.0625rem;
  line-height: 1.7;
}
body.guide-page .writeup > h2:first-child + p {
  font-size: 1.125rem;
  color: var(--ink-0);
}
body.guide-page .writeup a {
  color: var(--pv-accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--pv-accent) 40%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
body.guide-page .writeup a:hover {
  color: var(--pv-accent-strong);
  text-decoration-color: currentColor;
}

/* ─────────────────────────────────────────────────────────────
   SHARED FURNITURE
   ───────────────────────────────────────────────────────────── */

/* Ad slots — dormant; hold space without decoration */
.ad-slot {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 0.7rem;
  margin: 1.5rem 0;
}
.ad-slot--header  { min-height: var(--ad-min-mobile); }
.ad-slot--article { min-height: var(--ad-min-mobile); }
.ad-slot--end     { min-height: var(--ad-min-mobile); }
@media (min-width: 768px) {
  .ad-slot--header  { min-height: 90px; }
  .ad-slot--article { min-height: var(--ad-min-desktop); }
  .ad-slot--end     { min-height: var(--ad-min-desktop); }
}
:root[data-ad-debug="1"] .ad-slot { border: 1px dashed var(--line); }

/* Search palette */
.palette-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(28, 33, 38, 0.45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 1rem 0;
}
:root[data-theme="dark"] .palette-backdrop { background: rgba(0, 0, 0, 0.6); }
.palette-backdrop.is-open { display: flex; }
.palette {
  width: 100%; max-width: 600px;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.palette input {
  border: 0;
  background: transparent;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
}
.palette input:focus { box-shadow: none; }
.palette__list { max-height: 60vh; overflow-y: auto; padding: 0.375rem; }
.palette__item {
  display: flex; flex-direction: column; gap: 0.125rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--r-1);
  cursor: pointer;
  color: var(--ink-0);
  font-size: 0.95rem;
}
.palette__item:hover, .palette__item[aria-selected="true"] {
  background: var(--pv-soft);
  box-shadow: inset 2px 0 0 var(--pv-accent);
}
.palette__item small { color: var(--ink-2); font-size: 0.76rem; }

/* Search-result cards (rendered by search.js inside the palette) */
.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  padding: 0.875rem 1rem;
}
.card--link { display: block; color: inherit; text-decoration: none !important; cursor: pointer; }
.card--link:hover {
  border-color: var(--line-strong);
  box-shadow: inset 2px 0 0 var(--pv-accent);
  color: inherit;
}
.card__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--ink-0);
  margin: 0 0 0.25rem;
}
.card__desc {
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.5;
  margin: 0;
}
.card__meta { display: flex; gap: 0.375rem; margin-top: 0.625rem; flex-wrap: wrap; }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 80;
  background: var(--bg-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-lg);
  padding: 1rem 1.25rem;
  max-width: 460px;
  margin-left: auto;
  display: none;
}
.cookie-banner.is-open { display: block; }
.cookie-banner p { margin: 0 0 0.75rem; font-size: 0.86rem; color: var(--ink-1); }

/* — Utilities — */
.row { display: flex; gap: 0.625rem; flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.center-text { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.muted { color: var(--ink-2); }
.no-wrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* — Reduced motion: the desk barely moves anyway — */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Empty ad containers stay invisible until a real ad unit fills them (AdSense
   dormant -> no blank reserved boxes at review; a filled slot is not :empty).
   Added 2026-07-06, mirroring the sports-network fix. */
.ad-slot:empty { display: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
