/* Prawda o TK — minimalizm: dużo światła, wyraźna typografia, czerwień flagi jako jedyny akcent.
   Fonty wyłącznie systemowe (brak zapytań do zewnętrznych serwerów). */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --paper: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;          /* 5,1:1 na bieli */
  --rule: #e5e5ea;
  --rule-strong: #d2d2d7;

  --red: #dc143c;            /* czerwień flagi */
  --red-ink: #c0102f;        /* tekst/linki: 6:1 na bieli */
  --red-soft: #fdecef;
  --white-flag: #ffffff;

  --st-current: #1a7f37;
  --st-former: #6e6e73;
  --st-disputed: #b25000;
  --st-unsworn: #6e4bc3;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Inter", "Segoe UI", Roboto, "Noto Sans", "DejaVu Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 18px;
  --radius-sm: 12px;
  --measure: 68ch;
  --ease: cubic-bezier(.25, .1, .25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-alt: #111113;
    --paper: #1c1c1e;
    --ink: #f5f5f7;
    --ink-2: #d1d1d6;
    --muted: #98989d;
    --rule: #2c2c2e;
    --rule-strong: #3a3a3c;
    --red: #ff375f;
    --red-ink: #ff5c7a;
    --red-soft: #3a0f19;
    --white-flag: #f5f5f7;
    --st-current: #30d158;
    --st-former: #98989d;
    --st-disputed: #ff9f0a;
    --st-unsworn: #bf5af2;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--font);
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
  hanging-punctuation: first;
}
a { color: var(--red-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.1; font-weight: 600; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin: .15em 0 .35em; letter-spacing: -.035em; font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 3.5rem 0 1rem; }
h3 { font-size: 1.12rem; margin: 1.2rem 0 .4rem; letter-spacing: -.015em; }
p { margin: .4em 0 1em; max-width: var(--measure); text-wrap: pretty; }
code { font: .88em var(--mono); background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* wstęga flagi — biel i czerwień */
.flag-band { height: 6px; background: linear-gradient(to bottom, var(--white-flag) 0 50%, var(--red) 50% 100%); border-top: 1px solid var(--rule); }

/* nagłówek: przezroczysty pasek */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-bottom: 1px solid color-mix(in srgb, var(--rule-strong) 60%, transparent); }
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 52px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand-mark { width: 22px; height: 16px; border-radius: 3px; overflow: hidden; display: grid; grid-template-rows: 1fr 1fr; box-shadow: 0 0 0 1px var(--rule-strong); flex: none; }
.brand-mark::before { content: ""; background: var(--white-flag); }
.brand-mark::after { content: ""; background: var(--red); }
.brand-mark span { display: none; }
.brand-text { font-weight: 600; font-size: 1rem; letter-spacing: -.02em; }
.brand-text small { display: none; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: var(--ink-2); padding: 6px 10px; font-size: .8rem; font-weight: 400; letter-spacing: -.005em; text-decoration: none; opacity: .88; transition: opacity .2s var(--ease), color .2s var(--ease); position: relative; }
.nav a:hover { opacity: 1; color: var(--ink); text-decoration: none; }
.nav a.active { color: var(--ink); opacity: 1; font-weight: 600; }
.nav a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--red); }
.nav-toggle { display: none; margin-left: auto; font: inherit; font-size: .88rem; background: none; border: 0; color: var(--ink); padding: 6px 4px; }

main { padding-top: 40px; padding-bottom: 88px; min-height: 60vh; }
main:focus { outline: none; }

/* stopka */
.site-footer { background: var(--bg-alt); color: var(--muted); font-size: .8rem; line-height: 1.55; }
.site-footer .wrap { padding-top: 22px; padding-bottom: 28px; }
.site-footer p { max-width: none; }
.site-footer .motto { color: var(--ink-2); font-size: .95rem; border-bottom: 1px solid var(--rule-strong); padding-bottom: 14px; margin-bottom: 14px; }

/* hero */
.hero { text-align: center; padding: clamp(24px, 6vw, 72px) 0 clamp(32px, 5vw, 56px); }
.hero .eyebrow { justify-content: center; }
.hero h1 { font-size: clamp(2.6rem, 7.5vw, 5rem); line-height: 1.04; margin: .3em auto .3em; max-width: 14ch; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero .lede { margin: 0 auto; text-align: center; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 1.05rem; font-weight: 400; text-decoration: none !important; transition: opacity .2s var(--ease); }
.btn-primary { background: var(--red); color: #fff !important; padding: 11px 22px; border-radius: 99px; }
.btn-primary:hover { opacity: .88; }
.btn-ghost { color: var(--red-ink) !important; padding: 11px 0; }
.btn-ghost::after { content: "›"; font-size: 1.25em; line-height: 0; margin-left: 2px; }
.btn-ghost:hover { text-decoration: underline !important; }

.quote { text-align: center; padding: clamp(40px, 7vw, 80px) 22px; margin: 8px 0 0; background: var(--bg-alt); border-radius: var(--radius); }
.quote blockquote { margin: 0 auto; max-width: 30ch; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1.3; font-weight: 600; letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.quote figcaption { margin-top: 16px; font-size: .88rem; color: var(--muted); }

/* bloki */
.lede { font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.45; color: var(--muted); max-width: 40em; letter-spacing: -.015em; font-weight: 400; }
.card { background: var(--bg-alt); border-radius: var(--radius); padding: 24px 28px; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stats { margin-top: 20px; }
.stat-card { text-align: left; }
.stat { font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 700; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: .9rem; color: var(--muted); margin-top: 10px; }
.notice { background: var(--bg-alt); padding: 18px 22px; border-radius: var(--radius-sm); margin: 24px 0; max-width: none; }
.notice.info { background: var(--bg-alt); }
.notice p:last-child { margin-bottom: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--red-ink); margin: 0; letter-spacing: -.005em; }
.eyebrow::before { content: ""; width: 16px; height: 11px; border-radius: 2px; background: linear-gradient(to bottom, var(--white-flag) 0 50%, var(--red) 50% 100%); box-shadow: 0 0 0 1px var(--rule-strong); flex: none; }
.eyebrow a { color: inherit; }
.footnotes .eyebrow::before { display: none; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 3.5rem 0 1rem; }
.section-title h2 { margin: 0; }
.section-title a { font-size: 1rem; }
.section-title a::after { content: " ›"; }
.page-lede { margin-bottom: 28px; }

/* plan 15 miejsc */
.seats { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
@media (max-width: 820px) { .seats { grid-template-columns: minmax(0, 1fr); } }
.seat-svg { width: 100%; height: auto; display: block; max-width: 520px; margin: 0 auto; }
.seat-svg.legend-dot { width: 12px; height: 12px; display: inline-block; margin: 0; flex: none; }
.seat-svg.legend-dot circle { stroke: none; }
.seat-svg circle { stroke: var(--bg-alt); stroke-width: 3; transition: transform .2s var(--ease); transform-box: fill-box; transform-origin: center; }
.seat-svg a:hover circle, .seat-svg a:focus circle { transform: scale(1.12); }
.seat-svg .s-current { fill: var(--st-current); }
.seat-svg .s-disputed { fill: var(--st-disputed); }
.seat-svg .s-former { fill: var(--muted); }
.seat-svg .s-unsworn { fill: var(--st-unsworn); }
.seat-svg .s-vacant { fill: none; stroke: var(--rule-strong); stroke-dasharray: 4 3; stroke-width: 2; }
.seat-svg text { font: 600 12px var(--font); fill: var(--bg-alt); pointer-events: none; }
.seat-svg text.s-vacant-t { fill: var(--muted); }
.seat-svg .bench { fill: none; stroke: var(--rule-strong); stroke-width: 1; }
.seat-svg .center-t { font: 700 40px var(--font); fill: var(--ink); letter-spacing: -.04em; }
.seat-svg .center-s { font: 400 12px var(--font); fill: var(--muted); }
.seat-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.leadership { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin: 8px 0 8px; }
.leadership .card h3 { margin-top: 4px; }
.seat-list li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.seat-list li:last-child { border-bottom: 0; }
.seat-list .no { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .8rem; width: 1.6em; flex: none; text-align: right; }

/* status */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 500; white-space: nowrap; vertical-align: middle; letter-spacing: -.005em; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-current { color: var(--st-current); }
.st-former { color: var(--st-former); }
.st-disputed { color: var(--st-disputed); }
.st-unsworn { color: var(--st-unsworn); }
.tag { display: inline-block; font-size: .76rem; font-weight: 500; padding: 2px 10px; border-radius: 99px; background: var(--bg-alt); color: var(--ink-2); margin: 0 4px 4px 0; }
.law { display: block; margin-top: 4px; font-size: .84rem; color: var(--muted); }
.law::before { content: "§ "; color: var(--red-ink); font-weight: 600; }

/* filtry */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 24px; }
.filters input[type=search], .filters select {
  font: inherit; font-size: .95rem; padding: 10px 16px; border: 0; border-radius: 12px;
  background: var(--bg-alt); color: var(--ink); min-width: 0; -webkit-appearance: none; appearance: none;
}
.filters select { padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.filters input[type=search] { flex: 1 1 280px; }
.filters input[type=search]:focus, .filters select:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 35%, transparent); }
.segmented { display: inline-flex; flex-wrap: wrap; background: var(--bg-alt); border-radius: 10px; padding: 3px; gap: 2px; }
.chip { font: inherit; font-size: .86rem; font-weight: 500; padding: 6px 14px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed=true] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .chip[aria-pressed=true] { background: #3a3a3c; } }
.count { font-size: .86rem; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* lista osób */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.person { display: block; color: inherit; background: var(--bg-alt); border-radius: var(--radius); padding: 22px 24px; transition: transform .25s var(--ease), background .25s var(--ease); text-decoration: none !important; }
.person:hover { transform: scale(1.015); color: inherit; }
.person h3 { margin: 0 0 6px; font-size: 1.15rem; }
.person .meta { font-size: .86rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 4px; }
.person .sum { font-size: .9rem; color: var(--ink-2); margin: 12px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.person .more { display: inline-block; margin-top: 12px; font-size: .9rem; color: var(--red-ink); }
.person .more::after { content: " ›"; }

/* profil */
.profile-hero { padding: 8px 0 12px; border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.profile-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: .2em 0 .1em; }
.facts { list-style: none; padding: 0; margin: 0; }
.facts li { padding: 14px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; }
.facts li:last-child { border-bottom: 0; }
.facts .k { color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; padding-top: 1px; }
.facts .v { max-width: var(--measure); }
@media (max-width: 640px) { .facts li { grid-template-columns: 1fr; gap: 2px; } }
.section { margin-top: 48px; }
.section > h2 { margin: 0 0 8px; font-size: 1.45rem; }
.legal { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.legal:last-child { border-bottom: 0; }
.legal .by { font-weight: 600; font-size: .86rem; color: var(--ink); margin-bottom: 4px; }
.legal .by span { color: var(--muted); font-weight: 400; }

/* przypisy */
sup.cite { font-size: .66em; line-height: 0; margin-left: 2px; white-space: nowrap; }
sup.cite a { padding: 0 2px; font-weight: 600; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.footnotes { font-size: .84rem; color: var(--ink-2); margin-top: 64px; border-top: 1px solid var(--rule-strong); padding-top: 14px; }
.footnotes h2 { font-size: .84rem; font-weight: 600; color: var(--muted); margin: 0 0 8px; letter-spacing: 0; }
.footnotes ol { padding-left: 2.2em; margin: 0; }
.footnotes li { margin: 6px 0; word-break: break-word; padding: 2px 6px; border-radius: 6px; transition: background .4s var(--ease); }
.footnotes li.hl { background: var(--red-soft); }
.src-type { font-size: .72rem; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.src-type::before { content: "· "; }
.nosrc { color: var(--st-disputed); font-size: .76rem; font-weight: 600; }

/* oś czasu */
.tl { list-style: none; padding: 0; margin: 0; }
.tl li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding: 18px 0; border-bottom: 1px solid var(--rule); }
.tl .d { font-variant-numeric: tabular-nums; font-size: .88rem; color: var(--muted); padding-top: 2px; }
.tl h3 { margin: 0 0 4px; font-size: 1.08rem; }
.tl p { margin: 0 0 6px; color: var(--ink-2); }
.tl .year { grid-column: 1 / -1; font-weight: 700; font-size: 2rem; letter-spacing: -.04em; padding-top: 32px; color: var(--ink); }
.tl li.year-row { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 640px) { .tl li { grid-template-columns: 1fr; gap: 2px; } }

/* tabele */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: 14px 14px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; font-size: .8rem; color: var(--muted); border-bottom-color: var(--rule-strong); }
tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* podstawy prawne */
.act { padding: 28px 0; border-bottom: 1px solid var(--rule); }
.act:last-child { border-bottom: 0; }
.act h3 { font-size: 1.25rem; margin: 6px 0 4px; }
.act .meta { font-size: .88rem; color: var(--muted); }
.provision { margin: 16px 0 0; padding: 14px 18px; background: var(--bg-alt); border-radius: var(--radius-sm); max-width: 78ch; }
.provision b { display: block; font-size: .82rem; font-weight: 600; color: var(--red-ink); margin-bottom: 4px; }
.provision q { quotes: "„" "”"; color: var(--ink); }
.status-pill { font-size: .78rem; font-weight: 600; }
.status-pill.in-force { color: var(--st-current); }
.status-pill.repealed { color: var(--muted); }

/* wykres kadencji */
.gantt-wrap { overflow-x: auto; background: var(--bg-alt); border-radius: var(--radius); padding: 12px 0; }
.gantt text { font-family: var(--font); fill: var(--ink-2); font-size: 11px; }
.gantt .axis line { stroke: var(--rule-strong); stroke-width: .5; }
.gantt .row:hover rect.bg { fill: color-mix(in srgb, var(--red) 8%, transparent); }
.gantt a, .seat-svg a { text-decoration: none !important; }
.gantt a:hover text { fill: var(--red-ink); }
/* paleta kategorialna (zwalidowana pod kątem daltonizmu: tryb jasny i ciemny osobno) */
:root { --p1: #2a78d6; --p2: #eb6834; --p3: #1baf7a; --p4: #eda100; --p5: #e87ba4; --p6: #008300; --p7: #6250d6; --p8: #e34948; --p0: #c7c7cc; --hatch: #1d1d1f; --unsworn: #6250d6; }
@media (prefers-color-scheme: dark) {
  :root { --p1: #3987e5; --p2: #d95926; --p3: #199e70; --p4: #c98500; --p5: #d55181; --p6: #008300; --p7: #9085e9; --p8: #e66767; --p0: #48484a; --hatch: #f5f5f7; --unsworn: #9085e9; }
}
.pf-p1 { fill: var(--p1); } .pf-p2 { fill: var(--p2); } .pf-p3 { fill: var(--p3); } .pf-p4 { fill: var(--p4); }
.pf-p5 { fill: var(--p5); } .pf-p6 { fill: var(--p6); } .pf-p7 { fill: var(--p7); } .pf-p8 { fill: var(--p8); }
.pf-p0 { fill: var(--p0); }
.g-hatch { stroke: var(--hatch); opacity: .55; }
.g-unsworn { fill: none; stroke: var(--unsworn); stroke-dasharray: 3 2; stroke-width: 1.5; }
.gantt text.g-lab { font-size: 9.5px; fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .86rem; color: var(--ink-2); margin: 14px 0 18px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

/* powiązania */
.net { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.net-group { background: var(--bg-alt); border-radius: var(--radius); padding: 22px 24px; }
.net-group h3 { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.net-sejm { margin: 10px 0; font-size: .92rem; }
.net-sejm b { font-weight: 500; color: var(--muted); font-size: .82rem; display: block; }

.org-notes { grid-column: 1 / -1; }
.org-notes .footnotes { margin-top: 8px; }
.loading { color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--bg-alt); border-radius: var(--radius); max-width: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- animacje ----------
   Spokojne i krótkie; całkowicie wyłączane przy „ograniczeniu ruchu” w systemie. */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wave { from { background-position: 0 0; } to { background-position: 200% 0; } }

main.page-enter { animation: fade .35s var(--ease) both; }
.hero .eyebrow, .hero h1, .hero .lede, .hero .cta { animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; }
.hero h1 { animation-delay: .08s; }
.hero .lede { animation-delay: .2s; }
.hero .cta { animation-delay: .32s; }
.hero h1 em { background: linear-gradient(90deg, var(--red), color-mix(in srgb, var(--red) 55%, #ff9aa8), var(--red)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: wave 6s linear infinite; }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .8s cubic-bezier(.16, 1, .3, 1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

.seat-svg .seat { animation: pop .55s cubic-bezier(.34, 1.56, .64, 1) both; animation-play-state: paused; transform-box: fill-box; transform-origin: center; }
.seat-svg.in .seat { animation-play-state: running; }
.gantt .bar { transform-box: fill-box; transform-origin: left center; animation: grow .9s cubic-bezier(.16, 1, .3, 1) both; }
.flag-band { background-size: 100% 100%; }
.site-header { transition: box-shadow .3s var(--ease), background .3s var(--ease); }
.site-header.scrolled { box-shadow: 0 1px 0 var(--rule), 0 8px 24px -16px rgba(0,0,0,.25); }
.person, .net-group, .card { will-change: transform; }

/* przejście kolorem przy najechaniu na wiersz osi czasu i fakty */
.tl li, .facts li { transition: background .25s var(--ease); }
.tl li:hover, .facts li:hover { background: color-mix(in srgb, var(--bg-alt) 70%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .hero h1 em { color: var(--red); background: none; }
}

/* wykres publikacji */
.chart-box { position: relative; padding: 16px 12px 8px; }
.pubchart { width: 100%; height: auto; display: block; }
.pubchart .grid { stroke: var(--rule); }
.pubchart .base { stroke: var(--rule-strong); }
.pubchart .ax { fill: var(--muted); font: 11px var(--font); }
.pubchart .lab { fill: var(--ink-2); font: 600 11px var(--font); }
.pubchart .hit { fill: transparent; }
.pubchart .hit:hover { fill: var(--ink); fill-opacity: .05; }
.pubchart .bar { transform-box: fill-box; transform-origin: bottom; animation: rise-bar .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise-bar { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.chart-tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); font-size: .8rem; padding: 5px 10px; border-radius: 8px; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.chart-tip.on { opacity: 1; }
.stat-text { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.tag-warn { color: var(--st-disputed); background: color-mix(in srgb, var(--st-disputed) 12%, transparent); text-decoration: none !important; }
details summary { cursor: pointer; color: var(--muted); margin: 10px 0; }
@media (prefers-reduced-motion: reduce) { .pubchart .bar { animation: none; } }

/* kadencje obecnego składu */
.termchart { width: 100%; min-width: 600px; height: auto; display: block; }
.termchart .grid { stroke: var(--rule); stroke-width: .5; }
.termchart .ax { fill: var(--muted); font: 11px var(--font); }
.termchart .nm { fill: var(--ink-2); font: 12px var(--font); }
.termchart .end { fill: var(--ink); font: 600 11px var(--font); font-variant-numeric: tabular-nums; }
.termchart .today { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 3 3; }
.termchart .today-t { fill: var(--red-ink); font: 600 11px var(--font); }
.termchart .s-current { fill: var(--st-current); }
.termchart .s-disputed { fill: var(--st-disputed); }
.tb-derived { fill: color-mix(in srgb, var(--st-unsworn) 18%, transparent); stroke: var(--st-unsworn); stroke-width: 1.5; stroke-dasharray: 4 3; }
.termchart a { text-decoration: none !important; }
.termchart a:hover .nm { fill: var(--red-ink); }
.termchart .bar { transform-box: fill-box; transform-origin: left center; animation: grow .9s cubic-bezier(.16, 1, .3, 1) both; }
.term-note { margin-top: 20px; }
@media (prefers-reduced-motion: reduce) { .termchart .bar { animation: none; } }

/* statystyki odwiedzin */
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { counter-increment: r; display: grid; grid-template-columns: 1.6em minmax(0, 1fr) 30% 3.5em; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: .94rem; }
.rank li::before { content: counter(r) "."; color: var(--muted); font-size: .8rem; text-align: right; font-variant-numeric: tabular-nums; }
.rank li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 8px; background: var(--bg-alt); border-radius: 4px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; width: 0; background: var(--p1); border-radius: 4px; transition: width .9s cubic-bezier(.16, 1, .3, 1); }
.rank .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.footer-links a { margin-right: 14px; }

/* ---------- gradienty, ikony, ilustracje ----------
   Lekko: dużo bieli, czerwień flagi jako akcent i delikatne, jasne gradienty. */
:root {
  --grad-red: linear-gradient(135deg, #f0365a 0%, #dc143c 100%);
  --grad-text: linear-gradient(120deg, #ec2b52 0%, #c0102f 100%);
  --grad-soft: linear-gradient(135deg, #fff1f4 0%, #f7f7f9 70%);
  --grad-card: linear-gradient(180deg, #fafafc 0%, #f4f4f7 100%);
  --grad-glow: color-mix(in srgb, var(--red) 7%, transparent);
  --chip-bg: color-mix(in srgb, var(--red) 9%, #fff);
  --shadow-card: 0 1px 2px rgba(0,0,0,.03);
  --shadow-lift: 0 16px 32px -22px rgba(0,0,0,.22);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grad-red: linear-gradient(135deg, #ff5a7a 0%, #ff375f 100%);
    --grad-text: linear-gradient(120deg, #ff8aa0 0%, #ff375f 100%);
    --grad-soft: linear-gradient(135deg, #2a1117 0%, #141416 70%);
    --grad-card: linear-gradient(180deg, #1c1c1e 0%, #161618 100%);
    --grad-glow: color-mix(in srgb, var(--red) 12%, transparent);
    --chip-bg: color-mix(in srgb, var(--red) 18%, #1c1c1e);
    --shadow-card: 0 0 0 1px rgba(255,255,255,.04) inset;
    --shadow-lift: 0 16px 32px -20px rgba(0,0,0,.7);
  }
}

body {
  background: radial-gradient(1100px 420px at 50% -220px, var(--grad-glow), transparent 70%), var(--bg);
  background-repeat: no-repeat;
}

/* ---------- nagłówek: jeden lekki wiersz ---------- */
.flag-band { height: 4px; border-top: 0; background: linear-gradient(to bottom, var(--white-flag) 0 50%, var(--red) 50% 100%); box-shadow: 0 1px 0 var(--rule); }
.site-header { background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--rule) 80%, transparent); }
.site-header.scrolled { box-shadow: 0 6px 20px -16px rgba(0,0,0,.25); }
.header-inner { max-width: 1240px; min-height: 60px; gap: 24px; flex-wrap: nowrap; }
.brand { gap: 12px; flex: none; }
.brand-mark { width: 26px; height: 18px; border-radius: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 1.02rem; }
.brand-text small { display: block; font-size: .7rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.nav { flex-wrap: nowrap; gap: 2px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; font-size: .8rem; white-space: nowrap; opacity: 1; color: var(--ink-2); transition: background .2s var(--ease), color .2s var(--ease); }
.nav a:hover { background: var(--bg-alt); color: var(--ink); }
.nav a.active { background: var(--chip-bg); color: var(--red-ink); font-weight: 600; }
.nav a.active::after { display: none; }
.nav a .ic { width: 15px; height: 15px; display: none; }
@media (max-width: 979px) {
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; background: var(--bg-alt); font-weight: 500; }
  .nav { display: none; width: 100%; padding: 4px 0 18px; }
  .nav.open { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
  .nav a { font-size: 1rem; padding: 11px 14px; border-radius: 12px; border-bottom: 0; gap: 12px; }
  .nav a .ic { display: inline-block; width: 19px; height: 19px; color: var(--red-ink); }
}
@media (max-width: 420px) { .brand-text small { display: none; } }

/* ---------- ikony ---------- */
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.14em; }
.ic-chip { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--chip-bg); color: var(--red-ink); flex: none; }
.ic-chip .ic { width: 22px; height: 22px; }
.ic-chip.sm { width: 32px; height: 32px; border-radius: 10px; }
.ic-chip.sm .ic { width: 17px; height: 17px; }
.ic-chip.page-ic { width: 52px; height: 52px; border-radius: 15px; margin-bottom: 14px; display: grid; background: var(--grad-red); color: #fff; box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--red) 80%, transparent); animation: pop .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.ic-chip.page-ic .ic { width: 26px; height: 26px; }
.section-title h2, .section > h2 { display: flex; align-items: center; gap: 12px; }

/* nagłówki stron: ciemna czcionka przechodząca w czerwień */
main h1 { background: linear-gradient(180deg, var(--ink) 40%, color-mix(in srgb, var(--ink) 60%, var(--red)) 130%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* przyciski */
.btn-primary { background: var(--grad-red); box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--red) 90%, transparent); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn-primary:hover { opacity: 1; transform: translateY(-1px); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--red) 90%, transparent); }
.btn .ic { width: 1.05em; height: 1.05em; }

/* ---------- karty ---------- */
.card, .person, .net-group, .gantt-wrap, .tile { background: var(--grad-card); box-shadow: var(--shadow-card); }
.stat-card .ic-chip { margin-bottom: 16px; }
.stat { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.person { border: 1px solid transparent; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.person:hover { border-color: color-mix(in srgb, var(--red) 30%, transparent); box-shadow: var(--shadow-lift); }

/* kafelki „Przeglądaj portal” */
.explore { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile { position: relative; display: block; color: inherit; border-radius: var(--radius); padding: 22px 24px 20px; text-decoration: none !important; border: 1px solid transparent; transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s var(--ease), border-color .3s var(--ease); }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--red) 22%, transparent); color: inherit; }
.tile h3 { margin: 16px 0 6px; font-size: 1.1rem; }
.tile p { margin: 0; font-size: .9rem; color: var(--muted); }
.tile-go { position: absolute; top: 24px; right: 22px; color: var(--muted); transition: transform .3s var(--ease), color .3s var(--ease); }
.tile:hover .tile-go { transform: translateX(4px); color: var(--red-ink); }

/* cytat: jasny gradient z różowym odcieniem */
.quote { background: var(--grad-soft); margin-top: 36px; position: relative; overflow: hidden; isolation: isolate; }
.quote::before { content: "„"; position: absolute; left: 4%; top: -.2em; z-index: -1; font: 700 clamp(10rem, 24vw, 18rem)/1 Georgia, "Times New Roman", serif; color: color-mix(in srgb, var(--red) 12%, transparent); }

/* ramki informacyjne */
.notice { position: relative; background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--red) 10%, transparent); }
.notice:has(> .notice-ic) { display: flex; gap: 14px; align-items: flex-start; }
.notice > .notice-ic { width: 22px; height: 22px; color: var(--red-ink); margin-top: 3px; }
.notice > p { margin-top: 0; }

/* sekcje: krótka czerwona kreska nad h2 na długich stronach */
main > h2 { position: relative; padding-top: 20px; }
main > h2::before { content: ""; position: absolute; left: 0; top: 0; width: 40px; height: 2px; border-radius: 2px; background: var(--red); }

/* ---------- ilustracje ---------- */
.art { margin: 28px 0 40px; }
.art-frame { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-alt); aspect-ratio: 16 / 7; }
.art.wide .art-frame { aspect-ratio: 21 / 8; }
.art-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 1.6s cubic-bezier(.16, 1, .3, 1); }
.art:hover .art-frame img { transform: scale(1.03); }
.art-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 1px rgba(0,0,0,.06) inset; pointer-events: none; }
.credit { display: flex; gap: 8px; align-items: flex-start; font-size: .76rem; color: var(--muted); margin-top: 10px; line-height: 1.45; }
.credit .ic { margin-top: 2px; }
.credit i { font-style: italic; }
.art-pair { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 16px; margin: 28px 0 40px; }
.art-pair .art { margin: 0; }
.art-pair .art-frame { aspect-ratio: auto; height: clamp(220px, 34vw, 380px); }
@media (max-width: 700px) { .art-pair { grid-template-columns: 1fr; } .art-pair .art.tall .art-frame { height: 420px; } }
img[data-art="matejko"] { object-position: 50% 35%; }
img[data-art="wojniakowski"] { object-position: 50% 45%; }
img[data-art="marcowa"] { object-position: 50% 12%; }
img[data-art="praga"] { object-position: 50% 58%; }
img[data-art="zamek"] { object-position: 50% 62%; }
.credits { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; }
.credits li { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: var(--radius-sm); background: var(--grad-card); font-size: .88rem; color: var(--ink-2); }
.credits .thumb { width: 72px; height: 52px; border-radius: 9px; overflow: hidden; flex: none; background: var(--bg-alt); }
.credits .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* oś czasu, ranking, stopka */
.tl .year { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank-bar i { background: linear-gradient(90deg, color-mix(in srgb, var(--p1) 60%, #fff), var(--p1)); }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; }
.footer-links .ic { color: var(--red-ink); }

@media (prefers-reduced-motion: reduce) {
  .hero-media img { animation: none; }
  .art:hover .art-frame img, .tile:hover { transform: none; }
}

@media (max-width: 640px) {
  .card { padding: 20px 18px; }
}
.seat-list li > span { min-width: 0; }
.seat-list .badge { white-space: normal; align-items: baseline; }
.seat-list .badge::before { transform: translateY(-1px); }
.grid > *, .people > *, .explore > * { min-width: 0; }
.card .badge, .person .badge { white-space: normal; }

/* ---------- wyszukiwarka ---------- */
.search-btn { order: 3; flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.search-btn:hover { background: var(--bg-alt); color: var(--red-ink); }
.search-btn .ic { width: 19px; height: 19px; }
.nav { order: 2; }
.header-inner .nav-toggle { order: 4; }
@media (max-width: 979px) {
  .search-btn { margin-left: auto; background: var(--bg-alt); }
  .header-inner .nav-toggle { margin-left: 0; }
  .nav { order: 5; }
}

mark { background: color-mix(in srgb, var(--red) 16%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
kbd { font: 600 .72rem var(--mono); padding: 2px 7px; border-radius: 6px; background: var(--paper); color: var(--muted); box-shadow: 0 0 0 1px var(--rule-strong); }

/* pole w hero otwierające wyszukiwarkę */
.hero-search { display: flex; align-items: center; gap: 12px; width: min(560px, 100%); margin: 26px auto 0; padding: 13px 16px 13px 18px; border: 1px solid var(--rule-strong); border-radius: 16px; background: var(--paper); color: var(--muted); font: inherit; font-size: 1rem; text-align: left; cursor: text; box-shadow: 0 6px 20px -16px rgba(0,0,0,.3); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.hero-search:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--rule-strong)); box-shadow: 0 10px 26px -18px color-mix(in srgb, var(--red) 70%, transparent); }
.hero-search .ic { width: 19px; height: 19px; color: var(--red-ink); }
.hero-search span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero .hero-search { animation: rise .9s cubic-bezier(.16, 1, .3, 1) .4s both; }

/* okno wyszukiwania */
html.sp-open { overflow: hidden; }
.sp { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; align-items: flex-start; padding: min(12vh, 110px) 16px 16px; }
.sp[hidden] { display: none; }
.sp-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, rgba(0,0,0,.25)); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .2s var(--ease) both; }
.sp-panel { position: relative; width: min(680px, 100%); max-height: calc(100vh - min(12vh, 110px) - 24px); display: flex; flex-direction: column; background: var(--paper); border-radius: 20px; box-shadow: 0 0 0 1px var(--rule), 0 30px 80px -30px rgba(0,0,0,.45); overflow: hidden; animation: sp-in .25s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes sp-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
.sp-field { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--rule); }
.sp-field > .ic { width: 20px; height: 20px; color: var(--red-ink); }
.sp-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1.12rem; -webkit-appearance: none; appearance: none; }
.sp-field input::-webkit-search-cancel-button { display: none; }
.sp-esc { font: 600 .72rem var(--mono); padding: 4px 8px; border-radius: 7px; border: 0; background: var(--bg-alt); color: var(--muted); cursor: pointer; }
.sp-list { overflow-y: auto; padding: 8px; overscroll-behavior: contain; }
.sp-foot { display: flex; align-items: center; gap: 8px; margin: 0; max-width: none; padding: 10px 18px; border-top: 1px solid var(--rule); font-size: .74rem; color: var(--muted); }
.sp-foot .ic { color: var(--st-current); }

/* wiersz wyniku (okno i strona wyników) */
.sr { display: flex; gap: 14px; align-items: flex-start; padding: 11px 12px; border-radius: 12px; color: inherit; text-decoration: none !important; }
.sr:hover, .sr[aria-selected=true] { background: var(--bg-alt); color: inherit; }
.sr[aria-selected=true] { box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 25%, transparent) inset; }
.sr .ic-chip { margin-top: 1px; }
.sr-body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.sr-title { font-weight: 600; color: var(--ink); line-height: 1.3; }
.sr-ext { width: .8em; height: .8em; margin-left: 6px; color: var(--muted); }
.sr-sub { font-size: .8rem; color: var(--muted); }
.sr-snip { font-size: .86rem; color: var(--ink-2); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-all { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 2px; padding: 11px; border-radius: 12px; font-weight: 600; font-size: .9rem; color: var(--red-ink); text-decoration: none !important; }
.sr-all:hover, .sr-all[aria-selected=true] { background: var(--chip-bg); }
.sr-empty { padding: 22px 14px; margin: 0; color: var(--muted); max-width: none; }
.sr-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 12px; }
.sr-examples .chip { background: var(--bg-alt); }
.sr-examples .chip:hover { background: var(--chip-bg); color: var(--red-ink); }

/* strona wyników */
.search-field { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; padding: 4px 18px; border-radius: 16px; background: var(--paper); border: 1px solid var(--rule-strong); }
.search-field:focus-within { border-color: color-mix(in srgb, var(--red) 50%, var(--rule-strong)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 12%, transparent); }
.search-field .ic { width: 20px; height: 20px; color: var(--red-ink); }
.filters .search-field input[type=search] { flex: 1; background: transparent; padding: 12px 0; font-size: 1.1rem; box-shadow: none; }
#q-types { margin-bottom: 8px; }
.sr-group { margin-top: 28px; }
.sr-group h2 { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; margin: 0 0 8px; }
.sr-group h2 .count { font-weight: 400; }
.sr-group .sr { padding: 14px 12px; border-bottom: 1px solid var(--rule); border-radius: 0; }
.sr-group .sr:hover { border-radius: 12px; }
.sr-group .sr-snip { -webkit-line-clamp: 3; }
.sr-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 14px; border: 0; border-radius: 99px; background: var(--chip-bg); color: var(--red-ink); font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }

/* pozycja otwarta z wyników wyszukiwania */
@keyframes target-glow { 0%, 45% { background-color: var(--chip-bg); box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 45%, transparent); } 100% { box-shadow: 0 0 0 2px transparent; } }
.target { animation: target-glow 3.2s ease-out both; border-radius: 14px; outline: none; scroll-margin-top: 84px; }
.tl li.target { padding-left: 12px; padding-right: 12px; }
@media (prefers-reduced-motion: reduce) { .target { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 45%, transparent); } }
@media (max-width: 640px) {
  .sp { padding: 10px; }
  .sp-panel { max-height: calc(100vh - 20px); border-radius: 16px; }
  .hero-search kbd { display: none; }
}

/* ---------- telefon ---------- */
.wrap { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
.site-footer .wrap { padding-bottom: max(28px, calc(env(safe-area-inset-bottom) + 16px)); }
.person, .tile, .sr, .chip, .btn, .hero-search, .search-btn, .nav-toggle, .nav a, .to-top { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.site-header { transition: transform .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease); }
.site-header.hide:not(:focus-within) { transform: translateY(-100%); }
.scroll-hint { display: none; }

/* efekty „najechania” tylko tam, gdzie jest kursor — na dotyku zostawałyby „przyklejone” */
@media (hover: none) {
  .person:hover, .tile:hover { transform: none; box-shadow: var(--shadow-card); border-color: transparent; }
  .art:hover .art-frame img { transform: none; }
  .tile:hover .tile-go { transform: none; }
  .person:active, .tile:active, .sr:active, .hero-search:active { transform: scale(.985); transition-duration: .1s; }
  .chip:active, .btn:active, .search-btn:active, .nav-toggle:active { opacity: .7; }
}

/* przypisy: większe pole dotyku przy małej cyfrze */
@media (pointer: coarse) {
  sup.cite a { position: relative; padding: 0 3px; }
  sup.cite a::after { content: ""; position: absolute; inset: -12px -3px; }
}

/* panel przypisu od dołu ekranu */
html.sheet-open { overflow: hidden; }
.fn-sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.fn-sheet[hidden] { display: none; }
.fn-sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.28); animation: fade .2s var(--ease) both; }
.fn-sheet-panel { position: relative; width: 100%; max-height: 72vh; max-height: 72dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); border-radius: 22px 22px 0 0; padding: 10px 20px max(18px, calc(env(safe-area-inset-bottom) + 12px)); box-shadow: 0 -20px 50px -20px rgba(0,0,0,.35); animation: sheet-up .3s cubic-bezier(.16, 1, .3, 1) both; outline: none; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.fn-grab { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--rule-strong); margin: 0 auto 14px; }
.fn-sheet .eyebrow::before { display: none; }
.fn-sheet-list { margin: 8px 0 0; padding-left: 1.8em; font-size: .92rem; line-height: 1.5; color: var(--ink-2); }
.fn-sheet-list li { padding: 8px 6px; border-radius: 10px; word-break: break-word; }
.fn-sheet-list li + li { border-top: 1px solid var(--rule); }
.fn-sheet-list li.hl { background: var(--chip-bg); }
.fn-sheet-list a { font-weight: 600; }
.fn-sheet-actions { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 16px; }
.fn-sheet-actions .btn { padding: 10px 22px; font-size: 1rem; border: 0; font-family: inherit; cursor: pointer; }
.fn-sheet-actions .chip { background: var(--bg-alt); padding: 10px 14px; }

/* przycisk „do góry” */
.to-top { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); z-index: 20; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--red-ink); box-shadow: 0 0 0 1px var(--rule), 0 10px 24px -12px rgba(0,0,0,.35); cursor: pointer; animation: pop .35s cubic-bezier(.34, 1.56, .64, 1) both; }
.to-top[hidden] { display: none; }
.to-top .ic { width: 20px; height: 20px; transform: rotate(-90deg); }

@media (max-width: 979px) {
  .nav.open { max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain; }
}

@media (max-width: 700px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  main { padding-top: 24px; padding-bottom: 64px; }
  body { font-size: 16.5px; }
  h2 { margin-top: 2.6rem; }
  .section-title { margin-top: 2.6rem; }
  /* iOS powiększa stronę po dotknięciu pola z czcionką mniejszą niż 16 px */
  .filters input[type=search], .filters select, input, select, textarea { font-size: 16px; }
  .filters { gap: 8px; }
  .filters select { flex: 1 1 140px; }
  .segmented { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .segmented::-webkit-scrollbar { display: none; }
  .chip { flex: none; padding: 8px 14px; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 3rem); }
  .ic-chip.page-ic { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 10px; }
  .ic-chip.page-ic .ic { width: 22px; height: 22px; }
  .person, .tile, .net-group { padding: 18px 18px; }
  .explore { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 16px 14px; }
  .tile h3 { font-size: 1rem; margin-top: 12px; }
  .tile p { display: none; }
  .tile-go { display: none; }
  .tl li { padding: 14px 0; }
  .facts li { padding: 12px 0; }
  .quote { padding: 36px 20px; }
  .footnotes { margin-top: 48px; }
  .footnotes li { padding: 4px 6px; }
  .scroll-hint { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .78rem; color: var(--muted); max-width: none; }
  .scroll-hint .ic { color: var(--red-ink); }
  .gantt-wrap, .table-wrap { -webkit-overflow-scrolling: touch; }

  /* tabele jako karty */
  .table-wrap.cards { overflow: visible; }
  .table-wrap.cards table, .table-wrap.cards tbody, .table-wrap.cards tr, .table-wrap.cards td { display: block; width: 100%; }
  .table-wrap.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table-wrap.cards tr { background: var(--grad-card); box-shadow: var(--shadow-card); border-radius: 14px; padding: 12px 16px; margin-bottom: 10px; }
  .table-wrap.cards td { border: 0; padding: 5px 0; white-space: normal; }
  .table-wrap.cards td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; margin-bottom: 1px; }
  .table-wrap.cards td:first-child { font-weight: 600; font-size: 1rem; padding-top: 2px; }
  .table-wrap.cards td:first-child::before { display: none; }
}

/* =========================================================
   Nagłówek: logo, sześć głównych działów, „Więcej”, wyszukiwarka
   ========================================================= */
body { overflow-x: clip; }
.site-header { background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--rule) 90%, transparent); }
.header-inner { max-width: 1080px; min-height: 64px; gap: 14px; }
.brand { gap: 11px; }
.logo { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--red) 28%, transparent)); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.brand:hover .logo { transform: rotate(-6deg) scale(1.06); }
.brand-text { font-size: 1.06rem; font-weight: 700; letter-spacing: -.025em; }
.brand-text small { font-size: .7rem; font-weight: 500; letter-spacing: 0; }
.nav { margin-left: auto; gap: 2px; align-items: center; }
.nav > a, .nav-more-btn { position: relative; padding: 8px 11px; border-radius: 10px; font-size: .86rem; font-weight: 500; color: var(--ink-2); background: none; }
.nav > a:hover, .nav-more-btn:hover { background: var(--bg-alt); color: var(--ink); }
.nav > a.active, .nav-more-btn.active { background: none; color: var(--ink); font-weight: 600; }
.nav > a.active::after, .nav-more-btn.active::after { content: ""; display: block; position: absolute; left: 50%; bottom: -13px; width: 22px; height: 3px; margin-left: -11px; border-radius: 3px; background: var(--grad-red); }
.nav-more { position: relative; }
.nav-more-btn { display: inline-flex; align-items: center; gap: 3px; border: 0; font-family: inherit; cursor: pointer; }
.chev { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--ease); }
.nav-more.open .chev { transform: rotate(180deg); }
.nav-more-menu { position: absolute; right: -8px; top: calc(100% + 14px); width: 520px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 8px; background: var(--paper); border-radius: 18px; box-shadow: 0 0 0 1px var(--rule), 0 24px 60px -24px rgba(0,0,0,.35); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s .18s; z-index: 10; }
.nav-more.open .nav-more-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .18s var(--ease), transform .18s var(--ease); }
.nav-more-menu a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; color: var(--ink); text-decoration: none !important; }
.nav-more-menu a:hover, .nav-more-menu a.active { background: var(--bg-alt); color: var(--ink); }
.nav-more-menu a > .ic { display: block; width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--chip-bg); color: var(--red-ink); flex: none; opacity: 1; }
.nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.nm b { font-size: .9rem; font-weight: 600; }
.nm span { font-size: .76rem; color: var(--muted); }

.search-pill { order: 3; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 7px 0 12px; margin-left: 6px; border: 1px solid var(--rule-strong); border-radius: 12px; background: var(--paper); color: var(--muted); font: inherit; font-size: .86rem; cursor: pointer; flex: none; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease); }
.search-pill:hover { border-color: color-mix(in srgb, var(--red) 40%, var(--rule-strong)); color: var(--ink); box-shadow: 0 6px 16px -12px color-mix(in srgb, var(--red) 70%, transparent); }
.search-pill .ic { width: 16px; height: 16px; color: var(--red-ink); }
.search-pill kbd { font-size: .68rem; padding: 1px 6px; }
.sp-txt { min-width: 58px; text-align: left; }

@media (max-width: 979px) {
  .header-inner { min-height: 58px; }
  .search-pill { margin-left: auto; padding: 0; width: 40px; justify-content: center; border-radius: 99px; background: var(--bg-alt); border: 0; }
  .search-pill .sp-txt, .search-pill kbd { display: none; }
  .search-pill .ic { width: 19px; height: 19px; }
  .nav { margin-left: 0; }
  .nav-more, .nav-more-menu { display: contents; }
  .nav-more-menu { visibility: visible; opacity: 1; transform: none; }
  .nav-more-btn { display: none; }
  .nav-more-menu a > .ic { width: 19px; height: 19px; padding: 0; background: none; border-radius: 0; }
  .nav > a.active::after { display: none; }
  .nav a.active { background: var(--chip-bg); color: var(--red-ink); }
  .nm b { font-size: 1rem; font-weight: inherit; }
  .nm span { display: none; }
}
@media (max-width: 420px) { .logo { width: 30px; height: 30px; } }

/* =========================================================
   Hero: tekst + kolaż ilustracji z „żywymi” kartami danych
   ========================================================= */
.hero2 { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; text-align: left; padding: clamp(20px, 4vw, 56px) 0 8px; }
.hero2 h1 { font-size: clamp(2.5rem, 5.2vw, 4.3rem); line-height: 1.02; margin: .3em 0 .35em; max-width: 13ch; letter-spacing: -.045em; }
.hero2 .lede { margin: 0; text-align: left; max-width: 34em; font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
.hero2 .hero-search { margin: 26px 0 0; width: min(520px, 100%); }
.hero2 .cta { justify-content: flex-start; margin-top: 20px; gap: 10px 24px; }
.btn-primary .ic { width: 1em; height: 1em; transition: transform .2s var(--ease); }
.btn-primary:hover .ic { transform: translateX(3px); }

.live { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px 6px 10px; border-radius: 99px; background: var(--chip-bg); color: var(--red-ink); font-size: .8rem; font-weight: 600; animation: rise .9s cubic-bezier(.16, 1, .3, 1) both; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }

.hero2-bg { position: absolute; inset: -30px -22px 0; z-index: -1; overflow: hidden; pointer-events: none;
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 10%, transparent) 1px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(75% 75% at 72% 45%, #000 15%, transparent 75%); mask-image: radial-gradient(75% 75% at 72% 45%, #000 15%, transparent 75%); }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); }
.b1 { width: 440px; height: 440px; right: 2%; top: 4%; background: color-mix(in srgb, var(--red) 24%, transparent); }
.b2 { width: 320px; height: 320px; right: 36%; bottom: -6%; background: color-mix(in srgb, #ff9fb3 45%, transparent); }
.hero2-glyph { position: absolute; right: 0; top: -8%; font: 700 clamp(14rem, 30vw, 27rem)/1 Georgia, "Times New Roman", serif; color: color-mix(in srgb, var(--red) 8%, transparent); }
@media (prefers-color-scheme: dark) { .b1 { background: color-mix(in srgb, var(--red) 30%, transparent); } .b2 { background: color-mix(in srgb, #7a1030 50%, transparent); } }

.hero2-art { position: relative; aspect-ratio: 1 / .92; --mx: 0; --my: 0; }
.ha, .hc { transform: rotate(var(--r, 0deg)); translate: calc(var(--mx) * var(--d, 1) * 14px) calc(var(--my) * var(--d, 1) * 14px); transition: translate .7s cubic-bezier(.16, 1, .3, 1), box-shadow .25s var(--ease); }
.ha { position: absolute; margin: 0; overflow: hidden; border-radius: 18px; background: var(--bg-alt); box-shadow: 0 30px 60px -30px rgba(40, 0, 10, .5), 0 0 0 1px rgba(0,0,0,.05); animation: ha-in .9s cubic-bezier(.16, 1, .3, 1) both, float 9s ease-in-out infinite; }
.ha img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ha-main { left: 7%; top: 15%; width: 75%; aspect-ratio: 4 / 3; --r: -2.5deg; --d: 1; }
.ha-doc { right: 0; top: 1%; width: 29%; aspect-ratio: 3 / 5; --r: 6deg; --d: 2.2; border: 5px solid #fff; border-radius: 10px; animation-delay: .12s, -2s; }
.ha-photo { left: 0; bottom: 5%; width: 42%; aspect-ratio: 4 / 3; --r: 4deg; --d: 1.6; border: 5px solid #fff; border-radius: 14px; animation-delay: .22s, -4.5s; }
@keyframes float { 0%, 100% { transform: rotate(var(--r, 0deg)) translateY(0); } 50% { transform: rotate(var(--r, 0deg)) translateY(-9px); } }
@keyframes ha-in { from { opacity: 0; } to { opacity: 1; } }

.hc { position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; color: var(--ink); text-decoration: none !important; background: color-mix(in srgb, var(--paper) 84%, transparent); backdrop-filter: blur(14px) saturate(1.6); -webkit-backdrop-filter: blur(14px) saturate(1.6); box-shadow: 0 0 0 1px color-mix(in srgb, var(--rule-strong) 70%, transparent), 0 20px 40px -22px rgba(0,0,0,.45); animation: ha-in .9s .35s both, float 8s -3s ease-in-out infinite; }
.hc:hover { color: var(--ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent), 0 24px 44px -22px color-mix(in srgb, var(--red) 55%, transparent); }
.hc-seats { right: 1%; bottom: 0; width: min(250px, 54%); flex-direction: column; align-items: flex-start; gap: 2px; --r: -1.5deg; --d: 2.8; }
.seat-svg.mini-seats { width: 100%; max-width: 190px; height: auto; margin: 0 0 4px; }
.seat-svg.mini-seats circle { stroke: color-mix(in srgb, var(--paper) 80%, transparent); stroke-width: 2; }
.hc-big { font-size: 1.9rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.hc-big small { font-size: 1.15rem; color: var(--st-unsworn); }
.hc-label { display: block; font-size: .74rem; color: var(--muted); line-height: 1.35; }
.hc-next { left: 0; top: 2%; max-width: 64%; --r: 2deg; --d: 3.4; animation-delay: .5s, -5s; }
.hc-next b { display: block; font-size: .98rem; line-height: 1.2; margin: 1px 0; }
.hc-when { display: block; font-size: .78rem; color: var(--red-ink); font-weight: 600; }
.hero2-credit { grid-column: 1 / -1; margin: 10px 0 0; justify-content: flex-end; max-width: none; }

/* pasek „Ostatnio” pod hero */
.ticker { display: flex; align-items: center; gap: 12px; margin: 24px 0 8px; padding: 12px 16px; border-radius: 14px; background: var(--grad-soft); border: 1px solid color-mix(in srgb, var(--red) 12%, transparent); color: var(--ink); text-decoration: none !important; font-size: .92rem; transition: border-color .2s var(--ease); }
.ticker:hover { color: var(--ink); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.ticker-tag { flex: none; padding: 3px 10px; border-radius: 99px; background: var(--grad-red); color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ticker-d { flex: none; color: var(--muted); font-size: .84rem; }
.ticker-t { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker .ic { flex: none; color: var(--red-ink); transition: transform .2s var(--ease); }
.ticker:hover .ic { transform: translateX(3px); }

@media (max-width: 899px) {
  .hero2 { grid-template-columns: minmax(0, 1fr); padding-top: 12px; gap: 28px; }
  .hero2 h1 { font-size: clamp(2.3rem, 10.5vw, 3.3rem); }
  .hero2-art { aspect-ratio: 1 / .88; }
  .hero2-credit { justify-content: flex-start; margin-top: 0; }
  .ticker-d { display: none; }
  .hc { padding: 10px 12px; }
  .hc-big { font-size: 1.5rem; }
  .hc-label { font-size: .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ha, .hc, .live, .live-dot { animation: none !important; }
}

/* ilustracje na podstronach: para równych zdjęć, mała grafika */
.art-pair.even { grid-template-columns: 1fr 1fr; }
.art-pair.even .art-frame { height: clamp(200px, 26vw, 300px); }
.art.small { max-width: 480px; }
.art.small .art-frame { aspect-ratio: auto; }
.art.small .art-frame img { height: auto; }
@media (max-width: 700px) { .art-pair.even { grid-template-columns: 1fr; } .art-pair.even .art-frame { height: 220px; } }
img[data-art="tk-sala"] { object-position: 50% 55%; }
img[data-art="tk-mala-sala"] { object-position: 50% 50%; }
img[data-art="sejm"] { object-position: 50% 60%; }
img[data-art="palac"] { object-position: 50% 55%; }
img[data-art="rekopis"] { object-position: 50% 8%; }
img[data-art="tk-wejscie"] { object-position: 50% 40%; }
