:root {
  --bg: #0b0f1a;
  --panel: rgba(13, 18, 32, 0.86);
  --panel-border: rgba(120, 150, 210, 0.14);
  --text: #dbe4f5;
  --muted: #7c8aa5;
  --amber: #ffb020;
  --red: #ff4d5e;
  --green: #3ddc84;
  --cyan: #39c5ec;
  --accent: #5b8cff;
  /* Wysokość systemowego obszaru na dole: pasek gestów albo trzy przyciski
     nawigacji (te są znacznie wyższe). Wszystko, co przyklejone do dolnej
     krawędzi, musi ją doliczyć — inaczej przyciski Androida zasłaniają
     suwak historii, atrybucję i przyciski mapy. */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* wysokość dolnego paska zakładek — odsuwa panel, kartę obiektu i stos komunikatów */
  --tabbar-h: 72px;
  /* Okna dialogowe centrujemy nad paskiem zakładek i nigdy nie pozwalamy im go
     dotknąć — inaczej „O aplikacji" kończyło się w połowie wiersza pod zakładkami. */
  /* `vh` najpierw: starszy WebView (Chrome < 108, np. Galaxy S10 15.09.2026) nie zna
     `dvh`, zmienna robiła się nieważna, okna traciły limit wysokości i nie dało się
     ich przewinąć ani dojść do przycisków. W aplikacji vh = dvh (brak paska adresu). */
  --dlg-max: calc(100vh - var(--safe-t) - var(--tabbar-h) - var(--safe-b) - 28px);
  font-size: 15px;
}
@supports (height: 100dvh) {
  :root { --dlg-max: calc(100dvh - var(--safe-t) - var(--tabbar-h) - var(--safe-b) - 28px); }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
.native-app .web-only { display: none !important; }
.web-app .app-only { display: none !important; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif; }

/* Bez zaznaczania tekstu na mapie: przytrzymanie palca otwierało systemowe
   „Kopiuj / Udostępnij", co przy przeciąganiu mapy zdarzało się przypadkiem. */
#map { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }   /* inset: Chrome 87 */

/* ── pasek górny ── */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  /* pasek systemowy Androida/iOS — bez tego treść chowa się pod statusbarem */
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: linear-gradient(180deg, rgba(8,11,20,.94), rgba(8,11,20,.75) 80%, transparent);
  pointer-events: none;
}
#topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; position: relative; cursor: help; outline: none; }
.logo-dot { width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9fc1ff, var(--accent));
  box-shadow: 0 0 12px var(--accent); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 22px var(--accent); } }
.brand-name { margin: 0; line-height: normal; font-weight: 700; letter-spacing: .22em; font-size: 15px; }
.brand-sub { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }

/* Popover WYŁĄCZNIE po najechaniu myszą na „NieboGuard" (desktop) — nie na stałe.
   Mostek ::before wypełnia odstęp, żeby dało się przejechać do klikalnego linku
   bez chowania popovera. */
.brand-info { display: none; position: absolute; top: calc(100% + 9px); left: -4px; z-index: 3000;
  width: min(340px, 82vw); padding: 13px 15px; border-radius: 14px;
  background: rgba(16,22,34,.985); color: #d7deea; border: 1px solid rgba(159,193,255,.24);
  box-shadow: 0 16px 50px rgba(0,0,0,.62), 0 2px 8px rgba(0,0,0,.4);
  font: 400 12px/1.55 "Segoe UI", system-ui, sans-serif; letter-spacing: 0; text-transform: none;
  cursor: default; animation: brandPop .14s ease-out; }
@keyframes brandPop { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
/* strzałka wskazująca na tytuł */
.brand-info::after { content: ""; position: absolute; top: -6px; left: 16px; width: 11px; height: 11px;
  background: rgba(16,22,34,.985); border-left: 1px solid rgba(159,193,255,.24);
  border-top: 1px solid rgba(159,193,255,.24); transform: rotate(45deg); }
/* niewidoczny mostek nad popupem — pozwala przejechać myszą do linku bez chowania */
.brand-info::before { content: ""; position: absolute; top: -11px; left: 0; right: 0; height: 11px; }
.brand-info b { color: #eaf0fb; }
.brand-info a { display: inline-block; margin-top: 10px; color: #7fb4ff; font-weight: 600; text-decoration: none; }
.brand-info a:hover { text-decoration: underline; }
/* Desktop: hover pokazuje popup. Na dotyku hover „przykleja się" i popup nie
   znikał, zasłaniając UI — tam sterujemy klasą .brand-open (tap otwiera, tap
   poza / Escape zamyka; patrz app.js). */
@media (hover: hover) { .brand:hover .brand-info { display: block; } }
.brand.brand-open .brand-info { display: block; }

#status-leds { display: flex; gap: 10px; margin-left: 8px; flex-wrap: wrap;
  cursor: pointer; padding: 3px 6px; border-radius: 8px; }
#status-leds:hover { background: rgba(255,255,255,.06); }

/* ── stała karta obiektu (samolot / obiekt) — bottom-sheet ── */
#ac-card { position: fixed; left: 8px; right: auto; z-index: 1200;
  width: min(172px, calc(100vw - 16px));
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--stack-h, 0px) + 6px);
  max-height: 152px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #fff; color: #16202f; border-radius: 12px; padding: 8px 10px 9px;
  box-shadow: 0 8px 40px rgba(0,0,0,.55); font: 10px "Segoe UI", system-ui, sans-serif;
  line-height: 1.35; }
/* rozwinięta karta — prawie cały ekran, jak przed 1.7.23 */
#ac-card.big { right: 8px; width: auto; max-height: 74vh; max-height: 74dvh; border-radius: 14px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--stack-h, 0px) + 12px);
  padding: 14px 16px 16px; font-size: 12.5px; line-height: 1.45; }
/* w miniaturze zdjęcie jest tylko podglądem, nie połową karty */
#ac-card:not(.big) .thr-photo img,
/* !important, bo karta samolotu ustawia max-height w atrybucie style */
#ac-card:not(.big) #ac-card-body img { max-height: 44px !important; }
#ac-card:not(.big) .thr-photo-note { display: none; }
/* Nagłówek karty strefy musi omijać przyciski (zwiń/zamknij), które leżą
   absolutnie w prawym górnym rogu — bez tego długa nazwa typu strefy chowała się
   pod nimi („strefa czasowo wydzielona (T…"). Element blokowy, bo padding-right
   na tekście liniowym nie wymusza złamania wiersza. */
.zone-head { padding-right: 78px; margin-bottom: 1px; }
#ac-card:not(.big) .zone-head { padding-right: 56px; }
#ac-card.hidden { display: none; }
#ac-card-tools { position: absolute; top: 6px; right: 6px; z-index: 2;
  display: flex; gap: 5px; }
#ac-card:not(.big) #ac-card-x, #ac-card:not(.big) #ac-card-zoom { width: 24px; height: 24px; }
#ac-card:not(.big) #ac-card-x svg, #ac-card:not(.big) #ac-card-zoom svg { width: 13px; height: 13px; }
#ac-card:not(.big) table { font-size: 10px; }
/* Widoczny na KAŻDYM tle: biały × na ciemnym półprzezroczystym kółku z jasną
   obwódką i cieniem — czytelny zarówno na jasnym zdjęciu, jak i na ciemnej grafice. */
#ac-card-x, #ac-card-zoom { width: 32px; height: 32px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.5); border-radius: 50%;
  /* pełne krycie: przez półprzezroczyste tło prześwitywał pierścień zaznaczenia
     obiektu na mapie i wyglądał jak druga, rozmyta ikona */
  background: #101828; color: #fff; line-height: 1;
  cursor: pointer; box-shadow: 0 1px 6px rgba(0,0,0,.55); transition: background .15s; }
#ac-card-x:hover, #ac-card-zoom:hover { background: #1d2942; }
#ac-card-x svg, #ac-card-zoom svg { width: 16px; height: 16px; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#ac-card-zoom .ic-min { display: none; }
#ac-card.big #ac-card-zoom .ic-max { display: none; }
#ac-card.big #ac-card-zoom .ic-min { display: inline; }
#ac-card img { width: 100%; border-radius: 6px; display: block; }
.thr-photo img { max-height: 190px; object-fit: contain; background: #0e1626; }
.thr-photo-note { margin-top: 3px; color: #68758c; font-size: 10px; line-height: 1.25; }
.thr-photo-note a { color: #55729d; text-decoration: underline; }
#ac-card a { color: #1a6fd4; }
#ac-card table { border-collapse: collapse; }
#ac-card .btn-follow { border: 1px solid rgba(0,0,0,.15); background: #16202f; color: #fff;
  border-radius: 9px; }
/* na szerokim ekranie karta jako narożnik, nie pełna szerokość */
@media (min-width: 861px) {
  #ac-card { left: 12px; right: auto; width: 340px; max-height: 46vh; }
  #ac-card.big { right: auto; width: 420px; max-height: 82vh; }
}

/* ── obserwacja obcych maszyn (RU/BY) ── */
#btn-watch { position: relative; }
#watch-badge.badge { position: absolute; top: -6px; right: -6px; min-width: 16px;
  height: 16px; padding: 0 4px; border-radius: 8px; background: var(--red); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 700; }
#watch { max-width: 520px; }
.watch-h { margin: 14px 0 6px; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; }
.watch-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  margin-bottom: 6px; background: var(--card); cursor: pointer; }
.watch-row:hover { border-color: rgba(255,77,94,.5); }
.watch-ev { padding: 6px 2px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.watch-ev .ts { color: var(--muted); font-size: 11px; margin-left: 4px; }
.ev-in { color: var(--red); font-weight: 700; margin-right: 6px; }
.ev-out { color: var(--muted); font-weight: 700; margin-right: 6px; }

/* ── okno „Źródła danych” (klik w diody) ── */
#sources { max-width: 520px; }
.src-row { border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; background: var(--card); }
.src-row.err { border-color: rgba(255,77,94,.4); background: rgba(255,77,94,.06); }
.src-head { display: flex; align-items: center; gap: 8px; }
.src-head i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.src-row.ok .src-head i { background: var(--green); box-shadow: 0 0 6px var(--green); }
.src-row.err .src-head i { background: var(--red); box-shadow: 0 0 6px var(--red); }
.src-state { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.src-row.err .src-state { color: var(--red); }
.src-what { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.src-why { margin: 6px 0 0; font-size: 12.5px; color: #ffd98a; line-height: 1.5; }

/* ── pasek: nasłuch w tle nie działa ── */
#bg-warning {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(var(--topbar-h, 52px) + 46px); z-index: 55;
  display: flex; align-items: center; gap: 10px;
  max-width: min(560px, 94vw);
  background: rgba(255,176,32,.14); border: 1px solid rgba(255,176,32,.5);
  border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--amber);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
#bg-warning.hidden { display: none; }
#bg-warning .bgw-x { min-width: 36px; padding: 4px 10px; }
#bg-warning { flex-wrap: wrap; }          /* ten sam układ co pozostałe ramki */
#bg-warning span { min-width: 0; line-height: 1.35; }
#bg-warning .chip { flex: none; margin-left: auto; padding: 4px 10px; font-size: 11.5px; }
body.panel-open #bg-warning { display: none; }

.noscript-info {
  position: fixed; top: 70px; right: 16px; left: 16px; z-index: 80; max-width: 720px;
  margin: 0 auto; padding: 20px; color: var(--text); background: var(--panel);
  border: 1px solid var(--panel-border); border-radius: 14px; line-height: 1.5;
}
.noscript-info h2 { margin-top: 0; }
.noscript-info a { color: var(--accent); }

/* ── baner „dostępna nowa wersja” ── */
/* Okno aktualizacji: lista „Co się zmienia" bywa dłuższa niż ekran, więc karta ma
   ograniczoną wysokość, a przewija się jej treść. Przyciski w osobnym rzędzie —
   wcześniej przy długim tekście ściskały go do kilku znaków. */
#update-banner {
  /* Wiersz z tekstem MUSI mieć minmax(0, 1fr): element siatki domyślnie nie
     kurczy się poniżej swojej treści, więc dłuższy opis zmian wypychał
     przyciski poza baner, zamiast się przewinąć (zgłoszone 12.09.2026). */
  display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto auto; overflow: hidden;
  width: 100%; max-width: 520px; margin: 0 auto;
  max-height: calc(100vh - var(--topbar-h, 52px) - var(--tabbar-h) - var(--safe-b) - 96px);
  max-height: calc(100dvh - var(--topbar-h, 52px) - var(--tabbar-h) - var(--safe-b) - 96px);
  background: var(--panel, #151d2e); border: 1px solid var(--accent);
  border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.upd-txt { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.upd-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.upd-actions .chip { flex: 0 1 auto; }
#update-banner.hidden { display: none; }
#update-banner.critical { border-color: var(--red); box-shadow: 0 14px 40px rgba(220,45,55,.28); }

/* Komunikat administracyjny (np. zapowiedź testu) — u góry, kolor info, do zamknięcia. */
#notice-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: calc(64px + env(safe-area-inset-top)); z-index: 70;
  display: flex; align-items: center; gap: 10px;
  max-width: min(560px, 94vw);
  background: var(--panel, #151d2e); border: 1px solid #4a86d8;
  border-radius: 12px; padding: 10px 14px; line-height: 1.4;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
#notice-banner.hidden { display: none; }
/* dłuższy komunikat ma się zawijać i przewijać, a nie wychodzić poza ekran */
#notice-banner { flex-wrap: wrap; max-height: min(40vh, 300px); max-height: min(40dvh, 300px); overflow-y: auto; }
#notice-banner span { min-width: 0; font-size: 13px; }
#notice-banner .chip { flex: none; margin-left: auto; }
.upd-txt { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.upd-txt b { font-size: 13.5px; }
.upd-txt span { font-size: 11px; color: var(--muted); }
#upd-progress:not(:empty) { display: block; font-size: 11.5px; line-height: 1.4;
  color: #cfe0fb; background: #13243a; border: 1px solid #375e82;
  border-radius: 8px; padding: 7px 9px; }
.upd-changes { margin-top: 7px; font-size: 11.5px; line-height: 1.45; color: #dce7fa;
  background: rgba(91,140,255,.09); border: 1px solid rgba(91,140,255,.24);
  border-radius: 9px; padding: 8px 10px; }
.upd-changes b { font-size: inherit; }
.upd-changes ul { margin: 2px 0 0; padding-left: 16px; }
.upd-changes li { margin: 1px 0; line-height: 1.3; }
#update-banner .chip { flex: none; }
body.panel-open #update-banner:not(.critical) { display: none; }

/* ── tryb historii w panelu ── */
.hist-banner { background: rgba(255,176,32,.12); border: 1px solid rgba(255,176,32,.4);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--amber); }
.hist-banner span { display: block; font-weight: 400; letter-spacing: 0;
  font-size: 11px; color: var(--muted); margin-top: 3px; }
.linklike { background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer; text-decoration: underline; }
.led { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
.led i { width: 8px; height: 8px; border-radius: 50%; background: #444; display: inline-block; }
.led.ok i { background: var(--green); box-shadow: 0 0 6px var(--green); }
.led.err i { background: var(--red); box-shadow: 0 0 6px var(--red); }

.top-actions { margin-left: auto; display: flex; gap: 8px; }
.chip {
  border: 1px solid var(--panel-border); background: var(--panel); color: var(--text);
  border-radius: 9px; padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active { background: var(--accent); color: #fff; }
.chip.download { background: linear-gradient(135deg, #287a52, #3ca76e); color: #fff;
  border-color: rgba(119,235,171,.55); font-weight: 700; text-decoration: none;
  box-shadow: 0 3px 14px rgba(61,220,132,.18); }
.chip.download:hover { border-color: #9af0bd; filter: brightness(1.08); }
.chip.instructions { color: #dbe8ff; border-color: rgba(127,180,255,.38);
  background: rgba(40,67,112,.5); font-weight: 600; text-decoration: none; }
.chip.instructions:hover { border-color: #7fb4ff; background: rgba(50,82,136,.68); }

/* ── disclaimer ── */
#disclaimer {
  position: relative; border-radius: 10px;
  background: rgba(64, 44, 6, 0.95); border: 1px solid rgba(255, 176, 32, .5);
  color: #ffd98a; font-size: 11.5px; line-height: 1.35;
  padding: 7px 34px 7px 12px; text-align: center;
}
#disclaimer.hidden { display: none !important; }
#disclaimer-x {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: #ffd98a; font-size: 15px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}

/* ── atrybucja ── */
#attribution {
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 8px;
  font-size: 9.5px; line-height: 1.35; color: var(--muted); padding: 5px 9px;
  max-width: 100%; overflow: hidden;
}
/* Atrybucja NEPTUN musi być widoczna (warunek API), ale nie może zjadać pół ekranu.
   JEDEN wiersz z wielokropkiem zamiast przycinania na trzech: `-webkit-line-clamp`
   liczył wiersze inaczej niż wynikało z line-height i zostawiał tekst ucięty w połowie
   linii — wyglądało to jak nachodzenie paska zastrzeżenia. Przy jednym wierszu nie ma
   czego uciąć w pionie, a pełna lista źródeł jest w „O aplikacji". */
#attr-text {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Linki w oknach dialogowych: domyślny jaskrawoniebieski z podkreśleniem odcinał
   się od reszty interfejsu i wyglądał jak surowy HTML. */
dialog a { color: var(--cyan); text-decoration: none; }
dialog a:hover, dialog a:focus-visible { text-decoration: underline; }
/* Trzy odnośniki jako rząd z odstępem zamiast kropek rozdzielających: przy zawijaniu
   kropka zostawała sama na końcu wiersza. */
#more-links { display: flex; flex-wrap: wrap; gap: 6px 16px; line-height: 1.7; }

#attribution a { color: var(--cyan); text-decoration: none; }
#attribution b { color: var(--text); }

/* ── panel boczny (wysuwany) ── */
#panel {
  position: fixed; top: calc(54px + env(safe-area-inset-top)); right: 10px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--stack-h, 0px) + 14px); z-index: 25;
  width: 340px; overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: 12px;
  background: transparent;
  transition: transform .25s ease, opacity .2s ease;
}
#panel.collapsed { transform: translateX(calc(100% + 16px)); opacity: 0;
  pointer-events: none; }
/* Zamykanie panelu: wyraźny, okrągły cel dotyku z ramką i tłem — wcześniej goły
   znak × zlewał się z mapą i wyglądał jak niedokończony element. */
#panel-x {
  position: sticky; top: 0; align-self: flex-end; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(20,28,46,.96); border: 1px solid var(--line-strong, rgba(120,150,210,.3));
  color: var(--text); font-size: 15px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.45);
  transition: background .15s, border-color .15s;
}
#panel-x:hover { background: rgba(36,48,74,.98); border-color: var(--accent); }

/* ── przyciski nawigacji mapy (jak w Mapach Google) ── */
#map-actions {
  position: fixed; right: 12px; z-index: 26;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--stack-h, 0px) + 16px);
  /* Górna granica = dół paska. Gdy komunikaty zabiorą miejsce, przyciski przechodzą
     do drugiej kolumny w lewo zamiast wchodzić na pasek (wrap-reverse zamienia
     strony osi poprzecznej, stąd flex-start = prawa krawędź). */
  top: calc(var(--topbar-bottom, 110px) + 10px);
  display: flex; flex-direction: column; justify-content: flex-end;
  flex-wrap: wrap-reverse; align-items: flex-start; align-content: flex-start;
  gap: 8px; pointer-events: none;
}
#map-actions > * { pointer-events: auto; }
/* Mało miejsca (mały ekran, duża czcionka, tryb historii): same ikony. Gdy nie
   zmieści się nawet jedna ikona — chowamy przyciski, zamiast kłaść je na pasek. */
#map-actions.compact .map-btn { min-width: 0; padding: 9px; gap: 0; }
#map-actions.compact .map-btn span { display: none; }
#map-actions.no-room { visibility: hidden; }
.places-dialog form::-webkit-scrollbar-corner, dialog::-webkit-scrollbar-corner,
.places-dialog form::-webkit-resizer, dialog::-webkit-resizer { background: transparent; }
.map-btn {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-border); color: var(--accent);
  font-size: 19px; line-height: 1; backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.map-btn:hover { border-color: var(--accent); }

/* ── pasek historii 12 h ── */
#timebar {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 8px 12px; backdrop-filter: blur(8px);
}
#timebar.hidden { display: none !important; }
.tb-row { display: flex; align-items: center; gap: 10px; }
/* Stała wysokość nagłówka: plakietka alarmu ogólnokrajowego (#tb-national) pojawia
   się i znika podczas przewijania i nie może zmieniać wysokości paska (14.09.2026
   pasek i przyciski mapy podskakiwały spod palca). */
.tb-head { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 2px; height: 20px; }
#tb-national { flex: 0 1 auto; min-width: 0; display: flex; }
.tb-nat { display: block; max-width: 100%; height: 18px; padding: 0 8px; box-sizing: border-box;
  border: 1px solid var(--nat, #c06bff); border-radius: 999px; background: rgba(192,107,255,.12);
  color: var(--text); font: 600 11px/16px "Segoe UI", system-ui, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
body.history-mode #national-banner { display: none; }
.tb-mode { font: 700 10.5px/1 "Segoe UI", system-ui, sans-serif; letter-spacing: .1em;
  color: var(--amber); }
#timebar #tb-label { font: 600 13px/1 "Segoe UI", system-ui, sans-serif; color: var(--text);
  font-variant-numeric: tabular-nums; }
#timebar #tb-live { width: 100%; margin-top: 4px; justify-content: center; }
/* suwak historii: tło toru = poziom zagrożenia w czasie (zmienna --tl),
   kolor uchwytu = poziom w wybranym momencie */
#tb-slider {
  /* Palec potrzebuje większego celu niż mysz: wyższy tor i uchwyt oraz 44 px
     wysokości pola trafienia (wytyczne dotykowe), żeby dało się precyzyjnie
     przewijać historię bez trafiania w mapę pod spodem. */
  flex: 1; min-width: 90px; height: 44px; -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer; touch-action: none;
}
#tb-slider::-webkit-slider-runnable-track {
  height: 16px; border-radius: 8px;
  background: var(--tl, linear-gradient(90deg, #2a3550, #2a3550));
  border: 1px solid var(--panel-border);
}
#tb-slider::-moz-range-track {
  height: 16px; border-radius: 8px;
  background: var(--tl, linear-gradient(90deg, #2a3550, #2a3550));
  border: 1px solid var(--panel-border);
}
#tb-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 28px; height: 28px;
  border-radius: 50%; margin-top: -7px; background: #dbe4f5;
  border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.65);
}
#tb-slider::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%; background: #dbe4f5;
  border: 3px solid var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,.65);
}
#tb-slider[data-level="elevated"]::-webkit-slider-thumb { border-color: var(--amber); }
#tb-slider[data-level="elevated"]::-moz-range-thumb { border-color: var(--amber); }
#tb-slider[data-level="high"]::-webkit-slider-thumb { border-color: var(--red); }
#tb-slider[data-level="high"]::-moz-range-thumb { border-color: var(--red); }
#tb-label { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 96px;
  text-align: right; }
#tb-live.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* Stała wysokość dwóch wierszy: gdy w oknie pojawiał się sygnał, dochodziła druga
   linijka i cały pasek historii podskakiwał w górę pod palcem. Rezerwujemy miejsce
   od razu, więc pasek stoi w jednym miejscu niezależnie od treści. */
#tb-info { margin-top: 4px; min-height: 38px; }
/* Klikalna liczba sygnałów jest <button>, czyli inline-block: przy wyrównaniu do
   linii bazowej dokładała pod sobą kilka pikseli i pasek historii był wtedy wyższy
   niż przy zwykłym tekście. Razem z min-height wyżej wysokość paska nie zależy już
   od tego, czy w oknie są sygnały — wcześniej pasek podskakiwał w górę pod palcem. */
#tb-info .linklike { vertical-align: top; line-height: inherit; }
body.history-mode #my-banner { display: none; }

/* ── baner mojego regionu ── */
#my-banner {
  /* w stosie nad atrybucją NEPTUN — ta musi pozostać widoczna (warunek API) */
  max-width: 100%;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent); border-radius: 10px;
  padding: 7px 11px; font-size: 12px; backdrop-filter: blur(8px);
}
#my-banner b { text-transform: capitalize; }
#my-banner.level-elevated { border-left-color: var(--amber); }
#my-banner.level-high { border-left-color: var(--red); animation: cardpulse 1.6s infinite; }
#my-banner .lvl { font-size: 10.5px; letter-spacing: .08em; }
#my-banner.level-elevated .lvl { color: var(--amber); }
#my-banner.level-high .lvl { color: var(--red); }
#my-banner.level-none .lvl { color: var(--muted); }
/* alarm ogólnokrajowy NEPTUN-a (np. start MiG-31K) — komunikat zamiast ikony;
   widoczny także w historii, bo opisuje tamtą chwilę */
#national-banner {
  max-width: 100%;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 10px;
  padding: 7px 11px; font-size: 12px; line-height: 1.35; backdrop-filter: blur(8px);
  display: flex; flex-direction: column; gap: 6px;
}
#national-banner .nat-row { border-left: 3px solid var(--nat, #c06bff); padding-left: 8px; }
#national-banner .muted { font-size: 11px; }
/* kolor tylko od sąsiadów: kreskowana ramka i przygaszony opis, bez pulsowania */
#my-banner.level-spill { border-left: 3px dashed rgba(255,176,32,.55); }
#my-banner.level-spill .lvl { color: #c9a86a; }

/* ── pełnoekranowy alarm (poziom czerwony) ── */
#alarm-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90; display: flex; align-items: center;
  justify-content: center; padding: 18px;
  background: rgba(20, 0, 4, .72); backdrop-filter: blur(4px);
  animation: alarmflash 1.1s infinite;
}
@keyframes alarmflash {
  0%, 100% { background: rgba(20, 0, 4, .72); }
  50% { background: rgba(80, 6, 14, .82); }
}
.alarm-box {
  width: min(460px, 96vw); max-height: 92vh; overflow-y: auto; text-align: center;
  background: #16111a; border: 2px solid var(--red); border-radius: 16px;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 0 60px rgba(255, 77, 94, .35);
}
.alarm-icon { font-size: 44px; line-height: 1; color: var(--red);
  animation: cardpulse 1s infinite; }
.alarm-level { font-size: 19px; font-weight: 800; letter-spacing: .12em;
  color: var(--red); margin-top: 8px; }
.alarm-voiv { font-size: 24px; font-weight: 700; text-transform: capitalize;
  margin-top: 4px; }
.alarm-score { font-size: 13px; color: var(--muted); margin-top: 2px; }
.alarm-signals { text-align: left; margin: 14px 0 10px; display: flex;
  flex-direction: column; gap: 6px; }
.alarm-note { font-size: 11.5px; color: #ffd98a; line-height: 1.4;
  background: rgba(64,44,6,.5); border: 1px solid rgba(255,176,32,.4);
  border-radius: 9px; padding: 8px 10px; }
.alarm-nearest { font-size: 13px; color: #e8edf7; margin-top: 10px; line-height: 1.4; }
.alarm-todo { font-size: 13px; font-weight: 700; color: #fff; text-align: left;
  background: rgba(214, 40, 57, .22); border-radius: 9px; padding: 8px 10px; margin: 0 0 10px; }
dialog label.set-check { display: flex; gap: 10px; align-items: center; margin: 10px 0 6px;
  color: var(--text); font-size: 14px; }
dialog .set-check input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; padding: 0; }
/* Suwak jak w ustawieniach Androida (15.09.2026). Prawdziwy checkbox zostaje (klawiatura,
   czytniki ekranu, role="switch"), ale jest niewidoczny nad narysowanym torem. */
dialog label.set-switch { position: relative; display: flex; align-items: center; gap: 12px;
  justify-content: space-between; margin: 10px 0 6px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--panel-border); cursor: pointer; }
dialog .set-switch .sw-text { display: flex; flex-direction: column; gap: 2px; min-width: 0;
  font-size: 14px; color: var(--text); }
dialog .set-switch .sw-text b { font-weight: 600; }
dialog .set-switch .sw-text .muted { font-size: 12px; }
dialog .set-switch input { position: absolute; opacity: 0; width: 52px; height: 30px; right: 12px;
  margin: 0; cursor: pointer; }
dialog .set-switch .sw-track { position: relative; flex: 0 0 52px; height: 30px; border-radius: 15px;
  background: #3a4458; transition: background .15s; }
dialog .set-switch .sw-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px;
  height: 24px; border-radius: 50%; background: #c9d1dc; transition: transform .15s, background .15s; }
dialog .set-switch input:checked + .sw-track { background: #2f6fd6; }
dialog .set-switch input:checked + .sw-track::after { transform: translateX(22px); background: #fff; }
dialog .set-switch input:focus-visible + .sw-track { outline: 2px solid var(--accent); outline-offset: 2px; }
/* audyt C11: biały na #ff4d5e miał kontrast 3,24:1 (poniżej WCAG AA) */
.alarm-btn {
  width: 100%; margin-top: 14px; padding: 15px 12px; border-radius: 12px;
  border: 0; background: #c81e30; color: #fff; font-size: 15px; font-weight: 700;
  letter-spacing: .04em; cursor: pointer;
}
.alarm-btn:hover { filter: brightness(1.1); }
.alarm-time { font-size: 10.5px; color: var(--muted); margin-top: 8px; }

/* ── przycisk buycoffee ── */
.chip.coffee {
  background: linear-gradient(135deg, #ffb020, #ff7d3b); border-color: #ffb020;
  color: #2a1a00; font-weight: 600; text-decoration: none; display: inline-block;
}
.chip.coffee:hover { filter: brightness(1.08); border-color: #ffd98a; }

/* ── okno „O aplikacji" ── */
#about { width: min(680px, 94vw); max-height: var(--dlg-max); padding: 0; overflow: hidden; }
.about-body { max-height: var(--dlg-max); overflow-y: auto; padding: 20px 22px 18px; }
.about-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.about-logo {
  width: 52px; height: 52px; flex: none; border-radius: 14px;
  background: radial-gradient(circle at 35% 30%, #5b8cff, #12203c);
  box-shadow: 0 0 18px rgba(91,140,255,.45); position: relative;
}
.about-logo::after {
  content: ""; position: absolute; right: 11px; top: 11px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber);
}
#about h2 { font-size: 19px; letter-spacing: .2em; }
.about-sub { font-size: 11.5px; color: var(--muted); }
#about h3 { font-size: 12px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 7px; }
#about p { font-size: 13px; line-height: 1.5; }
#about a { color: var(--cyan); }
.warn-box {
  background: rgba(64,44,6,.55); border: 1px solid rgba(255,176,32,.45);
  border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45;
  color: #ffd98a;
}
.about-tab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.about-tab td { padding: 5px 6px; border-bottom: 1px solid rgba(120,150,210,.12);
  vertical-align: top; line-height: 1.4; }
.about-tab td:first-child { white-space: nowrap; color: var(--cyan); width: 74px; }
.about-tab .pts { text-align: right; color: var(--amber); font-weight: 700;
  white-space: nowrap; width: 46px; }
.lvl-row { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px;
  line-height: 1.45; margin-bottom: 6px; }
.lvl-row .sq { width: 12px; height: 12px; border-radius: 3px; background: var(--c);
  flex: none; margin-top: 3px; }
.about-list { font-size: 12.5px; line-height: 1.55; padding-left: 18px; }
.about-list li { margin-bottom: 4px; }
.about-actions { display: flex; gap: 10px; justify-content: flex-end;
  align-items: center; margin-top: 18px; flex-wrap: wrap; }

.switch-row { display: flex; align-items: center; gap: 10px; margin-top: 8px;
  font-size: 13px; color: var(--text); cursor: pointer; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--accent); }
.threat-row.clickable { cursor: pointer; }
.threat-row.clickable:hover { outline: 1px solid var(--accent); }

#cameras { width: min(620px, 95vw); }
.cam-list { margin-top: 10px; max-height: 56vh; overflow-y: auto; }
.cam-city { font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 12px 0 6px; }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; }
.cam-tile { display: block; border-radius: 10px; overflow: hidden; text-decoration: none;
  background: rgba(90,120,190,.10); border: 1px solid var(--panel-border); }
.cam-tile:hover { border-color: var(--accent); }
.cam-tile img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block;
  background: #0b0f1a; }
.cam-tile span { display: block; padding: 6px 8px; font-size: 11.5px; color: var(--text);
  line-height: 1.3; }
.cam-tile.cam-dead { display: none; }   /* miniatura padła — nie pokazuj martwej kafelki */
.cam-indoor { margin-top: 14px; }
.cam-indoor summary { font-size: 11.5px; color: var(--muted); cursor: pointer;
  line-height: 1.4; }
.btn-cams { margin-top: 8px; width: 100%; }

dialog select { width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--panel-border); background: #0b0f1a; color: var(--text); }
.voiv-card.is-mine { box-shadow: 0 0 0 1px var(--accent) inset; }
.voiv-card.is-mine .voiv-name::after { content: " · mój region"; color: var(--accent);
  font-size: 10px; letter-spacing: .05em; text-transform: none; }
html[lang="en"] .voiv-card.is-mine .voiv-name::after { content: " · my region"; }
.sig.src-spillover { border-left-color: #6f7ea8; opacity: .85; }
/* Rozpisanie wyniku pod nagłówkiem karty — cichsze niż sygnały, ale czytelne. */
/* Plakietka przy sygnale z ostatnich 5 minut — tłumaczy, czemu jest na górze. */
.sig-fresh { display: inline-block; margin-bottom: 3px; padding: 1px 6px;
  border-radius: 7px; background: rgba(91,140,255,.18); color: var(--accent);
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; }

.voiv-sum { margin: 4px 0 2px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.voiv-sum b { color: var(--text); }

#panel section {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 10px 12px; backdrop-filter: blur(8px);
}
#panel h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; }
.muted { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.fineprint { font-size: 10.5px; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.list { display: flex; flex-direction: column; gap: 7px; max-height: 30vh; overflow-y: auto; }
.list:empty::after { content: "— brak —"; color: var(--muted); font-size: 12px; }
html[lang="en"] .list:empty::after { content: "— none —"; }

/* karty województw */
.voiv-card {
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  background: var(--panel); border: 1px solid var(--panel-border);
  backdrop-filter: blur(8px); cursor: pointer;
}
.voiv-card.level-elevated { border-color: rgba(255,176,32,.65);
  box-shadow: inset 0 0 24px rgba(255,176,32,.07); }
.voiv-card.level-spill { border: 1px dashed rgba(255,176,32,.45); }
.level-spill .voiv-score, .level-spill .voiv-level { color: #c9a86a; }
.voiv-card.level-high { border-color: rgba(255,77,94,.8);
  box-shadow: inset 0 0 26px rgba(255,77,94,.12); animation: cardpulse 1.6s infinite; }
@keyframes cardpulse { 50% { box-shadow: inset 0 0 40px rgba(255,77,94,.22); } }
.voiv-head { display: flex; align-items: baseline; gap: 8px; }
.voiv-name { font-weight: 600; font-size: 14px; text-transform: capitalize; }
.voiv-score { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.level-none  .voiv-score { color: var(--muted); }
.level-elevated .voiv-score { color: var(--amber); }
.level-high .voiv-score { color: var(--red); }
.voiv-level { font-size: 10.5px; letter-spacing: .1em; }
.level-none .voiv-level { color: var(--muted); }
.level-elevated .voiv-level { color: var(--amber); }
.level-high .voiv-level { color: var(--red); }
.voiv-breakdown { margin-top: 6px; display: none; }
.voiv-card.open .voiv-breakdown { display: block; }

/* pozycje sygnałów */
.sig {
  font-size: 12px; line-height: 1.4; padding: 8px 10px; border-radius: 10px;
  background: rgba(90, 120, 190, 0.08); border-left: 3px solid var(--accent);
}
/* Nagłówek wiersza: źródło po lewej, punkty po prawej — bez float, żeby przy
   długim tytule punkty nie wchodziły w tekst (na telefonie to gubiło czytelność). */
.sig-head { display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 3px; }
.sig .src { font-weight: 700; font-size: 10.5px; letter-spacing: .06em;
  color: var(--tx2, #a9b4cc); white-space: nowrap; }
.sig .pts { font-weight: 800; color: var(--amber); font-size: 13px;
  background: rgba(255,176,32,.12); border-radius: 999px; padding: 1px 8px;
  white-space: nowrap; }
.sig .pts.capped { color: var(--muted); background: rgba(140,150,175,.12); }
.sig-title { font-size: 12.5px; line-height: 1.35; }
/* Pasek udziału: ile ten sygnał wnosi względem progu 2 pkt — jeden rzut oka
   wystarczy, żeby odróżnić drobiazg od sygnału domykającego alarm. */
.sig-bar { height: 3px; border-radius: 2px; background: rgba(140,150,175,.18);
  margin: 5px 0 4px; overflow: hidden; }
.sig-bar i { display: block; height: 100%; background: var(--amber); border-radius: 2px; }
.sig.src-neptun .sig-bar i { background: var(--red); }
.sig.src-adsb .sig-bar i { background: var(--cyan); }
.sig.src-pansa .sig-bar i { background: #b07dff; }
.sig .ts { color: var(--muted); font-size: 10.5px; }
.sig.src-neptun { border-left-color: var(--red); }
.sig.src-media { border-left-color: var(--amber); }
.sig.src-rcb { border-left-color: #ff7d3b; }
.sig.src-adsb { border-left-color: var(--cyan); }
.sig.src-pansa { border-left-color: #b07dff; }
.sig.src-test { border-left-color: var(--green); }
.sig a { color: var(--cyan); }

.threat-row { font-size: 12px; padding: 6px 9px; border-radius: 9px;
  background: rgba(255, 77, 94, 0.07); }
.threat-row b { text-transform: uppercase; font-size: 11px; }
.threat-row .meta { color: var(--muted); font-size: 10.5px; }
/* „Na mapie, ale bez punktów" — te same wiersze co obiekty punktowane, tylko
   wygaszone i z jawnym zerem, żeby nie udawały wkładu do wyniku. */
.unscored-head { margin: 10px 0 5px; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.threat-row.unscored { opacity: .72; border-left: 2px solid var(--line-strong, rgba(120,150,210,.3)); }
.threat-row.unscored .zero { margin-left: 6px; padding: 1px 6px; border-radius: 7px;
  background: rgba(120,150,210,.14); color: var(--muted); font-size: 10.5px;
  font-weight: 700; }

/* ── legenda ── */
#legend {
  position: fixed; left: 10px; top: calc(60px + env(safe-area-inset-top));
  z-index: 26; width: 250px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px;
  padding: 10px 12px; backdrop-filter: blur(8px); font-size: 12px;
  /* Legenda kończy się nad dolnymi sekcjami: wcześniej sztywne 170 px nie
     wiedziało o pasku zakładek ani o stosie komunikatów i wchodziła na nie. */
  max-height: calc(100vh - 74px - var(--tabbar-h) - var(--safe-b) - var(--stack-h, 0px));
  max-height: calc(100dvh - 74px - var(--tabbar-h) - var(--safe-b) - var(--stack-h, 0px));
  overflow-y: auto; overscroll-behavior: contain;
  /* Ostatni wiersz nie może kończyć się dokładnie na krawędzi — wyglądało to jak
     ucięta treść, mimo że legenda przewija się do końca. */
  padding-bottom: 16px;
}
/* Cień „jest więcej poniżej" znika, gdy przewiniesz legendę do końca. */
#legend::after {
  content: ""; position: sticky; bottom: -16px; display: block;
  height: 18px; margin: 4px -12px -16px; pointer-events: none;
  background: linear-gradient(rgba(13, 18, 32, 0), rgba(13, 18, 32, .95));
}
#legend h3 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px; }
.lg-group { color: var(--muted); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; margin: 8px 0 4px; }
.lg-row { display: flex; align-items: center; gap: 8px; padding: 2.5px 0; }
.lg-row i { flex: none; display: inline-block; }
.lg-row .lg-threat { width: 26px; height: 26px; }
.lg-row .lg-threat canvas { display: block; width: 26px; height: 26px; }
.lg-row .pulse-ic { width: 26px; height: 26px; flex: none; display: grid; place-items: center; }
.lg-row .sq.oblast-ic { background: rgba(255,111,145,.22); border: 1.5px dashed #ff6f91; box-sizing: border-box; }
.lg-row .pulse-ic::before { content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #ff4d5e; animation: lg-pulse 1.6s linear infinite; }
@keyframes lg-pulse { from { transform: scale(.8); opacity: .95; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lg-row .pulse-ic::before { animation: none; } }
.lg-row .ring { width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--amber); opacity: .7; }
.lg-row .trail { width: 16px; height: 0;
  border-top: 2px dashed var(--red); opacity: .7; }
.lg-row .plane-ic { width: 12px; height: 12px; background: var(--cyan);
  clip-path: polygon(50% 0, 58% 35%, 100% 55%, 100% 68%, 58% 55%, 55% 80%, 68% 92%, 32% 92%, 45% 80%, 42% 55%, 0 68%, 0 55%, 42% 35%); }
.lg-row .sq { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.muted-row { color: var(--muted); font-size: 10.5px; line-height: 1.35; }

#conn-badge { position: fixed; top: calc(60px + env(safe-area-inset-top)); left: 12px; z-index: 40;
  background: rgba(64,44,6,.9); color: var(--amber); font-size: 11px;
  border: 1px solid var(--amber); border-radius: 8px; padding: 4px 10px; }
.hidden { display: none !important; }

/* komunikat o zmianie ustawienia (zamiast niemego przełącznika) */
#toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 95;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  max-width: min(430px, 92vw); background: #16203a; color: var(--text);
  border: 1px solid var(--accent); border-radius: 12px; padding: 11px 14px;
  font-size: 12.5px; line-height: 1.45; box-shadow: 0 6px 26px rgba(0,0,0,.5);
  animation: toastIn .18s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }

/* atrybucja w panelu — na desktopie zbędna (jest ta na mapie) */
#panel-attrib { display: none; line-height: 1.45; }
#panel-attrib a { color: var(--cyan); }

/* Okna informacyjne: bez max-height i przewijania dłuższa treść (np. lista źródeł
   albo ustawienia) była ucinana na telefonie i nie dało się jej przewinąć.
   `dvh` zamiast `vh`, bo pasek adresu w przeglądarce zmienia wysokość widoku. */
dialog { margin: auto; background: #121828; color: var(--text); border: 1px solid var(--panel-border);
  /* Skrócony obszar pozycjonowania: dół kończy się nad paskiem zakładek, a
     `margin:auto` centruje okno w tym, co zostaje. */
  /* Górna krawędź MUSI uwzględniać pasek stanu: bez tego wysokie okno (np. lista
     źródeł) zaczynało się pod zegarkiem Androida i wyglądało jak ucięte u góry. */
  position: fixed; top: var(--safe-t); left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  border-radius: 14px; padding: 18px; width: min(420px, 92vw);
  max-height: var(--dlg-max); overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 24px 60px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(0,0,0,.55); }
/* cienki, ciemny pasek przewijania — jaśniejszy domyślny rozjeżdżał się z panelem */
dialog, .upd-txt, .about-body, .places-dialog form {
  scrollbar-width: thin; scrollbar-color: #3a4a6b transparent; }
dialog::-webkit-scrollbar, .upd-txt::-webkit-scrollbar,
.about-body::-webkit-scrollbar, .places-dialog form::-webkit-scrollbar { width: 9px; }
dialog::-webkit-scrollbar-thumb, .upd-txt::-webkit-scrollbar-thumb,
.about-body::-webkit-scrollbar-thumb, .places-dialog form::-webkit-scrollbar-thumb {
  background: #33425f; border-radius: 9px; border: 2px solid transparent;
  background-clip: content-box; }
dialog h3 { margin-bottom: 10px; }
dialog label { display: block; font-size: 13px; color: var(--muted); }
dialog input { width: 100%; margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--panel-border); background: #0b0f1a; color: var(--text); }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* ── lokalne profile „Moje miejsca” ── */
.places-dialog { width:min(620px,96vw); max-height:var(--dlg-max); padding:0; overflow:hidden; }
.places-dialog form { max-height:var(--dlg-max); overflow:auto; padding:20px; }
/* Druga asekuracja: formularz przewija się wewnątrz okna nawet wtedy, gdy limit
   wysokości nie zadziała — okno ma overflow:hidden, więc bez tego treść była ucinana. */
.places-dialog[open] { display:flex; flex-direction:column; }
.places-dialog[open] form { flex:1 1 auto; min-height:0; }
.places-dialog [hidden] { display:none!important; }
.places-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.places-head h2 { margin:3px 0 6px; font-size:26px; }
.places-head .eyebrow { color:var(--muted); font-size:10px; letter-spacing:.18em; }
.places-tabs { display:flex; gap:7px; margin:16px 0 10px; overflow-x:auto; padding-bottom:5px; }
.places-tabs button { white-space:nowrap; }
.places-tabs button.active { color:#fff; border-color:var(--accent); background:#243c6e; }
.places-dialog label { margin-top:14px; }
.places-dialog small { display:block; margin-top:5px; color:var(--muted); }
.place-alerts { display:flex!important; align-items:center; justify-content:space-between; gap:12px; color:var(--text)!important; }
.place-alerts input { width:21px; height:21px; margin:0; accent-color:var(--accent); }
.places-notice { margin:12px 0 4px; padding:11px 12px; border:1px solid #476484; border-radius:10px; background:#13243a; color:#d9e8fb; font-size:12px; line-height:1.45; }
.local-place-eta { margin:7px 0; padding:8px 10px; border-left:3px solid #55b7ff; border-radius:5px; background:rgba(44,123,190,.13); font-size:12px; line-height:1.45; }
.local-place-eta small { display:block; margin-top:4px; color:var(--muted); }
#place-gps-row { margin-top:15px; }
#place-gps-status { margin:8px 0 0; }
.text-button { border:0; background:none; color:#8db5ff; padding:7px 0; cursor:pointer; }
.places-actions { position:sticky; bottom:-20px; display:grid; grid-template-columns:auto 1fr auto auto; gap:8px; align-items:center; margin:20px -20px -20px; padding:13px 20px calc(13px + env(safe-area-inset-bottom)); border-top:1px solid var(--panel-border); background:#121828; }
.chip.danger { color:#ff9aa4; border-color:#743743; }
#place-feedback:not(:empty) { margin-top:12px; padding:9px; border:1px solid #375e82; border-radius:8px; background:#122437; color:#b8d8f7; }
@media(max-width:600px){
  /* Nie na cały ekran „od krawędzi do krawędzi": okno ma marginesy i zaokrąglenie,
     dzięki czemu widać, że to okno nad mapą, a nie osobny ekran aplikacji. */
  .places-dialog { width: calc(100vw - 20px); height: auto; max-height: var(--dlg-max);
    border-radius: 16px; border: 1px solid var(--panel-border); }
  .places-dialog form { max-height: var(--dlg-max); padding:16px; }
  .places-actions { grid-template-columns:1fr 1fr; margin-left:-18px; margin-right:-18px; }
  .places-actions span { display:none; }
}

.only-mobile { display: none; }
@media (max-width: 860px) {
  .only-mobile { display: inline-block; }
  .brand-sub, #status-leds .led span { display: none; }
  #topbar { gap: 8px; }
  #status-leds { gap: 5px; flex-wrap: nowrap; }
  .chip { padding: 5px 9px; }
  /* pasek nie może uciąć przycisków — zawijamy do drugiego rzędu */
  #topbar { flex-wrap: wrap; row-gap: 6px; }
  .top-actions { flex-wrap: wrap; justify-content: flex-end; }

  /* panel wysunięty przykrywa dół ekranu — chowamy to, co by się nakładało,
     a atrybucja przenosi się do wnętrza panelu (patrz #panel-attrib) */
  body.panel-open #my-banner,
  body.panel-open #national-banner,
  body.panel-open #attribution,
  body.panel-open #map-actions { display: none; }
  #panel-attrib { display: block; }
}

/* Niskie telefony (360×640): panel sygnałów w trybie historii miał ~300 px, bo resztę
   zabierały pasek historii i ostrzeżenie. Przy otwartym panelu chowamy linię statystyk
   paska (panel ma własny nagłówek chwili) i ostrzeżenie (wraca po zamknięciu panelu). */
@media (max-width: 700px) and (max-height: 780px) {
  body.panel-open #disclaimer, body.panel-open #tb-info { display: none; }
}

/* wąskie telefony: tekstowe przyciski zamieniamy na ikony, żeby wszystkie
   zmieściły się w jednym rzędzie */
@media (max-width: 700px) {
  .brand-name { font-size: 12px; letter-spacing: .12em; }
  #topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .top-actions { gap: 5px; }
  .chip { padding: 6px 8px; font-size: 13px; }
  #status-leds { gap: 4px; }
  .led i { width: 7px; height: 7px; }
  /* pięć ikon (legenda, 3D, obce maszyny, powiadomienia, ustawienia) musi zmieścić
     się w jednym rzędzie obok nazwy i diod */
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
  .icon-btn svg { width: 18px; height: 18px; }
  .top-actions { gap: 4px; }
  #panel { left: 10px; width: auto; top: auto; height: 52vh;
    /* przy wysokim stosie komunikatów panel wchodził na górny pasek (✕ pod ⚙) */
    max-height: calc(100vh - var(--topbar-bottom, 110px) - 8px - var(--tabbar-h) - var(--safe-b)
      - var(--stack-h, 0px) - 14px); }
  #panel.collapsed { transform: translateY(calc(100% + 60px)); }
  #attribution { font-size: 10px; }


  #legend { width: 210px; font-size: 11px; }
  /* na wąskim ekranie sam kubek — pełny napis nie mieści się w pasku */
  .chip.download { font-size: 0; padding: 5px 8px; }
  .chip.download::before { content: "⬇"; font-size: 15px; }
  .chip.instructions { font-size: 0; padding: 5px 8px; }
  .chip.instructions::before { content: "📖"; font-size: 14px; }
  .chip.coffee { font-size: 0; padding: 5px 8px; }
  .chip.coffee::before { content: "☕"; font-size: 14px; }
  .about-tab td:first-child { width: 62px; }
  #about h2 { font-size: 17px; }
}

.maplibregl-ctrl-attrib { display: none !important; }

/* ── dolny stos komunikatów ─────────────────────────────────────────────────
   Jeden pojemnik zamiast pięciu osobno pozycjonowanych elementów. Kolejność w
   kolumnie z odstępem sprawia, że nic nie może na siebie wejść, a zamknięcie
   paska zastrzeżenia automatycznie przesuwa resztę w dół. */
#bottom-stack {
  position: fixed; left: 10px; right: 10px; z-index: 28;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  display: flex; flex-direction: column; gap: 7px;
  pointer-events: none;                 /* mapa pod spodem zostaje przesuwalna */
}
/* Bez tego flex ściskał atrybucję i ucinał ją w połowie wiersza — wyglądało to
   jak nachodzenie paska zastrzeżenia na tekst źródeł. */
#bottom-stack > * { pointer-events: auto; flex: 0 0 auto; }

/* Atrybucja NEPTUN musi pozostać widoczna (warunek korzystania z API), więc ✕ nie
   usuwa jej, tylko ZWIJA do jednej plakietki. Użytkownik odzyskuje ekran, a źródło
   nadal jest podane; pełna lista jest też w „O aplikacji". */
#attribution { position: relative; padding-right: 30px; }
#attr-x {
  position: absolute; top: 3px; right: 3px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; font-size: 12px; line-height: 1;
  background: rgba(20,28,46,.9); border: 1px solid var(--panel-border); color: var(--muted);
}
#attr-x:hover { color: var(--text); border-color: var(--accent); }
#attribution.mini {
  padding-right: 9px; cursor: pointer; max-width: max-content;
}

#attribution.mini > :not(.mini-label) { display: none; }
#attribution .mini-label { display: none; }
#attribution.mini .mini-label { display: inline; }
#bottom-stack > .hidden { display: none !important; }
body.panel-open #bottom-stack > #update-banner:not(.critical) { display: none; }

/* ── dolny pasek zakładek ──────────────────────────────────────────────────
   Cztery cele dotyku z podpisami. Odstęp od systemowego paska nawigacji, żeby
   zakładek nie mylić z przyciskami Androida. */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px 4px calc(16px + var(--safe-b));
  background: rgba(9, 13, 22, .96); border-top: 1px solid var(--panel-border);
  backdrop-filter: blur(10px);
}
.tab-btn {
  position: relative; display: grid; justify-items: center; gap: 3px;
  padding: 6px 2px; border: 0; border-radius: 12px; background: transparent;
  color: var(--muted); font: 500 10.5px/1.1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tab-btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); background: rgba(91,140,255,.13); }
.tab-btn .badge { position: absolute; top: 2px; right: 22%; }

/* ── ikony w pasku górnym ── */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--panel-border); background: rgba(18,26,43,.86);
  color: var(--text);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn.active { background: rgba(91,140,255,.18); border-color: var(--accent); }
.icon-btn { position: relative; }
.icon-btn .badge { position: absolute; top: -5px; right: -5px; }

/* ── przyciski kadrowania mapy ── */
#map-actions .map-btn {
  /* szerokość z treści, nie sztywna: „mój region" i „whole PL" łamały się na dwie
     linie i wychodziły poza kafelek. Napis nigdy się nie zawija. */
  /* height:auto MUSI być: bazowa .map-btn ma sztywne 42x42 px i podpis wychodził
     poza kafelek — dolna linia napisu była ucięta. */
  display: grid; justify-items: center; gap: 5px;
  width: auto; height: auto; min-width: 96px; padding: 10px 16px 11px;
  border-radius: 14px; background: rgba(13,18,32,.94);
  border: 1px solid var(--line-strong, rgba(120,150,210,.3)); color: var(--text);
  font: 500 10px/1.1 "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
#map-actions .map-btn span { display: block; font-size: 10.5px; line-height: 1.15;
  white-space: nowrap; letter-spacing: 0; }
#map-actions .map-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#map-actions .map-btn:hover { border-color: var(--accent); }
/* przełącznik stref PAŻP: stan włączony/wyłączony musi być widoczny bez tekstu,
   bo kafelek ma miejsce tylko na jedno słowo */
/* strefy PAŻP w karcie województwa — druga droga do opisu strefy, gdy trafienie
   palcem w wielokąt na mapie jest niewygodne */
.voiv-zones { margin: 6px 0 2px; display: flex; flex-wrap: wrap; align-items: center;
  gap: 5px; }
.voiv-zones .btn-zone { padding: 2px 7px; font-size: 11px; border-radius: 8px;
  border-color: rgba(179,157,219,.45); color: #d9cdf3; background: rgba(179,157,219,.09); }
.voiv-zones .btn-zone:hover { border-color: #b39ddb; }

#map-actions .map-btn[aria-pressed="true"] { border-color: rgba(179,157,219,.62);
  color: #d9cdf3; }
#map-actions .map-btn[aria-pressed="false"] { opacity: .48; }
#map-actions .map-btn[aria-pressed="false"]:hover { opacity: .8; }

/* ── arkusz „Więcej” ── */
.sheet { width: min(460px, 94vw); padding: 16px 16px calc(16px + var(--safe-b)); }
.sheet h3 { margin-bottom: 12px; }
.sheet-list { display: grid; gap: 6px; }
.sheet-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 13px; border-radius: 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--panel-border); background: rgba(18,26,43,.7);
  color: var(--text); font: 500 14px/1.25 "Segoe UI", system-ui, sans-serif;
  text-decoration: none;
}
.sheet-row svg { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); }
/* sylwetki (np. samolot) czytelniejsze jako wypełnienie niż jako kreska */
.sheet-row svg.solid { fill: currentColor; stroke: none; }
.sheet-row:hover { border-color: var(--accent); background: rgba(91,140,255,.12); }
.sheet-row.active { border-color: var(--accent); }

/* ── zakładki w Ustawieniach ── */
.set-tabs {
  /* wrap: przy dużej czcionce systemowej na wąskim ekranie nazwy były ucinane do
     „Alar…”, „Dźw…” (Android 12, 360 px, czcionka 130%) — wtedy drugi rząd */
  display: flex; flex-wrap: wrap; gap: 5px; padding-bottom: 10px; margin: 0 0 12px;
}
.set-tabs::-webkit-scrollbar { display: none; }
.set-tab {
  /* cztery zakładki mają zmieścić się w jednym rzędzie na telefonie — przy
     większym odstępie „Aplikacja" wychodziła poza okno i trzeba było przewijać */
  flex: 1 1 auto; padding: 8px 6px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong, rgba(120,150,210,.3)); background: transparent;
  color: var(--muted); font: 600 11.5px/1 "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
}
.set-tab:hover { color: var(--text); }
.set-tab.active { background: rgba(91,140,255,.16); border-color: var(--accent); color: var(--text); }
.set-pane[hidden] { display: none; }
.set-pane > h3:first-child { margin-top: 0; }
