:root {
  --ink: #14173A;
  --ink-2: #1E2250;
  --ivory: #FBF6EC;
  --sand: #EDE3CF;
  --card: #FFFFFF;
  --line: #D9D4C7;
  --text: #14173A;
  --text-2: #3C405C;
  --muted: #5C6080;
  --saffron: #F2A93B;
  --gold: #FFD36A;
  --ember: #C8431F;
  --data: #1C7F74;        /* teal, darkened to hold 3:1 on ivory and white */
  --data-neg: #C8431F;
  --grid: #EDE7D8;
  --bg: var(--ivory);
  --band: #F4ECDC;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101330; --band: #14173A; --card: #1A1E48; --line: #2E3366; --grid: #262A58;
    --text: #F3EEE2; --text-2: #CFCBDF; --muted: #A6A9C6; --data: #2FB8A8; --data-neg: #F07A55;
    --ember: #F07A55; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101330; --band: #14173A; --card: #1A1E48; --line: #2E3366; --grid: #262A58;
  --text: #F3EEE2; --text-2: #CFCBDF; --muted: #A6A9C6; --data: #2FB8A8; --data-neg: #F07A55;
  --ember: #F07A55; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 'Sora', 'Trebuchet MS', sans-serif; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--ember); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .92em; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }

.top { background: var(--ink); color: var(--ivory); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ivory); min-height: 44px; }
.brand:hover { color: var(--ivory); }
.brand__name { font-weight: 600; font-size: 20px; }
.brand__sub { font-size: 14px; color: #BFC3DF; }
.top__nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top__nav a { color: var(--ivory); text-decoration: none; font-weight: 500; font-size: 15px; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; }
.top__nav a:hover { color: var(--gold); }

.eyebrow { color: var(--ember); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.lead { font-size: 18px; color: var(--text-2); max-width: 62ch; }
.muted { color: var(--text-2); max-width: 70ch; }
.small { font-size: 14px; color: var(--text-2); }
.fine { font-size: 13px; color: var(--muted); }
.label { font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #BFC3DF; }
.label--soft { font-weight: 400; letter-spacing: 0; text-transform: none; }

.hero { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 40px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.25fr 1fr; gap: 56px; padding-top: 72px; } }
.hero__text { display: flex; flex-direction: column; gap: 18px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 700; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
@media (min-width: 720px) { .card { padding: 24px; } }
.card--ink { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.card--ink .small { color: #D9D4C7; }
.hero__card { display: flex; flex-direction: column; gap: 16px; }
.hero__card-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.big span:first-child { font-size: clamp(44px, 7vw, 60px); font-weight: 700; line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.unit { font-size: 16px; color: #BFC3DF; }
.trio { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border-top: 1px solid #2E3366; padding-top: 16px; }
.trio dt { font-size: 12px; color: #BFC3DF; }
.trio dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--ivory); }
.trio dd small { display: block; font-weight: 400; color: #BFC3DF; font-size: 12px; }

.controls-band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.controls { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-end; padding-top: 18px; padding-bottom: 18px; }
.seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg legend, .field label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
.seg__opts { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg__opts label { position: relative; }
.seg__opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__opts span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 500; }
.seg__opts input:checked + span { background: var(--ink); color: var(--ivory); }
.seg__opts input:focus-visible + span { outline: 3px solid var(--saffron); outline-offset: -3px; }
.field { display: flex; flex-direction: column; }
.field label { display: flex; gap: 8px; }
.field output { font-variant-numeric: tabular-nums; color: var(--text); }
.field input[type=range] { width: 180px; min-height: 44px; accent-color: var(--ink); }
.field input[type=number], select { font: inherit; font-size: 15px; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); width: 180px; }
.btn { font: inherit; font-weight: 600; font-size: 14px; min-height: 44px; padding: 0 16px; border-radius: 8px; cursor: pointer; }
.btn--line { background: transparent; color: var(--text); border: 2px solid var(--text); }
.btn--line:hover { color: var(--ember); border-color: var(--ember); }

.block { padding-top: 56px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 24px; }
.block__head { display: flex; flex-direction: column; gap: 10px; }
.block h2 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 600; }
.block h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid2 { display: grid; gap: 20px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }

.chart-card { position: relative; }
.chart-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-bottom: 8px; align-items: center; }
.inline-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-2); font-family: 'Sora', sans-serif; font-size: 13px; }
.chart .t-val { fill: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .t-axis { fill: var(--muted); font-size: 12px; }
.chart .grid { stroke: var(--grid); }
.chart .base { stroke: var(--line); }
.chart .bar { fill: var(--data); }
.chart .bar--neg { fill: var(--data-neg); }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover + .bar, .chart .row:hover .bar { opacity: .82; }
.chart .rent-line { stroke: var(--text); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .line { fill: none; stroke: var(--data); stroke-width: 2; }
.chart .dot { fill: var(--data); stroke: var(--card); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--ivory); font-size: 13px; line-height: 1.45; padding: 10px 12px; border-radius: 8px; max-width: 280px; box-shadow: 0 6px 20px rgba(20,23,58,.25); }
.tip b { color: var(--gold); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; }
.data th, .data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.data thead th { font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--card); }
.th-sub { font-weight: 400; color: var(--muted); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data tbody tr:last-child td { border-bottom: 0; }
.data .region td { background: var(--band); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.data td.neg { color: var(--ember); font-weight: 600; }
.data td small { color: var(--muted); }
.data--tight th, .data--tight td { padding: 8px 10px; }
.flag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); }
.notes { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }

.formula { font-size: 17px; font-weight: 500; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-2); }
.list b { color: var(--text); }

.foot { background: var(--ink); color: #BFC3DF; padding: 32px 0; font-size: 14px; }
.foot a { color: #E6E2F2; display: inline-block; padding: 6px 0; }
.foot a:hover { color: var(--gold); }
.foot__inner { display: flex; flex-direction: column; gap: 10px; }
.foot .fine { color: #A6A9C6; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.grid2 > * { min-width: 0; }
.data--tight th, .data--tight td { white-space: normal; }
.formula { overflow-wrap: anywhere; }
