:root {
  --bg: #f7f5ef; --surface: #ffffff; --ink: #1d1b16; --muted: #6b665a; --line: #e2ddcf;
  --accent: #0f6b4f; --accent-ink: #ffffff; --neg: #a23b2a; --pos: #0f6b4f; --hover: #f1eee4; --link: #0d5a8c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f; --surface: #1e1c17; --ink: #ece8dc; --muted: #a39d8d; --line: #34312a;
    --accent: #4cc39a; --accent-ink: #0d1a14; --neg: #f08a76; --pos: #4cc39a; --hover: #26241e; --link: #7cc0f0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
.bar { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.brand { font: 600 15px/1 Georgia, "Times New Roman", serif; letter-spacing: .02em; }
main { max-width: 760px; margin: 0 auto; padding: 20px 16px 64px; }
a { color: var(--link); }

.hero h1 { font: 600 22px/1.2 Georgia, serif; margin: 8px 0 14px; }
.hero h1 small { color: var(--muted); font: 500 15px ui-sans-serif, system-ui, sans-serif; margin-left: 6px; }
.figures { display: flex; gap: 28px; flex-wrap: wrap; align-items: baseline; }
.fig .k { color: var(--muted); font-size: 13px; }
.fig .v { font: 600 34px/1.1 ui-sans-serif, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.fig .v.small { font-size: 22px; }
.gap.pos { color: var(--pos); } .gap.neg { color: var(--neg); }
.about { color: var(--muted); margin: 14px 0 0; max-width: 62ch; }
.hint { margin: 22px 0 8px; color: var(--muted); font-size: 13px; }

.tree { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.node > .row { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%;
  padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.tree > .node:first-child > .row { border-top: 0; }
.node > .row:hover, .node > .row:focus-visible { background: var(--hover); }
.node > .row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.label { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.label::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.node.open > .row .label::before { transform: rotate(90deg); }
.node.leaf > .row .label::before { content: "·"; }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; white-space: nowrap; }
.amount.neg { color: var(--neg); }
.formula { grid-column: 1 / -1; color: var(--muted); font-size: 13px; padding-left: 1em; overflow-wrap: anywhere; }
.body { display: none; padding: 0 0 8px 8px; }
.tree > .node > .body { padding-left: 14px; }
.note, .sources, table.series { margin-left: 6px; margin-right: 12px; }
.node.open > .body { display: block; }
.kids { border-left: 2px solid var(--line); margin: 4px 0 0; }
.kids .node > .row { padding: 9px 12px 9px 8px; }
.note { font-size: 13px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0; max-width: 70ch; }
.sources { font-size: 13px; margin: 4px 0; }
.sources a { margin-right: 10px; }
table.series { border-collapse: collapse; font-size: 13px; margin: 8px 0; font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
table.series th, table.series td { padding: 3px 10px 3px 0; text-align: right; white-space: nowrap; }
table.series th { color: var(--muted); font-weight: 500; }
table.series .reported { font-weight: 600; }

.offer { margin-top: 28px; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.offer h2 { font: 600 19px/1.25 Georgia, serif; margin: 0 0 6px; }
.offer .price { margin: 0 0 14px; color: var(--muted); }
.offer .price b { color: var(--ink); font-size: 22px; }
.offer button { font: 600 15px ui-sans-serif, system-ui, sans-serif; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer; }
.offer button:disabled { opacity: .55; cursor: default; }
.offer form { margin-top: 16px; }
.offer form p { margin: 0 0 8px; }
.offer .row { display: flex; gap: 8px; flex-wrap: wrap; }
.offer input { flex: 1 1 220px; font: 15px ui-sans-serif, system-ui, sans-serif; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.offer .msg { margin-top: 8px; font-size: 14px; color: var(--muted); }
.offer .msg:empty { display: none; }
.offer .msg.err { color: var(--neg); }
