/* =====================================================================
 * zpravy.css — Zprávy (zpravy.js): vlákno v okně dokladu, pole na psaní v patičce okna (nebo plovoucí okénko),
 * modul #messages. Barvy jen přes proměnné z :root (styles.css). Vzhled oken se nemění: karta Zprávy je obyčejná
 * karta okna (nadpis se žlutým pruhem), pole na psaní je řádek patičky nad tlačítky.
 * ===================================================================== */

/* ---------- avatar ---------- */
.msg-av { flex: none; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1; user-select: none; }
.msg-av--sm { width: 22px; height: 22px; font-size: 9.5px; }
.msg-av--xs { width: 18px; height: 18px; font-size: 8px; }
.msg-av--buy { background: var(--st-buy-bg); color: var(--st-buy-ink); }
.msg-av--ready { background: var(--st-ready-bg); color: var(--st-ready-ink); }
.msg-av--prod { background: var(--st-prod-bg); color: var(--st-prod-ink); }
.msg-av--done { background: var(--st-done-bg); color: var(--st-done-ink); }
.msg-av--new { background: var(--st-new-bg); color: var(--st-new-ink); }
.msg-av--bad { background: var(--st-bad-bg); color: var(--st-bad-ink); }

/* ---------- karta Zprávy v okně dokladu ---------- */
.modal__body .msg-card .card__head { display: flex; align-items: center; gap: 10px; }
.msg-card__count { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.msg-card__sub { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.msg-card__hint { margin: 8px 0 0; font-size: 11.5px; color: var(--muted-2); }
.msg-list { max-height: min(46vh, 460px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 2px 2px 0; }
.msg-list--page { max-height: none; flex: 1; min-height: 0; padding: 14px 16px; }

/* ---------- zpráva (chat: nejstarší nahoře) ---------- */
.msg { display: flex; gap: 9px; align-items: flex-start; border-radius: 12px; transition: background .4s; }
.msg.is-flash { background: var(--lime-50); }
.msg__main { min-width: 0; flex: 1; }
.msg__bubble { background: var(--bg); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 7px 11px 8px; }
.msg__bubble.is-mine { background: var(--bg-1); }
.msg__bubble.is-new { border-color: var(--lime); box-shadow: 0 0 0 1px var(--lime); }
.msg__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; line-height: 18px; }
.msg__who { color: var(--ink); font-weight: 700; }
.msg__time { color: var(--muted-2); font-size: 11.5px; margin-left: auto; white-space: nowrap; }
.msg__text { margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg__text a { color: var(--c-link); text-decoration: underline; }
.msg__replies { margin: 6px 0 0 6px; padding-left: 12px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.msg--reply .msg__bubble { background: var(--bg-1); border-color: transparent; border-radius: 4px 12px 12px 12px; padding: 5px 10px 6px; }
.msg--reply .msg__bubble.is-new { border-color: var(--lime); }
.msg--reply .msg__text { font-size: 13px; }
.msg__acts { display: flex; gap: 12px; margin: 3px 0 0 6px; min-height: 0; }
.msg__acts:empty { display: none; }
.msg-act { border: 0; background: none; padding: 0; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.msg-act:hover { color: var(--c-brand-strong); }
.msg-act--del { color: var(--muted-2); }
.msg-act--del:hover, .msg-act--del.is-sure { color: var(--danger); }
.msg-newpill { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--c-brand-ink);
  font-size: 9.5px; font-weight: 800; line-height: 16px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.msg-src { display: inline-flex; align-items: center; max-width: 100%; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--ink-3); font: inherit; font-size: 10.5px; font-weight: 600; line-height: 16px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
button.msg-src { cursor: pointer; }
button.msg-src:hover { border-color: var(--c-link); color: var(--c-link); background: var(--c-link-soft); }
.msg-src.is-here { background: transparent; border-style: dashed; }
.msg-empty { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.msg-empty svg { width: 22px; height: 22px; flex: none; color: var(--muted-2); }
.msg-empty--sm { padding: 12px; font-size: 12.5px; }
.msg-empty--err { color: var(--danger); }

/* ---------- pole na psaní: řádek patičky okna nad tlačítky ---------- */
.modal__foot:has(> .msg-dock:not([hidden])) { flex-wrap: wrap; }
.modal__foot > .msg-dock { flex: 1 0 100%; order: -1; }
.msg-dock { display: flex; flex-direction: column; gap: 6px; }
.msg-dock[hidden], .msg-card[hidden] { display: none; }   /* do zjištění stavu nesmí zabírat místo (tlačítka okna) */
.msg-dock__row { display: flex; align-items: flex-end; gap: 8px; }
.msg-dock__row[hidden] { display: none; }
.msg-dock__sum { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 10px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-3); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.msg-dock__sum:hover { border-color: var(--lime-600); color: var(--ink); }
.msg-dock__sum svg { width: 16px; height: 16px; }
.msg-dock__n { padding: 0 6px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-size: 11px; line-height: 16px; }
.msg-dock .msg-dock__input { flex: 1; min-width: 0; min-height: 38px; height: 38px; max-height: 140px; resize: none; padding: 8px 11px; line-height: 20px; }
.msg-dock .msg-dock__input::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Pole s formátováním (psani.js, 8.2.0): výšku drží editor sám (lišta při psaní + text do 140 px, pak se roluje). */
.msg-dock .msg-dock__input.msg-dock__editor { height: auto; min-height: 38px; max-height: none; padding: 0; line-height: normal; }
.msg-dock__editor .ps-box { min-height: 38px; }
.msg-dock__editor .ps-prose { --ps-max: 140px; }
/* Zpráva s formátováním: bloky (odstavce, seznamy) místo pre-wrap. */
.msg__text.ps-view { white-space: normal; }
.msg-dock__send { flex: none; height: 38px; }
.msg-dock__send svg { width: 15px; height: 15px; }
/* Odeslat zprávu modře, ne žlutě (pokyn vlastníka 4. 11. 2026): žluté tlačítko se pletlo s tlačítky stavu dokladu v patičce okna. */
.btn.msg-dock__send { background: var(--c-link-soft); color: var(--c-link); border: 1px solid #bcd6ee; }
.btn.msg-dock__send:hover { background: var(--c-link); color: #fff; border-color: var(--c-link); transform: none; box-shadow: none; }
.btn.msg-dock__send:focus-visible { outline: 2px solid var(--c-link); outline-offset: 2px; }
.msg-dock__reply { display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border-radius: var(--r-sm); background: var(--lime-50);
  border: 1px solid var(--lime-100); font-size: 12px; color: var(--ink-3); }
.msg-dock__reply[hidden] { display: none; }
/* Úprava odeslané zprávy (podnět z Vývoje 18. 11. 2026): pruh nad polem a značka „upraveno“ u zprávy. */
.msg-dock__reply.is-edit { background: var(--st-buy-bg); color: var(--st-buy-ink); }
.msg__edited { color: var(--muted-2); font-size: 11px; font-style: italic; white-space: nowrap; }
.msg-dock__replytxt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-dock__x { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; }
.msg-dock__x:hover { background: var(--bg); color: var(--ink); }
.msg-dock__x svg { width: 14px; height: 14px; }
.msg-dock__err { margin: 0; }
.msg-dock__err[hidden] { display: none; }
.msg-dock__row--ro { align-items: center; }
.msg-dock__ro { font-size: 12px; }
.msg-dock__gone { margin: 0; font-size: 12.5px; }

@media (max-width: 900px) {
  /* patička je tu wrap-reverse (styles.css): pole na psaní pořadím na konec, aby zůstalo nahoře nad tlačítky */
  .modal__foot:has(> .msg-dock:not([hidden])) { flex-wrap: wrap-reverse; }
  .modal__foot > .msg-dock { order: 2; }
  .msg-dock__sum span:not(.msg-dock__n):not(.msg-newpill) { display: none; }
  .msg-dock__send span { display: none; }
}
@media (max-width: 380px) {
  /* patička je tu sloupec column-reverse: bez zalamování (jinak druhý sloupec vpravo), poslední = nahoře */
  .modal__foot:has(> .msg-dock:not([hidden])) { flex-wrap: nowrap; }
  .modal__foot > .msg-dock { flex: none; width: 100%; }
}

/* ---------- štítky a označení lidé (značka na začátku textu, zpravy.js → parseBody) ---------- */
.msg-tag { display: inline-flex; align-items: center; padding: 0 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  line-height: 17px; white-space: nowrap; }
.msg-tag--note { background: var(--st-buy-bg); color: var(--st-buy-ink); }
.msg-tag--change { background: var(--st-new-bg); color: var(--st-new-ink); box-shadow: inset 0 0 0 1px var(--lime-100); }
.msg-tag--crit { background: var(--danger); color: #fff; }
.msg-tag--ready { background: #fdf0e3; color: #8a4507; box-shadow: inset 0 0 0 1px #f3c89c; }
.msg__bubble.is-crit { border-color: var(--danger); box-shadow: inset 3px 0 0 var(--danger); }
.msg__bubble.is-forme { background: var(--lime-50); }
.msg__to { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.msg-to { color: var(--c-link); font-weight: 600; }
.msg-forme { display: inline-flex; align-items: center; padding: 0 6px; border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 9.5px; font-weight: 800; line-height: 16px; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.msg-forme.is-seen { background: var(--bg-2); color: var(--ink-3); }

/* tlačítka Štítek / Označit u pole na psaní, vybrané nad polem, panel s výběrem */
.msg-dock { position: relative; }
.msg-dock__tools { flex: none; display: inline-flex; gap: 2px; }
.msg-tool { display: inline-grid; place-items: center; width: 32px; height: 38px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: none; color: var(--muted); cursor: pointer; }
.msg-tool:hover { background: var(--bg-2); color: var(--ink); }
.msg-tool.is-on { color: var(--c-brand-strong); background: var(--lime-50); border-color: var(--lime-100); }
.msg-tool svg { width: 17px; height: 17px; }
.msg-dock__meta { display: flex; flex-wrap: wrap; gap: 5px; }
.msg-dock__meta[hidden] { display: none; }
.msg-sel { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.msg-sel--to { padding: 0 2px 0 8px; border-radius: 999px; background: var(--c-link-soft); color: var(--c-link); font-weight: 600; line-height: 20px; }
.msg-sel__x { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; opacity: .7; }
.msg-sel__x:hover { opacity: 1; background: rgba(0,0,0,.06); }
.msg-sel__x svg { width: 12px; height: 12px; }
.msg-pop { position: absolute; z-index: 6; left: 0; bottom: calc(100% + 6px); width: min(300px, calc(100vw / var(--vz) - 32px)); max-height: min(360px, 60vh);
  display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; }
.msg-pop[hidden] { display: none; }
.msg-pop--down { bottom: auto; top: calc(100% + 6px); }
.msg-pop__ttl { padding: 2px 4px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.msg-pop__opt { display: flex; align-items: center; width: 100%; padding: 6px 6px; border: 0; border-radius: 8px; background: none; cursor: pointer; text-align: left; }
.msg-pop__opt:hover { background: var(--bg-1); }
.msg-pop__opt.is-on { background: var(--lime-50); }
.msg-pop__none { font-size: 12.5px; color: var(--muted); }
.msg-pop__q { height: 32px; font-size: 13px; }
.msg-pop__list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.msg-pop__person { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.msg-pop__person:hover { background: var(--bg-1); }
.msg-pop__person input { margin: 0; accent-color: var(--lime-600); }
.msg-pop__empty { padding: 10px 6px; font-size: 12.5px; color: var(--muted); }
.msg-pop__foot { display: flex; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  /* telefon: pole na psaní přes celou šířku, Zprávy / Štítek / @ a Odeslat pod ním */
  .msg-dock__row:not(.msg-dock__row--ro):not(.msg-dock__row--new) { flex-wrap: wrap; }
  .msg-dock__row:not(.msg-dock__row--ro):not(.msg-dock__row--new) .msg-dock__input { order: -1; flex: 1 0 100%; }
  .msg-dock__row .msg-dock__send { margin-left: auto; }
}

/* ---------- okno dokladu se Zprávami: Poznámka nahrazená zprávou, Historie na konci a sbalená (tidyDoc) ---------- */
.msg-note-off { display: none !important; }
.msg-note-hint { margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.modal__body .card.msg-history { background: var(--bg-1); box-shadow: none; border: 1px solid var(--line); }
.modal__body .msg-history .card__head { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.modal__body .msg-history .card__head h3 { font-size: 13px; font-weight: 600; color: var(--muted); border-left-color: var(--line-2); }
.modal__body .msg-history.is-closed .card__head { padding-bottom: 10px; }
.modal__body .msg-history.is-closed .card__body { display: none; }
.msg-history__toggle { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; }
.msg-history__toggle:hover { background: var(--bg-2); color: var(--ink); }
.msg-history__toggle svg { width: 14px; height: 14px; transition: transform .15s; }
.msg-history:not(.is-closed) .msg-history__toggle svg { transform: rotate(180deg); }
.msg-history__n { padding: 0 6px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-size: 11px; line-height: 16px; }

/* ---------- kde psát: pole dole | plovoucí okénko (Compose v zpravy.js) ---------- */
/* Dvě ikony v hlavičce okna před Zvětšit. Jen v okně, kde se dá psát; na telefonu je vždy pole dole. */
.msg-modes { display: none; align-items: center; gap: 2px; padding: 2px; margin-right: 4px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-1); }
.modal__panel:has(> .modal__foot > .msg-dock--write:not([hidden])) .msg-modes { display: inline-flex; }
.msg-modes .msg-mode { width: 30px; height: 28px; border-radius: 6px; color: var(--muted); }
.msg-modes .msg-mode svg { width: 17px; height: 17px; }
.msg-modes .msg-mode[aria-pressed="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(31,26,23,.14), inset 0 -2px 0 var(--lime); }
@media (max-width: 640px) { .msg-modes { display: none !important; } }

/* Hlavička okénka (úchyt na přesun) je jen v plovoucím režimu. */
.msg-dock__head { display: none; }
.msg-dock__row--new .msg-dock__input:disabled { background: var(--bg-1); cursor: not-allowed; }
.msg-dock__row--new .msg-dock__input:disabled::placeholder { color: var(--muted); }

/* Plovoucí okénko: tentýž uzel jako pole dole (patička okna), jen fixed nad oknem. Polohu nastaví zpravy.js. */
@media (min-width: 641px) {
  .modal.msg-float .modal__foot > .msg-dock--write {
    position: fixed; z-index: 5; left: 0; top: 0; width: min(420px, calc(100vw / var(--vz) - 16px));
    padding: 0 12px 12px; gap: 8px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 14px;
    box-shadow: var(--shadow-lg);
  }
  .modal.msg-float .msg-dock--write.is-placing { visibility: hidden; }
  .modal.msg-float .msg-dock--write.is-drag { box-shadow: 0 30px 60px -18px rgba(31,26,23,.32), 0 10px 24px -8px rgba(31,26,23,.16); }
  .modal.msg-float .msg-dock--write .msg-dock__head { display: flex; align-items: center; gap: 6px; margin: 0 -12px; padding: 5px 6px 5px 6px;
    min-height: 40px; border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; background: var(--bg-1);
    cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
  .modal.msg-float .msg-dock--write.is-drag .msg-dock__head { cursor: grabbing; }
  .modal.msg-float .msg-dock--write .msg-dock__head:focus-visible { outline: 2px solid var(--lime-600); outline-offset: -2px; }
  .msg-dock__grip { flex: none; display: inline-grid; place-items: center; width: 18px; color: var(--muted-2); }
  .msg-dock__grip svg { width: 16px; height: 16px; fill: currentColor; }
  .msg-dock__ttl { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .msg-dock__head .msg-dock__sum { height: 28px; padding: 0 8px; font-size: 12px; cursor: pointer; }
  .modal.msg-float .msg-dock--write .msg-dock__row > .msg-dock__sum { display: none; }
  .modal.msg-float .msg-dock--write .msg-dock__row { flex-wrap: wrap; }
  .modal.msg-float .msg-dock--write .msg-dock__input { flex: 1 0 100%; min-height: 62px; }
  .modal.msg-float .msg-dock--write .msg-dock__input.msg-dock__editor { min-height: 0; }
  .modal.msg-float .msg-dock--write .msg-dock__editor .ps-prose { min-height: 42px; }
  .modal.msg-float .msg-dock--write .msg-dock__input::placeholder { white-space: normal; }
  .modal.msg-float .msg-dock--write .msg-dock__send { margin-left: auto; }
  .modal.msg-float .msg-dock--write .msg-dock__input { order: 1; }
  .modal.msg-float .msg-dock--write .msg-dock__tools { order: 2; }
  .modal.msg-float .msg-dock--write .msg-dock__send { order: 3; }
  /* Celá konverzace v okénku (připomínka 20. 10. 2026): seznam zpráv je přestěhovaný sem, karta v okně schovaná. */
  .modal.msg-float .modal__foot > .msg-dock--write:has(> .msg-list) { width: min(480px, calc(100vw / var(--vz) - 16px)); }
  .modal.msg-float .msg-dock--write > .msg-list { max-height: min(52vh, 520px); margin: 0 -12px; padding: 10px 12px 4px; border-bottom: 1px solid var(--line); }
  .modal.msg-float .msg-dock--write.is-folded > .msg-list { display: none; }
  .modal.msg-float .msg-dock--write .msg-dock__head .msg-dock__sum[aria-expanded="true"] { background: var(--bg); border-color: var(--lime-600); }
  .msg-card--away { display: none; }
}

/* ---------- modul Zprávy (#messages) ---------- */
.msg-wrap .btn[hidden] { display: none; }            /* .btn má inline-flex, který by přebil atribut hidden */
.msg-loading { padding: 24px; color: var(--muted); }
.msg-off h3 { margin: 0 0 8px; }
.msg-off p { margin: 0 0 8px; }
.msg-page { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 14px; align-items: stretch;
  height: calc(100vh / var(--vz) - 210px); min-height: 460px; }
.msg-topics, .msg-pane { min-height: 0; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-sm); overflow: hidden; }
.msg-topics__head { padding: 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.msg-search { position: relative; }
.msg-search svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.msg-search .form__input { padding-left: 32px; }
.msg-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.msg-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; background: none;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.msg-chip span { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.msg-chip:hover { background: var(--bg-2); color: var(--ink); }
.msg-chip.is-on { background: var(--lime); color: var(--c-brand-ink); }
.msg-chip.is-on span { color: var(--ink-3); }
.msg-topics__list { flex: 1; min-height: 0; overflow-y: auto; }
.msg-sec { padding: 8px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); }
.msg-topic, .msg-hit { display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.msg-topic:hover, .msg-hit:hover { background: var(--bg-1); }
.msg-topic.is-unread { background: color-mix(in srgb, var(--lime-50) 55%, transparent); }
.msg-topic.is-active { background: var(--lime-50); box-shadow: inset 3px 0 0 var(--lime); }
.msg-topic__l1, .msg-topic__l2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.msg-topic__title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-topic.is-unread .msg-topic__title { font-weight: 800; }
.msg-topic__time { flex: none; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.msg-topic__sub { font-size: 11px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-topic__last { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-topic__last b { color: var(--ink-3); font-weight: 600; }
.msg-hit .msg-topic__last { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-hit mark { background: var(--lime-100); color: var(--ink); border-radius: 3px; padding: 0 1px; }
.msg-state { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.msg-state svg { width: 12px; height: 12px; }
.msg-state--ok { color: var(--ok); }
.msg-state--wait { color: var(--c-brand-strong); }
.msg-more { display: block; width: 100%; padding: 10px; border: 0; background: none; font: inherit; font-size: 12px; font-weight: 600; color: var(--c-brand-strong); cursor: pointer; }
.msg-more:hover { text-decoration: underline; }
.msg-pane__head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.msg-pane__ttl { min-width: 0; flex: 1; }
.msg-pane__ttl h2 { margin: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-pane__ttl p { margin: 2px 0 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-pane__head .btn svg { width: 14px; height: 14px; }
.msg-pane__body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--c-canvas); }
.msg-dock--page { padding: 10px 14px 12px; border-top: 1px solid var(--line); background: var(--bg-1); }
.msg-pane__empty { margin: auto; max-width: 380px; padding: 30px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.msg-pane__empty svg { width: 30px; height: 30px; color: var(--muted-2); }
.msg-pane__empty p { margin: 6px 0; }
.msg-pick { margin-top: 10px; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.msg-pick__row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; font: inherit; cursor: pointer; }
.msg-pick__row:last-child { border-bottom: 0; }
.msg-pick__row:hover { background: var(--lime-50); }
.msg-pick__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-pick__name.is-done { color: var(--muted); font-weight: 500; }
.msg-pick__id { flex: none; font-size: 11.5px; color: var(--muted); }

@media (max-width: 900px) {
  .msg-page { grid-template-columns: 1fr; height: auto; }
  .msg-topics { max-height: 55vh; }
  /* pevná výška: zprávy rolují uvnitř panelu, nejnovější dole u pole na psaní */
  .msg-pane { height: 75vh; min-height: 420px; }
}
