/* Krajopis - barwy i pismo z filmów (produkcja/src/design/tokens.ts) */
@font-face { font-family: Archivo; src: url(/fonts/archivo-latin.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: Archivo; src: url(/fonts/archivo-latin-ext.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }
@font-face { font-family: Newsreader; src: url(/fonts/newsreader-italic-latin.woff2) format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: Newsreader; src: url(/fonts/newsreader-italic-latin-ext.woff2) format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0; }

:root {
  --ocean: #0F3441;
  --deep: #0A2630;
  --land: #2B4A55;
  --bone: #E6DFCC;
  --line: #7FA3AE;
  --signal: #FFC21A;
  --rule: rgba(127, 163, 174, 0.28);
  --sans: Archivo, system-ui, sans-serif;
  --note: Newsreader, Georgia, serif;
  --top: 56px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ocean); color: var(--bone); font: 460 17px/1.5 var(--sans); }
a { color: var(--bone); text-decoration-color: var(--signal); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* nagłówek */
.top { position: sticky; top: 0; z-index: 5; height: var(--top); display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: var(--deep); border-bottom: 1px solid var(--rule); }
.mark { display: flex; align-items: center; gap: 10px; font-stretch: 118%; font-weight: 800; font-size: 22px; letter-spacing: -0.01em; text-decoration: none; }
.links { display: flex; gap: 18px; font-stretch: 80%; font-weight: 560; font-size: 15px; }
.links a { text-decoration: none; color: var(--line); }
.links a:hover { color: var(--bone); }

/* układ: mapa + panel */
.app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); grid-template-rows: auto 1fr; grid-template-areas: "map search" "map out"; }
.map-wrap { grid-area: map; align-self: start; position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); overflow: hidden; background: var(--ocean); }
#map { display: block; width: 100%; height: 100%; touch-action: manipulation; }
#map .gm path { stroke: rgba(10, 38, 48, 0.6); stroke-width: 0.5; vector-effect: non-scaling-stroke; cursor: pointer; }
#map .gm path:hover { stroke: var(--bone); stroke-width: 1.2; }
#map .woj { fill: none; stroke: rgba(230, 223, 204, 0.38); stroke-width: 0.9; vector-effect: non-scaling-stroke; pointer-events: none; }
#map .kraj { fill: none; stroke: rgba(230, 223, 204, 0.8); stroke-width: 1.3; vector-effect: non-scaling-stroke; pointer-events: none; }
#map .sel { fill: none; stroke: var(--signal); stroke-width: 2.6; vector-effect: non-scaling-stroke; pointer-events: none; stroke-linejoin: round; }
#map text { font-family: var(--sans); font-stretch: 72%; font-weight: 620; letter-spacing: 0.04em; fill: var(--bone);
  paint-order: stroke; stroke: rgba(10, 38, 48, 0.85); stroke-linejoin: round; pointer-events: none; }
#map .lab { font-weight: 720; fill: var(--signal); }

.legend { position: absolute; left: 20px; bottom: 18px; padding: 10px 12px 8px; background: rgba(10, 38, 48, 0.86); border-radius: 4px; }
.legend-t { margin: 0 0 6px; font-stretch: 75%; font-weight: 560; font-size: 13px; letter-spacing: 0.02em; color: var(--bone); }
.legend-bar { position: relative; display: grid; grid-template-columns: repeat(9, 26px); height: 30px; }
.legend-bar i { height: 10px; }
.legend-bar b { position: absolute; top: 13px; transform: translateX(-50%); font-stretch: 72%; font-weight: 520; font-size: 12px; color: var(--line); font-variant-numeric: tabular-nums; }

.mark img { display: block; width: auto; height: 40px; }
.tools { position: absolute; top: 16px; left: 20px; display: flex; gap: 8px; }
.tool { display: inline-block; text-decoration: none; padding: 7px 14px; border: 1px solid var(--rule); border-radius: 4px; background: rgba(10, 38, 48, 0.9); font-stretch: 85%; font-weight: 600; font-size: 14px; }
.tool:hover { border-color: var(--bone); }
.tool[aria-pressed="true"] { border-color: var(--signal); color: var(--signal); }
#map .zab { fill: none; stroke: var(--signal); stroke-width: 2.4; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; pointer-events: none; display: none; }
#map.zab-on .zab { display: inline; }
.has-sel #map .gm { opacity: 0.72; }
.year { position: absolute; top: 14px; right: 20px; padding: 6px 14px 8px; background: rgba(10, 38, 48, 0.88); border-radius: 6px; text-align: right; }
.year b { display: block; font-stretch: 125%; font-weight: 850; font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.year span { display: block; margin-top: 3px; font-stretch: 78%; font-weight: 560; font-size: 13px; color: var(--line); }
.year.fc b { color: var(--line); }
.year.fc span { font-family: var(--note); font-style: italic; font-stretch: normal; font-size: 14px; }
.time { position: absolute; right: 20px; bottom: 18px; width: min(380px, 46%); display: flex; align-items: center; gap: 12px; padding: 10px 14px 6px 10px;
  background: rgba(10, 38, 48, 0.86); border-radius: 4px; }
.play { flex: none; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--signal); color: var(--deep); }
.play svg { width: 14px; height: 14px; fill: currentColor; }
.play:hover { background: var(--bone); }
.range { position: relative; flex: 1; padding-bottom: 18px; }
.ticks span, .ticks i { position: absolute; top: 24px; transform: translateX(-50%); font-stretch: 72%; font-weight: 520; font-size: 12px; color: var(--line); font-style: normal; }
.ticks span:first-child { transform: none; }
.ticks span:nth-child(3) { transform: translateX(-100%); }
.ticks i { left: 78%; font-family: var(--note); font-style: italic; font-stretch: normal; }
#yr { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 22px; margin: 0; background: transparent; cursor: pointer; }
#yr::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--bone) 0 55.9%, rgba(127, 163, 174, 0.55) 55.9% 100%); }
#yr::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--bone) 0 55.9%, rgba(127, 163, 174, 0.55) 55.9% 100%); }
#yr::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--signal); border: 3px solid var(--deep); }
#yr::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--signal); border: 3px solid var(--deep); }
.nat { margin: 0 0 18px; padding: 16px 0 4px; border-top: 1px solid var(--rule); }
.hint { margin: 0 0 26px; font-family: var(--note); font-style: italic; font-size: 16px; color: var(--line); }
.tops li { padding-left: 10px; border-left: 3px solid var(--c); }
.strip { margin: 0 0 6px; }
.strip svg { display: block; width: 100%; height: auto; overflow: visible; }
.strip text { font-family: var(--sans); font-stretch: 72%; font-weight: 540; font-size: 11px; fill: var(--line); }
.tip { position: absolute; z-index: 3; pointer-events: none; padding: 6px 10px; background: var(--deep); border: 1px solid var(--rule); border-radius: 4px;
  font-size: 14px; line-height: 1.3; white-space: nowrap; }
.tip b { font-stretch: 110%; font-weight: 720; }
.tip span { display: block; font-stretch: 80%; color: var(--line); font-variant-numeric: tabular-nums; }

/* panel */
.search-box { grid-area: search; position: relative; z-index: 6; background: var(--deep); border-left: 1px solid var(--rule); padding: 22px 28px 0; }
.panel { grid-area: out; background: var(--deep); border-left: 1px solid var(--rule); padding: 26px 28px 40px; min-height: calc(100vh - var(--top) - 96px); }
.search { position: relative; }
.search-l { display: block; margin-bottom: 6px; font-stretch: 80%; font-weight: 600; font-size: 14px; color: var(--line); }
#q, #zq { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--ocean); color: var(--bone);
  font: 560 18px/1.2 var(--sans); }
#q::placeholder, #zq::placeholder { color: rgba(127, 163, 174, 0.75); }
#q:focus, #zq:focus { outline: none; border-color: var(--signal); }
.sugg { position: absolute; z-index: 6; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--ocean);
  border: 1px solid var(--line); border-radius: 4px; max-height: 360px; overflow-y: auto; }
.sugg li { padding: 8px 14px; cursor: pointer; line-height: 1.3; }
.sugg li span { display: block; font-stretch: 80%; font-size: 14px; color: var(--line); }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--land); }
.sugg .none { cursor: default; color: var(--line); }

.intro-h { margin: 8px 0 12px; font-stretch: 118%; font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -0.01em; }
.intro-p { margin: 0 0 22px; max-width: 34em; }
.pl-line { margin: 0 0 26px; color: var(--bone); }
.tops { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px; }
.tops h2 { margin: 0 0 8px; font-stretch: 85%; font-weight: 650; font-size: 15px; color: var(--line); }
.tops ol { margin: 0; padding: 0; list-style: none; }
.tops li { margin: 0 0 6px; }
.tops button { padding: 0; border: 0; background: none; text-align: left; line-height: 1.25; }
.tops button:hover .n { color: var(--signal); }
.tops .n { display: block; font-weight: 620; }
.tops .v { font-stretch: 80%; font-size: 14px; color: var(--line); font-variant-numeric: tabular-nums; }

/* gmina */
.gm-name { margin: 0; font-stretch: 118%; font-weight: 800; font-size: 40px; line-height: 1.02; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.gm-sub { margin: 6px 0 18px; font-stretch: 80%; font-weight: 520; font-size: 15px; color: var(--line); }
.big { margin: 0; font-stretch: 125%; font-weight: 850; font-size: 88px; line-height: 0.9; letter-spacing: -0.02em; color: var(--c); font-variant-numeric: tabular-nums; }
.big-cap { margin: 8px 0 14px; font-size: 17px; }
.big-cap b { font-weight: 680; font-variant-numeric: tabular-nums; }
.ctx { margin: 0 0 20px; color: var(--bone); }
.chart { margin: 0 0 26px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--sans); font-stretch: 75%; font-weight: 540; font-size: 12px; fill: var(--line); font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--bone); font-weight: 640; font-size: 13px; }
.chart .it { font-family: var(--note); font-style: italic; font-stretch: normal; font-size: 13px; letter-spacing: 0.01em; }
.panel h2.sec { margin: 26px 0 10px; padding-top: 16px; border-top: 1px solid var(--rule); font-stretch: 100%; font-weight: 720; font-size: 18px; }
.bars { display: grid; gap: 10px; margin: 4px 0 12px; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 3px; }
.bar-l { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.bar-l b { font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-t { position: relative; height: 10px; background: rgba(127, 163, 174, 0.12); }
.bar-t::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line); }
.bar-t i { position: absolute; top: 0; bottom: 0; }
.note { margin: 10px 0 0; font-family: var(--note); font-style: italic; font-size: 16px; line-height: 1.4; color: var(--line); }
.panel p { max-width: 36em; }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin: 28px 0 0; }
.share button { padding: 10px 16px; border: 1.5px solid var(--bone); border-radius: 4px; background: none; font-weight: 620; font-size: 15px; }
.share button:hover { border-color: var(--signal); color: var(--signal); }
.share .primary { background: var(--signal); border-color: var(--signal); color: var(--deep); }
.share .primary:hover { background: var(--bone); border-color: var(--bone); color: var(--deep); }
.toast { margin: 10px 0 0; min-height: 1.4em; font-stretch: 85%; font-size: 14px; color: var(--signal); }
.film { margin: 22px 0 0; }

/* stopka */
.foot { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 34px 28px 46px; background: var(--deep); border-top: 1px solid var(--rule);
  font-size: 15px; color: var(--line); }
.foot p { margin: 0 0 10px; max-width: 40em; }
.foot-h { font-weight: 680; color: var(--bone); }
.foot a { color: var(--bone); }

@media (max-width: 900px) {
  :root { --top: 50px; }
  .top { padding: 0 16px; }
  .links a:not(.nav-map), .nav-sep { display: none; }
  .mark img { height: 34px; }
  .app { grid-template-columns: 1fr; grid-template-areas: "search" "map" "out"; }
  .search-box { border-left: 0; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
  .map-wrap { position: relative; top: 0; }
  .panel { border-left: 0; border-top: 1px solid var(--rule); padding: 20px 16px 34px; min-height: 0; }
  .legend { left: 10px; bottom: 10px; padding: 7px 9px 5px; }
  .legend-t { font-size: 12px; }
  .legend-bar { grid-template-columns: repeat(9, 19px); height: 26px; }
  .legend-bar b { font-size: 11px; }
  .tools { top: 10px; left: 10px; }
  .tool { padding: 6px 10px; font-size: 13px; }
  .map-wrap { height: auto; }
  #map { height: min(88vw, 60vh); }
  .legend, .time { position: static; width: auto; margin: 8px 12px 0; }
  .time { margin-bottom: 10px; }
  .legend { display: inline-block; }
  .year { top: 10px; right: 10px; padding: 4px 10px 6px; }
  .year b { font-size: 32px; }
  .gm-name { font-size: 34px; }
  .big { font-size: 72px; }
  .foot { grid-template-columns: 1fr; gap: 6px; padding: 26px 16px 36px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.seo-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* mapa zaborów (/zabory/) */
.zb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); }
.zb-map { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); overflow: hidden; background: var(--ocean); align-self: start; }
#zmap { display: block; width: 100%; height: 100%; }
.zf { transition: opacity 0.7s ease; }
.zs { fill-opacity: 0.8; stroke: rgba(10, 38, 48, 0.75); stroke-width: 1; vector-effect: non-scaling-stroke; }
.zs-rp, .zs-dzis { fill-opacity: 0.88; }
.z-today { fill: none; stroke: var(--signal); stroke-width: 2; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; pointer-events: none; }
.z-rp { fill: none; stroke: rgba(230, 223, 204, 0.6); stroke-width: 1.1; vector-effect: non-scaling-stroke; pointer-events: none; }
.z-city circle { fill: var(--deep); stroke: var(--bone); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.z-city text { font-family: var(--sans); font-stretch: 72%; font-weight: 640; letter-spacing: 0.03em; fill: var(--bone); paint-order: stroke; stroke: rgba(10, 38, 48, 0.85); stroke-linejoin: round; }
.zb-key { position: absolute; left: 20px; bottom: 18px; display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; background: rgba(10, 38, 48, 0.88); border-radius: 4px; font-stretch: 82%; font-weight: 560; font-size: 13px; }
.zb-key span { display: flex; align-items: center; gap: 8px; }
.zb-key i { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.zb-side { background: var(--deep); border-left: 1px solid var(--rule); padding: 26px 28px 40px; min-height: calc(100vh - var(--top)); }
.zb-h { margin: 4px 0 14px; font-stretch: 118%; font-weight: 800; font-size: 32px; line-height: 1.05; letter-spacing: -0.01em; }
.zb-cap { margin: 0 0 20px; min-height: 4.4em; font-size: 19px; line-height: 1.45; }
.zb-time { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; }
.zb-years { display: flex; flex-wrap: wrap; gap: 6px; }
.zb-years button { padding: 6px 10px; border: 1px solid var(--rule); border-radius: 4px; background: none; font-stretch: 88%; font-weight: 620; font-size: 15px; font-variant-numeric: tabular-nums; }
.zb-years button:hover { border-color: var(--bone); }
.zb-years button[aria-pressed="true"] { background: var(--signal); border-color: var(--signal); color: var(--deep); }
.zb-note { margin: 0 0 14px; font-family: var(--note); font-style: italic; font-size: 16px; color: var(--line); }
.zb-film { margin: 0 0 14px; }
.zb-src { margin: 24px 0 0; font-size: 13px; line-height: 1.45; color: var(--line); }
.links a[aria-current="page"] { color: var(--bone); }
@media (max-width: 900px) {
  .zb { grid-template-columns: 1fr; }
  .zb-map { position: relative; top: 0; height: min(100vw, 64vh); }
  .zb-side { border-left: 0; padding: 18px 16px 30px; min-height: 0; }
  .zb-key { left: 8px; bottom: 8px; padding: 6px 8px; font-size: 11px; gap: 3px; }
  .zb-h { font-size: 26px; }
  .zb-cap { font-size: 17px; min-height: 0; }
}
@media (prefers-reduced-motion: reduce) { .zf { transition: none; } }

.tool[hidden] { display: none; }
@media (max-width: 900px) {
  .zb-map { height: auto; }
  #zmap { height: min(100vw, 60vh); }
  .zb-key { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 10px 16px; border-radius: 0; background: var(--deep); font-size: 12px; }
}

/* nawigacja między mapami */
.links { align-items: center; }
.links a.nav-map { color: var(--bone); }
.links a[aria-current="page"] { color: var(--signal); }
.nav-sep { width: 1px; height: 18px; background: var(--rule); }
.switch { display: inline-flex; border: 1px solid var(--rule); border-radius: 4px; overflow: hidden; background: rgba(10, 38, 48, 0.92); }
.switch a { padding: 7px 14px; font-stretch: 85%; font-weight: 640; font-size: 14px; color: var(--line); text-decoration: none; }
.switch a:hover { color: var(--bone); }
.switch a[aria-current="page"] { background: var(--signal); color: var(--deep); }
.tools { align-items: center; flex-wrap: wrap; }

/* mapa zaborów: wyszukiwarka i historia gminy */
.zb-search { margin: 0 0 18px; }
.zb-res { margin: 0 0 24px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 4px; background: var(--ocean); }
.zb-res h2 { margin: 0; font-stretch: 112%; font-weight: 780; font-size: 24px; line-height: 1.1; }
.zb-res .sub { margin: 4px 0 10px; font-stretch: 82%; font-size: 14px; color: var(--line); }
.zb-res ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; }
.zb-res li { display: contents; }
.zb-res li span { font-variant-numeric: tabular-nums; font-stretch: 88%; font-weight: 640; color: var(--line); }
.zb-res li b { font-weight: 560; }
.zb-res li.on span, .zb-res li.on b { color: var(--signal); }
.zb-res li i { display: inline-block; width: 12px; height: 9px; margin-right: 8px; border-radius: 2px; }
.z-gm { fill: none; stroke: rgba(230, 223, 204, 0.42); stroke-width: 0.6; vector-effect: non-scaling-stroke; pointer-events: none; display: none; }
#zmap.gm-on .z-gm { display: inline; }
.z-me circle { fill: var(--signal); stroke: var(--deep); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.z-me text { font-family: var(--sans); font-stretch: 100%; font-weight: 760; fill: var(--signal); paint-order: stroke; stroke: rgba(10, 38, 48, 0.9); stroke-linejoin: round; }
@media (max-width: 900px) {
  .year { top: auto; bottom: 10px; right: 10px; }
  .switch a { padding: 6px 10px; font-size: 13px; }
}
.warn { margin: -6px 0 18px; padding: 10px 14px; border-left: 3px solid var(--signal); background: rgba(255, 194, 26, 0.08); font-size: 15px; line-height: 1.45; color: var(--bone); }
