:root {
  --bg:            #0a0a0a;
  --surface:       #111111;
  --surface2:      #1a1a1a;
  --surface-hover: #1e1e1e;
  --border:        #242424;
  --border-strong: #383838;
  --text:          #e2e2e2;
  --text-muted:    #6b7280;
  --text-faint:    #4b5563;
  --accent:        #38bdf8;
  --accent-bg:     #38bdf8;
  --accent-text:   #0a0a0a;
  --accent-subtle: rgba(56,189,248,0.10);
  --green:         #4ade80;
  --green-bg:      rgba(74,222,128,0.08);
  --red:           #f87171;
  --red-bg:        rgba(248,113,113,0.08);
  --yellow:        #fbbf24;
  --yellow-bg:     rgba(251,191,36,0.08);
  --blue:          #38bdf8;
  --blue-bg:       rgba(56,189,248,0.10);
  --orange:        #fb923c;
  --phase-accum:   #38bdf8;
  --phase-markup:  #4ade80;
  --phase-dist:    #fbbf24;
  --phase-down:    #f87171;
  --phase-neutral: #6b7280;
  --font:          'Inter', system-ui, sans-serif;
  --mono:          'JetBrains Mono', 'Fira Code', monospace;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.50);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.60);
  --shadow-lg:     0 8px 32px rgba(0,0,0,0.70);
  --radius-sm:     4px;
  --radius-md:     6px;
  --radius-lg:     8px;
  --radius-pill:   100px;
  --topbar-h:      48px;
  --sidebar-w:     172px;
  --bottom-nav-h:  62px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 13px; line-height: 1.4; -webkit-font-smoothing: antialiased; overflow: hidden; }

/* ── Topbar ─────────────────────────────────────────────────────────────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex; align-items: center;
}

.topbar-logo {
  width: var(--sidebar-w); height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  color: var(--accent);
  border-right: 1px solid var(--border);
  flex-shrink: 0; cursor: default; user-select: none;
}

.topbar-nav { display: none; }

.topbar-tab {
  display: flex; align-items: center; height: 100%;
  padding: 0 12px; font-size: 13px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  border: none; background: none; white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.12s, border-color 0.12s;
  font-family: var(--font);
}
.topbar-tab:hover  { color: var(--text); }
.topbar-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.topbar-right { display: flex; align-items: center; gap: 8px; padding-right: 12px; flex-shrink: 0; }

.logo { display: none; }

.wallet-badge {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-pill); padding: 3px 9px;
  font-family: var(--mono); font-size: 10px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px;
}
.refresh-info { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 5px var(--green); flex-shrink: 0; }
.status-dot.off { background: var(--red); box-shadow: 0 0 5px var(--red); }

/* ── Sidebar nav ─────────────────────────────────────────────────────────────── */

.sidebar {
  position: fixed; top: var(--topbar-h); left: 0; bottom: 0;
  width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 6px 0 16px; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.nav-section {
  display: block;
  padding: 14px 12px 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-faint);
  user-select: none; flex-shrink: 0;
}
.nav-section:first-child { padding-top: 6px; }

.nav-item {
  width: auto; height: 32px;
  display: flex; align-items: center; gap: 9px;
  border-radius: var(--radius-md); cursor: pointer;
  margin: 1px 6px; padding: 0 8px;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  background: none; border: none; text-decoration: none;
  transition: background 0.12s, color 0.12s;
  user-select: none; flex-shrink: 0; white-space: nowrap;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--accent-subtle); color: var(--accent); font-weight: 600; }
.nav-item .icon  { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }

/* ── Main content ────────────────────────────────────────────────────────────── */

.main {
  position: fixed; top: var(--topbar-h); left: var(--sidebar-w);
  right: 0; bottom: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* ── Pages ───────────────────────────────────────────────────────────────────── */

.page { display: none; animation: fadein 0.15s ease; }
.page.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes refresh-flash { 0%,100% { color: var(--text-muted); } 50% { color: var(--green); } }
.refresh-flash { animation: refresh-flash 0.5s ease; }

/* ── Stat strip ──────────────────────────────────────────────────────────────── */

.stat-strip { display: flex; align-items: stretch; border-bottom: 1px solid var(--border); background: var(--surface); }
.stat-cell  { flex: 1; padding: 13px 16px; border-right: 1px solid var(--border); min-width: 100px; }
.stat-cell:last-child { border-right: none; }
.s-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.s-value { font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.s-sub   { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

/* ── Legacy stat cards ───────────────────────────────────────────────────────── */

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px 15px; margin-bottom: 12px; }
.card-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px; }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.stat-value { font-size: 18px; font-weight: 700; font-family: var(--mono); color: var(--text); }
.stat-sub { font-size: 10px; color: var(--text-muted); margin-top: 3px; }

/* ── Filter chip bar ─────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  background: var(--surface); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-sep { width: 1px; height: 14px; background: var(--border); margin: 0 2px; flex-shrink: 0; }

/* ── Tables ──────────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; padding: 8px 10px; color: var(--text-muted); font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
th.num { text-align: right; }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 12px; white-space: nowrap; }
td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }
.coin-cell { font-weight: 600; }

/* ── Chips ───────────────────────────────────────────────────────────────────── */

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text-muted); cursor: pointer; white-space: nowrap;
  transition: all 0.12s; touch-action: manipulation; font-family: var(--font);
}
.chip:hover  { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }

.narrative-row { display: flex; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.narrative-row::-webkit-scrollbar { display: none; }

/* ── Colors ──────────────────────────────────────────────────────────────────── */

.pos { color: var(--green); }
.neg { color: var(--red); }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }
.flow-in { color: var(--green); }
.flow-out { color: var(--red); }

/* ── Badges ──────────────────────────────────────────────────────────────────── */

.side-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; }
.side-badge.long    { background: var(--green-bg); color: var(--green); }
.side-badge.short   { background: var(--red-bg);   color: var(--red); }
.side-badge.inflow  { background: var(--green-bg); color: var(--green); }
.side-badge.outflow { background: var(--red-bg);   color: var(--red); }

.health-badge { display:inline-flex; align-items:center; gap:4px; padding:2px 7px; border-radius:var(--radius-pill); font-size:10px; font-weight:600; border:1px solid transparent; }
.health-score { font-family:var(--mono); font-size:11px; }
.health-ok      { background:var(--green-bg);  color:var(--green);  border-color:rgba(74,222,128,0.2); }
.health-caution { background:var(--yellow-bg); color:var(--yellow); border-color:rgba(251,191,36,0.2); }
.health-risky   { background:var(--red-bg);    color:var(--red);    border-color:rgba(248,113,113,0.2); }
.risk-summary { display:flex; align-items:flex-start; gap:16px; padding:12px 16px; background:var(--surface); border-bottom:1px solid var(--border); border-radius:var(--radius); margin-bottom:10px; }
.risk-score-big { font-family:var(--mono); font-size:28px; font-weight:800; }
.risk-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.health-chip { display:inline-flex; align-items:center; gap:4px; padding:3px 8px; border-radius:var(--radius-pill); font-size:11px; }
.risk-flag-row { font-size:11px; color:var(--yellow); padding:3px 8px; background:var(--yellow-bg); border-radius:var(--radius-sm); margin-top:6px; }

.health-modal-overlay { position:fixed; inset:0; z-index:200; background:rgba(0,0,0,0.72); display:flex; align-items:center; justify-content:center; }
.health-modal-box { background:var(--surface); border:1px solid var(--border-strong); border-radius:var(--radius-lg); padding:20px; min-width:300px; max-width:430px; width:90%; box-shadow:var(--shadow-lg); max-height:90vh; overflow-y:auto; }
.health-modal-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.hm-close { background:none; border:none; color:var(--text-muted); font-size:20px; cursor:pointer; line-height:1; padding:0 4px; }
.hm-close:hover { color:var(--text); }
.health-modal-score-row { display:flex; align-items:center; gap:12px; margin-bottom:16px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.health-modal-big-score { font-family:var(--mono); font-size:44px; font-weight:800; line-height:1; }
.hm-factor { display:flex; justify-content:space-between; align-items:flex-start; padding:9px 0; border-bottom:1px solid var(--border); }
.hm-factor:last-child { border-bottom:none; }
.hm-factor-left { display:flex; gap:10px; align-items:flex-start; flex:1; min-width:0; }
.hm-icon { width:20px; height:20px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:700; flex-shrink:0; margin-top:1px; }
.hm-pass { background:var(--green-bg); color:var(--green); }
.hm-fail { background:var(--red-bg);   color:var(--red); }
.hm-warn { background:var(--yellow-bg); color:var(--yellow); }
.hm-na   { background:var(--surface2); color:var(--text-muted); }
.hm-factor-name   { font-size:12px; font-weight:600; margin-bottom:2px; }
.hm-factor-detail { font-size:11px; color:var(--text-muted); }
.hm-ded { font-family:var(--mono); font-size:13px; font-weight:700; white-space:nowrap; padding-left:10px; flex-shrink:0; }
.hm-ded-neg { color:var(--red); }
.hm-ded-pos { color:var(--green); }
.hm-ded-na  { color:var(--text-muted); }

.phase-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 600; }
.phase-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.phase-ACCUMULATION { background: var(--blue-bg);   color: var(--phase-accum); }
.phase-MARKUP       { background: var(--green-bg);  color: var(--phase-markup); }
.phase-DISTRIBUTION { background: var(--yellow-bg); color: var(--phase-dist); }
.phase-MARKDOWN     { background: var(--red-bg);    color: var(--phase-down); }
.phase-NEUTRAL      { background: var(--surface2);  color: var(--phase-neutral); }

.funding-pill { display: inline-block; padding: 1px 6px; border-radius: var(--radius-sm); font-size: 10px; font-family: var(--mono); }
.funding-pos { background: var(--green-bg); color: var(--green); }
.funding-neg { background: var(--red-bg);   color: var(--red); }
.funding-neu { background: var(--surface2); color: var(--text-muted); }

.flow-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; gap: 1px; }
.flow-bar-in  { background: var(--green); border-radius: 3px 0 0 3px; }
.flow-bar-out { background: var(--red);   border-radius: 0 3px 3px 0; }

.change-pill { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; font-family: var(--mono); }
.change-pos  { background: var(--green-bg); color: var(--green); }
.change-neg  { background: var(--red-bg);   color: var(--red); }

/* ── Market cards ────────────────────────────────────────────────────────────── */

.market-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.market-card-coin  { font-weight: 700; font-size: 14px; color: var(--text); }
.market-card-price { font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--text); }
.market-card-row   { display: flex; justify-content: space-between; align-items: center; }
.market-card-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.market-card-val   { font-family: var(--mono); font-size: 12px; color: var(--text); }

/* ── Regime / play cards (intel) ─────────────────────────────────────────────── */

.regime-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: 0.4px; }
.regime-CAUTION       { background: var(--yellow-bg); color: var(--yellow); border: 1px solid rgba(251,191,36,0.2); }
.regime-WAIT          { background: var(--surface2);  color: var(--text-muted); border: 1px solid var(--border); }
.regime-BUY,.regime-BULL  { background: var(--green-bg); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.regime-SELL,.regime-BEAR { background: var(--red-bg);   color: var(--red);   border: 1px solid rgba(248,113,113,0.2); }

.play-card { padding: 10px 12px; border-radius: var(--radius-md); margin-bottom: 8px; border: 1px solid; }
.play-ENTRY { background: var(--green-bg); border-color: rgba(74,222,128,0.15); }
.play-HOLD  { background: var(--blue-bg);  border-color: rgba(56,189,248,0.15); }
.play-AVOID { background: var(--red-bg);   border-color: rgba(248,113,113,0.15); }
.play-action-badge { display: inline-block; padding: 2px 7px; border-radius: var(--radius-sm); font-size: 10px; font-weight: 700; }
.action-ENTRY { background: var(--green-bg); color: var(--green); }
.action-HOLD  { background: var(--blue-bg);  color: var(--blue); }
.action-AVOID { background: var(--red-bg);   color: var(--red); }

.intel-row   { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--border); }
.intel-label { font-size: 11px; color: var(--text-muted); }
.intel-val   { font-size: 12px; font-family: var(--mono); text-align: right; color: var(--text); }

/* ── Intel page redesign ────────────────────────────────────────────────────── */

.intel-posture-banner {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.intel-posture-main { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; flex: 1; }
.intel-posture-label { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 5px; }
.intel-posture-verdict { font-size: 18px !important; font-weight: 800 !important; padding: 5px 16px !important; }
.intel-posture-score-wrap { min-width: 180px; flex-shrink: 0; }
.intel-posture-score-label { font-size: 11px; color: var(--text-muted); margin-bottom: 5px; }
.intel-score-track { position: relative; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.intel-score-fill  { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; }
.intel-score-mid   { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--border-strong); }
.intel-posture-conf { font-size: 10px; color: var(--text-muted); font-family: var(--mono); }
.intel-posture-meta { display: flex; flex-direction: column; gap: 4px; }
.intel-meta-label  { font-size: 10px; color: var(--text-muted); margin-right: 6px; }
.intel-meta-val    { font-size: 11px; font-weight: 500; }
.intel-posture-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.intel-main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 12px; margin-bottom: 12px; }
.intel-col { display: flex; flex-direction: column; gap: 12px; }

.intel-radar-wrap { display: flex; justify-content: center; padding: 4px 0; }
.intel-radar-wrap canvas { max-width: 220px; max-height: 220px; }

.intel-zbar { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.intel-zbar-fill { height: 100%; border-radius: 2px; }
.intel-zbar-fill.pos-fill { background: var(--green); }
.intel-zbar-fill.neg-fill { background: var(--red); }

.intel-bottom-score { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 8px 0 4px; }
.intel-radar-score { font-size: 44px; font-weight: 800; font-family: var(--mono); line-height: 1; }
.intel-vote-row { display: flex; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.intel-vote-cell { flex: 1; padding: 8px 6px; text-align: center; border-right: 1px solid var(--border); }
.intel-vote-cell:last-child { border-right: none; }

.intel-quote { font-size: 12px; color: var(--text-muted); line-height: 1.65; padding: 10px 12px; background: var(--surface2); border-radius: var(--radius-md); border-left: 3px solid var(--accent); margin-bottom: 10px; }
.intel-conviction { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 8px; border-radius: var(--radius-md); }
.conv-pass { background: rgba(74,222,128,0.10);  color: var(--green); }
.conv-fail { background: rgba(248,113,113,0.10); color: var(--red); }
.intel-narrative-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--surface2); border-radius: var(--radius-md); flex-wrap: wrap; margin-bottom: 8px; }
.intel-narrative-chip { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--accent-subtle); border: 1px solid rgba(56,189,248,0.2); font-size: 11px; color: var(--accent); }
.intel-avoid-card { padding: 10px 12px; background: var(--red-bg); border: 1px solid rgba(248,113,113,0.15); border-radius: var(--radius-md); margin-bottom: 8px; }
.intel-risk-box { padding: 10px 12px; background: var(--yellow-bg); border: 1px solid rgba(251,191,36,0.2); border-radius: var(--radius-md); margin-top: 10px; }
.intel-desk-stat { flex: 1; min-width: 100px; padding: 8px 10px; background: var(--surface2); border-radius: var(--radius-md); border: 1px solid var(--border); }
.intel-desk-stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.intel-desk-stat-value { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-bottom: 2px; }

/* ── TA signal dashboard ─────────────────────────────────────────────────────── */

.ta-group  { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.ta-last   { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.ta-gtitle { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; }
.ta-row       { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 4px 0; min-height: 32px; }
.ta-row-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); min-width: 100px; padding-top: 2px; flex-shrink: 0; }
.ta-sig   { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: 1; }
.ta-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-sm); letter-spacing: 0.04em; white-space: nowrap; }
.ta-sub   { font-size: 10px; color: var(--text-muted); text-align: right; font-family: var(--mono); }
.ta-bull .ta-badge { background: var(--green-bg); color: var(--green); }
.ta-bear .ta-badge { background: var(--red-bg);   color: var(--red); }
.ta-neut .ta-badge { background: var(--surface2); color: var(--text-muted); }
.ta-warn .ta-badge { background: var(--yellow-bg);color: var(--yellow); }
.ta-info .ta-badge { background: var(--blue-bg);  color: var(--blue); }

/* ── TA Recommendation card ─────────────────────────────────────────────────── */

.ta-rec-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.ta-rec-long  { border-color: rgba(74,222,128,0.3); }
.ta-rec-short { border-color: rgba(248,113,113,0.3); }
.ta-rec-neutral { border-color: var(--border); }

.ta-rec-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 14px; background: var(--surface2); flex-wrap: wrap; }
.ta-rec-dir { font-size: 22px; font-weight: 800; letter-spacing: 0.05em; }
.ta-rec-meta { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.ta-rec-score-wrap { text-align: right; min-width: 140px; }
.ta-rec-score-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.ta-rec-bar { height: 6px; background: var(--red-bg); border-radius: 3px; overflow: hidden; }
.ta-rec-bar-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }
.ta-rec-score-subs { font-size: 10px; margin-top: 3px; display: flex; gap: 8px; justify-content: flex-end; }

.ta-setup-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); }
.ta-setup-cell { padding: 8px 10px; background: var(--surface); }
.ta-setup-label { font-size: 10px; color: var(--text-muted); margin-bottom: 3px; }
.ta-setup-val { font-size: 13px; font-weight: 600; font-family: var(--mono); }
.ta-setup-note { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

.ta-sr-block { padding: 8px 14px; border-top: 1px solid var(--border); background: var(--surface2); }
.ta-sr-row { display: flex; align-items: baseline; gap: 8px; font-size: 11px; padding: 2px 0; }
.ta-sr-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); min-width: 72px; }

.ta-ck-section { padding: 10px 14px 12px; }
.ta-ck-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; }
.ta-ck-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.ta-ck-row:last-child { border-bottom: none; }
.ta-ck-icon { font-size: 14px; flex-shrink: 0; width: 20px; text-align: center; padding-top: 1px; }
.ta-ck-body { flex: 1; min-width: 0; }
.ta-ck-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.ta-ck-name { font-size: 12px; color: var(--text); }
.ta-sig-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-sm); letter-spacing: 0.04em; white-space: nowrap; flex-shrink: 0; }
.ta-bull .ta-sig-badge, .ta-ck-bull .ta-sig-badge { background: var(--green-bg); color: var(--green); }
.ta-bear .ta-sig-badge, .ta-ck-bear .ta-sig-badge { background: var(--red-bg);   color: var(--red); }
.ta-neut .ta-sig-badge, .ta-ck-neut .ta-sig-badge { background: var(--surface2); color: var(--text-muted); }
.ta-warn .ta-sig-badge, .ta-ck-warn .ta-sig-badge { background: var(--yellow-bg);color: var(--yellow); }
.ta-info .ta-sig-badge, .ta-ck-info .ta-sig-badge { background: var(--blue-bg);  color: var(--blue); }
.ta-ck-sub { font-size: 10px; color: var(--text-muted); line-height: 1.4; }
.ta-ck-exp { color: var(--text-dim, var(--text-muted)); font-style: italic; }

.ta-conflict-banner { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.4); border-radius: var(--radius-md); padding: 8px 12px; font-size: 12px; color: var(--red); margin-bottom: 10px; }
.ta-aligned-banner  { background: rgba(74,222,128,0.1);  border: 1px solid rgba(74,222,128,0.4);  border-radius: var(--radius-md); padding: 8px 12px; font-size: 12px; color: var(--green); margin-bottom: 10px; }

@media (max-width: 480px) {
  .ta-setup-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── CVD + OI scanner table ──────────────────────────────────────────────────── */

.cvd-table { width: 100%; }
.cvd-head {
  display: grid;
  grid-template-columns: 56px 58px 70px 70px 1fr;
  gap: 4px; padding: 4px 0 6px;
  border-bottom: 1px solid var(--border);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted);
}
.cvd-row {
  display: grid;
  grid-template-columns: 56px 58px 70px 70px 1fr;
  gap: 4px; padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px; align-items: center;
}
.cvd-row:last-child { border-bottom: none; }
.cvd-pos-row { background: rgba(125,130,255,0.04); border-radius: 4px; }
.cvd-coin { font-weight: 600; display: flex; align-items: center; gap: 4px; }
.cvd-dot  { color: var(--accent); font-size: 8px; }
.cvd-legend { font-size: 10px; color: var(--text-muted); padding-top: 8px; }

.cvd-charts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}
.cvd-chart-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.cvd-chart-pos { border-color: rgba(124,106,255,0.35); }
.cvd-chart-hdr {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; gap: 8px;
}
.cvd-chart-hdr.cvd-chart-toggle { cursor: pointer; user-select: none; }
.cvd-chart-hdr.cvd-chart-toggle:hover { background: rgba(255,255,255,0.03); }
.cvd-chart-left { display: flex; flex-direction: column; gap: 1px; }
.cvd-chart-coin { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.cvd-toggle-icon { font-size: 11px; color: var(--text-muted); flex-shrink: 0; transition: transform 0.15s; }
.cvd-chart-body { padding: 0 10px 10px; border-top: 1px solid var(--border); }
.cvd-panel-label { font-size: 10px; color: var(--text-muted); margin: 7px 0 3px; display: flex; align-items: center; gap: 5px; }
.cvd-panel { position: relative; height: 80px; overflow: hidden; }
.cvd-panel canvas { max-width: 100%; display: block; }
.cvd-analysis {
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}
.cvd-oi-empty { font-size: 10px; color: var(--text-muted); padding: 18px 0; text-align: center; }
.cvd-track { font-size: 10px; color: var(--text-muted); }

/* ── Money flow panel ────────────────────────────────────────────────────────── */

.mf-dom-strip {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  padding: 8px 10px; background: var(--surface2); border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.mf-dom-val { font-size: 12px; font-weight: 600; font-family: var(--mono); }

/* ── Live monitor ────────────────────────────────────────────────────────────── */

.mono { font-family: var(--mono); font-size: 12px; }
@keyframes flash-up { 0% { background: rgba(74,222,128,0.20); } 100% { background: transparent; } }
@keyframes flash-dn { 0% { background: rgba(248,113,113,0.20); } 100% { background: transparent; } }
.ticker-flash-up { animation: flash-up 0.4s ease-out; }
.ticker-flash-dn { animation: flash-dn 0.4s ease-out; }
.alert-row     { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface2); border-radius: var(--radius-md); margin-bottom: 4px; font-size: 12px; border: 1px solid var(--border); }
.alert-log-row { padding: 5px 8px; border-radius: var(--radius-md); background: var(--surface2); margin-bottom: 3px; line-height: 1.5; font-size: 12px; }

/* ── Confidence ──────────────────────────────────────────────────────────────── */

.conf-inline { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.conf-track  { width: 48px; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.conf-fill   { height: 100%; background: var(--accent); border-radius: 2px; }
.conf-label  { font-family: var(--mono); font-size: 11px; min-width: 32px; text-align: right; color: var(--text-muted); }
.conf-bar    { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.conf-val    { font-family: var(--mono); font-size: 12px; min-width: 36px; }
.progress-bar  { height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.3s; }

/* ── Phase legend ────────────────────────────────────────────────────────────── */

.phase-legend { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 12px; border-radius: var(--radius-md); border: none; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.12s; touch-action: manipulation; min-height: 32px; font-family: var(--font); }
.btn-primary { background: var(--accent-bg); color: var(--accent-text); font-weight: 600; }
.btn-primary:hover { opacity: 0.87; }
.btn-ghost { background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-danger { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248,113,113,0.2); }
.btn-danger:hover { background: rgba(248,113,113,0.15); }
.btn-sm { padding: 4px 9px; font-size: 12px; min-height: 28px; }

/* ── Inputs ──────────────────────────────────────────────────────────────────── */

.input { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px 11px; color: var(--text); font-size: 13px; width: 100%; outline: none; transition: border 0.12s; min-height: 36px; font-family: var(--font); }
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-faint); }
.input-group { display: flex; gap: 8px; flex-wrap: wrap; }
.input-group .input { flex: 1; min-width: 0; }
.add-bar { display: flex; gap: 8px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); align-items: center; flex-wrap: wrap; }

/* ── Loading / skeleton ──────────────────────────────────────────────────────── */

.loading { display: flex; align-items: center; justify-content: center; padding: 40px 16px; color: var(--text-muted); gap: 8px; font-size: 13px; }
.spinner { width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-cell { height: 11px; border-radius: var(--radius-sm); }

/* ── Section headers / tabs ──────────────────────────────────────────────────── */

.section-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; flex-wrap: wrap; gap: 8px; background: var(--surface); border-bottom: 1px solid var(--border); }
.section-title  { font-size: 14px; font-weight: 600; color: var(--text); }
.tabs { display: flex; gap: 2px; }
.tab  { padding: 4px 10px; border-radius: var(--radius-pill); cursor: pointer; font-size: 12px; color: var(--text-muted); border: 1px solid var(--border); background: var(--surface2); transition: all 0.12s; touch-action: manipulation; font-family: var(--font); }
.tab.active { background: var(--accent-subtle); color: var(--accent); border-color: var(--accent); }
.tab:hover:not(.active) { border-color: var(--border-strong); color: var(--text); }
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */

::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Bottom nav (hidden — replaced by hamburger drawer) ──────────────────────── */

.bottom-nav { display: none !important; }

/* ── Hamburger button ────────────────────────────────────────────────────────── */

.hamburger-btn {
  display: none; flex: 1; height: 100%;
  align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; padding: 0 14px;
  touch-action: manipulation;
}
.hbars { display: flex; flex-direction: column; gap: 5px; width: 22px; flex-shrink: 0; }
.hbars span { display: block; height: 2px; background: var(--text-muted); border-radius: 1px; transition: all 0.22s ease; }
.hamburger-btn.open .hbars span:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--accent); }
.hamburger-btn.open .hbars span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open .hbars span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--accent); }

/* ── Nav drawer + overlay ────────────────────────────────────────────────────── */

.nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.55);
}
.nav-overlay.open { display: block; }

.nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 270px; z-index: 90;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg); will-change: transform;
}
.nav-drawer.open { transform: translateX(0); }

.nav-drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: var(--topbar-h);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.nav-drawer-logo { font-weight: 800; font-size: 16px; color: var(--accent); }
.nav-drawer-close {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 18px; padding: 6px; border-radius: var(--radius-sm);
  transition: color 0.12s; touch-action: manipulation;
}
.nav-drawer-close:hover { color: var(--text); }
.nav-drawer-body { flex: 1; overflow-y: auto; padding: 6px 8px; -webkit-overflow-scrolling: touch; }
.nav-drawer-section {
  padding: 10px 10px 4px; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint);
}
.drawer-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 11px 12px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  text-align: left; font-family: var(--font);
  border-radius: var(--radius-md);
  transition: background 0.12s, color 0.12s;
  touch-action: manipulation; min-height: 44px;
}
.drawer-item:hover { background: var(--surface2); color: var(--text); }
.drawer-item.active { color: var(--accent); background: var(--accent-subtle); }
.drawer-item-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }

/* ── Mobile card-style tables ─────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .mobile-cards { display: block; width: 100%; }
  .mobile-cards thead { display: none; }
  .mobile-cards tbody { display: block; }
  .mobile-cards tbody tr {
    display: block; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    margin-bottom: 10px; overflow: hidden;
  }
  .mobile-cards tbody tr:last-child { margin-bottom: 0; }
  .mobile-cards td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 13px; border-bottom: 1px solid var(--border);
    white-space: normal; word-break: break-word; font-size: 13px; gap: 8px;
    text-align: right;
  }
  .mobile-cards td:last-child { border-bottom: none; }
  .mobile-cards td::before {
    content: attr(data-label); font-size: 10px; font-weight: 700;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.5px; flex-shrink: 0; white-space: nowrap; text-align: left;
  }
  .table-wrap:has(.mobile-cards) { overflow-x: visible; }
}

/* ── Tablet (intel 2-col collapses) ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .intel-main-grid { grid-template-columns: 1fr; }
  .intel-posture-main { gap: 12px; }
}

/* ── Mobile ──────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  body { overflow: hidden; font-size: 14px; }
  .sidebar { display: none; }
  .topbar-nav { display: none; }
  .hamburger-btn { display: flex; }
  .main { left: 0; bottom: 0; }
  .refresh-info { display: none !important; }

  .stat-strip { flex-wrap: wrap; }
  .stat-cell  { min-width: 50%; border-bottom: 1px solid var(--border); }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid-2 { grid-template-columns: 1fr; gap: 8px; }
  .stat-value { font-size: 16px; }
  .stat-card, .card { padding: 11px 12px; }
  #phase-cards { grid-template-columns: 1fr !important; }
  .input-group { flex-direction: column; }
  .input-group .btn { width: 100%; }
  .narrative-row { flex-wrap: nowrap; overflow-x: auto; }
  .intel-main-grid { grid-template-columns: 1fr; }
  .intel-posture-verdict { font-size: 15px !important; }
  .intel-radar-score { font-size: 36px; }
  .mvrv-grid { grid-template-columns: repeat(2, 1fr); }
  .mvrv-legend { grid-template-columns: 1fr; }

  /* Larger touch targets */
  .btn { min-height: 40px; }
  .tab { padding: 6px 12px; font-size: 13px; min-height: 36px; }
  .chip { padding: 5px 12px; font-size: 13px; min-height: 36px; }
  .filter-bar { padding: 10px 14px; gap: 8px; }

  /* Better table readability */
  th { font-size: 11px; padding: 9px 10px; }
  td { font-size: 13px; padding: 9px 10px; }

  /* Prevent inner content overflow */
  .page { min-width: 0; }
  .card { overflow: hidden; }
}

@media (max-width: 380px) {
  .stat-value { font-size: 14px; }
  .mvrv-grid { grid-template-columns: 1fr; }
}

/* ── MVRV Monitor ────────────────────────────────────────────────────────────── */

.mvrv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}

.mvrv-card {
  background: var(--surface);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mvrv-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.mvrv-coin {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.mvrv-coin-name {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.mvrv-ratio {
  font-family: var(--mono);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.mvrv-ratio-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: -6px;
}

.mvrv-sparkline {
  margin: 2px 0;
}

.mvrv-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.mvrv-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.mvrv-stat-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.mvrv-desc {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.4;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.mvrv-zone-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.mvrv-zone-hot     { background: var(--red-bg);    color: var(--red); }
.mvrv-zone-bull    { background: var(--yellow-bg); color: var(--yellow); }
.mvrv-zone-neutral { background: var(--surface2);  color: var(--text-muted); }
.mvrv-zone-under   { background: var(--green-bg);  color: var(--green); }

.mvrv-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mvrv-legend-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.mvrv-legend-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-top: 2px;
}

/* ── AI Knowledge Base ───────────────────────────────────────────────────────── */

.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 120px);
  min-height: 320px;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
}

.chat-empty {
  margin: auto;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.6;
}
.chat-bubble.user {
  align-self: flex-end;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(56,189,248,0.2);
}
.chat-bubble.assistant {
  align-self: flex-start;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  max-width: 92%;
}

.chat-answer code {
  background: var(--surface2);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
}

.chat-sources {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.chat-sources-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  margin-bottom: 6px;
}

.chat-source {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 11px;
}

.chat-source-type {
  background: var(--surface2);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
}

.chat-source-title { color: var(--text-muted); font-family: var(--mono); }
.chat-source-score { color: var(--text-faint); margin-left: auto; }

.chat-powered-by {
  margin-top: 6px;
  font-size: 10px;
  color: var(--text-faint);
  text-align: right;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.chat-input { flex: 1; }

.kgraph-node circle  { transition: fill-opacity 0.15s; }
.kgraph-node:hover circle { fill-opacity: 0.45; }

.wiki-list { background: var(--surface); }

.wiki-file { border-bottom: 1px solid var(--border); }

.wiki-file-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}
.wiki-file-header:hover { background: var(--surface-hover); }

.wiki-filename {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text);
}

.wiki-lang {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: var(--accent-subtle);
  color: var(--accent);
  margin-left: 6px;
  font-weight: 600;
}

.wiki-path {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--mono);
  margin-top: 2px;
}

.wiki-chevron { font-size: 10px; color: var(--text-faint); flex-shrink: 0; }

.wiki-entries { background: var(--bg); }

.wiki-entry {
  padding: 10px 16px 10px 32px;
  border-top: 1px solid var(--border);
}

.wiki-entry-type {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 600;
  margin-right: 6px;
}
.wiki-entry-type.function { background: rgba(129,140,248,0.12); color: #818cf8; }
.wiki-entry-type.class    { background: rgba(251,191,36,0.12);  color: var(--yellow); }

.wiki-entry-name {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.wiki-entry-line {
  font-size: 10px;
  color: var(--text-faint);
  margin-left: 6px;
}

.wiki-snippet {
  margin-top: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
  white-space: pre-wrap;
  overflow: hidden;
  max-height: 80px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

.notes-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg);
  min-height: 400px;
}

.note-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.note-textarea {
  resize: vertical;
  min-height: 72px;
  font-family: var(--font);
}

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

.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}

.note-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.note-title { flex: 1; font-size: 13px; color: var(--text); }

.note-body {
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  line-height: 1.5;
}

.ai-stat-strip {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.ai-stat-cell {
  flex: 1;
  padding: 10px 14px;
  border-right: 1px solid var(--border);
}
.ai-stat-cell:last-child { border-right: none; }

.ai-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.ai-stat-val {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ── Position Meta Modal ────────────────────────────────────────────────────── */
.pos-modal-overlay { position:fixed;inset:0;background:rgba(0,0,0,.7);display:flex;align-items:center;justify-content:center;z-index:9000; }
.pos-modal-box { background:#111;border:1px solid #2a2a2a;border-radius:10px;width:100%;max-width:460px;max-height:90vh;overflow-y:auto;display:flex;flex-direction:column; }
.pos-modal-header { display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid #1f1f1f; }
.pos-modal-title { font-size:15px;font-weight:700;color:var(--accent); }
.pos-close-btn { background:none;border:none;color:#666;font-size:18px;cursor:pointer;line-height:1; }
.pos-close-btn:hover { color:var(--text); }
.pos-tabs { display:flex;border-bottom:1px solid #1f1f1f; }
.pos-tab { flex:1;padding:9px;background:none;border:none;color:#666;font-size:13px;cursor:pointer;border-bottom:2px solid transparent;transition:color .15s; }
.pos-tab.active { color:var(--accent);border-bottom-color:var(--accent); }
.pos-tab-panel { padding:16px;display:flex;flex-direction:column;gap:14px; }
.pos-field-group { display:flex;flex-direction:column;gap:6px; }
.pos-field-label { font-size:11px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted); }
.pos-field-row { display:flex;gap:8px;align-items:center; }
.pos-input { background:#0d0d0d;border:1px solid #2a2a2a;border-radius:6px;color:var(--text);padding:7px 10px;font-size:13px;font-family:var(--font);flex:1;outline:none; }
.pos-input:focus { border-color:var(--accent); }
.pos-textarea { background:#0d0d0d;border:1px solid #2a2a2a;border-radius:6px;color:var(--text);padding:8px 10px;font-size:13px;font-family:var(--font);width:100%;resize:vertical;outline:none;box-sizing:border-box; }
.pos-textarea:focus { border-color:var(--accent); }
.pos-save-btn { background:var(--accent);color:#000;border:none;border-radius:6px;padding:7px 14px;font-size:12px;font-weight:700;cursor:pointer;white-space:nowrap; }
.pos-save-btn:hover { opacity:.85; }
.pos-age-display { font-size:11px;color:var(--text-muted); }
.pos-field-hint { font-size:11px;color:var(--text-muted); }
.intent-chips { display:flex;gap:8px;flex-wrap:wrap; }
.intent-chip { background:#1a1a1a;border:1px solid #2a2a2a;border-radius:6px;color:#888;padding:6px 14px;font-size:12px;cursor:pointer;transition:all .15s; }
.intent-chip.active { background:rgba(56,189,248,.12);border-color:var(--accent);color:var(--accent); }
.pos-age-badge { display:inline-flex;align-items:center;gap:4px;font-size:11px;font-family:var(--mono);color:var(--text-muted);background:#1a1a1a;border:1px solid #2a2a2a;border-radius:4px;padding:2px 6px;white-space:nowrap; }
.pos-age-stale { color:#facc15;border-color:rgba(250,204,21,.3); }
.pos-intent-chip { font-size:10px;font-weight:700;color:var(--accent); }
.thesis-recheck { background:#0d0d0d;border:1px solid #1f1f1f;border-radius:8px;padding:12px;display:flex;flex-direction:column;gap:8px; }
.thesis-recheck-header { font-size:13px;font-weight:600;color:var(--text);margin-bottom:2px; }
.thesis-signal { display:flex;align-items:center;gap:8px;font-size:12px;padding:4px 0; }
.thesis-signal.sig-ok { color:var(--green); }
.thesis-signal.sig-fail { color:var(--red); }
.sig-icon { font-weight:700;width:14px;text-align:center; }
.sig-name { font-weight:600;min-width:70px; }
.sig-detail { color:inherit;opacity:.8; }
.stop-metrics { display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px; }
.stop-metric { background:#0d0d0d;border:1px solid #1f1f1f;border-radius:8px;padding:10px 12px; }
.stop-metric-label { font-size:10px;text-transform:uppercase;letter-spacing:.5px;color:var(--text-muted);margin-bottom:4px; }
.stop-metric-val { font-family:var(--mono);font-size:15px;font-weight:700;color:var(--text); }
.stop-metric-val.neg { color:var(--red); }

/* ── Journal ────────────────────────────────────────────────────────────────── */
.journal-insight-grid { display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px; }
@media(max-width:600px){.journal-insight-grid{grid-template-columns:1fr;}}
.journal-insight-card { background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 16px; }
.journal-hold-comparison { display:flex;flex-direction:column;gap:10px;margin-top:8px; }
.journal-hold-bar { height:8px;border-radius:4px;min-width:4px;transition:width .4s; }
.journal-coin-table table { width:100%;border-collapse:collapse;font-size:12px; }
.journal-coin-table th { text-align:left;color:var(--text-muted);font-size:10px;text-transform:uppercase;padding:4px 6px;border-bottom:1px solid var(--border); }
.journal-coin-table td { padding:5px 6px;border-bottom:1px solid #1a1a1a; }

/* ── Indicators ────────────────────────────────────────────────────────────── */
.ind-strip { display:flex; align-items:center; gap:0; border-bottom:1px solid var(--border); background:var(--surface); flex-wrap:wrap; }
.ind-chip { display:flex; align-items:center; gap:6px; padding:8px 16px; border-right:1px solid var(--border); font-size:12px; }
.ind-chip:last-child { border-right:none; }
.ind-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-muted); }
.ind-badge { padding:1px 6px; border-radius:var(--radius-sm); font-size:10px; font-weight:600; }
.ind-extreme_fear  { background:var(--red-bg); color:var(--red); }
.ind-fear          { background:rgba(251,146,60,0.1); color:#fb923c; }
.ind-neutral       { background:var(--surface2); color:var(--text-muted); }
.ind-greed         { background:rgba(74,222,128,0.06); color:#a3e635; }
.ind-extreme_greed { background:var(--green-bg); color:var(--green); }
.ind-bull          { background:var(--green-bg); color:var(--green); }
.ind-bear          { background:var(--red-bg); color:var(--red); }
.ind-top           { background:var(--red-bg); color:var(--red); }
.ind-warning       { background:var(--yellow-bg); color:var(--yellow); }
.ind-normal        { background:var(--surface2); color:var(--text-muted); }
.ind-strip-loading { padding:8px 16px; font-size:11px; color:var(--text-muted); border-bottom:1px solid var(--border); }
.ind-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; padding:14px; }
.ind-section-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.8px; color:var(--text-muted); padding:10px 14px 4px; }
.ind-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:13px 15px; }
.ind-card-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.6px; color:var(--text-muted); margin-bottom:8px; }
.ind-card-value { font-family:var(--mono); font-size:28px; font-weight:800; line-height:1; margin-bottom:4px; }
.ind-card-detail { font-size:11px; color:var(--text-muted); margin-top:6px; line-height:1.5; }
.ind-signal-badge { display:inline-block; padding:2px 8px; border-radius:var(--radius-pill); font-size:11px; font-weight:700; margin-bottom:6px; }
.ind-bar-wrap { height:6px; background:var(--surface2); border-radius:3px; margin:6px 0; overflow:hidden; }
.ind-bar-fill { height:100%; border-radius:3px; }
.ind-fg-bar { background:linear-gradient(to right, var(--red), var(--yellow), var(--green)); }
.ind-floor-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; padding:0 14px 14px; }
.ind-floor-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:10px 12px; }
.ind-floor-name { font-size:10px; font-weight:600; color:var(--text-muted); margin-bottom:3px; }
.ind-floor-price { font-family:var(--mono); font-size:14px; font-weight:700; }
.ind-floor-desc { font-size:10px; color:var(--text-muted); margin-top:2px; }
.ind-unavail { opacity:0.45; }
.ind-unavail-badge { display:inline-block; padding:1px 6px; border-radius:var(--radius-sm); font-size:10px; background:var(--surface2); color:var(--text-muted); }
.ind-sparkline-wrap { height:60px; margin-top:8px; }
@media (max-width:768px) { .ind-grid { grid-template-columns:1fr; } .ind-floor-grid { grid-template-columns:repeat(2,1fr); } }

/* ── Nansen Smart Money ─────────────────────────────────────────────────────── */
.nansen-header { display:flex; align-items:center; gap:12px; padding:10px 14px; background:var(--surface); border-bottom:1px solid var(--border); flex-wrap:wrap; }
.nansen-status { font-size:11px; color:var(--text-muted); }
.nansen-countdown { font-family:var(--mono); font-size:11px; color:var(--accent); }
.nansen-refresh-btn { padding:3px 10px; border-radius:var(--radius-sm); background:var(--surface2); border:1px solid var(--border); color:var(--text-muted); font-size:11px; cursor:pointer; }
.nansen-refresh-btn:hover { color:var(--text); }
.nansen-tabs { display:flex; border-bottom:1px solid var(--border); background:var(--surface); }
.nansen-tab { padding:9px 16px; font-size:13px; font-weight:500; color:var(--text-muted); cursor:pointer; border:none; background:none; border-bottom:2px solid transparent; transition:color 0.12s,border-color 0.12s; }
.nansen-tab:hover { color:var(--text); }
.nansen-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.nansen-pos-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:10px; padding:14px; }
.nansen-pos-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:13px 15px; }
.nansen-pos-card.pos-accum { border-left:3px solid var(--green); }
.nansen-pos-card.pos-distrib { border-left:3px solid var(--red); }
.nansen-pos-card.pos-neutral { border-left:3px solid var(--border); }
.nansen-pos-header { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.nansen-pos-coin { font-weight:700; font-size:14px; }
.nansen-flows { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:8px; }
.nansen-flow-cell { text-align:center; }
.nansen-flow-label { font-size:10px; color:var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:0.5px; }
.nansen-flow-val { font-family:var(--mono); font-size:12px; font-weight:700; margin-top:2px; }
.nansen-badge { display:inline-block; padding:2px 8px; border-radius:var(--radius-pill); font-size:10px; font-weight:700; letter-spacing:0.04em; }
.nansen-accum { background:var(--green-bg); color:var(--green); }
.nansen-distrib { background:var(--red-bg); color:var(--red); }
.nansen-neutral { background:var(--surface2); color:var(--text-muted); }
.nansen-key-form { padding:24px 14px; max-width:400px; }
.nansen-key-form input { width:100%; padding:8px 12px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-family:var(--mono); font-size:12px; outline:none; }
.nansen-key-form input:focus { border-color:var(--accent); }
.nansen-save-key-btn { margin-top:8px; padding:6px 16px; background:var(--accent-subtle); border:1px solid var(--accent); border-radius:var(--radius-sm); color:var(--accent); cursor:pointer; font-size:12px; }
.nansen-pos-open { border-left:2px solid var(--accent) !important; }
.nansen-watchlist-input { display:flex; gap:8px; padding:12px 14px; border-bottom:1px solid var(--border); }
.nansen-watchlist-input input { flex:1; padding:6px 10px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-size:12px; outline:none; }
.nansen-watchlist-input input:focus { border-color:var(--accent); }
.nansen-add-btn { padding:6px 12px; background:var(--accent-subtle); border:1px solid var(--accent); border-radius:var(--radius-sm); color:var(--accent); cursor:pointer; font-size:12px; }
.nansen-wl-item { display:flex; align-items:center; gap:8px; padding:4px 14px; }
.nansen-wl-remove { background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:14px; padding:2px 6px; }
.nansen-no-data { padding:24px 14px; color:var(--text-muted); font-size:13px; }
@media (max-width:768px) { .nansen-pos-grid { grid-template-columns:1fr; } }

/* ── Analytics ── */
.an-wrap { padding:14px; max-width:1200px; }
.an-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:8px; margin-bottom:16px; }
.an-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; }
.an-card-label { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.05em; font-weight:600; }
.an-card-value { font-size:18px; font-weight:700; font-family:var(--mono); margin-top:4px; }
.an-charts-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
.an-chart-box { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px; }
.an-chart-title { font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.05em; margin-bottom:8px; }
.an-breakdowns { display:flex; flex-direction:column; gap:12px; margin-bottom:16px; }
.an-section { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:12px 14px; margin-bottom:12px; }
.an-title { font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.06em; margin-bottom:10px; }
.an-title-sub { font-size:10px; color:var(--text-muted); font-weight:400; text-transform:none; letter-spacing:0; }
.an-table-wrap { overflow-x:auto; }
.an-table { width:100%; border-collapse:collapse; font-size:12px; }
.an-table th { text-align:left; padding:5px 8px; color:var(--text-muted); font-weight:600; font-size:10px; text-transform:uppercase; letter-spacing:0.04em; border-bottom:1px solid var(--border); }
.an-table td { padding:5px 8px; border-bottom:1px solid var(--border2,#111); }
.an-table tr:last-child td { border-bottom:none; }
.an-kelly-body { display:flex; flex-direction:column; gap:10px; }
.an-kelly-formula { font-family:var(--mono); font-size:13px; color:var(--text-muted); }
.an-kelly-formula strong { color:var(--text); font-size:15px; }
.an-kelly-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:6px; font-size:12px; color:var(--text-muted); }
.an-kelly-grid strong { color:var(--text); }
.an-kelly-recs { display:flex; flex-direction:column; gap:4px; }
.an-kelly-rec { font-size:12px; padding:5px 10px; background:var(--surface2); border-radius:var(--radius-sm); }
.an-kelly-rec.pos { background:var(--green-bg); }
.an-kelly-rec.neg { background:var(--red-bg); }
.an-kelly-rec strong { font-family:var(--mono); }
.an-kelly-note { font-size:11px; color:var(--text-muted); }
.an-patterns-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:8px; }
.an-pattern-card { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); padding:10px 12px; }
.an-pattern-card.good { border-left:3px solid var(--green); }
.an-pattern-card.bad  { border-left:3px solid var(--red); }
.an-pattern-rank { font-size:10px; color:var(--text-muted); font-weight:700; margin-bottom:3px; }
.an-pattern-dim  { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.04em; }
.an-pattern-val  { font-size:14px; font-weight:700; margin:3px 0; }
.an-pattern-wr   { font-size:13px; font-weight:700; font-family:var(--mono); }
.an-pattern-meta { font-size:10px; color:var(--text-muted); margin-top:3px; }
.an-pattern-edge { font-size:11px; font-weight:600; font-family:var(--mono); margin-top:4px; }
.an-ai-section { }
.an-ai-form { margin-bottom:12px; }
.an-ai-row { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px; }
.an-ai-field label { display:block; font-size:11px; color:var(--text-muted); margin-bottom:4px; }
.an-ai-field input { width:100%; padding:7px 10px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-family:var(--mono); font-size:12px; outline:none; box-sizing:border-box; }
.an-ai-field input:focus { border-color:var(--accent); }
.an-ai-btns { display:flex; gap:8px; flex-wrap:wrap; }
.an-ai-btn { padding:7px 16px; border-radius:var(--radius-sm); font-size:12px; font-weight:600; cursor:pointer; border:1px solid var(--accent); background:var(--accent-subtle); color:var(--accent); }
.an-ai-btn.primary { background:var(--accent); color:#000; }
.an-ai-btn:hover { opacity:0.85; }
.an-ai-result { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); padding:14px; margin-top:12px; }
.an-ai-response { font-size:13px; line-height:1.6; }
.an-ai-response p { margin:0 0 8px; }
.an-ai-response ul { margin:4px 0 8px 16px; padding:0; }
.an-ai-response li { margin-bottom:4px; }
.an-ai-h { font-size:13px; font-weight:700; color:var(--accent); margin:12px 0 6px; }
@media (max-width:768px) {
  .an-charts-row { grid-template-columns:1fr; }
  .an-ai-row { grid-template-columns:1fr; }
  .an-patterns-grid { grid-template-columns:repeat(2,1fr); }
}

/* ── Logger ── */
.logger-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin:0 4px; cursor:pointer; flex-shrink:0; }
.logger-dot.ok   { background:var(--green); box-shadow:0 0 4px var(--green); }
.logger-dot.warn { background:var(--yellow,#f59e0b); }
.logger-dot.off  { background:var(--border); }
.logger-dot.running { background:var(--accent); animation:pulse 1s infinite; }
.logger-dot.error   { background:var(--red); }
.an-tabbar { display:flex; gap:0; border-bottom:1px solid var(--border); margin-bottom:14px; }
.an-tab { padding:8px 16px; background:none; border:none; border-bottom:2px solid transparent; color:var(--text-muted); cursor:pointer; font-size:12px; font-weight:600; }
.an-tab:hover { color:var(--text); }
.an-tab.active { color:var(--accent); border-bottom-color:var(--accent); }
.log-setup { padding:14px; max-width:900px; }
.log-status-badge { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:var(--radius-pill); font-size:10px; font-weight:700; }
.log-status-badge.ok   { background:var(--green-bg); color:var(--green); }
.log-status-badge.warn { background:rgba(245,158,11,0.15); color:#f59e0b; }
.log-status-badge.off  { background:var(--surface2); color:var(--text-muted); }
.log-step { display:flex; gap:12px; margin-bottom:20px; }
.log-step-num { width:24px; height:24px; border-radius:50%; background:var(--accent); color:#000; font-size:12px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:2px; }
.log-step-body { flex:1; }
.log-step-title { font-size:13px; font-weight:700; margin-bottom:4px; }
.log-step-desc  { font-size:12px; color:var(--text-muted); margin-bottom:8px; }
.log-sql-wrap { position:relative; }
.log-copy-btn { position:absolute; top:8px; right:8px; padding:4px 10px; background:var(--accent-subtle); border:1px solid var(--accent); border-radius:var(--radius-sm); color:var(--accent); font-size:11px; cursor:pointer; z-index:1; }
.log-sql { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius); padding:12px; font-family:var(--mono); font-size:11px; color:var(--text-muted); overflow-x:auto; max-height:220px; overflow-y:auto; white-space:pre; margin:0; }
.log-fields { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.log-field label { display:block; font-size:11px; color:var(--text-muted); margin-bottom:4px; }
.log-field input { width:100%; padding:7px 10px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-family:var(--mono); font-size:12px; outline:none; box-sizing:border-box; }
.log-field input:focus { border-color:var(--accent); }
.log-save-btn { padding:7px 16px; background:var(--accent); color:#000; border:none; border-radius:var(--radius-sm); font-size:12px; font-weight:700; cursor:pointer; }
.log-test-btn { padding:7px 14px; background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text-muted); font-size:12px; cursor:pointer; }
.log-status-row { display:flex; align-items:center; gap:16px; flex-wrap:wrap; padding:12px 14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); margin-bottom:16px; }
.log-stat { display:flex; flex-direction:column; gap:2px; }
.log-stat-label { font-size:10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.04em; }
.log-stat-val { font-size:13px; font-weight:600; font-family:var(--mono); }
.log-now-btn { margin-left:auto; padding:6px 14px; background:var(--accent-subtle); border:1px solid var(--accent); border-radius:var(--radius-sm); color:var(--accent); font-size:12px; cursor:pointer; }
.log-what { margin-top:4px; }
.log-what-title { font-size:11px; color:var(--text-muted); font-weight:700; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:8px; }
.log-what-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:6px; }
.log-what-item { font-size:11px; color:var(--text-muted); background:var(--surface2); padding:8px 10px; border-radius:var(--radius-sm); line-height:1.5; }
.log-what-item strong { color:var(--text); }
@media (max-width:768px) { .log-fields { grid-template-columns:1fr; } .log-step { flex-direction:column; } }

/* ── Market Detail Modal ────────────────────────────────────────────────────── */
.mkt-overlay { position:fixed;inset:0;background:rgba(0,0,0,0.75);z-index:9500;display:flex;align-items:center;justify-content:center;padding:16px;backdrop-filter:blur(3px);opacity:0;pointer-events:none;transition:opacity .18s; }
.mkt-overlay.open { opacity:1;pointer-events:all; }
.mkt-modal { background:var(--card);border:1px solid var(--border-strong);border-radius:var(--radius-lg);width:100%;max-width:700px;max-height:88vh;overflow-y:auto;box-shadow:var(--shadow-lg);animation:mktSlideIn .18s ease; }
@keyframes mktSlideIn { from{transform:translateY(16px);opacity:0} to{transform:translateY(0);opacity:1} }
.mkt-modal-head { display:flex;justify-content:space-between;align-items:flex-start;padding:18px 20px 14px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--card);z-index:1; }
.mkt-modal-coin { font-size:22px;font-weight:800;color:var(--text); }
.mkt-modal-price { font-family:var(--mono);font-size:17px;font-weight:600;color:var(--text);margin-left:10px; }
.mkt-modal-chg { font-family:var(--mono);font-size:13px;margin-left:8px; }
.mkt-close { background:none;border:none;color:var(--text-faint);font-size:20px;cursor:pointer;line-height:1;padding:2px 6px;border-radius:var(--radius-sm); }
.mkt-close:hover { color:var(--text);background:var(--surface2); }
.mkt-modal-body { padding:16px 20px 20px; }
.mkt-stats-grid { display:flex;flex-wrap:wrap;gap:16px;padding:12px 0 16px;border-bottom:1px solid var(--border);margin-bottom:16px; }
.mkt-stat { display:flex;flex-direction:column;gap:2px; }
.mkt-stat-label { font-size:10px;color:var(--text-faint);text-transform:uppercase;letter-spacing:.05em; }
.mkt-stat-val { font-family:var(--mono);font-size:13px;font-weight:600; }
.mkt-section { margin-bottom:16px; }
.mkt-section-title { font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);margin-bottom:8px; }
.mkt-sig-row { display:flex;align-items:center;gap:10px;padding:6px 0;border-bottom:1px solid var(--border); }
.mkt-sig-row:last-child { border-bottom:none; }
.mkt-sig-name { font-size:11px;font-weight:600;color:var(--text-muted);width:54px;flex-shrink:0; }
.mkt-sig-sub { font-size:11px;color:var(--text-faint);font-family:var(--mono);margin-left:auto;text-align:right; }
.mkt-phase-box { background:var(--surface2);border-radius:var(--radius);padding:12px 14px; }
.mkt-phase-row { display:flex;align-items:center;justify-content:space-between;margin-bottom:8px; }
.mkt-conf-bar { height:4px;background:var(--border);border-radius:2px;overflow:hidden;margin-bottom:10px; }
.mkt-conf-fill { height:100%;border-radius:2px;transition:width .4s; }
.mkt-signals-list { display:flex;flex-direction:column;gap:4px; }
.mkt-signal-item { font-size:11px;color:var(--text-muted);display:flex;align-items:center;gap:5px; }
.mkt-signal-item::before { content:'';width:4px;height:4px;border-radius:50%;background:var(--accent);flex-shrink:0; }
.mkt-lsr-row { display:flex;align-items:center;gap:12px;padding:10px 0; }
.mkt-lsr-bar { flex:1;height:8px;border-radius:4px;overflow:hidden;display:flex; }
.mkt-lsr-long { background:var(--green);height:100%; }
.mkt-lsr-short { background:var(--red);height:100%; }
.mkt-oi-wrap { background:var(--surface2);border-radius:var(--radius);padding:10px 12px; }
.mkt-row-click { cursor:pointer; }
.mkt-row-click:hover td { background:var(--surface2); }

/* ── MVRV Learn Panel ───────────────────────────────────────────────────────── */
.mvrv-learn { border-bottom: 1px solid var(--border); background: var(--surface); }
.mvrv-learn-toggle { width: 100%; text-align: left; padding: 12px 16px; background: none; border: none; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.mvrv-learn-toggle:hover { background: var(--surface2); }
.mvrv-learn-content { padding: 0 16px 16px; }
.mvrv-learn-section { margin-bottom: 20px; }
.mvrv-learn-section h4 { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.mvrv-learn-section p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0 0 8px; }
.mvrv-learn-section ul { font-size: 13px; color: var(--text-muted); line-height: 1.7; margin: 0 0 8px; padding-left: 18px; }
.mvrv-learn-section strong { color: var(--text); }
.mvrv-learn-section em { color: var(--yellow); font-style: normal; font-weight: 600; }
/* Below-1 alert */
.mvrv-alert-below1 { display: flex; gap: 12px; background: var(--green-bg); border: 1px solid rgba(74,222,128,0.2); border-radius: var(--radius-lg); padding: 12px 14px; margin-bottom: 16px; }
.mvrv-alert-below1 strong { color: var(--green); font-size: 13px; }
.mvrv-alert-icon { font-size: 20px; flex-shrink: 0; }
/* Historical examples */
.mvrv-historical { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mvrv-hist-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
/* Zone reference table */
.mvrv-zone-table { display: flex; flex-direction: column; gap: 2px; }
.mvrv-zone-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 8px 10px; background: var(--surface2); border-radius: 6px; align-items: start; }
.mvrv-zone-row-left { display: flex; flex-direction: column; gap: 4px; }
.mvrv-zone-range { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
.mvrv-zone-meaning { font-size: 12px; color: var(--text); margin-bottom: 2px; }
.mvrv-zone-action { font-size: 11px; color: var(--text-muted); }
@media (max-width: 600px) {
  .mvrv-zone-row { grid-template-columns: 1fr; }
}

/* ── News Tab ───────────────────────────────────────────────────────────────── */
.news-fng-bar { display: flex; gap: 6px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); align-items: center; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.news-fng-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-right: 4px; flex-shrink: 0; }
.news-fng-chip { padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; flex-shrink: 0; cursor: default; }
.news-fng-chip.fng-extreme-fear { background: rgba(248,113,113,0.15); color: #f87171; border: 1px solid rgba(248,113,113,0.25); }
.news-fng-chip.fng-fear         { background: rgba(251,146,60,0.12); color: #fb923c; border: 1px solid rgba(251,146,60,0.2); }
.news-fng-chip.fng-neutral      { background: rgba(107,114,128,0.12); color: #9ca3af; border: 1px solid rgba(107,114,128,0.2); }
.news-fng-chip.fng-greed        { background: rgba(250,204,21,0.12); color: #facc15; border: 1px solid rgba(250,204,21,0.2); }
.news-fng-chip.fng-extreme-greed{ background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.2); }
.news-fng-chip.today { padding: 5px 10px; font-size: 12px; }
.news-fng-arrow { font-size: 10px; color: var(--border-strong); flex-shrink: 0; }

.news-feed { display: flex; flex-direction: column; gap: 0; overflow-y: auto; }
.news-card { padding: 12px 16px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.news-card:hover { background: var(--surface2); }
.news-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.news-source-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 6px; border-radius: 3px; background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border); flex-shrink: 0; }
.news-source-badge.src-cryptocompare { background: rgba(74,222,128,0.08); color: var(--green); border-color: rgba(74,222,128,0.2); }
.news-source-badge.src-reddit        { background: rgba(255,69,0,0.08); color: #ff6314; border-color: rgba(255,69,0,0.2); }
.news-source-badge.src-coindesk      { background: rgba(59,130,246,0.08); color: #60a5fa; border-color: rgba(59,130,246,0.2); }
.news-source-badge.src-cointelegraph { background: rgba(168,85,247,0.08); color: #c084fc; border-color: rgba(168,85,247,0.2); }
.news-source-badge.src-decrypt       { background: rgba(251,191,36,0.08); color: var(--yellow); border-color: rgba(251,191,36,0.2); }
.news-source-badge.src-cryptonews    { background: rgba(248,113,113,0.08); color: var(--red); border-color: rgba(248,113,113,0.2); }
.news-source-badge.src-theblock      { background: rgba(14,165,233,0.08); color: #38bdf8; border-color: rgba(14,165,233,0.2); }

.news-time { font-size: 11px; color: var(--text-faint); margin-left: auto; flex-shrink: 0; }
.news-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; line-height: 1.45; margin-bottom: 4px; }
.news-title:hover { color: #38bdf8; }
.news-excerpt { font-size: 12px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.news-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; background: var(--surface2); color: var(--text-faint); border: 1px solid var(--border); }
.news-reddit-meta { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.news-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.news-load-more { width: 100%; padding: 10px; background: none; border: none; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; cursor: pointer; }
.news-load-more:hover { background: var(--surface2); color: var(--text); }
@media(max-width:600px){.mkt-modal{max-height:95vh}.mkt-modal-head{padding:14px 14px 10px}.mkt-modal-body{padding:12px 14px 16px}}

/* ── Fundamentals ─────────────────────────────────────────────────────────── */
#page-fundamentals { flex-direction:column; overflow:hidden; }
#page-fundamentals.active { display:flex; }
#fundamentals-content { display:flex; flex-direction:column; flex:1; overflow:hidden; }
.fund-global-bar { display:flex; align-items:center; gap:12px; flex-wrap:wrap; padding:8px 14px; background:var(--surface); border-bottom:1px solid var(--border); font-size:12px; flex-shrink:0; }
.fund-stat { display:flex; align-items:center; gap:5px; white-space:nowrap; }
.fund-stat-label { color:var(--text-faint); font-size:11px; }
.fund-sep { color:var(--border-strong); }
.fund-chip { display:inline-block; padding:1px 6px; border-radius:3px; background:var(--surface2); border:1px solid var(--border); font-size:10px; font-weight:600; color:var(--text-muted); }
.fund-toolbar { display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px solid var(--border); flex-shrink:0; flex-wrap:wrap; }
.fund-table { width:100%; border-collapse:collapse; font-size:12px; }
.fund-table thead th { position:sticky; top:0; z-index:1; background:var(--surface); padding:7px 10px; font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid var(--border); white-space:nowrap; }
.fund-table thead th:first-child { width:36px; }
.fund-table tbody tr { border-bottom:1px solid var(--border); transition:background 0.1s; }
.fund-table tbody tr:hover { background:var(--surface2); }
.fund-table td { padding:7px 10px; white-space:nowrap; }
.fund-table td.num { text-align:right; font-family:var(--mono); font-variant-numeric:tabular-nums; }

/* ── AI Page ──────────────────────────────────────────────────────────────── */
.ai-layout { display:flex; height:100%; overflow:hidden; gap:0; }
.ai-left  { width:380px; min-width:280px; flex-shrink:0; display:flex; flex-direction:column; border-right:1px solid var(--border); overflow:hidden; }
.ai-right { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.stage-panel { display:flex; flex-direction:column; gap:0; overflow-y:auto; padding:12px; height:100%; }
.stage-panel-header { font-weight:700; font-size:14px; margin-bottom:10px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.stage-form { display:flex; flex-direction:column; gap:8px; padding:10px; background:var(--surface2); border-radius:var(--radius-lg); border:1px solid var(--border); margin-bottom:12px; }
.stage-row { display:flex; gap:8px; }
.stage-field { flex:1; display:flex; flex-direction:column; gap:4px; min-width:0; }
.stage-section-lbl { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-faint); padding:8px 0 4px; }
.stage-list { display:flex; flex-direction:column; gap:8px; }
.trade-card { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-lg); padding:10px 12px; }
.trade-card-dim { opacity:0.55; }
.trade-card-head { display:flex; align-items:center; gap:6px; }
.form-label { font-size:11px; color:var(--text-faint); }
.chat-panel { display:flex; flex-direction:column; height:100%; overflow:hidden; }
.chat-header { display:flex; align-items:center; gap:6px; padding:10px 14px; border-bottom:1px solid var(--border); background:var(--surface); flex-shrink:0; }
.chat-messages { flex:1; overflow-y:auto; display:flex; flex-direction:column; padding:8px; gap:8px; }
.chat-msg { display:flex; flex-direction:column; gap:3px; max-width:85%; }
.chat-msg-user { align-self:flex-end; }
.chat-msg-ai   { align-self:flex-start; }
.chat-msg-lbl  { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.5px; color:var(--text-faint); }
.chat-msg-user .chat-msg-lbl { text-align:right; }
.chat-msg-body { padding:8px 11px; border-radius:var(--radius-lg); font-size:13px; line-height:1.55; }
.chat-msg-user .chat-msg-body { background:var(--accent-subtle); border:1px solid rgba(56,189,248,0.15); color:var(--text); border-bottom-right-radius:3px; }
.chat-msg-ai   .chat-msg-body { background:var(--surface2); border:1px solid var(--border); color:var(--text); border-bottom-left-radius:3px; }
.chat-input-row { display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--border); flex-shrink:0; background:var(--surface); }
.chat-code-block { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-md); padding:10px 12px; font-size:11px; font-family:var(--mono); overflow-x:auto; white-space:pre; margin-top:6px; color:var(--text-muted); max-height:260px; overflow-y:auto; }
@media(max-width:768px) {
  .ai-layout { flex-direction:column; }
  .ai-left { width:100%; height:50%; border-right:none; border-bottom:1px solid var(--border); }
  .ai-right { height:50%; }
}

/* ── Arb Scanner ──────────────────────────────────────────────────────────── */
#page-arb { flex-direction:column; overflow:hidden; }
#page-arb.active { display:flex; }
#arb-content { display:flex; flex-direction:column; flex:1; overflow:hidden; }
.arb-table { width:100%; border-collapse:collapse; font-size:12px; }
.arb-table thead th { position:sticky; top:0; z-index:1; background:var(--surface); padding:7px 10px; font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid var(--border); white-space:nowrap; }
.arb-table tbody tr { border-bottom:1px solid var(--border); transition:background 0.1s; }
.arb-table tbody tr:hover { background:var(--surface2); }
.arb-table td { padding:7px 10px; white-space:nowrap; }
.arb-table td.num { text-align:right; font-family:var(--mono); font-variant-numeric:tabular-nums; }
.arb-table tr.arb-hi td { background:rgba(251,191,36,0.06); }
.arb-table tr.arb-hi:hover td { background:rgba(251,191,36,0.12); }
.arb-signal { display:inline-flex; align-items:center; padding:2px 7px; border-radius:var(--radius-pill); font-size:10px; font-weight:700; letter-spacing:0.3px; }
.arb-earn    { background:var(--green-bg); color:var(--green);   border:1px solid rgba(74,222,128,0.2); }
.arb-crowd   { background:var(--red-bg);   color:var(--red);     border:1px solid rgba(248,113,113,0.2); }
.arb-neutral { background:var(--surface2); color:var(--text-muted); border:1px solid var(--border); }

/* ── DeFiLlama ────────────────────────────────────────────────────────────── */
#page-defi { flex-direction:column; overflow:hidden; }
#page-defi.active { display:flex; }
#defi-content { display:flex; flex-direction:column; flex:1; overflow-y:auto; overflow-x:hidden; }
.defi-wrap { max-width:1200px; margin:0 auto; padding:0 0 24px; width:100%; }
.defi-toolbar { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); flex-shrink:0; flex-wrap:wrap; }
.defi-regime { margin:12px 14px 4px; padding:12px 14px; background:var(--surface2); border-radius:var(--radius-lg); border-left:3px solid var(--border-strong); }
.defi-regime-header { display:flex; align-items:center; gap:0; flex-wrap:wrap; margin-bottom:8px; }
.defi-regime-badge { font-size:13px; font-weight:800; margin-right:10px; }
.defi-regime-meta { font-size:12px; color:var(--text-muted); }
.defi-regime-bullets { display:flex; flex-direction:column; gap:4px; }
.defi-regime-bullet { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--text-muted); line-height:1.5; }
.defi-kpi-strip { display:flex; gap:0; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.defi-kpi { flex:1; min-width:120px; padding:12px 16px; border-right:1px solid var(--border); }
.defi-kpi:last-child { border-right:none; }
.defi-kpi-label { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-faint); margin-bottom:4px; }
.defi-kpi-value { font-size:20px; font-weight:800; font-family:var(--mono); }
.defi-kpi-sub { font-size:11px; color:var(--text-muted); margin-top:2px; }
.defi-grid { display:grid; grid-template-columns:1fr 340px; gap:0; }
@media(max-width:900px) { .defi-grid { grid-template-columns:1fr; } }
.defi-section { padding:14px 14px 0; }
.defi-right-col { border-left:1px solid var(--border); padding:14px 14px 0; }
.defi-section-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-faint); margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.defi-table-wrap { overflow-x:auto; }
.defi-table { width:100%; border-collapse:collapse; font-size:12px; }
.defi-table thead th { position:sticky; top:0; z-index:1; background:var(--surface); padding:6px 8px; font-size:10px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.5px; border-bottom:1px solid var(--border); white-space:nowrap; text-align:left; }
.defi-table th.num,.defi-table td.num { text-align:right; font-family:var(--mono); }
.defi-table tbody tr { border-bottom:1px solid var(--border); transition:background 0.1s; }
.defi-table tbody tr:hover { background:var(--surface2); }
.defi-table td { padding:6px 8px; white-space:nowrap; }
.defi-chains { display:flex; flex-direction:column; gap:6px; }
.defi-chain-row { display:grid; grid-template-columns:16px 90px 1fr 60px 36px; gap:6px; align-items:center; font-size:12px; }
.defi-chain-rank { color:var(--text-faint); font-size:10px; }
.defi-chain-name { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.defi-chain-bar-wrap { height:4px; background:var(--border); border-radius:2px; overflow:hidden; }
.defi-chain-bar { height:100%; background:var(--accent); border-radius:2px; transition:width 0.5s ease; }
.defi-chain-tvl { font-family:var(--mono); font-size:11px; text-align:right; }
.defi-chain-pct { font-size:10px; text-align:right; }

/* ── Indicators — Regime Summary ─────────────────────────────────────────── */
.ind-regime-summary { margin:12px 14px 4px; padding:12px 14px; background:var(--surface2); border-radius:var(--radius-lg); border:1px solid var(--border); }
.ind-regime-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.ind-regime-verdict { font-size:14px; font-weight:800; }
.ind-regime-sub { font-size:11px; color:var(--text-faint); }
.ind-regime-bullets { display:flex; flex-direction:column; gap:4px; }
.ind-regime-bullet { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--text-muted); line-height:1.5; }

/* ── Auto-Journal ─────────────────────────────────────────────────────────── */
.aj-panel { border-bottom:2px solid var(--border); }
.aj-toolbar { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.aj-toolbar-btns { display:flex; gap:6px; flex-wrap:wrap; margin-left:auto; }
.aj-section-title { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); }
.aj-weekly-review { margin:10px 14px; padding:10px 12px; background:var(--surface2); border-radius:var(--radius-lg); border-left:3px solid var(--accent); }
.aj-review-text { font-size:12px; color:var(--text-muted); line-height:1.6; margin-top:6px; }
.aj-snap-pill { margin:8px 14px 0; font-size:11px; color:var(--text-faint); padding:5px 10px; background:var(--surface2); border-radius:var(--radius-pill); display:inline-block; }
.aj-ai-notice { margin:8px 14px; padding:8px 12px; font-size:11px; color:var(--text-faint); background:rgba(56,189,248,0.06); border:1px solid rgba(56,189,248,0.15); border-radius:var(--radius-md); }
.aj-empty { padding:24px 14px; font-size:13px; color:var(--text-faint); }
#aj-entries { display:flex; flex-direction:column; }
.aj-entry { padding:10px 14px; border-bottom:1px solid var(--border); }
.aj-entry:last-child { border-bottom:none; }
.aj-entry-head { display:flex; align-items:center; gap:8px; margin-bottom:7px; flex-wrap:wrap; }
.aj-coin { font-weight:700; font-size:13px; }
.aj-side { font-size:10px; font-weight:700; padding:2px 6px; border-radius:3px; }
.aj-side-long  { background:rgba(74,222,128,0.15);  color:#4ade80; }
.aj-side-short { background:rgba(248,113,113,0.15); color:#f87171; }
.aj-pnl { font-size:13px; font-weight:700; }
.aj-hold { font-size:11px; }
.aj-date { font-size:11px; }
.aj-tags { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:6px; }
.aj-tag-btn { padding:2px 9px; font-size:10px; font-weight:700; cursor:pointer; border-radius:4px; border:1px solid; transition:all .12s; }
.aj-tag-btn:hover { opacity:0.85; }
.aj-lesson { font-size:11px; color:var(--text-muted); margin-bottom:5px; font-style:italic; line-height:1.4; }
.aj-note-row { margin-top:3px; }
.aj-note-input { width:100%; background:transparent; border:none; border-bottom:1px solid transparent; color:var(--text-muted); font-size:11px; padding:2px 0; outline:none; transition:border-color .15s; }
.aj-note-input:focus { border-bottom-color:var(--border-strong); }
.aj-note-input::placeholder { color:var(--text-faint); }

/* ── Listing toast ────────────────────────────────────────────────────────── */
.listing-toast { pointer-events:all; background:var(--surface); border:1px solid var(--border-strong); border-radius:var(--radius-lg); padding:11px 14px; min-width:220px; max-width:300px; box-shadow:var(--shadow-md); opacity:0; transform:translateX(20px); transition:opacity 0.3s ease, transform 0.3s ease; }
.listing-toast.listing-toast-in { opacity:1; transform:translateX(0); }

/* ── (arb styles continued above) ────────────────────────────────────────── */
.arb-toolbar { display:flex; align-items:center; gap:10px; padding:8px 14px; border-bottom:1px solid var(--border); flex-shrink:0; flex-wrap:wrap; }
.arb-section { padding:10px 14px 4px; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-faint); flex-shrink:0; }
.arb-table-wrap { overflow:auto; }
.arb-table { width:100%; border-collapse:collapse; font-size:12px; }
.arb-table thead th { position:sticky; top:0; z-index:1; background:var(--surface); padding:7px 10px; font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.5px; border-bottom:1px solid var(--border); white-space:nowrap; }
.arb-table tbody tr { border-bottom:1px solid var(--border); transition:background 0.1s; }
.arb-table tbody tr:hover { background:var(--surface2); }
.arb-table td { padding:6px 10px; white-space:nowrap; }
.arb-table td.num { text-align:right; font-family:var(--mono); font-variant-numeric:tabular-nums; }
.arb-hi { background:rgba(251,191,36,0.07) !important; }
.arb-signal { display:inline-block; padding:1px 7px; border-radius:3px; font-size:10px; font-weight:700; letter-spacing:.04em; }
.arb-earn  { background:rgba(74,222,128,.18); color:var(--green); }
.arb-crowd { background:rgba(248,113,113,.18); color:var(--red); }
.arb-neut  { background:var(--surface2); color:var(--text-muted); }
.arb-long  { background:rgba(74,222,128,.12); color:var(--green); }
.arb-short { background:rgba(248,113,113,.12); color:var(--red); }

/* ── Listing Toast ────────────────────────────────────────────────────────── */
.listing-toast { pointer-events:all; background:var(--surface2); border:1px solid var(--accent); border-radius:var(--radius-lg); padding:10px 14px; min-width:220px; max-width:300px; box-shadow:0 4px 20px rgba(0,0,0,.4); opacity:0; transform:translateX(20px); transition:opacity .3s ease, transform .3s ease; }
.listing-toast-in { opacity:1; transform:translateX(0); }
