/* TradeLab — design system
 * Inspired by Kite (dense, tabular, keyboard-first) and Groww (friendly cards,
 * green/red signalling). Env-aware accent colour: indigo for SANDBOX,
 * emerald for LIVE — driven by [data-env] on <html>.
 */

/* ──────────────── Tokens ──────────────── */
:root {
  --bg:        #0b0f1a;
  --bg-2:      #111827;
  --bg-3:      #161e2d;
  --line:      rgba(255,255,255,0.06);
  --line-2:    rgba(255,255,255,0.10);
  --text:      #e5e7eb;
  --text-mut:  #94a3b8;
  --text-dim:  #64748b;
  --pos:       #10b981;
  --pos-soft:  rgba(16,185,129,0.12);
  --neg:       #ef4444;
  --neg-soft:  rgba(239,68,68,0.12);
  --warn:      #f59e0b;

  --accent:        #6366f1;
  --accent-soft:   rgba(99,102,241,0.14);
  --accent-strong: #818cf8;

  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 6px 24px rgba(0,0,0,0.35);
  --topbar-h:  60px;
  --sidebar-w: 300px;
  --drawer-w:  380px;

  --mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

html[data-env="LIVE"] {
  --accent:        #10b981;
  --accent-soft:   rgba(16,185,129,0.14);
  --accent-strong: #34d399;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
.tl-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1f2a3d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2c3a52; }

.muted { color: var(--text-mut); }
.muted.small { font-size: 12px; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.pos  { color: var(--pos) !important; }
.neg  { color: var(--neg) !important; }

/* ──────────────── Top bar ──────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.brand-mark {
  width: 24px; height: 24px;
  border-radius: 7px;
  background:
    radial-gradient(circle at 30% 30%, #fff5 0 1px, transparent 2px),
    linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}
.brand-text { font-weight: 700; letter-spacing: -0.01em; }
.brand-tag  {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent-strong);
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-link {
  position: relative;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-mut);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tab-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.tab-link.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.search-wrap { position: relative; }
#global-search {
  width: 280px;
  height: 36px;
  padding: 0 12px;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#global-search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 50;
}
.sr-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.sr-row:hover { background: rgba(255,255,255,0.03); }
.sr-row:last-child { border-bottom: none; }
.sr-sym  { font-weight: 600; }
.sr-name { font-size: 12px; color: var(--text-mut); }
.sr-actions { display: flex; gap: 6px; }
.sr-actions button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-mut);
  cursor: pointer;
  font-family: var(--sans);
}
.sr-actions .sr-buy { background: var(--accent); color: white; border-color: transparent; }
.sr-actions button:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sr-actions .sr-buy:hover { background: var(--accent-strong); color: white; }

.env-pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--bg-3);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
}
.env-pill::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 8px var(--accent-strong);
}
.env-pill[data-env="LIVE"] {
  background: rgba(16,185,129,0.14);
  border-color: rgba(16,185,129,0.4);
  color: #34d399;
}

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--text-mut);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  font-size: 10px;
  font-weight: 700;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
  font-size: 13px;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 56px;
  width: 320px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 60;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pop-head {
  padding: 10px 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.notif-list { overflow-y: auto; }
.notif-row {
  display: flex; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.notif-row:last-child { border-bottom: none; }
.notif-row .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-top: 6px; flex-shrink: 0;
}
.notif-row.kind-fill  .dot { background: var(--pos); }
.notif-row.kind-alert .dot { background: var(--warn); }
.notif-row.kind-sys   .dot { background: var(--text-mut); }
.notif-msg  { font-size: 13px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ──────────────── Layout ──────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  flex: 1;
  min-height: 0;
}

/* ──────────────── Sidebar ──────────────── */
.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-section { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.sidebar-head > span:first-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mut);
}
.sidebar-head .hint { font-size: 10px; color: var(--text-dim); }

/* Watchlist */
.watchlist { display: flex; flex-direction: column; gap: 2px; }
.empty-watch {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border: 1px dashed var(--line-2);
  border-radius: 8px;
}
.wl-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px;
  padding: 8px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
}
.wl-row:hover, .wl-row.selected { background: rgba(255,255,255,0.04); }
.wl-row.selected { box-shadow: inset 2px 0 0 var(--accent); }
.wl-meta { min-width: 0; }
.wl-sym  { font-weight: 600; font-size: 13px; }
.wl-name { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-right { text-align: right; }
.wl-ltp { font-family: var(--mono); font-size: 12px; font-feature-settings: 'tnum'; }
.wl-pct { font-family: var(--mono); font-size: 11px; }
.wl-actions {
  grid-column: 1 / -1;
  display: none;
  gap: 4px;
  padding-top: 6px;
}
.wl-row:hover .wl-actions { display: flex; }
.wl-btn {
  flex: 1;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text-mut);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.wl-btn.buy  { background: var(--pos-soft); color: var(--pos); border-color: transparent; }
.wl-btn.sell { background: var(--neg-soft); color: var(--neg); border-color: transparent; }
.wl-btn.x    { flex: 0 0 26px; }

/* Quick panel */
.quick-panel {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}
.qp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.qp-sym  { font-weight: 700; font-size: 14px; }
.qp-name { font-size: 11px; color: var(--text-dim); }
.qp-px   { text-align: right; }
.qp-ltp  { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.qp-pct  { font-family: var(--mono); font-size: 12px; }
.qp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 10px;
}
.qp-grid > div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 4px 6px;
  background: var(--bg-2);
  border-radius: 4px;
}
.qp-grid span { color: var(--text-dim); }
.qp-grid b   { font-family: var(--mono); }
.qp-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.qp-actions button {
  height: 28px;
  border-radius: 6px;
  border: none;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  font-family: var(--sans);
}
.qp-actions .btn-buy   { background: var(--pos); color: white; }
.qp-actions .btn-sell  { background: var(--neg); color: white; }
.qp-actions .btn-chart { background: var(--bg-2); color: var(--text-mut); border: 1px solid var(--line-2); }

/* ──────────────── Content ──────────────── */
.content {
  overflow-y: auto;
  padding: 22px 26px 60px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}
.tab-pane.hidden { display: none; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 18px;
}
.page-head.split { gap: 24px; }
.page-head h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.page-head p { margin: 0; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 18px;
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.card-head.split { gap: 18px; }
.card-head h2 { font-size: 14px; font-weight: 700; margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.grid-2 > .card { margin-bottom: 0; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

/* KPIs */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.kpi {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.kpi span { display: block; font-size: 11px; color: var(--text-mut); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.kpi b    { font-family: var(--mono); font-size: 16px; font-weight: 700; }
.kpi.big  { padding: 16px 18px; }
.kpi.big b { font-size: 22px; }

/* Indices */
.indices-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.ix-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.ix-name { font-size: 11px; color: var(--text-mut); text-transform: uppercase; letter-spacing: 0.06em; }
.ix-ltp  { font-family: var(--mono); font-size: 18px; font-weight: 700; margin-top: 2px; }
.ix-pct  { font-family: var(--mono); font-size: 12px; }

/* Movers */
.movers-list { display: flex; flex-direction: column; gap: 4px; }
.mover {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.mover:hover { background: rgba(255,255,255,0.03); }
.mover > div:first-child b { font-weight: 600; margin-right: 8px; }
.mover > div:first-child span { font-size: 11px; color: var(--text-dim); }
.mover > div:last-child { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.empty { padding: 12px; color: var(--text-dim); }

/* News */
.news-list { display: flex; flex-direction: column; }
.news-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.news-row:last-child { border-bottom: none; }
.news-src { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.news-title { font-size: 13px; }
.news-time { font-size: 11px; color: var(--text-dim); }

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.data-table th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mut);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table .empty-cell { text-align: center; color: var(--text-dim); padding: 24px; }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.pill.side-buy   { background: var(--pos-soft); color: var(--pos); }
.pill.side-sell  { background: var(--neg-soft); color: var(--neg); }
.pill.st-executed  { background: var(--pos-soft); color: var(--pos); }
.pill.st-open      { background: var(--accent-soft); color: var(--accent-strong); }
.pill.st-cancelled { background: rgba(148,163,184,0.15); color: var(--text-mut); }

.btn-mini {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  font-family: var(--sans);
}
.btn-mini.sell { background: var(--neg-soft); color: var(--neg); }
.btn-mini.sell:hover { background: var(--neg); color: white; }

.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary.danger { background: var(--neg); }
.btn-primary.danger:hover { background: #f87171; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-2);
  height: 36px; padding: 0 14px; border-radius: 8px;
  font-weight: 600; font-size: 13px; cursor: pointer;
  font-family: var(--sans);
}
.btn-ghost:hover { background: rgba(255,255,255,0.04); }

/* Strategies */
.strategies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.strat-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s, border-color .15s;
}
.strat-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.strat-card .tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  background: var(--bg-3); color: var(--text-mut);
  padding: 3px 8px; border-radius: 4px;
}
.strat-card.tone-indigo  .tag { background: rgba(99,102,241,0.16);  color: #a5b4fc; }
.strat-card.tone-purple  .tag { background: rgba(168,85,247,0.16);  color: #d8b4fe; }
.strat-card.tone-emerald .tag { background: rgba(16,185,129,0.16);  color: #6ee7b7; }
.strat-card.tone-amber   .tag { background: rgba(245,158,11,0.16);  color: #fcd34d; }
.strat-card.tone-sky     .tag { background: rgba(56,189,248,0.16);  color: #7dd3fc; }
.strat-card.tone-rose    .tag { background: rgba(244,63,94,0.16);   color: #fda4af; }
.strat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.strat-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.strat-blurb { font-size: 12px; color: var(--text-mut); line-height: 1.4; }
.strat-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.strat-stats > div {
  background: var(--bg-3);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.strat-stats span { display: block; font-size: 10px; color: var(--text-dim); text-transform: uppercase; }
.strat-stats b    { font-family: var(--mono); }
.strat-actions { display: flex; gap: 6px; }
.strat-actions .btn-primary { flex: 1; height: 32px; font-size: 12px; padding: 0 10px; }
.strat-actions .btn-ghost   { flex: 1; height: 32px; font-size: 12px; padding: 0 10px; }

.promote-flow {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--text-mut);
}
.promote-flow .step {
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.promote-flow .step.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: transparent;
}
.promote-flow .arrow { color: var(--text-dim); }

.strat-detail-body {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}
@media (max-width: 1080px) { .strat-detail-body { grid-template-columns: 1fr; } }
.strat-detail-body h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-mut); margin: 0 0 10px; }
.strat-chart {
  width: 100%;
  height: 260px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-3);
}
.strat-detail-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 18px;
}
.strat-detail-stats > div {
  background: var(--bg-3); padding: 8px 10px; border-radius: 6px; font-size: 12px;
}
.strat-detail-stats span { display: block; font-size: 10px; color: var(--text-dim); }
.strat-detail-stats b    { font-family: var(--mono); font-size: 14px; }
.strat-detail-params { display: grid; gap: 10px; }
.strat-detail-params label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.strat-detail-params input {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 6px 10px; font-family: var(--mono); font-size: 13px; outline: none;
}
.strat-detail-params input:focus { border-color: var(--accent); }

/* Explore: heatmap + baskets */
.sector-heatmap { display: flex; flex-direction: column; gap: 10px; }
.sector-block { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; }
.sector-name {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-mut); padding-top: 6px;
}
.sector-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}
.tile {
  padding: 8px 10px; border-radius: 6px;
  display: flex; flex-direction: column; gap: 2px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform .12s;
}
.tile:hover { transform: scale(1.04); }
.tile b    { font-size: 11px; font-weight: 700; }
.tile span { font-family: var(--mono); font-size: 11px; }

.baskets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.basket-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.basket-tag {
  align-self: flex-start;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 4px;
}
.basket-card.tone-indigo  .basket-tag { background: rgba(99,102,241,0.16);  color: #a5b4fc; }
.basket-card.tone-purple  .basket-tag { background: rgba(168,85,247,0.16);  color: #d8b4fe; }
.basket-card.tone-emerald .basket-tag { background: rgba(16,185,129,0.16);  color: #6ee7b7; }
.basket-card.tone-sky     .basket-tag { background: rgba(56,189,248,0.16);  color: #7dd3fc; }
.basket-card.tone-rose    .basket-tag { background: rgba(244,63,94,0.16);   color: #fda4af; }
.basket-card.tone-amber   .basket-tag { background: rgba(245,158,11,0.16);  color: #fcd34d; }
.basket-name  { font-weight: 700; font-size: 15px; }
.basket-blurb { font-size: 12px; color: var(--text-mut); margin: 0; line-height: 1.4; }
.basket-members { display: flex; flex-wrap: wrap; gap: 4px; }
.basket-members span {
  font-family: var(--mono); font-size: 10px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-2); color: var(--text-mut);
}
.basket-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; }
.basket-stats > div { background: var(--bg-2); padding: 6px 8px; border-radius: 6px; }
.basket-stats span { display: block; font-size: 10px; color: var(--text-dim); }
.basket-stats b    { font-family: var(--mono); font-size: 12px; }
.basket-card .btn-primary { margin-top: auto; height: 32px; font-size: 12px; }

/* Charts tab */
.chart-px { text-align: right; }
.chart-ltp { font-family: var(--mono); font-size: 24px; font-weight: 700; }
.chart-pct { font-family: var(--mono); font-size: 14px; }
.tv-chart { width: 100%; height: 460px; }
.fund-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.fund-grid > div {
  background: var(--bg-3);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 8px;
}
.fund-grid span { display: block; font-size: 10px; color: var(--text-dim); text-transform: uppercase; }
.fund-grid b    { font-family: var(--mono); font-size: 16px; }

/* ──────────────── Order Drawer ──────────────── */
.order-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  width: var(--drawer-w);
  background: var(--bg-2);
  border-left: 1px solid var(--line-2);
  box-shadow: -10px 0 30px rgba(0,0,0,0.4);
  z-index: 70;
  transform: translateX(100%);
  transition: transform .22s ease;
  display: flex;
  flex-direction: column;
}
.order-drawer.open { transform: translateX(0); }
.order-drawer.hidden { display: none; }
.od-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.od-sym  { font-weight: 700; font-size: 16px; }
.od-name { font-size: 12px; }
.od-side-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 14px 16px 6px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.od-side-toggle button {
  border: none;
  padding: 8px 0;
  background: transparent;
  color: var(--text-mut);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--sans);
}
#od-side-buy.active  { background: var(--pos); color: white; }
#od-side-sell.active { background: var(--neg); color: white; }
.od-form {
  padding: 12px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.od-form label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--text-mut); }
.od-form input, .od-form select {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}
.od-form input:focus, .od-form select:focus { border-color: var(--accent); }
.od-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.od-meta > div { background: var(--bg-3); padding: 8px 10px; border-radius: 6px; }
.od-meta span  { display: block; font-size: 10px; color: var(--text-dim); }
.od-meta b     { font-family: var(--mono); font-size: 12px; }
.od-note { line-height: 1.4; }
.od-submit {
  margin-top: auto;
  height: 44px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: white;
  font-family: var(--sans);
}
.od-submit.buy  { background: var(--pos); }
.od-submit.sell { background: var(--neg); }
.od-submit.buy:hover  { background: #34d399; }
.od-submit.sell:hover { background: #f87171; }

/* ──────────────── Modal ──────────────── */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 480px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
}
.modal-card h2 { margin: 0 0 6px; font-size: 18px; }
.modal-card .warn { color: var(--neg); }
.modal-card p { margin: 0 0 12px; color: var(--text-mut); font-size: 13px; line-height: 1.5; }
.modal-list { padding-left: 18px; margin: 0 0 14px; color: var(--text-mut); font-size: 12px; line-height: 1.6; }
.modal-input { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-mut); margin-bottom: 14px; }
.modal-input b { color: var(--neg); }
.modal-input input {
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 6px; padding: 9px 12px; font-family: var(--mono); font-size: 14px;
  letter-spacing: 0.18em; outline: none;
}
.modal-input input:focus { border-color: var(--neg); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ──────────────── Toasts ──────────────── */
.toast-stack {
  position: fixed;
  bottom: 16px; right: 16px;
  z-index: 90;
  display: flex; flex-direction: column; gap: 6px;
  max-width: 360px;
}
.tl-toast {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  box-shadow: var(--shadow);
}
.tl-toast.show { opacity: 1; transform: translateY(0); }
.tl-toast.tone-ok   { border-left: 3px solid var(--pos); }
.tl-toast.tone-err  { border-left: 3px solid var(--neg); }
.tl-toast.tone-warn { border-left: 3px solid var(--warn); }

/* ──────────────── Landing page (index.html) ──────────────── */
.lp-body {
  background: var(--bg);
  color: var(--text);
  margin: 0;
  font-family: var(--sans);
  overflow-x: hidden;
}
.lp-nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 32px;
  background: rgba(11,15,26,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.lp-nav-links { display: flex; gap: 24px; }
.lp-nav-links a {
  color: var(--text-mut);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.lp-nav-links a:hover { color: var(--text); }
.lp-cta {
  background: var(--accent);
  color: white;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s;
}
.lp-cta:hover { background: var(--accent-strong); }
.lp-cta.ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); }

.lp-hero {
  padding: 96px 32px 72px;
  text-align: center;
  max-width: 920px;
  margin: 0 auto;
}
.lp-eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.lp-hero h1 {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0 0 18px;
}
.lp-hero h1 .accent {
  background: linear-gradient(90deg, var(--accent-strong), #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lp-hero p { font-size: 18px; color: var(--text-mut); max-width: 640px; margin: 0 auto 32px; line-height: 1.5; }
.lp-hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.lp-section { padding: 72px 32px; max-width: 1180px; margin: 0 auto; }
.lp-section h2 {
  font-size: 32px; font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  text-align: center;
}
.lp-section .lp-sub { text-align: center; color: var(--text-mut); max-width: 600px; margin: 0 auto 40px; }

.lp-promote {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .lp-promote { grid-template-columns: 1fr; } }
.lp-stage {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}
.lp-stage .stage-no { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.lp-stage h3 { font-size: 18px; margin: 6px 0 8px; }
.lp-stage p  { color: var(--text-mut); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.lp-stage .stage-gates { font-size: 11px; color: var(--text-dim); border-top: 1px dashed var(--line-2); padding-top: 10px; }
.lp-stage.lab   { border-color: rgba(99,102,241,0.4); }
.lp-stage.paper { border-color: rgba(245,158,11,0.4); }
.lp-stage.live  { border-color: rgba(16,185,129,0.4); }

.lp-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .lp-features { grid-template-columns: 1fr; } }
.lp-feature {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.lp-feature .lp-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-strong);
  margin-bottom: 12px;
  font-weight: 700;
}
.lp-feature h3 { font-size: 16px; margin: 0 0 6px; }
.lp-feature p  { color: var(--text-mut); font-size: 13px; line-height: 1.5; margin: 0; }

.lp-preview {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.lp-preview-frame {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 320px;
}
.lp-preview-side {
  background: var(--bg-3);
  border-right: 1px solid var(--line);
  padding: 14px;
}
.lp-preview-row {
  display: flex; justify-content: space-between;
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.lp-preview-row + .lp-preview-row { margin-top: 2px; }
.lp-preview-row b { font-family: var(--mono); }
.lp-preview-main {
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}
.lp-preview-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.lp-preview-kpi {
  background: var(--bg-3); border: 1px solid var(--line);
  padding: 10px; border-radius: 8px;
}
.lp-preview-kpi span { font-size: 10px; color: var(--text-dim); }
.lp-preview-kpi b    { display: block; font-family: var(--mono); font-size: 14px; margin-top: 2px; }
.lp-preview-curve {
  height: 140px;
  background:
    linear-gradient(180deg, rgba(99,102,241,0.18), transparent 70%),
    radial-gradient(circle at 70% 20%, rgba(16,185,129,0.16), transparent 50%);
  border-radius: 8px;
  position: relative;
  border: 1px solid var(--line);
  overflow: hidden;
}
.lp-preview-curve svg { width: 100%; height: 100%; }

.lp-pricing {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  max-width: 820px; margin: 0 auto;
}
@media (max-width: 720px) { .lp-pricing { grid-template-columns: 1fr; } }
.lp-plan {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.lp-plan.pro {
  background: linear-gradient(160deg, rgba(99,102,241,0.18), rgba(16,185,129,0.08));
  border-color: var(--accent);
}
.lp-plan h3 { margin: 0 0 6px; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-mut); }
.lp-plan .lp-price { font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.lp-plan .lp-price small { font-size: 14px; color: var(--text-mut); font-weight: 400; }
.lp-plan ul { list-style: none; padding: 0; margin: 0 0 22px; }
.lp-plan li { padding: 6px 0; color: var(--text-mut); font-size: 13px; }
.lp-plan li::before { content: '✓'; color: var(--pos); margin-right: 8px; font-weight: 700; }
.lp-plan a { display: block; text-align: center; }
.lp-popular {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  background: var(--accent); color: white;
  padding: 3px 8px; border-radius: 4px;
}

.lp-footer {
  border-top: 1px solid var(--line);
  padding: 24px 32px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

/* ──────────────── Dashboard NIFTY 5m chart ──────────────── */
.dash-chart {
  width: 100%;
  height: 280px;
  margin-top: 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  overflow: hidden;
}

/* ──────────────── Charts toolbar (timeframes + analysis dropdown) ──────────────── */
.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 14px;
  flex-wrap: wrap;
}
.chart-tf-group {
  display: inline-flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.chart-tf {
  border: none;
  background: transparent;
  color: var(--text-mut);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chart-tf:hover { color: var(--text); }
.chart-tf.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chart-analysis {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 6px 4px 10px;
}
.chart-analysis label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-mut);
}
#analysis-select {
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 22px 4px 4px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-mut) 50%),
                    linear-gradient(135deg, var(--text-mut) 50%, transparent 50%);
  background-position: calc(100% - 14px) center, calc(100% - 9px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
#analysis-select option, #analysis-select optgroup {
  background: var(--bg-2);
  color: var(--text);
}
#analysis-select optgroup {
  color: var(--text-mut);
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 11px;
}

/* RSI / MACD sub-pane */
.tv-sub {
  width: 100%;
  height: 160px;
  margin-top: 8px;
  border-top: 1px dashed var(--line-2);
  padding-top: 8px;
}
.tv-sub.hidden { display: none; }

/* Analysis insight callout */
.analysis-insight {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text);
}
.analysis-insight.hidden { display: none; }
.analysis-insight b { color: var(--accent-strong); font-weight: 700; margin-right: 4px; }

/* Search result first-row highlight (keyboard nav cue) */
.sr-row.highlight { background: rgba(255,255,255,0.04); }


/* ===========================================================================
 * NiftyStrat Pro — Glassmorphism & UI Enhancements
 * =========================================================================== */

/* Glassmorphism Tokens */
:root {
  --glass-bg: rgba(22, 30, 45, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(12px);
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

/* Enhancing existing structural cards with subtle glass hints */
.dash-card, .pane, .drawer-content {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2) 0%, rgba(17,24,39,0.9) 100%);
}

/* Strategy Detail Overlay (Full Screen Focus) */
.strategy-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.strategy-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.strategy-overlay-content {
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  display: grid;
  grid-template-rows: 60px 1fr;
  overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.strategy-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--glass-border);
}
.strategy-overlay-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.close-overlay-btn {
  background: none;
  border: none;
  color: var(--text-mut);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
}
.close-overlay-btn:hover { color: var(--text); }

.strategy-overlay-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 24px;
  overflow-y: auto;
}

/* Signal Badges & Cards */
.signal-card {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-3);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.signal-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.signal-badge.buy { background: var(--pos-soft); color: var(--pos); }
.signal-badge.sell { background: var(--neg-soft); color: var(--neg); }
.signal-badge.hold { background: rgba(245,158,11,0.12); color: var(--warn); }

.trigger-list {
  list-style: none;
  padding: 0; margin: 12px 0 0 0;
}
.trigger-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-top: 1px dashed var(--line);
}
.trigger-item:first-child { border-top: none; }
.trigger-icon {
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
}
.trigger-icon.met { background: var(--pos); color: #000; }
.trigger-icon.unmet { background: var(--bg-2); border: 1px solid var(--line); color: var(--text-mut); }

/* Community Hub */
.community-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.comm-message {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius);
}
.comm-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold;
  font-size: 14px;
}
.comm-content { flex: 1; }
.comm-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 12px;
}
.comm-user { font-weight: 600; color: var(--text); }
.comm-text { font-size: 13px; color: var(--text-mut); line-height: 1.4; }

/* Strategy Filters */
.strategy-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.filter-btn {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-mut);
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn:hover { background: var(--bg-2); color: var(--text); }
.filter-btn.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent);
}

/* Strategy Spotlight & Newbie Path on Dashboard */
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.newbie-path {
  background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(139,92,246,0.1) 100%);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}
.newbie-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.newbie-title { font-size: 16px; font-weight: 600; color: #a78bfa; }
.newbie-progress {
  font-size: 13px; color: var(--text-mut);
}
.newbie-tasks {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
.newbie-task {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.newbie-task:hover { border-color: #a78bfa; }
.newbie-task.done .task-check {
  background: #10b981; border-color: #10b981; color: #fff;
}
.task-check {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: transparent;
}
.task-label { font-size: 13px; color: var(--text); }

/* Popover & Notifications */
.popover {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  z-index: 9999;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.popover.hidden {
  display: none;
}
.pop-head {
  padding: 12px 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255,255,255,0.02);
}
.notif-list {
  max-height: 350px;
  overflow-y: auto;
}
.notif-row {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
}
.notif-row:hover {
  background: rgba(255,255,255,0.03);
}
.notif-row:last-child {
  border-bottom: none;
}
.notif-row .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 6px;
  flex-shrink: 0;
}
.notif-row.kind-sys .dot { background: var(--accent); }
.notif-row.kind-trade .dot { background: var(--up); }
.notif-msg {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--text);
}
.notif-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ──────────────── Strategy Detail View (Phase 1) ──────────────── */
.sd-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  padding-bottom: 96px; /* room for sticky order bar */
}
.sd-chart-card { padding: 8px; min-height: 480px; }
.sd-tv { width: 100%; height: 460px; position: relative; border-radius: 8px; overflow: hidden; }
.sd-tv-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0.4;
}
.sd-signal-card {
  display: flex; flex-direction: column; gap: 16px;
  background:
    linear-gradient(135deg, rgba(99,102,241,0.10), rgba(16,185,129,0.06)),
    var(--bg-2);
  backdrop-filter: blur(8px);
}
.sd-signal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sd-signal-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 36px; font-weight: 800; letter-spacing: -0.02em;
  margin-top: 4px;
}
.sd-signal-pos  { color: var(--pos); }
.sd-signal-neg  { color: var(--neg); }
.sd-signal-warn { color: var(--warn); }
.sd-arrow.signal-pos  { color: var(--pos); }
.sd-arrow.signal-neg  { color: var(--neg); }
.sd-arrow.signal-warn { color: var(--warn); }
.sd-arrow { transition: transform .25s ease, color .2s ease; }
.sd-confidence { text-align: right; }
.sd-gauge { position: relative; width: 120px; }
.sd-gauge-arc { transition: stroke-dashoffset .6s ease, stroke .2s ease; }
.sd-gauge-pct {
  position: absolute; bottom: -6px; left: 0; right: 0;
  text-align: center; font-weight: 700; font-size: 18px;
}
.sd-triggers-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-mut);
  margin-top: 4px;
}
.sd-triggers { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sd-trigger {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  font-size: 13px; line-height: 1.4;
}
.sd-trigger.met { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.2); }
.sd-trigger.unmet { opacity: 0.65; }
.sd-tcheck {
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pos-soft); color: var(--pos);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.sd-trigger.unmet .sd-tcheck { background: rgba(255,255,255,0.06); color: var(--text-mut); }
.sd-tlabel b { color: var(--text); margin-right: 4px; }

.sd-fund-card, .sd-insight-card, .sd-community-card {
  grid-column: span 1;
}
.sd-h3 {
  font-size: 13px; font-weight: 700;
  margin: 0 0 10px;
}
.sd-fund-table th.num, .sd-fund-table td.num { text-align: right; }

.sd-analyst {
  font-size: 14px; line-height: 1.6;
  color: var(--text);
  background: rgba(255,255,255,0.02);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  border-radius: 0 8px 8px 0;
  margin: 0;
}

.sd-community-tabs {
  display: inline-flex; gap: 2px;
  background: var(--bg-3); padding: 3px;
  border-radius: 8px; margin-bottom: 12px;
}
.sd-comm-tab {
  border: none; background: transparent; color: var(--text-mut);
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
}
.sd-comm-tab.active { background: var(--accent-soft); color: var(--accent-strong); }
.sd-comm-pane.hidden { display: none; }
.sd-comments {
  max-height: 220px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 10px;
}
.sd-comment {
  display: flex; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}
.sd-comment-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #4338ca, #7c3aed);
  color: white; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sd-comment-meta {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12px; margin-bottom: 2px;
}
.sd-comment-text { font-size: 13px; line-height: 1.4; }
.sd-comment-form {
  display: flex; gap: 6px;
}
.sd-comment-form input {
  flex: 1;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px;
  color: var(--text); font-family: var(--sans); font-size: 13px;
  outline: none;
}
.sd-comment-form input:focus { border-color: var(--accent); }
.sd-comment-form .btn-primary { padding: 0 14px; }
#sd-notes {
  width: 100%; min-height: 160px;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); border-radius: 8px;
  padding: 10px;
  font-family: var(--sans); font-size: 13px;
  resize: vertical; outline: none;
}
#sd-notes:focus { border-color: var(--accent); }

/* Sticky bottom order bar */
.sd-order-bar {
  position: fixed;
  bottom: 0; left: var(--sidebar-w); right: 0;
  background: linear-gradient(180deg, rgba(11,15,26,0.85), var(--bg-2));
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line-2);
  padding: 12px 26px;
  display: flex; align-items: center; gap: 16px;
  z-index: 30;
}
.sd-order-fields { display: flex; gap: 14px; flex: 1; }
.sd-order-fields label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; color: var(--text-mut);
  font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.sd-order-fields select, .sd-order-fields input[type="number"] {
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 10px;
  color: var(--text); font-family: var(--mono); font-size: 13px;
  outline: none;
}
.sd-qty { display: inline-flex; align-items: center; }
.sd-qty input { width: 90px; text-align: center; border-radius: 0; border-left: none; border-right: none; }
.sd-qty-btn {
  width: 32px; height: 32px;
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  font-size: 16px; font-weight: 700;
}
.sd-qty-btn:first-child { border-radius: 6px 0 0 6px; }
.sd-qty-btn:last-child  { border-radius: 0 6px 6px 0; }
.sd-place-btn {
  background: var(--pos); color: white;
  border: none; height: 44px;
  padding: 0 28px; border-radius: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 14px; letter-spacing: 0.04em;
  cursor: pointer;
}
.sd-place-btn:hover { background: #34d399; }

/* ──────────────── Strategy Spotlight (Dashboard) ──────────────── */
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.spotlight-card {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.spotlight-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.spotlight-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.spotlight-name { font-weight: 700; font-size: 14px; }
.spotlight-signal {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 4px;
}
.sig-pos  { background: var(--pos-soft); color: var(--pos); }
.sig-neg  { background: var(--neg-soft); color: var(--neg); }
.sig-warn { background: rgba(245,158,11,0.14); color: var(--warn); }
.spotlight-bar {
  height: 6px; background: rgba(255,255,255,0.04);
  border-radius: 3px; overflow: hidden;
}
.spotlight-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.spotlight-bar-fill.sig-pos  { background: var(--pos); }
.spotlight-bar-fill.sig-neg  { background: var(--neg); }
.spotlight-bar-fill.sig-warn { background: var(--warn); }
.spotlight-foot { display: flex; justify-content: space-between; align-items: baseline; }

/* ──────────────── Newbie Path checklist ──────────────── */
.newbie-path {
  background:
    linear-gradient(135deg, rgba(99,102,241,0.14), rgba(16,185,129,0.06)),
    var(--bg-2);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.newbie-path.all-done { display: none; }
.newbie-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.newbie-title { font-weight: 700; font-size: 14px; }
.newbie-progress { font-size: 12px; color: var(--text-mut); }
.newbie-tasks { display: flex; gap: 12px; flex-wrap: wrap; }
.newbie-task {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  flex: 1; min-width: 200px;
}
.newbie-task.completed {
  background: rgba(16,185,129,0.10);
  border-color: rgba(16,185,129,0.4);
}
.newbie-task.completed .task-check { background: var(--pos); color: white; }
.task-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
  color: transparent;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.newbie-task.completed .task-check { color: white; }

/* ──────────────── Strategy Explorer filters + risk ──────────────── */
.strategy-filters {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-btn {
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text-mut);
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.filter-btn:hover { color: var(--text); border-color: var(--line-2); }
.filter-btn.active { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }

.signal-badge {
  display: inline-block;
  padding: 3px 9px; border-radius: 4px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
}
.signal-badge.buy   { background: var(--pos-soft); color: var(--pos); }
.signal-badge.sell  { background: var(--neg-soft); color: var(--neg); }
.signal-badge.hold  { background: rgba(245,158,11,0.14); color: var(--warn); }

@media (max-width: 1080px) {
  .sd-grid { grid-template-columns: 1fr; }
  .sd-order-bar { left: 0; }
}

/* ===========================================================================
 * Mobile Responsiveness (< 768px)
 * =========================================================================== */
@media (max-width: 768px) {
  /* Layout & Sidebar */
  .layout { grid-template-columns: 1fr; }
  .content { padding: 16px 12px 100px; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); max-height: 40vh; }

  /* Topbar */
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-text { display: none; }
  .brand-tag { display: none; }
  #global-search { width: 130px; }
  .tabs { padding-bottom: 4px; }
  
  /* Typography & Cards */
  .page-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page-head.split { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-head.split .chart-px { text-align: left; }
  .card { padding: 14px; }
  .card-head { flex-direction: column; gap: 6px; }
  .card-head.split { flex-direction: column; align-items: flex-start; gap: 12px; }
  
  /* Grids */
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .indices-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .spotlight-grid { grid-template-columns: 1fr; }
  .newbie-tasks { flex-direction: column; }
  .baskets-grid { grid-template-columns: 1fr; }
  .strategies-grid { grid-template-columns: 1fr; }
  .lp-promote, .lp-features, .lp-pricing { grid-template-columns: 1fr; }
  .lp-preview-frame { grid-template-columns: 1fr; }

  /* Charts */
  .chart-toolbar { justify-content: flex-start; }
  .tv-chart, .sd-tv { height: 320px; }
  .chart-tf-group { flex-wrap: wrap; }
  
  /* Tables */
  .data-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* Order Drawer */
  .order-drawer { width: 100vw; }
  
  /* Strategy Detail */
  .sd-grid { grid-template-columns: 1fr; padding-bottom: 180px; }
  .sd-order-bar { left: 0; padding: 12px; flex-direction: column; align-items: stretch; gap: 12px; height: auto; }
  .sd-order-fields { flex-direction: column; gap: 10px; width: 100%; }
  .sd-order-fields > label { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .sd-order-fields select, .sd-order-fields input[type="number"] { width: 60%; }
  .sd-qty { width: 60%; justify-content: flex-end; }
  .sd-qty input { width: 100%; }
  .sd-place-btn { width: 100%; }

  /* Landing Page */
  .lp-nav { padding: 12px 16px; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .lp-nav-links { display: none; /* Hide links to save space or just wrap them */ }
  .lp-section { padding: 40px 20px; }
  .lp-hero { padding: 60px 20px 40px; }
  .lp-hero h1 { font-size: 32px; }
  .lp-hero p { font-size: 15px; }
  .lp-preview-side { border-right: none; border-bottom: 1px solid var(--line); }
  .lp-preview-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .lp-preview-main { padding: 12px; }
  .lp-hero-actions { flex-direction: column; width: 100%; }
  .lp-hero-actions .lp-cta { width: 100%; text-align: center; }
}

/* ===========================================================================
 * Mobile Hamburger Menu & Drawer
 * =========================================================================== */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-mut);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background .15s;
}
.menu-toggle:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 280px; height: 100vh;
  background: var(--bg-2);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  box-shadow: 20px 0 50px rgba(0,0,0,0.5);
}
.mobile-menu.open { transform: translateX(0); }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.menu-backdrop.active { opacity: 1; pointer-events: auto; }

.menu-head {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.menu-section { padding: 20px 16px; border-bottom: 1px solid var(--line); }
.menu-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.mobile-tabs { display: flex; flex-direction: column; gap: 4px; }
.mobile-tabs .tab-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-mut);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.mobile-tabs .tab-link.active { background: var(--accent-soft); color: var(--accent-strong); }

@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .desktop-only { display: none !important; }
  .sidebar { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .topbar-right .search-wrap { display: none; }
  .topbar { justify-content: flex-start; }
  .topbar-right { margin-left: auto; }
}

@media (max-width: 480px) {
  .kpi-row { grid-template-columns: 1fr; }
  .indices-strip { grid-template-columns: 1fr; }
  .lp-preview-kpis { grid-template-columns: 1fr; }
}
