/* News Sentiment Monitor -- terminal-style UI. Dark by default; light via [data-theme="light"]. */
:root {
  --bg: #0b0e13; --panel: #12161d; --panel-2: #171c24; --panel-head: #0f1319; --line: #232a35; --line-2: #2d3542;
  --text: #d9dee6; --text-2: #aab3bf; --muted: #7d8794; --accent: #3b8cff; --accent-2: #1f6fe0; --accent-bg: rgba(59, 140, 255, .14);
  --pos: #22b573; --neg: #ef4f4f; --neu: #8b95a3; --warn: #f2a93b;
  --pos-bg: rgba(34, 181, 115, .15); --neg-bg: rgba(239, 79, 79, .15); --neu-bg: rgba(139, 149, 163, .13); --warn-bg: rgba(242, 169, 59, .12);
  --grid: #171c24; --pos-fill: rgba(34, 181, 115, .26); --neg-fill: rgba(239, 79, 79, .26);
  --pos-vol: rgba(34, 181, 115, .35); --neg-vol: rgba(239, 79, 79, .35);
  --row-hover: #1a2029; --shadow: 0 1px 0 rgba(0, 0, 0, .4);
  --radius: 6px; --font: "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef1f5; --panel: #ffffff; --panel-2: #f7f9fb; --panel-head: #f3f5f8; --line: #dfe4ea; --line-2: #cfd6df;
  --text: #17202b; --text-2: #3b4654; --muted: #6a7480; --accent: #1f6fe0; --accent-2: #1557b8; --accent-bg: rgba(31, 111, 224, .1);
  --pos: #12894f; --neg: #d43a3a; --neu: #7a8490; --warn: #b8740f;
  --pos-bg: #e1f4ea; --neg-bg: #fbe5e5; --neu-bg: #eef0f3; --warn-bg: #fff4dc;
  --grid: #f0f2f5; --pos-fill: rgba(18, 137, 79, .22); --neg-fill: rgba(212, 58, 58, .22);
  --pos-vol: rgba(18, 137, 79, .3); --neg-vol: rgba(212, 58, 58, .3);
  --row-hover: #f2f6fb; --shadow: 0 1px 2px rgba(16, 24, 40, .06);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }     /* hidden wins over a class's display (form fields, alert details) */
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 13px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- app shell ---------- */
.app { display: grid; height: 100vh; grid-template: "bar bar" 48px "rail main" 1fr "status status" 26px / 60px 1fr; }
.app.bare { grid-template: "bar" 48px "main" 1fr "status" 26px / 1fr; }
.app.bare .rail { display: none; }
.appbar { grid-area: bar; display: flex; align-items: center; gap: 14px; padding: 0 14px 0 10px; background: var(--panel-head);
  border-bottom: 1px solid var(--line); min-width: 0; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo svg { width: 26px; height: 26px; flex: none; }
.logo-sub { color: var(--muted); font-weight: 500; font-size: 12px; }
.gsearch { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 0 10px; height: 32px; margin-left: 12px; position: relative; overflow: visible; }
.gsearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.gsearch svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.gsearch input { border: 0; background: transparent; outline: none; flex: 1; height: 30px; padding: 0; min-width: 0; box-shadow: none; }
.kbd { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.gsearch-menu { position: absolute; z-index: 60; top: calc(100% + 7px); left: 0; right: 0; min-width: min(560px, calc(100vw - 24px));
  max-height: min(580px, calc(100vh - 76px)); overflow-y: auto; padding: 6px; background: var(--panel); border: 1px solid var(--line-2);
  border-radius: 8px; box-shadow: 0 16px 44px rgba(0, 0, 0, .35); }
.gsearch-menu-head { padding: 5px 7px 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.gsearch-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 6px; border-top: 1px solid var(--line); }
.gsearch-result:first-of-type { border-top: 0; }
.gsearch-company { min-width: 0; display: grid; grid-template-columns: 58px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 4px 5px;
  height: auto; color: var(--text); text-align: left; background: transparent; border: 0; font-weight: 500; }
button.gsearch-company:hover { background: var(--row-hover); }
.gsearch-symbol { grid-row: span 2; color: var(--accent); font: 750 12px var(--mono); }
.gsearch-name, .gsearch-sector { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-name { font-size: 12.5px; font-weight: 650; }
.gsearch-sector { color: var(--muted); font-size: 10.5px; }
.gsearch-actions { display: flex; gap: 5px; align-items: center; }
.gsearch-action { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; height: auto; padding: 4px 8px; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.gsearch-action:hover { color: var(--text); border-color: var(--line-2); text-decoration: none; }
.gsearch-action.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.gsearch-action.lookup { color: var(--accent); }
.gsearch-lookup { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; padding: 10px 11px;
  background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 6px; }
.gsearch-empty, .gsearch-foot { margin: 0; padding: 10px; color: var(--muted); }
.gsearch-foot { padding: 8px 7px 4px; border-top: 1px solid var(--line); font-size: 10.5px; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.open .dot { background: var(--pos); box-shadow: 0 0 0 3px var(--pos-bg); }
.pill.ext .dot { background: var(--warn); }
.mono { font-family: var(--mono); }
.iconbtn { width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 6px; background: transparent; border: 1px solid transparent;
  color: var(--text-2); cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.iconbtn svg { width: 17px; height: 17px; }
.user { color: var(--muted); font-size: 12px; }

.rail { grid-area: rail; background: var(--panel-head); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  align-items: stretch; padding: 8px 6px; gap: 2px; }
.rail a, .rail button { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border-radius: 6px; height: auto;
  color: var(--muted); font-size: 10px; letter-spacing: .2px; background: none; border: 0; cursor: pointer; font-family: var(--font); font-weight: 500; }
.rail a:hover, .rail button:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.rail a.active { color: var(--text); background: var(--accent-bg); box-shadow: inset 2px 0 0 var(--accent); }
.rail svg { width: 20px; height: 20px; }
.rail .grow { flex: 1; }

main { grid-area: main; overflow: auto; padding: 12px 14px 18px; min-width: 0; }
.statusbar { grid-area: status; display: flex; align-items: center; gap: 14px; padding: 0 12px; font-size: 11.5px; color: var(--muted);
  background: var(--panel-head); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; }
.statusbar .sep { width: 1px; height: 12px; background: var(--line-2); }
.statusbar b { color: var(--text-2); font-weight: 600; }
.statusbar .ok { color: var(--pos); }
.statusbar .stale { color: var(--warn); }
.statusbar .right { margin-left: auto; }
.statusbar .bad { color: var(--neg); }
.health-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: 34px; z-index: 30; max-width: min(720px, calc(100vw - 24px));
  background: var(--neg-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--neg) 45%, transparent);
  border-radius: var(--radius); padding: 7px 12px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.health-banner b { color: var(--neg); }
.imp { letter-spacing: 1px; font-size: 10px; } .imp1 { color: var(--muted); } .imp2 { color: var(--warn); } .imp3 { color: var(--neg); }
table.cal tr.dayrow td { background: var(--panel-2); font-weight: 600; color: var(--text-2); }
table.cal tr.dayrow.today td { color: var(--accent); }
tr.past td { opacity: .92; }
.earnings-next { padding: 8px 0 12px; }
.earnings-next h3, .earnings-next p { margin: 0 0 6px; }
.earnings-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 10px 0 0; }
.earnings-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.earnings-history { border-top: 1px solid var(--line); padding-top: 10px; }
.earnings-history summary { cursor: pointer; font-weight: 600; }
.earnings-history-table { margin-top: 8px; }
.earnings-history-mobile { display: none; }
.warn { color: var(--warn); font-weight: 700; }
.hstat { font-weight: 600; text-transform: uppercase; font-size: 11px; }
.hstat.ok { color: var(--pos); } .hstat.late { color: var(--warn); } .hstat.stale { color: var(--neg); } .hstat.unknown { color: var(--muted); }

@media (max-width: 760px) {
  .app { grid-template: "bar" 48px "main" 1fr "rail" 56px / 1fr; }
  .statusbar { display: none; }
  .health-banner { bottom: 64px; }
  .rail { flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 4px; justify-content: space-around; }
  .rail .grow, .rail .rail-extra { display: none; }
  .rail a, .rail button { flex: 1; padding: 6px 0; }
  .logo-sub, .appbar .kbd, #clock, .user { display: none; }
  .gsearch { margin-left: 0; }
  .gsearch-menu { position: fixed; top: 54px; left: 8px; right: 8px; min-width: 0; }
  .gsearch-result { grid-template-columns: 1fr; }
  .gsearch-actions { padding-left: 5px; }
  main { padding: 10px; }
  .earnings-history-table { display: none; }
  .earnings-history-mobile { display: block; }
  .earnings-history-mobile details { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .earnings-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Fundamental Analysis application ---------- */
.fund-page { min-height: 100%; background: var(--bg); }
.fund-topbar { position: sticky; top: 0; z-index: 50; height: 54px; display: flex; align-items: center; gap: 15px; padding: 0 18px;
  background: color-mix(in srgb, var(--panel-head) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.fund-brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 750; white-space: nowrap; }
.fund-brand:hover { text-decoration: none; }
.fund-brand svg { width: 28px; height: 28px; flex: none; }
.fund-app-name { padding-left: 15px; border-left: 1px solid var(--line-2); color: var(--text-2); font-weight: 650; white-space: nowrap; }
.fund-search { width: min(360px, 34vw); height: 32px; display: flex; align-items: center; gap: 8px; margin-left: 8px; padding: 0 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; }
.fund-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.fund-search svg { width: 15px; color: var(--muted); flex: none; }
.fund-search input { min-width: 0; width: 100%; height: 30px; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.fund-top-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.fund-nav-link { padding: 5px 9px; color: var(--text-2); border-radius: 5px; font-size: 12px; }
.fund-nav-link:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.fund-user { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
.fund-app { min-height: calc(100vh - 54px); display: grid; grid-template-columns: 154px minmax(0, 1fr); }
.fund-side { position: sticky; top: 54px; align-self: start; height: calc(100vh - 54px); display: flex; flex-direction: column; gap: 2px; padding: 18px 10px;
  background: var(--panel-head); border-right: 1px solid var(--line); }
.fund-side a { padding: 7px 10px; border-radius: 5px; color: var(--muted); font-size: 12px; }
.fund-side a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.fund-side a.active { color: var(--text); background: var(--accent-bg); box-shadow: inset 2px 0 0 var(--accent); }
.fund-side-label { margin: 11px 10px 5px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.fund-workspace { grid-area: auto; width: min(1400px, 100%); margin: 0 auto; padding: 24px 26px 58px; overflow: visible; }
.fund-empty, .fund-loading { min-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px; }
.fund-empty-mark { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 18px; color: #06251c; background: var(--pos);
  border-radius: 13px; font-size: 22px; font-weight: 850; box-shadow: 0 10px 32px color-mix(in srgb, var(--pos) 24%, transparent); }
.fund-empty h1 { margin: 0 0 10px; font-size: clamp(28px, 5vw, 48px); letter-spacing: -.04em; }
.fund-empty > p:not(.fund-kicker) { max-width: 620px; margin: 0 0 22px; color: var(--muted); font-size: 15px; }
.fund-empty.error-state .fund-empty-mark { color: #fff; background: var(--neg); }
.fund-loader { width: 36px; height: 36px; margin-bottom: 17px; border: 3px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: fund-spin .9s linear infinite; }
.fund-loading strong { font-size: 16px; }
.fund-loading p { color: var(--muted); }
@keyframes fund-spin { to { transform: rotate(360deg); } }
.fund-kicker, .fund-eyebrow { margin: 0; color: var(--pos); font-size: 9.5px; font-weight: 850; letter-spacing: 1.2px; text-transform: uppercase; }
.fund-company-head { scroll-margin-top: 70px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding: 16px 2px 22px; }
.fund-title-row { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 8px; }
.fund-title-row h1 { margin: 0; font-size: clamp(29px, 4vw, 46px); line-height: 1.05; letter-spacing: -.04em; }
.fund-ticker { color: var(--accent); font: 750 14px var(--mono); }
.fund-market-line { display: flex; flex-wrap: wrap; gap: 11px; align-items: center; color: var(--muted); }
.fund-market-line strong { color: var(--text); font: 700 21px var(--mono); }
.fund-market-line > span + span { padding-left: 11px; border-left: 1px solid var(--line-2); }
.fund-company-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.fund-button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 12px; border-radius: 6px;
  background: var(--accent); border: 1px solid var(--accent); color: #fff; font-weight: 700; }
.fund-button:hover { background: var(--accent-2); color: #fff; text-decoration: none; }
.fund-button.secondary { background: var(--panel-2); color: var(--text-2); border-color: var(--line-2); }
.fund-readiness { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px 16px; margin-bottom: 13px; padding: 10px 13px;
  background: color-mix(in srgb, var(--pos) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--pos) 22%, var(--line)); border-radius: 7px; }
.fund-readiness > div { grid-column: 1; display: flex; flex-wrap: wrap; gap: 5px; }
.fund-readiness p { grid-column: 1; margin: 0; color: var(--text-2); font-size: 11.5px; }
.fund-readiness > span { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); font: 11px var(--mono); }
.fund-readiness.stale { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.fund-badge { display: inline-flex; align-items: center; min-height: 21px; padding: 2px 7px; border-radius: 10px; color: var(--text-2); background: var(--panel-2);
  border: 1px solid var(--line); font-size: 10px; font-weight: 700; }
.fund-badge.good { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 32%, var(--line)); }
.fund-badge.missing { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.fund-section { scroll-margin-top: 70px; margin-top: 13px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.fund-section.fund-first { margin-top: 0; }
.fund-section-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.fund-section-head h2 { margin: 3px 0 2px; color: var(--text); font-size: 18px; letter-spacing: -.01em; text-transform: none; }
.fund-section-head p:last-child { max-width: 760px; margin: 0; color: var(--muted); }
.fund-insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fund-insight { min-height: 220px; display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-radius: 7px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 4%, var(--panel-2)), var(--panel-2)); }
.fund-insight-top { display: flex; align-items: center; gap: 8px; }
.fund-insight-mark { display: grid; place-items: center; width: 27px; height: 27px; color: var(--accent); background: var(--accent-bg); border-radius: 7px; font-weight: 800; }
.fund-insight-label { color: var(--text-2); font-size: 11px; font-weight: 700; }
.fund-insight-value { display: flex; align-items: baseline; gap: 8px; margin: 19px 0 7px; font: 750 25px var(--mono); }
.fund-insight-value span { font: 650 10.5px var(--font); }
.fund-insight > p { margin: 0; color: var(--muted); }
.fund-insight-source { margin-top: auto; padding-top: 15px; color: var(--text-2); font-size: 10.5px; }
.fund-insight.cash .fund-insight-mark { color: var(--pos); background: var(--pos-bg); }
.fund-insight.balance .fund-insight-mark { color: var(--warn); background: var(--warn-bg); }
.fund-trend-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fund-trend-card { min-width: 0; padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; }
.fund-trend-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.fund-trend-title span { color: var(--text-2); font-weight: 650; }
.fund-trend-title strong { font: 750 14px var(--mono); }
.fund-spark { height: 112px; display: flex; align-items: end; gap: 7px; margin-top: 13px; padding-top: 8px; border-bottom: 1px solid var(--line-2); }
.fund-spark-col { height: 100%; flex: 1; display: flex; flex-direction: column; justify-content: end; align-items: center; gap: 4px; }
.fund-spark-bar { width: min(25px, 76%); min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .82; }
.fund-spark.green .fund-spark-bar { background: var(--pos); } .fund-spark.purple .fund-spark-bar { background: #9b7cff; }
.fund-spark.amber .fund-spark-bar { background: var(--warn); } .fund-spark-bar.negative { background: var(--neg) !important; }
.fund-spark small { color: var(--muted); font: 9px var(--mono); }
.fund-actual-label { display: block; margin-top: 8px; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; }
.fund-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.fund-table { min-width: 720px; }
.fund-table th { cursor: default; background: var(--panel-head); }
.fund-table th:hover { color: var(--muted); }
.fund-table td { padding-top: 8px; padding-bottom: 8px; background: var(--panel-2); font: 11.5px var(--mono); }
.fund-table td:first-child { color: var(--text-2); font-family: var(--font); font-weight: 600; }
.fund-table tbody tr:hover td { cursor: default; background: var(--row-hover); }
.fund-table.compact { min-width: 620px; }
.fund-table .fund-trailing-col { background: var(--accent-bg); min-width: 150px; }
.fund-table th small, .fund-table td small { display: block; margin-top: 3px; }
.fund-selected-row td { background: var(--accent-bg); }
.fund-ratio-detail { margin-top: 10px; }
.fund-ratio-detail summary { cursor: pointer; color: var(--muted); }
.fund-reactions { min-width: 1080px; }
.fund-reactions td small { display: block; margin-top: 4px; }
.fund-reactions .fund-reaction-day { background: var(--accent-bg); }
.fund-peer-direction { color: var(--accent); }
.fund-model-event { padding: 12px 14px; border-left: 3px solid var(--warn); background: var(--panel-2); }
.fund-model-event p { margin: 6px 0; }
.fund-model-results, .fund-model-inputs { display: grid; gap: 10px; margin: 12px 0; }
.fund-model-results { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.fund-model-inputs { grid-template-columns: repeat(auto-fit, minmax(179px, 1fr)); }
.fund-model-inputs label { display: grid; align-content: start; gap: 4px; }
.fund-model-inputs input { width: 100%; min-width: 0; }
.fund-model-case { display: grid; justify-items: start; align-content: start; gap: 6px; text-align: left; height: auto; min-height: 105px; padding: 12px 14px; white-space: normal; }
.fund-model-review { padding: 12px 16px; border-left: 3px solid var(--warn); background: var(--panel-2); margin: 12px 0; }
.fund-model-review li { margin: 6px 0; }
.fund-model-reference textarea { width: 100%; box-sizing: border-box; min-height: 100px; }
.fund-model-reference label { display: grid; gap: 5px; max-width: 300px; margin: 10px 0; }
.fund-model-case strong { font: bold 19px var(--mono); color: var(--text); }
.fund-model-case[aria-pressed="true"] { border-color: var(--accent); }
#model textarea { display: block; width: min(100%, 680px); margin: 8px 0; }
.fund-filing-links { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 3px 8px; margin-top: 3px; font-size: 10px; }
.fund-metric-table .fund-filing-links { justify-content: flex-start; }
.fund-metric-table { min-width: 0; margin-top: 4px; }
.fund-metric-table td:nth-child(2) { white-space: nowrap; }
.fund-chart-toolbar, .fund-comparison-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 10px; }
.fund-chart-toolbar select { min-width: 140px; }
.fund-comparison-summary > span { font-size: 12px; }
.fund-comparison-summary b { margin-left: 4px; font-family: var(--mono); }
.fund-research-plot { height: 310px; min-width: 0; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 10px; }
.fund-history-evidence { padding: 10px; background: var(--panel-2); border-radius: 6px; font-size: 12px; }
.fund-history-evidence span { display: block; margin-top: 4px; }
.fund-history-evidence .fund-filing-links { display: flex; justify-content: flex-start; }
.fund-expect-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 10px; }
.fund-next-event { padding: 16px; border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 7px; background: var(--accent-bg); }
.fund-next-event strong { display: block; margin: 12px 0 4px; font: 750 22px var(--mono); }
.fund-next-event p { margin: 0; color: var(--muted); }
.fund-missing-inline { display: grid; place-items: center; min-height: 135px; padding: 18px; color: var(--muted); text-align: center; border: 1px dashed var(--line-2); border-radius: 7px; }
.fund-section-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; align-self: flex-start; }
.fund-section-actions a, .fund-inline-link { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; font-weight: 700; }
.fund-section-actions a:hover, .fund-inline-link:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.fund-quarter-trends { margin-bottom: 16px; }
.fund-quarter-block { margin-bottom: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.fund-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 10px; }
.fund-subhead h3, .fund-reaction-head h3 { margin: 0; font-size: 14px; }
.fund-subhead p, .fund-reaction-head p { max-width: 760px; margin: 0; color: var(--muted); font-size: 11.5px; }
.fund-quarter-table { min-width: 1050px; }
.fund-quarter-table td:first-child { min-width: 112px; }
.fund-quarter-table td:first-child small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.fund-derived { color: var(--warn); cursor: help; }
.fund-filed { color: var(--pos); }
.fund-earnings-stack { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.fund-earnings-stack > *, .fund-reaction-panel { min-width: 0; }
.fund-earnings-stack > .fund-earnings-reactions { grid-column: 1 / -1; }
.fund-earnings-stack > :only-child { grid-column: 1 / -1; }
.fund-methods .fund-valuation-now { min-height: 0; }
.fund-methods .fund-valuation-now > span { font-size: 12px; line-height: 1.45; }
.fund-model-results + .fund-model-active { margin-top: 16px; }
.fund-model-active > details { margin-bottom: 10px; }
.fund-next-event { align-self: start; }
.fund-inline-link { margin-top: 14px; }
.fund-event-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 13px; }
.fund-event-bar span { display: grid; gap: 2px; color: var(--muted); font-size: 10px; }
.fund-event-bar b { color: var(--text); font: 700 13px var(--mono); }
.fund-reaction-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.fund-valuation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.fund-valuation-now, .fund-locked { min-height: 175px; padding: 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.fund-valuation-now strong { display: block; margin-top: 12px; font: 750 19px var(--mono); }
.fund-valuation-now > span { display: block; margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.fund-locked { position: relative; overflow: hidden; border-style: dashed; }
.fund-locked > span { display: inline-block; color: var(--warn); font-size: 9px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
.fund-locked h3 { margin: 28px 0 7px; }
.fund-locked p { margin: 0; color: var(--muted); }
.fund-evidence-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 12px; }
.fund-source-list { display: grid; align-content: start; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.fund-source-row { display: grid; grid-template-columns: 55px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 10px 12px; color: var(--text);
  background: var(--panel-2); border-bottom: 1px solid var(--line); }
.fund-source-row:last-child { border-bottom: 0; }
.fund-source-row:hover { background: var(--row-hover); text-decoration: none; }
.fund-source-row > span:nth-child(2) { display: grid; }
.fund-source-row small { color: var(--muted); }
.fund-source-form { color: var(--accent); font: 750 11px var(--mono); }
.fund-gap-card { padding: 16px; border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); border-radius: 7px; background: var(--warn-bg); }
.fund-gap-card h3 { margin: 7px 0 10px; }
.fund-gap-card ul { margin: 0 0 12px; padding-left: 18px; color: var(--text-2); }
.fund-gap-card p:last-child { margin: 0; color: var(--muted); }
.fund-disclaimer { padding: 18px 4px 0; color: var(--muted); font-size: 10.5px; }
.fund-coverage-workspace { width: min(1580px, 100%); }
.coverage-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 12px 2px 22px; }
.coverage-head h1 { margin: 5px 0 7px; font-size: clamp(27px, 3.5vw, 42px); letter-spacing: -.035em; }
.coverage-head > div:first-child > p:last-child { max-width: 760px; margin: 0; color: var(--muted); }
.coverage-meta { flex: none; display: grid; gap: 2px; min-width: 230px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; }
.coverage-meta span, .coverage-meta small { color: var(--muted); font-size: 10px; }
.coverage-meta span { font-weight: 800; letter-spacing: .7px; text-transform: uppercase; }
.coverage-meta strong { font: 650 12px var(--mono); }
.coverage-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 13px; }
.coverage-card { display: grid; gap: 6px; min-height: 126px; padding: 14px 15px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--line-2); border-radius: 7px; box-shadow: var(--shadow); }
.coverage-card.good { border-top-color: var(--pos); } .coverage-card.warn { border-top-color: var(--warn); }
.coverage-card span { color: var(--text-2); font-size: 11px; font-weight: 700; }
.coverage-card strong { align-self: end; font: 750 29px var(--mono); }
.coverage-card small { color: var(--muted); }
.coverage-panel { padding: 0; overflow: hidden; }
.coverage-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 13px; background: var(--panel-head); border-bottom: 1px solid var(--line); }
.coverage-toolbar label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.coverage-toolbar input { width: 230px; } .coverage-toolbar select { min-width: 145px; }
.coverage-count { margin-left: auto; padding-bottom: 7px; color: var(--muted); font: 11px var(--mono); }
.coverage-legend { display: flex; flex-wrap: wrap; gap: 13px; padding: 9px 13px; color: var(--muted); font-size: 10px; border-bottom: 1px solid var(--line); }
.coverage-legend span { display: flex; align-items: center; gap: 5px; }
.coverage-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.coverage-legend i.good { background: var(--pos); } .coverage-legend i.warn { background: var(--warn); }
.coverage-legend i.bad { background: var(--neg); } .coverage-legend i.neutral { background: var(--muted); }
.coverage-table { min-width: 1280px; }
.coverage-table th { position: sticky; top: 0; z-index: 1; }
.coverage-table td { height: 48px; background: var(--panel); }
.coverage-table td small { display: block; margin-top: 3px; color: var(--muted); font: 9px var(--font); }
.coverage-table td:first-child { font-family: var(--mono); }
.coverage-company { max-width: 235px; overflow: hidden; text-overflow: ellipsis; }
.coverage-status { display: inline-flex; min-width: 76px; justify-content: center; padding: 2px 7px; border: 1px solid var(--line); border-radius: 11px; font: 650 9.5px var(--font); }
.coverage-status.good { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 34%, var(--line)); background: var(--pos-bg); }
.coverage-status.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 38%, var(--line)); background: var(--warn-bg); }
.coverage-status.bad { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 34%, var(--line)); background: var(--neg-bg); }
.coverage-status.neutral { color: var(--muted); background: var(--panel-2); }
.coverage-issue { max-width: 310px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 10.5px var(--font) !important; }
.coverage-issue.flagged { color: var(--warn); }
.coverage-empty { height: 160px !important; text-align: center !important; color: var(--muted); }
@media (max-width: 1120px) {
  .fund-insight-grid, .fund-trend-grid, .fund-valuation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coverage-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fund-company-head { grid-template-columns: 1fr; } .fund-company-actions { justify-content: flex-start; }
  .fund-user, .fund-app-name { display: none; }
}
@media (max-width: 760px) {
  .fund-topbar { min-height: 54px; height: auto; flex-wrap: wrap; padding: 9px 10px; gap: 8px; }
  .fund-nav-link:first-child, .fund-user { display: none; }
  .fund-search { order: 3; width: 100%; margin: 0; }
  .fund-top-actions { margin-left: auto; }
  .fund-app { display: block; }
  .fund-side { top: 102px; z-index: 35; width: 100%; height: auto; flex-direction: row; overflow-x: auto; padding: 5px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .fund-side-label, .fund-side a:last-child { display: none; }
  .fund-side a { white-space: nowrap; }
  .fund-side a.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .fund-workspace { padding: 17px 10px 42px; }
  .fund-company-head { padding-top: 6px; }
  .fund-title-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .fund-market-line > span + span { padding-left: 0; border-left: 0; }
  .fund-readiness { grid-template-columns: 1fr; } .fund-readiness > span { grid-column: 1; grid-row: auto; }
  .fund-insight-grid, .fund-trend-grid, .fund-valuation-grid, .fund-evidence-grid, .fund-expect-grid, .fund-earnings-stack { grid-template-columns: 1fr; }
  .fund-insight { min-height: 190px; }
  .fund-section { padding: 14px; }
  .fund-section-head h2 { font-size: 16px; }
  .fund-section-head, .fund-subhead, .fund-reaction-head { align-items: flex-start; flex-direction: column; }
  .fund-section-actions { justify-content: flex-start; }
  .coverage-head { align-items: stretch; flex-direction: column; }
  .coverage-meta { min-width: 0; }
  .coverage-cards { grid-template-columns: 1fr 1fr; }
  .coverage-toolbar label, .coverage-toolbar input, .coverage-toolbar select { width: 100%; }
  .coverage-count { width: 100%; margin-left: 0; }
}

/* ---------- panels and building blocks ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; box-shadow: var(--shadow); padding: 12px; }
.phead { display: flex; align-items: center; gap: 10px; margin: -12px -12px 10px; padding: 7px 12px; border-bottom: 1px solid var(--line);
  background: var(--panel-head); border-radius: var(--radius) var(--radius) 0 0; min-height: 38px; flex-wrap: wrap; }
.phead h2, .ptitle { font-size: 11.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--text-2); margin: 0; }
h1 { font-size: 18px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 11.5px; margin: 0 0 8px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-2); }
h3 { font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.error { color: var(--neg); margin: 6px 0; }
.error:empty { display: none; }
.note { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); border-radius: var(--radius); padding: 8px 10px; }
.pad { padding: 12px; }
input, select, button, textarea { font: inherit; color: var(--text); }
input, select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 5px 8px; height: 30px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
input[type=checkbox] { height: auto; }
button { background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 5px; padding: 0 12px; height: 30px; cursor: pointer; font-weight: 600; }
button:hover { background: var(--accent-2); }
button.secondary { background: var(--panel-2); color: var(--text-2); border-color: var(--line); font-weight: 500; }
button.secondary:hover { color: var(--text); border-color: var(--line-2); }
button.link { background: none; border: 0; color: var(--accent); padding: 0; height: auto; font-weight: 500; }
button.active { background: var(--accent-bg); color: var(--text); border-color: var(--accent); outline: none; }
button:disabled { opacity: .5; cursor: default; }
form.stack { display: grid; gap: 12px; max-width: 380px; }
form.stack label, .field { display: grid; gap: 5px; color: var(--text-2); }
.check, form.stack label.check { display: flex; gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; align-items: center; }
.kv > span:nth-child(odd) { color: var(--muted); }
code.link { word-break: break-all; background: var(--panel-2); border: 1px solid var(--line); padding: 7px 9px; border-radius: 5px; display: block; font-family: var(--mono); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 7px 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.toolbar > strong { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-2); }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px; gap: 2px; }
.seg button { height: 26px; padding: 0 10px; border: 0; background: transparent; color: var(--text-2); font-weight: 500; border-radius: 4px; }
.seg button:hover { color: var(--text); background: var(--row-hover); }
.seg button.active { background: var(--accent); color: #fff; box-shadow: none; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); cursor: pointer; user-select: none;
  background: var(--panel); }
th:hover { color: var(--text-2); }
th.left, td.left { text-align: left; }
td.name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
tbody tr:hover td { background: var(--row-hover); cursor: pointer; }
tr.selected td { background: var(--accent-bg); font-weight: 600; }
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td a { font-weight: 600; font-family: var(--mono); font-size: 12.5px; }
.sort-asc::after { content: " \25B2"; font-size: 8px; } .sort-desc::after { content: " \25BC"; font-size: 8px; }

.chip { display: inline-block; min-width: 50px; text-align: center; border-radius: 4px; padding: 1px 6px; font: 600 12px var(--mono); }
.chip.pos { background: var(--pos-bg); color: var(--pos); }
.chip.neg { background: var(--neg-bg); color: var(--neg); }
.chip.neu { background: var(--neu-bg); color: var(--neu); }
.up { color: var(--pos); } .down { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; }
.partial { color: var(--muted); font-style: italic; }
.tag { font-size: 10.5px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; color: var(--muted); margin-left: 5px; white-space: nowrap; }
.tag.warn { color: var(--warn); border-color: var(--warn); }

/* ---------- headline stream ---------- */
.heads { list-style: none; margin: 0; padding: 0; }
.heads li { display: grid; grid-template-columns: 60px 1fr; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.heads li:last-child { border-bottom: 0; }
.heads a { color: var(--text); }
.heads a:hover { color: var(--accent); }
.heads .meta { color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.heads .sym { font: 700 12px var(--mono); margin-right: 7px; color: var(--accent); }
.opening-news-meta:not(:empty) { margin-top: 8px; }
.session-prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 6px; margin: 8px 0; }
.session-price { display: grid; gap: 3px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); }
.session-price strong { font: 700 13px var(--mono); }
.price-source { display: block; font: 9px var(--font); }

/* ---------- home dashboard ---------- */
.dash { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash > .panel { margin: 0; min-width: 0; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
@media (max-width: 1100px) { .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; } }
.vw-home { min-width: 0; }
.vw-home h1 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; letter-spacing: -.02em; }
.vw-app-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.vw-app-card { display: grid; grid-template-columns: 1fr auto; align-content: center; column-gap: 8px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.vw-app-card:hover { border-color: var(--accent); background: var(--row-hover); text-decoration: none; }
.vw-app-arrow { color: var(--accent); }
.vw-app-description { grid-column: 1 / -1; color: var(--text-2); font-size: 12px; }
.app :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.rail { overflow-y: auto; }
@media (max-width: 960px) {
  .vw-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .logo-sub { display: none; }
}
@media (max-width: 760px) {
  .rail { justify-content: flex-start; overflow-x: auto; overflow-y: hidden; }
  .rail a, .rail button, .rail .rail-extra { display: flex; flex: 0 0 auto; min-width: 54px; padding-inline: 4px; }
}
@media (max-width: 600px) {
  .app:not(.bare) { grid-template: "bar" auto "main" minmax(0, 1fr) "rail" 56px / minmax(0, 1fr); }
  .app:not(.bare) .appbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 7px 10px; }
  .app:not(.bare) .gsearch { order: 3; grid-column: 1 / -1; max-width: none; }
  .gsearch-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; }
  .appbar-right { gap: 2px; }
  .vw-app-description { display: none; }
  .vw-app-card { min-height: 44px; padding: 6px 9px; font-size: 12px; }
}
.idx { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.idx-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--panel-2); display: grid; gap: 6px; }
.idx-top { display: flex; align-items: baseline; gap: 10px; }
.idx-name { font-weight: 700; font-size: 14px; }
.idx-chg { font: 700 18px var(--mono); margin-left: auto; }
.bars { display: grid; gap: 3px; margin-top: 4px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 54px; gap: 8px; align-items: center; font-size: 11.5px; }
.bars.with-price .bar-row, .bar-head { grid-template-columns: 150px 1fr 54px 82px; }
.bar-head { display: grid; gap: 8px; margin-top: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.bar-head span:nth-child(4) { text-align: right; }
.px-pill { justify-self: end; display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 9px;
  font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; border: 1px solid transparent; }
.px-pill .px-arrow { font-size: 8px; }
.px-pill.up { color: var(--pos); background: color-mix(in srgb, var(--pos) 14%, transparent); border-color: color-mix(in srgb, var(--pos) 35%, transparent); }
.px-pill.down { color: var(--neg); background: color-mix(in srgb, var(--neg) 14%, transparent); border-color: color-mix(in srgb, var(--neg) 35%, transparent); }
.px-pill.flat { color: var(--text-2); background: color-mix(in srgb, var(--text-2) 10%, transparent); }
@media (max-width: 600px) { .bars.with-price .bar-row, .bar-head { grid-template-columns: 96px 1fr 44px 74px; gap: 6px; } }
.bar-row .lbl { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { position: relative; height: 8px; background: var(--neu-bg); border-radius: 4px; }
.bar-track .mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line-2); }
.bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.idx-card { min-width: 0; }
.with-trend.bar-head, .bars.with-trend .bar-row {
  grid-template-columns: minmax(76px, 142px) minmax(24px, 1fr) 42px 76px minmax(90px, 142px);
}
.idx-regime { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; line-height: 1.3; }
.idx-regime b { font-weight: 600; }
@media (max-width: 720px) {
  .idx { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 440px) {
  .with-trend.bar-head, .bars.with-trend .bar-row {
    grid-template-columns: minmax(68px, 1fr) minmax(12px, .45fr) 34px 62px minmax(72px, 1fr);
    gap: 4px;
  }
}
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .movers { grid-template-columns: 1fr; } }
.movers td, .movers th { padding: 4px 6px; }
.scroll { max-height: 520px; overflow-y: auto; }

/* ---------- symbol chart terminal ---------- */
.sym-input { width: 120px; font: 700 13px var(--mono); text-transform: uppercase; }
.live { color: var(--pos); font-size: 12px; white-space: nowrap; }
.live.stale { color: var(--warn); }
.live.closed { color: var(--muted); }
.terminal { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 10px; margin-bottom: 12px; }
.terminal-main { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; min-width: 0; }
.chart-wrap { position: relative; }
.terminal-chart { height: calc(100vh - 250px); min-height: 420px; width: 100%; }
.legend { position: absolute; top: 6px; left: 8px; z-index: 3; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center;
  font: 12px var(--mono); pointer-events: none; background: color-mix(in srgb, var(--panel) 82%, transparent); padding: 3px 7px; border-radius: 5px; }
.legend .lg-sym { font-weight: 700; color: var(--text); font-family: var(--font); }
.legend .tone-vol-key { color: var(--warn); }
.terminal-main > .row { padding: 6px 4px 0; }
.stories { padding: 6px 4px; min-height: 40px; }
.side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; max-height: calc(100vh - 160px); }
.side-head { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--panel-head); position: sticky; top: 0; }
.side-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 12px; border-bottom: 1px solid var(--line);
  color: var(--text); font-size: 12.5px; }
.side-row:hover { background: var(--row-hover); text-decoration: none; }
.side-row.current { box-shadow: inset 3px 0 0 var(--accent); background: var(--accent-bg); }
.side-sym { font: 700 12.5px var(--mono); }
.barinfo { min-height: 60px; }
.presets { gap: 6px; }
@media (max-width: 900px) {
  .terminal { grid-template-columns: 1fr; }
  .side { max-height: 320px; }
  .terminal-chart { height: 62vh; min-height: 360px; }
}

/* ---------- market ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; margin-bottom: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; align-content: start; box-shadow: var(--shadow); }
.card-title { font-weight: 700; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-2); }
@media (min-width: 900px) { .cards.two { grid-template-columns: minmax(280px, 1fr) minmax(320px, 2fr); } }
.heat-panel { padding: 6px; }
#heatmap { height: calc(100vh - 180px); min-height: 640px; width: 100%; }
@media (max-width: 760px) { #heatmap { height: 120vh; min-height: 520px; } }
.heat-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 8px 6px 2px; }
.lg-item { display: inline-flex; gap: 4px; align-items: center; }
.sw { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.tt { max-width: 340px; white-space: normal; line-height: 1.5; font-size: 12px; }
.tt-head { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.tt-muted { color: var(--muted); }

/* ---------- AI brief ---------- */
.brief h3 { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-2); margin: 18px 0 6px; }
.brief-overview { font-size: 15px; line-height: 1.6; color: var(--text); }
.brief-items { margin: 0; padding-left: 18px; display: grid; gap: 7px; line-height: 1.55; }
/* AI brief: good / bad news marks, each item's signal, symbols with their figures */
.brief b.good { color: var(--pos); } .brief b.bad { color: var(--neg); }
.brief-items li { padding-left: 8px; border-left: 3px solid transparent; }
.brief-items li.sig-positive { border-left-color: var(--pos); } .brief-items li.sig-negative { border-left-color: var(--neg); }
.brief-items li.sig-mixed { border-left-color: var(--warn); }
.symchip.fig { display: inline-flex; gap: 5px; white-space: nowrap; margin-top: 2px; }
.symchip.fig .tone.pos { color: var(--pos); } .symchip.fig .tone.neg { color: var(--neg); } .symchip.fig .tone.neu { color: var(--muted); }
.brief-sources { padding-left: 22px; display: grid; gap: 4px; }
.report-insights .brief-items { list-style: none; padding: 0; gap: 12px; }
.report-insights .row { flex-wrap: wrap; }
.report-subject, .report-metrics { margin-bottom: 3px; }
.report-references { margin-top: 4px; }
.report-picks { display: grid; gap: 5px; margin: 6px 0; }
.report-pick { padding-left: 9px; border-left: 1px solid var(--line-2); }
.cite { font-size: 10px; margin: 0 1px; }
.symchip { font: 600 10.5px var(--mono); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; margin-left: 3px; }
.brief-card .brief-overview { font-size: 13px; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px 12px; }
.auth { width: min(400px, 100%); }
.auth .panel { padding: 22px; }
.auth h1 { font-size: 20px; }

/* ---------- alerts ---------- */
.bell { position: relative; text-decoration: none; }
.bell:hover { text-decoration: none; }
.badge { position: absolute; top: -3px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--neg); color: #fff; font: 700 10px/16px var(--font); text-align: center; }
.rule-form { display: grid; gap: 14px; max-width: 760px; }
.rule-form input[type=number] { width: 90px; }
.rule-form details summary { cursor: pointer; color: var(--text-2); }
.rule-form details[open] summary { margin-bottom: 8px; }
.symchips { display: flex; flex-wrap: wrap; gap: 5px; }
.symchips button { height: 26px; padding: 0 9px; font: 600 12px var(--mono); }
.al-list { display: grid; }
.al-item { border-bottom: 1px solid var(--line); }
.al-item:last-child { border-bottom: 0; }
.al-head { display: flex; align-items: center; gap: 10px; padding: 8px 4px; cursor: pointer; flex-wrap: wrap; }
.al-head:hover { background: var(--row-hover); }
.al-dot { width: 7px; height: 7px; border-radius: 50%; background: transparent; flex: none; }
.al-item.unread .al-dot { background: var(--accent); }
.al-item.unread .al-sym { color: var(--text); }
.al-sym { font: 700 13px var(--mono); min-width: 52px; }
.al-body { padding: 0 6px 10px 21px; display: grid; gap: 6px; }
.al-stories .heads li { padding: 4px 2px; }
.al-price { font-size: 13px; }
.causes { margin: 2px 0 0 16px; padding: 0; }
.causes li { padding: 1px 0; }

.add-sym { width: 180px; }
/* news by type (stock page) */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-bg); }
.tag.ev { color: var(--accent); border-color: var(--accent); }
table.events td, table.events th { padding: 4px 8px; }
.pull { position: relative; display: inline-block; width: 140px; height: 8px; vertical-align: middle;
  background: linear-gradient(to right, transparent calc(50% - 0.5px), var(--line-2) calc(50% - 0.5px), var(--line-2) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.pull-bar { position: absolute; top: 0; height: 8px; border-radius: 2px; background: var(--muted); }
.pull-bar.up { background: var(--pos); }
.pull-bar.down { background: var(--neg); }
@media (max-width: 600px) { .pull { width: 70px; } }

/* market themes (Home band, Themes page, theme page) */
.theme-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.theme-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-card.pinned { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.theme-card.quiet { opacity: .75; }
.tc-top { display: flex; align-items: baseline; gap: 4px; }
.tc-title { font-size: 14px; font-weight: 650; color: var(--text); line-height: 1.3; }
.tc-title:hover { color: var(--accent); }
.tc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tc-meta .tag { margin-left: 0; }
.tag.cat { color: var(--text-2); }
.tc-idx { display: flex; gap: 10px; flex-wrap: wrap; }
.tc-ix { display: inline-flex; align-items: center; gap: 4px; }
.tc-ix .chip { min-width: 44px; }
.tc-status { margin: 0; color: var(--text-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-assets { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tc-assets .symchip { margin-left: 0; display: inline-flex; align-items: center; gap: 3px; }
.theme-driver-grid, .theme-impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 8px; }
.theme-analysis-card { min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.theme-analysis-card p { margin: 6px 0; }
.theme-impact-tag { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--bg); color: var(--text-2); }
.theme-impact-tag.positive { color: var(--pos); }
.theme-impact-tag.negative { color: var(--neg); }
.theme-impact-tag.mixed { color: var(--warn); }
.theme-driver-list { border-top: 1px solid var(--line); margin-top: 7px; padding-top: 7px; }
.theme-driver-list ul, .theme-impact-sources { margin: 4px 0 0; padding-left: 17px; font-size: 11px; }
.theme-driver-list li, .theme-impact-sources li { margin-bottom: 4px; }
.theme-driver-list h3 { margin: 4px 0 8px; }
.theme-driver-effect { margin: 3px 0; }
.timp { letter-spacing: 1px; font-size: 9px; color: var(--warn); }
.timp5 { color: var(--neg); }
.timp-off { color: var(--line-2); }
.theme-heads li { grid-template-columns: 132px 1fr; }
.tc-mini { display: flex; gap: 2px; }
.tc-mini .mini { font: 600 10.5px var(--mono); border-radius: 3px; padding: 0 3px; min-width: 38px; text-align: center; }
.tc-mini .mini.pos { background: var(--pos-bg); color: var(--pos); }
.tc-mini .mini.neg { background: var(--neg-bg); color: var(--neg); }
.tc-mini .mini.neu { background: var(--neu-bg); color: var(--neu); }
.quiet-themes summary { cursor: pointer; color: var(--text-2); margin-bottom: 8px; }
.theme-h { font-size: 14px !important; text-transform: none !important; letter-spacing: 0 !important; color: var(--text) !important; }
.theme-timeline-controls, .theme-story-picker { margin-bottom: 10px; }
.theme-series-spy { --theme-series: #469bff; }
.theme-series-qqq { --theme-series: #ab85ec; }
.theme-series-dia { --theme-series: #d49c42; }
.theme-series-controls button[aria-pressed="true"] { border-color: var(--theme-series); }
.theme-series-controls button[aria-pressed="false"] { color: var(--muted); }
.theme-plot-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.theme-plot { display: block; width: 100%; min-width: 540px; max-height: 340px; }
.theme-grid-line { stroke: var(--line); }
.theme-zero { stroke: var(--muted); stroke-dasharray: 4 3; }
.theme-tone-line { fill: none; stroke: var(--theme-series); stroke-width: 1.5; }
.theme-point { fill: var(--theme-series); }
.theme-point.low { fill: var(--panel); stroke: var(--theme-series); stroke-width: 1.4; }
.theme-point.partial { stroke: var(--theme-series); stroke-width: 2; }
.theme-volume { fill: var(--line-2); }
.theme-volume.partial { fill: var(--muted); }
.theme-date-hit { fill: transparent; cursor: pointer; }
.theme-date-hit:hover, .theme-date-hit.selected { fill: color-mix(in srgb, var(--accent) 12%, transparent); }
.tl-lbl { font: 10px var(--mono); fill: var(--text-2); }
.theme-data-table { margin: 8px 0 12px; }
.theme-data-table summary { cursor: pointer; }
.al-theme { font-weight: 650; color: var(--text); }
/* AI stock analysis (chart page) */
.ai-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-side { border-left: 3px solid var(--line-2); padding-left: 10px; min-width: 0; }
.ai-side.pos { border-color: var(--pos); } .ai-side.neg { border-color: var(--neg); }
.ai-side h3 { margin-top: 4px !important; }
@media (max-width: 760px) { .ai-sides { grid-template-columns: 1fr; } }
/* economic calendar (Calendar page) */
.econ-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.econ-range { min-width: 190px; text-align: center; }
table.econ td.num { font-family: var(--mono); font-size: 12px; }
table.econ tr.clickable { cursor: pointer; }
table.econ tr.clickable:hover td { background: var(--accent-bg); }
.econ-detail { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); padding: 10px 12px; margin: 10px 0;
  display: grid; gap: 6px; }
.econ-phases { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.econ-phase { min-width: 0; }
.econ-phase p { margin: 4px 0; line-height: 1.5; }
@media (max-width: 900px) { .econ-phases { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .theme-grid { grid-template-columns: 1fr; } .theme-heads li { grid-template-columns: 1fr; } }
/* tone versus price (Tone/price page, chart page panel) */
.tag.muted-tag { color: var(--muted); border-style: dashed; }
.findings li { padding-left: 2px; }
tr.div-row td { background: var(--warn-bg); }
.div-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 16px; align-items: start; }
.div-scatter { width: 100%; max-width: 340px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.div-scatter .axis { stroke: var(--line-2); stroke-width: 1; }
.div-scatter .fit { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
.div-scatter .pt.agree { fill: var(--pos); opacity: .55; } .div-scatter .pt.oppose { fill: var(--neg); opacity: .55; }
.div-scatter .lbl { font: 9px var(--mono); fill: var(--muted); }
@media (max-width: 760px) { .div-grid { grid-template-columns: 1fr; } }

/* news flow (busy news) */
.warn-text { color: var(--warn); }
tr.nf-stories td { background: var(--panel-2, transparent); }
