@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --bg: #0d1218;
  --surface: #121922;
  --surface-2: #17202b;
  --surface-3: #1e2835;
  --border: #222c39;
  --border-strong: #2f3b4c;
  --text: #e8edf5;
  --text-2: #aeb8c7;
  --muted: #7c8799;
  --accent: #4cc38a;
  --accent-ink: #06140d;
  --accent-soft: rgba(76, 195, 138, 0.12);
  --gain: #45cf8f;
  --loss: #f26b75;
  --warn: #f2b64c;
  --info: #6aa8ff;
  --violet: #a594ff;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --grid: #1f2833;
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.gain { color: var(--gain); }
.loss { color: var(--loss); }
.muted { color: var(--muted); }
.dim { color: var(--text-2); }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: #0b1016; border-right: 1px solid var(--border);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px 10px; text-decoration: none; }
/* Way back to the public equity research website (top of the sidebar, and in the phone top bar). */
.back-link {
  display: block; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; font-weight: 550; white-space: nowrap;
  color: var(--text-2); text-decoration: none; border: 1px solid var(--border); background: var(--surface-2);
}
.back-link:hover { color: var(--text); border-color: var(--border-strong); }
.topbar .back-link { margin-left: auto; padding: 5px 10px; white-space: nowrap; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #1f8f62, #2b5fb8); font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding: 0 10px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--text-2); text-decoration: none; font-weight: 500; border: 1px solid transparent;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current='page'] { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.nav-link .ico {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.nav-link[aria-current='page'] .ico { background: var(--accent-soft); border-color: rgba(76, 195, 138, 0.35); color: var(--accent); }
.nav-link.soon { opacity: 0.55; pointer-events: none; }
.nav-link .tag { margin-left: auto; font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; }
.pf-option {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; text-align: left;
  border: 1px solid transparent; background: none; color: var(--text-2); font-weight: 550; cursor: pointer;
}
.pf-option:hover { background: var(--surface-2); color: var(--text); }
.pf-option[aria-pressed='true'] { background: var(--accent-soft); border-color: rgba(76, 195, 138, 0.35); color: var(--text); }
.pf-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--muted); flex: none; }
.pf-option[aria-pressed='true'] .pf-dot { border-color: var(--accent); background: var(--accent); }
.pf-rename { align-self: flex-start; margin: 2px 0 0 10px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; }
.pf-rename:hover { color: var(--text); }
.pf-tag { display: inline-block; font-size: 10.5px; color: var(--muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 0 5px; margin-top: 3px; white-space: nowrap; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.market-pill {
  display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2);
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.open { background: var(--gain); box-shadow: 0 0 0 3px rgba(69, 207, 143, 0.18); }
.dot.closed { background: var(--warn); }

.main { min-width: 0; padding: 28px 32px 60px; }
.page { max-width: 1360px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
/* Flex children default to min-width:auto, which lets wide tables push the page sideways. */
.page > *, .grid > *, .card { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 650; letter-spacing: -0.02em; margin: 0; }
.page-sub { color: var(--muted); margin: 2px 0 0; }

.topbar { display: none; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 268px; z-index: 50; transform: translateX(-100%);
    transition: transform 0.2s ease; box-shadow: 20px 0 40px rgba(0, 0, 0, 0.4);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 40; }
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: 10px 16px; background: rgba(11, 16, 22, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  }
  .main { padding: 18px 16px 48px; }
}

/* ---------- Building blocks ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12px; color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-weight: 550; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:focus-visible, .nav-link:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .chip:focus-visible, .seg button:focus-visible {
  outline: 2px solid var(--info); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #5dd39a; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: rgba(242, 107, 117, 0.12); border-color: rgba(242, 107, 117, 0.45); color: #ffb3b9; }
.btn-danger:hover { background: rgba(242, 107, 117, 0.2); }
.btn-sm { height: 28px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-tone-blue { border-color: rgba(106, 168, 255, 0.4); color: #b7d3ff; background: rgba(106, 168, 255, 0.08); }
.btn-tone-amber { border-color: rgba(242, 182, 76, 0.4); color: #ffd99a; background: rgba(242, 182, 76, 0.08); }
.btn-tone-violet { border-color: rgba(165, 148, 255, 0.4); color: #d2c9ff; background: rgba(165, 148, 255, 0.08); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
  border: 0; background: transparent; color: var(--text-2); padding: 4px 10px; border-radius: 7px; font-size: 12px;
  font-weight: 550; cursor: pointer;
}
.seg button[aria-pressed='true'] { background: var(--surface-3); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong) inset; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 550;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); cursor: pointer;
}
.chip[aria-pressed='true'] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chip .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 0 0 2px; font-size: 14px; line-height: 1; }

.badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px;
  font-weight: 650; letter-spacing: 0.04em; border: 1px solid transparent; font-family: var(--mono);
}
.badge-buy { color: var(--gain); background: rgba(69, 207, 143, 0.1); border-color: rgba(69, 207, 143, 0.3); }
.badge-sell { color: var(--loss); background: rgba(242, 107, 117, 0.1); border-color: rgba(242, 107, 117, 0.3); }
.badge-cash { color: var(--info); background: rgba(106, 168, 255, 0.1); border-color: rgba(106, 168, 255, 0.3); }
.badge-income { color: var(--warn); background: rgba(242, 182, 76, 0.1); border-color: rgba(242, 182, 76, 0.3); }
.badge-other { color: var(--violet); background: rgba(165, 148, 255, 0.1); border-color: rgba(165, 148, 255, 0.3); }

.alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  border: 1px solid rgba(242, 182, 76, 0.35); background: rgba(242, 182, 76, 0.07); color: #f6dcab;
}
.alert.error { border-color: rgba(242, 107, 117, 0.4); background: rgba(242, 107, 117, 0.08); color: #ffc4c9; }
.alert.info { border-color: rgba(106, 168, 255, 0.35); background: rgba(106, 168, 255, 0.07); color: #cfe1ff; }
.alert b { font-weight: 650; }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12px; color: var(--text-2); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }

.hero { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(0, 2fr); gap: 0; padding: 0; overflow: hidden; }
.hero-main { padding: 22px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.hero-value { font-size: 44px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.today-box {
  border: 1px solid rgba(69, 207, 143, 0.3); background: rgba(69, 207, 143, 0.06); border-radius: 10px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 3px; align-self: flex-start;
}
.today-box.down { border-color: rgba(242, 107, 117, 0.35); background: rgba(242, 107, 117, 0.06); }
.today-box .big { font-weight: 650; font-size: 16px; font-variant-numeric: tabular-nums; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-2); }
.kv b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.periods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1250px) { .periods { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.period { padding: 18px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; display: flex; flex-direction: column; gap: 4px; }
.period .pct { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.period .bench { font-size: 12px; color: var(--muted); }
.period .note { font-size: 11.5px; color: var(--muted); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-main { border-right: 0; border-bottom: 1px solid var(--border); }
  .hero-value { font-size: 36px; }
}

.greeting { display: flex; gap: 16px; align-items: flex-start; }
.greeting .avatar {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; flex: none;
  background: var(--surface-3); border: 1px solid var(--border-strong);
}
.greeting h2 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.today-note { margin-top: 12px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 13px; }
.today-note .eyebrow { color: var(--info); margin-bottom: 4px; display: block; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 650;
  letter-spacing: 0.06em; text-transform: uppercase; text-align: right; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th.left, table.data td.left { text-align: left; }
table.data th button { all: unset; cursor: pointer; }
table.data th button:hover { color: var(--text); }
table.data th[aria-sort] button::after { content: ' ↓'; }
table.data th[aria-sort='ascending'] button::after { content: ' ↑'; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: right; vertical-align: middle; white-space: nowrap; }
table.data td.num { font-size: 13px; }
table.data tbody tr:hover > td { background: rgba(255, 255, 255, 0.015); }
table.data tfoot td { background: var(--surface-2); font-weight: 600; border-bottom: 0; }
table.data tr.sub > td { border-bottom: 1px solid var(--border); padding-top: 0; text-align: left; white-space: normal; }
table.data tr.has-sub > td { border-bottom: 0; }
.ticker { font-weight: 650; font-family: var(--mono); letter-spacing: 0.01em; }
.ticker-cell { display: flex; flex-direction: column; gap: 1px; }
.ticker-cell .name { font-size: 11.5px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.cell-sub { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.note-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 13px; color: var(--text-2); margin: 0 0 4px; }
.story { border-left: 3px solid var(--violet); background: rgba(165, 148, 255, 0.06); border-radius: 0 8px 8px 0; padding: 8px 12px; font-size: 12.5px; margin: 0 0 6px; color: var(--text-2); }
.story b { color: var(--text); }
.story .eyebrow { color: var(--violet); display: block; margin-bottom: 2px; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 16px; }

/* ---------- Bars (allocation) ---------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 64px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-row .track { display: block; height: 10px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--series-1); }
.bar-row .fill.cash { background: #56657a; }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Chart ---------- */
.chart-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.chart-stats > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.chart-box { position: relative; height: 320px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.legend .key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* ---------- Forms & modal ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; margin: max(16px, 7vh) auto auto; border: 1px solid var(--border-strong);
  border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}
dialog.modal::backdrop { background: rgba(4, 7, 10, 0.65); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 16px 16px; }
.type-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.type-tabs button {
  padding: 8px 4px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.type-tabs button[aria-pressed='true'][data-type='BUY'] { border-color: var(--gain); color: var(--gain); background: rgba(69, 207, 143, 0.1); }
.type-tabs button[aria-pressed='true'][data-type='SELL'] { border-color: var(--loss); color: var(--loss); background: rgba(242, 107, 117, 0.1); }
.type-tabs button[aria-pressed='true']:not([data-type='BUY']):not([data-type='SELL']) { border-color: var(--info); color: #cfe1ff; background: rgba(106, 168, 255, 0.1); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; position: relative; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.input, select.input, textarea.input {
  height: 38px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: #0e141b; color: var(--text);
  width: 100%;
}
textarea.input { height: auto; min-height: 70px; padding: 9px 11px; resize: vertical; }
.input::placeholder { color: #5d687a; }
.input[aria-invalid='true'] { border-color: var(--loss); }
.suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin-top: 4px; background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.suggest button {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 8px 11px; border: 0; background: none; cursor: pointer; align-items: baseline;
}
.suggest button:hover, .suggest button[aria-selected='true'] { background: var(--surface-3); }
.suggest .s-type { margin-left: auto; font-size: 11px; color: var(--muted); }
.summary-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.summary-box .row { display: flex; justify-content: space-between; gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.form-error { color: #ffb3b9; font-size: 13px; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  padding: 10px 14px; border-radius: 10px; background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 13px; max-width: 360px; animation: toast-in 0.18s ease-out;
}
.toast.ok { border-color: rgba(69, 207, 143, 0.5); }
.toast.warn { border-color: rgba(242, 182, 76, 0.5); }
.toast.error { border-color: rgba(242, 107, 117, 0.5); }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 8px; color: transparent !important; }
.skeleton::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after, .toast { animation: none; }
  .sidebar { transition: none; }
}

/* ---------- News ---------- */
.news-hero { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: center; }
.news-hero h2 { margin: 0 0 4px; font-size: 18px; }
.tone-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 82px)); gap: 8px; }
@media (max-width: 640px) { .tone-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; } .tone-tiles .l { font-size: 9.5px; } }
.tone-tiles > div { min-width: 0; text-align: center; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.tone-tiles .n { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tone-tiles .l { font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.top-stories { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.story-card {
  border: 1px solid rgba(242, 182, 76, 0.35); background: linear-gradient(180deg, rgba(242, 182, 76, 0.05), transparent 60%), var(--surface);
  border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px;
}
.story-card h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.story-card h3 a { text-decoration: none; }
.story-card h3 a:hover { text-decoration: underline; }
.story-card .meta { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; }
.tile {
  text-align: left; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; padding: 9px 10px 8px;
  cursor: pointer; display: flex; flex-direction: column; gap: 2px;
}
.tile:hover { border-color: var(--border-strong); }
.tile[aria-pressed='true'] { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn) inset; }
.tile .top { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.tile .bot { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.tile svg { width: 100%; height: 26px; display: block; }
.news-group { display: flex; flex-direction: column; gap: 0; }
.news-group-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.news-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.news-item:last-child { border-bottom: 0; }
.news-item .when { flex: none; width: 74px; font-size: 12px; color: var(--muted); font-family: var(--mono); padding-top: 2px; }
.news-item h4 { margin: 0 0 3px; font-size: 14px; font-weight: 550; line-height: 1.4; }
.news-item h4 a { text-decoration: none; }
.news-item h4 a:hover { text-decoration: underline; color: #fff; }
.news-item p { margin: 0 0 4px; font-size: 13px; color: var(--text-2); }
.news-item .src { font-size: 12px; color: var(--muted); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 18px; padding: 26px; }
.login-card h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }

/* ---------- Research pages ---------- */
.search-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.co-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.co-name { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.co-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.co-price { text-align: right; }
.co-price .p { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.kpi .k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-size: 17px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .s { font-size: 11.5px; color: var(--muted); }
.rating-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 10px 0 6px; background: var(--surface-2); }
.rating-bar span { display: block; height: 100%; }
.range { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); margin: 22px 0 8px; }
.range .mark { position: absolute; top: -6px; width: 3px; height: 20px; border-radius: 2px; transform: translateX(-50%); }
.range .lbl { position: absolute; top: -22px; transform: translateX(-50%); font-size: 11px; white-space: nowrap; color: var(--text-2); }
.est-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.est { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.est h3 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.est .line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.est .line b { font-variant-numeric: tabular-nums; }
.inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.input-wrap { position: relative; }
.input-wrap .unit { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; pointer-events: none; }
.inputs .field .hint { min-height: 15px; }
.value-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.value-hero .big { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
table.sens td { text-align: center !important; }
table.sens td.base { outline: 2px solid var(--info); outline-offset: -2px; font-weight: 700; }
table.sens th { text-align: center !important; }
.footnote { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

table.data th.est, table.data td.est { background: rgba(57, 135, 229, 0.06); }

/* ---------- Earnings calendar ---------- */
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; margin: -4px 0 12px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; border: 1.5px solid var(--accent); vertical-align: -1px; }
.cal-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cal-head { font-size: 11px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); padding: 0 4px 2px; }
.cal-day { min-height: 104px; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surface-2); min-width: 0; }
.cal-day.out { background: transparent; border-style: dashed; opacity: 0.4; }
.cal-day.gone { opacity: 0.72; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-num { display: flex; justify-content: space-between; font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.cal-num .muted { font-weight: 500; font-size: 11px; }
.cal-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-chip {
  font: 600 11px/1 var(--mono); padding: 4px 5px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2);
}
.cal-chip:hover, .cal-chip.on { color: var(--text); border-color: var(--info); }
.cal-chip.held { border-color: var(--accent); color: var(--text); }
.cal-chip.past { opacity: 0.85; }
.cal-chip.on { box-shadow: 0 0 0 1px var(--info) inset; }
.cal-more { all: unset; cursor: pointer; font-size: 11px; color: var(--info); padding: 3px 2px; }
table.data tr.sel > td { background: var(--surface-3); }
@media (max-width: 700px) { .cal-day { min-height: 70px; padding: 4px; } .cal-chip { font-size: 10px; padding: 3px; } }

/* ---------- Sector rotation ---------- */
.rrg-wrap { height: 460px; }
@media (max-width: 700px) { .rrg-wrap { height: 340px; } }
.cal-dot.followed { border-color: var(--info); }
.cal-chip.followed { border-color: var(--info); color: var(--text); }
