/* Wentro — powiadomienia push, ekran zachęty i bramki wejścia.
   Ładowany na stronach systemu (login, panele, moje konto). Wymaga colors.css. */

/* ============================================================
   1. Wspolna powloka obu bramek wejscia
   ------------------------------------------------------------
   Same ekrany siedza w sekcji 1b (.iag-*). Tu zostaje tylko to, czego uzywa
   app-gate.js do zamontowania ekranu i zablokowania przewijania tla.
   ============================================================ */
html.gate-locked, html.gate-locked body { overflow: hidden; height: 100%; }

.gate-host { position: fixed; inset: 0; z-index: 10000; }

/* ============================================================
   1b. Ekran „otwórz w przeglądarce" (przeglądarki wbudowane w sociale)
   ------------------------------------------------------------
   Kolory NIE są tu zapisane na sztywno — przychodzą z app-gate.js jako zmienne
   --iag-tlo / --iag-tekst / --iag-ink, dobrane pod aplikację, w której siedzi WebView.
   Ekran ma być czytany jako komunikat TEGO okna, a nie jako obca strona.
   ============================================================ */
.iag {
  position: fixed; inset: 0; z-index: 10001;
  background: var(--iag-tlo, linear-gradient(165deg, #14B8A6, #0E7C74));
  color: var(--iag-tekst, #fff);
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 24px 26px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
}

/* Wskazanie miejsca do naciśnięcia. `position: fixed`, nie absolute — strzałka celuje
   w element OKNA (menu aplikacji, pasek Safari), a nie w naszą treść. */
.iag-cel {
  position: fixed; display: flex; flex-direction: column; gap: 2px;
  pointer-events: none;
}
/* Menu przeglądarki wbudowanej: zwykle prawy górny róg. */
.iag-cel--gora {
  top: calc(6px + env(safe-area-inset-top)); right: 10px; align-items: flex-end;
  --iag-obrot: 30deg;
}
/* W swoim układzie współrzędnych strzałka wskazuje W GÓRĘ. Kierunek nadaje obrót
   (--iag-obrot z klasy pozycji), a dryf idzie wzdłuż tego obrotu — czyli zawsze w stronę,
   w którą pokazuje grot, niezależnie od tego, gdzie strzałkę postawiliśmy. */
.iag-strzalka {
  width: 56px; height: 66px; opacity: .95;
  transform: rotate(var(--iag-obrot, 0deg));
  animation: iag-dryf 1.5s ease-in-out infinite;
}
@keyframes iag-dryf {
  0%, 100% { transform: rotate(var(--iag-obrot, 0deg)) translateY(0); }
  50%      { transform: rotate(var(--iag-obrot, 0deg)) translateY(-9px); }
}
/* Ruch jest wskazówką, nie ozdobą, ale u kogoś z nadwrażliwością na animacje
   sam wskazujący kształt wystarczy. */
@media (prefers-reduced-motion: reduce) {
  .iag-strzalka { animation: none; }
}

/* Ekran instalacji na iOS nie udaje cudzej aplikacji — pasek Safari jest systemowy,
   więc ten ekran zostaje w barwach Wentro. */
/* Ekran instalacji jest JASNY — biel jako tło, kolor tylko na elementach.
   Odwrotnie niż ekran in-app, który udaje cudzą aplikację i dlatego jest kolorowy w całości.
   Tutaj nie ma czego naśladować: to Safari, a treścią jest instrukcja do przeczytania —
   czarny tekst na bieli czyta się lepiej niż biały na gradiencie, zwłaszcza w słońcu,
   a kolor zostaje tam, gdzie ma prowadzić wzrok: na ponumerowanych krokach. */
.iag--ios {
  --iag-tlo: var(--surface-0, #FFFFFF);
  --iag-tekst: var(--ink-900, #0B2321);
  --iag-ink: #FFFFFF;
}
.iag--ios .iag-lead { color: var(--ink-500, #4B615E); }
/* Karta kroku w kolorze marki, tekst na niej biały. Ikona udostępniania w kroku 1 rysuje
   się przez `currentColor`, więc bieleje razem z tekstem — bez osobnej reguły. */
.iag--ios .iag-kroki li {
  background: var(--teal-700, #0E7C74);
  color: #FFFFFF;
}
/* Numer odwrotnie: białe kółko, cyfra w kolorze karty. Domyślna reguła dałaby tu kółko
   w kolorze tekstu strony, czyli prawie czarne na ciemnym tealu. */
.iag--ios .iag-kroki li > span {
  background: var(--surface-0, #fff);
  color: var(--teal-700, #0E7C74);
}
.iag--ios .iag-powrot { color: var(--teal-700, #0E7C74); opacity: 1; }
/* Na bieli cień ikony musi być delikatniejszy — ten sam co na gradiencie robi brudną plamę. */
.iag--ios .iag-ikona-app { box-shadow: 0 8px 20px -8px rgba(11, 35, 33, .28); }
/* Ikona udostępniania wstawiona w zdanie — ma siedzieć w linii tekstu, nie nad nim. */
.iag-ikona {
  width: 1.05em; height: 1.05em; vertical-align: -.2em; margin: 0 .12em;
}

/* Kroki instalacji. Numer w kółku po lewej, treść po prawej, tekst DO LEWEJ — instrukcję
   czyta się linijka po linijce, a wyśrodkowany tekst rozjeżdża punkt startu każdej z nich. */
.iag-kroki {
  list-style: none; margin: 0; padding: 0; text-align: left; display: grid; gap: 9px;
}
.iag-kroki li {
  display: grid; grid-template-columns: 26px 1fr; gap: 11px; align-items: start;
  background: var(--iag-panel, rgba(255, 255, 255, .16));
  border-radius: 14px; padding: 12px 14px;
  font-size: 14.5px; line-height: 1.5;
}
.iag-kroki li > span {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--iag-tekst, #fff); color: var(--iag-ink, #0E7C74);
  font-size: 13.5px; font-weight: 800; line-height: 26px; text-align: center;
}
.iag-kroki b { font-weight: 800; }

/* Ikona aplikacji. Promień 22,5% szerokości to proporcja, jakiej iOS używa do swoich
   ikon — dzięki niej obrazek czyta się jako „aplikacja na telefonie", a nie jako logo
   wklejone w stronę. */
.iag-ikona-app {
  display: block; width: 72px; height: 72px; margin: 0 auto 16px;
  border-radius: 22.5%;
  box-shadow: 0 10px 26px -10px rgba(0, 0, 0, .45);
}

/* „Powrót" — zwykły podkreślony napis, nie przycisk. Element jest <button>, bo wykonuje
   akcję (cofnięcie), a nie prowadzi pod adres — ale ma wyglądać jak link w zdaniu:
   bez tła, bez obramowania, bez pola. Dlatego zerowane są WSZYSTKIE właściwości, które
   przeglądarka domyślnie nadaje przyciskowi, łącznie z `appearance` — bez tego Safari
   na iOS dorysowuje własne tło i zaokrąglenie mimo `background: none`. */
.iag-powrot {
  display: block; margin: 22px auto 0;
  -webkit-appearance: none; appearance: none;
  background: none; background-color: transparent;
  border: 0; border-radius: 0; box-shadow: none; padding: 6px 2px;
  font: inherit; font-size: 13.5px; color: inherit; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}

.iag-tresc { max-width: 380px; width: 100%; }

/* Wykrzyknik. Krąg wypełniony kolorem tekstu, znak w kolorze tła — ta sama reguła
   działa na ciemnym Messengerze i na żółtym Snapchacie. */
.iag-bang {
  width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--iag-tekst, #fff); color: var(--iag-ink, #0E7C74);
  font-size: 40px; font-weight: 800; line-height: 62px;
}
.iag h1 {
  font-size: 27px; line-height: 1.2; margin: 0 0 10px; font-weight: 800; letter-spacing: -.02em;
}
.iag-lead { font-size: 15.5px; line-height: 1.5; margin: 0 0 22px; opacity: .92; }
.iag-krok {
  font-size: 14.5px; line-height: 1.55; margin: 0 0 22px;
  /* Domyślnie jasna nakładka — pasuje do wszystkich ciemnych motywów. Motyw na jasnym tle
     (Snapchat) podmienia ją na ciemną przez --iag-panel z app-gate.js. */
  background: var(--iag-panel, rgba(255, 255, 255, .16)); border-radius: 14px; padding: 13px 15px;
}
.iag-krok b { font-weight: 800; }

.iag-btn {
  width: 100%; padding: 16px 24px; border: 0; border-radius: 999px;
  background: var(--iag-tekst, #fff); color: var(--iag-ink, #0E7C74);
  font-family: inherit; font-size: 16px; font-weight: 800; cursor: pointer;
}
.iag-note { margin: 12px 0 0; font-size: 13.5px; line-height: 1.45; font-weight: 600; }

/* Niskie ekrany (iPhone SE w poziomie, klawiatura) — ekran ma się zmieścić bez przewijania. */
@media (max-height: 620px) {
  .iag-bang { width: 48px; height: 48px; line-height: 48px; font-size: 31px; margin-bottom: 12px; }
  .iag h1 { font-size: 23px; }
  .iag-lead { margin-bottom: 16px; }
  .iag-krok { margin-bottom: 16px; }
  .iag-strzalka { width: 48px; height: 54px; }
  .iag-kroki { gap: 7px; }
  .iag-kroki li { padding: 10px 12px; font-size: 13.5px; }
  .iag-ikona-app { width: 56px; height: 56px; margin-bottom: 11px; }
  .iag-powrot { margin-top: 14px; }
}

/* ============================================================
   2. Ekran zachęty do powiadomień — mobile (pełny ekran)
   ============================================================ */
.wp-host { position: fixed; z-index: 9500; font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif); }

.wp-host-screen { inset: 0; opacity: 0; transition: opacity 220ms var(--ease, cubic-bezier(.4, 0, .2, 1)); }
.wp-host-screen.is-open { opacity: 1; }

.wp-screen {
  position: absolute; inset: 0;
  background: linear-gradient(165deg, #0E7C74 0%, #14B8A6 42%, #F5FBFA 42.1%, #F5FBFA 100%);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center;
  color: var(--ink-900, #0B2321);
}
.wp-screen-art {
  position: relative; flex-shrink: 0;
  width: 100%; height: 210px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  padding-top: env(safe-area-inset-top);
}
.wp-bell { width: 62px; height: 62px; position: relative; z-index: 2; animation: wp-swing 2.6s ease-in-out infinite; transform-origin: top center; }
@keyframes wp-swing {
  0%, 62%, 100% { transform: rotate(0deg); }
  68% { transform: rotate(11deg); }
  74% { transform: rotate(-9deg); }
  80% { transform: rotate(6deg); }
  86% { transform: rotate(-4deg); }
}
.wp-ring {
  position: absolute; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .38);
  animation: wp-pulse 2.6s ease-out infinite;
}
.wp-ring-1 { width: 118px; height: 118px; }
.wp-ring-2 { width: 168px; height: 168px; animation-delay: .45s; }
@keyframes wp-pulse {
  0% { transform: scale(.75); opacity: 0; }
  35% { opacity: .85; }
  100% { transform: scale(1.12); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .wp-bell, .wp-ring { animation: none; }
  .wp-ring { opacity: .5; }
}

.wp-screen-body {
  width: 100%; max-width: 480px; flex: 1;
  background: var(--surface-50, #F5FBFA);
  border-radius: 26px 26px 0 0;
  margin-top: -26px; position: relative; z-index: 3;
  padding: 26px 22px max(26px, env(safe-area-inset-bottom));
}
.wp-screen-body h2 { font-size: 23px; line-height: 1.25; font-weight: 800; margin: 0 0 10px; letter-spacing: -.01em; }
.wp-lead { font-size: 14px; line-height: 1.6; color: var(--ink-500, #4B615E); margin: 0 0 20px; }

.wp-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 11px; }
.wp-list li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: 15px; padding: 13px 15px;
}
.wp-dot {
  flex: 0 0 9px; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%;
  background: var(--teal-500, #14B8A6);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .16);
}
.wp-list strong { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.wp-list em { display: block; font-style: normal; font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); }

.wp-actions { display: grid; gap: 9px; }
.wp-btn {
  padding: 15px 24px; border: 0; border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer;
  transition: transform 120ms var(--ease, cubic-bezier(.4, 0, .2, 1)), opacity 120ms;
}
.wp-btn:active { transform: scale(.985); }
.wp-btn:disabled { opacity: .65; cursor: default; }
.wp-btn-primary {
  background: var(--gradient-cta, linear-gradient(135deg, #FF6B5B, #FF8F6B)); color: #fff;
  box-shadow: 0 16px 32px -18px rgba(255, 107, 91, .9);
}
.wp-btn-ghost { background: transparent; color: var(--ink-500, #4B615E); border: 1.5px solid var(--border, #DCEBE9); }
.wp-btn-sm { padding: 10px 20px; font-size: 13px; }

.wp-fine { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-300, #9DB0AD); text-align: center; }

.wp-note {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 13px;
  font-size: 13px; line-height: 1.55; font-weight: 600;
  background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
  border: 1px solid rgba(20, 184, 166, .28);
}
.wp-note-ok { background: rgba(31, 181, 116, .12); color: #12805A; border-color: rgba(31, 181, 116, .3); }
.wp-note-warn { background: #FFF4E5; color: #7A4B00; border-color: #FFD9A0; }

/* ============================================================
   3. Pasek zachęty — desktop
   ============================================================ */
.wp-host-bar {
  left: 50%; bottom: 20px; transform: translate(-50%, 14px);
  width: min(680px, calc(100vw - 32px));
  opacity: 0; transition: opacity 200ms var(--ease, cubic-bezier(.4, 0, .2, 1)), transform 200ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.wp-host-bar.is-open { opacity: 1; transform: translate(-50%, 0); }

.wp-bar {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); border-radius: 18px;
  padding: 16px 18px; box-shadow: 0 20px 48px -20px rgba(11, 35, 33, .35);
  color: var(--ink-900, #0B2321);
}
.wp-bar-ico {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
  display: flex; align-items: center; justify-content: center;
}
.wp-bar-ico svg { width: 22px; height: 22px; }
.wp-bar-text strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.wp-bar-text span { display: block; font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); }
.wp-bar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.wp-note-bar { grid-column: 1 / -1; margin: 4px 0 0; }

@media (max-width: 560px) {
  .wp-bar { grid-template-columns: auto 1fr; }
  .wp-bar-actions { grid-column: 1 / -1; }
  .wp-bar-actions .wp-btn { flex: 1; }
}

/* ============================================================
   4. Centrum powiadomień — pełny ekran
   ============================================================ */
.notif-btn-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--coral-500, #FF6B5B); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 18px; text-align: center;
  border: 2px solid #fff;
}

html.notif-locked, html.notif-locked body { overflow: hidden; }

.notif-screen {
  position: fixed; inset: 0; z-index: 9200;
  background: var(--surface-50, #F5FBFA);
  display: flex; flex-direction: column;
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--ink-900, #0B2321);
  opacity: 0; transform: translateY(10px);
  transition: opacity 180ms var(--ease, cubic-bezier(.4, 0, .2, 1)),
              transform 180ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.notif-screen.is-open { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .notif-screen { transition: opacity 120ms linear; transform: none; }
}

/* --- Pasek górny (przyklejony) --- */
.notif-topbar {
  flex-shrink: 0; background: var(--surface-0, #fff);
  border-bottom: 1px solid var(--border, #DCEBE9);
  padding-top: env(safe-area-inset-top);
}
.notif-topbar-inner {
  display: flex; align-items: center; gap: 12px;
  max-width: 720px; margin: 0 auto; padding: 12px 16px;
}
.notif-close {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--border, #DCEBE9); background: var(--surface-0, #fff); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--ink-700, #23403D);
}
.notif-close:hover { background: var(--surface-50, #F5FBFA); }
.notif-title { flex: 1; min-width: 0; }
.notif-title strong { display: block; font-size: 17px; font-weight: 800; line-height: 1.2; }
.notif-title span { display: block; font-size: 12px; color: var(--ink-500, #4B615E); margin-top: 1px; }
.notif-act {
  flex-shrink: 0; border: 0; background: transparent; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700; color: var(--teal-700, #0E7C74);
  padding: 9px 12px; border-radius: 999px; min-height: 40px;
}
.notif-act:hover { background: var(--teal-100, #E3F7F5); }
.notif-act:disabled { color: var(--ink-300, #9DB0AD); cursor: default; background: none; }

/* --- Filtry --- */
.notif-filters {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  max-width: 720px; margin: 0 auto; padding: 0 16px 12px;
}
.notif-filters::-webkit-scrollbar { display: none; }
.notif-filters:empty { display: none; }
.notif-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 8px 14px; border-radius: 999px; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface-50, #F5FBFA); color: var(--ink-500, #4B615E);
  border: 1px solid var(--border, #DCEBE9);
  transition: background 120ms var(--ease, cubic-bezier(.4, 0, .2, 1)), color 120ms;
}
.notif-chip:hover { color: var(--ink-900, #0B2321); }
.notif-chip span {
  font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 999px;
  background: rgba(11, 35, 33, .07); color: inherit;
}
.notif-chip.active { background: var(--ink-900, #0B2321); color: #fff; border-color: var(--ink-900, #0B2321); }
.notif-chip.active span { background: rgba(255, 255, 255, .2); }

/* --- Treść --- */
.notif-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.notif-inner {
  max-width: 720px; margin: 0 auto;
  padding: 14px 16px max(28px, env(safe-area-inset-bottom));
}

.notif-nudge {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #FFF4E5; border: 1px solid #FFD9A0; border-radius: 15px;
  padding: 13px 15px; margin-bottom: 14px;
}
.notif-nudge-ico { flex: 0 0 22px; color: #B8770A; display: flex; }
.notif-nudge p { flex: 1; min-width: 180px; font-size: 12.5px; line-height: 1.5; color: #7A4B00; margin: 0; }

.notif-group {
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-300, #9DB0AD); padding: 16px 4px 8px;
}
.notif-group:first-child { padding-top: 2px; }

.notif-list { display: block; }
.notif-item {
  display: flex; gap: 13px; align-items: flex-start; width: 100%; text-align: left;
  padding: 14px 15px; margin-bottom: 8px; border-radius: 15px; cursor: pointer;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); font-family: inherit;
  transition: border-color 120ms var(--ease, cubic-bezier(.4, 0, .2, 1)), transform 120ms;
}
.notif-item:hover { border-color: var(--teal-300, #5EEAD4); }
.notif-item:active { transform: scale(.995); }
.notif-item.unread { background: var(--surface-0, #fff); border-color: rgba(20, 184, 166, .35); box-shadow: var(--shadow-xs, 0 1px 2px rgba(11, 35, 33, .05)); }
.notif-ico {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 12px;
  background: var(--surface-50, #F5FBFA); color: var(--ink-500, #4B615E);
  display: flex; align-items: center; justify-content: center;
}
.notif-item.unread .notif-ico { background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74); }
.notif-body-text { flex: 1; min-width: 0; }
.notif-title-line { display: block; font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.notif-text { display: block; font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); margin-top: 3px; }
.notif-time { display: block; font-size: 11px; font-weight: 600; color: var(--ink-300, #9DB0AD); margin-top: 6px; }
.notif-unread-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--coral-500, #FF6B5B); margin-top: 14px; }

.notif-empty-big { text-align: center; padding: 56px 24px; }
.notif-empty-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 22px; margin-bottom: 14px;
  background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
}
.notif-empty-big strong { display: block; font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.notif-empty-big p { font-size: 13px; line-height: 1.55; color: var(--ink-500, #4B615E); max-width: 340px; margin: 0 auto; }

/* Wejście w ustawienia z tego samego ekranu: użytkownik, który tu zajrzał, jest dokładnie
   w tym miejscu, w którym może chcieć coś zmienić. */
.notif-settings {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin-top: 18px; padding: 14px 15px; border-radius: 15px; cursor: pointer;
  background: transparent; border: 1px dashed var(--border, #DCEBE9);
  font-family: inherit; font-size: 13px; font-weight: 700; color: var(--ink-500, #4B615E);
}
.notif-settings:hover { background: var(--surface-0, #fff); color: var(--ink-900, #0B2321); border-style: solid; }
.notif-settings span { flex: 1; text-align: left; }
.notif-settings-chev { flex: 0 0 15px; }

/* ============================================================
   5. Profil: urządzenia, historia logowań, przełączniki kategorii
   ============================================================ */
.dev-row {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px 0; border-bottom: 1px solid var(--border, #DCEBE9);
}
.dev-row:last-child { border-bottom: 0; }
.dev-ico {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px;
  background: var(--surface-50, #F5FBFA); color: var(--ink-700, #23403D);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border, #DCEBE9);
}
.dev-main { flex: 1; min-width: 0; }
.dev-name { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dev-meta { font-size: 12px; color: var(--ink-500, #4B615E); margin-top: 3px; line-height: 1.5; }
.dev-tag {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px;
}
.dev-tag-current { background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74); }
.dev-tag-push { background: rgba(31, 181, 116, .14); color: #12805A; }
.dev-tag-nopush { background: var(--ink-100, #DCEBE9); color: var(--ink-500, #4B615E); }

.switch-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 13px 0; border-bottom: 1px solid var(--border, #DCEBE9);
}
.switch-row:last-of-type { border-bottom: 0; }
.switch-row .sw-label { font-size: 13.5px; font-weight: 700; }
.switch-row .sw-desc { font-size: 12px; color: var(--ink-500, #4B615E); margin-top: 3px; line-height: 1.5; }

.sw {
  position: relative; flex: 0 0 46px; width: 46px; height: 27px; border-radius: 999px;
  border: 0; background: var(--ink-100, #DCEBE9); cursor: pointer; padding: 0;
  transition: background 160ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.sw::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px;
  border-radius: 50%; background: var(--surface-0, #fff); box-shadow: 0 2px 5px rgba(11, 35, 33, .28);
  transition: transform 160ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.sw[aria-checked="true"] { background: var(--teal-500, #14B8A6); }
.sw[aria-checked="true"]::after { transform: translateX(19px); }
.sw:disabled { opacity: .55; cursor: not-allowed; }

.diag-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; font-size: 13px; }
.diag-mark { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: #fff; margin-top: 1px; }
.diag-ok { background: var(--success, #1FB574); }
.diag-no { background: var(--warning, #F5A623); }
.diag-detail { font-size: 12px; color: var(--ink-500, #4B615E); margin-top: 2px; line-height: 1.5; }

/* „Zapamiętaj mnie" na ekranie logowania - jedna linia, bez opisu. */
.remember-row {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 0 14px; padding: 11px 14px;
  background: rgba(20, 184, 166, .07); border: 1px solid rgba(20, 184, 166, .22);
  border-radius: 14px;
}
.remember-row input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: #0E7C74; flex-shrink: 0; }
.remember-row label { font-size: 13.5px; font-weight: 700; color: #0B2321; text-transform: none; letter-spacing: 0; cursor: pointer; }
/* Na telefonie opcja jest wymuszona przez serwer i pole jest wylaczone - pokazujemy to
   wygaszeniem, ale wiersz zostaje widoczny, zeby uzytkownik wiedzial, ze pozostaje zalogowany. */
.remember-row.is-locked input[type="checkbox"] { opacity: .6; cursor: not-allowed; }
.remember-row.is-locked label { cursor: default; }

/* ============================================================
   6. Pull-to-refresh (aplikacja mobilna)
   ============================================================ */
/* Wskaznik jest jedynym elementem interfejsu, ktory moze wyjsc poza pasek gorny,
   wiec z-index tuz pod modalami (te maja 9000+), ale nad trescia i nad topnavem (40). */
.ptr {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -46px);
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  box-shadow: 0 6px 18px -6px rgba(11, 35, 33, .35);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-300, #9DB0AD);
  opacity: 0; pointer-events: none; z-index: 60;
}
.ptr svg { width: 20px; height: 20px; transition: none; }
/* Przekroczony prog: kolor marki mowi „pusc, a odswieze" - bez tego uzytkownik nie wie,
   kiedy pociagnal wystarczajaco daleko. */
.ptr.ready { color: var(--teal-700, #0E7C74); border-color: rgba(20, 184, 166, .45); }
.ptr.snap { transition: transform 220ms var(--ease, cubic-bezier(.4, 0, .2, 1)), opacity 220ms; }
.ptr.spin { color: var(--teal-700, #0E7C74); }
.ptr.spin svg { animation: ptr-spin .85s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .ptr.spin svg { animation-duration: 2s; }
}

/* Przycisk „Odswiez" w pasku gornym - ta sama animacja co wskaznik gestu, zeby obie drogi
   odswiezania wygladaly na jedna funkcje, a nie dwie rozne. */
/* Stan „pracuje" dla przycisków ikonowych. Został po usuniętym przycisku „Odśwież";
   zostawiony jako narzędzie ogólne — kręcąca się ikona to jedyny sposób pokazania pracy
   w przycisku, w którym nie ma miejsca na tekst. */
.icon-btn.is-busy { pointer-events: none; }
.icon-btn.is-busy .ico { animation: ptr-spin .85s linear infinite; }

/* ============================================================
   7. Ustawienia profilu: wiersze opcji i pod-ekrany
   ============================================================ */

/* Nagłówek profilu: awatar z nazwiskiem po lewej, akcje po prawej.
   Wcześniej „Edytuj dane" stało pod nazwiskiem, a cała prawa połowa karty była pusta. */
.profile-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.profile-id { display: flex; align-items: center; gap: 15px; min-width: 0; }
.profile-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.profile-name strong { font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -.015em; word-break: break-word; }
/* Podpis: rola i adres. Nazwisko samo nie mówi, kim się jest w tym systemie —
   a to pierwsza rzecz, której szuka się w profilu. */
.profile-name .pf-sub { display: flex; align-items: baseline; gap: 7px; min-width: 0; flex-wrap: wrap; }
.profile-name .pf-sub b { font-size: 13px; font-weight: 700; color: var(--teal-700, #0E7C74); }
.profile-name .pf-sub i {
  font-style: normal; font-size: 13px; color: var(--ink-500, #4B615E);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
/* Kropka rozdzielająca rolę od adresu — rysowana w CSS, żeby znikała razem z adresem. */
.profile-name .pf-sub i::before { content: '· '; color: var(--ink-300, #9DB0AD); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

@media (max-width: 560px) {
  /* Na telefonie akcje schodzą pod nazwisko i rozkładają się na pełną szerokość —
     przyciski w rzędzie z nazwiskiem byłyby wtedy ściśnięte do kilku znaków. */
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* --- Nagłówek pod-ekranu --- */
.screen-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.screen-head h1 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.screen-back {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 0; cursor: pointer; font-family: inherit;
  font-size: 12.5px; font-weight: 700; color: var(--teal-700, #0E7C74);
  padding: 7px 12px 7px 8px; border-radius: 999px; min-height: 40px;
}
.screen-back:hover { background: var(--teal-100, #E3F7F5); }
.screen-back .ico { width: 16px; height: 16px; transform: rotate(180deg); }
.screen-lead { font-size: 13px; line-height: 1.6; color: var(--ink-500, #4B615E); margin: 0 0 16px; max-width: 620px; }

@media (max-width: 760px) {
  /* Na telefonie powrót idzie nad tytuł — obok zabierałby połowę szerokości nagłówka. */
  .screen-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .screen-back { margin-left: -8px; }
  .screen-head h1 { font-size: 19px; }
}

/* --- Karta stanu (nagłówek obu ekranów) --- */
.status-card { padding: 18px 20px; }
.status-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.status-ico {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 16px;
  background: var(--ink-100, #DCEBE9); color: var(--ink-500, #4B615E);
  display: flex; align-items: center; justify-content: center;
}
.status-card.is-on .status-ico { background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74); }
.status-ico.warn { background: #FFF4E5; color: #B8770A; }
.status-text { flex: 1; min-width: 140px; }
.status-text strong { display: block; font-size: 15.5px; font-weight: 800; line-height: 1.3; }
.status-text span { display: block; font-size: 12.5px; color: var(--ink-500, #4B615E); margin-top: 2px; }
.status-desc { font-size: 12.5px; line-height: 1.6; color: var(--ink-500, #4B615E); margin: 14px 0 0; }
.status-warn {
  font-size: 12.5px; line-height: 1.55; margin: 14px 0 0;
  background: #FFF4E5; border: 1px solid #FFD9A0; color: #7A4B00;
  border-radius: 12px; padding: 11px 13px;
}
.status-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.status-actions .btn { flex: 1 1 auto; justify-content: center; }
@media (min-width: 560px) { .status-actions .btn { flex: 0 0 auto; } }

/* Fakty o bieżącym urządzeniu używają teraz tych samych wierszy co profil (`.pf-row`) —
   wcześniej miały własny układ i własne odstępy, choć pokazują dokładnie to samo. */
.status-card .pf-rows {
  margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--border, #DCEBE9);
}

/* ============================================================
   8. Ekran ładowania aplikacji i sesji
   ============================================================ */
/* Blokada przewijania na czas startu: pod spodem trwa budowa panelu i tło skacze. */
html.boot-locked, html.boot-locked body { overflow: hidden; }

.boot {
  position: fixed; inset: 0; z-index: 9800;
  background: linear-gradient(170deg, #F5FBFA 0%, #E3F7F5 55%, #FFF3F0 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  color: var(--ink-900, #0B2321);
  opacity: 1; transition: opacity 300ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.boot.is-hidden { opacity: 0; pointer-events: none; }
.boot-inner {
  width: 100%; max-width: 380px; text-align: center;
  padding: 24px max(20px, env(safe-area-inset-left)) 24px max(20px, env(safe-area-inset-right));
}
.boot-logo { height: 40px; width: auto; margin-bottom: 26px; }

/* Trzy kropki zamiast obracającego się koła: przy zerwanym połączeniu koło wygląda,
   jakby coś się działo, a kropki czytają się jak „czekamy". */
.boot-spinner { display: flex; gap: 7px; justify-content: center; margin-bottom: 18px; }
.boot-spinner span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--teal-500, #14B8A6);
  animation: boot-pulse 1.1s ease-in-out infinite;
}
.boot-spinner span:nth-child(2) { animation-delay: .16s; }
.boot-spinner span:nth-child(3) { animation-delay: .32s; }
@keyframes boot-pulse {
  0%, 70%, 100% { transform: scale(.72); opacity: .35; }
  35% { transform: scale(1); opacity: 1; }
}
.boot.is-failed .boot-spinner { display: none; }
@media (prefers-reduced-motion: reduce) {
  .boot-spinner span { animation-duration: 2.2s; }
}

.boot-status { font-size: 14px; font-weight: 700; margin: 0 0 16px; min-height: 20px; }

/* Log kroków — to on odróżnia „coś się wiesza" od „system przywraca sesję". */
.boot-log {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left; max-width: 320px; margin: 0 auto;
}
.boot-log-item {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-500, #4B615E);
  animation: boot-in 220ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
@keyframes boot-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.boot-mark {
  flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; margin-top: 2px;
  border: 2px solid var(--ink-100, #DCEBE9); position: relative;
}
.boot-log-item[data-state="run"] .boot-mark {
  border-color: var(--teal-500, #14B8A6); border-top-color: transparent;
  animation: boot-spin .7s linear infinite;
}
@keyframes boot-spin { to { transform: rotate(360deg); } }
.boot-log-item[data-state="ok"] .boot-mark { border-color: var(--success, #1FB574); background: var(--success, #1FB574); }
.boot-log-item[data-state="ok"] .boot-mark::after {
  content: ''; position: absolute; left: 2.5px; top: 0px; width: 3px; height: 6.5px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.boot-log-item[data-state="warn"] .boot-mark { border-color: var(--warning, #F5A623); background: var(--warning, #F5A623); }
.boot-log-item[data-state="fail"] .boot-mark { border-color: var(--danger, #E5484D); background: var(--danger, #E5484D); }
.boot-log-item[data-state="fail"] { color: var(--danger, #E5484D); font-weight: 700; }
.boot-log-item[data-state="warn"] { color: #7A4B00; }

.boot-fail { margin-top: 22px; }
.boot-fail-text { font-size: 13px; line-height: 1.55; color: var(--ink-500, #4B615E); margin: 0 0 16px; }
.boot-fail-actions { display: grid; gap: 8px; }
.boot-btn {
  padding: 13px 22px; border: 0; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700;
  background: var(--gradient-cta, linear-gradient(135deg, #FF6B5B, #FF8F6B)); color: #fff;
}
.boot-btn-ghost {
  background: transparent; color: var(--ink-500, #4B615E);
  border: 1.5px solid var(--border, #DCEBE9);
}
.boot-noscript {
  position: absolute; inset: auto 16px 24px; text-align: center;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); border-radius: 14px; padding: 16px;
}
.boot-noscript strong { display: block; font-size: 14px; margin-bottom: 6px; }
.boot-noscript p { font-size: 12.5px; color: var(--ink-500, #4B615E); margin: 0; }

/* ============================================================
   9. Tryb offline
   ============================================================ */
/* Pasek stanu połączenia. Przyklejony na dole nad nawigacją mobilną, żeby nie zasłaniał
   paska górnego i nie przesuwał treści. */
.net-bar {
  position: fixed; left: 50%; transform: translate(-50%, 130%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 8000; display: flex; align-items: center; gap: 9px;
  max-width: calc(100vw - 24px);
  padding: 10px 16px; border-radius: 999px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 12.5px; font-weight: 700;
  box-shadow: 0 12px 30px -12px rgba(11, 35, 33, .45);
  transition: transform 240ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.net-bar.is-visible { transform: translate(-50%, 0); }
.net-bar-off { background: var(--ink-900, #0B2321); color: #fff; }
.net-bar-on { background: var(--success, #1FB574); color: #fff; }
.net-bar .ico { width: 15px; height: 15px; }
@media (max-width: 760px) { .net-bar { bottom: calc(72px + env(safe-area-inset-bottom)); } }

/* Element wyłączony, bo wymaga sieci (np. odświeżenie kodu QR). */
.needs-net { opacity: .55; pointer-events: none; }

/* ============================================================
   10. Bilety: karta na liście i pełny ekran biletu
   ============================================================ */

/* --- Karta na liście: zapowiedź biletu, cała klikalna --- */
.tk-card { margin-bottom: 10px; cursor: pointer; transition: border-color 120ms var(--ease, cubic-bezier(.4, 0, .2, 1)), transform 120ms; }
.tk-card:hover { border-color: var(--teal-300, #5EEAD4); }
.tk-card:active { transform: scale(.997); }
.tk-card:focus-visible { outline: 2px solid var(--teal-500, #14B8A6); outline-offset: 2px; }

.tk-card-main { display: flex; align-items: center; gap: 14px; }
.tk-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-card-text strong { font-size: 14.5px; line-height: 1.3; }
.tk-card-when { font-size: 12.5px; color: var(--ink-500, #4B615E); }
.tk-card-type { font-size: 12px; color: var(--ink-300, #9DB0AD); }
.tk-card-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tk-flag {
  font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px;
  background: var(--coral-100, #FFEAE6); color: var(--coral-700, #E14A36);
}
.tk-card-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tk-card-chev { color: var(--ink-300, #9DB0AD); width: 18px; height: 18px; }
@media (max-width: 560px) {
  .tk-card-side { flex-direction: column; align-items: flex-end; gap: 6px; }
  .tk-card-chev { display: none; }
}

/* --- Układ ekranu biletu --- */
/* Dwie kolumny na szerokim ekranie: po lewej to, co się pokazuje przy wejściu,
   po prawej to, co się czyta wcześniej. Na telefonie jedna kolumna w tej samej kolejności. */
.tk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
@media (min-width: 900px) {
  .tk-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; gap: 22px; }
}
.tk-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ------------------------------------------------------------------
   KUPON — jedyny element na ekranie, który ma prawo krzyczeć.
   Wielkość elementów odpowiada temu, po co człowiek otwiera bilet:
   KIEDY, GDZIE, na co. Reszta ekranu jest świadomie cichsza.
   ------------------------------------------------------------------ */
.tk-stub {
  border-radius: var(--radius-lg, 20px); overflow: hidden;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  box-shadow: 0 14px 34px -18px rgba(11, 35, 33, .4);
}
.tk-stub-top {
  background: var(--gradient-brand, linear-gradient(135deg, #0E7C74, #14B8A6));
  color: #fff; padding: 18px 22px 22px;
}
.tk-stub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tk-stub-brand { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .8); }
/* Status na kolorowym tle potrzebuje własnej wersji — firmowe pigułki mają jasne tła. */
.tk-stub-head .pill { background: rgba(255, 255, 255, .18) !important; color: #fff !important; }

.tk-stub-top h2 {
  font-size: 25px; font-weight: 800; line-height: 1.2; margin: 0 0 18px;
  letter-spacing: -.015em; overflow-wrap: anywhere;
}

/* Blok „kiedy": dzień i godzina wielkimi cyframi — to jest treść, po którą się tu wchodzi. */
.tk-when { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.tk-date, .tk-time { display: flex; flex-direction: column; line-height: 1; }
.tk-date b { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tk-date span { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.tk-date i { font-style: normal; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .7); margin-top: 3px; }
.tk-time { padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .28); }
.tk-time b { font-size: 30px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.tk-time span { font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .78); margin-top: 6px; }
.tk-countdown {
  margin-left: auto; align-self: flex-start;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .28);
  padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 800; white-space: nowrap;
}

.tk-place { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.tk-place .ico { flex-shrink: 0; margin-top: 1px; }

/* Perforacja: dwa wycięcia po bokach — tyle wystarczy, żeby element czytał się jak bilet. */
.tk-stub-cut { position: relative; height: 16px; background: var(--gradient-brand, linear-gradient(135deg, #0E7C74, #14B8A6)); }
.tk-stub-cut::before, .tk-stub-cut::after {
  content: ''; position: absolute; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; background: var(--surface-50, #F5FBFA);
}
.tk-stub-cut::before { left: -9px; }
.tk-stub-cut::after { right: -9px; }

/* Typ biletu i cena jako jedna cicha linijka w nagłówku kuponu. Wcześniej zajmowały cały
   rząd etykiet pod perforacją — miejsce, w którym powinien być kod wejścia. */
.tk-kind {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .22);
  font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .82);
}

/* Osoba na bilecie — tylko gdy bilet jest wystawiony na kogoś innego niż właściciel konta.
   Stoi w kuponie, nie w sekcji szczegółów: przy bramce to jest sprawdzane jako pierwsze. */
.tk-holder {
  display: flex; align-items: center; gap: 7px; margin-top: 8px;
  font-size: 12.5px; color: rgba(255, 255, 255, .92);
}
.tk-holder strong { font-weight: 800; }

@media (max-width: 420px) {
  .tk-stub-top h2 { font-size: 21px; }
  .tk-date b { font-size: 34px; }
  .tk-time b { font-size: 25px; }
  .tk-when { gap: 14px; }
  .tk-time { padding-left: 14px; }
  .tk-countdown { margin-left: 0; }
}

/* ------------------------------------------------------------------
   KOD WEJŚCIA — druga rzecz co do ważności, więc druga co do wielkości.
   Celowo NIE jest zwykłą kartą: biała plama z ramką w kolorze marki
   odróżnia go od sekcji opisowych na pierwszy rzut oka.
   ------------------------------------------------------------------ */
/* Dolna, „odrywana" część kuponu. Bez własnej ramki i cienia — jest w środku biletu,
   a nie obok niego; perforacja powyżej wystarcza za granicę. */
.tk-code { background: var(--surface-0, #fff); padding: 20px 22px 22px; text-align: center; }
.tk-code-label { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-700, #0E7C74); margin-bottom: 14px; }
/* Kod QR nie mieszka już przy bilecie — jest jeden na konto, na ekranie „Kod QR".
   Tutaj zostaje tylko droga do niego, czyli przycisk `.tk-code-cta` (patrz sekcja
   „Legitymacja uczestnika" na końcu pliku). Style żywego kodu przeniosły się razem z nim. */
.tk-code-note { font-size: 12px; line-height: 1.5; color: var(--ink-300, #9DB0AD); margin: 10px 0 0; }

.tk-code.is-off { background: var(--surface-50, #F5FBFA); padding: 30px 22px; }
.tk-code.is-off .tk-code-label { color: var(--ink-500, #4B615E); }
.tk-code-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 18px; margin-bottom: 14px;
  background: var(--ink-100, #DCEBE9); color: var(--ink-300, #9DB0AD);
}
.tk-code.is-off .tk-code-note { color: var(--ink-500, #4B615E); font-size: 12.5px; max-width: 340px; margin: 8px auto 0; }

/* ------------------------------------------------------------------
   SEKCJE — trzy poziomy głośności zamiast jednego.
   ------------------------------------------------------------------ */
.tk-sec {
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: var(--radius-lg, 20px); padding: 18px 20px;
}
.tk-sec > h3 {
  font-size: 15px; font-weight: 800; margin: 0 0 14px;
  letter-spacing: -.01em; color: var(--ink-900, #0B2321);
}
.tk-hint { font-size: 12px; line-height: 1.5; color: var(--ink-300, #9DB0AD); margin: 10px 0 0; }

/* Wymaga uwagi — jedyna sekcja z akcentem, bo jako jedyna czegoś od użytkownika chce. */
.tk-sec-alert { border-color: rgba(255, 107, 91, .4); background: var(--surface-0, #fff); }
.tk-sec-alert > h3 { color: var(--coral-700, #E14A36); display: flex; align-items: center; gap: 8px; }
.tk-sec-alert > h3::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral-500, #FF6B5B); flex-shrink: 0;
}

/* Sekcje odniesienia: czytane rzadko, więc bez obudowy karty i mniejszą czcionką. */
.tk-sec-quiet { background: transparent; border: 0; padding: 4px 2px; }
.tk-sec-quiet > h3 { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-300, #9DB0AD); margin-bottom: 8px; }

/* --- Do załatwienia --- */
.tk-todo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 13px 15px; border-radius: var(--radius-md, 14px); margin-top: 10px;
  background: var(--coral-100, #FFEAE6);
}
.tk-todo:first-of-type { margin-top: 0; }
.tk-todo.is-info { background: var(--teal-100, #E3F7F5); }
.tk-todo.tk-blocked { background: var(--ink-100, #DCEBE9); }
.tk-facts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; }
.tk-facts li { font-size: 12.5px; color: var(--ink-700, #23403D); }
.tk-facts li b { display: inline-block; min-width: 86px; font-weight: 700; color: var(--ink-500, #4B615E); }
.tk-todo strong { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-900, #0B2321); }
.tk-todo span { display: block; font-size: 12px; line-height: 1.45; color: var(--ink-500, #4B615E); margin-top: 2px; }

.tk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-actions .btn { flex: 1 1 auto; justify-content: center; }
@media (min-width: 560px) { .tk-actions .btn { flex: 0 0 auto; } }

/* --- Agenda --- */
.ag-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 0; border-bottom: 1px solid var(--border, #DCEBE9);
}
.ag-item:last-child { border-bottom: 0; padding-bottom: 0; }
.ag-item.is-mine { background: rgba(20, 184, 166, .05); border-radius: var(--radius-sm, 8px); padding-left: 10px; padding-right: 10px; }

.ag-time {
  flex: 0 0 56px; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding-top: 1px;
}
.ag-time strong { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ag-time span { font-size: 11px; color: var(--ink-300, #9DB0AD); font-variant-numeric: tabular-nums; }

.ag-main { flex: 1; min-width: 0; }
.ag-title { font-size: 13.5px; font-weight: 700; line-height: 1.35; }
.ag-meta { font-size: 12px; color: var(--ink-500, #4B615E); margin-top: 2px; }
.ag-desc { font-size: 12px; line-height: 1.5; color: var(--ink-500, #4B615E); margin-top: 5px; }
.ag-seats-row { margin-top: 7px; }
.ag-seats {
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px;
  background: var(--ink-100, #DCEBE9); color: var(--ink-500, #4B615E);
}
.ag-seats.ok { background: rgba(31, 181, 116, .14); color: #12805A; }
.ag-seats.full { background: var(--coral-100, #FFEAE6); color: var(--coral-700, #E14A36); }
.ag-action { flex-shrink: 0; }

@media (max-width: 560px) {
  /* Na telefonie akcja schodzi pod treść — obok tytułu zostawałoby na nią kilka znaków. */
  .ag-item { flex-wrap: wrap; }
  .ag-action { width: 100%; padding-left: 70px; }
  .ag-action .btn { width: 100%; justify-content: center; }
}


/* ============================================================
   11. Kanały nadawcze, zdjęcie profilowe, plakietki nawigacji
   ============================================================ */

/* --- Plakietka nieprzeczytanych w nawigacji --- */
/* Kotwiczy się do przycisku zakładki, więc oba potrzebują punktu odniesienia. */
.topnav .tab, .mobnav .mnav-btn { position: relative; }
.tab-badge {
  position: absolute; top: 2px; right: 6px;
  min-width: 17px; height: 17px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--coral-500, #FF6B5B); color: #fff;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 2px #fff;
}
@media (max-width: 900px) {
  .mobnav .tab-badge { top: 2px; right: 50%; transform: translateX(16px); }
}

/* ------------------------------------------------------------------
   AWATAR — jeden komponent, pięć rozmiarów, jeden kształt.
   Rysuje go wyłącznie Core.avatar(); nigdzie nie ma już awatarów
   pisanych inline ani osobnych klas per widok.

   Kształt: zaokrąglony kwadrat (promień ~32% boku). Wybrany, bo tak
   wyglądał największy i najbardziej widoczny awatar w systemie
   (profil), a reszta interfejsu — karty, kafelki, ikony — mówi tym
   samym językiem. Koła w tabeli użytkowników i w górnym pasku były
   wyjątkami, nie regułą.
   ------------------------------------------------------------------ */
.av {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  background: var(--gradient-brand, linear-gradient(135deg, #0E7C74, #14B8A6));
  color: #fff; font-weight: 800; line-height: 1; letter-spacing: .01em;
  text-transform: uppercase; user-select: none;
}
/* Przy zdjęciu gradient znika — prześwitywałby przez obrazy z przezroczystością. */
.av.has-img { background: var(--ink-100, #DCEBE9); }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }

.av-xs { width: 24px; height: 24px; border-radius: 8px;  font-size: 10px; }
.av-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.av-md { width: 40px; height: 40px; border-radius: 13px; font-size: 14px; }
.av-lg { width: 56px; height: 56px; border-radius: 18px; font-size: 19px; }
.av-xl { width: 96px; height: 96px; border-radius: 30px; font-size: 32px; }

/* Alias dla znaczników sprzed ujednolicenia — te same wymiary co `.av-lg`. */
.avatar-lg {
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  width: 56px; height: 56px; border-radius: 18px; font-size: 19px; font-weight: 800;
  background: var(--gradient-brand, linear-gradient(135deg, #0E7C74, #14B8A6)); color: #fff;
}
.avatar-lg.has-img { background: var(--ink-100, #DCEBE9); }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --- Zmiana zdjęcia profilowego --- */
.avatar-wrap { position: relative; flex-shrink: 0; display: inline-flex; }

/* Przycisk aparatu siada w rogu zdjęcia — tam, gdzie ludzie go szukają odruchowo.
   Obwódka w kolorze tła odcina go od zdjęcia niezależnie od tego, co na nim jest. */
.avatar-edit {
  position: absolute; right: -4px; bottom: -4px;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-700, #0E7C74); color: #fff;
  border: 2px solid #fff; cursor: pointer; padding: 0;
  transition: transform 120ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.avatar-edit:hover { transform: scale(1.08); }
.avatar-edit:focus-visible { outline: 2px solid var(--teal-500, #14B8A6); outline-offset: 2px; }
.avatar-edit .ico { width: 14px; height: 14px; }

.av-crop {
  display: flex; justify-content: center;
  background: var(--surface-50, #F5FBFA); border-radius: var(--radius-md, 14px); padding: 12px;
}
/* Podgląd ma DOKŁADNIE ten kształt, co zapisany awatar. Wcześniej kadrowało się w kole,
   a wynik był zaokrąglonym kwadratem — podgląd kłamał o tym, co wyjdzie. */
.av-crop canvas {
  width: 220px; height: 220px; max-width: 100%;
  border-radius: 70px; cursor: grab; touch-action: none;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--border, #DCEBE9);
}
.av-crop canvas:active { cursor: grabbing; }

.av-nudge { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.av-nudge button {
  min-width: 38px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border, #DCEBE9); background: var(--surface-0, #fff); border-radius: var(--radius-sm, 8px);
  font-size: 13px; font-weight: 700; color: var(--ink-700, #29423F); cursor: pointer;
}
.av-nudge button:hover { border-color: var(--teal-300, #5EEAD4); }

/* ------------------------------------------------------------------
   LISTA KANAŁÓW
   ------------------------------------------------------------------ */
.ch-list { display: flex; flex-direction: column; gap: 8px; }

.ch-row {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 13px 15px; border-radius: var(--radius-lg, 20px);
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); cursor: pointer;
  transition: border-color 120ms var(--ease, cubic-bezier(.4, 0, .2, 1)), transform 120ms;
}
.ch-row:hover { border-color: var(--teal-300, #5EEAD4); }
.ch-row:active { transform: scale(.997); }
.ch-row:focus-visible { outline: 2px solid var(--teal-500, #14B8A6); outline-offset: 2px; }

.ch-row-ico {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
}
.ch-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ch-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ch-row-top strong { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-row-time { font-size: 11.5px; color: var(--ink-300, #9DB0AD); flex-shrink: 0; }
.ch-row-preview {
  font-size: 12.5px; color: var(--ink-500, #4B615E); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ch-row-preview.is-empty { color: var(--ink-300, #9DB0AD); font-style: italic; }
.ch-row-author { font-weight: 700; color: var(--ink-700, #29423F); }

/* Nieprzeczytane pogrubiamy zamiast kolorować tło — kolor na całym wierszu robi z listy
   szachownicę, a pogrubienie czyta się od razu i działa też przy dziesięciu kanałach. */
.ch-row.is-unread .ch-row-top strong { font-weight: 800; }
.ch-row.is-unread .ch-row-preview { color: var(--ink-900, #0B2321); font-weight: 600; }
.ch-row-badge {
  flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--teal-700, #0E7C74); color: #fff;
  font-size: 11.5px; font-weight: 800;
}

/* ------------------------------------------------------------------
   EKRAN KANAŁU
   ------------------------------------------------------------------ */
.ch-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ch-head-main { flex: 1; min-width: 200px; }
.ch-head-main h1 { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ch-head-main p { font-size: 12.5px; color: var(--ink-500, #4B615E); margin: 3px 0 0; }
.ch-head-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-audience { font-size: 11.5px; font-weight: 700; color: var(--ink-500, #4B615E); }
.ch-head .screen-back { flex-shrink: 0; }

.ch-tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--surface-50, #F5FBFA); border-radius: 999px; width: fit-content; }
.ch-tab {
  padding: 7px 18px; border: none; background: transparent; cursor: pointer;
  border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--ink-500, #4B615E);
}
.ch-tab.active { background: var(--surface-0, #fff); color: var(--teal-700, #0E7C74); box-shadow: var(--shadow-sm, 0 4px 12px rgba(11, 35, 33, .06)); }

/* Przypięte: pas nad wątkiem, nie karta w wątku — ma być czytelne, że stoi POZA kolejnością. */
.ch-pinned {
  border-left: 3px solid var(--teal-500, #14B8A6);
  background: var(--teal-100, #E3F7F5);
  border-radius: 0 var(--radius-md, 14px) var(--radius-md, 14px) 0;
  padding: 11px 15px; margin-bottom: 14px;
}
.ch-pinned-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--teal-700, #0E7C74); margin-bottom: 6px;
}
.ch-pinned-body { font-size: 13.5px; line-height: 1.55; color: var(--ink-900, #0B2321); }
.ch-pinned-meta { display: block; font-size: 11.5px; color: var(--ink-500, #4B615E); margin-top: 6px; }

.ch-more { display: flex; justify-content: center; margin-bottom: 12px; }
.ch-feed { display: flex; flex-direction: column; gap: 12px; }

/* Separator dnia: kreska przez całą szerokość z etykietą pośrodku. */
.ch-day { display: flex; align-items: center; gap: 12px; margin: 6px 0 2px; }
.ch-day::before, .ch-day::after { content: ''; flex: 1; height: 1px; background: var(--border, #DCEBE9); }
.ch-day span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-300, #9DB0AD); }

.ch-msg {
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: var(--radius-lg, 20px); padding: 14px 16px;
}
.ch-msg.is-removed {
  background: var(--surface-50, #F5FBFA); border-style: dashed;
  color: var(--ink-300, #9DB0AD); font-size: 12.5px; font-style: italic; padding: 12px 16px;
}
.ch-msg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.ch-msg-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ch-msg-who strong { font-size: 13px; font-weight: 700; }
.ch-msg-who span { font-size: 11.5px; color: var(--ink-300, #9DB0AD); }
.ch-msg-pin { color: var(--teal-500, #14B8A6); flex-shrink: 0; }
.ch-msg-menu { flex-shrink: 0; font-size: 17px; line-height: 1; color: var(--ink-300, #9DB0AD); }
.ch-msg-body { font-size: 14px; line-height: 1.6; color: var(--ink-900, #0B2321); overflow-wrap: anywhere; }


/* --- Reakcje --- */
.ch-reacts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 11px; position: relative; }
.ch-react {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border, #DCEBE9); background: var(--surface-50, #F5FBFA);
  font-size: 13px; line-height: 1;
}
.ch-react:hover { border-color: var(--teal-300, #5EEAD4); }
/* Własna reakcja odróżnia się obwódką i tłem — bez tego stuknięcie nie daje potwierdzenia,
   że w ogóle się zapisało. */
.ch-react.is-mine { background: var(--teal-100, #E3F7F5); border-color: var(--teal-500, #14B8A6); }
.ch-react-n { font-size: 11.5px; font-weight: 800; color: var(--ink-700, #29423F); }
.ch-react-add { color: var(--ink-500, #4B615E); padding: 4px 9px; background: var(--surface-0, #fff); }
.ch-react-add:hover { color: var(--teal-700, #0E7C74); background: var(--teal-100, #E3F7F5); }
.ch-react-add-ico { width: 17px; height: 17px; flex-shrink: 0; }
.ch-react-add.has-label { padding: 4px 11px 4px 9px; }
.ch-react-add.has-label span { font-size: 12px; font-weight: 700; }
.ch-palette button.is-mine { background: var(--teal-100, #E3F7F5); box-shadow: inset 0 0 0 1.5px var(--teal-500, #14B8A6); }

.ch-palette {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 20;
  display: flex; gap: 2px; padding: 5px;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: 999px; box-shadow: 0 10px 26px -12px rgba(11, 35, 33, .35);
}
.ch-palette button {
  width: 36px; height: 36px; border: none; background: transparent; cursor: pointer;
  border-radius: 50%; font-size: 19px; line-height: 1;
  transition: transform 100ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.ch-palette button:hover { transform: scale(1.22); background: var(--surface-50, #F5FBFA); }

.ch-foot { font-size: 12px; line-height: 1.5; color: var(--ink-300, #9DB0AD); text-align: center; margin: 18px 0 0; }

/* --- Pole nadawania --- */
.ch-composer {
  position: sticky; bottom: 0; margin-top: 16px; padding: 12px;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: var(--radius-lg, 20px);
  box-shadow: 0 -6px 20px -14px rgba(11, 35, 33, .3);
}
.ch-composer textarea {
  width: 100%; border: none; resize: vertical; min-height: 68px;
  font: inherit; font-size: 14px; line-height: 1.55; color: var(--ink-900, #0B2321);
  background: transparent; padding: 4px 2px;
}
.ch-composer textarea:focus { outline: none; }
.ch-composer-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.ch-counter { margin-left: auto; font-size: 11.5px; color: var(--ink-300, #9DB0AD); font-variant-numeric: tabular-nums; }
.ch-pin-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-500, #4B615E); cursor: pointer; }
.ch-pin-opt input { width: 16px; height: 16px; accent-color: var(--teal-700, #0E7C74); }

/* --- Menu w modalu (wiadomość, zdjęcie) --- */
.ch-menu { display: flex; flex-direction: column; gap: 2px; }
.ch-menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 12px 14px; border: none; background: transparent; cursor: pointer;
  border-radius: var(--radius-md, 14px);
  font-size: 14px; font-weight: 600; color: var(--ink-900, #0B2321);
}
.ch-menu-item:hover { background: var(--surface-50, #F5FBFA); }
.ch-menu-item.is-danger { color: var(--danger, #E5484D); }
.ch-menu-item.is-danger:hover { background: rgba(229, 72, 77, .07); }

/* --- Panel obsługi --- */
.ch-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 760px) { .ch-cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }

.ch-card {
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: var(--radius-lg, 20px); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.ch-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ch-card-head strong { font-size: 15px; font-weight: 800; display: block; overflow-wrap: anywhere; }
.ch-card-head p { font-size: 12px; color: var(--ink-500, #4B615E); margin: 3px 0 0; }
.ch-card-stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-500, #4B615E); }
.ch-card-stats b { font-size: 15px; font-weight: 800; color: var(--ink-900, #0B2321); }
.ch-card-last {
  font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); margin: 0;
  padding-left: 11px; border-left: 2px solid var(--border, #DCEBE9);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ch-card-last.is-empty { color: var(--ink-300, #9DB0AD); font-style: italic; }
.ch-card-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ------------------------------------------------------------------
   WEJŚCIE DO KANAŁU NA EKRANIE BILETU
   ------------------------------------------------------------------ */
.tk-sec-channel { padding: 0; border: 0; background: transparent; }
.tk-channel {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 15px 17px; cursor: pointer;
  border-radius: var(--radius-lg, 20px);
  border: 1px solid var(--teal-300, #5EEAD4); background: var(--teal-100, #E3F7F5);
  transition: transform 120ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.tk-channel:active { transform: scale(.997); }
.tk-channel:focus-visible { outline: 2px solid var(--teal-500, #14B8A6); outline-offset: 2px; }
.tk-channel-ico {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-700, #0E7C74); color: #fff;
}
.tk-channel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tk-channel-main strong { font-size: 14.5px; font-weight: 800; color: var(--ink-900, #0B2321); overflow-wrap: anywhere; }
.tk-channel-main span { font-size: 12.5px; color: var(--teal-700, #0E7C74); }
.tk-channel-badge {
  flex-shrink: 0; min-width: 24px; height: 24px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--coral-500, #FF6B5B); color: #fff;
  font-size: 12px; font-weight: 800;
}
.tk-channel-chev { flex-shrink: 0; width: 18px; height: 18px; color: var(--teal-700, #0E7C74); }


/* ============================================================
   12. Komentarze pod wiadomościami + podgląd reakcji
   ============================================================ */

/* --- Podsumowanie reakcji („kto dał") --- */
/* Celowo najcichszy element rzędu: przełączenie własnej reakcji to gest codzienny,
   sprawdzenie kto zareagował — okazjonalny. Waga wizualna idzie za częstością użycia. */
.ch-react-who {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: var(--ink-300, #9DB0AD);
  padding: 4px 6px; border-radius: var(--radius-sm, 8px);
}
.ch-react-who:hover { color: var(--teal-700, #0E7C74); background: var(--surface-50, #F5FBFA); }

.ch-who-tabs {
  display: flex; gap: 4px; flex-wrap: wrap; padding-bottom: 12px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border, #DCEBE9);
}
.ch-who-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border, #DCEBE9); background: var(--surface-0, #fff);
  font-size: 13px; color: var(--ink-500, #4B615E);
}
.ch-who-tab b { font-weight: 800; color: var(--ink-900, #0B2321); font-variant-numeric: tabular-nums; }
.ch-who-tab.active { background: var(--teal-100, #E3F7F5); border-color: var(--teal-500, #14B8A6); color: var(--teal-700, #0E7C74); }
.ch-who-tab.active b { color: var(--teal-700, #0E7C74); }

.ch-who-list { max-height: 46vh; overflow-y: auto; margin-top: 4px; }
.ch-who-row {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 2px; border-bottom: 1px solid var(--border, #DCEBE9);
}
.ch-who-row:last-child { border-bottom: 0; }
.ch-who-name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.ch-who-name i { font-style: normal; color: var(--ink-300, #9DB0AD); font-weight: 500; }
.ch-who-emoji { font-size: 17px; line-height: 1; flex-shrink: 0; }

/* --- Pasek pod wiadomością --- */
.ch-msg-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border, #DCEBE9); }
.ch-comments-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; cursor: pointer; padding: 4px 2px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-500, #4B615E);
}
.ch-comments-toggle:hover { color: var(--teal-700, #0E7C74); }
.ch-comments-toggle .ico { color: var(--ink-300, #9DB0AD); }
.ch-comments-toggle:hover .ico { color: var(--teal-700, #0E7C74); }

/* --- Wątek --- */
/* Wcięcie i pionowa kreska po lewej mówią, że to rozmowa POD wiadomością, a nie kolejne
   wiadomości w kanale. Bez tego przy dłuższym wątku ginie różnica między głosem
   organizatora a głosem uczestnika — a w kanale nadawczym to jest cała istota rzeczy. */
.ch-thread {
  margin-top: 10px; padding-left: 14px;
  border-left: 2px solid var(--border, #DCEBE9);
}
.ch-thread-loading { display: flex; justify-content: center; padding: 14px 0; }
.ch-thread-empty { font-size: 12.5px; line-height: 1.5; color: var(--ink-300, #9DB0AD); margin: 8px 0; }
.ch-thread-list { display: flex; flex-direction: column; gap: 12px; }

.ch-comment { display: flex; gap: 10px; }
.ch-comment.is-removed {
  font-size: 12px; font-style: italic; color: var(--ink-300, #9DB0AD); padding: 4px 0;
}
.ch-comment-main { flex: 1; min-width: 0; }
.ch-comment-head { display: flex; align-items: baseline; gap: 8px; }
.ch-comment-head strong { font-size: 12.5px; font-weight: 700; }
.ch-comment-head span { font-size: 11px; color: var(--ink-300, #9DB0AD); }
.ch-comment-del {
  margin-left: auto; border: 0; background: transparent; cursor: pointer; padding: 2px 4px;
  color: var(--ink-300, #9DB0AD); border-radius: var(--radius-sm, 8px);
  opacity: 0; transition: opacity 120ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.ch-comment:hover .ch-comment-del, .ch-comment-del:focus-visible { opacity: 1; }
.ch-comment-del:hover { color: var(--danger, #E5484D); background: rgba(229, 72, 77, .07); }
/* Na dotyku nie ma najechania, więc kosz musi być widoczny od razu. */
@media (hover: none) { .ch-comment-del { opacity: 1; } }

.ch-comment-body {
  font-size: 13.5px; line-height: 1.55; color: var(--ink-900, #0B2321);
  margin-top: 3px; overflow-wrap: anywhere;
}
.ch-comment .ch-reacts { margin-top: 7px; }
.ch-comment .ch-react { padding: 3px 8px; font-size: 12px; }
.ch-comment .ch-react-add { padding: 3px 7px; }
.ch-comment .ch-react-add-ico { width: 15px; height: 15px; }

/* --- Pole komentarza --- */
.ch-comment-form { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; }
.ch-comment-input {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 8px;
  border: 1px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px);
  background: var(--surface-0, #fff); padding: 6px 6px 6px 12px;
  transition: border-color 120ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.ch-comment-input:focus-within { border-color: var(--teal-500, #14B8A6); }
.ch-comment-input textarea {
  flex: 1; min-width: 0; border: 0; background: transparent; resize: none;
  font: inherit; font-size: 13.5px; line-height: 1.5; color: var(--ink-900, #0B2321);
  padding: 6px 0; max-height: 160px;
}
.ch-comment-input textarea:focus { outline: none; }
.ch-comment-input .btn { flex-shrink: 0; }

@media (max-width: 520px) {
  .ch-thread { padding-left: 10px; }
  /* Na wąskim ekranie awatar przy polu zabiera miejsce potrzebne na tekst. */
  .ch-comment-form > .av { display: none; }
}


/* --- Wylogowanie na dole zakładki „Moje konto" --- */
/* Nie jest kartą: to pojedyncza akcja kończąca pracę, a nie sekcja z treścią.
   Odsunięta od strefy zagrożenia większym odstępem, żeby nie czytała się jako jej część. */
.logout-block {
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--border, #DCEBE9);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
}
.logout-action {
  color: var(--danger, #E5484D);
  border-color: rgba(229, 72, 77, .3);
  min-width: 200px; justify-content: center;
}
.logout-action:hover { background: rgba(229, 72, 77, .07); border-color: rgba(229, 72, 77, .5); }
.logout-block p { font-size: 12px; line-height: 1.5; margin: 0; max-width: 44ch; }

@media (max-width: 560px) {
  /* Na telefonie to ostatni element ekranu — pełna szerokość daje pewny cel dla kciuka. */
  .logout-action { width: 100%; min-width: 0; }
}


/* ============================================================
   13. Profil: karta tożsamości i sekcje danych
   ============================================================ */

/* Karta tożsamości odróżnia się od sekcji danych delikatnym tłem, a nie ramką czy cieniem.
   Ma się czytać jako nagłówek strony („to jesteś Ty"), a nie jako pierwszy z serii
   jednakowych bloków — wcześniej wszystkie karty wyglądały identycznie i wzrok nie miał
   się od czego odbić. */
.pf-identity {
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--teal-100, #E3F7F5) 0%, #fff 130px);
  border: 1px solid var(--teal-300, #5EEAD4);
}

/* --- Pigułki stanu konta --- */
/* Tylko dwie rzeczy, które użytkownik faktycznie może musieć naprawić. Oddzielone
   kreską od nazwiska, żeby nie zlewały się z podpisem. */
.pf-pills {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 14px; border-top: 1px solid var(--border, #DCEBE9);
}
.pf-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.pf-pill .ico { width: 14px; height: 14px; flex-shrink: 0; }
.pf-pill.is-ok { background: rgba(31, 181, 116, .12); color: #12805A; }
.pf-pill.is-warn { background: var(--coral-100, #FFEAE6); color: var(--coral-700, #E14A36); }
.pf-pill.is-danger { background: rgba(229, 72, 77, .12); color: var(--danger, #E5484D); }

/* --- Sekcje danych --- */
.pf-sec { margin-top: 16px; }
/* Nagłówek sekcji jest cichy i drobny — to etykieta grupy, nie tytuł treści.
   Ten sam zabieg co przy sekcjach odniesienia na bilecie, żeby system mówił jednym językiem. */
.pf-sec-title {
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-300, #9DB0AD); margin: 0 0 4px;
}
.pf-sec-hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); margin: 0 0 12px; }
.pf-sec-title + .pf-rows { margin-top: 10px; }

.pf-rows { display: flex; flex-direction: column; }
/* Dwie kolumny o stałej szerokości etykiety, a NIE „etykieta do lewej, wartość do prawej".
   Ta druga wersja przy szerokiej karcie rozciąga między nimi kilkanaście centymetrów pustki
   i oko musi za każdym razem przeskoczyć przez całą kartę, żeby połączyć parę.
   Wartości wyrównane do wspólnej krawędzi czytają się jak tabela — czyli tak, jak wygląda
   każdy porządny ekran ustawień. */
.pf-row {
  display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 4px 20px;
  align-items: baseline;
  padding: 11px 0; border-bottom: 1px solid var(--border, #DCEBE9);
}
.pf-row:last-child { border-bottom: 0; padding-bottom: 0; }
.pf-label { font-size: 13px; color: var(--ink-500, #4B615E); }
.pf-value {
  font-size: 13.5px; font-weight: 700; color: var(--ink-900, #0B2321);
  min-width: 0; overflow-wrap: anywhere;
}
/* Brak wartości musi być WIDOCZNY. Wcześniej pusty wiersz znikał, więc telefon,
   którego nikt nie podał, wyglądał tak samo jak pole, którego w ogóle nie ma. */
.pf-value.is-empty { color: var(--ink-300, #9DB0AD); font-weight: 500; font-style: italic; }
/* Wartość do skopiowania: kropkowane podkreślenie mówi „można w to kliknąć" bez dokładania
   przycisku obok każdego takiego pola. */
.pf-value .mono {
  cursor: pointer; border-bottom: 1px dashed var(--ink-300, #9DB0AD); padding-bottom: 1px;
}
.pf-value .mono:hover { color: var(--teal-700, #0E7C74); border-bottom-color: var(--teal-500, #14B8A6); }

.pf-danger { margin-top: 16px; border: 1px solid rgba(229, 72, 77, .25); }
.pf-danger .pf-sec-title { color: var(--danger, #E5484D); }

@media (max-width: 480px) {
  /* Na wąskim ekranie długi adres e-mail dociśnięty do prawej krawędzi łamie się na
     dwie–trzy linijki obok krótkiej etykiety. Ustawienie jeden pod drugim czyta się lepiej. */
  .pf-row { grid-template-columns: 1fr; gap: 3px; }
  /* Adres w podpisie znika: łamał nagłówek na trzy linie, a stoi kilka centymetrów niżej
     w „Danych kontaktowych". Rola zostaje — to ona niesie informację, kim się tu jest. */
  .profile-name .pf-sub i { display: none; }
  .profile-name strong { font-size: 20px; }
}


/* ============================================================
   14. Ekrany ustawień: nagłówek sekcji z akcją, historia logowań
   ============================================================ */

/* Tytuł sekcji i akcja w jednym rzędzie. Wcześniej każdy ekran składał to sobie sam
   z `flex-between` i stylów w atrybucie `style` — stąd trzy różne odstępy w trzech miejscach. */
.pf-sec-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
}
.pf-sec-head > div:first-child { min-width: 0; }
.pf-sec-act { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
/* Podpowiedź pod tytułem ma odstęp tylko wtedy, gdy poniżej faktycznie coś jest. */
.pf-sec-head + .pf-rows, .pf-sec-head + div:not(:empty) { margin-top: 12px; }

@media (max-width: 560px) {
  /* Na telefonie akcje schodzą pod tytuł i biorą pełną szerokość — obok tytułu zostawałoby
     na nie kilka znaków, a to są przyciski, w które trzeba trafić palcem. */
  .pf-sec-act { width: 100%; }
  .pf-sec-act .btn { flex: 1 1 auto; justify-content: center; }
}

/* --- Historia logowań --- */
.log-list { display: flex; flex-direction: column; }
.log-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border, #DCEBE9);
}
.log-row:last-child { border-bottom: 0; padding-bottom: 0; }

/* Kropka po lewej niesie wynik logowania. Udanych jest tu 95%, więc zamiast pigułki przy
   każdym wierszu wystarczy cichy znacznik — a nieudana próba, ta jedna, którą trzeba
   zauważyć, dostaje i czerwoną kropkę, i pigułkę po prawej. */
.log-mark {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px;
  background: rgba(31, 181, 116, .5);
}
.log-row.is-fail .log-mark { background: var(--danger, #E5484D); }

.log-main { flex: 1; min-width: 0; }
.log-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.log-top strong { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.log-meta {
  font-size: 12px; line-height: 1.5; color: var(--ink-500, #4B615E); margin-top: 2px;
  overflow-wrap: anywhere;
}
.log-meta .mono { font-size: 11.5px; }
.log-row .pill { flex-shrink: 0; margin-top: 2px; }

/* --- Wiersz urządzenia --- */
.dev-revoke { color: var(--danger, #E5484D); flex-shrink: 0; }
.dev-revoke:hover { background: rgba(229, 72, 77, .08); }

/* ============================================================
   15. Wyszukiwarka wydarzeń i strona wydarzenia
   ============================================================ */

/* --- Pasek szukania i filtry --- */
.dsc-head { margin-bottom: 16px; }
.dsc-search { margin-bottom: 12px; }
.dsc-search input {
  width: 100%; padding: 12px 14px 12px 38px;
  border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-pill, 999px);
  font-family: inherit; font-size: 14px; color: var(--ink-900, #0B2321); background: var(--surface-0, #fff);
}
.dsc-search input:focus { outline: none; border-color: var(--teal-500, #14B8A6); }
/* Krzyżyk „wyczyść" w polu typu search bywa niewidoczny na jasnym tle Safari. */
.dsc-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Filtry przewijają się poziomo, a nie zawijają: pasek ma zostać jedną linią również wtedy,
   gdy dojdzie do niego kolejna pozycja. */
.dsc-filters {
  display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.dsc-filters::-webkit-scrollbar { display: none; }
.dsc-chip {
  flex-shrink: 0; border: 1.5px solid var(--border, #DCEBE9); background: var(--surface-0, #fff);
  color: var(--ink-500, #4B615E); font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 8px 15px; border-radius: var(--radius-pill, 999px); cursor: pointer;
  transition: background var(--dur-fast, 120ms) var(--ease, ease), color var(--dur-fast, 120ms) var(--ease, ease),
              border-color var(--dur-fast, 120ms) var(--ease, ease);
}
.dsc-chip:hover { border-color: var(--teal-300, #5EEAD4); color: var(--ink-900, #0B2321); }
.dsc-chip.active { background: var(--ink-900, #0B2321); border-color: var(--ink-900, #0B2321); color: #fff; }

.dsc-count { font-size: 12px; color: var(--ink-500, #4B615E); font-weight: 700; margin: 0 0 10px; }

/* --- Kafelki wyników --- */
.dsc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.dsc-card {
  background: var(--surface-0, #fff); border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-lg, 20px);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  box-shadow: var(--shadow-xs, 0 1px 2px rgba(11, 35, 33, .05));
  transition: border-color var(--dur-fast, 120ms) var(--ease, ease), box-shadow var(--dur-base, 200ms) var(--ease, ease),
              transform var(--dur-fast, 120ms) var(--ease, ease);
}
.dsc-card:hover { border-color: var(--teal-300, #5EEAD4); box-shadow: var(--shadow-md, 0 8px 24px rgba(11, 35, 33, .08)); }
.dsc-card:active { transform: scale(.995); }
.dsc-card:focus-visible { outline: 2px solid var(--teal-500, #14B8A6); outline-offset: 2px; }

/* Okładka. Wydarzenie bez zdjęcia dostaje spokojne tło marki zamiast pustej ramki —
   brak zdjęcia jest normalny i nie może wyglądać jak zepsuty obrazek. */
.dsc-cover {
  position: relative; aspect-ratio: 16 / 9; background: var(--gradient-brand, linear-gradient(135deg, #0E7C74, #14B8A6));
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.dsc-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dsc-cover-ico { color: rgba(255, 255, 255, .6); }
/* Bez zdjęcia pasek jest wyraźnie niższy: pełny prostokąt 16:9 wypełniony samym kolorem
   zabierał na telefonie pół ekranu i obiecywał obraz, którego nie ma. */
.dsc-cover:not(.has-photo) { aspect-ratio: 5 / 2; }

/* Data w rogu okładki: przy przeglądaniu listy to pierwsza rzecz, której się szuka wzrokiem,
   a w wierszu opisu ginęła między nazwą a miejscem. */
.dsc-date {
  position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; align-items: center;
  background: rgba(255, 255, 255, .95); color: var(--ink-900, #0B2321);
  border-radius: 12px; padding: 5px 9px 6px; line-height: 1; box-shadow: var(--shadow-sm, 0 4px 12px rgba(11, 35, 33, .06));
}
.dsc-date b { font-size: 17px; font-weight: 800; }
.dsc-date span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500, #4B615E); margin-top: 2px; }

.dsc-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.dsc-body h3 { font-size: 15px; font-weight: 800; margin: 0; line-height: 1.3; letter-spacing: -.01em; }
.dsc-meta { font-size: 12.5px; color: var(--ink-500, #4B615E); margin: 0; }
.dsc-excerpt { font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); margin: 2px 0 0; }

.dsc-flags { display: flex; gap: 6px; flex-wrap: wrap; }
.dsc-flag {
  font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: var(--radius-pill, 999px);
  background: var(--surface-50, #F5FBFA); color: var(--ink-500, #4B615E); white-space: nowrap;
}
.dsc-flag.soon { background: var(--coral-100, #FFEAE6); color: var(--coral-700, #E14A36); }
.dsc-flag.mine { background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74); }

.dsc-foot {
  margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.dsc-price { font-size: 14px; font-weight: 800; color: var(--ink-900, #0B2321); }
.dsc-seats { font-size: 11.5px; font-weight: 700; color: var(--ink-500, #4B615E); }
.dsc-seats.low { color: var(--coral-700, #E14A36); }
.dsc-seats.off { color: var(--ink-300, #9DB0AD); }

/* --- Strona wydarzenia --- */
.evp-hero {
  position: relative; border-radius: var(--radius-lg, 20px); overflow: hidden; margin-bottom: 14px;
  background: var(--gradient-brand, linear-gradient(135deg, #0E7C74, #14B8A6)); color: #fff;
  min-height: 150px; display: flex; align-items: flex-end;
}
.evp-hero.has-photo { min-height: 220px; }
.evp-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Przyciemnienie TYLKO pod tekstem, nie na całym zdjęciu: górna połowa plakatu zostaje
   czytelna, a nazwa na dole i tak ma pod sobą pełny kontrast. */
.evp-hero.has-photo::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11, 35, 33, .88) 0%, rgba(11, 35, 33, .55) 42%, rgba(11, 35, 33, 0) 78%);
}
.evp-hero-in { position: relative; z-index: 1; padding: 20px 22px; width: 100%; }
.evp-hero-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.evp-hero.has-photo .dsc-flag { background: rgba(255, 255, 255, .2); color: #fff; }
.evp-hero h2 { font-size: 22px; font-weight: 800; margin: 0 0 8px; line-height: 1.2; letter-spacing: -.015em; }
.evp-hero-meta { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: rgba(255, 255, 255, .9); }
.evp-hero-meta span { display: flex; align-items: center; gap: 7px; }

/* Bilet, który już mam — stoi wysoko, bo jest ważniejszy niż cokolwiek do kupienia niżej. */
.evp-mine {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--teal-100, #E3F7F5); border-radius: var(--radius-md, 14px); padding: 13px 16px; margin-bottom: 14px;
}
.evp-mine strong { display: block; font-size: 13.5px; color: var(--teal-900, #08403B); }
.evp-mine span { font-size: 12px; color: var(--ink-500, #4B615E); }

.evp-sec { margin-bottom: 20px; }
.evp-sec h3 { font-size: 13px; font-weight: 800; margin: 0 0 10px; color: var(--ink-900, #0B2321); }
.evp-sec-quiet h3 { color: var(--ink-500, #4B615E); }
.evp-hint { font-size: 12px; color: var(--ink-500, #4B615E); line-height: 1.5; margin: 8px 0 0; }

.evp-desc { font-size: 13.5px; line-height: 1.65; color: var(--ink-700, #23403D); }
.evp-desc p { margin: 0 0 10px; }
.evp-desc p:last-child { margin-bottom: 0; }

/* Galeria: rząd miniatur przewijany kciukiem. Pełne zdjęcie ogląda się w podglądzie. */
.evp-gallery {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.evp-gallery::-webkit-scrollbar { display: none; }
.evp-thumb {
  flex: 0 0 auto; width: 128px; height: 92px; padding: 0; border: none; border-radius: var(--radius-md, 14px);
  overflow: hidden; cursor: pointer; background: var(--ink-100, #DCEBE9);
  transition: transform var(--dur-fast, 120ms) var(--ease, ease);
}
.evp-thumb:hover { transform: translateY(-2px); }
.evp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.evp-agenda { display: flex; flex-direction: column; }
.evp-agenda-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border, #DCEBE9); }
.evp-agenda-row:last-child { border-bottom: 0; }
.evp-agenda-time { flex: 0 0 46px; font-size: 12.5px; font-weight: 800; color: var(--teal-700, #0E7C74); font-variant-numeric: tabular-nums; }
.evp-agenda-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.evp-agenda-main strong { font-size: 13.5px; font-weight: 700; }
.evp-agenda-main span { font-size: 12px; color: var(--ink-500, #4B615E); }

/* Rodzaje biletów */
.evp-tt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface-0, #fff); border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px);
  padding: 14px 16px; margin-bottom: 10px;
}
.evp-tt.is-off { background: var(--surface-50, #F5FBFA); border-style: dashed; }
.evp-tt-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.evp-tt-main strong { font-size: 14px; font-weight: 800; }
.evp-tt-main span { font-size: 12.5px; color: var(--ink-500, #4B615E); }
.evp-tt-desc { font-size: 12px; line-height: 1.45; color: var(--ink-300, #9DB0AD); }
.evp-tt-off { font-size: 12px; font-weight: 700; color: var(--ink-300, #9DB0AD); flex-shrink: 0; }

.evp-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--border, #DCEBE9); font-size: 13px;
}
.evp-row:last-child { border-bottom: 0; }
.evp-row span { color: var(--ink-500, #4B615E); }
.evp-row strong { font-weight: 700; text-align: right; overflow-wrap: anywhere; }

.evp-channel {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface-0, #fff); border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px); padding: 13px 15px;
  font-family: inherit; color: var(--ink-900, #0B2321);
}
.evp-channel:hover { border-color: var(--teal-300, #5EEAD4); }
.evp-channel-ico {
  width: 38px; height: 38px; border-radius: 11px; background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.evp-channel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.evp-channel-main strong { font-size: 13.5px; }
.evp-channel-main span { font-size: 12px; color: var(--ink-500, #4B615E); }
.evp-channel > .ico { color: var(--ink-300, #9DB0AD); flex-shrink: 0; }

/* --- Dla kogo jest bilet (PanelCore.holderFormHtml) --- */
.holder-pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.holder-opt {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px);
  padding: 12px 14px; background: var(--surface-0, #fff); transition: border-color .16s, background .16s;
}
.holder-opt.is-on { border-color: var(--teal-500, #14B8A6); background: var(--teal-100, #E3F7F5); }
.holder-opt input[type="radio"] { margin-top: 2px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--teal-700, #0E7C74); }
.holder-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.holder-opt strong { font-size: 13.5px; font-weight: 800; }
.holder-opt em { font-style: normal; font-size: 12px; color: var(--ink-500, #4B615E); line-height: 1.45; }
.holder-fields { margin-top: 10px; }
.holder-fields.is-hidden { display: none; }
.holder-fields .field { margin-bottom: 10px; }
.holder-hint { font-size: 11.5px; line-height: 1.5; color: var(--ink-500, #4B615E); margin: 0; }
/* Pytanie o pelnoletnosc uczestnika - ten sam uklad co przy zakladaniu konta
   (dwie opcje obok siebie), zeby oba formularze pytaly o to samo tak samo. */
.holder-age { display: flex; gap: 18px; padding: 4px 0 2px; }
.holder-age-opt { display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ink-900, #0B2321); }
.holder-age-opt input[type="radio"] { width: 17px; height: 17px; margin: 0;
  accent-color: var(--teal-700, #0E7C74); cursor: pointer; }
.holder-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700;
  color: var(--teal-700, #0E7C74); background: var(--teal-100, #E3F7F5);
  border-radius: 999px; padding: 2px 9px;
}

/* Okno potwierdzenia zakupu */
.evp-modal-lead { font-size: 14px; font-weight: 800; margin: 0 0 12px; }
.evp-modal-sum { background: var(--surface-50, #F5FBFA); border-radius: var(--radius-md, 14px); padding: 12px 14px; margin-bottom: 12px; }
.evp-modal-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 13px; }
.evp-modal-sum span { color: var(--ink-500, #4B615E); }
.evp-modal-note { font-size: 12.5px; line-height: 1.55; color: var(--ink-500, #4B615E); margin: 0 0 8px; }

/* --- Podgląd zdjęcia na pełnym ekranie --- */
html.evp-lb-open, html.evp-lb-open body { overflow: hidden; }
.evp-lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(6, 20, 19, .94);
  display: flex; align-items: center; justify-content: center;
  padding: max(48px, env(safe-area-inset-top)) 16px max(48px, env(safe-area-inset-bottom));
}
.evp-lb-fig { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.evp-lb-fig img { max-width: 100%; max-height: 74vh; border-radius: var(--radius-md, 14px); display: block; }
.evp-lb-fig figcaption { color: rgba(255, 255, 255, .82); font-size: 12.5px; text-align: center; max-width: 620px; }
.evp-lb-close, .evp-lb-nav {
  position: absolute; border: none; background: rgba(255, 255, 255, .12); color: #fff;
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.evp-lb-close:hover, .evp-lb-nav:hover { background: rgba(255, 255, 255, .22); }
.evp-lb-close { top: max(12px, env(safe-area-inset-top)); right: 14px; }
.evp-lb-nav.prev { left: 12px; }
.evp-lb-nav.prev .ico { transform: rotate(180deg); }
.evp-lb-nav.next { right: 12px; }
.evp-lb-count { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .7); font-size: 12px; font-weight: 700; }

/* --- Panel organizatora: zakładka „Strona wydarzenia" --- */
.evp-admin-cover {
  border-radius: var(--radius-md, 14px); overflow: hidden; background: var(--surface-50, #F5FBFA);
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
}
.evp-admin-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evp-admin-cover.is-empty {
  flex-direction: column; gap: 8px; color: var(--ink-300, #9DB0AD); font-size: 12.5px; font-weight: 700;
  border: 1.5px dashed var(--border, #DCEBE9);
}
.evp-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.evp-admin-photo { position: relative; margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius-sm, 8px); overflow: hidden; background: var(--ink-100, #DCEBE9); }
.evp-admin-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evp-admin-del {
  position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(11, 35, 33, .62); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.evp-admin-del:hover { background: var(--danger, #E5484D); }

@media (max-width: 560px) {
  .dsc-grid { grid-template-columns: 1fr; }
  .evp-hero h2 { font-size: 19px; }
  .evp-mine { align-items: flex-start; flex-direction: column; }
  .evp-mine .btn { width: 100%; justify-content: center; }
  /* Na telefonie cena i przycisk idą pod nazwą biletu — obok zostawałoby na nie kilka znaków. */
  .evp-tt { align-items: stretch; }
  .evp-tt .btn { width: 100%; justify-content: center; }
  .evp-lb-nav { bottom: max(52px, env(safe-area-inset-bottom)); top: auto; }
}
/* ===================================================================
   Legitymacja uczestnika — jeden kod QR konta
   =================================================================== */

/* Wyróżniony przycisk „Kod QR" w górnym pasku (desktop). Wypełniony, nie obrysowany:
   w rzędzie tekstowych zakładek to jedyny sposób, żeby wyłowić go bez czytania. */
.topnav .tab.is-center {
  background: var(--ink-900, #0B2321);
  color: #fff;
  border-radius: 999px;
  padding-left: 16px;
  padding-right: 16px;
}
.topnav .tab.is-center:hover { background: var(--teal-700, #0E7C74); }
.topnav .tab.is-center.active { background: var(--teal-700, #0E7C74); color: #fff; }

.pass-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 460px; margin: 0 auto; }

/* Karta legitymacji. Ciemna z premedytacją: przy bramce liczy się kontrast kodu, a ciemne
   tło odróżnia ten ekran od reszty aplikacji na tyle, że widać go kątem oka w kolejce. */
.pass-card {
  background: linear-gradient(160deg, #0B2321 0%, #0E7C74 140%);
  border-radius: var(--radius-lg, 20px);
  padding: 20px 18px 18px;
  color: #fff;
  box-shadow: 0 18px 40px rgba(11, 35, 33, .28);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.pass-skel { min-height: 300px; display: flex; align-items: center; justify-content: center; }

.pass-head { display: flex; align-items: center; gap: 12px; width: 100%; }
.pass-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pass-who strong { font-size: 15px; font-weight: 800; }
.pass-who span { font-size: 11.5px; color: rgba(255, 255, 255, .72); }

/* Sam kod na białym polu — czytniki radzą sobie z ciemnym motywem gorzej, a bramka to
   nie miejsce na eksperymenty z kontrastem. */
.pass-qr {
  width: 100%; max-width: 260px; aspect-ratio: 1 / 1;
  background: var(--surface-0, #fff); border: none; border-radius: var(--radius-md, 16px);
  display: flex; align-items: center; justify-content: center; padding: 14px;
  cursor: pointer; transition: opacity .18s;
}
.pass-qr canvas, .pass-qr img { width: 100% !important; height: auto !important; display: block; }
.pass-qr.is-busy { opacity: .45; }
.pass-qr-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--ink-500, #4B615E); font-size: 12.5px; text-align: center; padding: 12px;
}
.pass-qr-state.is-error { color: var(--danger, #E5484F); }
.pass-qr-retry { font-size: 11px; color: var(--ink-300, #9DB0AD); }

.pass-timer { width: 100%; max-width: 260px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.pass-timer .bar-bg { width: 100%; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.pass-timer .bar-fill { height: 100%; background: var(--surface-0, #fff); border-radius: 999px; transition: width 1s linear; }
.pass-timer span { font-size: 11.5px; color: rgba(255, 255, 255, .78); font-variant-numeric: tabular-nums; }

/* Do czego odnosi się kod — ostatnia linijka na karcie, żeby uczestnik zdążył wyłapać
   pomyłkę zanim ktoś zeskanuje. */
.pass-target {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: rgba(255, 255, 255, .12); border-radius: var(--radius-md, 14px);
  padding: 10px 12px; font-size: 12.5px; line-height: 1.4;
}
.pass-target.is-set { background: rgba(255, 255, 255, .2); }
.pass-target .ico { flex-shrink: 0; }
.pass-target strong { font-weight: 800; }

.pass-sec { background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); border-radius: var(--radius-lg, 18px); padding: 16px; }
.pass-sec h3 { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.pass-hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-500, #4B615E); margin: 0 0 12px; }

.pass-opts { display: flex; flex-direction: column; gap: 8px; }
.pass-opt {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  background: var(--surface-0, #fff); border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px);
  padding: 12px 13px; cursor: pointer; font-family: inherit; color: var(--ink-900, #0B2321);
  transition: border-color .16s, background .16s;
}
.pass-opt:hover:not(:disabled) { border-color: var(--teal-300, #5EEAD4); }
.pass-opt.is-on { border-color: var(--teal-500, #14B8A6); background: var(--teal-100, #E3F7F5); }
.pass-opt.is-off { opacity: .55; cursor: not-allowed; }

/* Znacznik wyboru rysowany CSS-em, nie radiem: to lista przycisków, a nie formularz —
   wybór zapisuje się natychmiast i nie ma czego zatwierdzać. */
.pass-opt-mark {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; margin-top: 1px;
  border: 2px solid var(--ink-300, #9DB0AD); position: relative;
}
.pass-opt.is-on .pass-opt-mark { border-color: var(--teal-700, #0E7C74); }
.pass-opt.is-on .pass-opt-mark::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--teal-700, #0E7C74);
}
.pass-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pass-opt-body strong { font-size: 13.5px; font-weight: 700; }
.pass-opt-body span { font-size: 12px; color: var(--ink-500, #4B615E); line-height: 1.4; }

/* Skrót z ekranu biletu do legitymacji. */
.tk-code-cta {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--ink-900, #0B2321); color: #fff; border: none;
  border-radius: var(--radius-md, 14px); padding: 14px 16px; cursor: pointer;
  font-family: inherit; text-align: left;
}
.tk-code-cta:hover { background: var(--teal-700, #0E7C74); }
.tk-code-cta .ico { flex-shrink: 0; }
.tk-code-cta span { display: flex; flex-direction: column; gap: 2px; }
.tk-code-cta strong { font-size: 14px; font-weight: 800; }
.tk-code-cta em { font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, .75); line-height: 1.4; }

@media (max-width: 760px) {
  .pass-wrap { max-width: none; }
}

/* ===================================================================
   Regulaminy — wydarzenia i systemu
   =================================================================== */

/* Treść regulaminu na stronie wydarzenia. Ograniczona wysokość z własnym przewijaniem:
   regulamin bywa długi, a jest jedną z kilku sekcji strony, nie jej treścią główną. */
.evp-terms {
  max-height: 260px; overflow-y: auto;
  background: var(--surface-50, #F5FBFA); border-radius: var(--radius-md, 14px);
  padding: 14px 16px; font-size: 13px; line-height: 1.62; color: var(--ink-700, #2E4643);
}
.evp-terms h2, .evp-terms h3 { font-size: 13.5px; font-weight: 800; margin: 14px 0 6px; color: var(--ink-900, #0B2321); }
.evp-terms h2:first-child, .evp-terms h3:first-child { margin-top: 0; }
.evp-terms p { margin: 0 0 9px; }
.evp-terms ul { margin: 0 0 9px; padding-left: 18px; }
.evp-terms li { margin-bottom: 3px; }
.evp-terms-note { font-size: 11.5px; color: var(--ink-300, #9DB0AD); margin: 10px 0 0; }

/* Zgoda w oknie odbioru biletu. `is-missing` zapala ramkę po nieudanej próbie zapisu —
   sam komunikat toast znika, a pytanie zostaje bez wskazania, czego dotyczy. */
.evp-terms-accept {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  border: 1.5px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px);
  padding: 12px 14px; margin-bottom: 12px; font-size: 12.5px; line-height: 1.5;
}
.evp-terms-accept input { margin-top: 1px; width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--teal-700, #0E7C74); }
.evp-terms-accept a { color: var(--teal-700, #0E7C74); font-weight: 700; }
.evp-terms-accept.is-missing { border-color: var(--danger, #E5484D); background: rgba(229, 72, 77, .06); }

/* Podgląd regulaminu systemu w panelu super-administratora. */
.doc-preview { font-size: 13.5px; line-height: 1.65; color: var(--ink-700, #2E4643); }
.doc-preview h2 { font-size: 16px; font-weight: 800; margin: 20px 0 8px; color: var(--ink-900, #0B2321); }
.doc-preview h3 { font-size: 14px; font-weight: 800; margin: 18px 0 6px; color: var(--teal-700, #0E7C74); }
.doc-preview h2:first-child, .doc-preview h3:first-child { margin-top: 0; }
.doc-preview p { margin: 0 0 10px; }
.doc-preview ul { margin: 0 0 12px; padding-left: 20px; }
.doc-preview li { margin-bottom: 4px; }

/* ===================================================================
   Rozdzielnia „Więcej" / „Profil" — poziome bloki
   =================================================================== */

/* Rozdzielnia ma szerokość MENU, nie tabeli. Rozciągnięta na całą szerokość desktopu
   dawała 56-pikselowy pasek z ikoną przy jednej krawędzi i strzałką przy drugiej —
   czyli długą drogę myszy do celu, który na telefonie leży pod kciukiem. */
.more-wrap { max-width: 620px; }

/* Karta tożsamości jest teraz KRÓTKA: odpowiada wyłącznie na pytanie „czyje to konto
   i w jakim jest stanie". Szczegóły zeszły do „Dane konta". */
.more-identity { margin-bottom: 16px; }

.more-group { margin-bottom: 18px; }
.more-group h3 {
  margin: 0 0 8px; padding-left: 2px;
  font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-300, #9DB0AD);
}

/* Blok. Wysokość celowo NIŻSZA niż w kartach na innych ekranach (56 px zamiast ~72 px):
   przy dziewięciu pozycjach każde 16 px różnicy decyduje o tym, czy lista mieści się
   na jednym ekranie telefonu, czy wymaga przewijania w poszukiwaniu ostatniej pozycji. */
.more-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 56px; padding: 9px 14px; margin-bottom: 6px;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9);
  border-radius: var(--radius-md, 14px);
  font-family: inherit; text-align: left; color: var(--ink-900, #0B2321);
  cursor: pointer; transition: border-color .16s, background .16s, transform .1s;
}
.more-row:last-child { margin-bottom: 0; }
.more-row:hover { border-color: var(--teal-300, #5EEAD4); background: var(--surface-50, #F5FBFA); }
.more-row:active { transform: scale(.995); }
.more-row:focus-visible { outline: 2px solid var(--teal-500, #14B8A6); outline-offset: 2px; }

.more-ico {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
}
.more-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.more-text strong { font-size: 14px; font-weight: 700; line-height: 1.3; }
/* Opis jest jednolinijkowy i ucinany: przy dziewięciu blokach druga linijka w każdym
   z nich rozciąga listę o pół ekranu, nie dokładając niczego, czego nie widać na ekranie
   docelowym. */
.more-text span {
  font-size: 12px; line-height: 1.35; color: var(--ink-500, #4B615E);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.more-chev { color: var(--ink-300, #9DB0AD); flex-shrink: 0; }

/* Licznik nieprzeczytanych. Pusty element nie zajmuje miejsca, więc bloki bez plakietki
   wyglądają dokładnie tak samo jak przed dociągnięciem liczby. */
.more-badge { display: none; }
.more-badge.is-on {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--coral-500, #FF6B5B); color: #fff;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}

/* Wylogowanie — jedyny blok, który kończy pracę z systemem. */
.more-row.is-danger .more-ico { background: rgba(229, 72, 77, .1); color: var(--danger, #E5484D); }
.more-row.is-danger strong { color: var(--danger, #E5484D); }
.more-row.is-danger:hover { border-color: rgba(229, 72, 77, .35); background: rgba(229, 72, 77, .04); }

@media (max-width: 420px) {
  .more-row { padding: 8px 12px; gap: 10px; min-height: 54px; }
  .more-ico { width: 34px; height: 34px; border-radius: 10px; }
}

/* ============================================================
   Bez przypadkowego powiekszania ekranu na telefonie
   ============================================================

   Trzy osobne rzeczy powodowaly, ze panel na telefonie "skakal":

   1. iOS Safari (takze w trybie aplikacji) POWIEKSZA strone przy wejsciu w pole
      formularza, jesli pole ma czcionke mniejsza niz 16 px - i po wyjsciu z pola
      NIE wraca do poprzedniej skali. Formularze panelu mialy 13,5 px, wiec kazde
      wpisanie czegokolwiek zostawialo interfejs przyblizony i przesuniety w bok.
      Dlatego na dotyku wymuszamy 16 px - to jedyny prog, ktory iOS uznaje.

   2. Podwojne stukniecie w przycisk albo zakladke uruchamialo zoom przegladarki
      zamiast akcji. `touch-action: manipulation` wylacza gest podwojnego stukniecia,
      zostawiajac przewijanie i zwykle klikniecia.

   3. Reszta (szczypanie dwoma palcami) jest wylaczona meta-tagiem `user-scalable=no`
      w powlokach panelu, a na iOS dodatkowo w public/js/viewport-lock.js, bo Safari
      ten meta-tag ignoruje.

   `!important` jest tu potrzebne, nie ozdobne: czesc pol panel rysuje z JS-a razem
   z atrybutem `style`, ktory bije kazdy selektor bez tego znacznika. */

@media (max-width: 900px), (pointer: coarse) {
  input[type=text], input[type=email], input[type=tel], input[type=number],
  input[type=date], input[type=datetime-local], input[type=time], input[type=url],
  input[type=search], input[type=password], input:not([type]),
  select, textarea {
    font-size: 16px !important;
  }

  /* Pola z wlasna typografia w tym pliku - ta sama zasada, ten sam prog. */
  .ch-composer textarea,
  .ch-comment-input textarea,
  .dsc-search input { font-size: 16px !important; }

  /* Zoom od podwojnego stukniecia. Wyliczone zamiast `*`, zeby nie ruszac obszarow,
     ktore same obsluguja gesty (podglad zdjecia w galerii wydarzenia). */
  a, button, .btn, .tab, .subtab, .mobnav-item, .more-row, .card,
  input, select, textarea, label, [role="button"] {
    touch-action: manipulation;
  }
}

/* ============================================================
   Pytania organizatora (pola dodatkowe przy bilecie)
   ============================================================

   Definicje przychodzą z serwera, więc panel rysuje coś, czego nie zna z góry — stąd
   osobny blok stylów zamiast dopisywania klas przy każdym użyciu. Pola same w sobie są
   zwykłymi kontrolkami formularza (dziedziczą wygląd z panel.css), tutaj zostaje ramka
   i podsumowanie odpowiedzi. */

.evfields {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--border, #DCEBE9);
  border-radius: var(--radius-md, 14px);
  background: var(--surface-50, #F7FBFA);
}
.evfields .field:last-child { margin-bottom: 0; }

/* Odpowiedzi w liście uczestników i na bilecie: para etykieta/wartość, czytana wzrokiem
   w pionie. Wartość jest ważniejsza od pytania, więc to ona ma pełny kontrast. */
.evf-summary { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.evf-summary > div {
  display: flex; gap: 12px; align-items: baseline; justify-content: space-between;
  padding-bottom: 7px; border-bottom: 1px solid var(--border, #DCEBE9);
}
.evf-summary > div:last-child { border-bottom: 0; padding-bottom: 0; }
.evf-summary dt {
  font-size: 12px; font-weight: 600; color: var(--ink-500, #4B615E);
  flex-shrink: 0; max-width: 55%;
}
.evf-summary dd {
  margin: 0; font-size: 13px; font-weight: 700; color: var(--ink-900, #0B2321);
  text-align: right; word-break: break-word;
}

/* ---------- Płatność na ekranie biletu uczestnika (paymentBox) ----------
   Karta ma dwa stany: przed pierwszą wpłatą jest instrukcją „jak zapłacić", a po wpłacie —
   potwierdzeniem „ile doszło i ile zostało". Największą liczbą jest zawsze ta, po którą
   człowiek tu wszedł: kwota, którą ma jeszcze wysłać. */
.upay-card { margin-top: 10px; background: var(--surface-50, #F5FBFA); box-shadow: none; border: 1px solid var(--border, #DCE9E7); }
.upay-title { font-size: 12px; display: block; margin-bottom: 10px; }

.upay-head { background: var(--surface-0, #fff); border: 1px solid var(--border, #DCE9E7); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.upay-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.upay-head-row span { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-500, #4B615E); }
/* `tabular-nums`: kwota nie zmienia szerokości między odświeżeniami listy biletów. */
.upay-head-row strong { font-size: 22px; font-weight: 800; line-height: 1.15; color: var(--coral-700, #C2410C); font-variant-numeric: tabular-nums; }
.upay-head.is-clear .upay-head-row strong { color: var(--teal-700, #0E7C74); }
.upay-head-sub { margin-top: 4px; font-size: 11.5px; color: var(--ink-500, #4B615E); }

.upay-log-label { font-size: 11.5px; font-weight: 800; color: var(--ink-700, #2B403D); margin: 2px 0 6px; }
.upay-log { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.upay-log li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  background: var(--surface-0, #fff); border: 1px solid var(--border, #DCE9E7); border-radius: 10px; padding: 7px 10px; }
.upay-log-amount { font-size: 13.5px; font-weight: 800; color: var(--teal-700, #0E7C74); font-variant-numeric: tabular-nums; white-space: nowrap; }
.upay-log-when { font-size: 11.5px; color: var(--ink-500, #4B615E); text-align: right; }
.upay-log li.is-deleted .upay-log-amount { color: var(--ink-300, #9DB0AD); text-decoration: line-through; }
.upay-log li.is-deleted .upay-log-when b { color: var(--danger, #E5484D); font-weight: 800; }


/* ============================================================
   13. Kanały: formatowanie, załączniki, ankiety, statystyki odczytu
   ============================================================ */

/* --- Treść z formatowaniem --- */
.ch-msg-body a, .ch-pinned-body a { color: var(--teal-700, #0E7C74); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.ch-msg-body strong, .ch-pinned-body strong { font-weight: 800; }
.ch-md-list { margin: 6px 0; padding-left: 22px; }
.ch-md-list li { margin: 2px 0; }
.ch-md-list li::marker { color: var(--teal-700, #0E7C74); }

/* --- Pasek formatowania nad polem --- */
.ch-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 0 0 8px; margin-bottom: 6px; border-bottom: 1px solid var(--border, #DCEBE9); }
.ch-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 34px; height: 32px; padding: 0 8px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-500, #4B615E); cursor: pointer;
  font-size: 14px; font-family: inherit;
}
.ch-tool:hover { background: var(--surface-50, #F5FBFA); color: var(--teal-700, #0E7C74); }
.ch-tool b, .ch-tool i { font-size: 15px; line-height: 1; }
.ch-tool-wide span { font-size: 12.5px; font-weight: 700; }
.ch-tool-sep { width: 1px; height: 20px; background: var(--border, #DCEBE9); margin: 0 6px; }
.ch-fmt-help { border: 0; background: transparent; padding: 0; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--ink-300, #9DB0AD); text-decoration: underline; text-underline-offset: 2px; }
.ch-fmt-help:hover { color: var(--teal-700, #0E7C74); }
@media (max-width: 520px) {
  .ch-tool-wide span { display: none; }
  .ch-fmt-help { display: none; }
}

.ch-fmt-table { display: grid; gap: 6px; }
.ch-fmt-table div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-50, #F5FBFA); font-size: 13px; }
.ch-fmt-table code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink-900, #0B2321); }
.ch-fmt-table span { color: var(--ink-500, #4B615E); text-align: right; }

/* --- Szkic dodatków w polu nadawania --- */
.ch-draft { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ch-draft[hidden] { display: none; }
.ch-draft-files { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-draft-file {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 5px 8px 5px 5px; border: 1px solid var(--border, #DCEBE9); border-radius: 12px; background: var(--surface-50, #F5FBFA);
}
.ch-draft-file img, .ch-draft-pdf { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ch-draft-pdf { display: flex; align-items: center; justify-content: center; background: var(--surface-0, #fff); color: var(--coral-500, #FF6B5B); }
.ch-draft-file.is-uploading { opacity: .65; }
.ch-draft-name { font-size: 12px; color: var(--ink-700, #29423F); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-draft-spin { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.ch-draft-x {
  flex-shrink: 0; width: 24px; height: 24px; border: 0; border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--ink-300, #9DB0AD); font-size: 18px; line-height: 1;
}
.ch-draft-x:hover { background: rgba(229, 72, 77, .08); color: var(--danger, #E5484D); }
.ch-draft-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 11px;
  border: 1px solid var(--teal-300, #5EEAD4); border-radius: 12px; background: var(--teal-100, #E3F7F5);
  color: var(--teal-700, #0E7C74); font-size: 12.5px;
}
.ch-draft-chip > span { flex: 1; min-width: 0; color: var(--ink-900, #0B2321); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-draft-chip i { font-style: normal; color: var(--ink-500, #4B615E); }
.ch-draft-edit { border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--teal-700, #0E7C74); padding: 2px 4px; }

/* --- Załączniki w wiadomości --- */
.ch-gallery { display: grid; gap: 4px; margin-top: 10px; border-radius: var(--radius-md, 14px); overflow: hidden; }
.ch-gallery.is-1 { grid-template-columns: 1fr; }
.ch-gallery.is-2, .ch-gallery.is-4 { grid-template-columns: 1fr 1fr; }
.ch-gallery.is-3 { grid-template-columns: 1fr 1fr 1fr; }
.ch-gallery-item { display: block; padding: 0; border: 0; cursor: zoom-in; background: var(--surface-50, #F5FBFA); aspect-ratio: 1 / 1; overflow: hidden; }
.ch-gallery.is-1 .ch-gallery-item { max-height: 420px; aspect-ratio: 4 / 3; }
.ch-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 160ms var(--ease, cubic-bezier(.4, 0, .2, 1)); }
.ch-gallery-item:hover img { transform: scale(1.02); }

.ch-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ch-file {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border: 1px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px);
  background: var(--surface-50, #F5FBFA); text-decoration: none; color: inherit;
}
.ch-file:hover { border-color: var(--teal-300, #5EEAD4); }
.ch-file-ico { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--surface-0, #fff); color: var(--coral-500, #FF6B5B); }
.ch-file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ch-file-main strong { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-file-main span { font-size: 11.5px; color: var(--ink-500, #4B615E); }
.ch-file-go { font-size: 12px; font-weight: 800; color: var(--teal-700, #0E7C74); flex-shrink: 0; }

/* Podgląd zdjęcia */
.ch-viewer-modal { max-width: min(960px, 96vw) !important; width: 100%; }
.ch-viewer { position: relative; display: flex; align-items: center; justify-content: center; background: #0B2321; border-radius: 12px; min-height: 200px; }
.ch-viewer img { max-width: 100%; max-height: 72vh; display: block; }
.ch-viewer-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9); color: var(--ink-900, #0B2321); font-size: 24px; line-height: 1; cursor: pointer;
}
.ch-viewer-nav.is-prev { left: 10px; }
.ch-viewer-nav.is-next { right: 10px; }
.ch-viewer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--ink-500, #4B615E); }

/* --- Przycisk akcji --- */
.ch-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px;
  padding: 11px 16px; border-radius: 999px; text-decoration: none;
  background: var(--teal-700, #0E7C74); color: #fff; font-size: 14px; font-weight: 700;
  transition: transform 120ms var(--ease, cubic-bezier(.4, 0, .2, 1)), background 120ms;
}
.ch-cta:hover { background: var(--teal-900, #0B5F59); }
.ch-cta:active { transform: scale(.99); }
.ch-cta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ch-edit-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-50, #F5FBFA); font-size: 13px; color: var(--ink-700, #29423F); }

/* --- Ankiety i potwierdzenia --- */
.ch-poll { margin-top: 12px; padding: 14px; border: 1px solid var(--border, #DCEBE9); border-radius: var(--radius-md, 14px); background: var(--surface-50, #F5FBFA); }
.ch-poll-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--teal-700, #0E7C74); }
.ch-poll-q { font-size: 15px; font-weight: 800; line-height: 1.4; margin: 6px 0 12px; color: var(--ink-900, #0B2321); overflow-wrap: anywhere; }
.ch-poll-opts { display: flex; flex-direction: column; gap: 7px; }
.ch-poll-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 11px 14px; border: 1.5px solid var(--border, #DCEBE9); border-radius: 12px;
  background: var(--surface-0, #fff); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-900, #0B2321);
}
.ch-poll-opt:hover { border-color: var(--teal-500, #14B8A6); background: var(--teal-100, #E3F7F5); }
.ch-poll-opt:disabled { opacity: .6; cursor: wait; }
.ch-poll-opt.is-check input { width: 18px; height: 18px; accent-color: var(--teal-700, #0E7C74); flex-shrink: 0; }
.ch-poll-submit { margin-top: 10px; }

.ch-poll-results { display: flex; flex-direction: column; gap: 7px; }
.ch-poll-bar {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 13px; border-radius: 12px; background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); overflow: hidden;
}
.ch-poll-fill { position: absolute; inset: 0 auto 0 0; background: var(--teal-100, #E3F7F5); transition: width 400ms var(--ease, cubic-bezier(.4, 0, .2, 1)); }
.ch-poll-bar.is-top .ch-poll-fill { background: rgba(20, 184, 166, .22); }
.ch-poll-bar.is-mine { border-color: var(--teal-500, #14B8A6); }
.ch-poll-label, .ch-poll-pct { position: relative; font-size: 13.5px; }
.ch-poll-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-900, #0B2321); min-width: 0; overflow-wrap: anywhere; }
.ch-poll-label .ico { color: var(--teal-700, #0E7C74); flex-shrink: 0; }
.ch-poll-pct { font-weight: 800; color: var(--ink-700, #29423F); font-variant-numeric: tabular-nums; flex-shrink: 0; }

.ch-poll-meta { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--ink-500, #4B615E); }
.ch-poll-meta b { color: var(--ink-900, #0B2321); font-weight: 800; }
.ch-poll-note { font-size: 13px; line-height: 1.5; color: var(--ink-500, #4B615E); margin: 0; }
.ch-poll-note:empty { display: none; }
.ch-poll-link { border: 0; background: transparent; padding: 0; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--teal-700, #0E7C74); text-decoration: underline; text-underline-offset: 2px; margin-top: 8px; }
.ch-poll-meta .ch-poll-link { margin-top: 0; margin-left: auto; }
.ch-poll-staff { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border, #DCEBE9); }

.ch-poll.is-confirm { border-color: var(--teal-300, #5EEAD4); background: var(--teal-100, #E3F7F5); }
.ch-poll.is-confirm .ch-poll-q { margin-bottom: 12px; }
.ch-confirm-btn { width: 100%; justify-content: center; }
.ch-confirm-done { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 999px; background: var(--surface-0, #fff); color: var(--teal-700, #0E7C74); font-size: 14px; font-weight: 800; }
.ch-confirm-done .ico { width: 20px; height: 20px; }

/* Kreator ankiety */
.ch-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-50, #F5FBFA); border-radius: 999px; margin-bottom: 8px; }
.ch-seg-btn { border: 0; background: transparent; border-radius: 999px; padding: 8px 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-500, #4B615E); }
.ch-seg-btn.active { background: var(--surface-0, #fff); color: var(--teal-700, #0E7C74); box-shadow: var(--shadow-sm, 0 4px 12px rgba(11, 35, 33, .06)); }
.ch-seg-desc { font-size: 12.5px; line-height: 1.5; margin: 0 0 12px; }
.ch-field-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-700, #29423F); margin-bottom: 6px; }
.ch-pk-opts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.ch-pk-opt { display: flex; align-items: center; gap: 6px; }
.ch-pk-opt input { flex: 1; min-width: 0; }

/* --- Statystyki odczytu --- */
.ch-msg-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ch-read-stat {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 8px;
  font-size: 12px; color: var(--ink-500, #4B615E);
}
.ch-read-stat:hover { background: var(--surface-50, #F5FBFA); color: var(--teal-700, #0E7C74); }
.ch-read-stat b { color: var(--ink-900, #0B2321); font-weight: 800; }
.ch-read-bar { width: 46px; height: 5px; border-radius: 999px; background: var(--border, #DCEBE9); overflow: hidden; }
.ch-read-bar span { display: block; height: 100%; background: var(--teal-500, #14B8A6); border-radius: 999px; }
.ch-read-pct { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--teal-700, #0E7C74); }

.ch-ins-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-bottom: 14px; }
.ch-ins-summary div { padding: 10px 12px; border-radius: 12px; background: var(--surface-50, #F5FBFA); display: flex; flex-direction: column; gap: 2px; }
.ch-ins-summary b { font-size: 20px; font-weight: 800; color: var(--ink-900, #0B2321); font-variant-numeric: tabular-nums; }
.ch-ins-summary span { font-size: 11.5px; color: var(--ink-500, #4B615E); }
.ch-ins-opt + .ch-ins-opt { margin-top: 12px; }
.ch-ins-opt-head { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px 4px; border-bottom: 2px solid var(--teal-100, #E3F7F5); font-size: 13px; }
.ch-ins-opt-head span { font-weight: 800; color: var(--teal-700, #0E7C74); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-ins-foot { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; }
.ch-ins-foot .muted { font-size: 11.5px; line-height: 1.5; margin: 0; }


/* ============================================================
   14. Ekran kanału w stylu komunikatora (kanały WhatsApp)
   ============================================================
   Świadomie znajomy wygląd: beżowa tapeta z delikatnym wzorem, białe dymki z „ogonkiem",
   godzina w rogu dymka, reakcje w pigułce pod spodem, pole pisania jak w czacie.
   Uczestnik ma od razu wiedzieć, jak z tego korzystać — bez instrukcji. */

.wa-chat {
  /* Kolory z palety systemu (colors.css) — układ jak w komunikatorze, barwy Wentro. */
  --wa-bg: #E4E8E4;
  --wa-in: var(--surface-0, #FFFFFF);
  --wa-out: #C4F0E4;
  --wa-ink: var(--ink-900, #0B2321);
  --wa-meta: #667D79;
  --wa-icon: var(--ink-500, #4B615E);
  --wa-link: var(--teal-700, #0E7C74);
  --wa-shadow: 0 1px 1px rgba(11, 35, 33, .10), 0 2px 6px rgba(11, 35, 33, .10);
  font-family: var(--font-sans, 'Plus Jakarta Sans', sans-serif);
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  background-color: var(--wa-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%230E7C74' stroke-opacity='.09' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 22h22l-3 16H21z'/%3E%3Ccircle cx='98' cy='26' r='9'/%3E%3Cpath d='M92 26h12M98 20v12'/%3E%3Cpath d='M20 92l10-10 10 10-10 10z'/%3E%3Cpath d='M88 86h26v18H88z'/%3E%3Cpath d='M88 92h26'/%3E%3Cpath d='M58 58c4-6 12-6 16 0'/%3E%3Ccircle cx='60' cy='64' r='1.4'/%3E%3Ccircle cx='72' cy='64' r='1.4'/%3E%3Cpath d='M52 120l6-10 6 10M122 56l6 6-6 6'/%3E%3Cpath d='M112 122a6 6 0 1 0 12 0 6 6 0 1 0-12 0'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--wa-ink);
}

/* Komputer: rozmowa jako okno w panelu, na wysokość ekranu. */
@media (min-width: 760px) {
  .wa-chat {
    height: calc(100vh - 104px); height: calc(100dvh - 104px); min-height: 480px;
    max-width: 980px; margin: -6px auto 0;
    border: 1px solid var(--border, #DCEBE9); border-radius: 20px;
    box-shadow: var(--shadow-sm, 0 4px 12px rgba(11, 35, 33, .06));
  }
  html.ch-immersive .app-main { padding-bottom: 16px; }
}

/* Telefon: pełny ekran nad paskami panelu, jak otwarta rozmowa w komunikatorze. */
@media (max-width: 759.98px) {
  .wa-chat {
    position: fixed; top: 0; left: 0; right: 0; z-index: 55;
    height: 100vh; height: 100dvh;
  }
  html.ch-immersive, html.ch-immersive body { overflow: hidden; overscroll-behavior: none; }
  .wa-chat .wa-head { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
}

.wa-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--wa-meta); font-size: 13.5px; }
.wa-loading .spinner { width: 26px; height: 26px; }
.wa-error { padding: 20px 14px; }

/* --- Nagłówek --- */
.wa-head {
  flex-shrink: 0; display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 6px; background: var(--surface-0, #fff);
  border-bottom: 1px solid var(--border, #DCEBE9); position: relative; z-index: 3;
}
.wa-back {
  width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--wa-icon); cursor: pointer;
}
.wa-back:hover, .wa-back:active { background: var(--surface-50, #F5FBFA); }
.wa-back .ico { width: 24px; height: 24px; stroke-width: 2.2; }
.wa-ava {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--teal-500, #14B8A6), var(--teal-700, #0E7C74)); color: #fff;
}
.wa-ava .ico { width: 20px; height: 20px; }
.wa-head-main { flex: 1; min-width: 0; }
.wa-head-main h1 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--wa-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head-main p { margin: 1px 0 0; font-size: 12.5px; color: var(--wa-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head .pill { flex-shrink: 0; }

/* --- Pasek przypiętej wiadomości --- */
.wa-pinned {
  flex-shrink: 0; width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 7px 14px; border: 0; border-bottom: 1px solid var(--border, #DCEBE9);
  background: rgba(255, 255, 255, .96); cursor: pointer; font: inherit; position: relative; z-index: 2;
}
.wa-pinned::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal-500, #14B8A6); }
.wa-pinned-ico { color: var(--wa-icon); display: inline-flex; flex-shrink: 0; }
.wa-pinned-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.wa-pinned-main b { font-size: 12px; font-weight: 700; color: var(--teal-700, #0E7C74); }
.wa-pinned-main span { font-size: 13.5px; color: var(--wa-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chPinned[hidden] { display: none; }

/* --- Obszar wiadomości --- */
.wa-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding: 6px 0 12px;
}
.wa-feed { display: flex; flex-direction: column; padding: 0 12px; }
@media (min-width: 760px) { .wa-feed { padding: 0 6%; } }

.wa-more { display: flex; justify-content: center; padding: 8px 0 4px; }
.wa-more button {
  border: 0; border-radius: 999px; padding: 7px 14px; cursor: pointer;
  background: rgba(255, 255, 255, .95); box-shadow: var(--wa-shadow);
  font: inherit; font-size: 12.5px; font-weight: 700; color: var(--teal-700, #0E7C74);
}
.wa-more button:disabled { opacity: .6; cursor: wait; }

.wa-day { display: flex; justify-content: center; margin: 12px 0 6px; }
.wa-day span {
  padding: 5px 12px; border-radius: 8px; background: rgba(255, 255, 255, .95); box-shadow: var(--wa-shadow);
  font-size: 12px; font-weight: 600; color: var(--wa-icon);
}

.wa-empty {
  margin: 26px auto; max-width: 340px; text-align: center;
  padding: 16px 18px; border-radius: var(--radius-md, 14px); background: var(--surface-0, #fff); box-shadow: var(--wa-shadow);
  color: var(--ink-500, #4B615E); font-size: 13px; line-height: 1.5;
}
.wa-empty-ico { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74); margin-bottom: 8px; }
.wa-empty strong { display: block; font-size: 14px; color: var(--wa-ink); margin-bottom: 4px; }
.wa-empty p { margin: 0; }

/* --- Wiersz i dymek --- */
.wa-row { display: flex; flex-direction: column; align-items: flex-start; margin-top: 2px; }
.wa-row.is-out { align-items: flex-end; }
.wa-line { display: flex; align-items: center; gap: 6px; max-width: min(88%, 560px); position: relative; }
.wa-row.is-out .wa-line { flex-direction: row-reverse; }

.wa-bubble {
  position: relative; min-width: 96px; max-width: 100%;
  background: var(--wa-in); border-radius: 14px; padding: 7px 11px 7px;
  box-shadow: var(--wa-shadow); font-size: 14.5px; line-height: 1.45; overflow-wrap: anywhere;
}
.wa-row.is-out .wa-bubble { background: var(--wa-out); }
.wa-bubble.is-first { margin-top: 8px; }
/* „Ogonek" przy pierwszym dymku serii — jak w komunikatorze. */
.wa-row.is-in .wa-bubble.is-first { border-top-left-radius: 4px; }
.wa-row.is-in .wa-bubble.is-first::before {
  content: ''; position: absolute; top: 0; left: -8px; width: 8px; height: 13px;
  background: var(--wa-in); clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.wa-row.is-out .wa-bubble.is-first { border-top-right-radius: 4px; }
.wa-row.is-out .wa-bubble.is-first::before {
  content: ''; position: absolute; top: 0; right: -8px; width: 8px; height: 13px;
  background: var(--wa-out); clip-path: polygon(0 0, 100% 0, 0 100%);
}

.wa-author { font-size: 13px; font-weight: 700; color: var(--teal-700, #0E7C74); margin-bottom: 2px; padding-right: 22px; }
.wa-text { color: var(--wa-ink); }
.wa-text a { color: var(--wa-link); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.wa-text a:hover { text-decoration: underline; }
.wa-text strong { font-weight: 700; }

.wa-meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 5px;
  margin: 2px -2px -3px 12px; font-size: 11px; line-height: 1.2; color: var(--wa-meta); white-space: nowrap;
}
.wa-meta-pin { width: 12px !important; height: 12px !important; }
.wa-seen {
  display: inline-flex; align-items: center; gap: 2px; padding: 1px 3px; margin-left: 1px;
  border: 0; background: transparent; border-radius: 6px; cursor: pointer; font: inherit; font-size: 11px; font-weight: 700;
  color: var(--teal-500, #14B8A6);
}
.wa-seen:hover { background: rgba(0, 0, 0, .05); }
.wa-seen .ico { width: 14px; height: 14px; }

/* Rozwijane menu wiadomości (obsługa) — jak strzałka w rogu dymka. */
.wa-menu {
  position: absolute; top: 2px; right: 2px; width: 26px; height: 24px; z-index: 1;
  border: 0; border-radius: 0 14px 0 12px; cursor: pointer; color: var(--wa-meta);
  display: inline-flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 70% 30%, var(--wa-in) 55%, transparent 80%);
  opacity: 0; transition: opacity 120ms;
}
.wa-row.is-out .wa-menu { background: radial-gradient(circle at 70% 30%, var(--wa-out) 55%, transparent 80%); }
.wa-bubble:hover .wa-menu, .wa-menu:focus-visible { opacity: 1; }
@media (hover: none) { .wa-menu { opacity: .85; } }

.wa-bubble.is-removed {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
  font-style: italic; font-size: 13.5px; color: var(--wa-meta);
}

/* Samo zdjęcie: dymek jako ramka, godzina na zdjęciu. */
.wa-bubble.is-media { padding: 3px; }
.wa-bubble.is-media .wa-author { padding: 3px 26px 2px 6px; }
.wa-bubble.is-media .wa-meta {
  position: absolute; right: 8px; bottom: 7px; margin: 0; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55);
}
.wa-bubble.is-media .wa-seen { color: #fff; }

/* Dodatki wewnątrz dymka */
.wa-bubble .ch-gallery { margin: 0 0 5px; border-radius: 10px; }
.wa-bubble.is-media .ch-gallery { margin: 0; }
.wa-bubble .ch-gallery.is-1 .ch-gallery-item { max-height: 380px; }
.wa-bubble .ch-files { margin: 0 0 5px; }
.wa-bubble .ch-file { background: var(--surface-50, #F5FBFA); border: 1px solid var(--border, #DCEBE9); border-radius: 10px; }
.wa-bubble .ch-file-ico { background: var(--surface-0, #fff); }
.wa-bubble .ch-cta {
  margin: 8px -11px -7px; border-radius: 0 0 14px 14px; padding: 11px 12px;
  background: transparent; color: var(--teal-700, #0E7C74); border-top: 1px solid var(--border, #DCEBE9);
  font-size: 14px; font-weight: 700;
}
.wa-bubble .ch-cta:hover { background: var(--teal-100, #E3F7F5); }
.wa-bubble .ch-cta .ico { width: 15px; height: 15px; }

.wa-bubble.has-poll { width: 340px; }
.wa-bubble .ch-poll { margin: 2px 0 0; padding: 0; border: 0; background: transparent; }
.wa-bubble .ch-poll.is-confirm { background: transparent; }
.wa-bubble .ch-poll-q { margin: 4px 0 10px; }
.wa-bubble .ch-poll-opt, .wa-bubble .ch-poll-bar { border-color: var(--border, #DCEBE9); }
.wa-bubble .ch-poll-staff { border-top-color: var(--border, #DCEBE9); }
.wa-bubble .ch-confirm-done { background: rgba(255, 255, 255, .8); }

/* Buźka obok dymka — reakcja jednym stuknięciem. */
.wa-react-btn {
  flex-shrink: 0; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-0, #fff); color: var(--ink-300, #9DB0AD); box-shadow: var(--wa-shadow);
  opacity: .9; transition: opacity 120ms, transform 120ms;
}
.wa-react-btn:hover { opacity: 1; transform: scale(1.06); }
.wa-react-btn .ch-react-add-ico { width: 17px; height: 17px; }
.wa-line .ch-palette { bottom: calc(100% + 4px); left: 0; }
.wa-row.is-out .wa-line .ch-palette { left: auto; right: 0; }

.wa-reacts { display: flex; margin-top: -5px; padding: 0 8px; position: relative; z-index: 1; }
.wa-reacts:empty { display: none; }
.wa-react-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px;
  border: 1px solid var(--border, #DCEBE9); border-radius: 999px; background: var(--surface-0, #fff); cursor: pointer;
  box-shadow: var(--wa-shadow); font: inherit;
}
.wa-react-pill.is-mine { background: var(--teal-100, #E3F7F5); border-color: var(--teal-300, #5EEAD4); }
.wa-react-emojis { font-size: 14px; letter-spacing: -1px; line-height: 1.3; }
.wa-react-n { font-size: 12px; font-weight: 700; color: var(--wa-icon); }

/* Podświetlenie wiadomości, do której prowadzi przypomnienie albo pasek przypiętej. */
@keyframes wa-flash { 0%, 30% { box-shadow: 0 0 0 3px rgba(20, 184, 166, .55); } 100% { box-shadow: var(--wa-shadow); } }
.wa-row.is-flash .wa-bubble { animation: wa-flash 1.8s ease-out; }


/* --- Stopka uczestnika --- */
.wa-readonly {
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface-0, #fff); border-top: 1px solid var(--border, #DCEBE9);
  font-size: 13px; color: var(--wa-icon);
}
.wa-readonly[hidden] { display: none; }

/* --- Pole pisania --- */
.wa-composer { flex-shrink: 0; position: relative; padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px)); }
.wa-composer[hidden] { display: none; }
.wa-composer .ch-draft { background: var(--surface-0, #fff); border-radius: 14px; padding: 8px; margin: 0 0 6px; box-shadow: var(--wa-shadow); }
.wa-composer .ch-draft-chip { background: var(--teal-100, #E3F7F5); }
.wa-fmtbar {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap; margin: 0 0 6px; padding: 4px 6px;
  background: var(--surface-0, #fff); border-radius: 14px; box-shadow: var(--wa-shadow);
}
.wa-fmtbar[hidden] { display: none; }
.wa-fmtbar .ch-fmt-help { display: inline; margin-left: 6px; }
.wa-fmtbar .ch-counter { margin-left: auto; padding-right: 4px; }

.wa-inputrow { display: flex; align-items: flex-end; gap: 6px; }
.wa-input {
  flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px;
  background: var(--surface-0, #fff); border-radius: 24px; padding: 3px 4px; min-height: 48px; box-shadow: var(--wa-shadow);
}
.wa-input textarea {
  flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--wa-ink);
  padding: 10px 4px; max-height: 150px; min-height: 42px; overflow-y: hidden;
}
.wa-ibtn {
  flex-shrink: 0; width: 40px; height: 42px; border: 0; border-radius: 50%; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; color: var(--wa-icon); cursor: pointer;
}
.wa-ibtn:hover { color: var(--teal-700, #0E7C74); }
.wa-ibtn[aria-pressed="true"], .wa-ibtn[aria-expanded="true"] { color: var(--teal-700, #0E7C74); }
.wa-ibtn .ico { width: 22px; height: 22px; }
.wa-aa { font-size: 14px; font-weight: 800; letter-spacing: -.02em; }
.wa-send {
  flex-shrink: 0; width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gradient-brand, #0E7C74); color: #fff; box-shadow: 0 4px 12px rgba(14, 124, 116, .28);
  transition: transform 120ms, background 120ms, opacity 120ms;
}
.wa-send:hover { filter: brightness(.95); }
.wa-send:active { transform: scale(.94); }
.wa-send.is-sending { opacity: .6; cursor: wait; }
.wa-send .ico { width: 22px; height: 22px; stroke-width: 2; margin-left: -2px; }

/* Menu dodatków pod spinaczem */
.wa-attach {
  position: absolute; bottom: calc(100% - 2px); right: 60px; z-index: 5;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  width: min(330px, calc(100% - 16px)); padding: 12px 8px;
  background: var(--surface-0, #fff); border-radius: var(--radius-lg, 20px); box-shadow: var(--shadow-lg, 0 16px 40px rgba(11, 35, 33, .14));
}
.wa-attach[hidden] { display: none; }
@media (max-width: 420px) { .wa-attach { right: 8px; } }
.wa-attach-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 4px;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--wa-ink); text-align: center; line-height: 1.25;
}
.wa-attach-item:hover { background: var(--surface-50, #F5FBFA); }
.wa-attach-ico { width: 50px; height: 50px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.wa-attach-ico .ico { width: 24px; height: 24px; }
.wa-attach-ico.is-photo { background: var(--coral-500, #FF6B5B); }
.wa-attach-ico.is-poll { background: var(--warning, #F5A623); }
.wa-attach-ico.is-confirm { background: var(--teal-500, #14B8A6); }
.wa-attach-ico.is-cta { background: var(--teal-700, #0E7C74); }
.wa-attach-ico.is-pin { background: var(--coral-700, #E14A36); }

/* --- Przypomnienie w statystykach --- */
.ch-remind {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 10px 12px; margin: 0 0 8px; border-radius: 12px; background: var(--surface-50, #F5FBFA);
}
.ch-remind[hidden] { display: none; }
.ch-remind p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--ink-500, #4B615E); }

/* --- Lista kanałów jak lista czatów --- */
.ch-list { gap: 0; background: var(--surface-0, #fff); border: 1px solid var(--border, #DCEBE9); border-radius: var(--radius-lg, 20px); overflow: hidden; }
.ch-list .ch-row { border: 0; border-radius: 0; border-bottom: 1px solid var(--border, #DCEBE9); padding: 12px 14px; }
.ch-list .ch-row:last-child { border-bottom: 0; }
.ch-list .ch-row:hover { background: var(--surface-50, #F5FBFA); }
.ch-list .ch-row-ico { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--teal-500, #14B8A6), var(--teal-700, #0E7C74)); color: #fff; }
.ch-list .ch-row-badge { background: var(--teal-500, #14B8A6); min-width: 20px; height: 20px; font-size: 11px; }
.ch-list .ch-row.is-unread .ch-row-time { color: var(--teal-700, #0E7C74); font-weight: 700; }
.wa-bubble .btn-primary { background: var(--teal-700, #0E7C74); border-color: var(--teal-700, #0E7C74); color: #fff; }
.wa-bubble .btn-primary:hover { background: var(--teal-900, #0B5F59); }

/* --- Ustawienia aplikacji: wybór motywu --- */
.app-set { padding: 16px; }
.app-set-h { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--ink-900); }
.theme-opts { display: flex; flex-direction: column; gap: 8px; }
.theme-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: var(--radius-md, 14px); font: inherit;
  background: var(--surface-0, #fff); border: 1.5px solid var(--border, #DCEBE9); color: var(--ink-900);
  transition: border-color var(--dur-fast, 120ms), background var(--dur-fast, 120ms);
}
.theme-opt:hover { border-color: var(--teal-300, #5EEAD4); }
.theme-opt.is-on { border-color: var(--teal-500, #14B8A6); background: var(--teal-100, #E3F7F5); }
.theme-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.theme-txt strong { font-size: 14px; font-weight: 700; }
.theme-txt span { font-size: 12px; line-height: 1.45; color: var(--ink-500); }
.theme-mark {
  width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border, #DCEBE9); color: transparent;
}
.theme-opt.is-on .theme-mark { background: var(--teal-500, #14B8A6); border-color: var(--teal-500, #14B8A6); color: #fff; }
/* Miniatura: kartka z trzema „liniami" w kolorach danego motywu — stałe, bez tokenów,
   bo ma pokazywać wygląd motywu niezależnie od tego, który jest teraz włączony. */
.theme-prev {
  width: 46px; height: 58px; flex-shrink: 0; border-radius: 10px; padding: 8px 7px;
  display: flex; flex-direction: column; gap: 5px; border: 1px solid rgba(0, 0, 0, .12);
}
.theme-prev i { display: block; height: 6px; border-radius: 3px; }
.theme-prev i:first-child { width: 70%; }
.theme-prev.is-light { background: #F5FBFA; }
.theme-prev.is-light i { background: #0E7C74; }
.theme-prev.is-light i + i { background: #DCEBE9; }
.theme-prev.is-dark { background: #0C1514; border-color: #243B38; }
.theme-prev.is-dark i { background: #3CCFBD; }
.theme-prev.is-dark i + i { background: #243B38; }
.theme-prev.is-system { background: linear-gradient(135deg, #F5FBFA 50%, #0C1514 50%); }
.theme-prev.is-system i { background: #14B8A6; }
.theme-prev.is-system i + i { background: rgba(127, 148, 145, .55); }
.app-set-note { margin: 12px 2px 0; font-size: 12px; line-height: 1.5; color: var(--ink-500); }
html[data-theme="dark"] .boot-logo { filter: brightness(0) invert(1); opacity: .92; }
html[data-theme="dark"] .boot { background: linear-gradient(170deg, #0C1514 0%, #10221F 60%, #0C1514 100%); }
html[data-theme="dark"] .wp-note-warn,
html[data-theme="dark"] .notif-nudge,
html[data-theme="dark"] .status-ico.warn,
html[data-theme="dark"] .status-warn { background: #33280F; }
html[data-theme="dark"] .pf-identity { background: linear-gradient(180deg, var(--teal-100) 0%, var(--surface-0) 130px); }
html[data-theme="dark"] .wp-screen { background: linear-gradient(165deg, #0E7C74 0%, #14B8A6 42%, var(--surface-50) 42.1%, var(--surface-50) 100%); }

/* --- Czat grupowy: oznaczenie wiadomości organizatora --- */
.wa-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  background: var(--teal-100, #E3F7F5); color: var(--teal-700, #0E7C74);
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
}
.wa-row.is-staff.is-in .wa-bubble { box-shadow: var(--wa-shadow), inset 3px 0 0 var(--teal-500, #14B8A6); }


/* ============================================================
   15. Ciemny motyw
   ============================================================
   Włącza go js/theme.js atrybutem <html data-theme="dark"> (Więcej / Profil → Aplikacja).

   Zasada: przedefiniowujemy TOKENY z colors.css, a nie poszczególne ekrany — panel prawie
   wszędzie z nich korzysta, a białe tła z arkuszy przeszły na var(--surface-0). Osobne
   reguły są tylko tam, gdzie token tekstu służy jako tło (np. główny przycisk w kolorze
   --ink-900): po odwróceniu kolorów to tło robi się jasne, więc napis musi zrobić się ciemny. */

html[data-theme="dark"] {
  --surface-0: #15201F;
  --surface-50: #0C1514;
  --border: #243B38;

  --ink-900: #E4F0EE;
  --ink-700: #C2D5D2;
  --ink-500: #93ABA7;
  --ink-300: #6A837F;
  --ink-100: #243B38;

  --teal-100: #12332F;
  --teal-300: #1F6B62;
  --teal-500: #19C2AF;
  --teal-700: #3CCFBD;
  --teal-900: #8FEADF;

  --coral-100: #3A201C;
  --coral-300: #9B4A40;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);

  color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--surface-50); color: var(--ink-900); }

/* Napis na jasnym (po odwróceniu) tle tokenu tekstu albo jasnego turkusu. */
html[data-theme="dark"] .topnav .tab.active,
html[data-theme="dark"] .pill.dark,
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .mobnav .mnav-btn.is-center .ico,
html[data-theme="dark"] .reg-bulkbar,
html[data-theme="dark"] .notif-chip.active,
html[data-theme="dark"] .net-bar-off,
html[data-theme="dark"] .avatar-edit,
html[data-theme="dark"] .ch-row-badge,
html[data-theme="dark"] .tk-channel-ico,
html[data-theme="dark"] .dsc-chip.active,
html[data-theme="dark"] .topnav .tab.is-center,
html[data-theme="dark"] .tk-code-cta,
html[data-theme="dark"] .ch-cta,
html[data-theme="dark"] .wa-bubble .btn-primary { color: #0B2321; }
html[data-theme="dark"] .reg-bulkbar .btn-primary { color: #0B2321; }
html[data-theme="dark"] .toast.success { background: var(--teal-500); }
html[data-theme="dark"] .toast.error { background: #F07A7E; }
html[data-theme="dark"] .scan-viewport { background: #000; }

/* Paski półprzezroczyste (dolna nawigacja, nagłówki) */
html[data-theme="dark"] .mobnav { background: rgba(21, 32, 31, .94); border-top-color: var(--border); }
html[data-theme="dark"] .topnav { background: var(--surface-0); border-bottom-color: var(--border); }
html[data-theme="dark"] .topnav .brand img { filter: brightness(0) invert(1); opacity: .92; }
html[data-theme="dark"] .table-wrap::after { background: linear-gradient(to right, rgba(21, 32, 31, 0), rgba(21, 32, 31, .9)); }
html[data-theme="dark"] .pay-head { background: linear-gradient(135deg, var(--coral-100), var(--surface-0)); }
html[data-theme="dark"] .pay-head.is-clear { background: linear-gradient(135deg, var(--teal-100), var(--surface-0)); }

/* Pola formularzy — przeglądarka nie zawsze dziedziczy tło po karcie. */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea { background-color: var(--surface-0); color: var(--ink-900); border-color: var(--border); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--ink-300); }
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .6); }

/* Kod QR musi zostać czarny na białym — skaner przy bramce czyta kontrast, nie motyw. */
html[data-theme="dark"] canvas,
html[data-theme="dark"] [class*="qr"] img { background: #fff; }

/* Kanał: ta sama tapeta, przygaszona */
html[data-theme="dark"] .wa-chat {
  --wa-bg: #0B1514;
  --wa-in: #1E2D2B;
  --wa-out: #0B5C52;
  --wa-ink: #E4F0EE;
  --wa-meta: #8AA39F;
  --wa-icon: #A3BAB6;
  --wa-link: #5EE0CF;
  --wa-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .wa-head,
html[data-theme="dark"] .wa-readonly { background: var(--surface-0); }
html[data-theme="dark"] .wa-pinned,
html[data-theme="dark"] .wa-day span,
html[data-theme="dark"] .wa-more button { background: rgba(27, 42, 40, .96); }
html[data-theme="dark"] .wa-bubble .ch-confirm-done { background: rgba(0, 0, 0, .25); }
html[data-theme="dark"] .wa-send { color: #fff; }
html[data-theme="dark"] .ch-viewer-nav { background: rgba(27, 42, 40, .92); color: var(--ink-900); }

/* Wyrazistość dymków w jasnym motywie: cienka obwódka oddziela dymek od tapety nawet
   na ekranie z niskim kontrastem albo w pełnym słońcu. Ciemny motyw ma własne kolory. */
html:not([data-theme="dark"]) .wa-bubble { border: 1px solid rgba(11, 35, 33, .07); }
html:not([data-theme="dark"]) .wa-row.is-out .wa-bubble { border-color: rgba(14, 124, 116, .22); }
html:not([data-theme="dark"]) .wa-row.is-out .wa-meta { color: #42625D; }
html:not([data-theme="dark"]) .wa-row.is-out .wa-seen { color: var(--teal-700, #0E7C74); }


/* ============================================================
   16. Kanał: dopracowanie kolorów pod znane komunikatory
   ============================================================
   Zweryfikowane kontrastem WCAG względem WhatsApp i Telegrama:
   • jasny: tapeta prawie bez nasycenia (#E4E8E4), własny dymek nasycony (#C4F0E4) —
     różnią się NASYCENIEM, nie jasnością, dokładnie jak zielony dymek na beżu w WhatsApp;
   • ciemny: dymki i tapeta w proporcjach WhatsApp (dymek/tło 1,30, własny/tło 2,36),
     pole pisania wyraźnie jaśniejsze od tła, godzina we własnym dymku ≥ 4,5:1;
   • imiona w czacie grupowym mają stały kolor na osobę (8 barw, ≥ 5:1 w obu motywach). */

/* Kolor imienia: klasa wa-n0…wa-n7 z numeru konta; obsługa zawsze w turkusie marki. */
.wa-author.wa-n0 { color: #0E7C74; }
.wa-author.wa-n1 { color: #C2410C; }
.wa-author.wa-n2 { color: #7C3AED; }
.wa-author.wa-n3 { color: #1D4ED8; }
.wa-author.wa-n4 { color: #BE185D; }
.wa-author.wa-n5 { color: #15803D; }
.wa-author.wa-n6 { color: #B45309; }
.wa-author.wa-n7 { color: #0369A1; }
html[data-theme="dark"] .wa-author.wa-n0 { color: #3CCFBD; }
html[data-theme="dark"] .wa-author.wa-n1 { color: #FB923C; }
html[data-theme="dark"] .wa-author.wa-n2 { color: #A78BFA; }
html[data-theme="dark"] .wa-author.wa-n3 { color: #60A5FA; }
html[data-theme="dark"] .wa-author.wa-n4 { color: #F472B6; }
html[data-theme="dark"] .wa-author.wa-n5 { color: #4ADE80; }
html[data-theme="dark"] .wa-author.wa-n6 { color: #FBBF24; }
html[data-theme="dark"] .wa-author.wa-n7 { color: #38BDF8; }

/* Ciemny: własny dymek — jasna godzina i linki na nasyconym turkusie. */
html[data-theme="dark"] .wa-row.is-out .wa-meta,
html[data-theme="dark"] .wa-row.is-out .wa-seen { color: #A6CFC7; }
html[data-theme="dark"] .wa-row.is-out .wa-text a { color: #A7F3E8; }
html[data-theme="dark"] .wa-row.is-out .ch-poll-opt,
html[data-theme="dark"] .wa-row.is-out .ch-poll-bar { background: rgba(0, 0, 0, .22); border-color: rgba(255, 255, 255, .12); }
/* Ciemny: nagłówek, stopka i pole pisania jaśniejsze od tapety (jak pasek i pole w WhatsApp). */
html[data-theme="dark"] .wa-head,
html[data-theme="dark"] .wa-readonly { background: #152321; border-color: #22332F; }
html[data-theme="dark"] .wa-input,
html[data-theme="dark"] .wa-fmtbar,
html[data-theme="dark"] .wa-composer .ch-draft { background: #223330; }
html[data-theme="dark"] .wa-input textarea { background: transparent; }
html[data-theme="dark"] .wa-react-pill { background: #22332F; border-color: #2C403C; }
html[data-theme="dark"] .wa-react-btn { background: #1E2D2B; color: #8AA39F; }
/* Ciemny: plakietka „Organizator" czytelna także na cudzym dymku. */
html[data-theme="dark"] .wa-badge { background: rgba(60, 207, 189, .16); color: #5EE0CF; }

/* ============================================================
   17. Awatary generowane (osoby bez zdjęcia profilowego)
   ============================================================
   Kolory, kąt i wzór wylicza PanelCore.avatar z numeru konta (zmienne --av-a, --av-b, --av-k),
   więc każda osoba ma własny, stały awatar. Wzór to półprzezroczyste białe kształty nad
   gradientem — daje charakter bez odbierania czytelności inicjałom. */
.av.av-gen {
  position: relative; isolation: isolate;
  background: linear-gradient(var(--av-k, 135deg), var(--av-a, #0E7C74), var(--av-b, #2DD4BF));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.av.av-gen::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
}
/* 0 — duże koło wychodzące zza prawego górnego rogu */
.av.av-gen.av-p0::before { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .30) 0 38%, transparent 39%); }
/* 1 — dwa łuki w lewym dolnym rogu */
.av.av-gen.av-p1::before {
  background:
    radial-gradient(circle at 0% 100%, transparent 0 34%, rgba(255, 255, 255, .22) 35% 45%, transparent 46%),
    radial-gradient(circle at 0% 100%, transparent 0 58%, rgba(255, 255, 255, .14) 59% 66%, transparent 67%);
}
/* 2 — siatka kropek */
.av.av-gen.av-p2::before {
  background: radial-gradient(circle, rgba(255, 255, 255, .26) 0 1.4px, transparent 1.6px) 0 0 / 22% 22%;
  -webkit-mask-image: linear-gradient(135deg, #000 0%, transparent 70%); mask-image: linear-gradient(135deg, #000 0%, transparent 70%);
}
/* 3 — ukośne pasy */
.av.av-gen.av-p3::before {
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .16) 0 12%, transparent 12% 26%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 85%); mask-image: linear-gradient(to top, #000 0%, transparent 85%);
}
.av-gen .av-ini { position: relative; text-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
html[data-theme="dark"] .av.av-gen { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .10); filter: saturate(.92) brightness(.95); }

/* Awatar przy cudzych wiadomościach w kanale (jak w grupach komunikatorów). */
.wa-av { flex-shrink: 0; width: 28px; align-self: flex-start; margin-top: 8px; }
.wa-av .av { width: 28px; height: 28px; border-radius: 50%; font-size: 11px; }
.wa-row.is-in .wa-line { align-items: flex-end; }
.wa-row.is-in .wa-line .wa-react-btn { align-self: center; }
.wa-row.is-in .wa-reacts { padding-left: 42px; }
.wa-row.is-in > .wa-bubble.is-removed { margin-left: 34px; }
.wa-row.is-in .wa-line .ch-palette { left: 34px; }

/* Przycisk „↓ N nowych wiadomości" — gdy przychodzą, a ktoś czyta starsze (jak w komunikatorach). */
.wa-newpill {
  position: absolute; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 4;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--teal-700, #0E7C74); color: #fff; box-shadow: 0 6px 18px rgba(11, 35, 33, .28);
  font: inherit; font-size: 13px; font-weight: 700;
  animation: wa-pill-in 180ms var(--ease, cubic-bezier(.4, 0, .2, 1));
}
.wa-newpill .ico { width: 16px; height: 16px; }
@keyframes wa-pill-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translateX(-50%); } }
html[data-theme="dark"] .wa-newpill { background: var(--teal-500); color: #0B2321; }
