:root {
  --bg: #ffffff; --surface: #f3f5f8; --fg: #1b2430; --muted: #5a6675; --line: #d5dae1;
  --brand: #12395f; --brand-fg: #ffffff; --link: #0b5cab; --bar: #5b87b5; --bar-strong: #12395f;
  --ok-bg: #e3f2e6; --ok-fg: #1d5c2c; --warn-bg: #fdf0d0; --warn-fg: #6b4a00;
  --font: "Public Sans", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171e; --surface: #1b222c; --fg: #e6eaef; --muted: #a0abb9; --line: #323c49;
    --brand: #0e2a47; --link: #7db8f2; --bar: #4f7dab; --bar-strong: #9cc4ea;
    --ok-bg: #1c3a24; --ok-fg: #a9dcb4; --warn-bg: #40320c; --warn-fg: #f0d58a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.6; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--link); }
a:focus-visible, input:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.sitebar { background: var(--brand); color: var(--brand-fg); }
.sitebar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; padding-top: 14px; padding-bottom: 14px; }
.sitename { font-weight: 700; font-size: 18px; color: var(--brand-fg); text-decoration: none; }
.sitebar nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 15px; }
.sitebar nav a { color: var(--brand-fg); text-decoration: none; opacity: .9; }
.sitebar nav a:hover { text-decoration: underline; opacity: 1; }
.notice { background: var(--warn-bg); color: var(--warn-fg); font-size: 14px; padding: 8px 0; }

.crumbs { font-size: 14px; color: var(--muted); padding-top: 16px; }
.crumbs a { color: var(--muted); }
.page { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; padding: 16px 0 56px; }
.page > * { min-width: 0; }
@media (max-width: 860px) { .page { grid-template-columns: minmax(0, 1fr); gap: 32px; } }

h1 { font-size: 32px; line-height: 1.2; margin: 8px 0; text-wrap: balance; }
h2 { font-size: 22px; line-height: 1.3; margin: 40px 0 12px; text-wrap: balance; }
h3 { font-size: 16px; margin: 20px 0 4px; }
p { margin: 0 0 14px; max-width: 68ch; }
ul, ol { max-width: 68ch; padding-left: 22px; margin: 0 0 14px; }
li { margin-bottom: 6px; }
.updated { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.lede { font-size: 18px; }
.src { font-size: 13px; color: var(--muted); max-width: none; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); margin: 24px 0 8px; }
.facts div { padding: 14px 16px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.facts small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
@media (max-width: 600px) {
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div { border-left: 0; border-top: 1px solid var(--line); }
  .facts div:first-child { border-top: 0; }
}

.tablebox { overflow-x: auto; margin-bottom: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.date { white-space: nowrap; }
tr.total td { font-weight: 700; border-top: 2px solid var(--fg); border-bottom: 0; }

.calc { background: var(--surface); border: 1px solid var(--line); padding: 20px; margin-bottom: 8px; }
.calc form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.calc label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.calc input, .calc select { width: 100%; font: inherit; font-variant-numeric: tabular-nums; padding: 8px 10px; border: 1px solid var(--muted); border-radius: 3px; background: var(--bg); color: var(--fg); }
.calc .hint { font-size: 13px; color: var(--muted); margin-top: 4px; }
.calc table { background: var(--bg); border: 1px solid var(--line); margin-top: 20px; }
.calc output { display: block; margin-top: 16px; font-size: 18px; font-weight: 600; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }

.bars { display: grid; gap: 10px; margin: 16px 0 8px; max-width: 640px; }
.bars .row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; gap: 12px; align-items: center; font-size: 15px; }
.bars .track { background: var(--surface); height: 18px; }
.bars .fill { background: var(--bar); height: 18px; }
.bars .row.own { font-weight: 700; }
.bars .row.own .fill { background: var(--bar-strong); }
.bars .val { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .bars .row { grid-template-columns: 110px minmax(0, 1fr) 62px; } }

aside { display: flex; flex-direction: column; gap: 28px; font-size: 15px; }
aside h2 { font-size: 16px; margin: 0 0 8px; }
aside ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
aside li { border-bottom: 1px solid var(--line); padding: 8px 0; margin: 0; }
aside li[aria-current] a { font-weight: 700; color: var(--fg); text-decoration: none; }
aside p { font-size: 14px; color: var(--muted); }

.utility-list { list-style: none; padding: 0; max-width: none; border-top: 1px solid var(--line); }
.utility-list li { border-bottom: 1px solid var(--line); padding: 12px 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between; }
.utility-list span { color: var(--muted); font-size: 14px; }

footer { border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
footer .wrap { padding-top: 20px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
footer a { color: var(--muted); }
