/* =====================================================================
   WorthDex — public site stylesheet (GTM-1 / P2-11b)
   Premium dark SaaS aesthetic. Dark-first, mobile-first, token-driven.
   No framework. Tokens mirror ios/Sources/DesignSystem/Theme.swift.
   ===================================================================== */

:root {
  /* Brand */
  --accent:           #FDB908;   /* electric yellow — used SPARINGLY */
  --accent-press:     #E5A600;
  --on-accent:        #0B1020;   /* text on the accent fill */

  /* Surfaces (dark-first) */
  --bg:               #0B1020;   /* page navy */
  --surface:          #161E33;   /* elevated surface */
  --surface-2:        #1C2540;   /* slightly lighter card */
  --surface-3:        #232E50;   /* hover / inset */

  /* Text */
  --text:             #F2F5F7;
  --text-secondary:   #A9B2C3;
  --text-tertiary:    #788299;

  /* Semantic price direction (never color-ALONE — always pair w/ sign/arrow) */
  --up:               #3FD08B;   /* success green */
  --up-bg:            rgba(63, 208, 139, 0.12);
  --down:             #FF6B6B;   /* danger red */
  --down-bg:          rgba(255, 107, 107, 0.12);

  /* Lines */
  --border:           rgba(255, 255, 255, 0.08);
  --border-strong:    rgba(255, 255, 255, 0.14);

  /* Radii */
  --r-card:           16px;
  --r-btn:            14px;
  --r-pill:           999px;

  /* Shadows + glows */
  --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.30);
  --shadow-md:        0 8px 24px rgba(0, 0, 0, 0.36);
  --shadow-lg:        0 24px 64px rgba(0, 0, 0, 0.46);
  --glow-accent:      0 0 0 1px rgba(253, 185, 8, 0.30), 0 8px 32px rgba(253, 185, 8, 0.18);

  /* Type */
  --font-body:   -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-num:    ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --font-mono:   ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  /* Layout */
  --maxw:        1120px;
  --maxw-prose:  720px;
  --gutter:      clamp(20px, 5vw, 40px);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Subtle top glow + grid wash — our-own decoration, no card art */
  background-image:
    radial-gradient(1100px 520px at 78% -8%, rgba(253, 185, 8, 0.10), transparent 60%),
    radial-gradient(900px 600px at 6% 0%, rgba(58, 90, 180, 0.16), transparent 55%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
p { margin: 0; }

/* ---------- Focus / a11y ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--on-accent);
  padding: 12px 18px; border-radius: 0 0 var(--r-btn) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
.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;
}

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
main { display: block; }
section { scroll-margin-top: 88px; }

/* ===================================================================
   Header / nav
   =================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  max-width: var(--maxw); margin-inline: auto;
  padding: 16px var(--gutter);
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; }
.brand img { height: 28px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a {
  color: var(--text-secondary); font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: 10px; transition: color .18s ease, background .18s ease;
}
.site-nav a:hover { color: var(--text); background: var(--surface); }
.site-nav .nav-cta {
  color: var(--on-accent); background: var(--accent); font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.site-nav .nav-cta:hover { background: var(--accent-press); color: var(--on-accent); }

/* ===================================================================
   Buttons / CTAs
   =================================================================== */
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--r-btn);
  font-weight: 600; font-size: 16px; cursor: pointer;
  border: 1px solid transparent; transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.cta.primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow-accent); }
.cta.primary:hover { transform: translateY(-1px); background: var(--accent-press); }
.cta.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.cta.secondary:hover { background: var(--surface-3); transform: translateY(-1px); }

.badge-link { display: inline-flex; transition: transform .16s ease, filter .16s ease; }
.badge-link:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 22px rgba(0,0,0,.5)); }
.badge-link img { height: 56px; width: auto; }

/* ===================================================================
   Chips / badges / pills
   =================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.badge-set {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.02em;
  color: var(--text);
}

/* price direction pill (sign + arrow always present, never color alone) */
.delta { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-num); font-weight: 600; font-size: 14px; padding: 3px 9px; border-radius: var(--r-pill); }
.delta.up   { color: var(--up);   background: var(--up-bg); }
.delta.down { color: var(--down); background: var(--down-bg); }
.delta .arrow { font-size: 12px; }

/* ===================================================================
   Cards / surfaces
   =================================================================== */
.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-md);
}

/* ===================================================================
   Footer
   =================================================================== */
.site-footer {
  margin-top: 96px; padding: 48px var(--gutter) 56px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.25));
}
.site-footer .wrap-inner { max-width: var(--maxw); margin-inline: auto; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 22px; }
.site-footer nav a { color: var(--text-secondary); font-size: 14px; }
.site-footer nav a:hover { color: var(--accent); }
.site-footer .footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.site-footer .footer-brand img { height: 24px; }
.site-footer .disclaimer { color: var(--text-tertiary); font-size: 13px; max-width: 640px; }
.site-footer .prices-note { color: var(--text-tertiary); font-size: 13px; margin-top: 8px; max-width: 640px; }
/* Accent "Browse all help articles →" CTA — used in the footer AND in-page (help/support), so it is
   NOT scoped to .site-footer (an unstyled in-body link is a web-quality FAIL). */
.browse-all { margin-top: 18px; }
.browse-all a { color: var(--accent); font-weight: 600; font-size: 15px; }

/* ===================================================================
   HERO (landing)
   =================================================================== */
.hero { max-width: var(--maxw); margin-inline: auto; padding: clamp(48px, 8vw, 96px) var(--gutter) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero h1 {
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: 1.03; letter-spacing: -0.03em; font-weight: 800;
  margin-bottom: 20px;
}
.hero h1 .accent {
  color: var(--accent);
  text-shadow: 0 0 40px rgba(253, 185, 8, 0.35);
}
.hero .lede { font-size: clamp(17px, 2vw, 20px); color: var(--text-secondary); max-width: 30ch; margin-bottom: 30px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 18px; }
.hero-sub { font-size: 15px; }
.hero-sub a { color: var(--accent); font-weight: 600; }
.hero-sub a:hover { text-decoration: underline; text-underline-offset: 3px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 20px;
}

/* Hero visual — our-own scan→value illustration */
.hero-visual { position: relative; }
.scan-illustration { width: 100%; height: auto; filter: drop-shadow(0 30px 70px rgba(0,0,0,0.5)); }

/* ===================================================================
   Trust strip
   =================================================================== */
.trust { max-width: var(--maxw); margin-inline: auto; padding: 8px var(--gutter) 24px; }
.trust ul { list-style: none; margin: 0; padding: 20px clamp(20px,4vw,36px); display: flex; flex-wrap: wrap; gap: 18px 40px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.trust li { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.trust li .ico { color: var(--accent); flex: 0 0 auto; }
.trust li strong { color: var(--text); font-family: var(--font-num); }

/* ===================================================================
   Generic section header
   =================================================================== */
.section { max-width: var(--maxw); margin-inline: auto; padding: clamp(48px, 7vw, 88px) var(--gutter); }
.section-head { max-width: var(--maxw-prose); margin-bottom: 40px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head :is(h1, h2) { font-size: clamp(28px, 4vw, 42px); margin-bottom: 14px; }
.section-head p { color: var(--text-secondary); font-size: 18px; }

/* ===================================================================
   How it works (3 steps)
   =================================================================== */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 28px 26px; position: relative; }
.steps li::before {
  counter-increment: step; content: counter(step);
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; margin-bottom: 18px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border-strong);
  color: var(--accent); font-family: var(--font-num); font-weight: 700; font-size: 18px;
}
.steps li h3 { font-size: 19px; margin-bottom: 8px; }
.steps li p { color: var(--text-secondary); font-size: 15px; }
.steps .step-ico { position: absolute; top: 26px; right: 24px; color: var(--text-tertiary); }

/* ===================================================================
   Features grid
   =================================================================== */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature-grid li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 30px 28px; transition: border-color .2s ease, transform .2s ease; }
.feature-grid li:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.feature-grid .f-ico { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: rgba(253,185,8,0.10); color: var(--accent); margin-bottom: 18px; }
.feature-grid h3 { font-size: 20px; margin-bottom: 10px; }
.feature-grid p { color: var(--text-secondary); font-size: 15.5px; }

/* ===================================================================
   Honest-pricing explainer (the wedge)
   =================================================================== */
.wedge { max-width: var(--maxw); margin-inline: auto; padding: clamp(48px, 7vw, 88px) var(--gutter); }
.wedge-card { background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-strong); border-radius: 22px; padding: clamp(28px, 4vw, 48px); box-shadow: var(--shadow-lg); }
.wedge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
/* No honest-price example to show (no card in the bundle has both a sold comp and an ask),
   so the wedge is prose only and must not leave half the card empty. */
.wedge-grid.single { grid-template-columns: 1fr; }
.wedge .demo .demo-head { font-size: 13px; color: var(--text-tertiary); margin: 0 0 4px; }
.wedge .demo .demo-head a { color: var(--text-secondary); font-weight: 600; }
.wedge .demo .demo-head a:hover { color: var(--accent); }
.wedge h2 { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 16px; }
.wedge p { color: var(--text-secondary); font-size: 17px; }
.wedge p + p { margin-top: 14px; }
.wedge .demo { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; }
.wedge .demo .row { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.wedge .demo .row:last-child { border-bottom: 0; }
.wedge .demo .lbl { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); }
.wedge .demo .lbl small { display: block; text-transform: none; letter-spacing: 0; color: var(--text-tertiary); font-size: 12px; margin-top: 2px; }
.wedge .demo .val { font-family: var(--font-num); font-weight: 700; font-size: 26px; }
.wedge .demo .val.sold { color: var(--text); }
.wedge .demo .val.ask  { color: var(--text-secondary); }
.wedge .demo .val.spread { color: var(--accent); font-size: 20px; }

/* ===================================================================
   Pricing
   =================================================================== */
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; max-width: 880px; }
.plan-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 32px 30px; display: flex; flex-direction: column; }
.plan-card.featured { border-color: rgba(253,185,8,0.4); box-shadow: var(--glow-accent); position: relative; }
.plan-card.featured::after { content: "Most popular"; position: absolute; top: -11px; right: 22px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--r-pill); }
.plan-card h3 { font-size: 22px; margin-bottom: 6px; }
.plan-card .plan-price { font-family: var(--font-num); margin: 14px 0; }
.plan-card .plan-price .amt { font-size: 38px; font-weight: 800; }
.plan-card .plan-price .per { color: var(--text-secondary); font-size: 16px; }
.plan-card .plan-price .alt { display: block; color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.plan-card .plan-trial { color: var(--accent); font-weight: 600; font-size: 14px; margin: -6px 0 0; }

/* ===================================================================
   Search (hero box, browse-hub box, /cards/search/ page)
   =================================================================== */
.search-box { display: flex; gap: 10px; margin: 8px 0 18px; max-width: 520px; flex-wrap: wrap; align-items: stretch; }
.search-box .search-input {
  flex: 1 1 240px; min-width: 0;
  appearance: none; -webkit-appearance: none;  /* kill the native (light) type=search chrome */
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r-btn);
  padding: 13px 16px; font-size: 16px; line-height: 1.2; font-family: var(--font-body);
}
.search-box .search-input::placeholder { color: var(--text-tertiary); }
.search-box .search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-box .search-input:focus-visible { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
.search-box .cta { flex: 0 0 auto; }
.search-page .lede { color: var(--text-secondary); font-size: 18px; max-width: 60ch; margin-bottom: 24px; }
.search-page .search-status { color: var(--text-secondary); font-size: 15px; margin: 6px 0 18px; min-height: 1.4em; }
.search-results { margin-top: 8px; }
.plan-card ul { list-style: none; margin: 18px 0 26px; padding: 0; display: grid; gap: 12px; }
.plan-card ul li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-secondary); font-size: 15px; }
.plan-card ul li .tick { color: var(--accent); flex: 0 0 auto; margin-top: 2px; }
.plan-card .plan-terms { color: var(--text-tertiary); font-size: 12.5px; line-height: 1.5; margin-top: auto; }
.plan-card .cta { width: 100%; justify-content: center; }

/* ===================================================================
   FAQ
   =================================================================== */
.faq-list { max-width: var(--maxw-prose); margin-inline: 0; display: grid; gap: 12px; }
.faq-list details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 4px 22px; transition: border-color .2s ease; }
.faq-list details[open] { border-color: var(--border-strong); }
.faq-list summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; color: var(--accent); font-size: 24px; font-weight: 400; transition: transform .2s ease; line-height: 1; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { color: var(--text-secondary); font-size: 15.5px; padding: 0 0 20px; max-width: 62ch; }

/* Help page (/help/) per-topic sub-headings: bare <h2>s reset to margin:0, so they hugged
   their accordion cards. Give them breathing room — gap below to the cards, and a larger gap
   above to separate each topic from the previous group (mirrors .legal/.browse-hub h2). The
   first sub-heading after .section-head keeps its top flush (the hero head already spaces it). */
#help > h2 { margin: 52px 0 20px; }
#help > .section-head + h2 { margin-top: 0; }

/* ===================================================================
   Final CTA
   =================================================================== */
.final-cta { max-width: var(--maxw); margin-inline: auto; padding: clamp(40px, 6vw, 72px) var(--gutter); }
.final-cta .panel { text-align: center; background: linear-gradient(160deg, rgba(253,185,8,0.10), var(--surface)); border: 1px solid rgba(253,185,8,0.28); border-radius: 24px; padding: clamp(40px, 6vw, 72px) var(--gutter); box-shadow: var(--shadow-lg); }
.final-cta h2 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 14px; }
.final-cta p { color: var(--text-secondary); font-size: 18px; max-width: 46ch; margin: 0 auto 28px; }
.final-cta .actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; align-items: center; }

/* ===================================================================
   CARD PAGE
   =================================================================== */
.card-page { max-width: 920px; margin-inline: auto; padding: 32px var(--gutter) 0; }
.breadcrumb { font-size: 14px; color: var(--text-secondary); margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span[aria-hidden] { color: var(--text-tertiary); }
.card-page h1 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 12px; }
.set-context { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.set-number { font-family: var(--font-mono); }

/* The hero value block */
.price-honest { background: linear-gradient(160deg, var(--surface-2), var(--surface)); border: 1px solid var(--border-strong); border-radius: 22px; padding: clamp(24px, 4vw, 36px); box-shadow: var(--shadow-lg); margin-bottom: 36px; }
.price-pair { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; align-items: end; }
.price-block { display: flex; flex-direction: column; gap: 6px; }
.price-block .price-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-tertiary); font-weight: 600; }
.price-block .price-value { font-family: var(--font-num); font-weight: 800; letter-spacing: -0.02em; }
.price-block.sold .price-value { font-size: clamp(42px, 7vw, 60px); color: var(--text); line-height: 1; }
.price-block.ask .price-value  { font-size: clamp(26px, 4vw, 34px); color: var(--text-secondary); }
.price-block.spread .price-value { font-size: clamp(22px, 3.4vw, 30px); color: var(--accent); }
.price-block .price-value.none { font-size: 20px; color: var(--text-tertiary); font-weight: 600; }
.price-block .price-note { font-size: 12.5px; color: var(--text-tertiary); }
.source-line { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-tertiary); font-size: 13.5px; line-height: 1.55; }

/* trend chart */
.trend { margin-bottom: 36px; }
.trend h2, .variants h2, .grade-teaser h2, .value-narrative h2, .card-faq h2 { font-size: 22px; margin-bottom: 16px; }

/* per-card value narrative + FAQ (GTM-8 content depth) */
.value-narrative { margin-bottom: 36px; }
.value-narrative p { color: var(--text-secondary); font-size: 15.5px; line-height: 1.65; max-width: 68ch; margin-bottom: 14px; }
.value-narrative p:last-child { margin-bottom: 0; }
.card-faq { margin-bottom: 36px; }
.card-faq dl { margin: 0; max-width: 68ch; }
.card-faq dt { font-weight: 600; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.card-faq dd { margin: 0 0 20px; color: var(--text-secondary); font-size: 15.5px; line-height: 1.65; }
.card-faq dd:last-child { margin-bottom: 0; }
/* THE `ch` OF THE `g<n>` Y-GUTTER RESOLVES ON `.chart-panel`, so its `font-size` below is
   load-bearing LAYOUT and not typography, and this note lives outside the rule because a brace
   in a comment inside it truncates every naive `_rule()`-style parser (including this repo's).
   Without a font-size the panel inherits the BODY size and `ch` means the body's `ch`: measured
   on the built page, 16px gives 1ch = 10.08px while the 11.5px axis labels give 1ch = 7.23px, so
   a g5 gutter reserved 55.42px for a widest label of 30.84px. 24.58px, 44% of the gutter, wasted
   on EVERY card at EVERY width. At 320px that surplus was the difference between the x labels
   clearing each other by +4.9px (the pre-window live site) and OVERLAPPING by -3.9px, a WCAG
   1.4.10 reflow failure and a loss of information, not cosmetic tightness.
   It was first filed as a harmless rough edge on the reasoning that `ch` against a larger font
   only ever over-reserves. Over-reserving IS the defect: the gutter steals plot width from the
   axis it exists to align. Matching the label size makes each `<n>.5ch` mean what it says, and
   it stays comfortably wider than the text it reserves (5.5ch x 7.28 = 40.0px vs 30.84px). */
/* ---------- trend chart panel: y gutter + plot + x axis (SITE-TREND-AXES-1) ----------
   The chart had NO axes at all, which made it decoration: a reader could not tell whether the
   rise happened over a week or a year, nor what any price on it was. The glyphs are HTML rather
   than SVG <text> because the panel scales 806/320 = 2.519x at the 1120px container and ~1.0x on
   a phone, so any type inside the viewBox would be 2.5x oversized on a desktop.
   The GRID is what keeps the labels aligned to the picture: one row for the plot, one for the x
   axis, and the plot column is `minmax(0, 1fr)` — NOT `1fr` — because `1fr`'s auto minimum is the
   SVG's 320px intrinsic width, which overflows the page below ~390px. */
.chart-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  font-size: 12.5px;
}
/* The plot. `overflow: visible` is REQUIRED, not cosmetic: chart.py plots edge to edge (zero
   padding, so the CSS never has to duplicate a Python inset), and `svg:root` is `overflow:
   hidden` by UA default — which would clip half the stroke at the highest and lowest vertices
   and half of the top and bottom gridlines, flattening the line at its own peak. */
.spark { grid-area: 1 / 2; width: 100%; height: auto; overflow: visible; }
.spark .line-sold { stroke: var(--accent); }
.spark .line-ask  { stroke: var(--text-secondary); }
.spark .grid-line { stroke: var(--border-strong); }
/* y axis: the plotted max, midpoint and min, top first, one per gridline. `space-between` puts
   k labels at 0%..100% of the plot height, which is where chart.py draws the k gridlines; the
   negative block margins are the half-line-height correction that centres each label ON its
   line instead of hanging it below/above. */
.chart-y {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: -0.6em 0;
  color: var(--text-secondary);
  font-family: var(--font-num);
  font-size: 12.5px;
  line-height: 1.2;
  text-align: right;
  white-space: nowrap;
}
/* A flat series gets ONE y label and ONE gridline, and chart.py puts that line at the MIDDLE
   (a flat line is drawn at mid-height), so the lone label must be centred too — `space-between`
   would pin it to the top, pointing at empty panel. */
.chart-y.n1 span:only-child { margin: auto 0; }
/* `.chart-grid` IS A CONTAINER (see `container:` in the rule), because the label-collision
   predicate is the PLOT width and nothing else. This element IS the plot column, so querying it
   asks the only question that matters: is there room for these labels? A viewport breakpoint
   cannot ask it -- the plot is the viewport MINUS the y gutter, and the gutter varies per card by
   up to 4ch (g5..g9 live, g11 reachable via the clamp), so one breakpoint is either too early for
   a narrow gutter or too late for a wide one. Same support tier as the `:has()` the time-window
   control already depends on. */
/* x axis: date labels under the tick marks, at 0/25/50/75/100% of the plot width. Eight columns
   because five labels cannot be centred on those five fractions in five columns: items sit at
   cols 1 / 2-4 / 4-6 / 6-8 / 8, which centres the middle three on 25/50/75% while the outer two
   are pinned to the plot edges by `justify-self` (centring them would miss by ~50px at the wide
   layout). The tick MARK is the `::before` on each label, so a tick can never drift from its
   date. */
.chart-grid {
  grid-area: 2 / 2;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.2;
  container: chart-grid / inline-size;
}
.chart-grid span { position: relative; grid-row: 1; padding-top: 8px; text-align: center; white-space: nowrap; }
.chart-grid span::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 5px;
  background: var(--border-strong);
}
.chart-grid span:first-child { grid-column: 1; justify-self: start; text-align: left; }
.chart-grid span:first-child::before { left: 0; }
.chart-grid span:last-child { grid-column: 8; justify-self: end; text-align: right; }
.chart-grid span:last-child::before { left: auto; right: 0; }
.chart-grid.n5 span:nth-child(2) { grid-column: 2 / 4; }
.chart-grid.n5 span:nth-child(3) { grid-column: 4 / 6; }
.chart-grid.n5 span:nth-child(4) { grid-column: 6 / 8; }
/* A THREE-tick axis (3-4 distinct dates): the middle label centres on the 50% mark, the same
   column the five-tick middle uses. Measured before this change: 0 of 17,263 axes were n3
   (17,261 n5 + 2 n2), so the rule was missing and nothing could see it. The windows make n3
   REACHABLE -- 3 of 34,515 offered views on the real 20260824 build, not "common" -- and
   reachable at all is the justification: it ships with the feature rather than after the first
   bug report. */
.chart-grid.n3 span:nth-child(2) { grid-column: 4 / 6; }
.chart-grid.n1 span:only-child { grid-column: 1 / -1; justify-self: center; text-align: center; }
.chart-grid.n1 span:only-child::before { left: 50%; right: auto; }
/* THE INTERIOR LABEL GOES when the plot cannot hold three of them, leaving first and last.
   MEASURED: the gap between two adjacent label TEXTS is `(plot - sum of label widths) / 2`,
   because the outer two are edge-pinned and the middle is centred (g5 at 320px: (196.17 -
   177.30)/2 = +9.4 measured +8.6; g9 at 320px: (167.19 - 177.30)/2 = -5.1 measured -5.9). So the
   no-overlap condition is simply `plot > total label text`, and the worst case is three
   year-bearing labels: the widest string `_x_labels` can emit is "24 Aug 2026" at 70.66px in
   this font (browser-measured), so 3 x 70.66 = 211.97px. The threshold is 215px, i.e. the
   measured worst case and not an eyeballed one -- an earlier 200px guess was BELOW it, which
   would have left a three-year-label axis (reachable when a short span crosses New Year, so
   first, middle and last all carry a year) overlapping on a 201-212px plot.
   With the middle gone, two labels need 2 x 70.66 = 141.3px and the narrowest plot the layout
   can produce at 320px is ~166px (g11), so the pair always clears.
   Text-to-text, NOT cell-to-cell: the grid cells touch at 0px by construction, so measuring the
   cell boxes says nothing about whether the writing collides -- that is what made this defect
   invisible to a media-query grep and to a first browser pass.
   Which one is "the middle": n3 labels it child 2; an n5 axis has already lost children 2 and 4
   to the query below, so its survivor is child 3. */
@container chart-grid (max-width: 215px) {
  .chart-grid.n3 span:nth-child(2),
  .chart-grid.n5 span:nth-child(3) { display: none; }
}
.legend { display: flex; gap: 22px; margin-top: 14px; color: var(--text-secondary); font-size: 13.5px; align-items: center; }
.legend .swatch { display: inline-block; width: 22px; height: 0; border-top: 3px solid; margin-right: 8px; vertical-align: middle; }
.legend .swatch.sold { border-color: var(--accent); }
.legend .swatch.ask  { border-color: var(--text-secondary); border-top-style: dashed; }
/* The legend's flex `gap` lands between a swatch and its OWN label, because the labels are bare
   text nodes (card.html) and so each is its own flex item. With the swatch's 8px margin that put
   30px between a dash and the thing it names, and in a sold+ask legend the intra-pair and
   inter-pair gaps were identical, so the grouping was ambiguous — a legend reading worse than no
   legend, which is the failure `has_ask_series` exists to avoid. Pair each swatch with its label
   in a span and let the gap separate PAIRS. */
.legend .key { display: inline-flex; align-items: center; }
/* The provenance footnote under the trend line (HIST-JUSTTCG-BACKFILL-1). It had NO sizing rule:
   `.muted` sets colour only and the global `p { margin: 0 }` applies, so it rendered at body 17px
   with zero separation from a 13.5px legend and no measure — the largest text on the page below
   the price block, louder than the 15.5px narrative it introduces. Scoped to `.trend` rather than
   the card page, because `.muted` also styles the variant-table cells (`card.html` variants) and a
   broader rule would shrink those too. Matches `.legend`'s scale so the annotation sits under the
   line it annotates instead of shouting over it. */
.trend .provenance { margin-top: 8px; color: var(--text-tertiary); font-size: 13.5px;
                     line-height: 1.55; max-width: 68ch; }

/* ---------- trend chart TIME WINDOWS (SITE-TREND-WINDOW-1) ----------
   Two views of one card's history, one visible at a time, selected by native radios and
   revealed by `:has()`. No JavaScript in the trend section at all.

   RESETS FIRST, and they are mandatory. The UA gives `fieldset` a border, padding, a margin
   AND `min-inline-size: min-content` -- the last of those is the classic reason a grid or flex
   child refuses to shrink below its content, which is the same failure `minmax(0, 1fr)` was
   added to `.chart-panel` to prevent (and which `test_assets.py` pins). Un-reset, this
   wrapper can push the card page into horizontal overflow below ~390px. */
.trend-windows { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.chart-window { margin: 0; }
/* The figure's accessible name, and after the content-model fix a WRAPPER: <figcaption> is
   valid only as the first or last child of its <figure>, so the legend, the provenance line and
   the density sentence all live inside it and the caption sentence gets its own <p>.
   `.caption-line` carries the type; without it the sentence inherits body 17px and becomes the
   largest text under the price block -- the exact mistake `.trend .provenance` was written to
   fix, one element over, on the element that carries AC (c)'s text. */
.chart-caption { margin-top: 10px; max-width: 68ch; }
.chart-caption .caption-line { color: var(--text-secondary); font-size: 13.5px;
                               line-height: 1.55; }
/* The chip row. `flex-wrap` is the WCAG 1.4.10 reflow answer: at 320px the two chips wrap to
   a second line instead of forcing a horizontal scrollbar on the whole page. */
.chart-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
/* Scoped to `.chart-chips` deliberately, and it must RESET what the older `.chip` block above
   leaks. That block was written for a landing-page pill and was genuinely unreferenced until
   these chips became the ONLY `class="chip"` in the tree -- so it now applies to them, and
   measured in Chrome it was handing every chip `border: 1px solid rgba(255,255,255,0.08)` and
   `font-weight: 500` that nobody here chose. The selected chip was an accent fill inside a
   1.28:1 hairline. `border: 0` and `font-weight: 400` take it back; the old block is left alone
   because it is still the shape any future pill should get.
   32px min-height clears WCAG 2.5.8's 24px target floor with room for the focus ring.
   CONTRAST, all existing tokens, no hex, all five ratios measured: unselected `--text` on
   `--surface-3` is 12.15:1; selected `--on-accent` on `--accent` is 10.93:1; and the state
   CHANGE is accent vs surface-3 at 7.68:1, a luminance inversion rather than a hue-only shift
   (the 1.4.1 answer). Deliberately NOT used: `--border-strong` as a chip boundary (1.54:1 over
   `--surface-3`, under 1.4.11's 3:1) and `--text-tertiary` for the chip text (3.45:1, under the
   4.5:1 floor at this size). Both of those were first written down against `--surface`, the
   panel BEHIND the chips rather than the chip itself; against the chip they are 1.54 and 3.45,
   and both conclusions hold.
   STATED RATHER THAN HIDDEN: the unselected chip's own fill against the page `--bg` is 1.42:1,
   so the chip BOUNDARY does not meet 1.4.11's 3:1. That is deliberate and defensible -- the
   control is identified by its TEXT at 12.15:1 and its selected state by a luminance inversion,
   not by an edge -- but it is a real number and belongs written down, not left silent. */
.chart-chips .chip {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text);
  font-size: 13.5px; font-weight: 400;
}
/* The input is VISUALLY hidden but still a real, focusable radio: `opacity: 0` on a 1x1
   absolutely-positioned box. NEVER `display: none` or `visibility: hidden` -- either one
   removes it from the tab order and from the browser's arrow-key radiogroup handling, which
   would leave the whole control keyboard-unreachable while still looking correct. */
.chart-chips .chip-in {
  position: absolute; appearance: none; -webkit-appearance: none;
  opacity: 0; width: 1px; height: 1px;
}
.chart-chips .chip:has(.chip-in:checked) { background: var(--accent); color: var(--on-accent); }
/* The ring is painted on the visible chip, because the input it belongs to is 1x1 and invisible. */
.chart-chips .chip:has(.chip-in:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
/* THE REVEAL, written INVERTED on purpose: "hide the views that are not selected", never
   "show the selected view". A UA that cannot parse `:has()` drops these two rules and gets
   BOTH views stacked, each with its own caption, legend and provenance line -- degraded but
   honest. Written the other way round, the same UA would show NOTHING. `display: none` is
   also the only hiding technique that removes the other view from the accessibility tree;
   `visibility`, `opacity`, `clip`, `clip-path` and `.sr-only` all leave it in, which here
   means two charts, two captions, two legends and two density claims read in sequence. */
.trend-windows:has(.chip-in[value="w30"]:checked) .chart-window:not([data-window="w30"]) { display: none; }
.trend-windows:has(.chip-in[value="all"]:checked) .chart-window:not([data-window="all"]) { display: none; }
/* THE SHARED Y GUTTER. `.chart-panel`'s first column is `auto`, so each view would size its
   own gutter from its own widest y label and the plot would visibly JUMP width when the
   selection changes. The fieldset carries one `g{n}` class derived from the widest label
   across BOTH views. Measured over 17,263 charted pages: the widest label is identical across
   views on 17,070, one character wider on 184, two on 4. No inline style, no new token. */
.trend-windows.g4 .chart-panel { grid-template-columns: 4.5ch minmax(0, 1fr); }
.trend-windows.g5 .chart-panel { grid-template-columns: 5.5ch minmax(0, 1fr); }
.trend-windows.g6 .chart-panel { grid-template-columns: 6.5ch minmax(0, 1fr); }
.trend-windows.g7 .chart-panel { grid-template-columns: 7.5ch minmax(0, 1fr); }
.trend-windows.g8 .chart-panel { grid-template-columns: 8.5ch minmax(0, 1fr); }
.trend-windows.g9 .chart-panel { grid-template-columns: 9.5ch minmax(0, 1fr); }
.trend-windows.g10 .chart-panel { grid-template-columns: 10.5ch minmax(0, 1fr); }
.trend-windows.g11 .chart-panel { grid-template-columns: 11.5ch minmax(0, 1fr); }
.muted { color: var(--text-tertiary); }

/* variants table */
.variants { margin-bottom: 36px; }
.variants table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.variants thead th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.variants tbody th, .variants tbody td { padding: 16px 18px; border-bottom: 1px solid var(--border); font-size: 15px; }
.variants tbody tr:last-child th, .variants tbody tr:last-child td { border-bottom: 0; }
.variants tbody th { font-weight: 600; text-align: left; }
.variants tbody td { font-family: var(--font-num); color: var(--text); }

/* grade teaser */
.grade-teaser { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-card); padding: 28px; margin-bottom: 36px; }
.grade-teaser p { color: var(--text-secondary); font-size: 15.5px; margin-bottom: 18px; max-width: 60ch; }

/* app cta on card page */
.app-cta { text-align: center; background: linear-gradient(160deg, rgba(253,185,8,0.08), var(--surface)); border: 1px solid var(--border-strong); border-radius: 22px; padding: clamp(28px, 4vw, 44px); margin-bottom: 24px; }
.app-cta p { font-size: 18px; margin-bottom: 22px; }
.app-cta .badge-link { justify-content: center; }

/* more-from-set related cards */
.related { margin-bottom: 24px; }
.related h2 { font-size: 22px; margin-bottom: 16px; }
.related-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.related-grid a { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; transition: border-color .18s ease, transform .18s ease; }
.related-grid a:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.related-grid .r-name { font-weight: 600; font-size: 15px; }
.related-grid .r-id { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-tertiary); }
.related-grid .r-price { font-family: var(--font-num); color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* ===================================================================
   BROWSE HUB + lists
   =================================================================== */
.browse-hub, .set-index, .all-page, .search-page { max-width: var(--maxw); margin-inline: auto; padding: 36px var(--gutter) 0; }
.browse-hub h1, .set-index h1, .all-page h1 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 12px; }
.browse-hub .lede, .set-index .lede, .all-page .lede { color: var(--text-secondary); font-size: 18px; max-width: 60ch; margin-bottom: 36px; }
.browse-hub h2 { font-size: 22px; margin: 40px 0 18px; }

.set-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.set-list li { margin: 0; }
.set-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; transition: border-color .18s ease, transform .18s ease; }
.set-list a:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.set-list .set-code { font-family: var(--font-mono); font-size: 14px; color: var(--text); }
.set-list .count { font-family: var(--font-num); font-size: 13px; color: var(--text-tertiary); }

.pager { display: flex; flex-wrap: wrap; gap: 8px; }
.pager a { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; color: var(--text-secondary); font-size: 14px; transition: border-color .18s ease, color .18s ease; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }

.card-list { list-style: none; margin: 0 0 36px; padding: 0; display: grid; gap: 8px; }
.card-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; transition: border-color .18s ease; }
.card-list li:hover { border-color: var(--border-strong); }
.card-list li > a { display: flex; align-items: baseline; gap: 12px; flex: 1; min-width: 0; }
.card-list .card-name { font-weight: 600; }
.card-list .card-name:hover { color: var(--accent); }
.card-list .card-id { font-family: var(--font-mono); font-size: 13px; color: var(--text-tertiary); }
.card-list .card-prices { display: flex; gap: 16px; flex: 0 0 auto; font-family: var(--font-num); font-size: 14px; }
.card-list .card-prices .sold { color: var(--text); }
.card-list .card-prices .ask  { color: var(--text-secondary); }
.card-list .card-prices .lbl { color: var(--text-tertiary); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 4px; }
/* Honest empty state in a compact row ("no comp" / "no listing") instead of a bare em dash. */
.card-list .card-prices .none { color: var(--text-tertiary); font-style: italic; }

/* ===================================================================
   LEGAL / prose pages
   =================================================================== */
.legal { max-width: var(--maxw-prose); margin-inline: auto; padding: 48px var(--gutter) 0; }
.legal h1 { font-size: clamp(30px, 4.4vw, 44px); margin-bottom: 10px; }
.legal h2 { font-size: 22px; margin: 36px 0 12px; }
.legal h3 { font-size: 17px; margin: 24px 0 8px; }
.legal p, .legal li { color: var(--text-secondary); font-size: 16.5px; }
.legal p + p { margin-top: 14px; }
.legal ul { margin: 12px 0; padding-left: 22px; display: grid; gap: 10px; }
.legal a { color: var(--accent); }
.legal a:hover { text-decoration: underline; text-underline-offset: 3px; }
.legal .muted { font-size: 14px; }

/* ===================================================================
   404 / not found (SITE-404-1)
   =================================================================== */
/* Prose measure, same as .legal, with hero-scale vertical air so the page reads as a
   deliberate destination rather than a broken one. Buttons + eyebrow + browse-all are
   the SHARED components (.cta, .eyebrow, .hero-cta, .browse-all) — nothing bespoke. */
.notfound { max-width: var(--maxw-prose); margin-inline: auto; padding: clamp(56px, 9vw, 104px) var(--gutter) clamp(24px, 4vw, 48px); }
.notfound h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 14px; }
.notfound .lede { color: var(--text-secondary); font-size: clamp(17px, 2vw, 19px); max-width: 46ch; margin-bottom: 30px; }

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 480px; margin-inline: auto; }
  .hero .lede { max-width: 46ch; }
  .wedge-grid { grid-template-columns: 1fr; }
  .price-pair { grid-template-columns: 1fr 1fr; }
  .price-block.sold { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  /* Five date labels do not fit under a ~330px plot: the 2nd and 4th go, leaving first/mid/last
     at 0/50/100%. They are hidden rather than shortened because the remaining three still have
     to line up with gridlines the SVG drew, and their explicit grid columns keep them there. */
  .chart-grid.n5 span:nth-child(2),
  .chart-grid.n5 span:nth-child(4) { display: none; }
  /* `.chart-panel` is in this list because the gutter's `ch` resolves against IT (see the rule
     above): leaving it at 12.5px here would reserve a 12.5px `ch` for an 11.5px label. */
  .chart-y, .chart-grid, .chart-panel { font-size: 11.5px; }
  body { font-size: 16px; }
  .site-nav .nav-secondary { display: none; }
  .steps { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .card-list li { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===================================================================
   Motion preferences
   =================================================================== */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .cta:hover, .badge-link:hover, .feature-grid li:hover, .set-list a:hover, .related-grid a:hover { transform: none; }
}
