/* WX Messenger — вид как у Telegram: светлая и тёмная тема по системе, телефон — чаты и переписка по очереди */
:root {
  --bg: #fff; --side: #fff; --chat-bg: #e7ebf0; --line: #e3e6ea; --text: #0f1419; --muted: #707579; --accent: #3390ec;
  --mine: #e3fee0; --other: #fff; --mine-time: #5ca853; --hover: #f4f4f5; --on: #3390ec; --badge: #3390ec; --input: #f1f3f4; --pinned: #f6f6f7;
}
/* Тёмная тема: по системе (пока в «Оформлении» не выбрана светлая) или выбрана явно */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #212121; --side: #212121; --chat-bg: #0f0f0f; --line: #2f2f2f; --text: #f5f5f5; --muted: #aaa; --accent: #8774e1;
    --mine: #766ac8; --other: #212121; --mine-time: #e0dcff; --hover: #2c2c2c; --on: #766ac8; --badge: #8774e1; --input: #181818; --pinned: #262626; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #212121; --side: #212121; --chat-bg: #0f0f0f; --line: #2f2f2f; --text: #f5f5f5; --muted: #aaa; --accent: #8774e1;
  --mine: #766ac8; --other: #212121; --mine-time: #e0dcff; --hover: #2c2c2c; --on: #766ac8; --badge: #8774e1; --input: #181818; --pinned: #262626; color-scheme: dark; }
/* Фон чата из «Оформления» */
:root[data-bg] .chat, :root[data-bg] .msgs { background: var(--chat-bg-own); }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { height: var(--app-h, 100%); overflow: hidden; }
body { position: fixed; left: 0; right: 0; top: var(--app-top, 0px); height: var(--app-h, 100%); }
.join { overflow-y: auto; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; overflow: hidden;
  /* iPhone: вырез и полоска «Домой» — содержимое не залезает под них (приложение с экрана «Домой») */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
/* iOS увеличивает страницу при вводе, если шрифт поля меньше 16px */
input, textarea, select { font-size: 16px; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }

.join { min-height: 100%; display: grid; place-items: center; padding: 16px; background: var(--chat-bg); }
body:has(.join) { background: var(--chat-bg); }
.join-card { width: min(400px, 100%); background: var(--bg); border-radius: 16px; padding: 32px 24px; text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.join-card .logo { width: 88px; height: 88px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font: 700 30px/1 sans-serif; }
.join-card h1 { margin: 0 0 8px; font-size: 22px; }
.join-card p { color: var(--muted); margin: 0 0 16px; }
.join-card input { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); text-align: center; font-size: 22px; letter-spacing: 3px; text-transform: uppercase; }
.join-card button { width: 100%; margin-top: 12px; padding: 14px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 600; }
.join-card .err { color: #e53935; min-height: 1.4em; margin: 10px 0 0; }
.small { font-size: 13px; color: var(--muted); }

.app { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); height: 100%; height: calc(var(--app-h, 100dvh) - env(safe-area-inset-top)); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.side { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--side); min-width: 0; }
.top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 56px; border-bottom: 1px solid var(--line); background: var(--bg); }
.icon { border: 0; background: none; color: var(--muted); font-size: 20px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon:hover { background: var(--hover); }
.search { flex: 1; min-width: 0; padding: 9px 16px; border: 1px solid transparent; border-radius: 22px; background: var(--input); outline: none; }
.search:focus { border-color: var(--accent); background: var(--bg); }
.chats { flex: 1; overflow-y: auto; padding: 6px; }
.row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.row:hover { background: var(--hover); }
.row.on { background: var(--on); color: #fff; }
.row.on .p span, .row.on time { color: rgba(255,255,255,.85); }
.ava { width: 54px; height: 54px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 18px; flex: none; }
.ava.sm { width: 40px; height: 40px; font-size: 15px; }
.mid { flex: 1; min-width: 0; }
.mid .t, .mid .p { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.mid b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mid time { font-size: 12px; color: var(--muted); flex: none; }
.mid .p span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.mid .p i { font-style: normal; background: var(--badge); color: #fff; border-radius: 12px; min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; font-weight: 600; display: grid; place-items: center; flex: none; }
.none { color: var(--muted); text-align: center; padding: 32px 16px; }
/* Вкладки внизу списка: Чаты, Звонки, Настройки */
.tabs { display: flex; border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border: 0; background: none; color: var(--muted); font-size: 11px; cursor: pointer; }
.tabs button.on { color: var(--accent); }
.tab-ttl { flex: 1; font-size: 17px; padding-left: 4px; }
.pane { flex: 1; overflow-y: auto; padding: 6px; }
.settings { display: flex; flex-direction: column; gap: 8px; padding: 14px 12px; }
.settings[hidden], .calls[hidden], .chats[hidden] { display: none; }
.settings h2 { margin: 0 0 4px; font-size: 19px; overflow-wrap: anywhere; }
.settings .wide { text-align: left; }
.call-row .recall { flex: none; color: var(--accent); }
.top [hidden] { display: none; }
.call-row.missed .p span { color: #e53935; }
.empty-tab { padding: 24px 12px; text-align: center; }
/* Выбор нескольких чатов */
.selbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 56px; border-bottom: 1px solid var(--line); background: var(--bg); }
.selbar b { font-size: 17px; }
.sel-mode .side .top, .sel-mode .side .tabs { display: none; }
.selacts { display: flex; border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.selacts button { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 5px; border: 0; background: none; color: var(--accent); font-size: 11px; cursor: pointer; }
.selacts button.danger { color: #e53935; }
.selacts button:disabled { opacity: .4; cursor: default; }
html.app-android .selacts { padding-bottom: 0; }
.row.picked { background: var(--hover); }
.row.picked .ava::after { content: '✓'; position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--chat-bg); }
.chat.empty { display: grid; place-items: center; }
.placeholder { background: rgba(0,0,0,.2); color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 14px; }
.chat .back { display: none; }
.ttl { display: flex; flex-direction: column; min-width: 0; }
.ttl b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttl small { color: var(--muted); }
.msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 12px max(12px, calc((100% - 760px) / 2)); display: flex; flex-direction: column; gap: 4px; }
.day { text-align: center; margin: 8px 0; }
.day span { background: rgba(0,0,0,.25); color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 13px; }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.bub { max-width: min(560px, 85%); background: var(--other); border-radius: 14px 14px 14px 4px; padding: 6px 10px 6px; box-shadow: 0 1px 1px rgba(0,0,0,.08); overflow-wrap: anywhere; position: relative; }
.mine .bub { background: var(--mine); border-radius: 14px 14px 4px 14px; }
.bub time { float: right; font-size: 11px; color: var(--muted); margin: 6px 0 -2px 10px; }
.mine .bub time { color: var(--mine-time); }
.who { display: block; font-size: 13px; margin-bottom: 2px; }
.txt a { color: var(--accent); }
.quote { border-left: 3px solid var(--accent); padding: 2px 8px; margin-bottom: 4px; font-size: 13px; background: rgba(51,144,236,.08); border-radius: 4px; display: flex; flex-direction: column; }
.quote span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img { min-width: 120px; min-height: 80px; display: grid; place-items: center; color: var(--muted); cursor: zoom-in; }
.img img { display: block; max-width: 100%; max-height: 360px; border-radius: 10px; }
.file { display: flex; gap: 10px; align-items: center; color: inherit; text-decoration: none; }
.file .fi { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 20px; flex: none; }
.file small { display: block; color: var(--muted); }
.reply-bar[hidden] { display: none; }
.reply-bar { display: flex; gap: 8px; align-items: center; padding: 6px 12px; background: var(--bg); border-top: 1px solid var(--line); }
.reply-bar div { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 8px; display: flex; flex-direction: column; font-size: 13px; }
.reply-bar span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose { display: flex; align-items: flex-end; gap: 6px; padding: 8px max(8px, calc((100% - 776px) / 2)); padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.compose .ta { flex: 1; min-width: 0; resize: none; border: 0; outline: none; background: var(--input); border-radius: 20px; padding: 10px 14px; max-height: 160px; }
.compose .send { color: var(--accent); }
.attach { cursor: pointer; }

.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: grid; place-items: center; padding: 16px; z-index: 10; }
.modal { width: min(440px, 100%); max-height: 86vh; overflow-y: auto; background: var(--bg); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.modal h2 { margin: 0; font-size: 19px; overflow-wrap: anywhere; }
.modal .search { flex: none; }
.modal > * { flex-shrink: 0; } /* длинное окно прокручивается целиком, а не сжимает списки внутри */
.gname { padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); }
.people { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.person { display: flex; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 10px; cursor: pointer; }
.person:hover { background: var(--hover); }
.person span { display: flex; flex-direction: column; min-width: 0; }
.person small { color: var(--muted); }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions button, .wide { border: 0; border-radius: 10px; padding: 10px 16px; background: var(--hover); color: var(--text); }
.actions .ok { background: var(--accent); color: #fff; }
.code { font-size: 22px; letter-spacing: 2px; color: var(--text); }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 20; max-width: calc(100% - 32px); }
.test-note { position: fixed; right: 8px; bottom: 4px; font-size: 11px; color: var(--muted); pointer-events: none; opacity: .7; }

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app .chat, .app .chat.empty { display: none; }
  .in-chat .side { display: none; }
  .in-chat .app .chat { display: flex; }
  .chat .back { display: grid; }
  .test-note { display: none; }
}

.ios-hint { text-align: left; background: #fff7e0; color: #5c4400; border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; }
.ios-hint ol { margin: 6px 0; padding-left: 20px; }
.ios-hint small { color: #7a6200; }
.ios-hint .share { display: inline-block; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; font-size: 12px; }
@media (prefers-color-scheme: dark) { .ios-hint { background: #3a3220; color: #f3e2b3; } .ios-hint small { color: #d9c690; } }

.sys { text-align: center; margin: 6px 0; }
.sys span { display: inline-block; max-width: 85%; background: rgba(0,0,0,.18); color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.left-note { padding: 14px; text-align: center; color: var(--muted); background: var(--bg); border-top: 1px solid var(--line); }
.ginfo-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; } .ginfo-t { flex: 1; min-width: 0; } .ginfo-t h2 { margin: 0; overflow-wrap: anywhere; } .ginfo-t .small { margin: 2px 0 0; }
.person .rm { margin-left: auto; width: 32px; height: 32px; font-size: 14px; }
.actions .leave { color: #e53935; }

.profile { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ava.big { width: 88px; height: 88px; font-size: 30px; }
.profile .about { margin: 0; color: var(--text); font-style: italic; }
.profile dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; text-align: left; width: 100%; margin: 8px 0 0; }
.profile dt { color: var(--muted); } .profile dd { margin: 0; overflow-wrap: anywhere; } .profile a { color: var(--accent); }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.fld input { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--text); }
.who, .people .person span { cursor: pointer; }
.fld .ro { color: var(--text); font-size: 15px; padding: 4px 0; }

.ctx-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.25); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ctx { position: fixed; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 16px); }
.rbar { display: flex; gap: 2px; background: var(--bg); border-radius: 28px; padding: 6px 8px; box-shadow: 0 4px 20px rgba(0,0,0,.15); overflow-x: auto; }
.rbar button { border: 0; background: none; font-size: 26px; padding: 2px 4px; border-radius: 50%; }
.items { display: flex; flex-direction: column; background: var(--bg); border-radius: 14px; box-shadow: 0 4px 20px rgba(0,0,0,.15); overflow: hidden; min-width: 220px; align-self: flex-start; }
.items button { border: 0; background: none; text-align: left; padding: 12px 16px; font-size: 16px; color: var(--text); display: flex; align-items: center; gap: 14px; }
.items button svg { flex: none; opacity: .75; }
.items button + button { border-top: 1px solid var(--line); }
.items .danger { color: #e53935; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rx { border: 0; border-radius: 12px; padding: 2px 8px; font-size: 13px; background: rgba(51,144,236,.12); color: var(--text); }
.rx.on { background: var(--accent); color: #fff; }
.txt.del { font-style: italic; color: var(--muted); }
.fwd { font-size: 13px; color: var(--accent); margin-bottom: 2px; }
.pinned { display: flex; flex-direction: column; padding: 6px 14px; background: var(--bg); border-bottom: 1px solid var(--line); border-left: 3px solid var(--accent); cursor: pointer; font-size: 13px; }
.pinned[hidden] { display: none; }
.pinned b { color: var(--accent); } .pinned span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.flash .bub { box-shadow: 0 0 0 3px var(--accent); transition: box-shadow .3s; }
.fwd-to { border: 0; background: none; width: 100%; text-align: left; color: var(--text); }
.msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Долгое нажатие на iPhone не выделяет текст и эмодзи в меню */
.ctx-wrap, .ctx-wrap *, .rx, .chats, .top { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.row { position: relative; touch-action: pan-y; background: var(--side); will-change: transform; }
.row.on { background: var(--on); }
.muted { display: inline-flex; vertical-align: -1px; color: var(--muted); margin-left: 4px; }
.row.on .muted { color: #fff; }
.mid .p i.grey { background: #a0a4a8; }
.opts { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.opts button { border: 0; background: var(--bg); color: var(--text); text-align: left; padding: 13px 16px; font-size: 16px; }
.opts button + button { border-top: 1px solid var(--line); }
.opts .danger { color: #e53935; }
.dnd-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #fff7e0; color: #5c4400; font-size: 14px; }
.dnd-bar button { margin-left: auto; border: 0; background: none; color: var(--accent); font-weight: 600; }
@media (prefers-color-scheme: dark) { .dnd-bar { background: #3a3220; color: #f3e2b3; } }

.rw { position: relative; border-radius: 12px; overflow: hidden; }
.acts { position: absolute; inset: 0 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.acts button { width: 76px; height: 58px; border: 0; border-radius: 16px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; }
.acts span { white-space: nowrap; }
.a-mute { background: #f0a030; } .a-del { background: #ff3b30; } .a-arch { background: #a8adb4; }
.row { transition: transform .2s; }
.arch-row { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; cursor: pointer; }
.arch-row:hover { background: var(--hover); }
.arch-row.back { justify-content: space-between; color: var(--accent); }
.ava.arch { background: #a8adb4; }

.acts-l { position: absolute; inset: 0 auto 0 0; display: flex; align-items: center; gap: 6px; padding: 0 8px; }
.acts-l button { width: 76px; height: 58px; border: 0; border-radius: 16px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; }
.a-unread { background: #2f8cf0; } .a-pin { background: #22c55e; }
.row.open { transform: translateX(-252px); }
.row.open-l { transform: translateX(92px); }

.ava { position: relative; }
.online { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; border-radius: 50%; background: #3390ec; border: 2px solid var(--side); }
.ttl small.on, .seen.on { color: var(--accent); }
.state { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 10px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.opts .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 10px; }

.tk { display: inline-flex; vertical-align: -1px; margin-left: 3px; color: var(--mine-time); }
.tk.read { color: #3b9ae1; }
@media (prefers-color-scheme: dark) { .tk.read { color: #9fd0ff; } }

.wxlogo { font: 800 17px/1 -apple-system, sans-serif; color: #fff; letter-spacing: -.5px; }
.ava.sm .wxlogo { font-size: 13px; }
/* Копия переписки: пароль восстановления */
.modal form { display: flex; flex-direction: column; gap: 10px; }
.modal .f-name, .modal .f-from, .modal .f-days, .modal .f-title { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--text); font-size: 16px; }
.modal .chk { display: flex; align-items: center; gap: 8px; }
.modal .qr { display: flex; justify-content: center; } .modal .qr img { border-radius: 12px; background: #fff; }
.modal .link { overflow-wrap: anywhere; user-select: all; }
.modal input[type=password] { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--input); color: var(--text); font-size: 16px; }
.modal .err { color: #e53935; margin: 0; min-height: 1.2em; font-size: 14px; }
.actions .primary { background: var(--accent); color: #fff; }
.actions button:disabled { opacity: .6; }
/* Кнопки бота под сообщением */
.kb { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.kb-row { display: flex; gap: 6px; }
.kb-btn { flex: 1; min-width: 0; border: 0; border-radius: 10px; padding: 8px 10px; background: var(--hover); color: var(--accent); font-weight: 600; overflow-wrap: anywhere; line-height: 1.25; }
.kb-btn:disabled { opacity: .6; }
/* Клавиатура открыта: полоски «Домой» под строкой ввода нет — без её отступа */
html.kb .compose { padding-bottom: 8px; }
/* Список чатов: тонкая линия между чатами (от текста, как в Telegram), закреплённые — светло-серым */
.rw:not(:last-child) .row::after { content: ''; position: absolute; left: 74px; right: 10px; bottom: 0; height: 1px; background: var(--line); }
.rw .row.on::after, .rw:has(+ .rw .row.on) .row::after { display: none; }
.row.pc { background: var(--pinned); }
.row.pc:hover { background: var(--hover); }
/* Оформление: образцы фона */
.bg-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.bg-opts button { aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.bg-opts button.on { border-color: var(--accent); }
.row.pc.on { background: var(--on); }
.arch-row:not(.back) { position: relative; }
.arch-row:not(.back)::after { content: ''; position: absolute; left: 74px; right: 10px; bottom: 0; height: 1px; background: var(--line); }
/* Белый фон чата: входящие сообщения — светло-серые (иначе сливаются с фоном), как в Telegram */
:root[data-bg="white"] .msg:not(.mine) .bub { background: #f1f1f4; color: #0f1419; }
:root[data-bg="white"] .day span, :root[data-bg="white"] .sys span { background: #eceef1; color: #5f6368; }
/* Мышь (компьютер): подсветка пунктов меню сообщения и реакций при наведении; на телефоне наведения нет */
@media (hover: hover) {
  .items button:hover { background: var(--hover); }
  .items button.danger:hover { background: rgba(229, 57, 53, .08); }
  .rbar button { transition: transform .12s, background .12s; }
  .rbar button:hover { background: var(--hover); transform: scale(1.18); }
  .opts button:hover, .kb-btn:hover, .wide:hover, .actions button:hover { filter: brightness(.96); }
}
/* Поиск: раздел «Сообщения» в списке, строка поиска в чате */
.sect { padding: 10px 16px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mk { color: var(--accent); font-weight: 600; }
.row.on .mk { color: #fff; }
.chat .top .find { margin-left: auto; }
.find-bar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.find-bar[hidden] { display: none; }
.find-q { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--input); outline: none; }
.find-n { font-size: 13px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
/* Голосовые: запись и прослушивание */
.compose[hidden] { display: none; }
.rec-bar { display: flex; align-items: center; gap: 10px; padding: 10px max(12px, calc((100% - 776px) / 2)); padding-bottom: max(10px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
html.kb .rec-bar { padding-bottom: 10px; }
/* Android-приложение: отступы под системные панели — у оболочки */
html.app-android .compose { padding-bottom: 8px; }
html.app-android .rec-bar { padding-bottom: 10px; }
html.app-android .tabs { padding-bottom: 0; }
html.app-android .app { height: 100%; } /* = высота body (под оболочкой, без env-отступа сверху) */
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #e53935; animation: recblink 1s infinite; flex: none; }
@keyframes recblink { 50% { opacity: .3; } }
.rec-t { font-variant-numeric: tabular-nums; min-width: 40px; }
.rec-hint { flex: 1; color: var(--muted); font-size: 14px; }
.rec-bar button { border: 0; border-radius: 18px; padding: 8px 14px; background: var(--hover); color: var(--text); }
.rec-bar .rec-send { background: var(--accent); color: #fff; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; padding: 2px 0; }
.vplay { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.mine .vplay { background: var(--mine-time); }
.vbar { flex: 1; height: 4px; border-radius: 2px; background: rgba(0,0,0,.12); overflow: hidden; }
.vbar i { display: block; height: 100%; width: 0; background: var(--accent); }
.mine .vbar i { background: var(--mine-time); }
.vdur { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Звонок */
.call-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(15, 20, 25, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; }
.call-card { width: min(360px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-align: center; }
.call-card h2 { margin: 6px 0 0; font-size: 22px; overflow-wrap: anywhere; }
.call-st { color: rgba(255,255,255,.75); font-variant-numeric: tabular-nums; min-height: 1.4em; }
.ava.big { width: 112px; height: 112px; font-size: 38px; }
.call-btns { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.call-btns button { border: 0; border-radius: 26px; padding: 13px 20px; font-size: 16px; background: rgba(255,255,255,.16); color: #fff; }
.call-btns .cb-acc { background: #16a34a; }
.call-btns .cb-dec, .call-btns .cb-end { background: #e53935; }
.chat .top .call { margin-left: auto; }
.chat .top .call + .find { margin-left: 0; }
/* Фото сотрудников */
.ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.photo-fld { display: flex; align-items: center; gap: 14px; }
.photo-fld .wide { display: inline-block; margin: 0 6px 6px 0; }
/* Строка ввода (contenteditable): растёт до 160 px, дальше прокрутка; подсказка, пока пусто */
.compose .ta { max-height: 160px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.35; -webkit-user-select: text; user-select: text; cursor: text; }
.compose .ta:empty::before { content: attr(data-ph); color: var(--muted); pointer-events: none; }
/* Кнопка отправки крупнее (палец не промахивается мимо неё к панели Safari) */
.compose .send { width: 46px; height: 46px; }
.fld.chk { display: flex; flex-direction: row; align-items: center; gap: 10px; font-size: 15px; color: var(--text); margin: 6px 0; cursor: pointer; }
.fld.chk input { padding: 0; margin: 0; width: 20px; height: 20px; flex: none; accent-color: var(--accent, #3390ec); }

/* Исчезающие сообщения и защита от снимков экрана (владелец 24.10) */
.top .mode { position: relative; }
.chat .top .mode { margin-left: auto; }
.chat .top .call ~ .mode, .chat .top .mode ~ .find { margin-left: 0; }
.top .mode.on { color: var(--accent, #2a8bf2); }
.top .mode small { position: absolute; right: 0; bottom: 2px; font-size: 9px; font-weight: 700; line-height: 1; background: var(--bg, #fff); border-radius: 4px; padding: 0 2px; }
.bub time .left { font-style: normal; margin-right: 2px; white-space: nowrap; }
.bub time .left svg { vertical-align: -1px; }
.modal .radios { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.modal .radios label, .modal .chk { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.modal .hint { font-size: 13px; color: var(--muted); margin: 6px 0; }
body.shield .msgs { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.shield.shield-blur .chat .msgs, body.shield.shield-blur .chat .pinned, body.shield.shield-blur .chat .reply-bar { filter: blur(18px); transition: filter .05s; }
@media print { body.shield .chat .msgs, body.shield .chat .pinned { visibility: hidden; } }
