/* WA Panel: wygląd w duchu Docker Desktop (ciemny).
   Boczne menu z ikonami, płaskie tabele, status jako kropka z tekstem,
   niebieski akcent dla akcji i linków. Kolory stref = kategorie nadawców. */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-latin-ext.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/schibsted-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
  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;
}

:root {
  color-scheme: dark;

  --top: #17191d;
  --side: #1b1e23;
  --ground: #1f2228;
  --well: #1a1d22;
  --panel: #25282f;
  --raised: #2c3038;
  --hover: #30353e;
  --line: #373c46;
  --line-soft: #2c3038;

  --text: #e8eaed;
  --text-2: #c3c8cf;
  --muted: #9aa1ab;

  --blue: #2f7bf5;
  --blue-hover: #4a8df7;
  --blue-text: #6aa5ff;
  --blue-soft: rgba(47, 123, 245, 0.16);

  --ok: #3fbf6f;
  --warn: #f0a637;
  --danger: #f2696b;
  --danger-soft: rgba(242, 105, 107, 0.13);

  /* strefy (kategorie nadawców) */
  --z-known: #3fbf6f;
  --z-ebay: #e8b04a;
  --z-support: #ef8fae;
  --z-wspolpraca: #4fc2c6;
  --z-proreture: #c4d45a;
  --z-unknown: #9aa1ab;

  --bubble-out: #24426f;
  --bubble-out-text: #eef4ff;

  --r-s: 4px;
  --r-m: 6px;
  --r-l: 8px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); }
.hidden { display: none !important; }

::selection { background: rgba(47, 123, 245, 0.45); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: #444b56 transparent; }
input, textarea { caret-color: var(--blue-text); }

a { color: var(--blue-text); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h2 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; }
h3 { margin: 0 0 10px; font-size: 15px; line-height: 1.3; font-weight: 650; }
p { margin: 0 0 8px; }
ol { margin: 0; padding-left: 20px; }
ol li + li { margin-top: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
b, strong { font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--danger); min-height: 1em; }
code, pre { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12px; }
code { color: var(--text-2); background: var(--raised); padding: 1px 5px; border-radius: var(--r-s); }
pre { background: var(--well); color: var(--text-2); border: 1px solid var(--line); padding: 14px; border-radius: var(--r-m); overflow: auto; white-space: pre-wrap; line-height: 1.55; margin: 0; }
pre code { background: none; padding: 0; }

.ic { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- strefy */
.z-known { --z: var(--z-known); }
.z-ebay { --z: var(--z-ebay); }
.z-support { --z: var(--z-support); }
.z-wspolpraca { --z: var(--z-wspolpraca); }
.z-proreture { --z: var(--z-proreture); }
.z-unknown, .z-group_member, .z-stranger { --z: var(--z-unknown); }
.zone-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--z, var(--muted)); white-space: nowrap; }
.zone-tag::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--z, var(--muted)); }

/* ---------- szkielet: górny pasek, boczne menu, treść */
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 14px 0 16px; height: 48px; background: var(--top); border-bottom: 1px solid var(--line-soft); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; white-space: nowrap; color: var(--text); }
.brand.big { font-size: 20px; }
.logo { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--blue); color: #fff; font-weight: 800; font-size: 11.5px; letter-spacing: -0.02em; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar select { width: auto; max-width: 240px; padding: 5px 10px; background: var(--panel); }

.shell { display: grid; grid-template-columns: 216px 1fr; min-height: calc(100vh - 48px); }
.sidebar { background: var(--side); border-right: 1px solid var(--line-soft); padding: 10px 8px; position: sticky; top: 48px; height: calc(100vh - 48px); overflow-y: auto; }
nav { display: flex; flex-direction: column; gap: 1px; }
nav hr { border-top-color: var(--line-soft); margin: 8px 6px; width: auto; }
nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--r-m); color: var(--text-2); font-weight: 550; text-decoration: none; transition: background-color 120ms ease, color 120ms ease; }
nav a .ic { width: 18px; height: 18px; color: var(--muted); }
nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
nav a.active { background: var(--blue-soft); color: var(--text); }
nav a.active .ic { color: var(--blue-text); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: #5d646f; display: inline-block; flex: 0 0 auto; }
.dot.WORKING { background: var(--ok); }
.dot.SCAN_QR_CODE, .dot.STARTING { background: var(--warn); }
.dot.FAILED, .dot.STOPPED { background: var(--danger); }
.dot.known { background: var(--z-known); }
.dot.group { background: var(--z-ebay); }
.dot.stranger { background: var(--z-unknown); }

main { padding: 22px 28px 40px; min-width: 0; max-width: 1400px; }

/* nagłówek strony: tytuł, jedno zdanie opisu, akcje */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin: 4px 0 0; max-width: 72ch; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.section-title h3 { margin: 0; }
.section-title .sub { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; }

/* ---------- formularze */
input, select, textarea { font: inherit; font-weight: 400; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--well); color: var(--text); width: 100%; transition: border-color 120ms ease, box-shadow 120ms ease; }
input::placeholder, textarea::placeholder { color: #808792; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
input[readonly] { color: var(--text-2); }
textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
select { cursor: pointer; }
select option { background: var(--panel); color: var(--text); }
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); margin: 0; cursor: pointer; }
input[type=file] { padding: 5px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-size: 12.5px; border: 1px solid var(--line); background: var(--raised); color: var(--text); border-radius: var(--r-s); padding: 4px 10px; margin-right: 10px; cursor: pointer; }
input[type=time], input[type=datetime-local] { color-scheme: dark; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); font-weight: 500; cursor: pointer; }

.btn { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: transparent; color: var(--text); padding: 6px 13px; border-radius: var(--r-m); cursor: pointer; white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 160ms var(--ease-out); }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { color: var(--danger); border-color: rgba(242, 105, 107, 0.4); }
.btn.ghost { color: var(--text-2); border-color: transparent; }
.btn.small { padding: 4px 9px; font-size: 12.5px; gap: 5px; }
.btn.icon { padding: 6px; }
.btn.small.icon { padding: 5px; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: var(--raised); }
  .btn.primary:hover:not(:disabled) { background: var(--blue-hover); border-color: var(--blue-hover); }
  .btn.danger:hover:not(:disabled) { background: var(--danger-soft); }
  .btn.ghost:hover:not(:disabled) { background: var(--panel); color: var(--text); }
}

/* akcje w wierszu tabeli: same ikony, jak w Dockerze */
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions .btn { border-color: transparent; color: var(--muted); padding: 5px; }
.row-actions .btn:hover:not(:disabled) { color: var(--text); background: var(--raised); }
.row-actions .btn.danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.row-actions .btn .ic { width: 17px; height: 17px; }

.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.row > .btn, .row > .shrink { flex: 0 0 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 1000px) { .grid2 { grid-template-columns: 1fr; } }

.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-l); padding: 18px; }
.card + .card, .grid2 + .card, .card + .grid2 { margin-top: 16px; }
.grid2 > .card, .grid3 > .card, .grid2 > div > .card:first-child { margin-top: 0; }
.card .card { background: var(--raised); border-color: transparent; border-radius: var(--r-m); padding: 14px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; }

.notice { background: rgba(240, 166, 55, 0.1); border: 1px solid rgba(240, 166, 55, 0.35); border-radius: var(--r-l); padding: 10px 14px; margin-bottom: 16px; color: var(--text); }
.hint { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-l); padding: 10px 14px; font-size: 13px; }
.hint .ic { color: var(--blue-text); margin-top: 2px; }

/* tabele: płaskie, cienkie linie, podświetlenie wiersza */
.table-wrap { border: 1px solid var(--line-soft); border-radius: var(--r-l); overflow: auto; background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
table tr:not(:first-child):hover td { background: rgba(255, 255, 255, 0.025); }
td .btn + .btn { margin-left: 4px; }
.table-wrap td:first-child { min-width: 190px; }
.cell-sub { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.td-empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.td-empty b { display: block; color: var(--text); font-size: 14.5px; margin-bottom: 4px; }

/* status: kropka + tekst */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #6b727d; flex: 0 0 auto; }
.badge.ok, .badge.sent, .badge.done, .badge.WORKING, .badge.running { color: var(--text); }
.badge.ok::before, .badge.sent::before, .badge.done::before, .badge.WORKING::before, .badge.running::before { background: var(--ok); }
.badge.warn::before, .badge.paused::before, .badge.pending::before, .badge.SCAN_QR_CODE::before, .badge.STARTING::before, .badge.sending::before { background: var(--warn); }
.badge.err, .badge.failed, .badge.FAILED { color: var(--danger); }
.badge.err::before, .badge.failed::before, .badge.FAILED::before, .badge.STOPPED::before, .badge.cancelled::before { background: var(--danger); }
.tag { display: inline-block; background: var(--raised); color: var(--text-2); padding: 0 7px; border-radius: var(--r-s); font-size: 11.5px; margin: 1px; }

.progress { height: 5px; background: var(--raised); border-radius: 3px; overflow: hidden; margin-bottom: 5px; min-width: 120px; }
.progress > div { height: 100%; background: var(--blue); }
.progress.done > div { background: var(--ok); }

/* rozwijane sekcje (np. przykłady dla programisty) */
details { border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--panel); }
details > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary .ic { color: var(--muted); transition: transform 160ms var(--ease-out); }
details[open] > summary .ic { transform: rotate(90deg); }
details > summary .sub { color: var(--muted); font-weight: 400; font-size: 12.5px; }
details > .details-body { padding: 0 14px 14px; }

/* wiersze ustawień: opis po lewej, kontrolka po prawej */
.settings { border: 1px solid var(--line-soft); border-radius: var(--r-l); background: var(--panel); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.setting:last-child { border-bottom: 0; }
.setting .what { min-width: 0; }
.setting .what b { display: block; font-weight: 600; }
.setting .what span { color: var(--muted); font-size: 12.5px; }
.setting .control { display: flex; gap: 8px; align-items: center; flex: 0 1 460px; justify-content: flex-end; }
.setting .control input { max-width: 340px; }

/* ---------- logowanie */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 340px; display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.login-card .btn { padding: 8px 14px; }
#loginError:empty { display: none; }

/* ---------- czaty */
.chat-layout { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 48px - 62px); background: var(--panel); border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line-soft); }
.notice + .chat-layout { height: calc(100vh - 48px - 124px); }
.chat-list { border-right: 1px solid var(--line-soft); display: flex; flex-direction: column; min-height: 0; }
.chat-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 12px 0; }
.chip { font: inherit; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; color: var(--text-2); padding: 3px 9px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, transform 160ms var(--ease-out); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--z, transparent); }
.chip[data-f="all"]::before { display: none; }
.chip:active { transform: scale(0.97); }
.chip.active { background: var(--blue-soft); border-color: var(--blue); color: var(--text); }
.chip .n { color: var(--muted); font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .chip:hover { color: var(--text); background: var(--raised); } }
.chat-list-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 6px; }
.chat-items { overflow-y: auto; flex: 1; }
.chat-item { display: flex; gap: 11px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line-soft); align-items: center; }
.chat-item:hover { background: var(--raised); }
.chat-item.active { background: var(--blue-soft); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 700; font-size: 14px; overflow: hidden; color: var(--z, var(--text-2)); background: color-mix(in oklab, var(--z, #5d646f) 18%, var(--panel)); border: 1.5px solid color-mix(in oklab, var(--z, #5d646f) 70%, transparent); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-meta { min-width: 0; flex: 1; }
.chat-name { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.chat-name span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.chat-preview > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: 11.5px; color: var(--muted); font-weight: 400; flex: 0 0 auto; }
.chat-unread { background: var(--blue); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 6px; min-width: 18px; text-align: center; margin-left: auto; flex: 0 0 auto; }

.conv { display: flex; flex-direction: column; min-height: 0; background: var(--well); }
.conv-head { background: var(--panel); padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.conv-head .grow { flex: 1; min-width: 160px; }
.conv-head .grow .small { display: flex; gap: 10px; align-items: center; }
.conv-msgs { flex: 1; overflow-y: auto; padding: 18px 6%; display: flex; flex-direction: column; gap: 4px; }
.bubble { max-width: 64%; padding: 7px 10px 5px; border-radius: 10px; background: var(--raised); align-self: flex-start; overflow-wrap: anywhere; line-height: 1.42; }
.bubble .text { white-space: pre-wrap; }
.bubble.out { background: var(--bubble-out); color: var(--bubble-out-text); align-self: flex-end; }
.bubble .meta { font-size: 11px; color: var(--muted); text-align: right; margin-top: 2px; }
.bubble.out .meta { color: #9fb6da; }
.bubble .author { font-size: 12px; color: var(--blue-text); font-weight: 650; }
.bubble img, .bubble video { max-width: 100%; max-height: 320px; border-radius: 6px; display: block; margin-bottom: 4px; }
.bubble audio { max-width: 260px; }
.ack-3, .ack-4 { color: #7fc4ff; }
.day-sep { align-self: center; color: var(--muted); font-size: 12px; padding: 2px 10px; margin: 10px 0 6px; border-radius: 999px; background: var(--panel); }
.composer { background: var(--panel); border-top: 1px solid var(--line-soft); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 38px; max-height: 160px; height: 38px; resize: none; }
.composer select { padding: 6px 8px; }
.composer .attach-info { font-size: 12px; color: var(--muted); }
.composer .attach-info:empty { display: none; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--muted); text-align: center; padding: 24px; line-height: 1.6; }

/* ---------- sesje */
.session-card { display: flex; flex-direction: column; gap: 12px; }
.session-card .toolbar { margin: 0; }
.session-card .actions { display: flex; flex-wrap: wrap; gap: 6px; }
.qr-box { display: grid; place-items: center; min-height: 280px; color: var(--muted); }
.qr-box img { width: 264px; height: 264px; image-rendering: pixelated; border-radius: var(--r-m); background: #fff; padding: 10px; }
.pair-code { font-size: 30px; letter-spacing: 0.18em; font-weight: 750; text-align: center; color: var(--blue-text); }

/* ---------- okno i powiadomienia */
.modal { position: fixed; inset: 0; background: rgba(8, 10, 13, 0.66); display: grid; place-items: center; z-index: 50; padding: 20px; transition: opacity 200ms ease; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px 24px; width: min(760px, 100%); max-height: 88vh; overflow: auto; position: relative; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }
#modalBody > h3:first-child { font-size: 17px; margin-bottom: 14px; padding-right: 32px; }
#modalBody h3:not(:first-child) { margin: 8px 0 0; }
@starting-style {
  .modal { opacity: 0; }
  .modal-box { opacity: 0; transform: scale(0.97); }
}
.modal-close { position: absolute; top: 14px; right: 14px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: var(--r-s); display: grid; place-items: center; }
.modal-close:hover { color: var(--text); background: var(--raised); }
.modal-close .ic { width: 18px; height: 18px; }

#toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--raised); color: var(--text); border: 1px solid var(--line); padding: 10px 14px; border-radius: var(--r-m); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); max-width: 380px; transition: transform 400ms ease, opacity 400ms ease; }
@starting-style { .toast { opacity: 0; transform: translateY(100%); } }
.toast.err { border-color: rgba(242, 105, 107, 0.5); color: #ffc6c6; }
.toast.ok { border-color: rgba(63, 191, 111, 0.45); }

/* ---------- wąski ekran: menu zwija się do samych ikon, na telefonie idzie na dół */
@media (max-width: 1100px) {
  .shell { grid-template-columns: 60px 1fr; }
  .sidebar { padding: 10px 6px; }
  nav a { justify-content: center; padding: 9px; }
  nav a span { display: none; }
}
@media (max-width: 700px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-right .btn span { display: none; }
  .topbar-right .btn { padding: 6px; }
  .topbar select { max-width: 150px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: 56px; z-index: 20; padding: 0 4px; border-right: 0; border-top: 1px solid var(--line-soft); }
  nav { flex-direction: row; height: 100%; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav hr { display: none; }
  nav a { flex: 0 0 auto; padding: 0 14px; height: 100%; border-radius: 0; }
  main { padding: 14px 12px 76px; }
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 48px - 56px - 28px); }
  .notice + .chat-layout { height: calc(100vh - 48px - 56px - 90px); }
  .chat-layout.has-chat .chat-list { display: none; }
  .chat-layout:not(.has-chat) .conv { display: none; }
  .bubble { max-width: 85%; }
  .composer { flex-wrap: wrap; }
  .composer > .stack { flex-basis: 100% !important; order: -1; }
  .composer #sendBtn { margin-left: auto; }
  .setting { flex-direction: column; align-items: stretch; }
  .setting .control { flex-basis: auto; justify-content: flex-start; }
}

/* uruchomione jako zainstalowana aplikacja */
@media (display-mode: standalone) { #installBtn { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled), .chip:active { transform: none; }
  .modal-box, .toast { transition: opacity 200ms ease; }
  @starting-style {
    .modal-box { transform: none; }
    .toast { transform: none; }
  }
}
