/* sady — system wizualny. Tokeny kolorów: jasny, ciemny (systemowy i ręczny przez data-theme). */
:root {
  color-scheme: light;
  --fg: oklch(26.61% .0759 268.32);
  --fg-muted: oklch(51.27% .0496 268.96);
  --fg-faint: oklch(64% .035 268);
  --bg: #fff;
  --bg-alt: oklch(97.3% .007 268.55);
  --bg-raised: #fff;
  --border: oklch(91.86% .0172 267.78);
  --border-strong: oklch(84% .025 268);
  --accent: oklch(49.06% .1888 21.82);
  --accent-hover: #9a1530;
  --accent-tint: #f6e3e6;
  --accent-glow: #b3122b38;
  --data: #2a78d6;
  --data-tint: color-mix(in oklch, var(--data) 16%, var(--bg));
  --warn-bg: #fbf0d9;
  --warn-fg: #6e4600;
  --shadow: 0 1px 2px oklch(26% .07 268 / .06), 0 4px 16px oklch(26% .07 268 / .05);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 24px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fg: oklch(89.82% .0156 257.2);
    --fg-muted: oklch(70% .036 262.6);
    --fg-faint: oklch(58% .03 262);
    --bg: oklch(17.23% .016 261.51);
    --bg-alt: oklch(21.66% .0218 260.51);
    --bg-raised: oklch(20.5% .02 261);
    --border: oklch(29.1% .0287 259.11);
    --border-strong: oklch(38% .03 259);
    --accent: oklch(70% .165 18);
    --accent-hover: oklch(78% .13 18);
    --accent-tint: oklch(27% .06 18);
    --accent-glow: oklch(70% .165 18 / .28);
    --data: #3987e5;
    --warn-bg: oklch(30% .05 75);
    --warn-fg: oklch(87% .11 85);
    --shadow: 0 1px 2px #0005, 0 4px 16px #0004;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fg: oklch(89.82% .0156 257.2);
  --fg-muted: oklch(70% .036 262.6);
  --fg-faint: oklch(58% .03 262);
  --bg: oklch(17.23% .016 261.51);
  --bg-alt: oklch(21.66% .0218 260.51);
  --bg-raised: oklch(20.5% .02 261);
  --border: oklch(29.1% .0287 259.11);
  --border-strong: oklch(38% .03 259);
  --accent: oklch(70% .165 18);
  --accent-hover: oklch(78% .13 18);
  --accent-tint: oklch(27% .06 18);
  --accent-glow: oklch(70% .165 18 / .28);
  --data: #3987e5;
  --warn-bg: oklch(30% .05 75);
  --warn-fg: oklch(87% .11 85);
  --shadow: 0 1px 2px #0005, 0 4px 16px #0004;
}

/* ---------- podstawy ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 400 1rem/1.6 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
.wrap { max-width: 84rem; margin: 0 auto; padding: 0 var(--gutter); }
.page { padding-top: 2.5rem; padding-bottom: 4rem; }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-strong); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); color: var(--fg); padding: .5rem .8rem; z-index: 1000; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--fg-muted); font-size: .9375rem; }
strong { font-weight: 600; }
p { margin: 0 0 1rem; }

h1, h2, h3 { color: var(--fg); letter-spacing: -.02em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); line-height: 1.12; font-weight: 800; margin: .25rem 0 .75rem; }
h2 { font-size: 1.25rem; line-height: 1.3; font-weight: 700; margin: 3rem 0 .75rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.eyebrow, .eyebrow-title {
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted); margin: 0 0 .5rem;
}
.eyebrow-title { font-size: .8125rem; font-weight: 700; color: var(--fg); letter-spacing: .06em; margin: 0; }
.lead { font-size: 1.125rem; color: var(--fg-muted); max-width: 46rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head .lead, .page-head > p { max-width: 50rem; }
.page-head + h2, .page-head + .note + h2 { margin-top: 2rem; }

/* ---------- nagłówek strony ---------- */
header.site { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 900; }
header.site .topbar { display: flex; align-items: center; gap: 1.5rem; min-height: 60px; }
.brand { font-weight: 800; font-size: 1.25rem; letter-spacing: -.03em; color: var(--fg); text-decoration: none; display: inline-flex; align-items: baseline; }
.brand:hover { color: var(--fg); }
.brand-dot { display: inline-block; width: .38em; height: .38em; border-radius: 50%; background: var(--accent); margin-left: .12em; }
header.site nav { display: flex; gap: .25rem; margin-left: auto; }
header.site nav a { color: var(--fg-muted); text-decoration: none; font-size: .9375rem; font-weight: 500; padding: .4rem .6rem; border-radius: var(--radius-sm); white-space: nowrap; }
header.site nav a:hover { color: var(--fg); background: var(--bg-alt); }
header.site nav a[aria-current="page"] { color: var(--fg); font-weight: 600; }
.theme-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg); cursor: pointer;
}
.theme-toggle:hover { background: var(--bg-alt); }
.theme-toggle .i-sun { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: block; }
.theme-toggle[aria-pressed="true"] .i-moon { display: none; }

/* ---------- stopka ---------- */
footer.site { border-top: 1px solid var(--border); background: var(--bg-alt); color: var(--fg-muted); font-size: .875rem; padding: 2rem 0; }
footer.site p { margin: .25rem 0; }
footer.site a { color: var(--fg-muted); }
footer.site a:hover { color: var(--accent); }

/* ---------- formularze ---------- */
input, select, button, textarea { font: inherit; color: var(--fg); }
input[type="search"], input[type="number"], input[type="text"], select {
  height: 2.5rem; padding: 0 .75rem; border: 1px solid var(--control-border); border-radius: 8px;
  background: var(--bg-raised); max-width: 100%;
}
select { padding-right: 2rem; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%), linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="number"] { width: 7.5rem; }
input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn, button[type="submit"] {
  height: 2.5rem; padding: 0 1.1rem; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
:root[data-theme="dark"] .btn, :root[data-theme="dark"] button[type="submit"] { color: oklch(17% .016 261); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn, :root:not([data-theme="light"]) button[type="submit"] { color: oklch(17% .016 261); } }
.btn:hover, button[type="submit"]:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
form.inline, .filters-bar {
  display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; margin: 1rem 0 1.25rem;
  padding: .9rem 1rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
}
form.inline > label, .field > label, .field > span { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: .3rem; }
form.inline > label { margin-bottom: 0; align-self: center; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1.5rem; margin-top: 3rem; }
.section-head h2 { margin: 0 0 .5rem; }
form.inline.compact { margin: 0 0 .5rem; padding: 0; background: none; border: 0; align-items: center; gap: .5rem; }
form.inline.compact select { height: 2.25rem; font-size: .875rem; }
.prose-note { max-width: 62rem; color: var(--fg-muted); font-size: .9375rem; }
.muted-num { color: var(--fg-muted); }
th.range-col, td.range-col { width: 26%; min-width: 9rem; vertical-align: middle; }
form.filters-stack { flex-direction: column; align-items: stretch; gap: 1rem; }
.filters-row { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; }
.field-grow { flex: 1 1 16rem; }
.field-grow select { width: 100%; }
td.n.muted { font-family: var(--font); }
.field { display: flex; flex-direction: column; min-width: 0; }

/* ---------- pigułki ---------- */
.pills { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .9rem 0 1rem; }
.pills-label { font-size: .8125rem; color: var(--fg-muted); margin-right: .2rem; }
.pill, .pill-radio label {
  display: inline-flex; align-items: center; min-height: 2rem; padding: .2rem .8rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--fg);
  font-size: .8125rem; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  text-transform: none; letter-spacing: normal; margin: 0;
}
.pill:hover, .pill-radio label:hover { border-color: var(--accent); color: var(--accent); }
.pill[aria-current="true"], .pill-radio label:has(input:checked) {
  background: var(--accent-tint); border-color: var(--accent); color: var(--accent); font-weight: 600;
}
.pill-radio { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; min-width: 0; }
.pill-radio legend { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: .4rem; padding: 0; }
.pill-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill-radio label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- wyróżnione bloki ---------- */
.note {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1.1rem; color: var(--fg); max-width: 60rem; font-size: .9375rem;
}
.note strong:first-child { color: var(--fg); }
.warn {
  display: inline-block; background: var(--warn-bg); color: var(--warn-fg); padding: .05rem .5rem;
  border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; vertical-align: .1em; font-family: var(--font);
}

/* ---------- tabele ---------- */
.table-wrap { overflow-x: auto; margin: .75rem 0 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .9375rem; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
thead th { vertical-align: bottom; }
td.sentence { vertical-align: top; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); background: var(--bg-alt); white-space: nowrap; }
tbody th { font-weight: 600; }
tbody tr:hover > * { background: color-mix(in oklch, var(--bg-alt) 60%, transparent); }
td.n, th.n { text-align: right; white-space: nowrap; }
td.n, td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.n a, td.num a { font-weight: 600; }
td.sentence { min-width: 18rem; color: var(--fg-muted); font-size: .875rem; }
td.sentence q { color: var(--fg); }
caption { text-align: left; }

/* pasek proporcji (kwoty, mediany) */
.bar { display: block; height: 4px; border-radius: 999px; background: var(--accent-tint); overflow: hidden; min-width: 3rem; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bar-data { background: var(--data-tint); }
.bar-data > span { background: var(--data); }
/* przedział 25–75 z medianą */
.range { position: relative; display: block; height: 10px; min-width: 8rem; }
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--border); border-radius: 2px; }
.range-iqr { position: absolute; top: 2px; height: 6px; border-radius: 999px; background: color-mix(in oklch, var(--data) 50%, transparent); }
.range-med { position: absolute; top: 0; width: 2px; height: 10px; margin-left: -1px; background: var(--fg); border-radius: 1px; }

/* ---------- listy ---------- */
.results { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: .6rem; }
.results a { display: block; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); text-decoration: none; }
.results a:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); color: var(--fg); }
.results-name { display: block; font-weight: 600; }
.results .muted { font-size: .8125rem; }
.cols { columns: 17rem; column-gap: 2rem; padding: 0; list-style: none; margin: .5rem 0; }
.cols li { break-inside: avoid; padding: .3rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.plain { padding: 0; list-style: none; margin: .5rem 0; }
.plain li { padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.stat-list { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.stat-list li { display: flex; flex-direction: column; gap: .15rem; border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1.1rem; background: var(--bg-raised); min-width: 12rem; font-size: .9375rem; }
.stat-list li.stat-wide { max-width: 40rem; }
.stat-list strong { display: block; font-family: var(--mono); font-size: 1.6rem; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; margin: .15rem 0 .2rem; }
.stat-label { color: var(--fg-muted); font-size: .8125rem; font-weight: 500; }
.source-line { font-size: .8125rem; }
.stat-list strong a { text-decoration: none; }
.link-list { list-style: none; padding: 0; margin: .5rem 0; }
.link-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.link-list .num { white-space: nowrap; }
.source { color: var(--fg-muted); font-size: .8125rem; white-space: nowrap; }
.more { font-weight: 600; text-decoration: none; color: var(--accent); font-size: .9375rem; }
.more:hover { text-decoration: underline; }
.pager { display: flex; gap: 1rem; margin: 1rem 0; }
.pager a { padding: .45rem .9rem; border: 1px solid var(--border-strong); border-radius: 8px; text-decoration: none; font-weight: 500; }
details { margin: .75rem 0; }
summary { cursor: pointer; color: var(--fg-muted); font-weight: 500; font-size: .9375rem; }
.chart { position: relative; max-width: 100%; margin: 1rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); }

/* ---------- strona główna ---------- */
.hero { background: linear-gradient(180deg, var(--bg-alt), var(--bg) 92%); border-bottom: 1px solid var(--border); padding: 3.25rem 0 3rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: center; }
.display { font-size: clamp(2.25rem, 1.4rem + 3.4vw, 3.6rem); line-height: 1.02; font-weight: 800; letter-spacing: -.035em; margin: .35rem 0 1rem; }
.hero-sub { font-size: 1.125rem; color: var(--fg-muted); max-width: 34rem; margin-bottom: 1.6rem; }
.search { margin: 0; max-width: 40rem; }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--fg-muted); pointer-events: none; }
.search-field:focus-within svg { color: var(--accent); }
.search-field input {
  width: 100%; height: 3.5rem; padding: 0 1rem 0 3rem; font-size: 1.0625rem; border-radius: 12px;
  border: 1.5px solid var(--control-border); background: var(--bg-raised);
  box-shadow: 0 0 0 4px transparent; transition: box-shadow .15s, border-color .15s;
}
.search-field input::placeholder { color: var(--fg-muted); }
.search-field input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow); }
.search-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .75rem; font-size: .875rem; color: var(--fg-muted); }
.search-row select { height: 2.25rem; font-size: .875rem; }
.search-row .btn { height: 2.25rem; margin-left: auto; }
.counters { margin: 0; display: grid; gap: 1.4rem; }
.counters div { display: flex; flex-direction: column-reverse; justify-content: flex-end; }
.counters dd { margin: 0; font-family: var(--font); font-variant-numeric: tabular-nums; font-size: clamp(1.6rem, 1rem + 2.8vw, 3.5rem); line-height: 1; font-weight: 700; color: var(--fg-muted); letter-spacing: -.04em; }
.counters dt { font-size: .8125rem; color: var(--fg-muted); margin-top: .35rem; }

.band { padding: 2.75rem 0; border-bottom: 1px solid var(--border); background: var(--bg); }
.band-alt { background: var(--bg-alt); }
.band-plain { border-bottom: 0; }
.section-title { font-size: 1.25rem; font-weight: 700; margin: 0 0 .35rem; }
.section-sub { margin-bottom: 1rem; }

.swarm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25rem 1.5rem; }
.swarm-head p { margin: 0; font-size: .875rem; }
.swarm-figure { margin: 0; }
.swarm-box { position: relative; }
.swarm { display: block; width: 100%; height: auto; overflow: visible; }
.swarm-axis { stroke: var(--border-strong); stroke-width: 1; }
.swarm-tick { stroke: var(--border-strong); stroke-width: 1; }
.swarm-median { stroke: var(--accent); stroke-width: 1.25; stroke-dasharray: 3 3; }
.dot { fill: color-mix(in oklch, var(--data) 62%, transparent); stroke: var(--data); stroke-width: 1; transition: fill .12s; }
.dot-low { fill: color-mix(in oklch, var(--data) 32%, transparent); stroke-dasharray: 2 1.5; }
.swarm-link { cursor: pointer; }
.swarm-link:hover .dot, .swarm-link:focus .dot { fill: var(--accent); stroke: var(--accent); }
.swarm-link:focus { outline: none; }
.swarm-link:focus-visible .dot { stroke: var(--fg); stroke-width: 2.5; }
.swarm-scale { position: relative; height: 2.6rem; margin-top: .35rem; font-size: .75rem; color: var(--fg-muted); }
.swarm-scale > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.swarm-scale > span:first-child { transform: none; }
.swarm-scale > span:last-of-type { transform: translateX(-100%); }
.swarm-median-label { position: absolute; top: 1.2rem; transform: translateX(-50%); white-space: nowrap; color: var(--fg); font-size: .8125rem; font-weight: 700; }
.swarm-median-label .num { font-weight: 700; }
.swarm-tip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 20rem; padding: .5rem .7rem; border-radius: 8px;
  background: var(--fg); color: var(--bg); font-size: .8125rem; line-height: 1.35; box-shadow: var(--shadow);
}
.swarm-tip strong { display: block; font-weight: 600; }
.swarm-narrow { display: none; }
.caption { font-size: .8125rem; color: var(--fg-muted); max-width: 72rem; margin-top: .5rem; line-height: 1.55; }
.caption a { color: var(--fg-muted); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.cards { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .6rem; }
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); padding: .9rem 1.1rem; }
.card-title { font-weight: 500; text-decoration: none; display: block; line-height: 1.4; }
.card-title:hover { text-decoration: underline; }
.amount { display: flex; align-items: center; gap: .75rem; margin: .45rem 0 .35rem; }
.amount-value { font-weight: 700; font-size: 1.0625rem; white-space: nowrap; }
.amount .bar { flex: 1; }
.meta { margin: 0; font-size: .75rem; color: var(--fg-muted); }
.meta a { color: var(--fg-muted); }
.meta-court { text-transform: uppercase; letter-spacing: .03em; }
.ranks { padding: 1rem 1.1rem .4rem; margin-bottom: 1rem; }
.ranks h3 { margin: 0 0 .35rem; }
.ranks h3 + .rank-list { margin-bottom: 1.1rem; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; grid-template-areas: "name value" "bar n";
  gap: .2rem 1rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--border);
}
.rank-list li > a { grid-area: name; font-weight: 500; text-decoration: none; font-size: .9375rem; }
.rank-list li > a:hover { text-decoration: underline; }
.rank-value { grid-area: value; text-align: right; font-weight: 700; white-space: nowrap; }
.rank-list .bar { grid-area: bar; }
.rank-n { grid-area: n; text-align: right; font-size: .75rem; white-space: nowrap; }

.org-list { list-style: none; margin: 0 0 1rem; padding: .3rem 1.1rem; counter-reset: none; }
.org-list li {
  display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; grid-template-areas: "rk name sum" ". bar bar" ". meta meta";
  gap: .2rem .5rem; align-items: baseline; padding: .7rem 0; border-top: 1px solid var(--border);
}
.org-list li:first-child { border-top: 0; }
.org-rank { grid-area: rk; color: var(--fg-muted); font-size: .8125rem; }
.org-name { grid-area: name; font-weight: 500; text-decoration: none; font-size: .9375rem; line-height: 1.4; }
.org-name:hover { text-decoration: underline; }
.org-sum { grid-area: sum; font-weight: 700; white-space: nowrap; text-align: right; }
.org-list .bar { grid-area: bar; align-self: center; margin: .15rem 0; }
.org-meta { grid-area: meta; font-size: .75rem; }
.org-skipped { font-size: .8125rem; margin: 0 0 1rem; }

/* ---------- strony szczegółów ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.prose { max-width: 70ch; }
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.7; }
.prose h2 { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.prose ol, .prose ul { padding-left: 1.3rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--fg-muted); }
.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 2rem; font-size: .9375rem; color: var(--fg-muted); }
.facts strong { color: var(--fg); font-family: var(--mono); font-weight: 600; }

/* ---------- mapa ---------- */
.map-controls { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; margin: 1rem 0; padding: 1rem 1.1rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); }
.map-controls .filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; }
.map-controls > *, .map-controls .field { min-width: 0; max-width: 100%; }
table.wide { min-width: 64rem; }
#mapa-plansza { height: min(68vh, 46rem); min-height: 22rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); overflow: hidden; z-index: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; list-style: none; padding: .6rem 0 0; margin: 0; font-size: .8125rem; color: var(--fg-muted); }
.legend .sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid var(--fg); vertical-align: -.1rem; margin-right: .35rem; }
.leaflet-container { font-family: var(--font) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-raised) !important; color: var(--fg) !important; box-shadow: var(--shadow) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--radius) !important; border: 1px solid var(--border); }
.leaflet-popup-content { color: var(--fg); font-size: .875rem; line-height: 1.45; }
.leaflet-popup-content strong { font-size: .9375rem; }
.leaflet-popup-content a { color: var(--accent); }
.leaflet-container a.leaflet-popup-close-button { color: var(--fg-muted); }
.leaflet-bar a { background: var(--bg-raised) !important; color: var(--fg) !important; border-color: var(--border) !important; }
.leaflet-control-attribution { background: color-mix(in oklch, var(--bg) 85%, transparent) !important; color: var(--fg-muted) !important; }
.leaflet-control-attribution a { color: var(--fg-muted) !important; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.6); } }

/* ---------- telefon ---------- */
@media (max-width: 60rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .counters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 48rem) {
  :root { --gutter: 16px; }
  header.site .topbar { flex-wrap: wrap; gap: 0 1rem; padding-bottom: 0; }
  .brand { order: 1; }
  .theme-toggle { order: 2; margin-left: auto; }
  header.site nav {
    order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) .45rem;
    overflow-x: auto; scrollbar-width: none; gap: .1rem;
  }
  header.site nav::-webkit-scrollbar { display: none; }
  header.site nav a { padding: .35rem .55rem; font-size: .875rem; }
  header.site nav a:first-child { padding-left: 0; }
  .hero { padding: 2rem 0 2rem; }
  .counters dt { font-size: .75rem; }
  .search-row .btn { margin-left: 0; }
  .band { padding: 2rem 0; }
  .swarm-wide { display: none; }
  .swarm-narrow { display: block; }
  .swarm-scale.swarm-narrow { display: block; }
  .page { padding-top: 1.5rem; }
  .rank-list li { grid-template-columns: minmax(0, 1fr) auto; }
  h2 { margin-top: 2.25rem; }
  .map-controls, .map-controls .filters { flex-direction: column; align-items: stretch; }
  .map-controls select, .map-controls input[type="number"], .filters-row select { width: 100%; }
  #mapa-plansza { height: 62vh; max-height: 30rem; }
  th, td { padding: .6rem .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
.nowrap { white-space: nowrap; }
.notfound { padding: 3rem 0 4rem; max-width: 40rem; }
.btn-link { display: inline-flex; align-items: center; text-decoration: none; color: #fff; }
.btn-link:hover { color: #fff; }
:root[data-theme="dark"] .btn-link, :root[data-theme="dark"] .btn-link:hover { color: oklch(17% .016 261); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-link, :root:not([data-theme="light"]) .btn-link:hover { color: oklch(17% .016 261); } }
.prose .facts { padding-left: 0; }
.prose .facts li { margin: 0; font-size: .9375rem; }
.stat-list.roles li { color: var(--fg-muted); font-size: .8125rem; font-weight: 500; }
.stat-list.roles strong { color: var(--fg); }
.table-wrap tbody th { min-width: 10rem; }
.prose p.eyebrow { font-size: .75rem; line-height: 1.6; }
.prose p.lead { font-size: 1.125rem; }

/* Widgety strony głównej: siatka kart. Grupa zaczyna się nagłówkiem na całą szerokość. */
.widget-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.widget-group { grid-column: 1 / -1; margin: 18px 0 0; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); border-top: 1px solid var(--border); padding-top: 14px; }
.widget-group:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.widget { background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.widget.wide { grid-column: span 2; }
.widget-kicker { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.widget-title { margin: 0; font-size: 1.02rem; line-height: 1.35; font-weight: 700; }
.widget-big { margin: 0; font-family: var(--mono); font-size: 2.2rem; font-weight: 700; line-height: 1.05; letter-spacing: -.02em; }
.widget-big small { font-size: .9rem; font-weight: 500; color: var(--fg-muted); margin-left: 4px; }
.widget-note { margin: 0; font-size: .85rem; color: var(--fg-muted); line-height: 1.45; }
.widget-chart { width: 100%; height: auto; display: block; overflow: visible; }
.widget-chart text { font-family: var(--mono); font-size: 10px; fill: var(--fg-muted); }
.widget-chart .c-line { fill: none; stroke: var(--data); stroke-width: 2; }
.widget-chart .c-area { fill: var(--data-tint); }
.widget-chart .c-bar { fill: var(--data); }
.widget-chart .c-hl { fill: var(--accent); }
.widget-chart .c-grid { stroke: var(--border); stroke-width: 1; }
.widget-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.widget-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; }
.widget-list .bar { grid-column: 1 / -1; }
.widget-more { margin-top: auto; font-size: .85rem; font-weight: 600; }
@media (max-width: 640px) { .widget.wide { grid-column: auto; } .widget-big { font-size: 1.9rem; } }

/* kontekst */
.limits { margin: 2.5rem 0 1.5rem; padding: 1rem 1.2rem; max-width: 60rem; border: 1px solid var(--border); border-left: 3px solid var(--fg-muted); border-radius: var(--radius); background: var(--bg-alt); font-size: .9375rem; }
.limits .limits-title { margin: 0 0 .5rem; font-size: 1rem; }
.limits ul { margin: 0 0 .6rem; padding-left: 1.2rem; }
.limits li { margin: .25rem 0; }
.limits li::marker { color: var(--fg-muted); }
.limits-more { margin: 0; font-size: .875rem; }
.context-list { list-style: none; padding: 0; margin: .5rem 0 .75rem; max-width: 60rem; }
.context-list li { display: flex; flex-direction: column; gap: .1rem; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9375rem; }
.context-rep { font-weight: 600; }
.context-vals strong { font-family: var(--mono); font-weight: 600; }
.context-rank { color: var(--fg-muted); font-size: .875rem; }
.ci { font-size: .75rem; font-family: var(--font); }
/* pasek „zmienione lub uchylone” na tle całości: niebieski danych i szary, bez czerwieni */
.split { display: block; height: 8px; min-width: 6rem; border-radius: 999px; background: var(--border-strong); overflow: hidden; }
.split-a { display: block; height: 100%; background: var(--data); }

/* przegląd rundy 5 */
/* .sr (position: absolute) w tabeli wychodził poza przewijany .table-wrap i poszerzał stronę na telefonie */
.table-wrap { position: relative; }
form.inline.compact { min-width: 0; max-width: 100%; }
form.inline.compact select { max-width: 100%; min-width: 0; }
@media (max-width: 48rem) {
  /* menu ma 7 linków i przewija się w bok: wygaszona prawa krawędź pokazuje, że jest dalej */
  header.site nav { padding-right: 3.5rem; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
}

/* sad-gora: góra strony sądu — trzy liczby, „Najważniejsze”, tabela braków */
.court-data-line { margin: .35rem 0 0; font-size: .875rem; }
.court-top { margin: 1.25rem 0 2rem; }
.court-cards { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); max-width: 62rem; }
.court-cards li { min-width: 0; }
.court-cards a { display: flex; flex-direction: column; gap: .2rem; height: 100%; box-sizing: border-box; padding: .85rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-raised); color: var(--fg); text-decoration: none; }
.court-cards a:hover { border-color: var(--border-strong); }
.court-card-value { font-family: var(--mono); font-size: 1.75rem; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums; }
.court-card-label { color: var(--fg-muted); font-size: .875rem; }
.court-card-src { color: var(--fg-muted); font-size: .75rem; }
.court-findings { margin: .5rem 0 .5rem; padding-left: 1.4rem; max-width: 62rem; }
.court-findings li { margin: .45rem 0; }
.court-findings li::marker { color: var(--fg-muted); font-weight: 600; }
.court-findings .more { font-size: .875rem; white-space: nowrap; }
.court-findings-note { font-size: .8125rem; max-width: 62rem; }
details.how { max-width: 62rem; }
.unpublished-table th[scope="row"] { font-weight: 600; min-width: 9rem; }
.unpublished-table td { vertical-align: top; font-size: .9375rem; min-width: 14rem; }
.unpublished-table th[scope="row"] { vertical-align: top; }
@media (max-width: 48rem) {
  .court-cards { gap: .5rem; }
  .court-cards a { padding: .6rem .9rem; }
  .court-card-value { font-size: 1.4rem; }
  /* tabela braków jako karty: trzy kolumny nie mieszczą się na telefonie */
  .unpublished-table thead { display: none; }
  .unpublished-table, .unpublished-table tbody, .unpublished-table tr, .unpublished-table th, .unpublished-table td { display: block; min-width: 0; }
  .unpublished-table tr { padding: .4rem 0; border-bottom: 1px solid var(--border); }
  .unpublished-table td::before { content: attr(data-label); display: block; color: var(--fg-muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
}
.court-cards .warn { align-self: flex-start; }

/* przegląd rundy 6: menu (8 linków), szukanie w nagłówku, stopka w dwóch grupach */
header.site .topbar { gap: 1rem; }
header.site nav { gap: 0; }
header.site nav a { padding: .4rem .5rem; }
.hsearch { position: relative; display: flex; align-items: center; flex: none; }
.hsearch label { position: absolute; left: .55rem; top: 50%; transform: translateY(-50%); display: grid; place-items: center; color: var(--fg-muted); cursor: text; }
.hsearch input {
  width: 14rem; height: 38px; padding: 0 .6rem 0 2rem; font: inherit; font-size: .875rem;
  border: 1px solid var(--control-border); border-radius: 8px; background: var(--bg); color: var(--fg);
}
.hsearch input::placeholder { color: var(--fg-muted); }
.hsearch input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
@media (max-width: 75rem) {
  /* na węższym ekranie pole to sama lupa; po kliknięciu rozwija się nad menu */
  .hsearch input { width: 38px; padding: 0; padding-left: 36px; color: transparent; cursor: pointer; }
  .hsearch input::placeholder { color: transparent; }
  .hsearch label { left: 0; width: 38px; cursor: pointer; }
  .hsearch:focus-within { position: absolute; left: var(--gutter); right: var(--gutter); top: 11px; z-index: 2; }
  .hsearch:focus-within input { width: 100%; padding-left: 2rem; color: var(--fg); cursor: text; }
  .hsearch:focus-within input::placeholder { color: var(--fg-muted); }
  .hsearch:focus-within label { left: .55rem; width: auto; }
  header.site .topbar { position: relative; }
}
/* nazwa „wokanda” + 8 linków: między telefonem a laptopem menu się nie mieściło */
@media (min-width: 48.01rem) and (max-width: 62rem) {
  header.site .topbar { gap: .6rem; }
  header.site nav a { padding: .4rem .3rem; font-size: .875rem; }
}
@media (max-width: 48rem) {
  .hsearch { order: 2; margin-left: auto; }
  .theme-toggle { order: 2; margin-left: 0; }
}
footer.site .foot-groups { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin-top: 1rem; }
footer.site .foot-groups nav { line-height: 1.9; }
footer.site .foot-groups h2 { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--fg); margin: 0 0 .25rem; }

/* ux-d: układ, tabele, dostępność, menu na telefonie */
:root { --hdr-h: 61px; --control-border: oklch(66% .03 268); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --control-border: oklch(60% .03 262); } }
:root[data-theme="dark"] { --control-border: oklch(60% .03 262); }

/* kotwice nie chowają się pod przyklejonym nagłówkiem */
[id] { scroll-margin-top: calc(var(--hdr-h) + 1rem); }

/* pola wyszukiwania i formularze: spokojne w spoczynku, akcent przy fokusie; krawędź co najmniej 3:1 */
/* (reguły pól są wyżej: formularze, .search-field, .hsearch; ux-f scalił je w jeden zestaw) */

/* tabele: przyklejony wiersz nagłówka pod nagłówkiem strony */
thead th { font-size: .8125rem; }
table .warn, table .ci, table small { font-size: .8125rem; }
.js thead th { position: sticky; top: var(--hdr-h); z-index: 2; }
.js .table-wrap:not(.fits):not(.is-scrollable) thead th { position: static; }
.table-wrap.fits { overflow: visible; }
.table-wrap.fits thead th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.table-wrap.fits thead th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.table-wrap.fits tbody tr:last-child > :first-child { border-bottom-left-radius: calc(var(--radius) - 1px); }
.table-wrap.fits tbody tr:last-child > :last-child { border-bottom-right-radius: calc(var(--radius) - 1px); }
/* tabela szersza niż ekran: przewija się w bok; wysoka dostaje własną ramkę, żeby nagłówek został na widoku */
.js .table-wrap.is-scrollable thead th { position: static; top: auto; }
.table-wrap.is-scrollable.tall { max-height: calc(100vh - var(--hdr-h) - 1rem); overflow: auto; }
.js .table-wrap.is-scrollable.tall thead th { position: sticky; top: 0; }
.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scroll-hint { display: none; margin: .5rem 0 0; font-size: .8125rem; color: var(--fg-muted); }

/* cele dotykowe co najmniej 24 px */
footer.site a, th a, td a, .link-list a, a.more { display: inline-block; padding-block: .3rem; }
footer.site .foot-groups nav { line-height: 1.5; }

.menu-toggle { display: none; }
@media (max-width: 48rem) {
  .scroll-hint:not([hidden]) { display: block; }
  .js .table-wrap.is-scrollable.sticky-col tbody th:first-child,
  .js .table-wrap.is-scrollable.sticky-col thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-raised); box-shadow: 1px 0 0 var(--border-strong); }
  .js .table-wrap.is-scrollable.sticky-col thead th:first-child { z-index: 3; background: var(--bg-alt); }
  .table-wrap tbody th { min-width: 7rem; }

  /* menu: bez JS lista zawija się pod nagłówkiem; z JS zwija ją przycisk „Menu” */
  header.site nav { order: 3; flex-basis: 100%; margin: 0; padding: 0 0 .5rem; overflow: visible; flex-wrap: wrap; gap: .1rem .25rem; -webkit-mask-image: none; mask-image: none; }
  header.site nav a, header.site nav a:first-child { padding: .5rem .65rem; font-size: .9375rem; }
  .js header.site nav.nav-closed { display: none; }
  .menu-toggle:not([hidden]) {
    display: inline-flex; align-items: center; order: 2; height: 38px; padding: 0 .85rem; flex: none;
    font: inherit; font-size: .875rem; font-weight: 600; color: var(--fg); background: var(--bg);
    border: 1px solid var(--control-border); border-radius: 8px; cursor: pointer;
  }
  .menu-toggle:hover { background: var(--bg-alt); }
  .menu-toggle[aria-expanded="true"] { border-color: var(--accent); }
}

/* ux-a: strona główna — „Który sąd jest mój?” w hero, szukanie sądu przy osi czasu, krótsze „Sądy w liczbach” */
.hero .ms-box { padding: 0; }
.ms-box-label { display: block; font-size: 1.125rem; color: var(--fg-muted); margin-bottom: .6rem; }
.hero-more { font-size: .9375rem; margin: 1.25rem 0 0; }
.court-search { max-width: none; margin: 1rem 0 1.25rem; }
.court-search-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; }
.court-search-fields label { display: block; font-size: .875rem; color: var(--fg-muted); margin-bottom: .3rem; }
.court-search-q { flex: 1 1 18rem; min-width: 0; }
.court-search-type { flex: 1 1 16rem; min-width: 0; }
.court-search-type select { width: 100%; height: 3.5rem; }
.court-search .btn { height: 3.5rem; }
.home-results { margin: 0 0 2rem; scroll-margin-top: 6rem; }
.results-title { font-size: 1.0625rem; font-weight: 700; margin: 0 0 .6rem; scroll-margin-top: 6rem; }
.swarm-head { margin-top: .5rem; }
.dot-hit { fill: transparent; stroke: none; pointer-events: all; }
.swarm-hint-narrow { display: none; }
.swarm-table {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1rem; margin-top: .25rem;
  border: 1.5px solid var(--accent); border-radius: var(--radius); color: var(--accent);
  font-weight: 600; font-size: .9375rem; text-decoration: none;
}
.swarm-table:hover { background: var(--accent-tint); color: var(--accent); }
.widget-grid .widget.fakty-card { grid-column: 1 / -1; }
.widget-grid .fakty-card .fakty { grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); column-gap: 2rem; }
.widget-grid .fakty-card .fakty li:nth-child(2) { border-top: 0; padding-top: 0; }
.widget-grid-short { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
@media (max-width: 1000px) { .widget-grid .fakty-card .fakty li:nth-child(2) { border-top: 1px solid var(--border); padding-top: 12px; } }
@media (max-width: 640px) {
  .swarm-hint-wide { display: none; }
  .swarm-hint-narrow { display: inline; }
  .court-search .btn { width: 100%; }
  .ms-box-label { font-size: 1rem; }
}
.swarm-median-label.at-end { transform: translateX(-100%); }
.swarm-median-label.at-start { transform: none; }

/* ux-e */
.check-label, .field > label.check-label { display: flex; align-items: flex-start; gap: .5rem; font-size: .9375rem; color: var(--fg); cursor: pointer; text-transform: none; letter-spacing: normal; font-weight: 400; margin: 0; }
.check-label input { margin: .2rem 0 0; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--accent); }
.field-check { align-self: center; }
.dl-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.dl-btn { font: inherit; font-size: .875rem; cursor: pointer; text-decoration: none; color: var(--fg); background: var(--bg-raised); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .35rem .75rem; }
.dl-btn:hover { border-color: var(--accent); color: var(--accent); }
.dl-btn[hidden] { display: none; }
.dated { margin: -.25rem 0 .75rem; font-size: .9375rem; }

/* ux-f: liczba w zdaniu ma krój tekstu; tabele, listy liczb i duże liczby zostają przy kroju o stałej szerokości */
p .num, #ruch-spraw strong.num { font-family: inherit; font-variant-numeric: normal; letter-spacing: normal; }
.widget-big .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.search-row .num { white-space: nowrap; }

/* _art212.html: blok Fedrowanie na /sprawdzamy-sie i /przepis/kk/212 */
.art212 .lead-sm { font-size: 1.0625rem; max-width: 50rem; }
.art212 .why { max-width: 62rem; padding-left: 1.25rem; }
.art212 .why li { margin-bottom: .6rem; }
.art212 th a.sort { text-decoration: none; color: inherit; }
.art212 th a.sort:hover { color: var(--accent); }
.art212 th[aria-sort="ascending"] a.sort::after { content: " \25B2"; font-size: .7em; color: var(--accent); }
.art212 th[aria-sort="descending"] a.sort::after { content: " \25BC"; font-size: .7em; color: var(--accent); }
.art212-table tbody th { font-weight: 400; }
