/* MPU Bydgoszcz — style współdzielony przez wszystkie podstrony */

:root {
  --red: #b30401;
  --red-light: #fdeceb;
  --ink: #1c1a19;
  --ink-soft: #4a4644;
  --paper: #ffffff;
  --paper-soft: #f7f5f4;
  --line: #e6e1df;
  --ok: #276b43;
  --ok-bg: #e9f5ee;
  --wip: #955a00;
  --wip-bg: #fbf0dd;
  --archive: #6b6663;
  --archive-bg: #eeebe9;
  /* szary z logo — napisy menu, lupa, hamburger (kontrast 5,0:1 na białym) */
  --logo-gray: #6f6f6f;

  --radius: 14px;
  --shadow: 0 2px 10px rgba(28, 26, 25, 0.06);
  --shadow-lg: 0 16px 40px rgba(28, 26, 25, 0.12);
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2efed;
    --ink-soft: #c7c1be;
    --paper: #171514;
    --paper-soft: #201d1c;
    --line: #332e2c;
    /* WCAG 1.4.3: czerwień marki #b30401 ma na ciemnym tle 2,5:1 — jaśniejszy odcień do tekstu */
    --red: #f2665a;
    --red-light: #2a1512;
    --ok: #5cc489;
    --wip: #e8a33d;
    --archive: #b3aca8;
    --ok-bg: #12271c;
    --wip-bg: #2b2110;
    --archive-bg: #262322;
    /* logo w trybie ciemnym jest rozjaśniane brightness(1.9) → ok. #d3d3d3 */
    --logo-gray: #d3d3d3;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
/* Leaflet potrzebuje własnych, nieograniczonych rozmiarów kafelków mapy */
.leaflet-container img { max-width: none; }
/* warstwy Leaflet mają z-index 400+ — bez własnego kontekstu mapka wjeżdża na przyklejony nagłówek */
.leaflet-container { isolation: isolate; }

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
/* WCAG 1.4.1: link w tekście różni się od tekstu kolorem tylko 1,3:1 — potrzebne podkreślenie */
main p a:not(.btn), main li a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

/* WCAG 2.4.7: widoczny fokus przy obsłudze klawiaturą (przy kliknięciu myszą — bez obwódki) */
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }

/* WCAG 2.4.1: link „Przejdź do treści” — pojawia się po pierwszym naciśnięciu Tab */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 12px; text-decoration: none; }
/* WCAG 1.4.3: domyślny szary podpowiedzi w polach ma w trybie ciemnym za niski kontrast */
::placeholder { color: var(--ink-soft); opacity: 1; }

h1, h2, h3, h4 {
  font-family: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.15rem, 2vw, 1.6rem); }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.6em;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
@media (prefers-color-scheme: dark) {
  .site-header { background: rgba(23, 21, 20, 0.97); }
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 92px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto; /* menu, lupa i hamburger dosunięte do prawej */
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
/* logo zawiera już nazwę instytucji (szary znak #6F6F6F na przezroczystym tle) */
.brand img { height: 68px; width: auto; display: block; }
@media (prefers-color-scheme: dark) {
  /* szary logotyp ma za mały kontrast na ciemnym tle nagłówka — rozjaśniony do ok. #D3D3D3 */
  .brand img { filter: brightness(1.9); }
}
@media (max-width: 560px) {
  .brand img { height: 56px; }
}
@media (max-width: 360px) {
  /* przy 320 px logo 56 px + lupa + hamburger nie mieszczą się w kontenerze */
  .brand img { height: 48px; }
}

/* wymiary menu dobrane tak, by logo + menu + lupa mieściły się w kontenerze (1132 px treści,
   potrzeba ok. 1099 px przy wielkich literach); przy dodaniu pozycji do menu sprawdzić szerokość tuż nad progiem hamburgera */
.nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav a {
  color: var(--logo-gray);
  font-weight: 600;
  /* wielkie litery; 0.85rem + rozstrzelenie i odstęp 10px — przy 0.95rem/6px pozycje zlewały się w jedno */
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 10px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--red-light); color: var(--red); text-decoration: none; }
.nav a.active { color: var(--red); }

/* plakietki BIP / Facebook (linki) i flaga UE (bez linku, <span>) — kolorowe logotypy, bez filtra w trybie ciemnym */
.nav .icon-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 8px;
}
.nav .icon-badge img { height: 20px; width: auto; display: block; flex-shrink: 0; }
.nav a.icon-badge:hover { background: var(--red-light); }

/* lupa — poza <nav>, żeby była widoczna także obok hamburgera na wąskich ekranach */
.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin-left: -8px; /* odstęp od Facebooka jak między pozycjami menu, nie jak gap nagłówka */
  padding: 0;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--logo-gray);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.search-toggle:hover { background: var(--red-light); color: var(--red); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--logo-gray);
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}

@media (max-width: 1180px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 92px 0 0 0;
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 24px;
    gap: 2px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    /* WCAG 2.4.3: visibility (nie tylko opacity) — Tab nie wchodzi w niewidoczne linki */
    visibility: hidden;
    transition: transform 0.2s, opacity 0.2s, visibility 0s 0.2s;
    border-top: 1px solid var(--line);
    max-height: calc(100vh - 92px);
    overflow-y: auto;
  }
  .nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; visibility: visible; transition: transform 0.2s, opacity 0.2s; }
  .search-toggle { margin-left: 0; }
  .nav a { padding: 14px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav span.icon-badge { padding: 14px 8px; }
}

/* ---------- Hero ---------- */
.page-hero {
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--red); color: #fff; }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
/* przyciski nad treścią podstrony (np. link do Rejestru Urbanistycznego na Planie ogólnym) */
.top-actions { margin-bottom: 24px; text-align: center; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
section.tight { padding: 40px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-head p { margin: 0; max-width: 560px; }

/* ---------- Cards / grid ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card h3, .card h2.card-title { margin-bottom: 0.4em; }
.card h2.card-title { font-size: 1.05rem; letter-spacing: -0.02em; }
.card p { margin-bottom: 0; }
.card .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--red-light);
  color: var(--red);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
}

/* ---------- Map ---------- */
.map-top {
  position: relative;
  padding: 0;
  width: 100%;
  background: var(--paper-soft);
  touch-action: none;
}
.map-top .map-frame {
  width: 100%;
  height: 68vh;
  min-height: 420px;
  max-height: 760px;
  border: 0;
  display: block;
  /* zgodne z .ol-viewport wewnątrz eksportu qgis2web — bez tego na dotyku
     przeglądarka i mapa "przeciągają się" o gest zamiast go jednoznacznie oddać mapie */
  touch-action: none;
}
@media (max-width: 640px) {
  .map-top .map-frame { height: 52vh; min-height: 340px; }
}

/* Blokuje przechwytywanie scrolla przez mapę, dopóki użytkownik jej świadomie nie aktywuje */
.map-guard {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 26px;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.15s;
  /* bez tego gest dwoma palcami na nakładce potrafi powiększyć całą stronę
     zamiast zostać przejęty przez mapę */
  touch-action: none;
}
.map-guard.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.map-guard:focus-visible { outline-offset: -4px; }
.map-guard span {
  background: rgba(28, 26, 25, 0.82);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
}

/* ---------- Kontakt: mapa + kafelki obok siebie ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: stretch;
}
.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-cards .card { flex: 1; }
@media (max-width: 880px) {
  .contact-layout { grid-template-columns: 1fr; }
}

.map-mini {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-soft);
  display: flex;
  flex-direction: column;
}
.map-mini-frame {
  flex: 1;
  min-height: 260px;
}
@media (max-width: 640px) {
  .map-mini-frame { min-height: 220px; }
}

/* ---------- News ---------- */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--line);
}
.news-item {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.news-date {
  font-weight: 700;
  color: var(--red);
  font-size: 0.9rem;
  white-space: nowrap;
}
.news-item h3 { margin-bottom: 0.3em; }
.news-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--paper-soft);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
@media (max-width: 640px) {
  .news-item { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Status badge ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.status-obowiazujacy { background: var(--ok-bg); color: var(--ok); }
.status-w_opracowaniu { background: var(--wip-bg); color: var(--wip); }
.status-archiwalny { background: var(--archive-bg); color: var(--archive); }

/* ---------- Table (plany) ---------- */
.table-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
}
.chip.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table.plany {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: var(--paper);
}
table.plany th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 14px 12px;
  background: var(--paper-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.plany th .sort-btn {
  all: unset;
  cursor: pointer;
  user-select: none;
}
table.plany th .sort-btn:hover { color: var(--red); }
table.plany th .sort-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }
table.plany th.sorted { color: var(--ink); }
table.plany td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.94rem;
}
table.plany tr:last-child td { border-bottom: none; }
/* kolumna plików: stała szerokość minimalna, a długie etykiety (np. „Zakres zmian po uchwaleniu…”)
   mogą się łamać — inaczej jedna długa etykieta rozpycha tabelę poza kontener */
table.plany td.files { white-space: normal; min-width: 240px; }
table.plany th:first-child, table.plany td:first-child { padding-left: 18px; }
/* w tabeli planów każdy plik w osobnej linii */
table.plany .file-link { display: block; width: fit-content; margin-right: 0; }
.file-link {
  display: inline-block;
  font-size: 0.86rem;
  font-weight: 600;
  margin: 0 12px 4px 0;
}
.empty-note {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-soft);
}

/* ---------- Opracowania ---------- */
.opracowanie-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red);
  margin-bottom: 8px;
  display: block;
}
/* każde opracowanie to pełnej szerokości blok: opis + lista plików */
.opracowania-list { display: grid; gap: 24px; }
.opracowanie {
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  scroll-margin-top: 110px;
}
.opracowanie.is-target { border-color: var(--red); }
.opracowanie h2 { font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 0.5em; }
.opracowanie-body > p, .opracowanie > p, .opracowanie-more p { color: var(--ink-soft); max-width: 80ch; }
.opracowanie-more { margin-bottom: 1em; }
.opracowanie-more summary { cursor: pointer; font-weight: 700; font-size: 0.9rem; color: var(--red); width: fit-content; }
.opracowanie-more[open] summary { margin-bottom: 0.8em; }
.opracowanie-date { font-size: 0.86rem; }
.opracowanie-date strong { color: var(--ink); }
.opracowanie-files-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: 20px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.opracowanie-files { list-style: none; margin: 0; padding: 0; }
.opracowanie-files li { margin-bottom: 4px; break-inside: avoid; }
.opracowanie-files .file-link { margin: 0; }
.opracowanie-files.is-long { columns: 2; column-gap: 32px; }
@media (max-width: 760px) {
  .opracowanie { padding: 20px; }
  .opracowanie-files.is-long { columns: 1; }
}

/* ---------- Treść (listy, linki) na podstronach dokumentowych ---------- */
.prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 6px; color: var(--ink-soft); }
.prose ul ul { margin-top: 6px; margin-bottom: 0; }
.prose a { font-weight: 600; }
.prose-narrow { max-width: 760px; }
.prose-narrow h2 { margin-top: 1.6em; }
.prose-narrow h3 { margin-top: 1.2em; }
kbd { font: inherit; font-size: 0.86em; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-soft); }
/* pola deklaracji dostępności do uzupełnienia przed publikacją (export.sh ostrzega, jeśli zostały) */
mark.todo { background: #fff3b0; color: #1c1a19; padding: 0 3px; border-radius: 3px; }

/* ---------- Lista etapów (Plan ogólny) ---------- */
.stage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stage-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--paper-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--ink);
}

/* ---------- Rozwijane etapy historii ---------- */
.stage-details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 20px;
  margin-bottom: 12px;
  background: var(--paper);
}
.stage-details summary {
  padding: 16px 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.stage-details summary::-webkit-details-marker { display: none; }
.stage-details summary::before {
  content: "+";
  display: inline-block;
  width: 1.2em;
  color: var(--red);
  font-weight: 800;
}
.stage-details[open] summary::before { content: "–"; }
.stage-details .stage-body { padding-bottom: 20px; }
/* nagłówek sekcji jako tytuł zwijanego bloku (np. ZPI) — zostaje h2 dla czytników i wyszukiwarki */
.stage-details summary h2 { display: inline; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; margin: 0; scroll-margin-top: 110px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--paper-soft);
  color: var(--ink-soft);
  padding: 40px 24px;
  margin-top: 48px;
  border-top: 1px solid var(--line);
}
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--red); }
.footer-mini {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.footer-mini-name { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); }
.footer-mini-text { margin: 0; font-size: 0.86rem; color: var(--ink-soft); }
.footer-mini-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.86rem;
  font-weight: 600;
}
.footer-mini-links span { color: var(--line); }
.footer-mini-copy { margin: 4px 0 0; font-size: 0.76rem; color: var(--ink-soft); opacity: 0.8; }

/* ---------- Utility ---------- */
.muted { color: var(--ink-soft); }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ---------- Wyszukiwarka ---------- */
body.search-open { overflow: hidden; }
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(28, 26, 25, 0.45);
  padding: 72px 16px 16px;
}
.search-overlay[hidden] { display: none; }
.search-panel {
  max-width: 720px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
  overflow: hidden;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}
.search-bar svg { flex-shrink: 0; }
.search-bar input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 1.1rem;
  color: var(--ink);
}
.search-close {
  flex-shrink: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-soft);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.75rem;
  padding: 3px 8px;
  cursor: pointer;
}
.search-results { overflow-y: auto; padding: 8px 8px 12px; }
.search-hint, .search-more { margin: 12px 12px; font-size: 0.9rem; }
.search-group h3 {
  margin: 14px 12px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.search-group h3 span { color: var(--ink-soft); font-weight: 600; }
.search-hit {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
}
.search-hit:hover { background: var(--paper-soft); text-decoration: none; }
.search-hit:focus-visible { background: var(--paper-soft); text-decoration: none; outline: 2px solid var(--red); outline-offset: -2px; }
.search-hit strong { display: block; font-weight: 700; }
.search-meta { display: block; font-size: 0.82rem; color: var(--ink-soft); }
.search-snippet { display: block; font-size: 0.86rem; color: var(--ink-soft); margin-top: 2px; }
.search-hit mark { background: var(--red-light); color: var(--red); border-radius: 3px; padding: 0 1px; }

/* element wskazany kotwicą z wyniku wyszukiwania (wiersz planu, aktualność) */
.is-target { scroll-margin-top: 110px; }
tr.is-target td { background: var(--red-light); }
.news-item.is-target { background: var(--red-light); padding-left: 16px; padding-right: 16px; border-radius: 10px; }

/* ---------- Strona błędu 404 ---------- */
.notfound { padding: 72px 0 88px; }
.notfound-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
}
.notfound-text h1 { margin: 10px 0 16px; }
.notfound-text p { max-width: 46ch; color: var(--ink-soft); }
.notfound-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.notfound-actions .btn { font-family: inherit; }
.notfound-map {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}
.nf-plots rect { fill: var(--paper); stroke: var(--line); stroke-width: 1.5; }
.nf-buildings rect { fill: var(--line); }
.nf-missing {
  fill: var(--red-light);
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-dasharray: 10 7;
  animation: nf-obrys 1.6s linear infinite;
}
.nf-label { font-size: 58px; font-weight: 800; letter-spacing: -0.03em; fill: var(--red); }
.nf-sub { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; fill: var(--red); }
@keyframes nf-obrys { to { stroke-dashoffset: -17; } }
@media (prefers-reduced-motion: reduce) { .nf-missing { animation: none; } }
@media (max-width: 860px) {
  .notfound { padding: 40px 0 56px; }
  .notfound-grid { grid-template-columns: 1fr; gap: 32px; }
  .notfound-map { order: -1; max-width: 420px; }
}
