/* What's in my super? Tokens first; every colour below is a role, swapped whole for dark mode. */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --ink: #0e1a2b;
  --ink-2: #33415a;
  --muted: #5d6a7d;
  --line: #e1e6ed;
  --line-2: #eef1f5;
  --navy: #0f2238;
  --navy-2: #173352;
  --on-navy: #eef3f9;
  --on-navy-muted: #a9b8cb;
  --accent: #0b7563;          /* links, 5.3:1 on white */
  --accent-soft: #e2f3ee;
  --gold: #8a6212;            /* eyebrow labels, 5.4:1 on white */
  --gold-bright: #e0b04a;     /* on navy */
  --up: #12733f;
  --up-soft: #e3f4ea;
  --down: #b4302a;
  --down-soft: #fbe7e5;
  --bar: #14866f;             /* series 1: validated with --bench (light, on #fff) */
  --bench: #2a78d6;           /* ASX 300 benchmark marker */
  --track: #edf0f4;
  /* categorical slots in fixed order (validated: adjacent CVD and normal-vision pass; slots 3-5 are under 3:1, so charts using them ship a table) */
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6;
  --shadow: 0 1px 2px rgba(15, 34, 56, .05), 0 6px 20px -14px rgba(15, 34, 56, .25);
  --radius: 12px;
  --sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4 Variable", "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c121a; --panel: #131b25; --panel-2: #172130; --ink: #e8edf3; --ink-2: #c6d0dc; --muted: #95a2b4;
    --line: #243142; --line-2: #1c2735; --navy: #0a1621; --navy-2: #12263a; --on-navy: #eef3f9; --on-navy-muted: #9fb0c5;
    --accent: #4fd0b2; --accent-soft: #123a33; --gold: #e0b04a; --gold-bright: #e9c066;
    --up: #5bd08f; --up-soft: #12321f; --down: #ff8a80; --down-soft: #3a1a1a;
    --bar: #2aa587; --bench: #3987e5; --track: #1e2a39;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c121a; --panel: #131b25; --panel-2: #172130; --ink: #e8edf3; --ink-2: #c6d0dc; --muted: #95a2b4;
  --line: #243142; --line-2: #1c2735; --navy: #0a1621; --navy-2: #12263a; --on-navy: #eef3f9; --on-navy-muted: #9fb0c5;
  --accent: #4fd0b2; --accent-soft: #123a33; --gold: #e0b04a; --gold-bright: #e9c066;
  --up: #5bd08f; --up-soft: #12321f; --down: #ff8a80; --down-soft: #3a1a1a;
  --bar: #2aa587; --bench: #3987e5; --track: #1e2a39;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}

/* ---------- base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15.5px/1.55 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding: 30px 20px 64px; }   /* main.wrap: beats .wrap's own padding */
h1 {
  font-family: var(--serif); font-weight: 650; font-size: 38px; line-height: 1.12;
  letter-spacing: -.015em; margin: 0 0 10px; font-optical-sizing: auto;
}
h1 .muted { font-family: var(--sans); font-weight: 600; font-size: .62em; letter-spacing: 0; color: var(--muted); vertical-align: .18em; }
h2 { font-size: 19px; font-weight: 680; line-height: 1.3; margin: 40px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 15.5px; font-weight: 650; margin: 22px 0 8px; }
.lede { color: var(--ink-2); font-size: 17px; line-height: 1.55; max-width: 780px; margin: 0 0 22px; }
.lede b { color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.eyebrow {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 6px;
}
.crumbs, main > p:first-child.small { font-size: 13px; color: var(--muted); margin: 0 0 12px; }

/* ---------- header */
header.site { background: var(--navy); color: var(--on-navy); position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06); }
.bar { display: flex; align-items: center; gap: 22px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; font-size: 18px; color: var(--on-navy);
  letter-spacing: -.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; }
.brand b { color: var(--gold-bright); font-weight: inherit; }
footer.site .brand b { color: inherit; }
header nav { display: flex; gap: 4px; }
header nav a { color: var(--on-navy-muted); font-size: 14.5px; font-weight: 500; padding: 6px 10px; border-radius: 7px; white-space: nowrap; }
header nav a:hover { color: var(--on-navy); background: rgba(255, 255, 255, .07); text-decoration: none; }
header nav a[aria-current="page"] { color: var(--on-navy); box-shadow: inset 0 -2px 0 var(--gold-bright); border-radius: 0; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.search { position: relative; flex: 0 1 300px; }
header .search { width: 300px; min-width: 150px; flex: 0 1 300px; }
.search input {
  width: 100%; padding: 9px 12px 9px 36px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 9px;
  background: rgba(255, 255, 255, .08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a9b8cb' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 12px 50%;
  color: var(--on-navy); font: inherit; font-size: 14.5px;
}
.search input::placeholder { color: var(--on-navy-muted); }
.search input:focus { outline: none; border-color: var(--gold-bright); background-color: rgba(255, 255, 255, .12); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px var(--mono);
  color: var(--on-navy-muted); border: 1px solid rgba(255, 255, 255, .2); border-radius: 4px; padding: 0 5px; pointer-events: none; }
.results {
  position: absolute; right: 0; left: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 16px 40px -12px rgba(15, 34, 56, .35); max-height: 60vh; overflow: auto; z-index: 30; min-width: 280px;
}
.results li a { display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; color: var(--ink); border-radius: 7px; font-size: 14.5px; }
.results li a b { font: 650 12px var(--mono); color: var(--accent); min-width: 44px; }
.results li a:hover, .results li a.on { background: var(--accent-soft); text-decoration: none; }
.results li.none { padding: 8px 10px; color: var(--muted); font-size: 14px; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .14);
  background: transparent; color: var(--on-navy-muted); cursor: pointer; }
.iconbtn:hover { color: var(--on-navy); background: rgba(255, 255, 255, .08); }
.iconbtn .sun { display: none; }
:root[data-theme="dark"] .iconbtn .sun { display: block; }
:root[data-theme="dark"] .iconbtn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .iconbtn .sun { display: block; }
  :root:not([data-theme="light"]) .iconbtn .moon { display: none; }
}

/* ---------- hero (home) */
body { overflow-x: clip; }
.hero { background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: var(--on-navy);
  margin: -30px calc(50% - 50vw) 8px; padding: 44px 0 30px; }   /* full bleed from inside main.wrap */
.hero .inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.hero h1 { color: #fff; font-size: 46px; max-width: 760px; }
.hero h1 em { font-style: normal; color: var(--gold-bright); }
.hero .lede { color: var(--on-navy-muted); }
.hero .lede b { color: var(--on-navy); }
.hero .search { max-width: 560px; margin: 4px 0 26px; }
.hero .search input { padding: 13px 14px 13px 42px; font-size: 16px; background-position: 15px 50%; border-radius: 11px; }
.hero .tiles { margin: 0; }
.hero .tile { border-color: transparent; }
.hero + p.muted { margin-top: 14px; }
.hero-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--on-navy-muted); margin: 14px 0 0; }
.hero-meta .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); margin-right: 6px; vertical-align: 1px; }

/* ---------- stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 22px 0; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 18px 14px; box-shadow: var(--shadow); min-width: 0; }
.tile .k { color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.tile .v { font-size: 28px; font-weight: 720; letter-spacing: -.02em; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; color: var(--ink); }
.tile .s { color: var(--muted); font-size: 13px; }
.tile .v.up, .tile .v .up { color: var(--up); }
.tile .v.down, .tile .v .down { color: var(--down); }

/* ---------- layout */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.grid2 > * { min-width: 0; }   /* a wide table must scroll inside its card, not stretch the column */
.grid2 > div > h2:first-child, .grid2 > div > .card:first-child { margin-top: 40px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 10px; box-shadow: var(--shadow); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose { max-width: 760px; }
.prose li { margin: 4px 0; }
.prose p, .prose li { color: var(--ink-2); }

/* ---------- tables */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { font-size: 11.5px; font-weight: 650; color: var(--muted); white-space: nowrap; text-transform: uppercase; letter-spacing: .06em;
  border-bottom-color: var(--line); padding-top: 12px; }
td.n, th.n { text-align: right; white-space: nowrap; }
tbody tr { transition: background-color .12s; }
tbody tr:hover { background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td a { font-weight: 500; }
.tick, a.tick {
  display: inline-block; font: 650 12px/1.55 var(--mono); letter-spacing: .02em; color: var(--accent);
  background: var(--accent-soft); padding: 0 6px; border-radius: 5px; margin-right: 4px; vertical-align: 1px;
}
a.tick:hover { text-decoration: none; filter: brightness(.95); }
.up { color: var(--up); }
.down { color: var(--down); }
td.n.up, td.n.down { font-weight: 600; }
.pill { display: inline-block; font-weight: 650; font-size: 13.5px; padding: 1px 8px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.pill.up { background: var(--up-soft); }
.pill.down { background: var(--down-soft); }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; }
.badge.out { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- bar lists */
.barrow { display: grid; grid-template-columns: minmax(150px, 42%) minmax(0, 1fr) minmax(64px, max-content); gap: 12px; align-items: center;
  padding: 5px 6px; margin: 0 -6px; font-size: 14px; border-radius: 7px; }
.barrow:hover { background: var(--panel-2); }
.barrow > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barrow .track { background: var(--track); height: 8px; border-radius: 4px; position: relative; }
.barrow .fill { background: var(--bar); height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.barrow .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 1px; background: var(--bench); box-shadow: 0 0 0 2px var(--panel); }
.barrow .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* ---------- notes, chips, details */
.note { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: 8px;
  padding: 11px 15px; font-size: 14px; margin: 14px 0; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px;
  background: var(--panel); color: var(--ink-2); font-weight: 500; }
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: var(--accent-soft); }
details summary { cursor: pointer; color: var(--accent); font-weight: 500; }

/* ---------- charts */
svg.chart { overflow: visible; }
svg.chart text { fill: var(--muted); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
svg.chart .ln { fill: none; stroke: var(--bar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
svg.chart .area { fill: var(--bar); opacity: .1; }
svg.chart .pt { fill: var(--bar); stroke: var(--panel); stroke-width: 2; }
svg.chart .grid { stroke: var(--line-2); }
svg.chart .base { stroke: var(--line); }
svg.chart .hit { fill: transparent; cursor: default; }
svg.chart .tip { opacity: 0; transition: opacity .1s; pointer-events: none; }
svg.chart .tip rect { fill: var(--ink); }
svg.chart .tip text { fill: var(--panel); font-weight: 600; font-size: 11.5px; }
svg.chart g.p:hover .tip, svg.chart g.p:focus .tip { opacity: 1; }
svg.chart g.p:hover .pt { r: 6; }
svg.chart .last { fill: var(--ink); font-weight: 650; font-size: 12px; }

/* ---------- footer */
footer.site { border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13.5px; padding: 30px 0 44px; }
footer.site .cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; }
footer.site h4 { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin: 4px 0; }
footer.site a { color: var(--ink-2); }
footer.site .brand { color: var(--ink); margin-bottom: 8px; }
footer.site .fine { border-top: 1px solid var(--line-2); margin-top: 22px; padding-top: 16px; max-width: 900px; }

/* ---------- phone */
@media (max-width: 1120px) {
  /* brand + theme button, then a scrolling nav row, then search */
  .bar { flex-wrap: wrap; gap: 0 12px; padding-top: 8px; min-height: 0; }
  .tools { display: contents; }
  #theme { order: 2; margin-left: auto; }
  header nav { order: 3; width: calc(100% + 40px); overflow-x: auto; scrollbar-width: none; margin: 6px -20px 0; padding: 0 14px 4px; }
  header nav::-webkit-scrollbar { display: none; }
  header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--gold-bright); }
  header .search { order: 4; width: 100%; flex: 1 1 100%; margin: 4px 0 10px; }
  header .search kbd { display: none; }
  body:has(.hero) header .search { display: none; }   /* the home page has its own big search */
}
@media (max-width: 760px) {
  header.site { position: static; }
  .brand span { font-size: 17px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); gap: 0; }
  h1 { font-size: 29px; }
  .hero { padding: 28px 0 22px; }
  .hero h1 { font-size: 33px; }
  .hero .search { margin-bottom: 18px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 12px 13px; }
  .tile .v { font-size: 22px; }
  .tile .s { font-size: 12px; }
  .barrow { grid-template-columns: minmax(96px, 40%) minmax(0, 1fr) minmax(56px, max-content); gap: 8px; font-size: 13.5px; }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
  footer.site .cols > div:first-child { grid-column: 1 / -1; }
  main.wrap { padding-top: 22px; }
  .hero { margin-top: -22px; }
}
@media (max-width: 520px) {
  .hide-sm { display: none; }   /* drop a secondary table column so names do not wrap three deep */
}
