/* foxalgo.io — vanilla CSS, mobile-first, dark default + light via
   prefers-color-scheme. No framework. */

:root {
  --bg: #0b0d12;
  --bg-raised: #12151c;
  --border: #23272f;
  --text: #e7e9ee;
  --text-dim: #9aa1ad;
  --accent: #4fd1c5;
  --accent-dim: #1f6f68;
  --bad: #ef7676;
  --good: #6bd67a;
  --warn: #e0b04f;
  --radius: 10px;
  --maxw: 1280px;
  /* Brand action color — the fox red from the logo. Red = FoxAlgo action
     (CTAs, high-probability heat); green = resolved/positive; blue = live;
     grey = closed/neutral. */
  --cta: #e5484d;
  --cta-hover: #ef5a5f;
  --live: #4da3e6;

  /* --- Instrument System (design tokens, phase 1) ---------------------- */
  --instrument-border: #262b35;
  --instrument-accent: #4fd1c5;
  /* Two data colors — blue/orange (Okabe-Ito family), distinguishable
     without relying on hue for colorblind readers; shape/label always
     carries the up/dn meaning too, color is reinforcement only. */
  --instrument-up: #4da3e6;
  --instrument-dn: #5fbf6f;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --motion-hover: 180ms;
  --motion-draw: 1000ms;
  /* Sequential single-hue (amber -> red) heat scale for |gap_pp| magnitude —
     not a diverging red/green "good/bad" scale, intensity only. */
  /* Scorecard |gap| heatmap: dark → red = bigger calibration error (error
     must never look "good", so this ramp stays red). */
  --heat-0: #171a20;
  --heat-1: #2c1719;
  --heat-2: #4c2124;
  --heat-3: #7c2d2f;
  --heat-4: #b0393c;
  /* Probability-map cells: dark → green = higher probability. Green is the
     probability color; red stays reserved for CTA buttons only. */
  --pheat-0: #171a20;
  --pheat-1: #16251b;
  --pheat-2: #1e3d27;
  --pheat-3: #2b5e39;
  --pheat-4: #3c8a4f;

  /* HTF reference-level overlays (PDH/PDL, PWH/PWL, PMH/PML) — optional
     checkbox-toggled priceLines on the symbol candlestick chart. Distinct
     hue per timeframe, kept clear of --instrument-up/dn (status: open/
     touched), --cta (red, action-only) and --warn (amber, already used
     elsewhere) so a viewer can tell "which timeframe" apart from "what
     state" at a glance. Read client-side via getComputedStyle — see
     redrawHtfLines in instruments.js. */
  --instrument-htf-d: #b58ce6;
  --instrument-htf-w: #e0a63f;
  --instrument-htf-m: #e0789e;

  font-size: 16px;
}

/* Svetla varianta vypnuta 2026-08-16 — tmava je fixni identita webu.
@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --bg-raised: #ffffff;
    --border: #e2e5ea;
    --text: #14161a;
    --text-dim: #5b6270;
    --accent: #0f8f82;
    --accent-dim: #d5f2ee;
    --bad: #b23b3b;
    --good: #2a8f3d;
    --warn: #8a6a12;
  }
}
*/

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

header.site {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.brand:hover {
  text-decoration: none;
}
nav.site-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
nav.site-nav a {
  color: var(--text-dim);
}
nav.site-nav a:hover {
  color: var(--text);
}

main {
  padding: 32px 0 64px;
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 12px;
}
h2 {
  font-size: 1.35rem;
  margin: 40px 0 12px;
}
p.lead {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 60ch;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 24px 0;
}
@media (min-width: 700px) {
  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .card-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

a.stat-card {
  color: var(--text);
  transition: border-color 0.15s ease;
}
a.stat-card:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.stat-card .market {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-card .prob {
  font-size: 2.1rem;
  font-weight: 700;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}
.stat-card .meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.badge.good {
  color: var(--good);
  border-color: var(--good);
}
.badge.dead {
  color: var(--bad);
  border-color: var(--bad);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 28px 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.trust-strip span::before {
  content: "\2713 ";
  color: var(--accent);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th,
td {
  text-align: start;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.table-scroll table {
  border: none;
}

.delta-pos {
  color: var(--good);
}
.delta-neg {
  color: var(--bad);
}

/* /bias SESSION BIAS lean cards */
.lean-card h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.lean-card.lean-up {
  border-inline-start: 3px solid var(--good);
}
.lean-card.lean-dn {
  border-inline-start: 3px solid var(--bad);
}
.lean-card.lean-coinflip {
  border-inline-start: 3px solid var(--border);
  opacity: 0.85;
}

/* home "TODAY'S BIAS" mini widget */
.today-bias-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.today-bias-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: inherit;
  text-decoration: none;
}
.today-bias-row:hover {
  text-decoration: underline;
}
.today-bias-label {
  font-weight: 600;
  min-width: 34px;
}

form.subscribe {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0;
}
form.subscribe input[type="email"] {
  flex: 1 1 240px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}
button,
form.subscribe button {
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--cta);
  background: var(--cta);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
}
button:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
}
.form-note {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-status {
  flex-basis: 100%;
  margin: 4px 0 0;
  font-size: 0.85rem;
  min-height: 1.2em;
}
.form-status-success {
  color: var(--ok, #3ecf8e);
}
.form-status-error {
  color: var(--bad, #e5554f);
}
.ledger-counts {
  margin: 0 0 10px;
  font-variant-numeric: tabular-nums;
}

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-dim);
  border-inline-start: 3px solid var(--warn);
  padding: 8px 12px;
  margin: 22px 0;
  background: var(--bg-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}
select {
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 0.9rem;
}

footer.site {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 28px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}
footer.site .wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
footer.site nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.grave-entry {
  border-inline-start: 3px solid var(--bad);
  padding: 4px 0 4px 14px;
  margin: 18px 0;
}
.grave-entry h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.grave-entry .claim {
  color: var(--text-dim);
  font-style: italic;
}

.reliability-legend {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 4px 0 14px;
}
.reliability-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-inline-end: 5px;
  vertical-align: middle;
}
.reliability-legend .predicted::before {
  background: var(--text-dim);
}
.reliability-legend .realized::before {
  background: var(--accent);
}

.reliability-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reliability-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 4px 10px;
  align-items: center;
}
.reliability-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.reliability-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bar-track {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 3px 0 0 3px;
}
.bar-fill.predicted {
  background: var(--text-dim);
}
.bar-fill.realized {
  background: var(--accent);
}
.reliability-meta {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.delta-tag {
  color: var(--text-dim);
}
.delta-tag.good {
  color: var(--good);
}
.delta-tag.bad {
  color: var(--bad);
}

code {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}

/* --- timeline (month-by-month scorecard) --- */
.timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 140px;
  padding: 10px 10px 0;
  overflow-x: auto;
}
.timeline-bar {
  position: relative;
  flex: 1 0 5px;
  min-width: 5px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  cursor: default;
}
.timeline-bar .fill {
  width: 100%;
  background: var(--accent-dim);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}
.timeline-bar .predicted-tick {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--text-dim);
}
.timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  padding: 4px 10px 0;
}
.timeline-legend {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 10px 0 4px;
}
.timeline-legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-inline-end: 5px;
  vertical-align: middle;
}
.timeline-legend .predicted::before {
  background: var(--text-dim);
}
.timeline-legend .realized::before {
  background: var(--accent-dim);
}
.timeline-caption {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 6px 0 0;
}

details.year-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 10px 0;
  overflow: hidden;
}
details.year-group summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  background: var(--bg-raised);
  list-style: none;
}
details.year-group summary::-webkit-details-marker {
  display: none;
}
details.year-group summary::before {
  content: "\25B8  ";
  color: var(--text-dim);
}
details.year-group[open] summary::before {
  content: "\25BE  ";
}
details.year-group summary .year-summary-meta {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.85rem;
  margin-inline-start: 8px;
}

/* --- live trust bar (home, right under hero) --- */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 30px;
}
.trust-box {
  flex: 1 1 150px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.trust-box-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.trust-box-value {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  margin-inline-end: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(107, 214, 122, 0.45);
  }
  50% {
    opacity: 0.65;
    box-shadow: 0 0 0 4px rgba(107, 214, 122, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot {
    animation: none;
  }
}

/* --- calibration scatter caption (home) — the scatter itself is an
   InstrumentPanel SVG, see the Instrument System block below --- */
.calib-caption {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 16px 0 4px;
}

/* --- "why traders trust this" checklist (home) --- */
.trust-checklist {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.trust-checklist li {
  position: relative;
  padding-inline-start: 26px;
  color: var(--text);
}
.trust-checklist li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--good);
  font-weight: 700;
}

/* --- symbol page trust strip --- */
.symbol-trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

/* --- hero CTAs --- */
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 4px;
}
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--cta);
  background: var(--cta);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.btn:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
  text-decoration: none;
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ======================================================================
   Instrument System — Bloomberg/lab-instrumentation panels (phase 1)
   ====================================================================== */

.instrument-panel {
  background: var(--bg-raised);
  border: 1px solid var(--instrument-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.instrument-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 18px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--instrument-border);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.instrument-id {
  white-space: nowrap;
}
.instrument-status {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.instrument-status-item {
  white-space: nowrap;
}
.instrument-title {
  margin: 12px 14px 0;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  color: var(--text);
}
.instrument-body {
  padding: 10px 14px 16px;
}

/* FOXALGO / TODAY — tabbed panel (LEVELS / SESSION / BIAS), home.tsx */
.today-tabs-intro {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.72rem;
}
.today-tabs {
  margin-top: 0;
}
.today-tabs [data-today-tab] {
  cursor: pointer;
  font-size: 0.82rem;
  padding: 5px 14px;
  background: none;
  border-width: 1px;
}
.today-tabs [data-today-tab]:hover {
  border-color: var(--accent);
}

/* SESSION tab — ASIA / LONDON / NEW YORK status + live countdown */
.session-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
}
.session-status-item {
  flex: 1 1 160px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.session-status-name {
  color: var(--text-dim);
  letter-spacing: 0.03em;
}
.session-status-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.session-status-value.session-status-live {
  color: var(--good);
}
.session-status-value.session-status-closed {
  color: var(--text-dim);
  font-weight: 400;
}

/* BIAS tab cards — coin-flip cards keep the same visual weight as lean
   cards (same .card.lean-card sizing), just a bigger verdict line so
   "COIN FLIP" reads as a real answer, not a smaller/apologetic one. */
.today-bias-verdict {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.today-bias-grade {
  font-size: 0.72rem;
  font-weight: 400;
}

.instrument-svg-wrap {
  position: relative;
}
.instrument-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.instrument-collecting {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 30px 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  justify-content: center;
  text-align: center;
}
.instrument-collecting-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--warn);
  flex-shrink: 0;
}

/* SVG chart primitives shared by every instrument chart */
.instrument-gridline {
  stroke: var(--instrument-border);
  stroke-width: 1;
}
.instrument-axis-text {
  fill: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9px;
}
.instrument-axis-caption {
  fill: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
}
.instrument-diagonal {
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  fill: none;
}
.instrument-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.instrument-line.up {
  stroke: var(--instrument-up);
}
.instrument-line.dn {
  stroke: var(--instrument-dn);
}
.instrument-point {
  stroke-width: 2;
  fill: var(--bg-raised);
  cursor: pointer;
  transition: r var(--motion-hover) ease;
}
.instrument-point.up {
  stroke: var(--instrument-up);
}
.instrument-point.dn {
  stroke: var(--instrument-dn);
}
.instrument-point.calib {
  stroke: var(--instrument-accent);
  fill: rgba(79, 209, 197, 0.18);
}
.instrument-point:hover,
.instrument-point:focus-visible,
.instrument-point.is-active {
  r: 6.5;
  outline: none;
}
.instrument-crosshair {
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
  opacity: 0;
}
.instrument-crosshair.visible {
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .instrument-point {
    transition: none;
  }
}

/* Draw-in animation, applied by instruments.js only (no-JS = fully drawn) */
.instrument-line.js-draw {
  transition: stroke-dashoffset var(--motion-draw) ease;
}

.instrument-tooltip {
  position: fixed;
  z-index: 60;
  max-width: 250px;
  padding: 8px 10px;
  background: var(--bg-raised);
  border: 1px solid var(--instrument-border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--motion-hover) ease, transform var(--motion-hover) ease;
}
.instrument-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.instrument-tooltip .t-title {
  font-weight: 700;
  margin-bottom: 3px;
  color: var(--text);
}
.instrument-tooltip .t-row {
  color: var(--text-dim);
}
@media (prefers-reduced-motion: reduce) {
  .instrument-tooltip {
    transition: none;
  }
}

/* Heatmap cell intensity */
.heat-cell {
  stroke: var(--instrument-border);
  stroke-width: 1;
  cursor: pointer;
}
.heat-none {
  fill: transparent;
  stroke-dasharray: 2 2;
}
.heat-0 {
  fill: var(--heat-0);
}
.heat-1 {
  fill: var(--heat-1);
}
.heat-2 {
  fill: var(--heat-2);
}
.heat-3 {
  fill: var(--heat-3);
}
.heat-4 {
  fill: var(--heat-4);
}
.heat-cell:hover,
.heat-cell:focus-visible,
.heat-cell.is-active {
  stroke: var(--instrument-accent);
  stroke-width: 1.5;
  outline: none;
}
.heat-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.heat-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.heat-legend .swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  display: inline-block;
  font-style: normal;
}
.heat-legend .swatch.heat-0 {
  background: var(--heat-0);
}
.heat-legend .swatch.heat-1 {
  background: var(--heat-1);
}
.heat-legend .swatch.heat-2 {
  background: var(--heat-2);
}
.heat-legend .swatch.heat-3 {
  background: var(--heat-3);
}
.heat-legend .swatch.heat-4 {
  background: var(--heat-4);
}

/* TP/SL first-hit matrix (brackets) — cells reuse .heat-cell (58x46 SVG
   units, i.e. >=44px CSS px since the svg is rendered at 1:1 via its
   inline min-width and never shrunk below that by .table-scroll), this
   only adds the in-cell percentage label. */
.matrix-cell-text {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Conditional odds scatter — categorical color by badge, reusing the
   existing up/dn/accent tokens instead of a new palette. */
.instrument-point.scatter {
  fill-opacity: 0.85;
}
.instrument-point.scatter.cat-0 {
  stroke: var(--instrument-accent);
  fill: rgba(79, 209, 197, 0.22);
}
.instrument-point.scatter.cat-1 {
  stroke: var(--instrument-up);
  fill: rgba(77, 163, 230, 0.22);
}
.instrument-point.scatter.cat-2 {
  stroke: var(--instrument-dn);
  fill: rgba(232, 162, 63, 0.22);
}
.heat-legend .swatch.cat-0 {
  background: var(--instrument-accent);
}
.heat-legend .swatch.cat-1 {
  background: var(--instrument-up);
}
.heat-legend .swatch.cat-2 {
  background: var(--instrument-dn);
}
.odds-scatter-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-dim);
}
.odds-scatter-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.odds-scatter-filters input,
.odds-scatter-filters select {
  width: 80px;
  padding: 4px 6px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

/* Scroll+highlight target flash when a research-map point is clicked */
.flash-highlight {
  animation: flash-highlight-anim 2s ease;
}
@keyframes flash-highlight-anim {
  0% {
    background: var(--accent-dim);
    border-color: var(--accent);
  }
  100% {
    background: var(--bg-raised);
    border-color: var(--border);
  }
}

/* Chart/table toggle (symbol touch ladder) */
.chart-table-toggle {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.chart-table-toggle button {
  padding: 5px 12px;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.chart-table-toggle button[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--instrument-accent);
  background: var(--bg-raised);
}

/* Table fallback (progressive-enhancement / a11y companion to every chart) */
details.chart-fallback {
  margin-top: 10px;
  font-size: 0.78rem;
}
details.chart-fallback summary {
  cursor: pointer;
  color: var(--text-dim);
  list-style: none;
}
details.chart-fallback summary::-webkit-details-marker {
  display: none;
}
details.chart-fallback summary::before {
  content: "\25B8  ";
}
details.chart-fallback[open] summary::before {
  content: "\25BE  ";
}
details.chart-fallback table {
  margin-top: 8px;
}

/* Hero layout: ~40/60 text/graph on desktop, stacked on mobile */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  align-items: start;
  margin: 6px 0 10px;
}
@media (min-width: 900px) {
  .hero-grid {
    /* 38/62 — widened from 40/60 now that the hero's right column carries
       the full FOXALGO / TODAY instrument (LEVELS/SESSION/BIAS tabs, BIAS
       being 6 cards) instead of just the map teaser. */
    grid-template-columns: 3fr 5fr;
  }
}

/* Live market strip — compact single-row version of the old hero cards */
.market-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 26px;
}
.market-strip-item {
  flex: 1 1 210px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  transition: border-color var(--motion-hover) ease;
}
.market-strip-item:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.market-strip-label {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.market-strip-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.market-strip-value .n {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.72rem;
  margin-inline-start: 4px;
}

/* ======================================================================
   Frozen prediction ledger — LIVE / FROZEN track record (phase 3)
   ====================================================================== */
.ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--instrument-border);
  border: 1px solid var(--instrument-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ledger-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 8px 12px;
  background: var(--bg-raised);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.ledger-time {
  color: var(--text-dim);
  min-width: 62px;
}
.ledger-symbol {
  font-weight: 700;
  min-width: 34px;
}
.ledger-level {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.ledger-p {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-inline-start: auto;
}
.ledger-status {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
.ledger-status.badge {
  font-family: var(--font-mono);
}
.ledger-live {
  display: inline-flex;
  align-items: center;
  color: var(--good);
  font-weight: 600;
}
.ledger-row.is-frozen {
  animation: ledger-fade-in var(--motion-draw) ease both;
}
@keyframes ledger-fade-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ledger-row.is-frozen {
    animation: none;
  }
}

/* ======================================================================
   Daily Probability Map (phase 4) — heatmap grid, drawer, view toggles
   ====================================================================== */

/* Solid (non-alpha) fills for the HTML-grid heat cells — the SVG .heat-0..4
   classes above set `fill`, which doesn't apply to a <div> background. Same
   tokens, same sequential amber->red scale. */
.pm-heat-0 {
  background: var(--pheat-0);
}
.pm-heat-1 {
  background: var(--pheat-1);
}
.pm-heat-2 {
  background: var(--pheat-2);
}
.pm-heat-3 {
  background: var(--pheat-3);
}
.pm-heat-4 {
  background: var(--pheat-4);
}
.pm-heat-none {
  background: transparent;
}

.pm-glance {
  margin: 4px 0 22px;
}

.pm-tabs {
  margin-bottom: 18px;
}

.pm-panel[hidden] {
  display: none;
}

.pm-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.pm-heatmap-scroll {
  overflow-x: auto;
  border: 1px solid var(--instrument-border);
  border-radius: var(--radius);
}
table.pm-heatmap {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  width: 100%;
}
table.pm-heatmap th,
table.pm-heatmap td {
  border-bottom: 1px solid var(--instrument-border);
  padding: 0;
  white-space: nowrap;
}
table.pm-heatmap thead th {
  padding: 8px 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-dim);
  text-align: center;
  background: var(--bg-raised);
  position: sticky;
  top: 0;
  z-index: 2;
}
table.pm-heatmap th.pm-corner {
  text-align: start;
  position: sticky;
  left: 0;
  z-index: 3;
}
th.pm-row-header {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--bg-raised);
  text-align: start;
  padding: 0 !important;
  min-width: 132px;
}
.pm-row-link {
  display: block;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.pm-row-link:hover {
  text-decoration: none;
  color: var(--accent);
}
.pm-row-note {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--text-dim);
}
td.pm-cell {
  cursor: pointer;
  min-width: 68px;
  vertical-align: middle;
}
.pm-cell-view {
  display: flex;
  flex-direction: column;
}
.pm-half {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 4px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  transition: filter var(--motion-hover) ease;
}
.pm-half.up {
  border-bottom: 1px solid var(--instrument-border);
}
.pm-half .arrow {
  font-size: 0.7em;
  opacity: 0.75;
}
.pm-half.up .arrow {
  color: var(--instrument-up);
}
.pm-half.dn .arrow {
  color: var(--instrument-dn);
}
.pm-half-empty {
  color: var(--text-dim);
  font-size: 0.72rem;
}
.pm-status-icon {
  font-size: 0.85em;
}
.pm-status-touched {
  color: var(--good);
}
.pm-status-live {
  color: var(--good);
}
.pm-status-not-touched {
  color: var(--text-dim);
}
.pm-cell-asym {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.pm-cell-asym-fill {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.pm-cell-asym-fill.up {
  background: var(--instrument-up);
}
.pm-cell-asym-fill.dn {
  background: var(--instrument-dn);
}
.pm-cell-asym span {
  position: relative;
  z-index: 1;
}
.pm-cell-live .pm-half-p {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Home hero "map teaser" — compact reuse of the .pm-heatmap grid, 4 columns
   x 8 markets, wrapped in a plain <a> per cell instead of the full drawer
   interaction /map uses. */
.pm-hot {
  box-shadow: inset 0 0 0 1px var(--good);
}
.mt-cell-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.mt-cell-link:hover {
  text-decoration: none;
  filter: brightness(1.06);
}
td.mt-cell-empty {
  text-align: center;
  padding: 14px 4px;
}
.mt-legend {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.mt-legend div {
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* PROBABILITY / LIVE STATUS / ASYMMETRY cell-view toggle: all three are
   server-rendered per cell; JS just flips which one shows via this
   attribute on the heatmap wrapper, so it works identically whichever view
   was active at first paint (no re-render needed) and degrades to
   PROBABILITY with no JS at all. */
.pm-heatmap-panel[data-cellview="probability"] .pm-cell-live,
.pm-heatmap-panel[data-cellview="probability"] .pm-cell-asym {
  display: none;
}
.pm-heatmap-panel[data-cellview="live"] .pm-cell-prob,
.pm-heatmap-panel[data-cellview="live"] .pm-cell-asym {
  display: none;
}
.pm-heatmap-panel[data-cellview="asymmetry"] .pm-cell-prob,
.pm-heatmap-panel[data-cellview="asymmetry"] .pm-cell-live {
  display: none;
}

/* HEATMAP / CURVES / TABLE main-view toggle, same "show only the matching
   block" approach as the cell-view toggle above. */
.pm-panel[data-mainview="heatmap"] .pm-view-curves,
.pm-panel[data-mainview="heatmap"] .pm-view-table {
  display: none;
}
.pm-panel[data-mainview="curves"] .pm-view-heatmap,
.pm-panel[data-mainview="curves"] .pm-view-table {
  display: none;
}
.pm-panel[data-mainview="table"] .pm-view-heatmap,
.pm-panel[data-mainview="table"] .pm-view-curves {
  display: none;
}

/* Row/column cross-highlight on cell hover/focus (instruments.js) */
tr.pm-hover-row {
  background: var(--accent-dim);
}
.pm-hover-col {
  outline: 1px solid var(--instrument-accent);
  outline-offset: -1px;
}

/* Comparison curves (CURVES view) — categorical line colors, reusing the
   existing up/dn/accent tokens plus --warn as a 4th so no new palette is
   introduced. */
.cm-line.cm-line-0 {
  stroke: var(--instrument-accent);
}
.cm-line.cm-line-1 {
  stroke: var(--instrument-up);
}
.cm-line.cm-line-2 {
  stroke: var(--instrument-dn);
}
.cm-line.cm-line-3 {
  stroke: var(--warn);
}
.cm-dot {
  pointer-events: none;
}
.cm-dot.cm-line-0 {
  fill: var(--instrument-accent);
}
.cm-dot.cm-line-1 {
  fill: var(--instrument-up);
}
.cm-dot.cm-line-2 {
  fill: var(--instrument-dn);
}
.cm-dot.cm-line-3 {
  fill: var(--warn);
}
.cm-hover-col {
  fill: transparent;
  cursor: pointer;
}
.cm-hover-col:hover,
.cm-hover-col:focus-visible,
.cm-hover-col.is-active {
  fill: rgba(255, 255, 255, 0.04);
  outline: none;
}
.cm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 8px;
}
.cm-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cm-legend i {
  width: 14px;
  height: 2.5px;
  display: inline-block;
  border-radius: 2px;
}
.cm-legend .cm-line-0 {
  background: var(--instrument-accent);
}
.cm-legend .cm-line-1 {
  background: var(--instrument-up);
}
.cm-legend .cm-line-2 {
  background: var(--instrument-dn);
}
.cm-legend .cm-line-3 {
  background: var(--warn);
}

/* Range bar (drawer): low --- o --- high, dot at today's position */
.pm-range {
  margin: 10px 0;
}
.pm-range-track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  margin: 6px 0;
}
.pm-range-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-raised);
  transform: translate(-50%, -50%);
}
.pm-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Drawer — desktop: panel from the right; mobile: bottom sheet */
.pm-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-hover) ease;
}
.pm-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.pm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 92vw);
  background: var(--bg-raised);
  border-inline-start: 1px solid var(--instrument-border);
  z-index: 41;
  overflow-y: auto;
  padding: 18px;
  transform: translateX(100%);
  transition: transform 220ms ease;
  display: none;
}
.pm-drawer.is-open {
  transform: translateX(0);
}
.pm-drawer[hidden] {
  display: none;
}
.pm-drawer:not([hidden]) {
  display: block;
}
.pm-drawer-close {
  float: right;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
}
.pm-drawer-close:hover {
  color: var(--text);
  border-color: var(--accent);
}
.pm-drawer h3 {
  margin: 0 0 4px;
}
.pm-drawer .pm-drawer-price {
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 10px;
}
@media (max-width: 640px) {
  .pm-drawer {
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    max-height: 85vh;
    border-inline-start: none;
    border-top: 1px solid var(--instrument-border);
    border-radius: 14px 14px 0 0;
    transform: translateY(100%);
  }
  .pm-drawer.is-open {
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pm-drawer,
  .pm-drawer-backdrop {
    transition: none;
  }
}

/* ======================================================================
   Candlestick panel (FoxAlgo probability overlay) — chart itself is drawn
   by lightweight-charts into .candle-chart-container; everything below is
   our own chrome (interval switch, crosshair OHLC tooltip). Height is fixed
   up front (desktop/mobile, mini/full) so there's no layout shift while the
   deferred vendor script loads and builds the chart.
   ====================================================================== */
.candle-chart-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 6px;
  overflow: hidden;
}
.candle-chart-container.mini {
  height: 260px;
}
@media (max-width: 699px) {
  .candle-chart-container {
    height: 300px;
  }
  .candle-chart-container.mini {
    height: 220px;
  }
}
.candle-interval-switch {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.candle-interval-switch button {
  padding: 5px 12px;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.candle-interval-switch button[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--instrument-accent);
  background: var(--bg-raised);
}
/* HTF reference-level toggles (PDH/PDL, PWH/PWL, PMH/PML) — plain checkbox
   row above the chart, unchecked by default (see CandlestickPanel /
   redrawHtfLines in instruments.js). Only rendered for the 6 HTF-covered
   futures symbols. */
.htf-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}
.htf-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.htf-toggle input[type="checkbox"] {
  accent-color: var(--instrument-accent);
  cursor: pointer;
}
.candle-tooltip {
  position: absolute;
  z-index: 20;
  max-width: 200px;
  padding: 6px 9px;
  background: var(--bg-raised);
  border: 1px solid var(--instrument-border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--motion-hover) ease;
}
.candle-tooltip.visible {
  opacity: 1;
}
.candle-tooltip .t-title {
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text);
}
.candle-tooltip .t-row {
  color: var(--text-dim);
}
@media (prefers-reduced-motion: reduce) {
  .candle-tooltip {
    transition: none;
  }
}

/* Level hover hit-zones — priceLines have no DOM node of their own, so this
   thin absolutely-positioned overlay (see repositionHitzones/buildCandleChart
   in instruments.js) is what makes them hoverable/focusable/tappable. */
.candle-level-hitzones {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.candle-level-hitzone {
  position: absolute;
  left: 0;
  right: 60px; /* keep clear of the right price-axis labels */
  height: 16px;
  pointer-events: auto;
  cursor: pointer;
}
.candle-level-hitzone:focus-visible {
  outline: 1px dashed var(--instrument-accent);
  outline-offset: -1px;
}

/* Brief highlight when a live/poll update actually changes the chart —
   new candle data or a level flipping to touched. */
.candle-chart-container.candle-flash {
  box-shadow: inset 0 0 0 1px var(--instrument-accent);
  transition: box-shadow 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  .candle-chart-container.candle-flash {
    transition: none;
  }
}

/* ======================================================================
   Hero candlestick terminal (home.tsx) — symbol tabs above the chart.
   ====================================================================== */
.hero-terminal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.hero-terminal-tab {
  padding: 6px 12px;
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero-terminal-tab[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--instrument-accent);
  background: var(--bg-raised);
}
.hero-terminal-tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Live-update flash on the UPDATED chip (see refreshUpdatedChip) */
.chip-flash { color: var(--instrument-accent, var(--accent)); transition: color 0.15s ease; }
@media (prefers-reduced-motion: reduce) { .chip-flash { transition: none; } }

/* /spots condition checklist — one fieldset per condition, radios laid out
   in a wrapping row (same visual density as .controls) rather than a
   traditional stacked form, since each group is short (2-4 options). */
.spots-conditions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 20px;
}
.spots-condition-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}
.spots-condition-group legend {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0 4px;
}
.spots-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}
.spots-radio input {
  accent-color: var(--accent);
}

/* Probability heat (green ramp) for SVG cells — bracket matrix and any other
   probability-magnitude surface. Error-magnitude surfaces keep .heat-N (red). */
.heat-cell.pheat-0, .swatch.pheat-0 { fill: var(--pheat-0); background: var(--pheat-0); }
.heat-cell.pheat-1, .swatch.pheat-1 { fill: var(--pheat-1); background: var(--pheat-1); }
.heat-cell.pheat-2, .swatch.pheat-2 { fill: var(--pheat-2); background: var(--pheat-2); }
.heat-cell.pheat-3, .swatch.pheat-3 { fill: var(--pheat-3); background: var(--pheat-3); }
.heat-cell.pheat-4, .swatch.pheat-4 { fill: var(--pheat-4); background: var(--pheat-4); }
.heat-cell.pheat-none { fill: var(--heat-0); }

/* Live price chip — flashes in the tick's direction (see refreshLivePrice) */
.live-price { font-variant-numeric: tabular-nums; transition: color 0.2s ease; }
.live-price.tick-up { color: var(--instrument-up); }
.live-price.tick-dn { color: var(--instrument-dn); }
@media (prefers-reduced-motion: reduce) { .live-price { transition: none; } }

/* Session decay strip (sessions.tsx) — one representative ATR distance,
   rendered SSR-only (inline width% on the fill divs, no client JS) to make
   the "at open" -> "right now" drop visually obvious next to the full
   ladder table. Reuses --live/--text-dim/--border/--bg tokens, no new
   color tokens introduced. */
.decay-strip {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.decay-strip-dist {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.decay-strip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 3px 0;
}
.decay-strip-label {
  flex: 0 0 auto;
  width: 72px;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.decay-strip-track {
  flex: 1 1 auto;
  height: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.decay-strip-fill {
  height: 100%;
  border-radius: 999px;
}
.decay-strip-fill.decay-strip-open {
  background: var(--text-dim);
}
.decay-strip-fill.decay-strip-now {
  background: var(--live);
}
.decay-strip-value {
  flex: 0 0 auto;
  width: 52px;
  text-align: end;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.decay-strip-copy {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* --- nav-tools: pure-CSS <details>/<summary> dropdown for the "Tools ▾"
   nav group (Conditional Odds, Scenario Finder, Target Odds, TP/SL
   Calculator). details/summary gives keyboard access and native tap support
   on mobile for free — no client JS, no separate mobile breakpoint needed
   since nav.site-nav already just wraps via flex-wrap.
   nav-lang (the language switcher, src/lib/layout.tsx) reuses every rule
   below by extending the selector list — same dropdown, no new styling. */
.nav-tools,
.nav-lang {
  position: relative;
}
.nav-tools > summary,
.nav-lang > summary {
  cursor: pointer;
  list-style: none;
  color: var(--text-dim);
}
.nav-tools > summary::-webkit-details-marker,
.nav-lang > summary::-webkit-details-marker {
  display: none;
}
.nav-tools > summary:hover,
.nav-tools[open] > summary,
.nav-lang > summary:hover,
.nav-lang[open] > summary {
  color: var(--text);
}
.nav-tools > summary::after,
.nav-lang > summary::after {
  content: " \25be";
}
.nav-tools-menu,
.nav-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  padding: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 20;
}
.nav-tools-menu a,
.nav-lang-menu a {
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-tools-menu a:hover,
.nav-lang-menu a:hover {
  background: var(--bg);
  text-decoration: none;
}

/* Small section eyebrow label (e.g. homepage "ZOOM OUT" teaser). */
.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}

/* Newsletter popup modal — injected by public/subscribe.js (exit-intent on
   desktop, timed on mobile). Ported mechanics from Klidne Beskydy's
   .modal/.modal-card, restyled with foxalgo's dark terminal tokens. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.open {
  display: flex;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(2px);
}
.modal-card {
  position: relative;
  width: min(440px, 100%);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.modal-close {
  position: absolute;
  right: 10px;
  top: 6px;
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
}
.modal-close:hover {
  color: var(--text);
}
.modal h2 {
  font-size: 1.3rem;
  margin: 4px 0 8px;
  padding-inline-end: 24px;
}
.modal p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin: 0 0 4px;
}
.modal .subscribe {
  margin: 16px 0 4px;
}
.modal-close-text {
  display: inline-block;
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.modal-close-text:hover {
  color: var(--text);
}
body.modal-open {
  overflow: hidden;
}
