/* =============================================================================
 * TeamLayer 2 - system designu aplikacji (wdrozenie redesignu z _mockups/next)
 *
 * Laduje sie PO styles.css (Tailwind) i wl-theme.css, wiec:
 *  - komponenty (.btn, .card, .page, .field, .chip...) sa dostepne wszedzie,
 *    niezaleznie od purge'a Tailwinda (zero klas zaleznych od buildu),
 *  - tokeny legacy --wl-* sa przemapowane na --t-* (sekcja 1b), wiec strony
 *    jeszcze nieprzepisane dostaja nowa palete bez zmian w markupie.
 *
 * Motyw ciemny: html.wl-dark (przelacznik wl-theme.js) albo html[data-theme=dark].
 *
 * Dokumentacja decyzji: _mockups/DESIGN_AUDIT.md
 *
 * Zasady:
 *  1. Jedna skala odstepow (4px), jedna skala promieni (3 stopnie), jedna skala
 *     typografii. Zero wartosci "z palca" w markupie.
 *  2. Kazdy kolor to token semantyczny (--t-*). Zero hardkodow typu #ef4444 albo
 *     klas bg-red-500 w tresci strony - inaczej dark mode zawsze bedzie dziurawy.
 *  3. Komponenty zamiast zlepkow utility: .btn, .chip, .field, .card, .list,
 *     .empty, .page. Strona sklada sie z komponentow, nie z 8 klas na element.
 *  4. Gestosc sterowana jedna zmienna (--t-density), nie setka regul !important
 *     w media query.
 * ========================================================================== */

/* ---------- 0. Atrybut hidden ---------------------------------------------
 * Regula przegladarki `[hidden] { display: none }` pochodzi z arkusza UA, wiec
 * przegrywa z KAZDA regula autorska ustawiajaca display - a nasze komponenty
 * (.note, .menu, .row, .chip, .btn) wlasnie to robia. Efekt bez tej reguly:
 * `<div class="note note--danger" hidden>` renderuje sie jako pusty czerwony
 * prostokat, a chowana lista `.menu` jako pusty biały kafel.
 * Stad !important: chowanie elementu ma byc silniejsze niz jego wyglad. */
[hidden] { display: none !important; }

/* ---------- 1. Tokeny ------------------------------------------------------ */
:root {
  /* Powierzchnie i tekst */
  --t-bg: #f4f5f9;
  --t-surface: #ffffff;
  --t-surface-2: #f8fafc;
  --t-surface-3: #eef1f6;
  --t-text: #161d2e;
  --t-text-dim: #5b6779;
  --t-text-mute: #8a94a6;
  --t-border: #e3e8f0;
  --t-border-strong: #cbd3e1;

  /* Marka */
  --t-accent: #5b5fc7;
  --t-accent-strong: #4a4eb4;
  --t-accent-soft: #edeefc;
  --t-accent-on: #ffffff;

  /* Semantyka statusow - kazdy ma wersje "soft" (tlo) i "on" (tekst na soft) */
  --t-success: #12855f;
  --t-success-soft: #dcf5ea;
  --t-warning: #a5620a;
  --t-warning-soft: #fdf0d5;
  --t-danger: #c8332f;
  --t-danger-soft: #fde5e4;
  --t-info: #2563a8;
  --t-info-soft: #e2eefb;
  --t-neutral-soft: #eef1f6;

  /* Nawigacja (rail) */
  --t-rail: #2c2f46;
  --t-rail-2: #363a55;
  --t-rail-text: rgba(255, 255, 255, .68);
  --t-rail-text-on: #ffffff;

  /* Promienie - TRZY stopnie, koniec z 6/7/8/9/10/12/14/16 na przemian */
  --t-r-sm: 6px;
  --t-r-md: 10px;
  --t-r-lg: 16px;

  /* Cienie */
  --t-shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --t-shadow-2: 0 4px 12px -2px rgba(16, 24, 40, .1), 0 2px 4px -2px rgba(16, 24, 40, .06);
  --t-shadow-3: 0 20px 48px -12px rgba(16, 24, 40, .28);

  /* Gestosc - jedna zmienna zamiast media query z !important */
  --t-density: 1;
  --t-row-h: calc(40px * var(--t-density));
  --t-control-h: calc(38px * var(--t-density));
  --t-gap: calc(16px * var(--t-density));
  --t-pad: calc(20px * var(--t-density));

  --t-ring: 0 0 0 3px color-mix(in srgb, var(--t-accent) 22%, transparent);
  --t-font: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --t-mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;

  /* Dolny safe-area (PWA standalone): Android edge-to-edge / iOS home indicator
   * raportuja 24-48px, a pelne dopelnienie robi pusty pas pod dolna nawigacja.
   * Przycinamy do 14px - przyciski i tak siedza w strefie tresci nad paddingiem. */
  --t-safe-b: min(env(safe-area-inset-bottom, 0px), 14px);
}

html.wl-dark,
html[data-theme="dark"] {
  --t-bg: #0d1220;
  --t-surface: #151b2b;
  --t-surface-2: #1a2133;
  --t-surface-3: #232c42;
  --t-text: #e8edf7;
  --t-text-dim: #a0abc0;
  --t-text-mute: #74809a;
  --t-border: #2a3448;
  --t-border-strong: #3b4761;

  --t-accent: #8f95f2;
  --t-accent-strong: #a8adf8;
  --t-accent-soft: #262d4e;
  --t-accent-on: #10142a;

  --t-success: #4ade9f;
  --t-success-soft: #15352a;
  --t-warning: #f2b45c;
  --t-warning-soft: #3a2c14;
  --t-danger: #f98b86;
  --t-danger-soft: #3b1f1e;
  --t-info: #7ab6f0;
  --t-info-soft: #16293f;
  --t-neutral-soft: #232c42;

  --t-rail: #0a0e1a;
  --t-rail-2: #151b2b;

  --t-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --t-shadow-2: 0 4px 14px rgba(0, 0, 0, .45);
  --t-shadow-3: 0 24px 56px -12px rgba(0, 0, 0, .7);
}

/* Telefon: jedna zmienna zageszcza CALY interfejs. */
@media (max-width: 767px) {
  :root { --t-density: .88; }
}

/* ---------- 1b. Most do tokenow legacy (--wl-*) ----------------------------
 * wl-theme.css definiuje wlasna palete --wl-*. Zamiast utrzymywac dwie prawdy,
 * przepisujemy --wl-* na --t-*: strony jeszcze nie przeniesione na komponenty
 * dostaja nowa palete (i poprawny dark mode) bez zmiany ani jednej klasy.
 * Kolejnosc ladowania w <head> ma znaczenie: wl2.css MUSI byc po wl-theme.css.
 *
 * Selektor wymienia te same konteksty co wl-theme.css (:root ORAZ html.wl-dark),
 * bo inaczej bardziej specyficzna regula `html.wl-dark { --wl-bg: ... }` z
 * wl-theme.css wygrywa i w ciemnym motywie wracaja stare kolory. */
:root,
html.wl-dark,
html[data-theme="dark"] {
  --wl-bg: var(--t-bg);
  --wl-surface: var(--t-surface);
  --wl-surface-2: var(--t-surface-2);
  --wl-surface-3: var(--t-surface-3);
  --wl-text: var(--t-text);
  --wl-text-dim: var(--t-text-dim);
  --wl-text-mute: var(--t-text-mute);
  --wl-border: var(--t-border);
  --wl-border-soft: var(--t-border);
  --wl-accent: var(--t-accent);
  --wl-accent-strong: var(--t-accent-strong);
  --wl-accent-soft: var(--t-accent-soft);
  --wl-accent-on: var(--t-accent-on);
  --wl-rail: var(--t-rail);
  --wl-rail-text: var(--t-rail-text);
  --wl-rail-active: rgba(255, 255, 255, .1);
  --wl-danger: var(--t-danger);
  --wl-shadow: var(--t-shadow-1);
  --wl-shadow-lg: var(--t-shadow-3);
}

/* B5 z audytu: tlo strony musi siedziec na <html>, inaczej przelacznik motywu
 * nie przemalowuje tla (canvas okna bierze tlo <body> i nie liczy go ponownie,
 * gdy zmieni sie sama zmienna CSS). .wl-app-bg zostaje w markupie, ale jest
 * przezroczysta - tlo daje regula html ponizej w sekcji 2. */
.wl-app-bg { background: transparent; }

/* ---------- 2. Reset ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
/* Tlo strony siedzi na <html>, NIE na <body>. Tlo body jest propagowane na
 * canvas okna i przegladarka nie przelicza go ponownie, gdy zmieni sie tylko
 * zmienna CSS - to wlasnie powoduje, ze przy przelaczeniu motywu w dzisiejszej
 * aplikacji karty ciemnieja, a tlo strony zostaje jasne (patrz DESIGN_AUDIT B5). */
html { background: var(--t-bg); }
body {
  font-family: var(--t-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--t-text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
/* G1: wszystko klikalne dostaje widoczny focus. Bez wymuszania promienia -
 * element zachowuje swoj kształt (awatar zostaje kolem, nie kwadratem). */
:focus-visible { outline: none; box-shadow: var(--t-ring); }

/* Bezpiecznik ikon: KAZDA ikona z MOCK.icon() dostaje klase .ico, wiec brak
 * reguly komponentu daje 16px, a nie 300x150 (svg bez wymiaru). Reguly
 * komponentow (.btn svg, .icon-btn svg, .tree__item svg...) maja specyficznosc
 * 0,1,1 i nadal wygrywaja z .ico (0,1,0). */
.ico { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- 3. Typografia -------------------------------------------------- */
.t-h1 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.3; }
.t-h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; line-height: 1.35; }
.t-h3 { font-size: 14px; font-weight: 650; line-height: 1.4; }
.t-body { font-size: 14px; }
.t-sm { font-size: 13px; }
.t-xs { font-size: 12px; }
.t-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--t-text-mute);
}
.t-dim { color: var(--t-text-dim); }
.t-mute { color: var(--t-text-mute); }
.t-accent { color: var(--t-accent); }
.t-danger { color: var(--t-danger); }
.t-num { font-variant-numeric: tabular-nums; }
.t-key { font-family: var(--t-mono); font-size: 11.5px; color: var(--t-text-mute); letter-spacing: -.02em; }
/* W wierszu listy klucz ma stala kolumne - "COMP-1" i "COMP-128" zaczynaja tytul
 * w tym samym miejscu, bez postrzepionej lewej krawedzi. */
.row > .t-key { flex: 0 0 auto; min-width: 64px; }
.t-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 4. Ukladki pomocnicze ------------------------------------------ */
.t-row-f { display: flex; align-items: center; gap: 8px; }
.t-col { display: flex; flex-direction: column; }
.t-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.t-wrap { flex-wrap: wrap; }
.t-grow { flex: 1 1 auto; min-width: 0; }
.t-spacer { flex: 1 1 auto; }
.t-gap-4 { gap: 4px; } .t-gap-8 { gap: 8px; } .t-gap-12 { gap: 12px; }
.t-gap-16 { gap: 16px; } .t-gap-24 { gap: 24px; }
.t-stack > * + * { margin-top: 12px; }
.t-stack-lg > * + * { margin-top: var(--t-gap); }
.t-grid { display: grid; gap: var(--t-gap); }
.t-grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.t-grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.t-hide-sm { display: initial; }
@media (max-width: 767px) { .t-hide-sm { display: none !important; } }

/* Menu "wiecej" w naglowku kanalu - pokazywane tylko na telefonie (blok
 * @media nizej). UWAGA: te reguly MUSZA stac PRZED tamtym blokiem - media
 * query nie podnosi specyficznosci, wiec `display:none` postawione pozniej
 * wygraloby z `display:block` z media query i przycisk nigdy by sie nie pokazal. */
.chat__head-more-wrap { position: relative; flex: 0 0 auto; display: none; }
.chat__head-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 232px; max-width: calc(100vw - 20px);
}
.chat__head-menu[hidden] { display: none; }

/* Telefon: w wierszu listy liczy sie tytul. Numer zadania i kropka statusu to
 * informacja drugorzedna - dostaja mniej miejsca, zeby tytul urywal sie duzo
 * pozniej. Klucz traci stala kolumne (rowne dlugosci i tak same sie ustawiaja). */
@media (max-width: 767px) {
  .row { gap: 8px; }
  .row > .t-key { min-width: 0; font-size: 10px; }
  .row > .dot { width: 6px; height: 6px; }
}

/* ---------- 5. Powloka aplikacji ------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: 68px 264px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--t-bg);
}
.app.app--no-tree { grid-template-columns: 68px 1fr; }
@media (max-width: 1023px) { .app { grid-template-columns: 68px 1fr; } }
@media (max-width: 767px) { .app { grid-template-columns: 1fr; } }

/* --- 5a. Rail (nawigacja glowna) --- */
.rail {
  background: var(--t-rail);
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 10px 8px;
  overflow: hidden;
}
@media (max-width: 767px) { .rail { display: none; } }
.rail__brand {
  width: 36px; height: 36px; border-radius: var(--t-r-md);
  background: var(--t-accent); color: #fff;
  display: grid; place-items: center; margin-bottom: 10px; flex: 0 0 auto;
}
.rail__brand svg { width: 22px; height: 22px; }
.rail__item {
  position: relative;
  width: 52px; padding: 7px 0 5px;
  border-radius: var(--t-r-md);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--t-rail-text);
  font-size: 10px; font-weight: 600; letter-spacing: -.01em;
  transition: color .14s ease, background-color .14s ease;
  flex: 0 0 auto;
}
.rail__item svg { width: 20px; height: 20px; }
.rail__item:hover { color: var(--t-rail-text-on); background: rgba(255, 255, 255, .06); }
.rail__item.is-active { color: var(--t-rail-text-on); background: rgba(255, 255, 255, .1); }
/* Wskaznik aktywnosci: pasek po lewej - czytelny takze przy daltonizmie */
.rail__item.is-active::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--t-accent-strong);
}
.rail__badge {
  position: absolute; top: 2px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--t-danger); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--t-rail);
}
.rail__sep { width: 28px; height: 1px; background: rgba(255, 255, 255, .12); margin: 8px 0; flex: 0 0 auto; }
.rail__avatar {
  width: 34px; height: 34px; border-radius: 999px; overflow: hidden;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--t-accent); color: #fff; font-size: 12px; font-weight: 650;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16);
}

/* --- 5b. Drzewo (sidebar) --- */
.tree {
  background: var(--t-surface);
  border-right: 1px solid var(--t-border);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
@media (max-width: 1023px) { .tree { display: none; } }
.tree__head { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 10px; }
.tree__team {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 8px; border-radius: var(--t-r-md);
  border: 1px solid var(--t-border); background: var(--t-surface-2);
  cursor: pointer; text-align: left;
}
.tree__team:hover { border-color: var(--t-border-strong); }
.tree__team svg { width: 14px; height: 14px; margin-left: auto; color: var(--t-text-mute); }
.tree__filter {
  width: 100%; height: 32px; padding: 0 10px 0 30px;
  border-radius: var(--t-r-md); border: 1px solid var(--t-border);
  background: var(--t-surface-2); font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%238a94a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' d='M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 8px center; background-size: 15px;
}
.tree__filter:focus { outline: none; border-color: var(--t-accent); box-shadow: var(--t-ring); }
.tree__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; }
.tree__section { margin-top: 14px; }
.tree__section:first-child { margin-top: 2px; }
.tree__section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px; margin-bottom: 2px;
}
.tree__item {
  display: flex; align-items: center; gap: 8px;
  height: calc(30px * var(--t-density)); padding: 0 8px;
  border-radius: var(--t-r-sm); color: var(--t-text-dim); font-size: 13px;
  cursor: pointer;
}
.tree__item:hover { background: var(--t-surface-3); color: var(--t-text); }
.tree__item.is-active { background: var(--t-accent-soft); color: var(--t-accent); font-weight: 600; }
.tree__item.is-unread { color: var(--t-text); font-weight: 650; }
.tree__item svg { width: 15px; height: 15px; flex: 0 0 auto; opacity: .75; }
.tree__group { margin-bottom: 2px; }
.tree__group-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: calc(32px * var(--t-density)); padding: 0 6px;
  border: none; background: none; border-radius: var(--t-r-sm);
  font-size: 13px; font-weight: 650; color: var(--t-text); cursor: pointer; text-align: left;
}
.tree__group-btn:hover { background: var(--t-surface-3); }
.tree__group-btn .caret { transition: transform .15s ease; width: 14px; height: 14px; color: var(--t-text-mute); }
.tree__group.is-open .caret { transform: rotate(90deg); }
.tree__children { display: none; padding-left: 14px; }
.tree__group.is-open .tree__children { display: block; }
.tree__foot { border-top: 1px solid var(--t-border); padding: 8px; }
.tile {
  width: 22px; height: 22px; border-radius: var(--t-r-sm); flex: 0 0 auto;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
}

/* --- 5c. Kolumna glowna --- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--t-bg); }
.topbar {
  height: 52px; flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
  background: var(--t-surface); border-bottom: 1px solid var(--t-border);
}
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; }
.crumbs a { color: var(--t-text-dim); }
.crumbs a:hover { color: var(--t-accent); }
.crumbs .sep { color: var(--t-text-mute); }
.crumbs strong { font-weight: 650; font-size: 14px; min-width: 0; }
/* Kafelek na wgrane logo zespolu.
 *
 * Osobny od .av celowo: .av maluje akcentowe tlo pod inicjaly, a logo prawie
 * zawsze ma przezroczyste tlo - fiolet przebijal spod niego. Tlo jest jasne i
 * NIE zmienia sie w ciemnym motywie: loga projektuje sie pod jasne podloze i
 * ciemny znak na ciemnym tle po prostu znika. Delikatna ramka trzyma kafelek
 * widocznym na bialej karcie. */
.wl-team-ico {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  width: 28px; height: 28px; border-radius: 8px;
  background: #fff; border: 1px solid var(--t-border);
}
.wl-team-ico img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.wl-team-ico--lg { width: 40px; height: 40px; border-radius: 12px; }

/* Znacznik zespolu w naglowku: TYLKO telefon. Na desktopie zespol jest juz
 * pierwszym okruszkiem sciezki. */
.wl-hdr-team { display: none; }
.wl-hdr-team__icon {
  width: 20px; height: 20px; border-radius: 6px; object-fit: cover; flex-shrink: 0;
}
/* Wariant .wl-team-ico w naglowku telefonu - te same wymiary co inicjaly. */
.wl-team-ico.wl-hdr-team__icon { border-radius: 6px; }
.wl-hdr-team__initials {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--t-accent); color: #fff;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.wl-hdr-team__name {
  font-size: 13px; font-weight: 600; color: var(--t-text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 767px) {
  /* Telefon: trzy okruszki po osiem znakow ("All tas... / Ibiza Tas... / Podl...")
   * nie niosa zadnej informacji. Zostaje sama biezaca strona - reszta sciezki
   * jest pod hamburgerem i dolnym paskiem. */
  .crumbs a, .crumbs .sep, .crumbs > span { display: none; }
  .crumbs strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* ...ale sam "#general" nie mowi, w ktorym zespole jestesmy. Ikona + nazwa
   * zespolu wracaja przed nazwe kanalu. Nazwa zespolu ustepuje pierwsza, gdy
   * miejsca brakuje - nazwa biezacej strony jest wazniejsza. */
  .wl-hdr-team { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex-shrink: 1; }
  .wl-hdr-team__name { max-width: 12ch; }
  .wl-hdr-team + .crumbs::before {
    content: ''; width: 1px; height: 14px; margin-right: 2px;
    background: var(--t-border); flex-shrink: 0;
  }
  .wl-hdr-team + .crumbs { flex-shrink: 0; }
}
.search-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; min-width: 220px;
  border-radius: var(--t-r-md); border: 1px solid var(--t-border);
  background: var(--t-surface-2); color: var(--t-text-mute);
  font-size: 13px; cursor: pointer;
}
.search-btn:hover { border-color: var(--t-border-strong); }
.search-btn svg { width: 15px; height: 15px; }
.search-btn kbd {
  margin-left: auto; font-family: var(--t-font); font-size: 10px; font-weight: 650;
  padding: 2px 5px; border-radius: 4px; background: var(--t-surface-3); color: var(--t-text-dim);
}
@media (max-width: 767px) { .search-btn { min-width: 0; width: 32px; padding: 0; justify-content: center; } .search-btn span, .search-btn kbd { display: none; } }

/* --- 5d. Rama strony: JEDNA dla wszystkich podstron --- */
.page { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.page__inner { max-width: 1320px; margin: 0 auto; padding: var(--t-pad); }
.page--flush .page__inner { max-width: none; padding: 0; height: 100%; }
/* Legacy karta strony (`h-full ... m-6`) w powloce. main#appMain to kolumna
 * flex z overflow:hidden, a `h-full` to `height:100%` LICZONE BEZ MARGINESU -
 * karta zajmowala wiec 100% + 2x24px i jej dol razem z dolnym marginesem
 * wypadal poza kontener, gdzie byl obcinany (wygladalo to na brak marginesu
 * pod trescia). Wysokosc ma wynikac z flexa, nie z procentu. */
main#appMain > .wl-card.m-6 { height: auto; flex: 1 1 auto; min-height: 0; }

/* Wlasny padding naglowka na stronach .page--flush (tablica kanban), ktorych
 * nie otacza .page__inner. Na telefonie schodzi do zera - .page__head, .tabs i
 * .toolbar maja tam juz wlasne 14px i paddingi by sie sumowaly (~32px), przez
 * co naglowek stal duzo dalej od krawedzi niz kolumny tablicy pod nim. */
.page__pad { padding: var(--t-pad) var(--t-pad) 0; }
/* Naglowek strony "flush" (tablica kanban) trzyma sie tej samej ramy co
 * .page__inner na zwyklych stronach. Bez tego tytul, zakladki i filtry na
 * /tasks byly wysrodkowane w kolumnie 1320 px, a na /tasks/board zaczynaly sie
 * przy lewej krawedzi - przelaczenie zakladki przeskakiwalo w bok o kilkaset
 * pikseli na szerokim ekranie. Tablica NIE jest w .page__inner (kolumny maja
 * przewijac sie na calej szerokosci), wiec rame trzeba jej nadac osobno.
 * Kolumny dostaja ten sam limit, zeby pierwsza z nich stala pod tytulem, a nie
 * lewiej od niego - inaczej zamiast skoku mielibysmy rozjazd. */
.page--flush .page__pad,
.page--flush > .board { max-width: 1320px; margin-left: auto; margin-right: auto; width: 100%; }
.page__head {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  margin-bottom: var(--t-gap);
}
.page__head-main { min-width: 0; flex: 1 1 auto; }
.page__title { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
.page__sub { margin-top: 3px; font-size: 13px; color: var(--t-text-dim); }
.page__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Pasek narzedzi nad lista: filtry po lewej, akcje po prawej */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar__spacer { flex: 1 1 auto; }

/* ---------- 6. Karty i listy ----------------------------------------------- */
.card {
  background: var(--t-surface);
  border: 1px solid var(--t-border);
  border-radius: var(--t-r-lg);
}
.card--pad { padding: var(--t-pad); }
.card--muted { background: var(--t-surface-2); }
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px var(--t-pad);
  border-bottom: 1px solid var(--t-border);
}
.card__title { font-size: 14px; font-weight: 650; }
.card__body { padding: var(--t-pad); }
.card__foot { padding: 12px var(--t-pad); border-top: 1px solid var(--t-border); }
.card--link { transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease; display: block; }
.card--link:hover { border-color: var(--t-border-strong); box-shadow: var(--t-shadow-2); }

.list { display: flex; flex-direction: column; }
.list > * + * { border-top: 1px solid var(--t-border); }
.row {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--t-row-h); padding: 6px var(--t-pad);
  transition: background-color .12s ease;
}
.row:hover { background: var(--t-surface-2); }
/* Wiersz ma rogi proste, karta zaokraglone i NIE przycina zawartosci (celowo -
 * overflow:hidden obcieloby rozwijane listy comboboxa, ktore siedza w karcie).
 * Tlo hoveru skrajnego wiersza zamalowywalo przez to luk ramki i wygladalo to
 * jak ucieta krawedz. Skrajne wiersze dostaja wiec promien karty (minus 1px na
 * jej ramke), a dwie reguly nizej cofaja to tam, gdzie wiersz wcale nie dotyka
 * krawedzi. Pusty stan (.empty) sie NIE liczy - jest ukryty, dopoki filtr
 * czegos nie odsieje, wiec ostatni wiersz i tak konczy karte. */
.card > .list > :first-child {
  border-top-left-radius: calc(var(--t-r-lg) - 1px);
  border-top-right-radius: calc(var(--t-r-lg) - 1px);
}
.card > .list > :last-child {
  border-bottom-left-radius: calc(var(--t-r-lg) - 1px);
  border-bottom-right-radius: calc(var(--t-r-lg) - 1px);
}
/* Nad lista stoi naglowek karty - gora nalezy do niego. */
.card > :not(.list) + .list > :first-child {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
/* Pod lista jest stopka (np. "Pokaz wiecej") - dol nalezy do niej. */
.card > .list:has(~ .card__foot) > :last-child {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Wiersz z osobna akcja obok linku (ustawienia kanalu na liscie kanalow):
 * hover ma podswietlac CALY wiersz. Bez tego pasek konczy sie tam, gdzie konczy
 * sie <a class="row">, czyli tuz przed przyciskiem po prawej. */
.row-wrap { display: flex; align-items: center; }
.row-wrap:hover { background: var(--t-surface-2); }
.row-wrap > .row:hover { background: transparent; }
.row__main { flex: 1 1 auto; min-width: 0; }
.row__title { font-size: 13.5px; font-weight: 550; }
.row__meta { font-size: 12px; color: var(--t-text-mute); }
.row--dense { min-height: calc(32px * var(--t-density)); }

/* Tabela danych */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--t-text-mute); padding: 8px var(--t-pad); border-bottom: 1px solid var(--t-border);
  white-space: nowrap; background: var(--t-surface-2);
}
.table td { padding: 8px var(--t-pad); border-bottom: 1px solid var(--t-border); vertical-align: middle; }
.table tbody tr:hover { background: var(--t-surface-2); }
.table--fixed { table-layout: fixed; }
.t-scroll-x { overflow-x: auto; }

/* ---------- 7. Przyciski ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--t-control-h); padding: 0 14px;
  border-radius: var(--t-r-md); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  cursor: pointer; background: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.btn--primary { background: var(--t-accent); color: var(--t-accent-on); }
.btn--primary:hover { background: var(--t-accent-strong); }
.btn--secondary { background: var(--t-surface); border-color: var(--t-border); color: var(--t-text); }
.btn--secondary:hover { background: var(--t-surface-2); border-color: var(--t-border-strong); }
.btn--ghost { color: var(--t-text-dim); }
.btn--ghost:hover { background: var(--t-surface-3); color: var(--t-text); }
.btn--danger { background: var(--t-danger); color: #fff; }
.btn--danger:hover { filter: brightness(.94); }
.btn--danger-ghost { color: var(--t-danger); border-color: var(--t-border); background: var(--t-surface); }
.btn--danger-ghost:hover { background: var(--t-danger-soft); border-color: var(--t-danger); }
.btn--sm { height: calc(30px * var(--t-density)); padding: 0 10px; font-size: 12.5px; }
/* Wersja pod strony publiczne: ten sam komponent, wieksza plaszczyzna dotyku
 * (hero, formularz rejestracji, bramka najemcy). */
.btn--lg { height: 44px; padding: 0 20px; font-size: 14px; }
.btn--icon { width: var(--t-control-h); padding: 0; }
.btn--icon.btn--sm { width: calc(30px * var(--t-density)); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--t-surface-3); border-radius: var(--t-r-md); }
.seg__btn {
  height: calc(30px * var(--t-density)); padding: 0 12px; border: none; background: none;
  border-radius: var(--t-r-sm); font-size: 12.5px; font-weight: 600; color: var(--t-text-dim); cursor: pointer;
}
.seg__btn.is-active { background: var(--t-surface); color: var(--t-text); box-shadow: var(--t-shadow-1); }

/* ---------- 8. Formularze --------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--t-text-dim); }
.field__hint { font-size: 12px; color: var(--t-text-mute); }
.field__error { font-size: 12px; color: var(--t-danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: var(--t-control-h); padding: 0 11px;
  border-radius: var(--t-r-md); border: 1px solid var(--t-border);
  background: var(--t-surface); color: var(--t-text); font-size: 13.5px;
}
.textarea { height: auto; min-height: 96px; padding: 9px 11px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--t-text-mute); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--t-accent); box-shadow: var(--t-ring); }
.input:disabled, .select:disabled { background: var(--t-surface-3); color: var(--t-text-mute); }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%238a94a6' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
.field--inline { flex-direction: row; align-items: center; gap: 10px; }
.field--inline .field__label { width: 132px; flex: 0 0 auto; }
.switch { position: relative; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
  position: absolute; inset: 0; border-radius: 999px; background: var(--t-border-strong);
  transition: background-color .16s ease; pointer-events: none;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 999px; background: #fff; box-shadow: var(--t-shadow-1); transition: transform .16s ease;
}
.switch input:checked + .switch__track { background: var(--t-accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--t-accent); margin: 0; }

/* ---------- 9. Chipy, badge, awatary ---------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px; border-radius: var(--t-r-sm);
  font-size: 11px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap;
  background: var(--t-neutral-soft); color: var(--t-text-dim);
}
.chip--success { background: var(--t-success-soft); color: var(--t-success); }
.chip--warning { background: var(--t-warning-soft); color: var(--t-warning); }
.chip--danger  { background: var(--t-danger-soft);  color: var(--t-danger); }
.chip--info    { background: var(--t-info-soft);    color: var(--t-info); }
.chip--accent  { background: var(--t-accent-soft);  color: var(--t-accent); }
.chip--outline { background: none; border: 1px solid var(--t-border); color: var(--t-text-dim); }
.chip__dot { width: 7px; height: 7px; border-radius: 999px; flex: 0 0 auto; }

/* Priorytet: JEDEN zestaw klas, nie inline style per szablon */
.prio { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: var(--t-r-sm); font-size: 11px; font-weight: 700; }
.prio--1 { background: var(--t-info-soft); color: var(--t-info); }
.prio--2 { background: var(--t-success-soft); color: var(--t-success); }
.prio--3 { background: var(--t-warning-soft); color: var(--t-warning); }
.prio--4 { background: var(--t-danger-soft); color: var(--t-danger); }
.prio--5 { background: var(--t-danger); color: #fff; }

.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--t-danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.badge--quiet { background: var(--t-surface-3); color: var(--t-text-dim); }
.dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; display: inline-block; }

.av {
  --av-size: 28px;
  width: var(--av-size); height: var(--av-size); border-radius: 999px; flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden;
  background: var(--t-accent); color: #fff;
  font-size: calc(var(--av-size) * .38); font-weight: 650; line-height: 1;
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av--xs { --av-size: 20px; }
.av--sm { --av-size: 24px; }
.av--md { --av-size: 32px; }
.av--lg { --av-size: 40px; }
.av--xl { --av-size: 64px; }
.av-stack { display: flex; }
.av-stack .av { box-shadow: 0 0 0 2px var(--t-surface); }
.av-stack .av + .av { margin-left: -8px; }
.av-wrap { position: relative; flex: 0 0 auto; }
.av-presence {
  position: absolute; right: -1px; bottom: -1px;
  width: 10px; height: 10px; border-radius: 999px;
  box-shadow: 0 0 0 2px var(--t-surface);
}
.is-available { background: #16a34a; }
.is-away { background: #d97706; }
.is-busy { background: #dc2626; }
.is-offline { background: #94a3b8; }

/* ---------- 10. Stany puste, ladowanie, komunikaty -------------------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px 24px; text-align: center;
}
.empty__icon {
  width: 44px; height: 44px; border-radius: var(--t-r-lg);
  display: grid; place-items: center;
  background: var(--t-accent-soft); color: var(--t-accent);
}
.empty__icon svg { width: 22px; height: 22px; }
.empty__title { font-size: 14px; font-weight: 650; }
.empty__text { font-size: 13px; color: var(--t-text-dim); max-width: 42ch; }

.note {
  display: flex; gap: 10px; padding: 11px 13px;
  border-radius: var(--t-r-md); font-size: 13px;
  border: 1px solid transparent;
}
.note svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.note--info { background: var(--t-info-soft); color: var(--t-info); }
.note--success { background: var(--t-success-soft); color: var(--t-success); }
.note--warning { background: var(--t-warning-soft); color: var(--t-warning); }
.note--danger { background: var(--t-danger-soft); color: var(--t-danger); }

/* Formularz w trakcie wysylki (wl-ajax-form.js dopina .wl-form-busy). Bez tego
 * jedynym sygnalem byly wyszarzone pola - za slaby, zeby zauwazyc, ze cos leci. */
.wl-form-busy { opacity: .6; cursor: progress; transition: opacity .12s ease; }
.wl-form-busy * { pointer-events: none; }

.skel { background: var(--t-surface-3); border-radius: var(--t-r-sm); animation: t-pulse 1.4s ease-in-out infinite; }
@keyframes t-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* ---------- 11. Zakladki ---------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--t-border); overflow-x: auto; }
.tab {
  padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--t-text-dim);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab:hover { color: var(--t-text); }
.tab.is-active { color: var(--t-accent); border-bottom-color: var(--t-accent); }
.tab__count { margin-left: 6px; font-size: 11px; color: var(--t-text-mute); font-variant-numeric: tabular-nums; }

/* ---------- 12. Modale, menu, dymki ----------------------------------------- */
.overlay {
  position: fixed; inset: 0; z-index: 120; padding: 20px;
  background: rgba(11, 16, 32, .5); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.overlay[hidden] { display: none; }
.modal {
  width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
  /* Naglowek zostaje widoczny przy dlugiej liscie - inaczej przy kilkunastu
     osobach tytul i krzyzyk odjezdzaja w gore i nie ma czym zamknac. */
  background: var(--t-surface); border: 1px solid var(--t-border);
  border-radius: var(--t-r-lg); box-shadow: var(--t-shadow-3);
}
.modal__head { position: sticky; top: 0; z-index: 1; background: var(--t-surface); }
.modal--lg { max-width: 860px; }
.modal--xl { max-width: 1080px; }

/* --- 12a. Paleta polecen (Ctrl+K) - jezyk makiety command-palette ----------- */
.cmd-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(11, 16, 32, .45); backdrop-filter: blur(3px); }
.cmd-overlay.hidden { display: none; }
.cmd-box {
  max-width: 620px; margin: 11vh auto 0; background: var(--t-surface);
  border: 1px solid var(--t-border); border-radius: var(--t-r-lg);
  box-shadow: var(--t-shadow-3); overflow: hidden;
}
.cmd-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--t-border); }
.cmd-field svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--t-text-mute); }
.cmd-field input { flex: 1; min-width: 0; border: none; background: none; height: 48px; font-size: 15px; color: var(--t-text); }
/* Ramka jest na .cmd-box - ring na samym inpucie to szum (makieta go nie ma). */
.cmd-field input:focus, .cmd-field input:focus-visible { outline: none; box-shadow: none; }
.cmd-field kbd { font-size: 10px; font-weight: 650; padding: 2px 5px; border-radius: 4px; background: var(--t-surface-3); color: var(--t-text-dim); }
.cmd-list { max-height: 52vh; overflow-y: auto; padding-bottom: 6px; margin: 0; list-style: none; }
.cmd-group { padding: 8px 14px 2px; }
.cmd-item { display: flex; align-items: center; gap: 10px; padding: 8px 14px; cursor: pointer; }
.cmd-item:hover { background: var(--t-surface-2); }
.cmd-item.is-sel { background: var(--t-accent-soft); }
.cmd-item__ico { color: var(--t-text-mute); flex: 0 0 auto; display: inline-flex; }
.cmd-item__ico svg { width: 16px; height: 16px; }
.cmd-item__title { display: block; font-size: 13.5px; font-weight: 550; }
.cmd-foot { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--t-border); background: var(--t-surface-2); }
.cmd-foot kbd { font-size: 10px; font-weight: 650; padding: 2px 5px; border-radius: 4px; background: var(--t-surface-3); color: var(--t-text-dim); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--t-border); }
.modal__title { font-size: 15px; font-weight: 650; flex: 1 1 auto; }
.modal__body { padding: 20px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--t-border); }
.menu {
  min-width: 200px; padding: 5px; border-radius: var(--t-r-md);
  background: var(--t-surface); border: 1px solid var(--t-border); box-shadow: var(--t-shadow-3);
}
.menu__item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 9px; border-radius: var(--t-r-sm); font-size: 13px; text-align: left;
  border: none; background: none; cursor: pointer; color: var(--t-text);
}
.menu__item:hover { background: var(--t-surface-3); }
.menu__item svg { width: 15px; height: 15px; color: var(--t-text-mute); }
.menu__item--danger { color: var(--t-danger); }
.menu__sep { height: 1px; background: var(--t-border); margin: 5px 0; }

/* ---------- 13. Czat -------------------------------------------------------- */
/* flex: 1 1 auto - w aplikacji .chat jest dzieckiem kolumny flex (#appMain), gdzie
 * samo height:100% nie wystarcza; w makiecie jest jedynym dzieckiem, wiec nie szkodzi. */
.chat { display: flex; flex-direction: column; flex: 1 1 auto; height: 100%; min-height: 0; background: var(--t-surface); }
.chat__head {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--t-border);
}
.chat__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 16px 8px; }
.chat__day {
  display: flex; align-items: center; gap: 12px; margin: 18px 0 12px;
  font-size: 11px; font-weight: 700; color: var(--t-text-mute); text-transform: uppercase; letter-spacing: .06em;
}
.chat__day::before, .chat__day::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--t-border); }
.msg { display: flex; gap: 10px; padding: 3px 8px; border-radius: var(--t-r-md); position: relative; }
.msg:hover { background: var(--t-surface-2); }
.msg + .msg { margin-top: 10px; }
.msg + .msg.msg--grouped { margin-top: 0; }
.msg--grouped .av, .msg--grouped .msg__head { visibility: hidden; height: 0; margin: 0; overflow: hidden; }
.msg--grouped .av { width: 28px; }
/* Wiadomosc przypieta w kanale (lista wspolna, migracja 063). Delikatny pasek
   z lewej zamiast tla - tlo jest juz zajete przez :hover i podswietlenie
   deep-linku, a te trzy stany musza dac sie rozroznic naraz. */
.msg.wl-msg-pinned { box-shadow: inset 2px 0 0 var(--t-accent); }
.msg__body { min-width: 0; flex: 1 1 auto; }
.msg__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg__author { font-size: 13.5px; font-weight: 650; }
.msg__time { font-size: 11px; color: var(--t-text-mute); font-variant-numeric: tabular-nums; }
.msg__text { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg__actions {
  position: absolute; top: -12px; right: 10px; display: none; gap: 2px; padding: 2px;
  background: var(--t-surface); border: 1px solid var(--t-border);
  border-radius: var(--t-r-md); box-shadow: var(--t-shadow-2);
}
.msg:hover .msg__actions { display: flex; }
/* Kebab otwarty: menu wisi poza wiadomoscia, wiec kursor schodzi z .msg -
 * bez tego pasek akcji znika razem z hoverem, a menu zostaje "bez rodzica". */
.msg__actions.open { display: flex; }
.msg__actions:focus-within { display: flex; }
.reactions { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.reaction {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  border-radius: 999px; border: 1px solid var(--t-border); background: var(--t-surface);
  font-size: 12px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.reaction.is-mine { border-color: var(--t-accent); background: var(--t-accent-soft); color: var(--t-accent); font-weight: 650; }
.composer { flex: 0 0 auto; padding: 12px 16px 16px; }
.composer__box {
  border: 1px solid var(--t-border); border-radius: var(--t-r-lg);
  background: var(--t-surface); overflow: hidden;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.composer__box:focus-within { border-color: var(--t-accent); box-shadow: var(--t-ring); }
.composer__input { padding: 11px 13px; min-height: 42px; font-size: 14px; line-height: 1.5; }
/* :not(.wl-msg-editor) - edytor kompozera (contenteditable z formatowaniem) ma
 * wlasny placeholder na .wl-msg-editor--empty; bez tego wyjatku po wyczyszczeniu
 * pola oba renderowaly sie jeden na drugim. */
.composer__input:empty:not(.wl-msg-editor)::before { content: attr(data-placeholder); color: var(--t-text-mute); }
.composer__bar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-top: 1px solid var(--t-border); }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--t-r-sm); border: none; background: none; color: var(--t-text-dim); cursor: pointer;
}
.icon-btn:hover { background: var(--t-surface-3); color: var(--t-text); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn--danger:hover { color: var(--t-danger); background: var(--t-danger-soft); }
.mention { color: var(--t-accent); background: var(--t-accent-soft); border-radius: 4px; padding: 0 4px; font-weight: 600; }
@media (max-width: 767px) {
  /* Na telefonie naglowek czatu ma miescic tytul + akcje bez zgniatania ich do zera. */
  .chat__head { gap: 6px; padding: 8px 10px; }
  .chat__scroll { padding: 10px 8px 6px; }
  .composer { padding: 8px 10px 12px; }
  .msg__actions { top: -14px; right: 4px; }
  /* Nazwa kanalu stoi juz w pasku aplikacji ("Ibiza / #general") - drugi raz
   * tylko zabiera szerokosc akcjom i i tak urywa sie po trzech znakach.
   * Blok zostaje jako spacer (t-grow), zeby akcje trzymaly sie prawej. */
  .chat__head-id > * { display: none; }
  /* Licznik "6 osob" zastapiony awatarami. Pokazujemy CZTERY plus szary chip
   * "+N", dokladnie jak na desktopie - wczesniej telefon ucinal do trzech i
   * gubil chip, wiec nie bylo widac, ze kogos brakuje. Miejsce sie znalazlo,
   * odkad akcje przenioslo sie pod "kropki". Pelna lista jest pod klikniecem. */
  .chat__head-people .av:nth-child(n+6) { display: none; }
  /* Awatary na lewo (przed spacerem), akcje pod "kropkami" po prawej. */
  .chat__head-people { order: -1; }
  /* !important, bo .btn/.icon-btn ustawiaja display, a wl2.css laduje sie
   * po styles.css - sama klasa bez !important by tu przegrala. */
  .chat__head-act { display: none !important; }
  .chat__head-more-wrap { display: block; }
}

/* ---------- 13b. Odtwarzacz nagran (wl-player.js) --------------------------
 * Przerobka odtwarzacza z clickplay na tokeny --t-*. Scena jest zawsze ciemna
 * (wideo oglada sie na czarnym tle niezaleznie od motywu aplikacji), ale
 * akcent i promienie ida z systemu. */
.wlp {
  position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000;
  border-radius: var(--t-r-lg); overflow: hidden; outline: none;
  display: flex; align-items: center; justify-content: center;
}
.wlp:fullscreen, .wlp.is-fs { border-radius: 0; aspect-ratio: auto; height: 100%; }
.wlp video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.wlp__big {
  position: absolute; inset: 0; margin: auto; width: 68px; height: 68px;
  display: grid; place-items: center; border: none; cursor: pointer;
  border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff;
  transition: opacity .15s ease, transform .15s ease;
}
.wlp__big svg { width: 30px; height: 30px; margin-left: 3px; }
.wlp.is-playing .wlp__big { opacity: 0; pointer-events: none; transform: scale(.9); }
.wlp__spin { display: none; position: absolute; width: 34px; height: 34px; border-radius: 999px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; animation: wlp-spin .8s linear infinite; }
.wlp.is-loading .wlp__spin { display: block; }
@keyframes wlp-spin { to { transform: rotate(360deg); } }
.wlp__error { display: none; position: absolute; inset: 0; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.8); color: #fff; text-align: center; padding: 20px; }
.wlp.is-error .wlp__error { display: flex; }
.wlp__error svg { width: 28px; height: 28px; opacity: .8; }
.wlp__ctrl {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px 8px;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  opacity: 0; transition: opacity .15s ease;
}
.wlp:hover .wlp__ctrl, .wlp:focus-within .wlp__ctrl, .wlp:not(.is-playing) .wlp__ctrl { opacity: 1; }
.wlp__prog { position: relative; padding: 7px 0; cursor: pointer; }
.wlp__track { position: relative; height: 4px; border-radius: 999px; background: rgba(255,255,255,.28); }
.wlp__buf { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: rgba(255,255,255,.4); }
.wlp__played { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--t-accent); }
.wlp__knob { position: absolute; top: 50%; left: 0; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 999px; background: var(--t-accent); opacity: 0; transition: opacity .12s ease; }
.wlp__prog:hover .wlp__knob { opacity: 1; }
.wlp__tip { position: absolute; bottom: 20px; transform: translateX(-50%); padding: 2px 6px; border-radius: var(--t-r-sm); background: rgba(0,0,0,.8); color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0; pointer-events: none; }
.wlp__prog:hover .wlp__tip { opacity: 1; }
.wlp__row { display: flex; align-items: center; gap: 4px; }
.wlp__btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto;
  border: none; background: none; color: #fff; cursor: pointer; border-radius: var(--t-r-sm);
  font-size: 12.5px; font-weight: 650; text-decoration: none;
}
.wlp__btn:hover { background: rgba(255,255,255,.16); }
.wlp__btn svg { width: 19px; height: 19px; }
.wlp__rate { width: auto; padding: 0 8px; font-variant-numeric: tabular-nums; }
.wlp__vol { width: 0; overflow: hidden; transition: width .15s ease; }
.wlp__row:hover .wlp__vol, .wlp__vol:focus-within { width: 72px; }
.wlp__vol-track { position: relative; height: 4px; margin: 0 8px; border-radius: 999px; background: rgba(255,255,255,.28); cursor: pointer; }
.wlp__vol-fill { position: absolute; inset: 0 auto 0 0; width: 100%; border-radius: 999px; background: #fff; }
.wlp__time { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; padding: 0 6px; white-space: nowrap; }
.wlp__time span { opacity: .7; margin-left: 4px; }
.wlp__spacer { flex: 1 1 auto; }

.wlp-overlay { padding: 24px; }
.wlp-modal { width: 100%; max-width: 980px; background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-r-lg); box-shadow: var(--t-shadow-3); overflow: hidden; }
.wlp-modal__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--t-border); }
.wlp-modal__title { font-size: 15px; font-weight: 650; }
.wlp-modal__sub { font-size: 12px; color: var(--t-text-mute); margin-top: 1px; }
.wlp-modal__stage { background: #000; }
@media (max-width: 767px) {
  .wlp-overlay { padding: 0; align-items: flex-start; }
  .wlp-modal { max-width: none; height: 100%; border-radius: 0; border: none; }
}

/* ---------- 14. Tablica kanban ---------------------------------------------- */
.board { display: flex; gap: 12px; height: 100%; padding: var(--t-pad); overflow-x: auto; align-items: flex-start; }
.board__col {
  width: 300px; flex: 0 0 auto; max-height: 100%;
  display: flex; flex-direction: column; min-height: 200px;
  background: var(--t-surface-2); border: 1px solid var(--t-border); border-radius: var(--t-r-lg);
}
.board__col-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--t-border);
}
.board__col-body { flex: 1 1 auto; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.tcard {
  background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-r-md);
  padding: 10px 11px; cursor: grab; box-shadow: var(--t-shadow-1);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.tcard:hover { border-color: var(--t-border-strong); box-shadow: var(--t-shadow-2); }
/* Karta bez przeciagania (tablica globalna) - kursor nie moze obiecywac chwytu. */
.tcard--static { cursor: pointer; }
.tcard__title { font-size: 13px; font-weight: 550; line-height: 1.4; margin-bottom: 8px; }
.tcard__foot { display: flex; align-items: center; gap: 6px; }
@media (max-width: 767px) {
  /* scroll-padding, nie samo padding: przy scroll-snap przegladarka dosuwa
   * poczatek kolumny do poczatku obszaru przewijania, przez co sama zjezdzala
   * o szerokosc paddingu (scrollLeft=14) i pierwsza kolumna i tak lezala na
   * krawedzi. scroll-padding przesuwa punkt zaczepienia razem z nim. */
  .board { scroll-snap-type: x mandatory; scroll-padding-left: 14px; }
  .board__col { width: 84vw; scroll-snap-align: start; }
}

/* ---------- 15. Kalendarz --------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--t-border); border-top: 1px solid var(--t-border); border-radius: var(--t-r-lg); overflow: hidden; background: var(--t-surface); }
.cal__dow { padding: 7px 8px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--t-text-mute); background: var(--t-surface-2); border-right: 1px solid var(--t-border); border-bottom: 1px solid var(--t-border); }
.cal__day { min-height: 108px; padding: 6px; border-right: 1px solid var(--t-border); border-bottom: 1px solid var(--t-border); display: flex; flex-direction: column; gap: 4px; }
.cal__day.is-out { background: var(--t-surface-2); }
.cal__num { font-size: 12px; font-weight: 650; color: var(--t-text-dim); font-variant-numeric: tabular-nums; }
.cal__day.is-today .cal__num { background: var(--t-accent); color: #fff; border-radius: 999px; width: 20px; height: 20px; display: grid; place-items: center; }
.cal__ev { font-size: 11.5px; padding: 2px 6px; border-radius: var(--t-r-sm); background: var(--t-accent-soft); color: var(--t-accent); font-weight: 600; cursor: pointer; }
.cal__ev--success { background: var(--t-success-soft); color: var(--t-success); }
.cal__ev--warning { background: var(--t-warning-soft); color: var(--t-warning); }

/* ---------- 16. Wykresy / statystyki ---------------------------------------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat { background: var(--t-surface); border: 1px solid var(--t-border); border-radius: var(--t-r-lg); padding: 14px 16px; }
.stat__label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t-text-mute); }
.stat__value { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat__delta { font-size: 12px; font-weight: 600; margin-top: 2px; }
.bar { height: 6px; border-radius: 999px; background: var(--t-surface-3); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--t-accent); }
.bar__fill--success { background: var(--t-success); }
.bar__fill--warning { background: var(--t-warning); }

/* ---------- 17. Dolna nawigacja (telefon) ----------------------------------- */
.botnav { display: none; }
@media (max-width: 767px) {
  .botnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    height: calc(54px + var(--t-safe-b, 0px));
    padding-bottom: var(--t-safe-b, 0px);
    display: flex; background: var(--t-surface); border-top: 1px solid var(--t-border);
  }
  .botnav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 10px; font-weight: 600; color: var(--t-text-dim); position: relative;
  }
  .botnav__item svg { width: 20px; height: 20px; }
  .botnav__item.is-active { color: var(--t-accent); }
  .main { padding-bottom: calc(54px + var(--t-safe-b, 0px)); }
}

/* ---------- 18. Strony publiczne (marketing / auth) ------------------------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; background: var(--t-surface); }
.pub__nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 24px;
  background: color-mix(in srgb, var(--t-surface) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--t-border);
}
.pub__wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.pub__hero { padding: 72px 0 56px; }
.pub__h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 700; letter-spacing: -.03em; line-height: 1.08; }
.pub__lead { margin-top: 16px; font-size: 17px; line-height: 1.6; color: var(--t-text-dim); max-width: 58ch; }
.pub__foot { margin-top: auto; border-top: 1px solid var(--t-border); padding: 32px 0; color: var(--t-text-dim); font-size: 13px; }
.feature { padding: 20px; border: 1px solid var(--t-border); border-radius: var(--t-r-lg); background: var(--t-surface); }
.feature__icon { width: 36px; height: 36px; border-radius: var(--t-r-md); display: grid; place-items: center; background: var(--t-accent-soft); color: var(--t-accent); margin-bottom: 12px; }
.feature__icon svg { width: 19px; height: 19px; }

/* --- 18a. Podstrony publiczne: jedna kolumna -------------------------------
 * Rejestracja, kontakt, onboarding, dokumenty prawne. Wczesniej kazda z nich
 * miala wlasny <main style="max-width:...;padding-top:..."> - trzy rozne
 * szerokosci i cztery rozne rytmy naglowka. */
.pub-page { width: 100%; margin: 0 auto; padding: 48px 24px 0; }
.pub-page--sm { max-width: 520px; }
.pub-page--md { max-width: 620px; }
.pub-page--lg { max-width: 780px; }
.pub-page__head { text-align: center; margin-bottom: 26px; }
.pub-page__head .pub__lead { margin-left: auto; margin-right: auto; }
.pub-page__form { display: flex; flex-direction: column; gap: 16px; }
/* Ikona potwierdzenia (rejestracja gotowa, haslo ustawione). */
.pub-mark {
  width: 64px; height: 64px; margin: 0 auto; border-radius: var(--t-r-lg);
  display: grid; place-items: center; background: var(--t-accent-soft); color: var(--t-accent);
}
.pub-mark svg { width: 32px; height: 32px; }
/* Karta z adresem zespolu: slug wyrozniony, sufiks wyciszony. */
.pub-slug { font-size: 20px; font-weight: 700; letter-spacing: -.02em; word-break: break-all; }
.pub-slug span { color: var(--t-text-mute); font-weight: 600; }

/* Pole subdomeny (slug + sufiks domeny) - jeden komponent dla hero landingu i
 * formularza rejestracji. Domyslnie ma wysokosc zwyklej kontrolki, zeby w
 * formularzu nie sasiadowaly dwie rozne wysokosci pola (D1 z audytu); hero
 * bierze wariant --lg. Nazwy .tl-domain/.tl-suffix/.tl-status oraz stany
 * .tl-ok/.tl-bad to KONTRAKT z teamlayer-marketing.js - nie zmieniac. */
/* Wysokosc siedzi na ramce (border-box), a nie na samym <input> - inaczej pole
 * jest o grubosc obramowania wyzsze niz .input obok niego w tym samym
 * formularzu. */
.tl-domain {
  display: flex; align-items: stretch; width: 100%; overflow: hidden;
  height: var(--t-control-h);
  border: 1px solid var(--t-border); border-radius: var(--t-r-md); background: var(--t-surface);
}
.tl-domain:focus-within { border-color: var(--t-accent); box-shadow: var(--t-ring); }
.tl-domain input {
  flex: 1 1 auto; min-width: 0; height: 100%; border: none; outline: none; background: none;
  padding: 0 11px; font-size: 13.5px; font-weight: 600; color: var(--t-text);
}
.tl-domain .tl-suffix {
  display: flex; align-items: center; height: 100%; padding: 0 11px; white-space: nowrap;
  background: var(--t-surface-3); color: var(--t-text-dim); font-size: 13px; font-weight: 600;
}
.tl-domain--lg { height: 48px; }
.tl-domain--lg input { padding: 0 13px; font-size: 15px; }
.tl-domain--lg .tl-suffix { padding: 0 13px; font-size: 14px; }
.tl-domain.tl-ok { border-color: var(--t-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-success) 20%, transparent); }
.tl-domain.tl-bad { border-color: var(--t-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-danger) 20%, transparent); }
.tl-status { font-size: 12px; font-weight: 600; min-height: 18px; margin-top: 6px; }
.tl-status.tl-ok { color: var(--t-success); }
.tl-status.tl-bad { color: var(--t-danger); }
.tl-status.tl-checking { color: var(--t-text-mute); }

/* Wybor planu przy rejestracji: karta-radio. Bez :has() (starsza przegladarka)
 * zostaje zwykla ramka z widocznym radiem - wybor nadal czytelny. */
.pick-row { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.pick {
  display: block; padding: 11px; text-align: center; cursor: pointer;
  border: 1px solid var(--t-border); border-radius: var(--t-r-md); background: var(--t-surface);
  transition: border-color .14s ease;
}
.pick:hover { border-color: var(--t-border-strong); }
.pick input { accent-color: var(--t-accent); margin-right: 5px; }
.pick:has(input:checked) { border-color: var(--t-accent); box-shadow: var(--t-ring); }
.pick__name { font-size: 13.5px; font-weight: 650; }
.pick__meta { font-size: 11px; color: var(--t-text-mute); margin-top: 3px; }

/* Odznaki sklepow (App Store / Google Play) na stronie pobierania. Wlasne, w
 * konwencji sklepowej - oficjalne pliki Apple/Google maja swoje wytyczne i
 * warto je podmienic na dzien premiery. `is-soon` = aplikacji jeszcze nie ma,
 * wiec odznaka jest wyciszona i NIE jest linkiem. */
.store-badge {
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 18px; border-radius: var(--t-r-md);
  background: #111827; color: #fff; border: 1px solid #111827;
}
.store-badge__logo { width: 26px; height: 26px; flex: 0 0 auto; }
.store-badge__text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.store-badge__text small { font-size: 10px; letter-spacing: .02em; opacity: .85; }
.store-badge__text strong { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.store-badge.is-soon { opacity: .45; filter: grayscale(1); cursor: default; }

/* Dokumenty (regulamin, polityka prywatnosci) - rytm czytania, nie interfejsu. */
.doc { max-width: 72ch; }
.doc section { margin-top: 26px; }
.doc h2 { font-size: 19px; font-weight: 650; letter-spacing: -.015em; }
.doc p { margin-top: 8px; font-size: 15px; line-height: 1.7; color: var(--t-text-dim); }

/* Bramka najemcy: pelny ekran, jedna karta na srodku (osobny layout - ta strona
 * nie ma naglowka ani stopki marketingu). */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 48px 20px; }
.gate__card { width: 100%; max-width: 480px; text-align: center; padding: 36px; }

.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--t-surface); }
@media (min-width: 940px) { .auth { grid-template-columns: 1.02fr 1fr; } }
/* Ekrany bez panelu brandowego (wybor zespolu, przyjecie zaproszenia) - jedna
 * kolumna na kazdej szerokosci. Wczesniej siadaly w LEWEJ kolumnie ukladu
 * dwukolumnowego, z pusta polowa ekranu obok. */
.auth--single { grid-template-columns: 1fr !important; }
.auth__aside {
  display: none; position: relative; overflow: hidden; padding: 48px;
  color: #fff; flex-direction: column;
  background: linear-gradient(155deg, #4a4eb4 0%, #5b5fc7 46%, #7b5cd6 100%);
}
@media (min-width: 940px) { .auth__aside { display: flex; } }
.auth__aside::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(680px 480px at 26% 26%, #000, transparent 74%);
}
.auth__main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth__card { width: 100%; max-width: 384px; }
.auth__card--wide { max-width: 460px; }
.auth__logo { display: flex; justify-content: center; margin-bottom: 22px; font-size: 18px; }
/* Tresc panelu brandowego: logo u gory, obietnica produktu na dole. */
.auth__brand { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.auth__brand-logo { align-self: flex-start; font-size: 22px; }
.auth__pitch { margin-top: auto; }
.auth__pitch h1 { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; max-width: 18ch; }
.auth__pitch p { margin-top: 16px; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .82); max-width: 34ch; }
.auth__points { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.auth__points li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255, 255, 255, .9); }
.auth__points li::before {
  content: "\2713"; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px;
  background: rgba(255, 255, 255, .16); display: inline-flex; align-items: center; justify-content: center;
}
.auth__title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; text-align: center; }
.auth__sub { margin-top: 6px; text-align: center; font-size: 13.5px; color: var(--t-text-dim); }
.auth__form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.auth__alt { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--t-text-dim); }
/* Przelacznik jezyka lezy nad JASNA kolumna formularza (panel brandowy jest po
 * lewej), wiec zwykly .seg - wczesniej powyzej 900 px robil sie bialy i gubil
 * sie na bialym tle. */
.auth__lang { position: fixed; top: 16px; right: 16px; z-index: 30; }
.auth__lang a { display: inline-flex; align-items: center; }
/* Autouzupelnianie przegladarki maluje wlasne tlo (niebieskie/zolte) - pole
 * wygladaloby inaczej niz sasiednie. */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--t-text);
  -webkit-box-shadow: 0 0 0 1000px var(--t-surface) inset;
  caret-color: var(--t-text);
}

/* ---------- 19. Logo -------------------------------------------------------- */
.logo { display: inline-flex; align-items: center; gap: 7px; color: var(--t-accent); }
.logo svg { width: 1.85em; height: 1.85em; fill: var(--t-surface); }
.logo__text { font-size: 1.28rem; font-weight: 800; letter-spacing: -.025em; color: inherit; }
.logo--light { color: #fff; }
.logo--light svg { fill: transparent; }

/* ---------- 19b. Stany drag-drop tablicy ------------------------------------ */
/* Wczesniej: bg-blue-50 / ring-blue-300 / opacity-50 wprost w JS - kolory poza
 * tokenami i niewidoczne w dark mode. */
.kanban-dropzone.is-dropzone-over {
  background: var(--t-accent-soft);
  box-shadow: inset 0 0 0 2px var(--t-accent);
  border-radius: var(--t-r-md);
}
.tcard.is-dragging { opacity: .5; }
.tcard.is-just-moved { box-shadow: 0 0 0 2px var(--t-accent); }
/* Gestosc tablicy: tryb Kompakt (seg w toolbarze tablicy). */
.board--compact .tcard { padding: 6px 9px; }
.board--compact .tcard__title { font-size: 12.5px; margin-bottom: 4px; }
.board--compact .board__col-body { gap: 6px; }

/* ---------- 20. Ukladki podstron aplikacji ---------------------------------- */
/* Pulpit: kolumna glowna + kolumna kontekstowa. Ponizej 1280 px kolumna
 * kontekstowa laduje pod trescia (a nie znika - wzmianki i sprint sa potrzebne
 * takze na tablecie i telefonie). */
.wl-dash-grid { grid-template-columns: minmax(0, 1fr) 340px; }
/* Prawa kolumna pulpitu ma 340px i czesto JEDEN wiersz w karcie ("Workspaces"
 * z jednym obszarem). Rytm var(--t-pad) = 20px robil z takiej karty pudelko
 * wypelnione glownie powietrzem - tutaj wystarczy ciasniej. Zwezenie dotyczy
 * tylko tej kolumny, glowna zostaje na pelnym rytmie. */
.wl-dash-aside .card__head { padding: 10px 14px; }
.wl-dash-aside .card__body { padding: 14px; }
.wl-dash-aside .card__foot { padding: 10px 14px; }
.wl-dash-aside .row { padding-left: 14px; padding-right: 14px; }
@media (max-width: 1279px) {
  .wl-dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  /* Filtry jeden pod drugim - trzy selecty nie mieszcza sie w rzedzie. */
  .wl-dash-filters { width: 100%; flex-direction: column; align-items: stretch; }
  .wl-dash-filters > div { width: 100%; min-width: 0 !important; }
  /* Naglowek karty moze sie zawinac: tytul ("Otwarte zadania (61)") idzie nad
   * pelnoszerokie filtry zamiast stac obok nich i je zgniatac. */
  .card__head { flex-wrap: wrap; }
  .card__head .card__title { flex: 1 1 auto; }
  /* Karty od krawedzi do krawedzi: telefon nie ma miejsca na marginesy strony. */
  .page__inner { padding: 0; }
  .page__head { padding: 12px 14px 0; margin-bottom: 12px; }
  .card { border-radius: 0; border-left: 0; border-right: 0; }
  .stats { padding: 0 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card__head, .card__body, .card__foot, .row { padding-left: 14px; padding-right: 14px; }
  /* Modal trzyma ten sam rytm co karta. Bez tego naglowek zostawal na 20px,
   * a wiersze w srodku mialy juz 14px - krzyzyk zamykania stal wtedy 6px
   * bardziej w lewo niz ikony w wierszach pod nim. */
  .modal__head, .modal__body, .modal__foot { padding-left: 14px; padding-right: 14px; }
  /* Strony .page--flush: zerujemy ich wlasny padding, zeby nie sumowal sie z
   * 14px naglowka/zakladek/filtrow. Kolumny tablicy dostaja te same 14px, wiec
   * wszystko na stronie ma jedna lewa krawedz. */
  .page__pad { padding: 0; }
  .board { padding: 12px 14px; }
  /* Docs: uklad dwukolumnowy (lista stron 256px + tresc) nie miesci sie na
   * telefonie - tresci zostawalo ~100px i lamala po jednym slowie. Kolumny
   * skladaja sie w pion, lista stron dostaje wlasny limit wysokosci. */
  [data-doc-root] { flex-direction: column; }
  [data-doc-root] > aside {
    width: 100%; max-height: 40vh; flex: 0 0 auto;
    border-right: 0; border-bottom: 1px solid var(--t-border);
  }
  /* Ten sam rytm w tabelach (sprinty globalne) - domyslne var(--t-pad) zjadalo
   * na telefonie prawie 18px z kazdej strony komorki. */
  .table th, .table td { padding-left: 14px; padding-right: 14px; }
  /* Od krawedzi do krawedzi maja isc KARTY, nie wolnostojace kontrolki.
   * Zakladki i pasek filtrow siedza wprost w .page__inner (padding 0), wiec
   * bez tego szukajka i "Tylko moje" dotykaly krawedzi ekranu. */
  .tabs, .toolbar { padding-left: 14px; padding-right: 14px; }
  /* Sztywne width:240px na szukajce zostawialo dziure z prawej - na telefonie
   * pole bierze caly wiersz, a selecty ustawiaja sie pod nim. */
  .toolbar > .input { width: 100% !important; flex: 1 1 100%; min-width: 0; }
}

/* ---------- 20b. Powloka: rail, drzewo, menu konta -------------------------
 * Markup powloki zostaje (JS realtime trzyma sie tych samych id i klas), ale
 * wyglad przechodzi na jezyk redesignu: aktywna pozycja z paskiem po lewej
 * (G3 - nie tylko tlo), sekcje w railu, jeden rytm wiersza w drzewie. */
.wl-rail-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--t-accent-strong);
}
.wl-rail-item { position: relative; border-radius: var(--t-r-md); }
.wl-rail-sep {
  width: 28px; height: 1px; flex: 0 0 auto; margin: 8px 0;
  background: rgba(255, 255, 255, .14);
}
/* Awatar konta = przycisk menu (H1/H2). */
.wl-rail-avatar {
  width: 34px; height: 34px; margin-top: 4px; flex: 0 0 auto;
  border: none; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: 999px; display: grid; place-items: center;
  background: var(--t-accent); color: #fff; font-size: 12px; font-weight: 650;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .16);
}
.wl-rail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wl-rail-avatar[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--t-accent-strong); }
.wl-account-menu {
  position: fixed; left: 78px; bottom: 12px; z-index: 150; min-width: 244px;
}
.wl-account-menu[hidden] { display: none; }
.wl-account-menu__head { display: flex; gap: 10px; align-items: center; padding: 10px 9px 8px; }
@media (max-width: 767px) {
  /* Rail jest schowany na telefonie - menu wjezdza od dolu, nad paskiem nawigacji. */
  .wl-account-menu { left: 10px; right: 10px; bottom: calc(62px + var(--t-safe-b, 0px)); }
}
/* Filtr drzewa */
.wl-tree-filter-wrap { padding: 8px 10px 4px; }
/* Jeden rytm wiersza w drzewie: workspace, kanal i rozmowa maja te sama
 * wysokosc i te sama reakcje na hover (H5 - dzis trzy rozne wysokosci). */
#sidebar .workspace-toggle,
#sidebar a[href*="/channels/"],
#sidebar a[href*="/chat"] {
  min-height: calc(30px * var(--t-density));
  border-radius: var(--t-r-sm);
}
#sidebar .wl-pin-on { color: var(--t-warning); }
/* Wskaznik obecnosci na awatarze rozmowy: jedna kropka z tokenow, zamiast
 * text-emerald-600 / text-red-500 / text-amber-500 wpisanych w JS (B1). */
.vv-call-avatar-badge { background: var(--t-surface); border-color: var(--t-border) !important; }
.wl-presence-ico { display: inline-flex; align-items: center; justify-content: center; }
.wl-presence-ico svg { width: 14px; height: 14px; }
/* Pinezka pojawia sie na hover wiersza - bez migotania ikony w innym kolorze. */
#wlBottomNav .wl-bottom-badge { background: var(--t-danger); }

/* ---------- 21. Mostki do komponentow legacy -------------------------------
 * Klasy .wl-* zyja jeszcze na czesci podstron. Zamiast czekac na przepisanie
 * kazdej z nich, sciagamy je do TEGO SAMEGO jezyka: jedna wysokosc kontrolki,
 * jeden promien, jeden pierscien focusa. D1/D2 i C1 z audytu przestaja byc
 * widoczne od razu, a nie po ostatnim przepisanym pliku. */
.wl-card { border-radius: var(--t-r-lg); }
.wl-input {
  height: var(--t-control-h); padding: 0 11px;
  border-radius: var(--t-r-md); border: 1px solid var(--t-border);
  background: var(--t-surface); color: var(--t-text); font-size: 13.5px;
}
textarea.wl-input { height: auto; padding: 9px 11px; }
.wl-input:focus { outline: none; border-color: var(--t-accent); box-shadow: var(--t-ring); }
.wl-chip {
  height: 20px; padding: 0 7px; border-radius: var(--t-r-sm);
  font-size: 11px; font-weight: 700; letter-spacing: -.01em;
  background: var(--t-neutral-soft); color: var(--t-text-dim);
}
.wl-avatar {
  width: 24px; height: 24px; border-radius: 999px; flex: 0 0 auto;
  display: inline-grid; place-items: center; overflow: hidden;
  background: var(--t-accent); color: #fff; font-size: 10px; font-weight: 650;
}
/* Rozwijana lista (wl-combobox.js) - ten sam wyglad co .select, bo inaczej
 * w jednym formularzu sasiaduja dwie wysokosci pola. */
.wl-cb-trigger {
  height: var(--t-control-h); padding: 0 11px !important;
  border-radius: var(--t-r-md) !important; border: 1px solid var(--t-border);
  background: var(--t-surface); color: var(--t-text);
  font-size: 13.5px; font-weight: 500 !important; box-shadow: none !important;
}
.wl-cb-trigger:hover { border-color: var(--t-border-strong); background: var(--t-surface); }
.wl-cb-panel { border-radius: var(--t-r-md) !important; box-shadow: var(--t-shadow-3) !important; }
.wl-cb-option { font-size: 13px; }
/* Pole koloru. Domyslnie przegladarka rysuje probke z wlasnym paddingiem i
 * ramka, a `.input` dokłada jeszcze `padding: 0 11px` - efekt to maly prostokat
 * plywajacy w srodku pola z widoczna jasna obwodka. Tu probka wypelnia CALE
 * pole: zerowy padding, brak ramki wokol probki, a zaokraglenie dziedziczone
 * z samego pola (`inherit`), zeby dzialalo niezaleznie od tego, czy element ma
 * `rounded`, `rounded-lg` czy `--t-r-md`. `overflow: hidden` pilnuje, zeby rogi
 * probki nie wystawaly poza obramowanie. */
.wl-color-input {
  padding: 0 !important;
  cursor: pointer;
  overflow: hidden;
  background: var(--t-surface);
}
.wl-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.wl-color-input::-webkit-color-swatch { border: none; border-radius: inherit; }
.wl-color-input::-moz-color-swatch { border: none; border-radius: inherit; }
/* Wyszukiwarka w gornym pasku = ten sam komponent co .search-btn. */
.wl-search-btn {
  height: 32px; border-radius: var(--t-r-md);
  border: 1px solid var(--t-border); background: var(--t-surface-2);
  color: var(--t-text-mute); font-size: 13px;
}

/* ---------- 22. Landing: rytm sekcji i podglad produktu -------------------- */
.sec { padding: 72px 0; }
.sec--tight { padding: 48px 0; }
.sec__head { max-width: 60ch; margin: 0 auto 40px; text-align: center; }
.sec__h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.025em; line-height: 1.15; margin-top: 10px; }

/* J1: landing nie pokazywal ANI JEDNEGO ekranu produktu. .shot to stylizowana
 * ramka przegladarki z uproszczonym widokiem aplikacji - rysowana z tokenow,
 * nie zrzut ekranu, wiec zawsze zgadza sie z aktualnym designem i nie pokazuje
 * niczyich danych. */
.shot {
  border: 1px solid var(--t-border); border-radius: var(--t-r-lg);
  background: var(--t-surface); box-shadow: var(--t-shadow-3); overflow: hidden;
}
.shot__bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  border-bottom: 1px solid var(--t-border); background: var(--t-surface-2);
}
.shot__dot { width: 9px; height: 9px; border-radius: 999px; background: var(--t-border-strong); flex: 0 0 auto; }
.shot__body { display: grid; grid-template-columns: 56px 190px 1fr; height: 320px; }
.shot__rail { background: var(--t-rail); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0; }
.shot__rail i { width: 26px; height: 26px; border-radius: var(--t-r-sm); background: rgba(255, 255, 255, .14); display: block; }
.shot__rail i:first-child { background: var(--t-accent); }
.shot__tree { background: var(--t-surface); border-right: 1px solid var(--t-border); padding: 12px 10px; }
.shot__main { background: var(--t-surface-2); padding: 14px; min-width: 0; }
.shot__line { height: 9px; border-radius: 999px; background: var(--t-surface-3); margin-bottom: 9px; }
@media (max-width: 767px) {
  .sec { padding: 48px 0; }
  .shot__body { grid-template-columns: 44px 1fr; height: 240px; }
  .shot__tree { display: none; }
}

.cta-band {
  border-radius: var(--t-r-lg); padding: 48px 28px; text-align: center; color: #fff;
  background: linear-gradient(150deg, #4a4eb4 0%, #5b5fc7 45%, #7b5cd6 100%);
}

/* Pasek makiety (przelacznik current/next) mieszka w assets/mock.css - jest
 * wspolny dla obu wersji, wiec nie moze zalezec od tokenow --t-*. */

/* ===== Dokumenty (wiki) - drzewo stron, artykul, chipy zadan, osadzone listy ===== */
.wl-doc-treeitem {
  display: block; padding: 6px 10px; font-size: 13px; color: var(--t-text-dim);
  border-left: 2px solid transparent; text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wl-doc-treeitem:hover { background: var(--t-surface-2); color: var(--t-text); }
.wl-doc-treeitem.active { color: var(--t-accent); border-left-color: var(--t-accent); background: var(--t-surface-2); font-weight: 600; }

.wl-doc-article { max-width: 760px; margin: 0 auto; padding: 28px 32px 64px; font-size: 15px; line-height: 1.65; color: var(--t-text); }
.wl-doc-article h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 26px 0 10px; }
.wl-doc-article h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 24px 0 8px; }
.wl-doc-article h3 { font-size: 16px; font-weight: 650; margin: 18px 0 6px; }
.wl-doc-article p { margin: 10px 0; }
.wl-doc-article ul, .wl-doc-article ol { margin: 10px 0 10px 22px; }
.wl-doc-article ul { list-style: disc; }
.wl-doc-article ol { list-style: decimal; }
.wl-doc-article li { margin: 3px 0; }
.wl-doc-article blockquote { border-left: 3px solid var(--t-border-strong); padding: 2px 14px; margin: 12px 0; color: var(--t-text-dim); }
.wl-doc-article pre { background: var(--t-surface-2); border: 1px solid var(--t-border); border-radius: var(--t-r-md); padding: 12px 14px; overflow-x: auto; font-size: 13px; margin: 12px 0; }
.wl-doc-article code { background: var(--t-surface-2); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.wl-doc-article pre code { background: none; padding: 0; }
.wl-doc-article a { color: var(--t-accent); }
.wl-doc-link { color: var(--t-accent); text-decoration: underline; }
.wl-doc-code { display: inline-block; background: var(--t-surface-2); border: 1px solid var(--t-border); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, monospace; font-size: 11px; white-space: pre; vertical-align: middle; }

/* Chip zadania (PROJ-123 w tekscie strony) - zywy status z linkiem. */
.wl-doc-taskchip {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: baseline;
  background: var(--t-surface-2); border: 1px solid var(--t-border); border-radius: 999px;
  padding: 1px 9px 1px 6px; font-size: 12.5px; text-decoration: none; color: var(--t-text);
  line-height: 1.5; white-space: nowrap;
}
.wl-doc-taskchip:hover { border-color: var(--t-border-strong); background: var(--t-surface-3); }
.wl-doc-taskchip__dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }
.wl-doc-taskchip__key { font-weight: 650; font-family: ui-monospace, monospace; font-size: 12px; }
.wl-doc-taskchip__status { color: var(--t-text-dim); }

/* Osadzona zywa lista zadan (blok ```tasks). */
.wl-doc-tasks { border: 1px solid var(--t-border); border-radius: var(--t-r-md); margin: 14px 0; overflow: hidden; }
.wl-doc-tasks__head {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--t-surface-2); border-bottom: 1px solid var(--t-border);
  font-size: 12px; font-weight: 650;
}
.wl-doc-tasks__meta { font-weight: 400; color: var(--t-text-mute); font-size: 11.5px; }
.wl-doc-tasks__row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--t-border); text-decoration: none; color: var(--t-text); font-size: 13.5px;
}
.wl-doc-tasks__row:last-child { border-bottom: none; }
.wl-doc-tasks__row:hover { background: var(--t-surface-2); }
.wl-doc-tasks__key { font-family: ui-monospace, monospace; font-size: 12px; font-weight: 650; color: var(--t-text-dim); flex: 0 0 auto; }
.wl-doc-tasks__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-doc-tasks__who { color: var(--t-text-dim); font-size: 12px; flex: 0 0 auto; }
.wl-doc-tasks__due { color: var(--t-text-mute); font-size: 12px; flex: 0 0 auto; }
.wl-doc-tasks__empty { padding: 14px; text-align: center; color: var(--t-text-mute); font-size: 13px; }
