/* ============================================================
   18% CLUB · TRADE DESK · v6
   Mobile-first stylesheet · Japandi palette
   Canonical viewport: iPhone 17 Pro (402×874)
   ============================================================ */

:root {
  /* Japandi colors */
  --cream-1: #F3F0E8;
  --cream-2: #E7E1D8;
  --cream-3: #FAEED8;
  --paper:   #FFFFFF;
  --navy:    #213744;
  --navy-2:  #1A1F25;
  --navy-3:  #0F1722;
  --terra:   #AB6A57;
  --terra-2: #806555;
  --mustard: #DCB482;
  --sage:    #606C5A;
  --stone-1: #917F6C;
  --stone-2: #5E5E5E;
  --border:  #DBD3CD;
  --border-soft: #E6E0D6;
  --win:     #606C5A;
  --loss:    #AB6A57;
  --pos:     #606C5A;
  --neg:     #AB6A57;

  /* Type */
  --font-display: Georgia, "Iowan Old Style", "Apple Garamond", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Spacing & radii */
  --r-sm: 3px;
  --r-md: 6px;
  --r-lg: 10px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-soft: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(33,55,68,0.05);
  --shadow-card: 0 1px 2px rgba(0,0,0,0.03), 0 4px 12px rgba(33,55,68,0.08);
  --shadow-dark: 0 4px 24px rgba(0,0,0,0.4);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream-2);
  color: var(--navy);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

/* ============================================================
   APP SHELL
   ============================================================ */

.app {
  max-width: 1280px;
  margin: 0 auto;
  background: var(--cream-1);
  min-height: 100vh;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ============================================================
   STATUS STRIP — top sticky
   ============================================================ */

.statusbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy-2);
  color: var(--cream-1);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--navy-3);
}
.statusbar .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mustard);
  box-shadow: 0 0 0 0 var(--mustard);
  animation: pulse 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
.statusbar.live .pulse { background: #8EE08E; }
.statusbar.closed .pulse { background: var(--stone-1); animation: none; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(220,180,130,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(220,180,130,0); }
  100% { box-shadow: 0 0 0 0   rgba(220,180,130,0); }
}
.statusbar .status-text { flex: 1; min-width: 0; }
.statusbar .status-text b { color: var(--mustard); font-weight: 600; }
.statusbar .status-text .sep { opacity: 0.4; margin: 0 6px; }
.statusbar .discord-go {
  background: var(--mustard);
  color: var(--navy-2);
  border: none;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* ============================================================
   NAV
   ============================================================ */

.nav {
  background: var(--cream-1);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: wrap;
}
.nav-link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--stone-2);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 8px;
  transition: background-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}
.nav-link:hover { background: rgba(33,55,68,0.06); color: var(--navy); }
.nav-link.active { color: var(--navy); font-weight: 700; }
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1;
}
.logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--cream-1);
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  /* the supplied PNG has a cream background — clipping to a circle hides any edge bleed on darker surfaces */
  clip-path: circle(50%);
}
.logo-wm {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.logo-wm .wm-main {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--navy);
  line-height: 1;
}
.logo-wm .wm-sub {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 600;
  line-height: 1;
}

.mode-toggle {
  margin-left: auto;
  display: inline-flex;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
}
.mode-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone-1);
  padding: 5px 9px;
  border-radius: 2px;
}
.mode-btn.on { background: var(--navy); color: var(--cream-1); }

.tour-trigger {
  background: transparent;
  border: 1px solid var(--border);
  width: 30px; height: 30px;
  border-radius: 50%;
  color: var(--stone-1);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tour-trigger:hover { color: var(--terra); border-color: var(--terra); }

/* First-time-visitor CTA — lives at right edge of nav */
.nav-firsttime {
  margin-left: auto;
  display: inline-flex;
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--terra);
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  transition: box-shadow 0.18s ease, transform 0.12s ease;
}
.nav-firsttime:hover { box-shadow: 0 4px 12px rgba(171,106,87,0.16); transform: translateY(-1px); }
.nav-firsttime-btn {
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--terra);
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  line-height: 1;
}
.nav-firsttime-btn:hover { background: rgba(171,106,87,0.06); }
.nav-firsttime-arrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  font-weight: 700;
}
.nav-firsttime-dismiss {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(171,106,87,0.32);
  font-size: 16px;
  font-weight: 300;
  color: var(--stone-1);
  width: 28px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.nav-firsttime-dismiss:hover { color: var(--terra); background: rgba(171,106,87,0.06); }

/* ── Nav Discord join widget (sub-pages) ── */
.nav-discord {
  display: inline-flex; align-items: center; gap: 14px;
  background: var(--navy); border-radius: var(--r-md);
  padding: 7px 8px 7px 14px; margin-left: auto; flex-shrink: 0;
  text-decoration: none;
}
.nav-discord-copy { display: flex; flex-direction: column; gap: 1px; }
.nav-discord-eb {
  font-family: var(--font-mono); font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mustard); line-height: 1;
}
.nav-discord-h {
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  line-height: 1.15; color: var(--cream-1);
}
.nav-discord-h em { font-style: italic; font-weight: 400; color: var(--mustard); }
.nav-discord-btn {
  background: var(--mustard); color: var(--navy-2);
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  border: none; border-radius: var(--r-sm); padding: 7px 11px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background 130ms ease;
}
.nav-discord-btn:hover { background: #c9a36e; }
/* On tablet/mobile the widget wraps to its own full-width row beneath the
   logo + links and becomes a tappable banner instead of being hidden. */
@media (max-width: 1023px) {
  .nav-discord {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 9px 9px 14px;
  }
}

/* Sub-page back link — shared across dashboard, structural-bias, etc. */
.sb-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--stone-1); margin-bottom: 18px;
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--paper); text-decoration: none;
  transition: color 140ms ease, border-color 140ms ease;
  white-space: nowrap;
}
.sb-back:hover { color: var(--terra); border-color: var(--terra); }
.sb-back .arr { font-family: var(--font-display); font-style: italic; font-weight: 700; }

/* ============================================================
   SPLIT HERO
   ============================================================ */

.split-hero {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--navy);
}
.split-hero > div {
  padding: 14px 16px;
}
.sh-left {
  background: var(--cream-1);
  border-bottom: 1px solid var(--border);
}
.sh-right {
  background: linear-gradient(160deg, #1F3340 0%, #182935 60%, #142532 100%);
  color: var(--cream-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sh-eb {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-bottom: 4px;
}
.sh-right .sh-eb { color: var(--mustard); }
.sh-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sh-h em { font-style: italic; color: var(--terra); font-weight: 400; }
.sh-right .sh-h { color: var(--cream-1); }
.sh-right .sh-h em { color: var(--mustard); }
.sh-go {
  background: var(--mustard);
  color: var(--navy-2);
  border: none;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* ============================================================
   NEW HERE banner
   ============================================================ */

.new-here {
  background: var(--paper);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.nh-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--mustard);
  color: var(--navy-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
}
.nh-text { flex: 1; font-size: 12.5px; line-height: 1.5; color: var(--stone-2); }
.nh-text b { color: var(--navy); font-weight: 600; }
.nh-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.nh-btn {
  background: var(--navy);
  color: var(--cream-1);
  border: none;
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
}
.nh-btn.ghost {
  background: transparent;
  color: var(--stone-1);
  border: 1px solid var(--border);
}

/* ============================================================
   SECTION HEAD
   ============================================================ */

.pad { padding: 22px 16px; }
.hd-eb {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 0 0 6px;
}
.hd-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--navy);
  text-wrap: balance;
}
.hd-h em { font-style: italic; font-weight: 400; color: var(--terra); }
.hd-l {
  font-size: 13px;
  line-height: 1.6;
  color: var(--stone-2);
  margin: 0 0 20px;
  max-width: 60ch;
}

/* ============================================================
   KPI cards
   ============================================================ */

.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* Triad layout used on the homepage — hero + 2 KPIs + dashboard CTA */
.kpi-triad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.kpi-triad .kpi.hero { grid-column: span 2; }

/* Compact dashboard-link tile that sits beside Max Drawdown in the triad */
.kpi.kpi-cta {
  grid-column: span 2; /* mobile: fill the row under WR|DD; tablet override below */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--terra);
  border-color: var(--terra-2);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}
.kpi.kpi-cta:hover {
  background: var(--terra-2);
  transform: translateY(-1px);
}
.kpi.kpi-cta .kpi-l {
  color: rgba(255,255,255,0.78);
}
.kpi.kpi-cta .kpi-v {
  color: var(--cream-1);
  font-size: 19px;
  letter-spacing: -0.01em;
}
.kpi.kpi-cta .kpi-v em {
  font-style: italic;
  color: var(--mustard);
  margin-left: 4px;
}
.kpi.kpi-cta .kpi-s {
  color: rgba(255,255,255,0.62);
}

/* ============================================================
   CONSOLIDATED KPI SUMMARY — homepage
   One navy card holding Live P&L + P&L % + Win Rate + separate terra dashboard CTA.
   ============================================================ */
.kpi-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-main {
  background: var(--navy);
  color: var(--cream-1);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.km-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.km-cell-sub {
  border-left: 1px solid rgba(243,240,232,0.14);
  padding-left: 16px;
}
.km-l {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 6px;
  line-height: 1.2;
}
.km-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--cream-1);
}
.km-s {
  font-size: 10.5px;
  color: rgba(243,240,232,0.72);
  margin-top: 6px;
  line-height: 1.4;
}
.km-s b { color: var(--mustard); font-weight: 600; }

.km-sub-l {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(243,240,232,0.52);
  margin-bottom: 6px;
  line-height: 1.2;
}
.km-sub-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--cream-1);
}
.km-sub-v.pos { color: var(--mustard); }
.km-sub-v.neg { color: var(--terra); }
.km-sub-s {
  font-size: 10px;
  color: rgba(243,240,232,0.52);
  margin-top: 4px;
  line-height: 1.4;
}

/* Dashboard CTA — terra companion card */
.kpi-cta-card {
  background: var(--terra);
  border: 1px solid var(--terra-2);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--cream-1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  transition: background 0.18s ease, transform 0.12s ease;
}
.kpi-cta-card:hover {
  background: var(--terra-2);
  transform: translateY(-1px);
}
.kc-l {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  line-height: 1.2;
}
.kc-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--cream-1);
}
.kc-v em {
  font-style: italic;
  color: var(--mustard);
  margin-left: 4px;
}
.kc-s {
  font-size: 10.5px;
  color: rgba(255,255,255,0.62);
  margin-top: 2px;
  line-height: 1.4;
}

/* Dashboard link card under homepage triad */
.dashboard-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--terra);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  margin: 4px 0 0;
  transition: background 0.18s, transform 0.12s;
}
.dashboard-link:hover {
  background: var(--cream-3);
  transform: translateY(-1px);
}
.dashboard-link .dl-eb {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
}
.dashboard-link .dl-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.dashboard-link .dl-h em {
  font-style: normal;
  color: var(--terra);
  margin-left: 4px;
}
.dashboard-link .dl-d {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-1);
  line-height: 1.55;
}
/* Navy "end of dashboard" return tile */
.dashboard-link.dl-end {
  background: var(--navy);
  border-left: 4px solid var(--mustard);
  text-align: center;
  align-items: center;
}
.dashboard-link.dl-end:hover { background: var(--navy-2); transform: translateY(-1px); }
.dashboard-link.dl-end .dl-h { color: var(--cream-1); }
.dashboard-link.dl-end .dl-h em { color: var(--mustard); }
.kpi {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 13px 14px;
  position: relative;
}
.kpi.hero {
  background: var(--navy);
  color: var(--cream-1);
  grid-column: span 2;
}
.kpi-l {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-bottom: 6px;
  line-height: 1.2;
}
.kpi.hero .kpi-l { color: var(--mustard); }
.kpi-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--navy);
}
.kpi.hero .kpi-v { color: var(--cream-1); font-size: 34px; }
.kpi-v.pos { color: var(--pos); }
.kpi-v.neg { color: var(--neg); }
.kpi-v.mute { color: var(--stone-1); }
.kpi-s {
  font-size: 10.5px;
  color: var(--stone-2);
  margin-top: 6px;
  font-family: var(--font-mono);
  line-height: 1.35;
}
.kpi.hero .kpi-s { color: rgba(243,240,232,0.7); }
.kpi-s b { font-weight: 600; color: var(--navy); }
.kpi.hero .kpi-s b { color: var(--mustard); }

/* Meta line on hero KPI — "$500K initial · since 20 Apr 2026" */
.kpi-meta {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.4;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(243,240,232,0.18);
  color: rgba(243,240,232,0.58);
  text-transform: lowercase;
}
.kpi.hero .kpi-meta {
  color: rgba(243,240,232,0.58);
  border-top-color: rgba(243,240,232,0.18);
}
.kpi-meta-sep { color: rgba(243,240,232,0.32); }

/* ============================================================
   TOOLTIPS on jargon
   ============================================================ */

.tt {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--terra);
}
.tt[data-active="1"]::after,
.tt:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy-2);
  color: var(--cream-1);
  padding: 8px 11px;
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: normal;
  width: max-content;
  max-width: 240px;
  border-radius: var(--r-sm);
  z-index: 100;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  box-shadow: var(--shadow-card);
}

/* ============================================================
   CHART card
   ============================================================ */

.chart-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 14px 10px;
  margin-bottom: 12px;
}
.ch-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}
.ch-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.ch-meta {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.ch-call {
  background: var(--cream-3);
  border-left: 3px solid var(--mustard);
  padding: 9px 12px;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--terra-2);
  line-height: 1.5;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.ch-call b { color: var(--navy-2); font-weight: 600; }

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  -webkit-user-select: none;
}

.ch-mark {
  cursor: pointer;
  transition: transform 0.15s;
  transform-origin: center;
}
.ch-mark:hover { transform: scale(1.5); }

/* Trade journey overlay animations — kept for back-compat, but the chart now uses lightweight-charts natively */
@keyframes tj-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes tj-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* TradingView Lightweight Charts container */
.tv-chart {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--paper);
  margin-bottom: 8px;
  /* Stop the chart from grabbing touch gestures we need for page scroll */
  touch-action: pan-y;
}
.tv-chart canvas { display: block; }

/* Wrapper for chart + DOM overlays (hold-band, OHLC tooltip) */
.tv-chart-wrap {
  position: relative;
  margin-bottom: 8px;
}
.tv-chart-wrap .tv-chart { margin-bottom: 0; }

/* Hold-duration band — translucent vertical strip between entry & exit dates */
.hold-band {
  position: absolute;
  top: 0;
  bottom: 30px;          /* leaves room for time axis */
  pointer-events: none;
  z-index: 1;
  transition: left 0.35s ease, width 0.35s ease, background 0.25s ease, border-color 0.25s ease;
}

/* Floating OHLC tooltip — follows the crosshair */
.ohlc-tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  background: rgba(33, 55, 68, 0.96);
  color: var(--cream-1);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  min-width: 130px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.ohlc-tip .oh-date {
  color: var(--mustard);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
  font-size: 10px;
}
.ohlc-tip .oh-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 8px;
  margin-bottom: 4px;
}
.ohlc-tip .oh-k {
  color: rgba(243, 240, 232, 0.55);
  font-weight: 600;
}
.ohlc-tip .oh-grid b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.ohlc-tip .oh-events {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(243,240,232,0.12);
}
.ohlc-tip .oh-event {
  font-size: 10px;
  padding: 1px 0;
}
.ohlc-tip .oh-event.entry { color: var(--mustard); }
.ohlc-tip .oh-event.win   { color: #C8D0AE; }
.ohlc-tip .oh-event.loss  { color: #F2C2B7; }
.ohlc-tip .oh-event.open  { color: var(--mustard); }

/* Chart action row — replay button + show-all pill + replay status */
.chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
  flex-wrap: wrap;
}
.ch-replay-btn {
  background: var(--navy);
  color: var(--cream-1);
  border: none;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.ch-replay-btn:hover:not(:disabled) { background: var(--terra); }
.ch-replay-btn:active:not(:disabled) { transform: translateY(1px); }
.ch-replay-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ch-replay-btn.live {
  background: var(--terra);
  animation: replayPulse 1.4s ease-in-out infinite;
}
@keyframes replayPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(171,106,87,0.35); }
  50%      { box-shadow: 0 0 0 6px rgba(171,106,87,0.05); }
}
.ch-frame-btn {
  background: transparent;
  color: var(--stone-1);
  border: 1px solid var(--border);
  padding: 7px 11px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
  cursor: pointer;
}
.ch-frame-btn:hover {
  color: var(--terra);
  border-color: var(--terra);
}

/* ────────────────────────────────────────────────────────────────
   TRADE OUTCOME FILTER (v6.7) — chips double as the chart legend.
   Replaces the old legend strip, the "Show all 30D" pill, AND the
   scrubber. Each chip has a glyph that matches the corresponding
   marker on the chart, a label, and a count.
   ──────────────────────────────────────────────────────────────── */
.trade-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;        /* chips stay together as a group */
  margin-left: auto;        /* push to the right of the replay button when there's room */
}
/* When the actions row is too narrow to hold replay + all 4 chips, the
   filter group wraps to its own line (chart-actions has flex-wrap: wrap).
   In that case kill the margin-left:auto so it sits left-aligned. */
.chart-actions { row-gap: 8px; }
.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px 6px 9px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--stone-1);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  /* v6.8: transition removed — rapid state flips were leaving chips stuck mid-
     transition (computed bg/border lagging behind the class change), so the
     active chip read as transparent until the next click. Snappy swaps read
     better here anyway; an active filter is a click, not a hover. */
}
.tf-chip:hover:not(:disabled):not(.sel) {
  color: var(--navy);
  border-color: var(--navy);
}
.tf-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.tf-chip .tf-n {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--stone-1);
  background: var(--cream-2);
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 16px;
  text-align: center;
}
.tf-chip.sel .tf-n { background: rgba(255,255,255,0.18); color: var(--cream-1); }

/* Active state — each outcome has its own brand color */
.tf-chip.all.sel  { background: var(--navy);    border-color: var(--navy);    color: var(--cream-1); }
.tf-chip.win.sel  { background: var(--sage);    border-color: var(--sage);    color: var(--cream-1); }
.tf-chip.loss.sel { background: var(--terra);   border-color: var(--terra);   color: var(--cream-1); }
.tf-chip.open.sel { background: var(--mustard); border-color: var(--mustard); color: var(--navy); }
.tf-chip.open.sel .tf-n { background: rgba(33,55,68,0.16); color: var(--navy); }

/* Glyphs — sized + colored to match the chart's marker icons */
.tf-glyph {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.tf-glyph.all {
  background: var(--navy);
  border-radius: 50%;
}
.tf-glyph.win {
  /* triangle (down arrow ≈ win exit) */
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid var(--sage);
}
.tf-chip.win.sel .tf-glyph.win { border-top-color: var(--cream-1); }
.tf-glyph.loss {
  /* diamond */
  width: 7px;
  height: 7px;
  background: var(--terra);
  transform: rotate(45deg);
  margin: 1px 1px;
}
.tf-chip.loss.sel .tf-glyph.loss { background: var(--cream-1); }
.tf-glyph.open {
  /* open ring */
  width: 10px;
  height: 10px;
  border: 2px solid var(--mustard);
  border-radius: 50%;
  background: transparent;
  box-sizing: border-box;
}
.tf-chip.open.sel .tf-glyph.open { border-color: var(--navy); }
.tf-chip.all.sel .tf-glyph.all { background: var(--cream-1); }

/* Small "zoomed" tag — appears in the filter row when a single trade is
   auto-framed. Reminds the user they're not seeing all chips' worth of
   markers; tapping any chip resets back to 30D + that filter. */
.tf-zoom-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
  background: rgba(171,106,87,0.08);
  border: 1px dashed rgba(171,106,87,0.45);
  border-radius: 999px;
  margin-right: 2px;
  white-space: nowrap;
}
.tf-zoom-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--terra);
  animation: zoomDotPulse 1.6s ease-in-out infinite;
}
@keyframes zoomDotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Legacy legend + scrubber blocks no longer rendered (kept in CSS file for
   reference). Hide defensively in case stale markup ever reappears. */
.legend, .scrub { display: none !important; }

/* ────────────────────────────────────────────────────────────────
   TRADE PICKER (v6.8) — dropdown menu for jumping to any trade.
   Trigger sits in the chart-actions row; the menu pops below it and
   lists trades filtered by the active outcome chip, newest first.
   ──────────────────────────────────────────────────────────────── */
.trade-picker {
  position: relative;
  display: inline-flex;
}
.tp-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 11px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink, var(--navy));
  background: var(--cream-1, #FAF6F0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.tp-trigger:hover { border-color: var(--navy); }
.tp-trigger.open { border-color: var(--navy); background: var(--cream-2, #F0EAE0); }
.tp-trigger .tp-lbl {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}
.tp-trigger .tp-date {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
}
.tp-trigger .tp-tier {
  font-size: 10px;
  color: var(--stone-1);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.tp-caret {
  font-size: 10px;
  color: var(--stone-1);
  transition: transform 0.18s;
}
.tp-trigger.open .tp-caret { transform: rotate(180deg); }

/* result dot — small circular swatch that matches the chart marker glyphs */
.tp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--stone-1);
}
.tp-dot.win  { background: var(--sage); }
.tp-dot.loss { background: var(--terra); }
.tp-dot.open {
  background: transparent;
  border: 2px solid var(--mustard);
  box-sizing: border-box;
  width: 9px;
  height: 9px;
}

/* Menu — popover anchored to the trigger */
.tp-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--cream-1, #FAF6F0);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: 0 8px 28px rgba(33, 55, 68, 0.18), 0 2px 6px rgba(0,0,0,0.06);
  padding: 4px;
  animation: tpMenuIn 0.14s ease-out;
}
@keyframes tpMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tp-menu-head {
  padding: 6px 10px 8px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tp-row {
  display: grid;
  grid-template-columns: 14px 56px 1fr auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--r-xs, 4px);
  font-family: inherit;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
  color: var(--ink, var(--navy));
  transition: background 0.1s;
}
.tp-row:hover { background: var(--cream-2, #F0EAE0); }
.tp-row.sel  {
  background: rgba(33, 55, 68, 0.06);
  outline: 1px solid var(--navy);
  outline-offset: -1px;
}
.tp-row-date {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0;
}
.tp-row-tier {
  font-size: 10px;
  color: var(--stone-1);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}
.tp-row-result {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.tp-row-result.win  { color: var(--cream-1); background: var(--sage); }
.tp-row-result.loss { color: var(--cream-1); background: var(--terra); }
.tp-row-result.open { color: var(--navy);    background: var(--mustard); }
.tp-row-pnl {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.tp-row-pnl.pos { color: var(--sage); }
.tp-row-pnl.neg { color: var(--terra); }

/* Replay mid-window floating P&L chip — sits horizontally centered between
   entry and exit dates, vertically anchored above the day's close.
   Avoids the right-axis area so it doesn't clash with NQ price labels. */
.replay-mid-label {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: var(--navy);
  color: var(--cream-1);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: left 0.18s linear, top 0.18s linear;
  min-width: 110px;
}
.replay-mid-label::after {
  /* down-pointing arrow */
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--navy);
}
.replay-mid-label .rml-day {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mustard);
  line-height: 1;
  margin-bottom: 3px;
}
.replay-mid-label .rml-pnl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.replay-mid-label .rml-pnl.pos { color: #C8D0AE; }
.replay-mid-label .rml-pnl.neg { color: #F2C2B7; }

/* Replay vertical "current day" line — sweeps day-by-day across the chart */
.replay-vline {
  position: absolute;
  top: 0;
  bottom: 30px;          /* clear the time-axis area */
  width: 0;
  border-left: 2px dashed;
  z-index: 3;
  pointer-events: none;
  opacity: 0.7;
  transform: translateX(-1px);
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.18s;
}
.replay-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: -6px;
  margin-top: -6px;
  z-index: 4;
  pointer-events: none;
  border: 2px solid #FFFFFF;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1), top 0.35s cubic-bezier(0.4, 0, 0.2, 1), background 0.18s;
  animation: replayDotPulse 1.4s ease-in-out infinite;
}
@keyframes replayDotPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* Replay status chip */
.replay-status {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  background: var(--cream-3);
  border: 1px solid var(--mustard);
  padding: 7px 11px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
}
.replay-status .rs-eb {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra-2);
}
.replay-status .rs-day {
  font-size: 11.5px;
  color: var(--navy);
  font-weight: 600;
}
.replay-status .rs-pnl {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.replay-status .rs-pnl.pos { color: var(--pos); }
.replay-status .rs-pnl.neg { color: var(--neg); }

.legend {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 10px;
  color: var(--stone-2);
  margin: 4px 0 8px;
  flex-wrap: wrap;
}
.lg-i { display: inline-flex; align-items: center; gap: 5px; }
.lg-tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--terra); }
.lg-cir { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); }
.lg-dia { width: 7px; height: 7px; background: var(--terra); transform: rotate(45deg); }
.lg-line { width: 14px; height: 2px; background: var(--navy); }
.lg-open { width: 10px; height: 10px; border: 2px solid var(--mustard); border-radius: 50%; box-sizing: border-box; }

/* SCRUBBER */
.scrub {
  margin-top: 6px;
  padding: 12px 4px 0;
  border-top: 1px dashed var(--border);
}
.scrub-l {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.scrub-l .hint {
  color: var(--stone-1);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  font-style: italic;
  font-size: 10.5px;
}
.scrub-track {
  position: relative;
  height: 32px;
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  touch-action: none;
}
.scrub-mk {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3px;
  height: 12px;
  background: var(--stone-1);
  border-radius: 1px;
  pointer-events: none;
}
.scrub-mk.win { background: var(--sage); }
.scrub-mk.loss { background: var(--terra); }
.scrub-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--terra);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--terra), 0 2px 6px rgba(0,0,0,0.15);
  cursor: grab;
  transition: left 0.2s ease;
}
.scrub-handle:active { cursor: grabbing; transition: none; }
.scrub-dates {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-1);
  margin-top: 6px;
  padding: 0 4px;
}
.scrub-dates .sel { color: var(--terra); font-weight: 600; }

/* ============================================================
   SELECTED TRADE BAR
   ============================================================ */

/* Trade connector — visual bridge from chart to selected-trade bar.
   Animates fresh each time tradeId changes (component re-keyed). */
.trade-connector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px 2px;
  margin: 4px 0 0;
  animation: tcAppear 0.55s ease-out;
}
.tc-line {
  flex: 1;
  height: 1px;
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}
.tc-line-l {
  background: linear-gradient(to right, transparent, var(--terra));
}
.tc-line-r {
  background: linear-gradient(to right, var(--terra), transparent);
}
.tc-line::after {
  content: '';
  position: absolute;
  top: 0; left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(220,180,130,0.9), transparent);
  animation: tcSweep 1.8s ease-out;
}
.tc-line-r::after { animation-delay: 0.1s; }
@keyframes tcSweep {
  0%   { left: -40%; }
  100% { left: 140%; }
}
.tc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--paper);
  border: 1px solid var(--terra);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(171,106,87,0.18);
}
.tc-pill-arrow {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  animation: tcArrowBob 0.9s ease-in-out infinite;
}
@keyframes tcArrowBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(2px); }
}
@keyframes tcAppear {
  0%   { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.sel-bar {
  background: var(--navy);
  color: var(--cream-1);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  flex-wrap: wrap;
  /* Trade-change pulse — terra halo fades over 1.5s, peak around 0.5s */
  animation: selBarPulse 1.5s ease-out;
}
@keyframes selBarPulse {
  0%   { box-shadow: 0 0 0 0 rgba(171,106,87,0), 0 0 0 0 rgba(171,106,87,0); }
  35%  { box-shadow: 0 0 0 4px rgba(171,106,87,0.4), 0 0 32px rgba(171,106,87,0.26); }
  100% { box-shadow: 0 0 0 0 rgba(171,106,87,0), 0 0 0 0 rgba(171,106,87,0); }
}
.sel-eb {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 3px;
}
.sel-t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--cream-1);
}
.sel-t em { font-style: italic; color: var(--mustard); font-weight: 400; }
.sel-pl-wrap {
  margin-left: auto;
  text-align: right;
}
.sel-pl-l {
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(243,240,232,0.6);
}
.sel-pl-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.sel-pl-v.win { color: #C8D0AE; }
.sel-pl-v.loss { color: #F2C2B7; }
.sel-pl-v.open { color: var(--mustard); }

/* ============================================================
   TRACE CASCADE
   ============================================================ */

/* Stagger-reveal each cascade element when trade changes (component
   is re-keyed on tradeId so children remount and animation replays). */
.trace-wrap > * {
  animation: traceReveal 0.55s ease-out backwards;
}
.trace-wrap > *:nth-child(1)  { animation-delay: 0.05s; }
.trace-wrap > *:nth-child(2)  { animation-delay: 0.15s; }
.trace-wrap > *:nth-child(3)  { animation-delay: 0.25s; }
.trace-wrap > *:nth-child(4)  { animation-delay: 0.35s; }
.trace-wrap > *:nth-child(5)  { animation-delay: 0.45s; }
.trace-wrap > *:nth-child(6)  { animation-delay: 0.55s; }
.trace-wrap > *:nth-child(7)  { animation-delay: 0.62s; }
.trace-wrap > *:nth-child(8)  { animation-delay: 0.68s; }
.trace-wrap > *:nth-child(9)  { animation-delay: 0.74s; }
.trace-wrap > *:nth-child(n+10) { animation-delay: 0.8s; }
@keyframes traceReveal {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.trace-wrap {
  background: var(--cream-1);
  padding: 16px 14px 18px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  margin-bottom: 16px;
}
.trace-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 0 0 12px;
}

.step {
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  padding: 12px 14px;
  border-radius: var(--r-sm);
}
.step-eb {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.step-eb .tag {
  background: var(--navy);
  color: var(--cream-1);
  padding: 3px 7px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  border-radius: 2px;
}
.step-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.step-h em { font-style: italic; color: var(--terra); font-weight: 400; }
.step-d {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-2);
  margin-top: 6px;
  line-height: 1.45;
}

.arrow-down {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 11.5px;
  color: var(--terra);
  padding: 8px 0;
  line-height: 1;
}
.arrow-down::after {
  content: " ↓";
  font-style: normal;
  margin-left: 2px;
}

/* Risk/Opp bar */
.ro-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--navy);
  border-bottom: 1px solid var(--navy);
  padding: 5px 10px;
  margin: 12px 0 10px;
  background: var(--cream-1);
}
.ro-bar .l, .ro-bar .r {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 11.5px;
}
.ro-bar .l { color: var(--terra); }
.ro-bar .r { color: var(--sage); }

/* Key level row */
.kl-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.kl-side {
  padding: 13px 14px;
  border-radius: var(--r-sm);
  color: var(--cream-1);
}
.kl-side.risk { background: var(--terra); text-align: left; }
.kl-side.opp { background: var(--sage); text-align: left; }
.kl-eb {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.88;
  margin-bottom: 4px;
}
.kl-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.kl-d {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.92;
  margin-top: 4px;
}
.kl-hub {
  background: var(--navy);
  color: var(--cream-1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: center;
  align-self: center;
  justify-self: stretch;
}
.kl-hub-eb {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mustard);
}
.kl-hub-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 5px 0 3px;
}
.kl-hub-d {
  font-family: var(--font-mono);
  font-size: 10px;
  color: rgba(243,240,232,0.65);
}

/* Reveal CTA */
.reveal-cta {
  background: var(--cream-2);
  border: 1px dashed var(--stone-1);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--stone-2);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: background 0.18s;
  border: 1px dashed var(--stone-1);
}
.reveal-cta::before {
  content: "▸";
  color: var(--terra);
  font-weight: 600;
  font-size: 13px;
  transition: transform 0.2s;
  display: inline-block;
}
.reveal-cta.open::before { transform: rotate(90deg); }
.reveal-cta:hover { background: var(--border-soft); }
.reveal-cta b { color: var(--navy); font-weight: 600; }

.reveal-open {
  background: var(--paper);
  border: 1px solid var(--navy);
  border-left: 4px solid var(--mustard);
  padding: 13px 16px;
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  animation: slideIn 0.25s ease;
}
.reveal-open .ro-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 6px;
}
.reveal-open p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--stone-2);
}
.reveal-open p strong { color: var(--navy); font-weight: 600; }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* SBS Module hub */
.module-hub-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.mods {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.mods-h {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.mods.risk { align-items: flex-start; }
.mods.risk .mods-h { color: var(--terra); }
.mods.opp { align-items: flex-start; }
.mods.opp .mods-h { color: var(--sage); }
.mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
  border: none;
  font-family: inherit;
  transition: transform 0.12s;
  color: var(--cream-1);
}
.mod-chip:hover { transform: scale(1.04); }
.mod-chip.risk { background: var(--terra); }
.mod-chip.opp { background: var(--sage); }
.mod-chip.sel { outline: 2px solid var(--navy); outline-offset: 2px; }
.mod-chip .mod-s {
  font-family: var(--font-mono);
  font-size: 9.5px;
  opacity: 0.85;
}

.plan-hub {
  background: var(--navy);
  color: var(--cream-1);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  justify-self: stretch;
}
.plan-hub-eb {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mustard);
}
.plan-hub-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.01em;
  margin: 6px 0 4px;
}
.plan-hub-d {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(243,240,232,0.7);
}

.mod-detail {
  background: var(--paper);
  border: 1px solid var(--navy);
  border-left: 4px solid var(--sage);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 12px;
  animation: slideIn 0.25s ease;
}
.mod-detail.risk-side { border-left-color: var(--terra); }
.mod-detail-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 5px;
}
.mod-detail.risk-side .mod-detail-eb { color: var(--terra); }
.mod-detail h4 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin: 0 0 5px;
  letter-spacing: -0.01em;
}
.mod-detail p {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--stone-2);
}

/* TSS bar */
.tss {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.tss-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-bottom: 10px;
}
.tss-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  height: 30px;
  border-radius: var(--r-sm);
  position: relative;
}
.tss-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cream-1);
  border-radius: 2px;
}
.tss-seg.ob { background: var(--terra); }
.tss-seg.nat { background: var(--stone-1); }
.tss-seg.os { background: var(--sage); }
.tss-marker {
  position: absolute;
  top: -16px;
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--navy);
  transition: left 0.4s ease;
  transform: translateX(-50%);
}
.tss-marker-label {
  position: absolute;
  top: 36px;
  font-size: 10px;
  font-style: italic;
  color: var(--navy);
  font-weight: 600;
  transition: left 0.4s ease;
  transform: translateX(-50%);
}

/* Roadmap (Markov) */
.roadmap {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 8px;
}
.roadmap-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-bottom: 8px;
}
.roadmap-bar {
  display: flex;
  height: 24px;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.roadmap-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--cream-1);
  transition: flex 0.4s ease;
}
.roadmap-seg.bull { background: var(--sage); }
.roadmap-seg.neut { background: var(--stone-1); }
.roadmap-seg.bear { background: var(--terra); }
.markov-badge {
  background: var(--mustard);
  color: var(--navy-2);
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
}
.markov-badge span {
  font-family: var(--font-mono);
  font-size: 9px;
  opacity: 0.85;
  margin-top: 2px;
  display: block;
}

/* Sensor */
.sensor-row {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.sensor-row.caution { border-left: 4px solid var(--terra); }
.sensor-row.normal { border-left: 4px solid var(--sage); }
.sensor-icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--cream-1);
  flex-shrink: 0;
}
.sensor-row.normal .sensor-icon { background: var(--sage); }
.sensor-row.caution .sensor-icon { background: var(--terra); }
.sensor-l {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.sensor-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin: 2px 0 3px;
}
.sensor-d {
  font-size: 12px;
  color: var(--stone-2);
  line-height: 1.5;
}

/* Post-mortem (red flag for losses) */
.pm-box {
  background: var(--terra);
  color: var(--cream-1);
  border-radius: var(--r-sm);
  padding: 13px 15px;
  margin-bottom: 12px;
}
.pm-eb {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 4px;
}
.pm-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 8px;
}
.pm-h em { font-style: italic; color: var(--mustard); }
.pm-d {
  font-size: 12px;
  line-height: 1.55;
  color: var(--cream-1);
  opacity: 0.95;
}
.pm-d b { color: var(--cream-3); font-weight: 600; }

/* Raw inputs */
.inputs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.input-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.input-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.input-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-bottom: 5px;
}
.input-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin-bottom: 5px;
}
.input-d {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-2);
  line-height: 1.5;
  margin-bottom: 6px;
}
.input-status {
  background: var(--cream-2);
  border-left: 2px solid var(--sage);
  padding: 6px 9px;
  font-size: 10.5px;
  color: var(--stone-2);
  font-style: italic;
}
.input-status.stale { border-left-color: var(--terra); }

/* ============================================================
   EQUITY + EXPOSURE
   ============================================================ */

.equity-card, .exposure-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.eq-pills {
  display: inline-flex;
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 2px;
  margin: 8px 0 10px;
}
.eq-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  letter-spacing: 0.06em;
  color: var(--stone-1);
  border: none;
  background: transparent;
  border-radius: 1px;
}
.eq-pill.on { background: var(--navy); color: var(--cream-1); }

.ex-pos {
  background: var(--cream-2);
  border-radius: 2px;
  padding: 11px 13px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.ex-pos-l {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--navy);
  font-weight: 600;
}
.ex-pos-d {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-2);
  margin-top: 3px;
}
.ex-pos-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--sage);
  letter-spacing: -0.01em;
  text-align: right;
}
.ex-pos-vs {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--sage);
  text-align: right;
}
.risk-box {
  background: var(--navy-2);
  color: var(--cream-1);
  padding: 13px 14px;
  border-radius: var(--r-sm);
  margin-top: 10px;
}
.risk-l {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mustard);
  margin-bottom: 4px;
}
.risk-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--terra);
  letter-spacing: -0.02em;
  line-height: 1;
}
.risk-s {
  font-size: 10.5px;
  color: rgba(243,240,232,0.75);
  margin-top: 5px;
  font-family: var(--font-mono);
}
.risk-s b { color: var(--mustard); font-weight: 600; }

/* ============================================================
   T+1 FOMO CTA
   ============================================================ */

.t1-cta {
  background: var(--terra);
  color: var(--cream-1);
  padding: 22px 18px;
  margin: 18px 0;
  border-radius: var(--r-sm);
}
.t1-cta-eb {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream-1);
  opacity: 0.85;
  margin-bottom: 6px;
}
.t1-cta-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--cream-1);
}
.t1-cta-h em { font-style: italic; font-weight: 400; color: var(--mustard); }
.t1-cta-p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--cream-1);
  opacity: 0.92;
  margin: 0 0 16px;
}
.t1-cta-card {
  background: var(--navy-2);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.t1-cta-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--cream-1);
  letter-spacing: -0.02em;
  line-height: 1;
}
.t1-cta-price span {
  font-size: 11px;
  opacity: 0.7;
  font-family: var(--font-sans);
  font-weight: 400;
}
.t1-cta-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: rgba(243,240,232,0.78);
  margin-top: 3px;
  line-height: 1.5;
}
.t1-cta-meta b { color: var(--mustard); font-weight: 600; }
.t1-cta-btn {
  background: var(--mustard);
  color: var(--navy-2);
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
}

/* Founding-seats progress mini (replaces waitlist progress) */
.seats-progress {
  margin-top: 12px;
}
.seats-track {
  height: 6px;
  background: rgba(243,240,232,0.18);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.seats-fill {
  height: 100%;
  background: var(--mustard);
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* Legacy waitlist progress — retained in case data flips back */
.wl-progress { margin-top: 12px; }
.wl-track {
  height: 6px;
  background: rgba(243,240,232,0.18);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
}
.wl-fill {
  height: 100%;
  background: var(--mustard);
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* ============================================================
   ABOUT / METHODOLOGY / FOOTER
   ============================================================ */

.about-section, .method-section {
  background: var(--cream-1);
  border-top: 1px solid var(--border);
  padding: 24px 16px;
}
.about-section { background: var(--paper); }

.author-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.author-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--cream-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 28px;
  color: var(--stone-1);
  flex-shrink: 0;
}
.author-meta {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 3px;
}
.author-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.author-bio {
  font-size: 12.5px;
  color: var(--stone-2);
  line-height: 1.6;
  margin-top: 4px;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.proof-card {
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 11px 12px;
}
.proof-eb {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.proof-v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--navy);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-top: 4px;
}

.coming-stub {
  background: var(--cream-2);
  border: 1px dashed var(--stone-1);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--stone-2);
  line-height: 1.55;
}
.coming-stub b { color: var(--navy); font-weight: 600; }
.coming-stub .stub-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 4px;
}

/* Rulebook changelog — real version history (V4.4 → V4.7) */
.method-changelog {
  margin-top: 20px;
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 18px 20px 16px;
}
.mc-eb {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 14px;
}
.mc-list { list-style: none; margin: 0; padding: 0; }
.mc-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
}
.mc-item:first-child { border-top: none; padding-top: 0; }
.mc-v {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mc-date {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--stone-1);
  text-transform: uppercase;
}
.mc-item.current .mc-v { color: var(--terra); }
.mc-b { font-size: 13px; color: var(--stone-2); line-height: 1.55; }
.mc-b b { color: var(--navy); font-weight: 700; }
.mc-ref {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-1);
}
.mc-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  font-size: 12px;
  font-style: italic;
  color: var(--stone-1);
  line-height: 1.5;
}
.mc-link {
  font-style: normal;
  font-weight: 700;
  color: var(--terra);
  white-space: nowrap;
}
.mc-link:hover { text-decoration: underline; }

.footer {
  background: var(--navy-2);
  color: rgba(243,240,232,0.75);
  padding: 22px 16px 28px;
  font-size: 11.5px;
  line-height: 1.6;
}
.footer b { color: var(--cream-1); font-weight: 600; }
.footer-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 10px 0 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.footer-row span {
  background: rgba(243,240,232,0.06);
  padding: 4px 9px;
  border-radius: 2px;
  color: var(--mustard);
  letter-spacing: 0.1em;
}
.footer .disclaimer { font-style: italic; color: var(--stone-1); }
.footer .links {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mustard);
  flex-wrap: wrap;
}
.footer .links a:hover { color: var(--cream-1); }

/* ============================================================
   FULL PERFORMANCE DASHBOARD (Chart.js port)
   ============================================================ */
.dsh-mission {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  background: var(--navy);
  color: var(--cream-1);
  border-radius: var(--r-md, 10px);
  padding: 18px 22px;
  margin-bottom: 16px;
}
@media (max-width: 760px) { .dsh-mission { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
.dsh-ms-l { font-family: var(--font-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-3); margin-bottom: 8px; }
.dsh-ms-v { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -0.025em; color: var(--cream-1); font-variant-numeric: tabular-nums; }
.dsh-ms-v.big { font-size: 26px; color: var(--mustard); }
.dsh-ms-v.up { color: #B7BFA9; }
.dsh-ms-v.down { color: #E5B0A0; }
.dsh-ms-s { font-family: var(--font-mono); font-size: 10.5px; color: rgba(243,240,232,0.6); margin-top: 8px; letter-spacing: 0.03em; }

.dsh-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 12px;
}
.dsh-card-h {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.005em;
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.dsh-hint {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.dsh-pos-h {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin: 12px 0 2px;
}
.dsh-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 820px) { .dsh-grid-2 { grid-template-columns: 1fr; } }

/* Plans table */
.dsh-table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.dsh-search {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--cream-1);
  border-radius: 8px;
  padding: 7px 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--navy);
  min-width: 200px;
}
.dsh-search:focus { outline: none; border-color: var(--navy); }
.dsh-table-wrap { overflow-x: auto; }
.dsh-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dsh-table th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-1);
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.dsh-table th:hover { color: var(--navy); }
.dsh-table th.on { color: var(--navy); }
.dsh-sort { margin-left: 4px; font-size: 8px; color: var(--terra); }
.dsh-table td { padding: 9px 10px; border-bottom: 1px dashed var(--border-soft); color: var(--stone-2); white-space: nowrap; }
.dsh-table td.mono { font-family: var(--font-mono); font-size: 11.5px; color: var(--navy); }
.dsh-table td.mono a { color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--border); }
.dsh-table td.mono a:hover { color: var(--terra); border-color: var(--terra); }
.dsh-table tr.open { background: rgba(220,180,130,0.05); }
.dsh-pnl.pos { color: var(--sage); font-weight: 700; }
.dsh-pnl.neg { color: var(--terra); font-weight: 700; }
.dsh-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.dsh-badge.win { background: rgba(96,108,90,0.16); color: var(--sage); }
.dsh-badge.loss { background: rgba(171,106,87,0.16); color: var(--terra); }
.dsh-badge.open { background: rgba(220,180,130,0.22); color: var(--terra-2); }

/* Full indicator verification sheet (per the SBS verification xlsx) */
.mdf-list { display: flex; flex-direction: column; gap: 18px; }
.mdf-group { }
.mdf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 6px; border-bottom: 1.5px solid var(--terra); margin-bottom: 4px; }
.mdf-mod { font-family: var(--font-display); font-size: 14px; font-weight: 800; color: var(--navy); letter-spacing: 0.01em; }
.mdf-row { display: grid; grid-template-columns: 1.35fr 1.55fr 62px 52px; gap: 8px; padding: 7px 4px; align-items: start; border-bottom: 1px dashed var(--border-soft); }
.mdf-row:last-child { border-bottom: none; }
.mdf-head-row { border-bottom: none; padding-bottom: 2px; }
.mdf-head-row span { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone-1); font-weight: 700; }
.mdf-head-row .c { text-align: center; }
.mdf-ind { font-family: var(--font-sans); font-size: 12px; font-weight: 700; color: var(--navy); line-height: 1.35; }
.mdf-read { font-family: var(--font-mono); font-size: 10.5px; color: var(--stone-2); line-height: 1.45; }
.mdf-stat { text-align: center; font-family: var(--font-mono); font-size: 9px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 4px; border-radius: 4px; height: fit-content; }
.mdf-stat.bull { background: rgba(96,108,90,0.16); color: var(--sage); }
.mdf-stat.bear { background: rgba(171,106,87,0.16); color: var(--terra); }
.mdf-stat.neut { background: rgba(220,180,130,0.22); color: var(--terra-2); }
.mdf-stat.none { background: transparent; color: var(--stone-1); }
.mdf-conf { text-align: center; font-family: var(--font-mono); font-size: 9.5px; font-weight: 800; }
.mdf-conf.high { color: var(--sage); }
.mdf-conf.med { color: var(--mustard); }
.mdf-conf.low { color: var(--terra); }
.mdf-src { font-family: var(--font-mono); font-size: 9.5px; color: var(--stone-1); letter-spacing: 0.04em; margin-top: 4px; }

/* 4-column KPI grid — fills the page width instead of stacking 2-up */
.dsh-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.dsh-kpis .kpi-row { display: contents; }
.dsh-kpis .kpi { margin: 0; }
.dsh-kpis .kpi.hero { grid-column: span 2; }
@media (max-width: 820px) { .dsh-kpis { grid-template-columns: repeat(2, 1fr); } .dsh-kpis .kpi.hero { grid-column: span 2; } }

/* Chart marker / line legend */
.dsh-legend { display: flex; flex-wrap: wrap; gap: 16px; margin: -4px 0 12px; }
.dsh-lg { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--stone-2); }
.dsh-tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.dsh-tri.up { border-bottom: 9px solid; }
.dsh-tri.dn { border-top: 9px solid; }
.dsh-tri.navy { border-bottom-color: var(--navy); }
.dsh-tri.mustard { border-bottom-color: var(--mustard); }
.dsh-tri.sage { border-top-color: var(--sage); }
.dsh-tri.terra { border-top-color: var(--terra); }
.dsh-sw { width: 16px; height: 3px; border-radius: 2px; }
.dsh-sw.sage { background: var(--sage); }
.dsh-sw.mustard { background: var(--mustard); }
.dsh-sw.dash { background: repeating-linear-gradient(90deg, var(--mustard) 0 5px, transparent 5px 9px); }

/* Date-range filter bar */
.dsh-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.dsh-filter-l, .dsh-filter-from { font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--stone-1); }
.dsh-filter-btns { display: inline-flex; gap: 4px; }
.dsh-fbtn { appearance: none; border: 1px solid var(--border); background: var(--cream-1); color: var(--stone-2); font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: all 140ms ease; }
.dsh-fbtn:hover { border-color: var(--navy); color: var(--navy); }
.dsh-fbtn.on { background: var(--navy); color: var(--cream-1); border-color: var(--navy); }
.dsh-fdate { appearance: none; border: 1px solid var(--border); background: var(--cream-1); border-radius: 8px; padding: 5px 10px; font-family: var(--font-mono); font-size: 11px; color: var(--navy); }
.dsh-fdate:focus { outline: none; border-color: var(--navy); }
.dsh-fclear { appearance: none; border: none; background: transparent; color: var(--stone-1); font-size: 16px; cursor: pointer; padding: 0 4px; }
.dsh-fclear:hover { color: var(--terra); }

/* Above/below-target badge on the return chart */
.dsh-target-badge { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.dsh-target-badge.above { background: rgba(96,108,90,0.16); color: var(--sage); }
.dsh-target-badge.below { background: rgba(171,106,87,0.16); color: var(--terra); }

/* Simple footer — logo + copyright only */
.footer-simple {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 14px;
  padding: 22px 20px;
  text-align: left;
}
.footer-logo { display: block; border-radius: 50%; flex: none; }
.footer-copy {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  color: rgba(243,240,232,0.62);
  max-width: none;
}

/* ============================================================
   TRADES TABLE (dashboard page)
   ============================================================ */

.trades-table {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.tt-head, .tt-row {
  display: grid;
  grid-template-columns: 56px 32px 36px 1fr 1fr 1fr;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
}
.tt-head {
  background: var(--cream-1);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone-1);
  border-bottom: 1px solid var(--border);
}
.tt-row {
  background: var(--paper);
  color: var(--navy);
  border-bottom: 1px dashed var(--border);
  text-decoration: none;
  transition: background 0.12s;
}
.tt-row:last-child { border-bottom: 0; }
.tt-row:hover { background: var(--cream-2); }
.tt-row.win .tt-c-pnl { color: var(--pos); font-weight: 600; }
.tt-row.loss .tt-c-pnl { color: var(--neg); font-weight: 600; }
.tt-c-pnl { text-align: right; }
.tt-c-tier, .tt-c-dir { color: var(--stone-1); }
.tt-c-entry, .tt-c-exit { text-align: right; }

/* ============================================================
   GUIDED TOUR overlay
   ============================================================ */

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,34,0.78);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.tour-card {
  background: var(--cream-1);
  border-radius: var(--r-md);
  max-width: 420px;
  width: 100%;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.tour-eb {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 6px;
}
.tour-step-n {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: var(--stone-1);
  font-weight: 400;
  margin-bottom: 8px;
}
.tour-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--navy);
  margin: 0 0 16px;
  text-wrap: pretty;
}
.tour-dots {
  display: flex;
  gap: 5px;
  margin-bottom: 16px;
}
.tour-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.tour-dot.active { background: var(--terra); }
.tour-dot.done { background: var(--stone-1); }
.tour-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tour-skip {
  background: transparent;
  border: none;
  color: var(--stone-1);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 8px 0;
}
.tour-next {
  background: var(--navy);
  color: var(--cream-1);
  border: none;
  padding: 11px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r-sm);
}
.tour-next.final { background: var(--terra); }

/* ============================================================
   STAT SHEET (compact, inline)
   ============================================================ */

.stat-sheet {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px;
  margin-bottom: 12px;
}
.stat-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}
.stat-t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.stat-m {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 11.5px;
}
.stat-row .k {
  color: var(--stone-1);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 9.5px;
  font-weight: 600;
}
.stat-row .v {
  font-family: var(--font-mono);
  color: var(--navy);
  font-weight: 600;
  font-size: 12px;
}
.stat-row .v.pos { color: var(--pos); }
.stat-row .v.neg { color: var(--neg); }

/* ============================================================
   SYSTEM FLOW VISUAL — 5-stage operating loop
   Data → Rulebook → Plan → Order → Review → (feeds back)
   Sequential active-state animation driven by React state.
   ============================================================ */
.system-flow {
  margin: 22px 0 26px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px 14px 14px;
}
.sf-track {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

/* Stage card */
.sf-stage {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 6px;
  opacity: 0.55;
  transition: opacity 0.45s ease;
}
.sf-stage.active {
  opacity: 1;
}
.sf-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: 19px;
  color: var(--navy);
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-top: 10px;
}
.sf-art {
  width: 100%;
  height: 56px;
  background: var(--cream-1);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
  transition: background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease, transform 0.45s ease;
}
.sf-stage.active .sf-art {
  background: var(--cream-3);
  border-color: var(--terra);
  transform: translateY(-2px);
  box-shadow:
    0 0 0 1px var(--terra),
    0 0 0 4px rgba(171,106,87,0.10),
    0 10px 28px rgba(171,106,87,0.22),
    0 0 36px rgba(171,106,87,0.14);
}
.sf-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ----- Glyph base colors (dim) ----- */
.sf-g          { transition: fill 0.45s ease, stroke 0.45s ease, opacity 0.45s ease; }
.sf-g-bar      { fill: var(--stone-1); opacity: 0.7; transform-box: fill-box; transform-origin: center bottom; animation: sfBarBreath 2.4s ease-in-out infinite; }
.sf-g-bar:nth-child(1) { animation-delay: 0s; }
.sf-g-bar:nth-child(2) { animation-delay: 0.13s; }
.sf-g-bar:nth-child(3) { animation-delay: 0.26s; }
.sf-g-bar:nth-child(4) { animation-delay: 0.39s; }
.sf-g-bar:nth-child(5) { animation-delay: 0.52s; }
.sf-g-bar:nth-child(6) { animation-delay: 0.65s; }
.sf-g-bar:nth-child(7) { animation-delay: 0.78s; }
@keyframes sfBarBreath {
  0%, 100% { transform: scaleY(0.78); }
  50%      { transform: scaleY(1.05); }
}
.sf-g-page     { fill: var(--paper);   stroke: var(--stone-1); stroke-width: 1; }
.sf-g-rule     { stroke: var(--stone-1); stroke-width: 1.6; opacity: 0.7; }
.sf-g-level    { stroke: var(--stone-1); stroke-width: 1; opacity: 0.65; fill: none; }
.sf-g-path     { stroke: var(--stone-1); stroke-width: 1.6; opacity: 0.85; stroke-linecap: round; stroke-linejoin: round;
                 stroke-dasharray: 120; animation: sfDrawPath 3s ease-in-out infinite; }
@keyframes sfDrawPath {
  0%   { stroke-dashoffset: 120; opacity: 0; }
  18%  { opacity: 0.85; }
  60%  { stroke-dashoffset: 0;   opacity: 0.85; }
  85%  { opacity: 0.85; }
  100% { stroke-dashoffset: 0;   opacity: 0; }
}
.sf-g-entry    { fill: var(--stone-1); transform-box: fill-box; transform-origin: center; animation: sfEntryPulse 1.8s ease-in-out infinite; }
@keyframes sfEntryPulse {
  0%, 100% { transform: scale(0.85); opacity: 0.7; }
  50%      { transform: scale(1.15); opacity: 1; }
}
.sf-g-base     { stroke: var(--stone-1); stroke-width: 1; opacity: 0.6; }
.sf-g-shaft    { stroke: var(--stone-1); stroke-width: 1.8; opacity: 0.9; stroke-linecap: round;
                 stroke-dasharray: 100; animation: sfDrawShaft 1.7s ease-out infinite; }
@keyframes sfDrawShaft {
  0%   { stroke-dashoffset: 100; opacity: 0; }
  20%  { opacity: 0.9; }
  55%  { stroke-dashoffset: 0;  opacity: 0.9; }
  85%  { opacity: 0.9; }
  100% { stroke-dashoffset: 0;  opacity: 0; }
}
.sf-g-head     { stroke: var(--stone-1); stroke-width: 1.8; opacity: 0.9; stroke-linejoin: round; stroke-linecap: round;
                 animation: sfHeadFlash 1.7s ease-out infinite; }
@keyframes sfHeadFlash {
  0%, 50%  { opacity: 0; }
  56%      { opacity: 1; }
  85%      { opacity: 0.9; }
  100%     { opacity: 0; }
}
.sf-g-fill     { fill: var(--stone-1); transform-box: fill-box; transform-origin: center; animation: sfFillPulse 1.7s ease-out infinite; }
@keyframes sfFillPulse {
  0%, 50%  { transform: scale(0.4); opacity: 0; }
  60%      { transform: scale(1.3); opacity: 1; }
  85%      { transform: scale(1);   opacity: 0.9; }
  100%     { transform: scale(1);   opacity: 0; }
}
.sf-g-ring     { stroke: var(--stone-1); stroke-width: 1.6; opacity: 0.7;
                 stroke-dasharray: 60 30; transform-box: fill-box; transform-origin: center;
                 animation: sfRingScan 5s linear infinite; }
@keyframes sfRingScan {
  to { transform: rotate(360deg); }
}
.sf-g-check    { stroke: var(--stone-1); stroke-width: 2.2; opacity: 0.85; stroke-linecap: round; stroke-linejoin: round;
                 stroke-dasharray: 28; animation: sfCheckDraw 2.5s ease-in-out infinite; }
@keyframes sfCheckDraw {
  0%, 30%  { stroke-dashoffset: 28; opacity: 0; }
  55%      { stroke-dashoffset: 0;  opacity: 1; }
  80%      { opacity: 1; }
  100%     { opacity: 0; }
}

/* Version badge — always terracotta */
.sf-g-badge rect {
  fill: var(--paper);
  stroke: var(--terra);
  stroke-width: 0.6;
}
.sf-g-badge text {
  fill: var(--terra);
  font-family: var(--font-mono);
  font-size: 5.6px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
/* When the Rulebook stage is active, the badge text fades in fresh each tick */
.sf-g-badge.cycling text {
  animation: sfBadgeFade 380ms ease-out;
}
@keyframes sfBadgeFade {
  0%   { opacity: 0; transform: translateY(-1.5px); }
  55%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Rulebook: incoming-data arrow (visible only when stage is active) */
.sf-rb-inflow {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.sf-rb-inflow.on { opacity: 1; }
.sf-g-inflow {
  stroke: var(--terra);
  stroke-width: 1.4;
  fill: none;
  animation: sfFlow 0.85s linear infinite;
}
.sf-g-inflow-arrow {
  stroke: var(--terra);
  stroke-width: 1.4;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Rulebook: small up-chevron above the version badge — "upgraded" cue */
.sf-g-delta {
  stroke: var(--terra);
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: 114px 18px;
  animation: sfDeltaPulse 1.4s ease-in-out infinite;
}
@keyframes sfDeltaPulse {
  0%, 100% { opacity: 0; transform: translateY(2px); }
  50%      { opacity: 1; transform: translateY(-1px); }
}

/* ----- Active state — light up in terracotta ----- */
.sf-stage.active .sf-g-bar    { fill: var(--terra);   opacity: 0.9; }
.sf-stage.active .sf-g-page   { stroke: var(--terra); }
.sf-stage.active .sf-g-rule   { stroke: var(--terra); opacity: 0.85; }
.sf-stage.active .sf-g-level  { stroke: var(--terra); opacity: 0.75; }
.sf-stage.active .sf-g-path   { stroke: var(--terra); opacity: 1; }
.sf-stage.active .sf-g-entry  { fill: var(--terra); }
.sf-stage.active .sf-g-base   { stroke: var(--terra); opacity: 0.7; }
.sf-stage.active .sf-g-shaft  { stroke: var(--terra); opacity: 1; }
.sf-stage.active .sf-g-head   { stroke: var(--terra); opacity: 1; }
.sf-stage.active .sf-g-fill   { fill: var(--terra); }
.sf-stage.active .sf-g-ring   { stroke: var(--terra); opacity: 1; }
.sf-stage.active .sf-g-check  { stroke: var(--terra); opacity: 1; }

/* Connector arrows + flowing particles */
.sf-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  opacity: 0.7;
  transition: opacity 0.45s ease;
}
.sf-link.flow { opacity: 1; }
.sf-link svg {
  width: 22px;
  height: 26px;
  transform: rotate(90deg); /* vertical arrow on mobile */
  overflow: visible;
}
.sf-link-path {
  stroke: var(--stone-1);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  fill: none;
  opacity: 0.55;
  transition: stroke 0.45s ease, opacity 0.45s ease;
}
.sf-link.flow .sf-link-path {
  stroke: var(--terra);
  opacity: 1;
  animation: sfFlow 0.9s linear infinite;
}
.sf-link-arrow {
  stroke: var(--stone-1);
  stroke-width: 1.2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.7;
  transition: stroke 0.45s ease, opacity 0.45s ease;
}
.sf-link.flow .sf-link-arrow { stroke: var(--terra); opacity: 1; }
@keyframes sfFlow {
  to { stroke-dashoffset: -12; }
}

/* Flowing data particles — always on, give the system a "live pipe" feel */
.sf-link-particle {
  fill: var(--terra);
  opacity: 0;
  animation: sfParticle 1.9s linear infinite;
}
.sf-link-particle-2 { animation-delay: 0.63s; }
.sf-link-particle-3 { animation-delay: 1.26s; }
@keyframes sfParticle {
  0%   { transform: translateX(0);    opacity: 0; }
  12%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translateX(66px); opacity: 0; }
}
.sf-link.flow .sf-link-particle { animation-duration: 1.1s; }

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  .sf-stage { opacity: 1; }
  .sf-link  { opacity: 0.7; }
  .sf-g-bar, .sf-g-path, .sf-g-shaft, .sf-g-head, .sf-g-fill,
  .sf-g-ring, .sf-g-check, .sf-g-entry,
  .sf-link.flow .sf-link-path, .sf-link-particle {
    animation: none;
  }
  .sf-g-path, .sf-g-shaft, .sf-g-check { stroke-dashoffset: 0; opacity: 0.85; }
  .sf-g-head { opacity: 0.9; }
  .sf-g-fill { opacity: 0.9; transform: scale(1); }
  .sf-link-particle { opacity: 0; }
}

/* ============================================================
   EVIDENCE CHAIN — the real moat, made visible
   ============================================================ */
.chain-section {
  background: var(--navy-2);
  color: var(--cream-1);
  border-top: 1px solid var(--border);
  padding: 32px 16px 36px;
}
.chain-section .hd-eb { color: var(--mustard); }
.chain-section .hd-h {
  color: var(--cream-1);
}
.chain-section .hd-h em {
  color: var(--mustard);
  font-style: italic;
}
.chain-section .hd-l {
  color: rgba(243,240,232,0.78);
}
.chain-section .hd-l em {
  color: var(--cream-1);
  font-style: italic;
  font-weight: 600;
}

.chain-list {
  list-style: none;
  padding: 0;
  margin: 22px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.chain-node {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: flex-start;
  padding: 10px 0;
}
.chain-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--navy-2);
  background: var(--mustard);
  border-radius: var(--r-sm);
  width: 36px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}
.chain-body {
  padding-bottom: 4px;
}
.chain-t {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--cream-1);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.chain-d {
  font-size: 12px;
  color: rgba(243,240,232,0.62);
  line-height: 1.45;
  margin-top: 3px;
}
.chain-link {
  position: absolute;
  left: 18px;
  top: 32px;
  bottom: -6px;
  width: 1px;
  background: rgba(220,180,130,0.32);
}
.chain-foot {
  font-size: 12.5px;
  color: rgba(243,240,232,0.7);
  line-height: 1.6;
  margin: 12px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(220,180,130,0.22);
}
.chain-foot em {
  color: var(--cream-1);
  font-style: italic;
  font-weight: 600;
}

/* ============================================================
   AUTHOR PULLQUOTE — "I built a system, not a story."
   ============================================================ */
.author-pullquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.3;
  color: var(--navy);
  border-left: 2px solid var(--terra);
  padding: 4px 0 4px 16px;
  margin: 4px 0 18px;
  letter-spacing: -0.01em;
}
.author-pullquote cite {
  display: block;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
}

/* ============================================================
   ANNUAL HURDLE NOTE — in methodology
   ============================================================ */
.annual-note {
  background: var(--cream-3);
  border: 1px solid var(--mustard);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  margin: 16px 0 4px;
}
.annual-note-eb {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terra);
  margin-bottom: 6px;
}
.annual-note-b {
  font-size: 13px;
  color: var(--navy);
  line-height: 1.55;
}
.annual-note-b em {
  font-style: italic;
  color: var(--terra);
}

/* ============================================================
   RESPONSIVE breakpoints
   ============================================================ */

/* Tablet / small desktop */
@media (min-width: 720px) {
  .pad { padding: 28px 24px; }
  .hd-h { font-size: 34px; }
  .kpi-row { grid-template-columns: repeat(4, 1fr); }
  .kpi.hero { grid-column: span 1; }
  .kpi.hero .kpi-v { font-size: 30px; }
  .kpi-triad { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .kpi-triad .kpi.hero { grid-column: span 1; }
  .kpi.kpi-cta { grid-column: span 1; }
  .kpi.kpi-cta .kpi-v { font-size: 21px; }
  .kpi-summary { grid-template-columns: 2fr 1fr; gap: 12px; }
  .kpi-main {
    grid-template-columns: 2fr 1fr 1fr;
    padding: 20px 24px;
    gap: 24px;
  }
  .km-v { font-size: 38px; }
  .km-sub-v { font-size: 26px; }
  .km-cell-sub { padding-left: 22px; }
  .kc-v { font-size: 22px; }
  .dashboard-link { flex-direction: row; align-items: center; gap: 18px; padding: 14px 18px; }
  .dashboard-link .dl-h { flex: 1; font-size: 17px; }
  .dashboard-link .dl-d { flex: 2; }
  .split-hero { grid-template-columns: 1fr 1fr; }
  .sh-left { border-bottom: 0; border-right: 1px solid var(--border); }
  .inputs-grid { grid-template-columns: 1fr 1fr; }
  .kl-row { grid-template-columns: 1fr 160px 1fr; align-items: stretch; gap: 10px; }
  .module-hub-row { grid-template-columns: 1fr 200px 1fr; gap: 14px; }
  .mods.risk { align-items: flex-end; }
  .roadmap { grid-template-columns: 1fr 140px; align-items: center; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 0 24px; }
  .t1-cta { padding: 28px; }
  .t1-cta-h { font-size: 28px; }
  .t1-cta-card { padding: 18px 22px; align-items: center; }
  .t1-cta-btn { width: auto; padding: 12px 22px; }
  .nav { padding: 18px 24px; }
  .logo-mark { width: 48px; height: 48px; }
  .logo-wm .wm-main { font-size: 19px; }
  .logo-wm .wm-sub { font-size: 10px; }
  .system-flow {
    padding: 24px 20px 18px;
    margin: 26px 0 30px;
  }
  .sf-track {
    grid-template-columns: 1fr 36px 1fr 36px 1fr 36px 1fr 36px 1fr;
    align-items: stretch;
    gap: 0;
  }
  .sf-stage { padding: 4px 6px; }
  .sf-title { font-size: 18px; margin-top: 12px; }
  .sf-art { height: 64px; }
  .sf-link svg { transform: none; width: 36px; height: 22px; }
  .chain-section { padding: 48px 24px 52px; }
  .chain-list { margin: 28px 0 22px; }
  .chain-t { font-size: 19px; }
  .author-pullquote { font-size: 26px; padding-left: 20px; }
}

@media (min-width: 1024px) {
  .pad { padding: 36px 28px; }
  .hd-h { font-size: 42px; }
  .ch-title { font-size: 18px; }
  .sel-t { font-size: 19px; }
  .sel-pl-v { font-size: 28px; }
  .kpi-v { font-size: 30px; }
  .kpi.hero .kpi-v { font-size: 36px; }
  .author-avatar { width: 80px; height: 80px; font-size: 34px; }
  .author-name { font-size: 22px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   TRADE PLAN WORKBENCH (tradeplan.jsx)
   Calendar + tab nav + 3 panels
   ============================================================ */
.tpw { margin: 36px 0 28px; }
.tpw-section-h { margin-bottom: 18px; }

/* ---- Selected-plan frame ----
   When a day is selected, ONLY the plan detail below the calendar (header +
   tabs + body) is framed as one module — a faint navy-tinted "area" plus a
   navy ring — with a caret poking up toward the calendar it expanded from.
   The calendar itself stays a plain card outside the frame. */
.tpw-group {
  border-radius: 18px;
}
.tpw-group.has-selection .tpw-details.open {
  position: relative;
  margin-top: 5px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(33, 55, 68, 0.05);
  box-shadow: inset 0 0 0 1.5px var(--navy);
}
/* Caret on top-center of the frame, pointing up at the calendar above. */
.tpw-group.has-selection .tpw-details.open::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 10px solid var(--navy);
}
/* The navy header sits flush at the top of the frame. */
.tpw-group.has-selection .tpw-details.open .splan-head {
  margin-top: 2px;
}

/* ---- Calendar ---- */
.cal-wrap {
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 18px 22px;
  box-shadow: var(--shadow-soft);
}
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.cal-eb {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
}
.cal-legend { display: flex; gap: 12px; font-size: 11px; color: var(--stone-1); }
.cal-nav {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.cal-nav-range {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy);
  font-weight: 700;
  min-width: 92px;
  text-align: center;
}
.cal-nav-btn {
  appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--cream-1);
  color: var(--navy);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 140ms ease, border-color 140ms ease;
}
.cal-nav-btn:hover:not(:disabled) { background: var(--navy); color: var(--cream-1); border-color: var(--navy); }
.cal-nav-btn:disabled { opacity: 0.32; cursor: default; }
.cl-i { display: inline-flex; align-items: center; gap: 4px; }
.cl-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cl-dot.win  { background: var(--sage); }
.cl-dot.loss { background: var(--terra); }
.cl-dot.open { background: var(--mustard); }
.cl-dot.today {
  background: var(--navy);
  box-shadow: 0 0 0 2px rgba(33,55,68,0.18);
}

.cal-months {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 760px) {
  .cal-months { grid-template-columns: 1fr 1fr; gap: 22px; }
}

.cal-month-h {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.cal-dow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 4px;
}
.cal-dow span { padding: 4px 4px; text-align: center; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.cal-cell {
  appearance: none;
  background: var(--paper);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 6px 6px 4px;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  cursor: default;
  font-family: var(--font-sans);
  color: var(--navy);
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.has-plans { cursor: pointer; }
.cal-cell.has-plans:hover { border-color: var(--navy); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.cal-cell.win  { background: rgba(96,108,90,0.26); border-color: rgba(96,108,90,0.55); }
.cal-cell.loss { background: rgba(171,106,87,0.10); border-color: rgba(171,106,87,0.32); }
.cal-cell.open { background: rgba(96,108,90,0.10); border-color: rgba(96,108,90,0.30); }
.cal-cell.flat { background: var(--cream-2); }
.cal-cell.sel { outline: 2px solid var(--navy); outline-offset: -2px; box-shadow: 0 2px 8px rgba(33,55,68,0.20); transform: translateY(-1px); }

/* Market-closed cells (holiday / weekend leakage). Visually muted, not
   clickable. The "closed" sub-label calls out why the day is dim. */
.cal-cell.closed {
  background: repeating-linear-gradient(
    135deg,
    var(--cream-2) 0px,
    var(--cream-2) 6px,
    var(--cream-1) 6px,
    var(--cream-1) 12px
  );
  border-color: var(--border-soft);
  color: var(--stone-1);
  cursor: not-allowed;
}
.cal-cell.closed .cal-d { color: var(--stone-1); opacity: 0.6; }
/* Today's cell — navy outline + small "today" tag in the corner so the user
   always knows where the live edge is, even when the day has no plan yet. */
.cal-cell.today {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy), 0 2px 6px rgba(33,55,68,0.18);
  position: relative;
}
.cal-today-tag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  background: var(--navy);
  color: var(--cream-1);
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.2;
}

/* Dates outside the OHLC window (before the journal started, or after
   the last published day) just render as plain Mon–Fri cells. No striping,
   no "closed" label — those dates were normal trading days, we just don't
   have a plan logged for them. */
.cal-cell.out-of-range {
  background: var(--paper);
  border-color: var(--border-soft);
}

/* Planned · not triggered — a pre-market plan was published, but the setup
   never cleared its activation gate, so no position was taken. Visually the
   most muted of the "something happened" states: no color fill, a dashed
   border (echoing the open/unfilled idea), and a "no trigger" sub-label
   where P&L normally sits. Not clickable — there's no execution to walk. */
.cal-cell.no-trigger {
  background: var(--paper);
  border-style: dashed;
  border-color: var(--stone-2);
  cursor: default;
}
.cal-cell.no-trigger .cal-d { color: var(--stone-1); }
.cal-notrig {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  text-align: center;
  margin-top: auto;
}
.cl-dot.no-trigger {
  background: transparent;
  border: 1.5px dashed var(--stone-1);
  box-sizing: border-box;
}

/* Activated · missed — a published plan whose setup DID trigger, but the fill
   was never logged. Distinct from "no trigger": we use a faint terracotta
   dashed border (the brand's loss/regret hue, kept muted) so it reads as
   "we should have been in this" without shouting. Not clickable. */
.cal-cell.missed {
  background: var(--paper);
  border-style: dashed;
  border-color: rgba(171,106,87,0.45);
  cursor: default;
}
.cal-cell.missed .cal-d { color: var(--terra); opacity: 0.75; }
.cal-missed {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
  text-align: center;
  margin-top: auto;
  opacity: 0.85;
}
.cl-dot.missed {
  background: transparent;
  border: 1.5px dashed var(--terra);
  box-sizing: border-box;
}
.cal-closed {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  text-align: center;
  margin-top: auto;
  opacity: 0.7;
}

/* When any plan is selected, dim every other plan cell so the chosen day
   visually stands out. Without a selection (nothing has .sel inside the
   grid) every cell stays at full opacity — the gray-off is purely an
   "is anything picked?" cue. */
.cal-grid:has(.cal-cell.sel) .cal-cell.has-plans:not(.sel) {
  opacity: 0.38;
  filter: saturate(0.55);
  transition: opacity 200ms ease, filter 200ms ease;
}
.cal-grid:has(.cal-cell.sel) .cal-cell.has-plans:not(.sel):hover {
  opacity: 0.85;
  filter: saturate(1);
}

.cal-d {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-1);
  font-weight: 700;
}
.cal-cell.has-plans .cal-d { color: var(--navy); }
.cal-meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cal-pnl {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.cal-cell.win  .cal-pnl { color: var(--sage); }
.cal-cell.loss .cal-pnl { color: var(--terra); }
.cal-cell.open .cal-pnl { color: var(--sage); }
.cal-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--stone-1);
  letter-spacing: 0.04em;
}

/* ---- Detail panel slide-in / out ---- */
/* Per design feedback: slide left-to-right and make the motion obvious.
   Single transition rule on the base — defining transitions on both .open
   AND .closed causes Chrome to drop the animation when class swaps happen
   in one frame (React commit). One source of truth = one rule. */
.tpw-details {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateX(-140px) scale(0.98);
  margin-top: 0;
  pointer-events: none;
  transition:
    grid-template-rows 560ms cubic-bezier(.22, .9, .32, 1),
    opacity 400ms ease,
    transform 560ms cubic-bezier(.22, .9, .32, 1),
    margin-top 560ms cubic-bezier(.22, .9, .32, 1);
  will-change: transform, opacity, grid-template-rows;
}
.tpw-details.open {
  grid-template-rows: 1fr;
  opacity: 1;
  transform: translateX(0) scale(1);
  margin-top: 18px;
  pointer-events: auto;
}
.tpw-details-inner {
  overflow: hidden;
  min-height: 0;
}

/* Animated arrow connector — removed per design feedback; styles kept neutralised
   in case the markup lingers in older snapshots. */
.splan-arrow { display: none; }

/* ---- Selected plan header ---- */
.splan-head {
  margin: 20px 0 14px;
  padding: 16px 18px;
  background: var(--navy);
  color: var(--cream-1);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
}
.splan-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(243,240,232,0.6);
  font-weight: 700;
  margin-bottom: 6px;
}
.splan-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}
.splan-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--cream-1);
  flex: 1 1 auto;
  min-width: 0;
}
.splan-title-main {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.splan-setup {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: rgba(243,240,232,0.78);
  letter-spacing: 0;
  line-height: 1.45;
  max-width: 60ch;
}
.splan-d { color: var(--cream-1); }
.splan-sep { color: var(--mustard); }
.splan-dir, .splan-tier {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--mustard);
  font-weight: 800;
  letter-spacing: -0.005em;
}
.splan-pnl { text-align: right; }
.splan-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243,240,232,0.6);
  font-weight: 700;
}
.splan-pnl-v {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.splan-pnl.win  .splan-pnl-v { color: #B7BFA9; }
.splan-pnl.loss .splan-pnl-v { color: #E5B0A0; }
.splan-pnl.open .splan-pnl-v { color: var(--mustard); }

.splan-switcher {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(243,240,232,0.12);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.splan-sw-eb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(243,240,232,0.55);
  font-weight: 700;
  margin-right: 4px;
}
.splan-sw-chip {
  appearance: none;
  background: rgba(243,240,232,0.08);
  border: 1px solid rgba(243,240,232,0.22);
  color: var(--cream-1);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.splan-sw-chip:hover { background: rgba(243,240,232,0.16); }
.splan-sw-chip.sel { background: var(--mustard); color: var(--navy); border-color: var(--mustard); }
.splan-sw-chip.win::before  { content: '● '; color: var(--sage); }
.splan-sw-chip.loss::before { content: '● '; color: var(--terra); }
.splan-sw-chip.open::before { content: '● '; color: var(--mustard); }
.splan-sw-chip.sel.win::before, .splan-sw-chip.sel.loss::before, .splan-sw-chip.sel.open::before { color: var(--navy); }

/* ---- Plan stage nav (segmented pill — active stage is a filled navy tab) ---- */
.psn-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px;
  margin-bottom: 14px;
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.psn-stage {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 12px;
  padding: 9px 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  text-align: center;
  color: var(--navy);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.psn-stage:hover { background: rgba(33, 55, 68, 0.05); }
.psn-stage.on {
  background: var(--navy);
  box-shadow: 0 4px 16px rgba(33, 55, 68, 0.24);
}
.psn-stage.on:hover { background: var(--navy); }
.psn-num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--stone-1);
}
.psn-stage.on .psn-num { color: var(--mustard); }
.psn-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--navy);
}
.psn-stage.on .psn-label { color: var(--cream-1); }

/* ---- Tab body ---- */
.tpw-tab-body { margin-top: 4px; }

/* ---- Market data panel ---- */
.md-panel { animation: tpw-fade 240ms ease both; }
.md-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.md-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
}
.md-h { margin-bottom: 12px; }
.md-eb {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
}
.md-t {
  display: block;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 2px;
  letter-spacing: -0.005em;
}
.md-inputs { display: flex; flex-direction: column; gap: 8px; }
.md-input-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr;
  gap: 12px;
  padding: 10px 12px;
  background: var(--cream-1);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
.mdi-label {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}
.mdi-source {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-1);
  margin-top: 2px;
}
.mdi-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mdi-status {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.mdi-status.fresh { background: rgba(96,108,90,0.16); color: var(--sage); }
.mdi-status.stale { background: rgba(171,106,87,0.16); color: var(--terra); }
.mdi-details {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-1);
  text-align: right;
  line-height: 1.4;
}

/* Module verification — grouped, click-to-expand (walkthrough style) */
.mdv-list { display: flex; flex-direction: column; gap: 7px; }
.mdv-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}
.mdv-group.open { border-color: var(--navy); }
.mdv-head {
  appearance: none;
  width: 100%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  text-align: left;
}
.mdv-head:hover { background: rgba(33,55,68,0.04); }
.mdv-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.005em;
}
.mdv-head-r { display: inline-flex; align-items: center; gap: 10px; }
.mdv-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
}
.mdv-badge.bull { background: rgba(96,108,90,0.16); color: var(--sage); }
.mdv-badge.bear { background: rgba(171,106,87,0.16); color: var(--terra); }
.mdv-badge.neut { background: rgba(220,180,130,0.22); color: var(--terra-2); }
.mdv-caret { font-size: 9px; color: var(--stone-1); }
.mdv-detail {
  padding: 10px 13px 13px;
  border-top: 1px solid var(--border-soft);
  background: var(--cream-1);
  max-height: none;
  overflow: visible;
  animation: mdv-acc 200ms ease both;
}
@keyframes mdv-acc {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.mdv-row {
  display: grid;
  grid-template-columns: 1fr 64px 52px;
  gap: 10px;
  align-items: start;
}
.mdv-row-head {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 6px;
}
.mdv-row-head span:nth-child(2),
.mdv-row-head span:nth-child(3) { text-align: center; }
.mdv-read { font-size: 12px; color: var(--stone-2); line-height: 1.5; }
.mdv-stat {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
}
.mdv-stat.bull { color: var(--sage); }
.mdv-stat.bear { color: var(--terra); }
.mdv-stat.neut { color: var(--terra-2); }
.mdv-conf {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}
.mdv-conf.hi { color: var(--sage); }
.mdv-conf.med { color: var(--stone-1); }

/* Market sensor summary card */
.ms-summary { display: flex; flex-direction: column; }
.ms-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 12.5px;
}
.ms-row:last-child { border-bottom: none; }
.ms-k { color: var(--stone-1); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; }
.ms-v { color: var(--navy); font-family: var(--font-display); font-weight: 800; font-size: 16px; }
.ms-v.pos { color: var(--sage); }
.ms-v.neg { color: var(--terra); }
.ms-v.mute { color: var(--stone-1); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.ms-themes {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-theme {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cream-1);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}
.ms-th-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.ms-theme.act .ms-th-dot { background: var(--terra); }
.ms-theme.watch .ms-th-dot { background: var(--mustard); }
.ms-th-l {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--navy);
}
.ms-th-l em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-left: 4px;
}
.ms-theme.act .ms-th-l em { color: var(--terra); }
.ms-th-d {
  font-size: 11.5px;
  color: var(--stone-2);
  margin-top: 2px;
  line-height: 1.45;
}
.ms-go {
  margin-top: 14px;
  width: 100%;
  appearance: none;
  background: var(--navy);
  color: var(--cream-1);
  border: 1px solid var(--navy);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 140ms ease;
}
.ms-go:hover { background: #182935; }
.ms-go-arrow { font-size: 14px; color: var(--mustard); }

/* ---- Market sensor modal ---- */
.msm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,34,0.62);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: tpw-fade 200ms ease;
}
.msm-card {
  background: var(--cream-1);
  border-radius: 12px;
  max-width: 760px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 24px 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.32);
}
.msm-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.msm-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
}
.msm-t {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
  margin-top: 2px;
}
.msm-close {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--stone-1);
  font-size: 24px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.msm-close:hover { color: var(--navy); }
.msm-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-1);
  margin: 8px 0 14px;
  line-height: 1.5;
}
.msm-verdict {
  padding: 12px 14px;
  background: rgba(96,108,90,0.12);
  border-left: 3px solid var(--sage);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--navy);
  margin-bottom: 12px;
}
.msm-alert {
  padding: 10px 14px;
  background: rgba(220,180,130,0.18);
  border-radius: 6px;
  font-size: 12px;
  color: var(--navy);
  margin-bottom: 16px;
}
.msm-section-t {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 6px;
}
.msm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}
.msm-table th {
  text-align: left;
  padding: 8px 8px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 800;
  background: var(--cream-2);
}
.msm-table td {
  padding: 8px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.msm-tk b { font-size: 13px; }
.msm-nm { font-size: 10.5px; color: var(--stone-1); font-style: italic; line-height: 1.3; margin-top: 1px; }
.msm-corr {
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: center;
  border-radius: 4px;
  padding: 4px 6px;
}
.msm-delta {
  font-family: var(--font-mono);
  font-weight: 800;
  text-align: right;
}
.msm-delta.pos { color: var(--sage); }
.msm-delta.neg { color: var(--terra); }
.msm-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stone-1);
}

/* ---- Pre-market plan panel ---- */
.pp-panel { animation: tpw-fade 240ms ease both; }
.pp-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 4px;
}
.pp-col-h {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 0;
  border-bottom: 2px solid;
}
.pp-col-h.risk { color: var(--terra); border-color: var(--terra); }
.pp-col-h.opp  { color: var(--sage);  border-color: var(--sage); }

.pp-kl-row {
  display: grid;
  grid-template-columns: 1fr 160px 1fr;
  gap: 10px;
  align-items: stretch;
  margin: 14px 0;
  transition: grid-template-columns 320ms cubic-bezier(.22,.9,.32,1);
}
.pp-kl-row.with-risk-detail {
  /* Mirror pp-mod-row.with-risk-detail so the KEY LEVEL pill aligns with the
     plan circle below. */
  grid-template-columns: 1.4fr 0.85fr 160px 0.85fr;
}
.pp-kl-row.with-opp-detail {
  grid-template-columns: 0.85fr 160px 0.85fr 1.4fr;
}
.pp-kl-spacer {
  /* Pure grid-cell placeholder. No visible content. */
}
@media (max-width: 720px) {
  .pp-kl-row,
  .pp-kl-row.with-risk-detail,
  .pp-kl-row.with-opp-detail { grid-template-columns: 1fr; }
  .pp-kl-spacer { display: none; }
}
.pp-kl-risk, .pp-kl-opp {
  padding: 12px 14px;
  border-radius: 8px;
  color: var(--cream-1);
}
.pp-kl-risk { background: linear-gradient(95deg, var(--terra), #944F3E); text-align: right; }
.pp-kl-opp  { background: linear-gradient(265deg, var(--sage), #4B5546); text-align: left; }
.pp-kl-eb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.7;
}
.pp-kl-h {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.005em;
  margin: 2px 0;
}
.pp-kl-d {
  font-family: var(--font-mono);
  font-size: 11.5px;
  opacity: 0.85;
}
.pp-kl-hub {
  background: var(--navy);
  color: var(--cream-1);
  border-radius: var(--r-md);
  padding: 12px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.pp-kl-hub-eb {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mustard);
  font-weight: 700;
}
.pp-kl-hub-v {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 2px 0;
  white-space: nowrap;
}
.pp-kl-hub-d {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(243,240,232,0.6);
}

/* "Why this level" briefing — real call-wall / gamma-flip / max-pain context. */
.pp-kl-why {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin: -2px 0 4px;
  padding: 10px 14px;
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pp-kl-why-eb {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mustard-deep, var(--terra));
  font-weight: 700;
}
.pp-kl-why-t { font-size: 12.5px; color: var(--stone-2); line-height: 1.5; }

.pp-mod-row {
  display: grid;
  grid-template-columns: 1fr 160px 1fr;
  gap: 14px;
  align-items: start;
  margin: 18px 0;
}
.pp-mod-row.with-risk-detail {
  /* [detail | risks | plan | opps] */
  grid-template-columns: 1.4fr 0.85fr 160px 0.85fr;
}
.pp-mod-row.with-opp-detail {
  /* [risks | plan | opps | detail] */
  grid-template-columns: 0.85fr 160px 0.85fr 1.4fr;
}
@media (max-width: 880px) {
  .pp-mod-row,
  .pp-mod-row.with-risk-detail,
  .pp-mod-row.with-opp-detail { grid-template-columns: 1fr; }
}

/* Side-panel detail — slides in from the matching side. Risk detail enters
   from the LEFT; opportunity detail enters from the RIGHT. */
.pp-mod-detail-side {
  position: relative;
  align-self: stretch;
  padding: 16px 16px 14px;
  border-radius: 10px;
  border: 1px solid;
  background: var(--paper);
  min-height: 120px;
}
.pp-mod-detail-side.risk {
  background: rgba(171,106,87,0.08);
  border-color: rgba(171,106,87,0.35);
  border-left: 3px solid var(--terra);
}
.pp-mod-detail-side.opp {
  background: rgba(96,108,90,0.08);
  border-color: rgba(96,108,90,0.35);
  border-left: 3px solid var(--sage);
}
.pp-mod-detail-side.left  { animation: pp-detail-slide-l 320ms cubic-bezier(.22,.9,.32,1) both; }
.pp-mod-detail-side.right { animation: pp-detail-slide-r 320ms cubic-bezier(.22,.9,.32,1) both; }

.pp-md-close {
  position: absolute;
  top: 6px;
  right: 8px;
  appearance: none;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--stone-1);
  cursor: pointer;
  padding: 2px 8px;
}
.pp-md-close:hover { color: var(--navy); }
@keyframes pp-detail-slide-l {
  from { opacity: 0; transform: translateX(-40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pp-detail-slide-r {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
.pp-mods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pp-mods.risk { align-items: stretch; text-align: right; }
.pp-mods.opp  { align-items: stretch; text-align: left; }
.pp-mods-h {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 2px;
}
.pp-mods-empty {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-1);
  font-style: italic;
  padding: 6px 0;
}
.pp-mod {
  appearance: none;
  border: 1px solid;
  border-radius: 6px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: transform 140ms ease;
}
/* Risk column sits left of the divider — push label toward the centre. */
.pp-mods.risk .pp-mod { flex-direction: row-reverse; }
.pp-mod:hover { transform: translateY(-1px); }
.pp-mod.risk { background: rgba(171,106,87,0.14); color: var(--terra-2); border-color: rgba(171,106,87,0.4); }
.pp-mod.opp  { background: rgba(96,108,90,0.14);  color: var(--sage);    border-color: rgba(96,108,90,0.4); }
.pp-mod.sel.risk { background: var(--terra); color: var(--cream-1); }
.pp-mod.sel.opp  { background: var(--sage);  color: var(--cream-1); }
.pp-mod-s {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 3px;
}
.pp-mod.sel .pp-mod-s { background: rgba(243,240,232,0.25); color: var(--cream-1); }

/* Vertical divider down the centre of the module row — separates the risk
   items (left) from the opportunity items (right). Kept faint per Tank. */
.pp-mid-divider {
  width: 1px;
  justify-self: center;
  align-self: stretch;
  min-height: 100%;
  background: linear-gradient(180deg, transparent, rgba(33,55,68,0.16) 14%, rgba(33,55,68,0.16) 86%, transparent);
}

.pp-plan-hub {
  background: #5895C7;
  background: linear-gradient(180deg, #6FA8D6, #4A7FAF);
  color: var(--cream-1);
  border-radius: 50%;
  width: 160px;
  height: 160px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(74,127,175,0.32);
}
.pp-plan-eb {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 700;
}
.pp-plan-v {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  margin: 4px 0;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.pp-plan-d {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.85;
}

.pp-mod-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pp-mod-detail {
  margin: 0;
  padding: 11px 13px;
  border-radius: 8px;
  border-left: 3px solid;
  animation: pp-acc 200ms ease both;
  overflow: hidden;
  text-align: left;
}
.pp-mods.risk .pp-mod-detail { text-align: right; border-left: none; border-right: 3px solid; }
@keyframes pp-acc {
  from { opacity: 0; transform: translateY(-6px); max-height: 0; }
  to   { opacity: 1; transform: translateY(0); max-height: 200px; }
}
.pp-mod-detail.risk { background: rgba(171,106,87,0.08); border-left-color: var(--terra); }
.pp-mod-detail.opp  { background: rgba(96,108,90,0.08);  border-left-color: var(--sage); }
.pp-md-eb {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
}
.pp-md-h {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 2px 0 4px;
}
.pp-md-d { font-size: 12.5px; color: var(--stone-2); line-height: 1.5; }

/* TSS bar */
.pp-tss {
  margin: 18px 0;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.pp-tss-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 12px;
}
.pp-tss-bar {
  position: relative;
  display: flex;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: 100%;
  padding: 0;
  appearance: none;
  cursor: pointer;
  transition: box-shadow 140ms ease;
}
.pp-tss-hint {
  float: right;
  color: var(--terra);
  letter-spacing: 0.06em;
}
.pp-tss-detail {
  margin-top: 30px;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid;
  background: var(--cream-1);
  animation: pp-acc 200ms ease both;
}
.pp-tss-detail.risk { border-left-color: var(--terra); }
.pp-tss-detail.opportunity { border-left-color: var(--sage); }
.pp-tss-detail.natural { border-left-color: var(--mustard); }
.pp-tss-detail-h {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.pp-tss-detail-h b { font-size: 16px; font-weight: 800; }
.pp-tss-firm {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--stone-1);
}
.pp-tss-verdict-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.pp-tss-detail-d { font-size: 12.5px; color: var(--stone-2); line-height: 1.55; }
.pp-tss-zone { flex: 1; height: 100%; }
.pp-tss-zone.risk-zone { background: var(--terra); box-shadow: inset -1.5px 0 0 var(--cream-1); }
.pp-tss-zone.nat-zone  { background: rgba(220,180,130,0.95); box-shadow: inset -1.5px 0 0 var(--cream-1); }
.pp-tss-zone.opp-zone  { background: var(--sage); }
.pp-tss-marker {
  position: absolute;
  top: -10px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pp-tss-marker-dot {
  width: 4px;
  height: 60px;
  background: var(--navy);
  border-radius: 2px;
  box-shadow: 0 0 0 3px rgba(33,55,68,0.15);
}
.pp-tss-marker-label {
  position: absolute;
  top: 64px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--navy);
  color: var(--cream-1);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
}
.pp-tss-axis-l, .pp-tss-axis-m, .pp-tss-axis-r {
  position: absolute;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--stone-1);
  font-weight: 700;
  pointer-events: none;
}
/* Clear scale labels BELOW the bar — readable, not overlaid on the colors. */
.pp-tss-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  padding: 0 2px;
}
.pp-tss-sc {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--navy);
  line-height: 1.25;
}
.pp-tss-sc.m { align-items: center; }
.pp-tss-sc.r { align-items: flex-end; text-align: right; }
.pp-tss-sc em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.08em;
}
.pp-tss-sc.l em { color: var(--terra); }
.pp-tss-sc.r em { color: var(--sage); }
.pp-tss-verdict {
  margin-top: 36px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--stone-2);
  padding: 10px 12px;
  border-radius: 6px;
}
.pp-tss-verdict.risk { background: rgba(171,106,87,0.10); }
.pp-tss-verdict.opportunity { background: rgba(96,108,90,0.10); }
.pp-tss-verdict.natural { background: rgba(220,180,130,0.14); }
.pp-tss-verdict b { color: var(--navy); }

/* Markov roadmap */
.pp-roadmap {
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.pp-roadmap-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 10px;
}
.pp-roadmap-bar {
  display: flex;
  height: 40px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.pp-rm-seg {
  appearance: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1px;
  color: var(--cream-1);
  font-family: var(--font-display);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  transition: filter 140ms ease, box-shadow 140ms ease;
}
.pp-rm-pct { font-size: 13px; letter-spacing: -0.01em; line-height: 1; }
.pp-rm-lab {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.9;
  font-weight: 700;
  white-space: nowrap;
}
/* Bearish → bullish spectrum, standardized with the TSS bar.
   Selection mirrors the risk/opportunity modules: faint tint when idle,
   solid tone fill when selected — no navy/black box. */
.pp-rm-seg { color: var(--navy); }
.pp-rm-seg.flush    { background: rgba(158,90,72,0.42); }
.pp-rm-seg.retest   { background: rgba(171,106,87,0.36); }
.pp-rm-seg.drift    { background: rgba(220,180,130,0.55); }
.pp-rm-seg.breakout { background: rgba(96,108,90,0.36); }
.pp-rm-seg:hover { filter: brightness(0.98); }
.pp-rm-seg.sel { color: var(--cream-1); }
.pp-rm-seg.sel.flush    { background: #9E5A48; }
.pp-rm-seg.sel.retest   { background: var(--terra); }
.pp-rm-seg.sel.drift    { background: var(--mustard); color: var(--navy); }
.pp-rm-seg.sel.breakout { background: var(--sage); }

/* Click-to-expand detail card below the roadmap bar */
.pp-rm-hint {
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--cream-1);
  font-size: 12px;
  font-style: italic;
  color: var(--stone-1);
  text-align: center;
}
.pp-rm-detail {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid;
  background: var(--cream-1);
  animation: pp-acc 200ms ease both;
}
.pp-rm-detail.flush    { border-left-color: #9E5A48; }
.pp-rm-detail.retest   { border-left-color: var(--terra); }
.pp-rm-detail.drift    { border-left-color: var(--mustard); }
.pp-rm-detail.breakout { border-left-color: var(--sage); }
.pp-rm-detail-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}
.pp-rm-detail-h b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.01em;
}
.pp-rm-detail-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--stone-1);
}
.pp-rm-detail-d { font-size: 12.5px; color: var(--stone-2); line-height: 1.55; }
.pp-rm-detail-foot {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--stone-1);
}
.pp-rm-foot {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--stone-1);
  line-height: 1.5;
}
/* Raw Markov reading cited verbatim beneath the roadmap bar. Distinct from
   .pp-rm-foot (the editorial read): mono, muted, with a small chart glyph so
   it reads as "source data" rather than narrative. */
.pp-rm-markov {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--stone-1);
  line-height: 1.5;
}
.pp-rm-markov::before {
  content: "▚ ";
  color: var(--mustard);
  font-weight: 700;
}

/* ---- Order execution panel ---- */
.oe-panel { animation: tpw-fade 240ms ease both; }

/* Execution-only placeholder (pre-cutover trades with no analysis cascade) */
.eo-note {
  animation: tpw-fade 240ms ease both;
  padding: 28px 30px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  max-width: 620px;
  margin: 8px auto;
}
.eo-note-eb {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.eo-note-h {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--text-primary);
  margin-bottom: 10px;
}
.eo-note-d {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 18px;
}
.eo-note-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}
.eo-note-facts span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.eo-note-facts b {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: var(--weight-regular);
  margin-bottom: 2px;
}
.oe-chart-top {
  margin-bottom: 16px;
}
.oe-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 880px) {
  /* Chart is now stacked on TOP (full width) per Tank; below it the timeline
     and summary share width 1:1 so the chart is the dominant element. */
  .oe-grid { grid-template-columns: 1.2fr 1fr; }
}
.oe-timeline {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 18px 12px;
}
.oe-step {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 14px;
  padding-bottom: 14px;
  position: relative;
}
.oe-step + .oe-step::before {
  content: '';
  position: absolute;
  left: 11px;
  top: -14px;
  width: 2px;
  height: 14px;
  background: var(--border);
}
.oe-step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--stone-1);
  margin-top: 6px;
  border: 2px solid var(--cream-1);
  box-shadow: 0 0 0 1px var(--border);
}
.oe-step-dot.fire { background: var(--terra); }
.oe-step-dot.win  { background: var(--sage); }
.oe-step-dot.loss { background: var(--terra-2); }
.oe-step-dot.open { background: var(--mustard); animation: oe-pulse 1.6s ease-in-out infinite; }
@keyframes oe-pulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--border), 0 0 0 0 rgba(220,180,130,0.5); }
  50%      { box-shadow: 0 0 0 1px var(--border), 0 0 0 8px rgba(220,180,130,0); }
}
.oe-step-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
}
.oe-step-h {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 2px 0 4px;
  letter-spacing: -0.005em;
}
.oe-step-d {
  font-size: 12.5px;
  color: var(--stone-2);
  line-height: 1.5;
}
.oe-step-d code {
  font-family: var(--font-mono);
  background: var(--cream-2);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--navy);
}
.oe-step-meta {
  margin-top: 6px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--stone-1);
}
.oe-step-meta b { color: var(--navy); margin-right: 3px; }

.oe-summary {
  margin-top: 0;
  align-self: start;
  background: var(--cream-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
}
.oe-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 12.5px;
}
.oe-sum-row:last-child { border-bottom: none; }
.oe-sum-k {
  color: var(--stone-1);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.oe-sum-v { color: var(--navy); font-weight: 700; }
.oe-sum-v.mono { font-family: var(--font-mono); font-size: 12.5px; }
.oe-sum-v.pos  { color: var(--sage); }
.oe-sum-v.neg  { color: var(--terra); }
.oe-sum-v.mute { color: var(--stone-1); font-style: italic; font-weight: 500; }

.oe-right {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 16px 12px;
}
.oe-chart-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.oe-chart-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 700;
}
.oe-chart-t {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.oe-chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-1);
  letter-spacing: 0.04em;
}
.ocl-i { display: inline-flex; align-items: center; gap: 6px; }
.ocl-dot {
  width: 14px;
  height: 2px;
  display: inline-block;
}
.ocl-dot.terra { background: var(--terra); }
.ocl-dot.bear  { background: #B23B2A; }
.ocl-dot.sage  { background: var(--sage); }
.ocl-dot.win   { background: #3F4A3B; }
.ocl-dot.loss  { background: #7D4A3B; }
.ocl-zone {
  width: 16px;
  height: 10px;
  display: inline-block;
  background: rgba(171,106,87,0.18);
  border-top: 1px dashed rgba(171,106,87,0.55);
  border-bottom: 1px dashed rgba(171,106,87,0.55);
}

/* Inner content slide-in animation — fires every time the inner is keyed
   by trade.id, so switching between dates replays the slide. */
.tpw-details-content {
  animation: tpw-content-slide 420ms cubic-bezier(.22, .9, .32, 1) both;
}
@keyframes tpw-content-slide {
  from { opacity: 0; transform: translateX(-80px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Replay toolbar + status */
.mini-nq-wrap { display: flex; flex-direction: column; gap: 8px; }
.mini-nq-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.mini-nq-replay {
  appearance: none;
  background: var(--navy);
  color: var(--cream-1);
  border: 1px solid var(--navy);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 140ms ease;
}
.mini-nq-replay:hover:not(:disabled) { background: #182935; }
.mini-nq-replay:disabled { opacity: 0.4; cursor: not-allowed; }
.mini-nq-replay.live { background: var(--terra); border-color: var(--terra); }
.mini-nq-status {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
}
.mnq-eb {
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 800;
}
.mnq-day { font-size: 11px; color: var(--navy); font-weight: 700; }
.mnq-pnl { font-size: 13px; font-weight: 800; }
.mnq-pnl.pos { color: var(--sage); }
.mnq-pnl.neg { color: var(--terra); }

.mini-nq-stage {
  position: relative;
  width: 100%;
  height: 420px;
  overflow: hidden;
}
.mini-nq-stage .mini-nq { position: absolute; inset: 0; }

/* Planned key-level ZONE — a translucent horizontal band drawn over the
   chart area; corresponds to the plan's entry zone (±25 NQ points). */
.mnq-zone {
  position: absolute;
  left: 0;
  background: rgba(171,106,87,0.16);
  border-top: 1px dashed rgba(171,106,87,0.55);
  border-bottom: 1px dashed rgba(171,106,87,0.55);
  border-left: 1px dashed rgba(171,106,87,0.45);
  pointer-events: none;
  z-index: 1;
}
/* Plan-date marker — vertical line where the key zone begins */
.mnq-planline {
  position: absolute;
  top: 0;
  bottom: 26px;
  width: 0;
  border-left: 1.5px dashed rgba(33,55,68,0.5);
  pointer-events: none;
  z-index: 2;
}
.mnq-planline-lbl {
  position: absolute;
  top: 6px;
  left: 5px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--navy);
  background: rgba(243,240,232,0.9);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.mnq-zone-label {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--terra);
  background: rgba(243,240,232,0.85);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(171,106,87,0.4);
  white-space: nowrap;
}

/* Replay vertical line + dot + floating chip */
.mnq-vline {
  position: absolute;
  top: 0;
  bottom: 22px;
  width: 0;
  border-left: 1px dashed var(--terra);
  pointer-events: none;
  z-index: 2;
}
.mnq-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 0 0 3px rgba(243,240,232,0.8);
}
.mnq-dot.pos { background: var(--sage); }
.mnq-dot.neg { background: var(--terra); }
.mnq-chip {
  position: absolute;
  transform: translate(-50%, 0);
  background: var(--navy);
  color: var(--cream-1);
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 4;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.mnq-chip-d {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
  font-weight: 700;
}
.mnq-chip-v {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.005em;
}
.mnq-chip-v.pos { color: #B7BFA9; }
.mnq-chip-v.neg { color: #E5B0A0; }

/* The hero h2 has a darker-gold "accent" em (for the closing word in copy that
   says "Build your wealth."). Per design feedback the mustard token was too
   pale — switched to a deeper goldenrod that reads against the cream paper. */
.hd-h em.accent {
  font-style: italic;
  color: #A8762E;
  font-weight: 800;
}

@keyframes tpw-fade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PERFORMANCE SNAPSHOT (HomeKpiTriad)
   Dark navy card, mustard accents, 4 tiles
   ============================================================ */
.kpi-snapshot {
  background: linear-gradient(160deg, #1F3340 0%, #182935 60%, #142532 100%);
  border-radius: 16px;
  padding: 28px 28px 22px;
  color: var(--cream-1);
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
  position: relative;
  overflow: hidden;
}
.kpi-snapshot::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(220,180,130,0.06) 0%, rgba(220,180,130,0) 70%);
  pointer-events: none;
}

.kps-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}
.kps-eb {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--mustard);
  margin-bottom: 8px;
}
.kps-t {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cream-1);
  line-height: 1.1;
  margin: 0;
  max-width: 28ch;
}
.kps-t em {
  font-style: italic;
  font-weight: 800;
  color: var(--cream-1);
}
.kps-head-r {
  text-align: right;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: rgba(243,240,232,0.7);
  line-height: 1.6;
  white-space: nowrap;
}
.kps-since {
  color: var(--cream-1);
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-display);
  letter-spacing: -0.005em;
  margin-top: 2px;
}

.kps-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  position: relative;
  z-index: 1;
}
.kps-tile {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(243,240,232,0.10);
  border-radius: 10px;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 160ms ease, border-color 160ms ease;
}
.kps-tile:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(220,180,130,0.30);
}
.kpt-l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mustard);
  font-weight: 800;
}
.kpt-v {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--cream-1);
  line-height: 1.05;
}
.kpt-v.accent { color: var(--mustard); }
.kpt-s {
  font-family: var(--font-sans);
  font-size: 12px;
  color: rgba(243,240,232,0.62);
  line-height: 1.5;
}

/* 4th tile — navigates to the full performance dashboard. Stands out from
   the read-only tiles via a distinct sage tint (Tank: "another color so user
   can see it"). Simplified to label + arrow only. */
.kps-tile-cta {
  text-decoration: none;
  background: linear-gradient(140deg, rgba(96,108,90,0.32), rgba(96,108,90,0.18));
  border-color: rgba(184,200,160,0.55);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 14px;
  text-align: center;
}
.kps-tile-cta:hover {
  background: linear-gradient(140deg, rgba(96,108,90,0.50), rgba(96,108,90,0.28));
  border-color: rgba(184,200,160,0.85);
}
.kpt-cta-label {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--cream-1);
  line-height: 1.1;
}
.kpt-cta-arrow {
  color: #DDE3D5;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  transition: transform 180ms ease;
}
.kps-tile-cta:hover .kpt-cta-arrow { transform: translateX(6px); }

.kps-foot {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(243,240,232,0.55);
  text-decoration: none;
  transition: color 160ms ease;
  position: relative;
  z-index: 1;
}
.kps-foot:hover { color: var(--mustard); }
.kps-foot-arrow {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

@media (min-width: 760px) {
  .kps-tiles { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .kpt-v { font-size: 38px; }
  .kpt-cta-label { font-size: 22px; }
}
@media (min-width: 1024px) {
  .kpi-snapshot { padding: 32px 32px 24px; }
  .kpt-v { font-size: 42px; }
  .kpt-cta-label { font-size: 24px; }
}

/* ============================================================
   MARKET SENSOR PAGE  (market-sensor.html / market-sensor.jsx)
   Reads data/sensor.json — the nightly QQQ Market Sensing output.
   Reuses tokens + .rb-back + .msm-table from existing styles.
   ============================================================ */

.mse-hero {
  background: var(--cream-1);
  border-bottom: 1px solid var(--border);
  padding: 22px 16px 26px;
}
.mse-eb {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 16px 0 10px;
}
.mse-h {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 5.4vw, 42px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy);
  margin: 0 0 14px;
  max-width: 20ch;
  text-wrap: balance;
}
.mse-h em { font-style: italic; font-weight: 400; color: var(--terra); }
.mse-lead {
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--stone-2);
  max-width: 64ch;
  margin: 0 0 18px;
}
.mse-lead b { color: var(--navy); font-weight: 600; }
.mse-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--stone-1);
  border-top: 1px dashed var(--border);
  padding-top: 14px;
}
.mse-meta b {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 9.5px;
  margin-right: 5px;
}

/* verdict banner */
.mse-verdict {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  background: var(--paper);
  box-shadow: var(--shadow-card);
  margin: 18px 0;
}
.mse-verdict.normal { border-left: 4px solid var(--sage); }
.mse-verdict.caution { border-left: 4px solid var(--mustard); }
.mse-verdict.alarm { border-left: 4px solid var(--terra); }
.mse-verdict-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--cream-1);
  flex-shrink: 0;
}
.mse-verdict.normal .mse-verdict-icon { background: var(--sage); }
.mse-verdict.caution .mse-verdict-icon { background: var(--mustard); color: var(--navy); }
.mse-verdict.alarm .mse-verdict-icon { background: var(--terra); }
.mse-verdict-l {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
}
.mse-verdict-h {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: var(--navy);
  margin: 3px 0 5px;
  letter-spacing: -0.01em;
}
.mse-verdict-d {
  font-size: 13px;
  line-height: 1.55;
  color: var(--stone-2);
  max-width: 70ch;
}

/* regime-shift stat row */
.mse-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.mse-stat {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 14px 13px;
}
.mse-stat-v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  color: var(--navy);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.mse-stat-v.pos { color: var(--sage); }
.mse-stat-v.neg { color: var(--terra); }
.mse-stat-v.mute { color: var(--stone-1); font-size: 24px; text-transform: uppercase; letter-spacing: 0.04em; }
.mse-stat-k {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--navy);
  font-weight: 700;
  margin-top: 8px;
}
.mse-stat-s {
  font-size: 11px;
  color: var(--stone-1);
  margin-top: 2px;
}

/* two-column block (maturity + themes) */
.mse-two-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

/* regime maturity card */
.mse-maturity {
  background: var(--cream-3);
  border: 1px solid var(--mustard);
  border-radius: var(--r-lg);
  padding: 16px 16px 15px;
}
.mse-card-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.mse-card-eb {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terra-2);
}
.mse-mat-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: var(--r-pill);
}
.mse-mat-tag.fresh { background: rgba(171,106,87,0.16); color: var(--terra); }
.mse-mat-tag.mature { background: rgba(96,108,90,0.18); color: var(--sage); }
.mse-mat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.mse-mat-cell {
  background: var(--paper);
  padding: 11px 12px;
}
.mse-mat-n {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  color: var(--navy);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.mse-mat-l {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone-1);
  margin-top: 5px;
}
.mse-mat-note {
  font-size: 12px;
  line-height: 1.55;
  color: var(--navy);
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--mustard);
}

/* section title */
.mse-block { margin-bottom: 18px; }
.mse-section-t {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone-1);
  font-weight: 700;
  margin-bottom: 10px;
}

/* theme cards */
.mse-themes { display: flex; flex-direction: column; gap: 9px; }
.mse-theme {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.mse-theme.act { border-left: 3px solid var(--terra); }
.mse-theme.watch { border-left: 3px solid var(--mustard); }
.mse-th-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.mse-theme.act .mse-th-dot { background: var(--terra); }
.mse-theme.watch .mse-th-dot { background: var(--mustard); }
.mse-th-body { flex: 1; min-width: 0; }
.mse-th-l {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
}
.mse-th-l em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--stone-1);
  font-weight: 700;
  margin-left: 6px;
}
.mse-theme.act .mse-th-l em { color: var(--terra); }
.mse-th-d {
  font-size: 12px;
  color: var(--stone-2);
  margin-top: 3px;
  line-height: 1.5;
}
.mse-th-tks { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mse-tk-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: var(--cream-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px 7px;
}

/* movers table */
.mse-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mse-table { min-width: 460px; }
.mse-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--stone-1);
}
.mse-lg-i { display: inline-flex; align-items: center; gap: 6px; }
.mse-lg-sw { width: 14px; height: 14px; border-radius: var(--r-sm); display: inline-block; }

/* feeds-the-plan section */
.mse-feeds {
  background: var(--cream-1);
  border-top: 1px solid var(--border);
  padding: 30px 16px 32px;
}
.mse-steps {
  list-style: none;
  margin: 18px 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.mse-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: start;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 14px;
}
.mse-step-n {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  color: var(--terra);
  background: var(--cream-2);
  border-radius: var(--r-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
}
.mse-step-t { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--navy); }
.mse-step-d { font-size: 12.5px; color: var(--stone-2); margin-top: 3px; line-height: 1.5; }
.mse-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--navy);
  color: var(--cream-1);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  transition: background 140ms ease;
}
.mse-cta:hover { background: #182935; }
.mse-cta-arr { color: var(--mustard); font-size: 15px; }

@media (min-width: 760px) {
  .mse-hero { padding: 26px 32px 30px; }
  .mse-stats { grid-template-columns: repeat(5, 1fr); }
  .mse-two-col { flex-direction: row; align-items: stretch; }
  .mse-two-col > .mse-maturity { flex: 0 0 42%; }
  .mse-two-col > .mse-block { flex: 1; margin-bottom: 0; }
  .mse-steps { grid-template-columns: repeat(2, 1fr); }
  .mse-feeds { padding: 36px 32px 40px; }
}
@media (min-width: 1024px) {
  .mse-steps { grid-template-columns: repeat(4, 1fr); }
}
