/* Layout: lead, bottom line box, KPI line, controls, then one budget register (spender > unit > KPKVK program) whose figures switch between total, general fund and special fund. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --fg: #1b2230; --muted: #5d6779; --line: #dde1e8; --zebra: #f1f3f7;
  --accent: #1f4fa3; --accent-soft: #e6edf9;
  --up: #1c7a4a; --down: #b3261e; --new: #9a5b00; --new-soft: #fbefd9;
  --up-soft: #e3f3ea; --down-soft: #fbe6e4; --mid: #7a5d00; --mid-soft: #fdf1bf;
  --chip-bg-l: 87%; --chip-fg-l: 25%;
  --font-body: "Golos Text", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #11151c; --surface: #181e27; --fg: #e5e9f0; --muted: #98a2b3; --line: #2a3240; --zebra: #1c232e;
  --accent: #8fb3ff; --accent-soft: #1d2a44; --up: #6fd39d; --down: #ff8a80; --new: #f0b860; --new-soft: #33270f;
  --up-soft: #15301f; --down-soft: #3a1a18; --mid: #f3d266; --mid-soft: #362d0c; --chip-bg-l: 23%; --chip-fg-l: 80%; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #11151c; --surface: #181e27; --fg: #e5e9f0; --muted: #98a2b3; --line: #2a3240; --zebra: #1c232e;
  --accent: #8fb3ff; --accent-soft: #1d2a44; --up: #6fd39d; --down: #ff8a80; --new: #f0b860; --new-soft: #33270f;
  --up-soft: #15301f; --down-soft: #3a1a18; --mid: #f3d266; --mid-soft: #362d0c; --chip-bg-l: 23%; --chip-fg-l: 80%; color-scheme: dark; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 14px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 28px 48px; }
.wrap { max-width: 1240px; margin: 0 auto; display: grid; gap: 20px; }
h1 { margin: 0; font-size: clamp(1.4rem, 3vw, 1.85rem); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; line-height: 1.2; }
p { margin: 0; }
a { color: var(--accent); }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.lead { font-size: 16px; max-width: 75ch; }
.bl { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; }
.bl ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14.5px; max-width: 110ch; }
header { display: grid; gap: 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 12px 36px; }
.fact { display: grid; gap: 2px; }
.fact span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.fact b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 500; }
.controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button, .btn { font: inherit; font-size: 13px; padding: 7px 12px; border: 0; background: transparent; color: var(--fg); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--surface); font-weight: 600; }
.btn { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.btn:hover, .seg button:hover { background: var(--accent-soft); }
.seg button[aria-pressed="true"]:hover { background: var(--accent); }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ctl-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctl-label { font-size: 13px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface); position: sticky; top: 0; z-index: 1; }
thead tr:first-child th.grp { text-align: center; border-bottom: 1px solid var(--line); color: var(--fg); }
th.y26, td.y26.last, th.y26.last { }
.sep { border-left: 1px solid var(--line); }
td.name, th.name { text-align: left; white-space: normal; min-width: 280px; max-width: 520px; }
td.code { text-align: left; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
td.num { font-family: var(--font-mono); font-size: 13px; }
tr.l0 td { font-weight: 600; background: var(--zebra); }
tr.l0 td.name { font-size: 15px; }
tr.l1 td.name { padding-left: 34px; font-weight: 500; }
tr.l2 td.name { padding-left: 34px; color: var(--fg); }
tr.l2.deep td.name { padding-left: 56px; }
tr.total td { font-weight: 700; background: var(--accent-soft); border-bottom: 2px solid var(--accent); }
.tg { all: unset; cursor: pointer; display: inline-flex; gap: 8px; align-items: baseline; }
.tg.static { cursor: default; }
.tg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.chev { display: inline-block; width: 12px; font-family: var(--font-mono); color: var(--accent); transition: transform .15s; }
.tg[aria-expanded="true"] .chev { transform: rotate(90deg); }
.short { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 500; }
.up { color: var(--up); }
.down { color: var(--down); }
.pn { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pn.clip { cursor: pointer; }
.pn.clip:hover { color: var(--accent); }
.pn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.pn.full { display: block; -webkit-line-clamp: unset; line-clamp: none; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; color: var(--new); background: var(--new-soft); margin-left: 6px; vertical-align: 1px; }
.dash { color: var(--muted); }
.chip { display: inline-block; min-width: 4.6em; text-align: right; padding: 1px 7px; border-radius: 5px; font-weight: 600; }
.chip.g { background: hsl(var(--h) 72% var(--chip-bg-l)); color: hsl(var(--h) 85% var(--chip-fg-l)); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; color: var(--muted); }
.scale { display: grid; gap: 3px; width: min(100%, 420px); }
.scale .bar { height: 12px; border-radius: 3px; background: linear-gradient(90deg, hsl(0 72% var(--chip-bg-l)) 0%, hsl(25 72% var(--chip-bg-l)) 40%, hsl(52 72% var(--chip-bg-l)) 57.2%, hsl(140 72% var(--chip-bg-l)) 100%); border: 1px solid var(--line); }
.scale .ticks { position: relative; height: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.scale .ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.scale .ticks span:first-child { transform: none; }
.scale .ticks span:last-child { transform: translateX(-100%); }
footer { color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .chev { transition: none; } }
