:root {
  --bg: #fbfaf8; --surface: #ffffff; --text: #1d1d1f; --muted: #6b6b70; --line: #e4e2dd;
  --accent: #1d5fc4; --y: #1f7a4d; --n: #b3261e; --a: #9a6b00; --x: #8a8a8f;
  --ins-bg: #dff3e6; --del-bg: #fbe1df; --warn-bg: #fff1cc;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416; --surface: #1c1c1f; --text: #ececee; --muted: #9a9aa2; --line: #2e2e33;
    --accent: #7db8ff; --y: #4cc48a; --n: #ff6b60; --a: #e0b240; --x: #8a8a8f;
    --ins-bg: #16402a; --del-bg: #4a1d1b; --warn-bg: #4a3a10;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); }
nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
nav a { color: var(--muted); }
main { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 32px 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat b { display: block; font-size: 1.5rem; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.adopted { background: var(--ins-bg); color: var(--y); }
.badge.rejected { background: var(--del-bg); color: var(--n); }
.badge.warn { background: var(--warn-bg); color: var(--a); }
.counts .y { color: var(--y); } .counts .n { color: var(--n); } .counts .a { color: var(--a); }
.v-Y { color: var(--y); } .v-N { color: var(--n); } .v-A { color: var(--a); } .v-X { color: var(--x); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); white-space: nowrap; }
th[data-sort] { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.amendment { border-left: 3px solid var(--line); }
.amendment.rec-przyjąć { border-left-color: var(--y); }
.amendment.rec-odrzucić { border-left-color: var(--n); }
.amendment .text { white-space: pre-wrap; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; }
.diff { margin-top: 10px; padding: 8px 10px; background: var(--bg); border-radius: 6px; font-family: Georgia, serif; }
.diff .where { font-family: system-ui, sans-serif; font-size: .8rem; color: var(--muted); display: block; }
ins { background: var(--ins-bg); text-decoration: none; padding: 0 2px; border-radius: 2px; }
del { background: var(--del-bg); padding: 0 2px; border-radius: 2px; }
.note { font-size: .9rem; color: var(--muted); margin: 6px 0 0; }
.snippet { font-size: .88rem; color: var(--muted); }
.bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; min-width: 120px; background: var(--line); }
.bar span { display: block; }
.bar .Y { background: var(--y); } .bar .N { background: var(--n); } .bar .A { background: var(--a); } .bar .X { background: var(--x); opacity: .35; }
.agenda { margin-top: 28px; }
.agenda h3 { margin-bottom: 4px; }
.club-toggle { font: inherit; font-weight: 600; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; white-space: nowrap; }
.club-toggle::before { content: "▸ "; display: inline-block; width: 1em; color: var(--muted); }
.club-toggle[aria-expanded="true"]::before { content: "▾ "; }
.club-row { cursor: pointer; }
.club-row:hover > td { background: var(--bg); }
.names-row > td { background: var(--bg); padding: 12px 16px; }
.name-cols { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); font-size: .9rem; }
.name-cols p { margin: 8px 0 4px; }
.name-cols ul { list-style: none; margin: 0; padding: 0; }
.name-cols li.rebel { font-weight: 700; }
.name-cols li.rebel::after { content: " ⚑"; color: var(--a); }
.foot { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 32px; }
.callout { background: var(--warn-bg); border-radius: 8px; padding: 10px 14px; margin: 12px 0; }
.print-text { font-family: Georgia, "Times New Roman", serif; max-width: 72ch; }
.print-text p { margin: 0 0 .6em; }
.amendment:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang { margin-left: auto; font-size: .9rem; color: var(--muted); }
h2.h3 { font-size: 1rem; margin-bottom: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin: 8px 0 12px; }
.filters select { font: inherit; padding: 4px 8px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
details.law { margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
details.law summary { cursor: pointer; }
.law-change { font-size: .95rem; }
.warn-text { color: var(--a); }
pre.code { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: .85rem; }
code { font-size: .9em; }
.rows { margin-top: 4px; }
.rows .r { padding: 2px 6px 2px calc(6px + var(--d, 0) * 1.4em); border-radius: 3px; }
.rows .r-context, .rows .r-parent { color: var(--muted); font-size: .9em; }
.rows .r-parent { font-style: italic; }
.rows .r-gap { color: var(--muted); }
.rows .r-added { background: var(--ins-bg); }
.rows .r-removed { background: var(--del-bg); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--n) 60%, transparent); }
.rows .r-changed { border-left: 3px solid var(--a); }
.r-legend { white-space: nowrap; }
.support-note { position: fixed; right: 16px; bottom: 70px; z-index: 10; width: min(320px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 6px 24px rgb(0 0 0 / .18); font-size: .9rem; }
.support-note p { margin: 0 0 8px; }
.support-note p:last-child { margin: 0; display: flex; gap: 12px; align-items: center; }
.support-close { position: absolute; top: 4px; right: 8px; font-size: 1.2rem; line-height: 1; }
.support-close, .support-later { background: none; border: 0; padding: 4px; color: var(--muted); cursor: pointer; font: inherit; }
.support-link { font-weight: 600; }
@media print { .support-note { display: none; } }
.sm-choice { position: fixed; left: 16px; bottom: 16px; z-index: 11; width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  box-shadow: 0 6px 24px rgb(0 0 0 / .18); font-size: .88rem; }
.sm-choice p { margin: 0 0 8px; }
.sm-choice-actions { display: flex; gap: 8px; justify-content: flex-end; margin: 0 !important; }
.sm-choice-actions button { font: inherit; padding: 4px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; }
@media print { .sm-choice { display: none; } }
.support-pill { position: fixed; right: 16px; bottom: 16px; z-index: 9; padding: 9px 18px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--accent); color: var(--text); font-size: .92rem; font-weight: 700;
  box-shadow: 0 4px 14px rgb(0 0 0 / .2); }
.support-pill:hover { opacity: 1; text-decoration: none; border-color: var(--accent); }
.foot { padding-bottom: 88px; }
@media (max-width: 600px) { .sm-choice { bottom: 84px; } .support-pill { padding: 8px 14px; font-size: .84rem; } }
@media print { .support-pill { display: none; } }
.law-index { margin: 8px 0 12px; font-size: .9rem; }
.law-index p { margin: 0 0 6px; }
.law-index .chip { display: inline-block; margin: 2px 2px 0 0; padding: 0 7px; border: 1px solid var(--line); border-radius: 99px; font-size: .85em; white-space: nowrap; }
.law-change:target, details.law:target > summary { outline: 2px solid var(--accent); outline-offset: 2px; }
.law-change, details.law { scroll-margin-top: 12px; }
.filters input[type="search"] { font: inherit; padding: 4px 8px; min-width: min(280px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 6px; }
.mp-head { display: flex; gap: 16px; align-items: flex-start; }
.mp-photo { width: 96px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); flex: none; }
.signers { margin: 4px 0 12px; } .signers summary { cursor: pointer; color: var(--muted); }
.names-inline { font-size: .9rem; margin: 6px 0; }
.side-toc { position: fixed; top: 76px; right: 12px; width: 210px; max-height: calc(100vh - 190px); overflow-y: auto; z-index: 8;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: .82rem; display: none; }
.side-toc.open { display: block; box-shadow: 0 6px 24px rgb(0 0 0 / .18); }
.side-toc a { display: block; color: var(--text); padding: 2px 0; }
.side-toc a.side-toc-h { font-weight: 600; margin-top: 6px; }
.side-toc .side-toc-sub { color: var(--muted); margin: 2px 0 0 8px; }
.side-toc-chips { margin: 2px 0 4px 8px; display: flex; flex-wrap: wrap; gap: 3px; }
.side-toc-chips a { padding: 0 6px; border: 1px solid var(--line); border-radius: 99px; color: var(--accent); }
.side-toc-toggle { position: fixed; top: 64px; right: 12px; z-index: 9; font: inherit; font-size: .85rem; padding: 4px 10px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.side-toc.open { top: 100px; }
h2, .amendment, .print-text p { scroll-margin-top: 12px; }
.print-text p:target { background: var(--warn-bg); }
@media (min-width: 1540px) {
  .side-toc { display: block; top: 76px; }
  .side-toc.open { top: 76px; box-shadow: none; }
  .side-toc-toggle { display: none; }
}
@media print { .side-toc, .side-toc-toggle { display: none; } }
.subnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.subnav a { padding: 3px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); font-size: .92rem; }
.subnav a.current { border-color: var(--accent); font-weight: 600; color: var(--text); }
#amend-table tr { content-visibility: auto; contain-intrinsic-size: auto 64px; }
.tagline { font-size: 1.1rem; color: var(--muted); margin-top: 0; }
