/* Market Signal — Design System */

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-panel: #1c2128;
  --bg-hover: #21262d;
  --border: #30363d;
  --border-muted: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-subtle: #656d76;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59,130,246,0.15);
  --green: #3fb950;
  --green-light: rgba(63,185,80,0.15);
  --red: #f85149;
  --red-light: rgba(248,81,73,0.15);
  --yellow: #d29922;
  --yellow-light: rgba(210,153,34,0.15);
  --purple: #bc8cff;
  --purple-light: rgba(188,140,255,0.15);
  --sidebar-width: 220px;
  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.logo-icon { font-size: 20px; color: var(--accent); }
.logo-text { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }

.nav-section { padding: 12px 0; }
.nav-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  padding: 4px 16px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.12s;
  border-left: 2px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--bg-hover); }
.nav-item-sub { padding-left: 32px; font-size: 12.5px; opacity: .85; }
.nav-item.active {
  color: var(--text);
  background: var(--accent-light);
  border-left-color: var(--accent);
}
.nav-icon { font-size: 13px; width: 16px; text-align: center; }

/* ── Main content ───────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}
.page-content { padding: 28px 32px; max-width: 1400px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--text); }
.page-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 2px; }
.header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  text-decoration: none;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--bg-panel); }
.btn-danger { color: var(--red); border-color: var(--red-light); }
.btn-danger:hover { background: var(--red-light); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border); color: var(--text); }
.btn-active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-xl { padding: 14px 28px; font-size: 15px; font-weight: 600; }
.btn-full { width: 100%; justify-content: center; }
.btn-run { padding: 10px 20px; font-size: 14px; font-weight: 600; }

/* ── Cards ──────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-wide { grid-column: span 2; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 { font-size: 14px; font-weight: 600; }
.card-link { color: var(--accent); font-size: 12px; text-decoration: none; }
.card-body { padding: 14px 18px; }

/* ── Stats Row ──────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Dashboard Grid ─────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Markets ────────────────────────────────── */
.market-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-muted);
  gap: 12px;
}
.market-row:last-child { border-bottom: none; }
/* Anchor variant: same row layout, no link colour, hover shows it's clickable */
.market-row-link { text-decoration: none; color: inherit; transition: background 0.12s; }
.market-row-link:hover { background: var(--bg-hover); }
.market-row-link:hover .market-question { color: var(--accent); }
.market-info { flex: 1; min-width: 0; }
/* Truncate visually with ellipsis instead of slicing in Python — keeps the
   full question text in the DOM so the title= tooltip works and screen
   readers get the whole question. */
.market-question { font-size: 13px; color: var(--text); line-height: 1.4;
                   white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.market-meta { display: flex; gap: 6px; margin-top: 4px; align-items: center; }
.prob-display { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.prob-bar { width: 60px; height: 6px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.prob-bar::after { content:''; display:block; height:100%; width: calc(var(--prob) * 100%); background: var(--accent); border-radius: 3px; }
.prob-pct { font-size: 12px; font-weight: 600; color: var(--text); min-width: 32px; text-align: right; }

.relevance-badge {
  font-size: 11px; padding: 1px 6px; border-radius: 10px;
  background: var(--accent-light); color: var(--accent);
  font-weight: 500;
}
.volume-tag { font-size: 11px; color: var(--text-subtle); }
/* Escape-hatch link when a Polymarket/Kalshi slug goes stale between ingests
   and the primary row link 404s. Tiny, muted; uses event.stopPropagation so
   clicking it doesn't also fire the row's anchor click. */
.market-search-fallback {
  font-size: 10px; color: var(--text-muted); text-decoration: none;
  padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border-muted);
  opacity: 0.6; transition: opacity .12s, color .12s;
}
.market-search-fallback:hover { opacity: 1; color: var(--accent); }

/* Markets grid */
.markets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.market-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
}
.market-card:hover { border-color: var(--accent); }
.market-card-header { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.relevance-badge-lg {
  font-size: 12px; padding: 2px 8px; border-radius: 10px;
  background: var(--accent-light); color: var(--accent); font-weight: 600;
}
.category-tag { font-size: 11px; color: var(--text-muted); background: var(--bg-hover); padding: 1px 6px; border-radius: 4px; }
.market-question-full { font-size: 13.5px; line-height: 1.4; margin-bottom: 12px; }
.market-prob-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.prob-bar-wide { flex: 1; height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.prob-fill { height: 100%; background: var(--accent); border-radius: 4px; }
.prob-pct-lg { font-size: 14px; font-weight: 700; min-width: 56px; text-align: right; }
.market-footer { display: flex; gap: 8px; align-items: center; font-size: 12px; flex-wrap: wrap; }
.vol-tag { color: var(--text-muted); }
.end-date { color: var(--text-subtle); }
.market-open-btn { margin-left: auto; }

/* ── Market detail slide-out panel ──────────── */
.market-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 200;
}
.market-overlay.active { display: block; }

.market-detail-panel {
  position: fixed; top: 0; right: -520px; width: 500px; height: 100vh;
  background: var(--bg-card); border-left: 1px solid var(--border);
  padding: 24px; overflow-y: auto; z-index: 201;
  transition: right 0.25s ease; display: flex; flex-direction: column; gap: 16px;
}
.market-detail-panel.active { right: 0; }

.market-detail-panel-header { display: flex; align-items: center; gap: 8px; }
.panel-close-btn {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; padding: 2px 6px;
}
.panel-close-btn:hover { color: var(--text); }

.panel-question { font-size: 16px; line-height: 1.45; font-weight: 600; margin: 0; }

.panel-prob-section { display: flex; flex-direction: column; gap: 6px; }
.panel-prob-bar { height: 10px; background: var(--bg-hover); border-radius: 5px; overflow: hidden; }
.panel-prob-labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.panel-yes-label { color: var(--accent); }
.panel-no-label  { color: var(--text-muted); }

.panel-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-muted); }

.panel-trade-link { text-decoration: none; flex-shrink: 0; }
.panel-trade-note { font-size: 11px; color: var(--text-subtle); line-height: 1.3; }

/* Wallet button — connected state */
.btn.wallet-connected { border-color: var(--green); color: var(--green); }

/* Wallet info dropdown */
.wallet-wrap { position: relative; }
.wallet-info-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 300px; z-index: 200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.wallet-info-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; padding: 4px 0;
}
.wallet-info-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.wallet-info-val {
  font-size: 12px; color: var(--text); text-align: right; word-break: break-all;
}
.wallet-info-val.mono { font-family: monospace; font-size: 11px; }
.wallet-info-divider { border-top: 1px solid var(--border); margin: 10px 0; }
.wallet-info-hint {
  font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px;
}
.wallet-info-hint a { color: var(--accent); text-decoration: none; }
.wallet-info-hint a:hover { text-decoration: underline; }
.wallet-copy-btn {
  width: 100%; text-align: center; margin-bottom: 4px;
  background: var(--accent); color: #fff; border: none;
}
.wallet-copy-btn:hover { opacity: 0.85; }
.wallet-disconnect-btn { width: 100%; text-align: center; }

/* In-panel wallet notice */
.panel-wallet-notice {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 8px;
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.25);
  border-radius: var(--radius); font-size: 12px; color: var(--text-muted);
}
.panel-wallet-notice span { flex: 1; }

.panel-trade-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px; background: var(--bg-hover); border-radius: var(--radius);
}
.btn-yes { background: var(--accent); color: #fff; border: none; }
.btn-yes:hover { opacity: 0.85; }
.btn-no  { background: #ef4444; color: #fff; border: none; }
.btn-no:hover  { opacity: 0.85; }
.trade-amount-input {
  width: 70px; padding: 5px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 13px; margin-left: auto;
}
.trade-amount-label { font-size: 12px; color: var(--text-muted); }

.panel-trade-msg { font-size: 12px; min-height: 16px; }
.panel-trade-msg.success { color: #22c55e; }
.panel-trade-msg.error   { color: #ef4444; }

.panel-section-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.panel-chart-section { flex: 1; }

/* ── Alerts ─────────────────────────────────── */
.alerts-panel {
  background: var(--bg-card);
  border: 1px solid var(--yellow);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 20px;
}
.alerts-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.alerts-header h3 { font-size: 13px; font-weight: 600; color: var(--yellow); margin: 0; }
.alert-question { color: inherit; text-decoration: none; }
.alert-question:hover { text-decoration: underline; }
.alert-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-muted); font-size: 13px;
}
.alert-row:last-child { border-bottom: none; }
.alert-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 10px;
  background: var(--yellow-light); color: var(--yellow);
  font-weight: 500; white-space: nowrap;
}
.alert-detail { flex: 1; }
.alert-meta { color: var(--text-muted); margin-left: 8px; }

/* ── Tweets ─────────────────────────────────── */
.tweet-list { display: flex; flex-direction: column; gap: 4px; }
.tweet-row { padding: 8px 0; border-bottom: 1px solid var(--border-muted); }
.tweet-row:last-child { border-bottom: none; }
/* Anchor variant of .tweet-row: same row layout, no link colour, hover surfaces
   that it's clickable. Mirrors .market-row-link in the Top Markets card. */
.tweet-row-link { display: block; text-decoration: none; color: inherit;
                  transition: background 0.12s; padding-left: 8px; padding-right: 8px;
                  margin-left: -8px; margin-right: -8px; border-radius: 4px; }
.tweet-row-link:hover { background: var(--bg-hover); }
.tweet-row-link:hover .tweet-handle { text-decoration: underline; }
.tweet-handle { font-size: 12px; font-weight: 600; color: var(--accent); }
/* Visual truncation to 3 lines so long tweets don't break the layout. Full
   text is in the DOM (good for hover tooltip + accessibility). */
.tweet-text { font-size: 13px; color: var(--text-muted); margin: 2px 0; line-height: 1.4;
              display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
              overflow: hidden; }
.tweet-dims { display: flex; gap: 4px; }
.dim-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 4px;
  font-weight: 600; font-family: monospace;
}
.dim-tag.fund { background: var(--green-light); color: var(--green); }
.dim-tag.macro { background: var(--accent-light); color: var(--accent); }
.dim-tag.tech { background: var(--purple-light); color: var(--purple); }

/* Tweet feed (full) */
.tweet-feed { display: flex; flex-direction: column; gap: 10px; max-height: 800px; overflow-y: auto; padding-right: 4px; }
.tweet-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.tweet-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.tweet-handle { font-weight: 600; color: var(--accent); font-size: 13px; }
.tweet-date { color: var(--text-subtle); font-size: 11px; margin-left: auto; }
.tweet-text { font-size: 13px; line-height: 1.5; color: var(--text); margin-bottom: 8px; }
.tweet-footer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.native-likes { color: var(--yellow); }

/* ── Filters ────────────────────────────────── */
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.filter-input {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px; color: var(--text); font-size: 13px;
  max-width: 320px;
}
.filter-input::placeholder { color: var(--text-subtle); }
.filter-input:focus { outline: none; border-color: var(--accent); }
.filter-select {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 10px; color: var(--text); font-size: 13px;
}

/* ── Two column layout ──────────────────────── */
.two-col-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-wide { }
.panel-title { font-size: 14px; font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }

/* ── Accounts ───────────────────────────────── */
.account-list { padding: 8px; max-height: 600px; overflow-y: auto; }
.account-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px;
  border-bottom: 1px solid var(--border-muted); border-radius: var(--radius-sm);
}
.account-row:last-child { border-bottom: none; }
.account-info { flex: 1; min-width: 0; }
.account-handle { font-size: 13px; font-weight: 600; color: var(--text); }
.verified-badge { color: var(--accent); margin-left: 4px; font-size: 11px; }
.account-bio { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-meta { display: flex; gap: 8px; margin-top: 3px; font-size: 11px; color: var(--text-subtle); flex-wrap: wrap; }
.account-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 32px; height: 18px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top:0;left:0;right:0;bottom:0;
  background: var(--bg-hover); border-radius: 18px; transition: 0.2s;
  border: 1px solid var(--border);
}
.toggle-slider::before {
  content:''; position:absolute; height:12px; width:12px; left:2px; bottom:2px;
  background: var(--text-muted); border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-slider::before { transform: translateX(14px); background: #fff; }

.dim-filter { display: flex; gap: 4px; }
.dim-btn { background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px; color: var(--text-muted); cursor: pointer; }
.dim-btn.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }

/* ── Clusters ───────────────────────────────── */
.clusters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.cluster-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.cluster-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cluster-size { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.macro-score { font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.macro-score.high { background: var(--accent-light); color: var(--accent); }
.macro-score.med { background: var(--yellow-light); color: var(--yellow); }
.macro-score.low { background: var(--bg-hover); color: var(--text-muted); }
.market-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.market-pill {
  font-size: 11px; background: var(--accent-light); color: var(--accent);
  border: 1px solid rgba(59,130,246,0.3); border-radius: 4px;
  padding: 3px 8px; cursor: pointer;
}
.market-pill strong { margin-left: 4px; }
.cluster-tweets { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cluster-tweet { padding: 8px; background: var(--bg-hover); border-radius: var(--radius-sm); }
.ct-handle { font-size: 12px; font-weight: 600; color: var(--accent); margin-right: 6px; }
.ct-text { font-size: 12px; color: var(--text-muted); }
.cluster-actions { display: flex; gap: 6px; }

/* ── Podcasts ───────────────────────────────── */
.source-list { padding: 8px; }
.source-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--border-muted);
              border-left: 3px solid transparent; transition: background 0.12s, border-color 0.12s; }
.source-row:last-child { border-bottom: none; }
/* Active = the source currently driving the episode-list filter. */
.source-row-active { background: var(--bg-hover); border-left-color: var(--accent); }
.source-row-active .source-name { color: var(--accent); }
.source-info { flex: 1; min-width: 0; }
/* Anchor variant of source-info — the whole left section is the click target
   for the filter; the Refresh / × buttons sit outside the anchor. */
.source-info-link { text-decoration: none; color: inherit; display: block;
                    padding: 2px 4px; margin: -2px -4px; border-radius: 4px; }
.source-info-link:hover .source-name { color: var(--accent); }
/* Helper links: subtitle "← all sources" + panel-title "Show all" */
.subtitle-link { color: var(--accent); text-decoration: none; font-size: 0.95em; }
.subtitle-link:hover { text-decoration: underline; }
.source-clear-link { float: right; font-size: 12px; font-weight: 500;
                     color: var(--accent); text-decoration: none; }
.source-clear-link:hover { text-decoration: underline; }
.source-name { font-size: 13px; font-weight: 600; }
.source-meta { display: flex; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.platform-tag { background: var(--bg-hover); padding: 1px 6px; border-radius: 4px; }
.source-actions { display: flex; gap: 6px; flex-shrink: 0; }

.episode-list { padding: 8px; max-height: 700px; overflow-y: auto; }
.episode-row { padding: 12px 8px; border-bottom: 1px solid var(--border-muted); }
.episode-row:last-child { border-bottom: none; }
.ep-info { margin-bottom: 8px; }
.ep-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.ep-meta { display: flex; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.source-name-tag { background: var(--bg-hover); padding: 1px 6px; border-radius: 4px; }
.status-badge { padding: 1px 6px; border-radius: 4px; font-size: 11px; background: var(--bg-hover); color: var(--text-subtle); }
.status-badge.transcribed { background: var(--green-light); color: var(--green); }
.ep-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.synopsis-panel { margin-top: 10px; background: var(--bg-hover); border-radius: var(--radius-sm); padding: 12px; }
.synopsis-content { font-size: 13px; line-height: 1.6; color: var(--text-muted); white-space: pre-wrap; }
.synopsis-stream { font-size: 13px; line-height: 1.6; color: var(--text-muted); white-space: pre-wrap; }
.transcript-content { max-height: 60vh; overflow-y: auto; font-size: 13px; line-height: 1.7; white-space: pre-wrap; color: var(--text-muted); padding: 8px; }

/* ── Substack ───────────────────────────────── */
.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-row { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.feed-info { flex: 1; }
.feed-name { font-size: 14px; font-weight: 600; }
.feed-url { font-size: 11px; color: var(--text-muted); margin: 2px 0; word-break: break-all; }
.feed-meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-subtle); margin-top: 4px; flex-wrap: wrap; }
.feed-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── Synthesize ─────────────────────────────── */
.synth-layout { display: grid; grid-template-columns: 1fr 280px; gap: 20px; }
.synth-input-area { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.synth-textarea { width: 100%; background: transparent; border: none; color: var(--text); font-size: 14px; line-height: 1.6; resize: vertical; font-family: inherit; outline: none; min-height: 100px; }
.synth-textarea::placeholder { color: var(--text-subtle); }
.synth-controls { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); gap: 12px; }
.mode-selector { display: flex; align-items: center; gap: 8px; }
.mode-label { font-size: 12px; color: var(--text-muted); }
.synth-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.synth-output-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.synth-output-content h1, .synth-output-content h2, .synth-output-content h3 { margin: 16px 0 8px; color: var(--text); }
.synth-output-content strong { color: var(--text); font-weight: 600; }
.synth-output-content code { background: var(--bg-hover); padding: 1px 5px; border-radius: 3px; font-family: monospace; }
.source-cite { background: var(--accent-light); color: var(--accent); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.typing-indicator { color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.synth-sidebar { }
.recent-queries { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; margin-bottom: 20px; }
.recent-query-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; cursor: pointer; transition: border-color 0.12s; }
.recent-query-item:hover { border-color: var(--accent); }
.rq-query { font-size: 12px; color: var(--text); line-height: 1.4; }
.rq-meta { display: flex; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--text-muted); }
.mode-badge { background: var(--bg-hover); padding: 1px 5px; border-radius: 3px; }
.quick-prompts { }
.quick-prompts h3 { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--text-muted); }
.quick-prompt-btn { display: block; width: 100%; text-align: left; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; color: var(--text-muted); cursor: pointer; margin-bottom: 6px; transition: all 0.12s; }
.quick-prompt-btn:hover { border-color: var(--accent); color: var(--text); background: var(--accent-light); }

/* ── Research ───────────────────────────────── */
.research-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 16px; margin-bottom: 32px; }
.tool-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: flex-start; gap: 16px; }
.tool-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.tool-info { flex: 1; }
.tool-info h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.tool-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.tool-stages { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.stage-chip { font-size: 11px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; color: var(--text-muted); }
.stage-chip.checkpoint { background: var(--yellow-light); border-color: var(--yellow); color: var(--yellow); }
.research-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-muted); gap: 10px; }
.research-row:last-child { border-bottom: none; }
.research-info { flex: 1; }
.research-subject { font-size: 13px; font-weight: 500; }
.research-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rtype-badge { background: var(--bg-hover); padding: 1px 6px; border-radius: 4px; font-size: 11px; color: var(--text-muted); }
.sessions-section { margin-top: 24px; }
.sessions-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.sessions-table { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-header { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr 80px; padding: 10px 16px; background: var(--bg-hover); font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.table-row { display: grid; grid-template-columns: 2fr 1fr 1.5fr 1fr 80px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: center; font-size: 13px; }
.table-row:hover { background: var(--bg-hover); }
.sess-subject { font-weight: 500; }
.sess-date { color: var(--text-muted); font-size: 12px; }
.sess-progress { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.progress-bar-sm { width: 60px; height: 5px; background: var(--bg-hover); border-radius: 3px; overflow: hidden; }
.progress-fill-sm { height: 100%; background: var(--accent); border-radius: 3px; }

/* New session form */
.new-session-form { max-width: 780px; }
.form-group { margin-bottom: 24px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text); font-size: 14px; font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--accent); }
.form-input-lg { font-size: 16px; padding: 12px 16px; }
.depth-selector { display: flex; gap: 8px; }
.depth-btn { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 18px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.depth-btn.active { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.stage-overview { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stage-preview { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-hover); border: 1px solid var(--border); }
.stage-preview.is-checkpoint { border-color: var(--yellow); background: var(--yellow-light); }
.stage-num { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--bg-panel); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stage-name { font-size: 12px; color: var(--text); }
.checkpoint-label { font-size: 10px; color: var(--yellow); }
.stage-arrow { color: var(--text-subtle); font-size: 14px; }

/* Session view */
.session-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.session-sidebar { position: sticky; top: 28px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.session-meta { margin: 12px 0 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.session-type { font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-subtle); font-weight: 600; }
.session-subject { font-size: 14px; font-weight: 700; margin-top: 4px; line-height: 1.3; }
.session-depth { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.stage-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.stage-nav-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); border-left: 2px solid transparent; }
.stage-nav-item.completed { color: var(--text-muted); border-left-color: var(--green); }
.stage-nav-item.next { color: var(--accent); background: var(--accent-light); border-left-color: var(--accent); }
.stage-nav-item.checkpoint .cp-dot { color: var(--yellow); font-size: 8px; }
.stage-nav-num { font-size: 11px; font-weight: 700; color: var(--text-subtle); width: 16px; flex-shrink: 0; }
.stage-nav-name { font-size: 12px; flex: 1; line-height: 1.3; }
.cost-widget { background: var(--bg-hover); border-radius: var(--radius-sm); padding: 10px; text-align: center; margin-bottom: 12px; }
.cost-label { font-size: 11px; color: var(--text-subtle); text-transform: uppercase; }
.cost-value { font-size: 18px; font-weight: 700; color: var(--text); }
.cost-tokens { font-size: 11px; color: var(--text-muted); }

.stage-output-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.stage-output-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--bg-hover); border-bottom: 1px solid var(--border); }
.stage-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.stage-output-body { padding: 16px; }
.research-output { font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; color: var(--text); }
.checkpoint-panel { padding: 16px; border-top: 1px solid var(--border); background: var(--yellow-light); }
.checkpoint-panel h4 { font-size: 13px; font-weight: 600; color: var(--yellow); margin-bottom: 4px; }
.checkpoint-panel p { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.feedback-textarea { width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; color: var(--text); font-size: 13px; font-family: inherit; resize: vertical; min-height: 80px; }
.checkpoint-actions { display: flex; gap: 8px; margin-top: 10px; }
.checkpoint-warning { background: var(--yellow-light); border: 1px solid var(--yellow); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; color: var(--yellow); margin-bottom: 12px; }
.stage-run-card { background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 20px; }
.stage-run-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.checkpoint-indicator { font-size: 11px; color: var(--yellow); background: var(--yellow-light); padding: 2px 8px; border-radius: 4px; }
.stage-run-controls { display: flex; align-items: center; gap: 12px; }
.stage-stream { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.stream-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--text-muted); }
.spinner { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.stream-output { font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; color: var(--text); max-height: 600px; overflow-y: auto; }
.complete-banner { background: var(--green-light); border: 1px solid var(--green); border-radius: var(--radius); padding: 28px; text-align: center; }
.complete-banner h2 { color: var(--green); margin-bottom: 8px; }
.complete-banner p { color: var(--text-muted); margin-bottom: 16px; }

/* ── Modals ─────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 440px; max-width: 90vw; }
.modal-wide { width: 680px; }
.modal-box h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.modal-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.resolve-result { background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; word-break: break-all; }
.form-row { display: flex; align-items: center; gap: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.toggle-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }

/* ── Misc ───────────────────────────────────── */
.back-link { font-size: 13px; color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 8px; }
.back-link:hover { color: var(--accent); }
.empty-state { color: var(--text-subtle); font-size: 13px; padding: 16px 0; text-align: center; }
.empty-state a { color: var(--accent); text-decoration: none; }
.empty-state-full { text-align: center; padding: 60px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); }
.empty-state-full p { margin-bottom: 12px; }
.status-bar { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; font-size: 13px; color: var(--text); z-index: 2000; pointer-events: none; opacity: 0; transition: opacity 0.2s; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.toast.show { opacity: 1; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 480px; background: var(--bg-card); border-left: 1px solid var(--border); z-index: 500; overflow: hidden; }
.drawer-content { height: 100%; display: flex; flex-direction: column; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid var(--border); }
.synth-output { flex: 1; padding: 16px; overflow-y: auto; white-space: pre-wrap; font-size: 13px; line-height: 1.6; }
.error { color: var(--red); }

/* ── Markets page: focus & meta ─────────────── */
.markets-meta-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.focus-dropdown-wrap { position: relative; }
.focus-badge { display: inline-flex; align-items: center; gap: 5px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: border-color 0.15s, color 0.15s; user-select: none; }
.focus-badge:hover { border-color: var(--accent); color: var(--text); }
.focus-edit-hint { font-size: 10px; opacity: 0.5; }
.last-updated-tag { font-size: 12px; color: var(--text-subtle); }
.focus-dropdown { position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.4); z-index: 300; overflow: hidden; }
.focus-dropdown-item { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-size: 13px; color: var(--text-muted); cursor: pointer; transition: background 0.1s; text-decoration: none; }
.focus-dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.focus-dropdown-active { color: var(--text); }
.focus-check { color: var(--accent); font-size: 12px; }
.focus-dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.focus-dropdown-manage { font-size: 12px; color: var(--text-subtle); }
.focus-dropdown-manage:hover { color: var(--accent); }
/* shared focus editor fields */
.focus-field { display: flex; flex-direction: column; gap: 4px; }
.focus-field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.tier-hint { font-weight: 400; opacity: 0.7; margin-left: 6px; }
.focus-textarea { background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 12px; padding: 6px 8px; resize: vertical; font-family: inherit; line-height: 1.5; width: 100%; box-sizing: border-box; }
.focus-textarea:focus { outline: none; border-color: var(--accent); }
/* ── Admin Configuration page ───────────────── */
.config-section { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.config-section-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.config-section-header h3 { margin: 0 0 4px; font-size: 15px; }
.config-section-desc { margin: 0; font-size: 13px; color: var(--text-muted); }
.preset-list { display: flex; flex-direction: column; }
.preset-card { padding: 16px 20px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.preset-card:last-child { border-bottom: none; }
.preset-card.preset-active { background: rgba(59,130,246,0.04); }
.preset-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.preset-name { font-size: 14px; font-weight: 600; color: var(--text); margin-right: 8px; }
.preset-builtin-tag { font-size: 10px; background: var(--bg-hover); color: var(--text-subtle); border-radius: 4px; padding: 1px 5px; }
.preset-active-tag { font-size: 10px; background: rgba(59,130,246,0.15); color: var(--accent); border-radius: 4px; padding: 1px 5px; margin-left: 6px; }
.preset-active-indicator { font-size: 12px; color: var(--accent); }
.preset-actions { display: flex; align-items: center; gap: 6px; }
.preset-desc { font-size: 12px; color: var(--text-muted); margin: 0; }
.preset-tiers { display: flex; flex-direction: column; gap: 4px; }
.preset-tier { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; }
.tier-label { flex-shrink: 0; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-top: 1px; }
.tier-label.tier-1 { background: rgba(239,68,68,0.15); color: #f87171; }
.tier-label.tier-2 { background: rgba(249,115,22,0.15); color: #fb923c; }
.tier-label.tier-3 { background: rgba(234,179,8,0.15); color: #facc15; }
.tier-keywords { color: var(--text-muted); line-height: 1.4; }
.btn-danger { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }
.btn-danger:hover { background: rgba(239,68,68,0.2); }
/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 400; }
.modal-panel { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); width: min(600px, 95vw); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); z-index: 500; flex-direction: column; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ── Portfolio ───────────────────────────────── */

/* Demo mode */
.demo-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; margin-bottom: 16px;
  background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.3);
  border-radius: var(--radius); font-size: 12px; color: var(--yellow);
}
.btn.demo-active {
  border-color: var(--yellow); color: var(--yellow);
}

.wallet-config-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.wallet-config-label { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.wallet-input {
  flex: 1; min-width: 260px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); font-size: 13px;
  font-family: monospace;
}
.wallet-save-msg { font-size: 12px; }
.wallet-config-hint { font-size: 12px; color: var(--yellow); margin-left: auto; }
.wallet-config-hint a { color: var(--yellow); }

.analysis-panel {
  background: var(--bg-card); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 20px; margin-bottom: 24px;
}
.analysis-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.analysis-label { font-size: 13px; font-weight: 600; color: var(--accent); }
.analysis-text { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.analysis-text p { margin-bottom: 10px; }
.analysis-text p:last-child { margin-bottom: 0; }

.portfolio-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.portfolio-section-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.portfolio-section-title {
  font-size: 14px; font-weight: 600; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.venue-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.hl-dot   { background: #22d3ee; }
.poly-dot { background: #6366f1; }

.account-summary {
  display: flex; gap: 6px; align-items: center;
  margin-left: auto; font-size: 12px;
}
.acc-stat { display: flex; flex-direction: column; align-items: flex-end; }
.acc-label { color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.acc-val   { font-weight: 600; font-size: 13px; }
.acc-divider { color: var(--border); margin: 0 4px; }

.poly-wallet-tag {
  font-size: 11px; color: var(--text-subtle); font-family: monospace;
  background: var(--bg-hover); padding: 2px 8px; border-radius: 10px;
  margin-left: auto;
}

.portfolio-loading { color: var(--text-muted); font-size: 13px; padding: 16px 0; }
.portfolio-empty   { color: var(--text-subtle); font-size: 13px; padding: 12px 0; }

.positions-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.positions-table th {
  text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.positions-table td {
  padding: 10px 10px; border-bottom: 1px solid var(--border-muted);
  vertical-align: middle;
}
.positions-table tr:last-child td { border-bottom: none; }
.positions-table tr:hover td { background: var(--bg-hover); }

.poly-question-cell { max-width: 280px; line-height: 1.35; }

.side-badge {
  font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600;
}
.side-long  { background: rgba(59,130,246,0.15); color: #60a5fa; }
.side-short { background: rgba(239,68,68,0.15);  color: #f87171; }

.pnl-pos  { color: #22c55e; font-weight: 600; }
.pnl-neg  { color: #ef4444; font-weight: 600; }
.roe-tag  { font-size: 11px; opacity: 0.8; margin-left: 4px; }
.lev-type { font-size: 11px; color: var(--text-muted); }
