:root {
  color-scheme: dark;
  --bg: #090b0f;
  --bg-2: #0f1218;
  --surface: #131720;
  --surface-2: #191e2a;
  --surface-3: #202636;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(224, 184, 97, 0.30);
  --text: #eef1f6;
  --text-2: #a5b0c4;
  --muted: #6e798f;
  --gold: #e0b861;
  --gold-soft: rgba(224, 184, 97, 0.14);
  --mint: #22c79a;
  --mint-soft: rgba(34, 199, 154, 0.14);
  --red: #f05c64;
  --red-soft: rgba(240, 92, 100, 0.14);
  --cyan: #5ea8ff;
  --purple: #b18cff;
  --radius: 10px;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", "Cascadia Code", ui-monospace, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; background-image: radial-gradient(ellipse 80% 420px at 50% -180px, rgba(224, 184, 97, 0.08), transparent 70%); }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pos { color: var(--mint) !important; }
.neg { color: var(--red) !important; }
.gold { color: var(--gold) !important; }
.muted-xs { color: var(--muted); font-size: 11px; }

/* TOP BAR */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 50px; padding: 0 18px;
  background: rgba(11, 13, 18, 0.94); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); flex: none; }
.brand-emblem {
  display: flex; align-items: flex-end; justify-content: center; gap: 2px;
  width: 28px; height: 28px; padding-bottom: 6px;
  border-radius: 7px; border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(224,184,97,0.22), rgba(224,184,97,0.05));
}
.brand-emblem i { width: 3px; height: 6px; border-radius: 1px; background: var(--gold); transform: skewY(-18deg); }
.brand-emblem i:nth-child(2) { height: 10px; }
.brand-emblem i:nth-child(3) { height: 14px; }
.brand-text { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; letter-spacing: 0.04em; }
.ver-pill { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; color: #171206; background: var(--gold); letter-spacing: 0.03em; }

.nav-tabs { display: flex; gap: 4px; margin-left: 8px; background: var(--surface); padding: 3px; border-radius: 8px; border: 1px solid var(--border); }
.nav-tab {
  padding: 5px 13px; border: 0; border-radius: 6px; background: transparent;
  color: var(--text-2); font-weight: 500; font-size: 12px; white-space: nowrap; transition: all 0.15s;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--surface-3); color: var(--gold); box-shadow: inset 0 0 0 1px var(--border-strong); }

.session-pill, .feed-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
  border-radius: 99px; font-size: 11px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); white-space: nowrap;
}
.session-pill i, .feed-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.session-pill[data-active="true"] { color: var(--gold); border-color: var(--border-strong); background: var(--gold-soft); }
.feed-pill[data-state="live"] { color: var(--mint); border-color: rgba(34,199,154,0.35); background: var(--mint-soft); }
.feed-pill[data-state="live"] i { box-shadow: 0 0 8px var(--mint); }
.feed-pill[data-state="error"], .feed-pill[data-state="offline"] { color: var(--red); border-color: rgba(240,92,100,0.4); background: var(--red-soft); }

.tz-toggle { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 11px; font-family: var(--mono); }
.tz-toggle:hover { border-color: var(--border-strong); color: var(--gold); }
.clock { color: var(--text-2); font-size: 12px; min-width: 64px; text-align: right; }

/* 5-PILLAR WATCHLIST BAR */
.watchlist-bar {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px;
  padding: 8px 18px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.wl-card {
  display: flex; flex-direction: column; gap: 4px; padding: 8px 11px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  text-align: left; transition: all 0.14s; min-width: 0;
}
.wl-card:hover { border-color: rgba(255,255,255,0.2); background: var(--surface-2); }
.wl-card.selected { border-color: var(--gold); background: linear-gradient(135deg, rgba(224,184,97,0.12), var(--surface-2)); box-shadow: 0 0 0 1px rgba(224,184,97,0.25); }
.wl-card.disabled { opacity: 0.55; }
.wl-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.wl-sym { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.wl-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.wl-pillar { font-size: 10px; color: var(--muted); white-space: nowrap; }
.wl-px { font-size: 15px; font-weight: 700; }
.wl-chg { font-size: 11px; font-weight: 600; }
.wl-score { font-size: 10px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* TICKER RIBBON */
.ticker-ribbon {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px;
  padding: 7px 18px; background: var(--bg-2); border-bottom: 1px solid var(--border);
}
.ticker-main { display: flex; align-items: center; gap: 16px; }
.sym-block { display: flex; flex-direction: column; }
.sym-name { font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.sym-venue { font-size: 10px; color: var(--gold); }
.price-block { display: flex; align-items: baseline; gap: 8px; }
.live-price { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; transition: color 0.15s; }
.live-price.tick-up { color: var(--mint); }
.live-price.tick-dn { color: var(--red); }
.live-chg { font-size: 12px; font-weight: 600; }

.ticker-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.tstat { display: flex; flex-direction: column; gap: 1px; }
.tstat span { font-size: 10px; color: var(--muted); }
.tstat b { font-size: 12px; font-weight: 600; color: var(--text); }

.banner {
  margin: 10px 18px 0; padding: 8px 14px; border-radius: 8px;
  background: var(--gold-soft); border: 1px solid var(--border-strong); color: var(--gold); font-size: 12px;
}
.banner[data-error="true"] { background: var(--red-soft); border-color: rgba(240,92,100,0.45); color: #ff9ba0; }

/* VIEWS */
.view { display: none; flex: 1; padding: 12px 18px 18px; width: 100%; max-width: 1680px; margin: 0 auto; }
.view.active { display: block; }

/* KPI STRIP */
.kpi-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi-card {
  padding: 10px 13px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--text-2); }
.kpi-tag { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-family: var(--mono); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.kpi-val { font-size: 19px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: 11px; color: var(--muted); line-height: 1.3; }

/* MAIN GRID */
.terminal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 12px; align-items: start; }
.terminal-main, .terminal-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; min-width: 0; }
.chart-panel { padding: 10px 12px; }

/* CHART TOOLBAR */
.chart-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tb-group { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pill-btn, .chip-btn, .mini-btn, .icon-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  border-radius: 6px; font-size: 11px; transition: all 0.12s;
}
.pill-btn { padding: 4px 10px; font-family: var(--mono); font-weight: 600; }
.pill-btn:hover, .chip-btn:hover, .mini-btn:hover, .icon-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.pill-btn.active { background: var(--gold-soft); color: var(--gold); border-color: var(--border-strong); }
.chip-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; }
.chip-btn i { width: 7px; height: 7px; border-radius: 50%; }
.dot-gold { background: var(--gold); }
.dot-cyan { background: var(--cyan); }
.dot-purple { background: var(--purple); }
.dot-muted { background: #7f8ca8; }
.dot-mint { background: var(--mint); }
.chip-btn.active { background: var(--surface-3); color: var(--text); border-color: rgba(255,255,255,0.22); }
.seg-mini { display: inline-flex; gap: 2px; background: var(--bg-2); padding: 2px; border-radius: 6px; border: 1px solid var(--border); }
.mini-btn { border: 0; background: transparent; padding: 3px 8px; border-radius: 4px; }
.mini-btn.active { background: var(--surface-3); color: var(--gold); }
.zoom-controls { display: inline-flex; gap: 3px; margin-left: 4px; }
.icon-btn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }

.chart-hud { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; min-height: 22px; padding: 2px 4px 6px; font-size: 11px; color: var(--text-2); }
.canvas-wrap { position: relative; width: 100%; border-radius: 7px; overflow: hidden; background: #0b0d12; border: 1px solid var(--border); }
.main-chart-wrap { height: clamp(350px, 45vh, 495px); cursor: crosshair; touch-action: none; }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; }
.chart-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 7px; font-size: 11px; color: var(--muted); }

/* SIDEBAR */
.side-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.side-head h2 { margin: 0; font-size: 14px; font-weight: 700; }
.side-head p { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.quick-btns { display: flex; gap: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 500; transition: all 0.14s;
}
.btn:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-3); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.btn-gold { background: var(--gold); color: #161106; border-color: var(--gold); font-weight: 700; }
.btn-gold:hover:not(:disabled) { background: #ecc672; border-color: #ecc672; }
.btn-danger { background: var(--red-soft); color: #ff8e94; border-color: rgba(240,92,100,0.45); }
.btn-danger:hover:not(:disabled) { background: rgba(240,92,100,0.24); }
.btn-outline-danger { background: transparent; color: #ff8e94; border-color: rgba(240,92,100,0.4); }
.btn-outline-danger:hover:not(:disabled) { background: var(--red-soft); }

/* PORTFOLIO POSITIONS STACK */
.pos-stack { display: flex; flex-direction: column; gap: 8px; }
.pos-item {
  padding: 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
}
.pos-item.long { border-color: rgba(34,199,154,0.42); background: linear-gradient(180deg, rgba(34,199,154,0.08), var(--surface-2)); }
.pos-item.short { border-color: rgba(240,92,100,0.42); background: linear-gradient(180deg, rgba(240,92,100,0.08), var(--surface-2)); }
.pos-item.pending { border-color: rgba(94,168,255,0.42); background: linear-gradient(180deg, rgba(94,168,255,0.08), var(--surface-2)); }
.pos-item-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 5px; }
.pos-item-body { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; font-size: 11px; color: var(--text-2); margin-top: 6px; }
.pos-item-body b { display: block; color: var(--text); font-family: var(--mono); font-size: 11px; }
.pos-empty { padding: 11px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.pos-empty strong { display: block; font-size: 14px; margin: 4px 0; }
.pos-empty p { margin: 0; font-size: 11px; color: var(--text-2); }

/* ALPHA RADAR */
.regime-chip { padding: 2px 8px; border-radius: 5px; font-size: 10px; font-weight: 600; background: var(--gold-soft); color: var(--gold); border: 1px solid var(--border-strong); white-space: nowrap; }
.gauge-wrap { margin: 4px 0 11px; }
.gauge-labels { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; margin-bottom: 5px; }
.gauge-labels strong { font-size: 15px; }
.gauge-track { position: relative; height: 10px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--border); overflow: hidden; }
.gauge-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,0.28); z-index: 2; }
.gauge-marker { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gold); z-index: 3; opacity: 0.85; }
.gauge-fill { position: absolute; top: 1px; bottom: 1px; border-radius: 99px; transition: all 0.25s ease; }

.factor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 0; }
.fcell { padding: 7px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.fcell.warn { border-color: rgba(240,92,100,0.45); background: var(--red-soft); }
.fcell dt { font-size: 10px; color: var(--muted); }
.fcell dd { margin: 2px 0 0; font-size: 12px; font-weight: 600; }

/* ORDERFLOW */
.of-bars { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.of-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-bottom: 3px; }
.split-bar { height: 7px; border-radius: 99px; background: rgba(240,92,100,0.55); overflow: hidden; }
.split-bar.slim { height: 5px; }
.split-buy { height: 100%; background: var(--mint); transition: width 0.25s; }
.book-depth { padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.tape-head, .tape-item { display: grid; grid-template-columns: 1fr 1fr 0.8fr; font-size: 11px; padding: 2px; }
.tape-head { color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--border); padding-bottom: 4px; margin-bottom: 3px; }
.tape-head span:last-child, .tape-item span:last-child { text-align: right; }
.tape-head span:nth-child(2), .tape-item span:nth-child(2) { text-align: center; }
.tape-list { max-height: 150px; overflow-y: auto; }

/* LEDGER */
.panel-tabs-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--border); padding-bottom: 9px; }
.sub-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.sub-tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; border: 1px solid transparent; background: transparent; color: var(--text-2); font-size: 12px; font-weight: 600; }
.sub-tab:hover { color: var(--text); background: var(--surface-2); }
.sub-tab.active { background: var(--surface-3); color: var(--gold); border-color: var(--border-strong); }
.cnt-badge { padding: 0 5px; border-radius: 99px; font-size: 10px; font-family: var(--mono); background: var(--bg-2); color: var(--text-2); }
.ledger-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.select-sm { padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 11px; }

.ltab-pane { display: none; }
.ltab-pane.active { display: block; }
.table-wrap { max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); }
.table-wrap.compact { max-height: 230px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 6px 6px; font-size: 11px; }
.bt-trades-wrap { max-height: 330px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
thead th { position: sticky; top: 0; z-index: 2; padding: 7px 9px; text-align: left; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 600; border-bottom: 1px solid var(--border); }
tbody td { padding: 6px 9px; border-bottom: 1px solid rgba(255,255,255,0.04); color: var(--text); vertical-align: middle; }
tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr.clickable { cursor: pointer; }
th.num, td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.empty-cell { text-align: center; padding: 32px 16px !important; color: var(--muted); white-space: normal; }

.tag { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.tag-long { background: var(--mint-soft); color: var(--mint); }
.tag-short { background: var(--red-soft); color: var(--red); }
.tag-maker { background: rgba(94,168,255,0.14); color: var(--cyan); margin-left: 4px; }
.tag-taker { background: var(--surface-3); color: var(--text-2); margin-left: 4px; }
.tag-gold { background: var(--gold-soft); color: var(--gold); }
.tag-muted { background: var(--surface-2); color: var(--muted); }
.sub-line { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }

.eq-analytics-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); gap: 12px; }
.mini-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.eq-canvas-wrap { height: 225px; }
.attr-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.attr-card { padding: 8px 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.attr-card span { display: block; font-size: 10px; color: var(--muted); }
.attr-card strong { display: block; margin-top: 2px; font-size: 13px; font-family: var(--mono); }
.attr-card small { display: block; margin-top: 2px; font-size: 10px; color: var(--text-2); font-family: var(--mono); }

/* BACKTEST LAB */
.diag-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; border-color: var(--border-strong); background: linear-gradient(120deg, rgba(224,184,97,0.08), var(--surface) 55%); }
.diag-left { flex: 1; min-width: 280px; }
.diag-eyebrow { font-size: 11px; font-weight: 700; color: var(--gold); letter-spacing: 0.05em; }
.diag-left h2 { margin: 4px 0 6px; font-size: 16px; }
.diag-left p { margin: 0; font-size: 12px; color: var(--text-2); max-width: 760px; }
.diag-compare { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.diag-col { padding: 10px 14px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--border); min-width: 195px; }
.diag-col.new { border-color: rgba(34,199,154,0.35); }
.diag-col span { display: block; font-size: 10px; color: var(--muted); }
.diag-col strong { display: block; font-size: 19px; margin: 3px 0; }
.diag-col small { display: block; font-size: 11px; color: var(--text-2); }
.diag-arrow { font-size: 20px; color: var(--gold); font-weight: 700; }

.lab-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 12px; align-items: start; }
.preset-pills { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-2); }
.field-lbl { display: block; font-size: 11px; color: var(--text-2); margin-bottom: 6px; }
.sym-check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.chk-pill {
  flex-direction: row !important; align-items: center; gap: 6px !important; cursor: pointer;
  padding: 5px 8px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); font-size: 11px !important;
}
.form-grid input[type="number"], .form-grid select { padding: 6px 9px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); font-family: var(--mono); font-size: 12px; }
.dual-in { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }

.lab-results { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bt-kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bt-eq-wrap { height: 265px; cursor: crosshair; }
.bt-split-row { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr); gap: 12px; }

.wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.wf-card { padding: 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); }
.wf-card h4 { margin: 0 0 5px; font-size: 11px; color: var(--gold); font-family: var(--sans); }
.wf-card strong { font-size: 18px; display: block; margin-bottom: 4px; }
.wf-card small { display: block; font-size: 11px; color: var(--text-2); }

.corr-table td, .corr-table th { text-align: center !important; padding: 6px 6px; font-family: var(--mono); font-size: 11px; }
.corr-low { background: rgba(34,199,154,0.12); color: var(--mint); }
.corr-mid { background: rgba(224,184,97,0.12); color: var(--gold); }
.corr-diag { background: var(--surface-3); color: var(--muted); }

.monthly-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.mon-cell { padding: 9px 10px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); }
.mon-cell.up { border-color: rgba(34,199,154,0.35); background: rgba(34,199,154,0.08); }
.mon-cell.dn { border-color: rgba(240,92,100,0.35); background: rgba(240,92,100,0.08); }
.mon-cell span { display: block; font-size: 11px; color: var(--text-2); }
.mon-cell strong { display: block; font-size: 15px; margin: 2px 0; }
.mon-cell small { display: block; font-size: 10px; color: var(--muted); white-space: nowrap; }

/* CONFIG VIEW */
.config-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.symbol-toggles { display: grid; grid-template-columns: 1fr; gap: 7px; }
.sym-tog-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
}
.sym-tog-row.on { border-color: rgba(34,199,154,0.3); }
.sym-tog-row h4 { margin: 0; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.sym-tog-row small { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }

.preset-cards { display: grid; grid-template-columns: 1fr; gap: 8px; }
.preset-card { padding: 11px 13px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preset-card.selected { border-color: var(--gold); background: linear-gradient(90deg, rgba(224,184,97,0.12), var(--surface-2)); }
.preset-card h3 { margin: 0 0 3px; font-size: 13px; }
.preset-card p { margin: 0; font-size: 11px; color: var(--text-2); }
.ctrl-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.method-list { display: flex; flex-direction: column; gap: 12px; }
.method-list h3 { margin: 0 0 5px; font-size: 13px; color: var(--gold); }
.method-list p { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.65; }
.method-list code { padding: 1px 5px; border-radius: 4px; background: var(--bg-2); color: var(--text); font-family: var(--mono); font-size: 11px; }

/* FOOTER & MODAL */
.footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }
.modal { width: min(420px, calc(100% - 28px)); padding: 18px 20px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.modal::backdrop { background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(4px); }
.modal h3 { margin: 0 0 8px; font-size: 15px; }
.modal p { margin: 0 0 16px; color: var(--text-2); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1240px) {
  .kpi-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .terminal-grid { grid-template-columns: minmax(0, 1fr) 316px; }
  .bt-split-row { grid-template-columns: 1fr; }
  .monthly-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .topbar { height: auto; padding: 8px 14px; flex-wrap: wrap; gap: 8px; }
  .topbar-left { width: 100%; justify-content: space-between; }
  .watchlist-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .terminal-grid, .lab-grid, .config-grid, .eq-analytics-grid { grid-template-columns: 1fr; }
  .bt-kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .topbar { padding: 8px 12px; }
  .nav-tabs { margin-left: 0; }
  .nav-tab { padding: 5px 8px; font-size: 11px; }
  .watchlist-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 8px 12px; gap: 6px; }
  .ticker-ribbon { padding: 8px 12px; }
  .view { padding: 10px 12px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-val { font-size: 16px; }
  .kpi-sub { font-size: 10px; }
  .main-chart-wrap { height: 310px; }
  .monthly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clock { display: none; }
}
