:root {
  --bg: #0b0d10;
  --panel: #111418;
  --panel-2: #161a20;
  --border: #1f242c;
  --text: #e6e8eb;
  --muted: #8a93a0;
  --accent: #6aa9ff;
  --up: #2ecc71;
  --down: #ff5d5d;
  --warn: #f6b94b;
  --chip-bg: #1a1f27;
  --chip-bg-hover: #222936;
  --chip-active: #2d6cdf;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand .subtitle {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s;
}

.dot.ok { background: var(--up); box-shadow: 0 0 8px rgba(46,204,113,0.5); }
.dot.err { background: var(--down); }
.dot.loading { background: var(--warn); }

.btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--chip-bg-hover); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }

.watchlist-bar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  overflow-x: auto;
}

.watchlist-tabs {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.watchlist-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.watchlist-tab:hover { background: var(--chip-bg-hover); color: var(--text); }
.watchlist-tab.active {
  background: var(--chip-active);
  border-color: var(--chip-active);
  color: white;
}

.watchlist-desc {
  font-size: 12px;
  color: var(--muted);
  margin-right: 12px;
  max-width: 500px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  min-height: 48px;
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chip {
  background: var(--chip-bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chip:hover { background: var(--chip-bg-hover); }
.chip.chip-back { color: var(--accent); margin-right: 6px; }
.chip.active {
  background: var(--chip-active);
  border-color: var(--chip-active);
  color: white;
}

.auto {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

main {
  padding: 16px 24px 32px;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
  background: var(--bg);
  white-space: nowrap;
}

thead th:hover {
  color: var(--text);
}

thead th.num { text-align: right; }
thead th:hover { color: var(--text); }
thead th .arrow { display: inline-block; width: 10px; margin-left: 4px; opacity: 0.7; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:hover { background: var(--panel); }

tbody td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

tbody td.num { text-align: right; }

td.metric-good { color: var(--up); }
td.metric-warn { color: var(--warn); }
td.metric-bad  { color: var(--down); }

.ticker {
  font-weight: 600;
  color: var(--accent);
  font-family: "SF Mono", Menlo, monospace;
  font-size: 13px;
}

.company {
  display: block;
  font-weight: 500;
}

.verdict {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

.verdict b {
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  font-size: 11px;
}

.verdict-hardbuy b  { background: rgba(46,204,113,0.25); color: #4be08a; }
.verdict-buy b      { background: rgba(108,193,255,0.20); color: #93c5fd; }
.verdict-neutral b  { background: rgba(138,147,160,0.20); color: #c0c8d2; }
.verdict-caution b  { background: rgba(246,185,75,0.20);  color: #ffce5a; }
.verdict-avoid b    { background: rgba(255,93,93,0.22);   color: #ff8585; }

.verdict-hardbuy { color: #d3f0dc; }
.verdict-buy     { color: #d4e3f4; }
.verdict-neutral { color: #b8bfc8; }
.verdict-caution { color: #e5cf99; }
.verdict-avoid   { color: #e8b8b8; }

.short-read {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

.price { font-weight: 600; }

.delta-up { color: var(--up); }
.delta-down { color: var(--down); }
.delta-flat { color: var(--muted); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  min-width: 28px;
  text-align: center;
}

.badge.f-strong { background: rgba(46,204,113,0.15); color: var(--up); }
.badge.f-mid    { background: rgba(246,185,75,0.15); color: var(--warn); }
.badge.f-weak   { background: rgba(255,93,93,0.15); color: var(--down); }

.badge.s-6 { background: rgba(46,204,113,0.18); color: var(--up); }
.badge.s-5 { background: rgba(108,193,255,0.15); color: var(--accent); }
.badge.s-4 { background: rgba(246,185,75,0.15); color: var(--warn); }
.badge.s-3, .badge.s-2, .badge.s-1, .badge.s-0 { background: rgba(255,93,93,0.12); color: var(--down); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  background: var(--panel);
}

.muted { color: var(--muted); }

@keyframes flash-up   { 0% { background: rgba(46,204,113,0.25); } 100% { background: transparent; } }
@keyframes flash-down { 0% { background: rgba(255,93,93,0.25); }  100% { background: transparent; } }

td.flash-up   { animation: flash-up   0.8s ease-out; }
td.flash-down { animation: flash-down 0.8s ease-out; }

#custom-tooltip {
  position: fixed;
  background: #0f1318;
  border: 1px solid #2c3340;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  /* max-content: without it, a tooltip anchored near the right viewport edge
     shrink-wraps to the sliver of space before the clamp repositions it,
     wrapping one word per line. */
  width: max-content;
  max-width: 400px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 0);
  transition: opacity 0.1s;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  line-height: 1.45;
  white-space: normal;
}

#custom-tooltip.visible { opacity: 1; }

/* --- Analyst consensus badge (table cell) --- */
.badge.an { font-size: 11px; padding: 2px 8px; min-width: 0; white-space: nowrap; }
.badge.rm-up   { background: rgba(46,204,113,0.15); color: var(--up); font-size: 11px; padding: 2px 8px; min-width: 0; white-space: nowrap; }
.badge.rm-flat { background: rgba(138,147,160,0.18); color: #c0c8d2; font-size: 11px; padding: 2px 8px; min-width: 0; white-space: nowrap; }
.badge.rm-down { background: rgba(255,93,93,0.15); color: var(--down); font-size: 11px; padding: 2px 8px; min-width: 0; white-space: nowrap; }
.an-strongbuy  { background: rgba(46,204,113,0.20); color: #4be08a; }
.an-buy        { background: rgba(46,204,113,0.12); color: #7ddca3; }
.an-hold       { background: rgba(138,147,160,0.18); color: #c0c8d2; }
.an-sell       { background: rgba(246,185,75,0.18); color: #ffce5a; }
.an-strongsell { background: rgba(255,93,93,0.20); color: #ff8585; }

/* --- Expand chevron --- */
.detail-th { width: 34px; cursor: default; }
td.detail-cell { text-align: center; padding: 8px 6px; }
.expand-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s, color 0.15s, border-color 0.15s, background 0.15s;
}
.expand-btn:hover { color: var(--text); border-color: var(--accent); background: var(--chip-bg-hover); }
.expand-btn.open { transform: rotate(90deg); color: var(--accent); border-color: var(--accent); }
tbody tr.row-open { background: var(--panel-2); }
tbody tr.row-open td { border-bottom-color: transparent; }

tbody tr.clickable { cursor: pointer; }

/* --- Decision hero (top of panel) --- */
.detail-hero {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--panel);
  margin-bottom: 4px;
}
.detail-hero.verdict-hardbuy { border-left-color: #4be08a; }
.detail-hero.verdict-buy     { border-left-color: #93c5fd; }
.detail-hero.verdict-neutral { border-left-color: #c0c8d2; }
.detail-hero.verdict-caution { border-left-color: #ffce5a; }
.detail-hero.verdict-avoid   { border-left-color: #ff8585; }

.hero-decision { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.hero-label {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1;
}
.verdict-hardbuy .hero-label { color: #4be08a; }
.verdict-buy .hero-label     { color: #93c5fd; }
.verdict-neutral .hero-label { color: #c0c8d2; }
.verdict-caution .hero-label { color: #ffce5a; }
.verdict-avoid .hero-label   { color: #ff8585; }
.hero-score { font-size: 12px; color: var(--muted); font-weight: 600; }

.hero-values { display: flex; gap: 22px; flex-wrap: wrap; }
.hv { display: flex; flex-direction: column; gap: 3px; }
.hv-k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.hv-k i { font-style: normal; cursor: help; opacity: 0.6; }
.hv-v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hv-v.delta-up { color: var(--up); }
.hv-v.delta-down { color: var(--down); }

.hero-why { flex: 1; min-width: 200px; font-size: 12px; color: var(--text); line-height: 1.5; opacity: 0.9; }

/* --- Detail panel --- */
.detail-row td { padding: 0; background: var(--panel-2); }
.detail-row:hover { background: var(--panel-2); }
.detail-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px 24px;
  align-items: start;
  padding: 18px 22px 22px;
  /* The panel lives inside the horizontally-scrolling table, so without this it
     inherits the table's full scroll width and runs its columns off-screen.
     Sticky keeps it readable while the table scrolls sideways underneath. */
  position: sticky;
  left: 0;
  max-width: calc(100vw - 24px);
  /* The panel sits inside a table cell that sets nowrap; without resetting it
     prose in the sections runs straight across the neighbouring columns. */
  white-space: normal;
  border-bottom: 2px solid var(--accent);
  background: linear-gradient(180deg, rgba(108,193,255,0.04), transparent 60%);
}
.detail-section h4 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.detail-section { min-width: 0; overflow-wrap: break-word; }
.detail-empty { color: var(--muted); font-size: 12px; margin: 4px 0 0; font-style: italic; }
.detail-note { color: var(--muted); font-size: 12px; margin-top: 8px; }
.detail-note b { color: var(--text); font-weight: 600; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px 14px;
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.stat-val { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-val.metric-good { color: var(--up); }
.stat-val.metric-warn { color: var(--warn); }
.stat-val.metric-bad  { color: var(--down); }

/* --- Pills in section headers --- */
.pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  text-transform: none;
  letter-spacing: 0.01em;
}
.pill-sub { font-size: 11px; font-weight: 500; color: var(--muted); text-transform: none; letter-spacing: normal; }

/* --- Analyst consensus bar --- */
.an-bar {
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border);
  gap: 1px;
}
.an-seg { display: block; min-width: 2px; }
.seg-strongBuy  { background: #21a85a; }
.seg-buy        { background: #57c98a; }
.seg-hold       { background: #8a93a0; }
.seg-sell       { background: #f6b94b; }
.seg-strongSell { background: #ff5d5d; }
.an-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 10px;
  font-size: 11px;
  color: var(--muted);
}
.an-key { display: inline-flex; align-items: center; gap: 5px; }
.an-key b { color: var(--text); font-weight: 600; }
.an-key i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.dot-strongBuy  { background: #21a85a; }
.dot-buy        { background: #57c98a; }
.dot-hold       { background: #8a93a0; }
.dot-sell       { background: #f6b94b; }
.dot-strongSell { background: #ff5d5d; }

/* --- Earnings track record chips --- */
.eps-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.eps-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.eps-chip.beat { background: rgba(46,204,113,0.15); color: #4be08a; }
.eps-chip.miss { background: rgba(255,93,93,0.15); color: #ff8585; }
.eps-chip.flat { background: var(--chip-bg); color: var(--muted); }

/* --- Portfolio view --- */
.watchlist-tab.pf-tab {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.watchlist-tab.pf-tab.active { background: var(--accent); border-color: var(--accent); color: #06121f; }

.pf-loading, .pf-error {
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}
.pf-error h3 { color: var(--text); margin: 0 0 8px; }
.pf-error p { max-width: 520px; margin: 0 auto; line-height: 1.5; }

.pf-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.pf-card {
  flex: 1;
  min-width: 150px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pf-card.sub { flex: 0 0 auto; min-width: 90px; }
.pf-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.pf-v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pf-v small { font-size: 13px; font-weight: 600; margin-left: 4px; }
.pf-v.delta-up { color: var(--up); }
.pf-v.delta-down { color: var(--down); }

.pf-table td:first-child { min-width: 200px; }
.pf-table .company { font-weight: 500; font-size: 12px; color: var(--text); }
.pf-table .verdict { margin-top: 3px; }

/* Keep the ticker column pinned while scrolling the wide analytics table. */
.pf-table th:first-child,
.pf-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel);
}
.pf-table thead th:first-child { z-index: 3; background: var(--bg); }
.pf-table tbody tr.row-open td:first-child { background: var(--panel-2); }
.pf-table tbody tr:hover td:first-child { background: var(--panel); }

/* --- Feed view --- */
.feed-view, .radar-view { padding: 18px 24px; }
.panel-chips { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-src { color: var(--muted); font-size: 12px; margin: 0; }
.panel-chips .panel-src { margin-left: auto; }

.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.news-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.news-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.news-src { font-weight: 600; }
.news-ticker {
  background: rgba(106,169,255,0.12);
  color: var(--accent);
  border-radius: 5px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 11px;
}
.news-headline { color: var(--text); font-weight: 600; font-size: 13.5px; line-height: 1.35; text-decoration: none; }
.news-headline:hover { color: var(--accent); }
.news-summary {
  color: var(--muted); font-size: 12px; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Radar view --- */
.radar-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1200px) { .radar-grid { grid-template-columns: 1fr; } }
.radar-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.radar-col h2 { margin: 0 0 4px; font-size: 15px; }
.radar-col .panel-src { display: block; margin-bottom: 12px; line-height: 1.4; }
.radar-row { padding: 9px 0; border-top: 1px solid var(--border); }
.radar-row.slim { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.radar-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.radar-rank { color: var(--muted); font-size: 11px; min-width: 18px; font-variant-numeric: tabular-nums; }
.radar-ticker { font-weight: 700; color: var(--accent); min-width: 48px; }
.radar-name { color: var(--muted); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-price { font-variant-numeric: tabular-nums; font-weight: 600; }
.radar-upside { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12px; }
.radar-warming { color: var(--muted); font-size: 11px; font-style: italic; }
.radar-mentions { color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; }
.radar-why { color: var(--muted); font-size: 12px; line-height: 1.45; margin-top: 4px; padding-left: 26px; }

/* --- Load progress bar --- */
.load-progress { height: 2px; background: transparent; }
.load-progress > div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #8fc4ff);
  transition: width 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}
.load-progress > div.active { opacity: 1; }

/* --- Influencers view --- */
.influencers-view { padding: 18px 24px; }
.inf-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1250px) { .inf-layout { grid-template-columns: 1fr; } }

.cons-col { position: sticky; top: 12px; }
.cons-row { padding: 10px 0; border-top: 1px solid var(--border); }
.cons-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cons-voices { color: var(--warn); font-size: 11px; font-weight: 600; white-space: nowrap; }
.cons-bar {
  height: 4px; border-radius: 3px; margin: 7px 0 6px;
  background: rgba(255,93,93,0.35); overflow: hidden;
}
.cons-bar.neutral { background: var(--chip-bg); }
.cons-bull { height: 100%; background: var(--up); border-radius: 3px; }
.cons-videos { display: flex; flex-direction: column; gap: 3px; }
.cons-videos a {
  color: var(--muted); font-size: 11.5px; text-decoration: none; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cons-videos a:hover { color: var(--text); }
.cons-videos b { color: var(--text); font-weight: 600; }

.inf-people { display: flex; flex-direction: column; gap: 14px; }
.inf-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.inf-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.inf-name { font-size: 15px; font-weight: 700; color: var(--text); text-decoration: none; }
.inf-name:hover { color: var(--accent); }
.inf-style { color: var(--accent); font-size: 11.5px; }
.inf-latest { color: var(--muted); font-size: 11px; margin-left: auto; }
.inf-note { color: var(--muted); font-size: 11.5px; line-height: 1.45; margin: 5px 0 10px; }
.inf-error {
  color: var(--warn); font-size: 12px; background: rgba(246,185,75,0.1);
  border-radius: 6px; padding: 6px 10px; margin-bottom: 8px;
}
.inf-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.inf-video {
  display: block; text-decoration: none; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
.inf-video:hover { border-color: var(--accent); }
.inf-vtop { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.inf-date, .inf-views { color: var(--muted); font-size: 10.5px; }
.inf-views { margin-left: auto; }
.inf-title { color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.inf-tickers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.inf-tick {
  font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 6px;
  background: rgba(106,169,255,0.14); color: var(--accent);
}
.inf-tick.c-medium { background: rgba(106,169,255,0.09); }
.inf-tick.c-low { background: var(--chip-bg); color: var(--muted); }

.lean { font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.lean-bull { background: rgba(46,204,113,0.16); color: var(--up); }
.lean-bear { background: rgba(255,93,93,0.16); color: var(--down); }
.lean-mixed { background: rgba(246,185,75,0.16); color: var(--warn); }
.lean-neutral { background: var(--chip-bg); color: var(--muted); }

.inf-disclaimer {
  color: var(--muted); font-size: 11px; line-height: 1.5;
  margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--border);
}
.mech-note {
  color: var(--muted); font-size: 10.5px; line-height: 1.5;
  margin: 10px 0 0; opacity: 0.85;
}
.mech-note a { color: var(--muted); text-decoration: underline; }
.mech-note a:hover { color: var(--accent); }
.row-unsupported td { opacity: 0.55; }

/* --- Tooltip: bold term + explanation paragraphs --- */
#custom-tooltip .tip-title {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 5px;
}
#custom-tooltip .tip-para { margin-bottom: 6px; }
#custom-tooltip .tip-para:last-child { margin-bottom: 0; }
#custom-tooltip .tip-rule {
  border-top: 1px solid #2c3340;
  margin-top: 7px;
  padding-top: 6px;
  color: var(--accent);
  font-weight: 600;
}

/* --- Detail panel: range bars, score factors --- */
.range-wrap { margin-top: 12px; max-width: 100%; min-width: 0; }
.range-head {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-bottom: 5px;
}
.range-pos { color: var(--accent); font-weight: 600; }
.range-bar {
  position: relative; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(255,93,93,0.35), rgba(246,185,75,0.3), rgba(46,204,113,0.35));
}
.range-marker {
  position: absolute; top: -3px; width: 3px; height: 11px;
  background: var(--text); border-radius: 2px; transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--panel);
}
.range-ends {
  display: flex; justify-content: space-between;
  font-size: 10.5px; color: var(--muted); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.factor-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 5px 14px; margin-top: 4px;
}
.factor { font-size: 12px; display: flex; align-items: center; gap: 7px; }
.factor.pass { color: var(--text); }
.factor.fail { color: var(--muted); }
.factor-mark { font-weight: 700; font-size: 12px; }
.factor.pass .factor-mark { color: var(--up); }
.factor.fail .factor-mark { color: var(--down); }

.pill-good { background: rgba(46,204,113,0.18); color: var(--up); }
.pill-warn { background: rgba(246,185,75,0.16); color: var(--warn); }
.pill-bad  { background: rgba(255,93,93,0.16); color: var(--down); }

/* --- Search box --- */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 8px 0 10px;
  height: 30px;
  transition: border-color 0.15s;
}
.search-wrap:focus-within { border-color: var(--chip-active); }
.search-icon { color: var(--muted); font-size: 15px; line-height: 1; }
#searchInput {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
  width: 230px;
  padding: 0;
}
#searchInput::placeholder { color: var(--muted); }
#searchInput::-webkit-search-cancel-button { display: none; }
.search-clear {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  color: var(--muted); font-size: 17px; line-height: 1;
}
.search-clear:hover { color: var(--text); }
.search-count {
  color: var(--muted); font-size: 11px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.search-count.no-match { color: var(--warn); }

/* --- Pulse view --- */
.pulse-view { padding: 18px 24px; }
.pulse-time { color: var(--muted); font-size: 11px; min-width: 52px; font-variant-numeric: tabular-nums; }
.pulse-date { color: var(--warn); font-size: 11.5px; min-width: 82px; font-weight: 600; white-space: nowrap; }
.pulse-type { font-size: 11px; font-weight: 600; white-space: nowrap; }
.pulse-msg { color: var(--text); font-size: 12.5px; line-height: 1.4; flex: 1; min-width: 200px; }
.pulse-eps { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.pulse-ev { align-items: baseline; }

/* --- Forecast & scenarios (detail panel) --- */
.scen-wrap { margin: 10px 0 4px; }
.scen-bar {
  position: relative; height: 7px; border-radius: 4px;
  background: var(--chip-bg); margin: 18px 6px 10px;
}
.scen-band {
  position: absolute; top: 0; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, rgba(255,93,93,0.4), rgba(246,185,75,0.35), rgba(46,204,113,0.4));
}
.scen-mark {
  position: absolute; top: -3px; width: 3px; height: 13px;
  border-radius: 2px; transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--panel);
}
.scen-bear { background: var(--down); }
.scen-base { background: var(--warn); }
.scen-bull { background: var(--up); }
.scen-price {
  position: absolute; top: -6px; width: 5px; height: 19px;
  background: var(--text); border-radius: 3px; transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--panel);
}
.scen-chips { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; }
.scen-chip {
  background: var(--chip-bg); border-radius: 6px; padding: 3px 9px;
  font-variant-numeric: tabular-nums; color: var(--muted);
}
.scen-chip b { color: var(--text); margin-right: 3px; }
.scen-chip.now { border: 1px solid var(--border); }

.act-list { margin-top: 10px; }
.act-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; padding: 4px 0; border-top: 1px solid var(--border);
}
.act-date { color: var(--muted); font-size: 11px; min-width: 82px; white-space: nowrap; }
.act-dir { font-weight: 700; }
.act-firm { font-weight: 600; color: var(--text); }
.act-grade { color: var(--muted); }

/* --- Newsletter / pro voices --- */
.inf-group-head {
  font-size: 14px; font-weight: 700; color: var(--text);
  margin: 8px 0 -4px; padding-top: 10px; border-top: 1px solid var(--border);
}

/* --- Voices redesign: AI digest, picks, compact rows --- */
.ai-banner {
  margin: 0 0 14px; padding: 8px 12px; border-radius: 8px;
  background: rgba(106,169,255,0.08); border: 1px solid rgba(106,169,255,0.25);
  color: var(--muted); font-size: 12px;
}
.ai-box {
  background: linear-gradient(135deg, rgba(106,169,255,0.07), rgba(106,169,255,0.02));
  border: 1px solid rgba(106,169,255,0.22); border-radius: 10px;
  padding: 10px 12px; margin: 8px 0 10px;
}
.ai-box.pending { color: var(--muted); font-size: 12px; font-style: italic; border-style: dashed; }
.ai-overview { font-size: 13px; line-height: 1.55; color: var(--text); }
.ai-calls { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.ai-call { display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: var(--text); line-height: 1.45; }
.ai-theme {
  font-size: 10px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; white-space: nowrap;
}
.ai-move { margin-top: 6px; font-size: 12px; color: var(--warn); }
.ai-shift { margin-top: 6px; font-size: 12px; color: var(--accent); }
.ai-meta { margin-top: 8px; font-size: 10.5px; color: var(--muted); opacity: 0.85; }

.inf-picks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.picks-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-right: 2px;
}
.pick-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--chip-bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 8px; font-size: 12px; font-weight: 600; color: var(--text);
}
.pick-chip small { color: var(--muted); font-weight: 500; }
.pick-flip {
  font-size: 9px; color: #fff; background: var(--warn); border-radius: 3px;
  padding: 1px 4px; font-weight: 700;
}
.pick-new {
  font-size: 9px; color: #fff; background: var(--chip-active); border-radius: 3px;
  padding: 1px 4px; font-weight: 700;
}

.inf-more summary {
  cursor: pointer; color: var(--muted); font-size: 12px; user-select: none;
  padding: 4px 0;
}
.inf-more summary:hover { color: var(--text); }
.voice-rows { display: flex; flex-direction: column; margin-top: 4px; }
.voice-row {
  display: flex; align-items: baseline; gap: 8px; text-decoration: none;
  padding: 5px 0; border-top: 1px solid var(--border); min-width: 0;
}
.voice-row:hover .voice-title { color: var(--accent); }
.voice-date { color: var(--muted); font-size: 11px; min-width: 62px; white-space: nowrap; }
.voice-title {
  color: var(--text); font-size: 12.5px; line-height: 1.4; flex: 1; min-width: 0;
}

/* --- Analyst screen: coverage, AI profile, superinvestors --- */
.cov-rows { display: flex; flex-direction: column; margin-top: 4px; max-height: 320px; overflow-y: auto; }
.cov-row {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0; border-top: 1px solid var(--border); font-size: 12px;
}
.cov-ticker { font-weight: 700; color: var(--accent); min-width: 52px; }
.cov-count { color: var(--muted); min-width: 28px; font-variant-numeric: tabular-nums; }
.cov-split { min-width: 56px; font-size: 11px; font-variant-numeric: tabular-nums; display: flex; gap: 5px; }
.cov-dates { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }

.ai-profile {
  background: linear-gradient(135deg, rgba(106,169,255,0.06), rgba(106,169,255,0.015));
  border: 1px solid rgba(106,169,255,0.18); border-radius: 10px;
  padding: 10px 12px; margin-top: 6px;
}
.aip-row { display: flex; gap: 10px; font-size: 12.5px; line-height: 1.5; padding: 3px 0; }
.aip-row > b { min-width: 82px; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 1px; }
.aip-row > span { flex: 1; color: var(--text); }
.aip-area { color: var(--accent); }
.aip-use > span { color: var(--up); }
.aip-warn > span { color: var(--warn); }

.guru-card { border-left: 3px solid rgba(246,185,75,0.5); }
.guru-meta { color: var(--muted); font-size: 11.5px; margin: 2px 0 8px; }
.guru-moves { display: flex; flex-direction: column; margin-top: 4px; }
.guru-move {
  display: flex; align-items: baseline; gap: 10px;
  padding: 4px 0; border-top: 1px solid var(--border); font-size: 12px;
}
.gm-tag { font-size: 10px; font-weight: 800; min-width: 34px; letter-spacing: 0.04em; }
.gm-name { flex: 1; display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.gm-name > span:last-child { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-pct { color: var(--muted); font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.cons-wallst { color: var(--muted); font-size: 11px; white-space: nowrap; }
.cons-videos .voice-date { min-width: 0; margin-right: 2px; }

/* --- Voices v3: independent column scrolling + Wall St ranks + signals --- */
/* The consensus column scrolls its own content, so the pane under the cursor
   is always the one that moves. */
.cons-col {
  position: sticky; top: 8px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
}
.an-rank {
  color: var(--warn); font-size: 10.5px; font-weight: 700;
  margin-left: 5px; white-space: nowrap;
}
.cons-signals { display: flex; gap: 12px; flex-wrap: wrap; margin: 3px 0 4px; }
.cons-signals .sig { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* --- Deep-content badges --- */
.tr-badge { font-size: 10px; margin-left: 4px; cursor: default; }
.tr-badge.dim { color: var(--muted); opacity: 0.7; font-style: normal; }

/* --- Per-ticker lean chips --- */
.inf-tick.tick-bull { border-color: rgba(46,204,113,0.55); color: var(--up); }
.inf-tick.tick-bear { border-color: rgba(255,93,93,0.55); color: var(--down); }

/* --- Superinvestor top picks leaderboard --- */
.gp-section {
  background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid rgba(246,185,75,0.5);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.gp-section h2 { margin: 0 0 10px; font-size: 15px; }
.gp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px;
}
@media (max-width: 1100px) { .gp-grid { grid-template-columns: 1fr; } }
.gp-row { padding: 7px 0; border-top: 1px solid var(--border); min-width: 0; }
.gp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.gp-score {
  font-weight: 800; color: var(--warn); font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.gp-gurus { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.gp-why {
  color: var(--muted); font-size: 11.5px; line-height: 1.45; margin-top: 2px;
  padding-left: 26px;
}
.gp-toggle { margin-top: 10px; }
.gp-grid[hidden] { display: none; }

/* --- Consensus dossier tiers + AI note --- */
.cons-brief {
  color: var(--text); font-size: 12px; line-height: 1.5;
  background: var(--chip-bg); border-radius: 8px; padding: 7px 10px; margin: 4px 0 6px;
}
.cons-note {
  background: linear-gradient(135deg, rgba(106,169,255,0.08), rgba(106,169,255,0.02));
  border: 1px solid rgba(106,169,255,0.22); border-radius: 8px;
  padding: 8px 11px; margin: 4px 0 6px;
}
.cn-sum { font-size: 12.5px; line-height: 1.55; color: var(--text); }
.cn-case { font-size: 11.5px; line-height: 1.45; margin-top: 4px; }
.tier { margin: 6px 0 2px; }
.tier-label {
  display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); margin-bottom: 2px;
}
.tier-line {
  display: flex; align-items: baseline; gap: 7px; text-decoration: none;
  color: var(--muted); font-size: 11.5px; line-height: 1.5; padding: 2px 0;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tier-line b { color: var(--text); font-weight: 600; white-space: nowrap; }
.tier-line:hover { color: var(--text); }
.quote-line { white-space: normal; }
.quote-text { color: var(--accent); font-size: 11.5px; font-style: italic; }
.quote-title { color: var(--muted); }

/* --- Radar 4-column + Advisor screen --- */
.radar-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1500px) { .radar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .radar-grid { grid-template-columns: 1fr; } }

.advisor-view { padding: 18px 24px; }
.adv-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px; border-left-width: 3px;
}
.adv-card.adv-good { border-left-color: var(--up); }
.adv-card.adv-ok { border-left-color: var(--accent); }
.adv-card.adv-warn { border-left-color: var(--warn); }
.adv-card.adv-bad { border-left-color: var(--down); }
.adv-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.adv-nums { margin-left: auto; display: flex; gap: 10px; align-items: baseline; font-size: 12.5px; }
.adv-pill-good { background: rgba(46,204,113,0.18); color: var(--up); }
.adv-pill-ok { background: rgba(106,169,255,0.16); color: var(--accent); }
.adv-pill-warn { background: rgba(246,185,75,0.16); color: var(--warn); }
.adv-pill-bad { background: rgba(255,93,93,0.16); color: var(--down); }
.adv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; margin-top: 8px; }
@media (max-width: 1000px) { .adv-cols { grid-template-columns: 1fr; } }
.adv-list { display: flex; flex-direction: column; gap: 3px; }
.adv-spread b { font-weight: 700; }
.adv-card.adv-na { border-left-color: var(--border); opacity: 0.65; }
.adv-pill-na { background: var(--chip-bg); color: var(--muted); }

/* --- Radar 3x2 grid + market movers --- */
.radar-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1300px) { .radar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .radar-grid { grid-template-columns: 1fr; } }
.mv-chg { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.mv-cap { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- Stock prediction screen --- */
.stock-view { padding: 18px 24px; }
.radar-ticker, .cov-ticker { cursor: pointer; }
.radar-ticker:hover, .cov-ticker:hover { text-decoration: underline; }
.st-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.st-ticker { font-size: 26px; font-weight: 800; color: var(--accent); }
.st-name { font-size: 14px; color: var(--muted); }
.st-price { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.st-section {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.st-section h3 { margin: 0 0 10px; font-size: 14.5px; }
.st-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.st-card {
  flex: 1; min-width: 130px; border-radius: 10px; padding: 10px 14px;
  border: 1px solid var(--border); background: var(--panel-2);
  display: flex; flex-direction: column; gap: 2px;
}
.st-card-k { font-size: 10px; letter-spacing: 0.09em; color: var(--muted); font-weight: 700; }
.st-card-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.st-card-u { font-size: 12px; font-weight: 600; }
.st-bear { border-left: 3px solid var(--down); }
.st-base { border-left: 3px solid var(--warn); }
.st-bull { border-left: 3px solid var(--up); }
.st-wall { border-left: 3px solid var(--accent); }
.st-now { border: 1px dashed var(--muted); }
.st-table, .st-matrix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.st-table th, .st-table td, .st-matrix th, .st-matrix td {
  padding: 6px 10px; border-top: 1px solid var(--border); text-align: left;
}
.st-table thead th, .st-matrix thead th {
  border-top: none; color: var(--muted); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.06em;
}
.st-table td.num, .st-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.st-matrix td { text-align: center; font-variant-numeric: tabular-nums; }
.st-matrix td b { display: block; font-size: 13.5px; }
.st-matrix td span { font-size: 11px; font-weight: 600; }
.st-matrix .mx-base { background: rgba(246,185,75,0.08); outline: 1px solid rgba(246,185,75,0.35); border-radius: 4px; }
.st-matrix tbody th small { color: var(--muted); font-weight: 500; }
.st-tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 1100px) { .st-tiers { grid-template-columns: 1fr; } }
.st-col {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px;
}
.st-col h3 { margin: 0 0 8px; font-size: 14px; }
.st-guru { padding: 7px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.st-guru-line { font-size: 12px; margin-top: 2px; }
.muted { color: var(--muted); }

/* --- Uniform-height panels (Radar + Pulse) + richer Pulse rows --- */
.radar-col {
  height: 640px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.pulse-ev { display: block; }
.pulse-ev-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pulse-facts { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pulse-msg { display: block; margin-top: 2px; }
.pulse-link { color: var(--accent); font-size: 10.5px; text-decoration: none; margin-left: 6px; white-space: nowrap; }
.pulse-link:hover { text-decoration: underline; }
/* Pulse has 4 panels — lay them out 4-across (Radar keeps 3×2). */
.pulse-view .radar-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1500px) { .pulse-view .radar-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .pulse-view .radar-grid { grid-template-columns: 1fr; } }

/* --- Stock dossier: key stats strip --- */
.st-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.st-stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; display: flex; flex-direction: column; gap: 1px;
}
.st-stat-k { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.st-stat-v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-stat.metric-good .st-stat-v { color: var(--up); }
.st-stat.metric-warn .st-stat-v { color: var(--warn); }
.st-peers .st-stat-v { display: flex; gap: 8px; font-size: 12.5px; }

/* --- Prediction table + timeline --- */
.st-card-w { font-size: 10px; color: var(--muted); }
a.st-card { text-decoration: none; color: inherit; }
a.st-card:hover { border-color: var(--accent); }
.proj-table td, .proj-table th { vertical-align: top; }
.proj-extra th, .proj-extra td { opacity: 0.75; font-style: italic; }
.mx-base-cell { background: rgba(246,185,75,0.06); }
.st-when .st-check { font-size: 12.5px; line-height: 1.6; color: var(--muted); margin: 6px 0; }
.st-when .st-check b { color: var(--text); }

/* --- Full scenario models table --- */
.model-table th { white-space: nowrap; }
.model-h { font-weight: 800; letter-spacing: 0.06em; }
.mh-bear { color: var(--down); }
.mh-base { color: var(--warn); }
.mh-bull { color: var(--up); }
.model-big td { font-size: 16px; padding-top: 10px; padding-bottom: 10px; background: rgba(255,255,255,0.015); }
.model-big b { font-size: 18px; }
/* --- Reported earnings section --- */
.st-latest-q { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 8px 0 12px; background: rgba(255,255,255,0.015); }
.st-latest-t { font-size: 12.5px; margin-bottom: 8px; }
.st-latest-t .muted { font-weight: 400; }
.st-latest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.st-lq { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.st-lq-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.st-lq-v { font-size: 16px; font-weight: 700; }
.st-lq-s { font-size: 11px; color: var(--muted); }
.q-table th, .q-table td { font-size: 12px; }

.model-years-h { margin: 20px 0 10px; font-size: 13px; color: var(--text); }
.model-years-h .pill-sub { font-weight: 400; }
.model-years th, .model-years td { font-size: 12px; }
.model-years .my-price b { font-size: 13px; }
.model-years .my-start td, .model-years .my-start th { color: var(--muted); background: rgba(255,255,255,0.015); font-style: italic; }
.model-block { border: 1px solid var(--border); border-radius: 10px; margin: 10px 0; overflow: hidden; }
.model-block-h { padding: 8px 12px; font-weight: 800; letter-spacing: 0.05em; font-size: 12.5px; cursor: default; }
.model-block-sub { font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 8px; font-size: 12px; }
.model-block-sub b { color: var(--text); }
.model-block table { margin: 0; }
.mb-bear { border-color: color-mix(in srgb, var(--down) 35%, var(--border)); }
.mb-bear .model-block-h { background: color-mix(in srgb, var(--down) 12%, transparent); }
.mb-bear .my-price b { color: var(--down); }
.mb-base { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.mb-base .model-block-h { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.mb-base .my-price b { color: var(--warn); }
.mb-bull { border-color: color-mix(in srgb, var(--up) 35%, var(--border)); }
.mb-bull .model-block-h { background: color-mix(in srgb, var(--up) 12%, transparent); }
.mb-bull .my-price b { color: var(--up); }

/* ================= 🛠 Prediction builder ================= */
.builder-view { padding: 16px 24px 60px; max-width: 1100px; margin: 0 auto; }
.bld-empty { max-width: 620px; margin: 80px auto; text-align: center; }
.bld-empty h2 { font-size: 22px; margin-bottom: 10px; }
.bld-empty p { color: var(--muted); line-height: 1.6; }
.bld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 22px; }
.bld-ctl { display: flex; flex-direction: column; gap: 6px; }
.bld-ctl-l { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.bld-ctl-l b { color: var(--text); font-variant-numeric: tabular-nums; }
.bld-ctl input[type=range] { width: 100%; accent-color: var(--accent); }
.bld-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.bld-compare { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.builder-view .st-header h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; }

/* ================= Liquid glass ================= */
/* Apple Liquid-Glass-inspired layer: a colorful depth background so the
   translucent panels have something to refract, frosted surfaces on the big
   containers, capsule controls, and specular top edges. Appended last so it
   overrides the flat theme above. */
:root {
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.09);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --chip-bg-hover: rgba(255, 255, 255, 0.10);
}

body { background: #0a0c12; }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(42% 34% at 12% 8%, rgba(64, 110, 255, 0.16), transparent 70%),
    radial-gradient(36% 30% at 88% 12%, rgba(140, 84, 255, 0.13), transparent 70%),
    radial-gradient(40% 36% at 78% 86%, rgba(38, 196, 172, 0.10), transparent 70%),
    radial-gradient(34% 30% at 18% 90%, rgba(255, 120, 84, 0.07), transparent 70%),
    #0a0c12;
}

/* Frosted major surfaces */
.topbar,
.radar-col, .st-section, .st-card, .model-block, .st-latest-q,
.adv-card, .gp-section, .cons-brief, .cons-note,
.detail-panel, .pf-error, .bld-empty,
.st-col {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--glass-highlight), 0 8px 28px rgba(0, 0, 0, 0.25);
}
.topbar { border-left: none; border-right: none; border-top: none; box-shadow: none; position: sticky; top: 0; z-index: 30; background: rgba(10, 12, 18, 0.55); }
.st-section, .radar-col, .model-block, .st-latest-q, .adv-card, .gp-section, .st-col { border-radius: 18px; }
.st-card { border-radius: 16px; }

/* Capsule controls */
.watchlist-tab, .chip, .pill, .search-wrap, .gp-toggle, button.refresh, #refreshBtn {
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
}
.watchlist-tab { backdrop-filter: blur(12px) saturate(150%); -webkit-backdrop-filter: blur(12px) saturate(150%); }
.watchlist-tab:hover, .chip:hover { background: var(--chip-bg-hover); }
.watchlist-tab.active {
  background: linear-gradient(180deg, rgba(88, 130, 255, 0.85), rgba(45, 96, 223, 0.85));
  border-color: rgba(140, 170, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 14px rgba(45, 108, 223, 0.35);
}
.search-wrap {
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--glass-highlight);
}
.search-wrap:focus-within { border-color: rgba(120, 160, 255, 0.6); box-shadow: var(--glass-highlight), 0 0 0 3px rgba(88, 130, 255, 0.18); }

/* Tables inside glass panels stay transparent so the frost shows through */
.st-table thead th { background: transparent; }
.model-big td { background: rgba(255, 255, 255, 0.03); }
.my-start td, .my-start th { background: rgba(255, 255, 255, 0.025); }

/* Prediction cards get a stronger glass + colored specular edge */
.st-card.st-bear { border-color: rgba(255, 93, 93, 0.35); }
.st-card.st-bull { border-color: rgba(46, 204, 113, 0.35); }
.st-card.st-base { border-color: rgba(246, 185, 75, 0.35); }
.mb-bear, .mb-base, .mb-bull { backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); }

/* Legal microcopy */
.ai-label { font-size: 10.5px; color: var(--muted); margin-top: 8px; opacity: 0.85; }
.footer-legal a { color: var(--accent); }

/* Builder per-year mode */
.bld-modes { float: right; display: inline-flex; gap: 6px; font-weight: 400; }
.bld-years { margin-top: 14px; overflow-x: auto; }
.bld-ytable input[type=number] { width: 64px; background: var(--glass); border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text); padding: 4px 6px; font: inherit; text-align: right; }
.bld-ytable input[type=number]:focus { outline: none; border-color: rgba(120,160,255,0.6); }

/* Stock price chart */
.st-chart-sec { padding-bottom: 8px; }
.st-chart-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 10px; }
.st-chart-meta { margin-left: auto; font-size: 12.5px; }
.st-chart-box { height: 320px; }
.st-chart-note { margin-top: 6px; }

/* Builder v3 */
.bld-basisrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; }
.bld-scenbar { align-items: center; }
.bld-scen { display: inline-flex; align-items: center; gap: 4px; }
.bld-prob { width: 44px; background: transparent; border: 1px solid var(--glass-border); border-radius: 6px; color: var(--text); font: inherit; text-align: right; padding: 1px 3px; }
.bld-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 2px; }
.bld-x:hover { color: var(--text); }
.bld-ev { border-color: rgba(120,160,255,0.5); }

/* Lists overview */
.lists-view { padding: 20px 24px 60px; max-width: 1200px; margin: 0 auto; }
.lists-h { font-size: 18px; margin: 6px 0 16px; }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lists-card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer;
  padding: 16px; border-radius: 18px; color: var(--text); font: inherit;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--glass-highlight), 0 8px 28px rgba(0,0,0,0.25);
  transition: transform 0.12s, border-color 0.12s;
}
.lists-card:hover { transform: translateY(-2px); border-color: rgba(120,160,255,0.45); }
.lists-name { font-size: 15px; font-weight: 700; }
.lists-count { font-size: 11.5px; color: var(--accent); }
.lists-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* --- Personal research layer: X-Ray strip, dividends, compare, thesis,
       predictions, screen builder ------------------------------------- */
.chip-primary { color: var(--accent); border-color: var(--accent); font-weight: 600; }

.xray-strip { margin-top: 4px; }
.xray-industries { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }

.pf-dividends { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.pf-div-total { font-size: 13.5px; }
.pill.pill-warn { color: var(--warn, #f6b94b); }

.cmp-table th:first-child { white-space: nowrap; }
.cmp-table .cmp-self th, .cmp-table .cmp-self td { background: rgba(108, 193, 255, 0.07); }
.cmp-table td.metric-good { color: var(--up); }
.cmp-table td.metric-bad { color: var(--down); }

.thesis-box .thesis-textarea {
  width: 100%; min-height: 56px; resize: vertical; box-sizing: border-box;
  background: var(--chip-bg, rgba(255,255,255,0.04)); color: var(--text);
  border: 1px solid var(--border, rgba(255,255,255,0.12)); border-radius: 10px;
  padding: 8px 12px; font: inherit; font-size: 13.5px; margin-bottom: 10px;
}
.thesis-claim, .scr-filter { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.thesis-claim select, .scr-filter select, .thesis-claim input, .scr-filter input, .scr-name {
  background: var(--chip-bg, rgba(255,255,255,0.05)); color: var(--text);
  border: 1px solid var(--border, rgba(255,255,255,0.14)); border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 13px;
}
.thesis-claim input[type="number"], .scr-filter input[type="number"] { width: 90px; }
.scr-name { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.thesis-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thesis-note { font-style: italic; }

.scr-del { margin-left: 6px; opacity: 0.6; }
.scr-del:hover { opacity: 1; color: var(--down); }
.lists-new { border-style: dashed; }
.lists-new .lists-name { color: var(--accent); }

/* --- Modern floating dock for the app tabs (final layer, wins cascade) ---- */
.watchlist-bar {
  position: sticky; top: 0; z-index: 60;
  padding: 12px 24px 10px;
  overflow: visible;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 88%, transparent), color-mix(in srgb, var(--bg) 55%, transparent) 70%, transparent);
}
.watchlist-tabs {
  display: inline-flex; align-items: center; gap: 2px;
  max-width: 100%;
  padding: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 45%, rgba(148, 178, 255, 0.05));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
}
.watchlist-tabs::-webkit-scrollbar { display: none; }
.watchlist-tab, .watchlist-tab.pf-tab {
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  transition: color 0.18s, background 0.18s, box-shadow 0.25s;
}
.watchlist-tab:hover, .watchlist-tab.pf-tab:hover {
  background: rgba(148, 178, 255, 0.09);
  color: var(--text);
}
.watchlist-tab.active, .watchlist-tab.pf-tab.active,
.watchlist-tab.active:hover, .watchlist-tab.pf-tab.active:hover {
  background: linear-gradient(180deg, #6f9dff, #2d60df);
  color: #fff;
  box-shadow: 0 6px 20px rgba(59, 109, 240, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.watchlist-tab:focus-visible { outline: 2px solid rgba(120, 160, 255, 0.7); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .watchlist-tab, .watchlist-tab.pf-tab { transition: none; }
}

/* --- Segmented controls: same dock language as the app tabs ---------------- */
.st-chart-tabs, .bld-modes {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 45%, rgba(148, 178, 255, 0.05));
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.st-chart-tabs .chip, .bld-modes .chip {
  border: none; background: transparent; box-shadow: none;
  padding: 6px 14px; font-weight: 600; color: var(--muted);
}
.st-chart-tabs .chip:hover, .bld-modes .chip:hover { background: rgba(148, 178, 255, 0.09); color: var(--text); }

/* Modern active state for every chip in the app */
.chip.active, .chip.active:hover,
.st-chart-tabs .chip.active, .bld-modes .chip.active {
  background: linear-gradient(180deg, #6f9dff, #2d60df);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 109, 240, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* --- TradinZ wordmark ------------------------------------------------------ */
.brand-mark { font-weight: 800; letter-spacing: -0.02em; }
.brand-z {
  background: linear-gradient(180deg, #6f9dff, #2d60df);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* --- Pulse: aligned two-column list items ---------------------------------- */
.pulse-item { display: flex; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--border, rgba(255,255,255,0.07)); }
.pulse-item:last-child { border-bottom: none; }
.pulse-meta { flex: 0 0 76px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pulse-when { font-size: 11px; color: var(--muted); white-space: nowrap; }
.pulse-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pulse-title { font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pulse-sub { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* --- Expanded-row chart + dossier bar -------------------------------------- */
.panel-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.panel-chart { margin: 0 0 14px; }
.panel-chart-head { display: flex; gap: 12px; align-items: baseline; font-size: 12.5px; margin-bottom: 6px; }
.panel-chart-svg { width: 100%; height: 110px; display: block; border-radius: 10px; }

/* --- Stock page: next-earnings stat card ----------------------------------- */
.st-stat.st-nextearn { border-color: rgba(246, 185, 75, 0.35); }
.st-nextearn-est { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* --- Voices: three rooms, no chip clutter ---------------------------------- */
.voices-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.voices-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.voices-picker {
  background: var(--chip-bg, rgba(255,255,255,0.05)); color: var(--text);
  border: 1px solid var(--glass-border); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: 13px;
}
.cons-col.cons-full { position: static; max-height: none; height: auto; overflow: visible; }
.inf-cards-grid { display: block; }
@media (min-width: 1100px) {
  .inf-cards-grid { column-count: 2; column-gap: 14px; }
  .inf-cards-grid .inf-group-head { column-span: all; }
  .inf-cards-grid > section { break-inside: avoid; }
}
.detail-panel .panel-topbar, .detail-panel .panel-chart { grid-column: 1 / -1; }
.panel-chart-svg { max-width: 860px; }
.panel-chart-live { width: 100%; }
.panel-chart-canvas { width: 100%; height: 240px; }
.panel-chart-tabs { margin-bottom: 8px; }
.panel-chart-meta { margin-left: 10px; font-size: 12.5px; }

/* The chart library builds an internal <table>; when the panel sits inside
   the portfolio/watchlist table, our app-table cell rules (sticky 200px first
   column, padding) leak into it and shove the chart pane sideways. Reset. */
.panel-chart-canvas table { border-collapse: separate !important; }
.panel-chart-canvas td, .panel-chart-canvas th {
  padding: 0 !important; border: none !important;
  min-width: 0 !important; background: none !important;
}
/* Undo only the leaked sticky-first-column rule; the library manages its own
   cell positioning inline, so touching other cells' position would break it. */
.pf-table .panel-chart-canvas td:first-child {
  position: static !important; left: auto !important; z-index: auto !important;
}

/* --- Build: typed-input mode ----------------------------------------------- */
.bld-ctl-input { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bld-inputwrap { display: inline-flex; align-items: center; gap: 6px; }
.bld-ctl-input input[type="number"] {
  width: 92px; text-align: right;
  background: var(--chip-bg, rgba(255,255,255,0.05)); color: var(--text);
  border: 1px solid var(--border, rgba(255,255,255,0.14)); border-radius: 8px;
  padding: 6px 10px; font: inherit; font-size: 13px;
}
.bld-unit { color: var(--muted); font-size: 12px; min-width: 22px; }
.ratings-strip { margin-bottom: 12px; }

/* --- Scorecard ------------------------------------------------------------- */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.score-col h4 { margin: 0 0 8px; font-size: 13.5px; }
.score-sub { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 10px 0 2px; }
.scorecard .pulse-item { padding: 6px 0; }

/* --- Layout rhythm: one consistent gap between sections app-wide ----------- */
.st-section, .gp-section, .scorecard { margin: 0 0 16px; }
.radar-grid { gap: 16px; margin-bottom: 16px; }
.pf-summary { gap: 12px; margin: 0 0 16px; }
.pf-dividends, .xray-industries { margin: 0 0 16px; }
.pulse-item, .pulse-body, .pulse-meta { text-align: left; }
.pulse-meta { flex: 0 0 84px; }

/* X-Ray strip: equal-width cards on a real grid — no more lone full-width card */
.pf-summary.xray-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pf-summary.xray-strip .pf-card { min-width: 0; }

/* Advisor per-holding status sentence */
.adv-status { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 6px 0 4px; }

/* Portfolio switcher + manual position form */
.pf-switch { margin: 0 0 14px; }
.pf-addpos { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.pf-addpos input {
  background: var(--chip-bg, rgba(255,255,255,0.05)); color: var(--text);
  border: 1px solid var(--border, rgba(255,255,255,0.14)); border-radius: 8px;
  padding: 7px 10px; font: inherit; font-size: 13px; width: 120px;
}
.pf-rmpos { margin-right: 6px; opacity: 0.55; }
.pf-rmpos:hover { opacity: 1; color: var(--down); }

/* Compare bar on the Stock screen */
.cmp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.cmp-input {
  background: var(--chip-bg, rgba(255,255,255,0.05)); color: var(--text);
  border: 1px solid var(--glass-border); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 13px; width: 110px;
}
.cmp-table thead th { vertical-align: bottom; }
.xray-movers { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 0 0 16px; padding: 14px 18px; border: 1px solid var(--glass-border); border-radius: 14px; background: var(--glass); }

/* --- Cosmetic pass 2026-09-07 ---------------------------------------------- */
/* Main selector centered */
.watchlist-bar { display: flex; justify-content: center; }

/* Portfolio header: switcher on its own row, summary cards on an even grid */
.pf-switch { display: flex; width: fit-content; margin: 0 0 14px; }
.pf-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pf-summary .pf-card { min-width: 0; }
.pf-card-wide { grid-column: span 2; }

/* Chart hover legend */
.chart-legend {
  position: absolute; top: 10px; left: 14px; z-index: 5;
  padding: 5px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  font-size: 13px; pointer-events: none;
  opacity: 0; transition: opacity 0.12s;
}
.chart-legend.visible { opacity: 1; }
.chart-legend b { font-size: 14.5px; }

/* Pulse: cleaner item anatomy — aligned meta column, quieter chips */
.pulse-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 2px 14px; padding: 10px 4px; align-items: start; }
.pulse-meta { flex: none; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding-top: 1px; }
.pulse-title { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; row-gap: 4px; }
.pulse-title .badge, .pulse-title .pill { font-size: 10.5px; padding: 1px 7px; }
.pulse-sub { margin-top: 1px; }
.pulse-sub .pulse-link { margin-left: 4px; }

/* Movers rows: name truncates, numbers stay right-aligned as a group */
.radar-row.slim { display: flex; align-items: center; gap: 10px; }
.radar-row.slim .radar-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-row.slim .radar-price { margin-left: auto; }
.radar-row.slim .radar-price, .radar-row.slim .mv-chg, .radar-row.slim .mv-cap { flex: none; font-variant-numeric: tabular-nums; }

/* --- Portfolio toolbar: label + segmented switcher + actions --------------- */
.pf-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 20px; }
.pf-toolbar-label { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); }
.pf-toolbar .pf-switch { display: inline-flex; margin: 0; padding: 5px; }
.pf-toolbar .pf-switch .chip { padding: 7px 16px; }
.pf-toolbar > .chip { padding: 7px 16px; }
.pf-danger { color: var(--down); }
.pf-danger:hover { border-color: var(--down); }
.chart-legend.floating { top: 0; left: 0; transition: none; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }

/* --- Scroll performance: blur only on floating chrome ----------------------
   backdrop-filter on dozens of scrolling panels forced a recomposite every
   frame. Content panels sit over a STATIC body gradient, so their blur was
   nearly invisible anyway — removed. Blur stays only on the sticky dock and
   small overlays, at a lighter radius. */
.radar-col, .st-section, .st-card, .model-block, .st-latest-q,
.adv-card, .gp-section, .cons-brief, .cons-note,
.detail-panel, .pf-error, .bld-empty, .st-col, .lists-card,
.mb-bear, .mb-base, .mb-bull, .search-wrap, .watchlist-tab {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.topbar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(10, 12, 18, 0.94); }
.watchlist-tabs { backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%); background: rgba(15, 18, 28, 0.85); }

/* --- Confirmation dialog for destructive actions --------------------------- */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5, 7, 12, 0.55);
  display: flex; align-items: center; justify-content: center;
}
.confirm-box {
  background: rgba(19, 23, 34, 0.98); border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 20px 24px; max-width: 380px; margin: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.confirm-box p { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--text); }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; }
.confirm-actions .pf-danger { border-color: var(--down); }

/* --- Scroll performance pass 2 --------------------------------------------- */
/* Offscreen sections skip layout & paint entirely; the browser materializes
   them just-in-time as they scroll into view. Chart sections are excluded —
   collapsing a live canvas container resizes the chart to zero. */
.stock-view .st-section:not(.st-chart-sec), .cons-row, .adv-card, .inf-people > section {
  content-visibility: auto;
  contain-intrinsic-size: auto 420px;
}
.news-card { content-visibility: auto; contain-intrinsic-size: auto 110px; }

/* The dock's blur composited over content on every scrolled frame — solid now. */
.watchlist-tabs { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(15, 18, 28, 0.96); }

/* Keep the fixed gradient and the sticky bar on their own GPU layers. */
body::before { will-change: transform; transform: translateZ(0); }
.watchlist-bar { will-change: transform; }

/* --- Pulse rows v3: identity | content | numbers --------------------------- */
.p-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto;
  column-gap: 12px; align-items: center;
  padding: 9px 2px; border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.p-row:last-child { border-bottom: none; }
.p-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.p-id .radar-ticker { font-size: 12.5px; }
.p-when { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.p-main { min-width: 0; }
.p-l1 { font-size: 13px; line-height: 1.45; }
.p-l2 { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: 2px; overflow-wrap: anywhere; }
.p-nums {
  display: flex; flex-direction: column; align-items: flex-end; gap: 1px;
  white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 76px;
}
.p-price { font-weight: 600; font-size: 13px; }
.p-chg { font-size: 11.5px; }
.p-tgt { font-size: 11px; opacity: 0.9; }
.wl-manage { display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.addtolist { max-width: 220px; }
.wl-manage .cmp-input { width: 132px; }

/* --- 10-K redline ---------------------------------------------------------- */
.rl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; margin-top: 10px; }
.rl-col h4 { margin: 0 0 8px; font-size: 13px; }
.rl-item { font-size: 12.5px; line-height: 1.55; color: var(--muted); padding: 8px 12px; margin: 0 0 8px; border-radius: 10px; border-left: 3px solid transparent; background: rgba(255,255,255,0.03); }
.rl-item.rl-add { border-left-color: var(--up); }
.rl-item.rl-del { border-left-color: var(--down); }

/* --- AI companion ---------------------------------------------------------- */
#companionBtn {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(122, 162, 255, .45);
  background: linear-gradient(135deg, #2b3f7a, #1a2547);
  color: #cfe0ff; font-size: 20px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45), 0 0 0 1px rgba(122, 162, 255, .08);
  transition: transform .15s ease, box-shadow .15s ease;
}
#companionBtn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 18px rgba(122, 162, 255, .25); }
#companionBtn b { font-family: inherit; }

#companionPanel[hidden] { display: none; }
#companionPanel {
  position: fixed; right: 22px; bottom: 86px; z-index: 901;
  width: min(400px, calc(100vw - 44px)); height: min(540px, calc(100vh - 130px));
  display: flex; flex-direction: column;
  background: rgba(16, 20, 36, .97);
  border: 1px solid rgba(122, 162, 255, .25); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
  overflow: hidden;
}
.cmpn-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}
.cmpn-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmpn-head b { font-size: 14px; color: #dfe7ff; }
.cmpn-label { font-size: 10px; color: #7c86a8; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmpn-close {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05);
  color: #9aa4c0; font-size: 12px; cursor: pointer; line-height: 1;
}
.cmpn-close:hover { background: rgba(255, 255, 255, .12); color: #e3ebff; }
.cmpn-msgs {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.cmp-msg {
  max-width: 88%; padding: 9px 12px; border-radius: 12px;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.cmp-user {
  align-self: flex-end; background: rgba(122, 162, 255, .18);
  border: 1px solid rgba(122, 162, 255, .25); color: #e3ebff;
  border-bottom-right-radius: 4px;
}
.cmp-assistant {
  align-self: flex-start; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08); color: #cdd6ee;
  border-bottom-left-radius: 4px;
}
.cmp-sys {
  align-self: flex-start; background: none; border: none;
  color: #6fd3a3; font-size: 11.5px; padding: 0 4px;
}
.cmp-thinking { color: #7c86a8; animation: cmpPulse 1.2s ease-in-out infinite; }
@keyframes cmpPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.cmpn-inputrow {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .02);
}
.cmpn-inputrow input {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12); background: rgba(0, 0, 0, .25);
  color: #e3ebff; font-size: 13px; outline: none;
}
.cmpn-inputrow input:focus { border-color: rgba(122, 162, 255, .5); }
@media (max-width: 640px) {
  #companionPanel { right: 12px; left: 12px; width: auto; }
}

/* --- Accounts (magic-link sign-in) ----------------------------------------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 16, .92); backdrop-filter: blur(10px);
}
.auth-box {
  width: min(400px, calc(100vw - 40px));
  padding: 34px 30px; border-radius: 16px; text-align: center;
  background: rgba(18, 22, 38, .95); border: 1px solid rgba(122, 162, 255, .2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.auth-brand { font-size: 26px; font-weight: 700; color: #eef2ff; letter-spacing: .5px; }
.auth-sub { font-size: 12px; color: #7c86a8; margin: 4px 0 22px; }
.auth-box form { display: flex; flex-direction: column; gap: 10px; }
.auth-box input {
  padding: 11px 14px; border-radius: 10px; font-size: 14px; text-align: center;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .3); color: #e3ebff;
  outline: none;
}
.auth-box input:focus { border-color: rgba(122, 162, 255, .5); }
.auth-box .chip { justify-content: center; padding: 10px; font-size: 13px; }
.auth-note { font-size: 11.5px; color: #7c86a8; margin-top: 16px; line-height: 1.5; }
.auth-note a { color: #7aa2ff; }
.auth-chip { font-size: 11px; color: #7c86a8; margin-right: 10px; white-space: nowrap; }
.auth-chip a { color: #7aa2ff; text-decoration: none; }

/* --- Alerts ---------------------------------------------------------------- */
#alertsBtn { position: relative; }
.alerts-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #e2574f; color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
#alertsPanel[hidden] { display: none; }
#alertsPanel {
  position: fixed; top: 64px; right: 22px; z-index: 902;
  width: min(440px, calc(100vw - 44px)); max-height: min(600px, calc(100vh - 90px));
  display: flex; flex-direction: column;
  background: rgba(16, 20, 36, .97);
  border: 1px solid rgba(122, 162, 255, .25); border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55); overflow: hidden;
}
.al-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .03);
}
.al-head b { font-size: 14px; color: #dfe7ff; }
.al-actions { display: flex; align-items: center; gap: 8px; }
.al-body { overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.al-form { display: flex; flex-wrap: wrap; gap: 6px; }
.al-form select, .al-form input {
  padding: 7px 10px; border-radius: 9px; font-size: 12px;
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .3); color: #e3ebff;
  outline: none; max-width: 160px;
}
.al-form input#alValue { width: 84px; }
.al-form input#alTicker { width: 84px; }
.al-form [hidden] { display: none; }
.al-note { font-size: 11px; color: #7c86a8; line-height: 1.4; min-height: 14px; }
.al-rules, .al-inbox { display: flex; flex-direction: column; gap: 6px; }
.al-inbox { border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 10px; }
.al-rule {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 9px; font-size: 12px; color: #cdd6ee;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .07);
}
.al-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: baseline;
  padding: 7px 10px; border-radius: 9px; font-size: 12px; color: #aeb7d0;
  background: rgba(255, 255, 255, .03);
}
.al-item.al-unread { background: rgba(122, 162, 255, .09); color: #dfe7ff; border-left: 2px solid #7aa2ff; }
.al-tick { font-weight: 700; cursor: pointer; }
.al-msg { line-height: 1.4; }
.al-when { font-size: 10.5px; color: #6a7390; white-space: nowrap; }
.al-empty { font-size: 12px; color: #7c86a8; padding: 6px 2px; }

/* --- Portfolio movers + target updates ------------------------------------- */
.pf-movers, .pf-targets {
  padding: 12px 14px; border-radius: 14px;
  background: rgba(16, 20, 36, .55); border: 1px solid rgba(255, 255, 255, .07);
}
.pf-movers-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pf-movers-head h4, .pf-targets h4 { font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: #7c86a8; margin: 0; }
.pf-targets h4 { margin-bottom: 8px; }
.pf-movers-tfs { display: flex; gap: 6px; }
.pf-movers-grid { padding: 0; background: none; border: none; }
.pf-targets .radar-row .al-when { margin-left: auto; }

/* --- Earnings brief -------------------------------------------------------- */
.st-brief {
  padding: 12px 16px; border-radius: 14px; margin-top: 12px;
  background: rgba(16, 20, 36, .6); border: 1px solid rgba(255, 255, 255, .08);
  border-left: 3px solid #7aa2ff;
}
.st-brief-bullish { border-left-color: #34d27b; }
.st-brief-bearish { border-left-color: #e2574f; }
.st-brief-mixed { border-left-color: #e8b34b; }
.st-brief-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.st-brief-tag { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: #7c86a8; font-weight: 600; }
.st-brief-tone { font-size: 10px; text-transform: uppercase; }
.st-brief-headline { font-size: 14px; font-weight: 600; color: #e3ebff; margin-bottom: 6px; }
.st-brief-bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.st-brief-bullets li { font-size: 12.5px; color: #b9c2da; line-height: 1.45; }

/* --- Your position bar (dossier) ------------------------------------------- */
.st-position {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 10px; border-radius: 12px; font-size: 13px;
  background: rgba(122, 162, 255, .08); border: 1px solid rgba(122, 162, 255, .22);
}
.st-pos-tag { font-size: 10px; font-weight: 700; letter-spacing: .6px; color: #7aa2ff; }

/* --- Portfolio P/L windows -------------------------------------------------- */
.pf-perf { margin-top: -6px; }
.pf-perf .pf-card { padding: 10px 14px; }
.pf-perf .pf-v small { font-size: 11px; opacity: .8; }

/* --- Google sign-in button + divider --------------------------------------- */
.auth-gsi { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: #7c86a8; font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, .12); }

/* Official-source research */
.research-card { margin: 18px 0; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.research-source { color: var(--muted); font-size: 12px; line-height: 1.6; }
.research-warning { color: var(--warn); font-size: 12px; }
.research-card a { color: var(--accent); }
.research-row { display: flex; gap: 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
.research-row > span { flex: 1; }
.research-card small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.research-table { width: 100%; min-width: 600px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.research-table th, .research-table td { padding: 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.research-table th { color: var(--muted); font-size: 11px; }
.research-table td { font-size: 12px; }
.research-table details { min-width: 100px; max-width: 350px; white-space: normal; }
.research-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.research-controls label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.research-controls input { background: var(--panel-2); color: var(--text); padding: 8px; border: 1px solid var(--border); border-radius: 6px; }
.research-pair { padding: 14px 0; border-bottom: 1px solid var(--border); }
.research-card summary { cursor: pointer; }
@media(max-width:600px) { .research-row { flex-wrap: wrap; gap: 8px; } .research-card { padding: 12px; } }

.auth-box h1 { font-size:25px; margin:12px 0; }
.auth-box form { display:flex; flex-direction:column; gap:12px; }
.auth-box [hidden] { display:none !important; }
.auth-box label { text-align:left; font-size:12px; color:var(--muted); }
#authCode { font-size:24px; letter-spacing:.22em; text-align:center; }
.auth-apple { width:300px; max-width:100%; background:white; color:black; border:0; border-radius:24px; min-height:44px; cursor:pointer; font-size:15px; font-weight:600; margin-bottom:10px; }
.auth-legal { margin-top:20px; font-size:11px; }
.auth-account { max-width:460px; width:calc(100% - 40px); max-height:85vh; overflow:auto; background:var(--panel,#182332); color:var(--text,#eef3fa); border:1px solid var(--border,#344353); border-radius:20px; padding:24px; }
.auth-account::backdrop { background:rgba(0,0,0,.6); backdrop-filter:blur(8px); }
.auth-account button { margin:6px 4px 6px 0; }
.auth-account code { overflow-wrap:anywhere; }
.auth-box { max-height:95dvh; overflow:auto; }
.auth-box #authConfirmWrap,.auth-box #authResetWrap { display:flex; flex-direction:column; gap:12px; }
.auth-box input { width:100%; box-sizing:border-box; }
.auth-modes { display:flex; justify-content:center; gap:8px; margin-bottom:14px; }

.environment-badge { display:inline-flex; align-items:center; padding:3px 9px; border:1px solid #d7b15d66; border-radius:999px; color:#ebc779; background:#d7b15d12; font-size:11px; font-weight:600; letter-spacing:.03em; }
.auth-box > .environment-badge { margin-bottom:14px; }
