/* predictionwave prototype styles
   Palette: cool paper + deep navy ink. Up moves blue, down moves orange
   (they also differ in lightness, so they read for colour-blind visitors). */

:root {
  --paper: #EEF2F5;
  --surface: #FFFFFF;
  --ink: #0E1B2C;
  --muted: #4A5A6E;
  --line: #C9D3DD;
  --line-soft: #DDE4EA;
  --up: #1D4ED8;
  --down: #B4400B;
  --focus: #1D4ED8;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Public Sans", "Segoe UI", system-ui, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --wrap: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 650; }
h3 { font-size: 1.15rem; font-weight: 650; }
h4 { font-size: .95rem; font-weight: 650; margin-top: 1.2em; }
p { margin: 0 0 1em; }

a { color: var(--up); text-underline-offset: 3px; }
a:hover { color: var(--ink); }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Header / footer ---------- */

.proto-note {
  background: var(--ink);
  color: #fff;
  font-size: .85rem;
  text-align: center;
  padding: 6px 16px;
}

.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; min-height: 68px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.3rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.logo svg { width: 34px; height: 20px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.nav a {
  color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: var(--radius-sm);
  font-weight: 500;
}
.nav a:hover { background: var(--line-soft); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

/* Phone menu (js/layout.js): a button that opens the nav as a dropdown under the header */
.nav-toggle { display: none; }
@media (max-width: 640px) {
  .site-header { position: relative; z-index: 50; }
  .site-header .wrap { flex-wrap: nowrap; min-height: 60px; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .nav-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
  .nav-toggle-bars { position: relative; width: 20px; height: 14px; display: block; }
  .nav-toggle-bars i {
    position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform .2s ease, opacity .2s ease, top .2s ease;
  }
  .nav-toggle-bars i:nth-child(1) { top: 0; }
  .nav-toggle-bars i:nth-child(2) { top: 6px; }
  .nav-toggle-bars i:nth-child(3) { top: 12px; }
  .nav-open .nav-toggle-bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
  .nav-open .nav-toggle-bars i:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle-bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 16px 14px; box-shadow: 0 12px 24px rgba(14, 27, 44, .12);
  }
  .nav-open .nav { display: flex; }
  .nav a { padding: 14px 12px; font-size: 1.05rem; border-radius: var(--radius-sm); }
  .nav a[aria-current="page"] { background: var(--line-soft); text-decoration: none; font-weight: 700; }
}
@media (prefers-reduced-motion: reduce) { .nav-toggle-bars i { transition: none; } }

.site-footer { border-top: 1px solid var(--line); margin-top: 96px; padding: 40px 0 56px; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; }
.site-footer p { max-width: 60ch; margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: var(--radius-sm);
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
  border: 2px solid var(--ink);
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #22344b; color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); }

/* ---------- Hero ---------- */

.hero { padding: 64px 0 72px; }
.hero .wrap {
  display: grid; gap: 48px; align-items: center;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}
.hero-copy p { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.hero-card {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: 0 1px 0 var(--line-soft), 0 18px 40px -24px rgba(14, 27, 44, .35);
}
.hero-card-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.hero-card-head h2 { font-size: 1.15rem; margin: 0; }
.hero-card-head .price { font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; line-height: 1; }
.hero-card-head .price small { display: block; font: 500 .75rem var(--font-body); color: var(--muted); text-align: right; }
.hero-card .detail { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 16px; }
.hero-card-link { display: inline-block; margin-top: 8px; font-weight: 600; }

/* ---------- Chart ---------- */

.chart { position: relative; height: 240px; margin: 8px 0 0; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.grid-line { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.price-area { fill: rgba(14, 27, 44, .05); }
.price-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.wave-seg { stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.wave-seg--up { stroke: var(--up); }
.wave-seg--down { stroke: var(--down); }

.grid-label {
  position: absolute; right: 0; transform: translateY(-120%);
  font-size: .75rem; color: var(--muted); background: var(--surface); padding: 0 4px;
}

.marker {
  position: absolute; transform: translate(-50%, -50%);
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.marker span {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 .85rem var(--font-body);
  background: var(--surface); color: var(--ink); border: 2px solid var(--ink);
  transition: transform .15s ease-out;
}
.marker:hover span { transform: scale(1.12); }
.marker[aria-pressed="true"] span { background: var(--ink); color: #fff; transform: scale(1.18); }

.chart-foot { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; }

/* ---------- Wave detail ---------- */

.detail-when { color: var(--muted); font-size: .9rem; margin-bottom: 4px; }
.detail-move { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; margin-bottom: 10px; }
.detail-move span { font: 500 .95rem var(--font-body); color: var(--muted); margin-left: 6px; }
.detail-text { margin-top: 12px; max-width: 62ch; }
.sources { margin: 0; padding-left: 1.1em; }
.sources-empty { color: var(--muted); font-size: .95rem; }
.held { display: flex; gap: 32px; flex-wrap: wrap; margin: 16px 0 0; }
.held dt { font-size: .8rem; color: var(--muted); }
.held dd { margin: 0; font-weight: 600; text-transform: capitalize; }

.move--up { color: var(--up); }
.move--down { color: var(--down); }

/* Confidence: the dot shape carries the meaning, not just colour. */
.conf {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; white-space: nowrap;
  padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink);
}
.conf-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); }
.conf-confirmed .conf-dot { background: var(--ink); }
.conf-likely .conf-dot { background: linear-gradient(90deg, var(--ink) 50%, transparent 50%); }
.conf-none .conf-dot { background: transparent; }

/* ---------- Sections ---------- */

.section { padding: 72px 0 0; }
.section-lede { color: var(--muted); max-width: 60ch; }

/* Method steps (a real sequence, so numbered) */
.steps {
  list-style: none; margin: 32px 0 0; padding: 0; counter-reset: step;
  display: grid; gap: 32px; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 16px; }
.steps li::before {
  content: counter(step); display: block;
  font: 700 2.4rem/1 var(--font-display); margin-bottom: 12px; color: var(--muted);
}
.steps p { color: var(--muted); margin: 0; }

.legend-box { display: flex; gap: 24px; flex-wrap: wrap; margin: 40px 0 0; padding: 20px 24px; background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--line); }
.legend-box div { flex: 1 1 240px; }
.legend-box dd { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }

/* Learn teaser */
.guide-links { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 0 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-links a {
  display: block; padding: 18px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.guide-links a span { display: block; font-weight: 400; color: var(--muted); font-size: .95rem; }
.guide-links a:hover { color: var(--up); }

/* Newsletter */
.newsletter-box {
  background: var(--ink); color: #fff; border-radius: var(--radius-lg);
  padding: 40px; display: grid; gap: 24px 48px; align-items: end;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.newsletter-box h2 { margin-bottom: .3em; }
.newsletter-box p { color: #C9D3DD; margin: 0; }
.signup label { display: block; font-size: .9rem; margin-bottom: 6px; color: #fff; }
.signup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.signup input {
  flex: 1 1 220px; min-height: 48px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 2px solid #fff; font: 1rem var(--font-body);
}
.signup button { background: #fff; color: var(--ink); border-color: #fff; }
.signup button:hover { background: var(--paper); }
.signup-msg { min-height: 1.5em; font-size: .9rem; margin-top: 10px; color: #fff; }
.newsletter-box :focus-visible { outline-color: #fff; }

/* ---------- Market page ---------- */

.crumbs { font-size: .9rem; color: var(--muted); margin: 32px 0 16px; }
.market-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.market-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); max-width: 22ch; margin-bottom: .3em; }
.market-meta { color: var(--muted); margin: 0; }
.market-price { text-align: right; }
.market-price .big { display: block; font: 700 3rem/1 var(--font-display); }
.market-price .small { font-size: .85rem; color: var(--muted); }

.market-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 24px; }
.panel h2 { font-size: 1.15rem; }
.market-side { display: grid; gap: 24px; }
.chart-panel .chart { height: 300px; }
.hint { color: var(--muted); font-size: .9rem; }
.chart-panel .detail { border-top: 1px solid var(--line-soft); margin-top: 20px; padding-top: 20px; }
.fine { font-size: .85rem; color: var(--muted); margin: 0; }

.venues { width: 100%; border-collapse: collapse; }
.venues th, .venues td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.venues th { font-size: .8rem; color: var(--muted); font-weight: 500; }
.venues td:not(:first-child), .venues th:not(:first-child) { text-align: right; }

.next { list-style: none; margin: 0; padding: 0; }
.next li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.next li:last-child { border-bottom: 0; }
.next span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }

.all-waves { margin-top: 24px; }
.wave-list { list-style: none; margin: 0; padding: 0; }
.wave-item {
  width: 100%; display: grid; align-items: center; gap: 8px 20px; text-align: left;
  grid-template-columns: 36px 170px 90px minmax(0, 1fr) auto;
  padding: 14px 8px; min-height: 56px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line-soft);
  font: inherit; color: inherit; cursor: pointer; border-radius: var(--radius-sm);
}
.wave-item:hover { background: var(--paper); }
.wave-item[aria-pressed="true"] { background: var(--line-soft); }
.wave-num {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink);
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.wave-date { color: var(--muted); font-size: .9rem; }
.wave-diff { font-weight: 700; }

.empty { padding: 96px 0; }

/* ---------- Learn page ---------- */

.article { max-width: 68ch; padding-top: 48px; }
.article h1 { font-size: clamp(2rem, 4vw, 3rem); }
.article .lede { font-size: 1.2rem; color: var(--muted); }
.article h2 { margin-top: 2em; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px 24px; margin: 32px 0; }
.toc ol { margin: 8px 0 0; padding-left: 1.2em; }
.toc li { padding: 4px 0; }
.example {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 20px 24px; margin: 24px 0;
}
.example p:last-child { margin-bottom: 0; }
.callout { border-left: 0; background: var(--ink); color: #fff; border-radius: var(--radius-md); padding: 20px 24px; margin: 32px 0; }
.callout p { margin: 0; }

/* ---------- Responsive ---------- */

/* ---------- Live data additions ---------- */

.muted { color: var(--muted); }
code { font-size: .9em; background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }

/* Venue lines: different colour AND different dash, so they read without colour too. */
.line-poly { stroke: var(--ink); }
.line-kalshi { stroke: #5B6B80; stroke-dasharray: 6 4; }
.legend { display: inline-flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 22px; height: 0; border-top: 2px solid var(--ink); }
.legend-swatch.line-kalshi { border-top: 2px dashed #5B6B80; }

.readout { font-size: .85rem; color: var(--muted); margin: 0 0 4px; white-space: pre; overflow-x: auto; min-height: 1.4em; }
.cursor { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-hit { position: absolute; inset: 0; cursor: crosshair; }
.chart-empty { color: var(--muted); padding: 40px 0; text-align: center; margin: 0; }
.marker { z-index: 2; }
.marker.conf-pending span { border-style: dashed; }

.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-head h2 { margin: 0; }
.ranges { display: flex; gap: 4px; }
.range {
  min-width: 52px; min-height: 40px; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); font: 600 .9rem var(--font-body); color: var(--ink); cursor: pointer;
}
.range[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.status { font-size: .9rem; color: var(--muted); margin: -16px 0 16px; }
.notice { border: 1px solid var(--down); background: #FFF4EE; border-radius: var(--radius-md); padding: 12px 16px; margin: 0 0 16px; font-size: .95rem; }
.notice ul { margin: 6px 0 0; padding-left: 1.2em; }
.row-error { color: var(--down); font-size: .85rem; }

.conf-pending .conf-dot { border-style: dashed; }
.detail-title { font-size: 1.05rem; margin: 14px 0 4px; }

.table-scroll { overflow-x: auto; }
.rules { white-space: pre-line; font-size: .9rem; color: var(--muted); }
details { border-bottom: 1px solid var(--line-soft); padding: 8px 0; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.timeline span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.market-side h3 { font-size: 1rem; margin-top: 1.2em; }

/* Home: live list */
.live-list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.live-row {
  display: grid; gap: 8px 24px; align-items: center;
  grid-template-columns: minmax(0, 1.5fr) auto 110px minmax(0, 1.3fr);
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.live-row.is-loading { grid-template-columns: minmax(0, 1fr) auto; }
.live-title { font-weight: 600; color: var(--ink); text-decoration: none; }
a.live-title:hover { text-decoration: underline; }
.live-prices { display: flex; gap: 14px; flex-wrap: wrap; }
.venue-price { font-weight: 700; }
.venue-price .muted { font-weight: 500; font-size: .85rem; }
.live-change { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.live-change span { display: block; font: 500 .75rem var(--font-body); color: var(--muted); }
.live-wave { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .95rem; }

/* Lookup form */
.lookup { margin-top: 48px; }
.lookup-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.field { flex: 1 1 280px; }
.field label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 2px solid var(--line);
  border-radius: var(--radius-sm); font: 1rem var(--font-body); background: var(--surface); color: var(--ink);
}
.field input:focus-visible { border-color: var(--focus); }
.form-msg { min-height: 1.4em; margin: 10px 0 0; color: var(--down); font-size: .9rem; }

@media (max-width: 960px) {
  .hero .wrap, .market-grid, .newsletter-box { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-row { grid-template-columns: minmax(0, 1fr) auto; }
  .live-wave, .row-error { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { padding: 40px 0 48px; }
  .hero-card, .panel { padding: 18px; }
  .newsletter-box { padding: 28px 22px; }
  .steps, .guide-links { grid-template-columns: minmax(0, 1fr); }
  .chart, .chart-panel .chart { height: 200px; }
  .market-price { text-align: left; }
  .wave-item { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .wave-item .wave-sum, .wave-item .conf { grid-column: 2 / -1; justify-self: start; }
}

.fatal { margin-top: 16px; margin-bottom: 16px; }

/* ---------- Embed + context + jumps layout ---------- */

.hero--simple .wrap { grid-template-columns: minmax(0, 1fr); }
.hero--simple .hero-copy { max-width: 720px; }

.market-list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.market-row { display: grid; gap: 4px 24px; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr); align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.market-row-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.market-row-title:hover { text-decoration: underline; }

.market-page { max-width: 760px; }
.market-title { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: 24px; }

.embed-wrap { margin: 0 0 40px; }
.embed-wrap iframe {
  display: block; width: 100%; max-width: 760px; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface);
}
.embed-wrap .fine { margin-top: 8px; }

.block { margin-top: 40px; }
.block p { max-width: 68ch; }

.jumps { list-style: none; margin: 16px 0 0; padding: 0; }
.jump, .up-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.jump-date { font-weight: 700; margin: 0; }
.jump-body h3 { margin: 0 0 6px; }
.jump-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }
.jump-move { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.jump-sources { font-size: .9rem; color: var(--muted); }

@media (max-width: 640px) {
  .market-row, .jump, .up-item { grid-template-columns: minmax(0, 1fr); }
}

.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--ink); margin-bottom: 12px; }
.tab {
  min-height: 44px; padding: 0 18px; border: 0; background: transparent; cursor: pointer;
  font: 600 1rem var(--font-body); color: var(--muted); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab:hover { color: var(--ink); background: var(--line-soft); }
.tab[aria-selected="true"] { background: var(--ink); color: #fff; }

/* ---------- Home directory ---------- */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hero--simple { padding-bottom: 32px; }
.search { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; max-width: 640px; }
.search input {
  flex: 1 1 260px; min-height: 48px; padding: 0 14px; border: 2px solid var(--ink);
  border-radius: var(--radius-sm); font: 1rem var(--font-body); background: var(--surface); color: var(--ink);
}
.section--tight { padding-top: 24px; }

.features { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.feature { background: var(--ink); color: #fff; border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.feature .muted { color: #C9D3DD; font-size: .85rem; }
.feature-title { color: #fff; font-family: var(--font-display); font-weight: 650; font-size: 1.15rem; text-decoration: none; }
.feature-title:hover { text-decoration: underline; color: #fff; }
.feature-jump { color: #C9D3DD; font-size: .9rem; }

.cats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 24px; }
.cat {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 600 .95rem var(--font-body); cursor: pointer;
}
.cat:hover { border-color: var(--ink); }
.cat[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; gap: 12px; align-items: flex-start; color: var(--ink); text-decoration: none; }
.card-head:hover .card-title { text-decoration: underline; }
.card-icon { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--line-soft); }
.card-title { font-weight: 600; line-height: 1.3; }
.card-odds { margin: 0; color: var(--muted); }
.card-big { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; color: var(--ink); }
.chg { font-weight: 700; font-size: .85rem; margin-left: 4px; }
.card-outcomes { list-style: none; margin: 0; padding: 0; }
.card-outcomes li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: .95rem; }
.card-outcomes li:last-child { border-bottom: 0; }
.card-outcomes a { color: var(--ink); text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-outcomes a:hover { text-decoration: underline; }
.card-pct { font-weight: 700; flex: none; }
.card-foot { margin: auto 0 0; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: .85rem; color: var(--muted); }
.badge { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; }

.grid-status { margin-top: 16px; color: var(--muted); }
.load-more { margin-top: 24px; }

.market-stats { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; margin: -12px 0 24px; }
.market-stats strong { font-family: var(--font-display); font-size: 1.6rem; }
.outcomes { list-style: none; margin: 0; padding: 0; }
.outcomes li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.outcomes a { flex: 1; color: var(--ink); font-weight: 600; }
.out-pct { font-weight: 700; }

/* What could move it next */
.upcoming { list-style: none; margin: 16px 0 0; padding: 0; }
.up-item { padding: 20px 0; border-top: 1px solid var(--line); }
.up-item .jump-date { color: var(--up); }
/* Impact: number of filled bars carries the meaning, not just colour */
.impact { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.impact-bars { display: inline-flex; gap: 2px; align-items: flex-end; }
.impact-bars i { display: block; width: 4px; border-radius: 1px; background: var(--line); }
.impact-bars i:nth-child(1) { height: 6px; }
.impact-bars i:nth-child(2) { height: 9px; }
.impact-bars i:nth-child(3) { height: 12px; }
.impact-low .impact-bars i:nth-child(-n+1),
.impact-medium .impact-bars i:nth-child(-n+2),
.impact-high .impact-bars i { background: var(--ink); }

/* ---------- Own price chart ---------- */

.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 20px 16px; margin-bottom: 40px; }
.chart-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.price-big { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.price-sub { font-size: .9rem; margin-top: 4px; }
.chart-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.chart-card-foot .fine { margin: 0; }

.pc { position: relative; height: 300px; margin-right: 44px; }
.pc svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pc-grid { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pc-area { fill: rgba(14, 27, 44, .05); }
.pc-cursor { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pc-ylabel { position: absolute; left: 100%; margin-left: 8px; transform: translateY(-50%); font-size: .75rem; color: var(--muted); }
.pc-hit { position: absolute; inset: 0; cursor: crosshair; }
.pc-readout { font-size: .85rem; color: var(--muted); margin: 0 0 6px; white-space: pre; overflow-x: auto; min-height: 1.4em; }
.pc-x { position: relative; height: 22px; margin: 6px 44px 0 0; font-size: .75rem; color: var(--muted); }
.pc-x span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pc-x span:first-child { transform: none; }
.pc-x span:last-child { transform: translateX(-100%); }
.pc-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 6px; font-size: .9rem; font-weight: 600; }
.pc-legend span { display: inline-flex; align-items: center; gap: 6px; }

.pc-marker {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  width: 44px; height: 44px; display: grid; place-items: center; text-decoration: none;
}
.pc-marker span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font: 700 .8rem var(--font-body);
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--ink);
}
.pc-marker:hover span { transform: scale(1.15); }
.pc-next { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--up); z-index: 1; pointer-events: none; }
.pc-next span { position: absolute; top: 0; right: 6px; white-space: nowrap; font-size: .75rem; font-weight: 600; color: var(--up); background: var(--surface); padding: 0 4px; }

.trade { display: flex; gap: 8px; }
.trade-btn { min-height: 44px; min-width: 110px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-weight: 700; text-decoration: none; }
.trade-yes { background: #E3EBFD; color: #1D4ED8; }
.trade-no { background: #FBE9E1; color: #96350A; }
.trade-btn:hover { filter: brightness(.95); }

.jump-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; margin-right: 8px; }
.jump:target, .jump:focus { background: var(--line-soft); outline: none; border-radius: var(--radius-sm); }

.embed-fallback { display: block; width: 100%; max-width: 480px; height: 320px; border: 0; margin: 8px auto 0; }
.embed-other { display: block; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); }

@media (max-width: 640px) {
  .pc { height: 220px; margin-right: 36px; }
  .pc-x { margin-right: 36px; }
  .chart-card { padding: 14px; }
}

/* Latest jumps (home) + AI note */
.latest-jumps { list-style: none; margin: 16px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.lj { display: grid; gap: 6px 24px; grid-template-columns: minmax(0, 1.4fr) 200px minmax(0, 1.2fr); align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.lj-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.lj-title:hover { text-decoration: underline; }
.lj-move { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.lj-move .muted { display: block; font: 500 .8rem var(--font-body); }
.lj-why { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .95rem; }
.ai-note { font-size: .8rem; color: var(--muted); margin-top: 12px; }
@media (max-width: 960px) { .lj { grid-template-columns: minmax(0, 1fr) auto; } .lj-why { grid-column: 1 / -1; } }

/* ---------- Calendar ---------- */
.cal-page { padding-top: 32px; max-width: none; }
.cal-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.cal-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 24px 0 8px; }
.cal-search, .cal-select { min-height: 44px; padding: 0 12px; border: 2px solid var(--line); border-radius: var(--radius-sm); font: 1rem var(--font-body); background: var(--surface); color: var(--ink); }
.cal-search { flex: 1 1 220px; }
.cal-search:focus-visible, .cal-select:focus-visible { border-color: var(--focus); }
.cal-day { margin-top: 28px; }
.cal-date { font-size: 1.1rem; margin-bottom: 8px; }
.cal-when { font: 500 .9rem var(--font-body); margin-left: 8px; }
.cal-table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); }
.cal-table th { text-align: left; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.cal-table td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-size: .95rem; }
.cal-table tr:last-child td { border-bottom: 0; }
.cal-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-time { white-space: nowrap; font-weight: 600; }
.cal-country { font-weight: 700; white-space: nowrap; }
.cal-title { font-weight: 600; }
.cal-note { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; max-width: 46ch; }
.cal-type { display: inline-block; margin-left: 8px; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--ink); vertical-align: 1px; }
.cal-markets ul { list-style: none; margin: 0; padding: 0; }
.cal-markets li { padding: 1px 0; font-size: .9rem; }
.cal-row.is-past td { color: var(--muted); }
.cal-row.is-past .cal-title { font-weight: 500; }

/* ---------- Home dashboard ---------- */

/* Ticker: the one moving element on the page. */
.ticker { background: var(--ink); color: #fff; overflow: hidden; border-bottom: 1px solid #22344b; }
.ticker-track { display: flex; width: max-content; animation: ticker 90s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-set { display: flex; }
.tick { display: inline-flex; align-items: baseline; gap: 8px; padding: 10px 22px; color: #fff; text-decoration: none; white-space: nowrap; border-right: 1px solid #22344b; font-size: .9rem; }
.tick:hover .tick-name { text-decoration: underline; }
.tick-name { max-width: 70ch; overflow: hidden; text-overflow: ellipsis; color: #C9D3DD; }
.tick-price { font-weight: 700; }
.ticker .move--up { color: #8FB0FF; }
.ticker .move--down { color: #FFB089; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker { overflow-x: auto; }
  .ticker-track { animation: none; }
  .ticker-set[aria-hidden="true"] { display: none; }
}

.dash { padding: 28px 0 8px; }
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 32px; flex-wrap: wrap; margin-bottom: 20px; }
.dash-head h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 4px; }
.dash-sub { color: var(--muted); margin: 0; }
.search--compact { margin: 0; flex: 0 1 420px; }

.dash-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.dash-side { display: grid; gap: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.1rem; }
.live-dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--up); margin-right: 6px; vertical-align: 1px; }

.board { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th, .board td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.board thead th { font-size: .78rem; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--ink); white-space: nowrap; }
.board tbody th { font-weight: 600; max-width: 0; width: 100%; }
.board tbody th a { color: var(--ink); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board tbody th a:hover { text-decoration: underline; }
.board tbody tr:hover { background: var(--paper); }
.board tbody tr:last-child th, .board tbody tr:last-child td { border-bottom: 0; }
.board .num { text-align: right; white-space: nowrap; }
.board .price { font-weight: 700; font-size: 1.02rem; }
.board--compact th, .board--compact td { padding: 8px 6px; }
.board-panel .table-scroll .board { min-width: 560px; }
.spark-cell { width: 128px; }
.spark { display: block; }
.spark--up polyline { stroke: var(--up); }
.spark--down polyline { stroke: var(--down); }
.chg-flat { color: var(--muted); }

/* Price change on refresh: a short highlight that fades. */
.flash-up { animation: flash-up 1.6s ease-out; }
.flash-down { animation: flash-down 1.6s ease-out; }
@keyframes flash-up { from { background: #DCE6FD; } to { background: transparent; } }
@keyframes flash-down { from { background: #FBE3D7; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .flash-up, .flash-down { animation: none; } }

.coming { list-style: none; margin: 0; padding: 0; }
.coming-day { font-size: .8rem; font-weight: 700; color: var(--muted); padding: 12px 0 4px; border-bottom: 1px solid var(--line); }
.coming-day:first-child { padding-top: 0; }
.coming-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: .92rem; }
.coming-row:last-child { border-bottom: 0; }
.coming-time { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coming-what { min-width: 0; line-height: 1.35; }
.coming-what .cal-country { margin-right: 4px; }
.impact-mini { display: inline-flex; align-items: center; gap: 5px; font-size: .75rem; font-weight: 600; white-space: nowrap; color: var(--muted); }
.impact-mini.impact-high { color: var(--ink); }

@media (max-width: 960px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .spark-cell { width: 96px; }
}

/* Elections page (elections.html, built by pipeline/build_pages.py; live parts in js/app.js) */
.el-page { padding-top: 32px; }
.el-page h1 { font-size: clamp(2rem, 4vw, 2.8rem); }

.el-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 24px 0; }
.el-stat { background: var(--ink); color: #fff; border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.el-stat-n { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; line-height: 1.1; }
.el-stat-l { color: #C9D3DD; font-size: .88rem; }

.tl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 18px 20px 14px; margin-bottom: 8px; }
.tl-h { font-size: 1.05rem; margin: 0 0 12px; }
.tl-months { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(64px, 1fr)); min-width: 780px; }
.tl-month { border-left: 1px solid var(--line); padding: 0 6px 4px; min-height: 96px; display: flex; flex-direction: column; gap: 6px; }
.tl-month:first-child { border-left: 0; padding-left: 0; }
.tl-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.tl-chips { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.tl-chip { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 7px; border-radius: 999px; font-size: .78rem; font-weight: 700; text-decoration: none; white-space: nowrap; border: 1px solid var(--ink); color: var(--ink); background: var(--surface); }
.tl-chip span { font-weight: 500; }
.tl-chip.tl-high { background: var(--ink); color: #fff; }
.tl-chip:hover { text-decoration: underline; }
.tl-key { font-size: .82rem; color: var(--muted); margin: 10px 0 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tl-key .tl-chip { pointer-events: none; }

.el-group { margin-top: 32px; }
.el-month { font-size: 1.15rem; margin-bottom: 10px; }
.el-month .muted { font: 500 .9rem var(--font-body); margin-left: 6px; }
.el-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.el-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; scroll-margin-top: 16px; }
.el-card:target { outline: 3px solid var(--focus); outline-offset: 2px; }
.el-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.el-cal { width: 84px; border: 2px solid var(--ink); border-radius: 10px; overflow: hidden; text-align: center; display: flex; flex-direction: column; }
.el-cal-m { background: var(--ink); color: #fff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 0; }
.el-cal-d { font-family: var(--font-display); font-weight: 700; font-size: 2rem; line-height: 1.1; padding-top: 4px; }
.el-cal-y { font-size: .75rem; color: var(--muted); padding-bottom: 4px; }
.el-count { font-size: .82rem; font-weight: 600; color: var(--muted); text-align: center; }
.el-kicker { margin: 0; font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.el-title { font-size: 1.25rem; margin: 2px 0 0; line-height: 1.3; }
.el-pills { margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.el-pill { font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; }
.el-pill--live { color: var(--up, #1D4ED8); }
.el-pill--warn { color: var(--down, #B4400B); }
.el-note { color: var(--muted); font-size: .88rem; margin: 8px 0 0; max-width: 70ch; }

.el-live:empty { display: none; }
.el-live-status { font-size: .9rem; margin: 14px 0 0; }
.el-feature { margin-top: 14px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.el-feature-head { margin: 0 0 10px; font-weight: 600; }
.el-feature-head .muted { font-weight: 500; font-size: .88rem; margin-left: 6px; }
.elb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.elb { display: grid; grid-template-columns: minmax(90px, 220px) minmax(0, 1fr) 48px 40px; gap: 10px; align-items: center; font-size: .92rem; }
.elb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.elb-track { height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.elb-fill { display: block; height: 100%; border-radius: 999px; }
.elb-pct { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.elb-chg { text-align: right; font-size: .82rem; font-variant-numeric: tabular-nums; }
.elb-more { font-size: .82rem; margin: 6px 0 0; }
.el-chart { margin-top: 14px; }
.el-chart .pc { height: 170px; }

.el-more { margin-top: 12px; }
.el-more summary { cursor: pointer; font-size: .88rem; font-weight: 600; color: var(--muted); }
.el-markets { list-style: none; margin: 8px 0 0; padding: 0; }
.el-markets li { padding: 3px 0; font-size: .92rem; }

@media (max-width: 640px) {
  .el-card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 16px; }
  .el-side { flex-direction: row; align-items: center; gap: 12px; }
  .el-cal { width: 64px; }
  .el-cal-d { font-size: 1.5rem; }
  .elb { grid-template-columns: minmax(70px, 1fr) minmax(60px, 1.2fr) 44px 34px; gap: 8px; font-size: .88rem; }
  .el-stat-n { font-size: 1.5rem; }
  .el-chart .pc-x span:nth-child(2), .el-chart .pc-x span:nth-child(3) { display: none; }
}
