/* ╔══════════════════════════════════════════════════════════════════════════════════════════
   DisciplineX — style.css  (Senior Dev Build — index-7 compatible)
   Covers all changes per SENIOR_DEV_ANALYSIS:
     ✓ Card 2 flip animation (5 panels, 5s rotation)
     ✓ Nearest Walls Table moved to Card 2 Panel 4
     ✓ Window pills inline with chart tabs (chart-controls-row)
     ✓ Proximity Hub restored to Image 2-3 design
     ✓ Header sparklines
     ✓ Signal card improved styling
     ✓ All existing functionality preserved
   ╚══════════════════════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   RESET & BASE
   ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 0 0 12px;
  min-height: 100dvh;
}
/* Scroll-lock while any overlay is open — toggled by core/lifecycle.js */
body.cx-scroll-lock { overflow: hidden; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 3px; }

/* ─────────────────────────────────────────────────────────────────
   CSS VARIABLES — DUAL-MODE TOKEN FOUNDATION
   ───────────────────────────────────────────────────────────────── */
:root {
  /* ── Legacy aliases (kept for existing rules) ── */
  --red:       #ef4444;
  --green:     #22c55e;
  --amber:     #f59e0b;
  --blue:      #3b82f6;
  --purple:    #8b5cf6;
  --cyan:      #06b6d4;
  --orange:    #f97316;
  --neon-green:#39FF14;
  --border:    #1e293b;
  --bg1:       #0f172a;
  --bg2:       #0a0f1e;
  --muted:     #64748b;
  --dim:       #475569;
  --text:      #f1f5f9;

  /* ── Semantic surface tokens (dark) ── */
  --bg-base:        #020817;
  --bg-card:        #0f172a;
  --bg-inset:       #0a0f1e;
  --border-subtle:  #1e293b;

  /* ── Semantic text tokens (dark) ── */
  --text-primary:   #f1f5f9;
  --text-label:     rgba(241,245,249,0.4);
  --text-dim:       #64748b;

  /* ── Desaturated accent tokens (chrome / UI) ── */
  --green-soft:     #6fa97f;
  --red-soft:       #c97070;
  --amber-soft:     #a88444;
  --orange-soft:    #b87444;
  --blue-soft:      #5b8dd9;
  --purple-soft:    #8b7ec8;

  /* ── Saturated chart-data tokens (D3, sparklines, candles) ── */
  --green-sat:      #22c55e;
  --red-sat:        #ef4444;
  --amber-sat:      #f59e0b;
  --blue-sat:       #3b82f6;
}

/* Light-mode overrides — only surfaces, text, borders change;
   chart data tokens intentionally stay saturated in both themes */
body.light-theme {
  color-scheme:     light;
  --bg-base:        #f5f0eb;
  --bg-card:        #ede8e3;
  --bg-inset:       #e0dbd5;
  --border-subtle:  #c8c0b8;
  --border:         #c8c0b8;
  --bg1:            #ede8e3;
  --bg2:            #e0dbd5;
  --text-primary:   #1a1612;
  --text-label:     rgba(26,22,18,0.5);
  --text-dim:       #7a6f65;
  --text:           #1a1612;
  --muted:          #7a6f65;
  --dim:            #9a8f85;
}

/* ─────────────────────────────────────────────────────────────────
   UTILITIES
   ───────────────────────────────────────────────────────────────── */
.mono  { font-family: 'JetBrains Mono', monospace; }
.label { font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 5px; }
.val   { font-size: 22px; font-family: 'JetBrains Mono', monospace; font-weight: 700; }

.sub   { font-size: 11px; color: var(--muted); margin-top: 3px; }
.red   { color: var(--red)   !important; }
.green { color: var(--green) !important; }

/* ─────────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────────── */
.btn {
  background: transparent;
  border: 1px solid var(--border);
  color: #94a3b8;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
  min-height: 32px;
  touch-action: manipulation;
}
.btn:hover  { border-color: var(--dim); color: #f1f5f9; background: rgba(255,255,255,.03); }
.btn:active { transform: scale(.97); }
/* ─────────────────────────────────────────────────────────────────
   CARDS
   ───────────────────────────────────────────────────────────────── */
.card      { background: var(--bg1); border: 1px solid var(--border); padding: 10px 12px; border-radius: 6px; }
.card-dark { background: var(--bg2); border: 1px solid var(--border); padding: 16px; border-radius: 6px; margin-bottom: 12px; }

/* ─────────────────────────────────────────────────────────────────
   LIVE DOT & ANIMATIONS
   ───────────────────────────────────────────────────────────────── */
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: blink 2s infinite;
  flex-shrink: 0;
}
@keyframes blink   { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes flash   { 0%,100%{opacity:1} 50%{opacity:.5} }
@keyframes ticker  { 0%{transform:translateX(100%)} 100%{transform:translateX(-100%)} }
@keyframes vault-turn {
  0%, 85% { transform: perspective(800px) rotateY(0deg); }
  100%     { transform: perspective(800px) rotateY(360deg); }
}

/* ─────────────────────────────────────────────────────────────────
   DATA DOTS STRIP
   ───────────────────────────────────────────────────────────────── */
#dataDots {
  display: flex;
  width: 100%;
  height: 3px;
  gap: 1px;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 9999;
  background: var(--bg-base);
  padding: 0 1px;
}

/* ─────────────────────────────────────────────────────────────────
   HEADER — 2-ROW DHAN STYLE
   ───────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}

/* ROW 1: TOP NAV */
.dhan-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 14px;
  border-bottom: 1px solid #1e293b;
  background: #07111a;
  height: 44px;
  flex-shrink: 0;
}
.dn-brand { display: flex; align-items: center; gap: 8px; justify-self: start; }
.dn-brand-logo {
  height: 58px;
  width: 58px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(245,158,11,.4));
}
.dn-logo {
  font-size: 20px; font-weight: 800; letter-spacing: 2px;
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(57,255,20,.35), 0 0 20px rgba(57,255,20,.15);
  font-family: 'JetBrains Mono', monospace;
}
.dn-center {
  display: flex; flex-direction: row; align-items: baseline; gap: 8px;
  white-space: nowrap; min-width: 0; pointer-events: none;
}
.dn-right { display: flex; align-items: center; gap: 8px; justify-self: end; }
.dhan-nav .user-pill      { margin-left: 0; }
/* ROW 2: TICKER STRIP */
.dhan-ticker {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  height: 70px !important;
  max-height: 70px !important;
  min-height: 70px !important;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: #050d18;
  border-bottom: 1px solid #1e293b;
  width: 100%;
}
.dhan-ticker::-webkit-scrollbar { display: none; }

.dt-seg {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center;
  align-items: flex-start;
  padding: 0 14px;
  gap: 2px;
  flex-shrink: 0;
  height: 100%;
}
.dt-seg-label {
  font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted); font-family: 'JetBrains Mono', monospace;
  white-space: nowrap; line-height: 1;
}
.dt-div { width: 1px; background: #1e293b; height: 38px; align-self: center; flex-shrink: 0; }

/* Clock */
.dt-clock-time {
  display: flex; align-items: baseline; gap: 1px;
  font-family: 'JetBrains Mono', monospace; line-height: 1;
}
.dt-hh  { font-size: 16px; font-weight: 700; color: #22c55e; }
.dt-mm  { font-size: 16px; font-weight: 700; color: #22c55e; }
.dt-ss  { font-size: 16px; font-weight: 700; color: #ef4444; }
.dt-colon { font-size: 16px; color: #334155; font-weight: 700; }
.dt-ist { font-size: 10px; color: var(--muted); margin-left: 2px; }
.badge  { font-size: 9px; color: var(--muted); padding: 1px 6px; border: 1px solid var(--border); border-radius: 2px; letter-spacing: .5px; }

/* Controls segment */
/* Bias mini — inline under Nifty spot */
.dt-bias-mini {
  display: flex; align-items: center; gap: 3px; line-height: 1;
}
.dt-bias-sep {
  font-size: 8px; color: #334155;
}
.dt-bias-state {
  font-size: 8px; font-weight: 800; letter-spacing: .8px;
  color: #f59e0b; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; line-height: 1;
}
.dt-bias-num {
  font-size: 8px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace; color: #f59e0b; line-height: 1;
}

/* Spot segment */
.dt-spot { }
.dt-spot-val {
  font-size: 26px; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; color: var(--amber); line-height: 1;
}
.dt-spot-change { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--muted); line-height: 1; }
.dt-session-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .8px;
  color: #475569; font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; padding: 1px 5px; border-radius: 3px;
  background: rgba(71,85,105,.12); border: 1px solid rgba(71,85,105,.25); white-space: nowrap;
}

/* VIX segment */
.dt-vix { min-width: 110px; }
.dt-vix-val    { font-size: 17px; font-family: 'JetBrains Mono', monospace; font-weight: 700; line-height: 1; color: var(--muted); }
.dt-vix-change { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--muted); line-height: 1; }

/* Macro currency segments (USD/INR, DXY) */
.dt-macro { min-width: 105px; }
.dt-macro-val { font-size: 17px; font-family: 'JetBrains Mono', monospace; font-weight: 700; line-height: 1; color: #f1f5f9; }
.dt-macro-chg { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: var(--muted); line-height: 1; white-space: nowrap; }

/* Institutional flow segment */
.dt-flow { min-width: 200px; }
.dt-flow-date { font-size: 9px; color: #64748b; letter-spacing: 0; text-transform: none; margin-left: 4px; font-family: 'JetBrains Mono', monospace; }
.dt-flow-body { display: flex; align-items: center; gap: 12px; margin-top: 2px; }
.dt-flow-rows { display: flex; flex-direction: column; gap: 0; }
.dt-flow-sub  { font-size: 10px; font-family: 'JetBrains Mono', monospace; line-height: 1.5; white-space: nowrap; color: var(--muted); }
.dt-flow-net  { font-size: 17px; font-family: 'JetBrains Mono', monospace; font-weight: 700; line-height: 1; flex-shrink: 0; }

/* Info icon on ticker labels */
.dt-info-icon { font-size: 11px; opacity: 0.65; cursor: default; transition: opacity 150ms; user-select: none; vertical-align: middle; margin-left: 3px; }
.dt-info-icon:hover { opacity: 1; }

/* Macro hover card (singleton) */
.macro-hover-card {
  position: fixed;
  z-index: 9100;
  background: rgba(15,23,42,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 6px;
  padding: 8px 11px;
  max-width: 220px;
  min-width: 160px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.macro-hover-card.mhc-visible {
  opacity: 1;
  transform: translateY(-2px);
}
.mhc-title { font-size: 9px; color: #94a3b8; letter-spacing: .5px; margin-bottom: 5px; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; }
.mhc-line  { font-size: 10px; color: #cbd5e1; font-family: 'JetBrains Mono', monospace; line-height: 1.55; }

/* ─────────────────────────────────────────────────────────────────
   USER PILL & THEME BUTTON
   ───────────────────────────────────────────────────────────────── */
.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 20px; cursor: default;
  vertical-align: middle; transition: all .2s;
}
.user-avatar {
  font-size: 12px; background: var(--bg2); width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--dim);
}
.user-name-text {
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  color: #cbd5e1; font-weight: 600; letter-spacing: .5px;
}
.user-pill:hover { border-color: var(--blue); background: rgba(59,130,246,.15); }

/* ─────────────────────────────────────────────────────────────────
   SEBI COMPLIANCE MARQUEE
   ───────────────────────────────────────────────────────────────── */
.sebi-marquee-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(4,8,15,.85);
  border-bottom: 1px solid rgba(30,41,59,.7);
  height: 20px;
  display: flex;
  align-items: center;
}
.sebi-marquee-track {
  display: flex;
  white-space: nowrap;
  animation: sebiMarquee 55s linear infinite;
}
.sebi-marquee-inner {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: #94a3b8;
  letter-spacing: .35px;
  padding-right: 0;
  flex-shrink: 0;
}
@keyframes sebiMarquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
body.light-theme .sebi-marquee-wrap  { background: var(--bg-inset); border-bottom-color: var(--border-subtle); }
body.light-theme .sebi-marquee-inner { color: var(--text-dim); }

/* ── Phase 2: Header light-theme coverage ── */
body.light-theme .dhan-nav        { background: var(--bg-card); border-bottom-color: var(--border-subtle); }
body.light-theme .dhan-ticker     { background: var(--bg-inset); border-bottom-color: var(--border-subtle); }
body.light-theme .dt-div          { background: var(--border-subtle); }
body.light-theme .dt-seg-label    { color: var(--text-dim); }
body.light-theme .dt-spot-val     { color: #8a6f1e; }
body.light-theme .dt-spot-change  { color: var(--text-dim); }
body.light-theme .dt-vix-val      { color: var(--text-primary); }
body.light-theme .dt-vix-change   { color: var(--text-dim); }
body.light-theme .dt-macro-val    { color: var(--text-primary); }
body.light-theme .dt-macro-chg    { color: var(--text-dim); }
body.light-theme .dt-flow-sub     { color: var(--text-dim); }
body.light-theme .dt-bias-sep     { color: var(--border-subtle); }
body.light-theme .dt-ist          { color: var(--text-dim); }
body.light-theme .badge           { color: var(--text-dim); border-color: var(--border-subtle); }
body.light-theme .dt-session-badge { color: var(--text-dim); background: rgba(120,110,100,.1); border-color: rgba(120,110,100,.2); }
body.light-theme .user-pill       { background: rgba(0,0,0,.05); border-color: var(--border-subtle); }
body.light-theme .user-avatar     { background: var(--bg-inset); border-color: var(--border-subtle); }
body.light-theme .user-name-text  { color: var(--text-primary); }
body.light-theme .user-pill:hover { border-color: var(--blue-soft); background: rgba(91,141,217,.1); }
body.light-theme .user-dropdown-menu { background: var(--bg-card); border-color: var(--border-subtle); box-shadow: 0 10px 32px rgba(0,0,0,.15); }
body.light-theme .user-dropdown-theme { color: var(--text-dim); border-bottom-color: var(--border-subtle); }
body.light-theme .user-dropdown-theme:hover { color: var(--text-primary); background: rgba(0,0,0,.04); }
body.light-theme .macro-hover-card { background: rgba(237,232,227,0.96); border-color: var(--border-subtle); }
body.light-theme .mhc-title       { color: var(--text-dim); }
body.light-theme .mhc-line        { color: var(--text-primary); }
body.light-theme .dn-date         { color: var(--text-dim); }
body.light-theme .dn-sep          { color: var(--border-subtle); }
body.light-theme .dt-drop-btn     { color: var(--text-dim); border-color: var(--border-subtle); }
body.light-theme .dt-drop-btn:hover { color: var(--text-primary); border-color: #9a8f85; background: rgba(0,0,0,.04); }
body.light-theme #dateDisplayBtn.history-mode { border-color: var(--purple-soft); color: var(--purple-soft); background: rgba(139,126,200,.1); }

/* ─────────────────────────────────────────────────────────────────
   REGIME BANNER
   ───────────────────────────────────────────────────────────────── */
.regime-banner {
  display: none;
  padding: 5px 14px;
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
  background: #04080f; text-align: center;
  transition: opacity .3s ease;
}
.regime-banner.show { display: block; }

/* Shared row — #regime-context-banner + the desktop shell's market-context
   chip (see modules/deskShell.js:_relocateTopContextRow), so the two pieces
   of text share one centred line instead of stacking two near-empty ones.
   Desktop-only (the mobile shell never creates #dxTopContextRow and keeps
   .regime-banner's own bar styling as-is when it relocates the banner into
   the narrator panel — see mobile-shell.css). The row itself carries the bar
   chrome so it still renders when the banner has no message (chip-only
   state); .regime-banner is stripped of its own chrome only in this context. */
.dx-top-context-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px 14px;
  border-bottom: 1px solid var(--border);
  background: #04080f;
}
.dx-top-context-row .regime-banner {
  padding: 0;
  border-bottom: none;
  background: none;
  width: auto;
}
/* Divider dot between the banner text and the chip, only when the banner
   actually has a message to show — otherwise the chip sits alone, centred. */
.dx-top-context-row:has(.regime-banner.show) .dx-market-context-chip::before {
  content: '·';
  opacity: .4;
  margin-right: 2px;
}

/* ─────────────────────────────────────────────────────────────────
   ALERT BARS
   ───────────────────────────────────────────────────────────────── */
.warn-bar  { background:#1c1200; border:1px solid #713f12; color:#fbbf24; padding:8px 14px; border-radius:4px; margin-bottom:10px; font-size:12px; display:none; }
.error-bar { background:#1a0a0a; border:1px solid #7f1d1d; color:#fca5a5; padding:10px 14px; border-radius:4px; margin-bottom:12px; font-size:12px; display:none; }

/* ─────────────────────────────────────────────────────────────────
   FIRST-OPEN GUIDE BANNER (B6)
   ───────────────────────────────────────────────────────────────── */
.dx-onboard-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  background: #06140f; border: 1px solid rgba(14,203,129,.28);
  color: #cbd5e1; padding: 10px 14px; border-radius: 4px;
  margin-bottom: 10px; font-size: 12px; line-height: 1.6;
}
.dx-onboard-bar[hidden] { display: none; }
.dx-onboard-txt b { color: #f1f5f9; }
.dx-onboard-txt b.dx-onboard-bull { color: #0ECB81; }
.dx-onboard-txt b.dx-onboard-bear { color: #E63946; }
.dx-onboard-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dx-onboard-show {
  background: rgba(14,203,129,.12); border: 1px solid rgba(14,203,129,.35); color: #0ECB81;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 14px; border-radius: 4px; cursor: pointer; white-space: nowrap;
}
.dx-onboard-show:hover { background: rgba(14,203,129,.2); }
.dx-onboard-skip {
  background: transparent; border: none; color: #64748b;
  font-size: 14px; line-height: 1; padding: 4px 6px; cursor: pointer;
}
.dx-onboard-skip:hover { color: #94a3b8; }

body.light-theme .dx-onboard-bar {
  background: #f0fdf6; border-color: #b9f0d4; color: #334155;
}
body.light-theme .dx-onboard-txt b { color: #0f172a; }
body.light-theme .dx-onboard-show {
  background: rgba(14,203,129,.10); border-color: rgba(14,203,129,.4); color: #0a9d63;
}
body.light-theme .dx-onboard-show:hover { background: rgba(14,203,129,.18); }
body.light-theme .dx-onboard-skip { color: #94a3b8; }
body.light-theme .dx-onboard-skip:hover { color: #475569; }

/* ─────────────────────────────────────────────────────────────────
   CALENDAR
   ───────────────────────────────────────────────────────────────── */
.cal-popup {
  display: none;
  position: fixed; top: 110px;
  background: #0a0f1e; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.9);
  z-index: 999999; width: 300px; user-select: none;
}
.cal-popup.open { display: block; }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-month-label { font-size: 13px; font-weight: 700; color: #f1f5f9; }
.cal-nav {
  background: transparent; border: 1px solid var(--border); color: #94a3b8;
  width: 28px; height: 28px; border-radius: 4px; cursor: pointer;
  font-size: 11px; transition: all .15s;
}
.cal-nav:hover { border-color: var(--dim); color: #f1f5f9; }
.cal-grid-head { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 6px; text-align: center; }
.cal-grid-head span { font-size: 9px; color: var(--dim); letter-spacing: .5px; padding: 3px 0; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cal-day {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 1; border-radius: 6px; cursor: default;
  font-size: 12px; font-family: 'JetBrains Mono', monospace;
}
.cld-has    { background: #0f1f38; color: #94a3b8; cursor: pointer; }
.cld-has:hover { background: #1e3a5f; color: #f1f5f9; }
.cld-no     { color: #334155; }
.cal-legend {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 5px;
}
.cal-legend-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cld-has.cal-legend-dot { background: var(--green); box-shadow: 0 0 4px #22c55e66; }
.cld-no.cal-legend-dot  { background: var(--border); }

/* ─────────────────────────────────────────────────────────────────
   DATE CONTROLS
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   STATS GRID — 3 EQUAL COLUMNS
   ───────────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  grid-template-rows: 1fr;
  gap: 10px;
  margin: 0 12px 12px;
  align-items: stretch;
}

/* ═══════════════════════════════════════════════════════════════════
   CARD 1 — PROXIMITY HUB  (Image 2 & 3 reference design)
   ═══════════════════════════════════════════════════════════════════ */
.prox-card {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 18px 20px;
  border-radius: 8px;
  height: auto;
  overflow: visible;
  transition: border-color 120ms ease, background 120ms ease;
}
.prox-card:hover {
  border-color: var(--muted);
}

/* Card header — no underline; whitespace separates */

/* OI row: CALL OI/RESISTANCE | C/P | PUT OI/SUPPORT */

.prox-oi-val  { font-size: 24px; font-family: 'JetBrains Mono', monospace; font-weight: 800; line-height: 1; }
.prox-oi-delta   { font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 700; line-height: 1.3; margin-top: 4px; }
.prox-wall-delta { font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 600; line-height: 1.3; }
.prox-net-flow   {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.03); border: 1px solid var(--border-subtle);
  border-radius: 4px; padding: 6px 10px; margin: 10px 0 12px;
  font-family: 'JetBrains Mono', monospace;
}
.prox-net-label  { font-size: 11px; letter-spacing: 1.2px; color: var(--text-dim); text-transform: uppercase; flex-shrink: 0; }
.prox-net-val    { font-size: 12px; font-weight: 800; }
.prox-net-bias   { font-size: 11px; color: var(--text-dim); flex: 1; }

.prox-ratio-val   { font-size: 13px; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); font-weight: 700; }

/* OI split bar wrapper */
.prox-bar-wrap { margin-bottom: 8px; flex-shrink: 0; }
.split-bar-bg  { height: 6px; border-radius: 3px; overflow: hidden; background: var(--border); position: relative; margin-top: 4px; }
.split-bar-green { position: absolute; left: 0;  top: 0; height: 100%; background: linear-gradient(90deg,#22c55e,#4ade80); transition: width .7s; border-radius: 3px 0 0 3px; }
.split-bar-red   { position: absolute; right: 0; top: 0; height: 100%; background: linear-gradient(270deg,#ef4444,#f87171); transition: width .7s; border-radius: 0 3px 3px 0; }

/* Heat slider section */
.heat-slider-section { margin: 0 0 6px; flex-shrink: 0; }
.heat-anchors {
  display: grid; grid-template-columns: 1fr auto 1fr;
  gap: 5px; align-items: start; margin-bottom: 6px;
}
.heat-anchor-left  { display: flex; flex-direction: column; gap: 2px; }
.heat-anchor-right { display: flex; flex-direction: column; gap: 2px; text-align: right; align-items: flex-end; }
.heat-anchor-label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); }
.heat-anchor-val   {
  font-size: 24px; font-family: 'JetBrains Mono', monospace;
  font-weight: 900; line-height: 1; letter-spacing: -1px;
}
.heat-anchor-oi   { font-size: 11px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; }
.heat-anchor-dist { font-size: 11px; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.heat-anchor-centre {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding-top: 4px;
}
.heat-spot-val {
  font-size: 13px; font-family: 'JetBrains Mono', monospace;
  font-weight: 700; color: var(--amber); line-height: 1.2;
}

/* Heat bar */
.heat-track {
  position: relative; height: 10px; border-radius: 5px;
  background: linear-gradient(90deg,#22c55e18,#1e293b 40%,#1e293b 60%,#ef444418);
  border: 1px solid #334155; overflow: hidden; margin-bottom: 4px;
}
.heat-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  background: linear-gradient(to right,#22c55e44,#f59e0b55,#ef444444);
  border-radius: 5px; transition: width .7s ease;
}
.heat-marker {
  position: absolute; top: 50%; transform: translate(-50%,-50%);
  z-index: 4; transition: left .7s ease;
}
.heat-marker-pip {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--amber); border: 2px solid #020817;
  box-shadow: 0 0 10px #f59e0baa, 0 0 4px #020817;
}
.heat-legend {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-dim); margin-top: 6px;
}

/* Wall dots */
.wall-dot   { width: 8px; height: 8px; border-radius: 50%; }
.red-dot    { background: var(--red);   box-shadow: 0 0 6px rgba(239,68,68,.6); }
.green-dot  { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,.6); }

/* ── Phase 3: Card 1 Proximity Hub light-theme coverage ── */
body.light-theme .prox-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}
body.light-theme .prox-card:hover { border-color: var(--muted); }

body.light-theme .prox-net-flow   { background: rgba(0,0,0,.04); border-color: rgba(0,0,0,.08); }
body.light-theme .prox-net-label  { color: var(--text-dim); }
body.light-theme .prox-net-bias   { color: var(--text-dim); }

body.light-theme .prox-ratio-val  { color: var(--text-primary); }
body.light-theme .split-bar-bg    { background: var(--border-subtle); }
body.light-theme .heat-anchor-label { color: var(--text-dim); }
body.light-theme .heat-anchor-oi  { color: var(--text-dim); }
body.light-theme .heat-spot-val   { color: #8a6f1e; }
body.light-theme .heat-track {
  background: linear-gradient(90deg,rgba(111,169,127,.25),var(--border-subtle) 40%,var(--border-subtle) 60%,rgba(201,112,112,.25));
  border-color: var(--border-subtle);
}
body.light-theme .heat-fill { background: linear-gradient(to right,rgba(111,169,127,.5),rgba(168,132,68,.4),rgba(201,112,112,.5)); }
body.light-theme .heat-marker-pip { border-color: var(--bg-card); }
body.light-theme .heat-legend     { color: var(--text-dim); }
body.light-theme .wall-dot.red-dot   { box-shadow: 0 0 6px rgba(201,112,112,.5); }
body.light-theme .wall-dot.green-dot { box-shadow: 0 0 6px rgba(111,169,127,.5); }

/* ═══════════════════════════════════════════════════════════════════
   CARD 2 — TREND INDICATORS — 5-PANEL FLIP ANIMATION
   ═══════════════════════════════════════════════════════════════════ */
.card-analytics {
  grid-column: 2; grid-row: 1;
  display: flex; flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-left: 2px solid rgba(139,92,246,.2);
  border-right: 2px solid rgba(139,92,246,.2);
  padding: 10px 12px;
  border-radius: 6px;
  max-height: 380px;
  overflow: hidden;
}

/* Card 2 header */

/* Flip wrapper — contains all 5 panels */
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Panel cell header (used in each panel) */
/* Big metric value */
/* Sparkline labels */
/* PCR badges */
/* IV panel */
/* Cost & Flow panel */
/* IV status badge in panel */

/* ═══════════════════════════════════════════════════════════════════
   CARD 3 — DAILY LEDGER
   ═══════════════════════════════════════════════════════════════════ */

.card-signals {
  grid-column: 3; grid-row: 1;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg,#07111f 0%,#0a1628 100%);
  border: 1px solid rgba(245,158,11,.15);
  padding: 10px 12px;
  border-radius: 6px;
  max-height: 440px;
  overflow: hidden;
  position: relative;
  transition: box-shadow .6s ease;
}

/* Ambient glow — driven by JS class toggle */

/* Header */

/* Filter strip + signal feed — kept for sidebar reuse */
.ticker-filter {
  background: transparent; border: none; color: var(--muted);
  font-size: 10px; font-weight: 600; padding: 4px 10px; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap; letter-spacing: .3px;
}
.ticker-filter:hover  { color: #94a3b8; }
.ticker-filter.active { color: #f1f5f9; border-bottom-color: var(--amber); }
/* Pulse dot */

@keyframes c3PulseAnim {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

/* ── Zone 1: Live Engine ───────────────────────────────────────── */

/* State-driven background glow — pure CSS, zero flash on load */

/* Neutral: barely-there blue pulse (slow breath) */

/* Watch: amber pulse (medium pace) */

/* Bull: green heartbeat */

/* Bear: red heartbeat */

@keyframes c3GlowBreathe {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}
@keyframes c3GlowPulse {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 1;    }
}

/* Live state content */

/* Neutral state */

@keyframes lighthousePulse {
  0%, 100% { opacity: .75; text-shadow: none; }
  50%      { opacity: 1;   text-shadow: 0 0 15px rgba(255,255,255,.4); }
}

/* ── Zone 2: Execution Trail ───────────────────────────────────── */

/* Subway map */

/* Subway node */

/* Excursion / validation tags */

/* SEBI Footer */

/* ── Cockpit (Card 3 redesign) ─────────────────────────────────────────────── */

/* State container */

/* Badge */
.ck-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: 1px; padding: 2px 8px; border-radius: 4px;
  width: fit-content;
}

/* Headline */
.ck-headline {
  font-size: 15px; font-weight: 700; color: #f1f5f9;
  margin: 0; display: flex; align-items: center; gap: 8px;
}
.ck-subline  { font-size: 10px; color: #64748b; margin: 0; }

/* Strength pill inside headline */

/* Reason list (WAIT / REST) */

/* Checklist (WATCH) */

/* Suppression note */

/* READY state details */

/* Live track */

/* Action line */

/* State-level color overrides */

/* ── Footer rail ───────────────────────────────────────────────────── */

/* Shot dots */

/* Amber pulse for WATCH state */

@keyframes pulse-amber {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}

/* ── Execution trail ───────────────────────────────────────────── */

/* cockpitTrail container — capped so it never squashes the state body */

/* ── Phase 4: Card 3 (Cockpit + Signal Feed) light-theme coverage ── */
body.light-theme .card-signals {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-inset) 100%);
  border-color: rgba(168,132,68,.3);
}

body.light-theme .ticker-filter    { color: var(--text-dim); }
/* Badges */

/* Headline + text */
body.light-theme .ck-headline     { color: var(--text-primary); }

body.light-theme .ck-subline      { color: var(--text-dim); }

/* Strength pills */
/* Suppression note */

/* Setup details */

/* Live track */
/* Action line */

/* Footer */

/* Shot dots */

/* Trail */

/* Trail header row with button */

/* ── Today's Signal Log Modal ──────────────────────────────────── */
.sl-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(2,8,23,.75); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.sl-modal {
  background: #0d1525; border: 1px solid #1e293b;
  border-radius: 12px; width: 100%; max-width: 440px;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: sl-slide-in .2s ease;
}
@keyframes sl-slide-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Modal head */
.sl-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid #1e293b; flex-shrink: 0;
}
.sl-modal-title {
  font-size: 14px; font-weight: 700; color: #f1f5f9; letter-spacing: .3px;
}
.sl-modal-sub {
  font-size: 10px; color: #475569; margin-top: 2px;
}
.sl-close-btn {
  background: none; border: none; color: #475569; cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 4px;
  transition: color .15s;
}
.sl-close-btn:hover { color: #f1f5f9; }

/* Summary bar */
.sl-summary-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #0a1120;
  border-bottom: 1px solid #1e293b; flex-shrink: 0;
}
.sl-summary-item { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.sl-sum-num {
  font-size: 18px; font-weight: 700; color: #f1f5f9;
  font-family: 'JetBrains Mono', monospace;
}
.sl-sum-num--win  { color: #94a3b8; }
.sl-sum-num--loss { color: #94a3b8; }
.sl-sum-num--pend { color: #94a3b8; }
.sl-sum-label { font-size: 9px; color: #475569; letter-spacing: .4px; }
.sl-summary-sep {
  width: 1px; height: 28px; background: #1e293b; margin: 0 4px;
}

/* Scrollable body */
.sl-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.sl-empty {
  text-align: center; color: #475569; font-size: 12px;
  padding: 32px 0;
}

/* Signal card */
.sl-card {
  border-radius: 8px; overflow: hidden;
  border: 1px solid #1e293b;
  flex-shrink: 0;
}
.sl-card--suppressed { border-left: 3px solid #1e293b; opacity: .45; }
.sl-card--suppressed:hover { opacity: .65; }

.sl-card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 6px; background: #0a1120;
}
.sl-card-time     { font-size: 11px; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.sl-card-dir      { font-size: 12px; font-weight: 700; }
.sl-card-strength {
  font-size: 9px; font-weight: 600; padding: 1px 6px;
  border-radius: 3px; background: #1e293b; color: #64748b;
}
.sl-card-live {
  font-size: 9px; font-weight: 700; color: #4ade80;
  margin-left: auto; animation: c3PulseAnim 1.5s ease-in-out infinite;
}

.sl-card-spot {
  font-size: 11px; color: #64748b; padding: 6px 12px 0;
}
.sl-card-spot strong { color: #94a3b8; }

/* Outcome */
.sl-outcome {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 12px; margin: 6px 0 0;
  font-size: 11px; line-height: 1.5;
}
.sl-outcome-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.sl-outcome--neutral { color: #94a3b8; background: #1e293b44; }
.sl-outcome--flat    { color: #94a3b8; background: #1e293b44; }
.sl-outcome--live    { color: #94a3b8; background: #1e293b44; }
.sl-outcome--pend    { color: #64748b; background: #1e293b44; }
.sl-outcome strong { font-weight: 700; }

/* Context row */
.sl-card-ctx {
  font-size: 9px; color: #334155; padding: 5px 12px 8px;
  letter-spacing: .3px;
}

/* SEBI line */
.sl-sebi {
  font-size: 8px; color: #1e293b; text-align: center;
  padding: 8px 16px; border-top: 1px solid #0d1525; flex-shrink: 0;
}

/* Light theme */
body.light-theme .sl-modal       { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .sl-modal-head  { border-bottom-color: #f1f5f9; }
body.light-theme .sl-modal-title { color: #0f172a; }
body.light-theme .sl-summary-bar { background: #f8fafc; border-bottom-color: #f1f5f9; }
body.light-theme .sl-sum-num     { color: #0f172a; }
body.light-theme .sl-card        { border-color: #e2e8f0; }
body.light-theme .sl-card-head   { background: #f8fafc; }
body.light-theme .sl-card-spot   { color: #94a3b8; }
body.light-theme .sl-sebi        { color: #cbd5e1; border-top-color: #f1f5f9; }

/* Light theme overrides */
body.light-theme .card-signals    { background: #ffffff; }

@keyframes lighthousePulseDark {
  0%, 100% { opacity: .8;  text-shadow: none; }
  50%      { opacity: 1;   text-shadow: 0 0 12px rgba(15,23,42,.25); }
}

/* Signal row — improved per SENIOR_DEV_ANALYSIS */
.ah-sig-row {
  padding: 7px 10px 7px 10px;
  border-bottom: 1px solid #0d1525;
  border-left: 2px solid transparent;
  transition: background .1s;
  cursor: default;
}
.ah-sig-row:hover { background: #0f1a2e; }

/* Top row inside signal: type + timestamp */
/* ─────────────────────────────────────────────────────────────────
   OI SPLIT UTILITIES (shared)
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   DUAL CHART GRID
   ───────────────────────────────────────────────────────────────── */

/* Chart controls row — tabs + window pills ALL inline */
.chart-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.chart-controls-row > div { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* Chart tabs */
.chart-tab {
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); padding: 5px 12px; border-radius: 4px;
  cursor: pointer; font-size: 11px; font-family: 'DM Sans', sans-serif;
  transition: all .2s; white-space: nowrap; min-height: 32px;
  touch-action: manipulation;
}
.chart-tab:hover  { border-color: var(--dim); color: #94a3b8; }
.chart-tab.active { background: #0f1f3a; border-color: #2563eb; color: #93c5fd; font-weight: 600; }

/* Window pill buttons */
.oiflow-pill {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 9px; border-radius: 4px; cursor: pointer;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); transition: all .15s;
  font-family: 'JetBrains Mono', monospace;
}
.oiflow-pill:hover  { border-color: #475569; color: #94a3b8; }
.oiflow-pill.active { background: #1e293b; border-color: #3b82f6; color: #60a5fa; }

/* Chart canvas area */
.chart-container {
  position: relative; height: 340px;
  background: #07111a; border-radius: 4px; border: 1px solid var(--border);
}
.bchart {
  position: absolute; top: 0; left: 0;
  width: 100% !important; height: 100% !important;
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.bchart.active-chart { opacity: 1; pointer-events: auto; }

/* Chart subtitle */

/* Crossover note — centered overlay inside the chart canvas, low-priority so
   the chart underneath stays readable. */

/* OI Flow legend prefix label */
/* Pulse pill */
/* Animation time label */

/* OI Flow legend */
.oiflow-legend     { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.oiflow-legend-item{ display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--muted); letter-spacing: .3px; }
.oiflow-legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────────
   OPTION CHAIN TABLE
   ───────────────────────────────────────────────────────────────── */

table       { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  position: sticky; top: 0; z-index: 5;
  background: #0a0f1e; box-shadow: 0 1px 0 var(--border);
  padding: 7px 10px; color: var(--muted); font-weight: 600;
  font-size: 10px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
}
td { padding: 6px 10px; border-bottom: 1px solid var(--bg1); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }
tr:hover td   { background: #111827; }

/* ─────────────────────────────────────────────────────────────────
   SIDEBAR
   ───────────────────────────────────────────────────────────────── */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 8000; backdrop-filter: blur(2px);
}
.sig-sidebar {
  position: fixed; top: 0; right: 0; width: 380px;
  max-width: 100vw;
  height: 100vh; height: 100dvh; z-index: 8001;
  background: #07111f; border-left: 1px solid #1d4ed8;
  display: none; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.8);
}
.sig-sidebar.open {
  display: flex;
}
.sidebar-head {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg2); flex-shrink: 0;
}
/* ── System Activity sidebar rows ───────────────────────────────── */
.sa-empty {
  color: var(--muted); font-size: 12px; padding: 20px 14px;
}
.sa-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid #0a1020;
}
.sa-row--suppressed { opacity: .35; }
.sa-row--suppressed:hover { opacity: .5; }

.sa-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}
.sa-dot--dim  { background: #334155; }

.sa-content { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.sa-top     { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.sa-time     { font-size: 10px; color: #64748b; font-family: 'JetBrains Mono', monospace; }
.sa-time--dim { color: #334155; }
.sa-dir      { font-size: 11px; font-weight: 700; }
.sa-dir--dim  { color: #475569; }
.sa-strength  {
  font-size: 8px; font-weight: 600; padding: 1px 5px;
  border-radius: 3px; background: #1e293b; color: #64748b;
}
.sa-strength--dim { opacity: .5; }
.sa-sent {
  font-size: 8px; color: #4ade80; margin-left: auto;
  font-weight: 600; letter-spacing: .3px;
}

.sa-outcome {
  font-size: 10px; padding: 2px 0;
}
.sa-suppress-note {
  font-size: 9px; color: #334155; font-style: italic;
}

/* ── Honesty panel (lifetime record, footer of System Activity) ──── */
.sa-honesty {
  padding: 10px 14px; border-top: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg2);
}
.sa-honesty-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.sa-honesty-title {
  font-size: 9px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--muted); text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.sa-honesty-link {
  font-size: 10px; color: #3b82f6; text-decoration: none;
}
.sa-honesty-link:hover { text-decoration: underline; }
.sa-honesty-stats {
  font-size: 11px; color: #94a3b8; font-family: 'JetBrains Mono', monospace;
}
.sa-h-num  { font-weight: 700; color: #f1f5f9; }
.sa-h-win  { color: #4ade80; }
.sa-h-loss { color: #f87171; }

/* Light theme */
body.light-theme .sa-row        { border-bottom-color: #f1f5f9; }
body.light-theme .sa-time       { color: #94a3b8; }
body.light-theme .sa-strength   { background: #f1f5f9; color: #94a3b8; }
body.light-theme .sa-suppress-note { color: #94a3b8; }
body.light-theme .sa-honesty       { background: #f8fafc; border-top-color: var(--border-subtle); }
body.light-theme .sa-honesty-stats { color: #475569; }
body.light-theme .sa-h-num         { color: #0f172a; }

/* ─────────────────────────────────────────────────────────────────
   SIGNAL HISTORY MODAL
   ───────────────────────────────────────────────────────────────── */
.sig-modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  z-index: 10000; display: none; align-items: flex-start;
  justify-content: center; padding: 40px 16px;
  backdrop-filter: blur(4px);
}
.sig-modal-bg.open { display: flex; }
.sig-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 8px; width: 100%; max-width: 760px;
  max-height: 80vh; max-height: 80dvh;
  display: flex; flex-direction: column; overflow: hidden;
}
.sig-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sig-modal-body { overflow-y: auto; flex: 1; padding: 14px 18px; }

/* ─────────────────────────────────────────────────────────────────
   ALERT DOCK
   ───────────────────────────────────────────────────────────────── */
#alertDock {
  display: none; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 10px;
  background: #07111a; border: 1px solid var(--border);
  border-left: 3px solid var(--amber); border-radius: 6px;
}
/* SD Badge */
.sd-badge { font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 3px; font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

/* ─────────────────────────────────────────────────────────────────
   REPLAY BAR
   ───────────────────────────────────────────────────────────────── */
.replay-bar {
  position: fixed; bottom: 20px; right: 20px; z-index: 9000;
  background: rgba(7,17,31,.95); border: 1px solid #1d4ed8;
  border-radius: 12px; padding: 8px 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.8);
  cursor: grab; user-select: none;
  min-width: 320px; max-width: 420px;
  backdrop-filter: blur(8px);
}
.replay-bar.dragging  { cursor: grabbing; }
.replay-bar.minimised .replay-body { display: none; }
.replay-drag-handle {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px; cursor: grab;
}
.replay-bar.minimised .replay-drag-handle { margin-bottom: 0; }
.replay-title { font-size: 10px; color: #93c5fd; letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; }

.range-wrap { position: relative; height: 20px; display: flex; align-items: center; margin: 4px 0; }
.range-wrap input[type=range] { position: absolute; width: 100%; height: 3px; -webkit-appearance: none; appearance: none; outline: none; background: transparent; pointer-events: none; }
.range-wrap input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; cursor: pointer; pointer-events: all; }
#rangeStart::-webkit-slider-thumb { background: var(--dim); }
#rangeEnd::-webkit-slider-thumb   { background: var(--amber); }
.range-track  { position: absolute; width: 100%; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.range-fill   { position: absolute; height: 100%; background: rgba(59,130,246,.5); border-radius: 2px; }
.range-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--dim); }
.time-tag     { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 1px 6px; border-radius: 3px; border: 1px solid; }
.time-start   { color: #94a3b8; border-color: var(--dim); }
.time-now     { color: var(--green); border-color: #166534; font-weight: 700; }

/* ─────────────────────────────────────────────────────────────────
   FULLSCREEN / ENLARGE CHART PANEL
   ───────────────────────────────────────────────────────────────── */
#chartModalBg { display: none; position: fixed; inset: 0; z-index: 8400; background: rgba(2,8,23,.75); backdrop-filter: blur(6px); }
#chartModalBg.open { display: block; }

.chart-fs-bar { display: none; }

.fs-countdown { font-size: 10px; font-family: 'JetBrains Mono', monospace; color: #ef4444; margin-right: 8px; background: #2d0a0a; border: 1px solid #7f1d1d; padding: 1px 7px; border-radius: 3px; display: none; }

/* ─────────────────────────────────────────────────────────────────
   OPTION CHAIN TABLE AREA
   ───────────────────────────────────────────────────────────────── */
.card-dark + .card-dark { margin-top: 0; }

/* ─────────────────────────────────────────────────────────────────
   LEGACY WALL/PCR ELEMENTS (kept for compat)
   ───────────────────────────────────────────────────────────────── */
.wall-card       { border-left: 3px solid rgba(239,68,68,.2); border-right: 3px solid rgba(34,197,94,.2); }

/* ─────────────────────────────────────────────────────────────────
   THETA / VOL PCR COMPACT (Panel 3)
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   DYN PCR BADGE
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   SNAP COUNT PILL
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   BREAKOUT BANNER
   ───────────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */
@media(max-width:1100px){
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media(max-width:900px){
  .stats-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .prox-card     { grid-column: 1; grid-row: 1; max-height: none; }
  .card-analytics{ grid-column: 2; grid-row: 1; max-height: none; }
  .card-signals  { grid-column: 1 / span 2; grid-row: 2; max-height: 440px; }
  
  .chart-controls-row { gap: 6px; }
}
@media(max-width:680px){
  .stats-grid { grid-template-columns: 1fr; }
  .prox-card, .card-analytics, .card-signals { grid-column: 1; grid-row: auto; max-height: none; }
  .dhan-ticker { height: 70px !important; min-height: 70px !important; max-height: 70px !important; }
  .dt-seg { padding: 9px 10px 0; justify-content: flex-start; }
  .dt-spot-val { font-size: 18px; }
  .dt-hh, .dt-mm, .dt-ss { font-size: 16px; }
  .sig-sidebar { width: 100%; max-width: 100vw; }
  .replay-bar { min-width: unset; width: calc(100vw - 16px); right: 8px; bottom: 8px; left: 8px !important; }
  body.replay-active { padding-bottom: 180px; }
  .chart-controls-row { flex-direction: column; align-items: flex-start; }
  .prox-oi-val    { font-size: 18px !important; }
  .heat-anchor-val{ font-size: 18px !important; }
}
@media(max-width:400px){
  .stats-grid { grid-template-columns: 1fr; }
}

/* Safe area */
@supports(padding-bottom:env(safe-area-inset-bottom)){
  .replay-bar { bottom: calc(8px + env(safe-area-inset-bottom)); }
  body { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.replay-active { padding-bottom: calc(180px + env(safe-area-inset-bottom)); }

  /* Full-screen ceremony / lock overlays must clear the notch and the iOS home
     indicator so dialogs and footer buttons are never occluded. Insets are
     added to the fixed container; the centred dialog inherits the breathing
     room. Harmless on devices that report zero insets. */
  .bx-sos-modal,
  .bx-reminder,
  .cx-ceremony-modal,
  .cx-checkpoint-modal,
  .cx-return-modal,
  .cx-prob-modal,
  .cx-break-modal,
  .cx-verdict-modal,
  .cx-midpoint-modal {
    padding-top:    env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left:   env(safe-area-inset-left);
    padding-right:  env(safe-area-inset-right);
    box-sizing: border-box;
  }
}

/* ─────────────────────────────────────────────────────────────────
   TOUCH TARGETS
   ───────────────────────────────────────────────────────────────── */
@media(max-width:768px){
  .btn,
  .ticker-filter, .chart-tab, .oiflow-pill,
  .cal-nav { min-height: 44px !important; }

  /* ── Row 1 mobile: temporal + user pill inline, discipline pill wraps below ── */
  .dhan-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 4px 10px !important;
    gap: 2px 0 !important;
  }
  .dn-temporal { flex: 1 1 auto; order: 1; }
  .dn-right    { flex: 0 0 auto; order: 2; }
  .dn-center   {
    display: flex !important;
    flex: 0 0 100%;
    order: 3;
    justify-content: center;
    padding: 2px 0 4px;
    pointer-events: auto;
  }
  .bx-tier-pill { display: none !important; }

  /* Row 2 mobile grid layout — moved to redesign.css to win cascade order */
  /* Brand slot scrolls with ticker — no sticky pin on mobile */
  .dt-brand-slot {
    position: static !important;
    left: auto !important;
    z-index: auto !important;
    background: transparent !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    padding: 4px 8px !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
    gap: 2px !important;
    border-right: 1px solid var(--border) !important;
  }
  /* Show title + logo at reduced size */
  .dt-brand-top     { gap: 4px !important; align-items: center !important; justify-content: space-between !important; }
  .dt-brand-inner   { gap: 5px !important; }
  .dn-brand-logo    { height: 28px !important; width: 28px !important; }
  .dn-logo          { font-size: 12px !important; letter-spacing: 0.5px !important; white-space: nowrap !important; }
  .dt-brand-text-col { display: flex !important; }
  .dt-update-info   { font-size: 8px !important; display: block !important; white-space: nowrap !important; }
  /* Stack controls vertically on mobile */
  .dt-direct-controls {
    display: flex !important; flex-direction: column !important;
    gap: 3px !important; flex-shrink: 0 !important; align-items: stretch !important;
  }
  .dt-drop-btn {
    width: auto !important; font-size: 8px !important;
    padding: 2px 5px !important; min-height: 0 !important;
    white-space: nowrap !important; min-width: 0 !important;
  }
}

/* ── Mobile: backdrop is invisible behind fullscreen overlay — remove GPU cost ── */
@media (max-width: 768px) {
  /* Kill blur on all full-viewport overlay backdrops.
     Safe universally — blur is always hidden behind the modal on mobile. */
  .sl-overlay,
  .sidebar-overlay,
  .sig-modal-bg,
  #chartModalBg,
  .pay-modal-bg,
  .bx-frost,
  .bx-reminder,
  .cx-ceremony-backdrop,
  .cx-checkpoint-backdrop,
  .cx-checkin-backdrop,
  .cx-break-backdrop,
  .bx-sos-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Remove dim only for sidebar — confirmed width:100%+height:100dvh on mobile.
     Chart panel is 84vw×82vh (centred), not fullscreen, so it keeps its dark dim. */
  .sidebar-overlay {
    background: transparent !important;
  }
}

/* ─────────────────────────────────────────────────────────────────
   LIGHT THEME
   ───────────────────────────────────────────────────────────────── */
/* body.light-theme root token overrides now live in Phase 0 block near :root */
body.light-theme { color-scheme: light; }
body.light-theme ::-webkit-scrollbar-thumb { background: var(--border-subtle); }

body.light-theme .card      { background: var(--bg-card);  border-color: var(--border-subtle); }
body.light-theme .card-dark { background: var(--bg-inset); border-color: var(--border-subtle); }
/* dhan-nav, dhan-ticker, dt-div, dt-macro-val/chg covered in Phase 2 block */
body.light-theme .dt-colon  { color: var(--border-subtle); }
body.light-theme .dt-flow-net  { color: var(--text-primary); }
/* macro-hover-card, mhc-* covered in Phase 2 block */

/* prox-card, heat-track, split-bar-bg covered in Phase 3 block */

body.light-theme .card-analytics { border-left-color: rgba(139,92,246,.3); border-right-color: rgba(139,92,246,.3); }
/* card-signals covered in Phase 4 block */

/* ah-sig-row, ah-sig-msg covered in Phase 5 block */

/* ticker-filters, ticker-filter covered in Phase 4 block */

body.light-theme .btn { color: var(--text-dim); border-color: var(--border-subtle); background: var(--bg-card); }
body.light-theme .btn:hover { color: var(--text-primary); border-color: var(--text-dim); background: var(--bg-inset); }
body.light-theme .badge     { border-color: #d1dae6; color: #64748b; background: #f1f5f9; }

body.light-theme .chart-container { background: #f8fafc; border-color: #e2e8f0; }
body.light-theme .chart-tab  { color: #64748b; border-color: #d1dae6; background: #ffffff; }
body.light-theme .chart-tab.active { background: #eff6ff; border-color: #3b82f6; color: #2563eb; }
body.light-theme .chart-tab:hover  { color: #0f172a; }
body.light-theme .oiflow-pill { color: #64748b; border-color: #d1dae6; background: #ffffff; }
body.light-theme .oiflow-pill.active { background: #f0f9ff; border-color: #3b82f6; color: #2563eb; }

body.light-theme thead th { background: #f1f5f9; color: #64748b; box-shadow: 0 1px 0 #e2e8f0; }
body.light-theme td       { border-bottom-color: #f8fafc; color: #1e293b; }
body.light-theme tr:hover td   { background: #f8fafc; }

body.light-theme .warn-bar  { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
body.light-theme .error-bar { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }

body.light-theme .sig-sidebar   { background: #ffffff; border-left-color: rgba(59,130,246,.4); }
body.light-theme .sidebar-head  { background: #f8fafc; }
body.light-theme .sidebar-overlay { background: rgba(15,23,42,.25); }

body.light-theme .cal-popup { background: #ffffff; border-color: #e2e8f0; box-shadow: 0 16px 48px rgba(0,0,0,.12); }
body.light-theme .cal-month-label { color: #0f172a; }
body.light-theme .cal-nav   { background: #ffffff; border-color: #e2e8f0; color: #64748b; }
body.light-theme .cld-has   { background: #f0f9ff; color: #1e293b; }
body.light-theme .cld-has:hover { background: #dbeafe; }
body.light-theme .cal-legend { border-top-color: #e2e8f0; }

body.light-theme .replay-bar { background: rgba(255,255,255,.95); border-color: rgba(59,130,246,.4); box-shadow: 0 8px 32px rgba(0,0,0,.12); }
body.light-theme .replay-title { color: #2563eb; }
body.light-theme .range-track  { background: #e2e8f0; }
body.light-theme .regime-banner { background: #f1f5f9; border-bottom-color: #e2e8f0; }
body.light-theme .dx-top-context-row { background: #f1f5f9; border-bottom-color: #e2e8f0; }
body.light-theme .dx-top-context-row .regime-banner { background: none; border-bottom: none; }

body.light-theme .sig-modal    { background: #ffffff; border-color: #e2e8f0; }
body.light-theme .sig-modal-head { border-bottom-color: #e2e8f0; }
body.light-theme #chartModalBg { background: rgba(15,23,42,.4); }

body.light-theme #dataDots { background: var(--bg-inset); }
body.light-theme #alertDock   { background: var(--bg-card); border-color: var(--border-subtle); border-left-color: var(--amber-soft); }
/* ── Phase 5: Lower zone light-theme additions ── */
body.light-theme .chart-container    { background: var(--bg-card) !important; border-color: var(--border-subtle) !important; }

body.light-theme .oiflow-legend-item { color: var(--text-dim); }
body.light-theme .ah-sig-row         { border-bottom-color: var(--border-subtle); color: var(--text-primary); }
body.light-theme .ah-sig-row:hover   { background: var(--bg-inset); }
body.light-theme .sa-row             { border-bottom-color: var(--border-subtle); }
body.light-theme .sa-time            { color: var(--text-dim); }
body.light-theme .sa-time--dim       { color: var(--border-subtle); }
body.light-theme .sa-strength        { background: var(--bg-inset); color: var(--text-dim); }
body.light-theme .sa-suppress-note  { color: var(--text-dim); }

/* ═══════════════════════════════════════════════════════════
   DisciplineX — style_patch.css
   ADD THESE RULES to the END of your style.css file.
   They override/fix the issues below.
   ═══════════════════════════════════════════════════════════ */

/* ── FIX 1: Signal rows — were rendering as stacked blocks ── */
.ah-sig-row {
  display: flex !important;
  gap: 8px !important;
  align-items: flex-start !important;
  padding: 7px 10px !important;
  border-bottom: 1px solid #0d1525 !important;
  cursor: default;
  transition: background .1s;
  min-height: 0 !important;
}
.ah-sig-row:hover { background: #0f1a2e; }
/* ── FIX 2: Card heights ── */
.prox-card,
.card-analytics {
  max-height: 380px !important;
  overflow: hidden !important;
}
.card-signals {
  max-height: 440px !important;
  overflow: hidden !important;
}

/* ── FIX 3: Window pills row — fix spacing so pills don't merge ── */
.chart-controls-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  margin-bottom: 8px !important;
}
.chart-controls-row > div {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
}

/* Window label */
#chartPanelL .chart-controls-row > div:last-child::before {
  content: 'WINDOW:';
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .5px;
  white-space: nowrap;
  margin-right: 2px;
}

.oiflow-pill {
  font-size: 10px !important;
  font-weight: 700 !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  background: transparent !important;
  border: 1px solid var(--border) !important;
  color: var(--muted) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  min-height: 26px !important;
  line-height: 1 !important;
}
.oiflow-pill:hover  { border-color: #475569 !important; color: #94a3b8 !important; }
.oiflow-pill.active { background: #1e293b !important; border-color: #3b82f6 !important; color: #60a5fa !important; }

/* ── FIX 4: OI Flow time badge — always inline with pills ── */
#oiFlowTimeBadge {
  font-size: 9px !important;
  font-family: 'JetBrains Mono', monospace !important;
  background: #1c1200 !important;
  border: 1px solid #713f12 !important;
  color: #f59e0b !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* ── FIX 5: Card 2 combined PCR panel layout ── */
#c2p0 {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}
#c2p0 canvas {
  flex-shrink: 0;
}

/* Light theme overrides */
body.light-theme .ah-sig-row:hover { background: #f8fafc; }
/* ═══════════════════════════════════════════════════════════════
   DisciplineX — style_patch3.css
   APPEND this entire file to the END of style.css
   Fixes: data-dots, card2-flip, calendar, WINDOW×2, charts,
          VIX display, card heights, ticker strip spacing.
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────
   FIX 1: Data-receipt dots
   JS sets className = "ddot received|missed|future"
   but old CSS only had .dot-received/.dot-missed
   ────────────────────────────────────────────── */
.ddot {
  flex: 1;
  height: 3px;
  background: #1e293b;
  border-radius: 1px;
  transition: background .4s;
}
.ddot.received {
  background: #22c55e !important;
  box-shadow: 0 0 4px #22c55e55;
}
.ddot.missed {
  background: #ef4444 !important;
}
.ddot.future {
  background: #1e293b !important;
  opacity: .35;
}

/* ──────────────────────────────────────────────
   FIX 3: Calendar — JS generates classes
   "has-data / today / no-data / disabled / selected"
   but CSS only knew "cld-has / cld-today / cld-no".
   Add matching rules for the JS-generated names.
   ────────────────────────────────────────────── */
.cal-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: default;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  position: relative;
  transition: background .15s;
}
.cal-cell .cal-day-num { line-height: 1; }
.cal-cell .cal-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--green);
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
}
.cal-cell.disabled    { color: #1e293b; pointer-events: none; }
.cal-cell.no-data     { color: #334155; }
.cal-cell.has-data    { background: #0f1f38; color: #94a3b8; cursor: pointer; }
.cal-cell.has-data:hover { background: #1e3a5f; color: #f1f5f9; }
.cal-cell.today       { background: #1c2d10; color: #4ade80; font-weight: 700; cursor: pointer; }
.cal-cell.today .cal-dot { background: #22c55e; }
.cal-cell.selected    {
  background: #1e1040 !important;
  border: 1px solid #7c3aed !important;
  color: #c4b5fd !important;
  font-weight: 700;
}

/* ──────────────────────────────────────────────
   FIX 4: Double "WINDOW:" label
   The style.css patch added a ::before pseudo-element
   AND the HTML already has a <span>WINDOW:</span>.
   Kill the pseudo-element.
   ────────────────────────────────────────────── */
#chartPanelL .chart-controls-row > div:last-child::before {
  content: none !important;
  display: none !important;
}

/* ──────────────────────────────────────────────
   FIX 5: Charts — canvases have inline style="display:none"
   which beats any CSS. Force them block so Chart.js can
   measure dimensions. Visibility controlled by opacity only.
   ────────────────────────────────────────────── */
#oiFlowChart,
#callPutChart {
  display: block !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}
#oiFlowChart.active-chart,
#callPutChart.active-chart {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ──────────────────────────────────────────────
   FIX 6: Ticker strip (header row 2)
   Increase height so NET BIAS gauge + Spot + VIX
   have breathing room and look premium.
   ────────────────────────────────────────────── */
.dhan-ticker {
  height:     70px !important;
  max-height: 70px !important;
  min-height: 70px !important;
  padding: 0 4px;
}
/* Top-align all segment labels at the same height */
.dt-seg { padding: 9px 16px 0; gap: 1px; justify-content: flex-start; }
/* Keep the controls segment (buttons) vertically centred */

/* ──────────────────────────────────────────────
   FIX 7: Card heights
   ────────────────────────────────────────────── */
.prox-card,
.card-analytics {
  max-height: 380px !important;
  min-height: 280px;
  overflow: hidden !important;
}
.card-signals {
  max-height: 440px !important;
  min-height: 280px;
  overflow: hidden !important;
}

/* ──────────────────────────────────────────────
   FIX 8: Window pill row — remove spurious gap
   so the pill strip is flush with chart tabs.
   ────────────────────────────────────────────── */
.chart-controls-row {
  row-gap: 4px !important;
  padding: 4px 0 2px !important;
}

/* ── Light-theme counterparts for calendar cells ── */
body.light-theme .cal-cell.has-data { background: #f0f9ff; color: #1e293b; }
body.light-theme .cal-cell.has-data:hover { background: #dbeafe; }
body.light-theme .cal-cell.today    { background: #dcfce7; }
body.light-theme .cal-cell.selected {
  background: #f3e8ff !important;
  border-color: #7c3aed !important;
  color: #6d28d9 !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   NIFTY 50 segment — mirrors VIX structure exactly; no !important wars
   ═══════════════════════════════════════════════════════════════════════ */

/* Nifty segment A */

/* label inherits base .dt-seg-label (8px, var(--muted)) — same as VIX */

/* Price row — explicit height gives the sparkline real vertical space */
/* Spot price */
.dt-spot-val {
  font-size: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: var(--amber);
  line-height: 1;
  letter-spacing: -0.5px;
}

/* Change — NO !important on color so JS green/red inline style wins */
.dt-spot-change {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  line-height: 1;
}

/* ── Session badge — use data-state instead of inline cssText ── */
.dt-session-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  font-size: 8px !important;
  font-weight: 800 !important;
  letter-spacing: 1.2px !important;
  text-transform: uppercase !important;
  font-family: 'JetBrains Mono', monospace !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  border: 1px solid !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  /* Default / fallback state */
  color: #64748b !important;
  background: rgba(71,85,105,.10) !important;
  border-color: rgba(71,85,105,.25) !important;
  transition: color .3s, background .3s, border-color .3s, box-shadow .3s !important;
}

.dt-session-badge[data-state="TRENDING"] {
  color: #22c55e !important;
  background: rgba(34,197,94,.10) !important;
  border-color: rgba(34,197,94,.4) !important;
  box-shadow: 0 0 8px rgba(34,197,94,.12) !important;
}
.dt-session-badge[data-state="SIDEWAYS"] {
  color: #f59e0b !important;
  background: rgba(245,158,11,.10) !important;
  border-color: rgba(245,158,11,.4) !important;
}
.dt-session-badge[data-state="VOLATILE"] {
  color: #ef4444 !important;
  background: rgba(239,68,68,.10) !important;
  border-color: rgba(239,68,68,.4) !important;
  box-shadow: 0 0 8px rgba(239,68,68,.12) !important;
  animation: flash 1.4s ease-in-out infinite !important;
}
.dt-session-badge[data-state="NEUTRAL"] {
  color: #64748b !important;
  background: rgba(71,85,105,.10) !important;
  border-color: rgba(71,85,105,.25) !important;
}

/* Light-theme badge overrides */
body.light-theme .dt-session-badge[data-state="TRENDING"]  { background: rgba(34,197,94,.08) !important; }
body.light-theme .dt-session-badge[data-state="SIDEWAYS"]  { background: rgba(245,158,11,.08) !important; }
body.light-theme .dt-session-badge[data-state="VOLATILE"]  { background: rgba(239,68,68,.08) !important; }
body.light-theme .dt-session-badge[data-state="NEUTRAL"]   { background: rgba(71,85,105,.06) !important; }

/* ═══════════════════════════════════════════════════════════════
   PATCH — Card 2 2×2 grid + inline chart header
   Append to END of style.css
   ═══════════════════════════════════════════════════════════════ */

/* Increase card heights to fit 2×2 grid */
.prox-card,
.card-analytics,
.card-signals {
  max-height: 340px !important;
  min-height: 280px;
}

/* ── Card 2 panel 0: 2×2 grid ── */
/* PCR Divergence Engine — spans full width */
/* PCR — compact 3-chip row */
/* PCR row — flat inline, no chip boxes */

/* Section cells — transparent, minimal 1px left accent */
/* PCR section — no left border, no padding offset */
/* nth-child overrides removed — sections now use .c2-iv-section and .c2-flow-section */

/* IV section — flex: 1, distributes content evenly top-to-bottom */

/* 3-column CE / AVG / PE layout */

#callIV { color: #f87171 !important; }
#putIV  { color: #4ade80 !important; }
#avgIV  { font-size: 21.25px; color: #f59e0b !important; }

/* IV skew slider — CE on left, PE on right; dot moves toward whichever side is pricier */
.c2-iv-skew {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.c2-iv-skew-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: rgba(241, 245, 249, 0.08);
  border-radius: 1px;
}
.c2-iv-skew-mid {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 1px;
  height: 6px;
  background: rgba(241, 245, 249, 0.18);
  transform: translateX(-50%);
}
.c2-iv-skew-dot {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
  transform: translateX(-50%);
  transition: left .4s cubic-bezier(.4, 0, .2, 1), background-color .3s;
}
/* Cost & Flow sizing now handled by .c2-flow-section in the grid */

/* ── Chart header: single inline row ── */
.chart-controls-row {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
  margin-bottom: 8px !important;
  padding: 2px 0 !important;
}
/* Remove any old pseudo-element "WINDOW:" label */
#chartPanelL .chart-controls-row::before,
#chartPanelL .chart-controls-row > *::before {
  content: none !important;
}

.chart-ctrl-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
  flex-shrink: 0;
  align-self: center;
}
.chart-win-lbl {
  font-size: 9px;
  color: var(--dim);
  letter-spacing: .5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fix: c2p0 active rule must beat the !important from earlier patch */
#c2p0.active {
  display: flex !important;
  flex-direction: column !important;
}

/* Light theme */
/* ── Card 2: 50/50 vertical split ───────────────────────────────────────────── */
.c2-split-body {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 8px;
}

/* LEFT half — 3 sub-cards stacked */
/* PCR strip — panel title + cyan left accent */

/* SPREAD sign coloring — applied by JS via .is-pos / .is-neg modifier */

/* IV section — stacks to content height */

/* Cost & Flow section — fills remaining left-panel height */

/* RIGHT half — Important Timeline */

/* Scrollable event feed — thin 2px scrollbar */

/* Single event row */
/* ═══════════════════════════════════════════════════════════════
   HEADER POLISH — sleek nav row, dropdown profile, sparkline overlay
   ═══════════════════════════════════════════════════════════════ */

/* ── Nav row: tighter height, subtitle flush to logo ── */
.dhan-nav {
  height: 40px !important;
}
/* ── Theme toggle + user pill: match height exactly ── */
.user-pill {
  height: 28px !important;
  padding: 0 10px !important;
  display: inline-flex !important;
  align-items: center !important;
}

/* ── User pill dropdown ── */
.user-pill-dropdown {
  position: relative;
  cursor: pointer;
  user-select: none;
}
.user-pill-chevron {
  font-size: 12px;
  color: var(--text-dim);
  margin-left: 6px;
  transition: transform .2s;
  line-height: 1;
}
.user-pill-dropdown.open .user-pill-chevron {
  transform: rotate(180deg);
}
.user-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #0a0f1e;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  min-width: 110px;
  box-shadow: 0 10px 32px rgba(0,0,0,.85);
  z-index: 10000;
}
.user-pill-dropdown.open .user-dropdown-menu {
  display: block;
}
.user-dropdown-logout {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(239,68,68,.3);
  color: #ef4444;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  letter-spacing: .3px;
  text-align: center;
  transition: all .2s;
}
.user-dropdown-logout:hover {
  background: rgba(239,68,68,.14);
  border-color: #ef4444;
  color: #fca5a5;
}

/* ── Dropdown: full rebuild ── */
.user-dropdown-menu { min-width: 220px !important; padding: 8px !important; }

/* Account info block */
.uda-section {
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.uda-email {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: .2px;
  margin-bottom: 6px;
  word-break: break-all;
}
.uda-plan-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uda-badge {
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 3px;
  padding: 2px 7px;
}
.uda-badge.trial {
  color: var(--amber-soft);
  background: rgba(168,132,68,.12);
  border: 1px solid rgba(168,132,68,.32);
}
.uda-badge.paid {
  color: var(--green-soft);
  background: rgba(111,169,127,.12);
  border: 1px solid rgba(111,169,127,.32);
}
.uda-expiry {
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: .1px;
}

/* Shared menu-item style — applied to all three interactive rows */
.uda-item,
.user-dropdown-menu .user-dropdown-theme,
.user-dropdown-menu .user-dropdown-logout {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  padding: 7px 10px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  font-size: 11px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 500 !important;
  text-align: left !important;
  transition: background .15s !important;
  box-sizing: border-box !important;
  margin-bottom: 2px !important;
}

/* Payment History item */
.uda-item {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
  justify-content: space-between !important;
}
.uda-item:hover { background: rgba(255,255,255,.07) !important; }

/* Theme toggle — override legacy bottom-border-only style */
.user-dropdown-menu .user-dropdown-theme {
  background: transparent !important;
  border: none !important;
  border-bottom: none !important;
  color: var(--text-dim) !important;
  justify-content: space-between !important;
}
.user-dropdown-menu .user-dropdown-theme:hover {
  background: rgba(255,255,255,.07) !important;
  color: var(--text-primary) !important;
}

/* Logout — keep red tint but make it a consistent item shape */
.user-dropdown-menu .user-dropdown-logout {
  background: transparent !important;
  border: none !important;
  border-top: 1px solid rgba(239,68,68,.2) !important;
  border-radius: 0 0 6px 6px !important;
  color: #ef4444 !important;
  letter-spacing: .3px !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  padding-top: 9px !important;
  justify-content: center !important;
}
.user-dropdown-menu .user-dropdown-logout:hover {
  background: rgba(239,68,68,.1) !important;
  color: #fca5a5 !important;
}

.uda-arrow { color: var(--text-dim); font-size: 10px; }
.uda-status-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  margin-right: 6px;
  vertical-align: middle;
}
.uda-status-dot.connected { background: var(--green-soft); }
.uda-status-dot.disconnected { background: var(--red-soft); }
.uda-hidden { display: none !important; }
.uda-sep {
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 4px 0;
}

/* ── Payment History Modal ── */
.pay-modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.72);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.pay-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  width: min(480px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.9);
}
.pay-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.pay-modal-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.01em;
}
.pay-modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.pay-modal-close:hover { color: var(--text-primary); background: rgba(255,255,255,.06); }
.pay-modal-list {
  overflow-y: auto;
  padding: 12px 20px 16px;
  flex: 1;
}
.pay-modal-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}
.pay-modal-loading {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  text-align: center;
  padding: 20px 0;
  letter-spacing: .08em;
}
.pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}
.pay-row:last-child { border-bottom: none; }
.alert-row-warn { border-left: 2px solid var(--red-soft); padding-left: 10px; }
.alert-unread-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--amber-soft);
  margin-right: 5px;
  vertical-align: middle;
}
.pay-row-left { display: flex; flex-direction: column; gap: 3px; }
.pay-row-plan {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -.01em;
}
.pay-row-id {
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: .06em;
}
.pay-row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pay-row-amount {
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--green-soft);
  letter-spacing: .04em;
}
.pay-row-date {
  font-size: 9.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: .06em;
}

.pricing-refund-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin: -6px 0 12px;
}

/* ── Invite & Earn — visible dashboard promo card ── */
.ref-promo-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 10px 0;
}
.ref-promo-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ref-promo-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.ref-promo-sub {
  font-size: 11px;
  color: var(--text-dim);
}
.ref-promo-btn {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #1a1612;
  background: var(--amber);
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: opacity .15s;
}
.ref-promo-btn:hover { opacity: .88; }

/* ── Invite & Earn ── */
.ref-tagline {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 14px;
}
.ref-link-row {
  background: var(--bg-elevated, rgba(255,255,255,.04));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.ref-link-row code {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  letter-spacing: .02em;
  white-space: nowrap;
}
.ref-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.ref-btn {
  flex: 1;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-primary);
  background: var(--bg-elevated, rgba(255,255,255,.04));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.ref-btn:hover { background: rgba(255,255,255,.06); color: var(--text-primary); }
.ref-stats {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: .04em;
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.ref-faq-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  text-align: center;
  cursor: pointer;
  padding: 6px 0;
  transition: color .15s;
}
.ref-faq-toggle:hover { color: var(--text-primary); }
.ref-faq-body {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.ref-faq-item { margin-bottom: 10px; }
.ref-faq-item:last-child { margin-bottom: 0; }
.ref-faq-q {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 2px;
}
.ref-faq-a {
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.5;
  margin: 0;
}
.ref-support-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  letter-spacing: .04em;
  text-decoration: none;
  transition: color .15s;
}
.ref-support-link:hover { color: var(--text-primary); }

/* ── Download my record / Delete my account modals (reuse .ref-* button/tagline styles) ── */
.dx-danger-btn {
  background: rgba(232,89,63,.12) !important;
  border-color: rgba(232,89,63,.35) !important;
  color: #E8593F !important;
}
.dx-danger-btn:hover { background: rgba(232,89,63,.2) !important; }
.dx-danger-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.dx-confirm-input {
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-primary);
  background: var(--bg-elevated, rgba(255,255,255,.04));
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 9px 11px;
  margin: 10px 0 14px;
}
.dx-confirm-input:focus { outline: 1px solid rgba(232,89,63,.5); }
.dx-status-line {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 12px;
  text-align: center;
}
.dx-status-line--ok { color: #6fa97f; }
.dx-status-line--err { color: #E8593F; }
.dx-verify-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}
.dx-verify-badge--pending  { color: #d4a857; background: rgba(212,168,87,.14); }
.dx-verify-badge--verified { color: #6fa97f; background: rgba(111,169,127,.14); }
.dx-verify-badge--rejected { color: #E8593F; background: rgba(232,89,63,.14); }

/* Light-mode overrides */
body.light-theme .user-dropdown-menu { background: var(--bg-card) !important; }
body.light-theme .uda-email { color: var(--text-dim); }
body.light-theme .uda-sep { background: var(--border-subtle); }
body.light-theme .pay-modal-card { background: var(--bg-card); }

/* ── Sparkline wrap: fixed compact width, badge centered over it ── */
.dt-sparkline-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: stretch;
}
#headerSparkline {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 2px;
  opacity: 0.9;
  min-width: 0;
}
/* Session type word centered over sparkline */
.dt-sparkline-wrap .dt-session-badge {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: auto !important;
  height: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(5,13,24,.78) !important;
  border-radius: 3px !important;
  font-size: 8px !important;
  font-weight: 900 !important;
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: 1px !important;
  padding: 2px 6px !important;
  pointer-events: none !important;
  white-space: nowrap !important;
  text-transform: uppercase !important;
}
.dt-sparkline-wrap .dt-session-badge:empty { display: none !important; }

/* Light theme counterparts (moved to Phase 2 block near top) */
body.light-theme .user-dropdown-logout {
  border-color: rgba(220,38,38,.3);
  color: #dc2626;
}
body.light-theme .user-dropdown-logout:hover {
  background: rgba(220,38,38,.08);
  border-color: #dc2626;
  color: #b91c1c;
}

/* Light-theme sparkline overlay — text-shadow only, no background */
body.light-theme .dt-sparkline-wrap .dt-session-badge {
  text-shadow: 0 0 5px rgba(255,255,255,.85), 0 1px 3px rgba(255,255,255,1) !important;
}

/* ── Card 3 Cockpit — Live Pressure Gauge + Freshness + History ────────────── */

/* Freshness dot */

/* Flatline: pause all animations when heartbeat is stale */

/* ── BUILDING state ── */

/* Pressure gauge bar */

@keyframes ck-breathe {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.65; }
}

/* ── TUG OF WAR state ── */

@keyframes ck-tugofwar-vibrate {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-2px) rotate(-.5deg); }
  40%     { transform: translateX(2px) rotate(.5deg); }
  60%     { transform: translateX(-1px); }
  80%     { transform: translateX(1px); }
}

/* ── TODAY'S HISTORY modal bubbles ── */
.hm-bubble {
  display:flex; flex-direction:column; gap:3px;
  padding:9px 12px; border-radius:6px; margin-bottom:6px;
  border-left:3px solid transparent;
}
.hm-bubble--bull     { border-left-color:#4ade80; background:#0a1f10; }
.hm-bubble--bear     { border-left-color:#f87171; background:#1f0a0a; }
.hm-bubble--signal   { border-left-color:#60a5fa; background:#0d1a2e; }
.hm-bubble--open     { border-left-color:#22c55e; background:#061a10; }
.hm-bubble--neutral  { border-left-color:#334155; background:#0d1525; }

.hm-bubble-row1 { display:flex; align-items:center; gap:8px; }
.hm-icon  { font-size:14px; flex-shrink:0; }
.hm-title {
  flex:1; font-size:12px; font-weight:600; color:#e2e8f0;
  letter-spacing:.2px;
}
.hm-bubble--bull .hm-title  { color:#4ade80; }
.hm-bubble--bear .hm-title  { color:#f87171; }
.hm-bubble--open .hm-title  { color:#4ade80; }
.hm-time    { font-size:10px; color:#475569; flex-shrink:0; font-family:'JetBrains Mono',monospace; }
.hm-subtext { font-size:10px; color:#64748b; padding-left:22px; line-height:1.4; }

/* ─────────────────────────────────────────────────────────────────
   BEHAVIORAL OS (DisciplineX Command Center)
   ───────────────────────────────────────────────────────────────── */

.bx-hidden { display: none !important; }

/* Frosted dashboard layer — sits behind the overlay, dims the terminal.
   pointer-events:none (P0 2026-08-30): frost is a visual dim/blur only — it
   must never swallow clicks meant for whatever's underneath it (namely
   #bxChartsGate's CTA, previously unclickable whenever the frost was up
   with no modal open above it). This is deliberately NOT done by raising
   .bx-charts-gate's z-index instead: real cx-* modals sit at z-index
   9000–9200 (see css/lazy/verdict.css, probation.css, vacation.css,
   .cx-ceremony-modal below) — a gate z-index above 9000 would risk painting
   the small banner on top of a legitimately-open full-viewport modal.
   pointer-events:none changes nothing about paint order, so that risk
   doesn't exist. The dashboard's actual interaction lock while gated is
   unaffected — body.bx-charts-gated already sets pointer-events:none
   directly on .stats-grid/.charts-row/etc (below) and real modals bring
   their own backdrop; frost itself never needed to catch clicks. */
.bx-frost {
  position: fixed; inset: 0;
  background: rgba(2,8,23,0.78);
  backdrop-filter: blur(8px) saturate(0.6);
  -webkit-backdrop-filter: blur(8px) saturate(0.6);
  z-index: 9000;
  pointer-events: none;
}

/* When any intercept-chain modal is open, the modal owns its own backdrop.
   Hide the frost to avoid double-dim / blur-on-blur visual mud. */
body:has(.cx-ceremony-modal--open) .bx-frost,
body:has(.cx-return-modal)         .bx-frost,
body:has(.cx-prob-modal)           .bx-frost,
body:has(.cx-verdict-modal)        .bx-frost,
body:has(.cx-vac-modal)            .bx-frost {
  display: none;
}

/* ── Dashboard Chart Gate ────────────────────────────────────────────────────
   Banner inserted before .stats-grid; blurs all live-data sections below.
   Body class bx-charts-gated is set by commandCenter._applyChartGate().
   ─────────────────────────────────────────────────────────────────────────── */

.bx-charts-gate {
  display: flex;
  align-items: center;
  margin: 0 12px 16px;
  padding: 12px 18px;
  background: rgba(2,8,23,0.86);
  border: 1px solid rgba(99,140,200,0.12);
  border-radius: 4px;
}
.bx-charts-gate.bx-hidden { display: none !important; }

/* #dxMarketLockPanel (Phase 3 desktop-shell locked state) is styled/shown by
   css/lazy/deskShell.css, which only loads above the desktop breakpoint.
   Default it hidden here (loaded everywhere) so mobile — where commandCenter.js
   still unhides it via the same bx-charts-gated toggle — never renders it as
   an unstyled block; mobile keeps its own .dxm-panel-analytics blur treatment. */
#dxMarketLockPanel { display: none; }

.bx-gate-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
}
.bx-gate-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #46566f;
  white-space: nowrap;
  flex-shrink: 0;
}
.bx-gate-msg {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #8899aa;
  flex: 1;
  min-width: 0;
}
.bx-gate-cta {
  background: transparent;
  border: 1px solid rgba(99,140,200,0.28);
  border-radius: 3px;
  color: #638cc8;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.bx-gate-cta:hover {
  border-color: rgba(99,140,200,0.55);
  color: #8cb4e8;
}

/* ── Live-market soft nudge (one-tap bypass, NOT a lock) ─────────────────────── */
.bx-gate-live .bx-gate-label {
  color: #6fa97f;                      /* desaturated green — "market is live", not "locked" */
}
.bx-gate-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.bx-gate-live .bx-gate-cta {
  border-color: rgba(111,169,127,0.4);
  color: #7fc090;
}
.bx-gate-live .bx-gate-cta:hover {
  border-color: rgba(111,169,127,0.7);
  color: #9ad6a8;
}
.bx-gate-link {
  background: transparent;
  border: none;
  color: #8899aa;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  white-space: nowrap;
  padding: 4px 2px;
  transition: color 0.15s;
}
.bx-gate-link:hover { color: #c3d0de; }

/* Stack the nudge on narrow screens so the one-tap CTA stays reachable */
@media (max-width: 640px) {
  .bx-gate-live.bx-gate-inner { flex-wrap: wrap; gap: 8px 12px; }
  .bx-gate-actions { width: 100%; justify-content: space-between; }
}

/* Blur all live-data sections when gated */
body.bx-charts-gated > .stats-grid,
body.bx-charts-gated > #dxBeforeYouTradeRow,
body.bx-charts-gated > .charts-row,
body.bx-charts-gated > #instCarousel,
body.bx-charts-gated > .nd-ocs-row {
  opacity: 0.07;
  pointer-events: none;
  user-select: none;
  filter: blur(5px);
  transition: opacity 0.3s, filter 0.3s;
}

/* Mobile: blur the analytics tab panel when gated */
body.bx-charts-gated .dxm-panel-analytics {
  opacity: 0.07;
  pointer-events: none;
  filter: blur(5px);
}

/* Light mode */
body.light-theme .bx-charts-gate {
  background: rgba(245,240,235,0.92);
  border-color: rgba(59,100,180,0.10);
}
body.light-theme .bx-gate-label { color: #9aaabb; }
body.light-theme .bx-gate-msg   { color: #5a6a7d; }
body.light-theme .bx-gate-cta   {
  border-color: rgba(59,100,180,0.28);
  color: #3b64b4;
}
body.light-theme .bx-gate-cta:hover {
  border-color: rgba(59,100,180,0.55);
  color: #2a4f9e;
}

/* Centered overlay */
.bx-card {
  width: min(1080px, 72vw);
  max-height: 92vh;
  overflow-y: auto;
  background: #0a0f1e;
  border: 1px solid #1e293b;
  border-radius: 4px;
  padding: 28px 32px 24px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 24px 48px rgba(0,0,0,0.6);
  font-family: 'DM Sans', sans-serif;
  color: #f1f5f9;
}

.bx-card-head {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #1e293b;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.bx-card-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 3px;
  color: #cbd5e1;
}
.bx-skip {
  background: transparent;
  border: 1px solid #1e293b;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 10px;
  cursor: pointer;
  border-radius: 2px;
}
.bx-skip:hover { color: #cbd5e1; border-color: #334155; }

/* SYS_LOG line */
.bx-syslog {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-left: 2px solid;
  margin-bottom: 18px;
  background: rgba(15,23,42,0.6);
}
.bx-syslog-info { color: #94a3b8; border-color: #475569; }
.bx-syslog-warn { color: #fbbf24; border-color: #f59e0b; }

@media (max-width: 720px) {
  .bx-card { width: 92vw; padding: 20px; }
}

.bx-section { margin-bottom: 18px; }
.bx-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 8px;
}

.bx-pill {
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #cbd5e1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  padding: 8px 14px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.bx-pill:hover { border-color: #334155; color: #f1f5f9; }
.bx-pill-active {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}
.bx-pill-wide { width: 100%; text-align: left; padding: 10px 14px; }

/* Agreement block — visually heavier per §8.
   Treated as a signing surface: darker background, harsher border,
   thin inner shadow + top accent so the eye reads it as a contract. */
/* Discipline Mirror — right column, locked panels */

.bx-mirror-title { color: #94a3b8; margin-bottom: 14px; }
.bx-mirror-panel {
  border: 1px dashed #1e293b;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 2px;
  background: rgba(15,23,42,0.4);
}
.bx-mirror-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #64748b;
  margin-bottom: 6px;
}
.bx-mirror-locked {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #475569;
  letter-spacing: 0.5px;
}

/* Live engine panels (Phase 4) */
.bx-mirror-host { display: block; }
.bx-mirror-engine {
  border-style: solid;
  background: rgba(15,23,42,0.6);
  transition: border-color 0.2s, background 0.2s;
}
.bx-mirror-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1;
  margin: 4px 0 6px;
}
.bx-mirror-unit {
  font-size: 11px;
  font-weight: 400;
  color: #64748b;
  letter-spacing: 1px;
  margin-left: 6px;
}
.bx-mirror-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: #94a3b8;
}

.bx-mirror-drag {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #1e293b;
}

.bx-mirror-drag-label {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #f59e0b;
  margin-right: 8px;
}

/* Tone classes — cold gradient. Green = stable. Amber = drift. Red = leak. */
.bx-tone-ok   { border-color: #166534; }
.bx-tone-ok   .bx-mirror-score { color: #4ade80; }
.bx-tone-warn { border-color: #854d0e; }
.bx-tone-warn .bx-mirror-score { color: #fbbf24; }
.bx-tone-bad  { border-color: #7f1d1d; animation: bx-ring-pulse 4s ease-in-out infinite; }
.bx-tone-bad  .bx-mirror-score { color: #f87171; }

@keyframes bx-ring-pulse {
  0%,  100% { box-shadow: 0 0 0 0 rgba(127,29,29,0); }
  50%        { box-shadow: 0 0 18px 4px rgba(127,29,29,0.35); }
}

/* Analytics modal — wider than the reminder modal */
.bx-analytics-card {
  width: min(720px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px 24px 20px;
}
.bx-mirror-sys-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #64748b;
  margin: 18px 0 6px;
}
.bx-mirror-syslog .bx-syslog { margin-bottom: 4px; }

/* ─────────────────────────────────────────────────────────────────
   DISCIPLINE CHARTS — Phase 4.5
   ───────────────────────────────────────────────────────────────── */
.bx-charts {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0 6px;
}
.bx-chart-block {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 2px;
  padding: 12px 14px 14px;
}
.bx-chart-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #64748b;
  margin-bottom: 8px;
}
.bx-chart-canvas-wrap {
  position: relative;
  height: 140px;
}
.bx-chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Heatmap — CSS grid (no Chart.js) */
.bx-chart-heatmap-wrap { padding: 4px 0 0; }
.bx-heatmap {
  display: flex;
  gap: 4px;
  align-items: flex-start;
  font-family: 'JetBrains Mono', monospace;
}
.bx-heatmap-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: 4px;
}
.bx-heatmap-daylabel {
  width: 12px;
  height: 14px;
  font-size: 9px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}
.bx-heatmap-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bx-heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.35);
  transition: transform 0.1s;
}
.bx-heatmap-cell:hover {
  transform: scale(1.18);
  border-color: #f1f5f9;
}
.bx-heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed #1e293b;
}
.bx-heatmap-legend-item {
  display: flex;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: #94a3b8;
}
.bx-heatmap-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 1px;
  border: 1px solid rgba(0,0,0,0.4);
}

/* ─────────────────────────────────────────────────────────────────
   PHASE 7 — Deterministic Depth surfaces
   ───────────────────────────────────────────────────────────────── */

/* Velocity badge inside Alignment Index card */
.bx-vel-badge {
  display: inline-block;
  margin-left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid #1e293b;
  background: #0a0f1e;
  vertical-align: middle;
}
.bx-vel-up   { color: #4ade80; border-color: #166534; }
.bx-vel-down { color: #f87171; border-color: #7f1d1d; }
.bx-vel-flat { color: #94a3b8; }

.bx-insight-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 2px;
  padding: 14px 16px 12px;
}
.bx-insight-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #64748b;
  margin-bottom: 10px;
}
.bx-insight-empty {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #475569;
  letter-spacing: 0.5px;
}
.bx-insight-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px dashed #1e293b;
}
.bx-insight-row:last-of-type { border-bottom: none; }
.bx-insight-k {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #64748b;
}
.bx-insight-v {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #f1f5f9;
  letter-spacing: 0.4px;
}
.bx-insight-foot {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #1e293b;
  line-height: 1.4;
}
.bx-insight-ok   { color: #4ade80; }
.bx-insight-warn { color: #f59e0b; }

/* Snapchat-style fire streak hero (Phase 7d).
   Three horizontal stat blocks: primary (current aligned) at full size +
   two secondaries at 50% (personal best with 🔥🔥, current negative with
   🔴/⚪). Intensity tones (cold → mega) apply to the primary only. */
.bx-streak-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 10px 0 14px;
  margin: 6px 0 4px;
  border-bottom: 1px dashed #1e293b;
  flex-wrap: wrap;
}
.bx-streak-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1;
}
.bx-streak-stat-primary  { flex: 0 0 auto; }
.bx-streak-stat-secondary { flex: 0 0 auto; opacity: 0.92; }
@media (max-width: 980px) {
  .bx-streak-hero { gap: 18px; }
}
.bx-streak-flame {
  font-size: 38px;
  line-height: 1;
  filter: grayscale(0.4) saturate(0.9);
}
.bx-streak-numblock {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.bx-streak-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 52px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
}
.bx-streak-unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  color: #94a3b8;
  text-transform: uppercase;
  margin-top: 6px;
}
.bx-streak-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #64748b;
  margin: 8px 0 10px;
}

/* Secondary stat tier — exactly half the primary's typography. */
.bx-streak-flame-mini {
  font-size: 19px;
  line-height: 1;
  filter: saturate(0.85);
}
.bx-streak-num-mini {
  font-family: 'JetBrains Mono', monospace;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: #cbd5e1;
}
.bx-streak-unit-mini {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 5px;
  display: block;
}
.bx-streak-num-neg { color: #f87171; }

/* Intensity tones */
/* Subtle pulse once the streak gets serious */
@keyframes bxFlamePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}
/* Rule Precision panel — full width, compact list */
.bx-precision-card {
  background: #0a0f1e;
  border: 1px solid #1e293b;
  border-left: 3px solid #475569;
  border-radius: 2px;
  padding: 14px 18px 12px;
}
.bx-precision-card .bx-insight-foot { margin-top: 4px; padding-top: 0; border-top: none; }
.bx-precision-row {
  display: grid;
  grid-template-columns: 200px 1fr 110px 200px;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #1e293b;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.4px;
}
.bx-precision-row:last-child { border-bottom: none; }
.bx-precision-rule {
  color: #cbd5e1;
  letter-spacing: 1px;
}
.bx-precision-bar {
  position: relative;
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}
.bx-precision-fill {
  position: absolute; inset: 0 auto 0 0;
  background: #f59e0b;
  transition: width 0.25s ease-out;
}
.bx-precision-pct  { color: #f59e0b; text-align: right; }
.bx-precision-meta { color: #64748b; text-align: right; }
@media (max-width: 980px) {
  .bx-precision-row { grid-template-columns: 1fr; gap: 4px; }
  .bx-precision-pct, .bx-precision-meta { text-align: left; }
}

/* ─────────────────────────────────────────────────────────────────
   PHASE 5 — OPERATIONAL CLASSIFICATION
   ───────────────────────────────────────────────────────────────── */

/* Header tier pill — sits next to #bxStatusPill */
.bx-tier-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  padding: 2px 6px;
  border-radius: 0;
  border: none;
  background: transparent;
  margin-right: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  user-select: none;
}
.bx-tier-pill-hidden       { display: none; }
.bx-tier-pill-systematic   { color: #4ade80; border-color: #166534; }
.bx-tier-pill-reactive     { color: #cbd5e1; border-color: #334155; }
.bx-tier-pill-degrading    { color: #f97316; border-color: #9a3412; }
.bx-tier-pill-uncalibrated { color: #64748b; border-color: #1e293b; }

/* ─────────────────────────────────────────────────────────────────
   IDENTITY MASTHEAD (Phase 7 §1)
   The identity block is the document masthead. It earns dominance
   through scale + breathing room alone — no background gradient,
   no glow, no animation. Color theater is not its lever.
   ───────────────────────────────────────────────────────────────── */

.bx-identity {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-left-width: 3px;
  border-radius: 2px;
  padding: 22px 26px 24px;
}
.bx-identity-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 6px;
}
.bx-identity-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2.4px;
  color: #64748b;
}
.bx-identity-issuance {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #475569;
  text-align: right;
  white-space: nowrap;
}
.bx-identity-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 2.2px;
  line-height: 1.05;
  margin: 16px 0 18px;
  color: #f1f5f9;
}
.bx-identity-status { margin-top: 4px; }
.bx-identity-status-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: #94a3b8;
  line-height: 1.55;
}

/* Tier-tone surfaces — text colour + left border. No background theatre. */
.bx-identity-systematic { border-left-color: #4ade80; }
.bx-identity-systematic .bx-identity-name { color: #4ade80; }

.bx-identity-muted      { border-left-color: #475569; }
.bx-identity-muted      .bx-identity-name { color: #cbd5e1; }

.bx-identity-degrading  { border-left-color: #f97316; }
.bx-identity-degrading  .bx-identity-name  { color: #f97316; }
.bx-identity-degrading  .bx-identity-label { color: #f59e0b; }

/* Mobile fallback — shrink scale, drop metadata to its own line */
@media (max-width: 980px) {
  .bx-identity-name { font-size: 32px; letter-spacing: 1.6px; }
  .bx-identity-meta-row { flex-direction: column; gap: 4px; }
  .bx-identity-issuance { text-align: left; }
}

/* Reminder + EOD modals */
.bx-reminder {
  position: fixed; inset: 0;
  background: rgba(2,8,23,0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 9200;
  padding: 24px;
}
.bx-reminder-card {
  width: min(440px, 92vw);
  background: #0a0f1e;
  border: 1px solid #1e293b;
  border-radius: 3px;
  padding: 22px 24px;
}
.bx-reminder-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  color: #cbd5e1;
  margin-bottom: 8px;
}
.bx-reminder-body {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}
.bx-reminder-actions { display: flex; flex-direction: column; gap: 8px; }
.bx-pill-primary {
  background: #1e293b;
  border-color: #475569;
  color: #f1f5f9;
}

/* Mirror header — two-action layout (End Session + Close) */
.bx-card-head-actions {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.bx-skip-strong {
  color: #cbd5e1;
  border-color: #475569;
}
.bx-skip-strong:hover {
  color: #f1f5f9;
  border-color: #64748b;
  background: #0f172a;
}
.bx-skip-strong:disabled {
  color: #334155;
  border-color: #1e293b;
  cursor: not-allowed;
  opacity: 1;
}
.bx-skip-strong:disabled:hover {
  color: #334155;
  border-color: #1e293b;
  background: none;
}

/* End Session button + below-button hint. The wrap keeps the hint visually
   anchored to the disabled button without disturbing the existing flex row. */
.bx-end-session-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.bx-end-session-hint {
  display: none;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #64748b;
  text-transform: uppercase;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, monospace);
}
body.light-theme .bx-end-session-hint { color: var(--text-dim, #6b6258); }

/* Header status pill */
.bx-status-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid #1e293b;
  background: #0f172a;
  white-space: nowrap;
  user-select: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  pointer-events: auto;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.bx-status-inactive { color: #64748b; cursor: pointer; }
.bx-status-inactive:hover { color: #cbd5e1; border-color: #334155; background: #1e293b; }

/* Active state — animated rotating border dot */
.bx-status-active {
  color: #4ade80 !important;
  background: #020a10 !important;
  border: 1px solid transparent !important;
  overflow: hidden;
  cursor: default;
}
/* Spinning conic-gradient — bright dot travels around the border */
.bx-status-active::before {
  content: '';
  position: absolute;
  width: 200%;
  height: 400%;
  left: -50%;
  top: -150%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg, transparent 295deg,
    rgba(74,222,128,0.08) 310deg,
    rgba(74,222,128,0.45) 335deg,
    rgba(74,222,128,0.75) 348deg,
    rgba(74,222,128,1.00) 356deg,
    rgba(74,222,128,0.55) 360deg
  );
  animation: bx-dot-spin 2.8s linear infinite;
  z-index: 0;
}
/* Inner fill — masks interior so only the 1px border shows */
.bx-status-active::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: #020a10;
  border-radius: 2px;
  z-index: 1;
}
@keyframes bx-dot-spin { to { transform: rotate(360deg); } }

/* Pill inner text wrapper — sits above pseudo-elements */
.bx-pill-txt {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 1.2px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
}
/* Animated arrows */

@keyframes bx-arr-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 1; }
}

/* ─────────────────────────────────────────────────────────────────
   TRACKING HORIZON SLIDER (first login / post-completion)
   ───────────────────────────────────────────────────────────────── */

.bx-tier {
  position: relative;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 2px;
  padding: 14px 12px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}
.bx-tier:focus-visible { border-color: #475569; }
@keyframes bx-lock-vibrate {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-12deg); }
  30%  { transform: rotate(12deg); }
  45%  { transform: rotate(-10deg); }
  60%  { transform: rotate(10deg); }
  75%  { transform: rotate(-6deg); }
  90%  { transform: rotate(6deg); }
  100% { transform: rotate(0deg); }
}
/* Active challenge strip (shown when slider is hidden) */
/* ═══════════════════════════════════════════════════════════════════
   HEADER REDESIGN — Row 1 + Row 2
   ═══════════════════════════════════════════════════════════════════ */

/* Row 1 — temporal anchor (left) */
.dn-temporal {
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.dn-date {
  font-size: 13px; color: #64748b;
  font-family: 'JetBrains Mono', monospace; letter-spacing: .5px;
}
.dn-sep {
  font-size: 13px; color: #334155;
  font-family: 'JetBrains Mono', monospace;
}

/* Row 1 — center block */
.dn-center {
  display: flex; align-items: center; gap: 10px;
  white-space: nowrap; pointer-events: none;
}
/* Theme button inside user dropdown */
.user-dropdown-theme {
  width: 100%; padding: 8px 12px;
  background: transparent; border: none;
  border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 11px; text-align: left;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: color .15s, background .15s;
}
.user-dropdown-theme:hover { color: #f1f5f9; background: rgba(255,255,255,.04); }

/* Row 2 — brand slot */
.dt-brand-slot {
  flex-direction: column !important;
  justify-content: center !important;
  align-items: flex-start !important;
  padding: 5px 12px !important;
  gap: 3px !important;
  min-width: 260px;
  flex-shrink: 0;
}
.dt-brand-top {
  display: flex; align-items: center;
  justify-content: space-between; width: 100%; gap: 10px;
}
.dt-brand-inner {
  display: flex; align-items: center; gap: 8px;
}
.dt-brand-text-col {
  display: flex; flex-direction: column; gap: 2px;
}
.dt-update-info {
  font-size: 9px; color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

/* Compact stacked control buttons */
.dt-drop-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: #94a3b8;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .5px;
  white-space: nowrap;
  width: 100%;
  text-align: left;
  min-height: auto;
  transition: color .15s, border-color .15s, background .15s;
}
.dt-drop-btn:hover { color: #f1f5f9; border-color: #334155; background: rgba(255,255,255,.04); }
/* history mode (date selected) */
#dateDisplayBtn.history-mode { border-color: #7c3aed; color: #c4b5fd; background: #1e1040; }
/* replay active state */
.dt-drop-replay-active { color: #4ade80 !important; border-color: #166534 !important; background: rgba(74,222,128,.08) !important; }
/* live exit button — slot-1 swap when history mode is active */
.dt-drop-live { color: #4ade80 !important; border-color: #166534 !important; background: rgba(74,222,128,.06) !important; }
.dt-drop-live:hover { background: rgba(74,222,128,.14) !important; }

/* Direct stacked controls (Replay + Today) */
.dt-direct-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  flex-shrink: 0;
}

/* Segment A — NIFTY price only */
.dt-spot { width: 120px; flex-shrink: 0; }

/* Segment B — sparkline */
.dt-sparkline-seg {
  width: 155px; flex-shrink: 0;
  justify-content: center !important;
  align-items: stretch !important;
  padding: 6px 8px !important;
}
.dt-sparkline-seg .dt-sparkline-wrap {
  position: relative; width: 100%; height: 100%;
  align-self: stretch; flex: 1;
}
.dt-spark-overlay {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 3px; pointer-events: none;
}
.dt-spark-overlay .dt-session-badge {
  position: static !important; transform: none !important;
  top: auto !important; left: auto !important;
}

/* Legacy light-theme stubs — now covered by Phase 2 & 6 blocks above */
body.light-theme .bx-status-inactive { color: var(--text-dim) !important; }

/* ══════════════════════════════════════════════════════════════════════
   PHASE 6 — BEHAVIORAL OS FULL LIGHT-MODE COVERAGE
   All .bx-* classes had zero light-mode rules before this block.
   ══════════════════════════════════════════════════════════════════════ */

/* Overlay frosted glass */
body.light-theme .bx-frost { background: rgba(245,240,235,0.88); backdrop-filter: blur(8px) saturate(1.2); }

/* Reminder / debrief / Mirror modal backdrop — the dark rgba(2,8,23) is too
   dim in light mode; flip to a paper-tint that still reads as a modal scrim. */
body.light-theme .bx-reminder {
  background: rgba(60, 50, 40, 0.42);
}

/* Active-state status pill: was hardcoded #020a10 bg / #4ade80 text. In light
   mode use a faint green wash so the pill still reads as "live" without going
   neon. */
body.light-theme .bx-status-active {
  color: #2f7a45 !important;
  background: rgba(111, 169, 127, 0.14) !important;
  border-color: rgba(111, 169, 127, 0.35) !important;
}

/* Engine ring track — dark slate stroke is invisible on cream bg. */
body.light-theme .bx-ring-track {
  stroke: var(--border-subtle, #c8c0b8);
}

/* Main card shell */
body.light-theme .bx-card {
  background: var(--bg-card);
  border-color: var(--border-subtle);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 24px 48px rgba(0,0,0,.12);
}
body.light-theme .bx-card-head    { border-bottom-color: var(--border-subtle); }
body.light-theme .bx-card-title   { color: var(--text-primary); }

/* Skip / close buttons */
body.light-theme .bx-skip         { border-color: var(--border-subtle); color: var(--text-dim); }
body.light-theme .bx-skip:hover   { color: var(--text-primary); border-color: var(--text-dim); }
body.light-theme .bx-skip-strong  { color: var(--text-primary); border-color: var(--text-dim); }
body.light-theme .bx-skip-strong:hover { color: var(--text-primary); border-color: #9a8f85; background: var(--bg-inset); }
body.light-theme .bx-skip-strong:disabled { color: var(--border-subtle); border-color: var(--border-subtle); }

/* Syslog line */
body.light-theme .bx-syslog       { background: rgba(0,0,0,.04); }
body.light-theme .bx-syslog-info  { color: var(--text-dim); border-color: var(--border-subtle); }
body.light-theme .bx-syslog-warn  { color: #8a6200; border-color: var(--amber-soft); background: rgba(168,132,68,.08); }

/* Section title */
body.light-theme .bx-section-title { color: var(--text-dim); }

/* Pills (time, mood, session tag selectors) */
body.light-theme .bx-pill         { background: var(--bg-inset); border-color: var(--border-subtle); color: var(--text-primary); }
body.light-theme .bx-pill:hover   { border-color: var(--text-dim); color: var(--text-primary); }
body.light-theme .bx-pill-active  { background: var(--border-subtle); border-color: var(--text-dim); color: var(--text-primary); }
body.light-theme .bx-pill-primary { background: var(--border-subtle); border-color: var(--text-dim); color: var(--text-primary); }
body.light-theme .bx-pill-txt     { color: var(--text-dim); }

/* Custom text input */
/* Agreement / signing surface */
/* Discipline Mirror column */
body.light-theme .bx-mirror-title { color: var(--text-dim); }
body.light-theme .bx-mirror-panel { background: rgba(0,0,0,.03); border-color: var(--border-subtle); }
body.light-theme .bx-mirror-label { color: var(--text-dim); }
body.light-theme .bx-mirror-locked { color: var(--text-dim); }
body.light-theme .bx-mirror-engine { background: rgba(0,0,0,.04); }
body.light-theme .bx-mirror-score { color: var(--text-primary); }
body.light-theme .bx-mirror-unit  { color: var(--text-dim); }
body.light-theme .bx-mirror-meta  { color: var(--text-dim); }

body.light-theme .bx-mirror-drag  { border-top-color: var(--border-subtle); }

body.light-theme .bx-mirror-drag-label { color: var(--amber-soft); }

body.light-theme .bx-mirror-sys-title  { color: var(--text-dim); }

/* Tone overrides in light — keep semantic hue, adjust lightness */
body.light-theme .bx-tone-ok   { border-color: var(--green-soft); }
body.light-theme .bx-tone-ok   .bx-mirror-score { color: var(--green-soft); }
body.light-theme .bx-tone-warn { border-color: var(--amber-soft); }
body.light-theme .bx-tone-warn .bx-mirror-score { color: var(--amber-soft); }
body.light-theme .bx-tone-bad  { border-color: var(--red-soft); }
body.light-theme .bx-tone-bad  .bx-mirror-score { color: var(--red-soft); }

/* Discipline Charts */
body.light-theme .bx-chart-block  { background: var(--bg-inset); border-color: var(--border-subtle); }
body.light-theme .bx-chart-title  { color: var(--text-dim); }

/* Heatmap */
body.light-theme .bx-heatmap-daylabel     { color: var(--text-dim); }
body.light-theme .bx-heatmap-legend       { border-top-color: var(--border-subtle); }
body.light-theme .bx-heatmap-legend-item  { color: var(--text-dim); }
body.light-theme .bx-heatmap-cell:hover   { border-color: var(--text-primary); }

/* Velocity badges */
body.light-theme .bx-vel-badge     { background: var(--bg-inset); border-color: var(--border-subtle); }
body.light-theme .bx-vel-up        { color: var(--green-soft); border-color: rgba(111,169,127,.4); }
body.light-theme .bx-vel-down      { color: var(--red-soft);   border-color: rgba(201,112,112,.4); }
body.light-theme .bx-vel-flat      { color: var(--text-dim); }

/* Personal Insights */
body.light-theme .bx-insight-card  { background: var(--bg-inset); border-color: var(--border-subtle); }
body.light-theme .bx-insight-label { color: var(--text-dim); }
body.light-theme .bx-insight-empty { color: var(--text-dim); }
body.light-theme .bx-insight-row   { border-bottom-color: var(--border-subtle); }
body.light-theme .bx-insight-k     { color: var(--text-dim); }
body.light-theme .bx-insight-v     { color: var(--text-primary); }
body.light-theme .bx-insight-foot  { color: var(--text-dim); border-top-color: var(--border-subtle); }
body.light-theme .bx-insight-ok    { color: var(--green-soft); }
body.light-theme .bx-insight-warn  { color: var(--amber-soft); }

/* Streak hero */
body.light-theme .bx-streak-hero      { border-bottom-color: var(--border-subtle); }
body.light-theme .bx-streak-unit      { color: var(--text-dim); }
body.light-theme .bx-streak-sub       { color: var(--text-dim); }
body.light-theme .bx-streak-num-mini  { color: var(--text-primary); }
body.light-theme .bx-streak-unit-mini { color: var(--text-dim); }
body.light-theme .bx-streak-num-neg   { color: var(--red-soft); }
/* Intensity tones — keep hue, reduce saturation for light canvas */
/* Rule Precision panel */
body.light-theme .bx-precision-card  { background: var(--bg-card); border-color: var(--border-subtle); border-left-color: var(--text-dim); }
body.light-theme .bx-precision-row   { border-bottom-color: var(--border-subtle); }
body.light-theme .bx-precision-rule  { color: var(--text-primary); }
body.light-theme .bx-precision-bar   { background: var(--border-subtle); }
body.light-theme .bx-precision-meta  { color: var(--text-dim); }

/* Tier pills */
body.light-theme .bx-tier-pill-systematic   { color: var(--green-soft); }
body.light-theme .bx-tier-pill-reactive     { color: var(--text-primary); }
body.light-theme .bx-tier-pill-degrading    { color: var(--orange-soft); }
body.light-theme .bx-tier-pill-uncalibrated { color: var(--text-dim); }

/* Identity masthead */
body.light-theme .bx-identity        { background: var(--bg-inset); border-color: var(--border-subtle); }
body.light-theme .bx-identity-label  { color: var(--text-dim); }
body.light-theme .bx-identity-issuance { color: var(--text-dim); }
body.light-theme .bx-identity-name   { color: var(--text-primary); }
body.light-theme .bx-identity-status-line  { color: var(--text-dim); }
body.light-theme .bx-identity-muted .bx-identity-name  { color: var(--text-primary); }
body.light-theme .bx-identity-systematic .bx-identity-name { color: var(--green-soft); }
body.light-theme .bx-identity-systematic { border-left-color: var(--green-soft); }
body.light-theme .bx-identity-degrading .bx-identity-name  { color: var(--orange-soft); }
body.light-theme .bx-identity-degrading { border-left-color: var(--orange-soft); }
body.light-theme .bx-identity-degrading .bx-identity-label { color: var(--amber-soft); }

/* Reminder + EOD modals */
body.light-theme .bx-reminder-card   { background: var(--bg-card); border-color: var(--border-subtle); }
body.light-theme .bx-reminder-title  { color: var(--text-primary); }
body.light-theme .bx-reminder-body   { color: var(--text-dim); }

/* Status pill */
body.light-theme .bx-status-pill   { background: var(--bg-inset); border-color: var(--border-subtle); }
body.light-theme .bx-status-inactive { color: var(--text-dim) !important; }
body.light-theme .bx-status-inactive:hover { color: var(--text-primary) !important; border-color: var(--text-dim); background: var(--border-subtle); }

/* Cockpit additions in light */

/* Today's History modal bubbles */
body.light-theme .hm-bubble--bull    { background: rgba(111,169,127,.12); border-left-color: var(--green-soft); }
body.light-theme .hm-bubble--bear    { background: rgba(201,112,112,.12); border-left-color: var(--red-soft); }
body.light-theme .hm-bubble--signal  { background: rgba(91,141,217,.12);  border-left-color: var(--blue-soft); }
body.light-theme .hm-bubble--open    { background: rgba(111,169,127,.08); border-left-color: var(--green-soft); }
body.light-theme .hm-bubble--neutral { background: var(--bg-inset); border-left-color: var(--border-subtle); }
body.light-theme .hm-title           { color: var(--text-primary); }
body.light-theme .hm-bubble--bull .hm-title { color: var(--green-soft); }
body.light-theme .hm-bubble--bear .hm-title { color: var(--red-soft); }
body.light-theme .hm-bubble--open .hm-title { color: var(--green-soft); }
body.light-theme .hm-time            { color: var(--text-dim); }
body.light-theme .hm-subtext         { color: var(--text-dim); }

/* Horizon strip (alignment progress) */
/* Log btn */

/* ═══════════════════════════════════════════════════════════════════════════
   COMMITMENT CYCLE — cycle1a
   All .cx-* classes. Dark-mode base + light-mode overrides inline.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── TODAY Panel ────────────────────────────────────────────────────────────── */

.cx-today-panel {
  margin: 0 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

/* Unmeasured-session bar */
.cx-unmeasured-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}
.cx-unmeasured-icon  { color: var(--amber); font-size: 11px; }
.cx-unmeasured-text  { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .2px; color: var(--amber); }
.cx-unmeasured-ctx   { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--muted); margin-left: auto; }

/* Masthead */
.cx-masthead {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
}
.cx-masthead-tier   { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 2px; color: var(--text-primary); text-transform: uppercase; }
.cx-masthead-meta   { font-family: 'DM Sans', sans-serif; font-size: 10px; color: var(--muted); margin-top: 2px; }
.cx-masthead-streak { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); margin-top: 2px; }

/* TODAY state content */
.cx-today-state { padding: 12px 14px 14px; }

.cx-state-content {}
.cx-state-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.cx-state-cycle-line {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cx-state-body {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cx-state-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.cx-tracking-dot { color: var(--green-soft); }

/* CTA buttons */
.cx-cta-btn {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cx-cta-btn:hover { border-color: var(--muted); background: rgba(255,255,255,0.03); }
.cx-cta-secondary { color: var(--muted); }

/* Pre-market obscure overlay */
.cx-premarket-overlay {
  position: relative;
  margin: 0 12px;
  height: 40px;
  background: linear-gradient(180deg, rgba(2,8,23,0.85) 0%, rgba(2,8,23,0) 100%);
  pointer-events: none;
  z-index: 10;
}

/* ── Ceremony Modal ──────────────────────────────────────────────────────────── */

.cx-ceremony-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9200;
}
.cx-ceremony-modal--open { display: block; }

.cx-ceremony-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.88);
  backdrop-filter: blur(4px);
}

.cx-ceremony-dialog {
  --accent: var(--gold);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 600px;
  max-height: min(720px, calc(100dvh - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.9);
}

.cx-ceremony-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.cx-ceremony-step-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}
.cx-ceremony-tier-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  background: var(--bg-inset, #0a0f1e);
  padding: 2px 8px;
  border-radius: 3px;
}
/* F4 (NEW_USER_FLOW_AUDIT_2026-08-25) — header skip link, same minimal
   style as .cx-anchor-skip; hidden via _updateCeremonySkipVisibility()
   once Step 8's review screen is reached. */
.cx-ceremony-skip-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--dim);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  margin-left: 12px;
}
.cx-ceremony-skip-link:hover { color: var(--muted); }
.cx-ceremony-skip-link:disabled { opacity: .5; cursor: default; }

.cx-ceremony-body {
  flex: 0 1 auto;
  overflow-y: auto;
  padding: 16px 16px;
}

.cx-ceremony-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Steps */
.cx-step {}
.cx-step-eyebrow {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cx-step-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.3;
}
/* Step 1 scroll */
.cx-step-scrollable { max-height: none; overflow-y: visible; }
.cx-step-scrollable p { font-size: 13px; color: var(--text-primary); line-height: 1.7; margin-bottom: 14px; }
.cx-sebi-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  border-left: 2px solid var(--border-subtle);
  padding-left: 10px;
  margin: 16px 0;
}

/* Step 0 — tick-to-proceed items */
.cx-step0-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cx-step0-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  cursor: default;
  transition: border-color 0.15s, background 0.15s, opacity 0.2s;
  user-select: none;
}
.cx-step0-item--active {
  border-color: var(--blue, #4FACFE);
  cursor: pointer;
  background: rgba(79, 172, 254, 0.05);
}
.cx-step0-item--active:hover {
  background: rgba(79, 172, 254, 0.10);
}
.cx-step0-item--ticked {
  border-color: var(--green, #00FF88);
  background: rgba(0, 255, 136, 0.05);
  opacity: 0.75;
}
.cx-step0-item--locked {
  opacity: 0.35;
  cursor: not-allowed;
}
@keyframes cxPulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(79,172,254,0); }
  50% { transform: scale(1.02); box-shadow: 0 0 14px rgba(79,172,254,0.6); border-color: #4FACFE; }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(79,172,254,0); }
}
.cx-step0-item--highlight {
  animation: cxPulseGlow 0.45s ease-in-out;
}
.cx-step0-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.cx-step0-item--active .cx-step0-check {
  border-color: var(--blue, #4FACFE);
}
.cx-step0-item--ticked .cx-step0-check {
  border-color: var(--green, #00FF88);
  background: var(--green, #00FF88);
}
.cx-step0-item--ticked .cx-step0-check::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: 2px solid #000;
  border-top: none;
  border-left: none;
  transform: rotate(42deg) translate(-1px, -1px);
}
.cx-step0-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
}
.cx-step0-item--locked .cx-step0-text {
  color: var(--muted);
}

/* Rule input */
.cx-rule-hints { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.cx-hint { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--dim); }
.cx-rule-input, .cx-field-textarea, .cx-breach-rationale, .cx-late-textarea {
  width: 100%;
  background: var(--bg-inset, #0a0f1e);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  resize: vertical;
  box-sizing: border-box;
}
.cx-rule-input:focus,
.cx-field-textarea:focus, .cx-breach-rationale:focus, .cx-late-textarea:focus {
  outline: none;
  border-color: var(--muted);
}

.cx-rule-error {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--red-soft, #c97070);
  margin-top: 4px;
  min-height: 0;
}

/* ── Tier Picker (Step 1) ─────────────────────────────────────────────────── */
.cx-tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.cx-tier-card {
  position: relative;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 16px 8px 12px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  background: var(--bg-elev, #181C28);
}
.cx-tier-card:hover:not(.cx-tier-card--locked)   { border-color: var(--border-strong, rgba(255,255,255,0.10)); }
.cx-tier-card--selected                           { border-color: var(--green, #00FF88) !important; background: rgba(0,255,136,0.07); transform: translateY(-2px); }
.cx-tier-card--locked                             { opacity: 0.55; cursor: default; }
/* Lock emoji: centered large over the watermark number */
.cx-tier-lock  {
  position: absolute;
  top: 42%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 32px;
  z-index: 2;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(245,166,35,0.9)) drop-shadow(0 0 18px rgba(245,166,35,0.4));
}
/* All tier cards: same large number — unlocked shows bright, locked shows ghost */
.cx-tier-days  { font-family: 'JetBrains Mono', monospace; font-size: 64px; font-weight: 700; color: var(--text-primary); line-height: 1; }
/* Locked card: ghost/watermark treatment only — font-size inherited from above */
.cx-tier-card--locked .cx-tier-days {
  color: rgba(255,255,255,0.18);
  position: relative;
  z-index: 0;
  margin-bottom: 2px;
}
.cx-tier-unit  { font-family: 'DM Sans', sans-serif; font-size: 10px; letter-spacing: 0.12em; color: var(--muted); margin-top: 2px; }
.cx-tier-sub   { font-family: 'DM Sans', sans-serif; font-size: 9px; color: var(--dim); margin-top: 6px; line-height: 1.3; }

/* ── Daily Anchor (Step 7) ───────────────────────────────────────────────── */
.cx-anchor-field  { margin-bottom: 14px; }
.cx-anchor-label  { display: block; font-family: 'DM Sans', sans-serif; font-size: 10px;
                    letter-spacing: 0.08em; color: var(--dim); margin-bottom: 6px; text-transform: uppercase; }
.cx-anchor-input  {
  width: 100%; background: var(--bg-inset, #0a0f1e); border: 1px solid var(--border-subtle);
  border-radius: 4px; padding: 9px 12px; font-family: 'JetBrains Mono', monospace;
  font-size: 14px; color: var(--text-primary); box-sizing: border-box;
}
.cx-anchor-input:focus          { outline: none; border-color: var(--gold, #E8A33D); }
.cx-preset-chips                { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; margin-bottom: 6px; }
.cx-preset-chip {
  background: var(--bg-inset, #0a0f1e);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 6px 12px;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.cx-preset-chip:hover {
  border-color: var(--gold, #E8A33D);
  background: rgba(232,163,61,0.08);
}
.cx-preset-chip:active, .cx-preset-chip.is-active {
  border-color: var(--gold, #E8A33D);
  background: rgba(232,163,61,0.18);
  color: var(--gold, #E8A33D);
}
.cx-anchor-pills                { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-anchor-skip                 { font-size: 11px; color: var(--dim); background: none; border: none;
                                  cursor: pointer; padding: 0; margin-right: auto; }
.cx-anchor-skip:hover           { color: var(--muted); }

/* ── Lock summary (Step 8) ───────────────────────────────────────────────── */
.cx-anchor-summary { font-family: 'DM Sans', sans-serif; font-size: 12px; color: var(--muted);
                     margin-top: 4px; line-height: 1.6; }
.cx-step-locked .cx-lock-line   { font-family: 'DM Sans', sans-serif; font-size: 14px;
                                   color: var(--muted); margin-bottom: 8px; }

/* Light-mode overrides */
body.light-theme .cx-tier-card        { background: var(--bg-card, #ede8e3); border-color: var(--border); }
body.light-theme .cx-tier-card--selected { border-color: var(--green-soft, #00C46A) !important; background: rgba(0,196,106,0.07); transform: translateY(-2px); }
body.light-theme .cx-tier-days        { color: var(--text-primary); }
body.light-theme .cx-anchor-input     { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-anchor-summary   { color: var(--text-secondary, #5a5550); }

.cx-rule-opt-note { font-size: 11px; color: var(--muted); margin-top: 8px; }
.cx-add-rule-prompt { font-size: 11px; color: var(--muted); margin-top: 8px; }
.cx-rule-prev-item, .cx-rule-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-primary);
}
.cx-rule-prev-list { margin: 10px 0; }
.cx-rule-num { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); width: 16px; flex-shrink: 0; }
.cx-rule-text { flex: 1; font-size: 12px; }

/* Class badges */
.cx-class-badge {
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Classification step */
.cx-classify-guess { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cx-classify-options { display: flex; flex-direction: column; gap: 8px; }
.cx-classify-btn {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: var(--bg-inset, #0a0f1e);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}
.cx-classify-btn:hover  { border-color: var(--muted); }
.cx-classify-selected   { border-color: var(--text-primary) !important; }
.cx-classify-label { font-size: 12px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.cx-classify-desc  { font-size: 10px; color: var(--muted); }

/* Validation states */
.cx-validation-fail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 4px;
  margin-top: 12px;
}
.cx-val-icon { color: var(--red-soft,#c97070); font-size: 14px; flex-shrink: 0; }
.cx-val-message { font-size: 12px; color: var(--text-primary); }
.cx-validation-warn {
  padding: 10px 12px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--amber);
  margin-top: 10px;
}

/* Review step */
.cx-review-meta { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--muted); margin-bottom: 16px; }
.cx-review-meta-sub { margin-top: -10px; opacity: .8; }
.cx-review-section { margin-bottom: 16px; }
.cx-review-section-label { font-size: 9px; font-weight: 700; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }

/* ── Cap in flat days (Feature 4, Step 8 day-0 payoff) ────────────────────────── */
.cx-cap-flat-days-emphasis { font-weight: 700; color: var(--text-primary); }

/* ── Danger zone question (Phase 6) ─────────────────────────────────────────── */
.cx-danger-zone-section { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-subtle, #1e293b); }
.cx-danger-zone-sub { font-size: 11px; color: var(--text-dim, #46566f); margin-bottom: 10px; font-family: 'DM Sans', sans-serif; }
.cx-danger-zone-options { display: flex; flex-direction: column; gap: 6px; }
.cx-danger-zone-btn {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: var(--text-secondary, #94a3b8);
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  padding: 9px 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  min-height: 40px;
}
.cx-danger-zone-btn:hover { background: rgba(255,255,255,0.05); color: var(--text-primary, #f1f5f9); }
.cx-danger-zone-btn--active {
  background: rgba(212,160,23,0.1);
  border-color: rgba(212,160,23,0.4);
  color: var(--gold);
}
body.light-theme .cx-danger-zone-section { border-top-color: rgba(0,0,0,0.08); }
body.light-theme .cx-danger-zone-sub { color: #9aaabb; }
body.light-theme .cx-danger-zone-btn { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); color: #6b7f96; }
body.light-theme .cx-danger-zone-btn:hover { background: rgba(0,0,0,0.05); color: #1a2332; }
body.light-theme .cx-danger-zone-btn--active { background: rgba(180,130,20,0.09); border-color: rgba(160,110,10,0.38); color: #7a5000; }
.cx-review-identity { font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text-primary); font-style: italic; }

/* Lock screen */
.cx-lock-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-primary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: 0.5px;
}

/* Probation banner */
.cx-probation-banner {
  margin-top: 12px;
  padding: 8px 12px;
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber);
  letter-spacing: 0.5px;
}

/* Step 7 rule row */
.cx-rule-row-review { padding: 8px 0; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* BRUTAL MIRROR — Phase 1: Day-0 Blood Oath surfaces                          */
/* Stark, mechanical, engraved-ledger aesthetic. No friendly rounding.         */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Shared step prompt — sits between headline and the heavy content */
.cx-step-prompt {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary, var(--muted));
  margin-bottom: 18px;
  max-width: 520px;
}

/* ── Daily Acknowledge — the engraved ledger ────────────────────────────── */

.cx-step-daily-confirm { padding-top: 4px; }

/* Today's date — deliberately its own block, not a .cx-daily-row, so it
   never falls under the :last-child override meant for the fatal-flaw row. */
.cx-ceremony-date-block {
  margin-bottom: 18px;
}
.cx-ceremony-date-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text-label, var(--muted));
  margin-bottom: 4px;
}
.cx-ceremony-date-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  min-height: 27px; /* holds layout steady before the typewriter starts */
}
.cx-ceremony-date-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--blue, #4FACFE);
  animation: cxDateCaretBlink 0.9s steps(1) infinite;
}
@keyframes cxDateCaretBlink { 50% { opacity: 0; } }
.cx-ceremony-date-sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-secondary, var(--muted));
  margin-top: 4px;
}

.cx-daily-contract {
  margin-top: 18px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red);
  border-radius: 0;                       /* mechanical, no soft corners */
  padding: 4px 0;
  font-family: var(--font-sans);
}

.cx-daily-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.cx-daily-row:last-child { border-bottom: none; }

.cx-daily-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.2px;
  text-transform: uppercase;
  color: var(--text-label, var(--muted));
}

.cx-daily-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  text-align: right;
}
/* Fatal flaw row — value is text, not a number, so tighten the size */
.cx-daily-row:last-child .cx-daily-value {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.3px;
}

/* ── Light theme overrides ───────────────────────────────────────────────── */

body.light-theme .cx-daily-contract {
  background: var(--bg-inset, #ede8e0);
  border-color: var(--border-strong);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .cx-daily-row  { padding: 14px 16px; }
  .cx-daily-value { font-size: 18px; }
  .cx-daily-row:last-child .cx-daily-value { font-size: 13px; }
  .cx-ceremony-date-value { font-size: 18px; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* BRUTAL MIRROR — Phase 3: two-input check-in gate + autopsy                  */
/* ─────────────────────────────────────────────────────────────────────────── */

.cx-brutal-mirror {
  padding: 4px 0 8px 0;
}

.cx-brutal-eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--text-label, var(--muted));
  margin-bottom: 12px;
}

.cx-brutal-field {
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--red);
  padding: 14px 16px 18px;
  margin-bottom: 14px;
}

.cx-brutal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.cx-brutal-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-label, var(--muted));
}

.cx-brutal-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.cx-brutal-input-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, var(--text-primary));
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.cx-brutal-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-base, var(--bg-card));
  border: 1px solid var(--border-strong);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  letter-spacing: 0.5px;
}
.cx-brutal-input:focus {
  border-color: var(--red);
}
.cx-brutal-input::placeholder {
  color: var(--text-mute, var(--dim));
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.cx-brutal-yesno {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cx-brutal-yesno-btn {
  appearance: none;
  background: var(--bg-base, var(--bg-card));
  border: 1px solid var(--border-strong);
  color: var(--text-secondary, var(--muted));
  padding: 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 90ms linear, color 90ms linear, background 90ms linear;
}
.cx-brutal-yesno-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.cx-brutal-yesno-selected {
  border-color: var(--red);
  color: var(--text-primary);
  background: rgba(255, 69, 96, 0.08);
}

/* ── Overtrade Autopsy ───────────────────────────────────────────────────── */

.cx-autopsy {
  padding: 6px 0 4px 0;
}

.cx-autopsy-eyebrow {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--red);
  margin-bottom: 8px;
}

.cx-autopsy-headline {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.25;
  letter-spacing: 0.3px;
}

.cx-autopsy-prompt {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary, var(--muted));
  margin: 16px 0 14px 0;
  letter-spacing: 0.2px;
}

.cx-autopsy-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cx-autopsy-btn {
  appearance: none;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary, var(--muted));
  padding: 18px 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 90ms linear, color 90ms linear, background 90ms linear;
}
.cx-autopsy-btn:hover {
  color: var(--text-primary);
}
.cx-autopsy-btn-selected {
  border-color: var(--red);
  background: rgba(255, 69, 96, 0.1);
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 var(--red);
}

/* Light theme overrides */
body.light-theme .cx-brutal-field      { background: var(--bg-inset, #ede8e0); }
body.light-theme .cx-brutal-input      { background: var(--bg-base, #f3eee5); }
body.light-theme .cx-brutal-yesno-btn  { background: var(--bg-base, #f3eee5); }
body.light-theme .cx-autopsy-btn       { background: var(--bg-inset, #ede8e0); }
body.light-theme .cx-brutal-yesno-selected,
body.light-theme .cx-autopsy-btn-selected {
  background: rgba(255, 69, 96, 0.1);
}

@media (max-width: 640px) {
  .cx-brutal-value         { font-size: 18px; }
  .cx-brutal-input         { font-size: 16px; padding: 11px 12px; }   /* 16px prevents iOS zoom */
  .cx-brutal-yesno-btn     { padding: 12px; font-size: 13px; }
  .cx-autopsy-headline     { font-size: 18px; }
  .cx-autopsy-btn          { padding: 16px 10px; font-size: 13px; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* PHASE 4 — BREAK CONTRACT: Danger zone + destructive button + confirm modal  */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Danger zone (bottom of Mirror modal) */
.bx-danger-zone {
  margin-top: 40px;
  padding: 20px 0 0 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}
.bx-danger-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-mute, var(--dim));
  margin-bottom: 14px;
}
.bx-btn-destructive {
  appearance: none;
  background: transparent;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: background 90ms linear, color 90ms linear;
}
.bx-btn-destructive:hover {
  background: var(--red);
  color: #fff;
}

/* ── Confirm modal ─────────────────────────────────────────────────────── */

.cx-break-modal {
  position: fixed;
  inset: 0;
  z-index: 100050;       /* above the Mirror modal (90000-ish) */
  display: flex;
  align-items: center;
  justify-content: center;
}
.cx-break-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(2px);
}
.cx-break-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--red);
  border-top: 4px solid var(--red);
  width: min(520px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  border-radius: 0;
}
.cx-break-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}
.cx-break-headline {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 22px;
  letter-spacing: 0.2px;
}

.cx-break-body { margin-bottom: 22px; }

.cx-break-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.cx-break-fact:last-of-type { border-bottom: none; }

.cx-break-fact-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-label, var(--muted));
}
.cx-break-fact-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.4px;
}
.cx-break-fact:first-child .cx-break-fact-value {
  color: var(--red);
  font-size: 20px;
}

/* Tombstone */
.cx-break-tomb {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-inset);
  border: 1px dashed var(--border-strong);
  border-radius: 0;
}
.cx-break-tomb-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-mute, var(--dim));
  margin-bottom: 6px;
}
.cx-break-tomb-line {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.cx-break-tomb-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-secondary, var(--muted));
  margin-top: 4px;
  letter-spacing: 0.2px;
}
.cx-break-tomb-empty {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary, var(--muted));
  text-align: center;
  font-style: italic;
}

.cx-break-footer {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 10px;
  margin-top: 18px;
}
.cx-break-footer .cx-btn-destructive {
  font-size: 12px;
  padding: 14px 16px;
  background: var(--red);
  color: #fff;
}
.cx-break-footer .cx-btn-destructive:hover {
  background: #cc3349;
}
.cx-break-footer .cx-btn-destructive:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.cx-break-error {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(255,69,96,0.1);
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.2px;
}

@media (max-width: 640px) {
  .cx-break-dialog       { padding: 22px 20px; }
  .cx-break-headline     { font-size: 18px; }
  .cx-break-fact-value   { font-size: 14px; }
  .cx-break-fact:first-child .cx-break-fact-value { font-size: 17px; }
  .cx-break-footer       { grid-template-columns: 1fr; }
  .cx-break-footer .cx-btn-destructive { font-size: 12px; }
  .bx-btn-destructive    { padding: 12px 22px; font-size: 12px; }
}

/* Light theme */
body.light-theme .cx-break-dialog { background: var(--bg-card, #f3eee5); }
body.light-theme .cx-break-tomb   { background: var(--bg-inset, #ede8e0); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* PHASE 5 — SOS / Lock Session: tactical retreat (not panic, not red)         */
/* ─────────────────────────────────────────────────────────────────────────── */

.bx-sos-btn {
  appearance: none;
  margin-left: 12px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--amber, #F5A623);
  color: var(--amber, #F5A623);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  border-radius: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 100ms linear, color 100ms linear;
}
.bx-sos-btn:hover {
  background: var(--amber, #F5A623);
  color: #0B0E17;
}
.bx-sos-btn.bx-hidden { display: none !important; }
.bx-sos-icon { font-size: 13px; line-height: 1; }

/* Modal */
.bx-sos-modal {
  position: fixed;
  inset: 0;
  z-index: 100040;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bx-sos-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(2px);
}
.bx-sos-dialog {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-top: 4px solid var(--amber, #F5A623);
  width: min(480px, 92vw);
  padding: 28px 28px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  border-radius: 0;
}
.bx-sos-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--amber, #F5A623);
  margin-bottom: 10px;
}
.bx-sos-success-eyebrow {
  color: var(--green-soft, #00C46A);
}
.bx-sos-headline {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 22px;
  letter-spacing: 0.2px;
}
.bx-sos-body { margin-bottom: 22px; }

.bx-sos-prompt {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary, var(--muted));
  margin-bottom: 16px;
  letter-spacing: 0.1px;
}
.bx-sos-input-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-label, var(--muted));
  margin-bottom: 8px;
}
.bx-sos-input {
  width: 100%;
  padding: 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}
.bx-sos-input:focus { border-color: var(--amber, #F5A623); }
.bx-sos-input::placeholder { color: var(--text-mute, var(--dim)); }

.bx-sos-meta {
  padding: 12px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border-subtle);
}
.bx-sos-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
}
.bx-sos-meta-label {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--text-label, var(--muted));
}
.bx-sos-meta-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.bx-sos-meta-row:last-child .bx-sos-meta-value {
  color: var(--green-soft, #00C46A);
}

.bx-sos-footer {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}
.bx-sos-footer-single { grid-template-columns: 1fr; }

.bx-btn-tactical {
  appearance: none;
  background: var(--amber, #F5A623);
  border: 1px solid var(--amber, #F5A623);
  color: #0B0E17;
  padding: 12px 18px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: background 100ms linear, opacity 100ms linear;
}
.bx-btn-tactical:hover  { background: #d68d18; }
.bx-btn-tactical:disabled,
.bx-btn-tactical.bx-btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bx-sos-confirm-line {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.bx-sos-confirm-line:last-child { border-bottom: none; }
.bx-sos-titanium {
  color: var(--amber, #F5A623);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.bx-sos-mute {
  color: var(--text-mute, var(--dim));
  font-size: 12px;
  font-style: italic;
}

.bx-sos-error {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(255,69,96,0.1);
  border: 1px solid var(--red);
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 12px;
}

body.light-theme .bx-sos-dialog { background: var(--bg-card, #f3eee5); }
body.light-theme .bx-sos-input,
body.light-theme .bx-sos-meta   { background: var(--bg-inset, #ede8e0); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* PHASE 2 — Morning Alert chip                                                */
/* Renders only when computeAlert() returns a hit. Above the engraved ledger.  */
/* ─────────────────────────────────────────────────────────────────────────── */

.cx-morning-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px 12px 14px;
  margin-bottom: 18px;
  background: rgba(245, 166, 35, 0.08);
  border-left: 3px solid var(--amber, #F5A623);
  border-radius: 0;
  font-family: var(--font-sans);
}

.cx-morning-alert-loading {
  background: rgba(148, 163, 184, 0.06);
  border-left-color: rgba(148, 163, 184, 0.2);
  align-items: center;
}

.cx-morning-alert-skeleton {
  height: 12px;
  border-radius: 2px;
  background: rgba(148, 163, 184, 0.3);
  width: 50%;
  animation: cx-pulse 1.5s infinite;
}

@keyframes cx-pulse {
  0% { opacity: 0.4; }
  50% { opacity: 0.8; }
  100% { opacity: 0.4; }
}

.cx-morning-alert-warn {
  background: rgba(255, 69, 96, 0.10);
  border-left-color: var(--red);
}

.cx-morning-alert-info {
  background: rgba(245, 166, 35, 0.08);
  border-left-color: var(--amber, #F5A623);
}

.cx-morning-alert-glyph {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--red);
  flex-shrink: 0;
  min-width: 18px;
  text-align: center;
}
.cx-morning-alert-info .cx-morning-alert-glyph {
  color: var(--amber, #F5A623);
}

.cx-morning-alert-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  letter-spacing: 0.15px;
}

body.light-theme .cx-morning-alert-warn { background: rgba(255, 69, 96, 0.12); }
body.light-theme .cx-morning-alert-info { background: rgba(245, 166, 35, 0.12); }

@media (max-width: 640px) {
  .cx-morning-alert       { padding: 10px 12px; gap: 10px; }
  .cx-morning-alert-text  { font-size: 12.5px; }
  .cx-morning-alert-glyph { font-size: 16px; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* PHASE 6 — THE ASCENT: Tier badge chip, body skins, unlock ceremony          */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Masthead badge chip (appears next to cxMastheadTier) */
.cx-masthead-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 9px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2.4px;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  vertical-align: middle;
  text-transform: uppercase;
}
.cx-masthead-badge-disciplined {
  border-color: var(--text-secondary, var(--muted));
  color: var(--text-secondary, var(--muted));
}
.cx-masthead-badge-crucible {
  border-color: var(--blue, #4FACFE);
  color: var(--blue, #4FACFE);
}
.cx-masthead-badge-operator {
  border-color: #C19A4B;        /* bronze */
  color: #C19A4B;
  background: rgba(193,154,75,0.06);
}
.cx-masthead-badge-master {
  border-color: var(--text-primary);
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  letter-spacing: 3px;
}

/* ── Tier body skins ─────────────────────────────────────────────────────── */

/* Crucible (15-day): subtle blue accent on the identity tier text */
body.bx-tier-crucible #cxMastheadTier {
  text-shadow: 0 0 8px rgba(79,172,254,0.18);
}

/* Operator (30-day): bronze accents on key surfaces */
body.bx-tier-operator {
  --bg-card-warm: #181412;
}
body.bx-tier-operator #cxMastheadTier {
  color: #C19A4B;
  letter-spacing: 0.4px;
}
body.bx-tier-operator .bx-status-pill.bx-status-active {
  border-color: #C19A4B;
}
body.bx-tier-operator .cx-daily-contract {
  border-left-color: #C19A4B;
}

/* Master (90-day): hyper-minimalist — strip chrome */
body.bx-tier-master #cxMastheadTier {
  color: var(--text-primary);
  letter-spacing: 0.8px;
}
body.bx-tier-master .cx-masthead-meta,
body.bx-tier-master .cx-masthead-probation,
body.bx-tier-master .cx-morning-alert {
  display: none !important;
}

/* ── Tier unlock ceremony (single dark overlay screen) ───────────────────── */

.cx-tier-unlock {
  position: fixed;
  inset: 0;
  z-index: 100060;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms ease;
}
.cx-tier-unlock--open {
  opacity: 1;
  pointer-events: auto;
}
.cx-tier-unlock-backdrop {
  position: absolute;
  inset: 0;
  background: #050709;
}
.cx-tier-unlock-dialog {
  position: relative;
  text-align: center;
  padding: 48px 40px;
  width: min(520px, 92vw);
}
.cx-tier-unlock-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--text-mute, var(--dim));
  margin-bottom: 24px;
}
.cx-tier-unlock-badge {
  display: inline-block;
  padding: 14px 28px;
  margin-bottom: 32px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 6px;
  border: 1px solid var(--border-strong);
}
.cx-tier-unlock-badge-disciplined { color: var(--text-primary); border-color: var(--text-secondary, var(--muted)); }
.cx-tier-unlock-badge-crucible    { color: var(--blue, #4FACFE); border-color: var(--blue, #4FACFE); }
.cx-tier-unlock-badge-operator    { color: #C19A4B; border-color: #C19A4B; background: rgba(193,154,75,0.08); }
.cx-tier-unlock-badge-master      { color: var(--text-primary); border-color: var(--text-primary); letter-spacing: 8px; }

.cx-tier-unlock-headline {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: 0.3px;
  line-height: 1.3;
}
.cx-tier-unlock-subline {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary, var(--muted));
  letter-spacing: 0.2px;
  margin-bottom: 36px;
  line-height: 1.5;
}
.cx-tier-unlock-btn {
  min-width: 160px;
}

@media (max-width: 640px) {
  .cx-tier-unlock-dialog   { padding: 36px 22px; }
  .cx-tier-unlock-badge    { font-size: 14px; padding: 12px 20px; letter-spacing: 4px; }
  .cx-tier-unlock-headline { font-size: 18px; }
  .cx-tier-unlock-subline  { font-size: 13px; }
  .cx-masthead-badge       { font-size: 8.5px; padding: 2px 7px; letter-spacing: 2px; }
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* PHASE 7 — Graveyard tombstones + Demographic Mirror line                    */
/* ─────────────────────────────────────────────────────────────────────────── */

/* Phase 7b — Titanium marker on heatmap cells (days where SOS was used cleanly).
   Bronze ring + inner highlight so it reads as "earned" rather than "alerted". */

/* ── Graveyard: Section header ─────────────────────────────────────────────── */
.bx-graveyard-section {
  margin: 24px 0;
}
.bx-graveyard-header {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: #6a6a72;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1f;
}

/* ── Monolith Grid — locked dark, no light variant, intentional ─────────────
   The graveyard is a penalty box. Even in light mode the monoliths stay black.
   Visual shock is the feature. */
.bx-monolith-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bx-monolith {
  background: radial-gradient(circle at 50% 0%, #1a1515 0%, #0d0d0f 70%);
  border: 1px solid #1a1a1f;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 8px 32px rgba(0,0,0,0.7),
    0 2px 8px rgba(0,0,0,0.5);
  padding: 28px 20px 20px;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: border-color 300ms ease, transform 300ms ease, box-shadow 300ms ease;
  color: #d4d4d8;
  position: relative;
  overflow: hidden;
}
.bx-monolith:hover {
  border-color: #3a1010;
  transform: translateY(-4px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 16px 40px rgba(0,0,0,0.8),
    0 4px 12px rgba(80,0,0,0.3);
}

.bx-monolith-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #5a5a62;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

/* Center block: watermark glyph behind day number */
.bx-monolith-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 22px;
}
.bx-monolith-glyph {
  position: absolute;
  font-size: 120px;
  line-height: 1;
  color: #c83232;
  opacity: 0.13;
  user-select: none;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.bx-monolith-day {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: #e4e4e7;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
}
.bx-monolith-cause-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: #5a5a62;
  margin-bottom: 6px;
}
.bx-monolith-cause {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  color: #c83232;
  letter-spacing: 0.02em;
  line-height: 1.25;
  margin-bottom: auto;
  padding-bottom: 16px;
}
.bx-monolith-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #44444a;
  letter-spacing: 0.1em;
  margin-top: auto;
}

/* Exhume Archives — overflow slab */

/* Empty state — penalty-locked dark, no light variant */
.bx-monolith-empty {
  background: #0d0d0f;
  border: 1px solid #1a1a1f;
  padding: 48px 24px;
  text-align: center;
  color: #d4d4d8;
}
.bx-monolith-empty-glyph {
  font-size: 36px;
  color: #2a2a30;
  margin-bottom: 18px;
}
.bx-monolith-empty-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #c4c4c8;
  margin-bottom: 10px;
}
.bx-monolith-empty-sub {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #6a6a72;
  font-style: italic;
}

@media (max-width: 640px) {
  .bx-monolith-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bx-monolith { min-height: 220px; padding: 20px 14px 16px; }
  .bx-monolith-day { font-size: 22px; }
}

/* Demographic Mirror line — sits between subline and Continue */
.cx-tier-unlock-demographic {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-mute, var(--dim));
  margin-bottom: 30px;
  margin-top: -16px;
  letter-spacing: 0.4px;
  font-style: italic;
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 640px) {
  .cx-tier-unlock-demographic { font-size: 11px; padding-top: 14px; }
}

@media (max-width: 640px) {
  .bx-sos-btn       { padding: 6px 10px; font-size: 10px; margin-left: 8px; }
  .bx-sos-dialog    { padding: 22px 18px; }
  .bx-sos-headline  { font-size: 18px; }
  .bx-sos-input     { font-size: 18px; padding: 12px; }
  .bx-sos-footer    { grid-template-columns: 1fr; }
}

/* Carry forward */
.cx-btn-link {
  background: none;
  border: none;
  padding: 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cx-btn-link:hover { color: var(--text-primary); }

/* Submit error / success */
.cx-submit-error {
  font-size: 11px;
  color: var(--red-soft, #c97070);
  margin-bottom: 6px;
}
.cx-submit-success { padding: 20px 0; }
.cx-success-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--text-primary);
  padding: 8px 0;
}

/* ── EOD integrity chip (Phase 5) ────────────────────────────────────────────
   Session-level chip appears after check-in submit. Required tap before
   Continue. Text is always optional; depth scales with skill tier.
   ──────────────────────────────────────────────────────────────────────────── */
.cx-eod-chip-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle, #1e293b);
}
.cx-eod-chip-prompt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-dim, #46566f);
  margin-bottom: 12px;
}
.cx-eod-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.cx-eod-chip {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  color: var(--text-secondary, #94a3b8);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  padding: 6px 14px;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.cx-eod-chip:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text-primary, #f1f5f9);
}
.cx-eod-chip--active {
  background: rgba(212,160,23,0.12);
  border-color: rgba(212,160,23,0.45);
  color: var(--gold);
}
/* "Held my rules" gets a green tint */
.cx-eod-chip[data-id="held"].cx-eod-chip--active {
  background: rgba(0,255,136,0.08);
  border-color: rgba(0,255,136,0.35);
  color: #00e076;
}

/* Reflection text area — depth scales by tier */
.cx-eod-reflection-wrap {
  margin-bottom: 10px;
}
.cx-eod-reflection-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-dim, #46566f);
  margin-bottom: 7px;
}
.cx-eod-reflection-wrap--veteran .cx-eod-reflection-label {
  color: var(--text-secondary, #94a3b8);
  font-size: 11px;
}
.cx-eod-reflection-ta {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  color: var(--text-primary, #f1f5f9);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  padding: 9px 12px;
  resize: none;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.cx-eod-reflection-ta:focus {
  border-color: rgba(212,160,23,0.35);
  background: rgba(212,160,23,0.03);
}
.cx-eod-reflection-ta::placeholder { color: var(--text-dim, #46566f); font-style: italic; }
.cx-eod-reflection-wrap--veteran .cx-eod-reflection-ta { font-size: 14px; }

/* Light theme */
body.light-theme .cx-eod-chip-section { border-top-color: rgba(0,0,0,0.08); }
body.light-theme .cx-eod-chip-prompt  { color: #9aaabb; }
body.light-theme .cx-eod-chip         { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.1); color: #6b7f96; }
body.light-theme .cx-eod-chip:hover   { background: rgba(0,0,0,0.06); color: #1a2332; }
body.light-theme .cx-eod-chip--active { background: rgba(180,130,20,0.1); border-color: rgba(160,110,10,0.4); color: #7a5000; }
body.light-theme .cx-eod-reflection-ta { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.08); color: #1a2332; }
body.light-theme .cx-eod-reflection-ta:focus { border-color: rgba(140,100,40,0.38); background: rgba(160,120,50,0.04); }
body.light-theme .cx-eod-reflection-label { color: #9aaabb; }

/* Rule list in step 5 */
.cx-rules-list { margin: 8px 0 12px; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.cx-btn {
  -webkit-user-select: none;
  user-select: none;
  padding: 9px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cx-btn-primary {
  background: var(--text-primary);
  color: var(--bg-base, #020817);
  border-color: var(--text-primary);
}
.cx-btn-primary:hover:not(:disabled) { opacity: 0.88; }
.cx-btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-subtle);
}
.cx-btn-secondary:hover:not(:disabled) { border-color: var(--muted); color: var(--text-primary); }
.cx-btn-disabled { opacity: 0.35; cursor: not-allowed; }
.cx-btn-countdown { opacity: 0.5; }

/* ── Blocking confirm overlay (_showConfirmOverlay) ───────────────────────────
   Sits above .cx-checkin-modal (z-index 2000) since it's shown while a
   check-in modal is open (reset confirm, verdict-card confirm step). */
.dx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 8, 23, 0.88);
  backdrop-filter: blur(4px);
}
.dx-modal-panel {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 20px;
}
.dx-modal-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.dx-modal-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.dx-modal-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 18px;
}
.dx-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.dx-btn-primary,
.dx-btn-ghost {
  padding: 11px 18px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.dx-btn-primary {
  background: var(--text-primary);
  color: var(--bg-base, #020817);
  border-color: var(--text-primary);
}
.dx-btn-primary:hover { opacity: 0.88; }
.dx-btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border-subtle);
}
.dx-btn-ghost:hover { border-color: var(--muted); color: var(--text-primary); }

body.light-theme .dx-btn-primary { background: var(--text-primary); color: var(--bg-base, #f5f0eb); border-color: var(--text-primary); }
body.light-theme .dx-btn-ghost   { color: var(--muted); border-color: var(--border); }

/* ── Checkpoint Modal (B2) ───────────────────────────────────────────────────── */

.cx-checkpoint-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9300;
}
.cx-checkpoint-modal--open { display: block; }

.cx-checkpoint-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.9);
  backdrop-filter: blur(4px);
}

.cx-checkpoint-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 32px);
  max-width: 440px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cx-checkpoint-head {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-subtle);
}
.cx-checkpoint-eyebrow {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.cx-checkpoint-signal {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.cx-checkpoint-dir {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 800;
}
.cx-checkpoint-signal--bull .cx-checkpoint-dir { color: var(--green, #4ade80); }
.cx-checkpoint-signal--bear .cx-checkpoint-dir { color: var(--red, #f87171); }
.cx-checkpoint-conv {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
}

.cx-checkpoint-body { padding: 16px 18px; }

.cx-checkpoint-contract {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.cx-checkpoint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.cx-checkpoint-row strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}
.cx-checkpoint-row--over strong { color: var(--red, #f87171); }

.cx-checkpoint-reminder {
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  border-left: 2px solid var(--border-subtle);
  padding-left: 10px;
}
.cx-checkpoint-reminder b { color: var(--text-primary); }

.cx-checkpoint-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 18px 14px;
}
.cx-checkpoint-btn { width: 100%; text-align: center; }

.cx-checkpoint-foot {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 0 18px 14px;
}

body.light-theme .cx-checkpoint-backdrop { background: rgba(245,240,235,0.88); }
body.light-theme .cx-checkpoint-dialog   { background: var(--bg-card); border-color: var(--border); }
body.light-theme .cx-checkpoint-head     { border-color: var(--border); }

/* ── Check-In Modal ──────────────────────────────────────────────────────────── */

.cx-checkin-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
}
.cx-checkin-modal--open { display: block; }

.cx-checkin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 23, 0.88);
  backdrop-filter: blur(4px);
}

.cx-checkin-dialog {
  position: absolute;
  max-width: 640px;
  max-height: 92vh;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: calc(100% - 24px);
}

.cx-checkin-header {
  position: relative;
  padding: 14px 40px 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.cx-checkin-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.cx-checkin-close:hover { color: var(--text-primary); background: rgba(255,255,255,.06); }
.cx-checkin-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cx-checkin-deadline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 6px;
}
.cx-deadline-late   { color: var(--amber); }
.cx-deadline-urgent { color: var(--amber); }
.cx-checkin-identity {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
  border-left: 2px solid var(--border-subtle);
  padding-left: 8px;
}

.cx-checkin-body   { flex: 1; overflow-y: auto; padding: 14px 16px; }
.cx-checkin-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.cx-submit-due-note { font-size: 10px; color: var(--dim); text-align: right; }

/* Anchor question */
.cx-anchor-section { margin-bottom: 16px; }
.cx-anchor-q {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.cx-anchor-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-anchor-btn {
  padding: 8px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-inset, #0a0f1e);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}
.cx-anchor-btn:hover           { border-color: var(--muted); color: var(--text-primary); }
.cx-anchor-selected            { border-color: var(--text-primary) !important; color: var(--text-primary) !important; }
.cx-execute-q                  { margin-top: 14px; }

/* ── EOD Verdict Card (Behave OS v2 Phase 3 — beginner + medium tiers) ───────
   3-button one-tap self-grade (Kept / Broke it / Didn't trade) + the Broke-it
   expansion (which-limit -> count -> why -> optional note) and the deferred-
   write undo result screen. Reuses .cx-anchor-btn/.cx-btn/.cx-field-* for the
   chip and footer steps; only the entry card and result screen get new,
   bigger tap targets (thumb-zone, mobile-first per B6). */
.cx-verdict-section  { margin-bottom: 16px; }
.cx-verdict-q {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 12px;
}
.cx-verdict-choices--which,
.cx-verdict-choices--count,
.cx-verdict-choices--why       { display: flex; gap: 8px; flex-wrap: wrap; }

.cx-verdict-choices--main {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cx-verdict-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-inset, #0a0f1e);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.cx-verdict-btn--kept          { border-color: var(--green-soft); color: var(--green-soft); }
.cx-verdict-btn--kept:hover    { background: rgba(34, 197, 94, 0.08); }
.cx-verdict-btn--broke         { border-color: var(--red-soft); color: var(--red-soft); }
.cx-verdict-btn--broke:hover   { background: rgba(239, 68, 68, 0.08); }
.cx-verdict-btn--notrade       { color: var(--muted); }
.cx-verdict-btn--notrade:hover { border-color: var(--muted); color: var(--text-primary); }

.cx-verdict-note-wrap  { margin-top: 14px; }

.cx-verdict-result  { padding: 20px 0; text-align: center; }
.cx-verdict-hero {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.cx-verdict-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.cx-verdict-footnote {
  margin-top: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  opacity: .8;
  line-height: 1.5;
}
.cx-verdict-record {
  margin-top: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
  opacity: .9;
}
.cx-verdict-record-growth {
  margin-top: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.cx-verdict-install {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-secondary, rgba(255,255,255,0.03));
  text-align: left;
}
.cx-verdict-install-copy {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.cx-verdict-install-actions { display: flex; gap: 10px; }
.cx-verdict-install-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: transparent;
}
.cx-verdict-install-btn--add     { border-color: var(--green-soft); color: var(--green-soft); }
.cx-verdict-install-btn--add:hover     { background: rgba(34, 197, 94, 0.08); }
.cx-verdict-install-btn--dismiss { color: var(--muted); }
.cx-verdict-install-btn--dismiss:hover { border-color: var(--muted); color: var(--text-primary); }

.cx-verdict-undo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cx-verdict-undo-countdown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
}
.cx-verdict-saving {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 8px 0;
}
.cx-verdict-locked-note {
  margin-top: 10px;
  font-size: 10px;
  color: var(--dim, #46566f);
  text-align: center;
}

body.light-theme .cx-verdict-btn--kept  { border-color: var(--green-soft); color: var(--green-soft); }
body.light-theme .cx-verdict-btn--broke { border-color: var(--red-soft); color: var(--red-soft); }

/* No-trade path */
.cx-notrade-confirm { padding: 12px 0; }
.cx-notrade-heading { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.cx-notrade-detail  { font-size: 12px; color: var(--muted); line-height: 1.6; }
.cx-notrade-badge   {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--muted);
  margin-left: 8px;
}
.cx-notrade-reflection { margin: 10px 0 14px; }
.cx-notrade-reflection label { font-size: 10px; color: var(--muted); display: block; margin-bottom: 4px; }

/* Rules grid */
.cx-rules-header {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.cx-rules-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  color: var(--muted);
}
.cx-rule-check-row {
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}
.cx-rule-check-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}
.cx-rule-check-text { flex: 1; font-size: 12px; color: var(--text-primary); }
.cx-rule-check-controls { display: flex; flex-direction: column; gap: 6px; }

/* Radio / checkbox labels */
.cx-radio-label, .cx-theme-label, .cx-severity-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
}
.cx-radio-label input, .cx-theme-label input, .cx-severity-label input { accent-color: var(--text-primary); }

.cx-cond-q   { font-size: 11px; color: var(--muted); margin: 8px 0 4px; }
.cx-cond-choices { display: flex; gap: 12px; flex-wrap: wrap; }
.cx-auto-status { font-size: 10px; color: var(--dim); font-style: italic; }

/* Breach expansion */
.cx-rule-breach-expand { margin-top: 8px; }
.cx-breach-section { padding: 12px; background: rgba(239,68,68,0.04); border: 1px solid rgba(239,68,68,0.12); border-radius: 4px; }
.cx-breach-q { font-size: 11px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.cx-severity-options { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.cx-theme-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.cx-word-count { font-size: 10px; color: var(--dim); margin-top: 4px; }
.cx-wordcount-ok { color: var(--green-soft, #6fa97f); }
.cx-probation-note { font-size: 10px; color: var(--amber); margin-top: 4px; }

/* Un-anchored section */
.cx-unanchored-card {
  padding: 12px;
  background: rgba(245,158,11,0.05);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 4px;
  margin-top: 12px;
}
.cx-unanchored-q   { font-size: 12px; color: var(--text-primary); margin-bottom: 10px; }
.cx-unanchored-choices { display: flex; gap: 12px; margin-bottom: 10px; }
.cx-unanchored-sub { font-size: 11px; color: var(--muted); margin-bottom: 6px; }

/* Late form */
.cx-late-form { padding: 4px 0; }
.cx-late-header { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cx-late-icon { color: var(--amber); }
.cx-late-header { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.cx-late-deadline-note { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.cx-late-prompt { font-size: 12px; color: var(--text-primary); margin-bottom: 8px; }

/* Crash recovery */
.cx-crash-recovery {
  padding: 10px 12px;
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Step rule preview (classify + validate) */
.cx-step-rule-preview {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text-primary);
  font-style: italic;
  border-left: 2px solid var(--border-subtle);
  padding-left: 10px;
  margin-bottom: 16px;
  line-height: 1.6;
}

/* Field label */
.cx-field-label { font-size: 10px; color: var(--muted); display: block; margin-bottom: 4px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT-MODE OVERRIDES — Commitment Cycle
   ═══════════════════════════════════════════════════════════════════════════ */

body.light-theme .cx-today-panel              { background: var(--bg-card); border-color: var(--border); }
body.light-theme .cx-unmeasured-bar           { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }
body.light-theme .cx-masthead                 { border-color: var(--border); }
body.light-theme .cx-masthead-tier            { color: var(--text-primary); }
body.light-theme .cx-masthead-meta            { color: var(--muted); }
body.light-theme .cx-masthead-streak          { color: var(--muted); }
body.light-theme .cx-today-state              {}
body.light-theme .cx-state-cycle-line         { color: var(--text-primary); }
body.light-theme .cx-state-body               { color: var(--text-primary); }
body.light-theme .cx-state-sub                { color: var(--muted); }
body.light-theme .cx-cta-btn                  { color: var(--text-primary); border-color: var(--border); }
body.light-theme .cx-cta-btn:hover            { border-color: var(--muted); background: rgba(0,0,0,0.03); }

body.light-theme .cx-ceremony-backdrop        { background: rgba(245,240,235,0.88); }
body.light-theme .cx-ceremony-dialog          { background: var(--bg-card); border-color: var(--border); }
body.light-theme .cx-ceremony-header          { border-color: var(--border); }
body.light-theme .cx-ceremony-footer          { border-color: var(--border); }
body.light-theme .cx-ceremony-tier-badge      { background: var(--bg-inset, #e0dbd5); color: var(--muted); }
body.light-theme .cx-step-headline            { color: var(--text-primary); }
body.light-theme .cx-step-scrollable p        { color: var(--muted); }
body.light-theme .cx-sebi-line                { color: var(--muted); border-color: var(--border); }
body.light-theme .cx-step0-item              { border-color: var(--border); }
body.light-theme .cx-step0-item--active      { border-color: var(--blue-soft, #3A7EB6); background: rgba(58,126,182,0.05); }
body.light-theme .cx-step0-item--ticked      { border-color: var(--green-soft, #00C46A); background: rgba(0,196,106,0.06); }
body.light-theme .cx-step0-text              { color: var(--text-primary); }
body.light-theme .cx-step0-item--locked .cx-step0-text { color: var(--muted); }
body.light-theme .cx-rule-input               { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-rule-prev-item           { border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-rule-row                 { border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-classify-btn             { background: var(--bg-inset, #e0dbd5); border-color: var(--border); }
body.light-theme .cx-classify-label           { color: var(--text-primary); }
body.light-theme .cx-classify-desc            { color: var(--muted); }
body.light-theme .cx-classify-selected        { border-color: var(--text-primary) !important; }
body.light-theme .cx-classify-guess           { color: var(--muted); }
body.light-theme .cx-review-identity          { color: var(--text-primary); }
body.light-theme .cx-lock-line                { color: var(--text-primary); border-color: var(--border); }
body.light-theme .cx-btn-primary              { background: var(--text-primary); color: var(--bg-base, #f5f0eb); border-color: var(--text-primary); }
body.light-theme .cx-btn-secondary            { color: var(--muted); border-color: var(--border); }

body.light-theme .cx-checkin-backdrop         { background: rgba(245,240,235,0.88); }
body.light-theme .cx-checkin-dialog           { background: var(--bg-card); border-color: var(--border); }
body.light-theme .cx-checkin-header           { border-color: var(--border); }
body.light-theme .cx-checkin-footer           { border-color: var(--border); }
body.light-theme .cx-checkin-title            { color: var(--text-primary); }
body.light-theme .cx-checkin-identity         { color: var(--muted); border-color: var(--border); }
body.light-theme .cx-anchor-btn               { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--muted); }
body.light-theme .cx-anchor-selected          { color: var(--text-primary) !important; border-color: var(--text-primary) !important; }
body.light-theme .cx-rule-check-row           { border-color: var(--border); }
body.light-theme .cx-rule-check-text          { color: var(--text-primary); }
body.light-theme .cx-radio-label              { color: var(--text-primary); }
body.light-theme .cx-severity-label           { color: var(--text-primary); }
body.light-theme .cx-theme-label              { color: var(--text-primary); }
body.light-theme .cx-cond-q                   { color: var(--muted); }
body.light-theme .cx-breach-section           { background: rgba(239,68,68,0.03); border-color: rgba(239,68,68,0.1); }
body.light-theme .cx-breach-q                 { color: var(--muted); }
body.light-theme .cx-field-textarea           { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-breach-rationale         { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-late-textarea            { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-unanchored-card          { background: rgba(245,158,11,0.04); border-color: rgba(245,158,11,0.12); }
body.light-theme .cx-unanchored-q             { color: var(--text-primary); }
body.light-theme .cx-crash-recovery           { background: rgba(245,158,11,0.04); border-color: rgba(245,158,11,0.15); color: var(--text-primary); }
body.light-theme .cx-step-rule-preview        { color: var(--text-primary); border-color: var(--border); }
body.light-theme .cx-success-line             { color: var(--text-primary); }
body.light-theme .cx-late-deadline-note       { color: var(--muted); }
body.light-theme .cx-late-prompt              { color: var(--text-primary); }
body.light-theme .cx-notrade-heading          { color: var(--text-primary); }
body.light-theme .cx-notrade-detail           { color: var(--muted); }
body.light-theme .cx-validation-fail          { background: rgba(239,68,68,0.05); border-color: rgba(239,68,68,0.15); }
body.light-theme .cx-val-message              { color: var(--text-primary); }
body.light-theme .cx-validation-warn          { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.15); }
body.light-theme .cx-premarket-overlay        { background: linear-gradient(180deg, rgba(245,240,235,0.85) 0%, rgba(245,240,235,0) 100%); }
body.light-theme .cx-probation-banner         { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }

/* → Moved to css/lazy/verdict.css (lazy-loaded on cycle:open-verdict) */
/* ═══════════════════════════════════════════════════════════════════════════
   AUTOPSY CASE FILE  (.cx-autopsy-*)
   → Moved to css/lazy/autopsy.css (lazy-loaded on first cycle:open-autopsy)
   ═══════════════════════════════════════════════════════════════════════════ */

/* → Moved to css/lazy/cycleEntry.css (lazy-loaded on cycleEntry open) */
/* → Moved to css/lazy/threeStrikes.css (lazy-loaded on cycle:fail-routing) */
/* → Moved to css/lazy/midpoint.css (lazy-loaded on cycle:open-midpoint) */
/* → Modal styles moved to css/lazy/vacation.css (lazy-loaded on cycle:open-vacation) */
/* ── Cycle footer nav — first-paint, stays eager ── */
.cx-cycle-footer {
  display: flex; gap: 16px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
  margin-top: 16px;
}
.cx-cycle-footer-link {
  background: none; border: none; padding: 0;
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--muted, #888);
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: color 120ms;
}
.cx-cycle-footer-link:hover { color: var(--text-secondary, #b8b4ae); }
body.light-theme .cx-cycle-footer          { border-color: var(--border); }
body.light-theme .cx-cycle-footer-link     { color: var(--muted); }
body.light-theme .cx-cycle-footer-link:hover { color: var(--text-secondary); }
/* → Moved to css/lazy/probation.css (lazy-loaded on calibrationProbation/returnCeremony open) */
/* ═══════════════════════════════════════════════════════════════════════════
/* → Moved to css/lazy/cycleHistory.css (lazy-loaded on cycle:open-history) */
/* → Moved to css/lazy/mirror.css (lazy-loaded on disciplineMirror.openModal) */
/* → Mirror light-mode — see css/lazy/mirror.css */
/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — Behavioral OS + Commitment Cycle
   Single 640px breakpoint covering ceremony modal, EOD/reminder cards,
   Mirror modal, intercept modals, and header pill. Visual layout only —
   no functional changes.
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* ── Ceremony modal: near-fullscreen on phones ───────────────────────────── */
  .cx-ceremony-dialog {
    max-width: none;
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 4px;
  }
  .cx-ceremony-header  { padding: 10px 12px 8px; }
  .cx-ceremony-body    { padding: 14px 14px 12px; }
  .cx-ceremony-footer  {
    padding: 10px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .cx-ceremony-footer .cx-btn { flex: 1 1 auto; min-width: 0; }
  .cx-ceremony-footer .cx-btn-link,
  .cx-ceremony-footer .cx-anchor-skip { flex: 1 0 100%; text-align: center; margin-right: 0; }

  /* Tier picker — 2 columns instead of 4 */
  .cx-tier-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cx-tier-days { font-size: 48px; }

  /* Step body text scaling */
  /* This rule is NOT dead. Inside `.cx-ceremony-dialog` it is correctly
     outranked by the 2-class `.cx-ceremony-dialog .cx-step-headline` rule
     (Rule Builder section, trailing @media (max-width: 640px) block) — edit
     the ceremony size THERE. But renderRuleBuilder also renders
     `.cx-step-headline` into cycleEntry.js's revise-rules modal, which is
     `.cx-entry-dialog`, NOT `.cx-ceremony-dialog`. That surface has no
     2-class rule, so this is its only mobile sizing; deleting it silently
     bumps revise-rules to the 18px desktop base on phones. */
  .cx-step-headline { font-size: 16px; }
  .cx-step-eyebrow  { font-size: 9px; }
  .cx-step-rule-preview { font-size: 14px; }
  .cx-classify-btn { padding: 12px 14px; }
  .cx-classify-label { font-size: 13px; }
  .cx-classify-desc  { font-size: 11px; }
  .cx-rule-row { gap: 8px; }
  .cx-rule-text { font-size: 13px; }
  .cx-anchor-input { font-size: 16px; /* 16px prevents iOS zoom on focus */ }
  .cx-rule-input { font-size: 16px; }
  .cx-builder-word-input { font-size: 16px; }

  /* Rule Builder two-pane split lives in its own @media block further down,
     right after the Rule Builder's base/desktop rules — those base rules
     are declared LATER in this file (§ "Rule Builder (step 2 pick-and-tweak)")
     and would win a same-specificity cascade tie against an override placed
     up here. See that trailing block for the actual mobile overrides. */

  /* Anchor pills — stack vertically so labels don't truncate */
  .cx-anchor-pills { flex-direction: column; gap: 6px; }
  .cx-anchor-pills .cx-anchor-btn { width: 100%; }

  /* Lock review section — let it breathe */
  .cx-review-meta { font-size: 11px; }
  .cx-anchor-summary { font-size: 12px; line-height: 1.5; }

  /* ── Skip reminder ───────────────────────────────────────────────────────── */
  .bx-reminder-card {
    width: calc(100vw - 24px);
    max-width: none;
    padding: 16px 16px 14px;
  }
  .bx-reminder-actions { flex-direction: column; gap: 8px; }
  .bx-reminder-actions .bx-pill { width: 100%; }

  .bx-mirror-top-row { grid-template-columns: 1fr; gap: 10px; }

  /* Card head: stack title + actions; end-session block becomes column */
  .bx-card-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .bx-card-head-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .bx-end-session-wrap { align-items: stretch; }
  .bx-end-session-wrap .bx-skip { width: 100%; }
  .bx-end-session-hint { text-align: center; }
  .bx-card-head-actions > .bx-skip { width: 100%; }

  /* Streak hero — column layout on phones */
  .bx-streak-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .bx-streak-num  { font-size: 42px; }
  .bx-streak-flame { font-size: 32px; }

  /* Identity hero text scaling */
  .bx-identity-hero { padding: 14px 14px; }

  /* ── Intercept modals (Return / Probation) ───────────────────────────────── */
  .cx-return-dialog,
  .cx-prob-dialog {
    width: calc(100vw - 24px);
    max-width: none;
    padding: 18px 16px 16px;
  }

  /* ── Status pill in header (the only behavioral element on the dashboard) ─ */
  #bxStatusPill {
    font-size: 9.5px;
    letter-spacing: 0.4px;
    padding: 4px 8px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
  }
  #bxStatusPill .bx-arr { display: none; }

  /* ── Today panel (cycle CTA) ─────────────────────────────────────────────── */
  .cx-cta-btn { width: 100%; padding: 12px 14px; }

}

/* Tighter breakpoint for very small phones (≤380px) — drop further padding */
@media (max-width: 380px) {
  .cx-ceremony-body    { padding: 10px 10px 10px; }
  .cx-ceremony-header  { padding: 8px 10px 6px; }
  .cx-ceremony-footer  { padding: 8px 10px; }
  .cx-tier-grid        { grid-template-columns: 1fr 1fr; gap: 8px; }
  /* Same split as the 640px block above: the ceremony keeps 21px down to
     360px and below (its 2-class rule wins), while this line remains the
     only ≤380px sizing for cycleEntry.js's `.cx-entry-dialog` revise-rules
     modal, which the 2-class rule never matches. */
  .cx-step-headline    { font-size: 15px; }
}

/* ── Cycle History: Autopsy + Iron Record ────────────────────────────────────── */
.bx-history-card { display: flex; flex-direction: column; gap: 0; }

/* Dot selector — replaces bx-cycle-history-dots */
.bx-history-dots {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 10px 0 2px;
}
.bx-history-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #334155;
  background: #1e293b;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
  flex-shrink: 0;
}
.bx-history-dot:hover { transform: scale(1.25); }
.bx-history-dot-active { border-color: var(--text-primary) !important; transform: scale(1.2); }

/* Grade colours reusing existing token names */
.bx-history-dot-platinum { background: #e2e8f0; border-color: #94a3b8; }
.bx-history-dot-gold     { background: #b45309; border-color: #d97706; }
.bx-history-dot-silver   { background: #64748b; border-color: #94a3b8; }
.bx-history-dot-bronze   { background: #78350f; border-color: #92400e; }
.bx-history-dot-fail     { background: #7f1d1d; border-color: #dc2626; }
.bx-history-dot-voided   { background: #1e293b; border-color: #334155; }
.bx-history-dot-empty    { background: #1e293b; border-color: #334155; }

body.light-theme .bx-history-dot          { background: #f1f5f9; border-color: #cbd5e1; }
body.light-theme .bx-history-dot-active   { border-color: var(--text-primary) !important; }

/* Autopsy card — broken cycle */
.bx-autopsy-card {
  padding: 10px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bx-autopsy-header {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-mute, var(--dim));
  text-transform: uppercase;
  margin-bottom: 4px;
}
.bx-autopsy-contrast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.bx-autopsy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.bx-autopsy-number {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}
.bx-autopsy-clean  { color: var(--text-primary); }
.bx-autopsy-breach { color: #dc2626; }
.bx-autopsy-stat-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--text-mute, var(--dim));
}
.bx-autopsy-vs {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute, var(--dim));
  flex-shrink: 0;
}
.bx-autopsy-verdict {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-mute, var(--dim));
  font-style: italic;
}

/* Iron Record card — completed cycle */
.bx-iron-record-card {
  padding: 10px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bx-iron-header {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--text-mute, var(--dim));
  text-transform: uppercase;
  margin-bottom: 4px;
}
.bx-iron-grade {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.05em;
}
.bx-iron-tier {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-mute, var(--dim));
  margin-bottom: 6px;
}
.bx-iron-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bx-iron-stat {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-secondary, var(--muted));
}

/* → Mirror redesign v2 — see css/lazy/mirror.css */

/* ── Rule Builder (step 2 pick-and-tweak) ───────────────────────────────────── */
/* "Quiet premium instrument" pass (2026-08-23) — restyle only, no structural/
   flow changes. --accent is scoped HERE (and on .cx-ceremony-dialog above) to
   the real brand gold token, not defined globally — dashboard.css has its own
   unrelated var(--accent, …) use that must not be touched. */
.cx-builder { --accent: var(--gold); }

/* Typography — headline/eyebrow scoped to the whole ceremony dialog (was
   `.cx-builder`-only; widened 2026-08-23 so every ceremony step — not just
   the Rule Builder — shares the same headline/eyebrow treatment and Continue
   no longer produces a visible size jump between steps). */
.cx-ceremony-dialog .cx-step-headline {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin-bottom: 18px;
}
.cx-ceremony-dialog .cx-step-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent, var(--gold));
  opacity: .72;
}

@keyframes cx-pop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes cx-pane-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Write-your-own — collapsed behind a disclosure */
.cx-builder-own {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.cx-builder-own-input {
  width: 100%;
  font-size: 14px !important;
}
.cx-builder-own-max {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted, rgba(255,255,255,.4));
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Disclosure button — "write my own rule" / "add your own words". Solid
   quiet surface with a circular plus badge, not a dashed placeholder (a
   dashed border reads as disabled). */
.cx-builder-disclose {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  text-align: left;
  background: rgba(255,255,255,.028);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, rgba(255,255,255,.5));
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.cx-builder-disclose-plus {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: var(--accent, var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.cx-builder-disclose-label { flex: 1; min-width: 0; }
.cx-builder-disclose:hover {
  border-color: var(--gold-line);
  color: var(--text-primary, #fff);
  background: rgba(255,255,255,.045);
}
.cx-builder-disclose:hover .cx-builder-disclose-plus {
  background: rgba(232,163,61,.16);
}

/* Outcome chips (category mode — unchanged) */
.cx-builder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.cx-builder-chip {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 14px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 20px;
  background: transparent;
  color: var(--muted, rgba(255,255,255,.5));
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.cx-builder-chip:hover {
  border-color: var(--text-secondary, rgba(255,255,255,.5));
  color: var(--text-primary, #fff);
}
.cx-builder-chip--active {
  border-color: var(--accent, var(--gold));
  color: var(--accent, var(--gold));
  background: rgba(232,163,61,.09);
}

/* Mistake picker — flaw mode. Full-width tappable rows, sentence case, not
   pill chips: eight of those wrap to four ragged rows on a phone. Desktop
   default is a compact 2-column grid; mobile forces 1 column (§ 640px).

   Surface system (dark, layered, restrained — "quiet premium instrument"):
   resting rows/cards get a soft top-lit gradient + inset highlight instead
   of a flat fill; hover (desktop only) nudges the border to brand gold;
   selected gets a gold wash + glow. Same recipe on .cx-flaw-row and
   .cx-builder-card so the two surfaces read as one visual language. */
.cx-flaw-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.cx-flaw-row,
.cx-builder-card {
  background: linear-gradient(180deg, rgba(255,255,255,.048), rgba(255,255,255,.016));
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 1px 2px rgba(0,0,0,.35);
}
@media (hover: hover) {
  .cx-flaw-row:hover,
  .cx-builder-card:hover {
    border-color: var(--gold-line);
    background: linear-gradient(180deg, rgba(255,255,255,.065), rgba(255,255,255,.024));
  }
}
@media (prefers-reduced-motion: no-preference) {
  .cx-flaw-row, .cx-builder-card { transition: border-color 150ms, background 150ms, box-shadow 150ms, transform 90ms ease; }
  .cx-flaw-row:active, .cx-builder-card:active { transform: scale(.985); }
}
@media (prefers-reduced-motion: reduce) {
  .cx-flaw-row, .cx-builder-card { transition: border-color 150ms, background 150ms, box-shadow 150ms; }
}
.cx-flaw-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.cx-flaw-row--active {
  background: rgba(232,163,61,.10);
  background: linear-gradient(180deg, color-mix(in oklab, var(--gold) 15%, transparent), color-mix(in oklab, var(--gold) 5%, transparent));
  border-color: rgba(232,163,61,.55);
  border-color: color-mix(in oklab, var(--gold) 55%, transparent);
  box-shadow: 0 0 0 1px rgba(232,163,61,.18), 0 6px 18px -8px rgba(232,163,61,.45);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--gold) 18%, transparent), 0 6px 18px -8px color-mix(in oklab, var(--gold) 45%, transparent);
}
.cx-flaw-radio {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.22);
  position: relative;
}
.cx-flaw-row--active .cx-flaw-radio {
  border-color: var(--accent, var(--gold));
}
.cx-flaw-row--active .cx-flaw-radio::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--gold-grad);
  transform: translate(-50%, -50%);
}
@media (prefers-reduced-motion: no-preference) {
  .cx-flaw-row--active .cx-flaw-radio::after {
    animation: cx-pop 260ms cubic-bezier(.34,1.4,.64,1);
  }
}
.cx-flaw-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--text-primary, #fff);
  line-height: 1.35;
}

/* Real progress indicator (mobile only — replaces the "1 of 2" grey text;
   see § 640px block for the visible layout). Desktop keeps both panes
   visible so a linear progress bar makes no sense there. */
.cx-builder-progress { display: none; }
.cx-builder-progress-seg {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.09);
}
.cx-builder-progress-seg--on { background: var(--gold-grad); }
@media (prefers-reduced-motion: no-preference) {
  .cx-builder-progress-seg { transition: background 240ms ease, width 240ms ease; }
}

/* Two-pane mobile split (ceremony Step 2 only — see paneGated in
   ruleBuilder.js). Both panes render every time; visibility is CSS-driven
   off data-pane, never a JS media query. Desktop default: both visible,
   no back row, no step counter, no "Next" button. */
.cx-builder-pane { display: block; }
.cx-builder-eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cx-builder-eyebrow-row .cx-step-eyebrow { margin-bottom: 0; }
.cx-builder-stepcount {
  display: none;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--muted, rgba(255,255,255,.4));
  white-space: nowrap;
  flex-shrink: 0;
}
/* Back row → breadcrumb pill. Visually compact (does not stretch full
   width); the ≥44px tap target comes from a transparent ::before hit area,
   not from min-height on the pill itself. */
.cx-builder-back {
  display: none;
  position: relative;
  align-items: center;
  gap: 4px;
  width: fit-content;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  padding: 7px 13px;
  margin: 0 0 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12.5px;
  color: var(--muted, rgba(255,255,255,.5));
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.cx-builder-back::before {
  content: '';
  position: absolute;
  inset: -12px -8px;
}
.cx-builder-back-flaw {
  color: var(--accent, var(--gold));
  font-weight: 600;
}
.cx-builder-sub {
  font-size: 13px;
  color: rgba(241,245,249,.45);
  margin: -4px 0 12px;
}
#cxBuilderNext { display: none; }

/* Step S — Skill Tier chips (commitmentCeremony/index.js _renderStepSkillTier) */
.cx-skill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}
.cx-skill-chip {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  letter-spacing: 0.4px;
  padding: 9px 16px;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  border-radius: 20px;
  background: transparent;
  color: var(--muted, rgba(255,255,255,.5));
  cursor: pointer;
  transition: border-color 150ms, color 150ms, background 150ms;
}
.cx-skill-chip:hover {
  border-color: var(--text-secondary, rgba(255,255,255,.5));
  color: var(--text-primary, #fff);
}
.cx-skill-chip--selected {
  border-color: var(--accent, var(--gold));
  color: var(--accent, var(--gold));
  background: rgba(232,163,61,.09);
}
body.light-theme .cx-skill-chip { border-color: var(--border); color: var(--muted); }
body.light-theme .cx-skill-chip--selected { background: rgba(176,122,30,.09); }

/* Library cards — tap toggles the rule in place (add ⇄ remove). Cards never
   move and are never disabled; the leading box is the tap affordance. */
.cx-builder-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 12px;
}
.cx-builder-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.cx-builder-card--added {
  background: rgba(232,163,61,.10);
  background: linear-gradient(180deg, color-mix(in oklab, var(--gold) 15%, transparent), color-mix(in oklab, var(--gold) 5%, transparent));
  border-color: rgba(232,163,61,.55);
  border-color: color-mix(in oklab, var(--gold) 55%, transparent);
  box-shadow: 0 0 0 1px rgba(232,163,61,.18), 0 6px 18px -8px rgba(232,163,61,.45);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--gold) 18%, transparent), 0 6px 18px -8px color-mix(in oklab, var(--gold) 45%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .cx-builder-card--added .cx-builder-card-box {
    animation: cx-pop 260ms cubic-bezier(.34,1.4,.64,1);
  }
}
.cx-builder-card-box {
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-top: 1px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.cx-builder-card--added .cx-builder-card-box {
  border-color: var(--accent, var(--gold));
  background: var(--gold-grad);
  color: #1b1206;
}
.cx-builder-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.cx-builder-card-text {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary, #fff);
  line-height: 1.45;
}
.cx-builder-card-hint {
  font-size: 12.5px;
  color: rgba(241,245,249,.42);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: normal;
}

/* Orphan rules — selected rules not represented by a card in the currently
   visible library list (free-typed, carried forward, or added under a
   different category). Rendered as an extra already-added group below the
   library cards so nothing a user picked ever silently disappears. */
.cx-builder-group-label {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted, rgba(255,255,255,.35));
  margin: 14px 0 6px;
}

/* Footer live count — replaces the old 3-row checklist block */
.cx-builder-count {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted, rgba(255,255,255,.45));
  margin-right: auto;
  align-self: center;
}
.cx-builder-count--has {
  color: var(--accent, var(--gold));
}
.cx-builder-count--has::before {
  content: '●';
  margin-right: 6px;
  font-size: 8px;
}

/* Continue button "wakes up" pulse */
@keyframes cx-continue-wake {
  0%   { box-shadow: 0 0 0 0 rgba(232,163,61,0); }
  40%  { box-shadow: 0 0 0 6px rgba(232,163,61,.25); }
  100% { box-shadow: 0 0 0 0 rgba(232,163,61,0); }
}
@media (prefers-reduced-motion: no-preference) {
  .cx-builder-continue--ready { animation: cx-continue-wake 600ms ease forwards; }
}

/* Footer buttons — scoped by id so the global .cx-btn-primary used across
   the rest of the app is untouched. */
#cxBuilderContinue,
#cxBuilderNext {
  border-radius: 10px;
  min-height: 50px;
  font-size: 15px;
  font-weight: 700;
}
#cxBuilderContinue:not(.cx-btn-disabled),
#cxBuilderNext:not(.cx-btn-disabled) {
  background: var(--gold-grad);
  color: #1b1206;
  box-shadow: 0 6px 18px -8px rgba(232,163,61,.6);
  box-shadow: 0 6px 18px -8px color-mix(in oklab, var(--gold) 60%, transparent);
}
#cxBuilderContinue.cx-btn-disabled,
#cxBuilderNext.cx-btn-disabled {
  background: rgba(255,255,255,.05);
  color: rgba(241,245,249,.35);
  box-shadow: none;
  cursor: not-allowed;
}

/* Free-type fallback */
.cx-builder-freetype { margin-top: 8px; }
.cx-builder-freetype-area {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cx-builder-freetype-hint {
  font-size: 12px;
  color: var(--muted, rgba(255,255,255,.4));
  min-height: 16px;
  transition: color 150ms;
}
.cx-builder-hint--warn { color: var(--gold); }

/* Inline identity — "YOUR WORD" (ceremony Step 2 only) */
.cx-builder-word {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(255,255,255,.1));
}
.cx-builder-word-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.cx-builder-word-opt {
  font-size: 11px;
  letter-spacing: normal;
  text-transform: none;
  color: var(--muted, rgba(255,255,255,.4));
}
.cx-builder-word-input {
  width: 100%;
  background: var(--bg-inset, #0a0f1e);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 10px 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  box-sizing: border-box;
  resize: vertical;
}
.cx-builder-word-input:focus {
  outline: none;
  border-color: var(--muted);
}

/* Light-mode overrides — --gold/--gold-grad/--gold-line already flip to the
   light palette via tokens.css, so every var(--accent)/var(--gold-*)/
   color-mix(…, var(--gold) …) declaration above is correct for free here.
   These overrides only touch the plain rgba/hex surfaces that don't derive
   from the token. */
body.light-theme .cx-builder-chip { border-color: var(--border); color: var(--muted); }
body.light-theme .cx-builder-chip--active { background: rgba(176,122,30,.09); }
body.light-theme .cx-flaw-row,
body.light-theme .cx-builder-card {
  background: linear-gradient(180deg, rgba(0,0,0,.028), rgba(0,0,0,.008));
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 1px 2px rgba(60,50,40,.08);
}
body.light-theme .cx-builder-card-text { color: var(--text-primary); }
body.light-theme .cx-builder-card-hint { color: var(--muted); }
body.light-theme .cx-builder-card-box { border-color: var(--border); }
body.light-theme .cx-builder-word { border-color: var(--border); }
body.light-theme .cx-builder-word-input { background: var(--bg-inset, #e0dbd5); border-color: var(--border); color: var(--text-primary); }
body.light-theme .cx-flaw-radio { border-color: var(--border); }
body.light-theme .cx-flaw-label { color: var(--text-primary); }
body.light-theme .cx-builder-disclose {
  background: rgba(0,0,0,.025);
  border-color: var(--border);
  color: var(--muted);
}
body.light-theme .cx-builder-disclose-plus { background: rgba(0,0,0,.05); }
body.light-theme .cx-builder-back {
  background: rgba(0,0,0,.035);
  border-color: rgba(0,0,0,.08);
  color: var(--muted);
}
body.light-theme .cx-builder-back-flaw { color: var(--text-primary); }
body.light-theme .cx-builder-count { color: var(--muted); }
body.light-theme .cx-builder-sub { color: var(--muted); }
body.light-theme .cx-builder-group-label { color: var(--muted); }
body.light-theme .cx-builder-stepcount { color: var(--muted); }
body.light-theme .cx-builder-progress-seg { background: rgba(0,0,0,.08); }

/* Light-theme SELECTED states — specificity repair, not decoration.
   The resting overrides above are `body.light-theme .cx-builder-card` (0,2,1),
   which outranks the selected rules `.cx-builder-card--added` (0,1,0). Without
   these, every gold selected state silently dies under light theme and only
   the checkbox fill survives — a picked rule looks identical to an unpicked
   one. Each selector below must therefore carry the `body.light-theme` prefix
   to outrank its own resting rule. Mirrors the dark recipe; --gold already
   resolves to the light triad (#B07A1E) via css/tokens.css. */
body.light-theme .cx-flaw-row--active,
body.light-theme .cx-builder-card--added {
  background: linear-gradient(180deg, rgba(176,122,30,.17), rgba(176,122,30,.06));
  background: linear-gradient(180deg, color-mix(in oklab, var(--gold) 18%, transparent), color-mix(in oklab, var(--gold) 6%, transparent));
  border-color: rgba(176,122,30,.6);
  border-color: color-mix(in oklab, var(--gold) 60%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 0 1px rgba(176,122,30,.2), 0 6px 18px -8px rgba(176,122,30,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 0 1px color-mix(in oklab, var(--gold) 20%, transparent), 0 6px 18px -8px color-mix(in oklab, var(--gold) 45%, transparent);
}
body.light-theme .cx-flaw-row--active .cx-flaw-radio,
body.light-theme .cx-builder-card--added .cx-builder-card-box {
  border-color: var(--gold);
}
body.light-theme .cx-builder-count--has { color: var(--gold); }
body.light-theme #cxBuilderContinue.cx-btn-disabled,
body.light-theme #cxBuilderNext.cx-btn-disabled { background: rgba(0,0,0,.05); color: rgba(26,22,18,.35); }

/* Two-pane mobile split overrides — must come AFTER the base/desktop rules
   above so a same-specificity cascade tie resolves in mobile's favour (the
   shared @media (max-width: 640px) block near the top of this file is
   earlier in source order than this section, so overrides placed there
   would lose to these base declarations). */
@media (max-width: 640px) {
  .cx-builder[data-pane] .cx-builder-pane { display: none; }
  .cx-builder[data-pane="mistake"] .cx-builder-pane--mistake { display: block; }
  .cx-builder[data-pane="rules"] .cx-builder-pane--rules { display: block; }
  @media (prefers-reduced-motion: no-preference) {
    /* One-shot: JS adds this class only on an actual mistake↔rules pane
       change, never on a same-pane re-render (e.g. a rule-card toggle) —
       see ruleBuilder.js's _lastRenderedPane tracking. Keying this off the
       data-pane attribute instead would replay the animation on every
       innerHTML rebuild of the pane, which is the "whole screen flashes on
       every tap" bug this guards against. */
    .cx-builder-pane--enter {
      animation: cx-pane-in 240ms ease-out;
    }
  }
  .cx-builder-back { display: inline-flex; }
  /* .cx-builder-stepcount stays display:none (its base rule) on mobile now —
     the real progress bar below replaces the "1 of 2" grey text. Desktop is
     unaffected (already hidden there via the base rule). */
  .cx-builder-progress { display: flex; gap: 6px; margin-bottom: 14px; }
  .cx-ceremony-dialog .cx-step-headline { font-size: 21px; }
  .cx-flaw-list { grid-template-columns: 1fr; }
  [data-pane="mistake"] #cxBuilderNext { display: inline-block; }
  [data-pane="mistake"] #cxBuilderContinue { display: none; }
  [data-pane="rules"] #cxBuilderNext { display: none; }
  [data-pane="rules"] #cxBuilderContinue { display: inline-block; }
  .cx-builder-count { flex: 1 0 100%; order: -1; margin-right: 0; }
  /* The rule count belongs to the rules pane. On the mistake pane it answers
     a question the user has not been asked yet ("No rules yet" before rules
     are ever mentioned), so hide it there. Desktop shows both panes at once,
     so the count stays visible there — this is mobile-only by design. */
  [data-pane="mistake"] .cx-builder-count { display: none; }
  /* Pre-existing bug swept up in this pass: .cx-builder-own-input's base
     rule hardcodes 14px !important (unconditional), which silently beat the
     shared mobile block's `.cx-rule-input { font-size: 16px; }` (no
     !important) — the free-type textarea was zooming on iOS focus. Must
     also be !important to win against that base rule. */
  .cx-builder-own-input { font-size: 16px !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   LIGHT-MODE GAP CLOSERS — surfaces that hardcoded dark hex with no light
   override (left dark islands / harsh scrims on cream). Cosmetic only.
   ════════════════════════════════════════════════════════════════════════ */

/* modal backdrop scrims — pure-black is harsh on cream; paper-tint instead */
body.light-theme .sig-modal-bg { background: rgba(60,50,40,0.42); }
body.light-theme .pay-modal-bg { background: rgba(60,50,40,0.42); }

/* header date-dropdown status pills — neon green is low-contrast on the
   light dropdown panel; soften to the institutional green token */
body.light-theme .dt-drop-replay-active {
  color: var(--green-soft, #0A9950) !important;
  border-color: rgba(10,153,80,0.40) !important;
  background: rgba(10,153,80,0.08) !important;
}
body.light-theme .dt-drop-live {
  color: var(--green-soft, #0A9950) !important;
  border-color: rgba(10,153,80,0.40) !important;
  background: rgba(10,153,80,0.07) !important;
}
body.light-theme .dt-drop-live:hover { background: rgba(10,153,80,0.14) !important; }

/* signal-log overlay is light-themed (.sl-modal → white) but these dark-navy
   chips/dividers were never flipped */
body.light-theme .sl-summary-sep { background: var(--border-subtle, #c8c0b8); }
body.light-theme .sl-card--suppressed { border-left-color: var(--border-subtle, #c8c0b8); }
body.light-theme .sl-card-strength { background: rgba(26,22,18,0.06); color: var(--text-dim, #7a6f65); }
body.light-theme .sl-outcome--neutral,
body.light-theme .sl-outcome--flat,
body.light-theme .sl-outcome--live { color: var(--text-dim, #7a6f65); background: rgba(26,22,18,0.05); }
body.light-theme .sl-outcome--pend { color: var(--text-dim, #7a6f65); background: rgba(26,22,18,0.04); }
