:root {
  color-scheme: light;
  --surface: #ffffff;
  --text: #191919;
  --text-2: #666666;
  --grid: #e7e7e7;
  --axis: #c2c2c2;
  --border: rgba(11, 11, 11, 0.10);
  --hover: rgba(11, 11, 11, 0.04);
  /* Series colours, always assigned in this order. Each page's legend says what they stand for. */
  --series-1: #257de0;
  --series-2: #f47230;
  --series-3: #00b894;
  --series-4: #f2a600;
  --series-5: #ee7fac;
  --series-6: #008a17;
  --on-series-4: #0b0b0b;
  --neutral-bar: #c2c2c2;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #191919;
    --text: #efefef;
    --text-2: #9c9c9c;
    --grid: #303030;
    --axis: #474747;
    --border: rgba(255, 255, 255, 0.10);
    --hover: rgba(255, 255, 255, 0.06);
    --series-1: #338ced;
    --series-2: #e76624;
    --series-3: #00a888;
    --series-4: #d28e05;
    --series-5: #e24d8b;
    --series-6: #0aac23;
    --on-series-4: #ffffff;
    --neutral-bar: #474747;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 980px; margin: 0 auto; padding: 32px 20px 64px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 4px; }
h3 { font-size: 15px; margin: 28px 0 8px; }
p { margin: 0 0 12px; }
a { color: inherit; }
.lede, .note { color: var(--text-2); max-width: 70ch; }
.note { font-size: 13px; }
section { padding: 28px 0; border-top: 1px solid var(--border); }

/* Site links (same rules as the other pages) */
.sitenav { display: flex; gap: 18px; margin: 0 0 20px; font-size: 14px; }
.sitenav a { color: var(--text-2); text-decoration: none; padding-bottom: 2px; }
.sitenav a:hover { color: var(--text); }
.sitenav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--text); }

/* Year filter */
.filters {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  padding: 10px 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.filters label { font-weight: 600; }
select {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--axis); border-radius: 4px; padding: 3px 6px;
}
#yearStatus { color: var(--text-2); }

/* Headline figures */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px 24px; }
.tile.hero { grid-column: 1 / -1; }
.tile .label { color: var(--text-2); font-size: 13px; }
.tile .value { font-size: 24px; font-weight: 600; line-height: 1.25; }
.tile.hero .value { font-size: 52px; line-height: 1.1; }
.tile .sub { color: var(--text-2); font-size: 13px; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tile.hero .value { font-size: 44px; } }

/* Legend */
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 8px 0; padding: 0; color: var(--text-2); font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }

/* Column chart */
.chart svg { display: block; width: 100%; }
.chart text { font-size: 12px; fill: var(--text-2); font-variant-numeric: tabular-nums; }
.chart text.on { fill: var(--text); font-weight: 600; }
/* the selected year's total can sit beside taller columns: give it a surface halo so it stays readable */
.chart text.val { stroke: var(--surface); stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: var(--hover); }
.chart .faded { opacity: 0.45; }
details { margin-top: 8px; }
summary { cursor: pointer; color: var(--text-2); font-size: 13px; }

/* One whole split into parts */
.segbar { display: flex; gap: 2px; height: 28px; margin: 12px 0 4px; }
.segbar div {
  border-radius: 4px; min-width: 2px;
  font-size: 13px; font-weight: 600; line-height: 28px; white-space: nowrap; color: #ffffff;
}
.segbar span { padding: 0 8px; }
.segbar div:focus-visible, .barcell:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--grid); vertical-align: middle; }
th { color: var(--text-2); font-size: 12px; font-weight: 500; white-space: nowrap; border-bottom-color: var(--axis); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.dim { color: var(--text-2); }
tbody tr:hover > td { background: var(--hover); }
tfoot td { font-weight: 600; border-top: 1px solid var(--axis); }
table.plain { width: auto; min-width: 320px; }
.barcell { width: 30%; min-width: 120px; }
.track { display: flex; height: 12px; }
.track span { display: block; height: 100%; border-right: 2px solid var(--surface); }
.track span:last-child { border-right: 0; border-radius: 0 4px 4px 0; }
.rowbtn {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  background: none; border: 0; padding: 0; display: flex; gap: 6px; align-items: baseline;
}
.rowbtn::before { content: "▸"; color: var(--text-2); font-size: 11px; width: 10px; flex: none; }
.rowbtn[aria-expanded="true"]::before { content: "▾"; }
tr.detail > td { padding: 4px 0 14px 16px; background: none !important; }
tr.detail table { font-size: 13px; }
tr.detail .fundline { color: var(--text-2); font-size: 13px; margin: 2px 0 6px; }
.more {
  font: inherit; color: inherit; cursor: pointer; margin-top: 10px;
  background: none; border: 1px solid var(--axis); border-radius: 4px; padding: 4px 10px;
}
@media (max-width: 640px) { .c-share, .c-chg, .c-agency { display: none; } .barcell { min-width: 70px; width: 22%; } }

/* Tooltip */
#tip {
  position: fixed; z-index: 10; pointer-events: none; max-width: 320px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--axis); border-radius: 6px; padding: 8px 10px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
#tip .t { font-weight: 600; }
#tip .s { color: var(--text-2); margin-bottom: 4px; }
#tip .r { display: flex; align-items: center; gap: 8px; }
#tip .k { width: 12px; height: 2px; flex: none; }
#tip .v { font-weight: 600; font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 16px; }
#tip .n { color: var(--text-2); }
#tip .total { border-top: 1px solid var(--grid); margin-top: 4px; padding-top: 4px; }

footer { border-top: 1px solid var(--border); padding-top: 24px; color: var(--text-2); font-size: 13px; }
footer ul { margin: 0 0 12px; padding-left: 18px; }
footer li { margin-bottom: 4px; }
