:root {
  --bg:      #0b0e17;
  --bg2:     #0f1320;
  --bg3:     #131828;
  --card:    #0f1421;
  --border:  #1a2233;
  --border2: #243040;
  --text:    #b4c8d8;
  --dim:     #6a8090;
  --mid:     #96b4c4;
  --bright:  #ddeeff;
  --gold:    #c8a84b;
  --green:   #3dd6a0;
  --red:     #f05060;
  --blue:    #4a9eff;
  --mono:    'IBM Plex Mono', monospace;
  --sans:    'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Site nav ── */
.site-nav {
  padding: 0 24px;
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 200;
}
.site-nav a {
  padding: 10px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3d526b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.site-nav a:hover { color: #94a3b8; }
.nav-brand {
  display: flex;
  align-items: center;
  color: var(--gold);
  font-size: 0.8rem;
  text-decoration: none;
  padding: 0 16px 0 0;
  margin-right: 4px;
  border-right: 1px solid var(--border);
  opacity: 0.75;
  user-select: none;
  flex-shrink: 0;
}

/* ── Ticker header ── */
.ticker-header {
  padding: 20px 24px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.ticker-header-left { display: flex; flex-direction: column; }
.ticker-search-wrap {
  position: relative;
  margin-top: 4px;
  width: 260px;
  flex-shrink: 0;
}
.ticker-search-input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 4px;
  color: var(--bright);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 12px 8px 34px;
  outline: none;
  box-sizing: border-box;
}
.ticker-search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(200,168,75,.15); }
.ticker-search-input::placeholder { color: var(--dim); }
.ticker-search-wrap::before {
  content: '⌕';
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--dim);
  font-size: 16px;
  pointer-events: none;
  line-height: 1;
}
.ticker-search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 4px;
  z-index: 200;
  overflow: hidden;
}
.ts-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.ts-item:last-child { border-bottom: none; }
.ts-item:hover, .ts-item.ts-active { background: var(--border); }
.ts-ticker { font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--gold); min-width: 52px; }
.ts-name { font-size: 12px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.light .ticker-search-input { background: #f8fafc; border-color: rgba(180,195,210,.6); color: #0f172a; }
body.light .ticker-search-dropdown { background: #f8fafc; border-color: rgba(180,195,210,.6); }
body.light .ts-item:hover, body.light .ts-item.ts-active { background: rgba(180,195,210,.25); }
.ticker-back {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.ticker-back:hover { color: var(--gold); }
.ticker-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.hdr-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
  padding: 3px;
  flex-shrink: 0;
}
.ticker-symbol {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 600;
  color: var(--bright);
  letter-spacing: 0.04em;
}
.ticker-name {
  font-size: 1rem;
  color: var(--mid);
  font-weight: 400;
}
.ticker-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ticker-price {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--bright);
}
.ticker-chg {
  font-family: var(--mono);
  font-size: 0.9rem;
}
.ticker-chg.up { color: var(--green); }
.ticker-chg.dn { color: var(--red); }
.ticker-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid var(--border2);
  color: var(--mid);
  background: var(--bg3);
}

/* ── Stock tab nav ── */
.stock-tabs {
  display: flex;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  gap: 0;
}
.stock-tabs button {
  padding: 11px 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s;
}
.stock-tabs button:hover { color: var(--mid); }
.stock-tabs button.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

/* ── Tab panels ── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Coming soon ── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 12px;
  text-align: center;
}
.coming-soon .cs-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.6;
}
.coming-soon h2 {
  font-size: 1.2rem;
  color: var(--bright);
  font-weight: 600;
}
.coming-soon p {
  font-size: 0.875rem;
  color: var(--dim);
  max-width: 360px;
  line-height: 1.7;
}

/* ─────────────────────────────────────────────
   DCF TAB STYLES
───────────────────────────────────────────── */
.dcf-page { max-width: 2200px; margin: 0 auto; padding: 24px clamp(16px, 2.5vw, 60px) 80px; }

/* Section structure */
.dcf-section { margin-bottom: 40px; }
.sec-hdr { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.sec-label { font-family: var(--mono); font-size: 11px; color: var(--mid); letter-spacing: 0.14em; text-transform: uppercase; flex-shrink: 0; }
.sec-title { font-family: var(--mono); font-size: 1rem; font-weight: 600; color: var(--bright); }
.rule { height: 1px; background: linear-gradient(90deg, var(--border2) 40px, var(--border) 40px); margin-bottom: 16px; }

/* Tables */
.tw { overflow-x: auto; border: 1px solid var(--border); border-radius: 7px; margin-bottom: 10px; }
table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
thead tr { background: var(--bg3); border-bottom: 1px solid var(--border2); }
thead th { padding: 10px 14px; text-align: right; color: var(--mid); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; font-weight: 500; }
thead th:first-child { text-align: left; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,.012); }
tbody td { padding: 9px 14px; text-align: right; color: var(--text); white-space: nowrap; }
tbody td:first-child { text-align: left; color: var(--bright); }
.rg td { background: rgba(61,214,160,.05); color: var(--green); }
.rg td:first-child { color: var(--green); }
.tnote { font-size: 12px; color: var(--mid); font-family: var(--mono); padding: 10px 14px; background: var(--bg2); border-left: 2px solid var(--border2); margin-bottom: 20px; line-height: 1.65; }

/* ── Model selector ── */
.model-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.model-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); }
.model-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.model-btn {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 7px 18px;
  border-radius: 4px;
  border: 1px solid var(--border2);
  background: var(--bg3);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.model-btn:hover { border-color: var(--gold); color: var(--bright); }
.model-btn.active { background: rgba(200,168,75,.12); border-color: var(--gold); color: var(--gold); }
.model-meta { font-family: var(--mono); font-size: 12px; color: var(--mid); display: flex; gap: 18px; flex-wrap: wrap; margin-left: auto; }
.model-meta span { color: var(--bright); }

/* ── Main DCF layout — 2×2 grid ── */
.dcf-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 32px;
  align-items: stretch;
}
@media(max-width:820px) { .dcf-main { grid-template-columns: 1fr; } }

/* ── Sliders panel ── */
.sliders-panel { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; }
.sliders-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sliders-title { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); }
.reset-btn {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s;
}
.reset-btn:hover { color: var(--gold); border-color: var(--gold); }
.slider-group { margin-bottom: 14px; }
.slider-group:last-child { margin-bottom: 0; }
.slider-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.slider-label .sv { color: var(--bright); font-weight: 600; font-size: 14px; }
input[type=range] {
  width: 100%;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 6px rgba(200,168,75,.5);
}
.slider-hints { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--mid); margin-top: 4px; }

.fair-value-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 22px 18px;
}
.fv-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--mid); margin-bottom: 8px; }
.fv-value { font-family: var(--mono); font-size: 3rem; font-weight: 600; color: var(--bright); line-height: 1; margin-bottom: 6px; }
.fv-base { font-family: var(--mono); font-size: 12px; color: var(--mid); margin-bottom: 16px; }

/* MOS gauge */
.mos-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--green) 0%, rgba(61,214,160,.3) 35%, var(--border2) 50%, rgba(240,80,96,.3) 65%, var(--red) 100%);
  position: relative;
  margin-bottom: 6px;
}
.mos-marker {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bright);
  border: 2px solid var(--bg);
  transform: translateX(-50%);
  transition: left 0.3s ease;
  box-shadow: 0 0 6px rgba(220,240,255,.3);
}
.mos-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--mid); }
.mos-verdict { font-family: var(--mono); font-size: 13px; font-weight: 600; margin-top: 10px; }
.mos-verdict.under { color: var(--green); }
.mos-verdict.over  { color: var(--red); }
.mos-verdict.fair  { color: var(--gold); }

.fv-breakdown { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.fv-row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; }
.fv-row .k { color: var(--mid); }
.fv-row .v { color: var(--text); }
.fv-row .v.hi { color: var(--gold); }

/* Reverse DCF card */
.reverse-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
}
.rev-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.rev-value { font-family: var(--mono); font-size: 1.6rem; font-weight: 600; color: var(--bright); line-height: 1; margin-bottom: 4px; }
.rev-sub { font-size: 13px; color: var(--text); line-height: 1.6; }
.rev-divider { border-top: 1px solid var(--border); margin: 14px 0; }
.rev-compare { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.rev-cmp-row { display: flex; justify-content: space-between; align-items: baseline; }
.rev-cmp-label { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.rev-cmp-val { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--bright); }
.rev-cmp-bar-wrap { height: 3px; background: var(--border); border-radius: 2px; margin-top: 3px; margin-bottom: 2px; }
.rev-cmp-bar { height: 3px; border-radius: 2px; transition: width .3s; }
.rev-verdict { font-size: 12px; font-family: var(--mono); padding: 7px 10px; border-radius: 4px; line-height: 1.5; }
.rev-verdict.bullish { background: rgba(61,214,160,.08); color: var(--green); border: 1px solid rgba(61,214,160,.2); }
.rev-verdict.neutral { background: rgba(200,168,75,.08); color: var(--gold); border: 1px solid rgba(200,168,75,.2); }
.rev-verdict.bearish { background: rgba(240,80,96,.08); color: var(--red); border: 1px solid rgba(240,80,96,.2); }

/* ── AI Insight ── */
.insight-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.insight-hdr { display: flex; align-items: center; gap: 12px; }
.insight-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.insight-refresh {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 1px solid var(--border2);
  border-radius: 3px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: auto;
}
.insight-refresh:hover { color: var(--gold); border-color: var(--gold); }
.insight-refresh:disabled { opacity: 0.4; cursor: default; }
.insight-text { font-family: var(--mono); font-size: 12.5px; color: var(--text); line-height: 1.75; }
.insight-text.loading { color: var(--dim); font-style: italic; }

/* ── Sensitivity ── */
.sens-wrap { overflow-x: auto; margin-bottom: 12px; }
.sens-table { border-collapse: separate; border-spacing: 4px; font-family: var(--mono); }
.sens-table th { font-size: 11px; letter-spacing: 0.12em; color: var(--mid); text-transform: uppercase; padding: 6px 12px; text-align: center; font-weight: 400; }
.sens-table td { padding: 9px 16px; text-align: center; border-radius: 4px; font-weight: 600; font-size: 12px; transition: transform .12s; cursor: default; white-space: nowrap; }
.sens-table td:hover { transform: scale(1.06); z-index: 2; position: relative; }
.s-lbl { color: var(--mid) !important; background: transparent !important; font-size: 11px !important; text-align: right !important; font-weight: 400 !important; padding-right: 6px !important; }
.sg3 { background: rgba(61,214,160,.22); color: #50eaa8; border: 1px solid rgba(61,214,160,.28); }
.sg2 { background: rgba(61,214,160,.14); color: #35cc88; border: 1px solid rgba(61,214,160,.2); }
.sg1 { background: rgba(61,214,160,.07); color: #28aa70; border: 1px solid rgba(61,214,160,.12); }
.sb  { background: rgba(232,184,75,.18); color: var(--gold); border: 1px solid rgba(232,184,75,.35); box-shadow: 0 0 10px rgba(232,184,75,.12); }
.sr1 { background: rgba(240,80,96,.07);  color: #cc6060; border: 1px solid rgba(240,80,96,.13); }
.sr2 { background: rgba(240,80,96,.14);  color: #c04050; border: 1px solid rgba(240,80,96,.2); }
.sr3 { background: rgba(240,80,96,.22);  color: #e03044; border: 1px solid rgba(240,80,96,.28); }
.sens-legend { display: flex; gap: 16px; font-size: 11px; font-family: var(--mono); flex-wrap: wrap; color: var(--mid); margin-top: 8px; }
.sleg { display: flex; align-items: center; gap: 5px; }
.sleg-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ── Mini bar chart ── */
.metric-chart { display: flex; align-items: flex-end; gap: 4px; height: 52px; margin-bottom: 12px; }
.mc-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; }
.mc-bar { width: 100%; border-radius: 2px 2px 0 0; background: var(--border2); transition: background .2s; min-height: 3px; }
.mc-bar.active-bar { background: var(--gold); }
.mc-yr { font-family: var(--mono); font-size: 11px; color: var(--mid); }

.disclaimer { font-size: 11px; color: var(--mid); line-height: 1.6; padding-top: 20px; border-top: 1px solid var(--border); font-family: var(--mono); }

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

/* ── Theme toggle button ── */
.theme-toggle {
  margin-left: auto;
  align-self: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1px solid var(--border2);
  border-radius: 3px;
  background: none;
  color: var(--dim);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text); }

/* ── Light mode ── */
body.light {
  --bg:      #f5f7fa;
  --bg2:     #ffffff;
  --bg3:     #edf0f5;
  --card:    #ffffff;
  --border:  #dde3ec;
  --border2: #c4cedb;
  --text:    #263d50;
  --dim:     #3e5f74;
  --mid:     #2c4a5e;
  --bright:  #0a1a28;
  --gold:    #8c6f10;
  --green:   #147a4a;
  --red:     #c62d40;
  --blue:    #1d52b8;
  --ov-label: #2c4a5e;
  --ov-value: #0a1a28;
  --ov-sec-bg: #eef1f6;
}
body.light .site-nav { background: var(--bg); }
body.light .stock-tabs { background: var(--bg); }
body.light .badge { background: var(--bg3); }
body.light .ov-sec-hdr:hover { background: #e2e8f0; }
body.light .metric-row { border-color: rgba(180,195,210,.45); }
body.light .val-ratio-item { border-color: var(--border2); }
body.light input[type=range]::-webkit-slider-thumb { border-color: var(--bg2); }
body.light .mos-marker { border-color: var(--bg2); }
body.light .range-dot  { border-color: var(--bg2); }
body.light tbody tr:hover { background: rgba(0,0,0,.018); }
body.light .sg3 { background: rgba(20,122,74,.16); color: #0e5a36; border-color: rgba(20,122,74,.22); }
body.light .sg2 { background: rgba(20,122,74,.09); color: #116040; border-color: rgba(20,122,74,.15); }
body.light .sg1 { background: rgba(20,122,74,.04); color: #145838; border-color: rgba(20,122,74,.09); }
body.light .sb  { background: rgba(140,111,16,.13); color: var(--gold); border-color: rgba(140,111,16,.28); box-shadow: 0 0 8px rgba(140,111,16,.08); }
body.light .sr1 { background: rgba(198,45,64,.05);  color: #8e1e2c; border-color: rgba(198,45,64,.1); }
body.light .sr2 { background: rgba(198,45,64,.11);  color: #7e1220; border-color: rgba(198,45,64,.17); }
body.light .sr3 { background: rgba(198,45,64,.18);  color: #6e0c18; border-color: rgba(198,45,64,.24); }

/* ─────────────────────────────────────────────
   OVERVIEW TAB
───────────────────────────────────────────── */

/* Shared readable label/value scale for overview */
:root {
  --ov-label: #8ab4cc;   /* labels — visible but subordinate */
  --ov-value: #ccdde8;   /* values — clear, high contrast */
  --ov-sec-bg: #0d1524;  /* section header bg */
}

.ov-page { max-width: 2200px; margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 60px) 80px; }

/* ── Company header ── */
.ov-company { padding: 24px 0 0; }
.ov-co-top { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.ov-co-name { font-size: 1.25rem; font-weight: 600; color: var(--bright); letter-spacing: -0.01em; }
.ov-co-meta { font-family: var(--mono); font-size: 12px; color: var(--ov-label); margin-top: 3px; line-height: 1.5; }
.ov-co-meta a { color: var(--blue); text-decoration: none; }
.ov-co-meta a:hover { text-decoration: underline; }
.ov-co-desc { font-size: 13.5px; color: var(--mid); line-height: 1.75; max-height: 3.6em; overflow: hidden; margin-top: 12px; }
.ov-co-desc.expanded { max-height: none; }
.ov-co-desc-toggle { font-family: var(--mono); font-size: 11.5px; color: var(--gold); cursor: pointer; display: inline-block; margin-top: 5px; }
.ov-co-facts { display: flex; gap: 24px; flex-wrap: wrap; margin: 12px 0 4px; font-family: var(--mono); font-size: 12px; color: var(--ov-label); }
.ov-co-facts span span { color: var(--bright); }
.ov-divider { height: 1px; background: var(--border); margin: 16px 0 10px; }

/* ── Composite Score Strip ── */
#ov-score-strip {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 10px;
  overflow: hidden;
}
.sc-overall {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 20px;
  margin-right: 20px;
  border-right: 1px solid var(--border2);
  flex-shrink: 0;
}
.sc-ring { flex-shrink: 0; }
.sc-overall-text { display: flex; flex-direction: column; gap: 2px; }
.sc-total {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.sc-grade {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sc-profile {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.sc-dims {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.sc-dim {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.sc-dim:hover { border-color: var(--border2); background: var(--bg2); }
.sc-dim-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  white-space: nowrap;
  margin-bottom: 6px;
}
.sc-dim-bar-wrap {
  height: 3px;
  background: var(--border2);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}
.sc-dim-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.sc-dim-score {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
}
.sc-dim-denom {
  font-size: 10px;
  opacity: 0.6;
  font-weight: 400;
}

/* ── Score breakdown tooltip ── */
.score-tooltip {
  position: absolute;
  z-index: 500;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 14px 16px;
  min-width: 260px;
  max-width: 320px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  pointer-events: none;
}
.stt-hdr {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.stt-row {
  display: grid;
  grid-template-columns: 1fr 80px 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.stt-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}
.stt-bar-wrap {
  height: 3px;
  background: var(--border2);
  border-radius: 2px;
  overflow: hidden;
}
.stt-bar {
  height: 100%;
  border-radius: 2px;
}
.stt-val {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-align: right;
}
.stt-na { color: var(--dim) !important; }
.stt-note {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  margin: 2px 0 6px 0;
  line-height: 1.5;
  grid-column: 1/-1;
}

/* ── Light mode overrides ── */
body.light #ov-score-strip { background: #ffffff; border-color: var(--border2); }
body.light .sc-dim { background: var(--bg3); border-color: var(--border); }
body.light .sc-dim:hover { background: #e2e8f0; }
body.light .score-tooltip { background: #ffffff; box-shadow: 0 8px 24px rgba(0,0,0,.15); }

/* ── Responsive ── */
@media (max-width: 900px) {
  #ov-score-strip { flex-direction: column; align-items: stretch; gap: 14px; }
  .sc-overall { border-right: none; border-bottom: 1px solid var(--border2); padding-right: 0; margin-right: 0; padding-bottom: 14px; margin-bottom: 0; }
  .sc-dims { flex-wrap: wrap; }
  .sc-dim { flex: 1 1 calc(33% - 6px); min-width: 80px; }
}
@media (max-width: 480px) {
  .sc-dim { flex: 1 1 calc(50% - 6px); }
}

/* ── Collapsible sections ── */
.ov-section { border: 1px solid var(--border2); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.ov-three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.ov-three-col .ov-section { margin-bottom: 0; }
@media(max-width:960px) { .ov-three-col { grid-template-columns: 1fr; } }
.ov-sec-hdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; background: var(--ov-sec-bg); cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--border2); transition: background 0.15s;
}
.ov-sec-hdr:hover { background: var(--bg3); }
.ov-section.collapsed .ov-sec-hdr { border-bottom: none; }
.ov-sec-name {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text); font-weight: 500;
}
.ov-toggle { font-size: 13px; color: var(--ov-label); transition: transform 0.2s; display: inline-block; }
.ov-section.collapsed .ov-toggle { transform: rotate(-90deg); }
.ov-sec-body { padding: 20px; }
.ov-section.collapsed .ov-sec-body { display: none; }
.ov-sec-hdr-right { display: flex; align-items: center; gap: 10px; }

/* ── Period toggles ── */
.period-toggle { display: flex; border: 1px solid var(--border2); border-radius: 4px; overflow: hidden; }
.ptog-btn { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 4px 11px; border: none; background: none; color: var(--ov-label); cursor: pointer; transition: all 0.15s; }
.ptog-btn.active { background: var(--border2); color: var(--text); }

.chart-period-bar { display: flex; gap: 5px; margin-bottom: 12px; flex-wrap: wrap; }
.period-btn { font-family: var(--mono); font-size: 12px; padding: 5px 11px; border: 1px solid var(--border2); border-radius: 3px; background: none; color: var(--ov-label); cursor: pointer; transition: all 0.15s; }
.period-btn:hover { color: var(--text); border-color: var(--text); }
.period-btn.active { background: rgba(200,168,75,.12); border-color: var(--gold); color: var(--gold); }

/* ── Metric grid ── */
.metric-grid { display: grid; grid-template-columns: repeat(3, auto); row-gap: 8px; column-gap: 24px; }
.metric-cluster-title {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
  padding-bottom: 7px; border-bottom: 1px solid var(--border2);
}
.metric-row { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 3px 0; border-bottom: 1px solid rgba(26,34,51,.8); }
.metric-row:last-child { border-bottom: none; }.ml { font-size: 12.5px; color: var(--ov-label); font-family: var(--mono); }
.mv { font-size: 13px; color: var(--ov-value); font-family: var(--mono); font-weight: 500; }
.mv.pos { color: var(--green); }
.mv.neg { color: var(--red); }
.macd-mv { display: flex; align-items: center; gap: 6px; }
.macd-badge { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; font-family: var(--mono); }
.macd-bull { background: rgba(52,211,153,.15); color: var(--green); }
.macd-bear { background: rgba(239,68,68,.12); color: var(--red); }
.macd-subs { display: flex; gap: 5px; font-size: 10px; font-family: var(--mono); }
.macd-subs .pos { color: var(--green); }
.macd-subs .neg { color: var(--red); }
.tech-badge { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 3px; font-family: var(--mono); white-space: nowrap; }
.tech-bull { background: rgba(52,211,153,.15); color: var(--green); }
.tech-bear { background: rgba(239,68,68,.12); color: var(--red); }
.tech-neut { background: rgba(148,163,184,.12); color: var(--dim); }
.tech-warn { background: rgba(251,191,36,.12); color: var(--gold); }
.fscore-9 { color: #22c55e; }
.fscore-8 { color: #4ade80; }
.fscore-7 { color: #86efac; }
.fscore-6 { color: #bef264; }
.fscore-5 { color: var(--dim); }
.fscore-4 { color: #fbbf24; }
.fscore-3 { color: #fb923c; }
.fscore-2 { color: #f87171; }
.fscore-1 { color: #ef4444; }
.fscore-0 { color: #b91c1c; }
.mv-period { font-size: 10px; color: var(--dim); margin-left: 4px; }

/* ── Chart + Key Metrics side-by-side ── */
.ov-chart-metrics-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 8px;
  margin-bottom: 8px;
  align-items: stretch;
}
.ov-chart-metrics-row .ov-section { margin-bottom: 0; display: flex; flex-direction: column; }
.ov-chart-metrics-row .ov-sec-body { padding: 10px 12px; flex: 1; }
.ov-chart-metrics-row .metric-cluster-title { margin-bottom: 6px; padding-bottom: 4px; }
@media(max-width:960px) {
  .ov-chart-metrics-row { grid-template-columns: 1fr; }
}

/* ── Valuation ratios strip ── */
.val-ratios { display: flex; flex-wrap: wrap; border: 1px solid var(--border2); border-radius: 6px; overflow: hidden; background: var(--ov-sec-bg); }
.val-ratio-item { flex: 1; min-width: 110px; padding: 16px 14px; border-right: 1px solid var(--border2); text-align: center; }
.val-ratio-item:last-child { border-right: none; }
.vr-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ov-label); margin-bottom: 7px; }
.vr-value { font-family: var(--mono); font-size: 1.2rem; font-weight: 600; color: var(--bright); }
.vr-sub { font-family: var(--mono); font-size: 11px; color: var(--mid); margin-top: 4px; }

/* ── Analyst consensus ── */
.ac-ratings-block { padding: 4px 0 8px; border-bottom: 1px solid rgba(26,34,51,.8); margin-bottom: 0; }
body.light .ac-ratings-block { border-bottom-color: rgba(180,195,210,.45); }
.ac-bar { display: flex; height: 14px; border-radius: 3px; overflow: hidden; gap: 2px; margin-bottom: 6px; }
.rb-seg { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; font-weight: 600; color: rgba(255,255,255,.9); white-space: nowrap; overflow: hidden; min-width: 0; }
.rb-sb { background: var(--green); }
.rb-b  { background: rgba(61,214,160,.5); }
.rb-h  { background: var(--border2); color: var(--text); }
.rb-s  { background: rgba(240,80,96,.5); }
.rb-ss { background: var(--red); }
.ac-counts { display: flex; gap: 10px; font-family: var(--mono); font-size: 11px; color: var(--ov-label); flex-wrap: wrap; }
.rc-item { display: flex; align-items: center; gap: 4px; }
.rc-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }

/* ── 52-week range bar ── */
.range-track { position: relative; height: 6px; background: var(--border2); border-radius: 3px; margin: 16px 0 10px; }
.range-dot { position: absolute; top: -5px; width: 16px; height: 16px; background: var(--gold); border-radius: 50%; transform: translateX(-50%); border: 2px solid var(--bg); box-shadow: 0 0 8px rgba(200,168,75,.5); }
.range-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--ov-label); }

/* ── Two-column layout ── */
.ov-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media(max-width:600px) { .ov-two-col { grid-template-columns: 1fr; } }

/* ── Financial charts ── */
.fin-charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media(max-width:700px) { .fin-charts-grid { grid-template-columns: 1fr; } }
.fin-chart-wrap { background: var(--ov-sec-bg); border: 1px solid var(--border2); border-radius: 7px; padding: 14px; min-width: 0; }
.fin-chart-lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ov-label); margin-bottom: 8px; }
.fin-chart-el { height: 230px; }

/* ── Mobile: compress header/tabs/fonts ── */
@media (max-width: 600px) {
  .ticker-header { padding: 14px 14px 0; flex-wrap: wrap; gap: 10px; }
  .ticker-search-wrap { width: 100%; margin-top: 8px; }

  .site-nav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 8px; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { padding: 8px 12px; font-size: 0.7rem; white-space: nowrap; }

  .stock-tabs { padding: 0 8px; overflow-x: auto; }
  .stock-tabs button { padding: 10px 12px; font-size: 0.7rem; letter-spacing: 0.03em; white-space: nowrap; }

  .ticker-symbol { font-size: 1.5rem; }
  .ticker-price  { font-size: 1.2rem; }

  .ov-co-facts { gap: 12px; }
  .sc-total { font-size: 1.5rem; }

  /* Key metrics: 2 columns on mobile instead of 3 */
  .metric-grid { grid-template-columns: repeat(2, 1fr); column-gap: 16px; }

  /* Valuation table: narrower padding on mobile */
  .cmp-page { padding: 16px 12px 60px; }

  /* Tables: force explicit pixel widths so fixed layout computes correctly,
     and force scroll containers to always be scrollable */
  .cmp-section { overflow-x: scroll; -webkit-overflow-scrolling: touch; }
  .cmp-table { width: 780px; table-layout: auto; }

  .ins-table-wrap { overflow-x: scroll; -webkit-overflow-scrolling: touch; }
  .ins-table { width: 720px; }

  /* Financial statement: narrower sticky label column */
  .fin-col-label { min-width: 160px; max-width: 160px; }
  .fin-year-hdr { min-width: 72px; }

  /* DCF sensitivity: tighter cell padding */
  .sens-table td { padding: 7px 10px; font-size: 11px; }
  .sens-table th { padding: 4px 10px; }

  /* Buttons: larger touch targets */
  .reset-btn { padding: 8px 14px; }
  .insight-refresh { padding: 8px 14px; }
  .fin-period-toggle button { padding: 8px 14px; }
  .fin-stmt-btn { padding: 8px 14px; }

  /* Tooltip: don't clip on narrow screens */
  .tip-popover { max-width: calc(100vw - 24px); }
}

/* ─────────────────────────────────────────────
   COMPARATIVE / VALUATION TAB
───────────────────────────────────────────── */
.cmp-page { max-width: 2200px; margin: 0 auto; padding: 28px clamp(16px, 2.5vw, 60px) 80px; }

/* Score summary cards */
.cmp-scores { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 32px; }
@media(max-width:700px){ .cmp-scores { grid-template-columns: repeat(2,1fr); } }
.cmp-score-card {
  background: var(--card); border: 1px solid var(--border2);
  border-radius: 8px; padding: 18px 20px;
}
.csc-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 10px; }
.csc-score { font-family: var(--mono); font-size: 2.2rem; font-weight: 600; line-height: 1; margin-bottom: 2px; }
.csc-denom { font-size: 1rem; color: var(--dim); font-weight: 400; }
.csc-bar { height: 4px; border-radius: 2px; background: var(--border2); margin: 10px 0 6px; overflow: hidden; }
.csc-fill { height: 100%; border-radius: 2px; transition: width .4s ease; }
.csc-verdict { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.score-red    { color: var(--red); }
.score-yellow { color: var(--gold); }
.score-green  { color: var(--green); }
.fill-red    { background: var(--red); }
.fill-yellow { background: var(--gold); }
.fill-green  { background: var(--green); }

/* Category sections */
.cmp-section { margin-bottom: 28px; overflow-x: auto; }
.cmp-sec-hdr {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border2); margin-bottom: 0;
}
.cmp-sec-name { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); font-weight: 600; }
.cmp-sec-badge { font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 3px; border: 1px solid; }

/* Metric table */
.cmp-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cmp-table tr { border-bottom: 1px solid var(--border); }
.cmp-table tr:last-child { border-bottom: none; }
.cmp-table tr:hover td { background: rgba(255,255,255,.018); }
body.light .cmp-table tr:hover td { background: rgba(0,0,0,.015); }
.cmp-table td { padding: 11px 10px; vertical-align: middle; }

/* Col widths */
.ct-label { width: 20%; font-family: var(--mono); font-size: 12.5px; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-val   { width: 10%; font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--bright); text-align: right; padding-right: 16px; white-space: nowrap; }
.ct-spark { width: 11%; text-align: center; }
.ct-ann   { font-family: var(--mono); font-size: 11px; color: var(--dim); white-space: nowrap; padding-left: 10px; }

/* Dual comparison bars (GuruFocus style) */
.ct-bar-ind, .ct-bar-hist { width: 14%; text-align: center; }
.cbar-wrap { display: flex; flex-direction: column; gap: 0; padding: 2px 4px; }
.cbar-track { position: relative; height: 7px; border-radius: 3px;
  background: rgba(255,255,255,.08); overflow: visible; }
body.light .cbar-track { background: rgba(0,0,0,.09); }
.cbar-fill { height: 100%; border-radius: 3px; }
.cbar-tick { position: absolute; top: -3px; width: 2.5px; height: 13px;
  background: #fff; border-radius: 1px; transform: translateX(-50%); z-index: 3;
  box-shadow: 0 0 4px rgba(0,0,0,.55); }
body.light .cbar-tick { background: #1a2d3e; }
body.light .fscore-9 { color: #0d7a3e; }
body.light .fscore-8 { color: #178a47; }
body.light .fscore-7 { color: #2a7a3a; }
body.light .fscore-6 { color: #4e7a1a; }
body.light .fscore-4 { color: #8c6f10; }
body.light .fscore-3 { color: #b05810; }
body.light .fscore-2 { color: #b83030; }
body.light .fscore-1 { color: #c62d40; }
body.light .fscore-0 { color: #8b1818; }

/* Percentile badge */
.pct-badge { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 3px; }
.pct-hi  { background: rgba(61,214,160,.15); color: var(--green); }
.pct-mid { background: rgba(200,168,75,.13); color: var(--gold); }
.pct-lo  { background: rgba(240,80,96,.13);  color: var(--red); }
body.light .pct-hi  { background: rgba(20,122,74,.12); }
body.light .pct-mid { background: rgba(140,111,16,.12); }
body.light .pct-lo  { background: rgba(198,45,64,.1); }

/* Column header sub-label */
.ct-th-sub { font-size: 9px; letter-spacing: 0.04em; text-transform: none; font-weight: 400; color: var(--dim); margin-top: 3px; opacity: 0.7; }

/* Percentile label under bar */
.cbar-label { font-family: var(--mono); font-size: 9.5px; font-weight: 600; margin-top: 3px; text-align: center; }

/* vs Median column */
.ct-vsmed { width: 17%; padding-left: 0; text-align: right; white-space: nowrap; vertical-align: middle; }
.ct-vsmed-val { font-family: var(--mono); font-size: 11px; color: var(--dim); display: block; margin-bottom: 2px; }
.ct-vsmed-delta { font-family: var(--mono); font-size: 11px; font-weight: 600; }

/* 10yr Range column */
.ct-histrange { width: 14%; white-space: nowrap; padding-left: 0; text-align: right; font-family: var(--mono); font-size: 11px; color: var(--dim); vertical-align: middle; }
.ct-range-lbl { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; margin-right: 4px; opacity: 0.6; }

/* Inline sparkline */
.spark-svg { display: inline-block; }

/* Sector label */
.cmp-sector-tag { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 24px; }
.cmp-sector-tag span { color: var(--text); }

/* ── 30-Year Financials ── */
.fin-page { display: flex; flex-direction: column; height: 100%; }
.fin-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px 0; flex-shrink: 0;
}
.fin-period-toggle { display: flex; border: 1px solid var(--border2); border-radius: 4px; overflow: hidden; }
.fin-period-toggle button {
  font-family: var(--mono); font-size: 11.5px; padding: 5px 14px;
  background: none; border: none; color: var(--dim); cursor: pointer;
}
.fin-period-toggle button.active { background: rgba(200,168,75,.12); color: var(--gold); }
.fin-stmt-toggle { display: flex; gap: 4px; }
.fin-stmt-btn {
  font-family: var(--mono); font-size: 11.5px; padding: 5px 14px;
  background: none; border: 1px solid var(--border2); border-radius: 4px;
  color: var(--dim); cursor: pointer; transition: all 0.15s;
}
.fin-stmt-btn:hover { color: var(--text); border-color: var(--text); }
.fin-stmt-btn.active { background: rgba(74,158,255,.1); border-color: var(--blue); color: var(--blue); }
body.light .fin-stmt-btn.active { background: rgba(29,82,184,.08); border-color: var(--blue); color: var(--blue); }
.fin-currency { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-left: auto; }

/* Scroll container */
.fin-scroll-outer {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
  margin-top: 12px;
}
.fin-scroll {
  overflow-x: auto; overflow-y: auto;
  flex: 1;
  padding-bottom: 40px;
}

/* The financials table */
.fin-table {
  border-collapse: collapse;
  min-width: max-content;
  font-family: var(--mono);
  font-size: 13px;
}
.fin-table th, .fin-table td { padding: 0; white-space: nowrap; }

/* Sticky label column — fixed height enforces uniform rows */
.fin-col-label {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg);
  min-width: 260px; max-width: 260px;
  border-right: 1px solid var(--border2);
  height: 44px; overflow: hidden;
  vertical-align: middle;
}
body.light .fin-col-label { background: var(--bg2); }

/* Year header row */
.fin-year-hdr {
  text-align: right; padding: 10px 14px 10px 4px;
  font-size: 11.5px; color: var(--dim);
  border-bottom: 1px solid var(--border2);
  min-width: 92px;
  position: sticky; top: 0; z-index: 1;
  background: var(--bg);
}
body.light .fin-year-hdr { background: var(--bg2); }
.fin-year-hdr.recent { color: var(--bright); font-weight: 600; }

/*
  Hierarchy — font sizes descend: L0(13.5px) > L1(12.5px) > L2(12px)
  All rows: fixed 36px height via overflow:hidden on cells
  L0: collapsible section header  L1: collapsible category header
*/

/* L0 — Section header: largest, ALL CAPS, gold stripe */
.fl0 {
  font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 700; color: var(--gold);
  padding: 0 12px 0 10px;
  border-left: 2px solid var(--gold);
  cursor: pointer; user-select: none;
}
body.light .fl0 { color: #1e3a8a; border-left-color: #1e3a8a; }

/* L1 — Category header: bold, indented */
.fl1 {
  font-size: 12.5px; font-weight: 700; color: var(--bright);
  padding: 0 12px 0 30px;
  cursor: pointer; user-select: none;
}

/* L2 — Line item: regular weight, most indented */
.fl2 {
  font-size: 12px; color: var(--text);
  padding: 0 12px 0 48px;
}

/* T0 — Section total: bold, matches L0 indent */
.ft0 {
  font-size: 13px; font-weight: 700; color: var(--bright);
  padding: 0 12px 0 16px;
  border-top: 1px solid var(--border2);
}

/* T1 — Category total: semi-bold, matches L1 indent */
.ft1 {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  padding: 0 12px 0 30px;
  border-top: 1px solid rgba(255,255,255,.08);
}
body.light .ft1 { border-top-color: rgba(0,0,0,.1); }

/* Collapse caret */
.fin-caret {
  display: inline-block; width: 14px;
  font-size: 8px; color: var(--dim);
  vertical-align: middle;
  transition: opacity .15s;
}
[data-group]:hover .fin-caret { opacity: 1; }

/* Spacer row */
.fin-lbl-spacer { height: 10px; }

/* Value cells — fixed height accommodates main value + up to two ctx lines */
.fin-val {
  text-align: right;
  padding: 5px 14px 0 4px;
  color: var(--text);
  vertical-align: top;
  min-width: 92px;
  height: 44px; overflow: hidden;
}
.fin-val.vt0 { color: var(--bright); font-weight: 700;
  border-top: 1px solid var(--border2); }
.fin-val.vt1 { color: var(--text); font-weight: 600;
  border-top: 1px solid rgba(255,255,255,.08); }
body.light .fin-val.vt1 { border-top-color: rgba(0,0,0,.1); }
.fin-val.vl0 { border: none; }
.fin-val.spacer { border: none; padding: 0; height: 10px; }
.fin-val.neg { color: var(--red) !important; }
.fin-val.pos { color: var(--green) !important; }

/* Context annotation — stacks below main value, clipped by fixed cell height */
.fin-ctx {
  display: block;
  font-size: 9.5px; color: var(--dim);
  margin-top: 2px; line-height: 1.2;
  white-space: nowrap;
}
.fin-ctx.up { color: var(--green); }

/* ── Insider overview aggregate table ── */
.ia-table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 11.5px; }
.ia-table thead tr, .ia-table thead th { background: transparent; }
.ia-hdr1 th { font-size: 10px; font-weight: 500; color: var(--dim); padding: 0 0 1px; text-align: center; }
.ia-hdr1 th.ia-mo { text-align: left; }
.ia-grp-hdr { color: var(--dim); }
.ia-hdr2 th { font-size: 10.5px; font-weight: 500; color: var(--dim); padding: 0 0 5px; text-align: center; border-bottom: 1px solid rgba(26,34,51,.8); }
.ia-hdr2 th.ia-mo { text-align: left; }
.ia-buy-hdr, .ia-sell-hdr { color: var(--dim); }
.ia-table tbody tr { border-bottom: 1px solid rgba(26,34,51,.5); }
.ia-table tbody tr:last-child { border-bottom: none; }
.ia-table td { padding: 3px 0; vertical-align: middle; }
.ia-table tfoot tr.ia-totals td { border-top: 1px solid rgba(26,34,51,.8); padding-top: 5px; font-weight: 600; }
.ia-mo  { width: 32%; color: var(--dim); }
.ia-num { width: 17%; text-align: center; }
.dim-val { color: var(--dim); }
body.light .ia-hdr2 th { border-color: rgba(180,195,210,.8); }
body.light .ia-table tbody tr { border-color: rgba(180,195,210,.45); }
body.light .ia-table tfoot tr.ia-totals td { border-color: rgba(180,195,210,.8); }

/* ── Insiders tab ── */
.ins-page    { padding: 20px 24px 60px; max-width: 1100px; }
.ins-loading { padding: 40px 24px; font-family: var(--mono); font-size: 13px; color: var(--dim); }
.ins-section { margin-bottom: 40px; }
.ins-sec-hdr { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border2); flex-wrap: wrap; }
.ins-sec-title { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--text); }
.ins-sec-meta  { font-family: var(--mono); font-size: 12px; display: flex; gap: 6px; align-items: baseline; }
.ins-sep       { color: var(--dim); }
.ins-congress-note { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-bottom: 10px; }
.ins-empty     { font-family: var(--mono); font-size: 12px; color: var(--dim); padding: 8px 0; }
.ins-table-wrap { overflow-x: auto; }
.ins-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--mono); font-size: 12px; }
.ins-table thead th { color: var(--dim); font-weight: 500; text-align: right; padding: 0 10px 8px; border-bottom: 1px solid var(--border2); }
.ins-table thead th:first-child { text-align: left; }
.ins-table tbody tr { border-bottom: 1px solid rgba(26,34,51,.6); }
.ins-table tbody tr:last-child { border-bottom: none; }
.ins-table tbody tr:hover { background: rgba(255,255,255,.02); }
.ins-table td { padding: 5px 10px; color: var(--ov-value); text-align: right; vertical-align: middle; overflow: hidden; }
.ins-td-date   { color: var(--dim) !important; white-space: nowrap; text-align: left; text-overflow: ellipsis; }
.ins-td-report { color: var(--dim) !important; white-space: nowrap; text-overflow: ellipsis; }
.ins-td-name   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-td-title  { color: var(--dim) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: default; }
.ins-td-code   { font-weight: 600; }
.ins-td-shares { text-align: right; }
.ins-td-price  { text-align: right; }
.ins-td-value  { text-align: right; }
.ins-td-value a { color: inherit; text-decoration: none; }
.ins-td-value a[href]:hover { color: var(--blue); text-decoration: underline; }
.ins-table thead th.ins-th-r { text-align: right; }
body.light .ins-table tbody tr { border-color: rgba(180,195,210,.45); }
body.light .ins-table tbody tr:hover { background: rgba(0,0,0,.02); }

/* ── Metric label tooltips ── */
.ml[data-tip] {
  cursor: help;
  border-bottom: 1px dotted var(--border2);
}
.ml[data-tip]:hover { color: var(--mid); }
.ml[data-metric] {
  cursor: pointer;
  border-bottom: 1px solid var(--border2);
}
.ml[data-metric]:hover { color: var(--gold); }

.tip-popover {
  position: fixed;
  z-index: 9999;
  max-width: 320px;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.55);
  pointer-events: none;
}
.tip-title {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--bright);
  margin-bottom: 6px;
}
.tip-body {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  line-height: 1.55;
}
body.light .tip-popover {
  background: #ffffff;
  border-color: #dde3ec;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
body.light .tip-title { color: #0a1a28; }
body.light .tip-body  { color: #3e5f74; }
.fin-ctx.dn { color: var(--red); }

/* ── Mobile table scroll (must come last to win the cascade) ── */
@media (max-width: 768px) {
  .ins-table-wrap { overflow-x: scroll; -webkit-overflow-scrolling: touch; }
  .ins-table { width: 720px !important; }
  .cmp-section { overflow-x: scroll; -webkit-overflow-scrolling: touch; }
  .cmp-table { width: 780px !important; table-layout: auto !important; }
}
