:root {
  color-scheme: light;
  --bg: #f6f5f2;
  --surface-1: #fcfcfb;
  --border: #e3e1db;
  --grid: #ebe9e4;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #7a7974;
  --accent: #2a78d6;
  --pos: #006300;
  --neg: #b42828;
  --series-1: #2a78d6; /* market cap */
  --series-2: #eb6834; /* revenue */
  --series-3: #1baf7a; /* net income */
  --series-4: #eda100; /* fcf */
  --series-5: #e87ba4; /* operating cash flow */
  --chip-off: #efeee9;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111110;
    --surface-1: #1a1a19;
    --border: #2e2e2b;
    --grid: #2a2a27;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #8f8e86;
    --accent: #3987e5;
    --pos: #3fbf5a;
    --neg: #e66767;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --chip-off: #242422;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111110; --surface-1: #1a1a19; --border: #2e2e2b; --grid: #2a2a27;
  --text-primary: #f0efec; --text-secondary: #c3c2b7; --text-muted: #8f8e86; --accent: #3987e5;
  --pos: #3fbf5a; --neg: #e66767;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181;
  --chip-off: #242422;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text-primary);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
header.top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
header.top h1 { font-size: 26px; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
.sub { color: var(--text-secondary); font-size: 14px; }
nav.funds { display: flex; gap: 6px; }
nav.funds a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; }
nav.funds a.on { background: var(--text-primary); color: var(--surface-1); border-color: var(--text-primary); }
nav.funds a:hover { text-decoration: none; }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card h2 { font-size: 17px; font-weight: 620; margin: 0 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .label { color: var(--text-secondary); font-size: 13px; }
.kpi .value { font-size: 26px; font-weight: 640; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.kpi .note { color: var(--text-muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 14px 0 10px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--text-secondary); padding: 7px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--text-primary); color: var(--surface-1); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface-1); color: var(--text-primary);
  padding: 5px 11px; border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.chip .sw { width: 12px; height: 3px; border-radius: 2px; background: var(--c); }
.chip[aria-pressed="false"] { background: var(--chip-off); color: var(--text-muted); }
.chip[aria-pressed="false"] .sw { background: var(--text-muted); opacity: .5; }
.chip.small { font-size: 12px; padding: 4px 10px; }
.chart-box { position: relative; height: 420px; }
.foot { color: var(--text-muted); font-size: 12px; margin-top: 10px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border); }
th { color: var(--text-secondary); font-weight: 560; font-size: 12.5px; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface-1); }
th:first-child, td:first-child, th.l, td.l { text-align: left; }
td .name { font-weight: 560; }
td .meta { color: var(--text-muted); font-size: 12px; }
tr:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.pos { color: var(--pos); } .neg { color: var(--neg); }
.muted { color: var(--text-muted); }
.gap { color: var(--text-muted); font-size: 12px; }
.method { color: var(--text-secondary); font-size: 13px; }
.method li { margin-bottom: 4px; }
.loading { color: var(--text-muted); padding: 40px 0; text-align: center; }
.home { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.home a.card { display: block; color: inherit; }
.home a.card:hover { text-decoration: none; border-color: var(--accent); }
@media (max-width: 640px) { .chart-box { height: 320px; } header.top h1 { font-size: 22px; } .kpi .value { font-size: 22px; } }
