/* Épicerie — чат. Телефон: список переписок → экран переписки с полем внизу.
   ПК (.desk): список слева, переписка справа, лента прокручивается внутри своей панели. */

/* ---------------------------------------------------------------- значки непрочитанного */
.tabbar button { position: relative; }
.tab-badge {
  position: absolute; top: 2px; inset-inline-start: 50%; margin-inline-start: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700; font-style: normal; line-height: 18px; text-align: center;
}

/* ---------------------------------------------------------------- список переписок */
.chat-list.m { margin-top: 4px; }
/* как в Telegram: сверху «Поиск чатов» и папки, внизу справа круглая кнопка «написать» */
.rooms-head { padding: 4px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.chat-find { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 16px; border-radius: 22px;
  background: var(--surface); color: var(--text-3); font-size: 15px; text-align: start; }
.chat-folds .chip { height: 34px; }
.chat-desk .chat-folds { margin: 0; padding: 0 0 2px; }
.chat-fab { position: fixed; inset-inline-end: 16px; bottom: calc(84px + var(--safe-bottom)); z-index: 26;
  width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(60, 30, 10, .22); }
.chat-fab:active { transform: scale(.95); }
.chat-fab { transition: transform .2s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.chat-fab.hide { transform: scale(.4); opacity: 0; pointer-events: none; }
.chat-side { position: relative; min-height: 0; display: flex; flex-direction: column; }
.chat-side .chat-list { flex: 1; min-height: 0; padding-bottom: 80px; }
.chat-side .chat-fab { position: absolute; bottom: 16px; inset-inline-end: 16px; }
/* поиск: поле с крестиком, недавние собеседники кружками в ряд, «Недавние» с «Очистить», найденное по разделам */
.find-bar { display: flex; align-items: center; gap: 6px; padding: 4px 0 10px; }
.find-input { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  border-radius: 22px; background: var(--surface); color: var(--text-3); border: 2px solid var(--accent); }
.find-input input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 15px; color: var(--text); }
.find-input input::-webkit-search-cancel-button { display: none; }
.find-peers { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 12px; }
.find-peers::-webkit-scrollbar { display: none; }
.find-peer { flex: none; width: 64px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.find-peer span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-sec { display: flex; align-items: center; justify-content: space-between; margin: 4px -16px 2px; padding: 6px 20px;
  background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chat-desk .find-sec { margin: 4px 0 2px; padding: 6px 10px; border-radius: 8px; }
.find-none { margin-top: 24px; }
/* поиск открывается мягко; найденное в названиях и сообщениях — цветом, как в Telegram */
.find-bar { animation: find-in .18s ease-out; }
@keyframes find-in { from { opacity: 0; transform: translateY(-6px); } }
.chat-list mark { background: transparent; color: var(--accent-ink, var(--accent)); font-weight: 700; }
.find-sk { display: flex; align-items: center; gap: 12px; padding: 8px 2px; }
.find-sk i { flex: none; width: 44px; height: 44px; margin: 0; border-radius: 50%; }
.find-sk span { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.find-sk b { width: 42%; height: 12px; margin: 0; border-radius: 6px; }
.find-sk em { width: 78%; height: 10px; margin: 0; border-radius: 5px; }
/* новое сообщение въезжает снизу; переписка при первом открытии проявляется (замер по видео: ~70–200 мс) */
.msg.msg-new { animation: msg-in .2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.msgs.msgs-in > * { animation: msgs-in .22s ease-out both; }
@keyframes msgs-in { from { opacity: 0; transform: translateY(10px); } }
/* расшифровка раскрывается вниз */
.vtxt.tx-in { animation: tx-in .2s ease-out both; transform-origin: top; }
@keyframes tx-in { from { opacity: 0; transform: translateY(-4px) scaleY(.85); } }
/* вкладки сведений группы: содержимое въезжает сбоку */
.gi-body.slide-next { animation: gi-next .18s ease-out both; }
.gi-body.slide-prev { animation: gi-prev .18s ease-out both; }
@keyframes gi-next { from { opacity: 0; transform: translateX(24px); } }
@keyframes gi-prev { from { opacity: 0; transform: translateX(-24px); } }
@media (prefers-reduced-motion: reduce) {
  .find-bar, .msg.msg-new, .msgs.msgs-in > *, .vtxt.tx-in, .gi-body.slide-next, .gi-body.slide-prev { animation: none; }
  .chat-fab { transition: none; }
}
.room {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border-radius: 14px; text-align: start; transition: background-color .12s ease-out;
}
.room:hover { background: var(--surface); }
.room.on { background: var(--accent-soft); }
.room .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-ico {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
}
.room-top { display: flex; align-items: baseline; gap: 8px; }
.room-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.room-time { flex: none; font-size: 12px; color: var(--text-3); }
.room-last { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room.unread .room-last { color: var(--text); font-weight: 500; }
.room-unread {
  flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--accent); color: var(--on-accent);
  font-size: 12px; font-weight: 700; font-style: normal; line-height: 22px; text-align: center;
}
.dm-pick { max-height: 52vh; overflow-y: auto; margin-top: 8px; }
.dm-pick .room { padding: 8px 10px; }
/* закреплённая переписка: булавка справа (пока нет непрочитанного); чат подразделения в «Новом чате» — «Вступить» */
.room-pin { flex: none; color: var(--text-3); display: flex; transform: rotate(45deg); }
.join-tag { flex: none; font-size: 13px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 14px; padding: 4px 12px; }
.dm-pick .ng-sec:first-child { margin-top: 0; }

/* ---------------------------------------------------------------- шапка переписки и переключатель перевода */
.thread-head { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.thread-head .grow { flex: 1; min-width: 0; }
.thread-head b { display: block; font-size: 16px; }
.trtoggle {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; flex: none;
  border-radius: 17px; background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  transition: background-color .12s ease-out, color .12s ease-out;
}
.trtoggle.on { background: var(--ok-soft); color: var(--ok); }

/* ---------------------------------------------------------------- лента */
.msgs { display: flex; flex-direction: column; padding: 4px 0 16px; }
.msgs.m { padding-bottom: 120px; }
.more { text-align: center; padding: 8px 0; }
.chat-empty { text-align: center; color: var(--text-2); padding: 48px 16px; }
.day-sep { text-align: center; margin: 16px 0 6px; }
.day-sep span { display: inline-block; padding: 3px 10px; border-radius: 10px; background: var(--surface); color: var(--text-3); font-size: 12px; font-weight: 600; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; margin-top: 10px; }
.msg.cont { margin-top: 2px; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { width: 32px; flex: none; }
.msg-body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine .msg-body { align-items: flex-end; }
.msg-who { margin: 0 0 2px; font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--nc, var(--text-2)); }
.msg-body > .msg-who { margin-inline-start: 12px; font-size: 12.5px; }      /* над большим эмодзи и кружком — снаружи */
.bubble.del > .msg-who { font-style: normal; }
.bubble {
  position: relative; min-width: 0; padding: 8px 12px; border-radius: 18px; background: var(--surface);
  overflow-wrap: anywhere; line-height: 1.4;
}
/* время, «изменено», галочки — внутри пузыря справа внизу, как в Telegram */
.mt {
  position: absolute; inset-inline-end: 10px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap; color: var(--text-3); font-style: normal;
}
.mt .edited { font-style: italic; margin-inline-end: 2px; }
.mt .ticks svg { width: 15px; height: 15px; }
.mt svg.i.pinned { width: 12px; height: 12px; }
.mt.ghost { position: static; visibility: hidden; margin-inline-start: 10px; vertical-align: -2px; }   /* место под время в конце текста */
.msg.mine .mt { color: color-mix(in srgb, var(--out-ink) 80%, transparent); }
.msg.mine .mt .ticks, .msg.mine .mt .ticks.read { color: var(--out-acc); }
.mt-row { display: flex; justify-content: flex-end; margin-top: 2px; }
.mt-row .mt { position: static; }
.mt.over { bottom: 8px; inset-inline-end: 8px; padding: 3px 7px; border-radius: 10px; background: rgba(0, 0, 0, .45); color: #fff; }
.msg.mine .mt.over, .msg.mine .mt.over .ticks { color: #fff; }
/* у кружка пузыря нет — время строкой под ним на полупрозрачной плашке */
.bubble.k-circle .mt-row .mt { padding: 3px 7px; border-radius: 10px; background: rgba(20, 14, 10, .42); color: #fff; }
.msg.mine .bubble.k-circle .mt, .msg.mine .bubble.k-circle .mt .ticks { color: #fff; }
/* большое эмодзи — время плашкой справа внизу поверх него (как в Telegram). Не последнее в переписке — плашка
   спрятана, чтобы не закрывать эмодзи; видна при наведении мыши или пока открыто меню сообщения */
.bubble.jumbo .mt.over { bottom: 0; inset-inline-end: 0; background: rgba(20, 14, 10, .42); transition: opacity .15s ease-out; }
.bubble.jumbo .mt.over.hide, .msgs.selecting .bubble.jumbo .mt.over.hide { opacity: 0; }
.msg.ctx-on .bubble.jumbo .mt.over.hide { opacity: 1; }
@media (hover: hover) { .msg:hover .bubble.jumbo .mt.over.hide { opacity: 1; } }
/* цвет имени — свой у каждого (по номеру), как в Telegram */
.nc-0 { --nc: #c03d33; } .nc-1 { --nc: #3f8f25; } .nc-2 { --nc: #b47a00; } .nc-3 { --nc: #168acd; }
.nc-4 { --nc: #8544d6; } .nc-5 { --nc: #cd4073; } .nc-6 { --nc: #2996ad; } .nc-7 { --nc: #ce671b; }
:root[data-theme="dark"] .nc-0 { --nc: #f37f72; } :root[data-theme="dark"] .nc-1 { --nc: #7cd36e; }
:root[data-theme="dark"] .nc-2 { --nc: #e8b64c; } :root[data-theme="dark"] .nc-3 { --nc: #58b3ef; }
:root[data-theme="dark"] .nc-4 { --nc: #b18af0; } :root[data-theme="dark"] .nc-5 { --nc: #f06c9b; }
:root[data-theme="dark"] .nc-6 { --nc: #5dc0d8; } :root[data-theme="dark"] .nc-7 { --nc: #f0a35c; }
.bubble .txt, .revealed, .del-text { white-space: pre-wrap; }
.msg:not(.mine) .bubble { border-end-start-radius: 6px; }
.msg.mine .bubble { background: var(--out-bg); border-end-end-radius: 6px; }
.msg.cont:not(.mine) .bubble { border-start-start-radius: 6px; }
.msg.mine.cont .bubble { border-start-end-radius: 6px; }
.msg-avi { position: absolute; inset-inline-start: -40px; bottom: 0; display: flex; }   /* 32 px аватар + 8 px отступ */
/* хвостик у последнего пузыря серии — в нижнем углу к аватару (у моих — справа), как в Telegram.
   У фото/видео (обрезаются по краю), большого эмодзи, кружка и удалённого — без хвостика. */
.msg.last .bubble:not(.jumbo):not(.k-circle):not(.k-photo):not(.k-video):not(.del)::before {
  content: ''; position: absolute; bottom: 0; width: 9px; height: 16px; background: inherit; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 16'%3E%3Cpath d='M9 0V16H1.5C.6 16 .2 15 .9 14.4 4.3 11.6 8.3 7.4 9 0Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 9 16'%3E%3Cpath d='M9 0V16H1.5C.6 16 .2 15 .9 14.4 4.3 11.6 8.3 7.4 9 0Z'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
}
.msg.last:not(.mine) .bubble:not(.jumbo):not(.k-circle):not(.k-photo):not(.k-video):not(.del) { border-end-start-radius: 0; }
.msg.last.mine .bubble:not(.jumbo):not(.k-circle):not(.k-photo):not(.k-video):not(.del) { border-end-end-radius: 0; }
.msg.last:not(.mine) .bubble::before { inset-inline-start: -8px; }
.msg.last.mine .bubble::before { inset-inline-end: -8px; transform: scaleX(-1); }
.msg.mine { margin-inline-end: 8px; }      /* место под хвостик: лента обрезает всё за своим краем */
[dir="rtl"] .msg.last:not(.mine) .bubble::before { transform: scaleX(-1); }
[dir="rtl"] .msg.last.mine .bubble::before { transform: none; }
.msg-meta .tr-mark { display: inline-flex; align-items: center; gap: 3px; color: var(--ok); }
.msg-meta .tr-mark svg { width: 13px; height: 13px; }
.bubble.del { background: transparent; box-shadow: inset 0 0 0 1px var(--surface-2); color: var(--text-3); font-style: italic; }
.msg-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 3px 8px 0;
  font-size: 12px; color: var(--text-3);
}
.msg.mine .msg-meta { justify-content: flex-end; }
.msg-meta button { color: var(--accent); font-size: 12px; font-weight: 600; }
.msg-meta .icb { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font-weight: 500; }
.msg-meta .icb:hover { color: var(--accent); }
.msg-meta .icb svg { width: 15px; height: 15px; }
.spin.xs { width: 14px; height: 14px; border-width: 2px; color: var(--text-3); }

/* ---------------------------------------------------------------- поле ввода */
.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 8px 12px calc(8px + var(--safe-bottom)); background: var(--bg);
  box-shadow: 0 -1px 0 var(--surface-2);
}
.composer-row { display: flex; align-items: flex-end; gap: 6px; }
/* лента подразделения без прав писать: вместо поля ввода — кнопка «Выкл./Вкл. уведомления» во всю ширину (как в канале) */
.composer-ro { display: flex; }
.ro-mute { flex: 1; height: 44px; border-radius: 22px; background: var(--surface); color: var(--accent-ink); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ro-mute:active { transform: scale(.98); }
/* значок ленты — рупор вместо букв */
.av.av-feed svg { width: 55%; height: 55%; }
.composer textarea {
  flex: 1; min-height: 44px; max-height: 160px; resize: none; padding: 9px 14px 11px;    /* текст на 1 px выше середины — на глаз ровно */
  border-radius: 22px; border: 2px solid transparent; background: var(--surface); outline: none; line-height: 1.4;
  overflow-y: hidden;
}
.composer textarea:focus { border-color: var(--accent); background: var(--bg); }
.composer .send {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center;
}
.composer .send:active { transform: scale(.96); }
.room-page .thread-head.m { position: sticky; top: calc(var(--safe-top) + 56px); z-index: 5; background: var(--bg); padding: 4px 0 8px; }

/* ---------------------------------------------------------------- ПК: две панели */
.page-chat { max-width: 1400px; }
.dbody .chat-desk {
  display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px;
  height: calc(100vh - 112px); min-height: 420px;
}
/* страница чата на ПК не листается целиком: окно переписки ровно в экран (нижний отступ колонки не нужен —
   был лишний 12 px и полоса прокрутки страницы справа). Листаются только список переписок и лента */
.dmain:has(.page-chat), .dmain:has(.page-news) { padding-bottom: 0; }
.chat-desk .chat-list { overflow-y: auto; padding-inline-end: 4px; scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
/* у ленты — своя тонкая полоса прокрутки внутри окна переписки, поверх фона: без стрелок, скруглённая,
   полупрозрачная в тон фону (по просьбе владельца 23.10 — видно, где ты и сколько ещё листать) */
.msgs::-webkit-scrollbar { width: 10px; }
.msgs::-webkit-scrollbar-track { background: transparent; }
.msgs::-webkit-scrollbar-button { display: none; height: 0; }
.msgs::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 6px; background: rgba(70, 42, 18, .24) padding-box; }
.msgs:hover::-webkit-scrollbar-thumb { background-color: rgba(70, 42, 18, .36); }      /* мышь над перепиской — заметнее */
.msgs::-webkit-scrollbar-thumb:hover { background-color: rgba(70, 42, 18, .5); }
:root[data-theme="dark"] .msgs::-webkit-scrollbar-thumb { background-color: rgba(255, 236, 214, .2); }
:root[data-theme="dark"] .msgs:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 236, 214, .3); }
:root[data-theme="dark"] .msgs::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 236, 214, .4); }
@supports not selector(::-webkit-scrollbar) {
  .msgs { scrollbar-width: thin; scrollbar-color: rgba(70, 42, 18, .35) transparent; }
}
.chat-desk .chat-thread {
  display: flex; flex-direction: column; min-height: 0;
  padding: 0 20px; border-radius: 20px; background: var(--chat-frame);
}
.chat-desk .thread-head { padding: 14px 0 12px; box-shadow: 0 1px 0 var(--surface-2); }
.chat-desk .msgs { flex: 1; overflow-y: auto; padding: 8px 4px 16px; padding-inline-start: 14px; }   /* аватар не у самого края (как в Telegram) */
.chat-desk .msg { max-width: 70%; }
.chat-desk .bubble, .chat-desk .day-sep span { background: var(--bg); }
.chat-desk .msg.mine .bubble { background: var(--out-bg); }
.chat-desk .bubble.del { background: transparent; }
.chat-desk .composer { position: static; padding: 12px 0 16px; background: transparent; box-shadow: none; }
.chat-desk .composer textarea { background: var(--bg); }
.chat-desk .room-ico { width: 40px; height: 40px; }

/* ---------------------------------------------------------------- галочки, «изменено», правка */
.ticks { display: inline-flex; color: var(--text-3); }
.ticks svg { width: 16px; height: 16px; stroke-width: 2; }
.ticks.read { color: var(--read); }
.edit-bar { display: flex; align-items: center; gap: 8px; padding: 0 4px 6px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.edit-bar span { flex: 1; }
.edit-bar button { display: flex; color: var(--text-2); }
.composer.editing textarea { border-color: var(--accent); }

/* ---------------------------------------------------------------- меню сообщения */
.ctx {
  position: fixed; z-index: 80; min-width: 220px; max-width: 280px; padding: 6px;
  border-radius: 14px; background: var(--bg);
  box-shadow: 0 12px 32px rgba(30, 20, 10, .18), 0 0 0 1px var(--surface-2);
  transform-origin: 50% 0; animation: ctx-in .18s cubic-bezier(.2, .9, .3, 1) both;
}
/* меню вырастает из точки нажатия (transform-origin ставит popCtx), а не просто появляется */
@keyframes ctx-in { from { opacity: 0; transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .ctx { animation: none; } }
.ctx-items button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px;
  border-radius: 10px; font-size: 14px; font-weight: 500; text-align: start;
}
.ctx-items button:hover { background: var(--surface); }
.ctx-items .danger { color: var(--danger); }
.ctx-sec { margin-top: 4px; padding: 8px 10px 4px; box-shadow: 0 -1px 0 var(--surface-2); }
.ctx-h { margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--text-3); }
#ctxReaders { max-height: 220px; overflow-y: auto; }
/* кто какую реакцию поставил: эмодзи, имя, фото справа */
.ctx-rxs { max-height: 196px; overflow-y: auto; }
.ctx-rxs .ctx-user { gap: 10px; padding: 4px 0; }
.ctx-rxs .ctx-user .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-e { width: 22px; flex: none; text-align: center; font-size: 17px; line-height: 1; }
.cr-e img { width: 19px; height: 19px; }
.ctx-user { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 14px; }
.ctx-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.ctx-status svg { width: 16px; height: 16px; }
.ctx-status.read { color: var(--read); }
/* на сенсорных экранах долгое нажатие открывает меню, а не выделение текста (копировать — через меню) */
@media (hover: none) {
  .msg .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

/* ---------------------------------------------------------------- упоминания @ник */
:root { --mention: var(--read); --mention-soft: rgba(43, 138, 224, .12); }
:root[data-theme="dark"] { --mention-soft: rgba(108, 182, 255, .16); }
.mention { color: var(--mention); font-weight: 600; font-size: inherit; line-height: inherit; }
.mention:hover { text-decoration: underline; }
.mention.me { padding: 0 3px; border-radius: 5px; background: var(--mention-soft); }
.bubble.ment-me { box-shadow: inset 3px 0 0 var(--mention); }
[dir="rtl"] .bubble.ment-me, [dir="rtl"] .quote { box-shadow: inset -3px 0 0 var(--mention); }
/* @ник всегда латиницей: внутри арабского текста не переворачиваем */
.mention { direction: ltr; unicode-bidi: isolate; }
.room-ment {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--mention); color: #fff;
  font-size: 13px; font-weight: 700; font-style: normal; line-height: 21px; text-align: center;
}
.tab-badge.ment, .nav-count.ment { background: var(--mention); color: #fff; }
.mention-pop {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% + 6px); z-index: 31;
  max-height: 280px; overflow-y: auto; padding: 6px; border-radius: 14px; background: var(--bg);
  box-shadow: 0 12px 32px rgba(30, 20, 10, .18), 0 0 0 1px var(--surface-2);
}
.mention-pop[hidden], .emoji-pop[hidden] { display: none; }
.mp-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 10px; text-align: start; }
.mp-item.on, .mp-item:hover { background: var(--surface); }
.mp-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.mp-nick { flex: none; color: var(--mention); font-size: 13px; font-weight: 600; }
.chat-desk .mention-pop { inset-inline-start: 0; inset-inline-end: auto; width: 380px; }

/* ---------------------------------------------------------------- ответ, пересланное, цитата */
.bubble-row { position: relative; display: flex; max-width: 100%; }
.fwd { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; font-size: 13px; color: var(--mention); }
.fwd button { color: inherit; font-size: inherit; font-weight: 600; }
.quote {
  display: block; width: 100%; max-width: 440px; margin: 2px 0 6px; padding: 4px 10px; border-radius: 8px;
  background: var(--mention-soft); box-shadow: inset 3px 0 0 var(--mention);
  text-align: start; font-size: 13px; line-height: 1.35;
}
.quote b { display: block; color: var(--mention); font-weight: 600; }
.quote span { display: block; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 0 4px 8px; color: var(--mention); }
.reply-bar .rb-body { flex: 1; min-width: 0; padding-inline-start: 10px; box-shadow: inset 2px 0 0 var(--mention); text-align: start; }
[dir="rtl"] .reply-bar .rb-body { box-shadow: inset -2px 0 0 var(--mention); }
.reply-bar .rb-body b { display: block; font-size: 13px; font-weight: 600; color: var(--mention); }
.reply-bar .rb-body span { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .rb-x { display: flex; padding: 4px; color: var(--text-2); }
.composer.replying textarea { border-color: var(--mention); }
/* ПК: задержал мышь на сообщении ~1 с — у нижнего угла пузыря всплывает быстрая реакция (как в Telegram).
   Кнопок «Ответить»/«⋯» при наведении нет: меню — правой кнопкой (на телефоне — касанием). Отступ от пузыря —
   полем самой кнопки (без зазора), прячется с задержкой — мышь успевает до неё дойти. */
.hover-acts { display: none; }
@media (hover: hover) {
  .hover-acts {
    position: absolute; bottom: 0; inset-inline-start: 100%; z-index: 2; display: flex; padding-inline-start: 6px; padding-top: 8px;
    visibility: hidden; opacity: 0; transform: scale(.5); transform-origin: 0 100%;
    transition: opacity .14s ease-out .25s, transform .14s ease-out .25s, visibility 0s linear .39s;
  }
  .msg.mine .hover-acts { inset-inline-start: auto; inset-inline-end: 100%; padding-inline: 0 6px; transform-origin: 100% 100%; }
  [dir="rtl"] .hover-acts { transform-origin: 100% 100%; }
  [dir="rtl"] .msg.mine .hover-acts { transform-origin: 0 100%; }
  .msg:hover .hover-acts {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity .16s ease-out 1s, transform .22s cubic-bezier(.3, 1.4, .5, 1) 1s, visibility 0s linear 1s;
  }
  .hover-acts .qr {
    width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: var(--bg); box-shadow: 0 1px 4px rgba(30, 20, 10, .2); font-size: 16px; line-height: 1;
    transition: transform .12s ease-out;
  }
  .hover-acts .qr img { width: 18px; height: 18px; }
  .hover-acts .qr:hover { transform: scale(1.15); }
  .hover-acts .qr:active { transform: scale(.92); }
}
/* ---------------------------------------------------------------- выделение сообщений (как в Telegram):
   строки во всю ширину, справа кружок-отметка; отмеченное подсвечено; сверху «Переслать N» / «Удалить N» / «Отмена» */
.msgs.selecting { -webkit-user-select: none; user-select: none; }
.msgs.selecting .msg { align-self: stretch; max-width: none; cursor: pointer; }
.msgs.selecting .msg-body { max-width: calc(86% - 40px); }
.msgs.selecting .msg.mine { margin-inline-end: 0; }
.msgs.selecting .hover-acts { display: none !important; }
.sel-c {
  flex: none; align-self: flex-end; width: 24px; height: 24px; margin-bottom: 6px; margin-inline-start: auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: rgba(20, 14, 10, .16); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9);
  transition: background-color .12s ease-out, transform .12s ease-out;
}
.msg.mine .sel-c { margin-inline-start: 10px; }        /* слева от кружка — место под хвостик моего пузыря */
.sel-c svg { width: 15px; height: 15px; stroke-width: 3; opacity: 0; transition: opacity .12s ease-out; }
.msg.sel .sel-c { background: var(--out-acc); box-shadow: none; transform: scale(1.06); }
.msg.sel .sel-c svg { opacity: 1; }
:root { --sel-tint: rgba(43, 138, 224, .17); }
:root[data-theme="dark"] { --sel-tint: rgba(108, 182, 255, .2); }
.msg.sel .bubble { background-image: linear-gradient(var(--sel-tint), var(--sel-tint)) !important; }   /* хвостик берёт то же */
.msg.sel .bubble.k-photo::after, .msg.sel .bubble.k-video::after { content: ''; position: absolute; inset: 0; background: var(--sel-tint); pointer-events: none; }
body.sel-drag { -webkit-user-select: none; user-select: none; }
.sel-bar { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sel-bar .btn { flex: none; }
.sel-bar .btn .num { margin-inline-start: 4px; opacity: .85; }
.sel-x { margin-inline-start: auto; padding: 8px 10px; font-weight: 700; color: var(--accent); }
.rt-row.sel-row .sel-bar { height: 56px; padding: 0 8px; border-radius: 28px; }   /* на телефоне — та же «таблетка», что у шапки */
/* телефон: потянуть сообщение влево — ответ */
.msgs .msg { position: relative; touch-action: pan-y; transition: transform .22s cubic-bezier(.2, .8, .2, 1); }
.msgs .msg.swiping { transition: none; }
.msgs .msg.swiping::after {
  content: ''; position: absolute; top: 50%; inset-inline-end: -42px; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b8ae0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 6 4 11.5 9.5 17'/%3E%3Cpath d='M4.5 11.5H14a6 6 0 0 1 6 6V19'/%3E%3C/svg%3E") center / 18px no-repeat;
  opacity: var(--sw, 0); transform: scale(calc(.6 + var(--sw, 0) * .4));
}
.msg.flash .bubble { animation: msg-flash 1.8s ease-out; }
@keyframes msg-flash { 0%, 35% { box-shadow: 0 0 0 3px var(--mention); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* ---------------------------------------------------------------- удалённые */
.bubble.del .txt { display: inline-flex; align-items: center; gap: 6px; }
.revealed { margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--danger-soft); color: var(--text); font-style: normal; }
.revealed small { display: block; margin-top: 2px; font-size: 11px; color: var(--danger); }
.page-deleted { max-width: 820px; }
.del-sub { display: flex; align-items: center; gap: 6px; margin: 4px 4px 12px; }
.del-list { display: flex; flex-direction: column; gap: 8px; }
.del-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); }
.del-item .grow { flex: 1; min-width: 0; }
.del-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.del-text { margin: 4px 0 6px; overflow-wrap: anywhere; }
.del-by { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }

/* ---------------------------------------------------------------- эмодзи */
.bubble.jumbo { padding: 0 2px; background: transparent !important; box-shadow: none; font-size: 44px; line-height: 1.15; }
.bubble.jumbo.j3 { font-size: 34px; }
/* одно эмодзи — «стикер»: крупно (чёткая картинка с сервера); свежее — проигрывает векторную анимацию один раз
   (на её время картинку подменяет span того же размера); моя реакция — анимируется само эмодзи в «таблетке» */
.bubble.jumbo img.emj.stk, span.stk { display: block; width: 112px; height: 112px; }
.rx-e { display: inline-block; width: 18px; height: 18px; flex: none; }
.stk.pop { animation: stk-pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }       /* у эмодзи нет анимации — «выпрыгивает» */
@keyframes stk-pop { 0% { transform: scale(.3) rotate(-14deg); opacity: 0; } 60% { transform: scale(1.12) rotate(6deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .stk.pop { animation: none; } }
.emoji-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
  transition: background-color .12s ease-out, color .12s ease-out;
}
.emoji-btn:hover, .emoji-btn.on { color: var(--accent); background: var(--surface); }
.chat-desk .emoji-btn:hover, .chat-desk .emoji-btn.on { background: var(--bg); }
/* окно эмодзи — как в Telegram: картинки одного набора (Google Noto), поиск, недавние, категории, оттенок кожи */
.emoji-pop {
  position: absolute; inset-inline-start: 8px; bottom: calc(100% + 8px); z-index: 30;
  width: min(380px, calc(100vw - 16px)); height: 400px; border-radius: 20px; overflow: hidden; background: var(--bg);
  box-shadow: 0 16px 40px rgba(30, 20, 10, .16), 0 0 0 1px var(--surface-2);
}
.ep { display: flex; flex-direction: column; width: 100%; height: 100%; }
.ep-head { display: flex; align-items: center; gap: 6px; padding: 10px 10px 6px; }
.ep-search {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 0; border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 15px;
}
.ep-search::placeholder { color: var(--text-3); }
.ep-search:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--bg); }
.ep-tone { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.ep-tone:hover, .ep-tone[aria-expanded="true"] { background: var(--surface); }
.ep-tone .emj { width: 24px; height: 24px; }
.ep-tones { display: flex; justify-content: flex-end; gap: 2px; padding: 0 10px 6px; }
.ep-tones button { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.ep-tones button:hover { background: var(--surface); }
.ep-tones button.on { background: var(--accent-soft); }
.ep-tones .emj { width: 24px; height: 24px; }
.ep-tabs { display: flex; gap: 2px; padding: 0 8px 6px; box-shadow: inset 0 -1px 0 var(--surface-2); overflow-x: auto; scrollbar-width: none; }
.ep-tabs::-webkit-scrollbar { display: none; }
.ep-tab {
  flex: 1 0 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); opacity: .55; filter: grayscale(.7); transition: opacity .12s ease-out, filter .12s ease-out, background-color .12s ease-out;
}
.ep-tab:hover { opacity: .85; filter: none; }
.ep-tab.on { opacity: 1; filter: none; background: var(--surface); color: var(--accent); }
.ep-tab .emj { width: 20px; height: 20px; }
.ep-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 6px 8px;
}
/* тонкая полоса без стрелок: в Chrome/Safari — через ::-webkit-scrollbar (scrollbar-width его отключил бы), в Firefox — thin */
.ep-body::-webkit-scrollbar { width: 6px; }
.ep-body::-webkit-scrollbar-button { display: none; }
.ep-body::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 3px; }
.ep-body::-webkit-scrollbar-track { background: transparent; }
@supports not selector(::-webkit-scrollbar) { .ep-body { scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; } }
.ep-title { position: sticky; top: 0; z-index: 1; padding: 10px 6px 6px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--text-3); }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.ep-e { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.ep-e:hover, .ep-e:focus-visible { background: var(--surface); outline: none; }
.ep-e .emj { width: 30px; height: 30px; transition: transform .1s ease-out; }
.ep-e:active .emj { transform: scale(.86); }
.ep-empty { padding: 32px 12px; text-align: center; color: var(--text-3); }
/* эмодзи-картинка в тексте сообщения, превью и цитате — ростом с букву */
img.emj { display: inline-block; width: 1.3em; height: 1.3em; margin: 0 .03em; vertical-align: -.3em; object-fit: contain; }
.bubble.jumbo img.emj { width: 1.1em; height: 1.1em; vertical-align: middle; }
.emoji-wait { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.chat-desk .composer { position: relative; }
@media (max-width: 899px) {
  .emoji-pop { left: 0; right: 0; width: auto; bottom: 100%; height: 320px; border-radius: 16px 16px 0 0; box-shadow: 0 -1px 0 var(--surface-2); }
  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}

/* ---------------------------------------------------------------- плавающие кнопки «@» и «вниз» */
.msgs-wrap { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.fabs {
  position: fixed; inset-inline-end: 14px; bottom: calc(var(--composer-h, 64px) + 14px); z-index: 24;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.chat-desk .fabs { position: absolute; inset-inline-end: 4px; bottom: 12px; }
.fab {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--text-2);
  box-shadow: 0 2px 10px rgba(30, 20, 10, .16), 0 0 0 1px var(--surface-2);
  animation: fab-in .18s ease-out;
}
.fab:hover { color: var(--text); }
.fab-ment, .fab-ment:hover { color: var(--mention); }
.fab em {
  position: absolute; top: -7px; inset-inline-end: -6px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font-size: 11px; font-weight: 700; font-style: normal; line-height: 20px; text-align: center;
}
.fab-ment em { background: var(--mention); color: #fff; }
@keyframes fab-in { from { opacity: 0; transform: scale(.8); } }

/* ---------------------------------------------------------------- всплывающее «вас упомянули» */
.mtoast {
  position: fixed; left: 50%; top: calc(var(--safe-top) + 12px); z-index: 90;
  display: flex; align-items: center; gap: 10px; width: min(420px, calc(100vw - 24px)); padding: 10px 14px;
  border-radius: 16px; background: var(--bg); text-align: start;
  box-shadow: 0 12px 32px rgba(30, 20, 10, .18), 0 0 0 1px var(--surface-2);
  /* спрятана: выше экрана на свою высоту + отступ + строку состояния (в APK она высокая — без неё низ плашки
     оставался виден и «застревал» наверху); после выезда ещё и невидима, чтобы ни краешка, ни нажатий */
  transform: translate(-50%, calc(-100% - 24px - var(--safe-top))); visibility: hidden;
  transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .26s;
}
.mtoast.show { transform: translate(-50%, 0); visibility: visible; transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
.mtoast .mt-at { width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--mention); color: #fff; display: flex; align-items: center; justify-content: center; }
.mtoast .grow { flex: 1; min-width: 0; }
.mtoast b { display: block; font-size: 14px; }
.mtoast .grow > span { display: block; font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.msgs.m { overflow-x: clip; }

/* ---------------------------------------------------------------- переписка на телефоне: «стеклянная» шапка как в Telegram */
/* круглая «назад», пилюля с фото/названием/«в сети», круглая ⋮; под ней — закреплённое. Лента проходит под ними. */
.chat-top { position: sticky; top: 0; z-index: 20; padding: calc(var(--safe-top) + 8px) 10px 6px; }
/* в анимации перехода шапка — своим слоем поверх въезжающей ленты (как .topbar); без этого лента 0,3 с
   перекрывала её и шапка «моргала» — пропадала и появлялась последней */
.chat-top { view-transition-name: topbar; }
.rt-row { display: flex; align-items: center; gap: 8px; }
.rt-btn, .rt-title, .pin-bar, .rt-search, .rt-row.sel-row .sel-bar {
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 7%, transparent), 0 6px 18px rgba(30, 20, 10, .10);
}
.rt-btn { width: 48px; height: 48px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.rt-btn:active, .rt-title:active { transform: scale(.97); }
.rt-title { flex: 1; min-width: 0; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 8px; border-radius: 28px; text-align: start; color: var(--text); }
.rt-title .room-ico { width: 40px; height: 40px; }
.rt-txt { min-width: 0; display: flex; flex-direction: column; }
.rt-txt b { display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; }
.rt-txt b bdi { overflow: hidden; text-overflow: ellipsis; }
.rt-txt small { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
svg.i.mute { width: 15px; height: 15px; flex: none; color: var(--text-3); }
.rt-search { flex: 1; min-width: 0; height: 48px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 24px; color: var(--text-3); }
.rt-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; color: var(--text); }
.thread-head .rt-search { box-shadow: 0 0 0 1px var(--surface-2); background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* закреплённое сообщение: полоски слева — сколько их (до 4) и какое сейчас; справа — список */
.pin-bar { display: flex; align-items: center; margin-top: 8px; border-radius: 22px; overflow: hidden; }
/* ПК: закреплённое — стеклянной полосой поверх верхней части ленты; фон под ней не сжимается и не перерисовывается,
   а сама лента получает отступ сверху, чтобы первые сообщения не прятались под полосой */
.chat-desk #pinWrap { position: absolute; top: 8px; left: 12px; right: 14px; z-index: 3; }
.chat-desk .pin-bar { margin: 0; border-radius: 14px; }
.chat-desk .msgs-wrap:has(#pinWrap .pin-bar) .msgs { padding-top: 72px; }
.pb-main { flex: 1; min-width: 0; display: flex; align-items: stretch; gap: 10px; padding: 8px 6px 8px 14px; text-align: start; color: var(--text); }
.pb-segs { display: flex; flex-direction: column; gap: 2px; width: 3px; flex: none; }
.pb-segs i { flex: 1; border-radius: 2px; background: color-mix(in srgb, var(--accent) 30%, transparent); }
.pb-segs i.on { background: var(--accent); }
.pb-txt { min-width: 0; display: flex; flex-direction: column; }
.pb-txt b { font-size: 14px; font-weight: 700; color: var(--accent-ink, var(--accent)); }
.pb-txt > span { font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-list { width: 48px; flex: none; align-self: stretch; display: flex; align-items: center; justify-content: center; color: var(--text-3); }
.pin-list .pin-row { display: flex; align-items: center; gap: 4px; padding: 0 12px 0 20px; }
.pin-list .pin-row .grow { min-width: 0; display: flex; flex-direction: column; padding: 10px 0; text-align: start; color: var(--text); }
.pin-list .pin-row .grow span { color: var(--text-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-list .pin-row + .pin-row { box-shadow: 0 -1px 0 var(--surface-2); }
svg.i.pinned { color: var(--text-3); }

/* список переписок: уведомления выключены — колокольчик зачёркнут, счётчик серый */
.room-top b svg.i.mute { display: inline-block; margin-inline-start: 4px; vertical-align: -2px; }
.room.muted .room-unread { background: var(--text-3); }

/* ---------------------------------------------------------------- меню сообщения: реакции сверху */
/* полоска реакций — отдельной «таблеткой» над меню (места нет — под ним), как в Telegram */
.ctx-rx {
  position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0; display: flex; align-items: center; gap: 2px; padding: 4px 6px;
  border-radius: 24px; background: var(--bg); box-shadow: 0 8px 24px rgba(30, 20, 10, .16), 0 0 0 1px var(--surface-2); white-space: nowrap;
}
.ctx-rx.down { bottom: auto; top: calc(100% + 8px); }
.ctx-rx button { width: 34px; height: 36px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; }
.ctx-rx button img { width: 26px; height: 26px; }
.ctx-rx button:hover, .ctx-rx button.on { background: var(--accent-soft); }
.ctx-rx button:active { transform: scale(.9); }
.ctx-rx .rx-more { width: 30px; color: var(--text-3); margin-inline-start: auto; }
.ctx { max-width: min(320px, calc(100vw - 16px)); }
.room-menu { min-width: 240px; }

/* реакции под сообщением: эмодзи и кто поставил */
.rx { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg.mine .rx { justify-content: flex-end; }
.rx-pill { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 8px 0 6px; border-radius: 15px; background: var(--surface); font-size: 16px; line-height: 1; box-shadow: 0 0 0 1px var(--surface-2); }
.rx-pill img { width: 18px; height: 18px; }
.rx-pill.mine { background: var(--accent-soft); box-shadow: 0 0 0 1.5px var(--accent); }
.rx-av { display: inline-flex; }
.rx-av .av { box-shadow: 0 0 0 1.5px var(--surface); }
.rx-pill.mine .rx-av .av { box-shadow: 0 0 0 1.5px var(--accent-soft); }
.rx-av .av + .av { margin-inline-start: -6px; }
.rx-n { font-size: 13px; font-weight: 700; color: var(--text-2); }
/* реакции внутри пузыря (как в Telegram): строкой под текстом, время — справа в той же строке. В чужом пузыре —
   голубоватые, в моём — зелёные; моя реакция — залитая (голубая / зелёная) */
.rx.in { margin-top: 6px; justify-content: flex-start !important; align-items: flex-end; }
.rx.in .mt.ghost { margin-inline-start: auto; }
.bubble:has(> .rx.in) > .mt { bottom: 12px; }
.bubble.k-photo > .rx.in, .bubble.k-video > .rx.in { margin: -2px 12px 0; padding-bottom: 8px; }
.mt-row.has-rx { justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.mt-row.has-rx .rx.in { margin-top: 0; }
.rx.in .rx-pill { height: 28px; padding: 0 8px 0 6px; background: var(--mention-soft); box-shadow: none; }
.msg.mine .rx.in .rx-pill { background: var(--out-soft); }
.rx.in .rx-pill.mine { background: var(--mention); }
.msg.mine .rx.in .rx-pill.mine { background: var(--out-acc); }
.rx.in .rx-n { color: var(--mention); }
.msg.mine .rx.in .rx-n { color: var(--out-ink); }
.rx.in .rx-pill.mine .rx-n { color: #fff; }
.rx.in .rx-av .av, .rx.in .rx-pill.mine .rx-av .av { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }
.av.s20 { width: 20px; height: 20px; font-size: 9px; }
.av.s24 { width: 24px; height: 24px; font-size: 10px; }
.av.s32 { width: 32px; height: 32px; font-size: 12px; }
.av.s36 { width: 36px; height: 36px; font-size: 13px; }

/* ---------------------------------------------------------------- поиск по переписке */
.search-res { position: fixed; inset: 0; z-index: 18; overflow-y: auto; background: var(--bg); padding: calc(var(--safe-top) + 74px) 10px 24px; }   /* под шапкой поиска целиком, без щели */
.chat-desk .search-res { position: absolute; inset: 0; z-index: 6; }
.sr-wait { display: flex; justify-content: center; padding: 32px; }
.sr-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; text-align: start; color: var(--text); }
.sr-item:hover { background: var(--surface); }
.sr-item .grow { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.sr-top { display: flex; align-items: baseline; gap: 8px; }
.sr-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sr-date { flex: none; font-size: 12px; color: var(--text-3); }
.sr-txt { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-txt mark { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--text); border-radius: 3px; padding: 0 1px; }

/* ---------------------------------------------------------------- обои лички */
.room-wall { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.chat-desk .room-wall { position: absolute; }
.room-page .msgs.m, .chat-desk .msgs { position: relative; z-index: 1; }
.walled .day-sep span, .walled .chat-empty { background: rgba(20, 14, 10, .42); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.walled .chat-empty { border-radius: 14px; margin: 24px auto; max-width: 320px; }
.walled .msg-meta { text-shadow: 0 0 4px var(--bg), 0 0 2px var(--bg); }
.wall-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 4px 2px 6px; }   /* все темы видны сразу */
.wall-tile { height: 112px; border-radius: 14px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 4px; box-shadow: inset 0 0 0 1.5px var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 600; }
.wall-tile span { background: color-mix(in srgb, var(--bg) 82%, transparent); border-radius: 8px; padding: 2px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wall-tile.none { justify-content: center; }
.wall-tile.none svg { color: var(--danger); width: 30px; height: 30px; }
.wall-tile.on { box-shadow: 0 0 0 3px var(--accent); }
.dialog .box.wall-dlg .pop-body { padding: 4px 20px 20px; }

/* заявка ждёт решения: «пришлём уведомление» */
.reg-notify-on { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: var(--ok) !important; margin: -8px 0 16px !important; }
.reg-sent.no .reg-sent-ic { background: var(--danger-soft); color: var(--danger); }

/* ---------------------------------------------------------------- голосовые и кружки: кнопка и запись */
/* поле пустое — справа микрофон/кружок; есть текст — «отправить» */
.composer:not(.typing):not(.editing) button[type="submit"].send { display: none; }
.composer.typing .rec-btn, .composer.editing .rec-btn { display: none; }
.rec-btn { touch-action: none; -webkit-user-select: none; user-select: none; position: relative; transition: transform .12s ease-out, background-color .15s; }
.composer.recording .rec-btn { background: var(--danger); transform: scale(calc(1.15 + var(--lvl, 0) * .5)); z-index: 3; }
.composer.recording.locked .rec-btn { background: var(--accent); transform: none; }
.composer.recording .rec-btn::after { content: ""; position: absolute; inset: -9px; z-index: -1; border-radius: 50%; background: var(--danger); opacity: .2;
  transform: scale(calc(1 + var(--lvl, 0) * .9)); transition: transform .1s linear; animation: rec-halo-in .18s ease-out; pointer-events: none; }
.composer.recording.locked .rec-btn::after { display: none; }
@keyframes rec-halo-in { from { opacity: 0; transform: scale(.4); } }
.rec-bar { animation: rec-bar-in .16s ease-out; }
@keyframes rec-bar-in { from { opacity: 0; transform: translateX(24px); } }
.composer-row { position: relative; }
.rec-bar { position: absolute; inset: 0 52px 0 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 0 8px; background: var(--bg); border-radius: 22px; overflow: hidden; }
.rec-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--danger); animation: rec-blink 1s ease-in-out infinite; }
@keyframes rec-blink { 50% { opacity: .2; } }
.rec-time { font-weight: 600; font-size: 15px; min-width: 64px; }
.rec-hint { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--text-3); font-size: 14px; white-space: nowrap; transition: transform .05s linear; }
.rec-trash { display: none; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; color: var(--danger); flex: none; }
.composer.locked .rec-trash { display: inline-flex; }
.composer.locked .rec-hint { visibility: hidden; }
.rec-lock { position: absolute; bottom: calc(100% + 8px); inset-inline-end: 14px; width: 40px; padding: 8px 0; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg); color: var(--text-3); box-shadow: 0 6px 18px rgba(30, 20, 10, .14), 0 0 0 1px var(--surface-2); animation: rec-lock-in .25s ease-out; }
.rec-lock svg.up { transform: rotate(180deg); animation: rec-lock-up 1.2s ease-in-out infinite; }
.composer.locked .rec-lock { display: none; }
@keyframes rec-lock-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes rec-lock-up { 50% { transform: rotate(180deg) translateY(3px); } }
.up-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px 4px; padding: 4px 10px; border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: 13px; }

/* кружок во время записи: на весь экран, круг по центру, кольцо — сколько осталось из минуты */
.circ-rec { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: rgba(10, 8, 6, .55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; transition: opacity .2s ease-out; pointer-events: none; }
.circ-rec.show { opacity: 1; }
.circ-rec .cr-stage { transform: scale(.72); transition: transform .24s cubic-bezier(.2, .9, .3, 1.12); }
.circ-rec.show .cr-stage { transform: none; }
.circ-rec .cr-bar, .circ-rec .cr-tools { transform: translateY(18px); opacity: 0; transition: transform .22s ease-out, opacity .22s; }
.circ-rec.show .cr-bar, .circ-rec.show .cr-tools { transform: none; opacity: 1; }
.circ-rec.fly { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transition: background-color .3s, opacity .3s .25s; opacity: 0; }
.circ-rec.fly .cr-stage { transition: transform .3s cubic-bezier(.3, .7, .2, 1); box-shadow: none; }
.circ-rec.fly .cr-bar, .circ-rec.fly .cr-tools, .circ-rec.fly .cr-ring { opacity: 0; transition: opacity .12s; }
.cr-stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-stage canvas.mirror { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .circ-rec .cr-stage, .circ-rec .cr-bar, .circ-rec .cr-tools { transform: none; transition: none; } }
.circ-rec .cr-tools, .circ-rec .cr-btn, .circ-rec .cr-bar { pointer-events: auto; }
/* внизу экрана кружка: отмена, сколько записано, отправить */
.cr-bar { display: flex; align-items: center; gap: 22px; }
.cr-time { min-width: 56px; text-align: center; color: #fff; font-size: 18px; font-weight: 600; }
.cr-send { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.cr-send:active { transform: scale(.95); }
.cr-stage { position: relative; width: min(74vw, 340px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #000; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.cr-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-stage video.mirror { transform: scaleX(-1); }
.cr-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.cr-ring circle { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 305; stroke-dashoffset: 305; }
.cr-tools { display: flex; gap: 14px; }
.cr-btn { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .16); color: #fff; }

/* ---------------------------------------------------------------- голосовое в переписке */
.bubble.media { padding: 8px 10px; }
.vmsg { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.vplay { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); }
.vplay .p2, .vplay .spin, .vmsg.playing .vplay .p1, .vmsg.loading .vplay .p1 { display: none; }
.vmsg.playing .vplay .p2, .vmsg.loading .vplay .spin { display: inline-block; }
.vmsg.loading .vplay .spin { color: var(--on-accent); }
.vbody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.vwave { display: flex; align-items: center; gap: 2px; height: 28px; cursor: pointer; }
.vwave i { flex: 1; max-width: 3px; min-height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--text-2) 40%, transparent); }
.vwave i.on { background: var(--accent); }
.msg.mine .vwave i { background: color-mix(in srgb, var(--out-acc) 35%, transparent); }
.msg.mine .vwave i.on { background: var(--out-acc); }
.vmeta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.vspeed { padding: 0 6px; height: 20px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 700; }
.vtx { width: 32px; height: 32px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); font-size: 12px; }
.vtx b { font-weight: 800; letter-spacing: -.02em; }
.vtx.done { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.vtxt { margin-top: 6px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.vtxt.wait { color: var(--text-3); font-style: italic; }
.vtxt small { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11px; color: var(--text-3); }

/* ---------------------------------------------------------------- кружок в переписке: круг с первым кадром, нажал — играет и растёт */
.bubble.k-circle { background: none !important; box-shadow: none !important; padding: 0; }
.circ { position: relative; width: 210px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #2a2420 center/cover no-repeat;
  box-shadow: 0 2px 10px rgba(30, 20, 10, .16); transition: width .25s cubic-bezier(.2, .8, .2, 1); }
.circ.active { width: min(280px, 72vw); }
.circ-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.circ-hit { position: absolute; inset: 0; z-index: 3; border-radius: 50%; }
.circ-ring { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; opacity: 0; }
.circ.active .circ-ring { opacity: 1; }
.circ-ring circle { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: 305; stroke-dashoffset: calc(305 * (1 - var(--p, 0))); }
.circ-dur { position: absolute; z-index: 2; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; font-weight: 600; }
.circ-ic { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .42); color: #fff; }
.circ-ic .spin, .circ.loading .circ-ic svg { display: none; }
.circ.loading .circ-ic .spin { display: inline-block; color: #fff; }
.circ.playing .circ-ic { opacity: 0; }
.circ-tools { display: flex; justify-content: flex-start; margin-top: 6px; }
.msg.mine .circ-tools { justify-content: flex-end; }

/* ---------------------------------------------------------------- звонок в переписке */
.callmsg { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cm-ic { width: 36px; height: 36px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--ok-soft, var(--surface-2)); color: var(--ok); }
.callmsg.miss .cm-ic { background: var(--danger-soft); color: var(--danger); }
.callmsg .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.callmsg.miss b { color: var(--danger); }
.callmsg small { font-size: 12px; color: var(--text-3); }
.cm-back { width: 36px; height: 36px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.cm-back:hover { background: var(--surface); }

/* ---------------------------------------------------------------- экран звонка (как в Telegram) */
.call { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; color: #fff; overflow: hidden; opacity: 0; transition: opacity .2s ease-out; }
.call.show { opacity: 1; }
.call.ending { opacity: 0; transition-delay: .9s; transition-duration: .3s; }
.call.min { display: none; }
.call-bg { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 10%, #8a4a2a 0%, #3a2318 55%, #160f0b 100%); }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.call.vid .call-remote { display: block; }
.call.vid .call-bg { display: none; }
/* вертикальное видео на широком экране (и наоборот) — целиком, а по бокам размытый тот же кадр, как в Telegram */
.call-remote-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover;
  filter: blur(32px) brightness(.5) saturate(1.2); display: none; }
.call.vid.fit .call-remote-bg { display: block; }
.call.fit .call-remote { object-fit: contain; background: transparent; }
/* кнопки — всегда внизу (раньше в режиме видео поднимались наверх и закрывали треть кадра) */
.call.vid .call-bar { margin-top: auto; }
.call-top { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(var(--safe-top) + 10px) 14px 0; }
.call-tb { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: rgba(255, 255, 255, .12); }
.call-e2e { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: rgba(0, 0, 0, .25); color: #fff; font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.call-q { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; width: 44px; justify-content: center; }
.call-q i { width: 5px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.call-q i:nth-child(1) { height: 7px; } .call-q i:nth-child(2) { height: 12px; } .call-q i:nth-child(3) { height: 17px; }
.call-q.q1 i:nth-child(1), .call-q.q2 i:nth-child(-n+2), .call-q.q3 i { background: #fff; }
.call-q.q1 i:nth-child(1) { background: #ff8a7a; }
.call-info { position: relative; z-index: 3; margin: 10px 14px 0; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .45); font-size: 14px; line-height: 1.45; }
.call-info p { margin: 4px 0 0; color: rgba(255, 255, 255, .85); }
.call-who { position: relative; z-index: 2; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; text-align: center; }
.call.vid .call-who { flex: 0; justify-content: flex-start; padding-top: 10px; }
.call.vid .call-av { display: none; }
.call-av { border-radius: 50%; transition: box-shadow .2s; }
.call-av .av { box-shadow: 0 0 0 6px rgba(255, 255, 255, .08); }
.call.speaking .call-av .av { box-shadow: 0 0 0 10px rgba(255, 255, 255, .16), 0 0 0 20px rgba(255, 255, 255, .06); }
.call.ringing .call-av .av { animation: call-pulse 1.6s ease-out infinite; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .35); } 100% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0); } }
.call-who h2 { margin: 6px 0 0; font-size: 26px; font-weight: 700; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.call-status { font-size: 16px; color: rgba(255, 255, 255, .85); font-variant-numeric: tabular-nums; }
.call-stats { min-height: 16px; font-size: 12px; color: rgba(255, 255, 255, .7); }
/* окошко (моя камера или собеседник после смены местами): таскается, прилипает к углу пружиной */
.call-pip {
  position: absolute; z-index: 4; left: 0; top: 0; width: 112px; height: 150px; border-radius: 16px; overflow: hidden;
  background: #111; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); display: none; touch-action: none; cursor: grab;
  will-change: transform; transition: transform .42s cubic-bezier(.18, .9, .3, 1.15), box-shadow .2s;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
.call.has-pip .call-pip { display: block; }
.call-pip.drag { transition: box-shadow .2s; cursor: grabbing; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.call-pip-v { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.call-pip-av { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 10%, #8a4a2a 0%, #3a2318 60%, #160f0b 100%); }
.call-pip.av-only .call-pip-av { display: flex; }
.call-pip.av-only .call-pip-v { visibility: hidden; }
.call-remote.mirror, .call-remote-bg.mirror, .call-pip-v.mirror { transform: scaleX(-1); }
/* страница под звонком не листается, а сам экран звонка не тянется пальцем (была полоса прокрутки справа) */
html.call-open, html.call-open body { overflow: hidden; overscroll-behavior: none; }
.call { touch-action: none; overscroll-behavior: none; }
/* окно поверх других приложений (Android): только собеседник, без кнопок */
.call.inpip .call-top, .call.inpip .call-bar, .call.inpip .call-vol, .call.inpip .call-info, .call.inpip .call-stats,
.call.inpip .call-pip { display: none !important; }
.call.inpip .call-who { padding: 0 8px; gap: 4px; }
.call.inpip .call-who h2 { font-size: 16px; margin: 0; }
.call.inpip .call-status { font-size: 13px; }
.call.inpip .call-av .av { width: 56px; height: 56px; font-size: 20px; }
.call.inpip.vid .call-who { display: none; }
.call-vol { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; margin: 0 auto 12px; width: min(340px, calc(100% - 40px)); padding: 10px 14px;
  border-radius: 16px; background: rgba(0, 0, 0, .35); }
.call-vol input { flex: 1; accent-color: #fff; }
.call-vol b { min-width: 44px; text-align: end; font-size: 13px; }
.call-bar { position: relative; z-index: 2; display: flex; justify-content: center; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px calc(var(--safe-bottom) + 24px); }
.call.vid .call-bar { background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; color: #fff; }
.call-btn span { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: transform .1s ease-out, background-color .15s; }
.call-btn:active span { transform: scale(.94); }
.call-btn small { font-size: 12px; color: rgba(255, 255, 255, .85); white-space: nowrap; }
.call-btn.on span { background: #fff; color: #222; }
.call-btn.off span { background: #fff; color: var(--danger); }
.call-btn.red span { background: #e5483b; }
.call-btn.green span { background: #2fb35f; }
.call-btn.pulse span { animation: call-pulse 1.4s ease-out infinite; }
.call-pill { position: fixed; z-index: 94; top: calc(var(--safe-top) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 19px; background: #2fb35f; color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
.call-pill span { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-vol[hidden], .call-info[hidden], .search-res[hidden] { display: none !important; }   /* свой display не должен перебивать hidden */
/* меню чата: пункт в две строки (название + выбранное значение) и окно «Язык для перевода» */
.ctx-two { display: flex; flex-direction: column; min-width: 0; }
.ctx-sub { font-size: 12.5px; font-weight: 500; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-lang-hint { margin: 0; padding: 0 20px 8px; }
.tr-langs { display: flex; flex-direction: column; gap: 2px; }
.tr-langs button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; text-align: start; }
.tr-langs button span { flex: 1; min-width: 0; }
.tr-langs button:hover { background: var(--surface); }
.tr-langs button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
/* ---------------------------------------------------------------- теги участников: цветная светящаяся плашка (как в Telegram) */
.utag {
  --tg: #2f6fdc;
  flex: none; display: inline-flex; align-items: center; max-width: 150px; height: 24px; padding: 0 10px; border-radius: 12px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--tg);
  background: color-mix(in srgb, var(--tg) 15%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--tg) 32%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--tg) 22%, transparent);
  text-shadow: 0 0 8px color-mix(in srgb, var(--tg) 45%, transparent);
}
.utag.c-red { --tg: #d93a3a; }
.utag.c-orange { --tg: #d9620f; }
.utag.c-amber { --tg: #b7791f; }
.utag.c-green { --tg: #2b9348; }
.utag.c-teal { --tg: #0f8f8a; }
.utag.c-blue { --tg: #2f6fdc; }
.utag.c-indigo { --tg: #4f4fd8; }
.utag.c-violet { --tg: #8a3fd1; }
.utag.c-pink { --tg: #d6337e; }
.utag.c-gray { --tg: #6b7280; }
:root[data-theme="dark"] .utag.c-red { --tg: #ff6b6b; }
:root[data-theme="dark"] .utag.c-orange { --tg: #ff9a4d; }
:root[data-theme="dark"] .utag.c-amber { --tg: #f5c04a; }
:root[data-theme="dark"] .utag.c-green { --tg: #57d07a; }
:root[data-theme="dark"] .utag.c-teal { --tg: #3fd1c8; }
:root[data-theme="dark"] .utag.c-blue { --tg: #64a8ff; }
:root[data-theme="dark"] .utag.c-indigo { --tg: #8f8fff; }
:root[data-theme="dark"] .utag.c-violet { --tg: #c084fc; }
:root[data-theme="dark"] .utag.c-pink { --tg: #ff73b3; }
:root[data-theme="dark"] .utag.c-gray { --tg: #a3abb8; }
.msg-who { display: flex; align-items: center; gap: 8px 14px; max-width: 100%; }
.msg-who > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-who .utag { height: 20px; padding: 0 8px; font-size: 11.5px; }
.bubble > .msg-who .utag { margin-inline-start: auto; }      /* тег — у правого края пузыря, как в Telegram */

/* ---------------------------------------------------------------- скрепка и окно «отправить» */
.att-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
  transition: background-color .12s ease-out, color .12s ease-out;
}
.att-btn:hover { color: var(--accent); background: var(--surface); }
.chat-desk .att-btn:hover { background: var(--bg); }
.dialog .box.att-dlg .pop-body { padding: 4px 20px 20px; }
.att-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 12px; }
.att-it { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--surface); }
.att-it img, .att-it video { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-it.file { grid-column: 1 / -1; aspect-ratio: auto; display: flex; align-items: center; gap: 10px; padding: 10px; padding-inline-end: 44px; }
.att-it.file .grow { min-width: 0; display: flex; flex-direction: column; }
.att-it.file b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-it.file small { color: var(--text-2); font-size: 13px; }
.att-x {
  position: absolute; top: 6px; inset-inline-end: 6px; z-index: 1; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); color: #fff;
}
.att-it.file .att-x { top: 50%; transform: translateY(-50%); background: var(--surface-2); color: var(--text-2); }
.att-play {
  position: absolute; inset: 0; margin: auto; width: 36px; height: 36px; border-radius: 50%; pointer-events: none;
  display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); color: #fff;
}
.att-cap { width: 100%; resize: none; margin-bottom: 12px; }

/* ---------------------------------------------------------------- фото, видео, документ в переписке */
/* фото и видео — во весь пузырь, без рамки (как в Telegram); подпись — под фото в том же пузыре и по его ширине */
.bubble.k-photo, .bubble.k-video { padding: 0; overflow: hidden; width: min-content; }
.bubble.k-photo .mph, .bubble.k-video .mph { border-radius: 0; }
.chat-desk .mph { width: min(360px, 34vw); max-height: 460px; }
.bubble.k-photo > .msg-who, .bubble.k-video > .msg-who, .bubble.k-photo > .fwd, .bubble.k-video > .fwd { margin: 7px 12px 5px; }
.bubble.k-photo > .quote, .bubble.k-video > .quote { width: auto; margin: 8px 8px 6px; }
.bubble.k-file { padding: 6px; }
.mph {
  position: relative; display: block; width: min(280px, 68vw); max-height: 380px; min-height: 90px; border-radius: 15px; overflow: hidden;
  background: var(--surface-2) center / cover no-repeat;
}
.mph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mph-play {
  position: absolute; inset: 0; margin: auto; width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.mph-dur { position: absolute; top: 8px; inset-inline-start: 8px; padding: 2px 7px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; font-weight: 600; }
.bubble .txt.cap { padding: 7px 12px 8px; }
.bubble.k-file .txt.cap { padding: 4px 6px 2px; }
.bubble.k-file > .msg-who { margin: 2px 6px 4px; }
/* перетаскивание файлов в переписку: две белые зоны (без сжатия / быстро) или одна (файлы) */
.drop { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; gap: 14px; padding: 14px; background: rgba(20, 14, 10, .25); }
.drop.in-thread { inset: auto; border-radius: 20px; }
.drop-z {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px;
  border-radius: 14px; background: var(--bg); box-shadow: 0 4px 18px rgba(30, 20, 10, .16); color: var(--text-3); text-align: center;
  transition: color .12s ease-out;
}
.drop-z * { pointer-events: none; }
.drop-z b { font-size: clamp(20px, 2.4vw, 28px); font-weight: 600; letter-spacing: -.01em; }
.drop-z span { font-size: clamp(15px, 1.5vw, 18px); font-weight: 600; }
.drop-z.on { color: var(--accent); }
.fmsg { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: min(320px, 72vw); padding: 4px 6px; border-radius: 12px; text-align: start; color: var(--text); }
.fmsg .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fmsg b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmsg small { font-size: 12.5px; color: var(--text-2); }
.fmsg > .i { flex: none; color: var(--accent); }
.fic {
  width: 42px; height: 42px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; color: #fff; background: #6b625a;
}
.fic.t-red { background: #c53030; }
.fic.t-blue { background: #2f5fc4; }
.fic.t-green { background: #237a4a; }
.fic.t-orange { background: #c2611b; }
.fic.t-amber { background: #a8761a; }

/* ---------------------------------------------------------------- просмотр фото и видео на весь экран */
.viewer {
  position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column;
  background: #000; color: #fff; opacity: 0; transition: opacity .18s ease-out;
}
.viewer.show { opacity: 1; }
.vw-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-top) + 8px) 8px 8px; }
.vw-top .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vw-top b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vw-top small { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.vw-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.vw-btn:hover { background: rgba(255, 255, 255, .12); }
.vw-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: center / contain no-repeat; }
.vw-stage img, .vw-stage video { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.vw-stage.ready { background-image: none !important; }
.vw-stage .spin { position: absolute; }
.vw-stage.ready .spin { display: none; }
.vw-stage.circ video { width: min(90vw, 70vh); aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.vw-nav {
  position: absolute; top: 50%; z-index: 2; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .12); color: #fff;
}
.vw-nav.prev { inset-inline-start: 12px; }
.vw-nav.next { inset-inline-end: 12px; }
.vw-nav:hover { background: rgba(255, 255, 255, .22); }
.vw-cap { padding: 10px 16px calc(var(--safe-bottom) + 14px); font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 30vh; overflow-y: auto; }
@media (hover: none) { .vw-nav { display: none; } }        /* на телефоне листают свайпом */

/* ---------------------------------------------------------------- профиль группы */
.gi { max-width: 640px; margin: 0 auto; padding-bottom: 24px; }
.gi-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 4px 16px 18px; }
.gi-ava { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent); color: var(--on-accent); }
.gi-ava .i { width: 46px; height: 46px; }
.gi-hero h2 { margin: 12px 0 2px; font-size: 22px; font-weight: 700; }
.gi-sub { color: var(--text-2); font-size: 14px; }
.gi-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.gi-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 64px; min-width: 0;
  border-radius: 14px; background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 600;
  transition: transform .12s ease-out, background-color .12s ease-out;
}
.gi-act span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.gi-act .i { color: var(--accent); }
.gi-act:active { transform: scale(.97); }
.gi-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.gi-tabs { display: flex; gap: 4px; padding: 6px; overflow-x: auto; scrollbar-width: none; }
.gi-tabs::-webkit-scrollbar { display: none; }
.gi-tabs button { flex: 1 0 auto; height: 34px; padding: 0 10px; border-radius: 17px; font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.gi-tabs button.on { background: var(--accent-soft); color: var(--accent-ink); }
.gi-body { padding: 0 6px 6px; }
.gi-list { display: flex; flex-direction: column; }
.gi-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border-radius: 12px; text-align: start; color: var(--text); }
.gi-row .grow { flex: 1; min-width: 0; }
.gi-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-row .sub { font-size: 13.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-row .sub.on { color: var(--read); }
.gi-row > .i { flex: none; color: var(--text-3); }
.gi-vic { width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.gi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; border-radius: 12px; overflow: hidden; }
.gi-cell { position: relative; aspect-ratio: 1; background: var(--surface-2) center / cover no-repeat; }
.gi-cell.k-circle { margin: 6px; border-radius: 50%; }
.gi-dur {
  position: absolute; bottom: 5px; inset-inline-start: 5px; display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 9px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11.5px; font-weight: 600;
}
.gi-cell.k-circle .gi-dur { inset-inline-start: 50%; transform: translateX(-50%); }
.gi-empty { margin: 0; padding: 28px 12px; text-align: center; }
.gi-more { margin-top: 8px; }
.gi .skeleton.gi-sk { height: 56px; margin: 0 0 6px; }
@media (hover: hover) {
  .gi-act:hover { background: var(--surface-2); }
  .gi-row:hover { background: var(--bg); }
}
/* шапка общего чата на ПК — нажимается, открывает профиль группы */
.th-group { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 2px; border-radius: 12px; text-align: start; color: var(--text); }
.th-group .grow { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- группы: служебные строки, создание, профиль */
.sys-msg { display: flex; justify-content: center; margin: 10px 0; position: relative; z-index: 1; }
.sys-msg span {
  max-width: 86%; padding: 4px 12px; border-radius: 12px; text-align: center; overflow-wrap: anywhere;
  background: color-mix(in srgb, var(--surface) 90%, transparent); color: var(--text-2); font-size: 12.5px; font-weight: 500;
}
.ng-start { margin: 4px 0 10px; }
.ng-top { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.ng-top .input { flex: 1; min-width: 0; }
.ng-photo {
  width: 64px; height: 64px; flex: none; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent);
}
.ng-photo img { width: 100%; height: 100%; object-fit: cover; }
.ng-nophoto { margin: 0 0 6px; font-size: 13px; }
.ng-sec { margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.dialog .box.ng-dlg .pop-body { padding: 4px 20px 20px; }
.ng-pick { max-height: 44vh; overflow-y: auto; margin-top: 8px; }
.ng-person { position: relative; cursor: pointer; }
.ng-person input { position: absolute; opacity: 0; pointer-events: none; }
.ng-tick {
  width: 24px; height: 24px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px var(--surface-2); color: transparent; transition: background-color .12s ease-out;
}
.ng-person input:checked ~ .ng-tick { background: var(--accent); box-shadow: none; color: var(--on-accent); }
.ng-person:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.gi-acts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gi-act.danger, .gi-act.danger .i { color: var(--danger); }
.gi-edit { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 16px; color: var(--accent); font-size: 13.5px; font-weight: 600; }
.gi-addrow {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 14px; padding: 14px 16px;
  border-radius: var(--radius); background: var(--surface); color: var(--accent); font-weight: 600; text-align: start;
}
.gi-own { flex: none; font-size: 12.5px; color: var(--text-3); }
@media (hover: hover) {
  .gi-edit:hover { background: var(--surface); }
  .gi-addrow:hover { background: var(--surface-2); }
}
/* ---------------------------------------------------------------- пузыри поверх фона (как в Telegram):
   у собеседника — белые с лёгкой тенью, мои — зелёные, цвета исходящих Telegram (решение владельца 23.10) */
.walled .msg:not(.mine) .bubble { background: #fff; box-shadow: 0 1px 2px rgba(70, 42, 18, .16); }
.walled .msg.mine .bubble { background: var(--out-bg); box-shadow: 0 1px 2px rgba(70, 42, 18, .16); }
.walled .bubble.k-circle, .walled .bubble.jumbo { box-shadow: none !important; }
.walled .msg-body > .msg-who > span:first-child { text-shadow: 0 0 4px rgba(255, 255, 255, .9); }
:root[data-theme="dark"] .walled .msg:not(.mine) .bubble { background: #2b231d; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .walled .msg.mine .bubble { box-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
:root[data-theme="dark"] .walled .msg-body > .msg-who > span:first-child { text-shadow: 0 0 4px rgba(0, 0, 0, .8); }
/* цвета моих пузырей: фон и зелёный акцент исходящих Telegram (#effdde / #4fae4e), подпись цитаты темнее — читается;
   в тёмной теме у Telegram зелёного нет — свой тёмно-зелёный в ту же гамму */
:root { --out-bg: #effdde; --out-acc: #4fae4e; --out-ink: #3a8e26; --out-soft: rgba(79, 174, 78, .14); }
:root[data-theme="dark"] { --out-bg: #2d4a2b; --out-acc: #6cc264; --out-ink: #9bd893; --out-soft: rgba(108, 194, 100, .16); }
/* всё, что внутри моего пузыря и было оранжевым/синим, — зелёное, как в Telegram */
.msg.mine .quote { background: var(--out-soft); box-shadow: inset 3px 0 0 var(--out-acc); }
[dir="rtl"] .msg.mine .quote { box-shadow: inset -3px 0 0 var(--out-acc); }
.msg.mine .quote b, .msg.mine .fwd, .msg.mine .fmsg > .i { color: var(--out-ink); }
.msg.mine .vplay { background: var(--out-acc); color: #fff; }
.msg.mine .vmsg.loading .vplay .spin { color: #fff; }
.msg.mine .vmeta { color: var(--out-ink); }
.msg.mine .vspeed, .msg.mine .vtx, .msg.mine .vtx.done { background: var(--out-soft); color: var(--out-ink); }

/* ---------------------------------------------------------------- вкладка «Новости»: лента подразделения (как канал)
   Окно как у чата на ПК — лента листается внутри него; сверху название подразделения или переключатель (если их
   несколько) и колокольчик: уведомления каждой ленты — свои. Телефон: высоту до нижней панели задаёт fitNews(). */
.chat-desk.news-box { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.dbody .chat-desk.news-box { display: flex; height: calc(100vh - 112px); max-width: 960px; margin: 0 auto; }
.content:has(.news-box) { padding-bottom: 0; }
.news-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.news-head .sel-row { flex: 1; }
.news-chips { flex: 1; min-width: 0; margin: 0; padding: 0; }
.news-chips .chip .i { opacity: .7; }
.chip-n { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; font-style: normal; line-height: 18px; text-align: center; }
.chip.on .chip-n { background: var(--on-accent); color: var(--accent); }
.news-one { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* уведомления этой ленты — колокольчик прямо на фоне, справа сверху, без подложки (просьба владельца 30.10);
   под закреплённым — ниже его */
.news-bell-wrap { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 4; }
.msgs-wrap:has(#pinWrap .pin-bar) .news-bell-wrap { top: 72px; }
.news-bell { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #111; }
/* белая обводка ~1,5 px — четыре тени без размытия вокруг линий значка */
.news-bell .i { width: 24px; height: 24px; stroke-width: 2.2;
  filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff); }
.news-bell.off { color: #111; opacity: .85; }
.news-bell:active { background: rgba(0, 0, 0, .06); }
.news-thread { flex: 1; min-height: 0; }
/* фон ленты — со скруглёнными углами внутри рамки (раньше верхние углы торчали квадратом) */
.news-box .msgs-wrap { margin-top: 6px; border-radius: 12px; overflow: hidden; }
.news-box .news-thread.ro .msgs-wrap { margin-bottom: 6px; }
html.desk .chat-desk.news-box .chat-thread { padding: 0 10px; }
html.desk .news-box .msgs-wrap { margin-top: 10px; border-radius: 14px; }
html.desk .news-box .news-thread.ro .msgs-wrap { margin-bottom: 10px; }
html.desk .news-box .composer { padding: 10px 2px 12px; }
html:not(.desk) .news-box .chat-thread { padding: 0 6px; border-radius: 16px; }
html:not(.desk) .news-box .msg { max-width: 86%; }
html:not(.desk) .news-box .composer { padding: 8px 0 10px; }
.news-none { margin-top: 48px; text-align: center; color: var(--text-2); }
.news-none .i { width: 40px; height: 40px; color: var(--text-3); }
/* шесть-семь кнопок внизу — подписи мельче, чтобы «Actualités» и «Bénévoles» не слипались */
.tabbar.many button { font-size: 11px; }
/* длинная подпись («Notifications», «Уведомления») берёт ширину у коротких, а не налезает на соседнюю */
.tabbar.many button { flex: 1 1 auto; min-width: 0; padding-inline: 1px; }
.tabbar.n7 button { font-size: 10px; }
.tabbar button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* окно языка перевода: поиск на лету; рядом с названием — самоназвание языка */
.tr-lang-find { margin: 0 14px 8px; border-width: 0; }
.tr-langs button small { font-weight: 400; margin-inline-start: 6px; }
.tr-lang-none { padding: 8px 4px; }
.vtxt small .linkbtn { font-size: inherit; }
