/* VinFinitti – wygląd 1:1 z projektu Figma Make „Interactive Prototype for VinFinitti” (tokeny, układ, komponenty).
   Jasny motyw jak w projekcie. Widoki nagrywania i bazy nagrań mają ten sam styl, układ i działanie bez zmian. */
:root {
  --topbar-h: 60px;
  --bg: #f4f9fb;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f9fb;
  --surface-3: #e4ecf1;
  --border: #e4ecf1;
  --border-strong: #cfdde6;
  --text: #0d1b2a;
  /* krok 88 (ADR-0069): tekst drugo- i trzeciorzędny, sukces i czerwony przycisk ciemniejsze niż w projekcie, żeby
     drobny tekst miał kontrast WCAG AA (4,5:1) na białym, tle strony i miętowym tle (sprawdza tests/test_accessibility.py) */
  --text-2: #4b5d6e;
  --text-3: #5d6e7e;
  --accent: #2bb3ad;
  --accent-2: #1a76ab;
  --accent-deep: #0e4a78;
  --accent-ink: #ffffff;
  --accent-soft: #e6f6f4;
  --grad: linear-gradient(110deg, #12588f 0%, #1a76ab 42%, #2fc0b6 100%);
  --grad-deep: linear-gradient(135deg, #072b47 0%, #0d4a72 46%, #0c6b63 100%);
  --live: #c53030;
  --live-soft: #fbeaea;
  --success: #0b7a6f;
  --info: #1a76ab;
  --warn: #b35900;
  --warn-soft: #fbf1e6;
  --cam: #0d1b2a;
  --shadow-menu: 0 16px 40px -12px rgba(13, 27, 42, .28);
  --font: 'Open Sauce Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* zgodność z dotychczasowymi regułami nagrywania i bazy */
  --card: var(--surface);
  --muted: var(--text-2);
  --ok: var(--success);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
h1, h2, h3, p { margin: 0; }
[hidden], .layout[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
kbd { font-family: monospace; }

/* ---------------------------------------------------------------- przyciski (Btn z projektu) */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 500; border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  font-family: inherit; line-height: 1.5;
}
.btn svg { flex-shrink: 0; }
.btn.primary { background: var(--grad); color: #fff; }
.btn.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.live { background: var(--live); color: #fff; }
.btn.wide { width: 100%; justify-content: center; padding: 11px 14px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, .nav-item:focus-visible, .sub-item:focus-visible, .menu-item:focus-visible, .quick:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 2px;
}

/* ---------------------------------------------------------------- szkielet: panel boczny + treść */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; background: var(--page); }
body.signed-out .shell { display: none; }
.sidebar {
  background: var(--bg); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 20px 12px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 0; text-align: left; margin-bottom: 8px; width: 100%;
}
.brand:hover { background: var(--surface-2); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}
.brand-mark img { width: 68%; height: auto; display: block; } /* logo VinFinitti (icons/logo-white.svg, vinsign/brand.py) */
.brand-text { flex: 1; display: flex; flex-direction: column; }
.brand-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { color: var(--text-3); font-size: 11px; margin-top: 1px; }
.nav-block { margin-top: 8px; }
.nav-caption { font-size: 11px; color: var(--text-3); padding: 12px 12px 6px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; width: 100%;
  color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; position: relative;
  background: transparent; border: 0; text-align: left;
}
.nav-item .ico { width: 16px; height: 16px; opacity: .9; flex-shrink: 0; display: grid; place-items: center; }
.nav-item .label { flex: 1; }
.nav-item.active { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(13, 27, 42, .04); }
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; background: var(--accent-2);
  border-radius: 0 2px 2px 0;
}
.nav-item:not(.active):hover { color: var(--text); }
.badge-soon { margin-left: auto; font-size: 11px; color: var(--text-2); background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.branch .label { flex: 0 1 auto; }
.branch .chev { flex-shrink: 0; }
.branch-items { margin: 2px 0 6px 19px; border-left: 1px solid var(--border-strong); }
.group:not(.open) .branch-items { display: none; }
.sub-item {
  display: block; width: calc(100% + 1px); margin-left: -1px; padding: 6px 10px 6px 15px; text-align: left;
  border: 0; border-left: 2px solid transparent; border-radius: 0 7px 7px 0; background: transparent;
  font-size: 12.5px; line-height: 1.35; font-weight: 500; color: var(--text-2); cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub-item.soon { color: var(--text-3); }
.sub-item:hover { color: var(--text); }
.sub-item.active { border-left-color: var(--accent-2); font-weight: 600; color: var(--accent-deep); background: var(--surface); }
.sub-caption { padding: 9px 10px 3px 16px; font-size: 11px; font-weight: 500; color: var(--text-3); }
.usage { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.usage-row { font-size: 11px; color: var(--text-3); margin-bottom: 6px; display: flex; justify-content: space-between; }
.usage-bar { height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.usage-bar div { height: 100%; width: 100%; background: var(--accent); }
.usage-note { font-size: 11px; color: var(--text-2); margin-top: 8px; }
.main { display: flex; flex-direction: column; min-width: 0; }
.scrim { display: none; }

/* ---------------------------------------------------------------- górny pasek */
.topbar {
  height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 28px;
  gap: 20px; background: var(--page); flex-shrink: 0; position: sticky; top: 0; z-index: 30;
}
body[data-view="app"] .topbar, body[data-view="talk"] .topbar { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.crumbs .sep { color: var(--text-3); }
.crumbs .current { color: var(--text); font-weight: 500; }
.search {
  flex: 1; max-width: 380px; height: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 0 12px; display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 13px; cursor: text;
  text-align: left; min-width: 0;
}
.search span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search kbd { margin-left: auto; font-size: 11px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--text-3); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.lang {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer;
}
.icon-btn { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); cursor: pointer; background: transparent; border: 0; }
.icon-btn:hover { background: var(--surface-2); }
.account { position: relative; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; font-weight: 600;
  font-size: 12px; color: #fff; cursor: pointer; border: 0; padding: 0;
}
.avatar[aria-expanded="true"] { box-shadow: 0 0 0 3px var(--accent-soft); }
.menu {
  position: absolute; top: calc(100% + 10px); right: 0; width: 264px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-menu); padding: 6px; font-size: 13px; color: var(--text); z-index: 60;
}
.menu-head { padding: 8px 10px 10px; }
.menu-email { font-weight: 500; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.menu-plan { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border-radius: 8px; font-weight: 500; cursor: pointer;
  color: var(--text); background: transparent; border: 0; text-align: left; font-size: 13px;
}
.menu-item:hover { background: var(--surface-2); }
.menu-item.danger { color: var(--live); }
.menu-sub { position: relative; }
.menu-sub .sub-chev { margin-left: auto; color: var(--text-3); }
.submenu { display: none; top: -7px; right: calc(100% + 8px); width: 256px; }
.submenu::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 10px; } /* mostek: kursor przechodzi do podmenu */
.menu-sub:hover .submenu, .menu-sub:focus-within .submenu { display: block; }
.menu-sub:hover > .menu-item, .menu-sub:focus-within > .menu-item { background: var(--surface-2); }
.menu-btn { display: none; width: 36px; height: 36px; border-radius: 8px; place-items: center; color: var(--text-2); background: transparent; border: 1px solid var(--border); cursor: pointer; flex-shrink: 0; }

/* ---------------------------------------------------------------- strony (pulpit, nagrywanie, baza) */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.page { padding: 28px 32px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.page-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; max-width: 720px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); font-size: 14px; font-weight: 600; }
.panel-action { font-size: 12px; color: var(--text-2); cursor: pointer; background: transparent; border: 0; font-weight: 400; padding: 0; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.quick {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; cursor: pointer;
}
.quick.featured { background: linear-gradient(135deg, #e6f6f4 0%, #f0f7fb 60%); border-color: #b7e2df; }
.quick-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent-2); margin-bottom: 16px; }
.quick.featured .quick-icon { background: var(--grad); color: #fff; }
.quick-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.quick-sub { font-size: 12px; color: var(--text-2); line-height: 1.5; }
.quick-meta { font-size: 11px; color: var(--text-3); margin-top: 16px; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.session-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.session-row .row-icon { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-soft), #f4f9fb); display: grid; place-items: center; color: var(--accent-2); }
.row-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.row-time { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.tag.live { background: var(--live-soft); color: var(--live); }
.tag.paid { background: var(--accent-soft); color: var(--success); }
.tag.admin { background: #e3eef6; color: var(--accent-2); }
.tag.owner { background: var(--accent-soft); color: var(--accent-deep); }
.tag.pending { background: var(--surface-3); color: var(--text-2); }
.empty { padding: 36px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.empty-icon { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--accent-soft), #f4f9fb); display: grid; place-items: center; color: var(--accent-2); margin-bottom: 6px; }
.empty-title { font-size: 13px; font-weight: 500; }
.empty-text { font-size: 12px; color: var(--text-3); max-width: 320px; }
.privacy { margin-top: 20px; font-size: 11px; color: var(--text-3); max-width: 720px; }

/* ---------------------------------------------------------------- tłumacz: ekran sesji (Sign to Speak z projektu) */
.session { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 560px; }
.session-bar {
  padding: 14px 32px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px;
  background: var(--surface); flex-shrink: 0;
}
.session-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.session-title h1 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.live-dot.on { background: var(--live); box-shadow: 0 0 0 4px var(--live-soft); }
.timer { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.session-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.session-body { flex: 1; display: grid; grid-template-columns: 1fr 1fr; min-height: 0; }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pane.out { border-right: 1px solid var(--border); background: var(--surface); }
.cam-pane { background: var(--surface-2); }
.pane-head {
  padding: 14px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  gap: 12px; font-size: 12px; color: var(--text-2); font-weight: 500; min-height: 59px;
}
.pane-tools { display: flex; gap: 8px; align-items: center; }
/* ADR-0042: przelacznik jezyka migowego (PJM / ASL) - widoczny, gdy serwer ma wiecej niz jeden model; na gornym
   pasku tlumacza obok tytulu (ADR-0045), zeby bylo go widac od razu, takze na telefonie */
.seg-lang { padding: 3px; gap: 3px; flex-shrink: 0; }
.seg-lang button { padding: 4px 10px; font-weight: 600; letter-spacing: .02em; }
/* 2026-10-29 (polecenie właściciela): kafelki ASL | Auslan | PJM; język z kilkoma odmianami otwiera pod spodem kwadraty
   do wyboru (znaki, miganie ciągłe, alfabet palcowy) */
.lang-pick { position: relative; display: flex; flex-shrink: 0; }
.lang-pick[hidden] { display: none; }
.seg-lang button.has-variants { display: inline-flex; align-items: center; gap: 6px; }
.seg-lang button.has-variants::after {
  content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg); opacity: .65; transition: transform .15s ease;
}
.seg-lang button.has-variants[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.seg-lang button.open:not(.on) { color: var(--text); } /* otwarty, ale niewybrany: bez tła zaznaczenia */
.lang-variants {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; display: grid;
  grid-template-columns: repeat(var(--lang-variants, 3), minmax(92px, 112px)); gap: 8px; padding: 8px;
  max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(13, 27, 42, .16);
}
.lang-variants[hidden] { display: none; }
.lang-variant {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 8px;
  aspect-ratio: 1 / 1; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: border-color .15s ease, background .15s ease;
}
.lang-variant:hover { border-color: var(--accent); }
.lang-variant:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-variant.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.lang-variant svg { color: var(--accent-2); }
.lv-text { display: flex; flex-direction: column; gap: 2px; }
.lv-name { font-size: 15px; font-weight: 700; letter-spacing: .01em; }
.lv-kind { font-size: 12px; color: var(--text-2); line-height: 1.3; }
.chip-btn {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; font-size: 12px; color: var(--text); cursor: pointer; font-weight: 400; white-space: nowrap;
}
/* pasek aktywności dłoni nad zapisem (w projekcie: przebieg dźwięku) – słupek co 0,5 s, ostatnie 15 w kolorze */
.wave-strip { padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.wave { height: 52px; display: flex; align-items: center; gap: 1.5px; overflow: hidden; }
.wave span { display: block; flex-shrink: 0; width: 2.5px; background: var(--surface-3); border-radius: 2px; }
.wave span.recent { background: var(--accent-2); }
.wave-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); padding: 4px 0 8px; font-variant-numeric: tabular-nums; }
.current-sign { padding: 16px 24px 14px; border-bottom: 1px solid var(--border); }
.current-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.mini-label { font-size: 10px; color: var(--text-3); letter-spacing: .02em; }
.word { font-size: 28px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; min-height: 34px; overflow-wrap: anywhere; }
.word.idle { color: var(--text-3); font-size: 20px; font-weight: 500; line-height: 34px; }
.conf { display: flex; flex-direction: column; align-items: flex-end; }
.conf-value { font-size: 13px; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.confidence { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin-top: 10px; }
/* ADR-0043: podpowiedzi, gdy slowo nie zostalo dopisane - klikniecie dopisuje slowo do zdania */
.candidates { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
/* ADR-0061: zdanie z kontekstu pod glosami */
.sentence-out { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); }
.sentence-out p { margin: 4px 0 0; font-size: 1.05rem; line-height: 1.4; }
.candidate-list { display: flex; gap: 6px; flex-wrap: wrap; }
.candidate { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.candidate:hover { background: var(--surface-3); }
.candidate small { font-weight: 400; color: var(--text-2); font-variant-numeric: tabular-nums; }
/* ADR-0053: dostrojenie do osoby - panel z kolejnym slowem do pokazania i wynikiem */
.calib { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; }
.calib-word { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; min-height: 28px; margin-top: 2px; }
.calib-text { font-size: 12px; color: var(--text-2); margin: 4px 0 0; }
.calib-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip-btn.on { border-color: var(--accent-2); color: var(--accent-2); }
/* ADR-0057: nowy znak z kilku pokazow - nazwa, postep, lista slow wlasnych z usuwaniem */
.learn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.learn-name { flex: 1 1 160px; min-width: 0; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; }
.learn-list { margin-top: 8px; }
.candidate.own { cursor: default; }
.chip-x { border: 0; background: transparent; color: var(--text-2); font-size: 14px; line-height: 1; padding: 0 2px; cursor: pointer; }
.chip-x:hover { color: var(--danger, #c0392b); }
#confidence-bar { height: 100%; width: 0; background: var(--grad); transition: width .15s; border-radius: 3px; }
.transcript { flex: 1; padding: 20px 32px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.line { display: flex; gap: 10px; align-items: flex-start; }
.line .ts { font-size: 10px; color: var(--text-3); font-family: monospace; margin-top: 3px; width: 34px; flex-shrink: 0; }
.line p { font-size: 15px; line-height: 1.65; color: var(--text-3); flex: 1; overflow-wrap: anywhere; }
.line.now p { color: var(--text); }
/* krok 87: mowa osoby słyszącej w zapisie rozmowy (wyróżniona, po prawej stronie znacznika czasu) */
.line.heard p { color: var(--text-2); font-style: italic; }
.line.heard p::before { content: "Mowa: "; font-style: normal; font-weight: 600; color: var(--text-3); }
.line.heard.now p { color: var(--text-3); }
#listen.live { border-color: var(--live); } /* czerwony jak „Stop”: biały tekst (krok 88: kontrast) */
.caret { display: inline-block; width: 2px; height: 16px; background: var(--accent-2); vertical-align: middle; margin-left: 3px; }
.line.now.empty { display: none; }
.hint { font-size: 12px; color: var(--text-3); }
.diag { padding: 8px 24px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--text-3); min-height: 33px; overflow-wrap: anywhere; }
.cam { flex: 1; position: relative; background: var(--cam); overflow: hidden; min-height: 240px; }
.cam video, .cam canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block;
  transform: scaleX(-1); /* podgląd jak w lustrze; MediaPipe dostaje obraz nieodwrócony */
}
.cam canvas { pointer-events: none; }
.scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255, 255, 255, .015) 3px, rgba(255, 255, 255, .015) 4px); }
.corner { position: absolute; width: 28px; height: 28px; border: 0 solid rgba(43, 179, 173, .7); border-radius: 3px; pointer-events: none; }
.corner.tl { top: 20px; left: 20px; border-top-width: 2px; border-left-width: 2px; }
.corner.tr { top: 20px; right: 20px; border-top-width: 2px; border-right-width: 2px; }
.corner.bl { bottom: 20px; left: 20px; border-bottom-width: 2px; border-left-width: 2px; }
.corner.br { bottom: 20px; right: 20px; border-bottom-width: 2px; border-right-width: 2px; }
.cam-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; font-size: 12px; color: rgba(255, 255, 255, .4); text-align: center; line-height: 1.6; }
.cam-wait-icon { width: 80px; height: 80px; border-radius: 50%; background: rgba(255, 255, 255, .06); display: grid; place-items: center; color: rgba(255, 255, 255, .55); }
.pill {
  position: absolute; top: 16px; display: flex; align-items: center; gap: 7px; padding: 5px 10px; background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, .14); border-radius: 20px;
  font-size: 11px; color: rgba(255, 255, 255, .75); font-weight: 500; max-width: calc(50% - 24px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sign-indicator { left: 16px; }
.pill.mono { right: 16px; font-family: monospace; font-weight: 400; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #2bb3ad; box-shadow: 0 0 0 3px rgba(43, 179, 173, .25); flex-shrink: 0; }
.sign-indicator.active { background: rgba(43, 179, 173, .32); border-color: rgba(43, 179, 173, .6); color: #fff; }
.sign-indicator.active .dot { background: #8df3e2; box-shadow: 0 0 0 3px rgba(141, 243, 226, .35); }
.session-foot {
  padding: 12px 32px; border-top: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 12px;
  flex-shrink: 0; flex-wrap: wrap;
}
.cam-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 4px rgba(43, 179, 173, .22); flex-shrink: 0; }
.seg { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.seg button { padding: 7px 12px; border-radius: 7px; font-size: 12px; color: var(--text-2); cursor: pointer; background: transparent; border: 0; }
.seg button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(13, 27, 42, .06); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
#sentence-text { cursor: pointer; }
.foot-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------------------------------------------------------- z mowy na migowy (krok 77, ADR-0067) */
.rev-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.rev-input, .rev-stage { padding: 16px; }
.rev-input textarea {
  width: 100%; resize: vertical; min-height: 84px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5;
}
.rev-input textarea:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.rev-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.rev-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.rev-info { margin-top: 8px; }
.rev-chips { margin-top: 12px; }
.rev-chip.on { border-color: var(--accent-2); background: var(--accent-soft); }
.rev-chip.no-video { border-style: dashed; }
.rev-chip.spell small { letter-spacing: .04em; }
.rev-chip.unknown { color: var(--text-2); font-weight: 500; border-style: dotted; }
#rev-listen.live { color: var(--text); border-color: currentColor; }
.rev-screen { position: relative; aspect-ratio: 4 / 3; background: var(--cam); border-radius: 10px; overflow: hidden; }
.rev-screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.rev-screen canvas, .talk-signs canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; } /* K5: awatar */
.rev-screen canvas[hidden], .talk-signs canvas[hidden] { display: none; }
.cam .talk-signs canvas { transform: none; }
.talk-signs-source { border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: rgba(255, 255, 255, .85); font-size: 11px; line-height: 1; cursor: pointer; padding: 3px 6px; border-radius: 6px; white-space: nowrap; }
.talk-signs-source[hidden] { display: none; }
.rev-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 16px; text-align: center; color: rgba(255, 255, 255, .9);
}
.rev-card-main { font-size: 40px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; overflow-wrap: anywhere; }
.rev-card.letter .rev-card-main { font-size: 96px; }
.rev-card.text .rev-card-main { font-style: italic; color: rgba(255, 255, 255, .7); }
.rev-card-sub { font-size: 12px; color: rgba(255, 255, 255, .55); }
.rev-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rev-controls .seg { margin-left: auto; }
.rev-now { margin-top: 8px; min-height: 18px; overflow-wrap: anywhere; }
.aw-diag { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-2, #f3f5f9); color: var(--text-2); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
/* ADR-0108: ostrzeżenie panelu ?diag=1 o karcie zintegrowanej (albo bez karty) z krokami instrukcji */
.aw-diag-warn { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--warn); background: var(--warn-soft); color: var(--text); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.aw-diag-warn[hidden] { display: none; }
.aw-diag-warn summary { cursor: pointer; font-weight: 600; color: var(--warn); }
.aw-diag-warn ol { margin: 6px 0 0; padding-left: 20px; }
.aw-diag-warn li + li { margin-top: 3px; }
#aw-measure { margin-left: 6px; }
@media (max-width: 900px) { .rev-layout { grid-template-columns: 1fr; } .rev-card.letter .rev-card-main { font-size: 72px; } }

/* ---------------------------------------------------------------- tryb rozmowy (krok 89, ADR-0068) */
.partner { padding: 14px 24px 16px; border-bottom: 1px solid var(--border); background: var(--accent-soft); }
.partner-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.partner-text { margin-top: 6px; font-size: 26px; font-weight: 600; line-height: 1.3; color: var(--text); overflow-wrap: anywhere; transition: transform .25s; }
.partner-text.idle { font-size: 16px; font-weight: 500; color: var(--text-3); }
.partner.flipped .partner-text { transform: rotate(180deg); }
#partner-flip[aria-pressed="true"] { border-color: var(--accent-2); color: var(--accent-2); }
.session.talk .wave-strip { display: none; }
.session.talk .line p { padding: 6px 12px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); }
.session.talk .line.now p { background: transparent; padding-left: 0; color: var(--text); }
.session.talk .line.heard { flex-direction: row-reverse; text-align: right; }
.session.talk .line.heard p { background: var(--accent-soft); color: var(--text); }
.line-sign { flex-shrink: 0; align-self: center; border: 1px solid var(--border); background: var(--surface); color: var(--accent-2); border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 3px 6px; cursor: pointer; }
.talk-signs {
  position: absolute; right: 16px; bottom: 16px; width: min(42%, 340px); aspect-ratio: 4 / 3; background: var(--cam); z-index: 2;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.cam .talk-signs video { transform: none; } /* film wzorcowy bez lustra (lustro dotyczy podglądu kamery) */
.talk-signs .rev-card-main { font-size: 24px; }
.talk-signs .rev-card.letter .rev-card-main { font-size: 56px; }
.talk-signs-bar {
  position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent); font-size: 11px; color: rgba(255, 255, 255, .85);
}
.talk-signs-title { font-weight: 600; white-space: nowrap; }
.talk-signs-word { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(255, 255, 255, .7); }
.talk-signs-close { border: 0; background: transparent; color: rgba(255, 255, 255, .8); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
@media (max-width: 900px) { .partner-text { font-size: 22px; } .talk-signs { width: min(48%, 260px); right: 10px; bottom: 10px; } }

/* ---------------------------------------------------------------- dostępność (krok 88, ADR-0069) */
/* „Większy tekst” w tłumaczu: zapis rozmowy, rozpoznany znak i zdanie czytelne z odległości (telefon na stole) */
.session.big-text .line p { font-size: 20px; line-height: 1.5; }
.session.big-text .word { font-size: 38px; }
.session.big-text #sentence-text { font-size: 1.4rem; }
.session.big-text .partner-text { font-size: 34px; }
#bigtext-chip[aria-pressed="true"] { border-color: var(--accent-2); color: var(--accent-2); }
/* system z ograniczeniem ruchu: bez animacji i przejść (np. obrót napisu dla rozmówcy, pasek pewności) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------- monitoring (krok 98, ADR-0070) */
.mon-actions { display: flex; align-items: center; gap: 12px; }
.mon-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.mon-card { padding: 14px 16px; }
.mon-card.alert { border-color: var(--live); }
.mon-value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mon-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.mon-models { margin: 12px 0 16px; }
.mon-block { padding: 16px; margin-bottom: 16px; }
.mon-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.mon-scroll { overflow-x: auto; }
.mon-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mon-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.mon-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
.mon-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mon-table tr.error td:nth-child(2) { color: var(--live); font-weight: 600; }
#mon-devices tr.warning td:last-child { font-weight: 600; } /* krok 90: urządzenie poniżej celu */
.mon-message { overflow-wrap: anywhere; min-width: 220px; }

/* ---------------------------------------------------------------- aplikacja (krok 82, ADR-0071) */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------- autoryzacja osób (widok „Team” z projektu, ADR-0033) */
.access-mode { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 28px; padding: 16px 20px; margin-bottom: 16px; }
.access-mode-title { font-size: 14px; font-weight: 600; }
.access-mode-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.switch-row { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.toggle { width: 36px; height: 20px; background: var(--surface-3); border-radius: 20px; position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; border: 0; padding: 0; }
.toggle i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(13, 27, 42, .15); transition: left .15s; }
.toggle.on { background: var(--accent); }
.toggle.on i { left: 18px; }
.toggle:disabled { opacity: .6; cursor: default; }
.access-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 10px; padding: 16px 20px; margin-bottom: 24px; align-items: center; }
.access-add input, .table-search input {
  font: inherit; font-size: 13px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); min-width: 0;
}
.access-add input:focus, .table-search:focus-within { outline: 2px solid var(--accent-soft); border-color: var(--accent-2); }
.access-error { grid-column: 1 / -1; font-size: 12px; color: var(--live); }
.access-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.seg-control { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; flex-wrap: wrap; }
.seg-control button { display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); cursor: pointer; background: transparent; border: 0; }
.seg-control button span { font-size: 11px; color: var(--text-3); }
.seg-control button.on { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(13, 27, 42, .06); }
.table-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 0 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; color: var(--text-3); width: 280px; }
.table-search input[type="search"] { font: inherit; font-size: 13px; border: 0; border-radius: 0; height: 34px; padding: 0 12px 0 0; flex: 1; outline: none; background: transparent; }
.access-table { overflow: hidden; }
.tbl-head, .tbl-row { display: grid; grid-template-columns: minmax(0, 2fr) 150px minmax(0, 1fr) 270px minmax(0, 1fr) 150px; align-items: center; gap: 16px; padding: 0 20px; }
.tbl-head { height: 38px; font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.tbl-row { min-height: 64px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.tbl-row:last-child { border-bottom: 0; }
.tbl-cell { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tbl-cell:last-child { display: flex; justify-content: flex-end; }
.row-actions { display: flex; gap: 6px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-avatar { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-deep); }
.person-avatar.admin { background: var(--accent-deep); color: #fff; }
.person-avatar.fixed { background: var(--surface-3); color: var(--text-2); }
.person-text { min-width: 0; }
.person-email { font-weight: 500; font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.small { padding: 6px 12px; font-size: 12px; }
.range-edit { display: flex; align-items: center; gap: 6px; }
.range-edit input { font: inherit; font-size: 13px; width: 72px; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.access-add .range-edit input { height: 36px; width: 90px; }
.range-dash { color: var(--text-3); }
.tbl-cell:has(.range-edit) { overflow: visible; }
.range-note { font-weight: 500; color: var(--accent-2); }
.person-sub.mobile-only { display: none; }
.btn.ghost.danger { color: var(--live); background: var(--live-soft); }

/* ---------------------------------------------------------------- logowanie */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eaf1f5; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px 28px; box-shadow: 0 12px 40px -20px rgba(13, 27, 42, .15); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-card h1 { font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
.login-card p { color: var(--text-2); font-size: 13px; margin-bottom: 22px; }
.login-tabs { display: flex; width: 100%; margin-bottom: 16px; }
.login-tabs button { flex: 1; justify-content: center; }
.login-card .btn.secondary.wide { background: var(--surface); }
.login-or { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 11px; color: var(--text-3); }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); }
.login-form input { font: inherit; font-size: 14px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); }
.login-form input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent-2); }
.login-card .login-error, .login-card .login-info { font-size: 12px; margin: 0; }
.login-card .login-error { color: var(--live); }
.login-card .login-info { color: var(--success); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; color: var(--accent-2); cursor: pointer; align-self: center; }
.link-btn:hover { text-decoration: underline; }
.login-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
#login-verify .btn { margin-top: 4px; }
#login-verify p { margin-bottom: 14px; }

/* ---------------------------------------------------------------- okienko „Już wkrótce” i komunikaty */
.modal { position: fixed; inset: 0; background: rgba(13, 27, 42, .32); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-menu); padding: 24px; text-align: center; }
.modal-icon { width: 44px; height: 44px; margin: 0 auto 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center; }
.modal-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.modal-card p { font-size: 13px; color: var(--text-2); margin-bottom: 18px; }
#status {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 90; max-width: min(640px, calc(100vw - 32px));
  background: var(--text); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-menu);
  text-align: center; transition: opacity .25s;
}
#status:empty, #status.faded { opacity: 0; pointer-events: none; }
body[data-view="app"] #status, body[data-view="talk"] #status { bottom: 84px; } /* nad stopką tłumacza, nie na przyciskach */
#status.error { background: var(--live); }

/* ---------------------------------------------------------------- telefon i wąskie okna */
@media (max-width: 1100px) {
  .tbl-head, .tbl-row { grid-template-columns: minmax(0, 2fr) 140px 270px 150px; }
  .tbl-head > :nth-child(3), .tbl-head > :nth-child(5), .tbl-row > :nth-child(3), .tbl-row > :nth-child(5) { display: none; }
  .quick-grid { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
  .search { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; visibility: hidden; }
  body.menu-open .sidebar { transform: none; visibility: visible; box-shadow: var(--shadow-menu); }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: rgba(13, 27, 42, .32); z-index: 35; }
  .menu-btn { display: grid; }
  .topbar { padding: 0 16px; gap: 12px; }
  .page { padding: 20px 16px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; }
  .session { height: auto; min-height: 100dvh; }
  .session-bar { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .session-actions .btn.ghost span, .session-actions .btn.secondary span { display: none; }
  .session-body { grid-template-columns: 1fr; }
  .cam-pane { order: -1; }
  .cam { flex: none; aspect-ratio: 4 / 3; max-height: 60svh; }
  .pane.out { border-right: 0; }
  .transcript { padding: 16px; min-height: 140px; }
  .pane-head, .current-sign, .diag { padding-left: 16px; padding-right: 16px; }
  .session-foot { padding: 10px 16px; }
  .foot-actions { margin-left: 0; width: 100%; flex-wrap: wrap; } /* pięć przycisków (krok 87: „Słuchaj”) w dwóch rzędach */
  .foot-actions .btn { flex: 1 1 auto; justify-content: center; }
  .partner { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) {
  .access-mode { grid-template-columns: 1fr; gap: 12px; }
  .access-add { grid-template-columns: 1fr; }
  .table-search { width: 100%; }
  .tbl-head { display: none; }
  .tbl-head, .tbl-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 10px 16px; }
  .tbl-row > :nth-child(2), .tbl-row > :nth-child(3) { display: none; }
  .tbl-row > :nth-child(4) { grid-column: 1 / -1; order: 3; }
  .access-add .range-edit input { width: 100%; }
  .person-sub.mobile-only { display: block; }
  .session-bar { flex-wrap: nowrap; gap: 8px; }
  .session-title h1 { font-size: 14px; }
  .session-actions .btn.ghost, .session-actions .btn.secondary { display: none; }
  .crumbs #crumb-1, .crumbs .sep { display: none; }
  .cam-btn { display: none; }
  .seg { flex: 1; }
  .seg button { flex: 1; }
  .seg-lang { flex: 0 0 auto; }
  .seg-lang button { flex: 0 0 auto; padding: 4px 8px; }
  .session-title h1 { font-size: 13px; }
  .session-bar:has(#lang-seg:not([hidden])) .timer { display: none; } /* miejsce na tytul, gdy jest przelacznik */
  /* 2026-10-29: kafelki języków w osobnym rzędzie pod tytułem, na całą szerokość (tytuł i Stop mieszczą się w
     pierwszym rzędzie także na ekranie 360 px) */
  .session-bar:has(#lang-pick:not([hidden])) { flex-wrap: wrap; row-gap: 8px; }
  .session-bar:has(#lang-pick:not([hidden])) .session-title { flex: 1 1 0; } /* tytuł się skraca, przyciski zostają */
  .lang-pick { order: 10; flex: 1 0 100%; }
  .lang-pick .seg-lang { flex: 1; }
  .lang-pick .seg-lang button { flex: 1 1 0; justify-content: center; padding: 6px 8px; }
  .lang { padding: 6px 8px; }
}

/* ================================================================ nagrywanie słów i baza nagrań: dotychczasowy układ
   i działanie (ADR-0017…0029), kolory i komponenty z projektu. :where() zostawia regułom poniżej tę samą wagę co
   dawniej (button, .status), więc szczegółowe style list, folderów i przycisków działają jak przedtem. */
.layout { --accent: var(--accent-2); font-size: 14px; }
:where(#record, #review) button {
  font: inherit; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); cursor: pointer;
}
:where(#record, #review) button.primary { background: var(--grad); border-color: transparent; color: #fff; }
:where(#record, #review) button.link { border: none; background: none; color: var(--accent-2); padding: 0; }
:where(#record, #review) button:disabled { opacity: .55; cursor: default; }
:where(#record, #review) .status { color: var(--muted); text-align: center; }
:where(#record, #review) .status.error { color: var(--warn); }
:where(#record, #review) input[type="number"], :where(#record, #review) input[type="text"] {
  font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.panel h3 { font-size: 14px; font-weight: 600; }

.layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(260px, 2fr); gap: 16px; }
.layout.review { grid-template-columns: minmax(240px, 1fr) minmax(0, 3fr); }
/* scena w siatce nie rozciąga się do wysokości panelu obok: płótno ze szkieletem ma dokładnie pole obrazu */
.layout > .stage { align-self: start; }
@media (max-width: 800px) { .layout, .layout.review { grid-template-columns: 1fr; } }
.column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stage { position: relative; width: 100%; background: #000; border-radius: 12px; overflow: hidden; }
.stage video, .stage canvas {
  display: block;
  width: 100%;
  height: auto;
  transform: scaleX(-1); /* podglad jak w lustrze; MediaPipe dostaje obraz nieodwrocony */
}
.stage canvas { position: absolute; inset: 0; height: 100%; }
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* nagrywanie (ADR-0017) */
/* ADR-0135: termin dostępu (lista + dzień „Do dnia…”), plakietki próśb */
.term-edit, .term-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.term-select, .term-date { font: inherit; font-size: 13px; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); max-width: 100%; }
.access-add .term-select, .access-add .term-date { height: 36px; }
.term-edit .term-select { width: 100%; font-size: 12px; padding: 0 4px; }
.term-select.expired { border-color: var(--live); color: var(--live); }
.tbl-cell:has(.term-edit), .tbl-cell:has(.term-pick) { overflow: visible; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.access-rec, .access-rec-add { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.access-rec input, .access-rec-add input { width: 16px; height: 16px; accent-color: var(--accent, #2563eb); }

/* wersja.js: serwer starszy niz strona (tylko administrator) */
.server-stale { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 12px 24px 0;
  padding: 10px 14px; border-radius: 10px; background: #fff4e5; color: #7a4100; border: 1px solid #f5c98a; font-size: 14px; }
.server-stale .link-btn { color: inherit; white-space: nowrap; }
:root[data-theme="dark"] .server-stale { background: #3a2a10; color: #ffd9a3; border-color: #8a5a1a; }
@media (max-width: 720px) { .server-stale { margin: 8px 12px 0; flex-direction: column; align-items: flex-start; } }

.banner {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  padding: 6px 16px; border-radius: 999px; font-size: 1.4rem; font-weight: 700;
  background: rgba(0, 0, 0, 0.6); color: #fff; white-space: nowrap;
}
.banner.sign { background: var(--ok); }
.progress { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(0, 0, 0, 0.4); }
#rec-progress { height: 100%; width: 0; background: var(--ok); }
.field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.9rem; }
input[type="search"], select {
  font: inherit; padding: 8px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
#word-list { width: 100%; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 0.9rem; }
.note { color: var(--muted); font-size: 0.9rem; margin: 0; }
.note.error, .reference { width: 100%; border-radius: 8px; background: #000; }
.reference { max-height: 240px; }
.mine { padding-left: 18px; font-size: 0.85rem; max-height: 200px; overflow: auto; }
.mine .accepted { color: var(--ok); }
.mine .rejected { color: var(--warn); }
#rec-word { font-size: 1.8rem; margin: 0; }
/* przeglad */
.queue { list-style: none; padding: 0; margin: 0; max-height: 70vh; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.queue button { width: 100%; text-align: left; font-size: 0.85rem; }
.queue button.active { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 800px) { .pair { grid-template-columns: 1fr; } }
.pair figure { margin: 0; }
.pair video { width: 100%; border-radius: 8px; background: #000; }
.pair figcaption { color: var(--muted); font-size: 0.85rem; }
#rv-box { display: flex; flex-direction: column; gap: 12px; }
#rv-box h2 { margin: 0; }
/* ADR-0018: lista słów, kontrola kadru, raport jakości, baza nagrań */
button.big { width: 100%; padding: 12px 16px; font-size: 1.1rem; }
.list-head { display: flex; gap: 8px; align-items: center; }
.list-head input { flex: 1; }
.words, .folders {
  list-style: none; margin: 0; padding: 0; max-height: 300px; overflow: auto;
  border: 1px solid var(--border); border-radius: 8px;
}
.folders { max-height: 65vh; }
.words li button, .folders li button {
  width: 100%; display: flex; align-items: center; gap: 6px; text-align: left;
  border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 7px 10px;
}
.words li button .name { flex: 1; }
.words li button.active, .folders li button.active, .folder.special.active {
  background: var(--accent); color: #fff;
}
.folders li button { justify-content: space-between; }
.folder .count { color: var(--muted); font-size: 0.85rem; }
.folders li button.active .count { color: #fff; }
.folder.special { width: 100%; text-align: left; font-weight: 600; }
.badge { font-size: 0.75rem; padding: 1px 6px; border-radius: 999px; background: var(--border); color: var(--text); }
.badge.mine { background: var(--ok); color: #fff; }
.badge.web { background: var(--accent); color: #fff; }
.checklist { display: flex; gap: 6px; flex-wrap: wrap; min-height: 1.8rem; }
.chip { padding: 3px 10px; border-radius: 999px; font-size: 0.85rem; border: 1px solid var(--border); }
.chip.ok { color: var(--ok); border-color: var(--ok); }
.chip.bad { color: var(--warn); border-color: var(--warn); font-weight: 600; }
.qc-list { margin: 0; padding-left: 18px; font-size: 0.9rem; }
.qc-list .ok { color: var(--ok); }
.qc-list .warn { color: var(--warn); }
.qc-list .bad { color: var(--warn); font-weight: 600; }
.note.good { color: var(--ok); }
.note.warn { color: var(--warn); }
.files { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.files th, .files td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.files tbody tr { cursor: pointer; }
.files tbody tr.active { background: var(--accent); color: #fff; }
.files tbody tr.rejected td { opacity: 0.6; }
@media (max-width: 800px) { .files th:nth-child(3), .files td:nth-child(3) { display: none; } }
/* ADR-0019: profil osoby i postęp nagrań */
.profile { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.profile select { width: 100%; }
.words-progress { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
#words-progress-bar { height: 100%; width: 0; background: var(--ok); transition: width 0.3s; }

/* wskazówki warunków nagrania (ADR-0020) */
.tips { margin: 8px 0; font-size: 0.9rem; }
.tips summary { cursor: pointer; font-weight: 600; }
.tips ul { margin: 6px 0 0; padding-left: 18px; }
.tips li { margin: 3px 0; }

/* przegląd: szkielet na filmie, tempo (ADR-0023) */
.rv-stage { position: relative; }
.rv-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rv-play button.active { background: var(--accent); color: #fff; }
.files tbody tr.ready td { color: var(--ok); }

/* nagrywanie telefonem (ADR-0024): podgląd i przyciski zawsze widoczne, słowo duże, tylna kamera bez lustra */
.rec-sticky { position: sticky; top: var(--topbar-h); z-index: 5; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg); padding-bottom: 4px; }
/* Podgląd nagrania w tym samym oknie co kamera (nic nie zmienia rozmiaru ani nie przewija strony); Wyślij/Powtórz
   i wynik kontroli tuż pod oknem, w przyklejonym bloku. Szczegóły kontroli jakości w panelu niżej. */
.stage canvas { z-index: 1; }
#rec-stage #preview {
  position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain;
  background: #000; border-radius: 0; z-index: 2; transform: none; /* film jak w pliku, sterowanie odtwarzacza nie w lustrze */
}
.banner, .word-overlay, .progress { z-index: 3; }
.rec-decide { align-items: center; }
.rec-decide .note { flex: 1 1 100%; }
.rec-controls { align-items: center; }
.camera-choice { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.9rem; }
.stage.rear video, .stage.rear canvas { transform: none; }
.word-overlay {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 4px 18px; border-radius: 12px; background: rgba(0, 0, 0, 0.6); color: #fff;
  font-size: clamp(1.6rem, 6vw, 3rem); font-weight: 800; white-space: nowrap; max-width: 95%;
  overflow: hidden; text-overflow: ellipsis;
}
#rec-session.active { background: var(--warn); border-color: var(--warn); color: #fff; }
@media (max-width: 800px) {
  .banner { font-size: clamp(1.1rem, 5vw, 1.6rem); }
  .rec-controls button { padding: 10px 14px; }
}
/* Telefon w pionie i niskie okna (uzupełnienie ADR-0029): kamera telefonu w pionie daje obraz pionowy, więc podgląd
   zajmował cały ekran, a przyklejony blok zasłaniał kadr, podgląd nagrania i przyciski Wyślij/Powtórz na zawsze.
   Podgląd ma najwyżej 40% wysokości ekranu (w podglądzie nagrania 22%; czarne pasy po bokach), płótno ze szkieletem
   jest dopasowane tak samo jak obraz (object-fit: contain = te same współrzędne), przyciski w dwóch kolumnach. */
.stage video, .stage canvas { object-fit: contain; }
@media (max-width: 800px) {
  #record .column { display: contents; } /* blok kamery przyklejony do całej sekcji, także nad listą słów */
  #rec-stage video { max-height: 40vh; max-height: 40svh; }
  .rec-controls > * { flex: 1 1 40%; min-width: 0; }
  .rec-controls button { padding: 10px 8px; font-size: 0.95rem; }
  .rec-controls .camera-choice select { flex: 1; min-width: 0; }
}
/* Telefon w poziomie: ekran za niski, żeby cokolwiek przyklejać – strona przewija się jak na komputerze. */
@media (max-height: 560px) {
  .rec-sticky { position: static; }
  #rec-stage video { max-height: 70vh; max-height: 70svh; }
}

/* ADR-0029: liczniki na osobę i słowo, lista „Do poprawki”, filtr listy */
.list-filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin: 0.25rem 0; }
.badge.mine.done { background: #1f6f3a; color: #fff; }
.badge.mine.none { background: #3a3f47; color: #c9d1d9; }
.badge.redo { background: #8a2b2b; color: #fff; }
.badge.model { background: #7a4db8; color: #fff; } /* ADR-0048: slowo mylone przez wydany model */
.badge.urgent { background: #a95b1b; color: #fff; cursor: help; } /* ADR-0058: czolowka kolejki nagran (kontrast 5:1, krok 88) */
.words button.state-redo { border-left: 4px solid #f85149; }
.words button.state-done { border-left: 4px solid #3fb950; }
.todo { list-style: none; padding: 0.5rem 0.75rem; margin: 0.5rem 0; border: 1px solid #f85149; border-radius: 8px;
  background: rgba(248, 81, 73, 0.08); }
.todo li { margin: 0.2rem 0; }
.todo li.head { font-weight: 600; color: #f85149; }
.todo button.link { font-weight: 600; }
.tips ol { padding-left: 1.2rem; }

/* zakres słów do sesji (uzupełnienie ADR-0029): numery na liście, słowa poza zakresem przygaszone */
.range { align-items: center; flex-wrap: wrap; }
.range input { width: 5.5rem; padding: 6px 8px; }
.words .number { color: var(--muted); min-width: 2.6em; text-align: right; font-variant-numeric: tabular-nums; }
.words li button.active .number { color: #fff; }
.words li button.outside { opacity: 0.55; }

/* ---------------------------------------------------------------- dodatki szkieletu */
#transcript-history { display: flex; flex-direction: column; gap: 12px; }
#transcript-history:empty { display: none; }
@media (max-width: 900px) {
  .submenu { position: static; display: block; width: auto; margin: 0; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .menu-sub > .menu-item .sub-chev { display: none; }
}

/* Awatar (plan awatara B0, ADR-0077): płótno three.js w oknie jak film wzorcowy, podgląd kamery w rogu */
.aw-screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.aw-pip { position: absolute; right: 10px; bottom: 10px; width: 26%; max-width: 180px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .25); transform: scaleX(-1); background: #000; }
.aw-pip[hidden] { display: none; }
.aw-check { display: flex; align-items: center; gap: 6px; margin-top: 10px; cursor: pointer; }
.aw-word { width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 13px; background: var(--surface); color: var(--text); }
.aw-word:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
#aw-list .chip-btn.on { border-color: var(--accent-2); background: var(--accent-soft); }
.aw-text { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; line-height: 1.45; resize: vertical; background: var(--surface); color: var(--text); }
.aw-text:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.aw-card { inset: auto 0 0 0; padding: 10px 16px 14px; background: linear-gradient(180deg, rgba(13, 27, 42, 0) 0%, rgba(13, 27, 42, .85) 40%); justify-content: flex-end; }
.aw-card .rev-card-main { font-size: 28px; }
.aw-card.letter .rev-card-main { font-size: 64px; }
#aw-controls .aw-check { margin-top: 0; }
#aw-controls .aw-check[hidden] { display: none; }

/* ================================================================ ADR-0094: panel – motyw, język, ustawienia, pomoc,
   powiadomienia, wyszukiwanie, co nowego, aplikacje. Nowe widoki w tym samym stylu (.page, .card, .btn, .seg). */

/* ---------------------------------------------------------------- ciemny motyw: tokeny (kontrast WCAG AA sprawdza
   tests/test_accessibility.py); data-theme ustawia skrypt w <head> i ustawienia.js, „jak system” śledzi system */
:root[data-theme="dark"] {
  --bg: #0b141c;
  --page: #0f1a24;
  --surface: #142230;
  --surface-2: #1a2a39;
  --surface-3: #24384a;
  --border: #22364a;
  --border-strong: #2f4a62;
  --text: #e7eef5;
  --text-2: #b4c3d1;
  --text-3: #9aabbb;
  --accent: #2bb3ad;
  --accent-2: #6cbcec;
  --accent-deep: #a7dcf7;
  --accent-ink: #ffffff;
  --accent-soft: #123436;
  --live: #c53030;
  --live-soft: #3b1d22;
  --live-ink: #ff9b9b;
  --success: #4fd1b5;
  --info: #6cbcec;
  --warn: #f0a24a;
  --warn-soft: #3a2a14;
  --cam: #05090d;
  --shadow-menu: 0 16px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
/* kolory zapisane na sztywno w jasnym projekcie */
:root[data-theme="dark"] .quick.featured { background: linear-gradient(135deg, #123436 0%, #142230 60%); border-color: #1f5a57; }
:root[data-theme="dark"] .empty-icon, :root[data-theme="dark"] .session-row .row-icon { background: linear-gradient(135deg, var(--accent-soft), var(--surface-2)); }
:root[data-theme="dark"] .tag.admin { background: #16304a; }
:root[data-theme="dark"] .person-avatar.admin { background: #0e4a78; }
:root[data-theme="dark"] .login { background: var(--bg); }
:root[data-theme="dark"] .modal, :root[data-theme="dark"] body.menu-open .scrim { background: rgba(0, 0, 0, .55); }
:root[data-theme="dark"] #status { background: var(--surface-3); color: var(--text); }
:root[data-theme="dark"] #status.error { background: var(--live); color: #fff; }
/* czerwony jako tło przycisku zostaje ciemny (biały tekst), jako kolor tekstu jaśniejszy */
:root[data-theme="dark"] .menu-item.danger, :root[data-theme="dark"] .access-error,
:root[data-theme="dark"] .login-card .login-error, :root[data-theme="dark"] .tag.live,
:root[data-theme="dark"] .btn.ghost.danger, :root[data-theme="dark"] .mon-table tr.error td:nth-child(2) { color: var(--live-ink); }
/* tła z białym tekstem w nagrywaniu i bazie nagrań: ciemny akcent i ciemna zieleń */
:root[data-theme="dark"] .layout { --accent: #1a6fa3; }
:root[data-theme="dark"] .badge.mine, :root[data-theme="dark"] .banner.sign { background: #0b7a6f; }
:root[data-theme="dark"] #rec-session.active { background: #b35900; border-color: #b35900; }

/* ---------------------------------------------------------------- mniej animacji (ustawienie, jak prefers-reduced-motion) */
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
/* język angielski z pamięci: strona pokazuje się po podmianie napisów (skrypt w <head> odsłania ją najpóźniej po 1,5 s) */
html[data-ui-lang]:not([data-ui-lang="pl"]):not(.i18n-ready) body { visibility: hidden; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.seg-control button span[data-i18n] { font-size: inherit; color: inherit; } /* napis zakładki; liczba obok zostaje mała */

/* ---------------------------------------------------------------- wygaszone moduły (bez okna „Już wkrótce”) */
[aria-disabled="true"].soon { cursor: default; }
.nav-item.soon, .menu-item.soon, .panel-action.soon { opacity: .55; }
.sub-item.soon { opacity: .7; }
.quick.soon { opacity: .55; }
.sub-item.soon:hover { color: var(--text-3); background: transparent; }
.nav-item.soon:hover { color: var(--text-2); }
.menu-item.soon:hover { background: transparent; }
.soon-tip {
  position: fixed; z-index: 120; max-width: 280px; padding: 6px 10px; border-radius: 8px; background: var(--text);
  color: var(--page); font-size: 12px; font-weight: 500; box-shadow: var(--shadow-menu); pointer-events: none;
}

/* ---------------------------------------------------------------- pasek górny: język, powiadomienia, szukaj */
.topmenu { position: relative; }
.search-mobile { display: none; }
.lang-menu { width: 190px; }
.menu-code { font-size: 11px; font-weight: 700; color: var(--text-3); width: 22px; }
.menu-item[aria-checked="true"] { background: var(--surface-2); }
.menu-item[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent-2); font-weight: 700; }
.notif-btn { position: relative; }
.notif-count {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--live); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.notif-panel { width: 360px; padding: 0; max-height: min(72vh, 560px); display: flex; flex-direction: column; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-head h2 { font-size: 14px; font-weight: 600; }
.notif-list { list-style: none; margin: 0; padding: 4px; overflow-y: auto; }
.notif-list:empty { display: none; }
.notif-item {
  display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: 10px; width: 100%; text-align: left; padding: 10px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--text); font: inherit;
}
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-2); }
.notif-item:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.notif-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.notif-item.unread .dot { background: var(--accent-2); }
.notif-title, .notif-text, .notif-time { display: block; }
.notif-title { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.notif-item.unread .notif-title { font-weight: 600; }
.notif-text { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.notif-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.notif-empty { padding: 24px 16px; text-align: center; font-size: 12px; color: var(--text-3); }
.notif-foot { padding: 8px 14px; border-top: 1px solid var(--border); text-align: right; }
.badge-new { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-deep); text-transform: uppercase; letter-spacing: .03em; }
.menu-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; }

/* ---------------------------------------------------------------- przełączanie kont (marka w panelu bocznym) */
.brand-wrap { position: relative; }
.switch-menu { top: calc(100% - 4px); left: 0; right: 0; width: auto; }
.switch-head { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.switch-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.switch-item .person-avatar { width: 28px; height: 28px; font-size: 11px; }
.switch-text { min-width: 0; }
.switch-email { display: block; font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-sub { display: block; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switch-item[aria-current="true"]::after { content: "✓"; color: var(--accent-2); font-weight: 700; }

/* ---------------------------------------------------------------- logowanie: przełącznik języka */
.ui-lang-switch { margin-left: auto; display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.ui-lang-switch button { border: 0; background: transparent; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.ui-lang-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(13, 27, 42, .08); }

/* ---------------------------------------------------------------- okno potwierdzenia */
.modal-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.modal-card .btn.danger-fill { background: var(--live); color: #fff; }

/* ---------------------------------------------------------------- ustawienia */
.set-tabs { margin-bottom: 16px; }
.set-panel { padding: 4px 20px; max-width: 880px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.set-panel > :last-child { border-bottom: 0; }
.set-text { min-width: 0; flex: 1; }
.set-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.set-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; max-width: 560px; overflow-wrap: anywhere; }
.set-desc:empty { display: none; }
.set-seg { flex-shrink: 0; flex-wrap: wrap; }
.set-input {
  font: inherit; font-size: 13px; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); min-width: 220px; max-width: 100%;
}
.set-input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.set-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.set-range { display: flex; align-items: center; gap: 10px; }
.set-range input[type="range"] { width: 200px; accent-color: var(--accent-2); }
.set-range output { min-width: 40px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); }
.set-account { display: flex; align-items: center; gap: 14px; min-width: 0; }
.set-avatar { width: 44px; height: 44px; font-size: 15px; cursor: default; flex-shrink: 0; }
.set-email { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.set-msg { font-size: 12px; color: var(--success); padding: 0 0 12px; }
.set-msg.error { color: var(--live); }
:root[data-theme="dark"] .set-msg.error { color: var(--live-ink); }
.set-accounts { list-style: none; margin: 0; padding: 0 0 12px; display: flex; flex-direction: column; gap: 6px; }
.set-accounts:empty { display: none; }
.set-accounts li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; }
.set-accounts .switch-text { flex: 1; }
.set-accounts .person-avatar { width: 32px; height: 32px; font-size: 11px; }

/* ---------------------------------------------------------------- pomoc i dokumentacja */
.help-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.help-search { width: 320px; max-width: 100%; }
.help-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.help-toc { padding: 8px; position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; }
.help-toc button { text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.help-toc button:hover, .help-toc button.on { background: var(--surface-2); color: var(--text); }
.help-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.help-section { padding: 20px 24px; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.help-section h2 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.help-section h3 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; }
.help-section p, .help-section li { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.help-section p + p { margin-top: 8px; }
.help-section ul, .help-section ol { margin: 6px 0 0; padding-left: 20px; }
.help-section li + li { margin-top: 4px; }
.help-section code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.help-section kbd { font-family: inherit; font-size: 11.5px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 0 6px; border-radius: 5px; }
.help-section table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.help-section th, .help-section td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.help-section th { font-size: 12px; font-weight: 600; color: var(--text-2); }
.help-section .link-btn { font-size: inherit; }
.help-empty { margin-top: 12px; }

/* ---------------------------------------------------------------- aplikacje */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.app-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.app-wide { grid-column: 1 / -1; }
.app-head { display: flex; align-items: center; gap: 14px; }
.app-head .quick-icon { margin-bottom: 0; flex-shrink: 0; }
.app-title { font-size: 15px; font-weight: 600; }
.app-state { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.app-state:empty { display: none; }
.app-text { font-size: 13px; color: var(--text-2); }
.app-steps { margin: 0; padding-left: 20px; font-size: 13px; color: var(--text); display: flex; flex-direction: column; gap: 6px; }
.app-steps:empty { display: none; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.app-links li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.app-link-text { flex: 1; min-width: 0; }
.app-link-name { font-size: 13px; font-weight: 500; }
.app-link-url { font-size: 11px; color: var(--text-3); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soon-card { opacity: .6; }

/* ---------------------------------------------------------------- co nowego */
.news-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; max-width: 880px; }
.news-item { padding: 16px 20px; }
.news-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.news-meta .badge-new { margin-left: 0; }
.news-title { font-size: 15px; font-weight: 600; margin-top: 4px; }
.news-text { font-size: 13px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }

/* ---------------------------------------------------------------- paleta wyszukiwania (Ctrl+K / ⌘K) */
.modal.palette { place-items: start center; padding-top: min(12vh, 110px); }
.palette-card {
  width: 100%; max-width: 640px; max-height: min(78vh, 640px); background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-menu); overflow: hidden; display: flex; flex-direction: column;
}
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.palette-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font: inherit; font-size: 15px; color: var(--text); height: 32px; }
.palette-input kbd { font-size: 11px; background: var(--surface-2); padding: 2px 6px; border-radius: 4px; color: var(--text-3); }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.palette-list:empty { display: none; }
.palette-group { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.palette-item[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent-2); }
.pi-text { min-width: 0; flex: 1; }
.pi-title { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-kind { font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.palette-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.palette-foot { padding: 8px 16px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-3); }

/* ---------------------------------------------------------------- telefon i wąskie okna */
@media (max-width: 1100px) {
  .search-mobile { display: grid; }
}
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; flex-direction: row; flex-wrap: wrap; max-height: none; }
}
@media (max-width: 520px) {
  .set-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .set-panel { padding: 4px 14px; }
  .set-seg { align-self: flex-start; }
  .set-input { min-width: 0; width: 100%; }
  .set-actions { justify-content: flex-start; }
  .set-range input[type="range"] { flex: 1; width: auto; }
  .help-search { width: 100%; }
  .help-section { padding: 16px; }
  .notif-panel { position: fixed; top: calc(var(--topbar-h) + 4px); left: 8px; right: 8px; width: auto; }
  .modal.palette { padding-top: 8px; }
  .top-actions { gap: 6px; }
}
