/* PolyForecast — base stylesheet (mobile-first) */

:root {
  --paper: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #F0F1F7;
  --ink: #14162B;
  --ink-2: #33374F;
  --muted: #5E6480;
  --line: #E2E5EF;
  --line-strong: #CDD2E1;

  --brand: #4B3AE0;
  --brand-ink: #3A2BC2;
  --brand-soft: #EEEBFF;
  --blue: #2563EB;

  --yes: #0A7F55;
  --yes-bar: #16A574;
  --yes-soft: #E3F5EC;
  --no: #C22E3A;
  --no-bar: #E0525D;
  --no-soft: #FCE9EB;

  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 43, .05), 0 4px 16px rgba(20, 22, 43, .04);

  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Figtree', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --header-h: 64px;
  --tabbar-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; }
a { color: var(--brand-ink); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.35rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding-inline: 16px; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); }
.btn-outline { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink-2); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--surface-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 246, 250, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--brand); stroke: none; }
.brand-mark path { stroke: #fff; stroke-width: 3; }
.brand-name { font-family: var(--font-display); font-weight: 750; font-size: 1.2rem; letter-spacing: -0.02em; }

.search { position: relative; flex: 1; min-width: 0; display: none; }
.search input {
  width: 100%; height: 42px; padding: 0 12px 0 38px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.search input::placeholder { color: var(--muted); }
.search-icon { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  list-style: none; margin: 0; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(20, 22, 43, .12);
  max-height: 60vh; overflow-y: auto;
}
.search-results li a, .search-results li.search-empty {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: var(--ink); text-decoration: none; font-size: .95rem;
}
.search-results li.search-empty { color: var(--muted); }
.search-results li[aria-selected="true"] a, .search-results li a:hover { background: var(--surface-2); }
.search-results .sr-q { flex: 1; min-width: 0; }
.search-results .sr-cat { display: block; color: var(--muted); font-size: .8rem; }
.search-results .sr-pct { font-weight: 700; color: var(--yes); }

.main-nav { display: none; }
.nav-toggle {
  margin-left: auto; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

body.nav-open .main-nav {
  display: flex; flex-direction: column; gap: 4px;
  position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
  background: var(--paper); padding: 16px; overflow-y: auto; z-index: 49;
}
body.nav-open .main-nav a:not(.btn) { padding: 14px 8px; font-size: 1.1rem; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
body.nav-open .nav-actions { display: flex; gap: 10px; margin-top: 16px; }
body.nav-open .nav-actions .btn { flex: 1; }
body.search-open .search { display: block; position: absolute; left: 16px; right: 16px; top: calc(var(--header-h) + 8px); }
body.search-open .search input { height: 48px; box-shadow: 0 8px 24px rgba(20, 22, 43, .14); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 360px at 85% -10%, rgba(75, 58, 224, .10), transparent 70%),
    radial-gradient(700px 300px at -10% 110%, rgba(37, 99, 235, .07), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding-top: 40px; padding-bottom: 32px; display: grid; gap: 32px; }
.hero-title {
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 750; letter-spacing: -0.035em; line-height: .98;
}
.hero-sub { margin-top: 16px; font-size: 1.1rem; color: var(--ink-2); max-width: 34ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.stat-strip {
  margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  overflow: hidden; align-self: end;
}
.stat { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat dt { font-size: .85rem; color: var(--muted); font-weight: 500; }
.stat dd { margin: 4px 0 0; font-family: var(--font-display); font-weight: 750; font-size: 1.9rem; letter-spacing: -0.02em; }
.stat-note { grid-column: 1 / -1; padding: 12px 20px; font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--yes-bar); box-shadow: 0 0 0 4px var(--yes-soft); flex-shrink: 0; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: pulse 2.4s ease-in-out infinite; }
  @keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(22, 165, 116, .08); } }
}

/* ---------- Sections ---------- */
.section { padding-top: 40px; padding-bottom: 8px; }
.section + .section { padding-top: 48px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.link-quiet { font-weight: 600; text-decoration: none; }
.link-quiet:hover { text-decoration: underline; }
.result-count { color: var(--muted); font-size: .9rem; }
.empty-inline { padding: 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); }

/* Biggest signals */
.signal-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.signal-list li + li { border-top: 1px solid var(--line); }
.signal-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 16px; color: var(--ink); text-decoration: none; align-items: center; }
.signal-row:hover { background: var(--surface-2); }
.signal-q { font-weight: 600; grid-column: 1 / -1; }
.signal-nums { display: flex; gap: 14px; font-size: .9rem; color: var(--muted); }
.signal-nums b { color: var(--ink); }
.signal-row .edge { justify-self: end; }
.signal-row .badge { justify-self: start; }

/* ---------- Feed controls ---------- */
.feed-controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cat-scroller {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 2px 16px; scroll-snap-type: x proximity;
}
.cat-scroller::-webkit-scrollbar { display: none; }
.cat-scroller button {
  flex-shrink: 0; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .92rem;
  cursor: pointer; scroll-snap-align: start;
}
.cat-scroller button[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.feed-tools { display: flex; gap: 8px; }
.select { position: relative; flex: 1; }
.select select, .filters select, .filters input {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface);
}
.filter-count { background: var(--brand); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 7px; }

.filters {
  display: grid; gap: 14px; padding: 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.filters[hidden] { display: none; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.field-pair { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.field-pair input { max-width: 90px; }
.filter-actions { display: flex; gap: 8px; justify-content: flex-end; align-self: end; }

/* ---------- Market cards ---------- */
.market-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card:hover { border-color: var(--line-strong); }
.card-top { display: flex; gap: 12px; align-items: flex-start; }
.card-img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.card-title { font-size: 1rem; font-weight: 650; line-height: 1.3; font-family: var(--font-body); }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.card-cat { font-size: .8rem; color: var(--muted); font-weight: 500; margin-top: 2px; }

.card-odds { display: flex; align-items: flex-end; gap: 14px; }
.card-odds .spark { margin-left: auto; }
.card-yes { font-family: var(--font-display); font-weight: 750; font-size: 2rem; line-height: 1; color: var(--yes); letter-spacing: -0.02em; }
.card-yes small, .card-no small { display: block; font-family: var(--font-body); font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-bottom: 4px; }
.card-no { font-family: var(--font-display); font-weight: 650; font-size: 1.25rem; line-height: 1; color: var(--no); }
.card-change { font-weight: 600; }
.up { color: var(--yes); }
.down { color: var(--no); }
.flat { color: var(--muted); }
.spark { width: 88px; height: 32px; flex-shrink: 0; }
.spark path { stroke: var(--ink-2); stroke-width: 1.6; }

/* The signature element: market split bar with the AI's estimate marked on it */
.meter { position: relative; display: flex; height: 8px; border-radius: 999px; background: var(--no-bar); overflow: visible; margin-top: 14px; }
.meter-yes { display: block; height: 100%; background: var(--yes-bar); border-radius: 999px 0 0 999px; }
.meter-ai {
  position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px;
  background: var(--brand); border-radius: 2px; box-shadow: 0 0 0 2px var(--surface);
}
.meter-ai i {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-style: normal; font-size: .66rem; font-weight: 700; color: var(--brand);
}
.meter-lg { height: 12px; margin-top: 26px; }
.meter-lg .meter-ai { top: -7px; bottom: -7px; }

.card-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--muted); }
.card-stats b { color: var(--ink-2); font-weight: 600; }

.card-ai {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--brand-soft); font-size: .88rem;
}
.card-ai .ai-name { color: var(--brand-ink); font-weight: 600; }
.card-ai .ai-num { font-weight: 750; font-family: var(--font-display); font-size: 1.05rem; }
.card-ai .badge { margin-left: auto; }
.card-ai.is-empty { background: var(--surface-2); color: var(--muted); }
.card-link { position: relative; z-index: 1; align-self: flex-start; margin-top: auto; font-size: .88rem; font-weight: 600; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

.edge { font-weight: 700; font-size: .88rem; }
.edge-up { color: var(--yes); }
.edge-down { color: var(--no); }

.badge {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge-strong_yes { background: var(--yes); color: #fff; }
.badge-yes { background: var(--yes-soft); color: var(--yes); }
.badge-neutral { background: var(--surface-2); color: var(--ink-2); }
.badge-no { background: var(--no-soft); color: var(--no); }
.badge-strong_no { background: var(--no); color: #fff; }

.skeleton { min-height: 250px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { to { background-position: -200% 0; } }
}

.feed-empty, .feed-error { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.feed-empty h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feed-empty p, .feed-error p { color: var(--muted); margin-bottom: 12px; }
.load-more { display: flex; justify-content: center; padding: 20px 0 8px; }

/* ---------- Market page ---------- */
.market-page { padding-top: 20px; padding-bottom: 32px; }
.crumbs { display: flex; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.market-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.market-img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.market-head h1 { font-size: clamp(1.5rem, 5vw, 2.3rem); font-weight: 750; letter-spacing: -0.025em; }
.market-meta { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; color: var(--muted); align-items: center; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); font-weight: 600; }
.status { font-weight: 600; }
.status-active { color: var(--yes); }
.status-resolved { color: var(--brand-ink); }

.market-layout { display: grid; gap: 16px; }
.market-main { display: grid; gap: 16px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel > h2 { margin-bottom: 12px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }

.odds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.odds-label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); }
.odds-value { font-family: var(--font-display); font-weight: 750; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1; letter-spacing: -0.03em; }
.odds-yes .odds-value { color: var(--yes); }
.odds-no .odds-value { color: var(--no); }
.odds-delta { font-family: var(--font-display); font-weight: 650; font-size: 1.3rem; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 22px 0 0; }
.kv dt { font-size: .8rem; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 650; }

.range-tabs { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; }
.range-tabs button { min-height: 36px; min-width: 44px; padding: 0 10px; border: 0; background: transparent; border-radius: 8px; font-weight: 600; font-size: .85rem; cursor: pointer; color: var(--muted); }
.range-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 22, 43, .1); }
.chart-legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.key-market { background: var(--ink); }
.key-ai { background: var(--brand); }
.chart-box { position: relative; height: 260px; }
.chart-box-sm { height: 140px; }
.chart-empty { color: var(--muted); font-size: .9rem; padding-top: 8px; }
.edge-chart { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.edge-chart h3 { margin-bottom: 8px; font-size: .95rem; }

.reason-summary { font-size: 1.02rem; color: var(--ink-2); margin-bottom: 16px; max-width: 70ch; }
.factor-grid { display: grid; gap: 16px; }
.factor-h { font-size: .95rem; margin-bottom: 6px; }
.factor-up { color: var(--yes); }
.factor-down { color: var(--no); }
.factor-grid ul, .source-list, .news-list { margin: 0; padding-left: 18px; }
.factor-grid li, .source-list li { margin-bottom: 6px; }
.source-list { margin-top: 6px; }
.factor-grid + .factor-h { margin-top: 18px; }
.news-list { list-style: none; padding: 0; }
.news-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.news-list li:last-child { border-bottom: 0; }
.news-list a { font-weight: 600; text-decoration: none; color: var(--ink); }
.news-list a:hover { text-decoration: underline; }
.news-list .muted { font-size: .85rem; }
.market-desc { color: var(--ink-2); max-width: 75ch; overflow-wrap: anywhere; }
.tag-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list li { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.attribution { margin-top: 16px; font-size: .85rem; color: var(--muted); }

.ai-panel { border-color: #D7D1FF; background: linear-gradient(180deg, #FBFAFF 0%, var(--surface) 60%); }
.ai-panel h2 { color: var(--brand-ink); }
.ai-big { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 16px; border-bottom: 1px solid var(--line); }
.ai-label { font-weight: 600; color: var(--ink-2); }
.ai-value { font-family: var(--font-display); font-weight: 750; font-size: 3rem; line-height: 1; color: var(--brand); letter-spacing: -0.03em; }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
.ai-grid dt { font-size: .8rem; color: var(--muted); }
.ai-grid dd { margin: 2px 0 0; font-family: var(--font-display); font-weight: 650; font-size: 1.35rem; }
.ai-times { font-size: .82rem; color: var(--muted); }
.ai-empty { color: var(--ink-2); padding: 8px 0; }
.ai-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

/* ---------- Error page ---------- */
.error-page { padding: 80px 16px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.error-code { font-family: var(--font-display); font-size: 4rem; font-weight: 750; color: var(--brand); line-height: 1; }
.error-page p:not(.error-code) { color: var(--muted); max-width: 44ch; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: grid; gap: 20px; padding-top: 28px; padding-bottom: 28px; font-size: .88rem; color: var(--muted); }
.footer-brand p { margin-top: 8px; }
.footer-legal { display: grid; gap: 8px; max-width: 70ch; }
.footer-legal strong { color: var(--ink-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a, .footer-legal a { color: var(--ink-2); }

/* ---------- Mobile tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: 0; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; cursor: pointer;
}
.tabbar svg { width: 22px; height: 22px; }

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  .container { padding-inline: 24px; }
  .cat-scroller { margin: 0 -24px; padding: 2px 24px; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
  .stat:nth-child(4) { border-right: 0; }
  .signal-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .signal-q { grid-column: auto; }
  .kv { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .factor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .feed-tools .select { flex: 0 0 220px; }
}

@media (min-width: 1024px) {
  body { padding-bottom: 0; }
  .tabbar { display: none; }
  :root { --header-h: 72px; }
  .search { display: block; max-width: 360px; }
  .nav-toggle { display: none; }
  .main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
  .main-nav > a { padding: 8px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .92rem; }
  .main-nav > a:hover { background: var(--surface-2); color: var(--ink); }
  .main-nav > a[aria-current="page"] { color: var(--brand-ink); }
  .nav-actions { display: flex; gap: 6px; margin-left: 10px; }
  .hero-inner { grid-template-columns: 1.25fr 1fr; align-items: end; padding-top: 72px; padding-bottom: 56px; gap: 48px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-child(even) { border-right: 0; }
  .feed-controls { flex-direction: row; align-items: center; justify-content: space-between; }
  .cat-scroller { margin: 0; padding: 2px; flex: 1; min-width: 0; }
  .feed-tools { flex-shrink: 0; }
  .market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; }
  .market-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .market-aside { position: sticky; top: calc(var(--header-h) + 16px); }
  .chart-box { height: 320px; }
  .footer-inner { grid-template-columns: 1fr 2fr auto; align-items: start; }
}

@media (min-width: 1280px) {
  .market-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Page heads & signals page (Phase 2) ---------- */
.page-head { padding-top: 32px; }
.page-head h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 750; letter-spacing: -0.03em; }
.page-sub { margin-top: 8px; color: var(--ink-2); font-size: 1.05rem; max-width: 60ch; }
.signals-page { padding-top: 24px; }
.pill-count { font-weight: 500; color: var(--muted); margin-left: 4px; }
.cat-scroller button[aria-selected="true"] .pill-count { color: rgba(255, 255, 255, .75); }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.signal-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.signal-table th, .signal-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.signal-table thead th { font-size: .78rem; font-weight: 600; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.signal-table tbody tr:last-child > * { border-bottom: 0; }
.signal-table tbody tr:hover { background: #FAFAFD; }
.signal-table tbody th { font-weight: 600; min-width: 260px; }
.signal-table tbody th a { color: var(--ink); text-decoration: none; }
.signal-table tbody th a:hover { text-decoration: underline; }
.row-cat { display: block; font-weight: 500; font-size: .8rem; color: var(--muted); }
.signal-table .num { text-align: right; white-space: nowrap; }
.ai-cell { color: var(--brand-ink); font-weight: 700; }
.method-note { margin-top: 28px; padding: 20px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink-2); font-size: .92rem; max-width: 80ch; }
.method-note h2 { font-size: 1.05rem; margin-bottom: 6px; color: var(--ink); }

@media (max-width: 719px) {
  .table-wrap { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .signal-table thead { display: none; }
  .signal-table, .signal-table tbody, .signal-table tr { display: block; }
  .signal-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; padding: 12px 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .signal-table tbody th { grid-column: 1 / -1; min-width: 0; padding: 0 0 6px; border: 0; }
  .signal-table td { padding: 0; border: 0; text-align: left; display: flex; justify-content: space-between; gap: 8px; }
  .signal-table td::before { content: attr(data-label); color: var(--muted); font-weight: 500; }
  .signal-table .num { text-align: left; }
}

/* Market page additions */
.signal-notes { margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .82rem; color: var(--ink-2); }
.signal-notes ul { margin: 4px 0 0; padding-left: 16px; }
.search-chips { margin-top: 14px; }
.search-chips iframe { width: 100%; border: 0; height: 64px; }
.quality { font-size: .8rem; color: var(--muted); }

/* ---------- Phase 3: auth, dashboard, pricing, gating ---------- */
.flash-wrap { padding-top: 16px; }
.flash { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .92rem; margin-bottom: 12px; border: 1px solid transparent; }
.flash-success { background: var(--yes-soft); color: #065F3F; border-color: #BFE6D3; }
.flash-error { background: var(--no-soft); color: #9A1F2A; border-color: #F3C4C9; }
.flash-info { background: var(--brand-soft); color: var(--brand-ink); border-color: #D7D1FF; }

.auth { display: flex; justify-content: center; padding-top: 40px; padding-bottom: 40px; }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.8rem; font-weight: 750; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 18px; }
.auth-alt { margin-top: 18px; text-align: center; color: var(--muted); font-size: .92rem; }
.form { display: grid; gap: 14px; }
.form input[type="text"], .form input[type="email"], .form input[type="password"], .form input[type="number"], .form select {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
}
.form input:focus-visible, .form select:focus-visible { outline: 3px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row a { font-size: .85rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; color: var(--ink-2); }
.check input { width: 20px; height: 20px; margin-top: 1px; flex-shrink: 0; accent-color: var(--brand); }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0 0 0 6px; color: var(--no); font-weight: 600; cursor: pointer; font-size: inherit; text-decoration: underline; }

.star {
  position: relative; z-index: 2; order: 3; margin-left: auto; flex-shrink: 0; width: 44px; height: 44px; margin-top: -10px; margin-right: -10px;
  display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 10px; color: var(--muted); cursor: pointer;
}
.star svg { width: 20px; height: 20px; }
.star:hover { background: var(--surface-2); color: var(--ink); }
.star[aria-pressed="true"] { color: #D97706; }
.star[aria-pressed="true"] svg { fill: currentColor; }
.watch-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: .85rem; cursor: pointer; }
.watch-btn svg { width: 16px; height: 16px; }
.watch-btn[aria-pressed="true"] { color: #B45309; border-color: #F5C98B; background: #FFF8EC; }
.watch-btn[aria-pressed="true"] svg { fill: currentColor; }

.gate { padding: 18px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink-2); }
.gate-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.gate-msg { margin-top: 10px; font-size: .88rem; color: var(--ink-2); }
.gate-msg:empty { display: none; }
.ai-refresh { margin-top: 14px; }
.alert-panel { margin-top: 16px; }
.alert-panel h2 { margin-bottom: 10px; }
.market-aside { display: grid; gap: 16px; align-content: start; }
.alert-panel { margin-top: 0; }

.upsell { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--ink-2); }
.cat-scroller button[disabled] { opacity: .5; cursor: not-allowed; }
.notice { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 20px; border-radius: var(--radius); background: #FFF8EC; border: 1px solid #F5D9A8; color: #7A4B00; }

.dash { padding-top: 28px; padding-bottom: 20px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.dash-head h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); font-weight: 750; letter-spacing: -0.02em; }
.plan-badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-weight: 700; font-size: .8rem; background: var(--surface-2); color: var(--ink-2); }
.plan-pro { background: var(--brand); color: #fff; }
.dash-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.dstat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.dstat-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.dstat-value { font-family: var(--font-display); font-weight: 750; font-size: 1.6rem; letter-spacing: -0.02em; }
.dstat-note { font-size: .82rem; color: var(--muted); }
.dash-grid { display: grid; gap: 16px; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list a { color: var(--ink); font-weight: 600; text-decoration: none; }
.mini-list a:hover { text-decoration: underline; }
.mini-nums { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.usage-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.usage-table th, .usage-table td { padding: 8px 0; border-bottom: 1px solid var(--line); text-align: left; }
.usage-table th { font-size: .78rem; color: var(--muted); font-weight: 600; }
.usage-table .num { text-align: right; }
.kv-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; margin-top: 0; }
.account-panel { margin-top: 16px; }
.account-grid { display: grid; gap: 24px; }
.account-grid .form { max-width: 420px; align-content: start; }

.plan-grid { display: grid; gap: 16px; max-width: 880px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.plan-featured { border: 2px solid var(--brand); }
.plan-price { font-family: var(--font-display); font-weight: 750; font-size: 2.6rem; letter-spacing: -0.03em; line-height: 1; }
.plan-price span { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-features { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; flex: 1; }
.plan-features li { padding-left: 26px; position: relative; }
.plan-features li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 12px; height: 7px; border-left: 2.5px solid var(--yes); border-bottom: 2.5px solid var(--yes); transform: rotate(-45deg); }
.plan-note, .plan-foot { font-size: .85rem; color: var(--muted); }
.plan-foot { margin-top: 18px; }

.prose { max-width: 760px; padding-top: 32px; padding-bottom: 20px; }
.prose h1 { font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 750; letter-spacing: -0.03em; margin-bottom: 10px; }
.prose h2 { font-size: 1.2rem; margin: 26px 0 8px; }
.prose p { color: var(--ink-2); margin-bottom: 10px; line-height: 1.65; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: .9rem; max-width: 90vw; z-index: 80; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  .dash-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .toast { bottom: 24px; }
  .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.panel > .btn, .panel > p + .btn { margin-top: 12px; }
@media (min-width: 1024px) and (max-width: 1279px) {
  .header-inner { gap: 8px; }
  .search { max-width: 220px; }
  .main-nav > a { padding: 8px 7px; font-size: .88rem; }
  .nav-actions .btn { padding: 0 12px; }
}

/* ---------- Phase 4: billing, track record, admin ---------- */
.checkout-card { max-width: 480px; }
.checkout-price { font-family: var(--font-display); font-weight: 750; font-size: 3rem; letter-spacing: -0.03em; line-height: 1; margin: 6px 0 8px; }
.checkout-price span { font-size: 1rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.pay-options { display: grid; gap: 10px; margin: 18px 0 12px; }
.crypto-page { padding-top: 8px; padding-bottom: 20px; }
.crypto-grid { display: grid; gap: 16px; }
.crypto-grid fieldset { margin: 0; min-width: 0; }
.step-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 650; margin-bottom: 12px; padding: 0; }
.wallet-list { display: grid; gap: 8px; margin-bottom: 14px; }
.wallet-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.wallet-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.wallet-opt input { margin-top: 3px; accent-color: var(--brand); }
.wallet-opt small { display: block; color: var(--muted); }
.pay-amount { font-family: var(--font-display); font-size: 1.3rem; }
.address-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.address-box code { flex: 1 1 240px; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: .9rem; overflow-wrap: anywhere; }
.qr { width: 176px; padding: 8px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.qr:empty { display: none; }
.warn { margin-top: 12px; font-size: .85rem; color: #7A4B00; background: #FFF8EC; padding: 10px 12px; border-radius: var(--radius-sm); }
.form textarea, .admin-form textarea, .panel textarea { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); font: inherit; }

.track-stats { margin-bottom: 16px; }
.track-grid { display: grid; gap: 16px; }

body.admin { padding-bottom: 0; }
body.admin .tabbar { display: none; }
.admin-bar { background: var(--ink); color: #fff; }
.admin-bar-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.admin-bar .brand, .admin-bar .brand-name { color: #fff; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.admin-nav a { color: #C9CCE0; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.admin-nav a:hover, .admin-nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; }
.admin-nav .count { background: #F59E0B; color: #1F1300; border-radius: 999px; padding: 0 7px; font-size: .75rem; margin-left: 4px; }
.admin-out .btn { color: #fff; }
.admin-out .btn:hover { background: rgba(255, 255, 255, .1); }
.admin-main { padding-top: 24px; padding-bottom: 48px; display: grid; gap: 16px; }
.admin-title { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 750; letter-spacing: -0.02em; }
.admin-narrow { margin: 0 auto; }
.admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-filters input, .admin-filters select, .inline-form select, .inline-form input, .review-form input { min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.admin-filters input[type="search"] { flex: 1 1 240px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table thead th { background: var(--surface-2); font-size: .76rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.admin-table .num { text-align: right; white-space: nowrap; }
.admin-table a { color: var(--ink); font-weight: 600; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .82rem; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.days-input { width: 90px; }
.row-actions { white-space: nowrap; }
.pager { display: flex; gap: 8px; }
.chip-warn { background: var(--no-soft); color: var(--no); border-color: #F3C4C9; }
.admin-form { display: grid; gap: 16px; }
.admin-form .panel { display: grid; gap: 12px; }
.admin-fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); align-items: end; }
.admin-fields input, .admin-fields select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.admin-fields .wide { grid-column: span 2; }
.wallet-form { margin-top: 16px; }
.review-card { display: grid; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review-card:last-child { border-bottom: 0; }
.review-card p { margin-bottom: 4px; }
.review-form { display: flex; flex-wrap: wrap; gap: 8px; }
.review-form input { flex: 1 1 220px; }
.code { background: var(--surface-2); padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .85rem; }
.admin-2col { grid-template-columns: 1fr; }

@media (min-width: 900px) {
  .crypto-grid { grid-template-columns: 1fr 1fr; }
  .crypto-grid > section:last-child { grid-column: 1 / -1; }
  .track-grid { grid-template-columns: 1fr 1fr; }
  .admin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-2col { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .review-card { grid-template-columns: 1fr minmax(320px, 420px); align-items: start; }
}
.crypto-grid .panel { margin: 0; }
.crypto-grid fieldset.panel { min-width: 0; }
.crypto-grid legend.step-title { float: left; width: 100%; padding: 0; margin-bottom: 14px; }
.crypto-grid legend.step-title + * { clear: both; }
.crypto-grid select, .crypto-grid input[type="text"] {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface);
}
.crypto-page .page-head { padding-top: 24px; margin-bottom: 16px; }

/* AI call-to-action on cards and locked AI panel */
.card-ai-cta { position: relative; z-index: 2; display: grid; gap: 6px; }
.ai-cta svg { width: 18px; height: 18px; }
.ai-cta-msg { font-size: .82rem; color: var(--no); }
.ai-cta-msg:empty { display: none; }
.ai-locked { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0 16px; color: var(--ink-2); }
.ai-locked svg { width: 28px; height: 28px; flex-shrink: 0; color: var(--brand); }
.ai-panel .btn + .btn { margin-top: 8px; }
.gate-note { margin-top: 8px; font-size: .82rem; color: var(--muted); text-align: center; }
.lock-link { font-weight: 600; text-decoration: none; }
.lock-link:hover { text-decoration: underline; }
.code { white-space: pre-wrap; word-break: break-all; }

/* ---------- Live hero (ticker + spotlight) ---------- */
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--surface); position: relative; }
.ticker::before, .ticker::after { content: ""; position: absolute; top: 0; bottom: 0; width: 48px; z-index: 1; pointer-events: none; }
.ticker::before { left: 0; background: linear-gradient(90deg, var(--surface), transparent); }
.ticker::after { right: 0; background: linear-gradient(270deg, var(--surface), transparent); }
.ticker-track { display: flex; width: max-content; }
.tick { display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; white-space: nowrap; text-decoration: none; color: var(--ink-2); font-size: .88rem; border-right: 1px solid var(--line); }
.tick:hover { background: var(--surface-2); color: var(--ink); }
.tick b { color: var(--ink); font-weight: 700; }
.tick-q { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: no-preference) {
  .ticker-track { animation: ticker 70s linear infinite; }
  .ticker:hover .ticker-track { animation-play-state: paused; }
  @keyframes ticker { to { transform: translateX(-50%); } }
}
@media (prefers-reduced-motion: reduce) { .ticker { overflow-x: auto; } }

.live-pill { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px; background: var(--yes-soft); color: var(--yes); font-weight: 650; font-size: .82rem; letter-spacing: .02em; text-transform: uppercase; }
.hero-live .hero-title { font-size: clamp(2rem, 6vw, 3.3rem); }
.hero-accent { background: linear-gradient(90deg, var(--brand), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.spotlight { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(20,22,43,.05), 0 18px 40px rgba(75,58,224,.10); overflow: hidden; min-width: 0; }
.spot-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 0; }
.spot-label { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.spot-dots { display: flex; gap: 6px; }
.spot-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--line-strong); cursor: pointer; }
.spot-dot[aria-current="true"] { background: var(--brand); width: 20px; border-radius: 4px; }
.spot-body { display: block; padding: 10px 20px 16px; color: inherit; text-decoration: none; }
.spot-cat { font-size: .78rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.spot-q { margin-top: 4px; font-size: 1.2rem; line-height: 1.25; min-height: 2.5em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spot-nums { display: flex; align-items: flex-end; gap: 14px; margin-top: 12px; }
.spot-yes small { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.spot-yes b { font-family: var(--font-display); font-weight: 750; font-size: 3rem; line-height: 1; color: var(--yes); letter-spacing: -0.03em; }
.spot-chg { font-weight: 700; font-size: .95rem; padding-bottom: 6px; }
.spot-spark { display: block; width: 100%; height: 80px; margin-top: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .spark-head { animation: blink 1.6s ease-in-out infinite; }
  @keyframes blink { 50% { opacity: .35; } }
  .spot-swap .spot-body { animation: spotIn .45s ease; }
  @keyframes spotIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
.spot-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.spot-meta b { color: var(--ink); }
.spot-cta { display: inline-block; margin-top: 12px; font-weight: 700; color: var(--brand-ink); }
.spot-body:hover .spot-cta { text-decoration: underline; }
.spot-foot { display: flex; align-items: center; gap: 8px; padding: 10px 20px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }

.stat-strip-4 { margin-bottom: 32px; }
.stat-strip-4 .stat dd { font-size: 1.7rem; }
.stat-sub { display: block; margin-top: 2px; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 1024px) {
  .hero-live .hero-inner { align-items: center; padding-top: 56px; padding-bottom: 40px; }
  .stat-strip-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 48px; }
  .stat-strip-4 .stat { border-bottom: 0; border-right: 1px solid var(--line); }
  .stat-strip-4 .stat:last-child { border-right: 0; }
}

/* Keep every card's AI button pinned to the bottom so rows line up. */
.market-grid .card { display: flex; flex-direction: column; height: 100%; }
.market-grid .card > .card-ai-cta,
.market-grid .card > .card-ai { margin-top: auto; }
.card-title a { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Language switch (EN / FR) ---------- */
.lang-switch { display: inline-flex; margin-left: auto; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; flex-shrink: 0; }
.lang-switch a { min-width: 36px; min-height: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-decoration: none; }
.lang-switch a:hover { color: var(--ink); }
.lang-switch a[aria-current="true"] { background: var(--surface); color: var(--brand-ink); box-shadow: 0 1px 3px rgba(20, 22, 43, .12); }
@media (min-width: 1024px) { .lang-switch { margin-left: 8px; } }
.footer-lang { color: var(--muted); }
.footer-lang a { margin: 0 2px; }

/* ---------- Email code ---------- */
.code-input { font-size: 1.6rem !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.auth-alt .btn-link { color: var(--brand-ink); padding: 0; }
form.auth-alt { margin-top: 12px; }

/* ---------- Crypto screenshot upload ---------- */
.upload-box { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; text-align: center; }
.upload-box:hover, .upload-box:focus-within { border-color: var(--brand); }
.upload-box input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-text { color: var(--ink-2); font-weight: 600; font-size: .9rem; word-break: break-all; }
.upload-preview { max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); border: 1px solid var(--line); }

/* ---------- Admin additions ---------- */
.proof-thumb { display: inline-flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: .85rem; }
.proof-thumb img { max-width: 260px; max-height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--line); object-fit: contain; background: var(--surface-2); }
.btn.danger { color: var(--no); }
.admin-list { display: grid; gap: 10px; }
.admin-row { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.admin-row summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; cursor: pointer; }
.admin-row-body { display: grid; gap: 18px; padding: 0 16px 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.create-user summary { cursor: pointer; }
.create-user[open] summary { margin-bottom: 14px; }
.quick-wallets { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); margin-bottom: 12px; }
.quick-wallets input[type="text"] { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width .4s ease; }
.form textarea, .admin-main textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; }
/* Longer French labels: full-width buttons may wrap onto two lines instead of overflowing. */
.btn-block { white-space: normal; text-align: center; padding-top: 8px; padding-bottom: 8px; line-height: 1.3; }
