/* Pokój tablicy: tablica na pełnym ekranie + pływające panele wokół niej. */

body.z-pokojem { overflow: hidden; overscroll-behavior: none; }
.pokoj {
  position: fixed; inset: 0; z-index: 100; background: #f5f6f8;
  --panel: #ffffff;
  --panel-obwodka: rgba(20, 32, 64, .08);
  --panel-cien: 0 1px 2px rgba(20, 32, 64, .06), 0 6px 24px rgba(20, 32, 64, .10);
  --najazd: #f1f3f6;
  --akcent-mieko: #fff1e7;
}
.pokoj > .plotno { position: absolute; inset: 0; }
.pokoj .plotno .narzedzia { top: calc(50% + 20px); max-height: calc(100% - 128px); }
.pokoj .plotno .opcje-narzedzia { top: calc(50% + 20px); }

.pokoj .gora {
  position: absolute; top: 12px; z-index: 90; display: flex; align-items: center; gap: 6px;
}
.pokoj .gora.lewa, .pokoj .gora.prawa {
  background: var(--panel); border: 1px solid var(--panel-obwodka); border-radius: 14px;
  box-shadow: var(--panel-cien); padding: 5px; min-height: 52px;
}
.pokoj .gora.lewa { left: 12px; padding-right: 16px; max-width: calc(50vw - 200px); min-width: 0; }
.pokoj .gora.prawa { right: 12px; }
.pokoj .gora.srodek {
  left: 50%; transform: translateX(-50%); flex-direction: column; gap: 6px; pointer-events: none;
  max-width: calc(100vw - 32px);
}
.pokoj .gora.srodek > * { pointer-events: auto; }
.pokoj .gora .rozdzielacz-pion { height: 26px; align-self: center; }
.pokoj .znak { height: 22px; margin: 0 8px; filter: brightness(0); opacity: .75; }
.pokoj .znak.kwadrat { height: 30px; width: 30px; margin: 0 4px; filter: none; opacity: 1; }
.pokoj .opis { min-width: 0; padding-left: 4px; }
.pokoj .nazwa-tablicy {
  font-weight: 700; font-size: 15px; color: var(--granat); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 6px; padding: 1px 4px; margin-left: -4px;
}
.pokoj .nazwa-tablicy.edytowalna { cursor: text; }
.pokoj .nazwa-tablicy.edytowalna:hover { background: var(--najazd); }
.pokoj .podpis { font-size: 12px; color: var(--tekst-slaby); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.stan-zapisu { width: 7px; height: 7px; border-radius: 50%; background: #2f9e44; display: inline-block; flex: none; }
.stan-zapisu.mignij { animation: zapis .6s ease-out; }
@keyframes zapis { 30% { transform: scale(1.8); box-shadow: 0 0 0 4px rgba(47, 158, 68, .2); } }
.pokoj.bez-polaczenia .stan-zapisu { background: var(--zolty); }

/* awatary */
.awatary { display: flex; align-items: center; padding: 0 4px 0 8px; }
.awatar {
  width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 50%; border: 2px solid #fff !important;
  color: #fff; font-size: 12px; font-weight: 750; justify-content: center; margin-left: -8px;
  box-shadow: 0 1px 3px rgba(20, 32, 64, .25); position: relative; letter-spacing: .02em;
  transition: transform .12s;
}
.awatar:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.awatar.reszta { background: #e9ecf2 !important; color: var(--granat); }
.awatar .korona { position: absolute; top: -9px; right: -5px; font-size: 11px; color: var(--akcent); text-shadow: 0 0 2px #fff, 0 0 2px #fff; }
.pokoj .gora [data-tip]:hover::after { bottom: auto; top: calc(100% + 8px); }

button.udostepnij {
  background: var(--akcent); border-color: var(--akcent); color: #fff; min-height: 40px; height: 40px;
  padding: 0 16px 0 13px; border-radius: 10px; font-weight: 700; margin-left: 4px;
  box-shadow: 0 2px 8px rgba(243, 108, 26, .35);
}
button.udostepnij:hover:not(:disabled) { background: var(--akcent-ciemny); }

/* pigułki na środku u góry */
.pigulka {
  display: flex; align-items: center; gap: 9px; white-space: nowrap;
  background: var(--panel); border: 1px solid var(--panel-obwodka); border-radius: 999px;
  box-shadow: var(--panel-cien); padding: 7px 16px; font-size: 13.5px; font-weight: 600; color: var(--granat);
  animation: wjazdGora .2s cubic-bezier(.2, .8, .2, 1);
}
@keyframes wjazdGora { from { opacity: 0; transform: translateY(-8px); } }
.pigulka button.maly { min-height: 28px; padding: 4px 11px; font-size: 12.5px; border-radius: 999px; }
.pigulka.klikalna { cursor: pointer; }
.pigulka.klikalna:hover { border-color: rgba(243, 108, 26, .4); }
.minutnik-pigulka { padding: 6px 18px 6px 14px; }
.minutnik-pigulka .minutnik .czas { font-size: 24px; letter-spacing: .02em; }
.minutnik-pigulka:has(.minutnik.blisko) { background: #fff8e6; border-color: #ffd98a; }
.minutnik-pigulka:has(.minutnik.koniec) { background: #ffeaea; border-color: #ffb3b3; animation: potrzasnij .5s; }
@keyframes potrzasnij { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.minutnik-pigulka.pauza { opacity: .8; }
.pigulka.ostrzezenie { background: #fff8e6; border-color: #ffd98a; color: #8a5a00; }
.pigulka.zamrozona { background: #e8f3ff; border-color: #b5d6ff; color: #134a8e; }
.pigulka.prywatna { background: #f4ecff; border-color: #dcc7ff; color: #5b2ba5; }
.pigulka.glosowanie { background: var(--granat); color: #fff; border-color: var(--granat); }
.pigulka.glosowanie .ikona-svg { color: var(--akcent); }
.pigulka.sledzenie { background: #ebfbee; border-color: #b2f2bb; color: #1f6f32; }
.pigulka.runda { background: var(--panel); color: var(--granat); font-weight: 650; }
.pigulka.runda .probka-rundy { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .15); flex: none; }
.pigulka.sledzenie.odlaczony { background: var(--panel); border-color: var(--panel-obwodka); color: var(--granat); }
.kropki-glosow { display: inline-flex; gap: 4px; }
.kropki-glosow span { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); }
.kropki-glosow span.pelna { background: var(--akcent); border-color: var(--akcent); }
.krecik { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: obrot .8s linear infinite; }
@keyframes obrot { to { transform: rotate(360deg); } }

/* dymki-panele (minutnik, głosowanie, menu) */
.dymek-panel {
  position: fixed; z-index: 150; min-width: 260px; max-width: calc(100vw - 20px);
  background: var(--panel); border: 1px solid var(--panel-obwodka); border-radius: 14px;
  box-shadow: 0 2px 4px rgba(20, 32, 64, .06), 0 16px 48px rgba(20, 32, 64, .18); padding: 14px;
  animation: wjazdGora .14s ease-out;
}
.tytul-dymka { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 15px; color: var(--granat); margin-bottom: 10px; }
.tytul-dymka .ikona-svg { color: var(--akcent); }
.tytul-dymka button.narzedzie { margin-left: auto; width: 30px; height: 30px; min-height: 30px; min-width: 30px; }
.siatka-minut { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.kafel-minut {
  flex-direction: column; gap: 0; padding: 8px 0; min-height: 56px; justify-content: center; border-radius: 10px;
}
.kafel-minut b { font-size: 20px; line-height: 1.1; }
.kafel-minut span { font-size: 11px; color: var(--tekst-slaby); font-weight: 600; }
.kafel-minut:hover:not(:disabled) { border-color: var(--akcent); background: var(--akcent-mieko); }
.dymek-panel input[type=number] { width: 72px; padding: 6px 8px; min-height: 32px; }
.przelacznik-maly { display: inline-flex; align-items: center; gap: 5px; margin: 0 0 0 auto; font-size: 12px; }
.przelacznik-maly input { width: auto; }
.wiersz-formy {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 7px 0;
  font-size: 14px; color: var(--tekst); font-weight: 550; margin: 0; border-bottom: 1px solid var(--obwodka);
}
.wiersz-formy select { width: auto; padding: 5px 28px 5px 10px; min-height: 32px; }
.wiersz-formy input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--akcent); }
.wiersz-formy[hidden] { display: none; }

.menu { display: flex; flex-direction: column; min-width: 270px; margin: -6px; }
.pozycja-menu {
  border: none; background: transparent; justify-content: flex-start; gap: 11px; min-height: 38px; padding: 8px 10px;
  font-weight: 550; font-size: 14px; border-radius: 9px; color: var(--tekst);
}
.pozycja-menu .ikona-svg { color: #5b6680; flex: none; }
.pozycja-menu span:nth-child(2) { flex: 1; text-align: left; }
.pozycja-menu:hover:not(:disabled) { background: var(--najazd); }
.menu .rozdzielacz { height: 1px; background: var(--obwodka); margin: 5px 6px; }
.przelacznik-stan { width: 30px; height: 18px; border-radius: 999px; background: #d5dae3; position: relative; flex: none; transition: background .15s; }
.przelacznik-stan::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.przelacznik-stan.wl { background: var(--akcent); }
.przelacznik-stan.wl::after { transform: translateX(12px); }

/* wyniki głosowania */
.panel-wynikow {
  position: absolute; right: 12px; top: 76px; z-index: 85; width: 320px; max-width: calc(100vw - 24px);
  background: var(--panel); border: 1px solid var(--panel-obwodka); border-radius: 14px; box-shadow: var(--panel-cien);
  padding: 14px; display: none;
}
.panel-wynikow.widoczny { display: block; animation: wjazdGora .2s ease-out; }
.panel-wynikow ol { list-style: none; margin: 0; padding: 0; }
.panel-wynikow li {
  display: grid; grid-template-columns: 22px 12px 1fr 60px 26px; align-items: center; gap: 8px;
  padding: 7px 6px; border-radius: 9px; cursor: pointer; font-size: 13.5px;
}
.panel-wynikow li:hover { background: var(--najazd); }
.panel-wynikow li:first-child .miejsce { background: var(--akcent); color: #fff; }
.panel-wynikow .miejsce { width: 22px; height: 22px; border-radius: 50%; background: #eef0f4; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.panel-wynikow .kolor { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .08); }
.panel-wynikow .tekst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.panel-wynikow .pasek-wyniku { height: 6px; background: #eef0f4; border-radius: 999px; overflow: hidden; }
.panel-wynikow .pasek-wyniku span { display: block; height: 100%; background: var(--akcent); border-radius: 999px; }
.panel-wynikow b { text-align: right; font-variant-numeric: tabular-nums; }

/* okno udostępniania */
dialog.okno-udostepniania { max-width: 620px; padding: 26px; border-radius: 18px; }
.naglowek-okna { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.naglowek-okna h2 { margin-bottom: 4px; }
.naglowek-okna p { margin: 0; font-size: 14.5px; }
.ikona-okna { width: 44px; height: 44px; border-radius: 12px; background: var(--akcent-mieko); color: var(--akcent); display: flex; align-items: center; justify-content: center; flex: none; }
.ikona-okna.zielona { background: #ebfbee; color: #2f9e44; }
.udostepnianie { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; }
.kolumna-linku { min-width: 0; }
.pole-linku { font-size: 14px; font-weight: 600; color: var(--granat); background: #f7f8fa; }
.rzad.link { flex-wrap: nowrap; gap: 8px; }
.rzad.link .pole-linku { flex: 1; min-width: 0; }
.rzad.link button { flex: none; }
.kod-duzy { margin-top: 16px; display: flex; flex-direction: column; }
.kod-duzy b { font-size: 34px; letter-spacing: .14em; font-weight: 800; color: var(--granat); font-variant-numeric: tabular-nums; }
.udostepnianie .qr { background: #fff; border: 1px solid var(--obwodka); border-radius: 14px; padding: 8px; }
.udostepnianie .qr svg { display: block; }
@media (max-width: 560px) { .udostepnianie { grid-template-columns: 1fr; } .udostepnianie .qr { justify-self: center; } }

dialog.okno-skrotow { max-width: 620px; max-height: min(86vh, 760px); overflow-y: auto; }
.grupa-skrotow { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tekst-slaby); margin: 16px 0 6px; }
.okno-skrotow h2 + .grupa-skrotow { margin-top: 6px; }
.lista-skrotow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.lista-skrotow div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; padding: 3px 0; }
.lista-skrotow kbd { flex-shrink: 0; }
kbd {
  font-family: var(--font); font-size: 12px; font-weight: 700; color: var(--granat); background: #f1f3f6;
  border: 1px solid #dde1e8; border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; white-space: nowrap; min-width: 26px; text-align: center;
}

/* krok warsztatu inny niż ta tablica */
.zakrycie-kroku { position: absolute; inset: 0; z-index: 200; background: rgba(245, 246, 248, .86); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; }
.zakrycie-kroku.widoczne { display: flex; }
.zakrycie-kroku .karta { max-width: 440px; text-align: center; padding: 28px; }

/* ── telefon ──────────────────────────────────────────────────────── */
.pokoj.telefon .gora { top: calc(8px + env(safe-area-inset-top)); }
.pokoj.telefon .gora.lewa { left: 8px; right: auto; max-width: calc(100vw - 188px); min-height: 46px; padding: 4px 12px 4px 4px; }
.pokoj.telefon .gora.prawa { right: 8px; min-height: 46px; padding: 4px; gap: 2px; }
.pokoj.telefon .gora .rozdzielacz-pion { display: none; }
.pokoj.telefon .nazwa-tablicy { font-size: 14px; }
.pokoj.telefon .podpis { font-size: 11px; }
.pokoj.telefon .awatary { padding: 0 2px 0 8px; }
.pokoj.telefon .awatar { width: 30px; height: 30px; min-height: 30px; font-size: 11px; }
.pokoj.telefon button.narzedzie { min-width: 40px; height: 40px; min-height: 40px; }
.pokoj.telefon button.udostepnij-ikona { background: var(--akcent); color: #fff; }
.pokoj.telefon button.udostepnij-ikona:hover:not(:disabled) { background: var(--akcent-ciemny); color: #fff; }
.pokoj.telefon .gora.srodek { top: calc(64px + env(safe-area-inset-top)); width: calc(100vw - 16px); align-items: center; }
.pokoj.telefon .pigulka { white-space: normal; font-size: 13px; padding: 7px 12px; }
.pokoj.telefon .panel-wynikow { top: auto; bottom: calc(86px + env(safe-area-inset-bottom)); right: 8px; left: 8px; width: auto; max-height: 45vh; overflow: auto; }
.dolny-pasek {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(245, 246, 248, .96) 60%, rgba(245, 246, 248, 0));
}
.dolny-pasek .okragly {
  width: 52px; height: 52px; min-height: 52px; border-radius: 50%; padding: 0; justify-content: center;
  background: var(--panel); box-shadow: var(--panel-cien); border: 1px solid var(--panel-obwodka); color: var(--granat);
}
.dodaj-karteczke {
  flex: 1; height: 56px; min-height: 56px; border-radius: 999px; justify-content: center; font-size: 17px; font-weight: 750;
  background: var(--akcent); border-color: var(--akcent); color: #fff; box-shadow: 0 6px 18px rgba(243, 108, 26, .4);
}
.info-glosowania { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; border-radius: 999px; background: var(--granat); color: #fff; font-weight: 650; font-size: 15px; }
.info-glosowania .ikona-svg { color: var(--akcent); }
.arkusz-tlo { position: absolute; inset: 0; z-index: 140; background: rgba(13, 24, 41, .35); animation: wjazd .15s ease-out; }
.arkusz {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 141; background: var(--panel);
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(13, 24, 41, .25); display: flex; flex-direction: column; gap: 12px;
  animation: wjazdDol .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes wjazdDol { from { transform: translateY(100%); } }
.uchwyt-arkusza { width: 40px; height: 5px; border-radius: 999px; background: #d5dae3; align-self: center; }
.arkusz textarea { font-size: 18px; min-height: 96px; }
.kolory-arkusza { display: flex; gap: 8px; }
/* Macierz (§9.7): dwie listy obok siebie — gdzie ląduje karteczka. */
.gdzie-karteczka { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bez-podpisu { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; color: #5b2ba5; background: #f4ecff; border-radius: 10px; padding: 6px 10px; }
.bez-podpisu[hidden] { display: none; }
.gdzie-karteczka[hidden] { display: none; }
.wybor-miejsca { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; font-weight: 650; color: var(--slaby, #5b6680); }
.wybor-miejsca select { width: 100%; min-width: 0; font-size: 16px; min-height: 44px; }
.kolory-arkusza .probka { width: 38px; height: 38px; min-height: 38px; }

/* Telefon: każde stuknięcie to klik, bez czekania na „czy to podwójne” i bez powiększania strony. */
.pokoj button, .pokoj .pozycja-menu, .pokoj .awatar { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Panele (minutnik, głosowanie, menu) wysuwane od dołu jak arkusz. */
.dymek-panel.jako-arkusz {
  left: 0 !important; right: 0; top: auto !important; bottom: 0; min-width: 0; max-width: none;
  border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto; animation: wjazdDol .22s cubic-bezier(.2, .8, .2, 1);
  transition: transform .15s;
}
.dymek-panel.jako-arkusz .uchwyt-arkusza { margin: 0 auto 10px; }
.dymek-panel.jako-arkusz .menu { margin: 0; min-width: 0; }
.dymek-panel.jako-arkusz .pozycja-menu { min-height: 50px; font-size: 16px; }
.dymek-panel.jako-arkusz .kafel-minut { min-height: 64px; }
.dymek-panel.jako-arkusz .wiersz-formy { min-height: 50px; font-size: 15px; }
.dymek-panel.jako-arkusz button.glowny, .dymek-panel.jako-arkusz button.maly { min-height: 46px; }
.pokoj .arkusz { transition: transform .15s; }
.pokoj .arkusz-tlo { z-index: 140; }
.dymek-panel.jako-arkusz { z-index: 150; }

/* Gdy coś jest zaznaczone, dolny pasek ustępuje miejsca paskowi opcji. */
.pokoj.telefon.cos-zaznaczone .dolny-pasek { display: none; }

/* Komunikaty nad dolnym paskiem, nie na nim. */
body.z-pokojem #powiadomienia { bottom: calc(92px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
body.z-pokojem .powiadomienie { text-align: center; }

/* Logo w lewym dolnym rogu tablicy (komputer i tablet). */
.znak-marki {
  position: absolute; left: 12px; bottom: 12px; z-index: 85;
  background: var(--panel); border: 1px solid var(--panel-obwodka); border-radius: 10px;
  box-shadow: var(--panel-cien); padding: 7px 11px;
}
.znak-w-pasku { display: flex; align-items: center; padding: 0 4px 0 6px; }
.pokoj.telefon .znak-w-pasku a.logo-link { padding: 2px; }
.uwaga-glosowania { background: #fff4e6; border: 1px solid #ffc078; color: #a34a00; border-radius: 8px; padding: 6px 9px; margin: 6px 0; }
.uwaga-glosowania[hidden] { display: none; }

/* Linki do dopisywania (0.99.24) */
dialog.okno-linkow { max-width: 780px; width: calc(100vw - 32px); max-height: calc(100vh - 40px); overflow: auto; box-sizing: border-box; }
.lista-linkow { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.tytul-celu-linkow { font-weight: 750; display: flex; align-items: center; margin-bottom: 4px; }
.wiersz-linku { gap: 8px; margin-top: 4px; flex-wrap: nowrap; }
.nazwa-linku { width: 150px; flex: none; font-size: 13px; color: var(--tekst-slaby, #5b6680); }
.wiersz-linku .pole-linku { flex: 1; min-width: 0; font-size: 13px; }
.kto-dopisal ul { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 5px; }
.kto-dopisal li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.kto-dopisal li.zero { color: var(--tekst-slaby, #5b6680); }
@media (max-width: 640px) {
  .wiersz-linku { flex-wrap: wrap; }
  .nazwa-linku { width: 100%; }
}
