:root {
  --bg: #f6f5fb;
  --panel: #ffffff;
  --side: #eeecf6;
  --text: #1c1b26;
  --muted: #6e6b80;
  --line: #dddaea;
  --accent: #6d5ef5;
  --accent-ink: #ffffff;
  --mine: #6d5ef5;
  --mine-ink: #ffffff;
  --theirs: #ffffff;
  --theirs-ink: #1c1b26;
  --danger: #d1394f;
  --ok: #1f9d6b;
  --shadow: 0 1px 2px rgba(20, 16, 50, .06), 0 4px 16px rgba(20, 16, 50, .06);
  --radius: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14131c;
    --panel: #1c1b27;
    --side: #191823;
    --text: #ecebf5;
    --muted: #9a97ad;
    --line: #2e2c3d;
    --accent: #8b7ef9;
    --mine: #6556e8;
    --theirs: #232232;
    --theirs-ink: #ecebf5;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Przypięte do krawędzi okna (bez 100dvh/100lvh — w iOS potrafią być za krótkie albo za wysokie).
   Przy otwartej klawiaturze wysokość i przesunięcie bierzemy z visualViewport (app.js). */
.shell { display: flex; position: fixed; left: 0; right: 0; top: var(--app-top, 0px); bottom: 0; }
.shell.kb { bottom: auto; height: var(--app-h); }

/* ---------- lista rozmów ---------- */
.sidebar {
  width: 290px; flex: none; display: flex; flex-direction: column;
  background: var(--side); border-right: 1px solid var(--line);
  padding: calc(12px + var(--safe-t)) 12px calc(12px + var(--safe-b));
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand img { width: 30px; height: 30px; border-radius: 9px; }
.new-btn {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px dashed var(--line); background: transparent; border-radius: 12px; padding: 10px; margin-bottom: 10px;
}
.new-btn:hover { border-color: var(--accent); color: var(--accent); }
.conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.conv {
  text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 9px 11px;
  display: flex; flex-direction: column; gap: 1px;
}
.conv:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.conv.active { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.conv b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv small { color: var(--muted); font-size: 12px; }
.conv .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.empty-list { color: var(--muted); font-size: 14px; padding: 10px; }
.side-foot { border-top: 1px solid var(--line); padding-top: 8px; }
.link-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 8px; border-radius: 10px; width: 100%; color: var(--muted); }
.link-btn:hover { color: var(--text); }
.scrim { display: none; }

/* ---------- czat ---------- */
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.topbar {
  display: flex; align-items: center; gap: 6px; position: relative;
  padding: calc(8px + var(--safe-t)) 10px 8px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.title-btn {
  flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; font-weight: 650; font-size: 17px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 6px;
}
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.icon-btn:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.conn.on { background: var(--ok); }
.menu {
  position: absolute; right: 10px; top: calc(100% - 4px); z-index: 20; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; display: flex; flex-direction: column; min-width: 180px;
}
.menu button { border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 8px; }
.menu button:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.danger { color: var(--danger) !important; }

.messages { flex: 1; overflow-y: auto; padding: 18px 14px 8px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.messages > * { max-width: 760px; width: 100%; margin-inline: auto; }
.welcome { margin: auto; text-align: center; color: var(--muted); padding: 30px 10px; }
.welcome img { width: 72px; height: 72px; border-radius: 20px; margin-bottom: 10px; }
.welcome h1 { color: var(--text); font-size: 22px; margin: 0 0 6px; }

.msg { display: flex; flex-direction: column; margin-top: 8px; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }
.bubble {
  max-width: min(85%, 620px); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.user .bubble { background: var(--mine); color: var(--mine-ink); border-bottom-right-radius: 6px; }
.assistant .bubble { background: var(--theirs); color: var(--theirs-ink); border-bottom-left-radius: 6px; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 4px 0 8px; padding-left: 22px; }
.bubble pre { background: color-mix(in srgb, var(--text) 8%, transparent); padding: 10px; border-radius: 10px; overflow-x: auto; font-size: 13.5px; margin: 6px 0; }
.bubble code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .92em; }
.bubble :not(pre) > code { background: color-mix(in srgb, var(--text) 10%, transparent); padding: 1px 5px; border-radius: 5px; }
.user .bubble :not(pre) > code { background: rgba(255, 255, 255, .2); }
.bubble a { color: inherit; }
.voice-tag { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: .85; margin-bottom: 4px; }
.voice-tag svg { width: 15px; height: 15px; }
.placeholder { font-style: italic; opacity: .8; }

.meta { font-size: 12px; color: var(--muted); margin: 4px 6px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta .err { color: var(--danger); }
.meta button { border: 0; background: transparent; color: var(--accent); padding: 0; font-size: 12px; font-weight: 600; }
.meta a.open-link { color: var(--accent); font-size: 12px; font-weight: 600; text-decoration: none; }

.play {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 4px 12px 4px 4px; font-size: 13px; color: var(--text);
}
.user .play { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: var(--mine-ink); margin-top: 6px; }
.play .knob { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.user .play .knob { background: #fff; color: var(--mine); }
.play .knob svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.play .bar { width: 90px; height: 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; }
.play .bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: currentColor; }
.assistant .play { margin: 6px 0 0 2px; }
/* Pasek w dymku na całą szerokość wiadomości, większy przycisk (2026-11-17). */
.play.wide { display: flex; width: 100%; min-width: 200px; margin: 10px 0 2px; padding: 4px 14px 4px 4px; gap: 12px; }
.play.wide .knob { width: 44px; height: 44px; flex: none; }
.play.wide .knob svg { width: 22px; height: 22px; }
.play.wide .bar { flex: 1; width: auto; height: 6px; }

.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.spinner { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- pole wiadomości ---------- */
/* Na iPhonie pasek leży przy samej dolnej krawędzi, w strefie paska „home” (34 px) — prośba użytkownika, ale nad zaokrągleniem ekranu;
   dotknięcia tam działają, iOS przechwytuje tylko przesunięcie w górę. */
.composer { padding: 4px 12px max(2px, calc(var(--safe-b) - 34px)); background: var(--bg); }
.compose-row {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 24px; padding: 4px 4px 4px 14px; box-shadow: var(--shadow);
}
.compose-row:focus-within { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
textarea {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent; color: var(--text);
  font: inherit; padding: 7px 0; max-height: 40vh; min-height: 38px;
}
.round-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}
.compose-row .round-btn { width: 38px; height: 38px; }
.round-btn.primary { background: var(--accent); color: var(--accent-ink); }
.round-btn:disabled { opacity: .5; cursor: default; }
.recording { align-items: center; padding-left: 6px; }
.rec-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .3; } }
#recWave { flex: 1; min-width: 0; width: 100%; height: 36px; color: var(--accent); }

/* ---------- tryb rozmowy i przerywanie ---------- */
.compose-row:has(#talkBtn) { padding-left: 6px; }
.ghost-btn { background: transparent; color: var(--muted); }
.ghost-btn:hover { color: var(--accent); }
.talk { align-items: center; padding-left: 6px; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.talk-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.talk-info span:nth-child(2) { white-space: nowrap; }
.talk-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); flex: none; transition: transform .1s; }
.talk-dot.speaking { background: var(--danger); animation: pulse .8s infinite; }
.talk-dot.busy { background: var(--accent); animation: pulse 1.4s infinite; }
#talkWave { flex: 1; min-width: 0; width: 100%; height: 36px; color: var(--accent); }
.stop-btn { background: var(--danger); color: #fff; }
.stop-btn svg, .stop-pill svg { fill: currentColor; stroke: none; }
.stop-pill {
  display: flex; align-items: center; gap: 6px; margin: 0 auto 8px; border: 1px solid var(--line); background: var(--panel);
  color: var(--danger); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
}
.stop-pill svg { width: 14px; height: 14px; }
.msg.cmd { align-items: center; }
.msg.cmd .cmd-note { font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--text) 6%, transparent); padding: 3px 10px; border-radius: 999px; }
body.talking .messages .bubble { font-size: 17px; }

/* ---------- wersja ---------- */
.version-tag { font-size: 11px; color: var(--muted); padding: 2px 8px 0; opacity: .8; font-variant-numeric: tabular-nums; }
.note.version { font-variant-numeric: tabular-nums; }
.update-bar {
  border: 0; background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: 14px;
  padding: 10px 14px; text-align: center; width: 100%;
}

/* ---------- ustawienia, komunikaty ---------- */
dialog { border: 0; padding: 0; border-radius: 20px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 8, 25, .45); }
.sheet { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font-size: 20px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
select { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.check { display: flex; gap: 10px; align-items: center; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.sheet-actions { display: flex; justify-content: space-between; gap: 10px; }
.sheet-actions button { border: 0; padding: 10px 18px; border-radius: 12px; }
.sheet-actions .primary { background: var(--accent); color: var(--accent-ink); }
.sheet-actions .ghost { background: transparent; color: var(--danger); }
.voices-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.voices-head { display: flex; justify-content: space-between; align-items: center; }
.small-btn { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.small-btn.rec-on { background: var(--danger); color: #fff; border-color: var(--danger); }
.gpu-voices, .voice-jobs { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.gv { display: flex; align-items: center; gap: 8px; }
.gv span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gv button { border: 0; background: transparent; color: var(--muted); padding: 4px 6px; border-radius: 8px; }
.gv button:hover { color: var(--danger); }
.vj { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }
.vj .err { color: var(--danger); }
.vj .play { padding: 2px 10px 2px 2px; }
.vj .play .knob { width: 22px; height: 22px; }
.seg { display: flex; background: var(--bg); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 9px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.sheet input:not([type=checkbox]) { font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
.sheet input[type=file] { padding: 8px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.read-box { background: var(--bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.read-box small { color: var(--muted); display: block; margin-bottom: 6px; }
.read-box p { margin: 0; font-size: 17px; line-height: 1.55; }
.rec-line { display: flex; align-items: center; gap: 10px; }
.sheet-actions .plain { color: var(--muted); }
/* Przewijanie ustawień na iOS: przewija się tylko .sheet (nie dialog i nie czat pod nim); 100svh nie „zacina się”
   po klawiaturze jak 100dvh, a przy otwartej klawiaturze obowiązuje wysokość widocznego obszaru (--app-h). */
dialog { max-height: calc(min(100svh, var(--app-h, 100svh)) - 32px); overflow: hidden; overscroll-behavior: contain; }
.sheet { max-height: calc(min(100svh, var(--app-h, 100svh)) - 32px); overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y; }
body:has(dialog[open]) .messages, body:has(dialog[open]) .conv-list { overflow: hidden; touch-action: none; }
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100vw - 32px);
}

.nav-bar {
  position: fixed; left: 16px; right: 16px; bottom: calc(150px + var(--safe-b)); z-index: 49; display: flex; align-items: stretch;
  background: var(--accent); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
}
.nav-go {
  flex: 1; color: #fff; text-align: center; text-decoration: none; font-weight: 600; font-size: 17px; padding: 18px 8px 18px 16px;
}
.nav-close {
  flex: none; width: 56px; border: 0; border-left: 1px solid rgba(255,255,255,.35); background: transparent;
  color: #fff; font-size: 22px; cursor: pointer;
}
.nav-bar[hidden] { display: none; }

.only-narrow { display: none; }
@media (max-width: 860px) {
  .only-narrow { display: grid; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 84vw);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .shell.side-open .sidebar { transform: none; }
  .shell.side-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(10, 8, 25, .4); }
  .bubble { max-width: 88%; }
}
@media (min-width: 861px) { #closeSide { display: none; } }
.v-wave { width: 100%; height: 28px; color: var(--accent); margin-top: 8px; display: block; }
.v-wave[hidden] { display: none; }
#muteBtn.off { color: var(--danger); }
.collecting { display: flex; align-items: center; gap: 4px; padding: 6px 0 2px; opacity: .8; }
.collecting i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite both; }
.collecting i:nth-child(2) { animation-delay: .2s; }
.collecting i:nth-child(3) { animation-delay: .4s; }
.users-list { display: flex; flex-direction: column; gap: 6px; }
.user-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.user-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row small { color: var(--muted); }
.user-add { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.user-add input { font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; }
.user-add button { grid-column: span 2; }
/* Kopiowanie: przytrzymanie dymka otwiera własne menu zamiast systemowego zaznaczania. */
.bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
@media (pointer: fine) { .bubble { -webkit-user-select: text; user-select: text; } }
.bubble.selectable { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
.copy-menu {
  position: fixed; z-index: 60; display: flex; gap: 2px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow), 0 8px 24px rgba(0, 0, 0, .25); padding: 4px;
}
.copy-menu button { border: 0; background: transparent; padding: 9px 14px; border-radius: 8px; font-size: 15px; white-space: nowrap; }
.copy-menu button:hover, .copy-menu button:active { background: color-mix(in srgb, var(--text) 8%, transparent); }

/* iOS powiększa stronę przy fokusie na polu z czcionką < 16 px (np. po otwarciu ustawień) i nie wraca po zamknięciu. */
@media (pointer: coarse) {
  input, select, textarea, .sheet input:not([type=checkbox]), .user-add input { font-size: 16px; }
}
dialog:focus, dialog:focus-visible { outline: none; }
.edit-text { font: inherit; font-size: 16px; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; resize: vertical; min-height: 110px; }

/* Karta linku do Map Google z podglądem mapy */
.map-card { display: block; margin-top: 8px; border-radius: 12px; overflow: hidden; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--text) 6%, transparent); border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); width: min(320px, 100%); }
.map-view { display: block; position: relative; height: 150px; overflow: hidden; background: #e8e4dc; }
.map-view img { position: absolute; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-pin { width: 30px; height: 30px; fill: #e2433b; stroke: #fff; stroke-width: 1.4; }
.map-pin circle { fill: #fff; stroke: none; }
.map-view .map-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.map-attr { position: absolute; right: 0; bottom: 0; font-size: 9px; padding: 1px 4px; background: rgba(255,255,255,.75); color: #333; }
.map-foot { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.map-foot > span { display: flex; flex-direction: column; min-width: 0; }
.map-foot b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-foot small { font-size: 12px; opacity: .7; }
.no-view .map-pin { width: 24px; height: 24px; flex: none; }

/* Opcje do wyboru od agenta */
.options { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 6px; max-width: 100%; }
/* Z mapką opcje i mapa zajmują całą szerokość okna rozmowy (prośba użytkownika). */
.options.has-map { align-self: stretch; width: 100%; }
.option { font: inherit; font-size: 14px; padding: 9px 14px; border-radius: 12px; text-align: left; line-height: 1.3; border: 1px solid color-mix(in srgb, var(--accent, var(--text)) 45%, transparent); background: color-mix(in srgb, var(--accent, var(--text)) 10%, transparent); color: inherit; cursor: pointer; }
button.option:active { transform: scale(.97); }
button.option:disabled { opacity: .5; }
a.option, a.map-mark { text-decoration: none; color: inherit; }
a.map-mark { color: #fff; }
a.option:active { transform: scale(.97); }
.option-go { flex: none; font-size: 15px; opacity: .7; }
span.option { opacity: .45; cursor: default; }
span.option.chosen { opacity: 1; font-weight: 600; }
a.option.dim { opacity: .7; }
a.option.chosen { font-weight: 600; border-color: #1f8a4c; background: color-mix(in srgb, #1f8a4c 18%, transparent); }
.option { display: flex; align-items: center; gap: 10px; }
.option-tag { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: color-mix(in srgb, var(--accent, var(--text)) 25%, transparent); }
.option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.options-map { border-radius: 12px; height: 180px; width: 100%; box-sizing: border-box; border: 1px solid color-mix(in srgb, var(--text) 12%, transparent); }
.map-mark { position: absolute; transform: translate(-50%, calc(-100% - 6px)); width: 28px; height: 28px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: #e2433b; color: #fff; font: 700 13px/24px system-ui, sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.45); cursor: pointer; }
.map-mark::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); border: 5px solid transparent; border-top: 6px solid #e2433b; border-bottom: 0; }
.map-mark.dim { opacity: .45; }
.map-mark.chosen { background: #1f8a4c; z-index: 2; }
.map-mark.chosen::after { border-top-color: #1f8a4c; }
button.map-mark:active { transform: translate(-50%, calc(-100% - 6px)) scale(.92); }
.map-me { position: absolute; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%; background: #2a7de1; border: 2px solid #fff; box-shadow: 0 0 0 6px rgba(42,125,225,.25); }
.memory-add { display: flex; gap: 6px; margin-top: 6px; }
.memory-add input { flex: 1; font: inherit; font-size: 14px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); min-width: 0; }
.mem-row span { white-space: normal; }

/* ---------- załączniki ---------- */
.compose-row #attachBtn { margin-left: -6px; }
.attach-tray { max-width: 760px; margin: 0 auto 6px; display: flex; gap: 8px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.attach-chip {
  position: relative; flex: none; display: flex; align-items: center; gap: 8px; max-width: 220px; height: 56px; padding: 4px 30px 4px 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; font-size: 13px;
}
.attach-chip img, .att-icon { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; }
.att-icon { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-weight: 700; font-size: 11px; text-transform: uppercase; }
.attach-chip .att-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.attach-chip .att-sub { color: var(--muted); font-size: 12px; display: block; }
.attach-chip .att-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); display: grid; place-items: center; padding: 0; }
.attach-chip .att-x svg { width: 12px; height: 12px; }
.attach-chip.uploading { opacity: .65; }
.attach-chip.failed { border-color: var(--danger); }
.msg-atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; }
.msg-atts:last-child { margin-bottom: 0; }
.msg-att-img { display: block; border-radius: 12px; overflow: hidden; line-height: 0; }
.msg-att-img img { max-width: min(240px, 60vw); max-height: 240px; object-fit: cover; display: block; background: color-mix(in srgb, var(--text) 8%, transparent); min-width: 60px; min-height: 60px; }
.msg-att-file { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border-radius: 12px; text-decoration: none; color: inherit; background: color-mix(in srgb, var(--text) 10%, transparent); max-width: 260px; font-size: 13.5px; }
.msg-att-file .att-icon { width: 36px; height: 36px; }
.msg-att-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer.drop .compose-row { border-color: var(--accent); }
.status-list { display: flex; flex-direction: column; gap: 4px; }
.status-group { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 6px; }
.status-row { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.status-row .status-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.status-row .small-btn { flex: none; margin-left: auto; min-width: 36px; }
.status-act-error { color: var(--danger) !important; }
.status-row small { color: var(--muted); overflow-wrap: anywhere; }
.status-fail b { color: #d33; }
.conn-row + .conn-row { margin-top: 8px; }
