:root {
  --zielen: #39844f;
  --zielen-ciemna: #2c6a3e;
  --zielen-tlo: #e8f3ec;
  --czerwien: #b3261e;
  --czerwien-tlo: #fbeaea;
  --bursztyn: #8a5a00;
  --bursztyn-tlo: #fdf3dc;
  --szary: #5f6b66;
  --szary-tlo: #eef1ef;
  --linia: #d9dfdb;
  --tekst: #1d2522;
  --tlo: #f1f6f8;
  --karta: #ffffff;
  --morze-ciemne: #0a3350;
  --morze: #0f5f7d;
  --morze-jasne: #1b8a8f;
  --woda: #2f9fd0;
  --cien: 0 1px 2px rgba(10, 51, 80, .07), 0 8px 22px rgba(10, 51, 80, .06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--tlo);
  color: var(--tekst);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

h2 { font-size: 16px; margin: 22px 0 8px; color: var(--morze-ciemne); }
h3 { font-size: 16px; margin: 0 0 10px; color: var(--morze-ciemne); }

/* Nagłówek */
.naglowek { background: var(--karta); }
.pas-logo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; }
.logo-projektu { height: 46px; width: auto; display: block; }
.nazwa { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.nazwa strong { color: var(--morze-ciemne); font-size: 16px; }
.nazwa span { color: var(--szary); font-size: 12.5px; }
.partnerzy { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.logo-imp { height: 46px; width: auto; display: block; }
.logo-rendben { height: 34px; width: auto; display: block; }
.wyloguj { margin: 0; }

.pas-morze {
  position: relative; overflow: hidden; color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 9px 16px 22px;
  background: linear-gradient(100deg, var(--morze-ciemne), var(--morze) 58%, var(--morze-jasne));
}
.czas { color: #d9eef5; font-variant-numeric: tabular-nums; font-size: 14px; }
.znaczniki { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.znacznik {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px;
  background: rgba(255, 255, 255, .14); color: #fff; white-space: nowrap;
}
.znacznik::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c9d6dc; }
.znacznik.ok::before { background: #7fe0a0; }
.znacznik.uwaga { background: rgba(255, 209, 102, .2); font-weight: 600; }
.znacznik.uwaga::before { background: #ffd166; }
.znacznik.zle { background: var(--czerwien); font-weight: 600; }
.znacznik.zle::before { background: #fff; animation: pulsowanie 1.2s ease-in-out infinite; }
.fala-naglowka {
  position: absolute; left: 0; bottom: -1px; width: 200%; height: 13px; fill: var(--tlo);
  animation: fala-naglowka 16s linear infinite;
}
@keyframes fala-naglowka { to { transform: translateX(-50%); } }

/* Paski alarmów */
.pasek { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pasek.alarm { background: var(--czerwien); color: #fff; }
.pasek.uwaga { background: var(--bursztyn-tlo); color: var(--bursztyn); border-bottom: 1px solid #efdcb0; }
.pasek-tekst { flex: 1 1 320px; }
.pasek-tekst strong { display: block; }

/* Zakładki */
.zakladki {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 16px 0; border-bottom: 1px solid var(--linia);
  position: sticky; top: 0; z-index: 5; background: var(--tlo);
}
.zakladka {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 8px 12px;
  font: inherit; color: var(--szary); cursor: pointer; transition: color .15s, border-color .15s;
}
.zakladka:hover { color: var(--tekst); }
.zakladka.aktywna { color: var(--morze-ciemne); border-bottom-color: var(--zielen); font-weight: 600; }

main { padding: 14px 16px 24px; max-width: 1500px; margin: 0 auto; }
.widok:not([hidden]) { animation: wejscie .28s ease both; }
@keyframes wejscie { from { opacity: 0; transform: translateY(6px); } }

/* Przyciski */
.przycisk {
  font: inherit; padding: 7px 14px; border-radius: 7px; border: 1px solid #b9c4be;
  background: #fff; color: var(--tekst); cursor: pointer; transition: background .15s, transform .08s;
}
.przycisk:hover { background: var(--szary-tlo); }
.przycisk:active { transform: translateY(1px); }
.przycisk:focus-visible, .zakladka:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--zielen); outline-offset: 1px;
}
.przycisk:disabled { opacity: .5; cursor: default; }
.przycisk.maly { padding: 3px 9px; font-size: 13px; }
.przycisk.glowny { background: var(--zielen); border-color: var(--zielen); color: #fff; }
.przycisk.glowny:hover { background: var(--zielen-ciemna); }
.przycisk.aktywny { background: var(--zielen-tlo); border-color: var(--zielen); color: var(--zielen-ciemna); }
.przycisk.stop {
  background: var(--czerwien); border-color: var(--czerwien); color: #fff;
  font-weight: 700; font-size: 18px; padding: 12px 34px; letter-spacing: 1px;
}
.przycisk.stop:hover { background: #8f1d17; }
.przycisk.stop.pracuje { animation: poswiata 1.6s ease-in-out infinite; }
@keyframes poswiata {
  0%, 100% { box-shadow: 0 0 0 0 rgba(179, 38, 30, .45); }
  50% { box-shadow: 0 0 0 9px rgba(179, 38, 30, 0); }
}
.pasek.alarm .przycisk { border-color: #fff; }

/* Bieżące zadanie */
.teraz {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between;
  background: var(--karta); border-radius: 12px; padding: 12px 16px; box-shadow: var(--cien);
  margin-bottom: 14px;
}
.teraz-lewa { flex: 1 1 300px; min-width: 0; }
.teraz-glowne { font-size: 17px; font-weight: 600; color: var(--morze-ciemne); }
.teraz-glowne .kropka {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--zielen);
  margin-right: 8px; animation: pulsowanie 1.2s ease-in-out infinite;
}
@keyframes pulsowanie { 50% { opacity: .35; } }
.teraz-dane { color: var(--szary); margin-top: 2px; font-variant-numeric: tabular-nums; }
.postep { height: 8px; background: var(--szary-tlo); border-radius: 4px; overflow: hidden; margin-top: 8px; max-width: 520px; }
.postep > div { height: 100%; background: linear-gradient(90deg, var(--morze-jasne), var(--zielen)); transition: width .9s linear; }
.postep > div.blisko { background: var(--czerwien); }
.kolejka { margin-top: 6px; color: var(--szary); font-size: 13px; overflow-wrap: anywhere; }

.kafle { display: flex; flex-wrap: wrap; gap: 8px; }
.kafel {
  display: flex; flex-direction: column; min-width: 104px; padding: 6px 10px 5px; border-radius: 9px;
  background: linear-gradient(180deg, #f6fafb, #edf4f6); border: 1px solid #e0e9ec;
}
.kafel-opis { font-size: 11.5px; color: var(--szary); }
.kafel b { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--morze-ciemne); }
.iskra { width: 100%; height: 22px; display: block; margin-top: 2px; }
.iskra polyline { fill: none; stroke: var(--morze-jasne); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* Moduły */
.moduly { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); gap: 14px; }
.modul {
  background: var(--karta); border-radius: 12px; padding: 12px 14px; min-width: 0; overflow-x: auto;
  box-shadow: var(--cien); transition: box-shadow .2s;
}
.modul:hover { box-shadow: 0 2px 4px rgba(10, 51, 80, .08), 0 12px 30px rgba(10, 51, 80, .1); }
.modul.wylaczony { background: #fbfcfc; }
.modul-glowa { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.modul-glowa h3 { margin: 0; }
.faza { padding: 2px 9px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--szary-tlo); color: var(--szary); }
.faza.praca { background: var(--zielen-tlo); color: var(--zielen-ciemna); }
.faza.zle { background: var(--czerwien-tlo); color: var(--czerwien); }
.faza.uwaga { background: var(--bursztyn-tlo); color: var(--bursztyn); }
.przelacznik { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--szary); cursor: pointer; }
.przelacznik input { width: 16px; height: 16px; accent-color: var(--zielen); margin: 0; }
.modul-info { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 8px; font-size: 14px; color: var(--szary); }
.modul-info b { color: var(--tekst); font-weight: 600; font-variant-numeric: tabular-nums; }
.brak-odczytu { color: var(--bursztyn); }
.blad-odczytu { color: var(--czerwien); font-weight: 600; }

/* Etapy cyklu */
.kroki { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 8px 0 2px; }
.krok {
  padding: 2px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; letter-spacing: .3px;
  background: var(--szary-tlo); color: #8a9792; transition: background .3s, color .3s;
}
.krok.bylo { background: var(--zielen-tlo); color: var(--zielen-ciemna); }
.krok.teraz { background: var(--morze); color: #fff; box-shadow: 0 0 0 3px rgba(15, 95, 125, .16); }
.strzalka { width: 14px; height: 2px; background: #cdd6d2; }
.licznik { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--szary); font-variant-numeric: tabular-nums; }
.pierscien { width: 24px; height: 24px; transform: rotate(-90deg); }
.pierscien circle { fill: none; stroke-width: 5; }
.pierscien .tor { stroke: var(--szary-tlo); }
.pierscien .lek { stroke: var(--morze-jasne); stroke-linecap: round; stroke-dasharray: 94.25; transition: stroke-dashoffset .9s linear; }

/* Schemat modułu */
.schemat svg { width: 100%; height: auto; display: block; margin: 2px 0 4px; }
.schemat.niezamontowany svg { opacity: .35; filter: grayscale(1); }
.modul.wylaczony .schemat svg { filter: saturate(.55); }
.sch-sciana { fill: rgba(233, 244, 248, .12); stroke: #8fa6b0; stroke-width: 2; }
.sch-pokrywa { fill: #c4d0d5; stroke: #8fa6b0; stroke-width: 1; }
.sch-podloga { stroke: #c9d3d6; stroke-width: 2; }
.sch-waz { fill: none; stroke: #b6c4c9; stroke-width: 3; stroke-linejoin: round; }
.sch-przeplyw { fill: none; stroke: #1b86c8; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 10; opacity: 0; }
.sch-sonda { stroke: #6f8490; stroke-width: 3; stroke-linecap: round; }
.sch-osad { fill: #6d5b42; }
.sch-poziom { transition: transform 1.1s linear; }
.sch-opis { font-size: 12px; fill: var(--szary); text-anchor: middle; }
.sch-nazwa { font-size: 13px; font-weight: 700; fill: var(--morze-ciemne); text-anchor: middle; }
.sch-wartosc, .sch-wartosc-mala {
  text-anchor: middle; fill: var(--morze-ciemne); paint-order: stroke; stroke: rgba(255, 255, 255, .85);
  stroke-width: 3.5px; stroke-linejoin: round; font-variant-numeric: tabular-nums;
}
.sch-wartosc { font-size: 23px; font-weight: 700; }
.sch-wartosc-mala { font-size: 12.5px; font-weight: 600; }
.sch-pompa-obudowa { fill: #fff; stroke: #6f8490; stroke-width: 2; }
.sch-wirnik circle { fill: #6f8490; }
.sch-wirnik .os { fill: none; }
.sch-wirnik { transform-box: fill-box; transform-origin: center; }
.lampa { fill: #dfe6e8; stroke: #6f8490; stroke-width: 1.3; transition: fill .3s; }
.lampa.sucho { fill: #fff; }
.lampa.mokro { fill: var(--woda); filter: drop-shadow(0 0 3px rgba(47, 159, 208, .9)); }
.lampa.alarm { fill: var(--czerwien); animation: pulsowanie .8s ease-in-out infinite; }

.ruch-baniak .fala-b { animation: fala-wody 4.5s linear infinite; }
@keyframes fala-wody { to { transform: translateX(var(--okres)); } }
.plynie-fill .fala-j, .plynie-drain .fala-j { animation: fala-wody 1.6s linear infinite; }
.plynie-fill .sch-przeplyw, .plynie-drain .sch-przeplyw { opacity: 1; }
.plynie-fill .sch-przeplyw { animation: przeplyw-fill .55s linear infinite; }
.plynie-drain .sch-przeplyw { animation: przeplyw-drain .55s linear infinite; }
@keyframes przeplyw-fill { to { stroke-dashoffset: -12; } }
@keyframes przeplyw-drain { to { stroke-dashoffset: 12; } }
.plynie-fill .sch-wirnik { animation: obrot 1s linear infinite; }
.plynie-drain .sch-wirnik { animation: obrot 1s linear infinite reverse; }
@keyframes obrot { to { transform: rotate(360deg); } }
.plynie-fill .sch-pompa-obudowa, .plynie-drain .sch-pompa-obudowa { stroke: var(--zielen); stroke-width: 2.5; }

/* Napowietrzanie w trybie testowym: bąbelki z dyfuzora w baniaku */
.sch-dyfuzor { fill: #41535b; }
.babelek { fill: rgba(255, 255, 255, .85); stroke: rgba(255, 255, 255, .5); animation: babelek 2.4s ease-in infinite; }
.b-1 { animation-delay: -.6s; }
.b-2 { animation-delay: -1.2s; }
.b-3 { animation-delay: -1.8s; }
@keyframes babelek {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateY(-96px); opacity: 0; }
}
.sch-napow-opis {
  font-size: 11.5px; font-weight: 700; text-anchor: middle; fill: var(--zielen-ciemna);
  paint-order: stroke; stroke: rgba(255, 255, 255, .9); stroke-width: 3px; stroke-linejoin: round;
}

/* Wodotrysk: woda wychodzi z końca węża w tym naczyniu, do którego właśnie płynie. */
.trysk circle { fill: rgba(255, 255, 255, .95); stroke: rgba(27, 134, 200, .55); stroke-width: .6; opacity: 0; }
.plynie-fill .trysk-sloik circle, .plynie-drain .trysk-baniak circle { animation: trysk 1s ease-out infinite; }
.trysk circle:nth-child(2) { animation-delay: .33s !important; --dx: 6px; }
.trysk circle:nth-child(3) { animation-delay: .66s !important; --dx: -6px; }
@keyframes trysk {
  0% { opacity: 0; transform: translate(0, 0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -30px); }
}

.j-praca .sch-sciana { stroke: var(--zielen); stroke-width: 2.5; }
.j-uwaga .sch-sciana { stroke: #d9a400; stroke-width: 2.5; }
.j-zly .sch-sciana { stroke: var(--czerwien); stroke-width: 3; animation: pulsowanie 1.2s ease-in-out infinite; }
.j-praca .sch-stan { fill: var(--zielen-ciemna); font-weight: 600; }
.j-uwaga .sch-stan { fill: var(--bursztyn); font-weight: 600; }
.j-zly .sch-stan { fill: var(--czerwien); font-weight: 700; }

.tabela { border-collapse: collapse; width: 100%; font-size: 14px; }
.tabela th { text-align: left; font-weight: 600; color: var(--szary); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--linia); white-space: nowrap; }
.tabela td { padding: 5px 6px; border-bottom: 1px solid #edf0ee; vertical-align: middle; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .liczba { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mokro { color: #17609b; font-weight: 600; }
.sucho { color: var(--szary); }
.stan-zly { color: var(--czerwien); font-weight: 600; }
.stan-uwaga { color: var(--bursztyn); font-weight: 600; }
.stan-praca { color: var(--zielen-ciemna); font-weight: 600; }
.przyciski-reczne { display: flex; gap: 4px; justify-content: flex-end; }
.przewijanie { overflow-x: auto; background: var(--karta); border-radius: 12px; padding: 6px 8px; box-shadow: var(--cien); }
tr.poziom-ALARM td { background: var(--czerwien-tlo); }
tr.poziom-BLAD td { background: #fff7f2; }

/* Wykresy */
.pasek-narzedzi { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grupa { display: flex; gap: 4px; }
.wykres { background: var(--karta); border-radius: 12px; padding: 8px; overflow: hidden; min-height: 60px; box-shadow: var(--cien); }
.pusto { color: var(--szary); }
.eksport { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

/* Sterowanie wykresami */
.wykresy-sterowanie .rzad { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.rzad-opis { width: 72px; flex: none; font-size: 13px; color: var(--szary); font-weight: 600; }
.wybor { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.wybor-pole { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; cursor: pointer; }
.wybor-pole input { width: 16px; height: 16px; accent-color: var(--zielen); margin: 0; }
#w-blad:empty { display: none; }
#w-blad { margin: 0; }
#wykresy h2 { margin-top: 16px; }

/* Formularze */
input[type="number"], input[type="text"], input[type="password"], input[type="date"], input[type="datetime-local"], select {
  font: inherit; padding: 5px 8px; border: 1px solid #b9c4be; border-radius: 6px; background: #fff; color: var(--tekst);
  max-width: 100%;
}
.grupa-nastaw { background: var(--karta); border-radius: 12px; padding: 12px 16px; margin-bottom: 14px; box-shadow: var(--cien); }
.grupa-nastaw h2 { margin: 0 0 10px; }
.pola { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 10px 18px; }
.pole label { display: block; font-size: 13px; color: var(--szary); margin-bottom: 2px; }
.pole input, .pole select { width: 100%; }
.podpowiedz { font-size: 13px; color: var(--szary); margin: 8px 0 0; }
.pole-glowa { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 2px; }
.pole-glowa label { margin-bottom: 0; }
.info {
  flex: none; width: 17px; height: 17px; padding: 0; border-radius: 50%; border: 1.5px solid var(--morze); background: #fff;
  color: var(--morze); font: italic 700 12px/1 Georgia, "Times New Roman", serif; cursor: pointer; transition: background .15s, color .15s;
}
.info:hover, .info[aria-expanded="true"] { background: var(--morze); color: #fff; }
.info:focus-visible { outline: 2px solid var(--zielen); outline-offset: 1px; }
.tytul-info { display: flex; align-items: center; gap: 7px; }
.naglowek-info { white-space: normal !important; }
.opis-nastawy {
  margin: 3px 0 6px; padding: 7px 10px; font-size: 13px; line-height: 1.4; color: var(--tekst);
  background: #eef6f9; border-left: 3px solid var(--morze); border-radius: 0 6px 6px 0;
}
.drain-osobno { margin-top: 12px; }
.przycisk-pod-polem { margin-top: 5px; color: var(--morze); border-color: var(--morze); }
#drain-tabela { margin-top: 6px; box-shadow: none; border: 1px solid var(--linia); }
.czas-cyklu { margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; background: var(--szary-tlo); }
.czas-cyklu.ok { background: var(--zielen-tlo); }
.czas-cyklu.uwaga { background: var(--bursztyn-tlo); }
.czas-cyklu.zle { background: var(--czerwien-tlo); }
.czas-cyklu-wynik { font-size: 16px; }
.czas-cyklu-ocena { margin-top: 4px; font-weight: 600; }
.czas-cyklu.ok .czas-cyklu-ocena { color: var(--zielen-ciemna); }
.czas-cyklu.uwaga .czas-cyklu-ocena { color: var(--bursztyn); }
.czas-cyklu.zle .czas-cyklu-ocena { color: var(--czerwien); }
.tabela-nastaw input[type="number"] { width: 84px; }
.tabela-nastaw select { width: 84px; }
.zapis { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; position: sticky; bottom: 0; background: var(--tlo); padding: 10px 0; }
.blad { color: var(--czerwien); font-weight: 600; margin: 6px 0 0; }
.sukces { color: var(--zielen-ciemna); font-weight: 600; }

/* Tryb podglądu z internetu: bez sterowania, STOP zostaje */
body.podglad .przelacznik, body.podglad .przyciski-reczne, body.podglad .zapis,
body.podglad .pasek [data-akcja], body.podglad [data-akcja="wyzeruj-fill"] { display: none; }

/* Instrukcja */
.instrukcja { max-width: 900px; }
.instrukcja-glowa { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.instrukcja h2 { font-size: 22px; margin: 8px 0; }
.instrukcja h3 { margin: 24px 0 6px; font-size: 17px; scroll-margin-top: 54px; }
.instrukcja p { margin: 6px 0; }
.instrukcja ul, .instrukcja ol { margin: 6px 0; padding-left: 22px; }
.instrukcja li { margin: 3px 0; }
.instrukcja code { background: var(--szary-tlo); padding: 1px 5px; border-radius: 4px; font-size: 13.5px; overflow-wrap: anywhere; }
.spis-tresci { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.spis-tresci a {
  padding: 3px 11px; border-radius: 999px; background: var(--karta); color: var(--morze); text-decoration: none;
  font-size: 13px; box-shadow: var(--cien);
}
.spis-tresci a:hover { background: var(--zielen-tlo); }
.tabela-instrukcji td { vertical-align: top; }
.tabela-instrukcji th, .tabela-instrukcji td { white-space: normal; }

/* Dokumenty */
.dokument { background: var(--karta); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--cien); }
.dokument-glowa { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.dokument-okladka { width: 110px; height: auto; border: 1px solid var(--linia); border-radius: 4px; display: block; }
.dokument-opis { flex: 1 1 280px; min-width: 0; }
.dokument-opis h2 { margin: 0 0 2px; font-size: 18px; }
.dokument-dane { color: var(--szary); font-size: 13.5px; margin: 0 0 8px; }
.link-glowny { display: inline-block; text-decoration: none; }
.rozdzialy { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 10px; font-size: 13.5px; }
.rozdzialy a { color: var(--morze); text-decoration: none; }
.rozdzialy a:hover { text-decoration: underline; }
.dokument h3 { margin: 16px 0 8px; font-size: 14.5px; }
.miniatury { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.miniatura {
  display: flex; flex-direction: column; text-decoration: none; color: var(--tekst); border-radius: 8px; overflow: hidden;
  border: 1px solid var(--linia); background: #fff; transition: transform .15s, box-shadow .15s;
}
.miniatura:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(10, 51, 80, .16); }
.miniatura img { width: 100%; height: 132px; object-fit: contain; object-position: top; background: #fff; display: block; border-bottom: 1px solid #edf0ee; }
.miniatura span { padding: 6px 8px; font-size: 13px; line-height: 1.3; }

/* Stopka */
.stopka {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px;
  padding: 8px 16px 18px; color: var(--szary); font-size: 12.5px; text-align: center;
}
.stopka img { width: min(100%, 460px); height: auto; display: block; border-radius: 6px; background: #fff; }

/* Komunikaty o wyniku zadania */
.toasty { position: fixed; right: 14px; bottom: 14px; z-index: 20; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 28px)); }
.toast {
  background: var(--morze-ciemne); color: #fff; padding: 9px 14px; border-radius: 9px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28); border-left: 4px solid #7fe0a0;
  animation: toast-wejscie .25s ease both;
}
.toast.zle { border-left-color: #ff8a80; }
.toast.znika { opacity: 0; transform: translateX(14px); transition: opacity .35s, transform .35s; }
@keyframes toast-wejscie { from { opacity: 0; transform: translateX(14px); } }

/* Okno dialogowe */
dialog { border: 0; border-radius: 12px; padding: 18px 20px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0,0,0,.25); color: var(--tekst); }
dialog::backdrop { background: rgba(10, 51, 80, .45); }
dialog p { margin: 0 0 10px; }
#dialog-pola .pole { margin-bottom: 10px; }
.dialog-przyciski { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
#dialog-blad:empty { display: none; }

/* Logowanie */
body.logowanie {
  display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 16px; position: relative; overflow-x: hidden;
  background: linear-gradient(180deg, #1b8a8f 0%, #0f5f7d 42%, #0a3350 100%);
}
.morze { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.fala-gorna { position: absolute; top: -1px; left: 0; width: 200%; height: 34px; fill: rgba(255, 255, 255, .22); animation: fala-naglowka 18s linear infinite; }
.dno { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; min-height: 170px; }
.wrak path { fill: #082a42; }
.piasek { fill: #061f33; }
.babel { position: absolute; bottom: 12vh; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); animation: babel 13s linear infinite; }
.b1 { left: 62%; width: 12px; height: 12px; }
.b2 { left: 66%; width: 7px; height: 7px; animation-delay: -3s; animation-duration: 11s; }
.b3 { left: 70%; width: 15px; height: 15px; animation-delay: -6s; }
.b4 { left: 75%; width: 9px; height: 9px; animation-delay: -9s; animation-duration: 15s; }
.b5 { left: 12%; width: 10px; height: 10px; animation-delay: -4s; animation-duration: 17s; }
.b6 { left: 22%; width: 6px; height: 6px; animation-delay: -11s; animation-duration: 14s; }
@keyframes babel {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { opacity: 1; }
  50% { transform: translate(14px, -44vh); }
  90% { opacity: .8; }
  100% { transform: translate(-6px, -88vh); opacity: 0; }
}
.karta-logowania {
  position: relative; background: #fff; border-radius: 16px; padding: 24px 28px; width: min(400px, 100%); max-width: 400px; margin: 0;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .35); animation: wejscie .4s ease both;
}
.logowanie-logo { display: block; height: 66px; width: auto; margin: 0 auto; }
.podtytul { margin: 6px 0 14px; color: var(--szary); text-align: center; }
.komunikat { color: var(--czerwien); margin: 0 0 10px; }
.komunikat:empty { display: none; }
.karta-logowania label { display: block; margin-bottom: 4px; }
.karta-logowania input { width: 100%; margin-bottom: 14px; padding: 8px 10px; }
.karta-logowania button { width: 100%; padding: 9px 14px; }
.logowanie-partnerzy { display: flex; justify-content: center; align-items: center; gap: 22px; margin: 18px 0 12px; }
.logowanie-znak { display: block; width: 100%; height: auto; border-top: 1px solid #edf0ee; padding-top: 8px; }

@media (max-width: 720px) {
  .partnerzy { margin-left: 0; width: 100%; }
  .partnerzy .wyloguj { margin-left: auto; }
  .licznik { margin-left: 0; width: 100%; }
}

@media (max-width: 520px) {
  .zakladki { position: static; }
  main { padding: 10px 10px 24px; }
  .pas-logo { padding: 6px 10px; }
  .pas-morze { padding: 7px 10px 20px; }
  .logo-projektu { height: 38px; }
  .logo-imp { height: 38px; }
  .logo-rendben { height: 28px; }
  .przycisk.stop { width: 100%; }
  .kafle { width: 100%; }
  .kafel { flex: 1 1 40%; }
  .tabela { font-size: 13px; }
  .tabela td, .tabela th { padding: 4px 3px; }
  .modul { padding: 10px; }
  .przyciski-reczne { flex-direction: column; align-items: stretch; }
  .karta-logowania { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .babel { display: none; }
}

@media print {
  body { background: #fff; }
  .naglowek, .zakladki, #paski, .stopka, .toasty, #drukuj, .spis-tresci { display: none !important; }
  .widok { display: none !important; }
  #z-instrukcja { display: block !important; max-width: none; animation: none; }
  .przewijanie { box-shadow: none; padding: 0; overflow: visible; }
  .instrukcja h3 { break-after: avoid; }
  .tabela-instrukcji tr { break-inside: avoid; }
}
