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

:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1e1e1e;
  --border: #2a2a2a;
  --accent: #4ade80;
  --accent-dim: #22543d;
  --text: #f0f4f8;
  --muted: #b0b8c4;
  --up: #4ade80;
  --down: #ef4444;
  --danger: #ef4444;
  --warn: #f59e0b;
  --user-bubble: #1a3a2a;
  --james-bubble: #1e1e1e;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
}

html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.5; }

/* Layout */
#app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
#sidebar {
  width: 200px; min-width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 0;
}

#logo {
  padding: 20px 16px 16px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
#logo span { color: var(--muted); font-weight: 400; font-size: 13px; display: block; margin-top: 2px; }

nav { flex: 1; padding: 8px 0; overflow-y: auto; min-height: 0; }
nav button {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 16px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 13px; font-family: var(--font);
  text-align: left; transition: all 0.15s;
  border-left: 3px solid transparent;
}
nav button:hover { color: var(--text); background: var(--surface2); }
nav button.active { color: var(--accent); background: var(--surface2); border-left-color: var(--accent); }
nav button .icon { font-size: 16px; width: 20px; text-align: center; }

/* Sub-nav (trading setups) */
.subnav { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 4px 0; }
.subnav-btn { display: flex; align-items: center; gap: 8px; padding: 5px 16px 5px 36px; font-size: 13px; color: var(--muted); background: none; border: none; border-left: 3px solid transparent; cursor: pointer; text-align: left; width: 100%; transition: color 0.15s; letter-spacing: 0.02em; }
.subnav-btn:hover { color: var(--text); background: var(--surface2); }
.subnav-btn.active { color: var(--accent); background: rgba(74,222,128,0.06); border-left-color: var(--accent); }
.subnav-dot { font-size: 7px; opacity: 0.6; }
.subnav-group-label { padding: 8px 16px 3px 16px; font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: #4a5568; text-transform: uppercase; }

#sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted);
}
#sidebar-footer a { color: var(--accent); text-decoration: none; }

/* Main content */
#main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Tab panes */
.pane { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.pane.active { display: flex; }

/* Page header */
.pane-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.pane-header h1 { font-size: 16px; font-weight: 600; }
.pane-body { flex: 1; overflow-y: auto; padding: 12px 10px; }

/* ── Chat ──────────────────────────────────────────────────────────────────── */
#chat-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}

.msg { display: flex; flex-direction: column; max-width: 70%; }
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.james { align-self: flex-start; align-items: flex-start; }

.msg-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.6;
  word-break: break-word;
  font-size: 13px;
}
.msg.user .msg-bubble { background: var(--user-bubble); border-bottom-right-radius: 4px; }
.msg.james .msg-bubble { background: var(--james-bubble); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.error .msg-bubble { background: #2d1515; border: 1px solid #7f1d1d; color: #fca5a5; }

/* Markdown inside bubbles */
.msg-bubble p { margin-bottom: 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble code { font-family: var(--mono); font-size: 13px; background: rgba(255,255,255,0.08); padding: 1px 5px; border-radius: 3px; }
.msg-bubble pre { background: #0a0a0a; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.msg-bubble pre code { background: none; padding: 0; }
.msg-bubble strong { color: #fff; font-weight: 600; }
.msg-bubble h1, .msg-bubble h2, .msg-bubble h3 { color: var(--accent); margin: 10px 0 4px; font-size: 14px; }
.msg-bubble ul, .msg-bubble ol { padding-left: 20px; margin: 6px 0; }
.msg-bubble li { margin-bottom: 2px; }

/* Typing status */
.typing-status {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* Typing indicator */
.typing-indicator { display: flex; align-items: center; gap: 4px; padding: 12px 14px; }
.typing-indicator span { width: 6px; height: 6px; background: var(--muted); border-radius: 50%; animation: bounce 1.2s infinite; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* Chat input */
#chat-input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: flex-end;
  flex-shrink: 0;
}
#chat-input {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 10px 14px;
  font-family: var(--font); font-size: 13px;
  resize: none; min-height: 40px; max-height: 120px; overflow-y: auto;
  line-height: 1.5; outline: none;
}
#chat-input:focus { border-color: var(--accent); }
#chat-input::placeholder { color: var(--muted); }

.btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 13px; font-family: var(--font); font-weight: 500; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: #0a1a0f; }
.btn-primary:hover { background: #6ee7a0; }
.btn-primary:disabled { background: var(--accent-dim); color: var(--muted); cursor: not-allowed; }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,0.1); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-sm { padding: 4px 10px; font-size: 13px; }

#chat-new { flex-shrink: 0; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-green { background: var(--accent-dim); color: var(--accent); }
.badge-yellow { background: #3d2e00; color: var(--warn); }
.badge-purple { background: #2e1a3d; color: #c084fc; }
.badge-blue { background: #1a2d3d; color: #60a5fa; }

/* Truncate long text in table cells */
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-row { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 13px; color: var(--muted); }
input[type=text], input[type=password], textarea, select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 8px 12px;
  font-family: var(--font); font-size: 13px; outline: none;
}
input[type=text]:focus, input[type=password]:focus, textarea:focus { border-color: var(--accent); }
input[type=text]::placeholder, input[type=password]::placeholder { color: var(--muted); }

/* Card */
.card { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.card-value { font-size: 24px; font-weight: 700; font-family: var(--mono); }
.card-value.green { color: var(--accent); }
.card-value.red { color: var(--danger); }
.card-value.yellow { color: var(--warn); }
.green { color: var(--accent); }
.red { color: var(--danger); }
.yellow { color: var(--warn); }

/* Login */
#login-screen {
  display: none; position: fixed; inset: 0;
  background: var(--bg); z-index: 100;
  justify-content: center; align-items: center;
}
#login-screen.visible { display: flex; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; width: 320px; }
.login-box h2 { font-family: var(--mono); color: var(--accent); margin-bottom: 8px; }
.login-box p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.login-box input { width: 100%; margin-bottom: 12px; }
.login-box .btn { width: 100%; }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 8px; display: none; }

/* Memory search */
#memory-search { width: 260px; margin-bottom: 16px; }

/* Autotrader */
.at-group-label { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 20px 0 8px; }
.at-section-hd { margin: 32px 0 12px; padding-left: 14px; border-left: 4px solid; }
.at-section-title { font-size: 22px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2; }
.at-section-count { font-size: 15px; font-weight: 400; opacity: .7; }
.at-section-desc { font-size: 13px; color: #c0c8d4; margin-top: 5px; line-height: 1.5; }
.at-no-trade-reason { font-size: 13px; color: #f59e0b; padding: 7px 10px; background: rgba(245,158,11,.08); border-left: 3px solid #f59e0b; margin: 6px 0 4px; line-height: 1.5; }
.at-grid    { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 24px; }
.at-grid-sm { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.at-card    { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.at-card-hd { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.at-sym     { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--text); }
.at-px      { font-family: var(--mono); font-size: 13px; color: var(--text); }
.at-wall    { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.at-cf      { font-size: 13px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.at-chart   { display: block; width: 100%; }
.at-card-sm { display: flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; }
.at-legend        { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 4px 8px; display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; font-family: var(--mono); margin-bottom: 12px; }
.at-strategy-box  { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 16px; }
.at-strategy-title{ font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.at-criteria      { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; line-height: 1.5; color: var(--text); }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Status dot */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-green { background: var(--accent); }
.dot-red { background: var(--danger); }
.dot-yellow { background: var(--warn); }

.empty-state { padding: 40px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Trading Dashboard ───────────────────────────────────────────────────────── */
.trading-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }

.t-section { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.t-section-label { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; font-family: var(--mono); }
.t-two-col { display: flex; gap: 16px; }
.t-two-col .t-section { min-width: 0; }

/* Macro strip */
.macro-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.macro-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 12px; min-width: 90px; flex: 1;
}
.macro-card-name { font-size: 13px; color: var(--muted); margin-bottom: 3px; font-family: var(--mono); }
.macro-card-price { font-size: 15px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.macro-card-chg { font-size: 13px; font-family: var(--mono); margin-top: 2px; }
.macro-loading, .sector-loading, .news-loading { color: var(--muted); font-size: 13px; padding: 8px 0; }
.macro-synthesis { margin-top: 8px; font-size: 13px; color: var(--muted); font-family: var(--mono); line-height: 1.5; min-height: 16px; }
.macro-card { position: relative; cursor: default; }
.macro-card-tip { display: none; position: absolute; bottom: calc(100% + 6px); left: 0; width: 220px; background: #1a1a1a; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; font-size: 13px; color: var(--text); line-height: 1.4; z-index: 10; pointer-events: none; }
.macro-card:hover .macro-card-tip { display: block; }

/* Sentiment row */
.sentiment-row { display: flex; gap: 12px; }
.fg-card, .ad-card {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 14px; min-width: 180px; flex: 1;
}
.fg-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; font-family: var(--mono); letter-spacing: 0.05em; }
.fg-score { font-size: 28px; font-weight: 700; font-family: var(--mono); }
.fg-text { font-size: 13px; color: var(--muted); margin-top: 2px; text-transform: capitalize; }
.fg-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; margin-top: 8px; }
.fg-bar { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.5s; }
.ad-stub { font-size: 13px; color: var(--muted); padding: 8px 0; font-style: italic; }

/* Sector grid */
.sector-grid { display: grid; grid-template-columns: 160px repeat(3, 80px) 90px; gap: 0; font-size: 13px; }
.sg-header { font-size: 13px; color: var(--muted); padding: 4px 8px; font-family: var(--mono); text-align: right; }
.sg-header:first-child { text-align: left; }
.sg-name { padding: 5px 8px; color: var(--text); font-weight: 500; border-top: 1px solid var(--border); display: flex; align-items: center; }
.sg-cell { padding: 5px 8px; font-family: var(--mono); font-size: 13px; text-align: right; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; border-radius: 3px; }
.sg-price { color: var(--muted); }

/* Color intensity for sector cells */
.chg-strong-up   { background: rgba(74,222,128,0.25); color: #6ee7a0; }
.chg-up          { background: rgba(74,222,128,0.12); color: #4ade80; }
.chg-slight-up   { background: rgba(74,222,128,0.06); color: #86efac; }
.chg-flat        { color: var(--muted); }
.chg-slight-down { background: rgba(239,68,68,0.06);  color: #fca5a5; }
.chg-down        { background: rgba(239,68,68,0.12);  color: #ef4444; }
.chg-strong-down { background: rgba(239,68,68,0.25);  color: #dc2626; }

/* News list */
.news-list { display: flex; flex-direction: column; gap: 1px; max-height: 320px; overflow-y: auto; }
.news-item { padding: 7px 4px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.news-item:last-child { border-bottom: none; }
.news-item a { color: var(--text); text-decoration: none; font-size: 13px; line-height: 1.4; flex: 1; }
.news-item a:hover { color: var(--accent); }
.news-age { font-size: 13px; color: var(--muted); white-space: nowrap; font-family: var(--mono); margin-top: 2px; }

/* Morning digest */
.digest-content { font-size: 14px; line-height: 1.7; color: var(--text); max-height: 420px; overflow-y: auto; }
.digest-content p { margin-bottom: 10px; }
.digest-content p:last-child { margin-bottom: 0; }
.digest-content strong { color: #fff; font-weight: 600; }
.digest-heading { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--accent); font-family: var(--mono); margin: 12px 0 4px; text-transform: uppercase; }

/* Sentiment col layout (when inside 2-col) */
.sentiment-col { flex-direction: column; gap: 10px; }

/* Movers list */
.movers-list { display: flex; flex-direction: column; gap: 2px; }
.mover-row { display: flex; align-items: center; gap: 10px; padding: 5px 4px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 13px; }
.mover-row:last-child { border-bottom: none; }
.mover-sym { font-weight: 700; color: var(--text); width: 60px; }
.mover-price { color: var(--muted); flex: 1; }
.mover-chg { font-weight: 600; white-space: nowrap; }
.mover-chg.green { color: var(--accent); }
.mover-chg.red { color: var(--danger); }

/* Economic calendar */
.econ-list { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.econ-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 4px; border-bottom: 1px solid var(--border); }
.econ-row:last-child { border-bottom: none; }
.econ-impact { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.impact-high { background: var(--danger); }
.impact-med { background: var(--warn); }
.econ-main { flex: 1; min-width: 0; }
.econ-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.econ-title { font-size: 13px; color: var(--text); font-weight: 500; }
.econ-actual { font-size: 13px; font-weight: 700; font-family: var(--mono); }
.econ-actual-good { color: var(--accent); }
.econ-actual-bad { color: var(--danger); }
.econ-actual-neutral { color: var(--text); }
.econ-forecast { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.econ-released .econ-title { color: var(--muted); }
.econ-meta { font-size: 13px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }

/* Breadth display */
.breadth-display { display: flex; flex-direction: column; gap: 4px; }
.breadth-row { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; }
.breadth-label { width: 28px; color: var(--muted); }
.breadth-bar-wrap { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.breadth-bar { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.breadth-green { background: var(--accent); }
.breadth-red { background: var(--danger); }
.breadth-neutral { background: var(--warn); }
.breadth-count { width: 32px; text-align: right; color: var(--text); }
.breadth-note { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* OpEx card */
.opex-card { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; }
.opex-label { font-size: 13px; font-weight: 600; font-family: var(--mono); }
.opex-label.opex-monthly { color: var(--warn); }
.opex-label.opex-quarterly { color: var(--danger); }
.opex-date { font-size: 13px; color: var(--muted); font-family: var(--mono); }

/* Confluence enhancements */
.cf-rs { font-size: 13px; font-family: var(--mono); }
.cf-rs.green { color: var(--accent); }
.cf-rs.red { color: var(--danger); }
.cf-52w { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.cf-badge { font-size: 13px; font-weight: 700; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.04em; }
.cf-badge-green { background: rgba(74,222,128,0.15); color: var(--accent); border: 1px solid var(--accent); }
.cf-badge-red { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid var(--danger); }

/* Confluence + GEX checker shared input */
.confluence-input-row { display: flex; gap: 8px; margin-bottom: 12px; }
.confluence-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; color: var(--text); font-family: var(--mono); font-size: 13px; width: 140px; outline: none; }

/* Watchlist */
.wl-row { display: grid; grid-template-columns: 52px 110px 80px 100px 70px 1fr; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border); }
.wl-row:hover { background: var(--surface2); }
.wl-score { display: inline-block; padding: 2px 6px; border-radius: 4px; font-weight: 700; font-size: 13px; font-family: var(--mono); }
.score-high { background: rgba(74,222,128,0.15); color: var(--accent); }
.score-mid  { background: rgba(251,191,36,0.15);  color: var(--warn); }
.score-low  { background: rgba(100,100,100,0.15);  color: var(--muted); }
.wl-cat { display: inline-block; font-size: 13px; padding: 1px 5px; border-radius: 3px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); margin-right: 3px; }

/* Scanner */
.scanner-row { display: grid; grid-template-columns: 80px 70px 70px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.scanner-sym { font-weight: 700; }
.scanner-chg { font-family: var(--mono); font-weight: 600; }
.scanner-vol { font-family: var(--mono); color: var(--warn); }
.scanner-reason { color: var(--muted); font-size: 13px; }

/* GEX */
.gex-header { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.gex-stat { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; min-width: 110px; }
.gex-stat-label { font-size: 13px; font-weight: 600; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.gex-stat-val { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.gex-dist { font-size: 13px; color: var(--muted); font-weight: 400; }
.gex-note { font-size: 13px; color: var(--muted); margin-bottom: 12px; font-style: italic; }
.gex-levels { display: flex; flex-direction: column; gap: 4px; }
.gex-level-row { display: grid; grid-template-columns: 90px 55px 120px 1fr; align-items: center; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.gex-level-current { background: var(--surface2); border-radius: 4px; padding: 4px 6px; }
.gex-level-strike { font-family: var(--mono); font-weight: 600; }
.gex-level-dist { font-family: var(--mono); }
.gex-level-bar-wrap { height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.gex-level-bar { height: 100%; border-radius: 3px; }
.gex-level-bar.green { background: var(--accent); }
.gex-level-bar.red { background: var(--danger); }
.confluence-input:focus { border-color: var(--accent); }
.cf-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cf-summary { font-size: 13px; color: var(--text); line-height: 1.5; padding: 6px 10px; background: var(--surface2); border-radius: 5px; border-left: 3px solid var(--accent); }
.cf-zone-role { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; width: 68px; flex-shrink: 0; }
.cf-price-line { font-size: 13px; color: var(--accent); font-family: var(--mono); padding: 3px 4px; letter-spacing: 0.04em; opacity: 0.7; }
.cf-symbol { font-size: 16px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.cf-current { font-size: 13px; color: var(--accent); font-family: var(--mono); }
.cf-note { font-size: 13px; color: var(--muted); font-style: italic; }
.cf-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cf-col-title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); font-family: var(--mono); margin-bottom: 6px; }
.cf-zone { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; border-radius: 5px; margin-bottom: 4px; background: var(--surface2); border: 1px solid var(--border); }
.cf-zone.cf-very-close { border-color: var(--accent); background: rgba(74,222,128,0.07); }
.cf-zone.cf-close { border-color: #f59e0b44; }
.cf-zone-label { font-size: 13px; font-family: var(--mono); color: var(--text); font-weight: 500; }
.cf-zone-right { display: flex; align-items: center; gap: 8px; }
.cf-strength { font-size: 13px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: var(--accent); color: #000; letter-spacing: 0.05em; }
.cf-zone-price { font-size: 13px; font-family: var(--mono); color: var(--text); }
.cf-zone-dist { font-size: 13px; color: var(--muted); font-family: var(--mono); }
.cf-level-grid { display: flex; flex-direction: column; gap: 2px; }
.cf-level-row { display: flex; align-items: center; gap: 8px; padding: 3px 4px; font-family: var(--mono); font-size: 13px; border-bottom: 1px solid var(--border); }
.cf-level-row:last-child { border-bottom: none; }
.cf-level-label { width: 52px; color: var(--muted); }
.cf-level-price { flex: 1; color: var(--text); }
.cf-level-dist { font-size: 13px; }
.cf-level-dist.green { color: var(--accent); }
.cf-level-dist.red { color: var(--danger); }

/* ── Levels Board ─────────────────────────────────────────────────────────── */
.lb-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.lb-symbol { font-size: 16px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.lb-current { font-size: 14px; color: var(--accent); font-family: var(--mono); }
.lb-flip-note { font-size: 13px; padding: 5px 10px; border-radius: 5px; margin-bottom: 8px; font-family: var(--mono); }
.lb-flip-note.green { background: rgba(74,222,128,0.08); color: var(--accent); border: 1px solid rgba(74,222,128,0.2); }
.lb-flip-note.red   { background: rgba(239,68,68,0.08); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.lb-board { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.lb-price-line { font-size: 13px; color: var(--accent); font-family: var(--mono); padding: 3px 6px; opacity: 0.7; letter-spacing: 0.04em; }
.lb-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface2); }
.lb-row-cluster { border-color: #f59e0b66; background: rgba(245,158,11,0.06); }
.lb-row-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lb-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.lb-label { font-size: 13px; font-family: var(--mono); color: var(--text); }
.lb-price { font-size: 13px; font-family: var(--mono); color: var(--text); min-width: 60px; text-align: right; }
.lb-dist { font-size: 13px; font-family: var(--mono); min-width: 48px; text-align: right; }
.lb-dist.green { color: var(--accent); }
.lb-dist.red   { color: var(--danger); }
.lb-src { font-size: 13px; font-weight: 700; padding: 1px 5px; border-radius: 3px; letter-spacing: 0.04em; }
.lb-src-ma         { background: rgba(99,102,241,0.2);  color: #818cf8; }
.lb-src-gex        { background: rgba(234,179,8,0.2);   color: #facc15; }
.lb-src-auto       { background: rgba(20,184,166,0.2);  color: #2dd4bf; }
.lb-src-sr         { background: rgba(249,115,22,0.2);  color: #fb923c; }
.lb-src-trendline  { background: rgba(168,85,247,0.2);  color: #c084fc; }
.lb-tf { font-size: 13px; color: var(--muted); font-family: var(--mono); padding: 1px 4px; border: 1px solid var(--border); border-radius: 3px; }
.lb-cluster-dot { color: #f59e0b; font-size: 13px; }
.lb-del-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; line-height: 1; }
.lb-del-btn:hover { color: var(--danger); }
.lb-add-section { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 4px; }
.lb-add-title { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); font-family: var(--mono); margin-bottom: 8px; }
.lb-add-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.lb-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 5px; color: var(--text); font-size: 13px; padding: 5px 8px; font-family: var(--mono); }
.lb-input:focus { outline: none; border-color: var(--accent); }
.lb-select { cursor: pointer; }

/* Watchlist preview (stub with column headers) */
.watchlist-preview { border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.wl-header { display: grid; grid-template-columns: 52px 110px 80px 100px 70px 1fr; align-items: center; gap: 8px; padding: 5px 4px; background: var(--surface2); border-bottom: 1px solid var(--border); font-size: 13px; font-family: var(--mono); color: var(--muted); font-weight: 700; letter-spacing: 0.05em; }
.wl-col-score { text-align: center; }
.wl-col-chg { overflow: hidden; }
.wl-stub-rows { padding: 14px 12px; }
.wl-stub-msg { font-size: 13px; color: var(--muted); font-style: italic; line-height: 1.5; }

/* Stub sections */
.api-stub {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  padding: 16px; text-align: center;
}
.stub-title { font-size: 13px; color: var(--warn); font-weight: 600; margin-bottom: 6px; }
.stub-body { font-size: 13px; color: var(--muted); line-height: 1.5; max-width: 480px; margin: 0 auto; }
.api-stub-sm { font-size: 13px; color: var(--muted); font-style: italic; padding: 12px 4px; }

/* ── Confluence Setup ─────────────────────────────────────────────────────── */
.cs-legend { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.cs-list { display: flex; flex-direction: column; gap: 4px; }
.cs-row { display: grid; grid-template-columns: 62px 1fr 90px 115px 115px; gap: 8px; align-items: start; padding: 6px 8px; border-radius: 5px; background: var(--surface2); border: 1px solid var(--border); font-size: 13px; min-width: 0; }
.cs-row:hover { border-color: var(--accent); }
.cs-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-mid { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cs-right { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; font-size: 13px; min-width: 0; }
.cs-gex-above { display: flex; flex-direction: column; gap: 1px; border-left: 2px solid var(--accent); padding-left: 5px; overflow: hidden; }
.cs-gex-below { display: flex; flex-direction: column; gap: 1px; border-left: 2px solid var(--danger); padding-left: 5px; overflow: hidden; }
.cs-gex-title { font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--warn); margin-bottom: 2px; }
.cs-gex-row { display: flex; gap: 3px; font-size: 13px; font-family: var(--mono); align-items: baseline; overflow: hidden; }
.cs-news-link { font-size: 13px; color: var(--accent); text-decoration: none; opacity: 0.7; margin-top: 2px; }
.cs-news-link:hover { opacity: 1; text-decoration: underline; }
.cs-gex-label { color: var(--warn); white-space: nowrap; width: 22px; flex-shrink: 0; font-weight: 700; }
.cs-gex-price { color: var(--text); white-space: nowrap; }
.cs-gex-dist { white-space: nowrap; }
.cs-symbol { font-weight: 700; font-family: var(--mono); color: var(--text); }
.cs-sector { font-size: 13px; color: var(--muted); }
.cs-zone-label { font-size: 13px; font-family: var(--mono); color: var(--text); }
.cs-zone-price { font-size: 13px; font-family: var(--mono); color: var(--muted); }
.cs-zone-dist { font-size: 13px; font-family: var(--mono); font-weight: 600; }
.cs-zone-dist.green { color: var(--accent); }
.cs-zone-dist.red   { color: var(--danger); }
.cs-role { font-size: 13px; font-weight: 700; padding: 2px 5px; border-radius: 3px; letter-spacing: 0.05em; text-align: center; }
.cs-role-sup { background: rgba(74,222,128,0.15); color: var(--accent); border: 1px solid rgba(74,222,128,0.3); }
.cs-role-res { background: rgba(239,68,68,0.15);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.3);  }
.cs-strength { font-size: 13px; font-family: var(--mono); color: var(--warn); }
.cs-price { font-size: 13px; font-family: var(--mono); color: var(--text); }
.cs-rvol { font-size: 13px; font-family: var(--mono); color: var(--muted); }
.cs-catalyst { font-size: 13px; color: var(--muted); font-style: italic; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cs-group-header { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; padding: 10px 4px 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; margin-top: 8px; font-family: var(--mono); }
.cs-group-header:first-child { margin-top: 0; }
.cs-bar-wrap { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 3px; max-width: 280px; }
.cs-bar { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.cs-explainer { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
.cs-exp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); line-height: 1.4; }
.cs-exp-row:last-child { border-bottom: none; }
.cs-exp-row span { padding-right: 4px; }
.badge-label { font-size: 13px; font-weight: 700; padding: 1px 6px; border-radius: 3px; letter-spacing: 0.05em; background: #1a2d3d; color: #60a5fa; border: 1px solid #2d4a6b; }
.gex-bt-wrap { overflow: auto; max-height: calc(100vh - 280px); }
.gex-bt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gex-bt-table th { position: sticky; top: 0; z-index: 1; background: var(--surface); text-align: left; padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); font-size: 13px; white-space: nowrap; cursor: pointer; user-select: none; }
.gex-bt-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }

/* ── Trading Ops Dashboard ──────────────────────────────────────────────────── */
.ops-section { margin-bottom: 22px; }
.ops-section-label { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; }

.ops-health-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.ops-health-chip { display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 8px 14px; font-size: 13px; }
.ops-chip-label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 2px; }

.ops-bot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ops-bot-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ops-bot-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ops-bot-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.ops-bot-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.ops-bot-stats { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ops-stat { display: flex; justify-content: space-between; align-items: center; font-size: 13px; gap: 8px; }
.ops-stat-label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; flex-shrink: 0; }
.ops-stat-value { color: var(--text); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.ops-bot-footer { display: flex; justify-content: flex-end; margin-top: 2px; }

.ops-pnl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ops-pnl-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; }
.ops-pnl-title { font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.ops-pnl-main { font-size: 28px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 4px; }
.ops-pnl-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.ops-pnl-num { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 3px; }
.ops-pnl-row-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.ops-pos-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-pos-table th { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--muted); text-align: left; padding: 4px 10px 8px 0; border-bottom: 1px solid var(--border); }
.ops-pos-table td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); color: var(--text); font-variant-numeric: tabular-nums; }
.ops-bot-card { cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ops-bot-card:hover { border-color: #3a3a3a; background: #1c1c1c; }
.ops-open-hint { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
.ops-bot-card:hover .ops-open-hint { color: var(--accent); }

/* ── Continuation Runners ───────────────────────────────────────────────────── */
.rn-section-label { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: #d0d8e4; text-transform: uppercase; margin-bottom: 12px; }
.rn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 8px; }
.rn-pinned-section { padding-bottom: 24px; margin-bottom: 20px; border-bottom: 3px solid rgba(74,222,128,0.5); }

.rn-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.rn-card-pinned { border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.03); }

.rn-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rn-ticker { font-size: 16px; font-weight: 700; color: var(--text); font-family: var(--mono); }
.rn-name { font-size: 13px; color: #c0c8d4; }

.rn-badge { font-size: 13px; font-weight: 700; padding: 2px 7px; border-radius: 3px; letter-spacing: 0.05em; white-space: nowrap; }
.rn-badge-small { background: rgba(251,191,36,0.15); color: #fbbf24; }
.rn-badge-large { background: rgba(96,165,250,0.15); color: #60a5fa; }

.rn-price-row { display: flex; align-items: baseline; gap: 10px; }
.rn-price { font-size: 20px; font-weight: 700; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.rn-chg { font-size: 16px; font-weight: 700; font-family: var(--mono); }
.rn-prev { font-size: 13px; color: #c0c8d4; }

.rn-stats-row { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.rn-stat { display: flex; flex-direction: column; gap: 1px; min-width: 60px; }
.rn-stat-l { font-size: 13px; font-weight: 700; color: #8090a8; letter-spacing: 0.06em; text-transform: uppercase; }
.rn-stat-v { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: #d0d8e4; }

.rn-chart-wrap { position: relative; cursor: pointer; border-radius: 4px; overflow: hidden; background: #0a0a0a; }
.rn-chart-wrap:hover .rn-chart-pin-hint { opacity: 1; }
.rn-chart { display: block; width: 100%; border-radius: 4px; }
.rn-chart-pin-hint { position: absolute; top: 6px; right: 8px; font-size: 13px; color: var(--accent); opacity: 0; transition: opacity 0.15s; pointer-events: none; font-weight: 600; background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 3px; }

.rn-unpin-btn { color: var(--muted); }
.rn-unpin-btn:hover { color: var(--warn); }

.rn-notes-wrap { display: flex; gap: 6px; align-items: flex-end; }
.rn-notes-ta { flex: 1; background: #0d1117; border: 1px solid #2a3040; border-radius: 4px; color: #d0d8e4; font-size: 13px; font-family: inherit; padding: 6px 8px; resize: vertical; min-height: 44px; max-height: 120px; outline: none; }
.rn-notes-ta:focus { border-color: #3a4a60; }
.rn-notes-ta::placeholder { color: #4a5568; }
.rn-notes-save { white-space: nowrap; flex-shrink: 0; align-self: flex-end; }

.rn-flags-row { display: flex; flex-wrap: wrap; gap: 5px; }
.rn-flag { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 3px; letter-spacing: 0.04em; cursor: default; white-space: nowrap; }

.rn-assess { background: rgba(255,255,255,0.03); border: 1px solid #2a2a3e; border-radius: 5px; padding: 10px 12px; display: flex; flex-direction: column; gap: 5px; }
.rn-assess-pending { color: #8090a8; font-size: 13px; font-style: italic; }
.rn-assess-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rn-signal-badge { font-size: 13px; font-weight: 700; padding: 2px 8px; border-radius: 3px; letter-spacing: 0.04em; cursor: default; white-space: nowrap; }
.rn-score-dots { display: flex; gap: 4px; align-items: center; }
.rn-score-dot { width: 10px; height: 10px; border-radius: 50%; }
.rn-assess-ts { font-size: 13px; color: #8090a8; margin-left: auto; }
.rn-assess-catalyst { font-size: 13px; font-weight: 600; color: #d0d8e4; }
.rn-assess-reasoning { font-size: 13px; color: #c0c8d4; line-height: 1.4; }
.rn-assess-headlines { margin-top: 4px; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid #2a2a3e; padding-top: 6px; }
.rn-assess-hl { font-size: 13px; color: #8090a8; line-height: 1.4; }

/* ── Deep Dive button + modal ─────────────────────────────────────────── */
.rn-dd-btn { font-weight: 700; border-width: 1px; border-style: solid; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.rn-dd-idle     { background: rgba(239,68,68,0.15);  color: #f87171; border-color: rgba(239,68,68,0.45); }
.rn-dd-idle:hover     { background: rgba(239,68,68,0.25); }
.rn-dd-pending  { background: rgba(251,191,36,0.15); color: #fbbf24; border-color: rgba(251,191,36,0.45); cursor: progress; }
.rn-dd-complete { background: rgba(74,222,128,0.15); color: #4ade80; border-color: rgba(74,222,128,0.5); }
.rn-dd-complete:hover { background: rgba(74,222,128,0.25); }
.rn-dd-failed   { background: rgba(239,68,68,0.20);  color: #ef4444; border-color: rgba(239,68,68,0.55); }
.rn-dd-failed:hover   { background: rgba(239,68,68,0.30); }

.rn-dd-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; overflow-y: auto; }
.rn-dd-box { background: #0d1117; border: 1px solid #2a2a3e; border-radius: 8px; max-width: 880px; width: 100%; box-shadow: 0 12px 48px rgba(0,0,0,0.5); }
.rn-dd-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #1e1e2e; position: sticky; top: 0; background: #0d1117; z-index: 1; border-radius: 8px 8px 0 0; }
.rn-dd-ticker { font-size: 18px; font-weight: 700; color: #d0d8e4; font-family: var(--mono); }
.rn-dd-sub    { font-size: 13px; color: #8090a8; margin-left: 10px; }
.rn-dd-ts     { font-size: 13px; color: #8090a8; margin-left: 8px; }
.rn-dd-body { padding: 18px 22px 28px; }
.rn-dd-md { font-size: 14px; line-height: 1.55; color: #d0d8e4; }
.rn-dd-md h1 { font-size: 19px; font-weight: 700; color: #d0d8e4; margin: 4px 0 14px; padding-bottom: 6px; border-bottom: 1px solid #1e1e2e; }
.rn-dd-md h2 { font-size: 15px; font-weight: 700; color: var(--accent); margin: 20px 0 8px; letter-spacing: 0.02em; }
.rn-dd-md h3 { font-size: 14px; font-weight: 700; color: #d0d8e4; margin: 14px 0 6px; }
.rn-dd-md p  { margin: 6px 0 10px; }
.rn-dd-md ul { margin: 6px 0 10px 4px; padding-left: 18px; }
.rn-dd-md li { margin: 2px 0; }
.rn-dd-md strong { color: #ffe27a; font-weight: 700; }
.rn-dd-md em     { color: #c0c8d4; font-style: italic; }
.rn-dd-md code   { background: #1a1a2e; color: #fbbf24; padding: 1px 5px; border-radius: 3px; font-size: 13px; font-family: var(--mono); }
.rn-dd-md pre    { background: #0a0a0a; border: 1px solid #1e1e2e; border-radius: 4px; padding: 10px 12px; overflow-x: auto; font-size: 13px; }
.rn-dd-md pre code { background: transparent; padding: 0; color: #d0d8e4; }

/* ── Runner Performance Table ─────────────────────────────────────────── */
.rn-perf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rn-perf-table th { color: var(--muted); font-weight: 400; text-align: left; padding: 4px 8px; border-bottom: 1px solid #1e1e2e; white-space: nowrap; }
.rn-perf-table td { padding: 4px 8px; border-bottom: 1px solid #12121c; color: #d0d8e4; }
.rn-perf-table tr:hover td { background: #12121c; }
.rn-pt-num { text-align: right; font-variant-numeric: tabular-nums; }
.rn-view-btn { opacity: 0.5; }
.rn-view-btn.rn-view-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }
.frd-view-btn { opacity: 0.5; }
.frd-view-btn.frd-view-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }
.dc-view-btn { opacity: 0.5; }
.dc-view-btn.dc-view-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }
.cr-view-btn { opacity: 0.5; }
.cr-view-btn.cr-view-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }
.crs-view-btn { opacity: 0.5; }
.crs-view-btn.crs-view-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }
.rn-sector-row { display:flex; align-items:center; gap:8px; font-size:13px; padding:3px 0; }

/* ── Paper Trader ─────────────────────────────────────────────────────── */
.pt-summary { display: flex; gap: 0; border: 1px solid #1e1e2e; border-radius: 6px; overflow: hidden; margin-bottom: 16px; }
.pt-stat { flex: 1; padding: 10px 14px; border-right: 1px solid #1e1e2e; background: #0d1117; }
.pt-stat:last-child { border-right: none; }
.pt-stat-label { font-size: 13px; color: var(--muted); letter-spacing: 0.08em; font-weight: 600; margin-bottom: 4px; }
.pt-stat-val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: #d0d8e4; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pt-table th { color: var(--muted); font-weight: 400; text-align: left; padding: 4px 8px; border-bottom: 1px solid #1e1e2e; white-space: nowrap; font-size: 13px; letter-spacing: 0.05em; }
.pt-table td { padding: 5px 8px; border-bottom: 1px solid #12121c; color: #d0d8e4; vertical-align: middle; }
.pt-table tr:hover td { background: #12121c; }

/* ── Swing Journal ─────────────────────────────────────────────────────── */
.sj-tab-btn { opacity: 0.65; }
.sj-tab-btn.sj-tab-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }
.sj-pf-btn { opacity: 0.65; }
.sj-pf-btn.sj-pf-active { opacity: 1; border-color: var(--accent) !important; color: var(--accent) !important; }

/* ── Daily Workflow ──────────────────────────────────────────────────────── */
.wf-section { margin-bottom: 20px; }
.wf-section-header {
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em;
  padding: 5px 10px; margin-bottom: 6px;
  border-radius: 3px; display: inline-block;
}
.wf-section-header.priority-1 { color: #ef4444; background: rgba(239,68,68,0.12); }
.wf-section-header.priority-2 { color: #f59e0b; background: rgba(245,158,11,0.12); }
.wf-section-header.priority-3 { color: #4ade80; background: rgba(74,222,128,0.10); }
.wf-section-header.priority-4 { color: #6b7280; background: rgba(107,114,128,0.12); }
.wf-section-header.pinned-header { color: #facc15; background: rgba(250,204,21,0.12); }

.wf-task-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin-bottom: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 5px; transition: background 0.1s;
}
.wf-task-card:hover { background: var(--surface2); }
.wf-task-card.done { opacity: 0.42; }
.wf-task-card.pinned { border-left: 3px solid #facc15; }
.wf-task-check { padding-top: 2px; flex-shrink: 0; }
.wf-checkbox { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.wf-task-content { flex: 1; min-width: 0; }
.wf-task-title {
  font-size: 13px; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  line-height: 1.4;
}
.wf-task-card.done .wf-task-title { text-decoration: line-through; color: var(--muted); }
.wf-task-detail {
  font-size: 13px; color: var(--muted); margin-top: 4px;
  line-height: 1.5;
}
.wf-task-actions {
  display: flex; flex-direction: column; gap: 2px; align-items: center; flex-shrink: 0;
}
.wf-task-delete {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 4px; opacity: 0; flex-shrink: 0;
  transition: opacity 0.15s;
}
.wf-task-card:hover .wf-task-delete { opacity: 0.6; }
.wf-task-delete:hover { color: var(--down); opacity: 1 !important; }

.wf-pin-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; padding: 2px 4px; flex-shrink: 0;
  opacity: 0.35; filter: grayscale(1);
  transition: opacity 0.15s, filter 0.15s, transform 0.15s;
}
.wf-task-card:hover .wf-pin-btn { opacity: 0.7; }
.wf-pin-btn:hover { opacity: 1 !important; filter: none; transform: scale(1.15); }
.wf-pin-btn.pinned { opacity: 1 !important; filter: none; }

.wf-ticker-badge {
  font-size: 13px; font-weight: 700; font-family: var(--mono);
  padding: 1px 5px; border-radius: 3px;
  background: rgba(74,222,128,0.12); color: var(--accent);
}
.wf-cat-badge {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  padding: 1px 5px; border-radius: 10px;
  border: 1px solid currentColor;
  text-transform: uppercase;
}
.wf-pri-badge {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid currentColor;
}

.wf-filter-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  padding: 5px 12px; border-radius: 14px; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.wf-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.wf-filter-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(74,222,128,0.08); }

.wf-stat-chip {
  font-size: 13px; font-weight: 600; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--muted); background: var(--surface);
  font-variant-numeric: tabular-nums;
}

.wf-notes-row {
  display: flex; align-items: center; gap: 4px; margin-top: 5px;
}
.wf-notes-input {
  flex: 1; background: transparent; border: none; border-bottom: 1px solid var(--border);
  color: #c0c8d4; font-size: 13px; padding: 2px 4px;
  outline: none; font-family: inherit; min-width: 0;
}
.wf-notes-input:focus { border-bottom-color: var(--accent); }
.wf-notes-input::placeholder { color: var(--muted); font-style: italic; }
.wf-task-card.done .wf-notes-input { color: var(--muted); }

.wf-note-save {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 2px 7px; line-height: 1; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.wf-note-save:hover { border-color: var(--accent); color: var(--accent); }

.wf-mic-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); cursor: pointer; font-size: 13px;
  padding: 2px 6px; line-height: 1; flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.wf-mic-btn:hover { border-color: var(--accent); color: var(--accent); }
.wf-mic-btn.listening { border-color: #ef4444; color: #ef4444; animation: wf-pulse 1s infinite; }
@keyframes wf-pulse { 0%,100% { opacity:1 } 50% { opacity:0.4 } }

/* ── Sector Timeline ──────────────────────────────────────────────────────── */
.st-marketview-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px; margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 14px;
}
.st-marketview-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent); flex-shrink: 0;
}
.st-marketview-text { font-size: 13px; color: var(--text); line-height: 1.5; }

#st-chart-wrap {
  background: #0a0a0a; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px;
  margin-bottom: 14px;
}
#st-chart { display: block; width: 100%; }

.st-legend-header {
  display: grid;
  grid-template-columns: 14px 50px 130px 60px 24px 60px 90px 1fr;
  gap: 10px; align-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--muted);
  padding: 6px 12px; border-bottom: 1px solid var(--border);
}

#st-sector-list { display: flex; flex-direction: column; }
.st-row {
  display: grid;
  grid-template-columns: 14px 50px 130px 60px 24px 60px 90px 1fr;
  gap: 10px; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid #1a1a1a;
  font-size: 13px; cursor: pointer;
  transition: background 0.1s, opacity 0.1s;
}
.st-row:hover { background: var(--surface); }
.st-row.st-row-dim { opacity: 0.45; }
.st-row-color {
  width: 10px; height: 10px; border-radius: 50%;
}
.st-row-sym { font-family: var(--mono); font-weight: 700; color: var(--text); }
.st-row-name { color: var(--text); }
.st-row-val, .st-row-fc {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  text-align: right; font-weight: 600;
}
.st-row-val.green, .st-row-fc.green { color: var(--up); }
.st-row-val.red, .st-row-fc.red { color: var(--down); }
.st-row-arrow { color: var(--muted); text-align: center; font-size: 13px; }
.st-row-phase {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
}
.st-row-reason {
  font-size: 13px; color: var(--text); line-height: 1.45;
  overflow: hidden; text-overflow: ellipsis;
}

/* ── Sector Timeline · Macro Snapshot Card ────────────────────────────────── */
.st-macro-section {
  margin-top: 18px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.st-macro-header {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 6px 4px;
  user-select: none;
  border-radius: 4px;
  transition: background 0.1s;
}
.st-macro-header:hover { background: var(--surface); }
.st-macro-arrow {
  font-size: 13px; color: var(--muted);
  width: 12px; display: inline-block;
}
.st-macro-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  letter-spacing: 0.02em;
}
.st-macro-count {
  font-size: 13px; color: var(--muted);
  margin-left: auto;
}
.st-macro-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.st-macro-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 10px 12px;
}
.st-macro-group-label {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}
.st-macro-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.st-macro-table th {
  text-align: right; font-weight: 600;
  color: var(--muted); font-size: 13px;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 6px; border-bottom: 1px solid var(--border);
}
.st-macro-table th:first-child { text-align: left; }
.st-macro-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #161616;
}
.st-macro-table tr:last-child td { border-bottom: none; }
.st-m-name { color: var(--text); font-weight: 500; }
.st-m-invert { color: var(--down); font-size: 13px; margin-left: 2px; }
.st-m-val { color: var(--text); font-family: var(--mono); text-align: right; font-weight: 600; }
.st-m-d { font-family: var(--mono); text-align: right; }
.st-m-d.green { color: var(--up); }
.st-m-d.red { color: var(--down); }
.st-m-date { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.st-m-stale { color: #555; font-size: 13px; }
