/*
 * StockIQ — Personal Stock Analysis & Trade Planning
 * Copyright (c) 2026 Yakoub Beldjehem. All rights reserved.
 * Proprietary software. See LICENSE for full terms.
 */

/* ── Reset & Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Ink-blue board, the logo's blue line and green dot. --muted was #64748b,
     4.0:1 on the page — too faint for small text; now 6.6:1. */
  --bg:        #0a0f1c;
  --bg2:       #0f1729;
  --bg3:       #16213a;
  --border:    #1f2c47;
  --text:      #e6ecf5;
  --muted:     #8b9ab0;
  --accent:    #4c8dff;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #eab308;
  --green-bg:  rgba(34,197,94,0.12);
  --red-bg:    rgba(239,68,68,0.12);
  --yellow-bg: rgba(234,179,8,0.12);
  --radius:    10px;
  --font:      'IBM Plex Sans', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
}
.logo:hover { opacity: .85; }
.search-bar {
  flex: 1;
  max-width: 600px;
  display: flex;
  gap: 8px;
}
.search-bar input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: var(--muted); }
.search-bar button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 18px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .2s, transform .1s;
}
.search-bar button:hover { background: #2563eb; }
.search-bar button:active { transform: scale(0.97); }

/* ── Landing: see REDESIGN at the end of this file ─────────────────────── */

/* ── Loading ──────────────────────────────────────────────────────────── */
#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
  color: var(--muted);
}
.spinner-ring {
  width: 40px; height: 40px;
  border: 3px solid var(--bg3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ────────────────────────────────────────────────────────────── */
#error-box {
  max-width: 500px;
  margin: 40px auto;
  padding: 0 24px;
}
.error-inner {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.error-icon { font-size: 20px; }
.error-inner p { flex: 1; color: #fca5a5; }
.error-inner button {
  background: none;
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 6px;
  color: #fca5a5;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
}

/* ── Stock Hero ───────────────────────────────────────────────────────── */
#result { max-width: 1400px; margin: 0 auto; padding: 0 24px 40px; }
.stock-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 0 20px;
  border-bottom: 1px solid var(--border);
}
.stock-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.stock-identity h2 { font-size: 22px; font-weight: 700; }
.ticker-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}
.exchange-badge {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--muted);
}
.stock-price-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.price-big { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.change-chip {
  font-size: 15px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 6px;
}
.change-chip.up   { color: var(--green); background: var(--green-bg); }
.change-chip.down { color: var(--red);   background: var(--red-bg);   }
.market-status { font-size: 12px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; }
.price-sub { display: flex; gap: 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ── Signal Cards ─────────────────────────────────────────────────────── */
.signal-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.sig-card, .val-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sig-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.sig-value { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.sig-meta  { font-size: 12px; color: var(--muted); }

/* Signal colors */
.sig-card.buy    { border-color: rgba(34,197,94,.35);  background: rgba(34,197,94,.05); }
.sig-card.sell   { border-color: rgba(239,68,68,.35);  background: rgba(239,68,68,.05); }
.sig-card.hold   { border-color: rgba(234,179,8,.35);  background: rgba(234,179,8,.05); }
.sig-card.buy  .sig-value  { color: var(--green); }
.sig-card.sell .sig-value  { color: var(--red);   }
.sig-card.hold .sig-value  { color: var(--yellow);}

.val-card.under { border-color: rgba(34,197,94,.35);  background: rgba(34,197,94,.05); }
.val-card.over  { border-color: rgba(239,68,68,.35);  background: rgba(239,68,68,.05); }
.val-card.fair  { border-color: rgba(234,179,8,.35);  background: rgba(234,179,8,.05); }
.val-card.under .sig-value { color: var(--green); }
.val-card.over  .sig-value { color: var(--red);   }
.val-card.fair  .sig-value { color: var(--yellow);}

#sig-bar-wrap {
  height: 5px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
#sig-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .5s ease;
}
.val-price  { font-size: 18px; font-weight: 700; }
.val-upside { font-size: 13px; font-weight: 600; }

/* ── Tabs ─────────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 12px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ── Tab Body ─────────────────────────────────────────────────────────── */
.tab-body { padding: 24px 0; }

/* ── Generic Cards & Grids ────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 14px;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.metric-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.metric-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.metric-value { font-size: 17px; font-weight: 700; }
.metric-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 9px 12px; border-bottom: 1px solid rgba(30,45,69,.5); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }
/* On a phone a wide table scrolls inside its own box instead of making the
   whole page wider than the screen (the signals table pushed it to 407px on a
   390px phone, so the page slid sideways and the header looked clipped). */
@media (max-width: 768px) {
  .data-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Signal Table ─────────────────────────────────────────────────────── */
.sig-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sig-tag.bullish { background: var(--green-bg);  color: var(--green); }
.sig-tag.bearish { background: var(--red-bg);    color: var(--red);   }
.sig-tag.neutral { background: rgba(100,116,139,.15); color: var(--muted); }

/* ── Summary Tab ──────────────────────────────────────────────────────── */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .summary-grid { grid-template-columns: 1fr; } }

/* ── News Tab ─────────────────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  transition: border-color .2s;
  text-decoration: none;
  color: inherit;
}
.news-card:hover { border-color: var(--accent); }
.news-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.news-meta  { font-size: 12px; color: var(--muted); }
.news-thumb img { width: 80px; height: 60px; object-fit: cover; border-radius: 6px; }
.sentiment-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.sentiment-chip.pos  { background: var(--green-bg);  color: var(--green); }
.sentiment-chip.neg  { background: var(--red-bg);    color: var(--red);   }
.sentiment-chip.neut { background: rgba(100,116,139,.15); color: var(--muted); }

/* ── Chart Tab ────────────────────────────────────────────────────────── */
.chart-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.period-btns { display: flex; gap: 4px; }
.period-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.period-btn:hover, .period-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.indicator-toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.indicator-toggles label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.chart-block { margin-bottom: 8px; }
.chart-block-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 8px 0 4px; }
#price-chart  { height: 380px; }
#volume-chart { height: 80px; }
#rsi-chart    { height: 130px; }
#macd-chart   { height: 130px; }

/* ── Research Tab ─────────────────────────────────────────────────────── */
.analyst-bar-wrap { height: 10px; background: var(--bg3); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.analyst-bar { height: 100%; border-radius: 5px; }
.rating-row { display: grid; grid-template-columns: 100px 1fr 50px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }

/* ── Financials Tab ───────────────────────────────────────────────────── */
.fin-toggle { display: flex; gap: 4px; margin-bottom: 16px; }
.fin-toggle button {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
}
.fin-toggle button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fin-section { margin-bottom: 24px; }
.fin-section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.fin-table-wrap { overflow-x: auto; }
.fin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fin-table th { padding: 8px 12px; text-align: right; font-size: 11px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.fin-table th:first-child { text-align: left; }
.fin-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid rgba(30,45,69,.4); font-variant-numeric: tabular-nums; }
.fin-table td:first-child { text-align: left; color: var(--muted); }
.fin-table tr:last-child td { border-bottom: none; }
.fin-table tr:hover td { background: rgba(255,255,255,.02); }
.fin-table .total-row td { font-weight: 700; color: var(--text); border-top: 1px solid var(--border); }

/* ── Historical Tab ───────────────────────────────────────────────────── */
.hist-wrap { overflow-x: auto; max-height: 500px; overflow-y: auto; }

/* ── Profile Tab ──────────────────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 600px) { .profile-grid { grid-template-columns: 1fr; } }
.bio-text { font-size: 13px; line-height: 1.7; color: var(--muted); }
.exec-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.exec-table th { text-align: left; padding: 8px 12px; font-size: 11px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.exec-table td { padding: 9px 12px; border-bottom: 1px solid rgba(30,45,69,.5); }

/* ── Analysis Tab ─────────────────────────────────────────────────────── */
.analysis-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .analysis-grid { grid-template-columns: 1fr; } }

/* ── Community Tab ────────────────────────────────────────────────────── */
.sentiment-gauge { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.gauge-bar-wrap { flex: 1; height: 10px; background: var(--bg3); border-radius: 5px; overflow: hidden; }
.gauge-bar { height: 100%; border-radius: 5px; }
.community-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .community-grid { grid-template-columns: 1fr; } }

/* ── Util ─────────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.pos     { color: var(--green); }
.neg     { color: var(--red);   }
.neutral { color: var(--muted); }
.bold    { font-weight: 700; }
.section-gap { margin-bottom: 20px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 680px) { .two-col { grid-template-columns: 1fr; } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Header Search Wrap & Tools ───────────────────────────────────────── */
.search-wrap {
  flex: 1;
  max-width: 600px;
  position: relative;
}
.header-tools {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.tool-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .2s;
  position: relative;
}
.tool-btn:hover { color: var(--text); border-color: var(--accent); }
.tool-btn.active { background: rgba(59,130,246,.15); border-color: var(--accent); color: var(--accent); }

/* Hamburger button — hidden on desktop, shown on small screens */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  transition: border-color .15s, background .15s;
}
.hamburger-btn:hover { border-color: var(--accent); }
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform .2s, opacity .2s;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.tool-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

/* ── Search History Dropdown ──────────────────────────────────────────── */
.hist-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.hist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 14px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.hist-header button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font);
}
.hist-header button:hover { color: var(--red); }
.hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s;
}
.hist-item:hover { background: var(--bg3); }
.hist-item button {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
}
.hist-item button:hover { color: var(--red); }

/* ── Star Button ──────────────────────────────────────────────────────── */
.star-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 15px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1.5;
}
.star-btn:hover, .star-btn.starred { border-color: #eab308; color: #eab308; background: rgba(234,179,8,.1); }

/* ── Live Badge ───────────────────────────────────────────────────────── */
.live-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: .04em;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* ── Page Sections (Compare & Screener) ───────────────────────────────── */
.page-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}
.page-section-header { margin-bottom: 24px; }
.page-section-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.section-desc { color: var(--muted); font-size: 14px; }

/* ── Compare ──────────────────────────────────────────────────────────── */
.compare-inputs { margin-bottom: 24px; }
.compare-inputs-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-inputs-inner input {
  flex: 1;
  min-width: 140px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s;
}
.compare-inputs-inner input:focus { border-color: var(--accent); }
.compare-inputs-inner input::placeholder { font-weight: 400; text-transform: none; }
.vs-divider { font-size: 14px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
#compare-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 24px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
#compare-btn:hover { background: #2563eb; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .compare-grid { grid-template-columns: 1fr; } }
.compare-col { display: flex; flex-direction: column; gap: 14px; }
.compare-header-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.compare-ticker { font-size: 22px; font-weight: 800; margin-bottom: 3px; }
.compare-name   { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.compare-price  { font-size: 28px; font-weight: 800; }
.link-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--accent);
  padding: 5px 14px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font);
  transition: background .15s;
}
.link-btn:hover { background: rgba(59,130,246,.1); }

/* ── Screener ─────────────────────────────────────────────────────────── */
.screener-filters { margin-bottom: 20px; }
.screener-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.screener-field { display: flex; flex-direction: column; gap: 4px; }
.screener-field label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.screener-field input, .screener-field select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  min-width: 130px;
  transition: border-color .2s;
}
.screener-field input:focus, .screener-field select:focus { border-color: var(--accent); }
#screener-run-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 22px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  align-self: flex-end;
}
#screener-run-btn:hover { background: #2563eb; }
.screener-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; }
.preset-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  padding: 4px 12px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.preset-btn:hover { border-color: var(--accent); color: var(--accent); }
.screener-table-wrap { overflow-x: auto; }
.screener-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.screener-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.screener-table td { padding: 10px 12px; border-bottom: 1px solid rgba(30,45,69,.5); }
.screener-table tr:last-child td { border-bottom: none; }
.screener-table tr:hover td { background: rgba(255,255,255,.02); }
.screener-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── Watchlist Side Panel ─────────────────────────────────────────────── */
.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  backdrop-filter: blur(2px);
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.side-panel.open { transform: translateX(0); }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-header h3 { font-size: 16px; font-weight: 700; }
.panel-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  border-radius: 4px;
}
.panel-close:hover { color: var(--text); background: var(--bg3); }
.watchlist-add-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.watchlist-add-bar input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s;
}
.watchlist-add-bar input::placeholder { font-weight: 400; text-transform: none; }
.watchlist-add-bar input:focus { border-color: var(--accent); }
#wl-add-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
#wl-add-btn:hover { background: #2563eb; }
.panel-body { flex: 1; overflow-y: auto; padding: 4px 0; }
.panel-empty { padding: 32px 20px; color: var(--muted); font-size: 13px; text-align: center; line-height: 1.6; }
.wl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(30,45,69,.5);
  transition: background .15s;
}
.wl-item:last-child { border-bottom: none; }
.wl-item:hover { background: rgba(255,255,255,.02); }
.wl-ticker {
  font-weight: 700;
  font-size: 14px;
  min-width: 60px;
  cursor: pointer;
  color: var(--accent);
}
.wl-ticker:hover { text-decoration: underline; }
.wl-price { font-size: 13px; font-weight: 600; }
.wl-change { font-size: 12px; }
.wl-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 4px;
  line-height: 1;
  margin-left: auto;
}
.wl-remove:hover { color: var(--red); }

/* ── Piotroski F-Score ────────────────────────────────────────────────── */
.fscore-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  border: 2.5px solid;
  flex-shrink: 0;
}
.fscore-badge.strong   { border-color: var(--green);  color: var(--green);  }
.fscore-badge.moderate { border-color: var(--yellow); color: var(--yellow); }
.fscore-badge.weak     { border-color: var(--red);    color: var(--red);    }
.fscore-bar-wrap { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.fscore-bar { height: 100%; border-radius: 3px; transition: width .6s ease; }
.fscore-criteria { display: flex; flex-direction: column; gap: 5px; margin-top: 12px; }
.fscore-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(30,45,69,.3);
}
.fscore-item:last-child { border-bottom: none; }

/* ── Altman Z-Score ───────────────────────────────────────────────────── */
.zscore-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.zscore-badge.safe     { background: var(--green-bg);  color: var(--green);  }
.zscore-badge.grey     { background: var(--yellow-bg); color: var(--yellow); }
.zscore-badge.distress { background: var(--red-bg);    color: var(--red);    }

/* ── BUY Screener redesign ────────────────────────────────────────────── */
.screener-controls { margin-bottom: 20px; display: flex; flex-direction: column; gap: 16px; }
.screener-sector-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.sector-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sector-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  padding: 7px 16px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  white-space: nowrap;
}
.sector-chip:hover { color: var(--text); border-color: var(--accent); }
.sector-chip.active {
  background: rgba(59,130,246,.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.screener-options {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
#screener-run-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, transform .1s;
  white-space: nowrap;
}
#screener-run-btn:hover { background: #16a34a; }
#screener-run-btn:active { transform: scale(.97); }
#screener-run-btn:disabled { background: var(--muted); cursor: not-allowed; }

/* Screener results table */
.screener-table-wrap { overflow-x: auto; }
.screener-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.screener-table thead { position: sticky; top: 0; z-index: 2; }
.screener-table th {
  background: var(--bg3);
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color .15s;
}
.screener-table th:hover { color: var(--text); }
.screener-table th.sorted { color: var(--accent); }
.screener-table th .sort-icon { margin-left: 4px; opacity: .6; font-size: 10px; }
.screener-table td { padding: 11px 12px; border-bottom: 1px solid rgba(30,45,69,.5); vertical-align: top; }
.screener-table tr.data-row:last-of-type td { border-bottom: none; }
.screener-table tr.data-row:hover td { background: rgba(255,255,255,.02); cursor: pointer; }
.screener-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.screener-rank { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 22px; text-align: center; }

/* Buy thesis expandable row */
.thesis-row td {
  padding: 0 12px 14px 48px;
  border-bottom: 1px solid rgba(30,45,69,.5);
}
.thesis-row.hidden td { display: none; }
.thesis-box {
  background: rgba(34,197,94,.06);
  border: 1px solid rgba(34,197,94,.18);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
.thesis-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--green);
  margin-bottom: 5px;
}
.expand-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 8px;
  transition: all .15s;
  white-space: nowrap;
}
.expand-btn:hover { border-color: var(--green); color: var(--green); }
.expand-btn.open { border-color: var(--green); color: var(--green); background: rgba(34,197,94,.08); }

/* Screener no-results / info bar */
.screener-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}
.screener-info-bar strong { color: var(--text); }

/* ── Value Score badge ───────────────────────────────────────────────────── */
.value-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid;
}
.value-score.vs-high   { color: #22c55e; border-color: rgba(34,197,94,.5);  background: rgba(34,197,94,.1); }
.value-score.vs-mid    { color: #eab308; border-color: rgba(234,179,8,.5);  background: rgba(234,179,8,.1); }
.value-score.vs-low    { color: #f97316; border-color: rgba(249,115,22,.5); background: rgba(249,115,22,.1); }
.value-score.vs-none   { color: var(--muted); border-color: var(--border);  background: transparent; }

/* ── Best Value Picks hero button ────────────────────────────────────────── */
.best-value-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 20px rgba(22,163,74,.35);
  font-family: var(--font);
}
.best-value-hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(22,163,74,.5);
}
.best-value-hero-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* ── Best Value Picks section ─────────────────────────────────────────────── */
#best-value-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.best-value-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.best-value-header h2 { font-size: 22px; font-weight: 700; }
.best-value-badge {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Best Value Picks cards ──────────────────────────────────────────────── */
.bv-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bv-card {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color .2s;
}
.bv-card:hover { border-color: rgba(59,130,246,.4); }

.bv-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bv-rank {
  font-size: 22px;
  font-weight: 800;
  color: var(--muted);
  min-width: 32px;
}
.bv-identity { flex: 1; min-width: 180px; }
.bv-sector-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.bv-price-block { text-align: right; }
.bv-price { font-size: 20px; font-weight: 700; color: var(--text); }
.bv-chg   { font-size: 13px; font-weight: 600; margin-top: 2px; }

.bv-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  background: var(--bg3);
  border-radius: 8px;
  padding: 14px 16px;
}
.bv-metric { display: flex; flex-direction: column; gap: 3px; }
.bv-metric-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.bv-metric-val   { font-size: 14px; font-weight: 600; color: var(--text); }

.bv-thesis-wrap { border-top: 1px solid var(--border); padding-top: 12px; }
.bv-thesis-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}
.bv-thesis-toggle:hover span:last-child { color: var(--text); }
.bv-thesis-body {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  background: rgba(34,197,94,.06);
  border: 1px solid rgba(34,197,94,.18);
  border-radius: 8px;
  padding: 12px 16px;
}

.bv-card-footer { display: flex; justify-content: flex-end; }
.bv-analyze-btn {
  background: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font);
}
.bv-analyze-btn:hover {
  background: rgba(59,130,246,.12);
}

/* ── Screener extra filter fields ────────────────────────────────────────── */
.screener-options { flex-wrap: wrap; }
.screener-check-field { justify-content: flex-end; padding-bottom: 6px; }
.check-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.check-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.screener-field select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  min-width: 130px;
  transition: border-color .2s;
  cursor: pointer;
}
.screener-field select:focus { border-color: var(--accent); }

/* ══════════════════════════════════════════════════════════════════════════
   ALPHA EDGE
   ══════════════════════════════════════════════════════════════════════════ */
.alpha-btn { border-color: rgba(168,85,247,.4) !important; }
.alpha-btn:hover, .alpha-btn.active { background: rgba(168,85,247,.15) !important; border-color: #a855f7 !important; color: #a855f7 !important; }
.alpha-badge { background: linear-gradient(135deg, #7c3aed, #a855f7); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; text-transform: uppercase; letter-spacing: .06em; }
.alpha-search-bar { margin-bottom: 24px; }
.alpha-search-inner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.alpha-input-wrap { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 0 14px; transition: border-color .2s; }
.alpha-input-wrap:focus-within { border-color: #a855f7; }
.alpha-input-wrap input { flex: 1; background: none; border: none; color: var(--text); font-family: var(--font); font-size: 14px; outline: none; padding: 9px 0; }
.alpha-input-wrap input::placeholder { color: var(--muted); }
#alpha-run-btn { background: linear-gradient(135deg, #7c3aed, #a855f7); border: none; border-radius: var(--radius); color: #fff; font-family: var(--font); font-size: 14px; font-weight: 600; padding: 9px 22px; cursor: pointer; transition: opacity .2s, transform .15s; white-space: nowrap; }
#alpha-run-btn:hover { opacity: .9; transform: translateY(-1px); }
#alpha-run-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.alpha-tool-labels { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.alpha-tool-labels span { font-size: 11px; color: var(--muted); background: var(--bg3); border: 1px solid var(--border); border-radius: 20px; padding: 3px 10px; }
.alpha-results-grid { display: flex; flex-direction: column; gap: 20px; }
.alpha-stock-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 24px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; }
.alpha-hero-ticker { font-size: 28px; font-weight: 800; color: var(--accent); }
.alpha-hero-name { font-size: 14px; color: var(--muted); margin-top: 2px; }
.alpha-hero-price { font-size: 22px; font-weight: 700; margin-left: auto; }
.alpha-tool-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.alpha-tool-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg3); }
.alpha-tool-num { width: 26px; height: 26px; border-radius: 50%; background: rgba(168,85,247,.2); border: 1px solid rgba(168,85,247,.4); color: #a855f7; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.alpha-tool-title { font-size: 15px; font-weight: 700; }
.alpha-tool-subtitle { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }
.alpha-tool-body { padding: 20px; }
/* Buffett */
.buffett-summary { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 20px; padding: 16px 20px; background: var(--bg3); border-radius: 10px; }
.buffett-score-circle { width: 72px; height: 72px; border-radius: 50%; border: 3px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; }
.buffett-score-circle .big { font-size: 22px; line-height: 1; }
.buffett-score-circle .sub { font-size: 10px; color: var(--muted); }
.buffett-verdict { flex: 1; min-width: 200px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.buffett-strength { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.buffett-criteria { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.buffett-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--bg3); border-radius: 8px; border-left: 3px solid; cursor: pointer; transition: background .15s; }
.buffett-row:hover { background: var(--bg); }
.buffett-row.pass { border-color: var(--green); }
.buffett-row.fail { border-color: var(--red); }
.buffett-row.na   { border-color: var(--border); }
.buffett-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.buffett-row-content { flex: 1; }
.buffett-row-name  { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.buffett-row-value { font-size: 11px; color: var(--muted); }
.buffett-row-desc  { font-size: 11px; color: var(--muted); margin-top: 4px; display: none; line-height: 1.5; }
.buffett-row.open .buffett-row-desc { display: block; }
/* Hidden Risk */
.risk-summary-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; border: 1px solid; }
.risk-overall { font-size: 18px; font-weight: 800; }
.risk-summary-text { font-size: 13px; flex: 1; min-width: 180px; }
.risk-flags { display: flex; flex-direction: column; gap: 10px; }
.risk-flag { display: flex; gap: 12px; padding: 12px 14px; border-radius: 8px; border-left: 4px solid; cursor: pointer; transition: background .15s; }
.risk-flag:hover { filter: brightness(1.08); }
.risk-flag.high   { background: rgba(239,68,68,.07);  border-color: var(--red); }
.risk-flag.medium { background: rgba(234,179,8,.07);  border-color: var(--yellow); }
.risk-flag.safe   { background: rgba(34,197,94,.07);  border-color: var(--green); }
.risk-flag-right  { flex: 1; }
.risk-flag-name   { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.risk-flag-value  { font-size: 11px; color: var(--muted); }
.risk-flag-headline { font-size: 12px; font-weight: 600; margin: 2px 0; }
.risk-flag-detail { font-size: 11px; color: var(--muted); line-height: 1.55; display: none; margin-top: 6px; }
.risk-flag.open .risk-flag-detail { display: block; }
/* Smart Entry */
.entry-status-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: 10px; margin-bottom: 20px; border: 1px solid; }
.entry-status-label { font-size: 20px; font-weight: 800; }
.entry-zone-range { font-size: 15px; font-weight: 700; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.3); border-radius: 6px; padding: 4px 12px; color: var(--green); }
.entry-status-desc { font-size: 13px; color: var(--muted); flex: 1; min-width: 180px; }
.entry-52w-wrap { margin: 16px 0 8px; }
.entry-52w-bar { position: relative; height: 8px; background: var(--bg3); border-radius: 4px; }
.entry-52w-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--green), var(--accent)); }
.entry-52w-marker { position: absolute; top: -4px; width: 4px; height: 16px; background: var(--yellow); border-radius: 2px; transform: translateX(-2px); }
.entry-52w-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 5px; }
.entry-signals { display: flex; flex-direction: column; gap: 8px; }
.entry-signal-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg3); border-radius: 8px; font-size: 13px; flex-wrap: wrap; }
.entry-signal-price { font-weight: 700; color: var(--accent); min-width: 70px; }
.entry-signal-name  { font-weight: 600; min-width: 160px; }
.entry-signal-desc  { color: var(--muted); font-size: 12px; flex: 1; }
.entry-signal-type  { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; white-space: nowrap; margin-left: auto; }
.entry-signal-type.value     { background: rgba(59,130,246,.15); color: var(--accent); }
.entry-signal-type.technical { background: rgba(234,179,8,.15);  color: var(--yellow); }
.entry-signal-type.momentum  { background: rgba(34,197,94,.15);  color: var(--green); }
/* Smart Money */
.smart-money-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(130px,1fr)); gap: 12px; margin-bottom: 20px; }
.smart-money-stat { text-align: center; padding: 16px; background: var(--bg3); border-radius: 10px; }
.smart-money-stat-val   { font-size: 24px; font-weight: 800; }
.smart-money-stat-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.smart-money-signals { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.sm-signal { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.sm-signal.bullish { background: rgba(34,197,94,.08);   border-left: 3px solid var(--green); }
.sm-signal.caution { background: rgba(234,179,8,.08);   border-left: 3px solid var(--yellow); }
.sm-signal.neutral { background: rgba(100,116,139,.08); border-left: 3px solid var(--muted); }
.sm-holders-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sm-holders-table th { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .05em; padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.sm-holders-table td { padding: 8px 10px; border-bottom: 1px solid rgba(30,45,69,.5); }
.sm-holders-table tr:last-child td { border-bottom: none; }
.legendary-row td { background: rgba(168,85,247,.05); }
.legendary-tag { font-size: 10px; background: rgba(168,85,247,.2); color: #a855f7; border-radius: 10px; padding: 1px 7px; margin-left: 6px; }
/* Earnings Predictor */
.earnings-main { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 24px; }
.earnings-prob-circle { width: 88px; height: 88px; border-radius: 50%; border: 4px solid; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
.earnings-prob-circle .pct { font-size: 22px; font-weight: 800; line-height: 1; }
.earnings-prob-circle .lbl { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.earnings-signal-badge { font-size: 20px; font-weight: 800; padding: 7px 18px; border-radius: 8px; border: 2px solid; }
.earnings-meta { flex: 1; min-width: 180px; }
.earnings-meta-row { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 5px; }
.earnings-meta-label { color: var(--muted); min-width: 140px; font-size: 12px; }
.earnings-meta-val   { font-weight: 600; }
.earnings-history-wrap { margin-top: 20px; }
.earnings-history-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.earnings-history-bars { display: flex; align-items: flex-end; gap: 4px; height: 60px; }
.earnings-bar { flex: 1; border-radius: 3px 3px 0 0; min-width: 16px; position: relative; cursor: default; transition: opacity .15s; }
.earnings-bar:hover { opacity: .8; }
.next-earnings-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.25); border-radius: 8px; margin-bottom: 20px; font-size: 13px; }
.next-earnings-banner strong { color: var(--accent); }

/* ── Alpha Tool Labels: group headers ────────────────────────────────── */
.atl-group-label { font-size: 10px !important; font-weight: 700 !important; text-transform: uppercase; letter-spacing: .08em; color: rgba(168,85,247,.7) !important; background: rgba(168,85,247,.08) !important; border: 1px solid rgba(168,85,247,.2) !important; padding: 2px 8px !important; border-radius: 4px; }

/* ── Alpha section group headers ─────────────────────────────────────── */
.alpha-group-header { display: flex; align-items: center; gap: 12px; padding: 20px 0 10px; }
.alpha-group-title  { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(168,85,247,.9); }
.alpha-group-line   { flex: 1; height: 1px; background: rgba(168,85,247,.15); }

/* ── Reverse DCF ─────────────────────────────────────────────────────── */
.rdcf-verdict-bar { padding: 16px 20px; border-radius: 10px; border: 1px solid; margin-bottom: 18px; }
.rdcf-verdict-tag { font-size: 18px; font-weight: 800; letter-spacing: .03em; margin-bottom: 4px; }
.rdcf-narrative   { font-size: 13px; line-height: 1.65; opacity: .9; }
.rdcf-grid        { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.rdcf-metric      { background: var(--bg3); border-radius: 8px; padding: 14px; text-align: center; }
.rdcf-metric-val  { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.rdcf-metric-lbl  { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.rdcf-compare     { background: var(--bg3); border-radius: 10px; padding: 16px; }
.rdcf-compare-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rdcf-compare-row:last-child { border-bottom: none; }
.rdcf-compare-label { color: var(--muted); }
.rdcf-compare-val   { font-weight: 700; }
.rdcf-bar-track   { height: 8px; border-radius: 4px; background: var(--bg2); margin: 4px 0; overflow: hidden; }
.rdcf-bar-fill    { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* ── Accruals Quality ────────────────────────────────────────────────── */
.accruals-grade-bar { padding: 16px 20px; border-radius: 10px; border: 1px solid; margin-bottom: 18px; }
.accruals-grade-tag { font-size: 18px; font-weight: 800; letter-spacing: .03em; margin-bottom: 4px; }
.accruals-grade-desc { font-size: 13px; line-height: 1.65; opacity: .9; }
.accruals-gauge-wrap { text-align: center; margin-bottom: 18px; }
.accruals-gauge-num  { font-size: 36px; font-weight: 900; letter-spacing: -.02em; }
.accruals-gauge-lbl  { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.accruals-yearly     { background: var(--bg3); border-radius: 10px; padding: 16px; }
.accruals-yr-row     { display: grid; grid-template-columns: 80px 1fr 80px; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.accruals-yr-row:last-child { border-bottom: none; }
.accruals-yr-label  { color: var(--muted); }
.accruals-yr-bar    { height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg2); }
.accruals-yr-fill   { height: 100%; border-radius: 3px; }
.accruals-yr-val    { font-weight: 700; text-align: right; font-size: 13px; }
.accruals-trend-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 12px; }
.accruals-trend-pill.improving    { background: rgba(34,197,94,.1);  color: var(--green); }
.accruals-trend-pill.deteriorating { background: rgba(239,68,68,.1); color: var(--red);   }
.accruals-trend-pill.stable       { background: rgba(156,163,175,.1); color: var(--muted); }

/* ── ROIC vs WACC ────────────────────────────────────────────────────── */
.roic-verdict-bar { padding: 16px 20px; border-radius: 10px; border: 1px solid; margin-bottom: 18px; }
.roic-verdict-tag { font-size: 17px; font-weight: 800; letter-spacing: .03em; margin-bottom: 4px; }
.roic-verdict-desc { font-size: 13px; line-height: 1.65; opacity: .9; }
.roic-headline-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.roic-headline-box  { background: var(--bg3); border-radius: 8px; padding: 14px; text-align: center; }
.roic-headline-val  { font-size: 22px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.roic-headline-lbl  { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.roic-history       { background: var(--bg3); border-radius: 10px; padding: 16px; }
.roic-history-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.roic-yr-row        { display: grid; grid-template-columns: 80px 1fr 60px 60px 80px; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.roic-yr-row:last-child { border-bottom: none; }
.roic-yr-label { color: var(--muted); }
.roic-yr-bar   { height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg2); }
.roic-yr-fill  { height: 100%; border-radius: 3px; }
.roic-spread-pill { padding: 2px 8px; border-radius: 12px; font-weight: 800; font-size: 12px; text-align: right; }
.roic-spread-pill.positive { color: var(--green); background: rgba(34,197,94,.1); }
.roic-spread-pill.negative { color: var(--red);   background: rgba(239,68,68,.1); }
.roic-trend-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: 12px; }
.roic-trend-pill.expanding    { background: rgba(34,197,94,.1);  color: var(--green); }
.roic-trend-pill.compressing  { background: rgba(239,68,68,.1);  color: var(--red);   }
.roic-trend-pill.stable       { background: rgba(156,163,175,.1); color: var(--muted); }

/* ── Operating Leverage (DOL) ────────────────────────────────────────── */
.dol-category-bar  { padding: 16px 20px; border-radius: 10px; border: 1px solid; margin-bottom: 18px; }
.dol-category-tag  { font-size: 18px; font-weight: 800; letter-spacing: .03em; margin-bottom: 4px; }
.dol-category-desc { font-size: 13px; line-height: 1.65; opacity: .9; }
.dol-big-number    { text-align: center; padding: 20px 0; }
.dol-num           { font-size: 56px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.dol-num-lbl       { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dol-scenario-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dol-scenario-box  { border-radius: 10px; padding: 16px; text-align: center; border: 1px solid; }
.dol-scenario-val  { font-size: 28px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.dol-scenario-lbl  { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.dol-history       { background: var(--bg3); border-radius: 10px; padding: 16px; }
.dol-yr-row        { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; gap: 8px; }
.dol-yr-row:last-child { border-bottom: none; }
.dol-yr-label  { color: var(--muted); min-width: 64px; }
.dol-yr-rev    { color: var(--muted); }
.dol-yr-ebit   { font-weight: 700; min-width: 64px; text-align: right; }
.dol-yr-dol    { font-weight: 900; min-width: 48px; text-align: right; color: var(--accent); }

/* ── Capital Allocation ───────────────────────────────────────────────── */
.cap-grade-box     { display: flex; align-items: center; gap: 20px; padding: 20px; background: var(--bg3); border-radius: 12px; margin-bottom: 18px; }
.cap-grade-letter  { font-size: 52px; font-weight: 900; line-height: 1; min-width: 56px; text-align: center; }
.cap-grade-info    { flex: 1; }
.cap-grade-pct     { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.cap-grade-verdict { font-size: 13px; line-height: 1.6; color: var(--text); }
.cap-breakdown     { margin-bottom: 18px; }
.cap-dim-row       { display: grid; grid-template-columns: 160px 1fr 48px; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.cap-dim-row:last-child { border-bottom: none; }
.cap-dim-label     { color: var(--muted); font-size: 11px; }
.cap-dim-track     { height: 7px; border-radius: 4px; background: var(--bg2); overflow: hidden; }
.cap-dim-fill      { height: 100%; border-radius: 4px; transition: width .5s ease; }
.cap-dim-score     { font-weight: 800; font-size: 12px; text-align: right; color: var(--accent); }
.cap-signals       { display: flex; flex-direction: column; gap: 8px; }
.cap-signal-row    { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; padding: 10px 14px; border-radius: 8px; }
.cap-signal-row.positive { background: rgba(34,197,94,.06);  border: 1px solid rgba(34,197,94,.2); color: var(--green); }
.cap-signal-row.negative { background: rgba(239,68,68,.06);  border: 1px solid rgba(239,68,68,.2); color: var(--red);   }

/* ── Market Pulse / Macro Dashboard ─────────────────────────────────── */
.macro-btn   { border-color: rgba(16,185,129,.35) !important; }
.macro-btn:hover,.macro-btn.active { background: rgba(16,185,129,.12) !important; border-color: rgba(16,185,129,.7) !important; color: var(--green) !important; }
.macro-badge { background: linear-gradient(135deg,#065f46,#10b981); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; letter-spacing: .05em; text-transform: uppercase; }

.macro-condition-banner { padding: 22px 28px; border-radius: 14px; border: 1px solid; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.macro-condition-tag    { font-size: 22px; font-weight: 900; letter-spacing: .02em; }
.macro-condition-meta   { font-size: 12px; opacity: .75; margin-top: 4px; }

.macro-pillars          { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 16px; margin-bottom: 28px; }
.macro-pillar           { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.macro-pillar-icon      { font-size: 24px; margin-bottom: 10px; }
.macro-pillar-title     { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.macro-pillar-val       { font-size: 26px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.macro-pillar-sub       { font-size: 11px; color: var(--muted); line-height: 1.5; }

.macro-sector-section   { background: var(--bg2); border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.macro-sector-title     { font-size: 13px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.macro-sector-table     { width: 100%; border-collapse: collapse; font-size: 13px; }
.macro-sector-table th  { text-align: left; color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 10px; }
.macro-sector-table th:not(:first-child) { text-align: right; }
.macro-sector-table td  { padding: 9px 8px; border-top: 1px solid var(--border); }
.macro-sector-table td:not(:first-child) { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.macro-sector-table tr:first-child td   { border-top: none; }
.macro-sector-table tr.top-sector td    { background: rgba(34,197,94,.04); }
.macro-sector-table tr.bot-sector td    { background: rgba(239,68,68,.04); }
.macro-sector-bar       { display: inline-block; height: 6px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.macro-rank-badge       { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 800; margin-right: 6px; }
.macro-rank-badge.top   { background: rgba(34,197,94,.15); color: var(--green); }
.macro-rank-badge.bot   { background: rgba(239,68,68,.15); color: var(--red); }

/* ── Historical Valuation Percentile ─────────────────────────────────── */
.hv-grade-bar   { padding: 16px 20px; border-radius: 10px; border: 1px solid; margin-bottom: 18px; }
.hv-grade-tag   { font-size: 17px; font-weight: 800; letter-spacing: .03em; margin-bottom: 4px; }
.hv-grade-desc  { font-size: 13px; line-height: 1.65; opacity: .9; }
.hv-range-wrap  { background: var(--bg3); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.hv-range-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.hv-track       { position: relative; height: 10px; border-radius: 5px; background: linear-gradient(to right, var(--green), var(--yellow), var(--red)); margin: 20px 0; }
.hv-marker      { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 18px; height: 18px; border-radius: 50%; background: var(--bg1); border: 3px solid var(--accent); box-shadow: 0 0 0 4px rgba(59,130,246,.2); }
.hv-tick-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.hv-stats-grid  { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.hv-stat-box    { background: var(--bg3); border-radius: 8px; padding: 12px; text-align: center; }
.hv-stat-val    { font-size: 18px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.hv-stat-lbl    { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hv-percentile-big { text-align: center; margin: 8px 0 16px; }
.hv-pct-num     { font-size: 48px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.hv-pct-lbl     { font-size: 11px; color: var(--muted); }

/* ── Position Size Calculator ────────────────────────────────────────── */
.pos-calc-card  { background: var(--bg2); border: 1px solid rgba(59,130,246,.25); border-radius: 14px; padding: 24px; margin-top: 24px; }
.pos-calc-title { font-size: 14px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.pos-calc-badge { background: rgba(59,130,246,.15); color: var(--accent); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: .05em; }
.pos-calc-sub   { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.pos-calc-inputs { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 12px; margin-bottom: 18px; }
.pos-calc-field  { display: flex; flex-direction: column; gap: 5px; }
.pos-calc-label  { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pos-calc-input  { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 600; color: var(--text); font-family: inherit; }
.pos-calc-input:focus { outline: none; border-color: var(--accent); }
.pos-calc-results { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px; margin-bottom: 16px; }
.pos-calc-result-box { background: var(--bg3); border-radius: 10px; padding: 14px; text-align: center; }
.pos-calc-result-val { font-size: 22px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.pos-calc-result-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pos-calc-warning    { font-size: 12px; color: var(--yellow); background: rgba(234,179,8,.08); border: 1px solid rgba(234,179,8,.2); border-radius: 8px; padding: 10px 14px; line-height: 1.6; }
.pos-calc-kelly      { font-size: 12px; color: var(--muted); padding: 10px 0; line-height: 1.6; border-top: 1px solid var(--border); margin-top: 8px; }

/* ── TP/SL Levels ─────────────────────────────────────────────────────────── */
.tpsl-section       { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.tpsl-title         { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 12px; }
.tpsl-grid          { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tpsl-level         { border-radius: 10px; padding: 12px 14px; text-align: center; border: 1px solid var(--border); }
.tpsl-level-label   { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.tpsl-level-price   { font-size: 18px; font-weight: 900; line-height: 1; margin-bottom: 4px; }
.tpsl-level-pct     { font-size: 11px; font-weight: 600; color: var(--muted); }
.tpsl-stop          { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.25); }
.tpsl-stop .tpsl-level-price { color: var(--red); }
.tpsl-entry         { background: var(--bg3); border-color: var(--accent); }
.tpsl-entry .tpsl-level-price { color: var(--text); }
.tpsl-tp1           { background: rgba(34,197,94,.06); border-color: rgba(34,197,94,.2); }
.tpsl-tp1 .tpsl-level-price  { color: var(--green); }
.tpsl-tp2           { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.tpsl-tp2 .tpsl-level-price  { color: var(--green); }
.tpsl-note          { font-size: 11px; color: var(--muted); margin-top: 12px; line-height: 1.6; }

/* ── Market Climate Badge ─────────────────────────────────────────────────── */
.hero-actions     { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.climate-badge    { font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 20px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.climate-on       { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.35); color: var(--green); }
.climate-caution  { background: rgba(234,179,8,.15); border: 1px solid rgba(234,179,8,.35); color: var(--yellow); }
.climate-off      { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.35); color: var(--red); }

/* ── Trade Readiness Checklist ───────────────────────────────────────────── */
.checklist-header    { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 12px 16px; background: var(--bg3); border-radius: 10px; }
.checklist-score-wrap{ display: flex; align-items: baseline; gap: 6px; }
.checklist-score     { font-size: 28px; font-weight: 900; line-height: 1; }
.checklist-score-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.checklist-verdict   { font-size: 13px; font-weight: 800; padding: 5px 14px; border-radius: 20px; }
.checklist-ready     { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.35); color: var(--green); }
.checklist-caution   { background: rgba(234,179,8,.15); border: 1px solid rgba(234,179,8,.35); color: var(--yellow); }
.checklist-not-ready { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.3); color: var(--red); }
.checklist-items     { display: flex; flex-direction: column; gap: 2px; }
.checklist-item      { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.checklist-item:hover { background: var(--bg3); }
.checklist-item.pass { }
.checklist-item.fail { opacity: .85; }
.checklist-item.na   { opacity: .6; }
.checklist-icon      { font-size: 14px; flex-shrink: 0; padding-top: 1px; }
.checklist-text      { flex: 1; }
.checklist-label     { font-size: 13px; font-weight: 600; line-height: 1.4; }
.checklist-detail    { font-size: 11px; color: var(--muted); margin-top: 2px; }
.checklist-note      { font-size: 11px; color: var(--muted); font-style: italic; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); line-height: 1.6; }

/* ── Filter toolkit (Best Value Picks + Screener) ───────────────────────── */
.bv-hint {
  text-transform: none;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 6px;
  font-size: 11px;
}
.filter-toolkit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding-top: 6px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s, background .15s;
}
.filter-row.active {
  border-color: var(--accent);
  background: rgba(59,130,246,.06);
}
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  user-select: none;
}
.filter-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-toggle .filter-name { line-height: 1.2; }
.filter-value {
  flex-shrink: 0;
  min-width: 130px;
}
.filter-value input,
.filter-value select {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 9px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, opacity .15s;
}
.filter-value input:focus,
.filter-value select:focus { border-color: var(--accent); outline: none; }
.filter-value input:disabled,
.filter-value select:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* Shared run button (used by Best Value Picks panel) */
.screener-run-btn-shared {
  align-self: flex-start;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, transform .1s;
  white-space: nowrap;
  margin-top: 4px;
}
.screener-run-btn-shared:hover  { background: #16a34a; }
.screener-run-btn-shared:active { transform: scale(.97); }
.screener-run-btn-shared:disabled { background: var(--muted); cursor: not-allowed; }

/* ── Best Value Picks results sort bar ───────────────────────────────────── */
.bv-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.bv-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  flex-shrink: 0;
}
.bv-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.bv-sort-chip {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--muted);
  padding: 5px 12px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.bv-sort-chip:hover { color: var(--text); border-color: var(--accent); }
.bv-sort-chip.active {
  background: rgba(59,130,246,.18);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}
.bv-sort-arrow {
  font-size: 11px;
  font-weight: 700;
  min-width: 8px;
}

/* ── Discoveries ─────────────────────────────────────────────────────────── */
.discoveries-btn { /* small visual nod — gold star vibe */ }
.discoveries-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #1a1a1a;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.discoveries-status-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  padding: 14px 20px;
  margin-bottom: 18px;
}
.disc-stat-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}
.disc-stat-lbl {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.disc-stat-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.disc-scan-now-btn {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.disc-scan-now-btn:hover    { background: #2563eb; }
.disc-scan-now-btn:active   { transform: scale(.97); }
.disc-scan-now-btn:disabled { background: var(--muted); cursor: not-allowed; }

/* Inline badges on the cards */
.disc-new-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #fbbf24, #ef4444);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: .04em;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, .15);
}
.disc-confirm-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.35);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Discoveries dense table — one row per pick. Built for 100-400 rows. */
.disc-table-wrap { padding: 0; overflow-x: auto; }
.disc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.disc-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg2);
}
.disc-table th {
  padding: 10px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.disc-table th.num { text-align: right; }
.disc-table th.disc-sortable {
  cursor: pointer;
  user-select: none;
  transition: color .12s;
}
.disc-table th.disc-sortable:hover { color: var(--text); }
.disc-table th.disc-sortable.sorted { color: var(--accent); }
.disc-arrow {
  font-size: 11px;
  margin-left: 3px;
  opacity: .85;
}
.disc-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(30,45,69,.4);
  vertical-align: middle;
}
.disc-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.disc-table tbody tr {
  cursor: pointer;
  transition: background .12s;
}
.disc-table tbody tr:hover { background: rgba(59,130,246,.06); }
.disc-table tbody tr:last-child td { border-bottom: none; }

.disc-rank { color: var(--muted); font-weight: 600; font-size: 11px; width: 32px; }
.disc-flags { width: 60px; }
.disc-new-pip {
  font-size: 14px;
  margin-right: 4px;
  text-shadow: 0 0 6px rgba(251, 191, 36, .6);
}
.disc-conf-pip {
  display: inline-block;
  background: rgba(59,130,246,.15);
  border: 1px solid rgba(59,130,246,.3);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
}
.disc-sector {
  color: var(--muted);
  font-size: 12px;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.disc-since {
  color: var(--muted);
  font-size: 11px;
}
.disc-table-hint {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  border-top: 1px solid var(--border);
  background: var(--bg3);
}

/* ── Backtest ────────────────────────────────────────────────────────────── */
.backtest-badge {
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.backtest-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.backtest-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 140px;
}
.backtest-field label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}
.backtest-field input,
.backtest-field select {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}
.backtest-field input:focus,
.backtest-field select:focus { border-color: var(--accent); outline: none; }
#bt-run-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .15s, transform .1s;
  margin-left: auto;
}
#bt-run-btn:hover    { background: #2563eb; }
#bt-run-btn:active   { transform: scale(.97); }
#bt-run-btn:disabled { background: var(--muted); cursor: not-allowed; }

.bt-headline-card {
  padding: 24px;
  margin-bottom: 18px;
  text-align: center;
}
.bt-verdict {
  font-size: 15px;
  margin-bottom: 18px;
  color: var(--text);
}
.bt-verdict.pos strong { color: var(--green); }
.bt-verdict.neg strong { color: var(--red); }
.bt-headline-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.bt-headline-block { min-width: 200px; }
.bt-headline-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.bt-headline-val {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bt-headline-val.pos { color: var(--green); }
.bt-headline-val.neg { color: var(--red); }
.bt-headline-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.bt-headline-arrow {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
  padding-top: 28px;
}

.bt-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.bt-stat {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
}
.bt-stat-lbl {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  margin-bottom: 6px;
}
.bt-stat-val {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.bt-stat-val.pos { color: var(--green); }
.bt-stat-val.neg { color: var(--red); }
.bt-stat-vs {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.bt-chart-card,
.bt-perstock-card {
  padding: 18px 20px;
  margin-bottom: 18px;
}
.bt-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}
.bt-caveat {
  background: rgba(234,179,8,.08);
  border: 1px solid rgba(234,179,8,.25);
  color: var(--yellow);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.6;
}

/* Permanent "what we learned" note on the Backtest section header. */
.bt-honest-note {
  background: linear-gradient(135deg, rgba(59,130,246,.06), rgba(139,92,246,.06));
  border: 1px solid rgba(59,130,246,.25);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.7;
}
.bt-honest-note strong { color: var(--accent); }
.bt-honest-note em     { color: var(--red);    font-style: normal; font-weight: 600; }

/* ── Trade Planner ────────────────────────────────────────────────────────── */
.planner-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.planner-rules {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 10px;
  padding: 12px 18px;
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.7;
}
.planner-rules ol { margin: 6px 0 0 22px; padding: 0; }
.planner-rules li { margin: 2px 0; color: var(--muted); }
.planner-rules strong { color: var(--text); }

.planner-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 18px 20px;
  margin-bottom: 18px;
  align-items: flex-end;
}
.planner-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 0 0 auto;
}
.planner-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.planner-hint { text-transform: none; font-weight: 400; color: var(--muted); margin-left: 4px; font-size: 10px; }
.planner-field input,
.planner-field select {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  width: 130px;            /* enough for ~10 digits at this font size */
  font-variant-numeric: tabular-nums;
}
.planner-field input:focus,
.planner-field select:focus { border-color: var(--accent); outline: none; }
.planner-ticker-row { display: flex; gap: 6px; }
.planner-ticker-row input { width: 110px; text-transform: uppercase; }
#pln-lookup-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
#pln-lookup-btn:hover { background: #2563eb; }
#pln-lookup-btn:disabled { background: var(--muted); cursor: not-allowed; }

/* Plan card */
.planner-plan-card { padding: 20px; }
.planner-stock-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.planner-stock-prices {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.planner-price-block { min-width: 80px; }
.planner-price-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.planner-price-val {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.planner-price-val.pos { color: var(--green); }
.planner-price-val.neg { color: var(--red); }

.planner-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}
.planner-row {
  display: grid;
  grid-template-columns: 130px 130px 1fr;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.planner-row-pos { border-color: var(--accent); background: rgba(59,130,246,.06); }
.planner-row-kelly {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.05);
}
.planner-row-kelly .planner-row-lbl { color: rgb(168, 85, 247); }

/* Correlation warning banner — sits above the plan card when the user already
   has open plans in the same sector as the new pick. */
.planner-correlation-banner {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 3px solid var(--red);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}
.planner-correlation-banner strong { color: var(--red); }
.planner-correlation-banner code {
  background: var(--bg3);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font);
  font-weight: 700;
  color: var(--accent);
}
.planner-row-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.planner-row-val {
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.planner-row-val.pos { color: var(--green); }
.planner-row-val.neg { color: var(--red); }
.planner-row-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Thesis + triggers */
.planner-thesis-block { margin-top: 18px; }
.planner-thesis-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.planner-thesis-block textarea {
  width: 100%;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}
.planner-thesis-block textarea:focus { border-color: var(--accent); outline: none; }
.planner-triggers { display: flex; flex-direction: column; gap: 6px; }
.planner-trigger {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.planner-trigger input[type="checkbox"] {
  margin-top: 3px;
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.planner-actions { display: flex; gap: 10px; margin-top: 18px; }
.planner-save-btn,
.planner-recalc-btn {
  border: none;
  border-radius: 8px;
  padding: 11px 22px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.planner-save-btn  { background: var(--green); color: #000; }
.planner-save-btn:hover  { background: #16a34a; }
.planner-save-btn:disabled { background: var(--muted); color: #fff; cursor: not-allowed; }
.planner-recalc-btn { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }
.planner-recalc-btn:hover { color: var(--text); border-color: var(--accent); }

/* Saved plans */
.planner-saved-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 12px;
}
.planner-saved-header h3 { font-size: 16px; font-weight: 800; }
.planner-saved-card { padding: 14px 18px; margin-bottom: 10px; }
.planner-saved-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 10px;
}
.planner-saved-conv {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 9px;
  border-radius: 8px;
  background: var(--bg3);
  color: var(--muted);
}
.planner-saved-conv[data-conv="high"] { background: rgba(34,197,94,.12); color: var(--green); }
.planner-saved-conv[data-conv="med"]  { background: rgba(234,179,8,.12); color: var(--yellow); }
.planner-saved-conv[data-conv="low"]  { background: rgba(239,68,68,.08); color: var(--red); }
.planner-delete-btn {
  background: var(--bg3);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.planner-delete-btn:hover { color: var(--red); border-color: var(--red); }
.planner-saved-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  font-size: 13px;
  margin-bottom: 8px;
}
.planner-saved-metrics .lbl {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.planner-saved-thesis,
.planner-saved-triggers {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 6px;
}
.planner-saved-thesis strong,
.planner-saved-triggers strong { color: var(--text); }
.planner-trigger-chip {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 9px;
  margin: 2px 3px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* Exclude-Top-N stress test controls */
.bt-exclude-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
.bt-exclude-row input {
  width: 60px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.bt-exclude-row input:focus { border-color: var(--accent); outline: none; }
.bt-exclude-presets {
  display: flex;
  gap: 3px;
}
.bt-exclude-preset {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: all .12s;
  font-variant-numeric: tabular-nums;
}
.bt-exclude-preset:hover  { color: var(--text); border-color: var(--accent); }
.bt-exclude-preset.active {
  background: rgba(239,68,68,.15);
  border-color: var(--red);
  color: var(--red);
}

/* Banner shown above results when a stress test was run */
.bt-excluded-banner {
  background: rgba(239,68,68,.06);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.bt-excluded-label {
  font-weight: 700;
  color: var(--red);
}
.bt-excluded-chip {
  background: var(--bg3);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text);
}
.bt-excluded-chip .pos {
  color: var(--green);
  margin-left: 4px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.bt-excluded-note {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 4px;
}

/* Diversified-mode toggle (in the controls row) */
.bt-div-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
}
.bt-div-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}
.bt-div-toggle:has(input:checked) {
  background: rgba(59,130,246,.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* Diversified-mode result banner (above the headline) */
.bt-diversified-banner {
  background: rgba(59,130,246,.06);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.bt-diversified-label {
  font-weight: 700;
  color: var(--accent);
}
.bt-diversified-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — tablet & phone breakpoints
   Strategy:
   - >1100px: full desktop layout (current behavior)
   - <=1100px: header tools wrap to a second row
   - <=900px:  hide header tools, show hamburger drawer
   - <=600px:  tighter padding, stacked hero, smaller fonts
   ════════════════════════════════════════════════════════════════════════ */

/* Allow tool buttons to wrap onto multiple lines when there's no room. They
   only can if the row may shrink: with flex-shrink: 0 the toolbar kept its full
   width and ran 170px off a 1280px screen. The header grows to fit a second row. */
.header-tools { flex-wrap: wrap; flex-shrink: 1; min-width: 0; justify-content: flex-end; row-gap: 6px; }
.header-inner { height: auto; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }

/* Medium screens: shrink tool button padding so more fit before hamburger kicks in */
@media (max-width: 1100px) {
  .tool-btn { padding: 6px 10px; font-size: 11px; }
  .header-inner { gap: 14px; padding: 0 16px; }
}

/* Mobile breakpoint — hamburger menu takes over */
@media (max-width: 900px) {
  .header-inner {
    height: auto;
    min-height: 60px;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .logo { font-size: 16px; }
  .logo span { display: inline; }
  .search-wrap {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }
  .hamburger-btn { display: flex; }

  /* Tools become a slide-down drawer */
  .header-tools {
    order: 4;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 20px rgba(0,0,0,.4);
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
    z-index: 99;
  }
  .header-tools.open {
    max-height: 70vh;
    overflow-y: auto;
  }
  .tool-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    font-size: 13px;
    border-radius: 8px;
    margin: 2px 0;
  }
}

/* Small phone breakpoint — tighten paddings, stack things */
@media (max-width: 600px) {
  .page-section { padding: 16px 12px; }

  .best-value-hero-btn { font-size: 13px; padding: 12px 16px; }

  /* Stock detail hero stacks */
  .stock-hero {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .stock-hero-left { width: 100%; }
  .signal-cards {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }
  .sig-card, .val-card { flex: 1 1 calc(50% - 6px); min-width: 140px; }

  /* Tabs scroll horizontally instead of wrapping into a jumble */
  .tab-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .tab-btn { white-space: nowrap; flex-shrink: 0; }

  /* Backtest + Discoveries status bars become column on phone */
  .discoveries-status-bar,
  .backtest-controls { flex-direction: column; align-items: stretch; gap: 10px; }
  .disc-scan-now-btn,
  #bt-run-btn { margin-left: 0; width: 100%; justify-content: center; }

  /* Best Value Picks cards: stack the metrics tighter */
  .bv-card { padding: 14px; }
  .bv-card-top { flex-wrap: wrap; gap: 10px; }
  .bv-price-block { margin-left: auto; }
  .bv-metrics { grid-template-columns: repeat(2, 1fr) !important; }
  .bv-metric { font-size: 12px; }

  /* Trade Planner — one column rows, smaller font */
  .planner-row { grid-template-columns: 1fr !important; gap: 4px; padding: 10px 12px; }
  .planner-row-val { font-size: 17px; }
  .planner-row-note { font-size: 11px; }
  .planner-stock-head { flex-direction: column; align-items: stretch; }
  .planner-stock-prices { gap: 12px; }
  .planner-price-block { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .planner-inputs { padding: 14px; gap: 10px; }
  .planner-field input, .planner-field select { width: 100%; }
  .planner-ticker-row input { width: 100%; }

  /* Tables — horizontal scroll instead of overflow */
  .disc-table-wrap,
  .screener-table-wrap { -webkit-overflow-scrolling: touch; }
  .disc-table,
  .screener-table { font-size: 12px; }
  .disc-table th, .disc-table td,
  .screener-table th, .screener-table td { padding: 7px 8px; }

  /* Filter toolkit (BVP + Screener) stacks */
  .filter-toolkit { grid-template-columns: 1fr; }
  .filter-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .filter-value { min-width: 0; }
  .filter-value input, .filter-value select { width: 100%; }

  /* Compare / general grid sections */
  .compare-grid { grid-template-columns: 1fr !important; }

  /* Cards everywhere get tighter padding */
  .card { padding: 14px; }

  /* Backtest headline stacks */
  .bt-headline-row { flex-direction: column; gap: 16px; }
  .bt-headline-arrow { padding-top: 0; }
  .bt-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bt-stat { padding: 10px 12px; }
  .bt-stat-val { font-size: 17px; }
}

/* Very small screens (<400px) — only used as a last resort */
@media (max-width: 400px) {
  .bv-metrics { grid-template-columns: 1fr !important; }
  .bt-stats-grid { grid-template-columns: 1fr; }
}

/* ── Site Footer (copyright + disclaimer) ────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 22px 16px 30px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}
.site-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.site-footer-sep { opacity: .5; }
.site-footer-disclaimer {
  font-style: italic;
  color: rgba(234, 179, 8, .8);
}
@media (max-width: 600px) {
  .site-footer-inner { font-size: 11px; gap: 6px; }
}


/* ── InfoTip system — beginner-friendly explainer popovers ─────────────── */

/* The "?" button itself. Sized to sit inline with labels without throwing
   off vertical rhythm. Wide enough to be tappable on phones. */
.infotip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0;
  border: 1px solid rgba(100, 116, 139, 0.5);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  transition: all 0.15s ease;
}
.infotip-btn:hover,
.infotip-btn:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}
.infotip-btn:active {
  transform: scale(0.92);
}

/* The popover. Singleton positioned via JS, hidden when not open. */
.infotip-popover {
  position: absolute;
  z-index: 1000;
  width: 280px;
  max-width: calc(100vw - 16px);
  padding: 14px 16px 15px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(59, 130, 246, 0.08);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.infotip-popover.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.infotip-pop-title {
  margin: 0 0 6px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.infotip-pop-body {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Alpha Edge tool titles host an InfoTip — give the row a hair more space
   on the right so the popover trigger doesn't crowd the subtitle. */
.alpha-tool-title .infotip-btn {
  margin-left: 8px;
}


/* ════════════════════════════════════════════════════════════════════════
   REDESIGN (2026-10) — the exchange board
   StockIQ's look: an exchange's LED board, switched off, behind everything —
   only the dots along the logo's own rising line are lit, ending in its green
   dot (public/board.svg). IBM Plex Sans with tabular figures for the numbers.
   The tools sit in one row under the search; the front page leads with the
   ticker search. These rules come last on purpose: they override the older
   ones above without rewriting them.
   ════════════════════════════════════════════════════════════════════════ */

body { font-feature-settings: "tnum" 1; -webkit-font-smoothing: antialiased; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url(board.svg) right bottom / cover no-repeat;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Panels stay solid so data never sits on the dots. */
.site-header { background: rgba(15, 23, 41, 0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.logo span { font-weight: 700; letter-spacing: -0.01em; }

/* ── Header: search on the first row, every tool on the second ─────────── */
@media (min-width: 901px) {
  .header-inner { flex-wrap: wrap; row-gap: 0; padding-top: 10px; padding-bottom: 0; min-height: 0; }
  .search-wrap { max-width: 640px; }
  .header-tools {
    order: 3;
    flex-basis: 100%;
    margin: 10px -24px 0;
    padding: 6px 18px;
    gap: 2px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--border);
  }
  .header-tools::-webkit-scrollbar { display: none; }
  .tool-btn,
  .alpha-btn, .macro-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--muted) !important;
    padding: 7px 12px;
    font-size: 13px;
    border-radius: 8px;
  }
  .tool-btn:hover, .alpha-btn:hover, .macro-btn:hover { color: var(--text) !important; background: var(--bg3) !important; }
  .tool-btn.active, .alpha-btn.active, .macro-btn.active {
    color: var(--text) !important;
    background: rgba(76, 141, 255, 0.14) !important;
    border-color: rgba(76, 141, 255, 0.35) !important;
  }
}

/* ── Front page ────────────────────────────────────────────────────────── */
#landing { max-width: 1180px; margin: 0 auto; padding: 72px 24px 88px; text-align: left; }
.hero2 { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero2 h1 {
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: #fff;
}
.hero2-sub { margin-top: 18px; max-width: 34rem; font-size: 17px; color: var(--muted); line-height: 1.6; }
.hero2-search {
  margin-top: 30px;
  display: flex;
  gap: 8px;
  padding: 6px;
  max-width: 34rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 0 0 6px rgba(76, 141, 255, 0.06), 0 20px 40px -24px rgba(0, 0, 0, 0.8);
}
.hero2-search:focus-within { border-color: var(--accent); }
.hero2-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: none;
  padding: 10px 12px;
  color: var(--text);
  font: 600 20px var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero2-search input::placeholder { color: #5f6f88; text-transform: none; letter-spacing: 0; font-weight: 500; }
.hero2-search button {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: 600 15px var(--font);
  cursor: pointer;
}
.hero2-search button:hover { background: #3a7bf0; }
.hero2-try { margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.hero2-try span { margin-right: 4px; }
.hero2-try button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text);
  font: 600 13px var(--font);
  letter-spacing: 0.04em;
  cursor: pointer;
}
.hero2-try button:hover { border-color: var(--accent); color: #fff; }
#landing .best-value-hero-btn { margin-top: 28px; }

.hero2-panel {
  background: rgba(15, 23, 41, 0.88);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 28px 10px;
  box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.9);
}
.hero2-panel h2 { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.hero2-list { list-style: none; }
.hero2-list li { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); }
.hero2-list li:first-child { border-top: 0; }
.hero2-ico {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(76, 141, 255, 0.12);
  color: var(--accent);
}
.hero2-list strong { display: block; font-size: 15px; font-weight: 600; color: #fff; }
.hero2-list p { margin-top: 2px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }

@media (max-width: 900px) {
  /* The closed menu drawer kept its padding and border: a 17px strip under
     the search, with buttons still reachable by keyboard. Closed means gone. */
  .header-tools:not(.open) { padding-top: 0; padding-bottom: 0; border-bottom-width: 0; box-shadow: none; visibility: hidden; }
  .header-tools { transition: max-height .25s ease, visibility 0s linear .25s; }
  .header-tools.open { visibility: visible; transition: max-height .25s ease, visibility 0s; }
  #landing { padding: 40px 18px 56px; }
  .hero2 { grid-template-columns: 1fr; gap: 36px; }
  .site-header { background: var(--bg2); }
}
@media (max-width: 600px) {
  /* Phones: anchor the board left, so only the line's first rise shows, low
     on the screen, and the green dot never lands behind the headline. */
  body::before { background-position: left bottom; }
  #landing { padding: 32px 16px 48px; }
  .hero2 h1 { font-size: clamp(2rem, 9vw, 2.4rem) !important; line-height: 1.06 !important; }
  .hero2-sub { font-size: 15.5px; }
  .hero2-search input { font-size: 18px; padding: 8px 10px; }
  .hero2-search button { padding: 0 16px; }
  .hero2-panel { padding: 20px 18px 6px; }
}
@media (max-width: 360px) {
  .hero2-search button { padding: 0 12px; font-size: 14px; }
}
/* The name only gives way to the mark on the narrowest phones. */
@media (max-width: 340px) { .logo span { display: none; } }
/* Market Pulse's sector table scrolls inside its own box on phones instead
   of widening the page (it is 380px of columns). */
.macro-sector-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.macro-sector-scroll .macro-sector-table { min-width: 380px; }
/* Front page: grid items may shrink below their content, and the long
   green button wraps, so nothing pushes a 320px screen wider. */
.hero2 > * { min-width: 0; }
#landing .best-value-hero-btn { white-space: normal; max-width: 100%; text-align: left; }
/* Report grids: cards may shrink below their tables (which scroll inside). */
.analysis-grid > *, .summary-grid > *, .two-col > * { min-width: 0; }
