/* ══════════════════════════════════════════════════════════════
   Reset
══════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Global hidden utility — used by show()/hide() JS helpers */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   Design Tokens
══════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:  #07090f;
  --s1:  #090c15;
  --s2:  #0c1020;
  --s3:  #101629;
  --s4:  #141d33;

  /* Borders — slightly more visible */
  --b1:  #1c2840;
  --b2:  #253560;
  --b3:  #2e4070;

  /* Text — significantly brighter for readability */
  --tx:  #edf4fc;
  --tx2: #90b4d4;
  --tx3: #5a7fa0;

  /* Accent — teal/cyan */
  --ac:      #00d4ff;
  --ac2:     #009abb;
  --ac-dim:  rgba(0,212,255,.08);
  --ac-glow: rgba(0,212,255,.18);
  --ac-brd:  rgba(0,212,255,.28);

  /* Gain — green */
  --gn:      #22c55e;
  --gn-dim:  rgba(34,197,94,.10);
  --gn-glow: rgba(34,197,94,.24);
  --gn-brd:  rgba(34,197,94,.28);

  /* Loss — red */
  --ls:      #f05050;
  --ls-dim:  rgba(240,80,80,.10);
  --ls-glow: rgba(240,80,80,.24);
  --ls-brd:  rgba(240,80,80,.28);

  /* Warning — amber */
  --wn:      #f5a623;
  --wn-dim:  rgba(245,166,35,.10);

  /* Typography */
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Radii */
  --r-xs: 3px;
  --r-sm: 5px;
  --r:    8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Layout */
  --sw:   252px;
  --th:   28px;
  --tabh: 50px;
}

/* ══════════════════════════════════════════════════════════════
   Light Theme Overrides
══════════════════════════════════════════════════════════════ */
body.light {
  --bg:  #f0f4f8;
  --s1:  #ffffff;
  --s2:  #f5f7fa;
  --s3:  #edf0f5;
  --s4:  #e3e8f0;
  --b1:  #d8e0eb;
  --b2:  #c4cedc;
  --b3:  #adbacb;
  --tx:  #0d1117;
  --tx2: #3a5068;
  --tx3: #6b8aa0;
  --ac:      #0088bb;
  --ac2:     #006688;
  --ac-dim:  rgba(0,136,187,.08);
  --ac-glow: rgba(0,136,187,.14);
  --ac-brd:  rgba(0,136,187,.24);
  --gn:      #16a34a;
  --gn-dim:  rgba(22,163,74,.09);
  --gn-glow: rgba(22,163,74,.20);
  --gn-brd:  rgba(22,163,74,.25);
  --ls:      #dc2626;
  --ls-dim:  rgba(220,38,38,.09);
  --ls-glow: rgba(220,38,38,.20);
  --ls-brd:  rgba(220,38,38,.25);
  --wn:      #b45309;
  --wn-dim:  rgba(180,83,9,.09);
}

/* Keep landing page text readable on its dark background */
body.light .landing {
  --tx:  #edf4fc;
  --tx2: #90b4d4;
  --tx3: #5a7fa0;
}

/* Badges: designed for dark bg — darken them for white background */
body.light .source-badge { filter: saturate(1.4) brightness(0.52); }

/* Scrollbar adapts automatically via vars; force thumb visibility */
body.light ::-webkit-scrollbar-thumb { background: var(--b2); }

/* Theme toggle button */
.theme-toggle {
  margin-left: auto;
  background: none;
  border: 1px solid var(--b2);
  border-radius: var(--r-sm);
  color: var(--tx2);
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--tx); background: var(--s3); border-color: var(--b3); }

/* ══════════════════════════════════════════════════════════════
   Base
══════════════════════════════════════════════════════════════ */
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font);
  font-size: 14px;
  background: var(--bg);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input  { font-family: var(--font); }

/* ══════════════════════════════════════════════════════════════
   Layout
══════════════════════════════════════════════════════════════ */
.layout {
  display: grid;
  grid-template-columns: var(--sw) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════
   Sidebar
══════════════════════════════════════════════════════════════ */
.sidebar {
  background: var(--s1);
  border-right: 1px solid var(--b1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Brand */
.sidebar-header {
  padding: 0 14px;
  height: 44px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, var(--s2) 0%, var(--s1) 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 6px;
  margin: -4px -6px;
  transition: background 0.15s;
}
.sidebar-brand:hover {
  background: var(--ac-dim);
}

.brand-logo {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-svg { width: 22px; height: 22px; }

.brand-live {
  position: absolute;
  top: 0; right: -3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gn);
  animation: live-pulse 2s ease-in-out infinite;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}

.brand-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--tx);
  letter-spacing: -.3px;
}

.brand-by {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .8px;
}

/* Add ticker row */
.add-row {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
}

.add-row input {
  flex: 1;
  min-width: 0;
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: var(--r-sm);
  color: var(--tx);
  padding: 0 10px;
  height: 30px;
  font-size: 12px;
  font-family: var(--mono);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  text-transform: uppercase;
}

.add-row input::placeholder { color: var(--tx3); font-family: var(--font); text-transform: none; }
.add-row input:focus { border-color: var(--ac-brd); box-shadow: 0 0 0 2px var(--ac-glow); }

.add-row button {
  width: 30px; height: 30px;
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: var(--r-sm);
  color: var(--ac);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, box-shadow .15s;
  flex-shrink: 0;
}

.add-row button:hover { background: var(--ac-glow); box-shadow: 0 0 8px var(--ac-glow); }
.add-row button:disabled { opacity: .4; cursor: default; }

/* Section label */
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx2);
  padding: 10px 14px 5px;
  flex-shrink: 0;
}

/* Ticker list */
#ticker-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 2px 8px 12px;
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s;
  border: 1px solid transparent;
  margin-bottom: 1px;
  min-height: 48px;
}

.ticker-item:hover { background: var(--s3); }

.ticker-item.active {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
}

.ticker-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.ticker-symbol {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: .3px;
}

.ticker-item.active .ticker-symbol { color: var(--ac); }

.ticker-company {
  font-size: 11px;
  color: var(--tx2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker-remove {
  opacity: 0;
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 15px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: color .12s, opacity .12s;
}

.ticker-item:hover .ticker-remove { opacity: 1; }
.ticker-remove:hover { color: var(--ls); }

.ticker-spark-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.ticker-spark {
  display: block;
  width: 72px;
  height: 28px;
  border-radius: 3px;
  opacity: .9;
}

.ticker-price-row {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.ticker-price {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--tx);
  letter-spacing: .01em;
}

.ticker-change {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.ticker-change.up   { color: var(--gn); }
.ticker-change.down { color: var(--ls); }
.ticker-change.flat { color: var(--tx3); }

/* ══════════════════════════════════════════════════════════════
   Main Column
══════════════════════════════════════════════════════════════ */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  background: var(--bg);
}

/* ══════════════════════════════════════════════════════════════
   Market Tape
══════════════════════════════════════════════════════════════ */
.market-tape {
  height: var(--th);
  background: var(--s1);
  border-bottom: 1px solid var(--b1);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.tape-inner {
  display: flex;
  align-items: center;
  white-space: nowrap;
  height: 100%;
}

.market-tape.tape-ready .tape-inner {
  animation: tape-scroll 55s linear infinite;
}

.market-tape.tape-ready .tape-inner:hover {
  animation-play-state: paused;
}

.tape-placeholder {
  font-size: 11px;
  color: var(--tx2);
  padding: 0 16px;
}

.tape-sep {
  color: var(--b3);
  margin: 0 8px;
  font-size: 10px;
  flex-shrink: 0;
}

.tape-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tape-ticker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  letter-spacing: .3px;
}

.tape-price {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--tx);
}

.tape-chg {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
}

.tape-chg.up   { color: var(--gn); }
.tape-chg.down { color: var(--ls); }

/* ══════════════════════════════════════════════════════════════
   Tab Bar (pill style)
══════════════════════════════════════════════════════════════ */
.main-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--b1);
  background: var(--s1);
  flex-shrink: 0;
  padding: 5px 8px;
  gap: 2px;
}

.main-tab {
  height: 34px;
  padding: 0 14px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--tx2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .1px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color .15s, background .15s, border-color .15s;
}

.main-tab:hover {
  color: var(--tx);
  background: var(--s3);
}

.main-tab.active {
  color: var(--ac);
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  font-weight: 600;
}

.tab-icon {
  font-size: 13px;
  opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   View Panels
══════════════════════════════════════════════════════════════ */
.view-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.view-panel.hidden { display: none; }

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--s2) 0%, transparent 100%);
}

.view-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: -.2px;
}

.view-subtitle {
  font-size: 12px;
  color: var(--tx2);
  margin-top: 3px;
}

/* Ghost button */
.btn-ghost {
  background: none;
  border: 1px solid var(--b2);
  border-radius: var(--r);
  color: var(--tx2);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: border-color .15s, color .15s, background .15s;
  flex-shrink: 0;
}

.btn-ghost:hover {
  border-color: var(--ac-brd);
  color: var(--ac);
  background: var(--ac-dim);
}

/* Shared loading / empty / error */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--tx3);
  font-size: 12px;
}

.loading.hidden { display: none; }

.spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--b3);
  border-top-color: var(--ac);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--tx3);
  font-size: 12px;
}

.empty-state.hidden { display: none; }

.error-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  margin: 12px 16px;
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.18);
  border-radius: var(--r);
  font-size: 12px;
  color: var(--tx2);
}

.err-icon { color: var(--ls); font-size: 14px; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   Stock Picker Component
══════════════════════════════════════════════════════════════ */
.tab-stock-picker {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  background: var(--s1);
}

.picker-row {
  position: relative;
}

.picker-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.picker-icon {
  position: absolute;
  left: 11px;
  font-size: 14px;
  color: var(--ac);
  pointer-events: none;
  z-index: 1;
}

.picker-input {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r);
  color: var(--tx);
  padding: 0 34px 0 34px;
  height: 34px;
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.picker-input::placeholder { color: var(--tx2); }
.picker-input:focus { border-color: var(--ac-brd); box-shadow: 0 0 0 3px var(--ac-glow); }

.picker-clear {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 16px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: var(--r-xs);
  transition: color .12s;
}

.picker-clear:hover { color: var(--tx); }
.picker-clear.hidden { display: none; }

/* Dropdown */
.picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--s3);
  border: 1px solid var(--b3);
  border-radius: var(--r);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  z-index: 200;
  overflow: hidden;
  max-height: 280px;
  overflow-y: auto;
}

.picker-dropdown.hidden { display: none; }

.picker-dropdown-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--b1);
}

.picker-dropdown-item:last-child { border-bottom: none; }
.picker-dropdown-item:hover { background: var(--s4); }

.picker-dropdown-item.picker-loading,
.picker-dropdown-item.picker-no-results {
  grid-template-columns: 1fr;
  color: var(--tx2);
  font-size: 12px;
  cursor: default;
  justify-content: center;
  text-align: center;
}

.picker-item-ticker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: var(--r-xs);
  padding: 2px 6px;
  text-align: center;
  white-space: nowrap;
}

.picker-item-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-item-exchange {
  font-size: 10px;
  color: var(--tx3);
  white-space: nowrap;
}

/* Chips */
.picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 8px;
  min-height: 0;
}

.watchlist-chip {
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: 20px;
  color: var(--tx2);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  cursor: pointer;
  letter-spacing: .3px;
  transition: background .12s, color .12s, border-color .12s;
}

.watchlist-chip:hover {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

.watchlist-chip.active {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

.chip-all-markets {
  font-weight: 600;
  letter-spacing: .2px;
}

.picker-chips-empty {
  font-size: 11px;
  color: var(--tx3);
  padding-top: 6px;
}

/* ══════════════════════════════════════════════════════════════
   Welcome Screen
══════════════════════════════════════════════════════════════ */
.welcome {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px;
  text-align: center;
  overflow: hidden;
}

.welcome-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: .4;
  pointer-events: none;
}

.welcome-icon {
  font-size: 32px;
  color: var(--ac);
  opacity: .4;
  position: relative;
}

.welcome h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
  position: relative;
}

.welcome p {
  font-size: 12px;
  color: var(--tx3);
  position: relative;
}

/* ══════════════════════════════════════════════════════════════
   News Tab
══════════════════════════════════════════════════════════════ */
.news-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.news-panel.hidden { display: none; }
.welcome.hidden    { display: none; }

/* ── Home Split Layout (Ideas + Market News) ── */
.home-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.home-split.hidden { display: none; }

.split-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ideas-col       { flex: 0 0 56%; border-right: 1px solid var(--b1); }
.market-news-col { flex: 1; }

.split-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  background: var(--s1);
  gap: 10px;
}
.split-col-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: -.2px;
  margin: 0;
}
.split-col-sub {
  display: block;
  font-size: 11px;
  color: var(--tx2);
  margin-top: 2px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  background: var(--s1);
  gap: 12px;
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.panel-title h2 {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--ac);
  letter-spacing: .3px;
  white-space: nowrap;
}

.panel-company {
  font-size: 12px;
  color: var(--tx2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-count {
  font-size: 11px;
  color: var(--tx2);
  white-space: nowrap;
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 2px 8px;
}

/* Source tabs */
.source-tabs {
  display: flex;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--b1);
  background: var(--s1);
  flex-shrink: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.source-tabs::-webkit-scrollbar { display: none; }

.source-tab {
  height: 36px;
  padding: 0 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--tx2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color .12s, border-color .12s;
}

.source-tab:hover { color: var(--tx2); }
.source-tab.active { color: var(--tx); border-bottom-color: var(--ac); }

.source-tab .count {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx2);
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: 8px;
  padding: 1px 5px;
}

.source-tab.active .count { color: var(--ac); border-color: var(--ac-brd); background: var(--ac-dim); }

/* News grid — compact rows */
.news-grid {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.news-card {
  border-bottom: 1px solid var(--b1);
  transition: background .1s;
  animation: card-in .2s ease both;
  animation-delay: calc(var(--i, 0) * 25ms);
}

.news-card:hover { background: var(--s2); }

.news-card a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  row-gap: 3px;
  padding: 10px 18px;
  text-decoration: none;
  color: inherit;
  align-items: start;
}

.card-time {
  grid-column: 1; grid-row: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 1px;
}

.card-abs-time {
  font-size: 11px;
  color: var(--tx2);
  white-space: nowrap;
}

.card-rel-time {
  font-size: 11px;
  color: var(--tx2);
  white-space: nowrap;
}

.card-rel-time::before { content: "·"; margin-right: 4px; }

.source-badge {
  grid-column: 2; grid-row: 1;
  display: inline-flex;
  align-self: start;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  white-space: nowrap;
  width: fit-content;
}

.card-title {
  grid-column: 1 / -1; grid-row: 2;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--tx);
  line-height: 1.5;
}

.news-card:hover .card-title { color: var(--ac); }

/* Source badge colours */
.badge-yahoo       { background: rgba(100,149,237,.12); color: #6495ed;  border: 1px solid rgba(100,149,237,.22); }
.badge-newsapi     { background: rgba(0,212,255,.08);   color: var(--ac); border: 1px solid var(--ac-brd); }
.badge-finnhub     { background: rgba(34,197,94,.08);   color: var(--gn); border: 1px solid var(--gn-brd); }
.badge-marketbeat  { background: rgba(168,85,247,.1);   color: #a855f7;  border: 1px solid rgba(168,85,247,.22); }
/* New sources */
.badge-google       { background: rgba(66,133,244,.1);   color: #4285f4;  border: 1px solid rgba(66,133,244,.22); }
.badge-seeking-alpha{ background: rgba(21,128,61,.1);    color: #4ade80;  border: 1px solid rgba(21,128,61,.25); }
.badge-benzinga     { background: rgba(234,179,8,.08);   color: #facc15;  border: 1px solid rgba(234,179,8,.22); }
/* Publishers via Google News */
.badge-bloomberg    { background: rgba(249,115,22,.1);   color: #fb923c;  border: 1px solid rgba(249,115,22,.22); }
.badge-reuters      { background: rgba(220,38,38,.1);    color: #f87171;  border: 1px solid rgba(220,38,38,.22); }
.badge-barrons      { background: rgba(180,83,9,.1);     color: #fdba74;  border: 1px solid rgba(180,83,9,.22); }
.badge-cnbc         { background: rgba(59,130,246,.1);   color: #60a5fa;  border: 1px solid rgba(59,130,246,.22); }
.badge-wsj          { background: rgba(148,163,184,.1);  color: #cbd5e1;  border: 1px solid rgba(148,163,184,.2); }
.badge-forbes       { background: rgba(139,92,246,.1);   color: #a78bfa;  border: 1px solid rgba(139,92,246,.22); }
.badge-bi           { background: rgba(20,184,166,.08);  color: #2dd4bf;  border: 1px solid rgba(20,184,166,.22); }
.badge-investopedia { background: rgba(6,182,212,.08);   color: #22d3ee;  border: 1px solid rgba(6,182,212,.22); }
.badge-fool         { background: rgba(239,68,68,.08);   color: #fca5a5;  border: 1px solid rgba(239,68,68,.2); }
.badge-ft           { background: rgba(245,158,11,.08);  color: #fcd34d;  border: 1px solid rgba(245,158,11,.22); }
.badge-marketwatch  { background: rgba(16,185,129,.08);  color: #6ee7b7;  border: 1px solid rgba(16,185,129,.22); }
.badge-default      { background: rgba(100,116,139,.1);  color: #94a3b8;  border: 1px solid rgba(100,116,139,.2); }
.badge-fintel     { background: rgba(245,158,11,.08);  color: var(--wn); border: 1px solid rgba(245,158,11,.22); }
.badge-13f        { background: rgba(236,72,153,.08);  color: #ec4899; border: 1px solid rgba(236,72,153,.22); }
.badge-morningstar{ background: rgba(239,68,68,.08);   color: #f87171; border: 1px solid rgba(239,68,68,.2); }
.badge-zacks      { background: rgba(30,64,175,.1);   color: #93c5fd;  border: 1px solid rgba(30,64,175,.25); }
.badge-thestreet  { background: rgba(148,163,184,.1); color: #e2e8f0;  border: 1px solid rgba(148,163,184,.2); }
.badge-ibd        { background: rgba(79,70,229,.1);   color: #a5b4fc;  border: 1px solid rgba(79,70,229,.22); }
.badge-finviz     { background: rgba(59,130,246,.1);   color: #60a5fa; border: 1px solid rgba(59,130,246,.22); }
.badge-whalewisdom{ background: rgba(20,184,166,.08);  color: #2dd4bf; border: 1px solid rgba(20,184,166,.22); }
.badge-tipranks   { background: rgba(251,146,60,.08);  color: #fb923c; border: 1px solid rgba(251,146,60,.22); }
.badge-sec        { background: rgba(163,230,53,.08);  color: #a3e635; border: 1px solid rgba(163,230,53,.22); }

/* ══════════════════════════════════════════════════════════════
   Fundamentals Tab
══════════════════════════════════════════════════════════════ */
.fundamentals-grid {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.fund-card {
  background: var(--s1);
  margin: 12px 16px;
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: card-in .3s ease both;
}

.fund-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--b1);
  background: linear-gradient(90deg, var(--s3), var(--s2));
  flex-wrap: wrap;
}

.fund-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.fund-ticker-badge {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--ac);
  flex-shrink: 0;
  letter-spacing: .5px;
}

.fund-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fund-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fund-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.fund-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--s4);
  border: 1px solid var(--b2);
  color: var(--tx2);
  white-space: nowrap;
}

.fund-tag-sector { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); }

.fund-price-box {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.fund-price {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--tx);
}

.fund-change {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--r-sm);
}

.fund-change.up   { background: var(--gn-dim); color: var(--gn); }
.fund-change.down { background: var(--ls-dim); color: var(--ls); }

.fund-employees {
  display: block;
  font-size: 10px;
  color: var(--tx3);
  margin-top: 2px;
}

/* Sections */
.fund-section {
  padding: 12px 20px;
  border-bottom: 1px solid var(--b1);
}

.fund-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--tx2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fund-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--b1);
}

.fund-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}

.fund-metric {
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .12s, background .12s;
}

.fund-metric:hover { background: var(--s4); border-color: var(--b2); }

.metric-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--tx2);
  white-space: nowrap;
}

.metric-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
}

.metric-value.na   { color: var(--tx2); font-size: 13px; font-weight: 400; }
.metric-good       { color: var(--gn); }
.metric-bad        { color: var(--ls); }
.metric-warn       { color: var(--wn); }

.fund-metric-warn   { border-color: rgba(245,166,35,.4) !important; background: rgba(245,166,35,.06) !important; }
.metric-caution-val { opacity: .45; }
.metric-note {
  font-size: 10px;
  font-weight: 600;
  color: var(--wn);
  line-height: 1.2;
  cursor: help;
  margin-top: 1px;
}

/* Description */
.fund-description {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--tx2);
  line-height: 1.7;
  border-bottom: 1px solid var(--b1);
}

.fund-website {
  font-size: 11px;
  color: var(--ac);
  text-decoration: none;
  display: inline-block;
  margin-top: 6px;
}

.fund-website:hover { text-decoration: underline; }

.fund-error {
  padding: 20px;
  font-size: 12px;
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ══════════════════════════════════════════════════════════════
   Analyst Estimates Card
══════════════════════════════════════════════════════════════ */
.est-card {
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0 20px 16px;
}
.est-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--b1);
  background: var(--s2);
}
.est-title    { font-size: 13px; font-weight: 700; color: var(--tx); }
.est-subtitle { font-size: 11px; color: var(--tx3); }

.est-body { padding: 4px 0 8px; }

.est-section { margin: 8px 16px 4px; }
.est-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tx3);
  margin-bottom: 6px;
}
.est-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--b1);
  font-size: 12.5px;
  flex-wrap: wrap;
}
.est-row:last-child { border-bottom: none; }
.est-label  { color: var(--tx2); min-width: 150px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; }
.est-date-badge {
  display: inline-block;
  font-size: 10px;
  font-family: var(--mono);
  font-weight: 600;
  color: var(--ac);
  background: rgba(0,206,255,.08);
  border: 1px solid var(--ac-brd);
  border-radius: 8px;
  padding: 1px 6px;
  letter-spacing: .02em;
}
.est-val    { font-weight: 700; color: var(--tx); font-family: var(--mono); min-width: 72px; }
.est-range  { font-size: 11px; color: var(--tx3); font-family: var(--mono); }
.est-growth-up { color: var(--gn); font-weight: 600; font-size: 12px; }
.est-growth-dn { color: var(--ls); font-weight: 600; font-size: 12px; }

/* Estimates table layout */
.est-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.est-tbl th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tx3);
  padding: 5px 10px 5px;
  text-align: left;
  border-bottom: 1px solid var(--b1);
  white-space: nowrap;
}
.est-trow { border-bottom: 1px solid rgba(255,255,255,.04); }
.est-trow:last-child { border-bottom: none; }
.est-tcell-period {
  padding: 8px 10px;
  min-width: 140px;
}
.est-period-main {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tx);
  display: block;
}
.est-period-date {
  font-size: 10px;
  color: var(--tx3);
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
}
.est-tcell-val {
  padding: 8px 10px;
  font-family: var(--mono);
}
.est-tcell-growth { padding: 8px 10px; }
.est-tcell-meta   { padding: 8px 10px; }
.est-ya {
  font-size: 10px;
  color: var(--tx3);
  display: block;
  margin-top: 2px;
}
.est-n         { font-size: 11px; color: var(--tx3); margin-left: auto; }
.est-rev-up    { font-size: 11px; font-weight: 600; color: var(--gn); background: rgba(33,209,106,.08); border: 1px solid var(--gn-brd); border-radius: 6px; padding: 1px 5px; }
.est-rev-dn    { font-size: 11px; font-weight: 600; color: var(--ls); background: rgba(240,68,68,.08); border: 1px solid var(--ls-brd); border-radius: 6px; padding: 1px 5px; }

/* ══════════════════════════════════════════════════════════════
   13F Holdings Tab
══════════════════════════════════════════════════════════════ */
.holdings-grid {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.holding-card {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 12px 16px;
  animation: card-in .3s ease both;
}

.holding-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(90deg, var(--s3), var(--s2));
  border-bottom: 1px solid var(--b1);
}

.holding-ticker {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--ac);
  flex-shrink: 0;
  letter-spacing: .5px;
}

.holding-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--tx2);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.holding-link {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--tx3);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: color .12s;
}

.holding-link:hover { color: var(--ac); }

.holding-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 12px;
}

.holding-table thead th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx2);
  padding: 8px 20px;
  text-align: left;
  border-bottom: 1px solid var(--b1);
  background: var(--s2);
}

.holding-table tbody tr { border-bottom: 1px solid var(--b1); transition: background .1s; }
.holding-table tbody tr:last-child { border-bottom: none; }
.holding-table tbody tr:hover { background: var(--s3); }
.holding-table td { padding: 9px 20px; color: var(--tx2); }
.holding-table td:first-child { color: var(--tx); font-weight: 600; }

.delta-up   { color: var(--gn); font-size: 10px; margin-left: 4px; }
.delta-down { color: var(--ls); font-size: 10px; margin-left: 4px; }

.holding-error {
  padding: 20px;
  font-size: 12px;
  color: var(--tx2);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Group the source links in the primary card header */
.holding-links { display: flex; gap: 10px; align-items: center; margin-left: auto; flex-shrink: 0; }
.holding-link-fintel { color: var(--wn); }
.holding-link-fintel:hover { color: var(--ac); }

/* ── Second-Source Comparison Card ─────────────────────────────────────── */
.alt-holdings-card {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin: 0 16px 12px;
  animation: card-in .3s ease both;
}
.alt-holdings-header {
  padding: 14px 20px 12px;
  background: linear-gradient(90deg, rgba(245,166,35,.06), var(--s2));
  border-bottom: 1px solid var(--b1);
}
.alt-holdings-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.alt-holdings-title { font-size: 13px; font-weight: 700; color: var(--wn); }
.alt-src-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--s3); color: var(--tx3); padding: 2px 6px; border-radius: 4px;
}
.alt-holdings-note {
  font-size: 11px; color: var(--tx3); margin: 0 0 8px; line-height: 1.5;
}
.alt-fintel-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ac);
  text-decoration: none; transition: opacity .12s;
}
.alt-fintel-link:hover { opacity: .75; }
.alt-fintel-note { font-size: 10px; font-weight: 400; color: var(--tx3); }
.alt-major {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 20px; border-bottom: 1px solid var(--b1);
  background: var(--s2);
}
.alt-major-item { display: flex; flex-direction: column; gap: 1px; }
.alt-major-label { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; color: var(--tx3); }
.alt-major-val   { font-size: 13px; font-weight: 700; font-family: var(--mono); color: var(--tx); }
.alt-subsection  { padding: 12px 20px 0; }
.alt-subsection:last-child { padding-bottom: 14px; }
.alt-subsection-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--tx3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.alt-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.alt-table th {
  text-align: left; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--tx3); padding: 0 8px 5px 0;
  border-bottom: 1px solid var(--b1);
}
.alt-table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--b1); color: var(--tx2); }
.alt-table tr:last-child td { border-bottom: none; }
.alt-table tr:hover td { color: var(--tx); }
.alt-rank  { font-family: var(--mono); font-size: 10px; color: var(--tx3); width: 24px; }
.alt-name  { font-weight: 500; color: var(--tx); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alt-num   { font-family: var(--mono); text-align: right; }
.alt-pct   { font-family: var(--mono); text-align: right; font-size: 10px; color: var(--tx3); }
.alt-date  { font-size: 10px; color: var(--tx3); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   Tech Sub-Tabs
══════════════════════════════════════════════════════════════ */
.tech-sub-tabs {
  display: flex; gap: 4px; padding: 0 16px 0;
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
}
.tech-sub-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--tx3); font-size: 12px; font-weight: 600; padding: 8px 14px;
  cursor: pointer; transition: color .15s, border-color .15s; margin-bottom: -1px;
}
.tech-sub-tab:hover { color: var(--tx); }
.tech-sub-tab.active { color: var(--ac); border-bottom-color: var(--ac); }

/* ══════════════════════════════════════════════════════════════
   Algo Signal Panel
══════════════════════════════════════════════════════════════ */
#algo-view,
#macro-view,
#calendar-view { overflow-y: auto; }
.algo-content { display: flex; flex-direction: column; gap: 20px; padding: 16px; }

/* Header */
.algo-header {
  display: flex; align-items: center; gap: 24px;
  background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm);
  padding: 20px 24px;
}
.algo-gauge-wrap { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.algo-ring { width: 110px; height: 110px; transform: rotate(-90deg); }
.algo-ring-bg   { fill: none; stroke: var(--b1); stroke-width: 10; }
.algo-ring-fill { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.algo-ring-fill.sig-strong-buy,  .algo-ring-fill.sig-buy  { stroke: var(--gn); }
.algo-ring-fill.sig-strong-sell, .algo-ring-fill.sig-sell { stroke: var(--ls); }
.algo-ring-fill.sig-neutral { stroke: var(--ac); }
.algo-score-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.algo-score-num { font-family: var(--mono); font-size: 20px; font-weight: 800; color: var(--tx); }
.algo-score-sub { font-size: 9px; color: var(--tx3); font-weight: 500; }

.algo-header-body { display: flex; flex-direction: column; gap: 6px; }
.algo-ticker-lbl  { font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--ac); }
.algo-signal-label {
  font-size: 20px; font-weight: 700;
}
.algo-signal-label.sig-strong-buy,  .algo-signal-label.sig-buy  { color: var(--gn); }
.algo-signal-label.sig-strong-sell, .algo-signal-label.sig-sell { color: var(--ls); }
.algo-signal-label.sig-neutral { color: var(--wn); }
.algo-confidence   { font-size: 12px; color: var(--tx3); }
.algo-weight-note  { font-size: 9.5px; color: var(--tx3); margin-top: 4px; font-family: var(--mono); }
.algo-score-desc   { font-size: 11px; color: var(--tx2); line-height: 1.5; margin-top: 2px; max-width: 420px; }
.algo-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; margin-left: auto; flex-shrink: 0; }
.algo-tf-bar { display: flex; gap: 3px; }
.algo-tf-btn {
  background: var(--s3); border: 1px solid var(--b1); color: var(--tx3);
  font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
}
.algo-tf-btn:hover  { color: var(--tx); border-color: var(--b2); }
.algo-tf-btn.active { background: var(--ac-dim); color: var(--ac); border-color: var(--ac-brd); }
.algo-tf-note { font-size: 9.5px; color: var(--tx3); font-family: var(--mono); }
/* Chart */
.algo-chart-section { background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm); overflow: clip; }

/* Legend colored line indicators (no special unicode chars needed) */
.acl-line  { display:inline-block; width:16px; height:2.5px; border-radius:1px; vertical-align:middle; margin-right:3px; }
.acl-dash  { display:inline-block; width:16px; height:2.5px; border-radius:1px; vertical-align:middle; margin-right:3px; }
.acl-block { display:inline-block; width:10px; height:10px; border-radius:2px; vertical-align:middle; margin-right:3px; opacity:.7; }
.algo-chart-labels  { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 14px 6px; border-bottom: 1px solid var(--b1); }
.algo-cl { font-size: 9.5px; font-weight: 600; color: var(--tx3); }
.algo-cl-price  { color: var(--tx); }
.algo-cl-sma20  { color: #3b82f6; }
.algo-cl-sma50  { color: #f59e0b; }
.algo-cl-sma200 { color: #ef4444; }
.algo-cl-vwap   { color: #a855f7; }
.algo-cl-bb     { color: var(--ac); }
.algo-cl-fib    { color: #f5a623; }
.algo-canvas-wrap { position: relative; width: 100%; line-height: 0; }
.algo-canvas    { display: block; width: 100%; }
.algo-canvas-ov {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  cursor: crosshair;
  pointer-events: all;
}
.algo-tooltip {
  position: absolute;
  top: 14px;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--tx);
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  min-width: 140px;
}
.algo-tooltip.hidden { display: none; }
.ato-date { font-size: 9.5px; color: var(--tx3); margin-bottom: 6px; letter-spacing: .4px; }
.ato-row  { display: flex; justify-content: space-between; gap: 14px; line-height: 1.8; }
.ato-row-highlight { background: rgba(245,166,35,.08); border-radius: 3px; padding: 0 3px; margin: 0 -3px; }
.ato-lbl  { color: var(--tx3); }
.ato-val  { font-weight: 700; }

/* Narrative */
.algo-narrative { font-size: 13px; color: var(--tx2); line-height: 1.7;
  background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm);
  padding: 14px 16px; }
.algo-narrative-wrap { display: flex; flex-direction: column; gap: 8px; }

/* Section labels */
.algo-section-label {
  font-size: 11px; font-weight: 700; color: var(--tx3); text-transform: uppercase;
  letter-spacing: .05em; display: flex; align-items: center; gap: 8px;
}
.algo-section-note { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 10px; }

/* Indicator grid */
.algo-grid { width: 100%; }

/* Indicator table */
.algo-ind-table {
  width: 100%; border-collapse: collapse;
  background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm);
  overflow: hidden;
}
.algo-ind-table thead th {
  background: var(--s3); font-size: 10px; font-weight: 700; color: var(--tx3);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--b1);
}
.algo-ind-table tbody tr { border-bottom: 1px solid var(--b1); transition: background .1s; }
.algo-ind-table tbody tr:last-child { border-bottom: none; }
.algo-ind-table tbody tr:hover { background: var(--s3); }
.ait-row td { padding: 9px 12px; vertical-align: middle; }
.ait-row.bullish { border-left: 3px solid var(--gn); }
.ait-row.bearish { border-left: 3px solid var(--ls); }
.ait-row.neutral { border-left: 3px solid var(--b2); }

.ait-name { display: flex; flex-direction: column; gap: 2px; min-width: 140px; }
.ait-n    { font-size: 12px; font-weight: 600; color: var(--tx); }
.ait-wt   { font-size: 9.5px; color: var(--tx3); font-family: var(--mono); }

.ait-val  { font-family: var(--mono); font-size: 11px; color: var(--tx); max-width: 260px; word-break: break-word; }

.ait-sig-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  white-space: nowrap;
}
.ait-sig-badge.bullish { background: rgba(33,209,106,.12); color: var(--gn); }
.ait-sig-badge.bearish { background: rgba(240,68,68,.12);  color: var(--ls); }
.ait-sig-badge.neutral { background: var(--s3);            color: var(--tx3); }

.ait-bar  { width: 120px; min-width: 100px; }
.ait-sc   { font-family: var(--mono); font-size: 13px; font-weight: 800; text-align: right; white-space: nowrap; }
.ait-sc.bullish { color: var(--gn); }
.ait-sc.bearish { color: var(--ls); }
.ait-sc.neutral { color: var(--tx3); }
.algo-ind-card {
  background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 5px;
  transition: background .12s;
}
.algo-ind-card.bullish { border-left: 3px solid var(--gn); }
.algo-ind-card.bearish { border-left: 3px solid var(--ls); }
.algo-ind-card.neutral { border-left: 3px solid var(--ac-brd); }
.algo-ind-card:hover   { background: var(--s3); }

.algo-ind-top {
  display: flex; align-items: center; gap: 6px;
}
.algo-ind-icon  { font-size: 14px; flex-shrink: 0; }
.algo-ind-name  { font-size: 12px; font-weight: 700; color: var(--tx); flex: 1; }
.algo-ind-wt    { font-size: 9.5px; color: var(--tx3); font-family: var(--mono); flex-shrink: 0; }
.algo-ind-score { font-family: var(--mono); font-size: 13px; font-weight: 800; flex-shrink: 0; }
.algo-ind-score.bullish { color: var(--gn); }
.algo-ind-score.bearish { color: var(--ls); }
.algo-ind-score.neutral { color: var(--ac); }

/* Bidirectional bar */
.algo-ind-bar-wrap {
  position: relative; height: 6px; background: var(--b1); border-radius: 3px; overflow: visible;
}
.algo-ind-bar-center {
  position: absolute; left: 50%; top: 0; width: 2px; height: 100%;
  background: var(--b2); transform: translateX(-50%); z-index: 1;
}
.algo-ind-bar-fill {
  position: absolute; top: 0; height: 100%; border-radius: 3px; max-width: 50%;
  transition: width .4s ease;
}
.algo-ind-bar-fill.bullish { background: var(--gn); }
.algo-ind-bar-fill.bearish { background: var(--ls); }
.algo-ind-bar-fill.neutral { background: var(--ac); }

.algo-ind-label  { font-size: 10.5px; font-weight: 600; }
.algo-ind-label.bullish { color: var(--gn); }
.algo-ind-label.bearish { color: var(--ls); }
.algo-ind-label.neutral { color: var(--wn); }
.algo-ind-detail { font-size: 10px; color: var(--tx3); }
.algo-ind-val    { font-family: var(--mono); font-size: 10px; color: var(--tx2);
                   background: var(--s3); border-radius: 4px; padding: 2px 6px;
                   width: fit-content; }

/* Bottom row: fib + trade setup */
.algo-bottom-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: start;
}
@media (max-width: 900px) { .algo-bottom-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .algo-bottom-row { grid-template-columns: 1fr; } }

/* Fibonacci table */
.algo-fib-wrap { background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm); padding: 14px; }
.algo-fib-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.algo-fib-table th {
  font-size: 9.5px; color: var(--tx3); text-transform: uppercase;
  font-weight: 700; padding: 4px 8px; text-align: left; border-bottom: 1px solid var(--b1);
}
.algo-fib-table td { font-size: 11px; padding: 5px 8px; color: var(--tx2); }
.algo-fib-table tr:hover td { background: var(--s3); }
.fib-lbl   { color: var(--tx3); font-size: 10.5px; }
.fib-price { font-family: var(--mono); font-weight: 600; color: var(--tx); }
.fib-dist  { font-family: var(--mono); font-size: 10.5px; }
.fib-role  { font-size: 10px; color: var(--tx3); }
.fib-sup td { background: rgba(33,209,106,.07); }
.fib-sup .fib-role { color: var(--gn); font-weight: 700; }
.fib-res td { background: rgba(240,68,68,.07); }
.fib-res .fib-role { color: var(--ls); font-weight: 700; }
.bull { color: var(--gn); }
.bear { color: var(--ls); }

/* Trade setup */
.algo-setup-wrap { display: flex; flex-direction: column; gap: 10px; }
.algo-setup-card {
  background: var(--s2); border: 1px solid var(--b1); border-radius: var(--r-sm);
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
}
.algo-setup-row { display: flex; justify-content: space-between; align-items: center; }
.algo-setup-lbl { font-size: 11px; color: var(--tx3); }
.algo-setup-val { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--tx); }
.algo-setup-val.bull { color: var(--gn); }
.algo-setup-val.bear { color: var(--ls); }
.algo-setup-val.ac   { color: var(--ac); }
.algo-bias-val  { font-family: var(--mono); font-size: 14px; font-weight: 800; }
.algo-disclaimer { font-size: 9.5px; color: var(--tx3); margin: 0; }

/* ══════════════════════════════════════════════════════════════
   Technical Analysis Tab
══════════════════════════════════════════════════════════════ */
.tech-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.tech-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: var(--s1);
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tech-summary-info {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.tech-summary-ticker {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--tx);
  letter-spacing: .3px;
}

.tech-summary-name {
  font-size: 11px;
  color: var(--tx3);
}

.tech-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gauge-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.gauge-pill { display: flex; gap: 3px; align-items: center; }

.gauge-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gauge-dot.bull { background: var(--gn); }
.gauge-dot.bear { background: var(--ls); }
.gauge-dot.neut { background: var(--b3); }

.tech-overall-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.overall-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.overall-signal {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.overall-signal.signal-bullish,
.overall-signal.signal-buy          { background: var(--gn-dim);              color: var(--gn); border: 1px solid var(--gn-brd); }
.overall-signal.signal-strong-buy   { background: rgba(34,197,94,.18);        color: var(--gn); border: 1px solid var(--gn-brd); font-weight: 800; }
.overall-signal.signal-bearish,
.overall-signal.signal-sell         { background: var(--ls-dim);              color: var(--ls); border: 1px solid var(--ls-brd); }
.overall-signal.signal-strong-sell  { background: rgba(239,68,68,.18);        color: var(--ls); border: 1px solid var(--ls-brd); font-weight: 800; }
.overall-signal.signal-neutral      { background: var(--s3);                  color: var(--tx2); border: 1px solid var(--b2); }

/* Chart pattern badge — sits next to Overall signal */
.tech-pattern-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid var(--b2);
}

.tech-pattern-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
  white-space: nowrap;
}

.tech-pattern-badge.pat-dir-bull { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.tech-pattern-badge.pat-dir-bear { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }
.tech-pattern-badge.pat-dir-neut { background: var(--s3);     color: var(--tx2); border: 1px solid var(--b2); }

/* TradingView chart */
.tech-chart-wrap {
  height: 500px;
  flex-shrink: 0;
  background: var(--bg);
  overflow: hidden;
}
.tech-chart-wrap > div,
.tech-chart-wrap iframe { width: 100% !important; height: 100% !important; }
.tv-error {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx3);
  font-size: 12px;
}

/* Finviz toggle button in TF bar */
.chart-src-btn {
  height: 26px;
  padding: 0 11px;
  background: none;
  border: 1px solid var(--b2);
  border-radius: 5px;
  color: var(--tx2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .12s, background .12s, border-color .12s;
}
.chart-src-btn:hover  { color: var(--tx); background: var(--s3); }
.chart-src-btn.active { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

/* Finviz section — appears below TV chart */
.fv-section {
  margin-top: 6px;
  border: 1px solid var(--b1);
  border-radius: 10px;
  flex-shrink: 0;
}
.fv-section-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 7px 12px;
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
}
.fv-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  margin-right: 4px;
  flex-shrink: 0;
}
.fv-period-group {
  display: flex;
  gap: 2px;
  margin-left: auto;
}
.fv-pd-btn {
  height: 22px;
  padding: 0 8px;
  background: none;
  border: 1px solid var(--b2);
  border-radius: 4px;
  color: var(--tx3);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.fv-pd-btn:hover  { color: var(--tx); background: var(--s3); }
.fv-pd-btn.active { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

/* ── Chart type + TA toggle buttons ──────────────────────── */
.tech-chart-types {
  display: flex;
  gap: 3px;
}
.tech-ty-btn {
  height: 26px;
  padding: 0 8px;
  background: none;
  border: 1px solid var(--b2);
  border-radius: 4px;
  color: var(--tx2);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.tech-ty-btn:hover  { color: var(--tx); background: var(--s3); }
.tech-ty-btn.active { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

.tech-ta-btn {
  height: 26px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--b2);
  border-radius: 4px;
  color: var(--tx2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.tech-ta-btn:hover  { color: var(--tx); background: var(--s3); }
.tech-ta-btn.active { color: var(--gn); background: var(--gn-dim); border-color: var(--gn-brd); }

/* ══════════════════════════════════════════════════════════
   Opportunity Score tab
══════════════════════════════════════════════════════════ */
.opp-content { display: flex; flex-direction: column; gap: 20px; overflow-y: auto; flex: 1; min-height: 0; padding: 14px; }

/* ── Header row: gauge + signal ── */
.opp-header-row {
  display: flex; align-items: flex-start; gap: 28px;
  background: var(--s2); border: 1px solid var(--b1); border-radius: 14px;
  padding: 24px 28px;
}
.opp-gauge-wrap {
  position: relative; width: 120px; height: 120px; flex-shrink: 0;
}
.opp-ring { width: 120px; height: 120px; transform: rotate(-90deg); }
.opp-ring-bg   { fill: none; stroke: var(--s3); stroke-width: 10; }
.opp-ring-fill { fill: none; stroke: var(--ac); stroke-width: 10; transition: stroke-dasharray .8s ease, stroke .4s; }
.opp-ring-fill.sig-strong-buy  { stroke: var(--gn); }
.opp-ring-fill.sig-buy         { stroke: #3ecf8e; }
.opp-ring-fill.sig-watch       { stroke: var(--wn); }
.opp-ring-fill.sig-neutral     { stroke: var(--tx3); }
.opp-ring-fill.sig-avoid       { stroke: var(--ls); }
.opp-score-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.opp-score-num { font-size: 26px; font-weight: 800; color: var(--tx); line-height: 1; }
.opp-score-sub { font-size: 11px; color: var(--tx3); margin-top: 2px; }
.opp-ticker-label { font-size: 11px; font-weight: 700; color: var(--ac); margin-top: 4px; letter-spacing: .5px; }

/* ── Header body ── */
.opp-header-body { flex: 1; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.opp-signal-row  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.opp-signal {
  font-size: 20px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
}
.opp-signal.sig-strong-buy { color: var(--gn); }
.opp-signal.sig-buy        { color: #3ecf8e; }
.opp-signal.sig-watch      { color: var(--wn); }
.opp-signal.sig-neutral    { color: var(--tx2); }
.opp-signal.sig-avoid      { color: var(--ls); }

.opp-profile-badge {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
  background: var(--ac-dim); color: var(--ac); border: 1px solid var(--ac-brd);
}
.opp-divergence {
  font-size: 12px; font-weight: 600; color: var(--wn);
  background: rgba(245,166,35,.08); border: 1px solid rgba(245,166,35,.22);
  border-radius: 8px; padding: 7px 12px;
}
.opp-highlight-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.opp-chip {
  font-size: 12px; padding: 4px 10px; border-radius: 20px;
  background: var(--s3); border: 1px solid var(--b1); color: var(--tx2);
}
.opp-chip.bull { color: var(--gn); background: var(--gn-dim); border-color: var(--gn-brd); }
.opp-chip.bear { color: var(--ls); background: var(--ls-dim); border-color: var(--ls-brd); }
.opp-chip.warn { color: var(--wn); background: rgba(245,166,35,.08); border-color: rgba(245,166,35,.22); }
.opp-chip.info { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

/* ── Section label ── */
.opp-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--tx2); padding-bottom: 8px; border-bottom: 1px solid var(--b1);
}
.opp-section-note { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--tx3); }

/* ── Sub-score bars ── */
.opp-bars { display: flex; flex-direction: column; gap: 10px; }
.opp-bar-row {
  display: grid; grid-template-columns: 160px 1fr 48px 46px; align-items: center; gap: 12px;
}
.opp-bar-label { font-size: 13px; color: var(--tx2); white-space: nowrap; }
.opp-bar-track { height: 8px; background: var(--s3); border-radius: 4px; overflow: hidden; }
.opp-bar-fill  {
  height: 100%; border-radius: 4px; width: 0%;
  transition: width .7s cubic-bezier(.4,0,.2,1);
  background: linear-gradient(90deg, var(--ac), #4af5ff);
}
.opp-bar-fill.high  { background: linear-gradient(90deg, var(--gn), #3ef5a0); }
.opp-bar-fill.mid   { background: linear-gradient(90deg, var(--wn), #f5d03e); }
.opp-bar-fill.low   { background: linear-gradient(90deg, var(--ls), #f55); }
.opp-bar-score { font-size: 13px; font-weight: 700; color: var(--tx); text-align: right; }
.opp-bar-weight {
  font-size: 11px; color: var(--tx3); text-align: right;
  background: var(--s3); border-radius: 4px; padding: 2px 6px;
}

/* ── Metrics grid ── */
.opp-metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.opp-metric-card {
  background: var(--s2); border: 1px solid var(--b1); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.opp-metric-warn { border-color: rgba(245,166,35,.4) !important; background: rgba(245,166,35,.06) !important; }
.opp-metric-label { font-size: 11px; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px; }
.opp-metric-value { font-size: 17px; font-weight: 700; color: var(--tx); }
.opp-metric-value.bull { color: var(--gn); }
.opp-metric-value.bear { color: var(--ls); }
.opp-metric-value.warn { color: var(--wn); }
.opp-metric-note  { font-size: 11px; color: var(--tx3); }

/* ── School Investment Lens ── */
.school-lens {
  border: 1px solid var(--b2); border-radius: 12px; padding: 14px 16px;
  background: var(--s1);
}
.school-lens-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.school-lens-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px; border: 1px solid; white-space: nowrap;
}
/* investor profile colours */
.school-lens-badge.cathie-wood    { color: #a855f7; background: rgba(168,85,247,.13); border-color: rgba(168,85,247,.35); }
.school-lens-badge.druckenmiller  { color: #22d3ee; background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.35); }
.school-lens-badge.buffett-ackman { color: #3b82f6; background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }
.school-lens-badge.lynch          { color: var(--wn); background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.35); }
.school-lens-badge.greenblatt     { color: var(--gn); background: var(--gn-dim); border-color: var(--gn-brd); }
.school-lens-badge.soros          { color: #f87171; background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.35); }
.school-lens-badge.howard-marks   { color: #94a3b8; background: rgba(148,163,184,.10); border-color: rgba(148,163,184,.30); }
/* keep legacy aliases in case anything still references them */
.school-lens-badge.growth    { color: #a855f7; background: rgba(168,85,247,.12); border-color: rgba(168,85,247,.3); }
.school-lens-badge.blue-chip { color: var(--ac);  background: var(--ac-dim);  border-color: var(--ac-brd); }
.school-lens-badge.value     { color: var(--gn);  background: var(--gn-dim);  border-color: var(--gn-brd); }
.school-lens-badge.garp      { color: var(--wn);  background: rgba(245,166,35,.12); border-color: rgba(245,166,35,.3); }
.school-lens-title { font-size: 11px; color: var(--tx3); }
.sl-why {
  font-size: 12px; color: var(--tx3); line-height: 1.5;
  padding: 6px 10px; background: var(--s2); border-radius: 6px;
  margin-bottom: 12px; border-left: 2px solid var(--b2);
}
.school-lens-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sl-metric {
  background: var(--s2); border: 1px solid var(--b1); border-radius: 8px;
  padding: 8px 12px; min-width: 105px; flex: 1;
}
.sl-metric-label {
  font-size: 10px; color: var(--tx3); margin-bottom: 3px;
  font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
}
.sl-metric-value { font-size: 15px; font-weight: 700; font-family: var(--mono); color: var(--tx); }
.sl-metric-value.bull { color: var(--gn); }
.sl-metric-value.bear { color: var(--ls); }
.sl-metric-value.warn { color: var(--wn); }
.sl-metric-hint { font-size: 10px; color: var(--tx3); margin-top: 2px; }
.sl-r40-value { font-size: 22px; font-weight: 800; font-family: var(--mono); }
.sl-r40-value.pass { color: var(--gn); }
.sl-r40-value.warn { color: var(--wn); }
.sl-r40-value.fail { color: var(--ls); }
.sl-metric-caution { font-size: 11px; color: var(--wn); margin-top: 4px; line-height: 1.4; }

/* ── Sector Benchmarks Card ─────────────────────────────────────────────── */
.sbm-card {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 12px;
  overflow: hidden;
}
.sbm-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.sbm-header:hover { background: var(--s3); }
.sbm-title { font-size: 13px; font-weight: 700; color: var(--tx); }
.sbm-sector-label { color: var(--ac); }
.sbm-chevron { width: 12px; height: 8px; color: var(--tx3); flex-shrink: 0; transition: transform .2s; }
.sbm-chevron-up { transform: rotate(180deg); }
.sbm-body { padding: 0 18px 18px; }
.sbm-body-hidden { display: none; }
.sbm-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tx3);
  margin-bottom: 8px; padding-top: 4px;
}
.sbm-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.sbm-table th {
  text-align: left; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--tx3); padding: 0 8px 6px 0; border-bottom: 1px solid var(--b1);
}
.sbm-row td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--b1); }
.sbm-row:last-child td { border-bottom: none; }
.sbm-metric { color: var(--tx2); font-weight: 500; }
.sbm-stock-val { font-family: var(--mono); font-weight: 700; color: var(--tx); }
.sbm-range { font-size: 11px; color: var(--tx3); font-family: var(--mono); }
.sbm-pill {
  display: inline-block; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; letter-spacing: .03em;
}
.sbm-cheap  { background: rgba(33,209,106,.15); color: var(--gn); }
.sbm-fair   { background: var(--s3); color: var(--tx2); }
.sbm-exp    { background: rgba(240,68,68,.15);  color: var(--ls); }
.sbm-strong { background: rgba(33,209,106,.15); color: var(--gn); }
.sbm-ok     { background: var(--s3); color: var(--tx2); }
.sbm-weak   { background: rgba(240,68,68,.15);  color: var(--ls); }
.sbm-na     { background: var(--s3); color: var(--tx3); }
.sbm-sector-note {
  font-size: 11px; color: var(--tx3); background: var(--s3);
  border-radius: 6px; padding: 8px 10px;
  margin-bottom: 12px; line-height: 1.5;
}
.sbm-de-note { color: var(--wn); background: rgba(245,166,35,.08); margin-top: 12px; }
.sbm-insight {
  display: flex; gap: 8px; align-items: flex-start;
  background: rgba(0,206,255,.07); border: 1px solid var(--ac-brd);
  border-radius: 8px; padding: 10px 12px;
  margin-top: 14px; font-size: 12px; color: var(--tx2); line-height: 1.6;
}
.sbm-insight-icon { font-size: 14px; flex-shrink: 0; }

.sl-div-hist {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  display: inline-block; margin-top: 2px;
}
.sl-div-hist.cheap     { color: var(--gn); background: var(--gn-dim); }
.sl-div-hist.expensive { color: var(--ls); background: var(--ls-dim); }
.sl-div-hist.fair      { color: var(--tx3); background: var(--s3); }
.sl-52wk-wrap { }
.sl-52wk-label { font-size: 11px; color: var(--tx3); margin-bottom: 5px; }
.sl-52wk-track {
  height: 6px; background: var(--s3); border-radius: 3px; position: relative; overflow: hidden;
}
.sl-52wk-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.sl-52wk-fill.low  { background: var(--gn); }
.sl-52wk-fill.mid  { background: var(--wn); }
.sl-52wk-fill.high { background: var(--ls); }
.sl-52wk-text { font-size: 11px; color: var(--tx2); text-align: right; margin-top: 3px; font-family: var(--mono); }

/* ── Analysis narrative ── */
.opp-analysis {
  background: var(--s2); border: 1px solid var(--b1); border-radius: 12px;
  padding: 18px 20px; font-size: 14px; line-height: 1.75; color: var(--tx2);
}

/* ── Opportunity mini chat ── */
.opp-chat-wrap {
  border-top: 1px solid var(--b1); padding-top: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.opp-chat-row { display: flex; gap: 8px; }
.opp-chat-input {
  flex: 1; padding: 9px 14px; background: var(--s2); border: 1px solid var(--b2);
  border-radius: 8px; color: var(--tx); font-size: 13px; font-family: var(--font);
  transition: border-color .15s;
}
.opp-chat-input:focus { outline: none; border-color: var(--ac); }
.opp-chat-input::placeholder { color: var(--tx3); }
.opp-chat-send-btn {
  padding: 9px 18px; background: var(--ac-dim); border: 1px solid var(--ac-brd);
  border-radius: 8px; color: var(--ac); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.opp-chat-send-btn:hover { background: rgba(0,206,255,.15); }
.opp-chat-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.opp-chat-answer {
  padding: 14px 16px; background: var(--s2); border: 1px solid var(--b1);
  border-radius: 10px; font-size: 13px; color: var(--tx2); line-height: 1.7;
}
.opp-chat-answer p { margin: 0 0 8px; }
.opp-chat-answer p:last-child { margin: 0; }
.opp-chat-answer strong { color: var(--tx); }
.opp-chat-answer ul { margin: 4px 0 8px 18px; }
.opp-chat-answer h2, .opp-chat-answer h3 { color: var(--tx); margin: 12px 0 4px; font-size: 13px; }
.opp-chat-thinking { color: var(--tx3); font-style: italic; }

/* Light mode overrides */
body.light .opp-ring-bg   { stroke: var(--s4); }
body.light .opp-metric-card { background: var(--s1); }

/* Timeframe selector bar */
.tech-tf-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px 16px;
  border-bottom: 1px solid var(--b1);
  background: var(--s2);
  flex-shrink: 0;
}
.tech-tf-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-right: 6px;
}
.tf-sep {
  width: 1px;
  height: 18px;
  background: var(--b2);
  margin: 0 4px;
  flex-shrink: 0;
}
.tech-tf-btn {
  height: 26px;
  padding: 0 9px;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--tx2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.tech-tf-btn:hover { color: var(--tx); background: var(--s3); }
.tech-tf-btn.active { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

/* Indicator groups */
.tech-indicators {
  display: flex;
  flex-direction: column;
  padding: 10px 14px 8px;
  gap: 0;
}

.indic-group { margin-bottom: 2px; }

.indic-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 4px 7px;
  border-bottom: 1px solid var(--b1);
  margin-bottom: 8px;
}

.indic-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--tx2);
}

.indic-group-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: 8px;
  padding: 1px 6px;
}

.indic-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 7px;
  padding-bottom: 12px;
}

.indic-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--r);
  padding: 11px 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: card-in .25s ease both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition: border-color .15s, background .15s;
}

.indic-card:hover { background: var(--s3); border-color: var(--b2); }

.indic-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx3);
}

.indic-value {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 800;
  color: var(--tx);
  line-height: 1;
}

.indic-sub {
  font-size: 9.5px;
  color: var(--tx3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.indic-signal {
  display: inline-flex;
  align-items: center;
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

/* Signal colour classes */
.signal-bullish    { background: var(--gn-dim); color: var(--gn); }
.signal-bearish    { background: var(--ls-dim); color: var(--ls); }
.signal-neutral    { background: var(--s3);     color: var(--tx2); border: 1px solid var(--b2); }
.signal-overbought { background: var(--ls-dim); color: var(--ls); }
.signal-oversold   { background: var(--gn-dim); color: var(--gn); }
.signal-high       { background: var(--ac-dim); color: var(--ac); }
.signal-low        { background: var(--s3);     color: var(--tx2); border: 1px solid var(--b2); }
.signal-normal     { background: var(--s3);     color: var(--tx2); border: 1px solid var(--b2); }

/* Overall analysis text panel */
.tech-analysis {
  margin: 0 14px 14px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-top: 2px solid rgba(0,212,255,.3);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
  animation: card-in .35s ease both;
}

.tech-analysis.hidden { display: none; }

.analysis-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-bottom: 1px solid var(--b1);
  flex-wrap: wrap;
}

.analysis-icon { font-size: 12px; color: var(--ac); opacity: .6; flex-shrink: 0; }

.analysis-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--tx3);
  flex-shrink: 0;
}

.analysis-rating {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .4px;
  flex-shrink: 0;
}

.rating-strong-buy  { background: rgba(34,197,94,.14);  color: var(--gn); border: 1px solid var(--gn-brd); }
.rating-buy         { background: var(--gn-dim);         color: var(--gn); border: 1px solid var(--gn-brd); }
.rating-neutral     { background: var(--s3);             color: var(--tx2); border: 1px solid var(--b2); }
.rating-sell        { background: var(--ls-dim);         color: var(--ls); border: 1px solid var(--ls-brd); }
.rating-strong-sell { background: rgba(239,68,68,.14);   color: var(--ls); border: 1px solid var(--ls-brd); }

.analysis-counts {
  display: flex;
  gap: 8px;
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.ac-bull { color: var(--gn); }
.ac-bear { color: var(--ls); }
.ac-neut { color: var(--tx3); }

.analysis-text {
  padding: 10px 15px 13px;
  font-size: 11.5px;
  color: var(--tx2);
  line-height: 1.72;
}

/* ══════════════════════════════════════════════════════════════
   Analyst Tab
══════════════════════════════════════════════════════════════ */
.analyst-content {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.analyst-content.hidden { display: none; }

.analyst-wrap {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: card-in .3s ease both;
}

/* Hero */
.analyst-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(90deg, var(--s3), var(--s2));
  border-bottom: 1px solid var(--b2);
  flex-wrap: wrap;
}

.analyst-hero-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.analyst-ticker-badge {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 800;
  color: var(--ac);
  letter-spacing: .5px;
  flex-shrink: 0;
}

.analyst-hero-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.analyst-company {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analyst-price {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--tx3);
}

.analyst-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

.analyst-rec-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.rec-strong-buy  { background: rgba(34,197,94,.15);  color: var(--gn); border: 1px solid var(--gn-brd); }
.rec-buy         { background: var(--gn-dim);         color: var(--gn); border: 1px solid var(--gn-brd); }
.rec-hold        { background: var(--wn-dim);         color: var(--wn); border: 1px solid rgba(245,158,11,.22); }
.rec-sell        { background: var(--ls-dim);         color: var(--ls); border: 1px solid var(--ls-brd); }
.rec-strong-sell { background: rgba(239,68,68,.15);   color: var(--ls); border: 1px solid var(--ls-brd); }

.analyst-cov { font-size: 10px; color: var(--tx3); }

/* Consensus score bar */
.rec-score-wrap {
  padding: 14px 20px 10px;
  border-bottom: 1px solid var(--b1);
}

.rec-score-track {
  position: relative;
  height: 5px;
  background: linear-gradient(90deg, var(--gn) 0%, var(--wn) 50%, var(--ls) 100%);
  border-radius: 3px;
  margin-bottom: 4px;
}

.rec-score-fill { display: none; }

.rec-score-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 13px; height: 13px;
  background: var(--tx);
  border: 2px solid var(--bg);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ac);
}

.rec-score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  color: var(--tx3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: 10px;
}

/* Price target gauge */
.pt-section {
  padding: 16px 20px;
  border-bottom: 1px solid var(--b1);
}

.pt-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.pt-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--tx3);
}

.pt-upside { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.pt-upside.up   { color: var(--gn); }
.pt-upside.down { color: var(--ls); }

.pt-gauge-wrap { position: relative; padding-bottom: 34px; margin-bottom: 8px; }

.pt-track {
  position: relative;
  height: 7px;
  background: var(--s4);
  border-radius: 4px;
  border: 1px solid var(--b2);
}

.pt-range {
  position: absolute;
  top: 0; height: 100%;
  background: rgba(0,212,255,.18);
  border: 1px solid var(--ac-brd);
  border-radius: 4px;
}

.pt-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

.pt-marker.pt-current {
  width: 14px; height: 14px;
  background: var(--tx);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--ac);
  z-index: 3;
}

.pt-marker.pt-mean {
  width: 10px; height: 10px;
  background: var(--gn);
  border: 2px solid var(--bg);
  z-index: 2;
}

.pt-marker.pt-median {
  width: 8px; height: 8px;
  background: var(--wn);
  border: 2px solid var(--bg);
  z-index: 1;
}

.pt-axis { position: absolute; bottom: 0; left: 0; right: 0; height: 30px; }

.pt-axis-item {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.pt-axis-val { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--tx); white-space: nowrap; }
.pt-axis-lbl { font-size: 8.5px; color: var(--tx3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

.pt-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }

.pt-leg-item { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--tx2); }

.pt-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pt-dot.current  { background: var(--tx);  box-shadow: 0 0 0 2px var(--ac); }
.pt-dot.mean     { background: var(--gn); }
.pt-dot.median   { background: var(--wn); }
.pt-dot.low-high { background: rgba(0,212,255,.3); border: 1px solid var(--ac-brd); }

/* Analyst actions */
.analyst-section { padding: 14px 20px; }

.analyst-section-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--tx3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analyst-section-hdr::after { content: ''; flex: 1; height: 1px; background: var(--b1); }

.analyst-table-wrap { overflow-x: auto; }

.analyst-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.analyst-table thead th {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--tx3);
  padding: 5px 10px;
  text-align: left;
  border-bottom: 1px solid var(--b1);
  white-space: nowrap;
}

.analyst-table tbody tr { border-bottom: 1px solid var(--b1); transition: background .1s; }
.analyst-table tbody tr:hover { background: var(--s3); }
.analyst-table td { padding: 8px 10px; vertical-align: middle; }

.at-date { font-family: var(--mono); font-size: 10px; color: var(--tx2); white-space: nowrap; }
.at-firm { font-weight: 600; color: var(--tx); white-space: nowrap; }

.grade-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--s3);
  border: 1px solid var(--b2);
  color: var(--tx2);
  white-space: nowrap;
}

.grade-pill.grade-buy  { background: var(--gn-dim); border-color: var(--gn-brd); color: var(--gn); }
.grade-pill.grade-sell { background: var(--ls-dim); border-color: var(--ls-brd); color: var(--ls); }
.grade-pill.grade-hold { background: var(--wn-dim); border-color: rgba(245,158,11,.2); color: var(--wn); }
.grade-none { color: var(--tx3); font-size: 11px; }

.action-badge {
  display: inline-block;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  white-space: nowrap;
}

.act-upgrade   { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.act-downgrade { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }
.act-init      { background: var(--ac-dim); color: var(--ac); border: 1px solid var(--ac-brd); }

/* ── Analyst Distribution Bar ──────────────────────────────── */
.dist-section {
  padding: 12px 20px 14px;
  border-bottom: 1px solid var(--b1);
}

.dist-section-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dist-total {
  font-size: 10px;
  font-weight: 500;
  color: var(--tx3);
  text-transform: none;
  letter-spacing: 0;
}

.dist-bar-outer {
  display: flex;
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
  margin-bottom: 9px;
}

.dist-seg { height: 100%; border-radius: 2px; transition: width .4s ease; }
.seg-strong-buy  { background: #15803d; }
.seg-buy         { background: var(--gn); }
.seg-hold        { background: var(--wn); }
.seg-sell        { background: var(--ls); }
.seg-strong-sell { background: #b91c1c; }

.dist-labels { display: flex; flex-wrap: wrap; gap: 10px; }

.dist-lbl {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--tx3);
}
.lbl-buy  { color: var(--gn); }
.lbl-hold { color: var(--wn); }
.lbl-sell { color: var(--ls); }

/* ── Finviz fallback note ── */
.tr-finviz-note {
  font-size: 11px;
  color: var(--tx3);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--b1);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* ── TipRanks Individual Analyst Ratings ───────────────────── */
.tr-src-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--ac-dim);
  color: var(--ac);
  border: 1px solid var(--ac-brd);
  text-transform: uppercase;
  letter-spacing: .6px;
  font-family: var(--mono);
  margin-left: 6px;
  vertical-align: middle;
}

.tr-table td { padding: 9px 10px; vertical-align: middle; }

.tr-analyst-cell { display: flex; flex-direction: column; gap: 3px; }

.tr-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.tr-aname {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--tx);
}

/* Legacy alias kept so nothing breaks */
.top25-badge { display: none; }

/* Tiered analyst ranking badges */
.top-analyst-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  margin-left: 4px;
  vertical-align: middle;
}

.top-analyst-25 {
  background: rgba(251,191,36,.18);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,.4);
  font-size: 10px;
}

.top-analyst-50 {
  background: rgba(148,163,184,.12);
  color: #94a3b8;
  border: 1px solid rgba(148,163,184,.3);
}

.top-analyst-100 {
  background: rgba(180,120,60,.1);
  color: #b4783c;
  border: 1px solid rgba(180,120,60,.25);
  font-size: 8.5px;
}

.tr-succ-hi { color: var(--gn) !important; font-weight: 600; }

.tr-rank {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.tr-ameta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.tr-stars { font-size: 10px; color: #fbbf24; letter-spacing: 1px; }
.tr-succ  { font-size: 10px; color: var(--tx3); }
.tr-avgr  { font-size: 10px; font-family: var(--mono); }
.tr-avgr.up { color: var(--gn); }
.tr-avgr.dn { color: var(--ls); }

.tr-firm { font-size: 11px; color: var(--tx2); white-space: nowrap; }

.tr-pt-val  { font-family: var(--mono); font-size: 12px; color: var(--tx); font-weight: 600; }
.tr-pt-none { color: var(--tx3); font-size: 11px; }

.tr-upside { font-family: var(--mono); font-size: 11px; font-weight: 700; white-space: nowrap; }
.tr-upside.up { color: var(--gn); }
.tr-upside.dn { color: var(--ls); }

/* ══════════════════════════════════════════════════════════════
   Search Tab
══════════════════════════════════════════════════════════════ */
.search-hero {
  padding: 28px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--b1);
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--s2) 0%, transparent 100%);
}

.search-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: -.2px;
}

.search-subtitle { font-size: 11px; color: var(--tx2); margin-top: 4px; }

.search-input-wrap {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 13px;
  font-size: 15px;
  color: var(--ac);
  pointer-events: none;
  line-height: 1;
  z-index: 1;
}

#search-input {
  width: 100%;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  color: var(--tx);
  padding: 0 38px 0 42px;
  font-family: var(--font);
  font-size: 13px;
  height: 42px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

#search-input:focus { border-color: var(--ac-brd); box-shadow: 0 0 0 3px var(--ac-glow); }
#search-input::placeholder { color: var(--tx3); }

.search-clear {
  position: absolute;
  right: 11px;
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--r-xs);
  transition: color .12s;
  z-index: 1;
}

.search-clear:hover { color: var(--tx); }
.search-clear.hidden { display: none; }

.search-hint {
  padding: 10px 20px 2px;
  text-align: center;
  font-size: 11px;
  color: var(--tx3);
  flex-shrink: 0;
}

.hint-example {
  display: inline-block;
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: var(--r-xs);
  padding: 2px 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 11px;
  color: var(--tx3);
  transition: background .12s, color .12s, border-color .12s;
  margin: 2px;
}

/* ══════════════════════════════════════════════════════════════
   Holders Tab — two-column split layout
══════════════════════════════════════════════════════════════ */
.holders-split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.holders-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.holders-col-inst {
  flex: 0 0 62%;
  border-right: 1px solid var(--b1);
  overflow-y: auto;
}
.holders-col-guru {
  flex: 1;
  overflow-y: auto;
}

.holders-col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--b1);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
.holders-section-icon { font-size: 20px; line-height: 1; }
.holders-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}
.holders-section-sub {
  font-size: 11px;
  color: var(--tx3);
  margin-top: 2px;
}

/* ── Guru Holders list (single column in the right pane) ── */
.guru-holders-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 20px;
}

.gh-card {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s, box-shadow .15s;
  animation: card-in .3s ease both;
}
.gh-card:hover {
  border-color: var(--b3);
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.gh-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.gh-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.gh-identity { flex: 1; min-width: 0; }
.gh-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gh-fund {
  font-size: 11px;
  color: var(--tx3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gh-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  align-self: flex-start;
  white-space: nowrap;
}
.gh-new       { background: rgba(0,206,255,.12); color: var(--ac);  border: 1px solid var(--ac-brd); }
.gh-increased { background: rgba(33,209,106,.12); color: var(--gn); border: 1px solid var(--gn-brd); }
.gh-decreased { background: rgba(240,68,68,.12);  color: var(--ls); border: 1px solid var(--ls-brd); }
.gh-unchanged { background: var(--s3); color: var(--tx2); border: 1px solid var(--b2); }
.gh-sold      { background: rgba(240,68,68,.12);  color: var(--ls); border: 1px solid var(--ls-brd); }

.gh-stats {
  display: flex;
  gap: 8px;
}
.gh-stat {
  flex: 1;
  background: var(--s1);
  border-radius: var(--r-md);
  padding: 8px 10px;
  text-align: center;
}
.gh-stat-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  font-family: var(--mono);
}
.gh-stat-lbl {
  font-size: 10px;
  color: var(--tx3);
  margin-top: 2px;
}

.gh-period {
  font-size: 10px;
  color: var(--tx3);
  text-align: right;
}

/* ══════════════════════════════════════════════════════════════
   Institutional Holders Tab
══════════════════════════════════════════════════════════════ */
.institutions-grid {
  flex: 1;
  min-height: 0;
  padding: 12px 18px 20px;
}

.inst-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.inst-error,
.inst-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--tx3);
  font-size: 13px;
}

/* ── Header ── */
.inst-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--b1);
  background: linear-gradient(180deg, var(--s2) 0%, transparent 100%);
  gap: 12px;
}

.inst-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inst-ticker-badge {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: var(--r-xs);
  padding: 3px 8px;
  letter-spacing: .5px;
}

.inst-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}

.inst-header-note {
  font-size: 10px;
  color: var(--tx3);
  white-space: nowrap;
}

/* ── Section title ── */
.inst-sec-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--tx3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inst-sec-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--b1);
}

/* ── Ownership breakdown ── */
.inst-ownership {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--b1);
}

.inst-stacked-bar {
  display: flex;
  height: 10px;
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--s3);
}

.inst-stk-seg {
  height: 100%;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

.inst-stk-inst   { background: var(--ac);  }
.inst-stk-inside { background: var(--wn);  }
.inst-stk-public { background: var(--s4);  }

.inst-stk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 11px;
  color: var(--tx2);
}

.inst-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inst-leg-item b { color: var(--tx); font-weight: 600; }

.inst-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.inst-dot-inst   { background: var(--ac); }
.inst-dot-inside { background: var(--wn); }
.inst-dot-public { background: var(--s4); border: 1px solid var(--b3); }

.inst-leg-count {
  margin-left: auto;
  font-size: 10px;
  color: var(--tx3);
}

/* ── Institution rows ── */
.inst-list-section {
  padding: 18px 20px 20px;
}

.inst-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.inst-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--b1);
  opacity: 0;
  transform: translateY(6px);
  animation: instFadeIn .25s ease forwards;
  animation-delay: calc(var(--i) * 40ms);
}

@keyframes instFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.inst-row:last-child { border-bottom: none; }

.inst-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--s3);
  border: 1px solid var(--b2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  font-family: var(--mono);
  flex-shrink: 0;
  margin-top: 2px;
}

.inst-row:nth-child(1) .inst-rank { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.3); color: var(--wn); }
.inst-row:nth-child(2) .inst-rank { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.2); color: #94a3b8; }
.inst-row:nth-child(3) .inst-rank { background: rgba(180,120,60,.1); border-color: rgba(180,120,60,.25); color: #b4783c; }

.inst-row-body { flex: 1; min-width: 0; }

.inst-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.inst-holder {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inst-pct-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ac);
  white-space: nowrap;
  flex-shrink: 0;
}

.inst-bar-track {
  height: 4px;
  background: var(--s3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}

.inst-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ac), rgba(0,212,255,.5));
  border-radius: 2px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px var(--ac-glow);
}

.inst-row-meta {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: var(--tx3);
  font-family: var(--mono);
}

.inst-meta-shares { color: var(--tx2); }
.inst-meta-val    { color: var(--gn);  }
.inst-meta-date   { margin-left: auto; }

/* ── Institution count badge & section extras ── */
.inst-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--s3);
  border: 1px solid var(--b2);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--tx3);
  margin-left: 6px;
  vertical-align: middle;
}

.inst-funds-section {
  border-top: 1px solid var(--b2);
  margin-top: 4px;
}

.inst-empty-section {
  padding: 14px 0;
  font-size: 13px;
  color: var(--tx3);
  text-align: center;
}

/* ── BlackRock callout ── */
.inst-br-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 20px 2px;
  padding: 9px 12px;
  background: rgba(245,166,35,.07);
  border: 1px solid rgba(245,166,35,.22);
  border-radius: 8px;
  font-size: 12px;
  color: var(--wn);
  line-height: 1.5;
}

.inst-br-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Show All button ── */
.inst-show-all-btn {
  display: block;
  width: calc(100% - 40px);
  margin: 8px 20px 4px;
  padding: 9px 16px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--ac);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
  transition: background .15s, border-color .15s;
}
.inst-show-all-btn:hover {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
}

.hint-example:hover { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); }

/* ══════════════════════════════════════════════════════════════
   Gurus Tab — 13F Holdings Tracker
══════════════════════════════════════════════════════════════ */

.gurus-layout {
  display: flex;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.gurus-sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--b2);
  overflow-y: auto;
  padding: 12px 0 24px;
}

.guru-group { margin-bottom: 8px; }

.guru-group-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tx3);
}

.guru-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
  border-left: 3px solid transparent;
}

.guru-card:hover { background: var(--s2); }

.guru-card-active {
  background: var(--s2);
  border-left-color: var(--ac);
}

.guru-emoji {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  line-height: 1;
}

.guru-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.guru-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guru-fund {
  font-size: 11px;
  color: var(--ac);
}

.guru-style {
  font-size: 10px;
  color: var(--tx3);
  line-height: 1.3;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guru-card-top {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.guru-stars {
  font-size: 10px;
  letter-spacing: 1px;
  white-space: nowrap;
  line-height: 1;
}

.tier-1 { color: #FFD700; }
.tier-2 { color: #A8B8C8; }
.tier-3 { color: #CD7F32; }
.tier-4 { color: var(--tx3); }

.guru-tier-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .75;
}

.guru-list-err {
  padding: 16px;
  font-size: 12px;
  color: var(--ls);
}

/* ── Main panel ──────────────────────────────────────────────── */
.gurus-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 20px 24px;
}

.gurus-pick-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  color: var(--tx3);
  font-size: 14px;
}

.gurus-pick-icon { font-size: 48px; line-height: 1; }

/* ── Guru detail header ─────────────────────────────────────── */
.guru-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 12px;
  margin-bottom: 12px;
}

.gdh-left  { display: flex; align-items: center; gap: 14px; }
.gdh-emoji { font-size: 36px; line-height: 1; }
.gdh-text  { display: flex; flex-direction: column; gap: 2px; }

.gdh-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
}

.gdh-fund {
  font-size: 12px;
  color: var(--ac);
  font-weight: 500;
}

.gdh-meta { text-align: right; }

.gdh-aum {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--gn);
}

.gdh-aum-label { font-size: 13px; color: var(--tx3); font-weight: 400; font-family: var(--font); }

.gdh-count {
  font-size: 11px;
  color: var(--tx3);
  margin-top: 2px;
}

/* Period + filed date badges */
.gdh-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.gdh-period-badge,
.gdh-filed-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
}

.gdh-period-badge {
  background: rgba(0,206,255,.1);
  border: 1px solid var(--ac-brd);
  color: var(--ac);
}

.gdh-filed-badge {
  background: rgba(245,166,35,.08);
  border: 1px solid rgba(245,166,35,.25);
  color: var(--wn);
}

/* ── Change summary chips ────────────────────────────────────── */
.guru-change-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.gcs-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--mono);
  border: 1px solid;
}

.gcs-new  { background: rgba(0,206,255,.08);  border-color: var(--ac-brd);  color: var(--ac); }
.gcs-up   { background: rgba(33,209,106,.08); border-color: var(--gn-brd);  color: var(--gn); }
.gcs-dn   { background: rgba(240,68,68,.08);  border-color: var(--ls-brd);  color: var(--ls); }
.gcs-sold { background: rgba(240,68,68,.05);  border-color: rgba(240,68,68,.2); color: #f04444aa; }
.gcs-unch { background: var(--s3);            border-color: var(--b2);       color: var(--tx3); }

/* ── Holdings sections ───────────────────────────────────────── */
.guru-holdings-section {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.guru-sold-section { opacity: .75; }

.guru-sec-title {
  padding: 12px 16px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx3);
  border-bottom: 1px solid var(--b1);
}

.guru-table-wrap { overflow-x: auto; }

.guru-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.guru-table thead tr {
  background: var(--s1);
  border-bottom: 1px solid var(--b2);
}

.guru-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--tx3);
  white-space: nowrap;
}

.guru-table td { padding: 9px 12px; border-bottom: 1px solid var(--b1); }
.guru-table tbody tr:last-child td { border-bottom: none; }
.guru-table tbody tr:hover { background: rgba(255,255,255,.03); }

.ghr-rank  { color: var(--tx3); font-family: var(--mono); font-size: 11px; width: 32px; }
.ghr-name  { font-weight: 500; color: var(--tx); }
.ghr-ticker {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ac);
  min-width: 52px;
  margin-right: 6px;
}
.ghr-company { color: var(--tx2); font-size: 12.5px; }
.ghr-sector { }
.ghr-sector-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 500;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--b2);
  color: var(--tx3);
  white-space: nowrap;
}
.ghr-val   { font-family: var(--mono); color: var(--gn); text-align: right; }
.ghr-pct   { font-family: var(--mono); font-size: 12px; color: var(--ac); text-align: right; }
.ghr-shares { font-family: var(--mono); font-size: 11px; color: var(--tx2); text-align: right; }

.ghr-new .ghr-company { color: var(--ac); }
.ghr-sold .ghr-company { color: var(--tx3); }
.ghr-sold-val { color: var(--tx3) !important; }

/* Change badges inline in table */
.gcb {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  margin-left: 5px;
  vertical-align: middle;
}

.gcb-new  { background: rgba(0,206,255,.15);  color: var(--ac); }
.gcb-up   { background: rgba(33,209,106,.15); color: var(--gn); }
.gcb-dn   { background: rgba(240,68,68,.15);  color: var(--ls); }
.gcb-sold { background: rgba(240,68,68,.1);   color: #f04444cc; }

/* Error card */
.guru-err-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px 24px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 12px;
  font-size: 14px;
  color: var(--tx3);
  text-align: center;
}

.guru-err-note { font-size: 12px; color: var(--tx3); }

.gurus-loading-list {
  display: flex;
  justify-content: center;
  padding: 20px;
}

/* ══════════════════════════════════════════════════════════════
   Crypto Tab
══════════════════════════════════════════════════════════════ */
.crypto-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.crypto-prices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 16px 20px;
  flex-shrink: 0;
}

.crypto-loading-row {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--tx3);
  font-size: 12px;
}

.crypto-empty {
  padding: 40px;
  text-align: center;
  color: var(--tx3);
  font-size: 13px;
}

/* ── Crypto price card ── */
.crypto-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  padding: 14px 16px 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .1s;
  border-top: 2px solid transparent;
  opacity: 0;
  transform: translateY(8px);
  animation: cryptoFadeIn .25s ease forwards;
  animation-delay: calc(var(--i) * 50ms);
  position: relative;
  overflow: hidden;
}

@keyframes cryptoFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

.crypto-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, var(--crypto-color, transparent) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
}

.crypto-card:hover { background: var(--s2); border-color: var(--b2); }
.crypto-card:hover::before { opacity: .04; }
.crypto-card.active {
  border-top-color: var(--crypto-color, var(--ac));
  background: var(--s2);
  border-color: var(--b2);
}
.crypto-card.active::before { opacity: .06; }

.crypto-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.crypto-card-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crypto-symbol {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.3px;
  line-height: 1;
}

.crypto-name {
  font-size: 10px;
  color: var(--tx3);
  font-weight: 500;
}

.crypto-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.crypto-price {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: -.3px;
}

.crypto-change {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--r-xs);
}

.crypto-change.up   { color: var(--gn); background: var(--gn-dim); }
.crypto-change.down { color: var(--ls); background: var(--ls-dim); }
.crypto-change.flat { color: var(--tx3); background: var(--s3); }

.crypto-card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.crypto-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crypto-meta-lbl {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx3);
}

.crypto-meta-val {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--tx2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Day range bar */
.crypto-bar-bg {
  height: 3px;
  background: var(--s3);
  border-radius: 2px;
  overflow: hidden;
}

.crypto-bar-day {
  height: 100%;
  background: var(--crypto-color, var(--ac));
  border-radius: 2px;
  opacity: .7;
  transition: width .5s ease;
}

/* ── Chart section ── */
.crypto-chart-wrap {
  margin: 0 20px 16px;
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  overflow: hidden;
  flex-shrink: 0;
}

.crypto-chart-wrap.hidden { display: none; }

.crypto-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
}

.crypto-chart-label {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tx2);
  letter-spacing: .5px;
}

.crypto-chart-price {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
}

.crypto-tv-chart {
  height: 400px;
  background: var(--bg);
}

/* ── News section ── */
.crypto-news-section {
  margin: 0 20px 20px;
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.crypto-news-section.hidden { display: none; }

.crypto-news-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
}

.crypto-news-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx3);
}

.crypto-news-ticker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--wn);
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--r-xs);
  padding: 1px 6px;
}

/* ── Crypto overview strip ── */
.crypto-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 8px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--b1);
  background: linear-gradient(180deg, var(--s2) 0%, transparent 100%);
}
.co-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 12px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.co-pill:hover { background: var(--s3); border-color: var(--b2); }
.co-pill-wide { min-width: 140px; }
.co-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--tx3);
}
.co-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  display: flex;
  align-items: center;
  gap: 4px;
}
.co-val.co-up   { color: var(--gn); }
.co-val.co-dn   { color: var(--ls); }
.co-val.co-flat { color: var(--tx3); }
.co-val.co-btc  { color: #f7931a; }
.co-val.co-eth  { color: #627eea; }
.co-val.co-sol  { color: #9945ff; }
.co-val.co-xrp  { color: #00AAE4; }
.co-chg {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
}
.co-chg.co-up   { background: var(--gn-dim); color: var(--gn); }
.co-chg.co-dn   { background: var(--ls-dim); color: var(--ls); }
.co-chg.co-flat { color: var(--tx3); }
.co-cmc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(6,146,203,.1);
  border: 1px solid rgba(6,146,203,.28);
  border-radius: var(--r-sm);
  color: #0692cb;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: .3px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  transition: background .15s, border-color .15s;
}
.co-cmc-badge:hover { background: rgba(6,146,203,.2); border-color: rgba(6,146,203,.5); }
.co-cmc-active { background: rgba(6,146,203,.22); border-color: rgba(6,146,203,.6); font-weight: 800; }

/* ── Crypto sentiment cards ── */
.crypto-sentiment {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px 20px;
  flex-shrink: 0;
}
.cs-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx3);
}
.cs-fg-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.fg-canvas { display: block; }
.cs-fg-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -6px;
}
.cs-fg-val {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.cs-fg-label {
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
}
.cs-dom-wrap { display: flex; flex-direction: column; gap: 6px; }
.cs-dom-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cs-dom-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  width: 40px;
  flex-shrink: 0;
}
.cs-dom-bar-bg {
  flex: 1;
  height: 6px;
  background: var(--s3);
  border-radius: 3px;
  overflow: hidden;
}
.cs-dom-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .6s ease;
}
.cs-dom-pct {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  width: 38px;
  text-align: right;
}
.cs-alt-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.cs-alt-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cs-alt-label {
  font-size: 12px;
  font-weight: 700;
}
.cs-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cs-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cs-stat-lbl {
  font-size: 11px;
  color: var(--tx3);
}
.cs-stat-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tx2);
}
.cs-footer {
  font-size: 10px;
  color: var(--tx3);
  margin-top: auto;
}

/* ── Crypto market table ── */
.crypto-table-section {
  padding: 0 20px 16px;
  flex-shrink: 0;
}
.crypto-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.crypto-table.hidden { display: none; }
.crypto-table thead th {
  padding: 8px 10px;
  text-align: right;
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx3);
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.crypto-table thead th:first-child  { text-align: center; width: 36px; }
.crypto-table thead th:nth-child(2) { text-align: left; }
.crypto-table thead th:last-child   { text-align: center; }
.crypto-table thead th:hover   { color: var(--tx2); }
.crypto-table thead th.sorted  { color: var(--ac); }
.sort-arrow { font-size: 10px; margin-left: 2px; }
.crypto-table tbody tr {
  border-bottom: 1px solid var(--b1);
  cursor: pointer;
  transition: background .1s;
  animation: card-in .2s ease both;
  animation-delay: calc(var(--i, 0) * 5ms);
}
.crypto-table tbody tr:hover  { background: var(--s1); }
.crypto-table tbody tr.active { background: var(--s2); border-left: 2px solid var(--ac); }
.crypto-table tbody tr:last-child { border-bottom: none; }
.crypto-table tbody td {
  padding: 7px 10px;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tx2);
  white-space: nowrap;
}
.crypto-table tbody td:first-child  { text-align: center; color: var(--tx2); font-size: 11px; }
.crypto-table tbody td:nth-child(2) { text-align: left; }
.crypto-table tbody td:last-child   { text-align: center; }
.ctd-name {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctd-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ctd-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ctd-rank  { color: var(--tx3); font-size: 11px; }
.ctd-sym   { font-weight: 700; font-size: 12px; color: var(--tx); text-decoration: none; }
.ctd-sym:hover { text-decoration: underline; }
.ctd-full  { font-size: 9.5px; color: var(--tx3); font-weight: 400; font-family: var(--font); }
.ctd-price { color: var(--tx); font-weight: 700; }
.ctd-mcap  { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--tx); white-space: nowrap; }
.ctd-vol   { font-family: var(--mono); font-size: 11px; color: var(--tx2); white-space: nowrap; }
.ctd-supply { font-family: var(--mono); font-size: 11px; color: var(--tx2); white-space: nowrap; }
.ctd-supply-sym { font-size: 9px; color: var(--tx3); font-family: var(--font); text-transform: uppercase; letter-spacing: .4px; }
.pct-up { color: var(--gn); }
.pct-dn { color: var(--ls); }
.pct-fl { color: var(--tx3); }
.pct-na { color: var(--tx3); }
.sparkline { display: block; }

/* Chart close button */
.crypto-chart-header { position: relative; }
#crypto-chart-close {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
}

.search-results { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }

.search-result {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--b1);
  transition: background .12s;
  animation: card-in .2s ease both;
  animation-delay: calc(var(--i, 0) * 20ms);
}

.search-result:hover { background: var(--s2); }

.search-result-ticker {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-info { min-width: 0; }

.search-result-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.search-result-meta { display: flex; gap: 4px; flex-wrap: wrap; }

.search-meta-tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  background: var(--s3);
  border: 1px solid var(--b1);
  color: var(--tx3);
  white-space: nowrap;
}

.search-meta-tag.type-equity { background: var(--gn-dim); border-color: var(--gn-brd); color: var(--gn); }
.search-meta-tag.type-etf    { background: var(--wn-dim); border-color: rgba(245,158,11,.2); color: var(--wn); }
.search-meta-tag.type-index  { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); }

.btn-add-watchlist {
  background: var(--s3);
  border: 1px solid var(--b2);
  color: var(--tx2);
  padding: 6px 12px;
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .12s, color .12s, border-color .12s;
}

.btn-add-watchlist:hover:not(:disabled) { background: var(--ac); border-color: var(--ac); color: #000; }
.btn-add-watchlist.in-watchlist { background: var(--gn-dim); border-color: var(--gn-brd); color: var(--gn); cursor: default; }
.btn-add-watchlist:disabled { opacity: .4; cursor: default; }

/* ══════════════════════════════════════════════════════════════
   Animations
══════════════════════════════════════════════════════════════ */
@keyframes card-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(34,197,94,.5); }
  50%       { box-shadow: 0 0 0 4px rgba(34,197,94,0);  }
}

@keyframes tape-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ══════════════════════════════════════════════════════════════
   Scrollbars
══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar              { width: 4px; height: 4px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: var(--b3); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover  { background: var(--tx3); }

/* ══════════════════════════════════════════════════════════════
   Landing page
══════════════════════════════════════════════════════════════ */
.landing {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity .5s ease, visibility .5s ease;
}
.landing.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/static/bull_bear_bg.png') center / cover no-repeat;
  opacity: 0.13;
  z-index: 0;
}

.landing-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .70;
  z-index: 1;
}

.landing-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 640px;
  padding: 40px 24px;
  gap: 20px;
}

.landing-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ac);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.landing-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

.landing-brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.landing-brand {
  font-size: 36px;
  font-weight: 800;
  color: var(--tx);
  letter-spacing: -.02em;
  font-family: var(--font);
  line-height: 1;
}

.landing-by {
  font-size: 11px;
  font-weight: 600;
  color: var(--ac);
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .8;
}

.landing-headline {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.12;
  color: var(--tx);
  letter-spacing: -.025em;
  margin: 0;
}

.landing-accent {
  color: var(--ac);
}

.landing-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--tx2);
  max-width: 500px;
  margin: 0;
}

/* Animated stat counters */
.landing-stats {
  display: flex;
  align-items: center;
  background: rgba(0,212,255,.04);
  border: 1px solid var(--ac-brd);
  border-radius: 14px;
  padding: 14px 28px;
  gap: 0;
}

.ls-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.ls-num-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.ls-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--ac);
  font-family: var(--mono);
  line-height: 1;
}

.ls-sfx {
  font-size: 18px;
  font-weight: 700;
  color: var(--ac);
  line-height: 1;
}

.ls-ai {
  font-size: 24px;
  font-weight: 800;
  color: var(--ac);
  font-family: var(--mono);
  letter-spacing: .06em;
  line-height: 1.25;
}

.ls-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.ls-sub {
  font-size: 10px;
  color: var(--tx3);
  opacity: 0.5;
  letter-spacing: .03em;
  text-align: center;
  margin-top: -2px;
  font-family: var(--font);
}

.ls-div {
  width: 1px;
  height: 42px;
  background: var(--b2);
  margin: 0 4px;
  flex-shrink: 0;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--ac);
  color: #000;
  border: none;
  border-radius: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 0 32px rgba(0,212,255,.3);
  margin-top: 4px;
}
.landing-cta:hover {
  background: #1ae0ff;
  transform: translateY(-2px);
  box-shadow: 0 0 48px rgba(0,212,255,.45);
}
.landing-cta:active { transform: translateY(0); }

.landing-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  margin-top: 6px;
}

.lf-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--tx2);
}

.lf-icon {
  color: var(--ac);
  font-size: 13px;
}

/* ── Landing entrance & motion animations ───────────────────── */
@keyframes landing-enter {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes accent-glint {
  0%, 65% { background-position: -100% 0; }
  82%     { background-position: 200% 0;  }
  100%    { background-position: 200% 0;  }
}
@keyframes badge-dot-pulse {
  0%, 100% { box-shadow: 0 0 4px var(--gn); opacity: 1; }
  50%      { box-shadow: 0 0 12px var(--gn), 0 0 24px rgba(34,197,94,.3); opacity: .7; }
}
@keyframes stats-glow {
  0%, 100% { border-color: var(--ac-brd); box-shadow: none; }
  50%      { border-color: rgba(0,212,255,.38); box-shadow: 0 0 32px rgba(0,212,255,.1), inset 0 0 24px rgba(0,212,255,.04); }
}
@keyframes cta-shimmer {
  0%   { transform: translateX(-130%); }
  100% { transform: translateX(130%);  }
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.landing-badge {
  animation: landing-enter .55s cubic-bezier(.22,1,.36,1) .05s both;
}
.landing-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gn);
  box-shadow: 0 0 6px var(--gn);
  animation: badge-dot-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
.landing-logo {
  animation: landing-enter .55s cubic-bezier(.22,1,.36,1) .18s both;
}
.landing-logo svg {
  animation: logo-float 4s ease-in-out 1.2s infinite;
}
.landing-headline {
  animation: landing-enter .65s cubic-bezier(.22,1,.36,1) .3s both;
}
.landing-accent {
  background: linear-gradient(90deg, var(--ac) 28%, rgba(255,255,255,.9) 50%, var(--ac) 72%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: accent-glint 4s ease-in-out 1.6s infinite;
}
.landing-sub {
  animation: landing-enter .55s cubic-bezier(.22,1,.36,1) .45s both;
}
.landing-stats {
  animation: landing-enter .55s cubic-bezier(.22,1,.36,1) .55s both,
             stats-glow 4.5s ease-in-out 2.2s infinite;
}
.landing-cta {
  position: relative;
  overflow: hidden;
  animation: landing-enter .55s cubic-bezier(.22,1,.36,1) .68s both;
}
.landing-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 28%, rgba(255,255,255,.22) 50%, transparent 72%);
  transform: translateX(-130%);
  animation: cta-shimmer 3.2s ease-in-out 2s infinite;
  pointer-events: none;
}
.landing-features {
  animation: landing-enter .55s cubic-bezier(.22,1,.36,1) .82s both;
}

/* ── Market bull & bear emoji symbols ───────────────────────── */
.mkt-bull,
.mkt-bear {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 2;
  line-height: 1;
}

/* Green bull — two on the canvas */
.mkt-bull-1 {
  font-size: 100px;
  bottom: 11%;
  left: 2%;
  opacity: 0.82;
  animation: mkt-bull-float 3.8s ease-in-out infinite;
}
.mkt-bull-2 {
  font-size: 78px;
  top: 6%;
  right: 3%;
  opacity: 0.68;
  animation: mkt-bull-float 4.4s ease-in-out infinite;
  animation-delay: -1.6s;
}

/* Red bear — two on the canvas */
.mkt-bear-1 {
  font-size: 90px;
  top: 5%;
  left: 3%;
  opacity: 0.72;
  animation: mkt-bear-float 4.1s ease-in-out infinite;
  animation-delay: -0.9s;
}
.mkt-bear-2 {
  font-size: 80px;
  bottom: 8%;
  right: 2%;
  opacity: 0.62;
  animation: mkt-bear-float 4.6s ease-in-out infinite;
  animation-delay: -2.4s;
}

@keyframes mkt-bull-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 16px rgba(34,197,94,.75)) drop-shadow(0 0 5px rgba(34,197,94,.5));
  }
  50% {
    transform: translateY(-14px) scale(1.10);
    filter: drop-shadow(0 0 30px rgba(34,197,94,1)) drop-shadow(0 0 14px rgba(34,197,94,.75));
  }
}

@keyframes mkt-bear-float {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 0 16px rgba(239,68,68,.75)) drop-shadow(0 0 5px rgba(239,68,68,.5));
  }
  50% {
    transform: translateY(-14px) scale(1.10);
    filter: drop-shadow(0 0 30px rgba(239,68,68,1)) drop-shadow(0 0 14px rgba(239,68,68,.75));
  }
}

/* ══════════════════════════════════════════════════════════════
   Valuation Verdict Card
══════════════════════════════════════════════════════════════ */
.verdict-card {
  margin: 14px 16px 4px;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: card-in .3s ease both;
}

.vd-header {
  padding: 14px 18px 12px;
  background: linear-gradient(135deg, var(--s3) 0%, var(--s2) 100%);
  border-bottom: 1px solid var(--b2);
}

.vd-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.vd-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tx3);
}

.vd-early-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #a78bfa;
  background: rgba(167,139,250,.1);
  border: 1px solid rgba(167,139,250,.25);
  border-radius: 999px;
  padding: 1px 7px;
}

.vd-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid;
}

.vd-strong-buy      { color: #16a34a; background: rgba(34,197,94,.12);   border-color: rgba(34,197,94,.3);   }
.vd-buy             { color: #22c55e; background: rgba(34,197,94,.08);   border-color: rgba(34,197,94,.2);   }
.vd-hold            { color: #f59e0b; background: rgba(245,158,11,.08);  border-color: rgba(245,158,11,.2);  }
.vd-caution         { color: #f97316; background: rgba(249,115,22,.08);  border-color: rgba(249,115,22,.2);  }
.vd-value-trap      { color: #f97316; background: rgba(249,115,22,.08);  border-color: rgba(249,115,22,.2);  }
.vd-quality-growth  { color: #00d4ff; background: rgba(0,212,255,.08);   border-color: rgba(0,212,255,.2);   }
.vd-high-growth     { color: #a78bfa; background: rgba(167,139,250,.1);  border-color: rgba(167,139,250,.3); }
.vd-speculative-buy { color: #818cf8; background: rgba(129,140,248,.1);  border-color: rgba(129,140,248,.3); }
.vd-speculative     { color: #94a3b8; background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.2); }
.vd-avoid           { color: #ef4444; background: rgba(239,68,68,.1);    border-color: rgba(239,68,68,.25);  }

.vd-summary {
  font-size: 12px;
  line-height: 1.65;
  color: var(--tx2);
  margin: 0;
}

.vd-bars {
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border-bottom: 1px solid var(--b1);
}

.vd-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vd-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  width: 58px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.vd-bar-track {
  flex: 1;
  height: 6px;
  background: var(--b2);
  border-radius: 999px;
  position: relative;
  overflow: visible;
}

.vd-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 4px;
}

.vd-bar-val  { background: linear-gradient(90deg, #ef4444, #f59e0b 50%, #22c55e); }
.vd-bar-qual { background: linear-gradient(90deg, #ef4444, #f59e0b 50%, #22c55e); }

/* midpoint tick */
.vd-bar-mid {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 1px;
  height: 10px;
  background: var(--b3);
  transform: translateX(-50%);
}

.vd-bar-hint {
  font-size: 10px;
  color: var(--tx3);
  width: 56px;
  text-align: right;
  flex-shrink: 0;
}

.vd-signals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.vd-list {
  list-style: none;
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vd-list:first-child {
  border-right: 1px solid var(--b1);
}

.vd-pro, .vd-con {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--tx2);
}

.vd-pro .vd-icon { color: var(--gn); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.vd-con .vd-icon { color: var(--ls); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ══════════════════════════════════════════════════════════════
   Fund Metric Tiles  (TradingView-inspired)
══════════════════════════════════════════════════════════════ */
.fmet-card {
  margin: 4px 16px 4px;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: card-in .3s ease both;
}

.fmet-sec {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--b1);
}
.fmet-sec:last-child { border-bottom: none; }

.fmet-sec-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--tx3);
  margin-bottom: 10px;
}

.fmet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}

/* ── Tile ── */
.fmet-tile {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-top: 2px solid transparent;
  border-radius: 10px;
  padding: 13px 14px 12px;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: background .15s, border-color .15s;
}

.fmet-tile-pos { border-top-color: rgba(34,197,94,.28); }
.fmet-tile-neg { border-top-color: rgba(239,68,68,.28);  }
.fmet-tile-ac  { border-top-color: rgba(0,212,255,.28);  }

.fmet-tile:hover                     { background: var(--s3); }
.fmet-tile.fmet-tile-pos:hover       { border-top-color: rgba(34,197,94,.55); }
.fmet-tile.fmet-tile-neg:hover       { border-top-color: rgba(239,68,68,.55); }
.fmet-tile.fmet-tile-ac:hover        { border-top-color: rgba(0,212,255,.55); }

.fmet-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .07em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.fmet-val {
  font-size: 19px;
  font-weight: 700;
  font-family: var(--mono);
  letter-spacing: -.025em;
  line-height: 1.1;
  margin-bottom: 13px;
}

.fmet-v-pos { color: var(--gn); }
.fmet-v-neg { color: var(--ls); }
.fmet-v-ac  { color: var(--ac); }

/* ── Bar track ── */
.fmet-bt {
  height: 4px;
  background: var(--b2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  margin-top: auto;
}
.fmet-bt.fmet-bt-bi { overflow: visible; }

/* ── Bar fill ── */
.fmet-bf {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 2px;
  transition: width .65s cubic-bezier(.4,0,.2,1);
  min-width: 3px;
}

.fmet-bf-abs { left: 0; }    /* left-anchored  */
.fmet-bf-r   { left:  50%; } /* bi-directional positive */
.fmet-bf-l   { right: 50%; } /* bi-directional negative */

.fmet-c-pos { background: var(--gn); box-shadow: 0 0 7px var(--gn-glow); }
.fmet-c-neg { background: var(--ls); box-shadow: 0 0 7px var(--ls-glow); }
.fmet-c-ac  { background: var(--ac); box-shadow: 0 0 7px var(--ac-glow); }

/* ── Center-zero tick ── */
.fmet-bz {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: calc(100% + 6px);
  background: var(--b3);
  transform: translateX(-50%);
  z-index: 2;
}

/* ══════════════════════════════════════════════════════════════
   Partnerships Card
══════════════════════════════════════════════════════════════ */
.pship-card {
  margin: 4px 16px 12px;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: card-in .3s ease both;
}

/* ── Header ── */
.pship-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 18px 12px;
  background: linear-gradient(135deg, var(--s3) 0%, var(--s2) 100%);
  border-bottom: 1px solid var(--b2);
}

.pship-icon {
  font-size: 15px;
  color: var(--ac);
  line-height: 1;
  flex-shrink: 0;
}

.pship-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: .01em;
}

.pship-source-note {
  margin-left: auto;
  font-size: 9.5px;
  color: var(--tx3);
  white-space: nowrap;
}

/* Official links bar */
.pship-links-bar {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px solid var(--b1); margin-bottom: 4px;
}
.pship-offlink {
  font-size: 11px; font-weight: 600; color: var(--ac);
  background: var(--ac-dim); border: 1px solid var(--ac-brd);
  border-radius: 6px; padding: 3px 10px; text-decoration: none;
  transition: opacity .15s;
}
.pship-offlink:hover { opacity: .8; }

/* Source link inside tiles */
.pship-tile-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pship-src-link  { font-size: 10px; color: var(--ac); text-decoration: none; white-space: nowrap; }
.pship-src-link:hover { text-decoration: underline; }
.pship-filing-date { font-size: 10px; color: var(--tx3); }

/* 8-K section */
.pship-sec-8k { background: rgba(245,166,35,.04); border: 1px solid rgba(245,166,35,.15); border-radius: var(--r-sm); }
.pship-dot-8k { background: var(--wn) !important; }
.pship-see-all { font-size: 10px; color: var(--ac); text-decoration: none; margin-left: auto; }
.pship-see-all:hover { text-decoration: underline; }

/* ── Loading state ── */
.pship-loading .pship-spinner-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
}

.pship-load-text {
  font-size: 12px;
  color: var(--tx3);
}

/* ── Sections ── */
.pship-sec {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--b1);
}
.pship-sec:last-child { border-bottom: none; }

.pship-sec-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--tx3);
  margin-bottom: 10px;
}

/* ── Wiki grid of tiles ── */
.pship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

/* ── Official SEC section ── */
.pship-sec-official {
  background: linear-gradient(180deg, rgba(245,158,11,.04) 0%, transparent 60%);
  border-bottom: 1px solid rgba(245,158,11,.12);
}
.pship-sec-official .pship-sec-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--wn);
}
.pship-sec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wn);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(245,158,11,.5);
}

/* SEC tiles — client vs partner accent */
.pship-tile-sec { border-left-color: rgba(245,158,11,.4); }
.pship-tile-sec:hover { border-left-color: var(--wn); }

.pship-badge-sec {
  color: var(--wn) !important;
  background: rgba(245,158,11,.1) !important;
  border-color: rgba(245,158,11,.25) !important;
}

/* Client tiles get a subtle amber top border */
.pship-tile-client { border-top: 2px solid rgba(245,158,11,.3); }
.pship-tile-client .pship-partner-name { color: #fbbf24; }

/* Partnership tiles keep cyan */
.pship-tile-partner .pship-partner-name { color: var(--ac); }

/* Base tile */
.pship-tile {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-left: 2px solid var(--ac-brd);
  border-radius: 8px;
  padding: 11px 13px 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .15s, border-color .15s;
}
.pship-tile:hover {
  background: var(--s3);
  border-left-color: var(--ac);
}

.pship-tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pship-partner-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pship-badge {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: 999px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.pship-context {
  font-size: 11px;
  line-height: 1.6;
  color: var(--tx2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── News rows ── */
.pship-news-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 8px 0;
  border-bottom: 1px solid var(--b1);
}
.pship-news-row:last-child { border-bottom: none; padding-bottom: 0; }
.pship-news-row:first-of-type { padding-top: 0; }

.pship-news-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ac);
  flex-shrink: 0;
  margin-top: 5px;
}

.pship-news-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.pship-news-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--tx);
  line-height: 1.45;
  text-decoration: none;
  transition: color .12s;
}
a.pship-news-title:hover { color: var(--ac); }

.pship-news-date {
  font-size: 10px;
  color: var(--tx3);
}

/* ── Empty state ── */
.pship-empty {
  padding: 20px 20px;
  font-size: 12px;
  color: var(--tx3);
}

/* ── Named-company table (v1.5.0) ── */
.pship-sec-named {
  background: linear-gradient(180deg, rgba(0,206,255,.04) 0%, transparent 50%);
  border-bottom: 1px solid var(--ac-brd);
}
.pship-sec-named .pship-sec-title {
  display: flex; align-items: center; gap: 7px; color: var(--ac);
}
.pship-sec-count {
  margin-left: auto;
  font-size: 9px; font-weight: 600;
  background: var(--ac-dim); border: 1px solid var(--ac-brd);
  color: var(--ac); border-radius: 999px; padding: 1px 7px;
}

/* Table */
.pship-tbl {
  width: 100%; border-collapse: collapse; table-layout: auto;
}
.pship-tbl thead tr {
  border-bottom: 1px solid var(--b2);
}
.pship-tbl thead th {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--tx3);
  padding: 0 10px 7px 0; text-align: left; white-space: nowrap;
}
.pship-tbl-row {
  border-bottom: 1px solid var(--b1);
  transition: background .12s;
}
.pship-tbl-row:last-child { border-bottom: none; }
.pship-tbl-row:hover { background: var(--s2); }
.pship-tbl td { padding: 9px 10px 9px 0; vertical-align: middle; }

.pship-tbl-name {
  font-size: 13px; font-weight: 700; color: var(--tx);
  white-space: nowrap;
}

.pship-type-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; border-radius: 999px; padding: 2px 8px;
  white-space: nowrap;
}
.pship-type-client  { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.3); color: #fbbf24; }
.pship-type-partner { background: var(--ac-dim); border: 1px solid var(--ac-brd); color: var(--ac); }

.pship-src-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  border-radius: 4px; padding: 1px 6px; white-space: nowrap;
}
.pship-src-sec  { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.25); color: #f5a623; }
.pship-src-wiki { background: rgba(148,163,184,.1); border: 1px solid rgba(148,163,184,.2); color: #94a3b8; }

.pship-tbl-date { font-size: 11px; color: var(--tx3); white-space: nowrap; }

.pship-tbl-link {
  font-size: 11px; color: var(--ac); text-decoration: none; white-space: nowrap;
}
.pship-tbl-link:hover { text-decoration: underline; }

/* Mobile: hide Date column, keep Name/Type/Link */
@media (max-width: 480px) {
  .pship-tbl thead th:nth-child(4),
  .pship-tbl td:nth-child(4) { display: none; }
}

/* ── Partnership chips (replaces table) ── */
.pship-chips-wrap {
  padding: 12px 16px 16px;
  border-bottom: 1px solid var(--b1);
}
.pship-chips-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--tx3); margin-bottom: 10px;
}
.pship-chips-count {
  background: var(--s2); border: 1px solid var(--b2);
  border-radius: 999px; padding: 1px 7px;
  font-size: 9px; color: var(--tx3); font-weight: 600;
}
.pship-chips-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.pship-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--s2); border: 1px solid var(--b2);
  border-radius: 8px; padding: 8px 14px;
  transition: background .15s, border-color .15s;
}
.pship-chip:hover { background: var(--s3); border-color: var(--b3); }
.pship-chip-partner { border-left: 3px solid var(--ac); }
.pship-chip-client  { border-left: 3px solid #fbbf24; }
.pship-chip-name { font-size: 13px; font-weight: 700; color: var(--tx); }

/* ══════════════════════════════════════════════════════════════
   Portfolio Tracker
══════════════════════════════════════════════════════════════ */

/* Add position bar */
.port-form-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 20px; border-bottom: 1px solid var(--b1);
  flex-wrap: wrap;
}
.port-input {
  background: var(--s2); border: 1px solid var(--b2);
  border-radius: 6px; color: var(--tx);
  font-family: var(--mono); font-size: 13px;
  padding: 7px 10px; outline: none;
  transition: border-color .15s;
}
.port-input:focus { border-color: var(--ac); }
.port-input[placeholder*="Ticker"] { width: 100px; text-transform: uppercase; }
.port-input[placeholder*="Shares"] { width: 100px; }
.port-input[placeholder*="cost"]   { width: 120px; }
.port-add-btn {
  background: var(--ac-dim); border: 1px solid var(--ac-brd);
  color: var(--ac); border-radius: 6px;
  font-size: 12px; font-weight: 700; padding: 7px 14px;
  cursor: pointer; transition: opacity .15s; white-space: nowrap;
}
.port-add-btn:hover { opacity: .8; }

/* Summary bar */
.port-summary {
  display: flex; align-items: center; gap: 0;
  padding: 12px 20px; border-bottom: 1px solid var(--b1);
  flex-wrap: wrap; gap: 0;
}
.port-sum-item { padding: 4px 18px 4px 0; }
.port-sum-val  { font-size: 17px; font-weight: 700; color: var(--tx); font-family: var(--mono); }
.port-sum-lbl  { font-size: 10px; color: var(--tx3); text-transform: uppercase; letter-spacing: .07em; margin-top: 1px; }
.port-sum-sep  { width: 1px; height: 32px; background: var(--b2); margin: 0 14px 0 4px; flex-shrink: 0; }
.port-refresh-btn {
  margin-left: auto; background: none; border: 1px solid var(--b2);
  color: var(--tx2); border-radius: 6px; font-size: 12px;
  padding: 5px 12px; cursor: pointer; transition: border-color .15s, color .15s;
}
.port-refresh-btn:hover { border-color: var(--ac); color: var(--ac); }

/* Layout: table + pie side by side */
.port-layout {
  display: flex; align-items: flex-start; overflow: auto;
}
.port-table-wrap { flex: 1; overflow-x: auto; min-width: 0; }
.port-pie-wrap {
  width: 260px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 16px 16px;
  border-left: 1px solid var(--b1);
}

/* Table */
.port-table {
  width: 100%; border-collapse: collapse; table-layout: auto;
}
.port-th {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--tx3);
  padding: 10px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--b2);
}
.port-th-r { text-align: right; }
.port-row { border-bottom: 1px solid var(--b1); transition: background .12s; }
.port-row:last-child { border-bottom: none; }
.port-row:hover { background: var(--s2); }
.port-row td { padding: 10px 12px; vertical-align: middle; }
.port-td-num { text-align: right; font-family: var(--mono); font-size: 13px; }
.port-td-ticker { display: flex; align-items: center; gap: 10px; }
.port-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.port-tick-sym  { font-size: 13px; font-weight: 700; color: var(--tx); }
.port-tick-name { font-size: 10px; color: var(--tx3); margin-top: 1px; }
.port-price  { font-size: 13px; font-weight: 600; }
.port-daychg { font-size: 10px; margin-top: 1px; }
.port-gl     { font-size: 13px; font-weight: 600; }
.port-glpct  { font-size: 10px; margin-top: 1px; }
.port-na     { color: var(--tx3); }
.port-remove-btn {
  background: none; border: 1px solid var(--b1);
  color: var(--tx3); border-radius: 4px;
  font-size: 14px; line-height: 1; padding: 2px 7px;
  cursor: pointer; transition: border-color .12s, color .12s;
}
.port-remove-btn:hover { border-color: var(--ls); color: var(--ls); }

/* Pie + legend */
.port-pie-legend { width: 100%; margin-top: 14px; }
.port-legend-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; border-bottom: 1px solid var(--b1);
}
.port-legend-row:last-child { border-bottom: none; }
.port-legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.port-legend-tick { font-size: 12px; font-weight: 700; color: var(--tx); flex: 1; font-family: var(--mono); }
.port-legend-pct  { font-size: 11px; color: var(--tx2); font-family: var(--mono); }

/* Loading + empty states */
.port-loading {
  display: flex; align-items: center; gap: 10px;
  padding: 32px 20px; color: var(--tx3); font-size: 13px;
}
.port-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 60px 20px;
  color: var(--tx3); font-size: 13px; text-align: center; gap: 8px;
}
.port-empty-icon { font-size: 40px; margin-bottom: 4px; }

/* Mobile */
@media (max-width: 640px) {
  .port-layout { flex-direction: column; }
  .port-pie-wrap { width: 100%; border-left: none; border-top: 1px solid var(--b1); flex-direction: row; gap: 16px; align-items: flex-start; }
  .port-th:nth-child(2), .port-row td:nth-child(2),
  .port-th:nth-child(3), .port-row td:nth-child(3) { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   Crypto Sub-tabs
══════════════════════════════════════════════════════════════ */
.crypto-subtabs {
  display: flex;
  gap: 4px;
  padding: 0 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--b1);
  margin-bottom: 0;
}

.crypto-subtab {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: var(--font);
}
.crypto-subtab:hover  { background: var(--s3); color: var(--tx); }
.crypto-subtab.active { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); }

.cpanel { padding: 0; min-height: 0; }
.cpanel.hidden { display: none; }

/* ══════════════════════════════════════════════════════════════
   BTC Cycle Charts
══════════════════════════════════════════════════════════════ */
.cycles-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}
.cycles-content.hidden { display: none; }

.cycle-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--r-lg);
  padding: 18px 20px;
}

.cycle-card-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cycle-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 4px;
}

.cycle-desc {
  font-size: 11px;
  color: var(--tx3);
  line-height: 1.5;
  max-width: 520px;
}

.cycle-legend {
  font-size: 10.5px;
  color: var(--tx3);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}

.cl-dot {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 3px;
}

.cl-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 3px;
}

.cycle-chart-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
  background: #07101d;
}

.cycle-canvas {
  display: block;
  width: 100%;
}

.cc-badge-wrap { flex-shrink: 0; }

.cc-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.cc-badge-ok      { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.cc-badge-warn    { background: rgba(240,68,68,.12); color: var(--ls); border: 1px solid rgba(240,68,68,.3); }
.cc-badge-neutral { background: rgba(245,166,35,.12); color: var(--wn); border: 1px solid rgba(245,166,35,.3); }

/* ══════════════════════════════════════════════════════════════
   Insider Transactions Tab
══════════════════════════════════════════════════════════════ */
/* ── Insider Transactions ─────────────────────────────────────── */
.insider-grid { flex: 1; overflow-y: auto; min-height: 0; }
.ins-error { padding: 30px 20px; color: var(--tx3); font-size: 13px; }

/* Hero */
.ins-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--b2);
  flex-wrap: wrap;
  background: linear-gradient(90deg, var(--s3), var(--s2));
}

.ins-hero-left { display: flex; align-items: center; gap: 12px; }

.ins-ticker-badge {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--ac);
  letter-spacing: .5px;
}

.ins-hero-info { display: flex; flex-direction: column; gap: 4px; }
.ins-hero-title { font-size: 12px; font-weight: 700; color: var(--tx); }

.ins-src-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .6px;
}

.ins-net-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  font-family: var(--mono);
}
.ins-net-buy  { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.ins-net-sell { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }

/* Summary cards */
.ins-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border-bottom: 1px solid var(--b1);
}

.ins-card {
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ins-card-buy  { border-right: 1px solid var(--b1); }

.ins-card-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.ins-card-buy  .ins-card-hdr { color: var(--gn); }
.ins-card-sell .ins-card-hdr { color: var(--ls); }

.ins-card-count {
  font-size: 26px;
  font-weight: 800;
  font-family: var(--mono);
  line-height: 1;
}
.ins-card-buy  .ins-card-count { color: var(--gn); }
.ins-card-sell .ins-card-count { color: var(--ls); }
.ins-card-count span { font-size: 11px; color: var(--tx3); font-family: var(--font); font-weight: 500; }

.ins-card-shares { font-size: 11px; color: var(--tx2); font-family: var(--mono); }
.ins-card-value  { font-size: 12px; font-weight: 600; color: var(--tx); }

/* Quarter chart */
.ins-chart-wrap {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--b1);
}

.ins-section-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx3);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ins-section-hdr::after { content: ''; flex: 1; height: 1px; background: var(--b1); }

.ins-count-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--s3);
  color: var(--tx3);
  text-transform: none;
  letter-spacing: 0;
}

.ins-qtr-canvas { display: block; width: 100%; margin-bottom: 14px; }

/* Quarter breakdown table */
.ins-qtr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 4px;
}
.ins-qtr-table thead th {
  padding: 5px 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--tx3);
  text-align: left;
  border-bottom: 1px solid var(--b1);
  white-space: nowrap;
}
.ins-qth-buy  { color: var(--gn) !important; }
.ins-qth-sell { color: var(--ls) !important; }
.ins-qtr-table tbody tr {
  border-bottom: 1px solid var(--b1);
  transition: background .12s;
}
.ins-qtr-table tbody tr:hover { background: var(--s3); }
.ins-qtr-table td { padding: 7px 10px; vertical-align: middle; }
.ins-qtd-lbl    { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--tx); white-space: nowrap; }
.ins-qtd-period { font-size: 10.5px; color: var(--tx3); white-space: nowrap; }
.ins-qtd-buy    { color: var(--gn); white-space: nowrap; }
.ins-qtd-sell   { color: var(--ls); white-space: nowrap; }
.ins-qtd-net-buy  { color: var(--gn); font-weight: 700; white-space: nowrap; }
.ins-qtd-net-sell { color: var(--ls); font-weight: 700; white-space: nowrap; }
.ins-qtd-shares { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.ins-qtd-val    { font-family: var(--mono); font-size: 10px; opacity: .75; margin-left: 4px; }

/* Table */
.ins-table-section { padding: 16px 0 4px; }

.ins-table-wrap { overflow-x: auto; padding: 0 0 16px; }

.ins-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  min-width: 700px;
}

.ins-table thead th {
  padding: 6px 12px;
  text-align: left;
  color: var(--tx3);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  border-bottom: 1px solid var(--b2);
  white-space: nowrap;
  background: var(--s1);
  position: sticky;
  top: 0;
}

.ins-table tbody tr { border-bottom: 1px solid var(--b1); transition: background .12s; }
.ins-table tbody tr:hover { background: var(--s3); }

.ins-row-buy  td:first-child { border-left: 2px solid var(--gn); }
.ins-row-sell td:first-child { border-left: 2px solid var(--ls); }

.ins-table td { padding: 8px 12px; color: var(--tx2); vertical-align: middle; }

.ins-td-date  { font-family: var(--mono); font-size: 10.5px; color: var(--tx2); white-space: nowrap; }
.ins-td-name  { font-weight: 600; color: var(--tx); white-space: nowrap; }
.ins-td-role  { font-size: 11px; color: var(--tx2); white-space: nowrap; }
.ins-td-price { font-family: var(--mono); font-size: 11px; white-space: nowrap; }
.ins-td-val   { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--tx); white-space: nowrap; }
.ins-td-owned { font-family: var(--mono); font-size: 10.5px; color: var(--tx2); white-space: nowrap; }

.ins-td-shares { font-family: var(--mono); font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ins-shares-buy  { color: var(--gn); }
.ins-shares-sell { color: var(--ls); }

.ins-type-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.ins-type-buy  { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.ins-type-sell { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }

/* ══════════════════════════════════════════════════════════════
   Short Interest Tab
══════════════════════════════════════════════════════════════ */

/* Sub-tabs */
.si-subtabs {
  display: flex;
  gap: 2px;
  padding: 10px 16px 0;
  border-bottom: 1px solid var(--b1);
  background: var(--s1);
  flex-shrink: 0;
}

.si-subtab {
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx3);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.si-subtab:hover  { color: var(--tx); }
.si-subtab.active { color: var(--ac); border-bottom-color: var(--ac); }

.si-panel {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* Top Shorted table */
.si-top-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 10px;
  border-bottom: 1px solid var(--b1);
  flex-wrap: wrap;
}

.si-top-count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
}

.si-top-updated {
  font-size: 10.5px;
  color: var(--tx3);
}

.si-top-src {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--tx3);
  margin-left: auto;
}

.si-top-table-wrap { overflow-x: auto; }

.si-top-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.si-top-table thead th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx2);
  border-bottom: 1px solid var(--b1);
  white-space: nowrap;
  background: var(--s2);
}

.si-top-row {
  border-bottom: 1px solid var(--b1);
  cursor: pointer;
  transition: background .12s;
}
.si-top-row:hover { background: var(--s3); }

.si-top-rank    { padding: 9px 10px; font-family: var(--mono); font-size: 10px; color: var(--tx2); width: 32px; }
.si-top-ticker  { padding: 9px 12px; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ac); white-space: nowrap; }
.si-top-company { padding: 9px 12px; color: var(--tx); font-weight: 500; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.si-top-exch    { padding: 9px 10px; font-size: 10px; color: var(--tx2); white-space: nowrap; }
.si-top-pct     { padding: 9px 14px; font-family: var(--mono); font-weight: 700; white-space: nowrap; min-width: 120px; }
.si-top-num     { padding: 9px 12px; font-family: var(--mono); font-size: 11px; color: var(--tx2); white-space: nowrap; }
.si-top-industry { padding: 9px 12px; font-size: 10.5px; color: var(--tx2); }

.si-pct-high { color: var(--ls); }
.si-pct-mid  { color: var(--wn); }
.si-pct-low  { color: var(--ac); }

.si-top-link-cell { padding: 9px 12px 9px 4px; width: 32px; }
.si-top-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--r-xs);
  font-size: 13px;
  color: var(--tx3);
  background: transparent;
  border: 1px solid var(--b1);
  text-decoration: none;
  transition: color .15s, background .15s, border-color .15s;
}
.si-top-link:hover {
  color: var(--ac);
  background: var(--ac-dim);
  border-color: var(--ac-brd);
}

/* Mini bar */
.si-bar-wrap {
  height: 3px;
  background: var(--b2);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.si-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease;
}
.si-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--b1);
  gap: 12px;
  flex-wrap: wrap;
}

.si-hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.si-ticker-badge {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  padding: 4px 12px;
  border-radius: var(--r-sm);
}

.si-hero-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.si-hero-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx);
}

.si-src-badge {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--tx3);
}

.si-hero-pct {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.si-hero-pct-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--tx3);
  font-family: var(--font);
}

/* Metric cards grid */
.si-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--b1);
  border-top: 1px solid var(--b1);
  border-bottom: 1px solid var(--b1);
  margin-bottom: 0;
}

.si-metric-card {
  background: var(--s1);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background .12s;
}
.si-metric-card:hover { background: var(--s2); }

.si-metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx2);
}

.si-metric-val {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.2;
}

.si-metric-sub {
  font-size: 12px;
  color: var(--tx2);
}

/* MoM change pill */
.si-mom {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 2px;
  white-space: nowrap;
}
.si-mom-up   { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }
.si-mom-down { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }

/* Borrow fee colors */
.si-fee-high { color: var(--ls); }
.si-fee-mid  { color: var(--wn); }
.si-fee-low  { color: var(--gn); }

/* Info note */
.si-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 20px;
  font-size: 11px;
  color: var(--tx3);
  line-height: 1.5;
}

.si-note-icon {
  font-size: 13px;
  color: var(--ac);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════════
   Alerts Tab
══════════════════════════════════════════════════════════════ */

/* Tab badge */
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--ls); color: #fff; font-size: 10px; font-weight: 800;
  font-family: var(--mono); margin-left: 5px; vertical-align: middle; line-height: 1;
}

/* Settings bar */
.al-settings-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.al-settings-label { font-size: 13px; color: var(--tx2); }
.al-settings-label strong { color: var(--tx); }
.al-select {
  background: var(--s3); border: 1px solid var(--b2); color: var(--tx);
  font-size: 13px; font-family: var(--font); padding: 5px 10px;
  border-radius: var(--r-sm); cursor: pointer; outline: none; transition: border-color .15s;
}
.al-select:focus { border-color: var(--ac); }
.al-status-on  { font-size: 11px; font-weight: 700; color: var(--gn); }
.al-status-off { font-size: 11px; font-weight: 700; color: var(--tx2); }

/* Sub-tabs */
.al-subtabs {
  display: flex; gap: 2px; padding: 10px 16px 0;
  border-bottom: 1px solid var(--b1); background: var(--s1); flex-shrink: 0;
}
.al-subtab {
  padding: 7px 16px; font-size: 12px; font-weight: 600; color: var(--tx2);
  background: transparent; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; transition: color .15s, border-color .15s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.al-subtab:hover  { color: var(--tx); }
.al-subtab.active { color: var(--ac); border-bottom-color: var(--ac); }
.al-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--ls); color: #fff; font-size: 10px; font-weight: 800; font-family: var(--mono);
}

.al-panel { flex: 1; overflow-y: auto; min-height: 0; }

/* Toggle switch (shared for settings bar) */
.al-toggle { position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; flex-shrink: 0; }
.al-toggle-input { opacity: 0; width: 0; height: 0; }
.al-toggle-slider {
  position: absolute; inset: 0; background: var(--b2); border-radius: 18px; transition: background .2s;
}
.al-toggle-slider::before {
  content: ""; position: absolute; width: 12px; height: 12px;
  left: 3px; bottom: 3px; background: var(--tx3); border-radius: 50%;
  transition: transform .2s, background .2s;
}
.al-toggle-input:checked + .al-toggle-slider { background: var(--gn-dim); border: 1px solid var(--gn-brd); }
.al-toggle-input:checked + .al-toggle-slider::before { transform: translateX(16px); background: var(--gn); }

/* ── Buy Opportunities panel ────────────────────────────── */
.opp-scan-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 2px 8px; gap: 12px;
}
.opp-scan-desc { font-size: 12px; color: var(--tx3); margin: 0; }

.opp-filter-bar {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; flex-shrink: 0;
}
.opp-filter-btn {
  height: 26px; padding: 0 12px;
  background: none; border: 1px solid var(--b2); border-radius: 13px;
  color: var(--tx2); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .12s;
}
.opp-filter-btn:hover  { color: var(--tx); background: var(--s3); }
.opp-filter-btn.active { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

.opp-scan-grid {
  display: flex; flex-direction: column; gap: 10px;
  flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px 20px;
}

.opp-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.opp-card:hover { background: var(--s3); border-color: var(--b2); transform: translateY(-1px); }

.opp-card-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 12px 14px 8px;
}
.opp-card-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.opp-card-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

.opp-ticker { font-family: var(--mono); font-size: 15px; font-weight: 800; color: var(--tx); }
.opp-name   { font-size: 11px; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.opp-price  { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--tx); }

.opp-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.opp-stage-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 2px 7px; border-radius: 3px;
  background: var(--ac-dim); color: var(--ac); border: 1px solid var(--ac-brd);
}
.opp-sector-tag {
  font-size: 9px; font-weight: 600;
  padding: 2px 7px; border-radius: 3px;
  background: var(--s3); color: var(--tx3); border: 1px solid var(--b1);
}
.opp-wl-tag {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 3px;
  background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd);
}

.opp-signal-row {
  margin: 0 14px 8px;
  padding: 7px 10px;
  background: var(--s1);
  border-radius: 6px;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
}
.opp-signal-label  { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; flex-shrink: 0; }
.opp-signal-reason { font-size: 11px; color: var(--tx2); }

.opp-metrics-row {
  padding: 0 14px 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.opp-changes {
  display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; font-weight: 700;
}
.opp-pos  { color: var(--gn); }
.opp-neg  { color: var(--ls); }
.opp-warn { color: var(--wn); }
.opp-rsi  { color: var(--tx2); }
.opp-vol  { color: var(--wn); }

.opp-pills { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.opp-pill {
  font-size: 10px; padding: 2px 7px; border-radius: 3px;
  background: var(--s3); color: var(--tx2); border: 1px solid var(--b1);
}
.opp-pill b { color: var(--tx); }

.opp-conviction-bar {
  height: 20px; position: relative; overflow: hidden;
  border-top: 1px solid var(--b1);
  display: flex; align-items: center;
}
.opp-conviction-fill {
  position: absolute; left: 0; top: 0; height: 100%;
  transition: width .3s;
}
.opp-conviction-label {
  position: relative; z-index: 1; padding: 0 10px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--tx3);
}

body.light .opp-card { background: var(--s1); }
body.light .opp-card:hover { background: var(--s2); }
body.light .opp-signal-row { background: #f0f2f5; }

/* Scorecard grid */
.al-scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 16px;
}

.al-sc-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .12s;
}
.al-sc-card:hover { background: var(--s3); }
.al-sc-monitored  { border-left: 3px solid var(--gn); }
.al-sc-skipped    { border-left: 3px solid var(--b2); opacity: .7; }

.al-sc-top   { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.al-sc-left  { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.al-sc-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }

.al-sc-ticker { font-family: var(--mono); font-size: 15px; font-weight: 800; color: var(--ac); }
.al-sc-name   { font-size: 11px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

.al-sc-status { font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.al-sc-watching { color: var(--gn); }
.al-sc-nowatch  { color: var(--tx3); }

.al-sc-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.al-sc-metric { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.al-sc-mlabel { font-size: 9.5px; color: var(--tx3); }
.al-sc-mval   { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--tx2); }

.al-sc-label { font-size: 10px; color: var(--tx3); font-style: italic; }

/* Pillar bars */
.al-sc-pillars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0 2px;
  border-top: 1px solid var(--b1);
}
.al-sc-pillar { display: flex; align-items: center; gap: 6px; }
.al-sc-pill-lbl {
  font-size: 9px; color: var(--tx3); width: 48px; flex-shrink: 0;
}
.al-sc-pill-track {
  flex: 1; height: 5px; background: var(--b1); border-radius: 3px; overflow: hidden;
}
.al-sc-pill-fill {
  height: 100%; border-radius: 3px; transition: width .3s ease;
}
.al-sc-pill-fill.high { background: var(--gn); }
.al-sc-pill-fill.mid  { background: var(--ac); }
.al-sc-pill-fill.low  { background: var(--wn); }
.al-sc-pill-val {
  font-family: var(--mono); font-size: 9px; color: var(--tx2);
  width: 30px; text-align: right; flex-shrink: 0;
}

/* Guru fit chip */
.al-sc-guru-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9.5px; font-weight: 600; color: var(--ac);
  background: var(--ac-dim); border: 1px solid var(--ac-brd);
  border-radius: 10px; padding: 2px 9px;
  width: fit-content;
}

.al-sc-footer {
  font-size: 9.5px;
  color: var(--gn);
  padding-top: 6px;
  border-top: 1px solid var(--b1);
}
.al-sc-footer-skip { color: var(--tx3); }

/* Quality badge */
.al-qual-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; font-weight: 800;
  padding: 3px 9px; border-radius: 10px;
}
.al-qual-badge span { font-size: 10px; font-weight: 600; opacity: .8; }
.al-q-a { background: rgba(33,209,106,.15); color: var(--gn); border: 1px solid var(--gn-brd); }
.al-q-b { background: rgba(33,209,106,.08); color: #6ee7a0; border: 1px solid rgba(33,209,106,.2); }
.al-q-c { background: rgba(245,166,35,.12); color: var(--wn); border: 1px solid rgba(245,166,35,.3); }
.al-q-d { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }
.al-q-f { background: var(--s3); color: var(--tx3); border: 1px solid var(--b1); }

/* History feed */
.al-history-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.al-history-card {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 14px 16px; background: var(--s2);
  border: 1px solid var(--ls-brd); border-left: 3px solid var(--ls);
  border-radius: var(--r-sm); gap: 12px;
  animation: al-slide-in .25s ease;
}
@keyframes al-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.al-hist-left  { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.al-hist-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.al-hist-ticker { font-family: var(--mono); font-size: 15px; font-weight: 800; color: var(--ls); white-space: nowrap; }
.al-hist-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.al-hist-name { font-size: 12px; font-weight: 600; color: var(--tx); }
.al-hist-row  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.al-hist-drop  { font-family: var(--mono); font-size: 13px; font-weight: 800; color: var(--ls); }
.al-hist-price { font-family: var(--mono); font-size: 12px; color: var(--tx); font-weight: 600; }
.al-hist-prev  { font-size: 10.5px; color: var(--tx3); }
.al-hist-time  { font-size: 9.5px; color: var(--tx3); text-align: right; line-height: 1.5; }
.al-hist-lookup { font-size: 11px; padding: 4px 10px; }

/* Empty state */
.al-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 48px 20px; gap: 10px; color: var(--tx3); font-size: 13px; text-align: center;
}
.al-empty-icon { font-size: 32px; opacity: .4; }

/* Toast */
#alert-toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none;
}
.al-toast {
  padding: 12px 18px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600;
  max-width: 380px; opacity: 0; transform: translateX(20px);
  transition: opacity .3s, transform .3s; pointer-events: auto; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.al-toast-show  { opacity: 1; transform: translateX(0); }
.al-toast-alert { background: #2a1111; border: 1px solid var(--ls-brd); color: var(--ls); }
.al-toast-info  { background: var(--s3); border: 1px solid var(--b2); color: var(--tx2); }
.al-toast-error { background: var(--s3); border: 1px solid var(--b2); color: var(--tx3); }

/* ══════════════════════════════════════════════════════════════
   Source Reliability Notes
══════════════════════════════════════════════════════════════ */
.src-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  margin: 2px 20px 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--tx2);
}
.src-note a {
  color: var(--ac);
  text-decoration: none;
}
.src-note a:hover { text-decoration: underline; }
.src-note strong { color: var(--tx); font-weight: 600; }

.src-note-warn {
  background: rgba(245, 166, 35, 0.07);
  border: 1px solid rgba(245, 166, 35, 0.22);
}
.src-note-ok {
  background: rgba(33, 209, 106, 0.05);
  border: 1px solid rgba(33, 209, 106, 0.18);
}
.src-note-info {
  background: rgba(0, 206, 255, 0.05);
  border: 1px solid rgba(0, 206, 255, 0.18);
}

/* ══════════════════════════════════════════════════════════════
   Sectors Tab
══════════════════════════════════════════════════════════════ */
.sectors-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 0 20px;
}

.sec-period-bar {
  display: flex; gap: 3px;
}
.sec-period-btn {
  height: 26px; padding: 0 10px;
  background: none; border: 1px solid var(--b2); border-radius: 4px;
  color: var(--tx2); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .12s;
}
.sec-period-btn:hover  { color: var(--tx); background: var(--s3); }
.sec-period-btn.active { color: var(--ac); background: var(--ac-dim); border-color: var(--ac-brd); }

.sectors-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  padding: 4px 0 16px;
}

.sec-card {
  border-radius: 10px;
  padding: 12px 12px 8px;
  border: 1px solid var(--b1);
  cursor: pointer;
  transition: transform .1s, filter .12s;
  display: flex; flex-direction: column; gap: 8px;
}
.sec-card:hover { transform: translateY(-2px); filter: brightness(1.08); }

.sec-card-top { display: flex; flex-direction: column; gap: 3px; }
.sec-card-header { display: flex; align-items: baseline; justify-content: space-between; }

.sec-etf   { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--tx3); }
.sec-price { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--tx2); }
.sec-name  { font-size: 13px; font-weight: 700; color: var(--tx); }
.sec-pct   { font-family: var(--mono); font-size: 22px; font-weight: 800; line-height: 1; }

.sec-mini-periods {
  display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 2px;
}
.sec-mini-val {
  font-size: 10px; font-weight: 600; color: var(--tx3);
}
.sec-pos { color: var(--gn) !important; }
.sec-neg { color: var(--ls) !important; }

.sec-stocks {
  display: flex; flex-direction: column; gap: 3px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 7px;
}
.sec-stock-row {
  display: flex; justify-content: space-between; align-items: center;
}
.sec-stock-ticker { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--tx); }
.sec-stock-chg    { font-family: var(--mono); font-size: 11px; font-weight: 600; }
.sec-stock-pos    { color: var(--gn); }
.sec-stock-neg    { color: var(--ls); }

.sec-footer {
  font-size: 10px; color: var(--tx3);
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 6px; margin-top: 2px;
}

/* Sector detail table */
.sectors-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--b1);
  border-radius: 10px;
  margin-top: 4px;
}
.sectors-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.sectors-table th {
  padding: 8px 12px; text-align: left;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--tx3); background: var(--s2); border-bottom: 1px solid var(--b1);
  white-space: nowrap;
}
.sectors-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--b1);
  white-space: nowrap; font-family: var(--mono); font-size: 12px;
}
.sectors-table tr:last-child td { border-bottom: none; }
.sectors-table tr:hover td { background: var(--s2); }
.sec-td-name { font-family: var(--font); font-weight: 600; color: var(--tx); }
.sec-td-etf  { font-weight: 700; color: var(--ac); }

/* ══════════════════════════════════════════════════════════════
   Heat Map Tab
══════════════════════════════════════════════════════════════ */
.hmap-search-wrap {
  padding: 10px 16px 0;
  flex-shrink: 0;
  overflow: hidden;
}

.hmap-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  padding: 0 12px;
  transition: border-color .15s;
}
.hmap-search-box:focus-within {
  border-color: var(--ac-brd);
  box-shadow: 0 0 0 2px var(--ac-glow);
}

.hmap-search-icon {
  color: var(--tx3);
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}

.hmap-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--tx);
  font-size: 14px;
  font-family: var(--font);
  padding: 11px 0;
}
.hmap-input::placeholder { color: var(--tx3); }

.hmap-clear {
  background: none;
  border: none;
  color: var(--tx3);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
  line-height: 1;
  border-radius: 50%;
  transition: color .15s, background .15s;
}
.hmap-clear:hover { color: var(--tx); background: var(--s3); }
.hmap-clear.hidden { display: none; }

.hmap-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  touch-action: pan-x;
}
.hmap-chips::-webkit-scrollbar { display: none; }

.hmap-chip {
  flex-shrink: 0;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  color: var(--tx2);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 13px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  font-family: var(--font);
}
.hmap-chip:hover  { background: var(--s3); color: var(--tx); }
.hmap-chip.active { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); }

.hmap-back-bar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--s1);
  border-bottom: 1px solid var(--b1);
  flex-shrink: 0;
}
.hmap-back-bar.hidden { display: none; }
.hmap-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-md);
  color: var(--tx2);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 500;
  padding: 6px 14px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.hmap-back-btn:hover {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

.hmap-dropdown {
  position: absolute;
  top: calc(100% - 2px);
  left: 20px;
  right: 20px;
  background: var(--s2);
  border: 1px solid var(--ac-brd);
  border-top: none;
  border-radius: 0 0 var(--r-md) var(--r-md);
  z-index: 50;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0,0,0,.4);
}
.hmap-dropdown.hidden { display: none; }

.hmap-dd-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--tx2);
  cursor: pointer;
  transition: background .1s, color .1s;
}
.hmap-dd-item:hover { background: var(--ac-dim); color: var(--ac); }

.hmap-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px 12px;
}

.hmap-fetching {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--tx3);
  font-size: 13px;
}

.hmap-tip {
  position: absolute;
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(4px);
  color: #e8e8e8;
  padding: 5px 11px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  font-family: var(--mono);
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
}
.hmap-tip.hidden { display: none; }

/* ══════════════════════════════════════════════════════════════
   Ask AI Tab
══════════════════════════════════════════════════════════════ */
.ai-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px 20px;
  gap: 12px;
}

.ai-welcome-icon {
  font-size: 32px;
  color: var(--ac);
  margin-bottom: 4px;
}

.ai-welcome h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--tx);
  margin: 0;
}

.ai-welcome p {
  font-size: 12px;
  color: var(--tx3);
  margin: 0;
  max-width: 360px;
}

.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 8px;
  max-width: 560px;
}

.ai-sugg {
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: var(--r-lg);
  color: var(--tx2);
  font-size: 11.5px;
  padding: 7px 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: var(--font);
}
.ai-sugg:hover { background: var(--s3); border-color: var(--ac-brd); color: var(--ac); }

.ai-message { max-width: 100%; }

.ai-msg-bubble {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 680px;
}

.ai-msg-user {
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  color: var(--tx);
  margin-left: auto;
  border-bottom-right-radius: 4px;
}

.ai-msg-ai {
  background: var(--s2);
  border: 1px solid var(--b1);
  color: var(--tx);
  border-bottom-left-radius: 4px;
}

.ai-msg-content h2, .ai-msg-content h3, .ai-msg-content h4 {
  color: var(--ac);
  margin: 12px 0 6px;
  font-size: 13px;
}
.ai-msg-content p  { margin: 4px 0; }
.ai-msg-content ul { margin: 6px 0 6px 18px; padding: 0; }
.ai-msg-content li { margin-bottom: 3px; }
.ai-msg-content code {
  background: var(--s3);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.ai-msg-content strong { color: var(--tx); }

.ai-thinking {
  display: inline-block;
  animation: blink 1s step-end infinite;
  font-size: 16px;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .2; } }

.ai-input-bar {
  padding: 12px 20px 14px;
  border-top: 1px solid var(--b1);
  background: var(--s1);
  flex-shrink: 0;
}

.ai-input-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ai-input {
  flex: 1;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 10px;
  color: var(--tx);
  padding: 10px 14px;
  font-family: var(--font);
  font-size: 13px;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
}
.ai-input:focus { border-color: var(--ac-brd); box-shadow: 0 0 0 3px var(--ac-glow); }
.ai-input::placeholder { color: var(--tx3); }

.ai-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ac);
  border: none;
  color: #07101d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
}
.ai-send-btn:hover   { background: #1ad5ff; }
.ai-send-btn:disabled { opacity: .5; cursor: not-allowed; background: var(--s3); color: var(--tx3); }

.ai-disclaimer {
  font-size: 10px;
  color: var(--tx3);
  margin: 6px 0 0;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   Pre / Post Market tape extensions
══════════════════════════════════════════════════════════════ */
.tape-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  letter-spacing: .01em;
}
.tape-pre  { background: rgba(245,166,35,.18); color: var(--wn); border: 1px solid rgba(245,166,35,.3); }
.tape-post { background: rgba(138,99,210,.18); color: #a78bfa;  border: 1px solid rgba(138,99,210,.3); }

/* ══════════════════════════════════════════════════════════════
   Financial Statements (Income / Balance Sheet / Cash Flow)
══════════════════════════════════════════════════════════════ */
.fin-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fin-section {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: 12px;
  overflow: hidden;
}

.fin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--b1);
  background: var(--s2);
}

.fin-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: .5px;
  text-transform: uppercase;
}

.fin-tabs {
  display: flex;
  gap: 4px;
}

.fin-tab {
  background: transparent;
  border: 1px solid var(--b2);
  color: var(--tx3);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.fin-tab:hover { border-color: var(--b3); color: var(--tx2); }
.fin-tab.active {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

.fin-body { overflow: hidden; }

.fin-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

/* Header row */
.fin-table thead tr { background: var(--s2); }

.fin-th {
  padding: 8px 14px;
  text-align: right;
  color: var(--tx3);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--b2);
  font-family: var(--font);
}

.fin-th-label {
  text-align: left;
  min-width: 155px;
  width: 155px;
  position: sticky;
  left: 0;
  background: var(--s2);
  z-index: 2;
}

/* Data rows */
.fin-row { border-bottom: 1px solid var(--b1); }
.fin-row:last-child { border-bottom: none; }
.fin-row:nth-child(odd)  { background: var(--bg); }
.fin-row:nth-child(even) { background: var(--s1); }
.fin-row:hover { background: var(--s2); }

/* Bold key rows */
.fin-row-key { border-top: 1px solid var(--b2); border-bottom: 1px solid var(--b2); }
.fin-row-key .fin-label { color: var(--tx); font-weight: 600; }
.fin-row-key .fin-td    { font-weight: 600; }

.fin-label {
  padding: 7px 14px;
  color: var(--tx2);
  font-size: 12px;
  font-family: var(--font);
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
  border-right: 1px solid var(--b1);
}

.fin-td {
  padding: 7px 14px;
  text-align: right;
  white-space: nowrap;
  vertical-align: top;
}

/* TradingView-style stacked cell: value on top, YoY badge below */
.fin-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.fin-val {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
}

.fin-yoy-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.fin-yoy-pos { color: var(--gn); background: var(--gn-dim); }
.fin-yoy-neg { color: var(--ls); background: var(--ls-dim); }

.fin-na  { color: var(--tx3); }
.fin-pos { color: var(--tx2); }
.fin-neg { color: var(--ls);  }
.fin-key-neg { color: var(--ls); }

.fin-row-key .fin-pos { color: var(--tx); }
.fin-row-key .fin-neg { color: var(--ls); }

.fin-empty {
  padding: 28px;
  text-align: center;
  color: var(--tx3);
  font-size: 13px;
}

/* Sub-item rows (indented, lighter) */
.fin-row-sub { }
.fin-label-sub {
  padding-left: 24px !important;
  color: var(--tx3);
  font-size: 11px;
}

/* Derived rows (margin %) */
.fin-row-derived { background: var(--s2) !important; }
.fin-label-derived {
  color: var(--tx3);
  font-size: 11px;
  padding-left: 28px !important;
  font-style: italic;
}
.fin-row-derived .fin-td { }

.fin-pct                        { font-family: var(--mono); }
.fin-pct-pos                    { color: var(--gn) !important; font-weight: 600; }
.fin-pct-neg                    { color: var(--ls) !important; font-weight: 600; }

/* "vs year ago" annotation in header */
.fin-th-yoy-note {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--ac);
  opacity: 0.7;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Yahoo Finance–style single-card financial statements */
.fin2-card {
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: 12px;
  overflow: hidden;
}

.fin2-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
  flex-wrap: wrap;
  gap: 0;
}

.fin2-stmt-tabs { display: flex; }

.fin2-stmt-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--tx3);
  font-size: 13px;
  font-weight: 500;
  padding: 13px 16px 11px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  font-family: var(--font);
}
.fin2-stmt-tab:hover  { color: var(--tx2); }
.fin2-stmt-tab.active { color: var(--ac); border-bottom-color: var(--ac); font-weight: 600; }

.fin2-period-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
}

.fin2-period-tab {
  background: transparent;
  border: 1px solid var(--b2);
  color: var(--tx3);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  font-family: var(--font);
}
.fin2-period-tab:hover:not(:disabled) { border-color: var(--b3); color: var(--tx2); }
.fin2-period-tab.active   { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); }
.fin2-period-tab:disabled { opacity: .35; cursor: not-allowed; }

.fin2-body { overflow: hidden; }

/* ══════════════════════════════════════════════════════════════
   Markets Tab
══════════════════════════════════════════════════════════════ */
.mkt-subtabs {
  display: flex;
  gap: 6px;
  padding: 0 0 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.mkt-subtab {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--b2);
  background: var(--s2);
  color: var(--tx2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.mkt-subtab:hover { background: var(--s3); color: var(--tx); }
.mkt-subtab.active {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

#mkt-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 20px 20px;
}

.mkt-table {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  overflow: hidden;
}

.mkt-header,
.mkt-row {
  display: grid;
  grid-template-columns: 32px 72px 1fr 100px 110px 90px 100px 110px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}

.mkt-header {
  background: var(--s3);
  border-bottom: 1px solid var(--b1);
  font-size: 11px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.mkt-row {
  border-bottom: 1px solid var(--b1);
  font-size: 13px;
  cursor: pointer;
  transition: background .12s;
}
.mkt-row:last-child { border-bottom: none; }
.mkt-row:hover { background: var(--s3); }

.mkt-rank  { color: var(--tx3); font-size: 11px; text-align: right; }
.mkt-sym   { font-weight: 700; color: var(--ac); font-family: var(--mono); font-size: 13px; }
.mkt-name  { color: var(--tx2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-price { color: var(--tx); font-weight: 600; font-family: var(--mono); font-size: 13px; text-align: right; }
.mkt-chg   { font-weight: 600; font-size: 13px; text-align: right; }
.mkt-vol    { color: var(--tx2); font-size: 12px; text-align: right; }
.mkt-avgvol { color: var(--tx3); font-size: 12px; text-align: right; }
.mkt-mcap   { color: var(--tx2); font-size: 12px; text-align: right; }

.mkt-up { color: var(--gn); }
.mkt-dn { color: var(--ls); }

/* ══════════════════════════════════════════════════════════════
   Earnings Calendar
══════════════════════════════════════════════════════════════ */
.earn-layout {
  display: flex;
  height: 100%;
  gap: 0;
  overflow: hidden;
}

/* ── Calendar side ── */
.earn-cal-side {
  flex-shrink: 0;
  width: 238px;
  border-right: 1px solid var(--b2);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.earn-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.earn-month-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: .2px;
}

.earn-nav-btn {
  background: none;
  border: 1px solid var(--b2);
  border-radius: 6px;
  color: var(--tx2);
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.earn-nav-btn:hover { background: var(--s3); color: var(--ac); }

.earn-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--tx3);
  letter-spacing: .4px;
  text-transform: uppercase;
}

.earn-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.earn-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--tx2);
  transition: background .1s, color .1s;
}
.earn-cal-day:hover         { background: var(--s3); color: var(--tx); }
.earn-cal-day.other-month   { color: var(--tx3); opacity: .35; pointer-events: none; }
.earn-cal-day.weekend       { color: var(--tx3); }
.earn-cal-day.today         { background: var(--ac-dim); color: var(--ac); font-weight: 700; }
.earn-cal-day.selected      { background: var(--ac); color: #000 !important; font-weight: 700; }

.earn-today-btn {
  background: none;
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--tx2);
  font-size: 12px;
  padding: 6px 0;
  cursor: pointer;
  width: 100%;
  transition: background .12s, color .12s, border-color .12s;
  margin-top: 4px;
}
.earn-today-btn:hover {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

/* ── Content side ── */
.earn-content-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 24px;
}

#earn-list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.earn-day-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
  gap: 12px;
}

.earn-date-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx);
}

.earn-time-filter {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.earn-tf {
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--tx3);
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.earn-tf:hover  { background: var(--s4); color: var(--tx); }
.earn-tf.active { background: var(--ac-dim); border-color: var(--ac-brd); color: var(--ac); font-weight: 600; }

/* ── Earnings table ── */
.earn-table-wrap {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  border: 1px solid var(--b1);
  border-radius: 10px;
}

.earn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.earn-table thead tr { border-bottom: 1px solid var(--b2); }

.earn-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx3);
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--s2);
  position: sticky;
  top: 0;
  z-index: 1;
}

.earn-table tbody tr {
  border-bottom: 1px solid var(--b1);
  cursor: pointer;
  transition: background .1s;
}
.earn-table tbody tr:last-child { border-bottom: none; }
.earn-table tbody tr:hover      { background: var(--s3); }

.earn-table td { padding: 11px 14px; }

.earn-ticker-cell {
  font-weight: 700;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ac) !important;
}
.earn-company-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--tx) !important;
  font-size: 13px;
}
.earn-time-bmo   { color: var(--gn) !important;  font-weight: 600; font-size: 11px; }
.earn-time-amc   { color: var(--wn) !important;  font-weight: 600; font-size: 11px; }
.earn-time-other { color: var(--tx3) !important; font-size: 11px; }

/* ── Detail view ── */
#earn-detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.earn-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.earn-back-btn {
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--tx2);
  font-size: 12px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s;
}
.earn-back-btn:hover { background: var(--s4); color: var(--ac); }

.earn-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.earn-detail-ticker {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ac);
}
.earn-detail-name {
  font-size: 15px;
  color: var(--tx);
  font-weight: 500;
}
.earn-detail-sector {
  font-size: 11px;
  color: var(--tx3);
  padding: 2px 9px;
  background: var(--s3);
  border-radius: 20px;
  border: 1px solid var(--b2);
}

/* ── Quarter cards ── */
.earn-detail-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.earn-quarters-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Guidance card */
.earn-guidance-card {
  background: var(--s2);
  border: 1px solid var(--ac-brd);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 6px;
}
.earn-guidance-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--ac);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.earn-guidance-cols {
  display: flex;
  gap: 32px;
}
.earn-guide-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.earn-guide-period {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 2px;
}
.earn-guide-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.earn-guide-lbl {
  font-size: 10px;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .3px;
  min-width: 52px;
}
.earn-guide-val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}

/* Beat / miss streak summary */
.earn-streak-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 6px;
}
.earn-streak-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.earn-streak-body {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.earn-streak-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.earn-streak-num {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  color: var(--tx);
  line-height: 1.1;
}
.earn-streak-num.gn { color: var(--gn); }
.earn-streak-num.ls { color: var(--ls); }
.earn-streak-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.earn-streak-divider {
  width: 1px;
  align-self: stretch;
  background: var(--b1);
}
.earn-streak-pills {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.earn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  cursor: default;
}
.earn-pill.beat { background: var(--gn-dim); color: var(--gn); }
.earn-pill.miss { background: var(--ls-dim); color: var(--ls); }
.earn-pill.meet { background: var(--s3);     color: var(--tx3); }

/* Quarter history cards */
.earn-quarter-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .1s;
}
.earn-quarter-card:hover  { background: var(--s3); }
.earn-quarter-card.latest { border-color: var(--ac-brd); background: var(--ac-dim); }

.earn-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.earn-card-metrics {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.earn-q-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tx3);
}

.earn-q-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.earn-q-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.earn-q-val {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--tx);
}
.earn-q-val.muted { font-size: 13px; color: var(--tx3); font-weight: 500; }

.earn-q-surprise {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--mono);
  padding: 3px 9px;
  border-radius: 6px;
}
.earn-q-surprise.beat    { background: var(--gn-dim); color: var(--gn); }
.earn-q-surprise.miss    { background: var(--ls-dim); color: var(--ls); }
.earn-q-surprise.neutral { background: var(--s3);     color: var(--tx3); }

/* ══════════════════════════════════════════════════════════════
   Peer Comparison Tab
══════════════════════════════════════════════════════════════ */
.peers-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 18px;
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 12px;
  margin-bottom: 10px;
}
.peers-banner-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.peers-source-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--tx3); background: var(--s3); padding: 2px 7px; border-radius: 10px;
}
.peers-type-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.peers-context-text {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.5;
}

.peers-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-radius: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.peers-summ-label { font-size: 11px; font-weight: 600; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px; }
.peers-summ-score { font-size: 13px; font-weight: 700; }
.peers-summ-score.bull    { color: var(--gn); }
.peers-summ-score.bear    { color: var(--ls); }
.peers-summ-score.neutral { color: var(--tx2); }
.peers-summ-hint  { font-size: 12px; color: var(--tx3); }

.peers-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--b1);
  border-radius: 12px;
  margin-bottom: 10px;
}

.peers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 520px;
}

/* Header */
.pt-th {
  padding: 10px 14px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  background: var(--s2);
  border-bottom: 2px solid var(--b2);
  white-space: nowrap;
}
.pt-metric-col { text-align: left; min-width: 110px; width: 110px; position: sticky; left: 0; background: var(--s2); z-index: 2; }
.pt-main-col   { color: var(--ac); background: var(--ac-dim); }
.pt-avg-col    { color: var(--tx3); font-style: italic; }
.pt-star       { color: var(--ac); }

/* Rows */
.pt-row { border-bottom: 1px solid var(--b1); transition: background .1s; }
.pt-row:last-child { border-bottom: none; }
.pt-row:nth-child(even) { background: var(--s1); }
.pt-row:hover { background: var(--s3); }

.pt-td {
  padding: 8px 14px;
  text-align: right;
  white-space: nowrap;
  vertical-align: middle;
}
.pt-label {
  text-align: left;
  font-size: 12px;
  color: var(--tx2);
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
  border-right: 1px solid var(--b1);
}
.pt-hint { font-size: 9px; color: var(--tx3); margin-left: 4px; font-weight: 400; }

.pt-val { font-family: var(--mono); font-size: 12px; color: var(--tx); }

/* Main stock cell states */
.pt-main              { background: rgba(0,206,255,.04); }
.pt-main.pt-good      { background: rgba(33,209,106,.10); }
.pt-main.pt-bad       { background: rgba(240, 68, 68,.10); }
.pt-main.pt-good .pt-val { color: var(--gn); font-weight: 700; }
.pt-main.pt-bad  .pt-val { color: var(--ls); font-weight: 700; }
.pt-main.pt-neutral .pt-val { color: var(--tx); font-weight: 600; }

.pt-avg  { background: var(--s2); }
.pt-avg .pt-val { color: var(--tx2); font-style: italic; }

.pt-caution-val { opacity: .45; }

/* Name legend below table */
.peers-namelist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 8px 4px 0;
}
.peers-name-item {
  font-size: 11px;
  color: var(--tx3);
}
.peers-name-item strong { color: var(--tx2); }

/* ══════════════════════════════════════════════════════════════
   Playbook tab
══════════════════════════════════════════════════════════════ */
#playbook-view:not(.hidden) { display: flex; flex-direction: column; overflow-y: auto; padding: 0; }

/* ── Stage selector bar ──────────────────────────────────── */
.pb-stage-bar {
  display: flex;
  gap: 8px;
  padding: 18px 24px 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--b2);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
.pb-stage-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--b2);
  background: var(--s1);
  color: var(--tx2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.pb-stage-btn:hover { background: var(--s2); color: var(--tx); }
.pb-stage-btn.pb-active {
  background: var(--ac-dim);
  border-color: var(--ac-brd);
  color: var(--ac);
}

/* ── Stage panel ─────────────────────────────────────────── */
.pb-stage-panel { padding: 22px 24px 4px; }

.pb-stage-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}
.pb-stage-emoji { font-size: 34px; line-height: 1; flex-shrink: 0; margin-top: 2px; }
.pb-stage-name  { font-size: 21px; font-weight: 700; color: var(--tx); margin-bottom: 5px; }
.pb-stage-desc  { font-size: 13px; color: var(--tx2); line-height: 1.65; max-width: 680px; }

/* ── Metrics grid (2 × 2) ────────────────────────────────── */
.pb-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.pb-cat {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 10px;
  padding: 14px 16px;
}
.pb-cat-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 12px;
}
.pb-metric { margin-bottom: 11px; }
.pb-metric:last-child { margin-bottom: 0; }
.pb-metric-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 2px;
}
.pb-metric-desc { font-size: 11.5px; color: var(--tx3); line-height: 1.55; }

/* ── Flags row ───────────────────────────────────────────── */
.pb-flags-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}
.pb-flags {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 10px;
  padding: 14px 16px;
}
.pb-flags-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.pb-flags.green .pb-flags-title { color: var(--gn); }
.pb-flags.red   .pb-flags-title { color: var(--ls); }
.pb-flag-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: var(--tx2);
  margin-bottom: 7px;
  line-height: 1.45;
}
.pb-flag-item:last-child { margin-bottom: 0; }
.pb-flags.green .pb-flag-item::before { content: "✓"; color: var(--gn); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.pb-flags.red   .pb-flag-item::before { content: "✗"; color: var(--ls); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* ── Masters section ─────────────────────────────────────── */
.pb-masters-section {
  border-top: 1px solid var(--b2);
  padding: 24px 24px 32px;
}
.pb-masters-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--tx);
  margin-bottom: 4px;
}
.pb-masters-sub {
  font-size: 12px;
  color: var(--tx3);
  margin-bottom: 18px;
}

/* ── Guru cards grid ─────────────────────────────────────── */
.pb-guru-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}
.pb-guru-card {
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .2s, box-shadow .2s;
}
.pb-guru-card:hover {
  border-color: var(--b3);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.pb-guru-card-top { display: flex; align-items: flex-start; gap: 11px; }
.pb-guru-emoji    { font-size: 26px; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.pb-guru-info     { flex: 1; min-width: 0; }
.pb-guru-name     { font-size: 14px; font-weight: 700; color: var(--tx); }
.pb-guru-tagline  { font-size: 10.5px; color: var(--tx3); margin-top: 2px; line-height: 1.4; }

.pb-guru-era {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-top: 5px;
}
.pb-guru-era.classic    { background: rgba(245,166,35,.12); color: var(--wn); }
.pb-guru-era.new-school { background: rgba(0,206,255,.09);  color: var(--ac); }

/* Stage tags on guru card */
.pb-guru-stages { display: flex; gap: 5px; flex-wrap: wrap; }
.pb-stage-tag {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--b3);
  color: var(--tx3);
}
.pb-tag-pre-revenue { border-color: rgba(245,166,35,.3); color: var(--wn); }
.pb-tag-pre-profit  { border-color: rgba(0,206,255,.25); color: var(--ac); }
.pb-tag-profitable  { border-color: rgba(33,209,106,.25); color: var(--gn); }
.pb-tag-bluechip    { border-color: rgba(160,120,240,.25); color: #a078f0; }

/* Philosophy, metrics, approach, quote */
.pb-guru-philosophy {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.65;
  border-left: 2px solid var(--b3);
  padding-left: 10px;
}
.pb-guru-metrics-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tx3);
  margin-bottom: 6px;
}
.pb-guru-metrics { display: flex; flex-direction: column; gap: 0; }
.pb-guru-metric {
  font-size: 11.5px;
  color: var(--tx2);
  padding: 4px 0;
  border-bottom: 1px solid var(--b1);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}
.pb-guru-metric:last-child { border-bottom: none; }
.pb-guru-metric::before { content: "·"; color: var(--ac); font-weight: 700; flex-shrink: 0; }
.pb-guru-approach {
  font-size: 11.5px;
  color: var(--tx3);
  line-height: 1.6;
  background: var(--s2);
  border-radius: 6px;
  padding: 9px 11px;
}
.pb-guru-quote {
  font-size: 11.5px;
  font-style: italic;
  color: var(--tx3);
  padding-top: 4px;
  border-top: 1px solid var(--b1);
}
.pb-guru-quote::before { content: "\201C"; color: var(--ac); font-style: normal; font-weight: 700; margin-right: 2px; }
.pb-guru-quote::after  { content: "\201D"; color: var(--ac); font-style: normal; font-weight: 700; margin-left: 2px; }

/* ── Playbook: Metrics Explained (Learn) ─────────────────────── */
.pb-stage-sep {
  display: inline-block;
  width: 1px;
  height: 20px;
  background: var(--b2);
  margin: 0 4px;
  align-self: center;
  flex-shrink: 0;
}

.pb-learn-tab-btn {
  color: var(--ac) !important;
  border-color: var(--ac-brd) !important;
}
.pb-learn-tab-btn.pb-active {
  background: var(--ac-dim) !important;
  border-color: var(--ac) !important;
}

.pb-learn-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0 32px;
}

.pb-learn-search-row {
  display: flex;
  align-items: center;
}

.pb-learn-input {
  width: 100%;
  max-width: 560px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--tx);
  font-family: var(--font);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.pb-learn-input::placeholder { color: var(--tx3); }
.pb-learn-input:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 2px var(--ac-dim);
}

.pb-learn-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pb-learn-section { display: flex; flex-direction: column; gap: 4px; }

.pb-learn-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tx3);
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--b1);
  margin-bottom: 2px;
}

.pb-learn-item {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s;
}
.pb-learn-item:hover { border-color: var(--b2); }
.pb-learn-item.expanded { border-color: var(--b3); }

.pb-learn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
}
.pb-learn-head:hover { background: var(--s3); }

.pb-learn-term-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.pb-learn-term {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
  white-space: nowrap;
  flex-shrink: 0;
}

.pb-learn-teaser {
  font-size: 12px;
  color: var(--tx3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-learn-chevron {
  font-size: 18px;
  color: var(--tx3);
  transition: transform .2s ease;
  line-height: 1;
  flex-shrink: 0;
}

.pb-learn-body {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 4px 14px 14px;
  border-top: 1px solid var(--b1);
}
.pb-learn-item.expanded .pb-learn-body { display: flex; }

.pb-learn-section-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pb-learn-section-text p {
  font-size: 12.5px;
  color: var(--tx2);
  line-height: 1.65;
  margin: 0;
}

.pb-learn-formula {
  font-family: var(--mono) !important;
  font-size: 12px !important;
  background: var(--s3);
  border-radius: 5px;
  padding: 6px 10px !important;
  color: var(--ac) !important;
  border: 1px solid var(--b2);
}

.pb-learn-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ac);
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  border-radius: 4px;
  padding: 2px 6px;
  width: fit-content;
}
.pb-learn-tag-rule {
  color: var(--gn);
  background: var(--gn-dim);
  border-color: var(--gn-brd);
}

.pb-learn-empty {
  font-size: 13px;
  color: var(--tx3);
  text-align: center;
  padding: 32px 0;
}
.pb-learn-empty em { color: var(--tx2); font-style: normal; }

/* Responsive */
@media (max-width: 900px) {
  .pb-metrics-grid,
  .pb-flags-row { grid-template-columns: 1fr; }
  .pb-guru-grid { grid-template-columns: 1fr; }
}

/* ── Fed Macro Tab ────────────────────────────────────────────── */
#macro-view:not(.hidden) {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0;
}

.macro-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 48px 32px;
  font-size: 13px;
  color: var(--tx3);
}

.macro-err {
  padding: 32px;
  font-size: 13px;
  color: var(--ls);
}

/* ── Economic Calendar (ForexFactory) ── */
.macro-cal-wrap {
  background: var(--s2); border: 1px solid var(--b1);
  border-radius: 10px; overflow: hidden;
}
.macro-cal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--b1);
}
.macro-cal-heading {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--tx);
}
.macro-cal-date {
  font-size: 11px; color: var(--tx3); margin-right: auto;
}
.macro-cal-src {
  font-size: 10px; color: var(--ac); text-decoration: none;
}
.macro-cal-src:hover { text-decoration: underline; }
.macro-cal-legend {
  display: flex; gap: 14px; padding: 6px 16px;
  border-bottom: 1px solid var(--b1); font-size: 10px;
}
.cal-imp-high { color: #f04444; font-weight: 700; }
.cal-imp-med  { color: #f5a623; font-weight: 700; }
.cal-imp-low  { color: #94a3b8; }
.macro-cal-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; border-bottom: 1px solid var(--b1);
  transition: background .12s;
}
.macro-cal-row:last-child { border-bottom: none; }
.macro-cal-row:hover { background: var(--s3); }
.macro-cal-time  { font-size: 11px; color: var(--tx3); font-family: var(--mono); width: 56px; flex-shrink: 0; }
.macro-cal-flag  { font-size: 16px; flex-shrink: 0; }
.macro-cal-imp   { font-size: 10px; flex-shrink: 0; }
.macro-cal-title { font-size: 13px; font-weight: 600; color: var(--tx); flex: 1; min-width: 0; }
.macro-cal-trio  { display: flex; gap: 16px; flex-shrink: 0; }
.macro-cal-cell  { text-align: right; min-width: 52px; }
.macro-cal-val   { font-size: 12px; font-weight: 600; font-family: var(--mono); color: var(--tx); }
.macro-cal-lbl   { font-size: 9px; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; }

@media (max-width: 600px) {
  .macro-cal-trio { display: none; }
  .macro-cal-time { display: none; }
}

.macro-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 20px 40px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

/* Regime banner */
.macro-regime {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 10px;
  padding: 16px 20px;
  border: 1px solid;
  flex-wrap: wrap;
}
.macro-regime-easing     { background: var(--gn-dim); border-color: var(--gn-brd); }
.macro-regime-neutral    { background: var(--wn-dim, rgba(245,166,35,.08)); border-color: var(--wn, #f5a623); }
.macro-regime-tightening { background: var(--ls-dim); border-color: var(--ls-brd); }

.macro-regime-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.macro-regime-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.macro-regime-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 3px;
}
.macro-regime-desc {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.5;
}

.macro-score-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}
.macro-score-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tx3);
}
.macro-score-track {
  width: 120px;
  height: 6px;
  background: var(--s3);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--b1);
}
.macro-score-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.macro-score-fill-gn { background: var(--gn); }
.macro-score-fill-ls { background: var(--ls); }
.macro-score-fill-wn { background: var(--wn); }
.macro-score-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx2);
  font-family: var(--mono);
}

/* Four metric cards */
.macro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.macro-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color .15s;
}
.macro-card:hover { border-color: var(--b2); }

.macro-card-hd {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.macro-card-icon { font-size: 15px; flex-shrink: 0; }
.macro-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tx2);
  flex: 1;
  min-width: 0;
}

.macro-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid;
  white-space: nowrap;
}
.macro-badge-gn { color: var(--gn); background: var(--gn-dim); border-color: var(--gn-brd); }
.macro-badge-ls { color: var(--ls); background: var(--ls-dim); border-color: var(--ls-brd); }
.macro-badge-wn { color: var(--wn); background: var(--wn-dim, rgba(245,166,35,.1)); border-color: var(--wn); }

.macro-card-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.macro-val {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--tx);
  line-height: 1;
}
.macro-val-sub {
  font-size: 11px;
  color: var(--tx3);
}

.macro-spark {
  line-height: 0;
  overflow: hidden;
}
.macro-spark-svg {
  width: 100%;
  height: 38px;
  display: block;
}

.macro-stats {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.macro-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  padding: 3px 0;
  border-bottom: 1px solid var(--b1);
}
.macro-stat:last-child { border-bottom: none; }
.macro-stat-l { color: var(--tx3); }
.macro-stat-v { font-family: var(--mono); font-size: 11px; color: var(--tx); font-weight: 600; }

.macro-note {
  font-size: 11px;
  color: var(--tx3);
  line-height: 1.5;
  background: var(--s3);
  border-radius: 5px;
  padding: 6px 9px;
}

/* Color helpers */
.macro-col-gn { color: var(--gn) !important; }
.macro-col-ls { color: var(--ls) !important; }
.macro-col-wn { color: var(--wn) !important; }

/* Signal board */
.macro-signals {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 16px 20px;
}
.macro-signals-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tx2);
  margin-bottom: 14px;
}
.macro-signals-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.macro-signal-row {
  display: grid;
  grid-template-columns: 200px 150px 1fr;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--b1);
  font-size: 12px;
}
.macro-signal-row:last-child { border-bottom: none; }
.macro-signal-label { color: var(--tx2); font-weight: 600; }
.macro-signal-val   { font-family: var(--mono); font-size: 11.5px; font-weight: 700; }
.macro-signal-desc  { color: var(--tx3); line-height: 1.4; }

/* Explainer */
.macro-explainer {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 16px 20px;
}
.macro-explainer-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--tx2);
  margin-bottom: 14px;
}
.macro-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.macro-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 12.5px;
  color: var(--tx2);
  line-height: 1.6;
}
.macro-step-n {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ac-dim);
  border: 1px solid var(--ac-brd);
  color: var(--ac);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.macro-step strong { color: var(--tx); }
.macro-source {
  font-size: 10px;
  color: var(--tx3);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--b1);
}

@media (max-width: 900px) {
  .macro-signal-row { grid-template-columns: 1fr 1fr; }
  .macro-signal-desc { display: none; }
  .macro-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .macro-cards { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   Chart Pattern Detection
══════════════════════════════════════════════════════════════ */
.pattern-section {
  margin: 0 16px 16px;
  border: 1px solid var(--b2);
  border-radius: 14px;
  overflow: hidden;
  background: var(--s1);
}
.pattern-section-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--s2);
  border-bottom: 1px solid var(--b1);
}
.pattern-section-title {
  font-size: 13px; font-weight: 700; color: var(--tx);
}
.pattern-loading-badge {
  font-size: 10px; color: var(--ac); animation: pulse 1.2s infinite;
}
.pattern-chart-wrap {
  padding: 10px 12px 0;
  background: var(--s2);
}
.pat-svg { width: 100%; height: auto; display: block; border-radius: 8px; }

/* ── Finviz proxied chart ────────────────────────────────── */
.finviz-chart-wrap {
  margin-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--s1);
  border: 1px solid var(--b1);
  border-bottom: none;
  width: 100%;
  /* NO overflow:hidden — it collapses the div in flex column context.
     Instead we clip the image corners directly on the img element.   */
}
.finviz-chart-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 9px 9px 0 0;
}
.finviz-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  color: var(--tx3);
  font-size: 13px;
}
.finviz-error {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: 20px;
  color: var(--tx3);
  font-size: 12px;
}

/* ── Finviz snapshot metrics strip ─────────────────────── */
.finviz-snapshot {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-top: 1px solid var(--b2);
  border-radius: 0 0 10px 10px;
  padding: 10px 14px 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.fv-snap-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.fv-snap-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--tx3);
  margin-bottom: 2px;
}
.fv-snap-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.fv-snap-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 50px;
}
.fv-snap-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx3);
}
.fv-snap-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--tx);
}
.fv-snap-val.snap-pos  { color: var(--gn); }
.fv-snap-val.snap-neg  { color: var(--ls); }
.fv-snap-val.snap-warn { color: var(--wn); }
.fv-snap-divider {
  width: 1px;
  background: var(--b2);
  align-self: stretch;
  margin: 0 6px;
}
body.light .finviz-snapshot { background: var(--s1); }

/* ══════════════════════════════════════════════════════════
   Chart AI tab
══════════════════════════════════════════════════════════ */
.chai-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
@media (max-width: 860px) { .chai-layout { grid-template-columns: 1fr; } }

.chai-upload-col, .chai-analysis-col { display: flex; flex-direction: column; gap: 12px; }

.chai-dropzone {
  border: 2px dashed var(--b2);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  background: var(--s1);
  transition: border-color .2s, background .2s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.chai-dropzone:hover, .chai-drag-over {
  border-color: var(--ac);
  background: var(--ac-dim);
}
.chai-drop-icon { font-size: 40px; }
.chai-drop-title { font-size: 15px; font-weight: 700; color: var(--tx); }
.chai-drop-sub   { font-size: 12px; color: var(--tx3); }
.chai-browse-btn {
  margin-top: 6px;
  background: var(--ac-dim); border: 1px solid var(--ac-brd); color: var(--ac);
  border-radius: 8px; padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer;
}

.chai-preview-wrap { display: flex; flex-direction: column; gap: 10px; }
.chai-preview-img  { width: 100%; border-radius: 10px; border: 1px solid var(--b1); }
.chai-rebrowse-btn {
  background: transparent; border: 1px solid var(--b2); color: var(--tx3);
  border-radius: 6px; padding: 6px 14px; font-size: 12px; cursor: pointer;
}
.chai-rebrowse-btn:hover { color: var(--tx2); border-color: var(--b3); }

.chai-empty {
  padding: 60px 20px; text-align: center; color: var(--tx3); font-size: 14px;
  border: 1px dashed var(--b1); border-radius: 10px; background: var(--s1);
}
.chai-loading {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px; color: var(--tx3); font-size: 13px;
}

.chai-result-inner {
  background: var(--s1); border: 1px solid var(--b1); border-radius: 12px;
  overflow: hidden;
}
.chai-result-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 16px; background: var(--s2); border-bottom: 1px solid var(--b1);
}
.chai-ticker  { font-size: 16px; font-weight: 800; color: var(--ac); }
.chai-pattern { font-size: 13px; font-weight: 700; color: var(--tx); }
.chai-conf    { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
                text-transform: uppercase; letter-spacing: .4px; }
.chai-conf-high { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.chai-conf-mid  { background: var(--wn-dim); color: var(--wn); border: 1px solid rgba(245,166,35,.3); }
.chai-conf-low  { background: var(--s3);     color: var(--tx3); border: 1px solid var(--b2); }

.chai-signal-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-bottom: 1px solid var(--b1);
}
.chai-signal  { font-size: 20px; font-weight: 900; }
.chai-trend   { font-size: 14px; font-weight: 700; }
.chai-timeframe { font-size: 11px; color: var(--tx3); margin-left: auto; }

.chai-metrics-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--b1); border-bottom: 1px solid var(--b1);
}
.chai-metric {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 14px; background: var(--s1);
}
.chai-metric-label { font-size: 10px; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px; }
.chai-metric-val   { font-size: 15px; font-weight: 700; font-family: var(--mono); }

.chai-section { padding: 12px 16px; border-bottom: 1px solid var(--b1); }
.chai-section:last-child { border-bottom: none; }
.chai-section-label { font-size: 10px; color: var(--tx3); text-transform: uppercase;
                      letter-spacing: .5px; margin-bottom: 5px; }
.chai-section-body  { font-size: 13px; color: var(--tx2); line-height: 1.55; }
.chai-summary .chai-section-body { color: var(--tx); }

.chai-error { padding: 20px; color: var(--ls); font-size: 13px; text-align: center; }

.chai-chat-wrap {
  border: 1px solid var(--b1); border-radius: 12px;
  background: var(--s1); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.chai-chat-label { font-size: 10px; color: var(--tx3); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }
.chai-chat-row { display: flex; gap: 8px; }
.chai-chat-input {
  flex: 1; padding: 9px 14px; background: var(--s2); border: 1px solid var(--b2);
  border-radius: 8px; color: var(--tx); font-size: 13px; font-family: var(--font);
  transition: border-color .15s;
}
.chai-chat-input:focus { outline: none; border-color: var(--ac); }
.chai-chat-input::placeholder { color: var(--tx3); }
.chai-chat-send-btn {
  padding: 9px 18px; background: var(--ac-dim); border: 1px solid var(--ac-brd);
  border-radius: 8px; color: var(--ac); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s;
}
.chai-chat-send-btn:hover { background: rgba(0,206,255,.15); }
.chai-chat-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.chai-chat-answer {
  padding: 14px 16px; background: var(--s2); border: 1px solid var(--b1);
  border-radius: 10px; font-size: 13px; color: var(--tx2); line-height: 1.7;
}
.chai-chat-answer p { margin: 0 0 8px; }
.chai-chat-answer p:last-child { margin: 0; }
.chai-chat-answer strong { color: var(--tx); }
.chai-chat-answer ul { margin: 4px 0 8px 18px; }
.chai-chat-answer h2, .chai-chat-answer h3 { color: var(--tx); margin: 12px 0 4px; font-size: 13px; }
.chai-chat-thinking { color: var(--tx3); font-style: italic; }
.pattern-cards {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px 14px;
}
.pattern-none {
  font-size: 12px; color: var(--tx3); padding: 8px 4px; margin: 0;
}
.pat-card {
  border-radius: 10px;
  border: 1px solid var(--b2);
  padding: 12px 14px;
  background: var(--s2);
}
.pat-card-bullish { border-left: 3px solid var(--gn); }
.pat-card-bearish { border-left: 3px solid var(--ls); }
.pat-card-neutral { border-left: 3px solid var(--tx3); }
.pat-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.pat-name-row { display: flex; align-items: center; gap: 8px; flex: 1; }
.pat-name { font-size: 13px; font-weight: 700; color: var(--tx); }
.pat-type-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--tx3); background: var(--s3);
  border: 1px solid var(--b1); border-radius: 4px; padding: 1px 6px;
}
.pat-badges { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pat-dir {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 20px; letter-spacing: .04em;
}
.pat-key-levels {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 0 0 8px; padding: 6px 10px;
  background: var(--s1); border-radius: 6px; border: 1px solid var(--b1);
}
.pat-kl-item { display: flex; flex-direction: column; gap: 1px; }
.pat-kl-key  { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--tx3); }
.pat-kl-val  { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--tx); }
.pat-bull { background: var(--gn-dim); color: var(--gn); border: 1px solid var(--gn-brd); }
.pat-bear { background: var(--ls-dim); color: var(--ls); border: 1px solid var(--ls-brd); }
.pat-neutral { background: var(--s3); color: var(--tx3); border: 1px solid var(--b2); }
.pat-conf {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; padding: 1px 6px; border-radius: 4px;
}
.pat-conf-high { background: rgba(33,209,106,.15); color: var(--gn); }
.pat-conf-mid  { background: rgba(245,166,35,.15);  color: var(--wn); }
.pat-conf-low  { background: var(--s3); color: var(--tx3); }
.pat-desc {
  font-size: 12px; color: var(--tx2); margin: 0 0 8px; line-height: 1.55;
}
.pat-impl {
  display: flex; gap: 6px; align-items: flex-start;
  background: rgba(0,206,255,.06); border-radius: 6px; padding: 8px 10px;
}
.pat-impl-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--ac); flex-shrink: 0; padding-top: 1px;
}
.pat-impl-text { font-size: 11px; color: var(--tx2); line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════
   Historical Financials Bar Charts
══════════════════════════════════════════════════════════════ */
.fin-history-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}
.fin-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--b1);
  background: var(--s1);
}
.fin-history-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx);
  letter-spacing: .02em;
}
.fin-mode-toggle {
  display: flex;
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: 6px;
  overflow: hidden;
}
.fin-mode-btn {
  background: none;
  border: none;
  color: var(--tx2);
  font-size: 11.5px;
  font-weight: 500;
  padding: 5px 14px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.fin-mode-btn.active {
  background: var(--ac);
  color: #000;
  font-weight: 700;
}
.fin-charts-area {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.fin-chart-wrap {
  padding: 14px 10px 8px;
  border-right: 1px solid var(--b1);
  border-bottom: 1px solid var(--b1);
}
.fin-chart-wrap:nth-child(3n)   { border-right: none; }
.fin-chart-wrap:nth-last-child(-n+3) { border-bottom: none; }
/* Tidy up when total is not a multiple of 3 */
.fin-chart-wrap:last-child      { border-right: none; border-bottom: none; }
.fin-chart-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx2);
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.fin-chart-canvas {
  width: 100%;
  height: 160px;
  display: block;
}
@media (max-width: 800px) {
  .fin-charts-area { grid-template-columns: 1fr 1fr; }
  .fin-chart-wrap  { border-right: 1px solid var(--b1); border-bottom: 1px solid var(--b1); }
  .fin-chart-wrap:nth-child(2n)  { border-right: none; }
  .fin-chart-wrap:nth-last-child(-n+2) { border-bottom: none; }
  .fin-chart-wrap:last-child { border-right: none; border-bottom: none; }
}
@media (max-width: 480px) {
  .fin-charts-area { grid-template-columns: 1fr; }
  .fin-chart-wrap  { border-right: none; border-bottom: 1px solid var(--b1); }
  .fin-chart-wrap:last-child { border-bottom: none; }
}

/* ══════════════════════════════════════════════════════════════
   TradingView-style Fundamentals Panel  (v43)
══════════════════════════════════════════════════════════════ */
.tv-fund-card {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 4px;
}
.tv-error {
  padding: 20px;
  color: var(--ls);
  font-size: 13px;
}

/* Header */
.tv-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 18px 12px;
  background: var(--s1);
  border-bottom: 1px solid var(--b1);
  gap: 16px;
}
.tv-identity { display: flex; flex-direction: column; gap: 5px; }
.tv-ticker-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.tv-ticker {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--ac);
  letter-spacing: .04em;
}
.tv-company-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx);
}
.tv-emp {
  font-size: 11px;
  color: var(--tx3);
}
.tv-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.tv-tag {
  font-size: 11px;
  color: var(--tx2);
  background: var(--s3);
  border: 1px solid var(--b1);
  border-radius: 4px;
  padding: 2px 7px;
}
.tv-price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.tv-price {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--tx);
}
.tv-chg {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}

/* Two-column grid */
.tv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.tv-col {
  border-right: 1px solid var(--b1);
  padding-bottom: 10px;
}
.tv-col:last-child { border-right: none; }

/* Sections inside columns */
.tv-section { padding: 0 14px; border-left: 3px solid transparent; }
.tv-sec-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--tx3);
  padding: 11px 0 6px;
  border-bottom: 1px solid var(--b2);
  margin-bottom: 0;
}
.tv-sec-icon { font-size: 13px; line-height: 1; flex-shrink: 0; }

/* Metric rows */
.tv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  gap: 6px;
  min-height: 26px;
}
.tv-row:last-child { border-bottom: none; }
.tv-lbl {
  font-size: 12px;
  color: var(--tx2);
  flex: 1;
  white-space: nowrap;
}
.tv-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--tx);
  white-space: nowrap;
}
.tv-pos { color: var(--gn) !important; }
.tv-neg { color: var(--ls) !important; }
.tv-na  { color: var(--tx3) !important; }
.tv-caution {
  font-size: 10px;
  color: var(--wn);
  cursor: help;
  flex-shrink: 0;
}

/* Description */
.tv-desc {
  padding: 12px 18px;
  border-top: 1px solid var(--b1);
  background: var(--s1);
}
.tv-desc p {
  font-size: 12px;
  color: var(--tx2);
  line-height: 1.65;
  margin: 0 0 6px;
}
.tv-website {
  font-size: 11px;
  color: var(--ac);
  text-decoration: none;
}
.tv-website:hover { text-decoration: underline; }

/* Responsive — stack columns on narrow screens */
@media (max-width: 640px) {
  .tv-grid { grid-template-columns: 1fr; }
  .tv-col  { border-right: none; border-bottom: 1px solid var(--b1); }
  .tv-col:last-child { border-bottom: none; }
}

/* ══════════════════════════════════════════════════════════════
   Mobile — Sidebar overlay backdrop
══════════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 299;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}

/* Hamburger toggle — hidden on desktop */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 100%;
  flex-shrink: 0;
  background: none;
  border: none;
  border-right: 1px solid var(--b1);
  color: var(--tx2);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.sidebar-toggle:hover { color: var(--tx); background: var(--s3); }

/* ══════════════════════════════════════════════════════════════
   Mobile breakpoint (≤ 768px)
══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Show hamburger */
  .sidebar-toggle { display: flex; }

  /* Single-column layout; sidebar becomes off-canvas */
  .layout { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100dvh;
    width: 280px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: 6px 0 32px rgba(0,0,0,.55);
  }

  .layout.sidebar-open .sidebar        { transform: translateX(0); }
  .layout.sidebar-open .sidebar-overlay{ display: block; }

  /* Main takes full width */
  .main { height: 100dvh; }

  /* Tab bar: single scrollable row, no wrap */
  .main-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 3px 6px;
    gap: 2px;
  }
  .main-tabs::-webkit-scrollbar { display: none; }
  .main-tab { flex-shrink: 0; height: 32px; padding: 0 10px; font-size: 12px; }
  .tab-icon  { font-size: 11px; }

  /* Landing */
  .landing-content  { padding: 32px 20px 20px; }
  .landing-headline { font-size: clamp(24px, 7vw, 42px); }
  .landing-sub      { font-size: 13px; }
  .landing-stats    { flex-direction: column; align-items: center; gap: 20px; padding: 24px 16px; }
  .ls-div           { display: none; }
  .landing-features { flex-direction: column; align-items: center; gap: 8px; }

  /* View headers: stack title + refresh button */
  .view-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 14px 8px;
  }
  .view-header .btn-ghost { align-self: flex-end; }

  /* Source notes: tighter */
  .src-note { padding: 8px 12px; font-size: 11px; }

  /* Home split: stack ideas + market-news vertically */
  .home-split       { flex-direction: column; }
  .ideas-col        { flex: 0 0 auto; border-right: none; border-bottom: 1px solid var(--b1); min-height: 40vh; max-height: 50vh; }
  .market-news-col  { flex: 0 0 auto; min-height: 40vh; max-height: 50vh; }

  /* Fundamentals */
  .fund-card        { margin: 8px 10px; }
  .fund-card-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .fund-price-box   { align-items: flex-start; }
  .fund-metrics     { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

  /* Holdings */
  .holding-card           { margin: 8px 10px; }
  .holding-card-header    { flex-direction: column; align-items: flex-start; gap: 6px; }
  .holding-links          { margin-left: 0; }

  /* Holdings table: horizontal scroll */
  .holdings-grid  { overflow-x: auto; }
  .holding-table-wrap { overflow-x: auto; }

  /* Tech chart */
  .tech-chart-wrap { height: 260px; }

  /* Algo header */
  .algo-header {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
  }
  .algo-header-right { align-items: center; margin-left: 0; }

  /* Gurus layout: stack list + detail */
  .gurus-layout   { flex-direction: column; }
  .gurus-sidebar  { max-height: 200px; border-right: none; border-bottom: 1px solid var(--b1); overflow-y: auto; }

  /* Holders split: stack */
  .holders-split  { flex-direction: column; overflow-y: auto; }
  .holders-col    { flex: 0 0 auto; }
  .holders-col-inst { border-right: none; border-bottom: 1px solid var(--b1); }

  /* Earnings: stack calendar + content */
  .earn-layout    { flex-direction: column; overflow-y: auto; }
  .earn-cal-side  { border-right: none; border-bottom: 1px solid var(--b1); flex-shrink: 0; }

  /* Crypto table: allow horizontal scroll */
  .crypto-table-section { overflow-x: auto; }

  /* Opp header */
  .opp-header-row { flex-direction: column; align-items: center; gap: 12px; }

  /* AI input bar */
  .ai-input-bar { padding: 8px 10px; }

  /* Panel header */
  .panel-header { padding: 8px 14px; }

  /* Sectors table: horizontal scroll */
  .sectors-table-wrap { overflow-x: auto; }

  /* Peers content */
  .peers-table-wrap { overflow-x: auto; }
}

/* Very small phones (≤ 480px) */
@media (max-width: 480px) {
  .landing-headline { font-size: 22px; }
  .landing-badge    { font-size: 11px; padding: 5px 12px; }
  .fund-metrics     { grid-template-columns: 1fr 1fr; }
  .main-tab         { padding: 0 8px; font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════════
   Data Quality & Verification (v1.3.0)
══════════════════════════════════════════════════════════════ */

/* Freshness timestamps */
.data-freshness-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 8px;
}

.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  cursor: default;
}

.freshness-fresh {
  color: var(--gn);
  background: var(--gn-dim);
  border: 1px solid var(--gn-brd);
}

.freshness-aging {
  color: var(--wn);
  background: color-mix(in srgb, var(--wn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--wn) 30%, transparent);
}

.freshness-stale {
  color: var(--ls);
  background: var(--ls-dim);
  border: 1px solid var(--ls-brd);
}

/* Stale data banners */
.stale-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--wn) 10%, var(--s1));
  border: 1px solid color-mix(in srgb, var(--wn) 35%, transparent);
  border-radius: 8px;
  color: var(--wn);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 14px;
  margin-bottom: 10px;
}

/* Price validation badge (Finnhub cross-check) */
.validation-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: default;
  white-space: nowrap;
}

.validation-ok {
  color: var(--gn);
  background: var(--gn-dim);
  border: 1px solid var(--gn-brd);
}

.validation-warn {
  color: var(--wn);
  background: color-mix(in srgb, var(--wn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--wn) 30%, transparent);
}

/* Multi-source consensus badges on fundamentals rows */
.consensus-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  cursor: default;
}

.consensus-ok {
  color: var(--gn);
  background: var(--gn-dim);
}

.consensus-warn {
  color: var(--wn);
  background: color-mix(in srgb, var(--wn) 15%, transparent);
}

/* TA indicator verification badges */
.verify-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: default;
}

.verify-ok {
  color: var(--gn);
  background: var(--gn-dim);
  border: 1px solid var(--gn-brd);
}

.verify-warn {
  color: var(--wn);
  background: color-mix(in srgb, var(--wn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--wn) 30%, transparent);
}

/* Analyst low-sample size warning */
.sample-warn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: color-mix(in srgb, var(--wn) 10%, var(--s1));
  border: 1px solid color-mix(in srgb, var(--wn) 35%, transparent);
  border-radius: 6px;
  color: var(--wn);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  margin: 6px 0;
}

/* Light theme overrides */
body.light .freshness-aging {
  background: #fff7e6;
  border-color: #f0a500;
  color: #b37800;
}

body.light .stale-banner,
body.light .sample-warn {
  background: #fff9e6;
  border-color: #f0c040;
  color: #956d00;
}

body.light .validation-warn,
body.light .consensus-warn,
body.light .verify-warn {
  background: #fff9e6;
  border-color: #f0c040;
  color: #956d00;
}

/* ══════════════════════════════════════════════════════════════
   Drag-to-Reorder Sidebar
══════════════════════════════════════════════════════════════ */
.ticker-drag-handle {
  flex-shrink: 0;
  color: var(--tx3);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  padding: 0 4px 0 0;
  opacity: 0;
  transition: opacity .15s;
  user-select: none;
}
.ticker-item:hover .ticker-drag-handle { opacity: 1; }
.ticker-item.dragging { opacity: .4; }
.ticker-item.drag-over { box-shadow: inset 0 2px 0 var(--ac); }

/* ══════════════════════════════════════════════════════════════
   Cmd+K Search Overlay
══════════════════════════════════════════════════════════════ */
.cmdk-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.cmdk-overlay.hidden { display: none; }
.cmdk-modal {
  width: min(640px, 94vw);
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
}
.cmdk-input-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--b1);
}
.cmdk-icon { font-size: 17px; flex-shrink: 0; }
.cmdk-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--tx); font-size: 15px; font-family: var(--font);
}
.cmdk-input::placeholder { color: var(--tx3); }
.cmdk-esc-hint {
  font-size: 11px; background: var(--s3); color: var(--tx3);
  border: 1px solid var(--b2); border-radius: 4px; padding: 2px 6px;
  font-family: var(--mono); flex-shrink: 0;
}
.cmdk-input-label { flex: 1; color: var(--tx); font-size: 15px; font-weight: 600; }
.cmdk-close-btn {
  background: none; border: none; color: var(--tx3); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px;
}
.cmdk-close-btn:hover { color: var(--tx); background: var(--s3); }
.cmdk-results { max-height: 340px; overflow-y: auto; }
.cmdk-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; cursor: pointer;
  transition: background .1s;
}
.cmdk-result-item:hover, .cmdk-result-item.selected { background: var(--s3); }
.cmdk-res-ticker { font-weight: 700; color: var(--ac); font-size: 13px; min-width: 64px; font-family: var(--mono); }
.cmdk-res-name   { flex: 1; color: var(--tx); font-size: 13px; }
.cmdk-res-exch   { font-size: 11px; color: var(--tx3); }
.cmdk-loading, .cmdk-no-results {
  padding: 20px 18px; color: var(--tx3); font-size: 13px; text-align: center;
}
.cmdk-footer {
  display: flex; gap: 20px; padding: 10px 18px;
  border-top: 1px solid var(--b1);
  background: var(--s1);
}
.cmdk-hint { font-size: 11px; color: var(--tx3); display: flex; align-items: center; gap: 5px; }
.cmdk-hint kbd {
  background: var(--s3); border: 1px solid var(--b2);
  border-radius: 4px; padding: 1px 5px; font-family: var(--mono);
  font-size: 10px; color: var(--tx2);
}

/* ══════════════════════════════════════════════════════════════
   Keyboard Shortcuts Help
══════════════════════════════════════════════════════════════ */
.kbd-help-modal { max-width: 580px; }
.kbd-help-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 0; padding: 16px;
}
@media (max-width: 520px) { .kbd-help-grid { grid-template-columns: 1fr 1fr; } }
.kbd-section { padding: 8px; }
.kbd-section-title { font-size: 11px; color: var(--tx3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.kbd-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-size: 12px; color: var(--tx2); }
.kbd-row kbd {
  background: var(--s3); border: 1px solid var(--b2); border-radius: 4px;
  padding: 2px 7px; font-family: var(--mono); font-size: 10px;
  color: var(--tx); min-width: 20px; text-align: center; white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════════
   Bottom Navigation (mobile)
══════════════════════════════════════════════════════════════ */
.bottom-nav { display: none; }
@media (max-width: 768px) {
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
    background: var(--s2); border-top: 1px solid var(--b2);
    padding: 0 0 env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(0,0,0,.25);
  }
  .bnav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    gap: 2px; padding: 8px 4px 6px;
    background: none; border: none; cursor: pointer;
    color: var(--tx3); transition: color .15s;
  }
  .bnav-btn.active { color: var(--ac); }
  .bnav-icon { font-size: 18px; line-height: 1; }
  .bnav-label { font-size: 9px; font-family: var(--font); font-weight: 500; }
  /* Add bottom padding to main so content isn't hidden behind nav */
  .main { padding-bottom: 64px; }
}

/* ══════════════════════════════════════════════════════════════
   Toast Notifications
══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 80px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--s3); border: 1px solid var(--b2);
  border-radius: 8px; padding: 10px 16px;
  font-size: 13px; color: var(--tx); max-width: 340px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  transform: translateX(120%); transition: transform .25s cubic-bezier(.2,.8,.3,1);
  pointer-events: auto;
}
.toast.toast-show { transform: translateX(0); }

/* ══════════════════════════════════════════════════════════════
   Options Flow
══════════════════════════════════════════════════════════════ */
.opt-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.opt-ticker { font-size: 22px; font-weight: 800; color: var(--tx); font-family: var(--mono); }
.opt-name   { font-size: 13px; color: var(--tx3); }
.opt-price  { font-size: 15px; color: var(--ac); font-family: var(--mono); font-weight: 600; }

.opt-summary-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 10px; margin-bottom: 24px;
}
@media (max-width: 600px) { .opt-summary-row { grid-template-columns: repeat(2,1fr); } }
.opt-sum-card {
  background: var(--s2); border: 1px solid var(--b1);
  border-radius: 10px; padding: 14px 16px; text-align: center;
}
.opt-sum-card.bull .opt-sum-val { color: var(--gn); }
.opt-sum-card.bear .opt-sum-val { color: var(--ls); }
.opt-sum-val { font-size: 20px; font-weight: 700; font-family: var(--mono); }
.opt-sum-lbl { font-size: 11px; color: var(--tx3); margin-top: 4px; }

.opt-section-label { font-size: 11px; color: var(--tx3); text-transform: uppercase;
  letter-spacing: .06em; margin: 20px 0 10px; }
.opt-section-note { text-transform: none; }

.opt-exp-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 10px; margin-bottom: 24px; }
.opt-exp-card { background: var(--s2); border: 1px solid var(--b1); border-radius: 8px; padding: 12px 14px; }
.opt-exp-date { font-size: 12px; font-weight: 700; color: var(--tx); font-family: var(--mono); margin-bottom: 6px; }
.opt-exp-row { font-size: 12px; color: var(--tx2); margin-bottom: 3px; }
.opt-exp-calls { color: var(--gn); }
.opt-exp-puts  { color: var(--ls); }
.opt-exp-meta  { color: var(--tx3); font-size: 11px; }

.opt-unusual-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.opt-unusual-table th {
  text-align: left; padding: 7px 10px;
  background: var(--s2); color: var(--tx3);
  border-bottom: 1px solid var(--b2); font-weight: 600; font-size: 11px;
}
.opt-unusual-table td { padding: 8px 10px; border-bottom: 1px solid var(--b1); color: var(--tx2); }
.opt-unusual-table tr:hover td { background: var(--s2); }

.opt-type-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; }
.opt-call { background: rgba(33,209,106,.15); color: var(--gn); }
.opt-put  { background: rgba(240,68,68,.15);  color: var(--ls); }

/* ══════════════════════════════════════════════════════════════
   Dividends
══════════════════════════════════════════════════════════════ */
.div-no-div { padding: 40px; text-align: center; color: var(--tx3); font-size: 15px; }
.div-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.div-ticker { font-size: 22px; font-weight: 800; color: var(--tx); font-family: var(--mono); }
.div-name   { font-size: 13px; color: var(--tx3); }

.div-kpi-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.div-kpi {
  background: var(--s2); border: 1px solid var(--b1);
  border-radius: 10px; padding: 14px 18px; text-align: center; min-width: 120px;
}
.div-kpi-val { font-size: 18px; font-weight: 700; font-family: var(--mono); color: var(--tx); }
.div-kpi-val.bull { color: var(--gn); }
.div-kpi-val.bear { color: var(--ls); }
.div-kpi-lbl { font-size: 11px; color: var(--tx3); margin-top: 4px; }

.div-section-label { font-size: 11px; color: var(--tx3); text-transform: uppercase;
  letter-spacing: .06em; margin: 16px 0 10px; }

.div-spark-section { margin-bottom: 20px; }
.div-spark-bars {
  display: flex; align-items: flex-end; gap: 4px;
  height: 80px; padding: 0 4px;
}
.div-spark-col { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.div-spark-bar {
  width: 100%; max-width: 20px; background: var(--ac);
  border-radius: 2px 2px 0 0; transition: height .3s;
}
.div-spark-lbl { font-size: 8px; color: var(--tx3); writing-mode: vertical-rl;
  transform: rotate(180deg); white-space: nowrap; }

.div-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.div-table th {
  text-align: left; padding: 8px 12px;
  background: var(--s2); color: var(--tx3); border-bottom: 1px solid var(--b2);
  font-weight: 600; font-size: 11px;
}
.div-table td { padding: 9px 12px; border-bottom: 1px solid var(--b1); color: var(--tx2); }
.div-table tr:hover td { background: var(--s2); }

/* ══════════════════════════════════════════════════════════════
   8-K Filings
══════════════════════════════════════════════════════════════ */
.eightk-content { max-width: 860px; }
.ek-count { font-size: 12px; color: var(--tx3); margin-bottom: 14px; }
.ek-none  { color: var(--tx3); font-size: 14px; text-align: center; padding: 40px; }
.ek-list  { display: flex; flex-direction: column; gap: 10px; }
.ek-item  {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--s2); border: 1px solid var(--b1); border-radius: 10px; padding: 14px 18px;
  transition: border-color .15s;
}
.ek-item:hover { border-color: var(--b3); }
.ek-item-left { display: flex; align-items: flex-start; gap: 12px; flex: 1; min-width: 0; }
.ek-badge {
  flex-shrink: 0; background: rgba(0,206,255,.12); color: var(--ac);
  border: 1px solid var(--ac-brd); border-radius: 5px;
  padding: 3px 8px; font-size: 11px; font-weight: 700; font-family: var(--mono);
}
.ek-item-body { flex: 1; min-width: 0; }
.ek-date   { font-size: 13px; font-weight: 600; color: var(--tx); font-family: var(--mono); }
.ek-items  { font-size: 12px; color: var(--tx2); margin-top: 3px; }
.ek-entity { font-size: 11px; color: var(--tx3); margin-top: 2px; }
.ek-view-btn {
  flex-shrink: 0; padding: 6px 14px; border-radius: 6px;
  background: var(--s3); border: 1px solid var(--b2); color: var(--tx2);
  font-size: 12px; text-decoration: none; transition: all .15s; white-space: nowrap;
}
.ek-view-btn:hover { border-color: var(--ac); color: var(--ac); }

/* ══════════════════════════════════════════════════════════════
   Price Alerts
══════════════════════════════════════════════════════════════ */
.pa-form {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 14px 0 18px; border-bottom: 1px solid var(--b1);
  margin-bottom: 16px;
}
.pa-input {
  padding: 8px 12px; border-radius: 7px;
  background: var(--s2); border: 1px solid var(--b2); color: var(--tx);
  font-size: 13px; font-family: var(--font); outline: none; transition: border-color .15s;
}
.pa-input:focus { border-color: var(--ac); }
.pa-input[placeholder="Ticker"] { width: 80px; font-family: var(--mono); font-weight: 700; }
.pa-select {
  padding: 8px 12px; border-radius: 7px;
  background: var(--s2); border: 1px solid var(--b2); color: var(--tx);
  font-size: 13px; font-family: var(--font); outline: none; cursor: pointer;
}
.pa-add-btn {
  padding: 8px 14px; border-radius: 7px;
  background: var(--ac); color: #000; font-weight: 700; font-size: 13px;
  border: none; cursor: pointer; transition: opacity .15s;
}
.pa-add-btn:hover { opacity: .85; }

.pa-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pa-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--s2); border: 1px solid var(--b1); border-radius: 8px; padding: 10px 14px;
}
.pa-item.pa-fired { border-color: var(--gn-brd); background: var(--gn-dim); }
.pa-item-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pa-item-ticker { font-weight: 700; color: var(--ac); font-family: var(--mono); font-size: 13px; }
.pa-item-cond   { font-size: 13px; color: var(--tx2); }
.pa-item-fired-badge {
  font-size: 11px; background: var(--gn-dim); color: var(--gn);
  border: 1px solid var(--gn-brd); border-radius: 4px; padding: 1px 7px;
}
.pa-remove-btn {
  background: none; border: none; color: var(--tx3); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px;
}
.pa-remove-btn:hover { color: var(--ls); background: var(--s3); }

.pa-fired-list { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.pa-fired-item { font-size: 12px; color: var(--gn); padding: 6px 10px;
  background: var(--gn-dim); border-radius: 6px; border: 1px solid var(--gn-brd); }

/* ══════════════════════════════════════════════════════════════
   Light-mode overrides for new features
══════════════════════════════════════════════════════════════ */
body.light .cmdk-modal { background: #fff; border-color: #e5e7eb; }
body.light .cmdk-input { color: #111; }
body.light .cmdk-footer { background: #f9fafb; border-color: #e5e7eb; }
body.light .cmdk-result-item:hover,
body.light .cmdk-result-item.selected { background: #f3f4f6; }
body.light .kbd-row kbd { background: #f3f4f6; border-color: #d1d5db; color: #374151; }
body.light .opt-sum-card,
body.light .opt-exp-card,
body.light .ek-item,
body.light .pa-item { background: #f9fafb; border-color: #e5e7eb; }
body.light .div-kpi { background: #f9fafb; border-color: #e5e7eb; }
body.light .toast { background: #fff; border-color: #e5e7eb; color: #111; }
body.light .bottom-nav { background: #fff; border-color: #e5e7eb; }
body.light .bnav-btn { color: #9ca3af; }
body.light .bnav-btn.active { color: #0099cc; }

/* ══════════════════════════════════════════════════════════════
   Accounts / Auth
══════════════════════════════════════════════════════════════ */
.account-area {
  margin-top: auto;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--b1);
}
.acct-signin-btn {
  width: 100%;
  padding: 9px 12px;
  background: var(--ac-dim);
  color: var(--ac);
  border: 1px solid var(--ac-brd);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s;
}
.acct-signin-btn:hover { background: var(--ac-glow); }
.acct-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.acct-info { display: flex; align-items: center; gap: 7px; min-width: 0; }
.acct-email {
  font-size: 12px;
  color: var(--tx2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}
.acct-badge.free { background: var(--s3); color: var(--tx3); }
.acct-badge.paid { background: var(--gn-dim); color: var(--gn); }
.acct-link {
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
}
.acct-link:hover { color: var(--ls); }

/* Sign-in modal */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal.hidden { display: none; }
.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(2px);
}
.auth-modal-card {
  position: relative;
  width: 90%;
  max-width: 380px;
  background: var(--s1);
  border: 1px solid var(--b2);
  border-radius: 14px;
  padding: 28px 26px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  text-align: center;
}
.auth-modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.auth-modal-x:hover { color: var(--tx); }
.auth-modal-logo {
  font-size: 28px;
  color: var(--ac);
  margin-bottom: 10px;
}
.auth-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--tx);
  margin: 0 0 8px;
}
.auth-modal-sub {
  font-size: 13px;
  color: var(--tx3);
  line-height: 1.5;
  margin: 0 0 18px;
}
.auth-form { display: flex; flex-direction: column; gap: 10px; }
.auth-email-input {
  width: 100%;
  padding: 11px 13px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--tx);
  font-size: 14px;
}
.auth-email-input:focus {
  outline: none;
  border-color: var(--ac-brd);
}
.auth-submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--ac);
  color: #001318;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .12s;
}
.auth-submit-btn:hover { opacity: .9; }
.auth-submit-btn:disabled { opacity: .5; cursor: default; }
.auth-msg {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
}
.auth-msg.hidden { display: none; }
.auth-msg.ok  { background: var(--gn-dim); color: var(--gn); }
.auth-msg.err { background: var(--ls-dim); color: var(--ls); }
.auth-msg a { color: var(--ac); }

/* Locked (Pro) tabs */
.main-tab.tab-locked::after {
  content: "🔒";
  font-size: 9px;
  margin-left: 5px;
  opacity: .65;
}
.bnav-btn.tab-locked .bnav-icon { position: relative; }
.bnav-btn.tab-locked .bnav-icon::after {
  content: "🔒";
  font-size: 8px;
  position: absolute;
  top: -4px;
  right: -8px;
}

/* Upgrade / paywall modal */
.upgrade-card { max-width: 420px; }
.upgrade-crown {
  font-size: 26px;
  color: var(--wn);
  margin-bottom: 6px;
}
.upgrade-pro {
  background: linear-gradient(90deg, var(--wn), var(--ac));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.upgrade-plans {
  display: flex;
  gap: 12px;
  margin: 18px 0 16px;
}
.upgrade-plan {
  position: relative;
  flex: 1;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 10px;
  padding: 14px 10px;
}
.upgrade-plan.best { border-color: var(--ac-brd); background: var(--ac-dim); }
.upgrade-plan-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ac);
  color: #001318;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.upgrade-plan-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx3);
  margin-bottom: 6px;
}
.upgrade-plan-price {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  color: var(--tx);
}
.upgrade-unit { font-size: 12px; color: var(--tx3); font-weight: 600; }
.upgrade-plan-per { font-size: 11px; color: var(--tx3); margin-top: 2px; }
.upgrade-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  text-align: left;
}
.upgrade-features li {
  position: relative;
  padding: 5px 0 5px 24px;
  font-size: 13px;
  color: var(--tx2);
}
.upgrade-features li::before {
  content: "✓";
  position: absolute;
  left: 4px;
  color: var(--gn);
  font-weight: 700;
}
.upgrade-pay-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--tx3);
}
.upgrade-net-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--tx3);
  margin-bottom: 8px;
}
.upgrade-networks {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.upgrade-net {
  flex: 1;
  padding: 9px 8px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--tx2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.upgrade-net:hover { border-color: var(--ac-brd); }
.upgrade-net.active {
  border-color: var(--ac);
  background: var(--ac-dim);
  color: var(--ac);
}
.upgrade-net-none {
  font-size: 12px;
  color: var(--tx3);
  margin-bottom: 14px;
}
.upgrade-plan { cursor: pointer; transition: border-color .12s, background .12s; }
.upgrade-plan.selected {
  border-color: var(--ac);
  background: var(--ac-dim);
  box-shadow: 0 0 0 1px var(--ac-brd) inset;
}

/* Payment panel */
.upgrade-back {
  position: absolute;
  top: 14px;
  left: 16px;
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 13px;
  cursor: pointer;
}
.upgrade-back:hover { color: var(--tx); }
.pay-qr {
  display: flex;
  justify-content: center;
  margin: 14px auto 16px;
  min-height: 4px;
}
.pay-qr img {
  width: 168px;
  height: 168px;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}
.pay-field { margin-bottom: 12px; text-align: left; }
.pay-field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--tx3);
  margin-bottom: 5px;
}
.pay-field-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.pay-field-row code {
  flex: 1;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--tx);
  overflow-x: auto;
  white-space: nowrap;
}
.pay-field-row code.pay-addr { font-size: 12px; }
.pay-copy {
  flex-shrink: 0;
  padding: 0 14px;
  background: var(--s3);
  border: 1px solid var(--b2);
  border-radius: 8px;
  color: var(--tx2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.pay-copy:hover { background: var(--ac-dim); color: var(--ac); border-color: var(--ac-brd); }
.pay-status {
  margin: 16px 0 4px;
  font-size: 13px;
  color: var(--tx2);
}
.pay-status.ok  { color: var(--gn); font-weight: 600; }
.pay-status.err { color: var(--ls); }
.pay-timer {
  font-size: 12px;
  color: var(--tx3);
  margin-bottom: 14px;
  font-family: var(--mono);
}

/* Account area trigger + modal */
.acct-open {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  text-align: left;
}
.acct-open:hover .acct-email { color: var(--tx); }
.acct-gear { color: var(--tx3); font-size: 13px; flex-shrink: 0; }
.acct-open:hover .acct-gear { color: var(--ac); }
.acct-badge.expiring { background: var(--wn-dim); color: var(--wn); }

.account-card { max-width: 420px; text-align: left; }
.account-card .auth-modal-title { text-align: left; }
.acct-detail-email {
  font-size: 13px;
  color: var(--tx2);
  margin-bottom: 16px;
  word-break: break-all;
}
.account-plan-box {
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}
.account-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.account-plan-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx3);
}
.account-renewal {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--b1);
  font-size: 12.5px;
  color: var(--tx2);
}
.account-renewal.warn { color: var(--wn); }
.account-renewal.hidden { display: none; }

.account-history { margin-top: 20px; }
.account-history-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx3);
  margin-bottom: 8px;
}
.account-history-list { display: flex; flex-direction: column; gap: 6px; }
.account-history-empty { font-size: 12px; color: var(--tx3); padding: 6px 0; }
.account-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--s2);
  border: 1px solid var(--b1);
  border-radius: 8px;
  padding: 9px 12px;
}
.ahi-left  { display: flex; flex-direction: column; gap: 2px; }
.ahi-right { display: flex; flex-direction: column; gap: 2px; text-align: right; }
.ahi-plan { font-size: 12.5px; font-weight: 600; color: var(--tx); }
.ahi-meta { font-size: 11px; color: var(--tx3); }
.ahi-amt  { font-size: 12.5px; font-weight: 700; font-family: var(--mono); color: var(--gn); }
.ahi-tx   { font-size: 10px; font-family: var(--mono); color: var(--tx3); }
.account-signout {
  margin-top: 18px;
  display: block;
  width: 100%;
  text-align: center;
  padding: 9px;
  background: var(--s2);
  border: 1px solid var(--b2);
  border-radius: 8px;
}
.account-signout:hover { color: var(--ls); border-color: var(--ls-brd); }

/* Landing pricing */
.landing-pricing { margin-top: 44px; width: 100%; max-width: 720px; }
.lp-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--tx3);
  text-align: center;
  margin-bottom: 18px;
}
.lp-plans {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.lp-plan {
  flex: 1;
  min-width: 240px;
  max-width: 320px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--b2);
  border-radius: 14px;
  padding: 22px 22px 24px;
  text-align: left;
}
.lp-pro {
  position: relative;
  border-color: var(--ac-brd);
  background: var(--ac-dim);
}
.lp-plan-badge {
  position: absolute;
  top: -10px;
  left: 22px;
  background: var(--ac);
  color: #001318;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 3px 10px;
  border-radius: 10px;
}
.lp-plan-name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--tx2);
  margin-bottom: 8px;
}
.lp-plan-price {
  font-family: var(--mono);
  font-size: 28px;
  font-weight: 800;
  color: var(--tx);
}
.lp-unit { font-size: 13px; color: var(--tx3); font-weight: 600; }
.lp-plan-sub { font-size: 12px; color: var(--tx3); margin-top: 3px; }
.lp-feat {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.lp-feat li {
  position: relative;
  padding: 5px 0 5px 22px;
  font-size: 13px;
  color: var(--tx2);
}
.lp-feat li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: var(--gn);
  font-weight: 700;
}
.lp-note {
  text-align: center;
  font-size: 12px;
  color: var(--tx3);
  margin-top: 18px;
}
@media (max-width: 560px) {
  .lp-plans { flex-direction: column; align-items: center; }
}

