:root {
  color-scheme: dark;
  --bg: #07111f;
  --card: rgba(15, 27, 48, 0.88);
  --text: #eef6ff;
  --muted: #8da4c2;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #5eead4;
  --accent-2: #8b5cf6;
  --danger: #fb7185;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.light {
  color-scheme: light;
  --bg: #eef4ff;
  --card: rgba(255, 255, 255, 0.9);
  --text: #101827;
  --muted: #58708f;
  --line: rgba(16, 24, 39, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(94, 234, 212, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.22), transparent 30rem),
    var(--bg);
  color: var(--text);
}

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0; }
.card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(16px);
}
.hero { display: flex; justify-content: space-between; gap: 24px; padding: 36px; margin-bottom: 24px; }
h1 { max-width: 820px; margin: 0; font-size: clamp(2.2rem, 6vw, 5rem); line-height: 0.95; letter-spacing: -0.06em; }
h2 { margin: 0; font-size: 1.4rem; }
.subhead { max-width: 760px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem; font-weight: 800; margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.search-card, .portfolio-card, .ideas, .monitor-card, .watchlist-card, .news-card { padding: 24px; }
.section-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.inline-form { display: flex; gap: 10px; margin-bottom: 18px; }
.stacked-form { display: grid; gap: 12px; margin-bottom: 18px; }
label { color: var(--muted); font-size: 0.84rem; }
input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin-top: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}
.inline-form input { margin-top: 0; }
.currency-control { display: grid; gap: 6px; min-width: 260px; text-align: left; color: var(--muted); }
.currency-control select { margin-top: 0; font-weight: 800; }
.currency-control small { line-height: 1.35; }
button {
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111f;
  font-weight: 800;
  cursor: pointer;
}
button.ghost { align-self: start; background: transparent; border: 1px solid var(--line); color: var(--text); white-space: nowrap; }
.refresh-status { align-self: start; margin: 0; border: 1px solid var(--line); border-radius: 999px; padding: 10px 12px; color: var(--muted); font-size: 0.82rem; white-space: nowrap; }
.quote { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: end; border: 1px solid var(--line); border-radius: 22px; padding: 18px; margin-bottom: 14px; }
.quote.empty { color: var(--muted); display: block; }
.price { font-size: 2.4rem; font-weight: 900; letter-spacing: -0.04em; }
.measurement-note, .chart-summary { color: var(--muted); line-height: 1.5; margin: 8px 0 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(255, 255, 255, 0.045); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card strong { display: block; margin: 4px 0; color: var(--text); }
.metric-card small { font-size: 0.76rem; line-height: 1.35; }
.range-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.range-tabs button { padding: 9px 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.055); color: var(--text); }
.range-tabs button.active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06111f; }
.chart-summary { margin-bottom: 12px; }
.chart-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 0 0 12px; }
.chart-metric { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(255, 255, 255, 0.045); }
.chart-metric span { display: block; color: var(--muted); font-size: 0.72rem; margin-bottom: 3px; }
.chart-metric strong { color: var(--text); font-size: 0.9rem; }
.chart-shell { position: relative; border: 1px solid var(--line); border-radius: 22px; padding: 10px; background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)); overflow: hidden; }
.chart-tooltip { position: absolute; z-index: 3; transform: translateX(-50%); min-width: 150px; border: 1px solid rgba(94,234,212,0.35); border-radius: 14px; padding: 10px 12px; background: rgba(7, 17, 31, 0.94); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); pointer-events: none; }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip span { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.positive { color: #34d399; }
.negative { color: #fb7185; }
canvas { display: block; width: 100%; max-height: 360px; border-radius: 16px; background: rgba(255, 255, 255, 0.02); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.dashboard-grid.single { max-width: 760px; }
.watchlist-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.watchlist { display: grid; gap: 10px; }
.watchlist-row { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: start; width: 100%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.045); color: var(--text); text-align: left; }
.watchlist-row span { color: var(--muted); font-weight: 500; line-height: 1.4; }
.detailed-watchlist-row { grid-template-columns: 112px 1fr; grid-template-areas: "symbol thesis" "attributes attributes"; }
.watchlist-symbol-block { grid-area: symbol; display: grid; gap: 4px; }
.watchlist-symbol-block strong { color: var(--text); font-size: 1.05rem; }
.watchlist-company-name { color: var(--accent); font-size: 0.72rem; line-height: 1.25; font-weight: 800; }
.watchlist-thesis { grid-area: thesis; }
.watchlist-attributes { grid-area: attributes; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.watchlist-attribute { display: grid; gap: 3px; border: 1px solid rgba(94, 234, 212, 0.18); border-radius: 12px; padding: 8px; background: rgba(94, 234, 212, 0.055); }
.watchlist-attribute b { color: var(--accent); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; }
.watchlist-attribute small { color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.news-card { margin-top: 24px; }
.news-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.news-item { border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: rgba(255, 255, 255, 0.045); }
.news-item h3 { margin: 0 0 8px; }
.news-symbol-block { display: grid; gap: 3px; }
.news-symbol-block strong { color: var(--text); }
.news-company-name { color: var(--muted); font-size: 0.78rem; font-weight: 700; line-height: 1.35; }
.news-item p { color: var(--muted); line-height: 1.55; }
.news-item ul { margin: 12px 0 0; padding-left: 18px; }
.news-item li { margin: 8px 0; color: var(--muted); }
.news-item a { color: var(--accent); text-decoration: none; font-weight: 700; }
.news-item small { display: block; margin-top: 3px; color: var(--muted); }
.positions { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.position { display: block; border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: rgba(255, 255, 255, 0.035); }
.position-main { width: 100%; }
.position-title-row { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.position-symbol { display: block; font-size: 1.15rem; letter-spacing: -0.02em; }
.position p { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.position-context { color: var(--accent); font-weight: 700; }
.position-notes { margin-top: 10px; }
.position-right { display: grid; gap: 4px; text-align: right; min-width: 112px; }
.position-value { color: var(--accent); font-weight: 900; font-size: 1.08rem; }
#portfolioValue { display: grid; gap: 4px; min-width: 210px; text-align: right; }
#portfolioValue span { color: var(--accent); font-size: 1.2rem; }
.portfolio-summary-line { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 700; line-height: 1.25; }
.position-details { margin-top: 12px; }
.portfolio-cost-grid { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 10px; }
.portfolio-form-actions { display: flex; gap: 10px; align-items: center; }
.portfolio-form-actions button { flex: 1; }
.portfolio-form-actions .ghost { background: transparent; color: var(--text); }
.position-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.position-detail-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px; background: rgba(255, 255, 255, 0.045); }
.position-detail-card span, .position-detail-card small { display: block; color: var(--muted); }
.position-detail-card span { font-size: 0.72rem; }
.position-detail-card strong { display: block; margin: 3px 0; color: var(--text); font-size: 0.88rem; line-height: 1.25; }
.position-detail-card small { font-size: 0.7rem; line-height: 1.35; }
.position-insight { margin-top: 10px; border: 1px solid rgba(94, 234, 212, 0.22); border-radius: 14px; padding: 10px; color: var(--muted); background: rgba(94, 234, 212, 0.07); font-size: 0.82rem; line-height: 1.45; }
.edit { padding: 7px 10px; justify-self: end; background: rgba(94, 234, 212, 0.14); color: var(--accent); border: 1px solid rgba(94, 234, 212, 0.26); font-size: 0.78rem; }
.remove { padding: 0; width: 28px; height: 28px; justify-self: end; background: rgba(251, 113, 133, 0.18); color: var(--danger); }
.idea-list { display: flex; flex-wrap: wrap; gap: 10px; }
.idea-list button { border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: rgba(255, 255, 255, 0.045); color: var(--muted); }
.idea-list button[data-plan-action].active, .idea-list button[data-plan-action]:hover { color: #06111f; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.idea-list button.completed { cursor: default; color: var(--accent); border-color: rgba(52, 211, 153, 0.55); background: rgba(52, 211, 153, 0.12); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: rgba(52, 211, 153, 0.72); }
.idea-list button.completed:hover { color: var(--accent); background: rgba(52, 211, 153, 0.12); }
.plan-action-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 20px; padding: 16px; background: rgba(255, 255, 255, 0.035); }
.plan-action-panel h3 { margin: 0 0 8px; }
.plan-action-panel p, .plan-action-panel li { color: var(--muted); line-height: 1.55; }
.plan-action-panel ol, .plan-action-panel ul { margin: 10px 0 0; padding-left: 20px; }
.comparison-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.comparison-row { display: grid; gap: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.045); color: var(--text); text-align: left; }
.comparison-row span { color: var(--muted); font-weight: 500; line-height: 1.35; }
.metric-grid.compact { margin: 12px 0; }

@media (max-width: 900px) {
  .hero, .grid, .dashboard-grid { display: block; }
  .hero { padding: 24px; }
  .portfolio-card, .watchlist-card { margin-top: 24px; }
  .household-portfolio-card { margin-top: 0; }
}

/* Landing page command-center layout */
.landing-hero { align-items: flex-start; }
.hero-actions { display: grid; gap: 10px; justify-items: end; }
.landing-grid { display: grid; grid-template-columns: 0.95fr 1.25fr; gap: 24px; margin-bottom: 24px; }
.spotlight-card, .watchlist-tabs-card { padding: 24px; }
.performer-list { display: grid; gap: 10px; }
.performer-card { display: grid; grid-template-columns: 44px 72px 1fr auto; gap: 10px; align-items: center; width: 100%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.045); color: var(--text); text-align: left; }
.performer-card .rank { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: rgba(94, 234, 212, 0.12); color: var(--accent); font-weight: 900; }
.performer-card strong { font-size: 1.05rem; }
.performer-card span:not(.rank), .performer-card small { color: var(--muted); font-weight: 600; line-height: 1.35; }
.performer-card em { font-style: normal; font-weight: 900; white-space: nowrap; }
.performer-card small { grid-column: 3 / -1; font-size: 0.78rem; }
.compact-news { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); max-height: 520px; overflow: auto; padding-right: 4px; }
.home-research-grid { align-items: start; }
.watchlist-tabs-card { margin: 0 0 24px; }
.household-portfolio-card { padding: 24px; margin: 0 0 24px; }
.portfolio-owner-note { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.portfolio-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.portfolio-tabs button { padding: 9px 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.055); color: var(--text); }
.portfolio-tabs button.active, .portfolio-tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06111f; }
.portfolio-allocation { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: rgba(255, 255, 255, 0.035); }
.allocation-empty { display: grid; gap: 6px; color: var(--muted); line-height: 1.45; }
.allocation-empty strong { color: var(--text); }
.allocation-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.allocation-header h3 { margin: 0; font-size: 1.08rem; }
.allocation-header > span { color: var(--muted); font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.allocation-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.allocation-metrics div { border: 1px solid rgba(94, 234, 212, 0.18); border-radius: 16px; padding: 10px; background: rgba(94, 234, 212, 0.055); }
.allocation-metrics span, .allocation-row small, .owner-split-label span { display: block; color: var(--muted); font-size: 0.72rem; line-height: 1.35; }
.allocation-metrics strong { display: block; margin-top: 3px; color: var(--text); }
.allocation-owner-split { display: grid; gap: 8px; margin-bottom: 14px; }
.owner-split-row, .allocation-row { display: grid; gap: 6px; }
.owner-split-label, .allocation-row-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.owner-split-label strong, .allocation-row-top strong { color: var(--text); }
.owner-split-label span, .allocation-row-top span { color: var(--muted); font-size: 0.78rem; font-weight: 800; text-align: right; }
.allocation-bars { display: grid; gap: 10px; }
.allocation-track, .owner-split-track { height: 10px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }
.allocation-track span, .owner-split-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 22px rgba(94, 234, 212, 0.25); }
.category-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.category-tabs button { padding: 9px 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.055); color: var(--text); }
.category-tabs button.active, .category-tabs button[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06111f; }
.watchlist-tab-panel { border: 1px solid var(--line); border-radius: 22px; padding: 18px; background: rgba(255, 255, 255, 0.035); }
.watchlist-tab-header { margin-bottom: 16px; }
.watchlist-tab-header h3 { margin: 0; font-size: 1.15rem; line-height: 1.35; }
.tabbed-watchlist { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tabbed-watchlist.watchlist { display: grid; }

@media (max-width: 900px) {
  .landing-grid { display: block; }
  .market-pulse-card { margin-top: 24px; }
  .hero-actions { justify-items: start; }
  .performer-card { grid-template-columns: 40px 62px 1fr; }
  .performer-card em { grid-column: 2 / -1; }
  .performer-card small { grid-column: 2 / -1; }
  .watchlist-attributes { grid-template-columns: 1fr; }
}

/* SignalStack 2.0 premium command center */
.top-nav {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.78);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}
body.light .top-nav { background: rgba(255, 255, 255, 0.78); }
.top-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 999px;
}
.top-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.nav-search { margin-left: auto; display: flex; gap: 8px; align-items: center; min-width: 260px; }
.nav-search input { margin: 0; padding: 10px 12px; border-radius: 999px; }
.nav-search button { padding: 10px 14px; border-radius: 999px; }
.landing-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(94, 234, 212, 0.12), transparent 36%),
    linear-gradient(145deg, rgba(139, 92, 246, 0.20), transparent 42%),
    var(--card);
}
.landing-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(94,234,212,0.22), transparent 62%);
  pointer-events: none;
}
.command-center {
  display: grid;
  gap: 18px;
  padding: 24px;
  margin: 0 0 24px;
  border-color: rgba(94, 234, 212, 0.24);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.08), rgba(139, 92, 246, 0.05)),
    var(--card);
}
.command-copy { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.command-copy h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); letter-spacing: -0.04em; }
.command-copy .subhead { max-width: 640px; margin: 8px 0 0; font-size: 0.98rem; }
.command-metrics {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.command-stat, .skeleton-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.command-stat span, .risk-chip span { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.10em; }
.command-stat strong {
  display: block;
  margin: 8px 0;
  font-size: 1.35rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.command-stat.hero-stat strong { font-size: clamp(2rem, 4vw, 3.2rem); }
.command-stat small, .risk-chip small { display: block; color: var(--muted); line-height: 1.42; }
.insight-summary {
  border: 1px solid rgba(94, 234, 212, 0.22);
  border-radius: 24px;
  padding: 18px;
  background: rgba(94, 234, 212, 0.06);
}
.insight-summary h3 { margin: 0 0 10px; font-size: 1.1rem; }
.insight-summary ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.insight-summary li { color: var(--muted); line-height: 1.55; }
.risk-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.risk-chip {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}
.risk-chip strong { display: block; margin: 6px 0 4px; color: var(--text); font-size: 1.05rem; }
.risk-chip.warning { border-color: rgba(251, 191, 36, 0.42); background: rgba(251, 191, 36, 0.09); }
.risk-chip.warning strong { color: #fbbf24; }
.decision-desk,
.thesis-tracker {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
}
.decision-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.decision-header h3 { margin: 0; font-size: 1.2rem; }
.decision-header > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.decision-grid,
.thesis-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.decision-card,
.thesis-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(30, 41, 59, 0.72);
}
body.light .decision-card,
body.light .thesis-card,
body.light .decision-desk,
body.light .thesis-tracker { background: rgba(248, 250, 252, 0.92); }
.decision-card span,
.thesis-card span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.decision-card strong,
.thesis-card strong { display: block; margin: 7px 0; color: var(--text); font-size: 1.05rem; line-height: 1.2; }
.decision-card p,
.thesis-card p,
.thesis-card small { color: var(--muted); line-height: 1.48; }
.primary-decision { border-color: rgba(212, 175, 55, 0.42); background: rgba(212, 175, 55, 0.09); }
.warning-card { border-color: rgba(251, 191, 36, 0.34); background: rgba(251, 191, 36, 0.075); }
.mini-action { margin-top: 10px; padding: 9px 12px; font-size: 0.78rem; }
.cool-head-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cool-head-checklist span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.78rem;
  font-weight: 800;
}
.thesis-card div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.thesis-card div span { text-align: right; text-transform: none; letter-spacing: 0; font-weight: 700; }
.search-card {
  background:
    linear-gradient(180deg, rgba(139, 92, 246, 0.08), transparent 38%),
    var(--card);
}
.watchlist-row, .performer-card, .news-item, .position, .metric-card, .position-detail-card {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.watchlist-row:hover, .performer-card:hover, .news-item:hover, .position:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, 0.32);
  background: rgba(255, 255, 255, 0.065);
}
@media (max-width: 980px) {
  .top-nav { border-radius: 24px; flex-wrap: wrap; position: static; }
  .nav-search { width: 100%; min-width: 0; margin-left: 0; }
  .command-copy { display: block; }
  .command-metrics, .risk-panel, .decision-grid, .thesis-grid { grid-template-columns: 1fr; }
  .decision-header, .thesis-card div { display: block; }
  .decision-header > span, .thesis-card div span { text-align: left; margin-top: 6px; }
}

/* SignalStack 2.0 polish pass */
.landing-hero {
  min-height: 380px;
  align-items: stretch;
}
.landing-hero > div:first-child {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
}
.landing-hero h1 {
  max-width: 880px;
  font-size: clamp(2.4rem, 5.2vw, 4.55rem);
  line-height: 0.98;
}
.hero-actions {
  position: relative;
  z-index: 1;
  min-width: 300px;
  align-self: stretch;
  align-content: start;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.045);
}
.hero-actions::before {
  content: "Market desk";
  display: block;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.hero-actions .currency-control,
.hero-actions .refresh-status,
.hero-actions .ghost {
  width: 100%;
}
.hero-actions .refresh-status {
  white-space: normal;
  line-height: 1.35;
}
.top-nav {
  padding: 12px;
}
.top-nav a {
  font-size: 0.86rem;
  padding: 11px 14px;
}
@media (max-width: 980px) {
  .landing-hero { min-height: 0; }
  .hero-actions { min-width: 0; margin-top: 18px; }
}

/* Premium private-wealth palette refresh — calmer, less neon, more financial. */
:root {
  color-scheme: dark;
  --bg: #07101c;
  --card: rgba(15, 23, 42, 0.92);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #d4af37;
  --accent-2: #38bdf8;
  --danger: #ef4444;
  --positive: #22c55e;
  --panel: rgba(17, 24, 39, 0.82);
  --panel-soft: rgba(30, 41, 59, 0.72);
}

body.light {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: rgba(255, 255, 255, 0.94);
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.14);
  --accent: #b8860b;
  --accent-2: #0369a1;
  --danger: #dc2626;
  --positive: #15803d;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-soft: rgba(241, 245, 249, 0.9);
}

body {
  background:
    radial-gradient(circle at top left, rgba(212, 175, 55, 0.13), transparent 31rem),
    radial-gradient(circle at 82% 12%, rgba(56, 189, 248, 0.11), transparent 28rem),
    linear-gradient(135deg, #07101c 0%, #0b1220 46%, #111827 100%);
}

body.light {
  background:
    radial-gradient(circle at top left, rgba(184, 134, 11, 0.13), transparent 30rem),
    radial-gradient(circle at 82% 12%, rgba(3, 105, 161, 0.1), transparent 28rem),
    linear-gradient(135deg, #f8fafc 0%, #eef4fb 55%, #e8eef7 100%);
}

.card,
.top-nav,
.command-center,
.landing-hero,
.command-card,
.readout-card,
.ticker-research-card,
.portfolio-card,
.watchlist-card,
.news-card,
.search-card,
.ideas {
  background: linear-gradient(180deg, var(--card), rgba(11, 18, 32, 0.84));
  border-color: var(--line);
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.28);
}

body.light .card,
body.light .top-nav,
body.light .command-center,
body.light .landing-hero,
body.light .command-card,
body.light .readout-card,
body.light .ticker-research-card,
body.light .portfolio-card,
body.light .watchlist-card,
body.light .news-card,
body.light .search-card,
body.light .ideas {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
}

button,
.range-tabs button.active,
.portfolio-owner-tabs button[aria-selected="true"] {
  background: linear-gradient(135deg, #f2c94c, #d4af37);
  color: #101827;
}

button.ghost,
.range-tabs button,
.portfolio-owner-tabs button {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}

.positive { color: var(--positive); }
.negative { color: var(--danger); }
.eyebrow,
.position-value,
#portfolioValue span,
.news-item a,
.watchlist-company-name,
.position-context,
.watchlist-attribute b {
  color: var(--accent);
}

.command-card,
.readout-card,
.chart-metric,
.metric-card,
.news-item,
.position,
.watchlist-row,
.watchlist-attribute,
.risk-chip,
.insight-card {
  background: var(--panel-soft);
  border-color: var(--line);
}

.chart-shell {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(15, 23, 42, 0.36));
}

body.light .chart-shell {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.86));
}

canvas {
  background: rgba(2, 6, 23, 0.2);
}

body.light canvas {
  background: rgba(255, 255, 255, 0.72);
}

/* QA fix pass — clearer failed lookups and easier dashboard scanning. */
.quote-error,
.quote-loading {
  display: grid;
  gap: 6px;
  border-color: rgba(251, 191, 36, 0.34);
  background: rgba(251, 191, 36, 0.075);
  line-height: 1.45;
}
.quote-error strong { color: var(--text); font-size: 1rem; }
.quote-error span { display: block; color: var(--muted); }
.quote-loading { border-color: var(--line); background: var(--panel-soft); }

.metric-card,
.chart-metric,
.position,
.position-detail-card,
.watchlist-row,
.watchlist-attribute,
.news-item,
.risk-chip {
  background: rgba(30, 41, 59, 0.78);
}
body.light .metric-card,
body.light .chart-metric,
body.light .position,
body.light .position-detail-card,
body.light .watchlist-row,
body.light .watchlist-attribute,
body.light .news-item,
body.light .risk-chip {
  background: rgba(248, 250, 252, 0.94);
}
.metric-card,
.position-detail-card,
.chart-metric { padding: 12px; }
.metric-card strong,
.position-detail-card strong,
.chart-metric strong { line-height: 1.28; }
.metric-card small,
.position-detail-card small,
.news-item p,
.news-item li,
.watchlist-row span,
.watchlist-attribute small,
.position p,
.position-insight,
.measurement-note,
.chart-summary {
  color: color-mix(in srgb, var(--muted) 88%, var(--text));
}
.metric-card small,
.position-detail-card small,
.watchlist-attribute small,
.news-item small { font-size: 0.78rem; }
.position { padding: 18px; }
.positions { gap: 16px; }
.position-symbol { font-size: 1.22rem; }
.position-value { color: var(--text); }
.position-details { margin-top: 14px; }
.position-detail-grid { gap: 10px; }
.position-insight {
  padding: 12px;
  border-color: rgba(212, 175, 55, 0.26);
  background: rgba(212, 175, 55, 0.07);
}
.watchlist { gap: 12px; }
.watchlist-row { padding: 14px; }
.watchlist-symbol-block strong { font-size: 1.12rem; }
.watchlist-company-name,
.watchlist-attribute b { color: var(--text); }
.watchlist-attribute {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.42);
  padding: 10px;
}
body.light .watchlist-attribute { background: rgba(241, 245, 249, 0.88); }
.news-list { gap: 16px; }
.news-item { padding: 18px; }
.news-item h3 { margin-bottom: 10px; }
.news-item p { margin: 0 0 10px; }
.news-item li { line-height: 1.45; }
.news-item a { color: var(--text); }
.chart-metrics { grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 10px; }
.chart-metric span { font-size: 0.76rem; }
.chart-metric strong { font-size: 0.98rem; }
.command-stat strong,
.allocation-metrics strong,
#portfolioValue span { color: var(--text); }

/* Secure auth/admin pages */
.auth-pending main > :not(.secure-user-bar) { visibility: hidden; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; }
.auth-card { width: min(620px, 100%); padding: 32px; }
.auth-card h1 { font-size: clamp(2.2rem, 8vw, 4rem); }
.form-message { min-height: 1.4em; color: var(--muted); line-height: 1.5; }
.form-message.error { color: var(--danger); }
.secure-user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}
.secure-user-bar > div { display: flex; gap: 10px; align-items: center; }
.button-link {
  display: inline-block;
  border-radius: 16px;
  padding: 13px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111f;
  text-decoration: none;
  font-weight: 800;
}
.button-link.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.admin-shell { display: grid; gap: 24px; }
.admin-card, .admin-create-card { padding: 24px; }
.admin-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.admin-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; align-items: end; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
.admin-table th { color: var(--accent); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; }
.admin-table td small { display: block; color: var(--muted); margin-top: 4px; }
.event-list { display: grid; gap: 10px; max-height: 620px; overflow: auto; padding-right: 4px; }
.event-row { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: rgba(255, 255, 255, 0.04); }
.event-row strong, .event-row span, .event-row small { display: block; }
.event-row span, .event-row small { color: var(--muted); margin-top: 3px; line-height: 1.35; }
