/* Broken Stocks — main stylesheet
 * Tokens mirror DESIGN.md 1:1. If you change a value here, also change DESIGN.md
 * (or vice-versa). The single source of truth is DESIGN.md.
 */

:root {
  /* surface */
  --ink:        #0E1116;
  --ink-deep:   #070A0E;
  --ink-card:   #161B22;
  --hairline:   #262C36;

  /* text */
  --bone:       #E6E2D6;
  --bone-soft:  #C3BFB1;
  --bone-muted: #8E8B81;

  /* accent */
  --gold:       #C7A352;
  --gold-dim:   #8E7638;

  /* tier */
  --red:           #C9342C;
  --red-bg:        rgba(201,52,44,0.10);
  --red-border:    rgba(201,52,44,0.35);
  --amber:         #D08E2A;
  --amber-bg:      rgba(208,142,42,0.10);
  --amber-border:  rgba(208,142,42,0.35);
  --watch:         #7E8A9A;
  --watch-bg:      rgba(126,138,154,0.10);
  --watch-border:  rgba(126,138,154,0.35);
  --recovering:    #5FA773;
  --recovering-bg: rgba(95,167,115,0.10);
  --recovering-border: rgba(95,167,115,0.35);

  /* type */
  --font-display: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* motion */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --d-fast: 180ms;
  --d-base: 320ms;

  /* shape */
  --r-xs: 2px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
}

/* ──────────────────────────── Reset ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.6;
  font-feature-settings: 'kern' 1, 'liga' 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--d-fast) var(--ease-out-quart),
              color var(--d-fast) var(--ease-out-quart);
}
a:hover { border-bottom-color: var(--gold); }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }

/* ──────────────────────────── Type ──────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--bone);
}
h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.625rem; line-height: 1.25; }
h3 { font-size: 1.125rem; line-height: 1.35; font-family: var(--font-body); letter-spacing: 0; }

.display-1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.5rem, 5.5vw, 4.5rem); line-height: 1.04; letter-spacing: -0.025em; }
.display-2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; }
.lead { font-size: 1.0625rem; line-height: 1.6; color: var(--bone-soft); max-width: 36em; }
.caption { font-size: 0.8125rem; line-height: 1.5; color: var(--bone-muted); letter-spacing: 0.005em; }
.italic-emphasis {
  font-style: italic;
  color: var(--bone);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* Eyebrow */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.eyebrow.no-rule::before { display: none; }
.eyebrow.muted { color: var(--bone-muted); }
.eyebrow.muted::before { background: linear-gradient(90deg, var(--bone-muted), transparent); }

/* Section divider — short gold rule */
.gold-rule {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--gold);
  border: 0;
  margin: 16px 0 0;
}

/* ──────────────────────────── Layout ──────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 400px) {
  .container { padding: 0 16px; }
}
@media (min-width: 768px) {
  .container { padding: 0 48px; }
}
@media (min-width: 1024px) {
  .container { padding: 0 80px; }
}
.section { padding: 56px 0; }
@media (min-width: 768px) { .section { padding: 96px 0; } }
.section-alt { background: var(--ink-card); }
.section-deep { background: var(--ink-deep); }

/* ──────────────────────────── Header ──────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--hairline);
  background: var(--ink);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}
.site-header .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  color: var(--bone);
  border: 0;
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}
@media (max-width: 640px) {
  .brand { font-size: 1.0625rem; gap: 0.2rem; }
}
.brand:hover { border: 0; }
.brand .word-1 { position: relative; }
.brand .word-1::after {
  /* The structural-break hairline under the "k" — last 18% of the word */
  content: "";
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 18%;
  height: 2px;
  background: var(--red);
}
.site-nav {
  display: flex;
  gap: 14px;
  align-items: center;
}
@media (min-width: 640px) {
  .site-nav { gap: 28px; }
}
.site-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--bone-soft);
}
.site-nav a:hover { color: var(--bone); border-bottom-color: var(--gold); }
.site-nav a.active { color: var(--bone); border-bottom-color: var(--gold); }

/* ──────────────────────────── Footer ──────────────────────────── */
.site-footer {
  border-top: 1px solid var(--hairline);
  background: var(--ink-deep);
  padding: 48px 0;
  margin-top: 96px;
}
.site-footer .disclosure {
  max-width: 64ch;
  color: var(--bone-muted);
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.65;
}
.site-footer .disclosure a {
  font-style: normal;
  color: var(--bone-soft);
  border-bottom-color: var(--hairline);
}
.site-footer .disclosure a:hover { border-bottom-color: var(--gold); color: var(--bone); }
.site-footer .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer .meta .copyright { color: var(--bone-muted); font-size: 0.8125rem; }
.site-footer .meta nav { display: flex; gap: 20px; }
.site-footer .meta nav a { font-size: 0.8125rem; color: var(--bone-muted); }
.site-footer .meta nav a:hover { color: var(--bone); }

/* ──────────────────────────── Logos ──────────────────────────── */
/* Logos are sourced from logo.dev (see scripts/refetch_logos.py). Many come
   back transparent; some carry the brand's official background (MCD red,
   CCU white, etc). We render them as-is — no blend-mode tricks — because the
   FMP black-surround problem that the blend-mode workaround targeted is gone
   once every PNG has been re-fetched. Fallback initials span keeps its own
   opaque chip background. */
.bs-logo {
  flex-shrink: 0;
  object-fit: contain;
  border-radius: var(--r-xs);
}
img.bs-logo { background: transparent; }
/* CSS Grid items have `min-width: auto` by default, which can collapse an
   img track below its CSS `width` when neighbour content is wider — bug
   surfaced 2026-05-14 on /ticker/<sym> related tiles where CWH/WING/FLUT
   logos rendered as 4×38px slivers instead of 38×38. Hard-pin the box. */
.bs-logo.size-72 { min-width: 72px; }
.bs-logo.size-32 { min-width: 32px; }
.bs-logo.size-20 { min-width: 20px; }
.bs-logo.size-18 { min-width: 18px; }
.bs-logo.size-72 { width: 72px; height: 72px; padding: 8px; border-radius: var(--r-md); }
.bs-logo.size-32 { width: 32px; height: 32px; padding: 3px; }
.bs-logo.size-20 { width: 20px; height: 20px; padding: 0; }
.bs-logo.size-18 { width: 18px; height: 18px; padding: 1px; }

/* Initials fallback — bone-on-ink so it reads as restrained, not as a missing image */
.bs-logo.fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-deep);
  border: 1px solid var(--hairline);
  color: var(--bone);
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0;
}
/* Match the img variants' outer box (width + 2*padding, content-box) so
   rows render identically whether or not a PNG exists for the ticker.
   .size-20 has its img padding zeroed out so its fallback is also a flat 20×20. */
.bs-logo.fallback.size-72 { width: 88px; height: 88px; font-size: 1rem; letter-spacing: -0.02em; }
.bs-logo.fallback.size-32 { width: 38px; height: 38px; font-size: 0.625rem; letter-spacing: 0; }
.bs-logo.fallback.size-20 { width: 20px; height: 20px; font-size: 0.55rem; letter-spacing: 0; }
.bs-logo.fallback.size-18 { width: 20px; height: 20px; font-size: 0.5rem; letter-spacing: 0; }

/* ──────────────────────────── Tier badges ──────────────────────────── */
.tier-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--r-xs);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}
.tier-badge.red       { color: var(--red);        background: var(--red-bg);        border-color: var(--red-border); }
.tier-badge.amber     { color: var(--amber);      background: var(--amber-bg);      border-color: var(--amber-border); }
.tier-badge.watch     { color: var(--watch);      background: var(--watch-bg);      border-color: var(--watch-border); }
.tier-badge.recovering{ color: var(--recovering); background: var(--recovering-bg); border-color: var(--recovering-border); }

.tier-badge.lg {
  padding: 6px 12px;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  border-radius: var(--r-sm);
}

/* ──────────────────────────── Buttons ──────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--d-fast) var(--ease-out-quart),
              border-color var(--d-fast) var(--ease-out-quart),
              color var(--d-fast) var(--ease-out-quart),
              transform var(--d-fast) var(--ease-out-quart);
}
.btn:hover { border-bottom: 1px solid transparent; }
.btn.primary { background: var(--bone); color: var(--ink); }
.btn.primary:hover { background: #FFFFFF; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--bone); border-color: var(--hairline); }
.btn.ghost:hover { border-color: var(--gold); color: var(--bone); }
.btn.block { width: 100%; padding: 16px 20px; font-size: 1rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ──────────────────────────── Cards ──────────────────────────── */
.card {
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.3);
}
.card.lg { padding: 32px; }
.card.hero { padding: 40px; box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.05) inset; }

/* ──────────────────────────── Ticker tape ──────────────────────────── */
/* Slow horizontal marquee just under the sticky header. Track is rendered
 * twice in the template so translateX(-50%) gives a seamless loop. Pauses
 * on hover; reduced-motion stops it entirely (see prefers-reduced-motion
 * block below). */
.ticker-tape {
  position: relative;
  overflow: hidden;
  background: var(--ink-deep);
  border-bottom: 1px solid var(--hairline);
  height: 32px;
  display: flex;
  align-items: center;
}
.ticker-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: 24px;
  animation: tt-scroll 45s linear infinite;
  will-change: transform;
}
/* Only pause on real pointing devices. On touch, iOS Safari's sticky :hover
 * after a tap would freeze the marquee permanently until the user taps off. */
@media (hover: hover) {
  .ticker-tape:hover .ticker-track { animation-play-state: paused; }
}
@keyframes tt-scroll {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}
.tt-label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 0 8px;
}
.tt-item {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: var(--bone);
  text-decoration: none;
  border-bottom: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.tt-item:hover { color: #fff; border-bottom: 0; }
.tt-item .tt-pct { color: var(--red); }
.tt-item.tier-amber .tt-pct { color: var(--amber); }
.tt-item.tier-watch .tt-pct { color: var(--watch); }
.tt-sep { color: var(--bone-muted); font-size: 0.8125rem; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; transform: translate3d(0, 0, 0); }
}

/* ──────────────────────────── Hero ──────────────────────────── */
.hero {
  /* Tight top — header already gives breathing room. Push content up so the
     scan input lands above the fold. */
  padding: 32px 0 64px;
}
@media (min-width: 768px) {
  .hero { padding: 48px 0 80px; }
}
.hero .eyebrow { margin-bottom: 20px; }
.hero h1 { margin-bottom: 20px; max-width: 16ch; }
.hero .lead { margin-bottom: 32px; }

/* ──────────────────────────── Hero grid ──────────────────────────── */
/* Single column under 1024px (mobile + tablet — the headline already fills
 * its 16ch max-width comfortably). Above 1024px the right column shows
 * a "Just Cracked" live feed so the previously-empty right half earns
 * its space. The stat-row sits outside this grid, full-width below. */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
}
@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 80px;
  }
}

/* "Just Cracked" recent-break feed — hidden under 1024px to preserve the
 * tight mobile flow (mobile already lands the scan input above the fold). */
.recent-feed { display: none; }
@media (min-width: 1024px) {
  .recent-feed { display: block; max-width: 360px; }
}
.recent-feed .eyebrow { margin-bottom: 12px; }
.recent-feed .recent-sub {
  margin: 0 0 24px;
  color: var(--bone-muted);
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.55;
  max-width: 32ch;
}
.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--hairline);
}
.recent-list li { margin: 0; padding: 0; }
.recent-item {
  display: grid;
  /* logo · sym · range-bar(fills) · pct · dsh */
  grid-template-columns: auto auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 12px 12px 14px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid var(--hairline);
  color: var(--bone);
  text-decoration: none;
  transition: background var(--d-fast) var(--ease-out-quart);
}
/* 52-week range bar — marker shows where today's price sits between low/high.
 * Tier color is inherited via currentColor on the marker. */
.range-mini {
  width: 100%;
  height: 14px;
  color: var(--red);
  opacity: 0.7;
  transition: opacity var(--d-fast) var(--ease-out-quart);
}
.recent-item.tier-amber .range-mini { color: var(--amber); }
.recent-item.tier-watch .range-mini { color: var(--watch); }
.recent-item:hover .range-mini { opacity: 1; }
.range-mini-empty { display: block; width: 100%; }
.recent-item:hover { border-bottom-color: var(--hairline); background: rgba(255,255,255,0.025); }
[data-theme="light"] .recent-item:hover { background: rgba(14,17,22,0.03); }
.recent-item.tier-red   { border-left-color: var(--red); }
.recent-item.tier-amber { border-left-color: var(--amber); }
.recent-item.tier-watch { border-left-color: var(--watch); }
.recent-item .sym {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.9375rem;
}
.recent-item .pct {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
}
.recent-item.tier-red   .pct { color: var(--red); }
.recent-item.tier-amber .pct { color: var(--amber); }
.recent-item.tier-watch .pct { color: var(--watch); }
.recent-item .dsh {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.8125rem;
  color: var(--bone-muted);
  white-space: nowrap;
}
.recent-more {
  display: inline-block;
  margin-top: 20px;
  font-size: 0.8125rem;
  color: var(--bone-soft);
  border-bottom: 1px solid transparent;
}
.recent-more:hover { color: var(--bone); border-bottom-color: var(--gold); }

/* ──────────────────────────── Scan input ──────────────────────────── */
.scan-form {
  max-width: 720px;
  margin: 0 auto;
}
.scan-form.left { margin: 0; }
.scan-input {
  width: 100%;
  background: var(--ink-card);
  color: var(--bone);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  letter-spacing: 0;
  resize: vertical;
  min-height: 96px;
  transition: border-color var(--d-fast) var(--ease-out-quart),
              background var(--d-fast) var(--ease-out-quart);
}
.scan-input::placeholder { color: var(--bone-muted); font-style: italic; }
.scan-input:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--ink);
}
.scan-form .hint {
  display: block;
  margin-top: 8px;
  margin-bottom: 16px;
  color: var(--bone-muted);
  font-size: 0.8125rem;
  font-style: italic;
}
.scan-form .submit-row { margin-top: 12px; }

/* ──────────────────────────── Stat row ──────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-top: 32px;
  margin-top: 56px;
  border-top: 1px solid rgba(199,163,82,0.18);
}
@media (min-width: 640px) {
  .stat-row { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat .number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.875rem, 3.5vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stat .number.red       { color: var(--red); }
.stat .number.amber     { color: var(--amber); }
.stat .number.watch     { color: var(--watch); }
.stat .number.bone      { color: var(--bone); }
.stat .label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-muted);
}

/* ──────────────────────────── Tier cards (landing) ──────────────────────────── */
.tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) {
  .tier-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
.tier-card { border-top: 2px solid transparent; }
.tier-card.red   { border-top-color: var(--red); }
.tier-card.amber { border-top-color: var(--amber); }
.tier-card.watch { border-top-color: var(--watch); }
.tier-card h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 16px 0 12px;
}
.tier-card p { color: var(--bone-soft); margin: 0 0 16px; }
.tier-card .examples {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.ticker-chip {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--bone);
  background: transparent;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  padding: 4px 8px;
}
.ticker-chip:hover { border-color: var(--gold); color: var(--bone); }

/* ──────────────────────────── How it works (steps) ──────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  counter-reset: step;
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 48px; }
}
.step { counter-increment: step; position: relative; padding-top: 24px; border-top: 1px solid var(--hairline); }
.step::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 12px;
}
.step h3 { font-family: var(--font-display); font-size: 1.375rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 12px; }
.step p { color: var(--bone-soft); margin: 0; }

/* ──────────────────────────── List table ──────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--bone-soft);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all var(--d-fast) var(--ease-out-quart);
}
.filter-chip:hover { color: var(--bone); border-color: var(--bone-muted); border-bottom-color: var(--bone-muted); }
.filter-chip.active { color: var(--bone); border-color: var(--gold); background: rgba(199,163,82,0.08); }
.filter-chip.tier-red.active   { color: var(--red);   border-color: var(--red-border);   background: var(--red-bg); }
.filter-chip.tier-amber.active { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.filter-chip.tier-watch.active { color: var(--watch); border-color: var(--watch-border); background: var(--watch-bg); }
.filter-chip.tier-recovering.active { color: var(--recovering); border-color: var(--recovering-border); background: var(--recovering-bg); }

.filter-bar .grow { flex: 1; min-width: 200px; }
.filter-bar select,
.filter-bar input[type=search] {
  background: var(--ink);
  color: var(--bone);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 0.875rem;
}
.filter-bar input[type=search] { width: 100%; font-family: var(--font-mono); }
.filter-bar input[type=search]::placeholder { color: var(--bone-muted); }
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--gold); }

.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink); }
table.list {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 0.875rem;
  min-width: 800px;
}
table.list thead th {
  background: var(--ink-deep);
  text-align: left;
  padding: 12px 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-muted);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
table.list thead th.num { text-align: right; }
table.list tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: middle;
}
table.list tbody td.num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.list tbody td.ticker-cell { white-space: nowrap; }
table.list tbody td.ticker-cell .ticker-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}
/* Under 640px the table scrolls horizontally inside .table-wrap and the
   ticker column eats too much thumb-drag width. Stack the logo above the
   ticker so the column collapses to max(20px, ticker-text-width). */
@media (max-width: 640px) {
  table.list tbody td.ticker-cell { white-space: normal; }
  table.list tbody td.ticker-cell .ticker-cell-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  table.list tbody td.ticker-cell { padding-top: 10px; padding-bottom: 10px; }
}
table.list tbody tr:hover { background: rgba(255,255,255,0.02); }
table.list tbody tr:last-child td { border-bottom: 0; }
table.list .ticker {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--bone);
}
table.list .ticker:hover { border-bottom-color: var(--gold); }
table.list .company { color: var(--bone-soft); }
table.list .sector { color: var(--bone-muted); font-size: 0.8125rem; }
table.list .decline { color: var(--red); font-weight: 500; }
table.list .meta-row { color: var(--bone-soft); }

.empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--bone-muted);
  font-style: italic;
}

.list-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.list-footer .caption { margin: 0; }
.paginator {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.paginator .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 6px 10px;
  font-size: 0.8125rem;
  color: var(--bone-soft);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
  background: transparent;
  transition: border-color var(--d-fast) var(--ease-out-quart), color var(--d-fast) var(--ease-out-quart);
}
.paginator .page-link:hover { color: var(--bone); border-color: var(--gold); }
.paginator .page-link.current { color: var(--bone); border-color: var(--gold); background: rgba(199,163,82,0.08); cursor: default; }
.paginator .page-link.disabled { color: var(--bone-muted); border-color: transparent; cursor: default; }
.paginator .page-link.disabled:hover { color: var(--bone-muted); border-color: transparent; }
.paginator .page-gap { color: var(--bone-muted); padding: 0 4px; font-size: 0.8125rem; }
[data-theme="light"] .paginator .page-link.current { background: rgba(142,118,56,0.10); }

/* ──────────────────────────── Scan results ──────────────────────────── */
.result-hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 48px;
}
.result-hero h1 { margin-bottom: 16px; }
.result-summary {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  color: var(--bone-soft);
  letter-spacing: -0.01em;
}
.result-summary .count { color: var(--bone); font-weight: 600; }
.result-summary .count.hit { color: var(--red); }
.result-summary .count.clean { color: var(--recovering); }

.ticker-tile-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.ticker-tile {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  transition: border-color var(--d-fast) var(--ease-out-quart);
}
.ticker-tile:hover { border-color: var(--bone-muted); }
.ticker-tile .bs-logo { margin: 0; }
.ticker-tile .symbol {
  font-family: var(--font-mono);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--bone);
}
.ticker-tile .company { color: var(--bone-soft); font-size: 0.875rem; }
.ticker-tile .decline { font-family: var(--font-mono); color: var(--red); font-size: 1rem; font-variant-numeric: tabular-nums; }
.ticker-tile .since { color: var(--bone-muted); font-size: 0.8125rem; font-family: var(--font-mono); white-space: nowrap; }
@media (max-width: 640px) {
  .ticker-tile { grid-template-columns: auto auto 1fr; row-gap: 8px; }
  .ticker-tile .decline, .ticker-tile .since { grid-column: 1 / -1; text-align: left; }
}

.clean-list {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
}
.clean-list .label {
  color: var(--bone-muted);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}
.clean-list .symbols {
  font-family: var(--font-mono);
  color: var(--bone-soft);
  letter-spacing: 0.04em;
}

/* ──────────────────────────── Ticker detail ──────────────────────────── */
/* Hero: identity left, decline number anchor right. Always shows decline % when
   ≥20% (Watch tier floor); falls back to sigma when shallow. Pattern locked in
   session 4 (2026-05-13) to stop the cross-ticker headline inconsistency where
   LULU showed -64% and MCD showed 5/5 in the same visual slot. */
.ticker-hero {
  padding: 40px 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
}
.ticker-hero .hero-info { min-width: 0; }
.ticker-hero .top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.ticker-hero .symbol {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--bone);
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin-bottom: 6px;
}
.ticker-hero .company { color: var(--bone-soft); font-size: 1.125rem; }
.ticker-hero .sector { color: var(--bone-muted); font-size: 0.875rem; margin-top: 6px; }
.ticker-hero .sector a { color: var(--bone-soft); border-bottom: 1px solid transparent; }
.ticker-hero .sector a:hover { color: var(--bone); border-bottom-color: var(--gold); }

.ticker-hero .decline-anchor { text-align: right; min-width: 0; }
.ticker-hero .decline-anchor .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 500;
  color: var(--red);
  line-height: 1.0;
  letter-spacing: -0.025em;
}
.ticker-hero .decline-anchor .sub {
  color: var(--bone-muted);
  font-size: 0.8125rem;
  margin-top: 10px;
  font-family: var(--font-mono);
  max-width: 32ch;
  margin-left: auto;
  line-height: 1.5;
}
@media (max-width: 768px) {
  .ticker-hero { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
  .ticker-hero .decline-anchor { text-align: left; }
  .ticker-hero .decline-anchor .sub { margin-left: 0; max-width: none; }
  .ticker-hero .bs-logo.size-72 { width: 56px; height: 56px; padding: 6px; }
}

/* 4-item strip below hero. All three structural axes + current price, always
   shown so the trigger axis is visible even when it's not the headline. */
.hero-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding: 20px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 32px;
}
.hero-stat-strip .item .label {
  color: var(--bone-muted);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.hero-stat-strip .item .value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.0625rem;
  color: var(--bone);
  font-weight: 500;
}
.hero-stat-strip .item .value.text-red { color: var(--red); }
@media (max-width: 768px) {
  .hero-stat-strip { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* Candlestick chart row. Bars come from Alpaca via bars.py + SQLite TTL cache;
   when creds are missing (cold Railway env, dev without keys) the chart slot
   is omitted and the page renders without it. */
.hero-chart { margin-bottom: 48px; }
.hero-chart .chart-frame {
  background: var(--ink);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 16px;
  height: 320px;
}
.hero-chart .bs-candle-chart { display: block; width: 100%; height: 100%; }
.hero-chart .chart-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--bone-muted);
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-chart .chart-caption .dot { display: inline-block; vertical-align: middle; margin-right: 6px; }
.hero-chart .chart-caption .dot-line { width: 14px; height: 2px; background: var(--gold); }
.hero-chart .chart-caption .dot-up { width: 8px; height: 8px; background: #5A8F6A; border-radius: 50%; }
.hero-chart .chart-caption .dot-down { width: 8px; height: 8px; background: var(--red); border-radius: 50%; }
@media (max-width: 640px) {
  .hero-chart .chart-frame { height: 220px; padding: 8px; }
}

.reasoning {
  max-width: 64ch;
  margin: 48px 0;
}
.reasoning h2 { margin-bottom: 16px; font-size: 1.5rem; }
.reasoning p { color: var(--bone-soft); font-size: 1rem; line-height: 1.7; }
.reasoning .mono-inline { color: var(--bone); }

.related {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--hairline);
}
.related h2 { margin-bottom: 24px; font-size: 1.375rem; }
.related .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 640px) { .related .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related .grid { grid-template-columns: repeat(3, 1fr); } }

/* ──────────────────────────── Ticker page — extended components ──────────────────────────── */
.breadcrumb {
  display: block;
  padding: 24px 0 16px;
  color: var(--bone-muted);
  font-family: var(--font-body);
  font-size: 0.8125rem;
}
.breadcrumb a {
  color: var(--bone-soft);
  border-bottom: 1px solid transparent;
}
.breadcrumb a:hover { color: var(--bone); border-bottom-color: var(--gold); }
.breadcrumb .mono { color: var(--bone); }

.structural-read {
  max-width: 64ch;
  margin: 64px 0 48px;
}
.structural-read .eyebrow { margin-bottom: 16px; }
.structural-read h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 20px;
  color: var(--bone);
}
.structural-read p {
  color: var(--bone-soft);
  font-size: 1.0625rem;
  line-height: 1.7;
  margin: 0 0 16px;
}
.structural-read p:last-child { margin-bottom: 0; }
.structural-read .mono-inline {
  color: var(--bone);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.structural-signals {
  margin: 64px 0 48px;
}
.structural-signals .eyebrow { margin-bottom: 16px; }
.structural-signals h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
  max-width: 56ch;
}
.structural-signals h2 strong { color: var(--gold); font-weight: 600; }
.axis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) { .axis-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.axis {
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  padding: 24px;
  position: relative;
  transition: border-color var(--d-fast) var(--ease-out-quart);
}
.axis-hit { border-color: var(--red-border); }
.axis-hit::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 2px;
  background: var(--red);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.axis .axis-label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-muted);
  margin-bottom: 12px;
}
.axis-hit .axis-label { color: var(--red); }
.axis .axis-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.75rem;
  font-weight: 500;
  color: var(--bone);
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.axis-hit .axis-value { color: var(--red); }
.axis .axis-note {
  color: var(--bone-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}
.axis .axis-note strong { color: var(--bone); font-weight: 600; }
.axis .axis-note .mono { color: var(--bone); font-family: var(--font-mono); }

/* Methodology threshold table */
.threshold-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-family: var(--font-body);
}
.threshold-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bone-muted);
  border-bottom: 1px solid var(--hairline);
  background: var(--ink-card);
}
.threshold-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9375rem;
  color: var(--bone-soft);
}
.threshold-table tbody td:first-child {
  font-weight: 600;
  color: var(--bone);
  width: 30%;
}

.range-block {
  margin: 64px 0 48px;
  padding: 32px;
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
.range-block .eyebrow { margin-bottom: 20px; }
.range-bar {
  position: relative;
  height: 8px;
  background: var(--ink-deep);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  overflow: visible;
  margin: 0 0 16px;
}
.range-bar .range-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--red) 0%, var(--amber) 50%, var(--recovering) 100%);
  opacity: 0.35;
  border-radius: 999px;
}
.range-bar .range-marker {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 28px;
  background: var(--bone);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(14,17,22,0.9), 0 0 12px rgba(199,163,82,0.4);
}
.range-bar .range-marker::after {
  content: attr(data-label);
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--bone);
  white-space: nowrap;
  padding: 2px 6px;
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xs);
}
.range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--bone-muted);
  margin-top: 24px;
}
.range-labels .mono { color: var(--bone); }

.sector-context {
  margin: 64px 0 48px;
}
.sector-context .eyebrow { margin-bottom: 16px; }
.sector-context h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.sector-context h2 .mono { color: var(--bone); font-family: var(--font-mono); font-size: 1.5rem; }
.sector-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 24px;
  background: var(--ink-card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
}
@media (max-width: 640px) {
  .sector-stats { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
}
.sector-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sector-stat .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--bone);
}
.sector-stat .label {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bone-muted);
}
.sector-context p.text-soft a {
  color: var(--bone);
  border-bottom: 1px solid var(--hairline);
}
.sector-context p.text-soft a:hover { border-bottom-color: var(--gold); }

.faq {
  margin: 64px 0 48px;
  max-width: 64ch;
}
.faq .eyebrow { margin-bottom: 16px; }
.faq h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.faq-item {
  border-top: 1px solid var(--hairline);
  padding: 20px 0;
}
.faq-item:last-child { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--bone);
  cursor: pointer;
  list-style: none;
  padding-right: 32px;
  position: relative;
  transition: color var(--d-fast) var(--ease-out-quart);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--gold);
  transition: transform var(--d-fast) var(--ease-out-quart);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--bone); }
.faq-item summary:hover::after { transform: translateY(-50%) scale(1.2); }
.faq-item p {
  color: var(--bone-soft);
  font-size: 1rem;
  line-height: 1.7;
  margin: 16px 0 0;
}
.faq-item p strong { color: var(--bone); font-weight: 600; }
.faq-item p .mono-inline {
  color: var(--bone);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ──────────────────────────── Methodology ──────────────────────────── */
.editorial { max-width: 64ch; margin: 0 auto; }
.editorial h1 { margin: 0 0 24px; font-size: clamp(2rem, 4vw, 2.5rem); }
.editorial h2 { margin: 48px 0 16px; font-size: 1.5rem; }
.editorial h3 { margin: 32px 0 12px; font-size: 1.125rem; color: var(--bone); }
.editorial p { color: var(--bone-soft); font-size: 1.0625rem; line-height: 1.7; margin: 0 0 16px; }
.editorial p strong { color: var(--bone); font-weight: 600; }
.editorial ul { color: var(--bone-soft); padding-left: 1.2em; line-height: 1.7; margin: 0 0 16px; }
.editorial code { font-family: var(--font-mono); font-size: 0.9em; color: var(--bone); background: var(--ink-card); padding: 2px 6px; border-radius: var(--r-xs); border: 1px solid var(--hairline); }
.editorial .lede { font-size: 1.1875rem; color: var(--bone); font-style: italic; }

/* ──────────────────────────── 404 ──────────────────────────── */
.notfound {
  padding: 160px 0;
  text-align: center;
}
.notfound h1 { font-size: 4rem; color: var(--bone-muted); margin-bottom: 16px; }
.notfound p { color: var(--bone-soft); margin-bottom: 32px; }

/* ──────────────────────────── Utility ──────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.text-muted { color: var(--bone-muted); }
.text-soft  { color: var(--bone-soft); }
.text-red   { color: var(--red); }
.text-amber { color: var(--amber); }
.text-watch { color: var(--watch); }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ──────────────────────────── Light mode ──────────────────────────── */
/* Token overrides only — components read through these variables, so
 * structure, spacing, and tier hues stay identical. The accent shifts
 * gold → gold-dim because warm gold loses contrast on a cream surface.
 * If you add a literal color elsewhere in the file (rgba(255,...) inset
 * highlights, #FFF hover fills, ink-color halos), add a matching
 * [data-theme="light"] override below. */
[data-theme="light"] {
  --ink:        #F4F1E8;
  --ink-deep:   #EAE6D6;
  --ink-card:   #FBF8ED;
  --hairline:   #D6D0BD;

  --bone:       #0E1116;
  --bone-soft:  #3A3F47;
  --bone-muted: #6B6F77;

  --gold:       #8E7638;
  --gold-dim:   #C7A352;
}
[data-theme="light"] .card {
  box-shadow: 0 1px 0 rgba(0,0,0,0.03) inset, 0 1px 2px rgba(14,17,22,0.06);
}
[data-theme="light"] .card.hero {
  box-shadow: 0 8px 24px rgba(14,17,22,0.08), 0 1px 0 rgba(0,0,0,0.04) inset;
}
[data-theme="light"] .btn.primary:hover { background: #000000; }
[data-theme="light"] table.list tbody tr:hover { background: rgba(14,17,22,0.025); }
[data-theme="light"] .range-bar .range-marker {
  box-shadow: 0 0 0 4px rgba(244,241,232,0.9), 0 0 12px rgba(142,118,56,0.4);
}

/* ──────────────────────────── Theme toggle ──────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--bone-muted);
  transition: border-color var(--d-fast) var(--ease-out-quart),
              color var(--d-fast) var(--ease-out-quart);
}
@media (min-width: 640px) {
  .theme-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--hairline);
    color: var(--bone-soft);
  }
}
.theme-toggle:hover { border-color: var(--gold); color: var(--bone); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
