/* Warsztatownia — wspólne style.
   Zasada: duże, czytelne z ostatniego rzędu sali, bez ozdobników.
   Czcionki systemowe — żadnych zapytań do obcych serwerów (W-10). */

/* Identyfikacja wizualna: pawelbirecki.com — pomarańcz #f36c1a, granat #142040. */
:root {
  --tlo: #f5f6f8;
  --tlo-karta: #ffffff;
  --tekst: #142040;
  --tekst-slaby: #7a85a0;
  --obwodka: #e6e9ef;
  --akcent: #f36c1a;
  --akcent-ciemny: #d45c12;
  --granat: #142040;
  --granat-ciemny: #0d1829;
  --zielony: #2f9e44;
  --czerwony: #e03131;
  --zolty: #f59f00;
  --cien: 0 1px 2px rgba(20, 32, 64, .05), 0 4px 16px rgba(20, 32, 64, .05);
  --cien-wysoki: 0 2px 4px rgba(20, 32, 64, .06), 0 16px 40px rgba(20, 32, 64, .12);
  --promien: 10px;
  --odstep: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--tekst);
  background: var(--tlo);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.ciemne {
  --tlo: var(--granat-ciemny);
  --tlo-karta: #16223f;
  --tekst: #e8eaf0;
  --tekst-slaby: #8a95b0;
  --obwodka: #24304f;
  --cien: none;
}

h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; font-weight: 650; }
h1 { font-size: 28px; letter-spacing: -.02em; font-weight: 750; }
h2 { letter-spacing: -.01em; }
h2 { font-size: 21px; }
h3 { font-size: 17px; }
p { margin: 0 0 .8em; line-height: 1.5; }
a { color: var(--akcent); }

/* ── elementy formularza ─────────────────────────────────────────── */
button, .przycisk {
  font: inherit;
  font-weight: 550;
  border: 1px solid var(--obwodka);
  background: var(--tlo-karta);
  color: var(--tekst);
  padding: 10px 16px;
  border-radius: var(--promien);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background .12s, border-color .12s, transform .06s;
  min-height: 42px;
}
button:hover:not(:disabled), .przycisk:hover { background: #f1f3f6; border-color: #d9dde5; }
button:focus-visible, .przycisk:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--akcent); outline-offset: 2px; }
body.ciemne button:hover:not(:disabled) { background: #1e2229; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.glowny, .przycisk.glowny {
  background: var(--akcent);
  border-color: var(--akcent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(243, 108, 26, .25), 0 4px 12px -2px rgba(243, 108, 26, .35);
}
button.glowny:hover:not(:disabled), .przycisk.glowny:hover { background: var(--akcent-ciemny); border-color: var(--akcent-ciemny); }
button.niebezpieczny { color: var(--czerwony); border-color: #ffc9c9; }
button.duzy { font-size: 18px; padding: 14px 22px; min-height: 54px; }
button.maly { font-size: 13px; padding: 6px 10px; min-height: 32px; }
button.aktywny { background: var(--akcent); border-color: var(--akcent); color: #fff; }
button.ikona { padding: 8px; min-height: 38px; min-width: 38px; justify-content: center; }

input[type=text], input[type=password], input[type=number], input[type=search], textarea, select {
  font: inherit;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--obwodka);
  border-radius: var(--promien);
  background: var(--tlo-karta);
  color: var(--tekst);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--akcent); outline-offset: -1px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.45; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--tekst-slaby); margin-bottom: 5px; }

.pole { margin-bottom: 14px; }
.rzad { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rozciag { flex: 1; }
.srodek { display: flex; align-items: center; justify-content: center; }

/* ── układ ────────────────────────────────────────────────────────── */
.karta {
  background: var(--tlo-karta);
  border: 1px solid var(--obwodka);
  border-radius: var(--promien);
  padding: var(--odstep);
  box-shadow: var(--cien);
}
.strona { max-width: 1280px; margin: 0 auto; padding: 28px 20px 60px; }
.slaby { color: var(--tekst-slaby); }
.male { font-size: 13px; }
.pasek {
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px; min-height: 58px; background: var(--granat);
  box-shadow: inset 0 -2px 0 var(--akcent);
  position: sticky; top: 0; z-index: 40; color: #fff;
}
.pasek .logo { display: block; }
.pasek .nazwa-apki { font-weight: 650; letter-spacing: .01em; font-size: 15px; }
.pasek button { background: transparent; color: #e8eaf0; border-color: #2c3a5e; }
.pasek button:hover:not(:disabled) { background: #1d2c50; }
.pasek .znacznik { background: #1d2c50; color: #ffd8b0; }

/* Dyskretny ślad autorstwa — tylko tam, gdzie materiał wychodzi poza salę. */
.slad-autora {
  margin-top: 34px; padding-top: 12px; border-top: 1px solid var(--obwodka);
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; color: var(--tekst-slaby);
}
.slad-autora a { color: var(--tekst-slaby); text-decoration: none; }
.slad-autora a:hover { color: var(--akcent-ciemny); text-decoration: underline; }

/* ── znaczniki ────────────────────────────────────────────────────── */
.znacznik {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px;
  background: #fdece0; color: var(--akcent-ciemny);
}
.znacznik.szary { background: #f1f3f5; color: var(--tekst-slaby); }
.znacznik.zielony { background: #d3f9d8; color: #2b8a3e; }
.znacznik.czerwony { background: #ffe3e3; color: #c92a2a; }
.znacznik.zolty { background: #fff3bf; color: #e67700; }

.kropka { width: 9px; height: 9px; border-radius: 50%; background: var(--tekst-slaby); display: inline-block; }
.kropka.online { background: var(--zielony); }

/* ── komunikaty ───────────────────────────────────────────────────── */
#powiadomienia {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.powiadomienie {
  background: #142040; color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: 0 8px 28px rgba(20, 32, 64, .3);
  animation: wjazd .22s cubic-bezier(.2, .9, .3, 1.2);
}
#powiadomienia { z-index: 400; }
.powiadomienie.blad { background: var(--czerwony); }
.powiadomienie.sukces { background: var(--zielony); }
@keyframes wjazd { from { opacity: 0; transform: translateY(10px); } }

/* ── minutnik ─────────────────────────────────────────────────────── */
.minutnik {
  display: inline-flex; align-items: center; gap: 10px;
  font-variant-numeric: tabular-nums; font-weight: 700;
}
.minutnik .czas { font-size: 22px; letter-spacing: .5px; }
.minutnik.blisko .czas { color: var(--zolty); }
.minutnik.koniec .czas { color: var(--czerwony); }
.minutnik.pulsuje { animation: puls 1s steps(2, start) infinite; }
@keyframes puls { 50% { opacity: .35; } }

/* ── wyniki ćwiczeń ───────────────────────────────────────────────── */
.slupek { margin-bottom: 14px; }
.slupek .etykieta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; font-weight: 550; }
.slupek .rynna { background: #e9ecef; border-radius: 6px; height: 30px; overflow: hidden; }
body.ciemne .slupek .rynna { background: #22262d; }
.slupek .wypelnienie {
  height: 100%; background: var(--akcent); border-radius: 6px;
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.slupek.poprawna .wypelnienie { background: var(--zielony); }
.slupek.zla .wypelnienie { background: #adb5bd; }

.chmura { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; justify-content: center; padding: 20px; }
.chmura span { font-weight: 700; line-height: 1.1; transition: font-size .5s, color .5s; }

.kafelki { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.kafelek {
  background: var(--tlo-karta); border: 1px solid var(--obwodka);
  border-radius: var(--promien); padding: 14px; font-size: 16px; line-height: 1.45;
  animation: wjazd .25s ease-out;
}
.kafelek .autor { font-size: 12px; color: var(--tekst-slaby); margin-top: 8px; }

.macierz { position: relative; aspect-ratio: 1; border: 1px solid var(--obwodka); border-radius: var(--promien); background: var(--tlo-karta); }
.macierz .os-pion, .macierz .os-poziom { position: absolute; background: var(--obwodka); }
.macierz .os-pion { left: 50%; top: 0; bottom: 0; width: 1px; }
.macierz .os-poziom { top: 50%; left: 0; right: 0; height: 1px; }
.macierz .punkt {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--akcent); transform: translate(-50%, 50%); opacity: .75;
}
.macierz .srednia {
  position: absolute; transform: translate(-50%, 50%);
  background: #212529; color: #fff; font-size: 12px; font-weight: 650;
  padding: 4px 9px; border-radius: 999px; white-space: nowrap;
}

table.wyniki { width: 100%; border-collapse: collapse; }
table.wyniki th, table.wyniki td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--obwodka); }
table.wyniki th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--tekst-slaby); }

/* ── lista przeciągalna (ranking) ─────────────────────────────────── */
.lista-ranking { list-style: none; margin: 0; padding: 0; }
.lista-ranking li {
  display: flex; align-items: center; gap: 12px;
  background: var(--tlo-karta); border: 1px solid var(--obwodka);
  border-radius: var(--promien); padding: 14px; margin-bottom: 9px;
  cursor: grab; user-select: none; touch-action: none;
}
.lista-ranking li.chwytany { opacity: .5; }
.lista-ranking .numer {
  width: 30px; height: 30px; border-radius: 50%; background: var(--akcent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none;
}
.uchwyt { color: var(--tekst-slaby); font-size: 20px; line-height: 1; }

/* ── ekran uczestnika ─────────────────────────────────────────────── */
.telefon { max-width: 620px; margin: 0 auto; padding: 18px 16px 120px; }
.telefon h1 { font-size: 24px; }
.pytanie { font-size: 22px; font-weight: 650; line-height: 1.28; margin-bottom: 6px; }
.opcja {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px; margin-bottom: 10px; text-align: left;
  border: 1px solid var(--obwodka); border-radius: var(--promien);
  background: var(--tlo-karta); font-size: 17px; cursor: pointer; min-height: 58px;
}
.opcja.wybrana { border-color: var(--akcent); background: #fdece0; box-shadow: inset 0 0 0 1px var(--akcent); }
body.ciemne .opcja.wybrana { background: #12283d; }
.stopka-akcji {
  position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--tlo-karta); border-top: 1px solid var(--obwodka); z-index: 50;
}
.stopka-akcji button { width: 100%; justify-content: center; }

/* ── ekran prezentera ─────────────────────────────────────────────── */
.prezenter { height: 100%; overflow: hidden; display: flex; flex-direction: column; padding: 3vh 4vw; }
.prezenter .naglowek { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 2vh; }
.prezenter h1 { font-size: clamp(28px, 3.6vw, 56px); }
/* `safe center` centruje, ale przy treści wyższej niż ekran przestaje centrować
   i nie ucina góry — bez tego tabela liderów gubi pierwszy wiersz. */
.prezenter .tresc { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; justify-content: safe center; min-height: 0; }
.prezenter .stopka { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 2vh; color: var(--tekst-slaby); }
.kod-dolaczenia { display: flex; align-items: center; gap: 18px; }
.kod-dolaczenia .cyfry { font-size: clamp(28px, 3vw, 46px); font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.kod-dolaczenia svg { display: block; border-radius: 8px; }

/* ── panel ────────────────────────────────────────────────────────── */
.panel-siatka { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.lista-pozycji { list-style: none; margin: 0; padding: 0; }
.lista-pozycji li {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--obwodka); border-radius: var(--promien);
  margin-bottom: 8px; background: var(--tlo-karta); cursor: pointer;
}
.lista-pozycji li.wybrana { border-color: var(--akcent); box-shadow: inset 0 0 0 1px var(--akcent); }
.lista-pozycji li .rozciag { min-width: 0; }
.lista-pozycji li .nazwa { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.zakladki { display: flex; gap: 6px; border-bottom: 1px solid var(--obwodka); margin-bottom: 18px; flex-wrap: wrap; }
.zakladki button {
  border: none; background: none; border-radius: 0; border-bottom: 2px solid transparent;
  color: var(--tekst-slaby); padding: 10px 14px;
}
.zakladki button.aktywna { color: var(--tekst); border-bottom-color: var(--akcent); background: none; }

dialog {
  border: 1px solid var(--obwodka); border-radius: 16px; padding: 24px;
  max-width: 560px; width: calc(100vw - 32px); background: var(--tlo-karta); color: var(--tekst);
  box-shadow: 0 24px 80px rgba(13, 24, 41, .3);
}
dialog[open] { animation: oknoWjazd .2s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes oknoWjazd { from { opacity: 0; transform: translateY(10px) scale(.98); } }
dialog::backdrop { background: rgba(13, 24, 41, .45); backdrop-filter: blur(3px); }

.pusto { text-align: center; padding: 40px 20px; color: var(--tekst-slaby); }

@media (max-width: 820px) {
  .panel-siatka { grid-template-columns: 1fr; }
}

/* ── wydruk raportu (Ctrl+P → zapisz jako PDF) ────────────────────── */
@media print {
  .pasek, .zakladki, .bezDruku, #powiadomienia { display: none !important; }
  body { background: #fff; }
  .strona { max-width: none; padding: 0; }
  .karta { box-shadow: none; border-color: #ccc; }
  section { break-inside: avoid; page-break-inside: avoid; }
  .doDruku h2 { margin-top: 18px; }
  .kafelki { grid-template-columns: repeat(2, 1fr); }
}

/* Na rzutniku macierz 2×2 musi liczyć rozmiar z WYSOKOŚCI, nie z szerokości —
   inaczej kwadrat jest szerszy niż ekran i wypycha stopkę poza widok. */
.macierz-wynik { max-width: 640px; margin: 0 auto; }
.prezenter .tresc { overflow-y: auto; overflow-x: hidden; }
.prezenter .macierz-wynik { width: min(58vh, 100%); max-width: none; }
.prezenter .kafelki { max-height: 100%; overflow-y: auto; }
.prezenter table.wyniki { font-size: .85em; }

.macierz .punkt-srednia {
  position: absolute; transform: translate(-50%, 50%); z-index: 3;
  width: 26px; height: 26px; border-radius: 50%; background: #212529; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; box-shadow: 0 0 0 3px rgba(255,255,255,.85);
}
.legenda-macierzy {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center;
  margin-top: 12px; font-size: .8em;
}
.legenda-macierzy .wpis { display: inline-flex; align-items: center; gap: 7px; }
.legenda-macierzy .numer {
  width: 22px; height: 22px; border-radius: 50%; background: #212529; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}

/* ── ekran startowy (pierwsze uruchomienie) ───────────────────────── */
.kroki-startowe { margin: 0; padding-left: 22px; line-height: 2; font-size: 15px; }
.kroki-startowe li { padding-left: 4px; }

/* ── zakładka bez treści: wygaszona, ale z wyjaśnieniem po najechaniu ── */
.zakladki button.wygaszona { opacity: .38; cursor: not-allowed; }

/* ── przełącznik nazywający STAN, nie akcję ───────────────────────── */
button.przelacznik { gap: 7px; }
button.przelacznik .dioda {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--tekst-slaby); flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
button.przelacznik.wl { background: var(--akcent); border-color: var(--akcent); color: #fff; }
button.przelacznik.wl .dioda { background: #fff; }

/* ── uchwyty przeciągania ─────────────────────────────────────────── */
.uchwyt-kroku {
  color: var(--tekst-slaby); font-size: 13px; line-height: 1;
  cursor: grab; user-select: none; flex: none; opacity: .55;
}
.agenda-pozycja:hover .uchwyt-kroku { opacity: 1; }

/* ── wskaźnik zapisu ──────────────────────────────────────────────── */
#stanZapisu { transition: color .2s, opacity .2s; opacity: .7; }
#stanZapisu.mignij { color: var(--zielony); opacity: 1; font-weight: 650; }

/* ── cele dotykowe na telefonie: palec potrzebuje 44 px ───────────── */
@media (max-width: 700px), (pointer: coarse) {
  button.maly { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  button.ikona { min-height: 44px; min-width: 44px; }
  .lista-pozycji li { padding: 12px; gap: 8px; }
  .zakladki button { padding: 12px 14px; }
}

/* Trwałe potwierdzenie na telefonie uczestnika — dymek znika za szybko. */
.przyjeto {
  display: flex; align-items: center; gap: 10px;
  background: #e9f7ec; color: #2b8a3e; border: 1px solid #b7e4c1;
  border-radius: var(--promien); padding: 12px 14px; margin-bottom: 16px;
  font-weight: 600; animation: wjazd .2s ease-out;
}
.przyjeto span { font-size: 18px; line-height: 1; }


/* ════════════════════════════════════════════════════════════════════
   Panel 2.0 — biblioteka z miniaturami, zakładki w pasku, karty
   ════════════════════════════════════════════════════════════════════ */
.pasek .nazwa-apki { margin-right: 10px; }
.zakladki-gorne { display: flex; align-items: stretch; gap: 2px; align-self: stretch; }
.zakladki-gorne button {
  background: transparent !important; border: none; border-radius: 0; color: #aab4cc; min-height: 58px;
  padding: 0 14px; font-weight: 600; font-size: 14px; position: relative;
}
.zakladki-gorne button:hover:not(:disabled) { color: #fff; }
.zakladki-gorne button.aktywna { color: #fff; }
.zakladki-gorne button.aktywna::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--akcent); }
.zakladki-gorne button.wygaszona { opacity: .4; cursor: not-allowed; }
.pasek button.maly { color: #c9d1e3; }

.naglowek-biblioteki { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 6px 0 26px; }
.naglowek-biblioteki h1 { font-size: 32px; margin-bottom: 4px; }
.naglowek-biblioteki p { margin: 0; }
.pole-szukaj { position: relative; display: flex; align-items: center; }
.pole-szukaj .ikona-svg { position: absolute; left: 12px; color: var(--tekst-slaby); pointer-events: none; }
.pole-szukaj input { padding-left: 38px; width: 280px; min-height: 42px; border-radius: 10px; }

.tytul-sekcji { display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.tytul-sekcji h2 { margin: 0; font-size: 18px; }
section { margin-bottom: 34px; }

.pasek-szablonow { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kafel-szablonu {
  flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; min-height: 92px; text-align: left;
  border-radius: 12px; font-size: 13.5px; font-weight: 650; line-height: 1.25; box-shadow: var(--cien);
}
.kafel-szablonu:hover:not(:disabled) { border-color: var(--akcent); background: #fff; transform: translateY(-2px); box-shadow: var(--cien-wysoki); }
.ikonka-szablonu { width: 34px; height: 34px; border-radius: 9px; background: #fff1e7; color: var(--akcent); display: flex; align-items: center; justify-content: center; }

.siatka-tablic { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.karta-tablicy {
  background: var(--tlo-karta); border: 1px solid var(--obwodka); border-radius: 14px; overflow: hidden;
  cursor: pointer; box-shadow: var(--cien); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.karta-tablicy:hover, .karta-tablicy:focus-visible { transform: translateY(-3px); box-shadow: var(--cien-wysoki); border-color: #d9dde5; }
.miniatura {
  aspect-ratio: 16 / 9; position: relative; border-bottom: 1px solid var(--obwodka);
  background-color: #f5f6f8; background-image: radial-gradient(circle, #dde1e8 1px, transparent 1.2px); background-size: 14px 14px;
}
.miniatura svg { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
.na-zywo {
  position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border-radius: 999px; padding: 3px 10px 3px 8px; font-size: 11.5px; font-weight: 700; color: #2b8a3e;
  box-shadow: 0 1px 4px rgba(20, 32, 64, .15);
}
.kropka-zywo { width: 8px; height: 8px; border-radius: 50%; background: #2f9e44; animation: tetno 1.6s ease-out infinite; }
@keyframes tetno { 0% { box-shadow: 0 0 0 0 rgba(47, 158, 68, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(47, 158, 68, 0); } }
.podpis-karty { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 14px; }
.podpis-karty .nazwa, .wiersz-karty .nazwa { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podpis-karty .rozciag, .wiersz-karty .rozciag { min-width: 0; }
.akcje-karty { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.karta-tablicy:hover .akcje-karty, .karta-tablicy:focus-within .akcje-karty { opacity: 1; }
@media (hover: none) { .akcje-karty { opacity: 1; } }
button.narzedzie-maly {
  border: none; background: transparent; min-height: 32px; height: 32px; width: 32px; padding: 0; justify-content: center;
  color: #5b6680; border-radius: 8px;
}
button.narzedzie-maly:hover:not(:disabled) { background: #f1f3f6; color: var(--granat); }
button.narzedzie-maly.niebezpieczny:hover:not(:disabled) { background: #ffeaea; color: var(--czerwony); }

.kolumny-biblioteki { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .kolumny-biblioteki { grid-template-columns: 1fr; } .pole-szukaj input { width: 100%; } }
.lista-kart { display: flex; flex-direction: column; gap: 8px; }
.wiersz-karty {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; cursor: pointer;
  background: var(--tlo-karta); border: 1px solid var(--obwodka); border-radius: 12px; box-shadow: var(--cien);
  transition: border-color .12s, box-shadow .12s;
}
.wiersz-karty:hover { border-color: #d9dde5; box-shadow: var(--cien-wysoki); }
.ikonka-wiersza { width: 38px; height: 38px; border-radius: 10px; background: #f1f3f6; color: #5b6680; display: flex; align-items: center; justify-content: center; flex: none; }
.ikonka-wiersza.zywa { background: #ebfbee; color: #2f9e44; }
.wiersz-karty button.maly.glowny { padding: 6px 12px; }

/* logowanie i wejście uczestnika */
.ekran-wejscia { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 80% -10%, rgba(243, 108, 26, .10), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, rgba(20, 32, 64, .08), transparent 60%), var(--tlo); }
.karta-wejscia { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--obwodka); border-radius: 20px; box-shadow: var(--cien-wysoki); padding: 30px 26px; }
.karta-wejscia .znak-apki { display: flex; align-items: center; gap: 10px; font-weight: 750; color: var(--granat); margin-bottom: 22px; }
.karta-wejscia .znak-apki img { width: 30px; height: 30px; }
.karta-wejscia h1 { font-size: 26px; margin-bottom: 6px; }
.karta-wejscia input { font-size: 17px; min-height: 50px; border-radius: 12px; }
.karta-wejscia button.glowny { width: 100%; justify-content: center; min-height: 52px; font-size: 17px; border-radius: 12px; margin-top: 4px; }

/* Wąskie okno: pasek nie łamie się i nie rozpycha strony w bok. */
.pasek { flex-wrap: nowrap; overflow: hidden; }
.zakladki-gorne { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.zakladki-gorne::-webkit-scrollbar { display: none; }
.zakladki-gorne button, .pasek .znacznik, .pasek button { white-space: nowrap; flex: none; }
@media (max-width: 900px) { .pasek .znacznik { display: none; } }
@media (max-width: 720px) { .pasek .nazwa-apki { display: none; } .pasek { gap: 8px; padding: 0 10px; } .zakladki-gorne button { padding: 0 10px; } }
html, body { overflow-x: hidden; }

/* ── panel na telefonie ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .strona { padding: 18px 14px 50px; }
  .pasek .logo { height: 16px !important; }
  .pasek button.maly { padding: 6px 8px; font-size: 0; gap: 0; }
  .pasek button.maly .ikona-svg { width: 18px; height: 18px; }
  .zakladki-gorne button.wygaszona { display: none; }
  .naglowek-biblioteki { margin-bottom: 20px; }
  .naglowek-biblioteki h1 { font-size: 26px; }
  .naglowek-biblioteki > .rzad { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .naglowek-biblioteki .pole-szukaj { grid-column: 1 / -1; }
  .naglowek-biblioteki .pole-szukaj input { width: 100%; }
  .naglowek-biblioteki > .rzad button { justify-content: center; padding: 10px 8px; font-size: 14px; }
  .tytul-sekcji { flex-wrap: wrap; gap: 2px 10px; }
  /* Szablony w jednym rzędzie przewijanym palcem — Twoje tablice są od razu pod nimi. */
  .pasek-szablonow { display: flex; overflow-x: auto; gap: 8px; margin: 0 -14px; padding: 2px 14px 10px; scroll-snap-type: x proximity; scroll-padding-left: 14px; scrollbar-width: none; }
  .pasek-szablonow::-webkit-scrollbar { display: none; }
  .kafel-szablonu { flex: 0 0 132px; min-height: 84px; padding: 12px; font-size: 13px; scroll-snap-align: start; }
  section { margin-bottom: 26px; }
  .siatka-tablic { grid-template-columns: 1fr; gap: 12px; }
  .wiersz-karty { gap: 8px; padding: 8px 8px 8px 10px; }
  .wiersz-karty .ikonka-wiersza { width: 34px; height: 34px; }
  .wiersz-karty button.maly.glowny { padding: 6px 10px; font-size: 13px; }
}

/* ── logo Pawła z linkiem (widoczne zawsze, decyzja 5.10.2026) ──────── */
a.logo-link { display: inline-flex; align-items: center; flex: none; border-radius: 6px; transition: opacity .15s, transform .15s; }
a.logo-link:hover { opacity: .75; }
a.logo-link:focus-visible { outline: 2px solid var(--akcent); outline-offset: 3px; }
.pasek a.logo-link:hover { opacity: .8; }
.stopka-wejscia { display: flex; justify-content: center; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--obwodka); }

/* Termin linku gościa (0.99.48): panel sesji i okienko „Zaproś do tablicy”. */
.waznosc-linku { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: #555; }
.waznosc-linku.wygasl { color: var(--czerwony); font-weight: 600; }
