/* === Design Tokens === */
:root {
  --bg-primary: #08090d;
  --bg-surface: #11131a;
  --bg-elevated: #1a1c25;
  --border: #1e2028;
  --border-subtle: #141620;
  --text-primary: #e8e9ed;
  --text-secondary: #6b6f7b;
  --text-muted: #3d4150;
  --green: #00d672;
  --green-dim: rgba(0, 214, 114, 0.12);
  --red: #ff3b5c;
  --red-dim: rgba(255, 59, 92, 0.12);
  --amber: #f0b429;
  --amber-dim: rgba(240, 180, 41, 0.12);
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --section-padding: clamp(2.5rem, 6vw, 5rem);
  --content-max: 920px;
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-display);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Subtle top glow */
body::before {
  content: '';
  position: fixed;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(0, 214, 114, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* === Portfolio Navbar === */
.portfolio-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.portfolio-navbar::-webkit-scrollbar { display: none; }

.portfolio-navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  opacity: 0.92;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: -1;
  border-bottom: 1px solid var(--border-subtle);
}

.portfolio-navbar:empty { display: none; }

.navbar-label {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 0.25rem;
}

.portfolio-btn {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.portfolio-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.portfolio-btn.active {
  background: var(--bg-elevated);
  border-color: var(--green);
  color: var(--text-primary);
}

/* === View Switcher === */
.view-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.5rem clamp(1rem, 4vw, 2rem);
}

.view-btn {
  font-family: var(--font-display);
  font-size: 0.68rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.view-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.view-btn.active {
  background: var(--bg-elevated);
  border-color: var(--green);
  color: var(--text-primary);
}

.view-btn-label { font-weight: 500; }

.view-btn-desc {
  font-size: 0.56rem;
  color: var(--text-muted);
}

.view-btn.active .view-btn-desc { color: var(--text-secondary); }

/* === Layout === */
.dashboard {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* === Sections (shared) === */
.section-hero,
.section-overview,
.section-equity,
.section-positions,
.section-decisions,
.section-strategies,
.section-trades,
.section-pipeline,
.section-funnel,
.section-stats,
.section-journal,
.section-footer {
  padding: var(--section-padding) 0;
}

.section-equity,
.section-positions,
.section-decisions,
.section-strategies,
.section-trades,
.section-pipeline,
.section-funnel,
.section-stats,
.section-journal {
  border-top: 1px solid var(--border-subtle);
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* === Hero === */
.section-hero {
  position: relative;
  padding: clamp(4rem, 10vw, 8rem) 0 var(--section-padding);
  overflow: hidden;
}

.hero-curve {
  position: absolute;
  bottom: 0;
  left: -5%;
  width: 110%;
  height: 70%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-label {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-value {
  font-family: var(--font-mono);
  font-size: clamp(3.2rem, 10vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.hero-return {
  font-family: var(--font-mono);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 500;
  margin-top: 0.25rem;
}

.hero-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.hero-mode {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}
.mode-pill {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: capitalize;
}
.mode-pill-mode {
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.mode-pill-persona {
  color: var(--green);
  background: var(--green-dim);
}

.positive { color: var(--green); }
.negative { color: var(--red); }

/* Hero entrance */
.hero-content > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.7s ease-out forwards;
}
.hero-content > *:nth-child(1) { animation-delay: 0.1s; }
.hero-content > *:nth-child(2) { animation-delay: 0.25s; }
.hero-content > *:nth-child(3) { animation-delay: 0.4s; }
.hero-content > *:nth-child(4) { animation-delay: 0.55s; }
.hero-content > *:nth-child(5) { animation-delay: 0.7s; }

/* === Overview === */
.overview-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.overview-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 100px;
}

.overview-stat .stat-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.overview-stat .stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === Equity Chart === */
.equity-chart-wrap {
  position: relative;
}

.equity-chart {
  width: 100%;
  aspect-ratio: 3 / 1;
  min-height: 200px;
}

.equity-chart svg {
  width: 100%;
  height: 100%;
}

.equity-axis-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}

/* Hover layer */
.eq-hover-layer {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.eq-crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--text-muted);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.eq-dot {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  border: 1.5px solid var(--bg-primary);
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  box-shadow: 0 0 6px rgba(0, 214, 114, 0.4);
}

.eq-tooltip {
  position: absolute;
  top: -4px;
  transform: translate(-50%, -100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  z-index: 10;
}

.eq-hover-layer.active .eq-crosshair,
.eq-hover-layer.active .eq-dot,
.eq-hover-layer.active .eq-tooltip { opacity: 1; }

.eq-tt-date {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--text-muted);
}

.eq-tt-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.eq-tt-ret {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
}

.eq-tt-dd {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--red);
}

/* Trades panel — separate tooltip, left-justified below dot */
.eq-trades-panel {
  position: absolute;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  white-space: nowrap;
  z-index: 9;
}

.eq-trades-panel.visible { opacity: 1; }
.eq-hover-layer:not(.active) .eq-trades-panel { opacity: 0; }

.eq-tp-header {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.1rem;
}

.eq-tt-trade {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.56rem;
}

.eq-tt-sym {
  font-weight: 600;
  color: var(--text-primary);
}

.eq-tt-side {
  font-size: 0.48rem;
  font-weight: 700;
  padding: 0 0.2rem;
  border-radius: 2px;
}

.eq-tt-side.long { color: var(--green); background: rgba(0, 214, 114, 0.1); }
.eq-tt-side.short { color: var(--red); background: rgba(255, 59, 92, 0.1); }

/* === Positions === */
.positions-total {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.positions-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.position-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  flex: 1 1 calc(50% - 0.75rem);
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.2s ease;
}

.position-card:hover { border-color: var(--border); }

.position-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.position-symbol {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
}

.position-size {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  margin-left: auto;
}

.position-prices {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.position-arrow {
  color: var(--text-muted);
  font-size: 0.55rem;
}

.position-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.position-strategy {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
}

.position-pnl {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: auto;
}

/* Stagger position cards */
.positions-grid .position-card { transition-delay: calc(var(--i, 0) * 60ms); }

/* === Strategy Cards === */
.strategies-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.strategy-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  flex: 1 1 calc(50% - 0.75rem);
  min-width: 240px;
  transition: border-color 0.2s ease;
}

.strategy-card:hover {
  border-color: var(--border);
}

.strategy-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.strategy-dot.active { background: var(--green); box-shadow: 0 0 6px var(--green-dim); }
.strategy-dot.stopped { background: var(--text-muted); }

.strategy-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.strategy-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strategy-symbol {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.strategy-return {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* === Trades List === */
.trades-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.trade-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.trade-row:last-child { border-bottom: none; }

.trade-symbol {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  width: 90px;
  flex-shrink: 0;
}

.trade-side {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.trade-side.long { color: var(--green); background: var(--green-dim); }
.trade-side.short { color: var(--red); background: var(--red-dim); }

.trade-times {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

.trade-arrow {
  color: var(--text-muted);
  font-size: 0.6rem;
}

.trade-tz {
  color: var(--text-muted);
  font-size: 0.58rem;
  margin-left: 0.1rem;
}

.trade-pnl {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

/* === Stats Grid === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem 2rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 600;
}

.stat-card .stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === Footer === */
.section-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* === Scroll Animation === */
[data-animate] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-animate].visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children of strategy grid */
.strategies-grid .strategy-card { transition-delay: calc(var(--i, 0) * 60ms); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drawLine {
  from { stroke-dashoffset: var(--line-length); }
  to { stroke-dashoffset: 0; }
}

/* === Error State === */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* === Strategy MC Badges === */
.strategy-mc { display: flex; gap: 0.35rem; margin-top: 0.2rem; }
.mc-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--green);
  background: var(--green-dim);
}
.mc-badge-wr {
  color: var(--text-secondary);
  background: var(--bg-elevated);
}

/* === Trade Detail Sub-row === */
.trade-entry-group { border-bottom: 1px solid var(--border-subtle); }
.trade-entry-group:last-child { border-bottom: none; }
.trade-entry-group .trade-row { border-bottom: none; }
.trade-detail {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
  padding: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trade-logic {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
  padding: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.trade-exit-reason {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.trade-exit-reason-take_profit { color: var(--green); background: var(--green-dim); }
.trade-exit-reason-stop_loss { color: var(--red); background: var(--red-dim); }
.trade-exit-reason-trailing_stop { color: var(--amber); background: var(--amber-dim); }
.trade-exit-reason-manual { color: var(--text-secondary); background: var(--bg-elevated); }
.trade-reasoning {
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

/* === Decisions === */
.decisions-summary {
  display: flex;
  gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.decisions-list { display: flex; flex-direction: column; }
.decision-entry {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.decision-entry:last-child { border-bottom: none; }
.decision-symbol {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  width: 80px;
  flex-shrink: 0;
}
.trade-side.hold { color: var(--text-muted); background: rgba(61, 65, 80, 0.2); }
.decision-conf {
  width: 48px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  flex-shrink: 0;
  overflow: hidden;
}
.decision-conf-bar {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.decision-status {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  width: 56px;
  flex-shrink: 0;
}
.decision-status-executed { color: var(--green); }
.decision-status-rejected { color: var(--red); }
.decision-time {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: auto;
}
.decision-reason {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Decision 2-line layout */
.decision-entry-group { border-bottom: 1px solid var(--border-subtle); }
.decision-entry-group:last-child { border-bottom: none; }
.decision-entry-group .decision-entry { border-bottom: none; }
.decision-detail {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text-muted);
  padding: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.decision-detail .decision-reason {
  white-space: normal;
  flex-basis: 100%;
}
.decision-rr {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.decision-rr-good { color: var(--green); background: var(--green-dim); }
.decision-rr-bad { color: var(--red); background: var(--red-dim); }
.decision-prices {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-secondary);
}
.decision-size {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* === Pipeline === */
.pipeline-run {
  margin-bottom: 1.25rem;
}
.pipeline-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.pipeline-id {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
}
.pipeline-status {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.pipeline-status-completed { color: var(--green); background: var(--green-dim); }
.pipeline-status-in_progress { color: var(--amber); background: var(--amber-dim); }
.pipeline-status-failed { color: var(--red); background: var(--red-dim); }
.pipeline-status-partial { color: var(--amber); background: var(--amber-dim); }
.pipeline-stages {
  display: flex;
  gap: 2px;
}
.pipeline-stage {
  flex: 1;
  height: 36px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.pipeline-stage-complete { background: var(--green-dim); }
.pipeline-stage-failed { background: var(--red-dim); }
.pipeline-stage-skipped { background: rgba(61, 65, 80, 0.2); }
.pipeline-stage-name {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.pipeline-stage-dur {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: var(--text-muted);
}
.pipeline-funnel {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

/* Pipeline compute inline */
.pipeline-compute {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.compute-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.compute-type {
  font-size: 0.58rem;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  background: var(--bg-elevated);
  border-radius: 3px;
}

/* === Funnel === */
.funnel-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.funnel-bar {
  height: 28px;
  background: var(--bg-elevated);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.6rem;
  transition: width 0.5s ease;
}
.funnel-bar-skip { border-left: 2px solid var(--amber); }
.funnel-bar-filter { border-left: 2px solid var(--red); }
.funnel-bar-exec { border-left: 2px solid var(--green); }
.funnel-bar-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
}
.funnel-bar-count {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-primary);
}
.funnel-conversion {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.attribution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.attribution-title {
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.attribution-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-secondary);
  padding: 0.2rem 0;
}

/* === Live Bar === */
.live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.6rem clamp(1rem, 4vw, 2rem);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.live-bar:empty { display: none; }

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 214, 114, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(0, 214, 114, 0); }
}

.live-label {
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.1em;
}

.live-delay {
  color: var(--text-muted);
  font-size: 0.58rem;
}

.commit-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.commit-timer-label {
  font-size: 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.commit-timer {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.commit-timer.green { color: var(--green); }
.commit-timer.amber { color: var(--amber); }
.commit-timer.red { color: var(--red); }

.commit-stats {
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* === Event Ticker === */
.ticker-strip {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.ticker-strip:empty { display: none; }

.ticker-strip::before,
.ticker-strip::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3rem;
  z-index: 2;
  pointer-events: none;
}

.ticker-strip::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-primary), transparent);
}

.ticker-strip::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-primary), transparent);
}

.ticker-track {
  display: inline-flex;
  animation: tickerScroll 40s linear infinite;
  padding: 0.45rem 0;
}

.ticker-track:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  padding: 0 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ticker-item .ticker-sym {
  font-weight: 600;
  color: var(--text-primary);
}

.ticker-item .ticker-msg { color: var(--text-secondary); }
.ticker-item .ticker-msg.positive { color: var(--green); }
.ticker-item .ticker-msg.negative { color: var(--red); }
.ticker-item .ticker-msg.long { color: var(--green); }
.ticker-item .ticker-msg.short { color: var(--red); }

.ticker-item .ticker-time {
  color: var(--text-muted);
  font-size: 0.56rem;
}

.ticker-sep {
  color: var(--border);
  padding: 0 0.25rem;
}

/* === Pulse Strip === */
.pulse-strip {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.5rem clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.6rem;
}
.pulse-strip[style*="display: none"] + .ticker-strip { border-top: none; }
.pulse-blocks {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.pulse-block {
  width: 12px;
  height: 16px;
  border-radius: 2px;
  opacity: 0.7;
}
.pulse-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pulse-stat {
  color: var(--text-muted);
  font-size: 0.58rem;
}

/* === Mode Badges (shared) === */
.live-mode-badge {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.mode-active { color: var(--green); background: var(--green-dim); }
.mode-conservative { color: var(--amber); background: var(--amber-dim); }
.mode-defensive { color: var(--red); background: var(--red-dim); }
.mode-lockdown { color: #fff; background: rgba(255, 59, 92, 0.4); }

/* === Health Dots === */
.health-dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: 0.5rem;
}
.health-label {
  font-family: var(--font-mono);
  font-size: 0.48rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.15rem;
}
.health-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.health-ok { background: var(--green); box-shadow: 0 0 4px rgba(0, 214, 114, 0.3); }
.health-warn { background: var(--amber); box-shadow: 0 0 4px rgba(240, 180, 41, 0.3); }
.health-down { background: var(--red); box-shadow: 0 0 4px rgba(255, 59, 92, 0.3); }

/* === Calibration === */
.calibration-block {
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.cal-summary {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.cal-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
.cal-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: 52px;
  text-transform: capitalize;
  flex-shrink: 0;
}
.cal-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.cal-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.cal-pct {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 32px;
  text-align: right;
  flex-shrink: 0;
}
.cal-count {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--text-muted);
  width: 56px;
  flex-shrink: 0;
}

/* === Journal === */
.journal-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.journal-entry {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-subtle);
}
.journal-entry:last-child { border-bottom: none; }
.journal-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.journal-time {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  color: var(--text-muted);
}
.journal-type {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.journal-type-standard { color: var(--green); background: var(--green-dim); }
.journal-type-deep { color: #4a9eff; background: rgba(74, 158, 255, 0.12); }
.journal-type-event { color: var(--amber); background: var(--amber-dim); }
.journal-type-pulse { color: var(--text-muted); background: var(--bg-elevated); }
.journal-type-mode { color: var(--text-secondary); background: var(--bg-elevated); }
.journal-value {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-secondary);
  margin-left: auto;
}
.journal-body {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.journal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.journal-action {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
}
.journal-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.3rem;
}
.journal-warning {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  color: var(--amber);
  background: var(--amber-dim);
}

/* === P&L Attribution (in Stats) === */
.pnl-attribution {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* === Position Exposure Bars === */
.position-exposure {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
}
.exposure-fill-bg {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.exposure-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
}
.exposure-label {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* === Risk Warnings === */
.risk-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}
.risk-warning {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: var(--amber);
  background: var(--amber-dim);
}

/* === Regime Badges === */
.regime-badge {
  font-family: var(--font-mono);
  font-size: 0.52rem;
  font-weight: 500;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}
.regime-up { color: var(--green); background: var(--green-dim); }
.regime-down { color: var(--red); background: var(--red-dim); }
.regime-ranging { color: var(--text-secondary); background: var(--bg-elevated); }
.regime-volatile { color: var(--amber); background: var(--amber-dim); }

/* === Strategy Age === */
.strategy-age {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--text-muted);
}

/* === Footer Memory === */
.footer-memory {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* === Responsive === */
@media (max-width: 640px) {
  .navbar-label { display: none; }
  .hero-value { font-size: 2.8rem; }
  .overview-grid { gap: 1.25rem; }
  .strategy-card { flex: 1 1 100%; min-width: unset; }
  .position-card { flex: 1 1 100%; min-width: unset; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .section-footer { flex-direction: column; gap: 0.5rem; text-align: center; }
  .trade-times { display: none; }
  .decision-reason { white-space: normal; }
  .decision-detail .decision-reason { white-space: normal; }
  .pipeline-stages { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .attribution-grid { grid-template-columns: 1fr; }
  .trade-detail { white-space: normal; overflow-wrap: break-word; }
  .trade-logic { flex-wrap: wrap; }
  .trade-reasoning { flex-basis: 100%; }
  .pipeline-compute { flex-wrap: wrap; }
  .live-bar { flex-wrap: wrap; gap: 0.5rem; }
  .commit-section { flex-wrap: wrap; }
  .pulse-strip { flex-wrap: wrap; }
  .pulse-meta { gap: 0.4rem; }
  .health-dots { margin-left: 0; margin-top: 0.3rem; }
  .calibration-block { padding: 0.5rem; }
  .cal-count { display: none; }
  .journal-actions { gap: 0.2rem; }
  .journal-body { font-size: 0.72rem; }
}
