/* Wygląd w stylu Intercom (DESIGN.md): ciemny (domyślny) i jasny – przełączane w ustawieniach.
   Krój Inter (zamiennik Saans zalecany w DESIGN.md), zapisany lokalnie – działa bez internetu.
   Kolor przewodni (--accent) ustawia panel administracyjny (/branding.css); domyślnie pomarańcz Intercomu. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* ciemny – czerń i grafit Intercomu */
:root {
  --bg: #000000; --panel: #141413; --panel2: #1f1f1e; --line: #2a2a28; --line2: #3d3d3b;
  --fg: #ffffff; --fg2: #d4d3cf; --muted: #9c9fa5; --accent: #ff5600; --accent-fg: #000000;
  --primary: #ffffff; --primary-fg: #000000;
  --accent-bg: color-mix(in srgb, var(--accent) 15%, var(--bg)); --accent-line: color-mix(in srgb, var(--accent) 50%, var(--bg));
  --accent-text: color-mix(in srgb, var(--accent) 80%, #ffffff);
  --ok: #3ddc7a; --ok-bg: #0d2617; --ok-line: #1d5a34; --ok-fg: #04140a;
  --warn: #fbbf24; --warn-bg: #2a2010; --warn-line: #5c4512;
  --urgent: #ff5a5f; --urgent-bg: #2a1012; --urgent-line: #6b2226; --urgent-fg: #ffb4b6; --urgent-solid: #d92d34;
  --info: var(--accent-text); --wait: #c9c3b6;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: var(--font);
  --r: 12px; --r2: 8px; --arch: 12px;
  --shadow: 0 12px 32px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .7);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
/* jasny – kremowe tło, białe karty, czarne przyciski główne */
:root[data-theme="light"] {
  --bg: #f5f1ec; --panel: #ffffff; --panel2: #ebe7e1; --line: #d3cec6; --line2: #b9b3a9;
  --fg: #111111; --fg2: #3b3b39; --muted: #626260; --accent-fg: #000000;
  --primary: #111111; --primary-fg: #ffffff;
  --accent-bg: color-mix(in srgb, var(--accent) 12%, #ffffff); --accent-line: color-mix(in srgb, var(--accent) 55%, #ffffff);
  --accent-text: color-mix(in srgb, var(--accent) 70%, #000000);
  --ok: #0a7a33; --ok-bg: #e2f2e7; --ok-line: #8fcaa4; --ok-fg: #ffffff;
  --warn: #8a5300; --warn-bg: #fbefd9; --warn-line: #e3c07f;
  --urgent: #c41c1c; --urgent-bg: #fbe9e9; --urgent-line: #e3a1a1; --urgent-fg: #a11616; --urgent-solid: #c41c1c;
  --wait: #6f6450;
  --shadow: 0 12px 32px rgba(40, 30, 20, .16);
  --scrim: rgba(40, 32, 24, .35);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--accent-line); color: var(--fg); }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); caret-color: var(--accent);
  font: 16px/1.45 var(--font); overscroll-behavior: none; font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: var(--r2); padding: 10px 14px; transition: background-color .15s, border-color .15s, transform .1s; }
button:hover { border-color: var(--line2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); font-weight: 600; }
button.danger { border-color: var(--urgent-line); color: var(--urgent-fg); }
button.icon { background: transparent; border: 0; padding: 6px 8px; font-size: 18px; color: var(--fg2); display: inline-flex; align-items: center; gap: 6px; }
button.icon:hover { color: var(--fg); }
button.big { width: 100%; padding: 14px; font-size: 18px; }
input { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px; outline: none; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus { border-color: var(--accent); }
.ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
.view { height: 100%; }
[hidden] { display: none !important; }

/* logowanie */
#login { display: grid; place-items: center; padding: 16px; }
.card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; display: grid; gap: 14px; }
.card h1 { margin: 0; text-align: center; font-size: 22px; }
.card label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.logo { font-size: 40px; text-align: center; }
.logo img { display: block; margin: 0 auto; max-width: 220px; max-height: 96px; object-fit: contain; }
.org-logo { display: inline-flex; align-items: center; flex: none; }
.org-logo img { display: block; object-fit: contain; }
.logo-tint { display: block; margin: 0 auto; -webkit-mask: var(--logo) center / contain no-repeat; mask: var(--logo) center / contain no-repeat; }
.top.talking .org-logo { display: none; }
details summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details label { margin-top: 8px; }
.err { color: var(--urgent-fg); min-height: 1em; margin: 0; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; margin: 0; }
.hint a { color: var(--info); }

/* główny układ */
#main { display: flex; flex-direction: column; height: 100dvh; }
.top { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 12px 8px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top strong { flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--urgent); flex: none; }
.dot.on { background: var(--ok); }
.dot.half { background: var(--warn); }

.banner { padding: 10px 14px; text-align: center; font-weight: 600; cursor: pointer; }
.banner.warn { background: var(--warn-bg); }
.toast { position: fixed; left: 12px; right: 12px; top: calc(56px + var(--safe-t)); z-index: 20; background: var(--panel2); border: 1px solid var(--line); border-color: color-mix(in srgb, var(--c, var(--accent)) 55%, var(--line)); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow); cursor: pointer; }
.toast.urgent { background: var(--urgent-bg); border-color: var(--urgent); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); white-space: nowrap; }
.tab::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; vertical-align: middle; }
.tab[aria-selected="true"] { color: var(--fg); border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); }
.tab.muted::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.tab .badge { margin-left: 6px; background: var(--accent); color: var(--accent-fg); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.tab .badge.urgent { background: var(--urgent); }
.tab.talking { animation: pulse 1s infinite; border-color: var(--ok); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 35%, transparent); } }

.feed { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.empty { margin: auto; color: var(--muted); text-align: center; }
.msg { flex: none; min-width: 0; max-width: 88%; align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 22%, var(--bg)); border-color: color-mix(in srgb, var(--accent) 45%, var(--bg)); }
.msg .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.msg .who { color: var(--fg); font-weight: 600; }
.msg .text { white-space: pre-wrap; word-wrap: break-word; }
.msg.quick { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.msg.quick .text { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; padding: 3px 12px; border-radius: 999px; font-weight: 700; background: color-mix(in srgb, var(--t) 22%, transparent); color: var(--t); border: 1px solid var(--t); }
.msg.urgent { background: var(--urgent-bg); border-color: var(--urgent); }
.msg.voice { background: transparent; border-style: dashed; color: var(--muted); font-size: 14px; }
.msg.system { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 13px; }
.tone-ok { --t: var(--ok); } .tone-warn { --t: var(--warn); } .tone-urgent { --t: var(--urgent); }
.tone-info { --t: var(--info); } .tone-wait { --t: var(--wait); }

.bottom { background: var(--panel); border-top: 1px solid var(--line); padding: 8px 10px calc(8px + var(--safe-b)); display: grid; gap: 8px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.quick button { min-width: 0; border-radius: 12px; padding: 8px 6px; font-size: 14px; line-height: 1.2; white-space: normal; font-weight: 600; color: var(--t); border-color: color-mix(in srgb, var(--t) 60%, transparent); background: color-mix(in srgb, var(--t) 12%, transparent); }
.quick button:active { transform: scale(.96); }
.composer { display: flex; gap: 8px; }
.composer button { flex: none; width: 52px; }
.pttrow { display: flex; gap: 8px; }
.ptt { flex: 1; min-height: 76px; border-radius: 16px; border: 2px solid var(--line2); background: var(--panel2); display: grid; place-content: center; gap: 2px; user-select: none; -webkit-user-select: none; touch-action: none; }
.ptt-l1 { font-size: 18px; font-weight: 700; }
.ptt-l2 { font-size: 13px; color: var(--muted); }
.ptt.live { background: var(--ok-bg); border-color: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 35%, transparent); }
.ptt.live .ptt-l2 { color: var(--fg); }
.ptt:disabled { opacity: .5; }
.pttlock { flex: none; width: 64px; border-radius: 16px; font-size: 22px; }
.pttlock[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok); }

/* panel */
.sheet { position: fixed; inset: 0; background: #000a; z-index: 30; display: flex; align-items: flex-end; justify-content: center; }
.sheet-body { width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; background: var(--panel); border-radius: 18px 18px 0 0; border: 1px solid var(--line); padding: 16px 16px calc(16px + var(--safe-b)); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font-size: 18px; }
.sheet h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.checklist, .switch { display: grid; gap: 4px; }
.checklist label, .switch { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.checklist input, .switch input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); }
.checklist .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.row { display: flex; gap: 8px; margin-top: 12px; }
.me { color: var(--muted); margin: 8px 0 0; }
.people-sum { color: var(--muted); font-size: 14px; margin: 6px 0 4px; }
.pgroup { margin-top: 14px; }
.pgroup h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; }
.pgroup h4::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.pgroup h4 small { margin-left: auto; font-weight: 400; color: var(--muted); font-size: 12px; }
.people { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.people li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel2); border-radius: var(--r2); }
.people .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.people .here { font-size: 12px; color: var(--muted); }
.pbadge { flex: none; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pbadge.can { color: color-mix(in srgb, var(--accent) 55%, #fff); border-color: color-mix(in srgb, var(--accent) 45%, var(--bg)); }
.pbadge.live { color: var(--ok-fg); background: var(--ok); border-color: var(--ok); font-weight: 700; animation: pulse 1s infinite; }

@media (min-width: 900px) {
  .feed { padding: 16px 24px; }
  .msg { max-width: 70%; }
}
.msg.voice .stt { font-style: italic; opacity: .75; }
.msg.voice .text { color: var(--fg); font-size: 16px; margin-top: 2px; }

/* logowanie z obsady Planning Center */
.lead { margin: 0; font-weight: 600; }
.roster { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; max-height: 46dvh; overflow-y: auto; }
.roster button { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 10px 12px; }
.roster .rn { font-weight: 600; }
.roster .rt { grid-column: 1; font-size: 12px; color: var(--muted); }
.roster .pbadge { grid-column: 2; grid-row: 1 / span 2; }
.roster .you { color: var(--info); font-weight: 400; font-size: 13px; }
.linkbtn { background: none; border: 0; color: var(--info); padding: 4px 0; text-align: left; }

/* pasek planu */
.planbar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--panel); padding: 8px 12px; }
.planbar .pl-now { font-weight: 700; }
.planbar .pl-next, .planbar .pl-muted { color: var(--muted); font-size: 13px; }
.planbar .live { background: var(--urgent-solid); color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; margin-right: 4px; letter-spacing: .05em; }
.planlist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.planlist li { padding: 8px 10px; border-radius: 10px; background: var(--panel2); cursor: default; }
.planlist li[data-iid] { cursor: pointer; }
.planlist li.ph { background: transparent; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 12px 2px 2px; }
.planlist li.cur { background: var(--ok-bg); border: 1px solid var(--ok); }
.planlist .pt { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.planlist .pm { color: var(--muted); font-weight: 400; font-size: 13px; white-space: nowrap; }
.planlist .pd { color: var(--muted); font-size: 13px; margin-top: 2px; white-space: pre-wrap; }
.adminlink { display: inline-block; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 600; }

/* 0.5: pasek planu Teraz/Dalej + sterowanie Live */
.planbar { display: flex; align-items: stretch; gap: 0; padding: 0; cursor: default; }
.planbar .pl-main { flex: 1; min-width: 0; padding: 6px 12px; cursor: pointer; display: grid; gap: 2px; }
.planbar .pl-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.planbar .pl-lbl { flex: none; width: 58px; font-size: 10px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.planbar .pl-now { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.planbar .pl-next { color: var(--fg2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.planbar .pl-meta { flex: none; color: var(--warn); font-size: 12px; white-space: nowrap; }
.planbar .pl-nextrow .pl-meta { color: var(--muted); }
.planbar .pl-note { flex: none; font-size: 12px; }
.planbar .live { margin: 0; }
.planbar .pl-ctl { display: flex; border-left: 1px solid var(--line); }
.planbar .pl-ctl button { width: 52px; border: 0; border-radius: 0; background: transparent; font-size: 18px; }
.planbar .pl-ctl button + button { border-left: 1px solid var(--line); background: var(--ok-bg); }
@media (max-width: 420px) { .planbar .pl-lbl { width: 46px; } }

.planctl { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin: 10px 0; }
.planctl button { padding: 14px; font-size: 16px; font-weight: 700; }
.pcard { border-radius: 12px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); background: var(--panel2); }
.pcard.now { border-color: var(--ok); background: var(--ok-bg); }
.pcard .pc-lbl { font-size: 11px; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.pcard .pt, .planlist .pt { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.pcard .pm { color: var(--warn); font-weight: 500; font-size: 13px; white-space: nowrap; }
.planlist li.nxt { border: 1px dashed var(--muted); }
.seq { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.seq span { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.pnote { font-size: 13px; margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: var(--bg); white-space: pre-wrap; overflow-wrap: anywhere; }
.pnote.mine { border: 1px solid var(--accent-line); background: var(--accent-bg); }
#sheetPlan h3 { margin-top: 16px; }

.pcard .pd { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* logowanie przez Planning Center */
.pcologin { display: block; text-align: center; padding: 14px; border-radius: 10px; background: var(--accent); color: var(--accent-fg); font-weight: 600; text-decoration: none; }
.pcoswitch { display: block; margin: 8px auto 0; padding: 8px; min-height: 44px; background: none; border: 0; color: var(--muted); font-size: 14px; text-decoration: underline; cursor: pointer; }
#pcoSwitchHint { text-align: center; margin: 4px 0 0; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* awatary */
.av { flex: none; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: var(--panel2); vertical-align: middle; }
.av.ini { display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: hsl(var(--h) 45% 38%); }
.msg .meta { align-items: center; }
.msg.quick { row-gap: 4px; }
.msg.voice .vline { display: flex; align-items: center; gap: 8px; }
.people li .av { width: 28px; height: 28px; }
.people li .av.ini { font-size: 11px; }

/* ogłoszenie zmiany punktu planu */
.msg.plan { align-self: stretch; max-width: none; background: var(--ok-bg); border-color: var(--ok-line); cursor: pointer; }
.msg.plan .pl-tag { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--ok); }
.msg.plan .pm { color: var(--warn); font-size: 13px; }
.msg.plan .pl-next2 { color: var(--fg2); font-size: 14px; margin-top: 2px; }
.msg.plan .pl-time { color: var(--muted); font-size: 11px; margin-top: 2px; }

.msg.member { align-self: center; background: transparent; border: 0; color: var(--muted); font-size: 12px; padding: 2px 8px; }
.msg.member b { color: var(--fg2); font-weight: 600; }

/* wezwania */
.people li.callable { cursor: pointer; }
.callform { display: flex; gap: 6px; margin: -2px 0 6px; }
.callform input { flex: 1; padding: 10px; }
.callform button { flex: none; }
.callbox { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #7f1d1dee; animation: callpulse 1.2s infinite; }
@keyframes callpulse { 50% { background: #b91c1cee; } }
.call-inner { width: 100%; max-width: 380px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.call-av .av { width: 96px; height: 96px; font-size: 32px; border: 3px solid #fff; }
.call-lbl { font-size: 13px; letter-spacing: .2em; font-weight: 800; color: #fecaca; }
.call-from { font-size: 28px; font-weight: 800; }
.call-text { font-size: 20px; }
.call-btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; width: 100%; margin-top: 14px; }
.call-btns button { padding: 18px; font-size: 18px; font-weight: 700; border-radius: 14px; }
.call-btns .primary { background: var(--ok); border-color: var(--ok); }

/* rozmowy prywatne */
.tab.dmtab { display: inline-flex; align-items: center; gap: 6px; }
.tab.dmtab::before { display: none; }
.tab.dmtab .av { width: 20px; height: 20px; font-size: 9px; }
.tab .dmclose { margin-left: 4px; padding: 0 4px; color: var(--muted); }
.callform .dmbtn { flex: none; }

.field { display: grid; gap: 6px; padding: 8px 0; color: var(--fg); }
.field select { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
.msg.voice .text.lowconf { color: var(--muted); font-style: italic; }

#elevateBox .row input { flex: 1; }

/* transmisja live */
.live-badge { font-size: 11px; font-weight: 800; letter-spacing: .04em; color: #fff; background: var(--urgent-solid); border-radius: 999px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45vw; }
.live-badge.bad { background: #d97706; }
.msg.stream { align-self: stretch; max-width: none; font-weight: 600; }
.msg.stream.k-start { border-color: var(--urgent-line); background: var(--urgent-bg); }
.msg.stream.k-stop { border-color: var(--line2); }
.msg.stream.k-problem { border-color: var(--warn-line); background: var(--warn-bg); }
.msg.stream.k-ok { border-color: var(--ok-line); background: var(--ok-bg); }
.msg.stream .st-time { color: var(--muted); font-weight: 400; font-size: 11px; }

/* wybrane kolumny notatek z Planning Center */
.pl-mynotes { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: #fde68a; }
.pl-mynotes span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* widok podzielony: plan + komunikacja */
.split { flex: 1; display: flex; min-height: 0; }
.comm { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.planpane { width: var(--plan-w, min(42%, 520px)); flex: none; overflow-y: auto; border-right: 1px solid var(--line, var(--line)); padding: 12px 14px 24px; background: var(--panel, var(--panel)); }
body.plan-right .split { flex-direction: row-reverse; }
body.plan-right .planpane { border-right: 0; border-left: 1px solid var(--line, var(--line)); }
.pp-head { font-weight: 800; font-size: 13px; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.planpane #sheetPlan .planlist li { cursor: default; }
.planpane #sheetPlan .planlist li[data-iid] { cursor: pointer; }
@media (max-width: 520px) { .live-badge .lb-names { display: none; } }
.live-badge.preview { background: var(--line2); }
.msg.stream.k-signal { font-weight: 500; }
.live-badge { flex-shrink: 0; }

/* dźwięk: wybór urządzeń */
.meter { height: 8px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
#micMeter { height: 100%; width: 0; background: linear-gradient(90deg, var(--ok), var(--warn) 75%, var(--urgent)); transition: width 80ms linear; }
details.adv summary { color: var(--muted); font-size: 14px; cursor: pointer; margin: 6px 0; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ===== 0.16: dopracowanie widoków mobilnych ===== */
.top { position: relative; z-index: 15; }
.top-spacer { flex: 1; }
/* kto mówi – pasek pod nagłówkiem (nakłada się na plan, nie przesuwa wiadomości) */
.talkbar { pointer-events: none; position: absolute; left: 0; right: 0; top: 100%; display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 7px 12px; background: var(--ok-bg); border-bottom: 1px solid var(--ok); color: #dcfce7; font-weight: 700; font-size: 15px; box-shadow: 0 6px 16px #0008; }
.talkbar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.talkbar span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-right: 8px; vertical-align: 1px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
/* Planning Center Live – zielona kropka przy „TERAZ” */
.planbar .pcl { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 5px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
/* przełącznik mówienie / pisanie (tylko telefon) */
.modebtn { display: none; flex: none; width: 56px; font-size: 22px; border-radius: 16px; padding: 0; }
/* panel: tytuł i ✕ zawsze widoczne */
#listenList, #optNoteCats { grid-template-columns: 1fr 1fr; column-gap: 12px; }
.checklist label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* osoby */
.people .nm { display: grid; }
.people .nm1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .here { font-size: 12px; color: var(--muted); }
.people-empty { color: var(--muted); font-size: 13px; margin: 16px 0 6px; line-height: 1.6; }
.people-empty span { white-space: nowrap; }
.people-empty span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; }
/* plan: tytuł i dane utworu zawijają się zamiast ściskać tytuł */
.planlist .pt, .pcard .pt { flex-wrap: wrap; }
.planlist .pt .pm, .pcard .pt .pm { margin-left: auto; }

@media (max-width: 600px) {
  /* szybkie przyciski: jeden przewijany rząd */
  #quickBar { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -10px; padding: 0 10px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 10px, #000 calc(100% - 28px), transparent); }
  #quickBar::-webkit-scrollbar { display: none; }
  #quickBar button { flex: none; white-space: nowrap; padding: 9px 14px; scroll-snap-align: start; }
  .modebtn { display: block; }
  body.can-talk:not(.typing) .composer { display: none; }
  body.can-talk.typing .pttrow { display: none; }
  body:not(.can-talk) #btnToPtt { display: none; }
  .ptt { min-height: 70px; }
  .pttlock { width: 56px; }
  .msg { max-width: 92%; }
}

/* telefon poziomo / niski ekran: wszystko ciaśniej, pole tekstu i przycisk mówienia w jednym rzędzie */
@media (max-height: 520px) {
  .top { padding-top: calc(4px + var(--safe-t)); padding-bottom: 4px; }
  .planbar .pl-main { padding: 3px 12px; }
  .planbar .pl-nextrow, .planbar .pl-mynotes { display: none; }
  .tabs { padding: 4px 8px; }
  .tab { padding: 5px 12px; }
  .feed { padding: 8px 12px; gap: 6px; }
  #quickBar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  #quickBar::-webkit-scrollbar { display: none; }
  #quickBar button { flex: none; white-space: nowrap; padding: 6px 12px; }
  .bottom { grid-template-columns: 1fr minmax(240px, 42%); align-items: stretch; padding-top: 6px; padding-bottom: calc(6px + var(--safe-b)); gap: 6px 8px; }
  body:not(.can-talk) .bottom { grid-template-columns: 1fr; }
  #quickBar { grid-column: 1 / -1; }
  .ptt { min-height: 46px; }
  .ptt-l1 { font-size: 15px; }
  .ptt-l2 { font-size: 11px; }
  .pttlock { width: 48px; font-size: 18px; }
  .modebtn { display: none; }
  .sheet-body { max-height: 96dvh; }
}
.planbar .pl-lbl { white-space: nowrap; width: 62px; }
@media (max-width: 420px) { .planbar .pl-lbl { width: 56px; } }

/* odliczanie czasu punktu */
.planbar .pl-cd { flex: none; margin-left: auto; font: 700 15px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--fg); padding: 3px 7px; border-radius: 6px; background: var(--panel2); }
.planbar .pl-cd:empty { display: none; }
.cd-warn { color: #111 !important; background: var(--warn) !important; }
.cd-over { color: #fff !important; background: var(--urgent-solid) !important; animation: cdblink 1s infinite; }
.cd-up { color: var(--muted) !important; }
@keyframes cdblink { 50% { opacity: .7; } }
.pc-cd { float: right; display: grid; justify-items: end; gap: 2px; margin-left: 8px; }
.pc-cd .cd-big { font: 800 26px/1 var(--mono); font-variant-numeric: tabular-nums; padding: 4px 8px; border-radius: 8px; background: var(--bg); }
.pc-cd .cd-big:empty { display: none; }
.pc-cd .cd-end { font-size: 11px; color: var(--muted); }
.pushprefs { margin-top: 8px; }
.pushprefs label { white-space: normal; }

/* ===== 0.19: plan – przypięty bieżący/następny punkt, zwarty program ===== */
.planlist.compact { gap: 2px; }
.planlist.compact li { padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.planlist.compact li.ph { padding: 10px 2px 2px; cursor: default; }
.planlist.compact .prow { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.planlist.compact .pt1 { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.planlist.compact .pm { flex: none; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.planlist.compact .pdot { color: var(--info); font-weight: 800; }
.planlist.compact .pdet { display: none; padding-top: 4px; }
.planlist.compact li.open .pdet { display: block; }
.planlist.compact li.open .pt1 { white-space: normal; }
.planlist.compact li.cur { background: var(--ok-bg); border: 1px solid var(--ok); }
.planlist.compact li.nxt { border: 1px dashed var(--muted); }
.pgo { width: 100%; margin-top: 8px; padding: 8px; font-weight: 700; border-color: var(--ok); color: #bbf7d0; background: var(--ok-fg); }
.planctl { margin: 8px 0 4px; }
.plan-pin .pcard { margin-top: 6px; }
.plan-pin #planMeta { margin: 0; }
/* panel boczny: góra przypięta, przewija się tylko program */
.planpane { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.planpane #sheetPlan { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.planpane .plan-pin { flex: none; padding-bottom: 6px; border-bottom: 1px solid var(--line); max-height: 62%; overflow-y: auto; }
.planpane .plan-pin.sized { height: var(--pin-h); max-height: none; }
/* przeciągane granice: szerokość lewej kolumny i planu, podział planu (bieżący punkt / cały program) */
.col-resize, .row-resize { display: none; position: relative; flex: none; touch-action: none; z-index: 3; }
.col-resize { width: 9px; margin: 0 -4px; cursor: col-resize; }
.row-resize { height: 11px; margin: -5px 0; cursor: row-resize; }
.col-resize::after, .row-resize::after { content: ""; position: absolute; border-radius: 2px; background: transparent; transition: background .15s; }
.col-resize::after { top: 50%; left: 50%; width: 4px; height: 32px; margin: -16px 0 0 -2px; }
.row-resize::after { left: 50%; top: 50%; width: 32px; height: 4px; margin: -2px 0 0 -16px; }
.col-resize:hover::after, .row-resize:hover::after { background: var(--line2); }
.col-resize.drag::after, .row-resize.drag::after, .col-resize:focus-visible::after, .row-resize:focus-visible::after { background: var(--accent); }
body.split-on .split > .col-resize { display: block; }
.planpane .row-resize { display: block; }
body.resizing, body.resizing * { user-select: none; }
body.resizing.rs-col, body.resizing.rs-col * { cursor: col-resize !important; }
body.resizing.rs-row, body.resizing.rs-row * { cursor: row-resize !important; }
.planpane .plan-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 24px; overscroll-behavior: contain; }
.planpane .plan-scroll h3 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
/* arkusz na telefonie: przypięta góra też zostaje widoczna */

/* ===== 0.20: aplikacja z ekranu początkowego (iPhone) ===== */
/* dokument nigdy się nie przewija ani nie przesuwa – inaczej po schowaniu klawiatury iOS zostawia przesunięcie i dotyk trafia obok */
html.app, html.app body { height: 100%; overflow: hidden; }
html.app body { position: fixed; inset: 0; width: 100%; }
#login { overflow-y: auto; height: 100%; }
/* panel (ustawienia / osoby / plan): stały nagłówek, przewija się tylko treść – bez elementów „sticky” */
.sheet-body { display: flex; flex-direction: column; overflow: hidden; padding: 0 0 var(--safe-b); }
.sheet-head { flex: none; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
#sheetSettings, #sheetPeople { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 16px 16px; }
.sheet-body #sheetPlan { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet-body .plan-pin { flex: none; max-height: 52%; overflow-y: auto; padding: 8px 16px 6px; border-bottom: 1px solid var(--line); }
.sheet-body .plan-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 16px 16px; }
.sheet-body .plan-scroll h3 { margin: 10px 0 4px; }
/* większe pola dotyku dla przełączników i suwaka */
.switch, .checklist label { min-height: 44px; }
input[type="range"] { height: 32px; }

/* ===== 0.21: @oznaczenia i ksywki ===== */
.mention { color: color-mix(in srgb, var(--accent) 55%, #fff); font-weight: 600; }
.mention.me { color: #111; background: #fde047; border-radius: 4px; padding: 0 3px; }
.msg.text:has(.mention.me) { border-color: #facc15; box-shadow: 0 0 0 2px color-mix(in srgb, #facc15 35%, transparent); }
.mentionbox { display: grid; gap: 2px; max-height: 40dvh; overflow-y: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: 0 -8px 24px #0007; }
.mentionbox button { display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; min-height: 44px; }
.mentionbox button.sel, .mentionbox button:hover { background: color-mix(in srgb, var(--accent) 25%, transparent); }
.mentionbox .av { width: 28px; height: 28px; }
.mentionbox .mn { display: grid; min-width: 0; }
.mentionbox small { color: var(--muted); font-size: 12px; }
.nickrow { margin-top: 0; }
.nickrow input { flex: 1; }
.people .nk { color: color-mix(in srgb, var(--accent) 55%, #fff); }

/* 0.22 – link do instrukcji */
.helplink { margin: -4px 0 12px; font-size: 15px; }
.helplink a, #login .hint a { color: var(--info); text-decoration: none; }

/* 0.26 – dźwięk transmisji */
.prog-btn { position: relative; opacity: .55; }
.prog-btn.on { opacity: 1; }
.prog-btn.on::after { content: ''; position: absolute; right: 3px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--panel); }
.prog-btn.muted.on::after { background: var(--warn); }
.mixer { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 6px 10px; }
.mx-strip { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mx-strip.off .mx-fader, .mx-strip.off .mx-val { opacity: .35; }
.mx-strip.na { opacity: .4; }
.mx-ic { font-size: 20px; line-height: 1; }
.mx-name { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.15; min-height: 2.3em; }
.mx-fader { position: relative; width: 44px; height: 150px; touch-action: none; cursor: pointer; outline: none; }
.mx-fader::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--panel2); border: 1px solid var(--line); }
.mx-fill { position: absolute; left: 50%; bottom: 0; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--accent); }
.mx-knob { position: absolute; left: 50%; width: 38px; height: 18px; margin: 0 0 -9px -19px; border-radius: 5px; background: linear-gradient(var(--fg), #9aa3b5); border: 1px solid #0008; box-shadow: 0 2px 6px #0009; }
.mx-knob::after { content: ''; position: absolute; left: 5px; right: 5px; top: 8px; height: 2px; background: #333; }
.mx-fader.boost::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 50%; height: 1px; background: var(--fg2); opacity: .6; } /* znacznik 100% */
.mx-strip.over .mx-val { color: var(--warn); }
.mx-fader:focus-visible .mx-knob { outline: 2px solid var(--accent); outline-offset: 2px; }
.mx-val { font-size: 13px; font-variant-numeric: tabular-nums; }
.mx-mute { width: 100%; max-width: 64px; padding: 6px 0; font-size: 12px; font-weight: 700; letter-spacing: .03em; border-radius: 8px; }
.mx-mute.on { background: var(--urgent-solid); border-color: var(--urgent-solid); color: #fff; }
.progbox { position: absolute; top: calc(100% + 6px); right: 8px; z-index: 40; width: min(340px, calc(100vw - 16px)); background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.45); display: grid; gap: 12px; }
.pb-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pb-st { font-size: 13px; color: var(--muted); white-space: nowrap; }
.pb-st.ok { color: var(--ok); } .pb-st.warn { color: var(--warn); }
.pb-sw { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.pb-sw input, .pb-ck input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.pb-vol { display: grid; grid-template-columns: auto 1fr 44px; gap: 10px; align-items: center; }
.pb-vol input { width: 100%; padding: 0; accent-color: var(--accent); height: 28px; }
.pb-vol span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.pb-ck { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.pb-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.pb-hint:empty { display: none; }

/* 0.27 – „kto mówi” w nagłówku zamiast paska zasłaniającego zakładki kanałów */
.talkbar { position: static; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow: hidden; gap: 12px; padding: 4px 12px; border: 1px solid var(--ok); border-radius: 999px; box-shadow: none; font-size: 14px; }
.talkbar span { flex: 0 1 auto; }
.top.talking #orgName, .top.talking .top-spacer { display: none; }
.top > button, .top > .live-badge { flex: none; white-space: nowrap; }
/* wąski telefon: logo i „LIVE” ustępują miejsca przyciskom – ustawienia zawsze widoczne (motyw jest też w ⚙️ → Widok) */
.top > .org-logo, .top > #orgName { flex: 0 1 auto; min-width: 0; overflow: hidden; }
.top > .org-logo > img, .top > .org-logo > .logo-tint { max-width: 100%; }
.top > .live-badge { flex-shrink: 1; min-width: 64px; } /* „● LIVE” zostaje czytelne, ucinają się najwyżej nazwy */
@media (max-width: 440px) {
  #btnTheme { display: none; }
  .top { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .top > button.icon { padding-left: 6px; padding-right: 6px; min-width: 40px; }
}
@media (max-width: 370px) { /* małe iPhone’y i „powiększony ekran” */
  .top > button.icon { padding-left: 3px; padding-right: 3px; min-width: 34px; }
  .top { gap: 2px; padding-left: 6px; padding-right: 6px; }
}
.top.talking { gap: 6px; }
@media (max-width: 420px) { .top.talking > button.icon { padding-left: 5px; padding-right: 5px; } .talkbar { padding: 4px 10px; font-size: 13.5px; } }
.pb-lat { border-top: 1px solid var(--line); padding-top: 10px; font-size: 14px; }
.pb-lat-h b { margin-left: 4px; } .pb-lat-h b.ok { color: var(--ok); } .pb-lat-h b.mid { color: var(--warn); } .pb-lat-h b.bad { color: var(--urgent); }
.pb-lat-d { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pb-lat-w { color: #fcd34d; font-size: 12.5px; margin-top: 4px; display: grid; gap: 3px; }
.pb-lat-w:empty { display: none; }
.pb-ultra { display: grid; gap: 8px; }
.pb-buf { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.pb-buf select { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px; }

/* 0.32 – aplikacja natywna */
html.native #micBox, html.native #spkRow, html.native #btnSpkTest, html.native #btnDevRefresh, html.native .web-only, html.native #btnPush, html.native #btnPushTest { display: none !important; }
.natbox > * { min-width: 0; }
.natbox select { width: 100%; max-width: 100%; }
.natbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.natbox .row button { white-space: nowrap; }
.remote-note { background: color-mix(in srgb, var(--info) 12%, var(--bg)); border: 1px solid color-mix(in srgb, var(--info) 40%, var(--line)); border-radius: 10px; padding: 10px 12px; margin: 0; }
.app-links { display: grid; gap: 8px; }
.app-links .al-h { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.app-links .al-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.app-badge { display: inline-flex; align-items: center; gap: 10px; min-width: 190px; padding: 7px 14px 7px 10px; border-radius: 10px; background: #000; border: 1px solid #555; color: #fff; text-decoration: none; line-height: 1.1; }
.app-badge:hover { border-color: #aaa; }
.app-badge svg { width: 24px; height: 24px; flex: none; }
.app-badge small { display: block; font-size: 10px; letter-spacing: .02em; opacity: .85; }
.app-badge b { display: block; font-size: 16px; font-weight: 600; }
html.native .app-links { display: none !important; }
.srvbtn { width: 100%; background: none; color: var(--muted); font-size: 14px; }

.boom { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 6px; }
.boom .hint { margin: 0; }
#boomState b.dn { color: var(--ok); } #boomState b.up { color: var(--muted); }

button.busy { opacity: .6; cursor: progress; }

/* ---- kilka kanałów obok siebie ---- */
.feeds { flex: 1; display: flex; min-height: 0; min-width: 0; }
.fcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.fcol + .fcol { border-left: 1px solid var(--line); }
.colhead { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.colhead::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--muted)); flex: none; }
.colhead b { color: var(--fg); }
.colhead select { flex: 1; min-width: 0; padding: 4px 6px; font-size: 13px; }
.colhead .xx { flex: none; padding: 2px 8px; font-size: 13px; }
.colhead.talking::before { animation: pulse 1s infinite; background: var(--ok); }
body.cols .msg { max-width: 92%; }
body.cols .feed { padding: 10px 12px; }
@media (max-width: 699px) { .fcol.extra { display: none; } #optColsRow, #optColsHint { display: none; } }
.modform { flex-wrap: wrap; }
.modform select { flex: 1; min-width: 110px; padding: 8px; }
.pgroup h4 .chstt { margin-left: 8px; padding: 1px 8px; font-size: 12px; font-weight: 400; }

/* słuchanie kanałów – widoczne na zakładkach i nad rozmową */
.tab .li { margin-left: 7px; font-size: 13px; padding: 2px 3px; margin-right: -6px; border-radius: 6px; cursor: pointer; }
.tab .li:hover { background: color-mix(in srgb, var(--fg) 12%, transparent); }
.tab.muted .badge, .tab.muted .li { text-decoration: none; display: inline-block; }
.listenbar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: color-mix(in srgb, var(--warn, var(--warn)) 16%, var(--panel)); border-bottom: 1px solid color-mix(in srgb, var(--warn, var(--warn)) 55%, transparent); font-size: 14px; }
.listenbar span { flex: 1; min-width: 0; }
.listenbar b { color: var(--c); }
.listenbar button { flex: none; padding: 8px 14px; }
.colhead .li.off { opacity: .8; }
/* przycisk mówienia: kanał w jego kolorze – widać, dokąd idzie głos */
.ptt { border-color: color-mix(in srgb, var(--c, var(--line2)) 70%, var(--line2)); }
.ptt-l2 { margin-top: 2px; }
.ptt-ch { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; font-family: var(--mono); letter-spacing: .04em; color: var(--c, var(--fg)); background: var(--bg); border: 1px solid color-mix(in srgb, var(--c, var(--muted)) 60%, transparent); }
.ptt.live .ptt-ch { background: var(--c, var(--ok)); color: var(--bg); border-color: transparent; }
.tab .li.pop { animation: lipop .6s ease-out; }
@keyframes lipop { 0% { transform: scale(1); } 35% { transform: scale(1.7); } 100% { transform: scale(1); } }
.tab .li.fixed { cursor: default; }
.tab .li.fixed:hover { background: none; }

/* ===== okienko czatu (jeden kanał) ===== */
.mini-only, button.icon.mini-only { display: none; }
html.mini .mini-only:not([hidden]), html.mini button.icon.mini-only:not([hidden]) { display: inline-flex; align-items: center; justify-content: center; }
html.mini #tabs, html.mini #listenBar, html.mini #btnMix, html.mini #btnPeople, html.mini #btnProg,
html.mini #orgName, html.mini #orgLogo, html.mini #liveBadge, html.mini #planPane, html.mini #planBar,
html.mini .top-spacer, html.mini #btnToPtt, html.mini #btnToText, html.mini #mainHead { display: none !important; }
html.mini .top { gap: 6px; padding-left: 8px; padding-right: 8px; }
html.mini .mini-ch { flex: 1; min-width: 0; font-weight: 800; font-size: 16px; padding: 8px 10px; border-radius: 10px;
  border: 2px solid var(--c, var(--line)); background: color-mix(in srgb, var(--c, var(--muted)) 18%, var(--panel)); color: var(--fg); }
html.mini .top .icon.mini-only { padding: 6px 8px; min-width: 34px; font-weight: 700; }
html.mini .top.talking .mini-ch { flex: 0 1 40%; }
html.mini .feed { font-size: var(--mini-font, 17px); padding: 8px; }
html.mini .feed .msg { max-width: 100%; }
html.mini .split { display: flex; }
html.mini .bottom { padding: 6px 8px calc(6px + var(--safe-b)); gap: 6px; }
/* pisanie i mówienie naraz – bez przełączania trybów */
html.mini body .composer { display: flex !important; }
html.mini body.can-talk .pttrow { display: flex !important; }
html.mini .ptt { min-height: 54px; border-radius: 12px; }
html.mini .ptt-l1 { font-size: 14px; }
html.mini .pttlock { width: 52px; }
html.mini #quickBar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
html.mini #quickBar button { flex: none; white-space: nowrap; padding: 7px 12px; }
html.pip #miniPip, html.pip #miniExit, html.pip #btnSettings { display: none !important; }
html.pip body { margin: 0; }
html.pip #main { display: flex; flex-direction: column; height: 100dvh; }
.pipnote { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; background: var(--bg); padding: 24px; }
.pipnote .logo { font-size: 48px; }
.pipnote p { font-size: 18px; margin: 8px 0; }
.ptt.nomic { border-style: dashed; border-color: var(--warn); }
.ptt.nomic .ptt-l1 { color: var(--warn); font-size: 14px; }

/* ===== wspólna warstwa komponentów (od 0.47; styl Intercom od 0.49) ===== */
/* przewijanie i drobne powierzchnie przeglądarki */
* { scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.top { background: var(--bg); border-bottom-color: var(--line); }
.top strong { font-weight: 600; letter-spacing: -.01em; }
/* stan połączenia: plakietka z diodą i napisem (zamiast samej kropki) */
.top .dot { width: auto; height: auto; background: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--urgent-line); border-radius: var(--r2); font: 500 11px/1.2 var(--mono); letter-spacing: .06em; color: var(--urgent); }
.top .dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.top .dot::after { content: "BRAK POŁĄCZENIA"; }
.top .dot.half { color: var(--warn); border-color: var(--warn-line); }
.top .dot.half::after { content: "ŁĄCZENIE"; }
.top .dot.on { color: var(--ok); border-color: var(--ok-line); }
.top .dot.on::after { content: "POŁĄCZONO"; }
@media (max-width: 520px) { .top .dot { padding: 6px; border: 0; } .top .dot::after { content: none !important; } }

/* kanały: dioda świeci = słuchasz, pusty pierścień = nie słuchasz */
.tabs { background: var(--bg); gap: 6px; }
.tab { border-radius: var(--r2); padding: 8px 12px; font-size: 15px; }
.tab::before { box-shadow: 0 0 6px color-mix(in srgb, var(--c) 55%, transparent); }
.tab.muted::before { box-shadow: inset 0 0 0 1.5px var(--muted); }
.tab[aria-selected="true"] { color: var(--fg); border-color: var(--accent); background: var(--accent-bg); }
.tab .badge { border-radius: var(--r2); font-family: var(--mono); font-weight: 500; }
.tab .badge.urgent { background: var(--urgent-solid); color: #fff; }
.tab .li { display: inline-flex; vertical-align: -3px; color: var(--muted); }
.tab .li .ic { width: 16px; height: 16px; }
.tab:not(.muted) .li:not(.fixed) { color: var(--fg2); }
.tab.talking { border-color: var(--ok); }

/* wiadomości */
.feed { gap: 10px; }
.msg { border-radius: var(--r2); background: var(--panel); }
.msg.mine { background: var(--accent-bg); border-color: var(--accent-line); }
.msg .meta { font-family: var(--mono); font-size: 11px; letter-spacing: .02em; align-items: baseline; }
.msg .who { font-family: var(--font); font-size: 13px; letter-spacing: 0; }
.msg.voice { border-style: solid; background: var(--panel); }
.msg.urgent { background: var(--urgent-bg); border-color: var(--urgent-line); }
.msg.quick .text { border-radius: var(--r2); font-weight: 600; background: color-mix(in srgb, var(--t) 14%, transparent); border-color: color-mix(in srgb, var(--t) 50%, transparent); }
.msg.system { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.empty { font-size: 15px; line-height: 1.5; max-width: 30ch; }
.toast.urgent { background: var(--urgent-bg); border-color: var(--urgent-line); }

/* dół: szybkie przyciski neutralne, ton jako dioda; PILNE osobno */
.bottom { background: var(--bg); }
.quickrow { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.quickrow .quick { flex: 1; min-width: 0; }
.quick button { border-radius: var(--r2); color: var(--fg); font-weight: 500; background: var(--panel); border-color: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.quick button::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--t); }
.quick button:hover { border-color: var(--line2); }
.urgentbtn { position: relative; flex: none; width: 96px; overflow: hidden; display: grid; place-content: center; justify-items: center; gap: 1px; padding: 6px 8px; border-radius: var(--r); border: 1px solid var(--urgent-line); background: var(--urgent-bg); color: var(--urgent); font-weight: 700; letter-spacing: .04em; line-height: 1.1; user-select: none; -webkit-user-select: none; touch-action: none; }
.urgentbtn .ic { width: 18px; height: 18px; }
.urgentbtn small { font: 400 11px/1.2 var(--mono); letter-spacing: .02em; color: var(--urgent-fg); opacity: .8; }
.urgentbtn::after { content: ""; position: absolute; inset: auto 0 0 0; height: 0; background: color-mix(in srgb, var(--urgent-solid) 55%, transparent); z-index: -1; }
.urgentbtn { isolation: isolate; }
.urgentbtn.arming::after { height: 100%; transition: height .6s linear; }
.urgentbtn.sent { background: var(--urgent-solid); color: #fff; border-color: var(--urgent-solid); }
.urgentbtn.sent small { color: #fff; }
.composer input { border-radius: var(--r2); }
.composer button[type="submit"] .ic { width: 20px; height: 20px; }

/* mówienie */
.ptt { border-radius: var(--r); border: 1px solid var(--line2); background: var(--panel2); }
.ptt-l1 { font-size: 17px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ptt-l2 { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }
.ptt.live { background: var(--ok-bg); border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 30%, transparent); }
.pttlock, .modebtn { border-radius: var(--r); color: var(--fg2); display: inline-flex; align-items: center; justify-content: center; }
.pttlock .ic, .modebtn .ic { width: 24px; height: 24px; }
.pttlock[aria-pressed="true"] { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.talkbar { background: var(--ok-bg); border-color: var(--ok-line); color: var(--fg); }

/* plan: odczyty w mono, karta „Teraz” zwieńczona łukiem okna */
.planbar { background: var(--panel); }
.planbar .pl-lbl { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; }
.planbar .pl-cd { font-family: var(--mono); font-weight: 600; color: var(--accent-text); background: var(--bg); border: 1px solid var(--line); }
.pcard { border-radius: var(--r); }
.pcard .pc-lbl { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; }
.pcard.now { border-color: var(--accent-line); background: var(--accent-bg); border-top-left-radius: var(--arch); border-top-right-radius: var(--arch); padding-top: 22px; }
.pc-cd .cd-big { font-family: var(--mono); font-weight: 600; color: var(--accent-text); background: var(--bg); border-radius: var(--r2); }
.planlist li { border-radius: var(--r2); }
.planlist li.cur { background: var(--accent-bg); border: 1px solid var(--accent-line); }
.pp-head { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }

/* arkusze i okienka */
.sheet { background: var(--scrim); }
.sheet-body { border-radius: 14px 14px 0 0; background: var(--panel); }
.sheet h2 { font-weight: 600; letter-spacing: -.01em; }
.sheet h3 { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; }
.progbox { border-radius: var(--r); box-shadow: var(--shadow); }
.card { border-radius: var(--r); }
.card h1 { font-weight: 600; letter-spacing: -.01em; }
.logo .ic { width: 44px; height: 44px; stroke-width: 1.4; color: var(--accent-text); }
.pbadge { border-radius: var(--r2); font-family: var(--mono); font-size: 11px; letter-spacing: .03em; }
.live-badge { border-radius: var(--r2); font-family: var(--mono); font-weight: 500; letter-spacing: .06em; }
.mx-ic .ic { width: 20px; height: 20px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .urgentbtn.arming::after { transition: height .6s linear !important; }
}
.quickrow .quick { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* ===== układ (0.47) =====
   telefon / tablet pionowo: karta planu u góry, zakładki kanałów, czat, dół z przyciskami
   tablet poziomo / komputer (≥1024px): lewa kolumna z kanałami i osobami | czat (kolumny) | plan po prawej */
.rail, .commmain { display: contents; }
.rail-h, .rail-people { display: none; }
.comm > .rail > .tabs { order: 2; }
.commmain > .planbar, .commmain > .banner, .commmain > .toast { order: 1; }
.commmain > .listenbar { order: 3; }
.commmain > .feeds { order: 4; }
.commmain > .bottom { order: 5; }

/* karta planu na telefonie zamiast paska */
.planbar { margin: 8px 10px 0; width: auto; border: 1px solid var(--accent-line); background: var(--accent-bg); border-radius: var(--r); border-top-left-radius: var(--arch); border-top-right-radius: var(--arch); overflow: hidden; }
.planbar .pl-main { padding: 14px 12px 8px; }
.planbar .pl-now { font-size: 16px; font-weight: 600; }
.planbar .pl-cd { font-size: 20px; padding: 4px 9px; }
.planbar .pl-ctl { border-left-color: var(--accent-line); }
.planbar .pl-ctl button { background: transparent; color: var(--fg); border-radius: 0; }

@media (min-width: 1024px) {
  .comm { flex-direction: row; }
  .rail { display: grid; grid-template-rows: auto minmax(72px, var(--rs-a, 1fr)) 14px minmax(72px, var(--rs-b, 1fr)); width: var(--rail-w, 256px); flex: none; min-height: 0; border-right: 1px solid var(--line); background: var(--bg); padding: 12px 10px; }
  .commmain { display: flex; flex-direction: column; flex: 1; min-width: 0; min-height: 0; }
  .rail-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 6px; font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  .comm > .rail > .tabs { order: 0; }
  .rail .tabs { flex-direction: column; flex: 0 1 auto; overflow-x: hidden; overflow-y: auto; padding: 0; border: 0; background: none; gap: 3px; min-height: 0; }
  .rail .tab { display: flex; align-items: center; width: 100%; text-align: left; padding: 9px 10px; border-color: transparent; color: var(--fg2); }
  .rail .tab.muted { color: var(--muted); }
  .rail .tab:hover { background: var(--panel); }
  .rail .tab[aria-selected="true"] { border-color: var(--accent-line); background: var(--accent-bg); color: var(--fg); }
  .rail .tab .badge { margin-left: auto; }
  .rail .tab .li { margin-left: auto; margin-right: 0; }
  .rail .tab .badge + .li { margin-left: 6px; }
  .rail .tab.dmtab .dmclose { margin-left: auto; }
  .rail-people { display: flex; flex-direction: column; min-height: 0; }
  .rail-split { display: block; position: relative; cursor: row-resize; touch-action: none; border-radius: 4px; }
  .rail-split::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
  .rail-split::after { content: ""; position: absolute; left: 50%; top: 50%; width: 32px; height: 4px; margin: -2px 0 0 -16px; border-radius: 2px; background: var(--line2); }
  .rail-split:hover::after, .rail-split.drag::after, .rail-split:focus-visible::after { background: var(--accent); }
  .comm > .col-resize { display: block; }
  .rail-people li.pm-open { background: var(--panel2); }
  .rail-ph { width: 100%; background: none; border: 0; border-radius: var(--r2); cursor: pointer; }
  .rail-ph span { text-transform: none; letter-spacing: 0; font-family: var(--font); font-size: 12px; color: var(--accent-text); }
  .rail-ph:hover { background: var(--panel); }
  .rail-people ul { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; gap: 1px; }
  .rail-people li { display: flex; align-items: center; gap: 9px; padding: 6px 10px; border-radius: var(--r2); font-size: 14px; min-width: 0; }
  .rail-people li.callable { cursor: pointer; }
  .rail-people li.callable:hover { background: var(--panel); }
  .rail-people .av { width: 24px; height: 24px; }
  .rail-people .rp-nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rail-people .rp-st { flex: none; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 400 11px/1.3 var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
  .rail-people .rp-st .ic { width: 13px; height: 13px; }
  .rail-people .rp-st.live { color: var(--ok); }
  .rail-people li.talking .av { box-shadow: 0 0 0 2px var(--ok); }
  .rail-people .rp-more { margin: 4px 10px 0; font-size: 12px; color: var(--muted); }
  .rail-people .callform { flex-wrap: wrap; padding: 4px 10px 8px; }
  .rail-people .callform input { flex: 1 1 100%; }
  .rail-people .callform button { flex: 1; padding: 8px; }
  /* plan po prawej: duże odliczanie */
  .planpane { width: min(30%, 380px); background: var(--bg); }
  .planpane .pc-cd .cd-big { font-size: 40px; padding: 4px 10px; }
  .planpane .pcard.now .pt { font-size: 18px; }
  .bottom { padding-left: 14px; padding-right: 14px; }
}
.msg.plan { background: var(--accent-bg); border-color: var(--accent-line); }
.msg.plan .pl-tag { color: var(--accent-text); font: 500 11px/1.4 var(--mono); letter-spacing: .1em; }
.colhead .xx { display: inline-flex; align-items: center; justify-content: center; color: var(--fg2); }
.colhead .xx .ic { width: 16px; height: 16px; }
.msg.voice .vline .ic, .callform .ic { width: 16px; height: 16px; }
.planbar .pl-row:first-child { flex-wrap: wrap; row-gap: 2px; }
.planbar .pl-now { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; flex: 1 1 60%; }

@media (max-width: 1023.98px) { .rail-split { display: none; } }

/* ===== okna: ustawienia na środku (w sekcjach), „Kto jest online” przy ikonie, menu osoby ===== */
.sheet[data-mode="settings"] .sheet-body { max-width: none; width: 100%; height: 92dvh; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.sheet[data-mode="settings"] .sheet-head { padding: 12px 16px; border-bottom: 1px solid var(--line); flex: none; }
.set { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.set-nav { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.set-nav::-webkit-scrollbar { display: none; }
.set-nav button { flex: none; display: inline-flex; align-items: center; gap: 8px; border-color: transparent; background: transparent; color: var(--fg2); padding: 8px 12px; font-size: 14px; border-radius: var(--r2); }
.set-nav button .ic { width: 18px; height: 18px; }
.set-nav button:hover { background: var(--panel2); }
.set-nav button[aria-current="true"] { background: var(--accent-bg); border-color: var(--accent-line); color: var(--fg); }
.set-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 16px calc(20px + var(--safe-b)); overscroll-behavior: contain; }
.sheet .set-h { font: 600 19px/1.3 var(--font); letter-spacing: -.01em; text-transform: none; color: var(--fg); margin: 16px 0 10px; }
.set-sec > h3:not(.set-h) { margin-top: 22px; }
@media (min-width: 700px) {
  .sheet { align-items: center; padding: 4dvh 4vw; }
  .sheet-body { border-radius: 14px; max-height: 86dvh; box-shadow: var(--shadow); }
  .sheet[data-mode="settings"] .sheet-body { width: min(1040px, 100%); height: min(86dvh, 840px); }
  .sheet[data-mode="plan"] .sheet-body { max-width: 640px; }
  .set { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .set-nav { flex-direction: column; gap: 2px; border-bottom: 0; border-right: 1px solid var(--line); padding: 12px 10px; overflow-y: auto; }
  .set-nav button { width: 100%; justify-content: flex-start; padding: 10px 12px; }
  .set-body { padding: 6px 32px 32px; }
  .set-sec { max-width: 660px; }
  /* „Kto jest online”: okienko pod ikoną */
  .sheet.pop { background: transparent; padding: 0; }
  .sheet.pop .sheet-body { position: fixed; top: var(--pop-top, 56px); right: var(--pop-right, 8px); width: min(400px, calc(100vw - 16px)); max-height: calc(100dvh - var(--pop-top, 56px) - 12px); border: 1px solid var(--line2); background: var(--panel); }
  .sheet.pop .sheet-head h2 { font-size: 16px; }
}
.pmenu { position: fixed; z-index: 60; width: min(320px, calc(100vw - 16px)); display: grid; gap: 10px; padding: 12px; background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); }
.pm-h { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pm-h .av { width: 36px; height: 36px; font-size: 13px; }
.pm-who { flex: 1; min-width: 0; display: grid; }
.pm-who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-who span { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.pm-who span.live { color: var(--ok); }
.pm-x { padding: 4px; }
.pm-row { display: flex; gap: 6px; }
.pm-row > * { flex: 1; min-width: 0; }
.pm-row button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; }
.pm-row button .ic { width: 17px; height: 17px; }
.pm-row select { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r2); padding: 8px; }
.pm-msg { padding: 10px; font-size: 14px; }
.pm-sec { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.pm-l { font: 500 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pm-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--fg2); }
.pm-f select { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r2); padding: 6px 8px; max-width: 60%; }
.people li.pm-open { outline: 1px solid var(--accent-line); }

/* ===== styl Intercom (0.49): pigułki, główny przycisk, spokojne powierzchnie – działa w obu motywach ===== */
.top, .tabs, .bottom, .rail, .a-top { background: var(--bg); }
.tab { border-radius: 999px; padding: 8px 14px; font-weight: 500; }
.tab[aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.tab[aria-selected="true"] .li, .tab[aria-selected="true"] .dmclose { color: inherit; }
.tab[aria-selected="true"]::before { box-shadow: 0 0 0 2px var(--primary-fg); }
@media (min-width: 1024px) {
  .rail .tab { border-radius: var(--r2); font-weight: 500; }
  .rail .tab[aria-selected="true"] { background: var(--panel2); border-color: var(--line); color: var(--fg); }
  .rail .tab[aria-selected="true"]::before { box-shadow: none; }
}
.tab .badge { background: var(--accent); color: var(--accent-fg); border-radius: 999px; font-weight: 600; }
/* mówienie = główna akcja ekranu */
.ptt { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.ptt .ptt-l2 { color: var(--primary-fg); opacity: .8; }
.ptt.live { background: var(--ok-bg); border-color: var(--ok); color: var(--fg); }
.ptt.nomic { background: var(--panel2); color: var(--fg); }
.ptt-ch { background: var(--bg); color: var(--fg); border-color: color-mix(in srgb, var(--c, var(--muted)) 70%, transparent); font-family: var(--font); font-weight: 600; }
.ptt-ch::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); margin-right: 6px; vertical-align: 1px; }
.msg { border-radius: var(--r); }
.msg.mine { background: var(--panel2); border-color: var(--line); }
.msg .meta, .msg .who { letter-spacing: 0; }
.quick button { border-radius: var(--r2); }
.planbar { background: var(--panel); border-color: var(--line); }
.pcard.now { background: var(--panel); border-color: var(--accent-line); }
.planlist li.cur { background: var(--accent-bg); border-color: var(--accent-line); }
.sheet-body, .progbox, .pmenu { background: var(--panel); }
.set-nav button[aria-current="true"] { background: var(--panel2); border-color: var(--line); }
.pbadge.can { color: var(--fg2); border-color: var(--line2); }
.mention, .people .nk { color: var(--accent-text); }
.linkbtn, .hint a, .roster .you { color: var(--accent-text); }
.top .dot { font-family: var(--font); font-weight: 600; letter-spacing: .04em; }
/* jasny motyw: drobiazgi zapisane wcześniej na stałe dla ciemnego */
:root[data-theme="light"] .mx-knob { background: linear-gradient(#ffffff, #d9d4cc); border-color: #0003; box-shadow: 0 2px 6px #0002; }
:root[data-theme="light"] .callbox { background: #c41c1cee; }
:root[data-theme="light"] .app-badge { background: #111111; border-color: #111111; }
:root[data-theme="light"] .rail-people li.talking .av { box-shadow: 0 0 0 2px var(--ok); }

/* ===== jeden system przycisków (0.50) =====
   główny (biały / czarny): tylko główna akcja – mówienie, wyślij, dołącz, Idę, Wezwij, Następny
   zwykły (obramowany, zawsze z ikoną po lewej): wszystkie przyciski w ustawieniach
   niebezpieczny (czerwony napis): wyloguj, wyczyść czat */
.set-body button:not(.icon), #sheetPeople button, #sheetPlan button, .callbox button, .planctl button, .adminlink, .pmenu .pm-row button, .row > button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; }
.set-body button:not(.icon):not(.primary):not(.danger), #sheetPlan button:not(.primary):not(.danger), .row > button:not(.primary):not(.danger) {
  background: var(--panel2); border-color: var(--line); color: var(--fg); }
.set-body button:not(.icon):not(.primary):not(.danger):hover { border-color: var(--line2); }
.set-body button .ic, #sheetPlan button .ic, .callbox button .ic, .planctl button .ic, .adminlink .ic, .helplink .ic { width: 18px; height: 18px; flex: none; }
.set-body button.danger { background: transparent; border-color: var(--urgent-line); color: var(--urgent); }
.set-body button.primary, .planctl button.primary, .callbox button.primary { font-weight: 600; }
.adminlink { background: var(--panel2); color: var(--fg); border: 1px solid var(--line); border-radius: var(--r2); font-weight: 500; }
.helplink a { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); }
.srvbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.sheet .row { flex-wrap: wrap; }
.chstt .ic, .pgo .ic { width: 15px; height: 15px; vertical-align: -3px; }

/* ---- stały wskaźnik mikrofonu i transkrypcji (widoczny w każdym widoku, także w Reżyserii i nad oknami) ---- */
.micbar { position: fixed; left: 0; right: 0; top: 0; z-index: 80; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 10px;
  min-height: 40px; box-sizing: border-box; padding: calc(6px + var(--safe-t)) 12px 6px; background: #c81e1e; color: #fff; font-weight: 700; font-size: 15px; text-align: center; box-shadow: 0 4px 14px #0007; pointer-events: none; }
.micbar .mb-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; animation: blink 1s infinite; flex: none; }
.micbar .mb-extra { font-weight: 600; opacity: .95; }
.micbar.voice-only { background: #8a4b00; font-size: 14px; min-height: 34px; }
body.mic-live #main { padding-top: var(--micbar-h, 40px); box-sizing: border-box; }
body.mic-live .top { padding-top: 8px; }
body.mic-live .toast { top: calc(56px + var(--micbar-h, 40px)); }
/* ---- informacja o prywatności przy pierwszym logowaniu ---- */
.privbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: #000b; }
.privcard { width: min(440px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--panel2, var(--panel)); color: var(--fg); border: 1px solid var(--line); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.privcard h2 { margin: 0 0 10px; font-size: 20px; }
.privcard p { margin: 0 0 10px; line-height: 1.45; }
.privcard .primary { width: 100%; margin-top: 6px; }
