/* ==========================================
   Dashboard Banner
   ========================================== */

.analysis-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 48px;
  background: rgba(245, 158, 11, 0.07);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 13px;
  color: var(--accent-amber);
  font-weight: 500;
}

.analysis-banner svg {
  flex-shrink: 0;
  color: var(--accent-amber);
}

/* ==========================================
   Analysis Mode — Page Layout
   ========================================== */

.page-header {
  padding: 32px 48px 24px;
  border-bottom: 1px solid var(--border);
}

.page-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.page-title-group .section-label {
  margin-bottom: 6px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
}

.page-header-actions {
  flex-shrink: 0;
}

.dashboard-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  font-family: var(--font-mono, 'DM Mono', monospace);
  font-size: 12px;
  color: var(--text-muted, #9aa3b2);
}

.dashboard-account-chip-label {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted, #9aa3b2);
}

.dashboard-account-chip strong {
  font-weight: 600;
  color: var(--text-primary, #e6e9f0);
}

.open-positions-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.open-positions-row:last-child { border-bottom: none; }
.open-positions-pl.pl-positive { color: var(--accent-positive, #2ecc71); }
.open-positions-pl.pl-negative { color: var(--accent-negative, #ef4444); }
.open-positions-close { margin-left: auto; }

.recent-trades-rows {
  display: block;
}
.recent-trades-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.recent-trades-row:last-child { border-bottom: none; }
.recent-trades-side--buy {
  color: var(--accent-positive, #2ecc71);
}
.recent-trades-side--sell {
  color: #e74c3c;
}
.recent-trades-link { margin-left: auto; }

/* ==========================================
   Buttons
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-cyan);
  color: #060B18;
  border-color: var(--accent-cyan);
}
.btn-primary:hover {
  background: #00b8e0;
  border-color: #00b8e0;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.btn-secondary:hover {
  background: var(--accent-cyan-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.mode-badge-inactive {
  opacity: 0.3;
  cursor: default;
}

/* ==========================================
   Analysis Grid Layout
   ========================================== */

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px;
  gap: 32px;
}

.analysis-col-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.analysis-col-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================
   Panels
   ========================================== */

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
}

.sample-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

/* ==========================================
   Watchlist
   ========================================== */

.watchlist-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-secondary);
}

.watchlist-empty p {
  font-size: 14px;
  margin-bottom: 8px;
}

.link-cyan {
  color: var(--accent-cyan);
  text-decoration: none;
}
.link-cyan:hover { text-decoration: underline; }

.watchlist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watchlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(0, 212, 255, 0.04);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 10px;
}

.watchlist-item-info { flex: 1; }

.watchlist-item-ticker {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.watchlist-item-reason {
  font-size: 11px;
  color: var(--text-secondary);
}

.watchlist-item-score {
  flex-shrink: 0;
}

.watchlist-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.watchlist-item-remove:hover { color: var(--text-primary); }

/* ==========================================
   Signal Panels Grid
   ========================================== */

.signals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.signal-panel {
  padding: 20px;
}

.signal-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.signal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}

.signal-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ticker-tag {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.signal-desc {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-value {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.signal-value-long {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-cyan);
}

.signal-value-short {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.signal-value-neutral {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

/* ==========================================
   Portfolio Overview
   ========================================== */

.portfolio-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.portfolio-stat {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
}

.portfolio-stat-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.portfolio-stat-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.positions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.position-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.position-info {
  flex: 1;
  min-width: 0;
}

.position-ticker {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
}

.position-shares {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.position-entry, .position-pnl {
  text-align: right;
}

.position-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.position-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.position-value { font-size: 13px; font-weight: 600; }

.positive { color: #10b981; }
.negative { color: #ef4444; }

/* ==========================================
   Setup Score Badges
   ========================================== */

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  width: 36px;
  height: 28px;
  border-radius: 6px;
}

.score-high { background: rgba(0,212,255,0.15); color: var(--accent-cyan); }
.score-mid  { background: rgba(245,158,11,0.15); color: var(--accent-amber); }
.score-low  { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ==========================================
   Market Context
   ========================================== */

.market-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
}

.market-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.market-value {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display);
}

/* ==========================================
   Research Page
   ========================================== */

.research-search-bar {
  padding: 24px 48px;
  border-bottom: 1px solid var(--border);
}

.search-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-input::placeholder {
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.search-input:focus {
  border-color: var(--accent-cyan);
}

.search-btn {
  flex-shrink: 0;
}

/* ==========================================
   Research Results
   ========================================== */

.research-results {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.result-ticker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.result-ticker-info { display: flex; align-items: center; gap: 16px; }

.result-ticker-symbol {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.result-ticker-name {
  font-size: 15px;
  color: var(--text-secondary);
}

.result-ticker-score { text-align: right; }

.score-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.score-number {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 800;
  color: var(--accent-cyan);
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-label-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Chart */
.result-chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.chart-placeholder {
  margin-top: 4px;
}

.chart-svg-canvas {
  width: 100%;
  height: 180px;
}

/* Trade Plan */
.result-trade-plan {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.setup-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 4px 10px;
  border-radius: 6px;
}

.trade-plan-body { margin-top: 20px; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.plan-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.plan-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.plan-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-value-cyan  { color: var(--accent-cyan); }
.plan-value-green { color: #10b981; }
.plan-value-red   { color: #ef4444; }
.plan-value-amber { color: var(--accent-amber); }
.plan-value-muted { color: var(--text-secondary); }

/* R/R Visual */
.rr-visual {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.rr-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-column: 1;
}

.rr-bar-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  width: 50px;
  flex-shrink: 0;
}

.risk-label { color: #ef4444; }
.reward-label { color: #10b981; }

.rr-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.rr-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.risk-bar { background: #ef4444; }
.reward-bar { background: #10b981; }

.rr-ratio-display {
  display: flex;
  align-items: center;
  justify-content: center;
}

#rr-ratio-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--accent-amber);
  letter-spacing: -0.03em;
}

/* Setup Reason */
.setup-reason-block {
  background: rgba(0,212,255,0.05);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.setup-reason-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  opacity: 0.7;
  margin-bottom: 8px;
}

.setup-reason-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Disclaimer */
.trade-plan-disclaimer {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(245,158,11,0.05);
  border: 1px solid rgba(245,158,11,0.15);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 16px;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================
   Empty State
   ========================================== */

.research-empty {
  max-width: 600px;
  margin: 60px auto;
  text-align: center;
  padding: 0 24px;
}

.empty-icon {
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0.4;
}

.research-empty h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.research-empty p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.empty-tips { display: flex; justify-content: center; }

.tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 28px;
  text-align: center;
}

.tip-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.tip-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.tip-ticker {
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0,212,255,0.2);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.tip-ticker:hover {
  background: var(--accent-cyan);
  color: #060B18;
}

/* ==========================================
   Score Ring
   ========================================== */

.score-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.score-ring-svg {
  position: absolute;
  inset: 0;
}

.score-ring-number {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-ring-big {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent-cyan);
  line-height: 1;
}

.score-ring-max {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================
   Ticker Header — Updated Layout
   ========================================== */

.result-ticker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.result-ticker-info {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex: 1;
  min-width: 0;
}

.result-ticker-symbol {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 4px;
}

.result-ticker-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-ticker-name {
  font-size: 15px;
  color: var(--text-secondary);
}

.ticker-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.auto-eligibility-note {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  line-height: 1.5;
  max-width: 480px;
}

/* ==========================================
   Wait / Act Badge
   ========================================== */

.wait-act-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
}

.badge-clean {
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  border-color: rgba(0,212,255,0.2);
}

.badge-confirm {
  background: rgba(245,158,11,0.1);
  color: var(--accent-amber);
  border-color: rgba(245,158,11,0.2);
}

.badge-extended {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border-color: rgba(239,68,68,0.2);
}

.badge-avoid {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border-color: var(--border);
}

/* ==========================================
   Eligibility Label
   ========================================== */

.eligibility-label {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
}

.eligibility-auto {
  background: rgba(123,97,255,0.1);
  color: var(--accent-purple);
  border-color: rgba(123,97,255,0.2);
}

.eligibility-paper {
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  border-color: rgba(0,212,255,0.2);
}

.eligibility-analysis {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border-color: var(--border);
}

/* ==========================================
   Score Breakdown
   ========================================== */

.result-breakdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.breakdown-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: 180px 1fr 36px;
  align-items: center;
  gap: 12px;
}

.breakdown-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: right;
}

.breakdown-track {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.breakdown-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.breakdown-value {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

/* ==========================================
   Chart Read
   ========================================== */

.chart-read-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chart-read-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.chart-read-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chart-read-item-full {
  grid-column: span 3;
}

.chart-read-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chart-read-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
}

.chart-read-support { color: #10b981; }
.chart-read-resistance { color: #ef4444; }

.chart-verdict {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
}

.verdict-bullish {
  background: rgba(0,212,255,0.12);
  color: var(--accent-cyan);
}

.verdict-bearish {
  background: rgba(239,68,68,0.12);
  color: #ef4444;
}

.verdict-mixed {
  background: rgba(245,158,11,0.12);
  color: var(--accent-amber);
}

.verdict-neutral {
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
}

/* ==========================================
   Trade Plan — Header Tags
   ========================================== */

.trade-plan-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeframe-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 6px;
}

.lesson-category-picker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
}
.lesson-category-picker:focus { outline: 2px solid rgba(0,212,255,0.4); outline-offset: 2px; }

.lesson-category-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ==========================================
   Why Scored + What Fails
   ========================================== */

.result-context-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-context-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
}

.context-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 1100px) {
  .analysis-grid {
    grid-template-columns: 1fr;
  }
  .analysis-col-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .page-header { padding: 24px 24px 16px; }
  .analysis-grid { padding: 24px; }
  .research-search-bar { padding: 20px 24px; }
  .research-results { padding: 24px; }
  .research-empty { margin: 40px auto; }
  .signals-grid { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr 1fr; }
  .analysis-col-right { grid-template-columns: 1fr; }
  /* ==========================================
   Data Status Badges
   ========================================== */

.data-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
}

.live-badge {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.delayed-badge {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.25);
}

/* ==========================================
   Chart Meta
   ========================================== */

.chart-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}

/* ==========================================
   Current Price Display
   ========================================== */

.result-current-price {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-left: 12px;
  padding: 4px 12px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: 8px;
}

/* ==========================================
   Paper Trading — Main Layout
   ========================================== */

.pt-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Account Stats Bar */
.pt-account-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
}

.pt-account-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.pt-stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.pt-stat-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
}

/* Conditional coloring for P/L values (applied via JS classList) */
.pt-stat-value.positive { color: #10b981; }
.pt-stat-value.negative { color: #ef4444; }

/* Sticky Stats Strip */
.pt-stats-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 14px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* 6-card responsive grid — each stat is its own card */
.pt-stats-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  flex: 1;
}

.pt-stats-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}

.pt-stats-card:hover {
  border-color: rgba(0,212,255,0.25);
}

.pt-stats-card-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.pt-stats-card-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1;
}

.pt-stats-card-sub {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1;
}

.pt-stats-value.positive { color: #10b981; }
.pt-stats-value.negative { color: #ef4444; }

.pt-stats-simulation-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0,212,255,0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.2);
  padding: 6px 12px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   4-Step Sequential Sections
   ───────────────────────────────────────── */

.pt-step-sections {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 48px 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.pt-step-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

.pt-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pt-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,212,255,0.12);
  color: var(--accent-cyan);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}

.pt-step-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.pt-step-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 4px;
}

.pt-step-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Card disclaimer label */
.pt-card-disclaimer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Disclaimer Strip */
.pt-disclaimer-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 10px;
  padding: 12px 16px;
}

.pt-disclaimer-strip svg { flex-shrink: 0; color: var(--accent-cyan); }

/* Simulation Badge */
.pt-simulation-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(0,212,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,212,255,0.2);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Result Badges */
.pt-result-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
}

.pt-win {
  background: rgba(16,185,129,0.15);
  color: #10b981;
  border: 1px solid rgba(16,185,129,0.25);
}

.pt-loss {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.25);
}

/* Status Badges */
.pt-status-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
}

.pt-status-open   { background: rgba(245,158,11,0.12); color: var(--accent-amber); border-color: rgba(245,158,11,0.25); }
.pt-status-saved  { background: rgba(0,212,255,0.1); color: var(--accent-cyan); border-color: rgba(0,212,255,0.2); }
.pt-status-closed { background: rgba(255,255,255,0.04); color: var(--text-muted); border-color: var(--border); }

/* Tabs */
.pt-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}

.pt-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: none;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex: 1;
  justify-content: center;
}

.pt-tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }

.pt-tab-active {
  background: var(--accent-cyan) !important;
  color: #060B18 !important;
}

.pt-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.1);
  padding: 2px 7px;
  border-radius: 20px;
  line-height: 1.4;
}

.pt-tab-active .pt-tab-count {
  background: rgba(0,0,0,0.15);
}

.pt-tab-content { display: none; }
.pt-tab-visible { display: block; }

/* Tab Section Headers */
.pt-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pt-section-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.pt-section-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.pt-page-pnl-value {
  font-family: var(--font-display);
  font-weight: 700;
}

/* Trade Cards */
.pt-trade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}

.pt-trade-card:hover { border-color: rgba(0,212,255,0.2); }

.pt-trade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.pt-trade-ticker-block { display: flex; align-items: center; gap: 12px; }

.pt-trade-ticker {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.pt-trade-name {
  font-size: 14px;
  color: var(--text-muted);
}

.pt-trade-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Trade Levels Grid */
.pt-trade-levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.pt-level-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pt-level-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pt-level-value {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
}

.pt-entry { color: var(--accent-cyan); }
.pt-sloss  { color: #ef4444; }
.pt-t1     { color: #10b981; }
.pt-t2     { color: #10b981; }
.pt-rr     { color: var(--accent-amber); }

/* P/L Display */
.pt-trade-pnl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.pt-pnl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pt-pnl-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
}

/* Journal Preview */
.pt-journal-note-preview {
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Trade Footer */
.pt-trade-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pt-trade-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pt-meta-date {
  font-size: 11px;
  color: var(--text-muted);
}

.pt-meta-reason {
  font-size: 12px;
  color: var(--text-secondary);
  max-width: 400px;
  line-height: 1.4;
}

.pt-trade-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pt-btn-start,
.pt-btn-close {
  min-width: 140px;
  justify-content: center;
}

/* Empty State */
.pt-empty {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ─────────────────────────────────────────
   Journal Cards
   ───────────────────────────────────────── */

.pt-journal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
}

.pt-journal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.pt-journal-ticker {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.pt-journal-score {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

.pt-journal-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
  font-style: italic;
}

.pt-journal-empty {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.pt-journal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ─────────────────────────────────────────
   Modals
   ───────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-visible { display: flex; }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.5);
}

.modal-card-wide { max-width: 600px; }

.modal-header {
  margin-bottom: 12px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.modal-subtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-ticker {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.modal-disclaimer {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(0,212,255,0.06);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 20px;
  line-height: 1.5;
}

.modal-field {
  margin-bottom: 16px;
}

.modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.modal-label-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
  font-size: 11px;
}

.modal-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.modal-input:focus { border-color: var(--accent-cyan); }

.modal-textarea {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  transition: border-color 0.15s;
  line-height: 1.6;
}

.modal-textarea:focus { border-color: var(--accent-cyan); }

.modal-field-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.modal-error {
  display: block;
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
  min-height: 18px;
}

.live-order-outcome {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-negative, #ef4444);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  background: rgba(239, 68, 68, 0.05);
}
.live-order-outcome__heading {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-negative, #ef4444);
  font-weight: 600;
  margin-bottom: 6px;
}
.live-order-outcome__reason {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 6px;
}
.live-order-outcome__next {
  font-size: 12px;
  color: var(--text-muted, #9aa3b2);
  line-height: 1.5;
}
.live-order-outcome__next span {
  color: var(--text-primary);
}
.live-order-outcome__unmet {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-muted, #9aa3b2);
  line-height: 1.5;
}

.modal-plan-summary {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Trade Detail Modal */
.pt-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.pt-detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  border-bottom: 1px solid var(--border);
}

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

.pt-detail-row-full {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.pt-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
}

.pt-detail-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 12px 16px;
  line-height: 1.5;
}

.pt-detail-row-full .pt-detail-label { padding: 0; background: none; }

@media (max-width: 600px) {
  .page-header-inner { flex-direction: column; align-items: flex-start; }
  .dashboard-account-chip { font-size: 11px; gap: 10px; }
  .result-ticker-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .result-ticker-score { text-align: left; }
  .score-ring-big { font-size: 28px; }
  .score-ring-wrap { width: 96px; height: 96px; }
  .search-wrap { flex-direction: column; }
  .search-btn { width: 100%; justify-content: center; }
  .plan-grid { grid-template-columns: 1fr; }
  .rr-visual { grid-template-columns: 1fr; }
  .rr-ratio-display { text-align: center; }
}

/* Stats grid responsive */
@media (max-width: 900px) {
  .pt-stats-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .pt-stats-sticky { padding: 12px 20px; }
  .pt-stats-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pt-stats-sticky .btn { display: none; }
  .pt-step-sections { padding: 0 20px 48px; }
  .pt-step-section { padding: 18px; }
  .pt-trade-levels { grid-template-columns: repeat(3, 1fr); }
  .pt-trade-footer { flex-direction: column; align-items: flex-start; }
  .pt-trade-actions { width: 100%; }
  .pt-trade-actions .btn { flex: 1; text-align: center; }
}

/* ==========================================
   Paper Trading — Explicit paper-* CSS
   (replaces pt-* with paper-* prefixes)
   ========================================== */

.paper-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.paper-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 24px;
  margin-bottom: 24px;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.paper-eyebrow {
  margin: 0 0 8px;
  color: #22d3ee;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.paper-hero h1 {
  margin: 0;
  color: #f8fafc;
  font-size: 28px;
  line-height: 1.15;
}

.paper-subtitle {
  max-width: 720px;
  margin: 12px 0 0;
  color: #94a3b8;
  font-size: 15px;
  line-height: 1.6;
}

.paper-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid #22d3ee;
  border-radius: 999px;
  color: #22d3ee;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

/* ─── Stats cards (6-card grid) ─── */
.paper-stats-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.paper-stats-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  flex: 1;
}

/* Paper stat card — individual stat in the stats strip */
.paper-stat-card {
  background: #111827;
  border: 1px solid #243244;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}

.paper-stat-card:hover { border-color: rgba(34, 211, 238, 0.3); }

.paper-stat-label {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.paper-stat-value {
  display: block;
  color: #f8fafc;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.paper-stat-sub {
  display: block;
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
}

.paper-profit { color: #22c55e; }
.paper-loss   { color: #ef4444; }

/* ─── Step badge and count badge ─── */
.paper-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: #22d3ee;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.paper-count-badge {
  padding: 7px 12px;
  border-radius: 999px;
  background: #111827;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* ─── Step card (section wrapper) ─── */
.paper-step-card {
  background: #0f172a;
  border: 1px solid #243244;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0;
}
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 14px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.paper-stats-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  flex: 1;
}

.paper-stats-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s;
}

.paper-stats-card:hover { border-color: rgba(0,212,255,0.25); }

.paper-stats-card-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
}

.paper-stats-card-value {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #f1f5f9;
  line-height: 1;
}

.paper-stats-card-sub {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  line-height: 1;
}

/* 4-step sections */
.paper-step-sections {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.paper-step-section {
  background: #0f172a;
  border: 1px solid #243244;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.25);
}

.paper-step-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #1e293b;
}

.paper-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.paper-step-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.paper-step-hint {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
  flex: 1;
}

.paper-step-body {
  display: grid;
  gap: 16px;
}

/* Empty state */
.paper-empty-state {
  padding: 18px;
  border: 1px dashed #334155;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.5;
}

/* Trade cards */
.paper-trade-card {
  padding: 18px;
  background: #111827;
  border: 1px solid #334155;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.2);
  margin-bottom: 0;
}

.paper-trade-card:hover { border-color: rgba(34, 211, 238, 0.3); }

.paper-trade-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.paper-trade-ticker-block { display: flex; align-items: center; gap: 12px; }

.paper-trade-ticker {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.paper-trade-name {
  font-size: 14px;
  color: #94a3b8;
}

.paper-trade-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.paper-score-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
}

.paper-result-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid;
}

.paper-result-badge.pt-win {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.paper-result-badge.pt-loss {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

.paper-status-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid;
}

.paper-status-badge.pt-status-open {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
}

.paper-status-badge.pt-status-saved {
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.1);
}

.paper-status-badge.pt-status-closed {
  color: #94a3b8;
  border-color: #334155;
  background: transparent;
}

/* Trade grid */
.paper-trade-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.paper-field {
  padding: 12px;
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 14px;
}

.paper-field span {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  font-weight: 700;
}

.paper-field strong {
  display: block;
  color: #f8fafc;
  font-size: 15px;
}

/* Trade reason / journal */
.paper-trade-reason {
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 14px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.18);
}

.paper-trade-reason span {
  display: block;
  color: #22d3ee;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.paper-trade-reason p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.5;
  font-size: 13px;
}

/* Card footer */
.paper-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
}

.paper-disclaimer {
  color: #94a3b8;
  font-size: 12px;
}

.paper-card-actions {
  display: flex;
  gap: 8px;
}

/* Buttons */
.paper-primary-button {
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  background: #22d3ee;
  color: #04111f;
  font-weight: 800;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  min-width: 140px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.paper-primary-button:hover { background: #00b8e0; }

.paper-secondary-button {
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 11px 16px;
  background: transparent;
  color: #cbd5e1;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.paper-secondary-button:hover {
  background: rgba(255,255,255,0.05);
  border-color: #475569;
}

/* Score badge variants (used by JS) */
.score-badge.paper-score-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid;
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  width: auto;
  height: auto;
}

/* Modals */
.paper-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
}

.paper-modal-overlay.modal-visible { display: flex; }

.paper-modal-card {
  width: min(520px, 100%);
  padding: 24px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.paper-modal-card h2 {
  margin: 0 0 8px;
  color: #f8fafc;
}

.paper-modal-card p {
  color: #94a3b8;
}

.paper-modal-card label {
  display: block;
  color: #cbd5e1;
  margin: 14px 0 6px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.paper-modal-card input,
.paper-modal-card textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: #020617;
  color: #f8fafc;
  font-family: var(--font-body);
  font-size: 15px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.paper-modal-card input:focus,
.paper-modal-card textarea:focus {
  border-color: #22d3ee;
}

.paper-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

/* Responsive overrides for paper-* */
@media (max-width: 960px) {
  .paper-stats-strip { grid-template-columns: repeat(3, 1fr); }
  .paper-stats-sticky { padding: 12px 24px; }
  .paper-hero { flex-direction: column; }
}

@media (max-width: 640px) {
  .paper-page { padding: 16px 14px 56px; }
  .paper-stats-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .paper-stats-sticky .btn { display: none; }
  .paper-step-sections { padding: 20px 0 0; }
  .paper-step-header { flex-direction: column; align-items: stretch; }
  .paper-trade-header { flex-direction: column; align-items: stretch; }
  .paper-card-footer { flex-direction: column; align-items: stretch; }
  .paper-trade-grid { grid-template-columns: 1fr; }
  .paper-card-actions { width: 100%; flex-direction: column; }
  .paper-primary-button,
  .paper-secondary-button { width: 100%; }
}

/* ==========================================
   Tab Navigation
   ========================================== */

.tab-nav {
  display: flex;
  gap: 4px;
  padding: 24px 48px 0;
  border-bottom: 1px solid var(--border);
  max-width: 1400px;
  margin: 0 auto;
}

.tab-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-secondary);
}

.tab-btn--active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

/* ==========================================
   Tab Panels
   ========================================== */

.tab-panels {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 48px;
}

.tab-panel--hidden {
  display: none;
}

/* ==========================================
   Placeholder Field Rows (broker shell)
   ========================================== */

.placeholder-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.placeholder-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.placeholder-field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.placeholder-field-value {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-style: italic;
}

/* API Docs Panel */
.api-docs-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 48px 40px;
}

.api-docs-panel {
  cursor: pointer;
}

.api-docs-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.api-docs-summary::-webkit-details-marker {
  display: none;
}

.api-docs-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--text-muted);
}

details[open] .api-docs-chevron {
  transform: rotate(90deg);
}

details[open] .api-docs-summary {
  margin-bottom: 20px;
}

.api-docs-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.api-group-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.api-endpoint {
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
}

.api-endpoint-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.api-method {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: monospace;
}

.api-method--get {
  color: #34D399;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.api-method--post {
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.api-method--patch {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.api-method--delete {
  color: #F87171;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.api-path {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
}

.api-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.api-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.api-field {
  font-family: monospace;
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
}

.api-copy-btn {
  font-family: var(--font-display, sans-serif);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.api-copy-btn:hover {
  color: var(--accent-cyan);
  border-color: rgba(0, 212, 255, 0.3);
  background: var(--accent-cyan-dim);
}
.api-copy-btn svg { stroke: currentColor; }
.api-copy-btn.is-copied {
  color: var(--accent-cyan);
  border-color: rgba(0, 212, 255, 0.45);
  background: var(--accent-cyan-dim);
}

.api-copy-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(8px);
  font-family: var(--font-display, sans-serif);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0, 212, 255, 0.45);
  padding: 8px 14px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 50;
}
.api-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================
   Trade History Tab (broker dashboard)
   ========================================== */

.trade-history-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.open-orders-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.open-orders-cancel-btn {
  padding: 4px 10px;
  font-size: 11px;
}

.trade-history-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 13px;
}

.trade-history-table thead th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.trade-history-table thead th.is-sorted {
  color: var(--text-primary, #fff);
}

.trade-history-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.trade-history-table tbody tr:last-child td {
  border-bottom: none;
}

.trade-history-side--buy {
  color: var(--accent-positive, #2ecc71);
}

.trade-history-side--sell {
  color: #e74c3c;
}

/* ==========================================
   Positions Tab — Close action column
   ========================================== */

.broker-positions-action-cell {
  white-space: nowrap;
}

.broker-positions-action-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.broker-positions-qty-input {
  width: 72px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 8px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 12px;
  color: var(--text-primary, #e6e9f0);
  text-align: right;
  outline: none;
}

.broker-positions-qty-input:focus {
  border-color: rgba(0, 212, 255, 0.45);
}

.broker-positions-close-btn {
  padding: 5px 12px;
  font-size: 11px;
  min-width: 0;
}

.broker-positions-close-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ==========================================
   Live Trading Tab — Kill Switch
   ========================================== */

.kill-switch-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
}

.kill-switch-title {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: var(--text-primary);
}

.kill-switch-button {
  background: var(--accent-negative, #ef4444);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.kill-switch-button:hover { background: #b91c1c; }

.kill-switch-button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.paper-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.paper-modal-body {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
}

#live-gate-why-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
#live-gate-why-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }

.live-gate-why-popover {
  position: relative;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-bg, rgba(255,255,255,0.02));
  z-index: 5;
}
.live-gate-why-popover__heading {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.live-gate-why-popover__row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 4px 0;
  font-size: 13px;
}
.live-gate-why-popover__label {
  color: var(--text-muted);
  min-width: 140px;
}
.live-gate-why-popover__current { color: var(--text-primary); font-weight: 600; }
.live-gate-why-popover__threshold { color: var(--text-muted); margin-left: 4px; }
.live-gate-why-popover__row--met .live-gate-why-popover__current { color: var(--accent-positive, #2ecc71); }
.live-gate-why-popover__row--unmet .live-gate-why-popover__current { color: var(--text-muted); }
.live-gate-why-popover__footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}