:root {
  --bg: oklch(0.17 0.008 60);
  --bg-2: oklch(0.21 0.01 60);
  --bg-3: oklch(0.25 0.012 60);
  --line: oklch(0.32 0.012 60);
  --line-soft: oklch(0.28 0.01 60 / 0.6);
  --text: oklch(0.96 0.005 80);
  --text-2: oklch(0.78 0.01 70);
  --text-3: oklch(0.58 0.01 70);
  --bull: oklch(0.74 0.17 145);
  --bull-dim: oklch(0.58 0.14 145);
  --bear: oklch(0.68 0.21 25);
  --bear-dim: oklch(0.52 0.17 25);
  --amber: oklch(0.83 0.14 75);
  --amber-dim: oklch(0.65 0.11 75);
  --violet: oklch(0.72 0.14 295);

  --font-sans: 'Inter', ui-sans-serif, system-ui;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-serif: 'Instrument Serif', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.mono { font-family: var(--font-mono); font-feature-settings: "ss01", "zero"; }
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }

/* ============ APP SHELL ============ */
.app {
  display: grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 56px 1fr;
  height: 100vh;
  width: 100vw;
}
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  z-index: 5;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  letter-spacing: 0.12em;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 3px;
  background: var(--text); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 11px;
}
.topbar-ticker {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  display: flex; gap: 20px; padding-left: 20px; border-left: 1px solid var(--line);
}
.topbar-ticker .up { color: var(--bull); }
.topbar-ticker .down { color: var(--bear); }

.topbar-right { display: flex; align-items: center; gap: 18px; font-size: 12px; color: var(--text-2); }
.streak {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-2);
  font-family: var(--font-mono); font-size: 11px;
}
.streak b { color: var(--amber); font-weight: 600; }
.xp-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 10px; border-radius: 999px;
  background: var(--bg-2); font-family: var(--font-mono); font-size: 11px;
}
.xp-pill b { color: var(--text); font-weight: 600; }
.xp-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bull); }

/* ============ SIDEBAR ============ */
.sidebar {
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 18px 0 40px;
  background: linear-gradient(180deg, var(--bg) 0%, oklch(0.16 0.008 60) 100%);
}
.sidebar-section-title {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-3); padding: 10px 22px 8px;
  font-family: var(--font-mono); font-weight: 500;
}
.module {
  padding: 6px 14px;
}
.module-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px; font-size: 12px; color: var(--text-2);
  font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
}
.module-num {
  width: 20px; height: 20px; border-radius: 4px;
  display: grid; place-items: center;
  background: var(--bg-3); color: var(--text-2);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
}
.module-progress {
  flex: 1; height: 2px; background: var(--line); border-radius: 1px; overflow: hidden;
  margin-left: 8px;
}
.module-progress > div { height: 100%; background: var(--bull-dim); transition: width 0.3s; }

.lesson-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer;
  transition: background 120ms, color 120ms;
  width: 100%; text-align: left;
  position: relative;
}
.lesson-row:hover { background: var(--bg-2); color: var(--text); }
.lesson-row.active {
  background: var(--bg-2);
  color: var(--text);
}
.lesson-row.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
  width: 2px; background: var(--amber); border-radius: 1px;
}
.lesson-row.done { color: var(--text-3); }
.lesson-status {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  border: 1.5px solid var(--line); background: transparent;
  font-size: 9px; color: var(--text-3);
}
.lesson-status.done {
  background: var(--bull); border-color: var(--bull); color: var(--bg);
}
.lesson-status.active {
  border-color: var(--amber); color: var(--amber);
}
.lesson-title { flex: 1; }
.lesson-meta { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }

/* ============ MAIN ============ */
.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  min-height: 0;
}
.lesson-pane {
  overflow-y: auto;
  padding: 40px 48px 80px;
  border-right: 1px solid var(--line);
  scroll-behavior: smooth;
}
.chart-pane {
  overflow-y: auto;
  padding: 28px 32px 60px;
  background:
    radial-gradient(1200px 400px at 80% -10%, oklch(0.25 0.02 60 / 0.5), transparent 60%),
    var(--bg);
}

.crumb {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
  letter-spacing: 0.05em;
}
.crumb .sep { opacity: 0.5; }
.crumb b { color: var(--text-2); font-weight: 500; }

h1.lesson-title-big {
  font-family: var(--font-serif); font-size: 48px; line-height: 1.08;
  font-weight: 400; letter-spacing: -0.02em;
  margin: 0 0 18px; color: var(--text);
}
h1.lesson-title-big em { color: var(--amber); font-style: italic; }
.lesson-sub {
  font-size: 15px; color: var(--text-2); max-width: 56ch;
  line-height: 1.55; margin: 0 0 28px;
}

h2.section-h {
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--amber); margin: 36px 0 14px;
  display: flex; align-items: center; gap: 10px;
}
h2.section-h::before {
  content: ""; width: 18px; height: 1px; background: var(--amber); display: inline-block;
}

.prose p { font-size: 14.5px; line-height: 1.65; color: var(--text); margin: 0 0 14px; max-width: 62ch; }
.prose p.muted { color: var(--text-2); }
.prose b, .prose strong { color: var(--amber); font-weight: 600; }
.prose ul { padding-left: 0; list-style: none; margin: 14px 0; }
.prose li {
  font-size: 14px; line-height: 1.55; color: var(--text); padding: 8px 0 8px 24px;
  position: relative; border-bottom: 1px dashed var(--line-soft);
}
.prose li:last-child { border-bottom: none; }
.prose li::before {
  content: "›"; position: absolute; left: 4px; top: 7px;
  color: var(--amber); font-family: var(--font-mono); font-size: 14px;
}

/* cards + stat grids */
.def-card {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 10px; padding: 18px 20px; margin: 14px 0;
}
.def-card .lbl {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 6px;
}
.def-card .val { font-size: 14.5px; line-height: 1.55; color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

.stat {
  border: 1px solid var(--line); background: var(--bg-2);
  border-radius: 8px; padding: 12px 14px;
}
.stat .k { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); }
.stat .v { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--text); margin-top: 4px; }
.stat .v.bull { color: var(--bull); }
.stat .v.bear { color: var(--bear); }

/* Chart pane blocks */
.chart-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, oklch(0.20 0.01 60) 0%, oklch(0.18 0.01 60) 100%);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 18px;
}
.chart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.chart-header .title { color: var(--text-2); font-weight: 500; }
.chart-header .right { display: flex; gap: 10px; color: var(--text-3); }
.chart-header .dot-bull { width: 6px; height: 6px; background: var(--bull); border-radius: 50%; display: inline-block; }
.chart-body { padding: 14px 16px 18px; }

.chart-footer {
  padding: 10px 16px 14px; border-top: 1px solid var(--line-soft);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  font-size: 12px; color: var(--text-2);
}

.tab-row { display: flex; gap: 4px; background: var(--bg-3); padding: 3px; border-radius: 8px; width: fit-content; }
.tab-row button {
  padding: 6px 12px; border-radius: 6px; font-size: 12px;
  font-family: var(--font-mono); letter-spacing: 0.04em; color: var(--text-2);
}
.tab-row button.on { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line-soft); }
.tab-row button:hover:not(.on) { color: var(--text); }

.btn {
  padding: 8px 14px; border-radius: 6px; font-size: 12px; font-weight: 500;
  font-family: var(--font-mono); letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--bg-3); color: var(--text); border: 1px solid var(--line);
  transition: background 120ms, border-color 120ms;
}
.btn:hover { background: var(--bg-2); border-color: var(--text-3); }
.btn.primary {
  background: var(--amber); color: oklch(0.2 0.02 60); border-color: var(--amber);
}
.btn.primary:hover { background: oklch(0.88 0.14 75); }
.btn.ghost { background: transparent; }

.nav-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line);
}

/* Quiz blocks */
.quiz {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2); padding: 20px; margin: 20px 0;
}
.quiz-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.quiz-head .tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--amber);
  padding: 3px 8px; border: 1px solid var(--amber-dim); border-radius: 4px;
}
.quiz-head .q {
  font-size: 14px; color: var(--text); font-weight: 500;
}
.quiz-options { display: grid; gap: 8px; }
.quiz-opt {
  text-align: left; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); font-size: 13.5px; color: var(--text);
  transition: all 150ms;
}
.quiz-opt:hover { border-color: var(--text-3); background: var(--bg-3); }
.quiz-opt .bullet {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--text-3);
  flex-shrink: 0; display: grid; place-items: center; font-size: 10px;
}
.quiz-opt.correct { border-color: var(--bull); background: oklch(0.3 0.08 145 / 0.2); }
.quiz-opt.correct .bullet { background: var(--bull); border-color: var(--bull); color: var(--bg); }
.quiz-opt.wrong { border-color: var(--bear); background: oklch(0.3 0.12 25 / 0.2); }
.quiz-opt.wrong .bullet { background: var(--bear); border-color: var(--bear); color: white; }
.quiz-feedback {
  margin-top: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.5;
  border-radius: 6px; background: var(--bg-3);
  color: var(--text-2); border-left: 2px solid var(--amber);
}

/* Candle lab */
.candle-lab {
  display: grid; grid-template-columns: 1fr 180px; gap: 16px; align-items: stretch;
}
.candle-sliders { display: grid; gap: 12px; align-content: start; padding: 10px 4px; }
.slider-row { display: grid; gap: 4px; }
.slider-row label {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-3);
  display: flex; justify-content: space-between;
}
.slider-row label span { color: var(--text); }
.slider-row input[type="range"] { -webkit-appearance: none; height: 4px; background: var(--bg-3); border-radius: 2px; outline: none; }
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; background: var(--amber);
  border-radius: 50%; cursor: pointer;
}

/* legend chips */
.legend-row { display: flex; flex-wrap: wrap; gap: 12px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; }
.legend-chip .sq { width: 10px; height: 10px; border-radius: 2px; }

/* Tweaks panel */
.tweaks-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 280px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 14px 40px -10px oklch(0.1 0.01 60 / 0.6);
}
.tweaks-panel h4 {
  margin: 0 0 12px; font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber);
}
.tweak-row { display: grid; gap: 4px; margin-bottom: 10px; }
.tweak-row label { font-size: 11px; color: var(--text-2); display:flex; justify-content: space-between; }
.tweak-swatch-row { display: flex; gap: 6px; }
.tweak-swatch {
  width: 22px; height: 22px; border-radius: 4px; cursor: pointer;
  border: 2px solid transparent;
}
.tweak-swatch.on { border-color: var(--text); }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 6px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-track { background: transparent; }

/* utility */
.kbd {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px; color: var(--text-2);
}

.divider { height: 1px; background: var(--line-soft); margin: 26px 0; }

/* price ticker animation */
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bull); display: inline-block; animation: blink 1.4s ease-in-out infinite; }

/* ============ TOP TABS ============ */
.top-tabs {
  display: flex; gap: 2px; padding: 3px; margin-left: 20px;
  background: var(--bg-2); border-radius: 8px; border: 1px solid var(--line);
}
.top-tabs button {
  padding: 6px 14px; border-radius: 6px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3); display: flex; align-items: center; gap: 8px;
  transition: all 120ms;
}
.top-tabs button:hover { color: var(--text-2); }
.top-tabs button.on { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line-soft); }
.top-tabs button.on .tt-live-dot { background: var(--bull); }
.top-tabs .tt-icon { font-size: 13px; color: var(--amber); }
.top-tabs .tt-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-3);
  animation: blink 1.4s ease-in-out infinite;
}

/* ============ LIVE CHARTS PAGE ============ */
.app--live { grid-template-columns: 260px 1fr 280px; }
.live-page {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  overflow: hidden;
  min-height: 0;
  height: 100%;
}
.live-page.fullscreen { grid-template-columns: 1fr; }

/* Watchlist */
.lc-watchlist {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg) 0%, oklch(0.16 0.008 60) 100%);
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.lc-wl-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--text-3); text-transform: uppercase;
  border-bottom: 1px solid var(--line-soft);
}
.lc-wl-add {
  width: 22px; height: 22px; border-radius: 4px; background: var(--bg-3);
  color: var(--text-2); font-size: 14px; display: grid; place-items: center;
}
.lc-wl-add:hover { background: var(--amber); color: var(--bg); }
.lc-wl-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; width: 100%; text-align: left;
  border-bottom: 1px solid var(--line-soft);
  transition: background 100ms;
  position: relative;
}
.lc-wl-row:hover { background: var(--bg-2); }
.lc-wl-row.active { background: var(--bg-2); }
.lc-wl-row.active::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px; background: var(--amber);
}
.lc-wl-sym { display: flex; flex-direction: column; gap: 2px; }
.lc-wl-name { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--text); }
.lc-wl-ex { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); letter-spacing: 0.08em; }
.lc-wl-price { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.lc-wl-price > div:first-child { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.lc-wl-price > div:last-child { font-family: var(--font-mono); font-size: 10px; }
.lc-up { color: var(--bull) !important; }
.lc-down { color: var(--bear) !important; }
.lc-wl-footer { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line-soft); }

/* Chart column */
.lc-chart-col {
  display: flex; flex-direction: column; min-width: 0;
  background: radial-gradient(1200px 400px at 80% -10%, oklch(0.25 0.02 60 / 0.4), transparent 60%), var(--bg);
}
.lc-symbar {
  display: flex; align-items: center; gap: 18px; padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}
.lc-sym-btn {
  display: flex; align-items: baseline; gap: 10px; padding: 6px 12px;
  border: 1px solid var(--line); background: var(--bg-2); border-radius: 8px;
  transition: all 120ms;
}
.lc-sym-btn:hover { border-color: var(--amber); background: var(--bg-3); }
.lc-sym-ticker { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.lc-sym-ex { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.1em; }
.lc-sym-chev { color: var(--text-3); margin-left: 6px; font-size: 14px; }
.lc-price-block { display: flex; align-items: baseline; gap: 14px; }
.lc-ltp { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.lc-chg { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.lc-ohlc-mini {
  display: flex; gap: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  padding-left: 20px; border-left: 1px solid var(--line);
}
.lc-ohlc-mini em { font-style: normal; color: var(--text-3); margin-right: 4px; font-size: 10px; }
.lc-status {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  padding: 5px 10px; border-radius: 4px; border: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.lc-status.live { color: var(--bull); border-color: oklch(0.5 0.15 145); }
.lc-status.demo { color: var(--amber); border-color: var(--amber-dim); }
.lc-status.idle { color: var(--text-2); border-color: var(--line-soft); }
.lc-status-copy { display: flex; flex-direction: column; gap: 2px; letter-spacing: 0.08em; }
.lc-status-copy span:last-child { color: var(--text-3); font-size: 9px; }

/* Toolbar */
.lc-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 24px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.lc-divider { width: 1px; height: 20px; background: var(--line); }
.lc-tool-btn {
  padding: 6px 10px; border-radius: 6px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.04em; color: var(--text-2);
  background: var(--bg-3); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 120ms;
}
.lc-tool-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-3); }
.lc-tool-btn.on { background: oklch(0.28 0.05 75); color: var(--amber); border-color: var(--amber-dim); }
.lc-tool-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.lc-badge {
  background: var(--amber); color: var(--bg); font-weight: 700;
  font-size: 9px; padding: 1px 5px; border-radius: 8px; min-width: 14px; text-align: center;
}

/* Crosshair readout */
.lc-crosshair-readout {
  display: flex; gap: 18px; padding: 8px 24px;
  background: var(--bg-2); border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-2);
  align-items: center;
}
.lc-crosshair-readout em { font-style: normal; color: var(--text-3); margin-right: 4px; font-size: 10px; }
.lc-crosshair-readout b { font-weight: 600; color: var(--text); }
.lc-time { margin-left: auto; color: var(--text-3); font-size: 10px; }

/* Chart area */
.lc-chart-wrap {
  flex: 1; position: relative; min-height: 0;
  margin: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: oklch(0.14 0.008 60);
  overflow: hidden;
}
.lc-legend {
  position: absolute; top: 10px; left: 14px; z-index: 3;
  display: flex; gap: 10px; font-family: var(--font-mono); font-size: 10px; color: var(--text-2);
}
.lc-leg { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; background: oklch(0.14 0.008 60 / 0.7); border-radius: 4px; }
.lc-leg > span:first-child { width: 12px; height: 2px; display: inline-block; border-radius: 1px; }
.lc-loading, .lc-error {
  position: absolute; top: 14px; right: 14px; z-index: 4;
  padding: 6px 12px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px;
}
.lc-loading { background: var(--bg-3); color: var(--text-2); }
.lc-error { background: oklch(0.3 0.1 25 / 0.4); color: var(--bear); border: 1px solid var(--bear-dim); }

/* RSI pane */
.lc-rsi-pane {
  height: 160px; margin: 0 16px 12px; border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; background: oklch(0.14 0.008 60);
  display: flex; flex-direction: column;
}
.lc-rsi-head {
  padding: 8px 14px; font-family: var(--font-mono); font-size: 10px;
  color: var(--text-2); letter-spacing: 0.1em; text-transform: uppercase;
  border-bottom: 1px solid var(--line-soft);
}
.lc-rsi-body { flex: 1; min-height: 0; }

/* Info rail */
.lc-inforail {
  border-left: 1px solid var(--line); overflow-y: auto;
  background: linear-gradient(180deg, var(--bg) 0%, oklch(0.16 0.008 60) 100%);
}
.lc-info-section { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.lc-info-title {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--text-3); text-transform: uppercase; margin-bottom: 10px;
}
.lc-info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-family: var(--font-mono); font-size: 11.5px;
}
.lc-info-row > span { color: var(--text-3); }
.lc-info-row > b { color: var(--text); font-weight: 500; }
.lc-range-bar {
  position: relative; height: 6px; background: var(--bg-3); border-radius: 3px;
  margin-top: 10px;
}
.lc-range-fill {
  position: absolute; top: -3px; width: 2px; height: 12px;
  background: var(--amber); border-radius: 1px; transform: translateX(-50%);
}
.lc-range-bar > span {
  position: absolute; top: 10px; font-family: var(--font-mono);
  font-size: 9px; color: var(--text-3);
}

/* Order ticket */
.lc-ticket { display: flex; flex-direction: column; gap: 8px; }
.lc-ticket-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lc-ticket-buy, .lc-ticket-sell {
  padding: 10px; border-radius: 6px; font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
}
.lc-ticket-buy { background: oklch(0.35 0.12 145); color: var(--bull); border: 1px solid var(--bull-dim); }
.lc-ticket-buy:hover { background: var(--bull); color: var(--bg); }
.lc-ticket-sell { background: oklch(0.32 0.13 25); color: var(--bear); border: 1px solid var(--bear-dim); }
.lc-ticket-sell:hover { background: var(--bear); color: white; }
.lc-ticket-field { display: flex; align-items: center; gap: 8px; }
.lc-ticket-field label { font-family: var(--font-mono); font-size: 9px; color: var(--text-3); width: 40px; letter-spacing: 0.1em; }
.lc-ticket-field input {
  flex: 1; padding: 7px 10px; border-radius: 4px;
  background: var(--bg-3); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; color: var(--text);
  outline: none;
}
.lc-ticket-field input:focus { border-color: var(--amber); }
.lc-ticket-tabs { display: flex; gap: 4px; background: var(--bg-3); padding: 3px; border-radius: 6px; }
.lc-ticket-tabs button {
  flex: 1; padding: 5px; border-radius: 4px; font-family: var(--font-mono);
  font-size: 10px; color: var(--text-2); letter-spacing: 0.08em;
}
.lc-ticket-tabs button.on { background: var(--bg); color: var(--text); }

/* Symbol search overlay */
.sym-search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: oklch(0.1 0.008 60 / 0.6);
  backdrop-filter: blur(4px);
  display: grid; place-items: start center;
  padding-top: 80px;
}
.sym-search {
  width: min(560px, 92vw); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 20px 60px -10px oklch(0.05 0.01 60 / 0.8);
  overflow: hidden;
}
.sym-search input {
  width: 100%; padding: 18px 22px; background: transparent; border: none;
  color: var(--text); font-size: 16px; font-family: var(--font-sans);
  outline: none; border-bottom: 1px solid var(--line);
}
.sym-list { max-height: 50vh; overflow-y: auto; }
.sym-item {
  display: grid; grid-template-columns: 140px 1fr auto; gap: 14px;
  padding: 12px 22px; width: 100%; text-align: left;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  transition: background 100ms;
}
.sym-item:hover { background: var(--bg-3); }
.sym-tick { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text); }
.sym-name { font-size: 13px; color: var(--text-2); }
.sym-ex { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.08em; padding: 2px 8px; background: var(--bg-3); border-radius: 4px; }
.sym-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }
.sym-footer {
  padding: 10px 22px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--text-3); display: flex; gap: 14px;
}

/* Config modal */
.config-modal {
  width: min(520px, 92vw); background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 26px;
  box-shadow: 0 20px 60px -10px oklch(0.05 0.01 60 / 0.8);
}
.cfg-row { margin-bottom: 18px; }
.cfg-row label {
  display: block; font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: var(--text-3); text-transform: uppercase;
  margin-bottom: 6px;
}
.cfg-row input {
  width: 100%; padding: 10px 14px; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-family: var(--font-mono); font-size: 13px;
  outline: none;
}
.cfg-row input:focus { border-color: var(--amber); }
.cfg-hint { font-size: 11px; color: var(--text-3); margin-top: 6px; line-height: 1.5; }
.cfg-test {
  padding: 10px 14px; border-radius: 6px; background: var(--bg-3);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-2);
  margin-top: 10px;
}

/* Indicators popover */
.ind-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10;
  min-width: 200px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; box-shadow: 0 10px 30px -5px oklch(0.05 0.01 60 / 0.6);
}
.ind-pop-title {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--text-3); padding: 4px 8px 8px;
}
.ind-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 5px; cursor: pointer; font-size: 12px; color: var(--text-2);
}
.ind-item:hover { background: var(--bg-3); color: var(--text); }
.ind-item.on { color: var(--text); }
.ind-item input { margin: 0; accent-color: var(--amber); }
.ind-dot { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }
.ind-label { font-family: var(--font-mono); font-size: 11px; }
.lc-pro-dock { border-top: 1px solid var(--line); padding: 10px; background: var(--bg); max-height: 420px; overflow: auto; }
.lc-pro-dock > * { max-height: 400px; }

/* ============ APP V2: new tab shell ============ */
.app.v2 { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; }
.topbar.v2 { padding: 0 16px; gap: 14px; }
.top-nav-row { display: flex; gap: 2px; margin-left: 20px; overflow-x: auto; }
.top-nav-btn {
  padding: 7px 12px; border-radius: 6px; font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em; color: var(--text-3);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  border: 1px solid transparent;
}
.top-nav-btn:hover { color: var(--text-2); background: var(--bg-2); }
.top-nav-btn.on { background: var(--bg-2); color: var(--text); border-color: var(--line); }
.top-nav-btn.on .tnb-ic { color: var(--amber); }
.top-nav-btn .tnb-ic { font-size: 13px; color: var(--text-3); }
.app-body { overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.app-body > * { flex: 1; min-height: 0; overflow: auto; }

/* Mobile bottom nav (hidden on desktop) */
.mob-nav { display: none; }

.course-shell {
  display: grid; grid-template-columns: 300px 1fr; height: 100%; overflow: hidden;
}
.course-shell > .sidebar { grid-column: 1; }
.course-shell > .main { grid-column: 2; }

/* ============ DASHBOARD ============ */
.dash-page { padding: 18px 22px 40px; overflow-y: auto; height: 100%; }
.dash-indices {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 18px;
}
.dash-idx { padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.dash-idx-name { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--text-3); }
.dash-idx-val { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--text); margin-top: 4px; }
.dash-idx-ch { font-family: var(--font-mono); font-size: 11px; margin-top: 2px; }

.dash-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  grid-auto-rows: min-content;
}
.dash-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.dash-card.dash-pnl { grid-column: span 2; }
.dash-card.dash-wide { grid-column: span 2; }
.dash-card.dash-heatmap-card { grid-column: span 2; }
.dash-card-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--text-3); text-transform: uppercase;
}
.dash-head-copy { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.dash-live-pill,
.scr-live-pill {
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.dash-live-pill.live,
.scr-live-pill.live { color: var(--bull); border-color: oklch(0.5 0.15 145); }
.dash-live-pill.fallback,
.scr-live-pill.fallback { color: var(--amber); border-color: var(--amber-dim); }
.dash-status-note,
.scr-status-note {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.scr-scan-note {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.scr-scan-note.warn { color: var(--amber); }
.dash-more { font-family: var(--font-mono); font-size: 10px; color: var(--amber); letter-spacing: 0.06em; }
.dash-more:hover { color: oklch(0.9 0.14 75); }

.dash-pnl-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.dash-pnl-main { display: flex; flex-direction: column; gap: 4px; }
.dash-pnl-lbl { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); letter-spacing: 0.1em; }
.dash-pnl-big { font-family: var(--font-serif); font-size: 34px; letter-spacing: -0.02em; }
.dash-pnl-pct { font-family: var(--font-mono); font-size: 13px; }
.dash-pnl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-family: var(--font-mono); font-size: 11px; }
.dash-pnl-grid > div { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--bg-3); border-radius: 6px; }
.dash-pnl-grid em { font-style: normal; color: var(--text-3); font-size: 9.5px; letter-spacing: 0.1em; }
.dash-pnl-grid b { color: var(--text); font-weight: 600; font-size: 13px; }

.dash-breadth { display: flex; flex-direction: column; gap: 10px; }
.dash-breadth-bar { height: 10px; background: var(--bg-3); border-radius: 5px; overflow: hidden; display: flex; }
.bd-adv { background: var(--bull); }
.bd-dec { background: var(--bear); }
.dash-breadth-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-family: var(--font-mono); font-size: 11px; }
.dash-breadth-nums > div { display: flex; flex-direction: column; gap: 2px; text-align: center; padding: 6px; background: var(--bg-3); border-radius: 5px; }
.dash-breadth-nums em { font-style: normal; font-size: 9.5px; letter-spacing: 0.1em; }
.dash-breadth-nums b { font-size: 16px; color: var(--text); font-weight: 600; }
.dash-breadth-ratio { text-align: center; font-size: 11px; color: var(--text-3); }
.dash-breadth-ratio b { color: var(--text); font-size: 14px; margin-left: 4px; }

.dash-movers { display: flex; flex-direction: column; gap: 4px; }
.dash-mover {
  display: grid; grid-template-columns: 90px 60px 1fr auto; gap: 10px; align-items: center;
  padding: 7px 10px; border-radius: 6px; text-align: left;
  transition: background 100ms;
}
.dash-mover:hover { background: var(--bg-3); }
.dash-mover-sym { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; color: var(--text); }
.dash-mover-spark { opacity: 0.8; }
.dash-mover-price { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); text-align: right; }
.dash-mover-ch { font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-align: right; }

.dash-heatmap {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; min-height: 180px;
}
.dash-heat-cell {
  padding: 10px; border-radius: 6px; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 80px;
}
.dash-heat-sym { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.dash-heat-ch { font-family: var(--font-mono); font-size: 14px; color: white; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

.dash-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-tbl th { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--text-3); text-align: left; font-weight: 500; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); }
.dash-tbl td { padding: 8px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 11.5px; color: var(--text); }
.tag-chip { font-family: var(--font-mono); font-size: 9px; padding: 2px 6px; background: var(--bg-3); border-radius: 3px; color: var(--text-3); letter-spacing: 0.08em; }
.tag-chip.pat { color: var(--amber); border: 1px solid var(--amber-dim); }
.dash-row-btn { font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; color: var(--text-3); letter-spacing: 0.06em; border-radius: 4px; }
.dash-row-btn:hover { background: var(--bg-3); color: var(--text); }

.dash-orders { display: flex; flex-direction: column; gap: 6px; }
.dash-order { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg-3); border-radius: 6px; font-size: 11px; }
.order-side { font-family: var(--font-mono); font-size: 9px; padding: 3px 7px; border-radius: 3px; letter-spacing: 0.1em; font-weight: 700; }
.order-side.b { background: oklch(0.3 0.1 145); color: var(--bull); }
.order-side.s { background: oklch(0.3 0.1 25); color: var(--bear); }
.order-stat { font-family: var(--font-mono); font-size: 9px; padding: 3px 7px; border-radius: 3px; letter-spacing: 0.1em; font-weight: 600; }
.order-stat.s-pending { background: oklch(0.3 0.1 75); color: var(--amber); }
.order-stat.s-executed { background: oklch(0.3 0.1 145); color: var(--bull); }
.order-stat.s-cancelled { background: var(--bg-3); color: var(--text-3); }
.order-stat.s-rejected { background: oklch(0.3 0.1 25); color: var(--bear); }
.order-stat.s-active { background: oklch(0.3 0.1 145); color: var(--bull); }
.order-stat.s-triggered { background: oklch(0.3 0.1 75); color: var(--amber); }
.order-stat.s-expired { background: var(--bg-3); color: var(--text-3); }

.dash-news { display: flex; flex-direction: column; gap: 4px; }
.dash-news-status { display: flex; align-items: center; gap: 8px; padding: 0 10px 6px; }
.dash-news-row { display: flex; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 6px; }
.dash-news-row:hover { background: var(--bg-3); }
.news-impact { width: 3px; border-radius: 2px; flex-shrink: 0; align-self: stretch; }
.news-impact.i-high { background: var(--bear); }
.news-impact.i-med { background: var(--amber); }
.news-impact.i-low { background: var(--text-3); }
.news-title { font-size: 12.5px; line-height: 1.4; color: var(--text); }
.news-title-link { color: inherit; text-decoration: none; }
.news-title-link:hover { text-decoration: underline; }
.news-meta { display: flex; gap: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--text-3); margin-top: 3px; align-items: center; flex-wrap: wrap; }
.news-cat { background: var(--bg-3); padding: 1px 6px; border-radius: 3px; letter-spacing: 0.06em; }
.news-sym { appearance: none; background: oklch(0.25 0.08 75); color: var(--amber); padding: 1px 6px; border-radius: 3px; border: 1px solid var(--amber-dim); cursor: pointer; font: inherit; }
.news-sym-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.news-state { padding: 14px 16px; border-radius: 8px; background: var(--bg-2); border: 1px dashed var(--line); color: var(--text-3); font-size: 12px; }
.news-state.error { color: var(--bear); border-color: var(--bear-dim); }

.dash-wl { display: flex; flex-direction: column; gap: 2px; }
.dash-wl-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 10px; border-radius: 5px; font-size: 11.5px; text-align: left; }
.dash-wl-row:hover { background: var(--bg-3); }

/* ============ SCREENER ============ */
.screener-page { display: grid; grid-template-columns: 260px 1fr; height: 100%; overflow: hidden; }
.scr-filters { border-right: 1px solid var(--line); padding: 14px 16px 40px; overflow-y: auto; background: linear-gradient(180deg, var(--bg) 0%, oklch(0.16 0.008 60) 100%); }
.scr-head { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; color: var(--text); padding: 6px 4px 16px; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1px solid var(--line-soft); margin-bottom: 14px; gap: 12px; }
.scr-head-copy { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.scr-section-title { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em; color: var(--text-3); margin: 14px 0 6px; text-transform: uppercase; }
.scr-presets { display: flex; flex-direction: column; gap: 3px; }
.scr-preset { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 5px; text-align: left; font-size: 11.5px; color: var(--text-2); transition: all 100ms; font-family: var(--font-mono); }
.scr-preset:hover { background: var(--bg-2); color: var(--text); }
.scr-preset.on { background: oklch(0.28 0.05 75); color: var(--amber); }
.scr-preset-ic { width: 16px; font-size: 12px; }
.scr-input { width: 100%; padding: 8px 10px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 5px; color: var(--text); font-family: var(--font-mono); font-size: 11.5px; outline: none; }
.scr-input:focus { border-color: var(--amber); }
.scr-input.small { flex: 1; padding: 6px 8px; font-size: 11px; }
.scr-range-row { display: flex; gap: 6px; align-items: center; font-size: 10px; }
.scr-tab { display: flex; gap: 2px; background: var(--bg-3); padding: 2px; border-radius: 5px; }
.scr-tab button { flex: 1; padding: 5px 6px; border-radius: 3px; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--text-3); }
.scr-tab button.on { background: var(--bg); color: var(--text); }
.scr-results { overflow: hidden; display: flex; flex-direction: column; }
.scr-res-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.scr-res-title { font-family: var(--font-serif); font-size: 22px; display: flex; align-items: baseline; gap: 12px; }
.scr-res-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); letter-spacing: 0.08em; }
.scr-sort { display: flex; gap: 8px; align-items: center; }
.scr-sort-dir { padding: 4px 10px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 4px; color: var(--text-2); font-family: var(--font-mono); font-size: 12px; }
.scr-tbl-wrap { flex: 1; overflow: auto; }
.scr-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.scr-tbl th { position: sticky; top: 0; z-index: 2; background: var(--bg); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--text-3); text-align: left; font-weight: 500; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.scr-tbl th.r { text-align: right; }
.scr-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); color: var(--text); }
.scr-tbl td.r { text-align: right; }
.scr-tbl .scr-row { cursor: pointer; }
.scr-tbl .scr-row:hover { background: var(--bg-2); }
.scr-sub { font-size: 9.5px; color: var(--text-3); margin-top: 2px; }
.scr-52bar { position: relative; width: 60px; height: 4px; background: var(--bg-3); border-radius: 2px; margin-left: auto; }
.scr-52mark { position: absolute; top: -3px; width: 2px; height: 10px; background: var(--amber); border-radius: 1px; transform: translateX(-50%); }
.scr-signal-cell { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag-chip.sig-bullish { color: var(--bull); border: 1px solid oklch(0.5 0.15 145 / 0.6); }
.tag-chip.sig-bearish { color: var(--bear); border: 1px solid oklch(0.52 0.16 25 / 0.6); }
.tag-chip.sig-neutral { color: var(--text-2); border: 1px solid var(--line); }
.scr-signal-more { color: var(--text-2); border: 1px solid var(--line); }

/* ============ POSITIONS / ORDERS / HOLDINGS / ALERTS / NEWS PAGES ============ */
.pg-page { padding: 18px 22px 40px; overflow: auto; height: 100%; }
.pg-summary { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.pg-summary-item { padding: 10px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.pg-summary-item em { font-style: normal; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; color: var(--text-3); }
.pg-summary-item b { font-family: var(--font-mono); font-size: 15px; color: var(--text); font-weight: 600; }
.pg-tbl { width: 100%; border-collapse: collapse; font-size: 12px; background: var(--bg-2); border-radius: 10px; overflow: hidden; }
.pg-tbl th { background: var(--bg); font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--text-3); text-align: left; font-weight: 500; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.pg-tbl th.r { text-align: right; }
.pg-tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); color: var(--text); font-size: 11.5px; }
.pg-tbl td.r { text-align: right; }
.pg-edit { width: 72px; padding: 4px 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 3px; color: var(--text); font-family: var(--font-mono); font-size: 11px; text-align: right; outline: none; }
.pg-edit:focus { border-color: var(--amber); }
.pg-hit-sl { font-size: 9px; color: var(--bear); margin-left: 4px; padding: 1px 4px; background: oklch(0.3 0.12 25); border-radius: 3px; letter-spacing: 0.1em; }
.pg-hit-tgt { font-size: 9px; color: var(--bull); margin-left: 4px; padding: 1px 4px; background: oklch(0.3 0.1 145); border-radius: 3px; letter-spacing: 0.1em; }
.pg-risk-bar { width: 80px; height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.pg-risk-fill { height: 100%; transition: width 200ms; }
.pg-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.pg-tabs button { padding: 7px 14px; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.pg-tabs button:hover { color: var(--text); }
.pg-tabs button.on { background: var(--bg); color: var(--amber); border-color: var(--amber-dim); }
.pg-tab-count { background: var(--bg-3); color: var(--text-3); padding: 1px 6px; border-radius: 8px; font-size: 9px; }
.pg-holdings-grid { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
.pg-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.pg-card-head { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--text-3); margin-bottom: 12px; }
.pg-alloc-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--bg-3); margin-bottom: 14px; }
.pg-alloc-legend { display: flex; flex-direction: column; gap: 6px; }
.pg-alloc-lg { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-2); }
.pg-alloc-dot { width: 10px; height: 10px; border-radius: 2px; }
.news-list { display: flex; flex-direction: column; gap: 8px; }
.news-card { display: flex; gap: 14px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.news-card-left { display: flex; gap: 10px; align-items: start; }
.news-card-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); min-width: 30px; }
.news-card-title { font-size: 14px; line-height: 1.4; color: var(--text); }
.impact-tag { padding: 2px 6px; border-radius: 3px; font-size: 9px; letter-spacing: 0.1em; font-weight: 600; margin-left: 4px; }
.impact-tag.high { background: oklch(0.3 0.12 25); color: var(--bear); }
.impact-tag.med { background: oklch(0.3 0.1 75); color: var(--amber); }
.impact-tag.low { background: var(--bg-3); color: var(--text-3); }

/* ============ CHART PRO WIDGETS ============ */
.vp-panel, .depth-panel, .ts-panel, .ai-panel, .mtf-grid { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.vp-head, .depth-head, .ts-head, .ai-head, .mtf-head { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--text-3); display: flex; align-items: center; gap: 8px; text-transform: uppercase; }
.vp-body { padding: 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.vp-row { display: grid; grid-template-columns: 60px 1fr 50px; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 10px; }
.vp-price { color: var(--text-3); }
.vp-bar-wrap { background: var(--bg-3); height: 8px; border-radius: 2px; }
.vp-bar { height: 100%; background: oklch(0.45 0.1 60); border-radius: 2px; }
.vp-bar.va { background: oklch(0.55 0.12 200); }
.vp-bar.poc { background: var(--amber); }
.vp-vol { color: var(--text-2); text-align: right; }
.vp-footer { padding: 8px 14px; border-top: 1px solid var(--line-soft); display: flex; gap: 14px; font-size: 10px; }
.vp-footer em, .depth-foot em { font-style: normal; color: var(--text-3); margin-right: 4px; }
.vp-footer b, .depth-foot b { color: var(--text); }
.depth-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); }
.depth-col { display: flex; flex-direction: column; background: var(--bg-2); }
.depth-col-head { display: grid; grid-template-columns: 1fr 40px 1fr; gap: 6px; padding: 6px 10px; font-family: var(--font-mono); font-size: 9px; color: var(--text-3); letter-spacing: 0.1em; background: var(--bg-3); }
.depth-col-head .r { text-align: right; }
.depth-row { position: relative; display: grid; grid-template-columns: 1fr 40px 1fr; gap: 6px; padding: 5px 10px; font-size: 10.5px; }
.depth-row .r { text-align: right; }
.depth-bg { position: absolute; top: 0; bottom: 0; opacity: 0.15; }
.depth-row.bid .depth-bg { right: 0; background: var(--bull); }
.depth-row.ask .depth-bg { left: 0; background: var(--bear); }
.depth-foot { padding: 8px 14px; border-top: 1px solid var(--line-soft); display: flex; gap: 14px; font-size: 10px; }
.ts-col-head, .ts-row { display: grid; grid-template-columns: 1fr 1fr 1fr 22px; gap: 8px; padding: 4px 12px; font-family: var(--font-mono); font-size: 10.5px; align-items: center; }
.ts-col-head { background: var(--bg-3); color: var(--text-3); font-size: 9px; letter-spacing: 0.1em; padding: 6px 12px; }
.ts-col-head .r { text-align: right; }
.ts-row .r { text-align: right; }
.ts-body { overflow-y: auto; max-height: 400px; }
.ts-row.buy { background: oklch(0.22 0.04 145 / 0.2); }
.ts-row.sell { background: oklch(0.22 0.05 25 / 0.2); }
.ts-side { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; padding: 1px 4px; border-radius: 2px; text-align: center; }
.ts-side.b { background: var(--bull); color: var(--bg); }
.ts-side.s { background: var(--bear); color: white; }
.mtf-grid-body { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); flex: 1; min-height: 0; }
.mtf-mini { background: var(--bg-2); display: flex; flex-direction: column; min-height: 180px; }
.mtf-mini-head { display: flex; justify-content: space-between; padding: 6px 10px; font-family: var(--font-mono); font-size: 10px; }
.mtf-mini-tf { color: var(--amber); letter-spacing: 0.1em; font-weight: 600; }
.mtf-mini-chg { font-weight: 600; }
.mtf-mini-chart { flex: 1; min-height: 0; }
.ai-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 4px; max-height: 300px; overflow-y: auto; }
.ai-row { display: flex; gap: 8px; padding: 6px 10px; border-radius: 4px; align-items: center; font-family: var(--font-mono); font-size: 11px; }
.ai-row.bull { background: oklch(0.22 0.04 145 / 0.3); }
.ai-row.bear { background: oklch(0.22 0.05 25 / 0.3); }
.ai-row.neutral { background: var(--bg-3); }
.ai-dot { width: 8px; height: 8px; border-radius: 50%; }
.ai-dot.bull { background: var(--bull); }
.ai-dot.bear { background: var(--bear); }
.ai-dot.neutral { background: var(--text-3); }
.ai-type { color: var(--text); font-weight: 600; }

/* ============ MOBILE ============ */
@media (max-width: 860px) {
  .topbar.v2 { padding: 0 12px; }
  .top-nav-row { display: none; }
  .brand span:not(.brand-mark) { display: none; }
  .topbar-right { gap: 10px; }
  .topbar-right .streak { padding: 3px 8px; font-size: 10px; }

  .mob-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: oklch(0.14 0.01 60 / 0.98); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); padding: 6px 4px 10px; gap: 2px;
  }
  .mob-nav-btn {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 6px 2px; border-radius: 6px; color: var(--text-3);
    font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.04em;
  }
  .mob-nav-btn.on { color: var(--amber); background: oklch(0.22 0.04 75 / 0.4); }
  .mnb-ic { font-size: 18px; }
  .app-body { padding-bottom: 70px; }

  .dash-indices { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .dash-idx { padding: 8px 10px; }
  .dash-idx-val { font-size: 14px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-card.dash-pnl, .dash-card.dash-wide, .dash-card.dash-heatmap-card { grid-column: span 1; }
  .dash-heatmap { grid-template-columns: repeat(4, 1fr); }
  .dash-pnl-body { grid-template-columns: 1fr; }
  .dash-pnl-grid { grid-template-columns: 1fr 1fr; }

  .screener-page { grid-template-columns: 1fr; }
  .scr-filters { display: none; } /* show via toggle in real build */
  .screener-page.show-filters .scr-filters { display: block; position: absolute; inset: 0; z-index: 20; }

  .pg-page { padding: 12px 14px 80px; }
  .pg-summary-item { min-width: 100px; padding: 8px 12px; }
  .pg-summary-item b { font-size: 13px; }
  .pg-holdings-grid { grid-template-columns: 1fr; }
  .pg-tbl { font-size: 11px; }
  .pg-tbl th, .pg-tbl td { padding: 8px 7px; }
  .pg-edit { width: 60px; }

  /* Live chart mobile */
  .live-page { grid-template-columns: 1fr; }
  .lc-watchlist, .lc-inforail { display: none; }
  .lc-symbar { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .lc-ohlc-mini { padding-left: 0; border-left: none; width: 100%; gap: 10px; font-size: 10px; flex-wrap: wrap; }
  .lc-toolbar { padding: 8px 12px; gap: 6px; }
  .lc-tool-btn { padding: 5px 8px; font-size: 10px; }

  .course-shell { grid-template-columns: 1fr; }
  .course-shell > .sidebar { display: none; }
  .course-shell > .main { grid-template-columns: 1fr; }
  .lesson-pane { padding: 20px 18px 40px; border-right: none; }
  .chart-pane { display: none; } /* hide chart pane on mobile lessons, or show below */

  h1.lesson-title-big { font-size: 32px; }
}
@media (max-width: 500px) {
  .dash-indices { grid-template-columns: repeat(2, 1fr); }
  .dash-heatmap { grid-template-columns: repeat(3, 1fr); }
}
