/* © 2026 VanlifeFabrika, ALT — SPDX-License-Identifier: AGPL-3.0-or-later */
/* Onest (OFL) — гротеск, сделанный для кириллицы; файлы лежат на сервере, интернет не нужен */
@font-face { font-family: Onest; src: url('/fonts/onest-cyrillic-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: Onest; src: url('/fonts/onest-cyrillic-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: Onest; src: url('/fonts/onest-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Onest; src: url('/fonts/onest-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Inter; src: local('Inter'), url('/fonts/Inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
:root {
  /* ===== токены ALT 1.27 (одно оформление, день / ночь; значения — ux/report-design.md 3.2) ===== */
  --bg: #F3F5F9; --surface: #FFFFFF; --surface2: #E8ECF3; --surface3: #DCE2EC;
  --border: #D5DCE8; --border-strong: #7C8798;
  --text: #101A2C; --text2: #475569; --muted: #5F6B82;
  --accent: #2B5FE0; --accent-fill: #2B5FE0; --on-accent: #FFFFFF; --accent-soft: rgba(43, 95, 224, .12);
  --near: #0F7A52; --near-soft: rgba(15, 122, 82, .12);
  --air: #A85A00; --air-fill: #F59E0B; --on-air: #1C1200; --air-soft: rgba(245, 158, 11, .18);
  --danger: #C8102E; --danger-fill: #C8102E; --on-danger: #FFFFFF; --danger-soft: rgba(200, 16, 46, .10);
  --ok: #15803D; --ok-soft: rgba(21, 128, 61, .12); --info: #0E7490;
  --bubble-in: #FFFFFF; --bubble-in-border: #D5DCE8; --bubble-in-text: #101A2C; --bubble-out: #2B5FE0; --on-bubble-out: #FFFFFF; --meta-out: rgba(255, 255, 255, .9); --ticks-read: #8FE3FF;
  --toast-bg: #1C2333;
  --shadow-1: 0 1px 2px rgba(16, 26, 44, .06), 0 2px 8px rgba(16, 26, 44, .06);
  --shadow-2: 0 4px 16px rgba(16, 26, 44, .14);
  --shadow-3: 0 16px 48px rgba(16, 26, 44, .22);
  --r8: 8px; --r12: 12px; --r16: 16px; --r24: 24px; --pill: 999px;
  /* старые имена (их ещё читают mc/*.js и встроенные стили) */
  --ink: var(--text); --panel: var(--surface); --panel2: var(--surface2); --line: var(--border);
  --shadow: var(--shadow-1); --shadow-lg: var(--shadow-3); --chat-bg: var(--bg);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0B0F17; --surface: #141A26; --surface2: #1D2535; --surface3: #273043;
  --border: #2A3447; --border-strong: #5B6880;
  --text: #EDF1F7; --text2: #B4BDCC; --muted: #8D98AD;
  --accent: #5A8DFF; --accent-fill: #2B5FE0; --on-accent: #FFFFFF; --accent-soft: rgba(90, 141, 255, .16);
  --near: #34D399; --near-soft: rgba(52, 211, 153, .14);
  --air: #FBBF24; --air-fill: #F59E0B; --on-air: #1C1200; --air-soft: rgba(251, 191, 36, .14);
  --danger: #FF6B6B; --danger-fill: #D7263D; --on-danger: #FFFFFF; --danger-soft: rgba(255, 107, 107, .14);
  --ok: #4ADE80; --ok-soft: rgba(74, 222, 128, .14); --info: #38BDF8;
  --bubble-in: #1A2232; --bubble-in-border: #2A3447; --bubble-in-text: #EDF1F7; --bubble-out: #2B5FE0; --on-bubble-out: #FFFFFF; --meta-out: rgba(255, 255, 255, .9); --ticks-read: #8FE3FF;
  --toast-bg: #273043;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .3);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font: 16px/1.45 Onest, Inter, "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100vh; height: 100dvh; height: calc(100dvh / var(--ui-zoom, 1)); }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
svg.ic { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hide { display: none !important; }

/* ---------- вход ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border-radius: var(--r24); border: 1px solid var(--border); box-shadow: var(--shadow-1); padding: 28px 26px 24px; }
.auth-logo { width: 72px; height: 72px; margin: 0 auto 14px; display: block; border-radius: 18px; }
.auth h1 { text-align: center; font-size: 28px; line-height: 34px; font-weight: 700; margin: 0 0 4px; letter-spacing: -.4px; }
.auth .sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface2); border-radius: var(--r12); padding: 3px; gap: 2px; margin-bottom: 18px; }
.seg button { min-height: 40px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 600; transition: .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
[data-theme="dark"] .seg button.on { background: var(--surface3); box-shadow: none; }
.seg.n3 { grid-template-columns: 1fr 1fr 1fr; }
.seg.n3 button { padding: 8px 4px; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.seg button .ic { font-size: 16px; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 13px; line-height: 18px; color: var(--text2); margin: 0 0 6px 2px; font-weight: 500; }
.field input, .field select { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r12); border: 1.5px solid var(--border-strong); background: var(--surface); outline: none; transition: .15s; }
.field input:focus, .field select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.err { color: var(--danger); font-size: 13px; line-height: 18px; min-height: 18px; margin: 2px 2px 8px; }
.btn { color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border-radius: var(--r12); font-size: 16px; line-height: 20px; font-weight: 600; background: var(--surface2); transition: .15s; }
.btn:hover { filter: brightness(.97); }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); background: var(--danger-soft); }
.btn.block { width: 100%; }
a.btn { text-decoration: none; box-sizing: border-box; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.hint { color: var(--muted); font-size: 13px; line-height: 18px; margin-top: 14px; text-align: center; }

/* ---------- основной экран ---------- */
.main { height: 100%; display: grid; grid-template-columns: clamp(300px, 28vw, 400px) minmax(0, 1fr); }
.side { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.side-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 12px; }
.side-head .me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 11px; text-align: left; }
.side-head .me b { display: block; font-size: 17px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-head .me small { color: var(--near); font-size: 13px; line-height: 18px; font-weight: 500; }
.side-head .me small.off { color: var(--danger); }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r12); display: grid; place-items: center; font-size: 24px; color: var(--muted); transition: .15s; }
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.search { margin: 0 14px 8px; position: relative; }
.search input { width: 100%; min-height: 44px; padding: 10px 12px 10px 40px; border-radius: var(--r12); border: 0; background: var(--surface2); outline: none; font-size: 16px; }
.search input:focus { box-shadow: 0 0 0 2px var(--accent); }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 17px; }
.convlist { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.conv { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 8px 10px; border-radius: var(--r16); text-align: left; transition: background .12s; }
.conv:hover { background: var(--surface2); }
.conv.on { background: var(--accent-soft); }
.conv .mid { flex: 1; min-width: 0; }
.conv .top { display: flex; align-items: baseline; gap: 8px; }
.conv .title { font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .when { color: var(--muted); font-size: 13px; }
.conv .bot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.conv .prev { color: var(--muted); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.conv .prev.typing { color: var(--accent); }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--pill); background: var(--accent-fill); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.section-title { padding: 14px 12px 4px; font-size: 14px; line-height: 20px; color: var(--text2); font-weight: 600; }
.empty-list { padding: 24px 16px; color: var(--muted); text-align: center; }
/* пустое состояние: значок в круге, заголовок, текст, одно действие */
.estate { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 32px 20px; color: var(--text2); }
.estate .eic { width: 96px; height: 96px; border-radius: 50%; background: var(--surface2); color: var(--muted); display: grid; place-items: center; margin-bottom: 10px; }
.estate .eic .ic { width: 48px; height: 48px; stroke-width: 1.5; }
.estate b { color: var(--text); font-size: 17px; line-height: 22px; font-weight: 600; }
.estate p { margin: 0; font-size: 15px; line-height: 20px; max-width: 32ch; }
.estate .btn { margin-top: 12px; }

.avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px; flex: none; position: relative; user-select: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 72px; height: 72px; font-size: 28px; }
.avatar.chan { background: var(--accent-fill); border-radius: 32%; }
.avatar.chan.sm { border-radius: 10px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--surface); }

.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); position: relative; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); min-height: 64px; z-index: 5; }
.chat-head .back { display: none; }
.chat-head .t { flex: 1; min-width: 0; }
.chat-head .t b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .t small { color: var(--muted); font-size: 13px; }
.chat-head .t small.live { color: var(--accent); }
.netbar { background: var(--air-fill); color: var(--on-air); text-align: center; font-size: 13px; padding: 6px 10px; font-weight: 600; }
.msgs-wrap { flex: 1; overflow-y: auto; min-height: 0; position: relative; scroll-behavior: auto; }
.msgs { display: flex; flex-direction: column; padding: 14px 14px 8px; max-width: 920px; margin: 0 auto; }
.older { text-align: center; color: var(--muted); font-size: 13px; padding: 8px; }
.sep { align-self: center; margin: 14px 0 8px; padding: 3px 12px; font-size: 12px; line-height: 18px; color: var(--text2); background: var(--surface2); border-radius: var(--r8); font-weight: 600; }
.row { display: flex; align-items: flex-end; gap: 8px; margin-top: 2px; position: relative; animation: pop .18s ease-out; }
.row.mine { justify-content: flex-end; }
.row.first { margin-top: 10px; }
.row .avatar { visibility: hidden; }
.row.last .avatar { visibility: visible; }
.row.mine .avatar { display: none; }
.bubble { position: relative; max-width: min(78%, 560px); background: var(--bubble-in); color: var(--bubble-in-text); border-radius: var(--r16); padding: 7px 12px 5px; word-wrap: break-word; overflow-wrap: anywhere; }
.row.theirs .bubble { border-bottom-left-radius: 4px; }
.row.theirs:not(.last) .bubble { border-bottom-left-radius: var(--r16); }
.row.mine .bubble { background: var(--bubble-out); color: var(--on-bubble-out); border-bottom-right-radius: 4px; }
.row.mine:not(.last) .bubble { border-bottom-right-radius: var(--r16); }
.bubble .name { font-size: 13px; line-height: 18px; font-weight: 700; margin-bottom: 1px; color: color-mix(in srgb, var(--nm, var(--accent)) 62%, #000); }   /* ≥4.5:1 на светлом пузыре для всех цветов имён */
[data-theme="dark"] .bubble .name { color: color-mix(in srgb, var(--nm, var(--accent)) 65%, #fff); }   /* ночью имя осветляем */
.bubble .txt { white-space: pre-wrap; }
.bubble .txt a { text-decoration: underline; text-underline-offset: 2px; }
.bubble .txt.big { font-size: 34px; line-height: 1.15; padding: 2px 0; }
.bubble.media { padding: 4px 4px 5px; }
.bubble.media .meta { padding: 0 8px; }
.bubble.media .name { padding: 3px 8px 0; }
.meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); margin-top: 1px; user-select: none; }
.row.mine .meta { color: var(--meta-out); }
.meta .ic { font-size: 15px; }
.meta .read { color: var(--ticks-read); }
.row.theirs .meta .read { color: var(--ok); }
.deleted { font-style: italic; opacity: .7; }
.quote { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: var(--r8); padding: 4px 8px; margin: 2px 0 5px; cursor: pointer; font-size: 14px; max-width: 100%; }
.row.mine .quote { border-left-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .18); }
.quote b { display: block; font-size: 13px; }
.quote span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.react { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--pill); font-size: 13px; background: var(--accent-soft); border: 1px solid transparent; }
.row.mine .react { background: rgba(255, 255, 255, .22); }
.react.me { border-color: var(--accent); }
.row.mine .react.me { border-color: #fff; }
.more-btn { opacity: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); align-self: center; transition: .12s; flex: none; }
.row:hover .more-btn { opacity: 1; }
.more-btn:hover { background: var(--surface); }
.row.flash .bubble { animation: flash 1.2s ease; }
.row.mine { flex-direction: row; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px var(--air-fill); } 100% { box-shadow: none; } }

.img-wrap { display: block; border-radius: 14px; overflow: hidden; cursor: zoom-in; background: rgba(120, 130, 160, .15); min-width: 140px; min-height: 90px; }
.img-wrap img { display: block; max-width: 100%; max-height: 340px; width: auto; height: auto; margin: 0 auto; }
.vid { display: block; max-width: 100%; max-height: 340px; border-radius: 14px; background: #000; }
.file { display: flex; align-items: center; gap: 12px; min-width: 220px; padding: 4px 2px; text-decoration: none; }
.file .fi { width: 44px; height: 44px; border-radius: var(--r12); display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); color: var(--accent); flex: none; }
.row.mine .file .fi { background: rgba(255, 255, 255, .22); color: #fff; }
.file .fn { min-width: 0; }
.file .fn b { display: block; font-weight: 650; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fn small { opacity: .75; }
.audio-el { width: 260px; max-width: 100%; height: 40px; }
.prog { height: 5px; border-radius: 3px; background: rgba(120, 130, 160, .3); overflow: hidden; margin-top: 6px; }
.prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.row.mine .prog i { background: #fff; }
.progline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.progline .linkbtn { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.row.mine .progline { color: rgba(255, 255, 255, .85); }
.row.mine .progline .linkbtn { color: #fff; }
.failed { color: var(--danger); font-size: 13px; display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.row.mine .failed { color: #ffd7d9; }
.failed button { text-decoration: underline; }

.vp { display: flex; align-items: center; gap: 10px; min-width: 230px; padding: 3px 2px 0; }
.vp-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; font-size: 18px; flex: none; }
.row.mine .vp-btn { background: #fff; color: var(--accent); box-shadow: none; }
.vp-mid { flex: 1; min-width: 0; }
.vp-bars { display: flex; align-items: center; gap: 2px; height: 30px; cursor: pointer; }
.vp-bars i { flex: 1; min-width: 2px; border-radius: 2px; background: currentColor; opacity: .3; transition: opacity .1s; }
.vp-bars i.on { opacity: 1; }
.vp-row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: .85; margin-top: 2px; }
.vp-speed { font-weight: 700; padding: 0 7px; border-radius: 9px; background: rgba(120, 130, 160, .22); font-size: 12px; }
.row.mine .vp-speed { background: rgba(255, 255, 255, .25); }

.down-btn { position: absolute; right: 18px; bottom: 96px; width: 48px; height: 48px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; font-size: 22px; z-index: 6; }
.down-btn .badge { position: absolute; top: -8px; right: -4px; }
.drop { position: absolute; inset: 0; background: var(--accent-soft); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 20; font-size: 20px; font-weight: 700; color: var(--accent); border: 3px dashed var(--accent); margin: 10px; border-radius: var(--r24); pointer-events: none; }

.composer-wrap { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
.composer-in { max-width: 920px; margin: 0 auto; position: relative; }
.replybar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r16) var(--r16) 0 0; padding: 8px 12px; }
.replybar .ic { color: var(--accent); font-size: 20px; }
.replybar .q { flex: 1; min-width: 0; border-left: 3px solid var(--accent); padding-left: 10px; font-size: 14px; }
.replybar .q b { display: block; color: var(--accent); }
.replybar .q span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.composer { display: flex; align-items: flex-end; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r24); padding: 4px; }
.replybar + .composer { border-top-left-radius: 0; border-top-right-radius: 0; }
.composer textarea { flex: 1; resize: none; border: 0; outline: none; background: transparent; padding: 11px 6px; max-height: 160px; line-height: 22px; min-width: 0; font-size: 16px; }
.composer .icon-btn { width: 40px; height: 40px; border-radius: 50%; font-size: 22px; flex: none; }
.send-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; font-size: 22px; flex: none; transition: transform .12s; }
.send-btn:active { transform: scale(.93); }
.recbar { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r24); padding: 4px 4px 4px 16px; min-height: 56px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; flex: none; }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 44px; }
.rec-wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 34px; overflow: hidden; justify-content: flex-end; }
.rec-wave i { width: 3px; border-radius: 2px; background: var(--accent); flex: none; min-height: 4px; }
.rec-hint { color: var(--muted); font-size: 13px; }
@keyframes blink { 50% { opacity: .25; } }

.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--text2); padding: 30px; font-size: 15px; }
.chat-empty .big-ic { width: 96px; height: 96px; margin: 0 auto 16px; display: block; border-radius: 24px; }
.chat-empty h2 { color: var(--text); margin: 0 0 6px; font-size: 20px; line-height: 26px; font-weight: 600; }

/* ---------- меню, окна ---------- */
.modal input:not([type]):not(.atcap), .modal input[type=text], .modal input[type=number], .modal input[type=password], .modal select, .modal textarea { font-size: 16px; }
.modal input:not([type]):not([style*="border"]):not(.minfo-q):not(.tq), .modal input[type=text]:not([style*="border"]):not(.tq) { min-height: 44px; padding: 10px 12px; border-radius: var(--r12); border: 1.5px solid var(--border-strong); background: var(--surface); outline: none; }
.modal input:focus { border-color: var(--accent); }
.menu { position: fixed; z-index: 100; background: var(--surface); border-radius: var(--r16); box-shadow: var(--shadow-2); border: 1px solid var(--border); padding: 6px; min-width: 210px; animation: pop .12s ease-out; }
.menu .rx { display: flex; gap: 2px; padding: 4px 4px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .rx button { font-size: 22px; width: 38px; height: 38px; border-radius: 10px; }
.menu .rx button:hover { background: var(--surface2); transform: scale(1.15); }
.menu .it { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--r12); text-align: left; }
.menu .it:hover { background: var(--surface2); }
.menu .it.danger { color: var(--danger); }
.menu .it .ic { font-size: 18px; }
.emoji-pop { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30; width: min(340px, 94vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); box-shadow: var(--shadow-2); padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; max-height: 260px; overflow-y: auto; animation: pop .12s ease-out; }
.emoji-pop button { font-size: 24px; height: 40px; border-radius: 10px; }
.emoji-pop button:hover { background: var(--surface2); }
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(8, 12, 24, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { width: min(460px, 100%); max-height: min(calc(88vh / var(--ui-zoom, 1)), 720px); overflow-y: auto; background: var(--surface); border-radius: var(--r24); box-shadow: var(--shadow-3); padding: 20px; animation: pop .16s ease-out; }
.modal h3 { margin: 0 0 14px; font-size: 20px; line-height: 26px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.modal .group { margin-bottom: 18px; }
.modal .group > label { display: block; font-size: 14px; line-height: 20px; color: var(--text2); font-weight: 600; margin-bottom: 8px; }
.kv { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface2); border-radius: var(--r12); margin-bottom: 6px; word-break: break-all; font-size: 14px; }
.kv span { flex: 1; min-width: 0; }
/* 2.0-dev11: «название — значение» (Маршрут сообщения и т.п.): название не сжимается, значение переносится по словам —
   раньше break-all + flex:1 у названия ставили «Состояние» по букве в строку */
.kv.kv2 { word-break: normal; align-items: flex-start; }
.kv.kv2 span { flex: none; max-width: 45%; }
.kv.kv2 b { flex: 1; min-width: 0; text-align: right; word-break: normal; overflow-wrap: anywhere; }
.kv button { color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 6px 2px; }
.sw { width: 52px; height: 32px; border-radius: var(--pill); background: var(--border-strong); position: relative; transition: .15s; flex: none; cursor: pointer; }
.sw::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: .15s; }
.sw.on { background: var(--accent-fill); }
.sw.on::after { left: 24px; }
.ulist .u { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px; border-radius: var(--r12); text-align: left; }
.ulist .u:hover { background: var(--surface2); }
.ulist .u small { color: var(--muted); display: block; }
.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(5, 8, 16, .92); display: grid; place-items: center; animation: fade .15s; }
.lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 8px; }
.lightbox .lb-bar { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.lightbox .lb-bar a, .lightbox .lb-bar button { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; display: grid; place-items: center; font-size: 22px; text-decoration: none; }
#toasts { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--toast-bg); color: #fff; padding: 10px 16px; border-radius: var(--r16); box-shadow: var(--shadow-2); font-size: 15px; line-height: 20px; font-weight: 500; max-width: 90vw; animation: pop .15s ease-out; }
.toast.err { background: var(--danger-fill); color: var(--on-danger); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- телефон ---------- */
@media (max-width: 839px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .chat { display: none; }
  .main.show-chat .side { display: none; }
  .main.show-chat .chat { display: flex; }
  .chat-head .back { display: grid; }
  .bubble { max-width: 86%; }
  .more-btn { display: none; }
  .down-btn { bottom: 84px; }
  #toasts { bottom: 100px; }
}
@media (hover: none) { .more-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 4px; }

/* --- фаза B / MeshCore --- */
.fwd { display: flex; align-items: center; gap: 5px; font-size: 13px; opacity: .8; margin-bottom: 3px; font-style: italic; }
.mcflag { font-size: 11px; }
.mcflag.bad { color: var(--danger); opacity: 1; }
.chat-head .icon-btn { flex: none; }

.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.grp { background: #0F766E; border-radius: 32%; }
.pinbar { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 14px; }
.pinbar.hide { display: none; }
.pinbar .ic { color: var(--accent); font-size: 18px; flex: none; }
.pinbar .q { flex: 1; min-width: 0; cursor: pointer; border-left: 3px solid var(--accent); padding-left: 8px; }
.pinbar .q b { display: block; color: var(--accent); font-size: 13px; }
.pinbar .q span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.qr { display: grid; place-items: center; margin: 10px 0; }
.qr svg { border-radius: 12px; max-width: 100%; height: auto; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: var(--r12); }
.ulist label.u input { width: 18px; height: 18px; }

.fpnum { font: 700 26px/1.4 ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; text-align: center; letter-spacing: 2px; margin: 14px 0; padding: 14px; border-radius: var(--r16); background: var(--surface2); word-spacing: 8px; }
.img-ph { padding: 28px 40px; color: var(--muted); font-size: 14px; }

/* ---- звонки ---- */
.callov { position: fixed; inset: 0; z-index: 90; background: radial-gradient(circle at 50% 30%, #2b3560, #0d1226); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
/* 1.33: видео собеседника целиком в правильных пропорциях (поля по краям); двойное нажатие — заполнить экран (.fill) */
.callrv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; display: none; }
.callrv.fill { object-fit: cover; }
.callov.cvid .callrv { display: block; }
.calllv { position: absolute; right: 14px; top: 14px; width: 110px; height: 150px; object-fit: cover; border-radius: 14px; background: #000; border: 2px solid rgba(255,255,255,.35); display: none; transform: scaleX(-1); z-index: 2; }
.callov.hasl .calllv { display: block; }
.callov:not(.cvid) .callrv { display: none; }
.callinfo { position: relative; z-index: 1; text-align: center; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.callinfo .avatar { width: 96px; height: 96px; font-size: 38px; margin: 0 auto 14px; }
.callov.cvid .callinfo { position: absolute; top: 18px; left: 0; right: 0; }
.callov.cvid .callinfo .avatar { display: none; }
.callinfo .cn { font-size: 24px; font-weight: 700; }
.callinfo .cs { margin-top: 6px; opacity: .85; font-size: 15px; }
.callbtns { position: absolute; bottom: calc(36px + env(safe-area-inset-bottom)); left: 0; right: 0; display: flex; justify-content: center; gap: 22px; z-index: 3; }
.cbtn { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; border: 0; cursor: pointer; }
.cbtn .ic { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 2; }
.cbtn.red { background: var(--danger-fill); } .cbtn.red .ic { transform: rotate(135deg); }
.cbtn.green { background: #15803D; }
.cbtn.off { background: #fff; } .cbtn.off .ic { stroke: #222; }
/* 1.30: качество видео в звонке — пилюля слева сверху и меню */
.callvq { position: absolute; left: 14px; top: calc(14px + env(safe-area-inset-top)); z-index: 4; display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.25); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.callov.cvid .callvq { top: calc(64px + env(safe-area-inset-top)); }
.callvq .ic { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; }
.callvqm { position: absolute; left: 14px; top: calc(56px + env(safe-area-inset-top)); z-index: 5; min-width: 240px; max-width: calc(100vw - 28px); background: var(--sheet, var(--surface)); color: var(--text); border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 6px; display: flex; flex-direction: column; }
.callov.cvid .callvqm { top: calc(106px + env(safe-area-inset-top)); }
.callvqi { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.callvqi:hover { background: var(--surface2, rgba(0,0,0,.06)); }
.callvqi.on b { color: var(--accent); }
.callvqi small { color: var(--muted); font-size: 12px; }
/* ---- SOS ---- */
/* пилюля SOS в шапке: заметна, не кричит; залитая красным — только кнопка отправки на экране SOS */
.sosbtn { background: var(--danger-soft); color: var(--danger); border: 1.5px solid var(--danger); border-radius: var(--pill); font-weight: 800; font-size: 13px; letter-spacing: .6px; padding: 0 12px; height: 36px; min-width: 56px; cursor: pointer; flex: none; position: relative; }
.sosbtn::before { content: ''; position: absolute; inset: -4px; }     /* зона нажатия 44 px */
.sosbtn:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); }
.sosgo { background: var(--danger-fill); color: var(--on-danger); padding: 16px; min-height: 56px; font-size: 17px; font-weight: 800; border: 0; }
.sosgo:hover { filter: brightness(1.06); }
.sosov { position: fixed; inset: 0; z-index: 100; background: rgba(160,10,20,.96); display: grid; place-items: center; animation: sosflash 0.9s infinite alternate; padding: 16px; }
@keyframes sosflash { from { background: rgba(160,10,20,.96); } to { background: rgba(90,5,12,.97); } }
.sosbox { color: #fff; text-align: center; max-width: 420px; width: 100%; }
.sosh { font-size: 64px; font-weight: 900; }
.sosw { font-size: 22px; font-weight: 700; margin: 8px 0; }
.sosn { font-size: 18px; margin: 6px 0; }
.sosc { font: 600 15px ui-monospace, Menlo, Consolas, monospace; opacity: .9; margin: 10px 0 18px; }
.sosb { display: flex; flex-direction: column; gap: 10px; }
.sosb .btn { width: 100%; }
.geo { min-width: 230px; }
.geo-t { font-weight: 700; margin-bottom: 4px; }
.geo.sos { border-left: 4px solid var(--danger); padding-left: 8px; }
.geo.sos .geo-t { color: var(--danger); }
.geo-t .ic { font-size: 16px; vertical-align: -3px; margin-right: 4px; }
.geo-c { font: 13px ui-monospace, Menlo, Consolas, monospace; opacity: .85; margin: 4px 0 8px; }
.geo-pr { font-size: 12.5px; font-weight: 700; margin-top: 4px; color: var(--muted); } .row.mine .geo-pr { color: #fff; opacity: .9; }   /* 1.36 (Г1) */
.geo-b { display: flex; flex-wrap: wrap; gap: 6px; }
.geo-b .btn { text-decoration: none; }
/* ---- карта сети ---- */
.netmap { background: var(--surface2); border-radius: 14px; overflow: hidden; margin-bottom: 12px; }
.mapsvg { width: 100%; height: auto; display: block; }
.mapsvg .gl { stroke: var(--border); stroke-width: 1; }
.mapsvg .lk { stroke-width: 2; stroke-dasharray: 5 4; } .mapsvg .lk.up { stroke: var(--ok); } .mapsvg .lk.dn { stroke: var(--danger); opacity: .6; }
.mapsvg text { font: 600 11px system-ui, sans-serif; fill: var(--text, currentColor); text-anchor: middle; paint-order: stroke; stroke: var(--surface2); stroke-width: 3px; }
.mapsvg .mnode.up rect { fill: var(--ok); } .mapsvg .mnode.dn rect { fill: var(--danger); }
.mapsvg .mfocus circle { fill: var(--danger-fill); } .mapsvg .mfocus .pulse { fill: var(--danger-soft); }
.mapsvg .ruler line { stroke: var(--muted); stroke-width: 2; } .mapsvg .ruler text { text-anchor: start; fill: var(--muted); }
.nomap { padding: 28px 18px; color: var(--muted); text-align: center; font-size: 14px; line-height: 1.5; }
.netsum { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.okc { color: var(--ok); } .offc { color: var(--muted); }
.nrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.nrow span, .nrow em { color: var(--muted); font-style: normal; font-size: 13px; } .nrow em { margin-left: auto; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; } .dot.up { background: var(--ok); } .dot.dn { background: var(--danger); }
/* ---- управление ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--surface2); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 17px; } .stat small { color: var(--muted); font-size: 12px; }
.dot.na { background: var(--border-strong); }
.urow { display: flex; align-items: center; gap: 8px; padding: 8px 0; flex-wrap: wrap; }
.urow .un { flex: 1; min-width: 120px; } .urow .un small { color: var(--muted); display: block; }
.nedit { display: flex; gap: 4px; margin-bottom: 6px; }
@media (max-width: 760px) { .calllv { width: 88px; height: 120px; } }
.sosb .btn { background: #fff; color: #101A2C; border: 0; } .sosb .btn.primary { background: var(--accent-fill); color: #fff; }
.side-head .me small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============ контраст и шапка (1.3.1) ============ */
.side-head .me { overflow: hidden; }
.side-head .me > span { min-width: 0; flex: 1; overflow: hidden; display: block; text-align: left; }
.side-head .me b, .side-head .me small { max-width: 100%; }
.side-head .icon-btn { flex: none; }
@media (max-width: 360px) {
  .side-head { gap: 4px; padding: 10px 6px 6px 8px; }
  .side-head .me { gap: 8px; }
  .sosbtn { min-width: 48px; padding: 0 8px; }
}
.icon-btn { color: var(--text2); }
.icon-btn:hover { color: var(--text); }
.conv .mid small, .conv .last { color: var(--muted); }
/* кнопки в сообщениях с геопозицией: читаемо и на синем пузыре, и на белом */
.row.mine .geo-b .btn { background: #ffffff; color: #2B5FE0; border: 0; font-weight: 700; }
.row:not(.mine) .geo-b .btn { background: var(--surface2); color: var(--text); font-weight: 700; }
.row.mine .geo-c { opacity: 1; color: #fff; }
.geo-b .btn:hover { filter: brightness(.95); }
.row.mine .geo.sos .geo-t { color: #ffd6d8; }
.row:not(.mine) .bubble { border: 1px solid var(--bubble-in-border); }
/* ---- пароль: глазок, код восстановления ---- */
.pw { position: relative; }
.pw input { width: 100%; }
.pweye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; color: var(--muted); }
.pweye:hover { color: var(--text); background: var(--surface2); }
.field .pw { margin: 0; }
.linkrow { text-align: center; margin-top: 12px; }
.linkbtn { color: var(--accent); font-weight: 600; font-size: 15px; min-height: 40px; padding: 8px 10px; border-radius: var(--r8); }
.linkbtn:hover { background: var(--surface2); }
.recp { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 12px; }
.reccode { font: 700 32px/36px ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; letter-spacing: 2px; text-align: center; padding: 18px 10px; border-radius: var(--r16); background: var(--surface2); border: 2px dashed var(--accent); margin: 4px 0 14px; user-select: all; word-break: break-all; }

/* ---------- сообщения из эфира MeshCore (вид как в приложении MeshCore) ---------- */
.row.mcrow { align-items: flex-start; margin-top: 10px; gap: 10px; }
.row.mcrow .avatar, .row.mcrow.last .avatar { visibility: visible; }
.row.mcrow .avatar.sm { width: 48px; height: 48px; font-size: 18px; }
.avatar.rad { font-size: 17px; letter-spacing: .3px; }
.mccol { display: flex; flex-direction: column; max-width: min(78%, 560px); min-width: 0; }
.mccol .bubble { max-width: 100%; }
/* сообщение из эфира — чужой пузырь с янтарной кромкой слева; своё, ушедшее в эфир, — обычный синий */
.bubble.mcb { padding: 8px 12px 6px; }
.row.mcrow.theirs .bubble.mcb { background: var(--bubble-in); color: var(--bubble-in-text); border: 1px solid var(--air-fill); box-shadow: inset 3px 0 0 var(--air-fill); }
.row.mcrow.mine .bubble.mcb { background: var(--bubble-out); color: var(--on-bubble-out); }
.row.mcrow .bubble.mcb .name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.row.mcrow .bubble.mcb .txt { font-size: 16px; line-height: 22px; }
.mccap { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--air); margin: 4px 10px 0; user-select: none; }
.mccap span + span::before { content: '•'; margin-right: 6px; opacity: .7; }
.row.mine .mccol { align-items: flex-end; }
.mccap .bad { color: var(--danger); }
.mccap .okc { display: inline-flex; align-items: center; }
.mccap .okc::before { content: none !important; }
.mccap .okc svg { font-size: 15px; color: var(--ok); }
.route { position: relative; margin: 4px 0 2px 4px; }
.rnode { position: relative; display: flex; gap: 14px; padding: 0 0 16px 0; }
.rnode:last-child { padding-bottom: 0; }
.rnode > i { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 4px; position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--accent-soft); }
.rnode:not(:last-child)::before { content: ''; position: absolute; left: 6px; top: 18px; bottom: -4px; width: 2px; background: var(--border); }
.rnode.src > i { background: var(--air-fill); box-shadow: 0 0 0 4px var(--air-soft); }
.rnode.dst > i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.rnode.na > i { background: var(--muted); box-shadow: none; }
.rnode b { display: block; font-size: 15px; }
.rnode small { color: var(--muted); font-size: 13px; }

/* окно «Действия с сообщением» */
.overlay.sheet { place-items: end center; padding: 0; }
.sheetbox { width: min(560px, 100%); max-height: calc(88dvh / var(--ui-zoom, 1)); overflow: auto; background: var(--surface); color: var(--text); border-radius: var(--r24) var(--r24) 0 0; padding: 0 0 12px; box-shadow: var(--shadow-3); animation: pop .15s ease-out; }
.shead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 20px; font-weight: 600; position: sticky; top: 0; z-index: 2; }
.sprev { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px 6px; }
.sprev .bubble.mcb { max-width: 86%; }
.sprev .bubble.mcb.theirs { background: var(--bubble-in); color: var(--bubble-in-text); border: 1px solid var(--bubble-in-border); }
.sprev .bubble.mcb.mine { background: var(--bubble-out); color: var(--on-bubble-out); margin-left: auto; }
.sprev .name { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.sprev .txt { font-size: 16px; white-space: pre-wrap; }
.sprev:has(.mine) { justify-content: flex-end; }
.sinfo { padding: 4px 18px 12px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.slist { display: flex; flex-direction: column; gap: 8px; padding: 0 12px; }
.srow { display: flex; align-items: center; gap: 14px; text-align: left; min-height: 56px; padding: 14px 16px; border-radius: var(--r12); background: var(--surface2); font-size: 16px; }
.srow span { flex: 1; }
.srow .ic:first-child { font-size: 22px; }
.srow .ic:last-child { font-size: 18px; color: var(--muted); }
.srow.danger { color: var(--danger); }

/* ---------- крупнее и глаже ---------- */
svg.ic { shape-rendering: geometricPrecision; }
.composer .icon-btn { width: 40px; height: 40px; font-size: 24px; }
.chat-head { min-height: 64px; }
.chat-head .t b { font-size: 17px; line-height: 22px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.chat-head .t small { font-size: 13px; line-height: 18px; display: flex; align-items: center; flex-wrap: wrap; }
.ri { display: inline-flex; vertical-align: -3px; margin: 0 2px; }
.ri svg.ic { font-size: 1.1em; }
.conv .title { font-size: 16px; line-height: 22px; display: flex; align-items: center; gap: 4px; }
.conv .prev { font-size: 15px; line-height: 20px; }
.conv .when { font-size: 13px; }
.avatar.sm { width: 40px; height: 40px; font-size: 15px; }
.bubble .txt { font-size: 16px; line-height: 22px; }
.mccap { font-size: 13px; }
.menu { min-width: 250px; padding: 8px; }
.menu .it { padding: 12px 14px; font-size: 16px; gap: 16px; }
.menu .it .ic { font-size: 22px; }
.menu .it.two small { display: block; color: var(--muted); font-size: 14px; }
.menu-top { transform-origin: top right; }
.secret { background: var(--surface2); border-radius: 14px; padding: 10px 14px; margin-top: 12px; }
.secret small { color: var(--muted); font-size: 13px; }
.secret .row2 { display: flex; align-items: center; gap: 8px; }
.secret code { flex: 1; word-break: break-all; font: 600 15px/1.35 "JetBrains Mono", Consolas, monospace; }
.side-head .me b { font-size: 17px; }

/* ---------- экран «Эфир» (рация MeshCore): в оформлении ALT, день и ночь ---------- */
.mcscreen { position: fixed; inset: 0; z-index: 80; background: var(--bg); color: var(--text); display: flex; flex-direction: column; height: calc(100dvh / var(--ui-zoom, 1)); font-size: 16px; }
.mcscreen .icon-btn { color: var(--text2); }
.mcscreen .icon-btn:hover { background: var(--surface2); color: var(--text); }
.mchead { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.mchead .mct { flex: 1; min-width: 0; padding-left: 6px; }
.mchead .mct b { display: block; font-size: 17px; line-height: 22px; font-weight: 600; }
.mcsub { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; line-height: 18px; }
.mcsub .ic { font-size: 15px; }
.mcsearch { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.mcsearch input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 16px; padding: 12px 0; min-height: 48px; }
.mcsearch input::placeholder { color: var(--muted); }
.mcsearch .ic { font-size: 22px; color: var(--muted); }
.mclist { flex: 1; overflow-y: auto; padding: 6px 0 90px; position: relative; }
.mcrow { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px 8px 16px; cursor: pointer; }
.mcrow:hover { background: var(--surface2); }
.mcrow .mid { flex: 1; min-width: 0; }
.mcrow .mid b { display: block; font-size: 16px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcrow .mid small { display: block; color: var(--muted); font-size: 14px; line-height: 20px; margin-top: 1px; }
.mcrow .mono { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px !important; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcrow .rt { text-align: right; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mcrow .pin .ic { font-size: 16px; color: var(--muted); }
.mcscreen .av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 17px; font-weight: 700; flex: none; }
.mcscreen .av.lg { width: 64px; height: 64px; }
.mcscreen .av .ic { font-size: 24px; }
.bdg { min-width: 22px; height: 22px; border-radius: var(--pill); background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; font-size: 12px; padding: 0 7px; }
.mcfab { position: fixed; right: 18px; bottom: 100px; width: 56px; height: 56px; border-radius: var(--r16); background: var(--accent-fill); color: var(--on-accent); display: grid; place-items: center; font-size: 28px; box-shadow: var(--shadow-2); }
.mcempty { text-align: center; color: var(--text2); padding: 40px 20px; }
.mcnav { display: flex; background: var(--surface); border-top: 1px solid var(--border); flex: none; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
.mcnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); min-height: 56px; }
.mcnav button.on { color: var(--accent); font-weight: 600; }
.mcnav .pill { width: 56px; height: 32px; border-radius: var(--pill); display: grid; place-items: center; font-size: 24px; }
.mcnav button.on .pill { background: var(--accent-soft); color: var(--accent); }
.mcnav small { font-size: 12px; font-weight: 600; }
.mcbody { flex: 1; overflow-y: auto; padding: 14px 16px 40px; }
.mccard { max-width: 460px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.mccard .big { width: 96px; height: 96px; border-radius: 50%; background: var(--surface2); color: var(--muted); display: grid; place-items: center; font-size: 48px; }
.mccard .big .ic { stroke-width: 1.5; }
.mccard > b { font-size: 17px; line-height: 22px; font-weight: 600; }
.mccard .hint { color: var(--text2); font-size: 15px; line-height: 20px; margin: 0; }
.mccard .mcconn { width: 100%; text-align: left; }
.mcconn input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: inherit; }
.mcpop { position: fixed; z-index: 120; background: var(--surface); color: var(--text); border-radius: var(--r16); padding: 6px; min-width: 280px; box-shadow: var(--shadow-2); }
.mcpop .it { display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 16px; min-height: 48px; border-radius: var(--r12); text-align: left; font-size: 16px; }
.mcpop .it:hover { background: var(--surface2); }
.mcpop .it .ic { font-size: 23px; }
.mcpop .it.danger { color: var(--danger); }
.mcpop hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.mcmapwrap { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.mcchips { display: flex; gap: 8px; padding: 8px 12px; flex-wrap: wrap; background: var(--bg); }
.chip { padding: 8px 14px; min-height: 40px; border-radius: var(--r12); border: 1px solid var(--border); color: var(--text2); background: var(--surface); font-size: 15px; font-weight: 600; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.mcbind { display: flex; flex-wrap: wrap; gap: 8px; }      /* 1.34: ячейки рации, открытые для привязки */
.mcmapbox { flex: 1; min-height: 0; position: relative; }
.mcset .mcbody { background: var(--bg); }
.mcsec { margin: 22px 0 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text2); }
.mcset .fld { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r12); padding: 8px 14px; margin-bottom: 8px; }
.mcset .fld small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.mcset .fld input, .mcset .fld select { width: 100%; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 16px; padding: 4px 0; }
.mcset .fld select option { background: var(--surface); color: var(--text); }
.mcset .two { display: flex; gap: 8px; } .mcset .two .fld { flex: 1; }
.mcset .chk { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r12); padding: 14px; margin: 0 0 8px; }
.mcset .chk input { width: 22px; height: 22px; accent-color: var(--accent); }
.mcset .row2 { display: flex; align-items: center; gap: 8px; } .mcset .row2 code { flex: 1; word-break: break-all; font: 600 14px/1.35 Consolas, monospace; }
.mcset .hint { color: var(--muted); font-size: 13px; margin: 8px 2px; }
.mcset .btn { background: var(--surface2); color: var(--text); }
.infoblk { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text2); font-size: 15px; }
.infoblk .bar { height: 6px; border-radius: 3px; background: var(--surface3); margin-top: 6px; } .infoblk .bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* карта */
.tmap { position: relative; width: 100%; height: 100%; min-height: 260px; overflow: hidden; background: #cfd8e3; touch-action: none; user-select: none; cursor: grab;
  background-image: linear-gradient(rgba(120, 130, 150, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 130, 150, .18) 1px, transparent 1px); background-size: 64px 64px; }
/* 1.23: карта всегда светлая — фон под плитками и подписи точек тоже светлые в любой теме */
[data-theme="dark"] .tmap, .mcscreen .tmap { background-color: #e8ecf2; }
.tmap:active { cursor: grabbing; }
.tm-tiles, .tm-lay, .tm-svg { position: absolute; inset: 0; }
.tm-lay, .tm-svg { pointer-events: none; } .tm-lay > * { pointer-events: auto; }
.tm-t { position: absolute; left: 0; top: 0; max-width: none; will-change: transform; }

.tmap.tm-night .tm-tiles { filter: brightness(0.94); }     /* 1.23: карта всегда светлая; ночью — чуть приглушена */
.tm-m { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--mc, #3b82f6); border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0; }
.tm-m.me { width: 26px; height: 26px; margin: -13px 0 0 -13px; box-shadow: 0 0 0 6px rgba(34, 197, 94, .3), 0 2px 6px rgba(0, 0, 0, .5); }
/* 2.0-dev11: подпись узла — «пилюля» над значком (11px, полупрозрачная светлая подложка: карта всегда светлая) */
.tm-lb { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
  font-size: 11px; line-height: 15px; font-weight: 600; color: #101A2C; background: rgba(255, 255, 255, .86); padding: 1px 7px; border-radius: 999px;
  box-shadow: 0 1px 3px rgba(16, 26, 44, .25); pointer-events: none; }
.tm-fx { position: absolute; left: 0; top: 0; pointer-events: none; }
/* 1.34: показания датчика — плашка под значком (цвет узла); подпись «N км» под дугой маршрута */
.tm-sub { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; line-height: 15px;
  font-weight: 700; color: #fff; background: var(--mc, #8A5CF0); padding: 1px 7px; border-radius: 999px; box-shadow: 0 1px 3px rgba(16, 26, 44, .3); pointer-events: none; }
.tm-lbg.under { fill: rgba(255, 255, 255, .92); stroke: rgba(16, 26, 44, .18); stroke-width: 1; }
.tm-lt.under { font-size: 11.5px; font-weight: 600; fill: #101A2C; }
/* 2.0-dev11: цвета видов узлов на карте сети — одни в Дне и Ночи (карта всегда светлая), как NetColors в app2 */
:root { --nk-self: #2B5FE0; --nk-rep: #1E7FD6; --nk-comp: #0E9F77; --nk-room: #C98208; --nk-sensor: #8A5CF0; --nk-server: #2B5FE0;
  --nk-router: #0F8A99; --nk-down: #5F6B82; --nk-unk: #8D98AD; }
/* «Маршрут сообщения» в вебе — как RouteMap приложения: мини-карта 240 px и пронумерованные прыжки под ней */
/* 1.31: одно окно «Маршрут сообщения» / «Сведения» для бесед ALT и «Эфира»; пересылка в беседу или в эфир */
.rtov .modal { width: min(560px, 100%); }
.rtwrap > .rtlb { display: block; font-size: 14px; line-height: 20px; color: var(--text2); font-weight: 600; margin-bottom: 8px; }
.rtwrap > .rtnomap { margin: 0 0 10px; }
.rtquote { background: var(--surface2); border-radius: var(--r12); padding: 10px 12px; margin-bottom: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9em; overflow: hidden; }
.rtbtns { display: flex; gap: 8px; flex-wrap: wrap; } .rtbtns .btn { flex: 1 1 auto; }
.fwdlist .fwdh { font-size: 13px; font-weight: 600; color: var(--text2); padding: 10px 4px 4px; }
/* 1.33: зашифрованное → в эфир: предупреждение над разделами эфира (перед отправкой — вопрос «Переслать открыто?») */
.fwdlist .fwdwarn { font-size: 13px; color: var(--danger); padding: 10px 4px 2px; line-height: 1.4; }
.fwdlist .u small { display: block; color: var(--muted); font-size: 12px; }
.fwdlist .fwdic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--air-soft, var(--surface2)); color: var(--air); flex: none; }
.fwdlist .fwdic .ic, .fwdlist .fwdic svg { width: 18px; height: 18px; }
.rtmap { height: 240px; border-radius: var(--r16); overflow: hidden; position: relative; margin-bottom: 10px; }
.rtmap .tm-m { width: 24px; height: 24px; margin: -12px 0 0 -12px; font-size: 12px; font-weight: 800; }
.rtmap .tm-m.guess { border-style: dashed; }
.rthops { display: flex; flex-direction: column; gap: 10px; }
.rthop { display: flex; align-items: center; gap: 12px; }
.rthop > i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; font-style: normal; flex: none; }
.rthop > i.guess { box-shadow: 0 0 0 2px var(--border-strong); }
/* 1.34: ретранслятор, в который можно войти (долгое нажатие) — значок шестерёнки справа */
.rthop.rp { cursor: context-menu; border-radius: 12px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rthop.rp > div { flex: 1; min-width: 0; }
.rthop .rtgear { flex: none; color: var(--muted); display: grid; place-items: center; }
.rthop .rtgear svg { width: 18px; height: 18px; }
.rthop > div { flex: 1; min-width: 0; } .rthop b { display: block; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rthop small { color: var(--muted); font-size: 13px; }
.tm-ln.rt { stroke: #0E7490; stroke-width: 3; stroke-dasharray: none; } .tm-ln.rt.guess { stroke: #8D98AD; stroke-dasharray: 7 6; }
.tm-ar.rt { fill: #0E7490; } .tm-ar.rt.guess { fill: #8D98AD; }
/* мини-карта «живого места» в пузыре (не листается — только смотреть; нажатие — карта сети) */
.geomini { position: relative; width: 260px; max-width: 100%; height: 130px; border-radius: 12px; overflow: hidden; background: #E8ECF3; margin: 6px 0; }
.geomini img { position: absolute; width: 256px; height: 256px; max-width: none; }
.geomini .gpin { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--accent-fill); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.geo.live .geomini .gpin { box-shadow: 0 0 0 6px rgba(43, 95, 224, .25), 0 1px 4px rgba(0, 0, 0, .4); }
/* (1.23: подписи точек — тёмные на светлой карте и ночью) */
.tm-cl { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: #f97316; color: #fff; font-weight: 800; font-size: 15px; border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 0; }
.tm-ln { stroke: #94a3b8; stroke-width: 2.5; stroke-dasharray: 6 5; } .tm-ln.up { stroke: #22c55e; stroke-dasharray: none; } .tm-ln.dn { stroke: #ef4444; }
.tm-ctl { position: absolute; right: 12px; bottom: 56px; display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.tm-b { width: 44px; height: 44px; border-radius: var(--r12); background: #fff; color: #222; font-size: 24px; font-weight: 700; box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.tm-b { background: var(--surface); color: var(--text); box-shadow: var(--shadow-2); }
.tm-attr { position: absolute; left: 6px; bottom: 4px; font-size: 11px; color: #444; background: rgba(255, 255, 255, .7); padding: 1px 6px; border-radius: 6px; z-index: 3; }
.tm-scale { position: absolute; left: 10px; bottom: 26px; border: 2px solid #333; border-top: 0; font-size: 12px; padding: 0 4px; color: #222; background: rgba(255, 255, 255, .6); z-index: 3; }
.netmap.tilebox { height: 340px; }

.mctop{display:flex;align-items:center;gap:4px;margin:-4px 0 12px;padding:6px 4px 10px;border-bottom:1px solid var(--border)}
.mctop .mct{flex:1;min-width:0}.mctop .mcsub{display:flex;align-items:center;gap:6px;font-size:16px;font-weight:600}
.mcmark{margin-left:6px;color:var(--accent);opacity:.9}
.mctop .mcsub,.mctop .mcsub span{color:var(--text,inherit)!important;opacity:1}.mctop .icon-btn{color:var(--text,inherit)}

.mcmark{color:var(--text);opacity:.85}.mcmark.on{color:var(--accent);opacity:1}
.mcsetbox{background:var(--surface);color:var(--text);border-radius:var(--r24);width:min(580px,94vw);max-height:calc(90vh / var(--ui-zoom,1));display:flex;flex-direction:column;overflow:hidden;box-shadow:var(--shadow-3)}
.mcsetbox .mchead{position:static;flex:none}.mcsetbox .mcbody{flex:1;overflow:auto;padding:0 14px 18px}
/* ALT: собственный стиль всплывающих меню MeshCore */
.mcpop{background:var(--surface);color:var(--text);border:1px solid var(--border);border-radius:var(--r16);padding:8px;min-width:250px;box-shadow:var(--shadow-2);animation:mcpin .14s ease-out;transform-origin:top right}
@keyframes mcpin{from{opacity:0;transform:scale(.94) translateY(-4px)}to{opacity:1;transform:none}}
.mcpop .it{gap:12px;padding:8px 10px;min-height:48px;border-radius:var(--r12);font-size:15px;font-weight:500}
.mcpop .it:hover{background:var(--surface2)}
.mcpop .it .ic{display:inline-flex;align-items:center;justify-content:center;flex:none;width:36px;height:36px;border-radius:10px;background:var(--accent-soft);color:var(--accent);font-size:20px}
.mcpop .it .ic svg{width:20px;height:20px}
.mcpop .it.danger{color:var(--danger)}.mcpop .it.danger .ic{background:var(--danger-soft);color:var(--danger)}
.mcpop hr{border-top:1px solid var(--border);margin:6px 4px}
.mctop .icon-btn{border-radius:var(--r12);background:var(--surface2)}
.mcpop .it .ic{display:block;box-sizing:border-box;width:36px;height:36px;padding:8px}
.mcpop .it .ic svg{width:auto;height:auto}

/* настройки MeshCore: стиль темы ALT, окно поменьше */
.mcsetbox{background:var(--surface);color:var(--text);width:min(460px,92vw);max-height:calc(82vh / var(--ui-zoom,1));border-radius:var(--r24);border:1px solid var(--border)}
.mcsetbox .mchead{background:transparent;border-bottom:1px solid var(--border);padding:10px 12px}
.mcsetbox .mchead b{font-size:20px;font-weight:600}
.mcsetbox .icon-btn{color:var(--text2);background:var(--surface2);border-radius:var(--r12)}
.mcsetbox .mcbody,.mcset .mcbody{background:transparent;padding:0 16px 16px}
.mcsetbox .mcsec{color:var(--text2);font-size:14px;line-height:20px;font-weight:600;margin:18px 0 8px}
.mcsetbox .fld{background:var(--surface2);border:1px solid var(--border);border-radius:var(--r12);padding:8px 12px;margin-bottom:8px}
.mcsetbox .fld small{color:var(--muted);font-size:12px}
.mcsetbox .fld input,.mcsetbox .fld select{color:var(--text);font-size:16px}
.mcsetbox .fld select option{background:var(--surface);color:var(--text)}
.mcsetbox .two{gap:8px}.mcsetbox .two .fld{flex:1}
.mcsetbox .chk{background:var(--surface2);border:1px solid var(--border);border-radius:var(--r12);padding:12px;margin:0 0 8px;font-size:15px}
.mcsetbox .hint{color:var(--muted);font-size:13px}
.mcsetbox .btn{background:var(--surface2);color:var(--text);margin:0 0 8px;border-radius:var(--r12)}
.mcsetbox .row2 code{font-size:13px}
.pickbox{position:relative;height:min(380px,50vh);border-radius:12px;overflow:hidden;margin-bottom:8px}

.term{background:#0B0F17;color:#c7f0d8;font:13px/1.45 Consolas,monospace;border-radius:12px;padding:12px;height:min(300px,40vh);overflow:auto;white-space:pre-wrap;word-break:break-all;margin:0 0 8px}
.termrow{display:flex;gap:8px}.terminp{flex:1;min-width:0;padding:11px 12px;border-radius:var(--r12);border:1.5px solid var(--border-strong);background:var(--surface);color:var(--text);font:15px Consolas,monospace}

.tm-note{position:absolute;left:10px;right:10px;top:10px;z-index:5;background:rgba(30,36,50,.92);color:#fff;font-size:13px;padding:8px 10px;border-radius:10px;pointer-events:none}

/* разделы, подписи, управление каналом */
.conv.subconv{padding-left:34px;background:rgba(120,130,160,.06)}
.conv.subconv .avatar{transform:scale(.82);transform-origin:left center}
.chevbtn{display:inline-flex;margin-left:auto;margin-right:6px;opacity:.6;transition:transform .15s}.chevbtn svg{width:18px;height:18px}.chevbtn.open{transform:rotate(90deg)}
.avatar.sec{background:#5B6880;color:#fff;border-radius:32%}.secemo{font-size:1.15em;line-height:1}
.secbar{display:flex;gap:8px;overflow-x:auto;padding:8px 12px;border-bottom:1px solid var(--border);background:var(--surface);scrollbar-width:thin;flex:none}
.secchip{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:36px;padding:6px 13px;border-radius:var(--pill);border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:14px;font-weight:600;white-space:nowrap}
.secchip svg{width:16px;height:16px}.secchip.on{background:var(--accent-fill);border-color:transparent;color:var(--on-accent)}
.secchip.add{padding:6px 10px;color:var(--accent);border-style:dashed}.secchip .badge{position:static;margin:0}
.utag{display:inline-block;margin-left:7px;padding:1px 7px;border-radius:var(--r8);font-size:12px;font-weight:600;background:var(--surface2);color:var(--muted);vertical-align:1px}
.utag.owner{background:var(--air-soft);color:var(--air)}.utag.admin{background:var(--accent-soft);color:var(--accent)}
.postnote{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;text-align:center;gap:8px;padding:14px;color:var(--muted);font-size:15px;border-top:1px solid var(--border)}.postnote svg{width:18px;height:18px}
.manage .mhead{display:flex;align-items:center;gap:14px;margin-bottom:12px}.manage .mht{display:flex;flex-direction:column;min-width:0}.manage .mht b{font-size:20px}.manage .mht small{color:var(--muted)}
.manage .mdescr{background:var(--surface2);border-radius:12px;padding:10px 12px;margin-bottom:12px;display:flex;flex-direction:column;gap:4px}.manage .mdescr small{color:var(--muted)}.manage .mut{color:var(--muted)}.manage .grow{flex:1;display:flex;align-items:center}
.manage .u{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.manage .acts{display:flex;gap:6px;margin-left:auto}.manage .acts.wrap{flex-wrap:wrap;justify-content:flex-end}
.manage .secrow .u-main{display:flex;align-items:center;gap:10px;flex:1;min-width:0;background:none;border:0;color:inherit;padding:0}
.icon-btn.sm{width:36px;height:36px;font-size:20px}.icon-btn[disabled]{opacity:.3}
.emogrid{display:grid;grid-template-columns:repeat(9,1fr);gap:6px;margin:8px 0 12px}.emo{height:38px;border-radius:10px;border:1px solid var(--border);background:var(--surface2);font-size:19px;color:var(--muted)}.emo svg{width:18px;height:18px}.emo.on{border-color:var(--accent);background:var(--accent-soft)}
label.cap{display:block;margin:12px 0 0;color:var(--muted);font-size:13px}
.manage .secrow small,.manage .u small{display:block}.manage .secrow .u-main b{display:block}

/* режим «форум»: темы канала в списке слева */
.forumhead{display:flex;align-items:center;gap:8px;padding:6px 8px 10px;position:sticky;top:0;background:var(--surface);z-index:2;border-bottom:1px solid var(--border)}
.forumhead .ft{display:flex;flex-direction:column;min-width:0}.forumhead .ft b{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.forumhead .ft small{color:var(--muted)}
.conv.topic .avatar.topicav{width:48px;height:48px;border-radius:32%;background:#5B6880}
.conv.topic .avatar.topicav .secemo{font-size:24px}
.lockmini{display:inline-flex;margin-left:auto;margin-right:6px;opacity:.55}.lockmini svg{width:15px;height:15px}
.topicsmark{display:inline-flex;margin-left:auto;margin-right:6px;opacity:.5}.topicsmark svg{width:16px;height:16px}
/* правая панель информации */
.main.info-open{grid-template-columns:clamp(300px,28vw,400px) minmax(0,1fr) 340px}
.infopanel{display:none;flex-direction:column;min-height:0;background:var(--surface);border-left:1px solid var(--border);position:relative;overflow:hidden}
.infopanel .infoclose{position:absolute;top:10px;right:10px;z-index:3}
.infobody{overflow:auto;flex:1;min-height:0;padding:18px 0 14px}
.icard{display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px 16px 14px;text-align:center}
.icard b{font-size:20px}.icard small{color:var(--muted)}
.avatar.xl{width:84px;height:84px;font-size:32px}.avatar.chan.xl svg{width:38px;height:38px}
.qrow{display:flex;gap:10px;padding:4px 14px 14px;justify-content:center}
.qbtn{flex:1;max-width:110px;display:flex;flex-direction:column;align-items:center;gap:6px;padding:11px 6px;border-radius:var(--r16);border:1px solid var(--border);background:var(--surface2);color:var(--text);font-size:13px;font-weight:600}
.qbtn svg{width:22px;height:22px;color:var(--accent)}
.iline{display:flex;align-items:center;gap:10px;padding:12px 16px;border-top:1px solid var(--border)}
.iline .grow{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.iline small{color:var(--muted);font-size:13px}.iline a{color:var(--accent);word-break:break-all;text-decoration:none}
.iline .descr{white-space:pre-wrap;word-break:break-word;font-size:15px;line-height:1.4}
.istats{border-top:1px solid var(--border);padding:6px 0}.istat{display:flex;align-items:center;gap:16px;padding:10px 18px;font-size:15px}.istat svg{width:22px;height:22px;color:var(--muted)}
.imemhead{display:flex;flex-direction:column;gap:8px;padding:12px 16px 6px;border-top:1px solid var(--border)}
.imh{display:flex;align-items:center;gap:12px;color:var(--text2);font-size:14px;font-weight:600}.imh svg{width:20px;height:20px}
.minfo-q{width:100%;padding:9px 12px;border-radius:10px;border:1px solid var(--border);background:var(--surface2);color:var(--text);outline:none;font:inherit;font-size:14px}
.imembers{padding:4px 6px 12px}.imem{display:flex;align-items:center;gap:12px;width:100%;padding:8px 10px;border-radius:12px;text-align:left;background:none;border:0;color:inherit}
.imem:hover{background:var(--surface2)}.imem .grow{flex:1;min-width:0;display:flex;flex-direction:column}.imem small{color:var(--muted)}.imem small.on{color:var(--near)}
.imem .utag{margin-left:0;flex:none;max-width:44%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:1279px){.main.info-open{grid-template-columns:clamp(300px,28vw,400px) minmax(0,1fr)}.infopanel{position:fixed;top:0;right:0;bottom:0;width:min(380px,100vw);z-index:60;box-shadow:-10px 0 30px rgba(0,0,0,.3)}}
@media (max-width:839px){.main.info-open{grid-template-columns:1fr}}

.pinmini{display:inline-flex;margin-left:auto;opacity:.5}.pinmini svg{width:15px;height:15px;transform:rotate(45deg)}
.chiplock{display:inline-flex;opacity:.6}.chiplock svg{width:13px;height:13px}
.icon-btn.sm.on{color:var(--accent);background:var(--accent-soft)}
.emogrid{grid-template-columns:repeat(9,1fr)}

.avatar.sec .secemo{filter:drop-shadow(0 1px 1px rgba(0,0,0,.25))}

/* ===== «Настройки группы» (Telegram-стиль) ===== */
.gs .gstop{display:flex;align-items:center;gap:14px;margin-bottom:12px}
.gs .gsav{position:relative;border:0;background:none;padding:0;border-radius:50%;cursor:pointer;flex:none}
.gs .gscam{position:absolute;right:-2px;bottom:-2px;width:26px;height:26px;border-radius:50%;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;border:2px solid var(--surface,#fff)}
.gs .gscam .ic{width:14px;height:14px}
.gs .gsfields{flex:1;min-width:0}.gs .gsfields label,.gs .cap{display:block;font-size:14px;line-height:20px;font-weight:600;color:var(--text2);margin:0 0 6px}
.gs input:not([type=file]),.gs textarea{width:100%;min-height:48px;padding:11px 13px;border-radius:var(--r12);border:1.5px solid var(--border-strong);background:var(--surface);outline:none;font:inherit;color:inherit;box-sizing:border-box}
.gs input:focus,.gs textarea:focus{border-color:var(--accent)}
.gs textarea{resize:vertical}
.gslist{background:var(--surface);border:1px solid var(--border);border-radius:var(--r16);margin:0 0 14px;overflow:hidden}
[data-theme="dark"] .gslist{background:var(--surface2);border-color:transparent}
.gsrow{display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:10px 14px;border:0;background:none;color:inherit;font:inherit;font-size:16px;text-align:left;cursor:pointer}
.gsrow+.gsrow{border-top:1px solid var(--border)}
.gsrow:hover{background:var(--surface2)}.gsrow.dim{opacity:.55}
.gsic{width:36px;height:36px;border-radius:10px;background:var(--accent-soft);color:var(--accent);display:flex;align-items:center;justify-content:center;flex:none}
.gsic .ic{width:20px;height:20px}
.gslab{flex:1 1 auto;min-width:40%;line-height:20px}.gsval{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:45%;flex:0 1 auto;min-width:0}
.gsnew{font-size:11px;font-weight:800;background:var(--accent-fill);color:#fff;border-radius:6px;padding:2px 6px;letter-spacing:.3px}
.gschev{width:16px;height:16px;color:var(--muted);flex:none}
.gsfoot{display:flex;gap:10px;justify-content:flex-end;margin-top:6px}
.gsradio{background:var(--surface2);border-radius:var(--r16);margin-bottom:14px;overflow:hidden}
.gsr{display:flex;align-items:center;gap:12px;width:100%;padding:13px 14px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.gsr+.gsr{border-top:1px solid var(--border)}.gsr small{display:block;color:var(--muted)}
.gsdot{width:22px;height:22px;border-radius:50%;border:2px solid var(--border-strong);flex:none;position:relative}
.gsr.on .gsdot{border-color:var(--accent)}.gsr.on .gsdot::after{content:"";position:absolute;inset:3px;border-radius:50%;background:var(--accent)}
.gsinfo{background:var(--surface2);border-radius:var(--r16);padding:12px 14px;margin-bottom:12px}.gsinfo p{margin:8px 0 0;line-height:1.45;white-space:pre-wrap}.gsinfo .mut{color:var(--muted)}
.gslogrow{padding:10px 2px;border-bottom:1px solid var(--border)}.gslogrow small{display:block;color:var(--muted)}
.gsback{margin-right:4px}
.gsov h3{display:flex;align-items:center;gap:6px}.gsov h3 .icon-btn:last-child{margin-left:auto}
.gs .toggle{background:var(--surface2);border-radius:var(--r12);padding:8px 14px;margin-bottom:8px}

/* ===== превью ссылок, опросы, комментарии ===== */
.lpslot:empty{display:none}
.lpc{display:block;margin:6px 0 2px;padding:6px 10px 8px;border-left:3px solid var(--accent);border-radius:4px 10px 10px 4px;background:var(--accent-soft);color:inherit;text-decoration:none;max-width:340px;overflow:hidden}
.lpc:hover{filter:brightness(.97)}
.lpsite{color:var(--accent);font-weight:700;font-size:13px}
.lpt{font-weight:700;font-size:15px;line-height:1.3;margin-top:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.lpd{font-size:14px;line-height:1.35;margin-top:2px;opacity:.85;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;white-space:normal}
.lpimg{position:relative;margin-top:8px;border-radius:10px;overflow:hidden;background:rgba(127,127,127,.15)}
.lpimg img{display:block;width:100%;max-height:200px;object-fit:cover}
.lpplay{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px;border-radius:50%;background:rgba(0,0,0,.55);color:#fff;display:flex;align-items:center;justify-content:center}
.lpplay .ic{width:22px;height:22px;fill:#fff}
.poll{min-width:240px;max-width:340px;padding:2px 0}
.poll .pq{font-weight:700;font-size:16px;line-height:1.3;white-space:pre-wrap}
.poll .pmeta{font-size:12px;opacity:.7;margin:2px 0 8px}
.popt{position:relative;display:flex;align-items:center;gap:10px;width:100%;text-align:left;border:0;background:none;color:inherit;font:inherit;padding:7px 4px;cursor:pointer;overflow:hidden;border-radius:8px}
.popt:disabled{cursor:default}
.popt .pchk{width:20px;height:20px;border-radius:50%;border:2px solid currentColor;opacity:.55;flex:none;display:flex;align-items:center;justify-content:center;z-index:1}
.popt .pchk.sq{border-radius:6px}
.popt.me .pchk{background:var(--accent);border-color:var(--accent);opacity:1;color:#fff}.popt .pchk .ic{width:13px;height:13px}
.popt .pot{flex:1;z-index:1;word-break:break-word}.popt .ppc{font-weight:700;z-index:1;font-size:14px}
.popt .pbar{position:absolute;left:0;bottom:0;height:4px;border-radius:2px;background:var(--accent);opacity:.8;transition:width .3s}
.popt:not(:disabled):hover{background:rgba(127,127,127,.1)}
.poll .pfoot{display:flex;gap:12px;align-items:center;font-size:13px;opacity:.85;margin-top:6px;flex-wrap:wrap}
.poll .plink{border:0;background:none;color:var(--accent);font:inherit;cursor:pointer;padding:0;font-weight:600}
.cmtbar{display:flex;align-items:center;gap:8px;width:calc(100% + 20px);margin:8px -10px -4px;padding:8px 12px;border:0;border-top:1px solid rgba(127,127,127,.25);background:none;color:var(--accent);font:inherit;font-weight:600;cursor:pointer;text-align:left}
.cmtbar .ic{width:18px;height:18px}.cmtbar span{flex:1}.cmtbar .gschev{margin-left:auto}
.cmtbar:hover{background:rgba(127,127,127,.1)}
.meta .views{display:inline-flex;align-items:center;gap:3px}.meta .views .ic{width:14px;height:14px}
.threadov .modal{display:flex;flex-direction:column;max-height:88vh}
.threadbox{display:flex;flex-direction:column;min-height:0;flex:1}
.tpost{display:flex;gap:10px;align-items:center;padding:8px 10px;border-left:3px solid var(--accent);background:var(--surface2);border-radius:4px 10px 10px 4px;margin-bottom:10px}
.tpost .grow{min-width:0}.tptxt{opacity:.8;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tlist{flex:1;overflow:auto;min-height:160px;max-height:50vh;padding:2px}
.tc{display:flex;gap:10px;padding:8px 0}.tcb{flex:1;min-width:0}.tcb small{display:block;opacity:.6;margin-top:2px}
.tcn{display:flex;align-items:center;gap:6px}.tcdel{margin-left:auto;opacity:.5}
.tcomp{display:flex;gap:8px;align-items:flex-end;margin-top:10px}
.tcomp textarea{flex:1;padding:10px 12px;border-radius:14px;border:1.5px solid var(--border);background:var(--surface2);outline:none;font:inherit;color:inherit;resize:none}
.pollform input{margin-bottom:8px}.pollform .popts{display:flex;flex-direction:column}
.row.mine .cmtbar,.row.mine .poll .plink,.row.mine .lpsite{color:inherit}
.row.mine .cmtbar{border-top-color:rgba(255,255,255,.3)}
.row.mine .lpc{border-left-color:rgba(255,255,255,.8);background:rgba(255,255,255,.14)}
.row.mine .popt.me .pchk{background:#fff;color:var(--accent);border-color:#fff}
.row.mine .popt .pbar{background:#fff}
.row.mine .poll .plink{text-decoration:underline}

/* ===== боковое меню (бургер) ===== */
.searchrow{display:flex;align-items:center;gap:4px;margin:0 8px 8px 8px}.searchrow .search{margin:0;flex:1;min-width:0}
.hamb{flex:none}
.drawer{position:fixed;inset:0;z-index:300;background:rgba(0,0,0,0);transition:background .2s}
.drawer.open{background:rgba(0,0,0,.45)}
.drpanel{position:absolute;left:0;top:0;bottom:0;width:min(310px,86vw);background:var(--surface);color:var(--text);display:flex;flex-direction:column;transform:translateX(-100%);transition:transform .2s ease;box-shadow:var(--shadow-3)}
.drawer.open .drpanel{transform:none}
.drhead{padding:calc(20px + env(safe-area-inset-top)) 18px 16px;background:var(--surface2);border-bottom:1px solid var(--border);color:var(--text)}
.drav{border:0;background:none;padding:0;border-radius:50%;cursor:pointer}
.drname{margin-top:10px}.drname b{display:block;font-size:17px;line-height:22px;font-weight:600}.drname small{color:var(--text2);font-size:13px}
.dritems{padding:8px 0;flex:1;overflow:auto}
.dritem{display:flex;align-items:center;gap:18px;width:100%;min-height:52px;padding:10px 22px;border:0;background:none;color:inherit;font:inherit;font-size:16px;text-align:left;cursor:pointer}
.dritem:hover{background:var(--surface2)}.dritem .ic{width:24px;height:24px;color:var(--text2);flex:none}.dritem span:first-of-type{flex:1}
.dritem .sw{flex:none}
.drsep{height:1px;background:var(--border);margin:6px 0}
.drfoot{padding:14px 22px;color:var(--muted);font-size:13px}
.drval{font-size:13px;color:var(--muted)}.drval.on{color:var(--near)}
/* пример пузырей на странице «Оформление» */
.thprev{background:var(--bg);border:1px solid var(--border);border-radius:var(--r16);padding:12px;display:flex;flex-direction:column;gap:6px}
.thprev .row{animation:none;margin:0}.thprev .bubble{max-width:86%}

/* ===== настройки (Telegram-стиль) ===== */
.stbody .sthead{padding:4px 2px 14px}.stname{display:block;font-size:20px;line-height:26px;font-weight:600}.stsub{color:var(--muted);font-size:14px}.stsub.on{color:var(--near)}
.stzoom{padding:4px 14px 12px}.stzoom .toggle{background:none;padding:10px 0;margin:0}
.stzrow{display:flex;align-items:center;gap:12px}.stzrow input[type=range]{flex:1;accent-color:var(--accent);padding:0;border:0;background:none}
.stzv{min-width:46px;text-align:right;color:var(--muted);font-size:13px}
.stbody .group{margin-bottom:18px}
.stzscale{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin:2px 58px 0 2px}
/* 1.10: новичок ждёт подтверждения; приглашения */
.limban{margin:8px 10px;padding:12px 14px;border-radius:var(--r16);background:var(--accent-soft);border:1px solid var(--accent);display:flex;flex-direction:column;gap:8px;font-size:14px;line-height:1.4}
.limban b{font-size:15px}.limban .btn{align-self:flex-start}
.invrow span{font-size:13px}.invrow button+button{margin-left:6px}
.invmine{margin-top:10px;display:flex;flex-direction:column;gap:6px}.invout{margin-top:10px}
/* управление ретранслятором MeshCore (1.11) */
.rpbox input, .rpbox select { padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--border-strong); background: var(--surface); color: inherit; min-width: 0; }
.rpbox > div > input[type=password] { width: 100%; margin-bottom: 8px; }
.rpbox.busy { opacity: .75; }
.rpkeep { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0 0 10px; }
.rpsec { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; margin: 16px 0 8px; font-size: 14px; }
.rpstat .kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 3px 0; }
.rpstat .kv span { color: var(--muted); }
.rpgrid { display: flex; flex-direction: column; gap: 6px; }
.rprow { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 6px; align-items: center; font-size: 13px; }
.rpacts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rplog { white-space: pre-wrap; font-size: 12px; max-height: 160px; overflow: auto; background: var(--surface2); border-radius: 10px; padding: 8px; margin: 0; min-height: 32px; }
@media (max-width: 520px) { .rprow { grid-template-columns: 1fr auto; } .rprow > span { grid-column: 1 / -1; } }
.rpcon { display: flex; gap: 6px; } .rpcon input { flex: 1; }
.bubble .name .byname { font-weight: 500; opacity: .7; font-size: 12px; }

/* ============ 1.27: ровный фон, плоские пузыри, одна шапка ============ */
@media (min-width: 840px) { .stov .modal, .gsov .modal { width: min(560px, 100%); } }
.chat { background: var(--bg); }
.chat-head { background: var(--surface); backdrop-filter: none; }
.chat-head .t small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row.theirs.last .bubble { border-bottom-left-radius: 4px; }
.row.mine.last .bubble { border-bottom-right-radius: 4px; }
/* комментарии к постам: компактная ссылка вместо полосы под каждым сообщением */
.cmtbar { width: auto; margin: 4px 0 0; padding: 3px 0; border-top: 0; font-size: 14px; gap: 6px; }
.cmtbar .ic { width: 16px; height: 16px; }
.cmtbar span { flex: none; }
.cmtbar .gschev { display: none; }
.cmtbar:hover { background: none; text-decoration: underline; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* телефон: в шапке беседы — назад, плитка, название, поиск и ⋮; остальное — в меню */
@media (max-width: 839px) {
  .chat-head { gap: 4px; padding: 6px 6px 6px 2px; min-height: 56px; }
  #hinfo, #hdel, #hradio, #hvid { display: none !important; }
  .chat-head .t b { font-size: 17px; }
  .chat-head .t small { font-size: 13px; }
}
/* окно «Эфир»: способы подключения рации */
.mcconn { display: flex; flex-direction: column; gap: 8px; }
.mcopt { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: var(--r16); background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.mcopt b { display: block; font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.mcopt span { display: block; font-size: 14px; color: var(--muted); line-height: 1.35; }
.mcopt:not(.off):hover { border-color: var(--accent); }
.mcopt.off { opacity: .6; cursor: default; background: transparent; }
.mcopt.off b { font-weight: 600; }
.mcble p { font-size: 14px; color: var(--muted); margin: 4px 2px; }
.mcble .mcopt { background: var(--surface); }
.mctcp { display: flex; gap: 6px; }
.mctcp input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border-radius: var(--r12); border: 1.5px solid var(--border-strong); background: var(--surface); color: inherit; }
.mctcp input[type=number] { flex: none; width: 90px; }
.mccard .mcopt { color: inherit; }
.mcscreen .mcopt.off { background: transparent; }

/* ---- игры в чате (1.16) ---- */
.menu .it .gm-ic { width: 22px; text-align: center; font-size: 19px; line-height: 1; }
.gm { min-width: 250px; max-width: 320px; }
.gm-t { font-weight: 700; }
.gm-p { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.gm-s { font-weight: 600; margin-bottom: 8px; }
.gm-line { font-size: 14px; color: var(--muted); }
.gm-line.bad { color: var(--danger); }
.gm-b { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.gm-n { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.35; }
.gm-n.warn { color: var(--danger); }
.gm-cap { font-size: 13px; font-weight: 600; color: var(--text2); margin: 8px 0 4px; }
.gm button[disabled] { cursor: default; }
.gm-ttt { display: grid; grid-template-columns: repeat(3, 64px); gap: 6px; }
.gm-c { width: 64px; height: 64px; border-radius: var(--r12); background: var(--surface2); font-size: 34px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: center; }
.gm-c:not([disabled]):hover { background: var(--accent-soft); }
.gm-c.x { color: var(--accent); } .gm-c.o { color: var(--air); }
.gm-c.win { background: var(--ok-soft); }
.gm-chess { display: grid; grid-template-columns: repeat(8, 1fr); width: min(300px, 72vw); aspect-ratio: 1; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.gm-q { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: clamp(20px, 6.4vw, 30px); line-height: 1; padding: 0; position: relative; color: #1b1b1b; }
.gm-q.lt { background: #eed9b6; } .gm-q.dk { background: #b58863; }
.gm-q.w { color: #fff; text-shadow: 0 0 2px #000, 0 1px 1px #000; } .gm-q.b { color: #111; text-shadow: 0 0 1px #fff8; }
.gm-q.last { box-shadow: inset 0 0 0 100px rgba(255, 213, 79, .38); }
.gm-q.sel { box-shadow: inset 0 0 0 3px #2B5FE0, inset 0 0 0 100px rgba(43, 95, 224, .25); }
.gm-q.to::after { content: ''; width: 28%; height: 28%; border-radius: 50%; background: rgba(20, 60, 160, .45); }
.gm-q.cap { box-shadow: inset 0 0 0 3px rgba(220, 50, 50, .8); }
.gm-seaw { min-width: 240px; }
.gm-sea { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; width: min(260px, 70vw); }
.gm-z { aspect-ratio: 1; border-radius: 4px; padding: 0; background: color-mix(in srgb, var(--accent) 12%, var(--surface2)); position: relative; }
.gm-sea.act .gm-z.w:hover { background: color-mix(in srgb, var(--accent) 40%, var(--surface2)); }
.gm-z.ship { background: #5b6b86; }
.gm-z.miss::after { content: ''; position: absolute; inset: 38%; border-radius: 50%; background: var(--muted); }
.gm-z.hit { background: #e8a33d; } .gm-z.sunk { background: #d6453d; }
.gm-z.hit::after, .gm-z.sunk::after { content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; }
.row.mine .gm .gm-p, .row.mine .gm .gm-cap, .row.mine .gm .gm-n, .row.mine .gm-line { color: inherit; opacity: .85; }
.row.mine .gm .gm-n.warn, .row.mine .gm-line.bad { color: #ffd2cf; opacity: 1; }
.gm-dr .gm-q.lt { background: #f0e2c6; } .gm-dr .gm-q.dk { background: #8a5a3c; }
.gm-pc { width: 74%; height: 74%; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25), 0 2px 3px rgba(0,0,0,.35); }
.gm-pc.w { background: radial-gradient(circle at 35% 30%, #fff, #e7e2d6 60%, #c9c1b0); }
.gm-pc.b { background: radial-gradient(circle at 35% 30%, #6b6b6b, #2a2a2a 60%, #111); }
.gm-pc.k::after { content: '♛'; font-size: 60%; line-height: 1; color: #c8961e; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.gm-dr .gm-q.mov .gm-pc { box-shadow: 0 0 0 3px rgba(46,107,240,.75), 0 2px 3px rgba(0,0,0,.35); }
.gm-dr .gm-q.cap { box-shadow: inset 0 0 0 3px rgba(220,50,50,.85); }
/* 1.17: значок пути своего сообщения (📶 своя сеть / 🌐 Интернет) */
.via { display: inline-flex; align-items: center; background: none; }
.via .ic { width: 15px; height: 15px; stroke-width: 2.2; }
.meta .via { color: inherit; opacity: .9; }
.row.mine .meta .via { color: #fff; }
.row.mine .meta .via.ok { color: var(--ticks-read); opacity: 1; }       /* доставлено (две галочки) — голубой на синем */
.mccap .via { color: var(--muted); }
.mccap .via.ok { color: var(--accent); }

/* ===== 1.18: панель вложений (📎) ===== */
/* 1.21: панель выезжает снизу с «пружиной», тянется за ручку вверх (на весь экран) и вниз (закрыть) */
@keyframes atup2 { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeout { to { opacity: 0; } }
.atgripz { flex: none; padding: 4px 0 2px; cursor: grab; touch-action: none; }
.atgripz:active { cursor: grabbing; }
.attile.pick { cursor: pointer; }
.attile.pick img { transition: transform .2s; }

/* ===== 1.21: альбом-мозаика ===== */
.album { display: flex; flex-direction: column; gap: 2px; border-radius: 14px; overflow: hidden; width: 100%; }
.bubble.albb { width: 368px; }
.albr { display: flex; gap: 2px; height: 120px; }
.albr.n1 { height: 220px; }
.albr.n2 { height: 160px; }
.albt { position: relative; flex: 1; min-width: 0; background: rgba(120, 130, 160, .18); cursor: zoom-in; overflow: hidden; }
.albt img, .albt video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.albt:hover img, .albt:hover video { transform: scale(1.03); }
.albdur { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; }
.albdur .ic { width: 16px; height: 16px; fill: #fff; }
.albph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.albprog { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 2px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.albprog i { display: block; height: 100%; width: 0; background: #fff; transition: width .15s; }
.albfail { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--danger-fill); color: #fff; font-weight: 800; display: grid; place-items: center; }
.bubble.media .album + .txt { padding: 6px 8px 0; }
.vidbox { position: relative; }
.vidfs { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; opacity: .85; }
.vidfs .ic { width: 18px; height: 18px; }

/* ===== 1.21: просмотр на весь экран ===== */
.mv { --mvbg: 1; position: fixed; inset: 0; z-index: 115; background: rgba(5, 8, 16, var(--mvbg)); color: #fff; overflow: hidden; animation: mvin .2s ease-out; user-select: none; -webkit-user-select: none; }
@keyframes mvin { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.mv.out { animation: mvout .2s ease-in forwards; }
@keyframes mvout { to { opacity: 0; transform: scale(.97); } }
.mvtrack { position: absolute; inset: 0; touch-action: none; }
.mvslide { position: absolute; top: 0; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 0 120px; box-sizing: border-box; }
.mv.bare .mvslide { padding: 0; }
.mvslide img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s ease; touch-action: none; }
.mv.zoomed .mvslide img { transition: none; cursor: grab; }
.mvslide video { max-width: 100%; max-height: 100%; background: #000; }
.mvph { color: rgba(255, 255, 255, .75); font-size: 15px; }
.mvtop { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 18px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); transition: opacity .2s, transform .2s; }
.mvt { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 6px; }
.mvt b { font-size: 16px; }
.mvt small { font-size: 13px; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvb { width: 44px; height: 44px; border-radius: 50%; color: #fff; display: grid; place-items: center; flex: none; }
.mvb:hover { background: rgba(255, 255, 255, .12); }
.mvb .ic { width: 22px; height: 22px; }
.mvbot { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 0 calc(env(safe-area-inset-bottom, 0px) + 10px); background: linear-gradient(transparent, rgba(0, 0, 0, .6)); transition: opacity .2s, transform .2s; }
.mv.bare .mvtop { opacity: 0; transform: translateY(-12px); pointer-events: none; }
.mv.bare .mvbot, .mv.bare .mvnav { opacity: 0; transform: translateY(12px); pointer-events: none; }
.mvcap { max-height: 22vh; overflow-y: auto; padding: 0 16px 10px; font-size: 15px; line-height: 1.45; }
.mvcap a { color: #9cc3ff; }
.mvstrip { display: flex; gap: 4px; overflow-x: auto; padding: 0 calc(50% - 22px); scrollbar-width: none; }
.mvstrip::-webkit-scrollbar { display: none; }
.mvth { flex: none; width: 40px; height: 52px; border-radius: 8px; overflow: hidden; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; opacity: .55; transition: opacity .15s, transform .15s, width .15s; padding: 0; }
.mvth img { width: 100%; height: 100%; object-fit: cover; }
.mvth .ic { width: 18px; height: 18px; }
.mvth.on { opacity: 1; width: 52px; box-shadow: 0 0 0 2px #fff; }
.mvnav { position: absolute; top: 50%; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center; z-index: 2; transition: opacity .2s, background .15s; }
.mvnav:hover { background: rgba(255, 255, 255, .26); }
.mvnav.l { left: 14px; }
.mvnav.r { right: 14px; }
.mvnav.r .ic { transform: rotate(180deg); }
@media (hover: none) { .mvnav { display: none; } }
.menu.mvmenu { z-index: 130; }

/* ===== 1.21: редактор перед отправкой ===== */
.ated { position: fixed; inset: 0; z-index: 105; background: #05080f; color: #fff; display: flex; flex-direction: column; animation: mvin .2s ease-out; }
.edstage { touch-action: none; }
.ated.out { animation: mvout .18s ease-in forwards; }
.edtop { display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 8px; }
.edtop .cfbtn { position: static; }
.edcnt { flex: 1; text-align: center; font-size: 15px; }
.edstage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 12px; overflow: hidden; }
.edstage img, .edstage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; transition: transform .25s cubic-bezier(.2, .9, .3, 1.1); }
.edstage img.odd { max-width: calc(100dvh - 240px); max-height: calc(100vw - 24px); }
.edfile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 20px; }
.edfile .ic { width: 48px; height: 48px; }
.edhint { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 12px; background: rgba(0, 0, 0, .55); padding: 4px 10px; border-radius: 10px; white-space: nowrap; }
.edstrip { display: flex; gap: 6px; padding: 6px 12px; overflow-x: auto; flex: none; scrollbar-width: none; justify-content: safe center; }
.edth { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; padding: 0; opacity: .6; transition: opacity .15s, box-shadow .15s; }
.edth img, .edth video { width: 100%; height: 100%; object-fit: cover; }
.edth.on { opacity: 1; box-shadow: 0 0 0 2px var(--accent); }
.edbot { display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 12px); flex: none; }
.edbot .atcap { background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }
.edbot .atcap::placeholder { color: rgba(255, 255, 255, .6); }
.edbot .atq { background: rgba(255, 255, 255, .12); color: #fff; }
.edbot .atq.on { background: var(--accent); color: #fff; }
.edbot .send-btn { position: relative; flex: none; }

.atgrip { width: 44px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: 9px auto 4px; flex: none; }
.atbody { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px 10px; }
.attile { position: relative; aspect-ratio: 1; border-radius: var(--r12); overflow: hidden; background: var(--surface2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text); font-size: 14px; font-weight: 600; border: 0; padding: 0; }
.attile .ic { width: 30px; height: 30px; }
.attile.stub:hover { filter: brightness(.96); }
.attile img, .attile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.attile.cam { background: #0d1320; color: #fff; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.attile.cam .atcamhint { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; line-height: 1.25; text-align: center; background: rgba(0, 0, 0, .45); border-radius: 8px; padding: 3px 4px; font-weight: 500; }
.attile.cam.err .atcamhint { top: 6px; bottom: auto; position: relative; background: none; font-size: 12px; }
.attile.cam::after { content: ''; position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.attile.cam.err::after { display: none; }
.attile.cam.rec::after { background: var(--danger-fill); animation: atpulse 1s infinite; }
.attile.cam.flash { filter: brightness(1.8); }
@keyframes atpulse { 50% { opacity: .45; } }
.atflip { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 18px; z-index: 2; }
.attile.pick { background: var(--surface2); }
.atnum { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--accent-fill); color: var(--on-accent); font-size: 13px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.atdel { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.atdel .ic { width: 15px; height: 15px; }
.atvid { position: absolute; bottom: 6px; right: 8px; font-size: 16px; }
.atfn { padding: 8px; font-size: 12px; word-break: break-all; text-align: center; }
.athint { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 10px 4px 0; }
.atcap { flex: 1; min-width: 0; min-height: 44px; padding: 11px 14px; border-radius: var(--r24); border: 1.5px solid var(--border-strong); background: var(--surface); outline: none; font-size: 16px; }
.atcap:focus { border-color: var(--accent); }
.atq { flex: none; min-height: 40px; padding: 9px 12px; border-radius: var(--pill); background: var(--surface2); font-size: 13px; font-weight: 700; color: var(--muted); }
.atq.on { background: var(--accent-soft); color: var(--accent); }
.atsend .send-btn { position: relative; flex: none; }
.attab.off { opacity: .4; }
/* 1.34: скрепка как в Telegram — камера на 2×2 клетки со значком, номер выбора справа вверху, у видео ▶ и длительность,
   шапка «← Галерея ⋮» у развёрнутой на весь экран панели */
.atcamic { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .35); display: grid; place-items: center; color: #fff; z-index: 1; }
.atcamic .ic { width: 22px; height: 22px; }
.attile.cam::after { top: auto; bottom: 34px; left: 50%; margin-left: -18px; width: 36px; height: 36px; }
.attile.pick .atdel { right: auto; left: 6px; }
.attile.pick .atvid { left: 6px; right: auto; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600; }
.attile.pick .atvid .ic { width: 11px; height: 11px; }
.athead { display: none; position: relative; align-items: center; gap: 8px; padding: 0 6px 6px; flex: none; }
.athead b { flex: 1; font-size: 18px; font-weight: 700; }
.atsheet.tall .athead { display: flex; }
.atmenu { position: absolute; right: 8px; top: 44px; z-index: 3; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); box-shadow: var(--shadow-3); padding: 6px; display: flex; flex-direction: column; }
.atmi { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r12); text-align: left; font-size: 15px; color: var(--text); }
.atmi:hover { background: var(--surface2); }
.atmi .ic { width: 20px; height: 20px; color: var(--muted); }
.atbig { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px; border-radius: var(--r16); background: var(--surface2); margin-bottom: 8px; }
.atbig .ic { width: 28px; height: 28px; flex: none; color: var(--accent); }
.atbig b { display: block; font-size: 16px; }
.atbig small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; line-height: 1.35; }
.atbig.warn .ic { color: var(--danger); }
.atbig.col { flex-direction: column; align-items: stretch; }
.atrow { display: flex; align-items: center; gap: 14px; }
.atchips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding-left: 42px; }
.atgames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.atgame { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--r16); background: var(--surface2); font-weight: 600; text-align: left; }
.atgame .gm-ic { font-size: 22px; width: 30px; text-align: center; }
.geo.live .geo-c:first-of-type { color: var(--ok); font-weight: 600; }

/* ===== 1.18: статьи ===== */
.artcard { cursor: pointer; min-width: min(300px, 70vw); max-width: 420px; }
.artcard .artcov { width: calc(100% + 24px); margin: -8px -12px 8px; max-height: 200px; object-fit: cover; display: block; border-radius: 14px 14px 0 0; }
.artk { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.artk .ic { font-size: 14px; }
.artt { font-size: 18px; font-weight: 800; line-height: 1.25; margin: 2px 0 6px; }
.arte { font-size: 14px; line-height: 1.45; color: var(--muted); margin-bottom: 8px; }
.row.mine .artk, .row.mine .arte { color: rgba(255, 255, 255, .82); }
.artov .modal { width: min(720px, 100%); max-height: min(calc(92vh / var(--ui-zoom, 1)), 900px); }
.artread .artcov { width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; margin-bottom: 12px; }
.artread h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.2; }
.artby { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.artbody { font-size: 16px; line-height: 1.6; }
.artbody p { margin: 0 0 12px; }
.artbody h4 { font-size: 18px; margin: 18px 0 8px; }
.artbody ul { margin: 0 0 12px; padding-left: 22px; }
.artbody li { margin-bottom: 4px; }
.artbody blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface2); border-radius: 0 10px 10px 0; }
.artbody a { color: var(--accent); word-break: break-all; }
.artedit { display: flex; flex-direction: column; gap: 10px; }
.arti { padding: 12px 14px; border-radius: var(--r12); border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 18px; font-weight: 700; outline: none; }
.artb { min-height: 240px; padding: 12px 14px; border-radius: var(--r12); border: 1.5px solid var(--border-strong); background: var(--surface); font-size: 15px; line-height: 1.5; outline: none; resize: vertical; font-family: inherit; }
.arti:focus, .artb:focus { border-color: var(--accent); }
.arttools { display: flex; gap: 6px; flex-wrap: wrap; }
.arttb { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--surface2); font-weight: 800; font-size: 15px; display: inline-grid; place-items: center; }
.arttb:hover { filter: brightness(.95); }
.artprev { min-height: 240px; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--border); }
.artprev h2 { margin: 0 0 10px; font-size: 22px; }
.artcovbox { display: flex; align-items: center; gap: 10px; }
.artcovbox img { width: 96px; height: 64px; object-fit: cover; border-radius: 10px; }

/* ===== 1.19: устройства, подтверждение входа, проверка собеседника, QR ===== */
.lwait { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.lwait p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.spin { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.devrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface2); border-radius: 12px; margin-bottom: 6px; }
.devrow .devic { font-size: 24px; color: var(--accent); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); }
.devrow .grow { flex: 1; min-width: 0; }
.devrow b { display: block; font-size: 15px; }
.devrow small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.warnkv { background: var(--air-soft); }
.vfst { padding: 10px 12px; border-radius: 12px; margin-bottom: 10px; font-weight: 700; background: var(--surface2); }
.vfst.ok { color: var(--ok); background: var(--ok-soft); }
.vfst.changed { color: var(--danger); background: var(--danger-soft); }
.vfmark.ok { color: var(--ok); }
.vfmark.changed { color: var(--danger); }
.qrscan { display: flex; flex-direction: column; gap: 10px; }
.qrvid { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; }
.qrvid video { width: 100%; height: 100%; object-fit: cover; }
.qrframe { position: absolute; inset: 18%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }
.myqr { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.myqr .qr { align-self: center; }
.lcode { font-size: 32px; line-height: 36px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; text-align: center; margin: 4px 0 12px; color: var(--accent); }
.lchoices { display: flex; gap: 8px; }
.lchoices .btn { flex: 1; font-size: 22px; font-weight: 800; padding: 12px 0; }

/* ===== 1.20: камера на весь экран ===== */
.camfs { position: fixed; inset: 0; z-index: 120; background: #000; display: flex; align-items: center; justify-content: center; animation: fade .15s; touch-action: none; user-select: none; -webkit-user-select: none; }
.camfs video { width: 100%; height: 100%; object-fit: cover; }
.cftop { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top, 0)) 14px 12px; }
.cfbtn { width: 46px; height: 46px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 22px; display: grid; place-items: center; }
.cfbtn .ic { width: 24px; height: 24px; }
.cfbot { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 18px 18px calc(26px + env(safe-area-inset-bottom, 0)); background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.cfmid { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cfshut { position: relative; width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; display: grid; place-items: center; cursor: pointer; transition: transform .12s; }
.cfshut i { width: 60px; height: 60px; border-radius: 50%; background: #fff; transition: all .15s; }
.cfshut:active { transform: scale(.94); }
.cfshut.rec { border-color: #D7263D; }
.cfshut.rec i { width: 30px; height: 30px; border-radius: 8px; background: #D7263D; animation: atpulse 1s infinite; }
.cfshut.flash i { background: #ddd; }
.cfshut .atcamhint { position: absolute; top: -34px; white-space: nowrap; color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.cfdone { justify-self: end; display: none; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: var(--pill); background: var(--accent-fill); color: #fff; font-weight: 700; font-size: 15px; }
.cfdone.on { display: inline-flex; }
.cfcnt { min-width: 22px; height: 22px; border-radius: 11px; background: #fff; color: var(--accent); font-size: 13px; font-weight: 800; display: grid; place-items: center; padding: 0 5px; }
.attile.cam { cursor: pointer; }
.attile.cam .atcamhint { font-size: 12px; font-weight: 600; }
.genpw { align-self: flex-start; margin: -4px 0 6px; font-weight: 600; }
.genhint { text-align: left; margin: 0 0 8px; }

/* ===== 1.21: плавность ===== */
.overlay.out { animation: fadeout .16s forwards; }
.overlay.out .modal { transform: scale(.97); transition: transform .16s ease-in; }
.overlay.sheet .modal { animation: atup2 .26s cubic-bezier(.2, .9, .3, 1.08); }
.down-btn { animation: pop .18s ease-out; transition: transform .15s; }
.down-btn:active { transform: scale(.92); }
.down-btn .badge { animation: pop .2s ease-out; }
.albt { animation: fade .25s ease-out; }

/* 1.22: выбор нескольких сообщений */
.selbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 52px; box-sizing: border-box; animation: fadein .15s ease; }
.selbar b { font-size: 16px; }
.selbar .icon-btn.danger { color: var(--danger); }
.selbar .icon-btn[disabled] { opacity: .35; pointer-events: none; }
#chatview.selmode .chat-head { display: none; }
#chatview.selmode #msgs .row { cursor: pointer; position: relative; }
#chatview.selmode #msgs .row::before { content: ''; flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); margin: auto 8px auto 2px; box-sizing: border-box; align-self: center; }
#chatview.selmode #msgs .row.sel::before { background: var(--accent-fill) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--accent); }
#chatview.selmode #msgs .row.sel { background: var(--accent-soft); border-radius: var(--r12); }
#chatview.selmode #msgs .row .bubble { pointer-events: none; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* 1.22: «Инструменты»; 1.23 — в оформлении ALT (светлое и тёмное, как весь чат), компактно */
.mcscreen.tools { background: var(--bg); color: var(--text); font-size: 15px; }
.mcscreen.tools .mchead { background: var(--surface); border-bottom: 1px solid var(--border); padding: 6px 8px; }
.mcscreen.tools .mchead .mct b { font-size: 17px; font-weight: 600; }
.mcscreen.tools .icon-btn { color: var(--text); }
.mcscreen.tools .icon-btn:hover { background: var(--surface2); }
.mcscreen.tools .mcbody { padding: 10px 12px 28px; width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box; }
.mcscreen.tools .mccard .hint { color: var(--text2); }
.tools .tlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.tcard { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; text-align: left; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: var(--r16); padding: 10px 12px; cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.tcard:hover { background: var(--surface2); border-color: var(--accent); }
.tcard .tic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.tcard .tic .ic { width: 20px; height: 20px; }
.tcard .tmid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tcard .tmid b { font-weight: 600; font-size: 16px; }
.tcard .tmid small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.tools .tnote { margin-top: 10px; text-align: left; }
.tools .group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); padding: 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.tools .group > label { color: var(--text2); font-size: 14px; font-weight: 600; }
.tools .tcenter { align-items: center; text-align: center; }
.tools .hint { color: var(--muted); font-size: 13px; text-align: left; margin: 0; }
.tools .hint.err { color: var(--danger); }
.tools .btn { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.tools .btn:not(.primary) { background: var(--surface2); color: var(--text); border-color: var(--border); }
.tools .btn.primary { align-self: flex-start; }
.tools select, .tools input[type=number], .tools input.tq { background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong); border-radius: 10px; min-height: 40px; padding: 6px 8px; font: inherit; font-size: 15px; }
.tools input.tq { width: 100%; box-sizing: border-box; padding: 8px 10px; }
.tools input[type=number] { width: 92px; }
.rnode small .sigv { margin-left: 6px; }
.mcscreen.tools .tm-b { background: var(--surface); color: var(--text); }
.trow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.trow.sp { justify-content: space-between; margin: 8px 0; }
.tchk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.tchk input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.tnum { display: inline-flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); }
.tpath { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.tpath:empty { display: none; }
.tchips { display: flex; flex-wrap: wrap; gap: 6px; }
.tchip { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent); border-radius: var(--pill); padding: 2px 2px 2px 3px; font-size: 14px; }
.tchip em { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-fill); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.tchip .icon-btn.sm { width: 26px; height: 26px; }
.tools .ulist.tl { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; }
.tools .ulist .u { color: var(--text); padding: 6px 8px; gap: 10px; border-radius: 12px; }
.tools .ulist .u.sel { background: var(--accent-soft); }
.tools .ulist .u small { color: var(--muted); font-size: 13px; }
.tools .ulist .tmid { flex: 1; min-width: 0; }
.tools .tav { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--air-soft); color: var(--air); }
.tools .tav .ic { width: 18px; height: 18px; }
.tools .u.sel .tav { background: var(--accent-fill); color: #fff; font-size: 13px; }
.tools .tok { color: var(--accent); display: grid; place-items: center; }
.tools .tok .ic { width: 20px; height: 20px; stroke-width: 2.6; }
.tsig { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; margin-top: 2px; }
/* антенки уровня сигнала */
.sigv { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; margin-right: 6px; color: var(--text); }
.sig { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 13px; vertical-align: middle; }
.sig i { width: 3px; border-radius: 1px; background: color-mix(in srgb, var(--muted) 35%, transparent); }
.sig i:nth-child(1) { height: 25%; } .sig i:nth-child(2) { height: 50%; } .sig i:nth-child(3) { height: 75%; } .sig i:nth-child(4) { height: 100%; }
.sig.g i.on { background: var(--ok); } .sig.y i.on { background: var(--air-fill); } .sig.r i.on { background: var(--danger); }
.tools .tav .sig { height: 16px; gap: 2px; } .tools .tav .sig i { width: 3.5px; }
.tmaphost { height: 42vh; min-height: 240px; max-height: 420px; border-radius: var(--r16); overflow: hidden; position: relative; border: 1px solid var(--border); }
.tmaphost .tmap { position: absolute; inset: 0; }
.losv { border-radius: 12px; padding: 10px 12px; margin: 8px 0; display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.losv.ok { background: var(--ok-soft); color: var(--ok); }
.losv.mid { background: var(--air-soft); color: var(--air); }
.losv.bad { background: var(--danger-soft); color: var(--danger); }
.losv div { color: var(--text); opacity: .85; }
.losprof { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.losprof .ter { fill: color-mix(in srgb, #a16207 30%, var(--surface)); stroke: #a16207; stroke-width: 1.5; }
.losprof .fre { fill: none; stroke: #ca8a04; stroke-width: 1.2; stroke-dasharray: 5 4; opacity: .8; }
.losprof .los { stroke: #0ea5e9; stroke-width: 2; stroke-dasharray: 7 5; }
.losprof .blk { stroke: #ef4444; stroke-width: 3; opacity: .8; }
.losprof .lbl { fill: var(--muted); font-size: 13px; }
.rxlog { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.rxi { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; }
.rxi .rxh { display: flex; justify-content: space-between; gap: 8px; }
.rxi .rxt { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.rxi .rxk { color: var(--air); font-weight: 600; }
.rxi .rxp { color: var(--text); overflow-wrap: anywhere; }
.rxi .rxs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.noisebig { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
.noisebig.g { color: var(--ok); } .noisebig.y { color: var(--air); } .noisebig.r { color: var(--danger); }
.noisegraph { margin: 8px 0; }
/* 1.23: на карте инструментов — голубой пунктир со стрелками, подписи участков, красное — рельеф мешает */
.tm-ln.route { stroke: #0ea5e9; stroke-width: 3; stroke-dasharray: 8 6; }
.tm-ln.blocked { stroke: #ef4444; stroke-width: 5; stroke-dasharray: none; opacity: .9; }
/* 1.24: покрытие антенны — зелёным, где антенну видно с высоты человека */
.tm-pg { stroke: none; } .tm-pg.cov { fill: #22c55e; fill-opacity: .42; } .tm-pg.cov2 { fill: #eab308; fill-opacity: .32; }
.tm-ln.ring { stroke: #0ea5e9; stroke-width: 1.5; stroke-dasharray: 4 5; opacity: .8; }
.tprog { height: 8px; border-radius: 6px; background: var(--surface3); overflow: hidden; margin: 8px 0; } .tprog > i { display: block; height: 100%; background: var(--accent-fill); width: 0; transition: width .2s; }
.rgchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .rgchip { min-height: 36px; padding: 6px 12px; border-radius: var(--pill); border: 1.5px solid var(--border); background: var(--surface2); cursor: pointer; font-weight: 600; }
.rgchip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tm-ar { fill: #0ea5e9; stroke: #fff; stroke-width: 1; }
.tm-lt { font-size: 13px; font-weight: 700; fill: #0b3a53; }
.tm-lbg { fill: #fff; stroke: #0ea5e9; stroke-width: 1.5; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.tm-lt.lv4, .tm-lt.lv3 { fill: #15803d; } .tm-lt.lv2 { fill: #a16207; } .tm-lt.lv1 { fill: #b91c1c; }
.tm-m.sel { width: 28px; height: 28px; margin: -14px 0 0 -14px; font-size: 12px; font-weight: 800; box-shadow: 0 0 0 5px rgba(46, 107, 240, .3), 0 2px 6px rgba(0, 0, 0, .4); }
body, .side, .bubble { transition: background-color .3s, color .3s; }
@media (prefers-reduced-motion: reduce) { body, .side, .bubble { transition: none; } }


/* =====================================================================================================
   2.0-dev9 (веб 1.29): облик приложения ALT 2.0 — размеры, радиусы и цвета из app2 ui/Theme.kt, Components.kt, Nav.kt,
   ChatsScreen.kt, ChatScreen.kt, SettingsScreen.kt, Editor.kt. Токены (цвета) — выше, в :root; они совпадают с Theme.kt.
   ===================================================================================================== */
:root { --navh: 0px; --railw: 0px; --scrim: rgba(0, 0, 0, .32); }

/* ---------- оболочка: нижняя панель (телефон) и рейка (окно ≥ 600) — Nav.kt ---------- */
.shell { height: 100%; display: flex; flex-direction: column; }
.shell > .main { flex: 1; min-height: 0; min-width: 0; height: auto; }
.appnav { order: 2; flex: none; display: flex; flex-direction: column; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
.appnav .navlogo, .appnav .navfoot, .appnav .navx { display: none; }
.navtabs { display: flex; flex: none; height: 72px; }
/* пункт: колонка, отступ сверху 10, между значком и подписью 4 */
.navit { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; height: 72px; padding: 10px 0 0; color: var(--muted); }
.navbox { position: relative; width: 64px; height: 32px; display: grid; place-items: center; flex: none; }
.navpill { width: 56px; height: 32px; border-radius: var(--pill); display: grid; place-items: center; transition: background-color .15s, color .15s; color: var(--muted); }
.navpill .ic { width: 24px; height: 24px; }
.navit:hover .navpill { background: var(--surface2); }
.navit.on, .navit.on .navpill { color: var(--accent); }
.navit.on .navpill, .navit.on:hover .navpill { background: var(--accent-soft); }
.navit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r12); }
.navlab { font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; }
/* счётчик: 18 высотой, рамка 2 цвета панели, 10/700; точка «рация подключена»: 11 с рамкой 2 */
.navbadge { position: absolute; top: -6px; right: 2px; box-sizing: border-box; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill); background: var(--accent-fill); color: #fff; font-size: 10px; line-height: 14px; font-weight: 700; text-align: center; border: 2px solid var(--surface); white-space: nowrap; }
.navdot { position: absolute; top: -2px; right: 8px; box-sizing: border-box; width: 11px; height: 11px; border-radius: 50%; background: var(--air-fill); border: 2px solid var(--surface); }
.navme { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-top: 6px; }
.navme .avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.navme:hover .avatar { box-shadow: 0 0 0 3px var(--surface2); }
.navme:focus-visible, .navsos:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 599px) {
  body:not(.navchat) { --navh: calc(73px + env(safe-area-inset-bottom)); }
  .shell.inchat .appnav { display: none; }
  /* Эфир, Настройки, Инструменты, Карта — над нижней панелью, чтобы разделы оставались под рукой */
  .overlay.tabov { bottom: var(--navh); }
  .mcscreen, body > [data-alt-tab] { bottom: var(--navh); height: auto; max-height: calc(100dvh / var(--ui-zoom, 1) - var(--navh)); }
}
@media (min-width: 600px) {
  body { --railw: 81px; }
  .shell { flex-direction: row; }
  .appnav { order: 0; width: 81px; align-items: center; gap: 2px; border-top: 0; border-right: 1px solid var(--border); padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); overflow-y: auto; overflow-x: hidden; }
  .appnav .navlogo { display: block; width: 40px; height: 40px; border-radius: var(--r12); margin: 0 0 10px; flex: none; }
  .navtabs { height: auto; flex-direction: column; align-items: center; gap: 2px; }
  .appnav .navx { display: flex; }
  .appnav .navfoot { display: flex; flex-direction: column; align-items: center; margin-top: auto; padding-top: 12px; flex: none; }
  .navit { flex: none; width: 76px; height: auto; padding: 5px 0; gap: 3px; border-radius: var(--r12); }
  .navlab { font-size: 11px; line-height: 14px; }
  /* окна разделов — справа от рейки; SOS — внизу рейки, в шапке списка не дублируется */
  .overlay.tabov, .mcscreen, body > [data-alt-tab] { left: var(--railw); }
  .side-head #sosbtn, .stsos { display: none; }
  /* 1.33: значок карты в шапках «Чатов» и «Эфира» — только на телефоне (на рейке есть «Карта») */
  .navonly { display: none !important; }
}
/* 1.33 (ux4): поиск в шапке «Чатов» — строка раскрывается по значку 🔍 (sideSearch), «назад» слева от поля */
.searchrow { display: flex; align-items: center; gap: 2px; margin: 2px 12px 6px 4px; }
.searchrow .search { flex: 1; min-width: 0; }
.searchrow.hide { display: none; }
body.sidesearch .side-head, body.sidesearch #storybar, body.sidesearch .gcbanner { display: none; }
.conv.found .title { font-size: 15px; }
/* 1.33 (ux4): переход «к нужному пункту с подсветкой» (jumpGlow): свечение по контуру акцентным цветом, затухает за 1,8 с;
   при «уменьшить движение» — просто рамка без анимации (общее правило выше гасит анимации) */
.jumpglow { position: relative; z-index: 1; animation: jumpglow 1.8s ease-out both; }
@keyframes jumpglow {
  0% { box-shadow: 0 0 0 0 transparent; }
  15% { box-shadow: 0 0 0 2px var(--accent), 0 0 16px 4px var(--accent-soft), 0 0 28px 8px var(--accent-soft); }
  60% { box-shadow: 0 0 0 2px var(--accent), 0 0 16px 4px var(--accent-soft), 0 0 28px 8px var(--accent-soft); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .jumpglow { box-shadow: 0 0 0 2px var(--accent); } }
/* экраны разделов нового вида (mc/*: «Эфир», «Инструменты») — место рядом с рейкой / над панелью */
:where(body > [data-alt-tab]) { position: fixed; top: 0; right: 0; bottom: var(--navh); left: var(--railw); z-index: 80; background: var(--bg); }

/* пилюля SOS (SosPill): 36 высотой, рамка 1,5 danger, подложка dangerSoft, 13/800; зона нажатия 48 */
.sosbtn { height: 36px; min-width: 56px; padding: 0 12px; border-radius: var(--pill); background: var(--danger-soft); color: var(--danger); border: 1.5px solid var(--danger); font-size: 13px; font-weight: 800; letter-spacing: .6px; margin: 6px; }
.sosbtn::before { inset: -6px; }

/* ---------- кнопки-значки (AltIconButton: круг 48, значок 24) ---------- */
.side-head .icon-btn, .chat-head .icon-btn, .sthd .icon-btn, .forumhead .icon-btn, .selbar .icon-btn { width: 48px; height: 48px; border-radius: 50%; font-size: 24px; color: var(--text); flex: none; }
.side-head .icon-btn:hover, .chat-head .icon-btn:hover, .sthd .icon-btn:hover, .forumhead .icon-btn:hover, .selbar .icon-btn:hover { background: var(--surface2); color: var(--text); }
.side-head .icon-btn .ic, .chat-head .icon-btn .ic, .sthd .icon-btn .ic { width: 24px; height: 24px; }
.chat-head #hmore { color: var(--muted); }

/* ---------- пилюля состояния (StatusPill: 28, точка 8, 13/600) и чип (SmallChip: 20, 12/600, r8) ---------- */
.spill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--pill); font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; flex: none; max-width: 100%; }
.spill > i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.spill .spt { overflow: hidden; text-overflow: ellipsis; }
.spill.ok { background: var(--near-soft); color: var(--near); }
.spill.off { background: var(--surface2); color: var(--muted); }
.spill.air { background: var(--air-soft); color: var(--air); }
.spill.err { background: var(--danger-soft); color: var(--danger); }
.schip { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r8); font-size: 12px; line-height: 16px; font-weight: 600; flex: none; white-space: nowrap; }
.schip.air { background: var(--air-soft); color: var(--air); }

/* ---------- плитка-значок (IconTile) ---------- */
.itile { width: 36px; height: 36px; border-radius: var(--r8); display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.itile .ic { width: 20px; height: 20px; }
.itile.s48 { width: 48px; height: 48px; border-radius: var(--r12); }
.itile.s48 .ic { width: 24px; height: 24px; }
.itile.near { background: var(--near-soft); color: var(--near); }
.itile.air { background: var(--air-soft); color: var(--air); }
.itile.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- раздел «Чаты» (ChatsScreen.kt) ---------- */
.side { background: var(--bg); }
.side-head { display: flex; align-items: center; gap: 0; padding: 12px 8px 4px 16px; min-height: 0; }
.shtitle { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bigtitle { margin: 0; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.4px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.side-head #sosbtn { margin: 0 0 0 4px; }
/* поле поиска: 44, surface2, r12, лупа 20 слева, крестик справа */
.searchrow { margin: 6px 16px; display: block; }
.search { margin: 0; position: relative; }
.search input { width: 100%; height: 44px; min-height: 44px; padding: 0 44px 0 40px; border-radius: var(--r12); border: 0; background: var(--surface2); color: var(--text); outline: none; font-size: 16px; line-height: 22px; }
.search input::placeholder { color: var(--muted); }
.search input:focus { box-shadow: 0 0 0 2px var(--accent); }
.search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; font-size: 20px; }
.qclr { position: absolute; right: 2px; top: 2px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.qclr:hover { background: var(--surface3); color: var(--text); }
.qclr .ic { width: 20px; height: 20px; }
/* строка беседы (ConvRow): поля 8, r16, ≥ 64, плитка 48, между ними 12 */
.convlist { padding: 4px 0 16px; }
.conv { display: flex; align-items: center; gap: 12px; width: calc(100% - 16px); margin: 1px 8px; min-height: 64px; padding: 8px; border-radius: var(--r16); text-align: left; transition: background-color .12s; }
.conv:hover { background: var(--surface2); }
.conv.on, .conv.on:hover { background: var(--accent-soft); }
.conv .mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.conv .top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.conv .title { flex: 0 1 auto; min-width: 0; font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.conv .title.sos { color: var(--danger); }
.conv .title .ri { margin: 0 1px; }
.conv .when { margin-left: auto; flex: none; color: var(--muted); font-size: 13px; line-height: 18px; font-weight: 400; }
.cmark { display: inline-flex; flex: none; color: var(--muted); }
.cmark .ic { width: 15px; height: 15px; }
.conv .bot { display: flex; align-items: center; gap: 0; margin: 0; min-width: 0; }
.cticks { display: inline-flex; flex: none; margin-right: 4px; color: var(--ok); }
.cticks.read { color: var(--accent); }
.cticks .ic { width: 16px; height: 16px; }
.conv .prev { flex: 1; min-width: 0; color: var(--muted); font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .prev.typing { color: var(--accent); }
.conv .bot .badge { margin-left: 8px; }
.badge { box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--pill); background: var(--accent-fill); color: #fff; font-size: 12px; line-height: 22px; font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.badge.muted { background: var(--surface3); color: var(--text2); }
.section-title { padding: 14px 20px 6px; font-size: 14px; line-height: 20px; color: var(--muted); font-weight: 600; text-transform: none; }
.conv.topic, .conv.subconv { width: calc(100% - 16px); }
.forumhead { background: var(--bg); padding: 4px 8px 8px; margin: 0 0 4px; }
.limban { margin: 6px 16px; }

/* плитки бесед (ConvTile): человек — круг; канал и группа — квадрат r16; эфир — круг airFill с антенной; SOS — круг dangerFill */
.avatar { width: 48px; height: 48px; font-size: 17px; font-weight: 700; }
.avatar.sm { width: 40px; height: 40px; font-size: 14px; }
.avatar.chan, .avatar.chan.sm, .avatar.grp, .avatar.sec { border-radius: var(--r16); }
.avatar.chan { background: var(--accent-fill); color: #fff; }
.avatar.chan .ic { width: 50%; height: 50%; }
.avatar.grp { font-size: 16px; }
.avatar.grp.sm { font-size: 13px; }
.avatar.tair { border-radius: 50% !important; background: var(--air-fill); color: var(--on-air); }
.avatar.tair .ic { width: 54%; height: 54%; }
.avatar.tsos { border-radius: 50%; background: var(--danger-fill); color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .6px; }
.avatar.sm.tsos { font-size: 11px; }
.avatar .dot { right: 0; bottom: 0; width: 13px; height: 13px; border: 2.5px solid var(--bg); background: var(--ok); }
.avatar.sm .dot { width: 11px; height: 11px; border-width: 2px; }
.mcmark.schip { opacity: 1; }

/* ---------- беседа (ChatScreen.kt) ---------- */
.chat, .msgs-wrap { background: var(--bg); }
.side { border-right: 1px solid var(--border); }
/* шапка 56: назад · плитка 40 · название 17/600 + подпись 13 · ⋮ */
.chat-head { min-height: 56px; height: 56px; padding: 0 4px; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); backdrop-filter: none; }
.chat-head .back { display: none; }
.chat-head #headav { margin: 0 12px 0 12px; display: flex; flex: none; }
.chat-head .back + #headav { margin-left: 0; }
.chat-head #headav .avatar { width: 40px; height: 40px; }
.chat-head .t { padding: 4px 4px 4px 0; border-radius: var(--r12); min-width: 0; }
.chat-head .t b { font-size: 17px; line-height: 22px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-head .t small { font-size: 13px; line-height: 18px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .t small.live { color: var(--accent); }
.chat-head .hx { display: none !important; }
@media (max-width: 839px) {
  .chat-head .back { display: grid; }
  .chat-head { padding: 0 4px; }
  #hvid { display: none !important; }
}
/* закреплённое (PinBar) и полоса ответа/правки (ComposeBar) */
.pinbar { min-height: 48px; padding: 6px 4px 6px 16px; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.pinbar > .ic { width: 18px; height: 18px; color: var(--accent); }
.pinbar .q { border-left: 0; padding-left: 0; }
.pinbar .q b { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--accent); }
.pinbar .q span { font-size: 13px; line-height: 18px; color: var(--text2); }
.pinbar .icon-btn, .replybar .icon-btn { width: 40px; height: 40px; border-radius: 50%; color: var(--muted); font-size: 20px; flex: none; }
.pinbar .icon-btn:hover, .replybar .icon-btn:hover { background: var(--surface2); }
.replybar { gap: 10px; background: var(--surface); border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 4px 4px 4px 16px; margin: 0 -12px 6px; }
.replybar > .ic { width: 20px; height: 20px; color: var(--accent); flex: none; }
.replybar .q { border-left: 2px solid var(--accent); padding-left: 10px; min-height: 34px; display: flex; flex-direction: column; justify-content: center; }
.replybar .q b { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--accent); }
.replybar .q span { font-size: 13px; line-height: 18px; color: var(--text2); }
/* лента: плашка дня — surface2 r8 13/600 muted; пузыри — ≤ 86 % и 520, r16 с хвостиком 4 у последнего */
.msgs { padding: 8px 12px; }
.sep { margin: 6px 0 10px; padding: 4px 10px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--muted); background: var(--surface2); border-radius: var(--r8); }
.bubble { max-width: min(86%, 520px); padding: 8px 12px; border-radius: var(--r16); }
.bubble .name { font-size: 13px; line-height: 18px; font-weight: 700; }
.meta { font-size: 12px; line-height: 16px; font-weight: 500; gap: 5px; }
.react { padding: 3px 8px; border-radius: var(--pill); background: var(--surface2); border: 1px solid transparent; font-size: 15px; line-height: 20px; gap: 4px; }
.react b, .react span:last-child { font-size: 13px; font-weight: 600; color: var(--text2); }
.react.me { background: var(--accent-soft); border-color: var(--accent); }
.row.mine .react { background: rgba(255, 255, 255, .14); border-color: transparent; }
.row.mine .react.me { background: rgba(255, 255, 255, .32); border-color: transparent; }
.row.mine .react b, .row.mine .react span:last-child { color: #fff; }
/* кнопка «вниз»: круг 48 surface с рамкой и тенью, стрелка 24 */
.down-btn { width: 48px; height: 48px; right: 14px; bottom: 84px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 3px 10px rgba(0, 0, 0, .18); color: var(--text); }
.down-btn .ic { width: 24px; height: 24px; }
/* поле ввода (Composer): капсула ≥ 48, r24, surface + рамка; скрепка и микрофон 40 внутри; снаружи круглая синяя 48 */
.composer-wrap { padding: 6px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); }
.composer { display: flex; align-items: flex-end; gap: 8px; background: none; border: 0; border-radius: 0; padding: 0; }
.replybar + .composer { border-radius: 0; }
.capsule { flex: 1; min-width: 0; display: flex; align-items: flex-end; min-height: 48px; padding: 0 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r24); }
.capsule:focus-within { border-color: var(--accent); }
.capsule .icon-btn, .composer .capsule .icon-btn { width: 40px; height: 40px; margin: 3px 0; border-radius: 50%; color: var(--muted); font-size: 22px; flex: none; }
.capsule .icon-btn .ic { width: 22px; height: 22px; }
.capsule .icon-btn:hover { background: var(--surface2); color: var(--text); }
.composer textarea { flex: 1; min-width: 0; padding: 12px 4px; margin: 0; line-height: 22px; font-size: 16px; max-height: 154px; background: transparent; border: 0; outline: none; resize: none; color: var(--text); }
.composer textarea::placeholder { color: var(--muted); }
.send-btn { width: 48px; height: 48px; border-radius: 50%; background: var(--accent-fill); color: #fff; box-shadow: none; flex: none; }
.send-btn .ic { width: 22px; height: 22px; margin-left: 2px; }
.send-btn.dim { opacity: .5; }
.recbar { min-height: 48px; border-radius: var(--r24); padding: 0 4px 0 16px; }
.postnote { background: var(--bg); border-top: 0; font-size: 15px; color: var(--muted); }
.chat-empty { background: var(--bg); }
.chat-empty .estate { height: 100%; }

/* ---------- пустое состояние (EmptyState): круг 96 surface2, значок 48 muted, 17/600, 15 text2, вторичная кнопка ---------- */
.estate { gap: 12px; padding: 24px; max-width: 408px; margin: 0 auto; }
.estate .eic { margin: 0; }
.estate p { max-width: 360px; color: var(--text2); }
.estate .btn { margin-top: 4px; background: var(--surface2); color: var(--text); }

/* ---------- кнопки (AltButton: 48, r12, 16/600; маленькая 36, 14/600) ---------- */
.btn { min-height: 48px; padding: 0 18px; border-radius: var(--r12); font-size: 16px; line-height: 20px; font-weight: 600; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.ghost, .tbtn { background: transparent; color: var(--text2); }
.tbtn { min-height: 40px; padding: 0 12px; border-radius: var(--pill); font-size: 15px; line-height: 20px; font-weight: 600; }
.tbtn:hover { background: var(--surface2); }
.tbtn.acc { color: var(--accent); }
.tbtn.dng { color: var(--danger); }
.linkbtn { border-radius: var(--r12); }

/* ---------- переключатель (AltSwitch 52×32) и сегменты (Segmented) ---------- */
.sw { width: 52px; height: 32px; background: var(--border-strong); }
.sw::after { top: 4px; left: 4px; width: 24px; height: 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sw.on { background: var(--accent-fill); }
.sw.on::after { left: 24px; }
.seg { background: var(--surface2); border-radius: var(--r12); padding: 3px; gap: 3px; }
.seg button { min-height: 40px; border-radius: var(--r12); font-size: 15px; font-weight: 600; color: var(--muted); border: 1px solid transparent; box-shadow: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; }
.seg button .ic { width: 16px; height: 16px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: none; }
.seg button.on .ic { color: var(--accent); }
[data-theme="dark"] .seg button.on { background: var(--surface3); border-color: transparent; }
.seg.n3 button { font-size: 15px; }

/* ---------- окна и диалоги (AlertDialog / ConfirmDialog): r24, отступ 24, заголовок 20/600, затемнение 32 % ---------- */
.overlay { background: var(--scrim); backdrop-filter: none; }
.modal { width: min(480px, 100%); border-radius: var(--r24); padding: 24px; background: var(--surface); box-shadow: 0 8px 32px rgba(0, 0, 0, .28); }
.modal h3 { margin: 0 0 16px; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; gap: 8px; }
.modal h3 > .icon-btn:last-child { width: 40px; height: 40px; border-radius: 50%; color: var(--muted); font-size: 22px; margin: -8px -10px -8px 0; flex: none; }
.modal h3 > .icon-btn:hover { background: var(--surface2); color: var(--text); }
.modal .group > label { font-size: 14px; line-height: 20px; color: var(--text2); font-weight: 600; }
.cdlg { width: min(400px, 100%); }
.cdlg h3 { display: block; }
.cdtxt { margin: 0 0 8px; font-size: 15px; line-height: 20px; color: var(--text2); }
.cdcol { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cdbtns { display: flex; justify-content: flex-end; gap: 8px; margin: 16px -12px -8px 0; }
/* подсказка внизу (AltToast): плотный фон, r16, значок 22 ✓ / ⓘ, белый текст 14,5 */
#toasts { bottom: calc(var(--navh) + 16px); }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 32px)); padding: 12px 14px; border-radius: var(--r16); background: var(--toast-bg); color: #fff; font-size: 14.5px; line-height: 20px; font-weight: 500; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.toast.err { background: var(--toast-bg); color: #fff; }
.toast .tic { display: inline-flex; flex: none; color: #6EF0B4; }
.toast.err .tic { color: #FFB4A8; }
.toast .tic .ic { width: 22px; height: 22px; }
@media (max-width: 839px) { #toasts { bottom: calc(var(--navh) + 16px); } body.navchat #toasts { bottom: 84px; } }

/* ---------- меню ⋮ (DropdownMenu): surface, r8, тень, отступ 8; пункты 48, значок 22 muted, 16 ---------- */
.menu.ddmenu { min-width: 200px; max-width: 280px; padding: 8px 0; border-radius: var(--r8); border: 0; background: var(--surface); box-shadow: 0 3px 12px rgba(0, 0, 0, .2), 0 1px 3px rgba(0, 0, 0, .12); animation: mcpin .14s ease-out; transform-origin: top right; }
[data-theme="dark"] .menu.ddmenu { border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .5); }
.menu.ddmenu .it { min-height: 48px; padding: 0 16px 0 12px; gap: 12px; border-radius: 0; font-size: 16px; line-height: 22px; color: var(--text); }
.menu.ddmenu .it .ic { width: 22px; height: 22px; font-size: 22px; color: var(--muted); }
.menu.ddmenu .it:hover { background: var(--surface2); }
.menu.ddmenu .it.danger, .menu.ddmenu .it.danger .ic { color: var(--danger); }

/* ---------- шторка действий с сообщением (ModalBottomSheet): ручка 32×4, реакции 48, пункты 56/значок 24 ---------- */
.menu.mswrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: var(--scrim); border: 0; border-radius: 0; box-shadow: none; padding: 0; min-width: 0; animation: fade .15s; }
.msheet { width: min(560px, 100%); max-height: calc(88dvh / var(--ui-zoom, 1)); overflow-y: auto; background: var(--surface); color: var(--text); border-radius: var(--r24) var(--r24) 0 0; padding: 0 0 calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(0, 0, 0, .18); animation: atup2 .24s cubic-bezier(.2, .9, .3, 1.04); }
.bsgrip { width: 32px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 40%, transparent); margin: 22px auto; flex: none; }
.msbody { padding: 0 12px; display: flex; flex-direction: column; }
.msheet .rx { display: flex; justify-content: space-evenly; gap: 4px; padding: 6px 4px; margin: 0; border: 0; }
.msheet .rx button { width: 48px; height: 48px; border-radius: 50%; background: var(--surface2); font-size: 20px; line-height: 1; display: grid; place-items: center; transition: transform .12s, background-color .12s; }
.msheet .rx button.on { background: var(--accent-soft); }
.msheet .rx button:hover { transform: scale(1.08); }
/* 1.33 (parity4): реакции в меню сообщения рации (openMcSheet) — те же круги 48, что в обычном меню */
.mcsheet .rx { display: flex; justify-content: space-evenly; gap: 4px; padding: 6px 12px 2px; }
.mcsheet .rx button { width: 48px; height: 48px; border-radius: 50%; background: var(--surface2); font-size: 20px; line-height: 1; display: grid; place-items: center; transition: transform .12s, background-color .12s; }
.mcsheet .rx button.on { background: var(--accent-soft); }
.mcsheet .rx button:hover { transform: scale(1.08); }
.msheet .it { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 56px; padding: 8px 12px; border-radius: var(--r12); font-size: 16px; line-height: 22px; color: var(--text); text-align: left; text-decoration: none; }
.msheet .it .ic { width: 24px; height: 24px; font-size: 24px; color: var(--muted); flex: none; }
.msheet .it:hover { background: var(--surface2); }
.msheet .it.danger, .msheet .it.danger .ic { color: var(--danger); }
/* шторка «Действия с сообщением» из эфира (mc) — те же пункты 56 */
.overlay.sheet { background: var(--scrim); backdrop-filter: none; }
.sheetbox { border-radius: var(--r24) var(--r24) 0 0; }
.shead { font-size: 20px; line-height: 26px; padding: 12px 12px 12px 8px; }
.slist { gap: 0; padding: 0 12px; }
.srow { background: none; min-height: 56px; padding: 8px 12px; gap: 16px; }
.srow:hover { background: var(--surface2); }
.srow .ic:first-child { width: 24px; height: 24px; color: var(--muted); }
.srow.danger .ic:first-child { color: var(--danger); }
.srow .ic:last-child { display: none; }

/* ---------- шторки (openSheet): «Новая беседа», «Написать человеку» ---------- */
.overlay.bsov { place-items: end center; padding: 0; }
.bsheet { width: min(560px, 100%); max-height: calc(88dvh / var(--ui-zoom, 1)); display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: var(--r24) var(--r24) 0 0; padding: 0 0 calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(0, 0, 0, .18); animation: atup2 .24s cubic-bezier(.2, .9, .3, 1.04); overflow: hidden; }
.overlay.bsov.out .bsheet { transform: translateY(100%); transition: transform .16s ease-in; }
.bslist { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.bshead { padding: 4px 20px 4px; display: flex; flex-direction: column; gap: 2px; }
.bshead b { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; }
.bshead small { font-size: 13px; line-height: 18px; color: var(--muted); }
.bssearch { margin: 10px 16px; }
.bssearch input { padding-right: 12px; }
.bsscroll { overflow-y: auto; min-height: 0; max-height: 480px; padding-top: 8px; }
.bsnone { padding: 16px 20px; color: var(--muted); font-size: 15px; }
.rtrail { display: inline-flex; color: var(--muted); flex: none; }
.rtrail .ic { width: 18px; height: 18px; }
.rtrail.air { color: var(--air); }
.rtrail.air .ic { width: 20px; height: 20px; }

/* ---------- строка AltRow ---------- */
.arow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; position: relative; }
button.arow { cursor: pointer; }
button.arow:hover { background: var(--surface2); }
.arow .arm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arow .art { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.arow .ars { font-size: 13px; line-height: 18px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.arow > .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.arow.danger .art { color: var(--danger); }
.arow.dim { opacity: .55; }
.arow .avatar.sm { width: 40px; height: 40px; }

/* ---------- раздел «Настройки» (SettingsScreen.kt): страница, не окно ---------- */
.overlay.stpage { display: block; padding: 0; background: var(--bg); backdrop-filter: none; animation: none; z-index: 85; }
.stscroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.sthd { display: flex; align-items: center; min-height: 56px; position: sticky; top: 0; z-index: 3; background: var(--bg); }
.sthd.root { padding: 8px 8px 4px 16px; position: static; }
.sthd.root .bigtitle { flex: 1; }
.sthd:not(.root) { height: 56px; padding: 0 16px 0 4px; border-bottom: 1px solid var(--border); }
.sthd h2 { flex: 1; min-width: 0; margin: 0 0 0 4px; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stcol { max-width: 640px; margin: 0 auto; padding: 0 16px 32px; }
.sthdr { padding: 24px 16px 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text2); }
.stbody > .sthdr:first-child { padding-top: 12px; }
.gslist.stgroup, .stpage .gslist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); margin: 0; overflow: hidden; }
[data-theme="dark"] .stpage .gslist { background: var(--surface); border-color: var(--border); }
.stgroup > * + *::before, .stpage .gslist > .gsrow + .gsrow::before { content: ''; position: absolute; left: 16px; right: 0; top: 0; height: 1px; background: var(--border); }
.stgroup > .gsrow + .gsrow, .stpage .gslist > .gsrow + .gsrow { border-top: 0; }
.stgroup > * { position: relative; }
.stprof { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; text-align: left; color: var(--text); }
.stprof:hover { background: var(--surface2); }
.stprof .arm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.stprof .stname { font-size: 20px; line-height: 26px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stprof .stpl { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.stprof .stsub { font-size: 13px; line-height: 18px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.stprof > .ic { width: 20px; height: 20px; color: var(--muted); flex: none; }
.stprof .gsav { position: relative; flex: none; border-radius: 50%; cursor: pointer; }
.stprof .avatar.xl { width: 56px; height: 56px; font-size: 20px; }
.stprof .gscam { position: absolute; right: -3px; bottom: -3px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-fill); color: #fff; display: grid; place-items: center; border: 2px solid var(--surface); }
.stprof .gscam .ic { width: 12px; height: 12px; }
.stsegrow .seg { margin: 0 16px 12px; }
.stsegrow > .arow { min-height: 56px; }
.stsos { margin: 0; }
/* вложенные страницы настроек: заголовки групп — как GroupHeader, строки-переключатели — карточки */
.stpage .stbody .group { margin: 0 0 4px; }
.stpage .stbody .group > label, .stpage label.cap { display: block; padding: 24px 16px 8px; margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text2); }
.stpage .stbody > .group:first-child > label:first-child { padding-top: 12px; }
.stpage .toggle { min-height: 56px; padding: 8px 16px; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); margin: 0 0 8px; font-size: 16px; line-height: 22px; }
.stpage .gslist .toggle { border: 0; border-radius: 0; margin: 0; background: none; }
.stpage .kv { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r12); padding: 10px 14px; }
.stpage .kv button { color: var(--accent); font-weight: 600; font-size: 14px; min-height: 36px; padding: 0 8px; border-radius: var(--r8); }
.stpage .kv button:hover { background: var(--accent-soft); }
.stpage .devrow { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); padding: 12px 14px; }
.stpage .devrow .devic { border-radius: var(--r8); }
.stpage .hint { color: var(--muted); font-size: 13px; line-height: 18px; }
.stpage .btn.block + .btn.block { margin-top: 8px; }
.stpage .stzoom { padding: 4px 16px 12px; }
.stpage .stzoom .toggle { padding: 8px 0; }
.stpage .myqr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r16); padding: 16px; margin-top: 12px; }
.stpage select { min-height: 48px; }
.stpage .urow { border-bottom: 1px solid var(--border); }

/* ---------- панель скрепки (AttachSheet): плитки и вкладки снизу как нижняя панель ---------- */
.atgrip { width: 32px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--muted) 40%, transparent); margin: 12px auto 10px; }
.atbody { padding: 4px 16px 12px; }
/* крупная плитка (AttTile): surface2 r16, плитка значка 48 accentSoft, 16/600 и подпись 13 */
.atbig { flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px 14px; border-radius: var(--r16); background: var(--surface2); margin-bottom: 10px; }
.atbig:hover { filter: none; background: color-mix(in srgb, var(--surface2) 80%, var(--surface3)); }
.atbig > .ic, .atbig .atrow > .ic { width: 48px; height: 48px; padding: 12px; border-radius: var(--r12); background: var(--accent-soft); color: var(--accent); box-sizing: border-box; }
.atbig.warn > .ic { background: var(--danger-soft); color: var(--danger); }
.atbig b { font-size: 16px; line-height: 22px; font-weight: 600; }
.atbig small { font-size: 13px; line-height: 18px; color: var(--muted); }
.atbig.col { align-items: stretch; }
.atbig .atrow { align-items: center; }
.atchips { padding-left: 0; }
.athint { color: var(--muted); font-size: 13px; line-height: 18px; margin: 4px 4px 0; }
.atgame { border-radius: var(--r16); background: var(--surface2); min-height: 56px; }
.attile { border-radius: var(--r12); }

/* «Мой QR», «Пароль» и прочие окна: поля ввода — r12, рамка borderStrong, фокус — accent */
.field input, .field select { border-width: 1px; }
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* ширина списка в широком окне — как listWidthFor приложения: 360, на очень широком — 400 */
@media (min-width: 840px) {
  .main { grid-template-columns: 360px minmax(0, 1fr); }
  .main.info-open { grid-template-columns: 360px minmax(0, 1fr) 340px; }
}
@media (min-width: 840px) and (max-width: 1279px) { .main.info-open { grid-template-columns: 360px minmax(0, 1fr); } }
@media (min-width: 1440px) {
  .main { grid-template-columns: 400px minmax(0, 1fr); }
  .main.info-open { grid-template-columns: 400px minmax(0, 1fr) 340px; }
}
/* поле «Что случилось?» в окне SOS */
.sosin { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r12); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); outline: none; margin: 10px 0; font-size: 16px; }
.sosin:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
/* 2.0-dev9: расшифровка голосовых и надиктовка (API 8e) */
.sttbtn { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; min-height: 32px; padding: 0 10px; border-radius: var(--pill); background: var(--accent-soft); color: var(--accent); font-size: 13px; line-height: 18px; font-weight: 600; }
.sttbtn .ic { width: 16px; height: 16px; }
.sttbtn:hover { filter: brightness(.96); }
.sttbtn.off { background: transparent; color: var(--muted); opacity: .8; }   /* 1.33: зашифрованное — недоступно (нажатие объясняет) */
.row.mine .sttbtn.off { background: transparent; color: rgba(255, 255, 255, .8); }
#dictbtn.dim { opacity: .45; }   /* 1.33: надиктовка сейчас недоступна — нажатие объясняет почему */
.row.mine .sttbtn { background: rgba(255, 255, 255, .18); color: #fff; }
.stttxt { margin-top: 6px; font-size: 14px; line-height: 20px; color: var(--text2); white-space: pre-wrap; user-select: text; -webkit-user-select: text; cursor: text; max-width: 300px; }
.row.mine .stttxt { color: rgba(255, 255, 255, .85); }
.sttbusy { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.row.mine .sttbusy { color: rgba(255, 255, 255, .85); }
.sttbusy .spin { width: 14px; height: 14px; border-width: 2px; }
#dictbtn.on { color: var(--danger); background: var(--danger-soft); animation: blink 1.2s infinite; }
#dictbtn.busy { color: var(--accent); opacity: .6; pointer-events: none; }

/* 1.30: черта «Новые сообщения» — откуда начинается непрочитанное */
.sep.newsep { align-self: stretch; display: flex; align-items: center; gap: 10px; background: none; color: var(--accent); padding: 0 4px; margin: 10px 0; border-radius: 0; }
.sep.newsep::before, .sep.newsep::after { content: ''; flex: 1; height: 1px; background: var(--accent); opacity: .45; }

/* ---- 1.31: групповые звонки (как GroupCallScreen.kt): сетка плиток 1/2/4/6, своё видео окошком ---- */
.gcjoin { display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; padding: 7px 12px; border: 0; border-radius: 999px; background: #15803D; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.gcjoin .ic { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; }
.cmark.gcmark { color: var(--ok); }
.gcbanner { display: flex; align-items: center; gap: 10px; margin: 6px 12px; padding: 10px 10px 10px 12px; border-radius: var(--r16, 16px); background: var(--surface); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); cursor: pointer; }
.gcbic { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); }
.gcbic .ic { width: 20px; height: 20px; stroke: var(--ok); fill: none; stroke-width: 2; }
.gcbt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gcbt b { font-size: 15px; color: var(--text); }
.gcbt small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcbjoin { flex: none; }
.gcallov { position: fixed; inset: 0; z-index: 90; background: linear-gradient(#2b3560, #0d1226); color: #fff; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.gchead { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px 16px; }
.gct { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gct b { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gct small { font-size: 13px; opacity: .8; }
.gcallov .gcvq { position: static; }
.gcallov .gcvqm { left: auto; right: 14px; top: calc(60px + env(safe-area-inset-top)); }
.gcgrid { flex: 1; min-height: 0; display: grid; gap: 8px; padding: 0 8px; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.gcgrid.n2 { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
.gcgrid.n3, .gcgrid.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gcgrid.n5, .gcgrid.n6 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 1fr; }
@media (orientation: landscape) {
  .gcgrid.n2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .gcgrid.n5, .gcgrid.n6 { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
}
.gctile { position: relative; min-height: 0; border-radius: 18px; overflow: hidden; background: #1b2246; border: 1px solid rgba(255,255,255,.12); display: grid; place-items: center; }
/* 1.33: плитка показывает видео целиком (не обрезает снизу/сверху), поля — тёмные в цвет плитки */
.gctile .gcv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #121833; display: none; }
.gctile.vid .gcv { display: block; }
.gctile.vid .gcav { display: none; }
.gcname { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); padding: 3px 8px; border-radius: 8px; background: rgba(0,0,0,.45); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcstate:empty { display: none; }
.gcstate { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(0,0,0,.45); font-size: 12px; font-weight: 600; white-space: nowrap; }
.gcwait { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; }
.gcwic { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); margin-bottom: 8px; }
.gcwic .ic { width: 40px; height: 40px; stroke: #fff; fill: none; stroke-width: 2; }
.gcwait b { font-size: 18px; }
.gcwait small { font-size: 14px; opacity: .7; max-width: 340px; }
.gclv { position: absolute; right: 16px; bottom: calc(120px + env(safe-area-inset-bottom)); width: 96px; height: 132px; object-fit: cover; border-radius: 14px; background: #000; border: 2px solid rgba(255,255,255,.4); transform: scaleX(-1); z-index: 2; display: none; }
.gcallov.hasl .gclv { display: block; }
.gcallov .gcbtns { position: static; padding: 14px 0 24px; gap: 14px; }

/* 1.32: «кольцо эфира» (ring.js, docs/МЕДИА-КОНЦЕПЦИЯ.md §1) */
.ring { display: block; overflow: visible; }
.ring-breathe { animation: alt-breathe 2400ms ease-in-out infinite; }
.ring-spin { transform-box: fill-box; transform-origin: center; animation: alt-spin 1600ms linear infinite; }
.ring-badge { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
@keyframes alt-breathe { 0%, 100% { opacity: .72; stroke-width: 2.5; } 50% { opacity: 1; stroke-width: 3; } }
@keyframes alt-spin { to { transform: rotate(360deg); } }
/* 1.33: новая история — гребни волнистого кольца бегут по кругу, от кольца расходятся две волны «от капли»;
   просмотрено — кольцо без .ring-live, волны стоят */
.ring-live .ring-crest { transform-box: view-box; transform-origin: center; animation: alt-spin 6s linear infinite; }
.ring-drop { opacity: 0; transform-box: view-box; transform-origin: center; animation: alt-drop 2.4s cubic-bezier(.22,.61,.36,1) infinite; }
.ring-drop.d2 { animation-delay: 1.2s; }
@keyframes alt-drop { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.16); opacity: 0; stroke-width: 1; } }
@media (prefers-reduced-motion: reduce) { .ring-breathe, .ring-spin, .ring-live .ring-crest { animation: none; } .ring-drop { display: none; } }
/* 1.33: «Чаты» — последнее сообщение пришло из эфира без сервера (рация в браузере): значок и время цветом эфира */
.conv .when.airwhen { color: var(--air); }
.conv .cmark.airmark { color: var(--air); margin-right: 2px; }
.conv .cmark.airmark .ic { width: 14px; height: 14px; }
.row.airloc .meta { color: var(--air); }
.row.mine.airloc .meta { color: rgba(255, 255, 255, .9); }
.overlay.atask { z-index: 130; }      /* 1.34: вопрос «Сбросить выбор?» — над панелью вложений */

/* =====================================================================================================
   1.38 (редизайн, docs/РЕДИЗАЙН-КОНЦЕПЦИЯ.md, живой макет docs/redesign/макет-v7.dc.html) — веб, как app2 2.0-dev19.
   ===================================================================================================== */
/* ---------- токены движения — ОДНО место (как ui/Motion.kt в app2); экраны берут только отсюда ---------- */
:root {
  --m-fast: 120ms; --m-base: 200ms; --m-screen: 280ms; --m-sheet: 320ms; --m-swipe: 260ms; --m-morph: 180ms;
  --m-breathe: 1200ms; --m-arcon: 240ms; --m-menu: 200ms; --m-bounce: 320ms; --m-story: 300ms;
  --e-fast: cubic-bezier(.4, 0, 1, 1); --e-base: cubic-bezier(.4, 0, .2, 1); --e-screen: cubic-bezier(.2, 0, 0, 1);
  --e-sheet: cubic-bezier(.2, .8, .2, 1); --e-spring: cubic-bezier(.34, 1.3, .64, 1); --e-arcon: cubic-bezier(.3, 1.4, .5, 1);
  /* подпись пути: эфир — янтарный, сеть — мятный; в своём синем пузыре — светлее, текст — белый 72 % */
  --sg-air-mine: #FFD166; --sg-net-mine: #7DF2C6; --sg-text-mine: rgba(255, 255, 255, .72); --sg-err-mine: #E99FAB;
  --swipe-pin: #6B7A90; --menu-scrim: rgba(0, 0, 0, .45);
}
[data-theme="dark"] { --sg-err-mine: #FFC4C4; --swipe-pin: #3B4658; }
/* «Меньше анимации» (Настройки → Внешний вид, или системное prefers-reduced-motion): без переходов и анимаций */
html.rm *, html.rm *::before, html.rm *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
/* Кроме индикаторов со смыслом (загрузка/расшифровка, поиск рации, запись, диктовка, SOS, «найден»): это не украшение —
   без них не видно, что идёт работа. :root поднимает вес выше «html.rm *» и общего правила prefers-reduced-motion.
   При «Меньше анимации» вращение медленнее (3 с), SOS мигает реже. */
:root .spin { animation: spin 1s linear infinite !important; }
:root .aspin, :root .aircon .ascan::before { animation: aspin .8s linear infinite !important; }
:root .rec-dot { animation: alt-rec-in var(--m-base) var(--e-base), alt-rec-br 700ms ease-in-out var(--m-base) infinite alternate !important; }   /* 1.39: точка записи вырастает и «дышит» */
:root.rm .rec-dot { animation: blink 1s infinite !important; }
@media (prefers-reduced-motion: reduce) { :root .rec-dot { animation: blink 1s infinite !important; } }
:root #dictbtn.on { animation: blink 1.2s infinite !important; }
:root .attile.cam.rec::after, :root .cfshut.rec i { animation: atpulse 1s infinite !important; }
:root .fldchip::before { animation: fldpulse 2s infinite !important; }
:root .falert.found, :root .fldhq .tm-m.fld-mk.found { animation: fldpulse 1.6s infinite !important; }
:root .sosov { animation: sosflash .9s infinite alternate !important; }
:root.rm .spin, :root.rm .aspin, :root.rm .aircon .ascan::before { animation-duration: 3s !important; }
:root.rm .sosov { animation-duration: 2s !important; }
@media (prefers-reduced-motion: reduce) { :root .spin, :root .aspin, :root .aircon .ascan::before { animation-duration: 3s !important; } :root .sosov { animation-duration: 2s !important; } }

/* ---------- п. 1: единая подпись под сообщением (pathsig.js) ---------- */
.meta.psig { display: flex; justify-content: flex-end; align-items: center; flex-wrap: nowrap; gap: 4px; font-size: 12px; line-height: 16px; font-weight: 500; margin-top: 2px; white-space: nowrap; max-width: 100%; }
.meta.psig.sgother { color: var(--muted); --sg-air: var(--air); --sg-net: var(--near); --sg-dim: var(--muted); --sg-dim-op: .75; --sg-err: var(--danger); }
.meta.psig.sgmine, .row.mine .meta.psig { color: var(--sg-text-mine); --sg-air: var(--sg-air-mine); --sg-net: var(--sg-net-mine); --sg-dim: #fff; --sg-dim-op: .6; --sg-err: var(--sg-err-mine); }
.meta.psig .pi { display: inline-flex; align-items: center; flex: none; }
.meta.psig .pi svg { width: 14px; height: 14px; display: block; overflow: visible; }
.meta.psig .pi.pg svg { width: 13px; height: 13px; }
.meta.psig.psig .pi.via { color: var(--sg-net); opacity: 1; }
.meta.psig .pi.pn { color: var(--sg-net); }
.meta.psig .pt { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.meta.psig .pt.bad { color: var(--sg-err); }
.meta.psig .ptk { display: inline-flex; flex: none; }
.meta.psig .ptk svg { width: 15px; height: 15px; display: block; }
.meta.psig .ptk.two svg, .meta.psig .ptk.read svg { width: 19px; height: 15px; }
.meta.psig .ptk.clock svg { width: 13px; height: 13px; }
.meta.psig .ptk.read { color: var(--ticks-read); }
.meta.psig .views { margin-right: 2px; }
.psarcs .parc { fill: none; stroke: var(--sg-dim); opacity: var(--sg-dim-op); stroke-width: 1.9; stroke-linecap: round; }
.psarcs .pdot { fill: var(--sg-dim); opacity: var(--sg-dim-op); }
.psarcs .parc.on { stroke: var(--sg-air); opacity: 1; }
.psarcs.lit .pdot { fill: var(--sg-air); opacity: 1; }
.psarcs.err .parc, .psarcs.err .pslash { stroke: var(--sg-err); opacity: 1; fill: none; stroke-width: 1.9; stroke-linecap: round; }
.psarcs.err .pslash { stroke-width: 1.6; }
.psarcs.err .pdot { fill: var(--sg-err); opacity: 1; }
/* 1.42 (А7): антенна с волнами по бокам — мачта как точка (тусклая / янтарная, когда услышали) */
.meta.psig .pi.parcs svg.pant { width: 20px; height: 14px; }
.psarcs .pmast { fill: none; stroke: var(--sg-dim); opacity: var(--sg-dim-op); stroke-width: 1.7; stroke-linecap: round; }
.psarcs.lit .pmast { stroke: var(--sg-air); opacity: 1; }
.psarcs.err .pmast { stroke: var(--sg-err); opacity: 1; }
.psarcs.br .pmast { animation: alt-sig-breathe var(--m-breathe) ease-in-out var(--sg-br-n, 150) alternate; }
/* ждёт эфира: серые дуги «дышат» — только последнее своё и не дольше 3 мин (число повторов задаёт pathsig.js) */
.psarcs.br .parc, .psarcs.br .pdot { animation: alt-sig-breathe var(--m-breathe) ease-in-out var(--sg-br-n, 150) alternate; }
@keyframes alt-sig-breathe { from { opacity: calc(var(--sg-dim-op) * .45); } to { opacity: calc(var(--sg-dim-op) * .95); } }
/* услышал ретранслятор: дуга зажигается с лёгким перелётом и вспышкой толщины (как arcOn в макете) */
.psarcs .parc.arcon { animation: alt-arc-on var(--m-arcon) var(--e-arcon) both; }
@keyframes alt-arc-on { 0% { opacity: .25; stroke-width: 1.2; } 55% { opacity: 1; stroke-width: 2.8; } 100% { opacity: 1; stroke-width: 1.9; } }
.meta.psig.pact { cursor: pointer; position: relative; border-radius: var(--r8); }
/* без расширения зоны касания: иначе нажатие на текст пузыря попадало бы в «Маршрут», а не в меню сообщения */
.meta.psig.pact:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.bubble .meta.psig { margin-left: auto; }
.abub .meta.psig { align-self: flex-end; }
/* прежние цвета подписи «из эфира без сервера» не перекрашивают новую */
.row.airloc .meta.psig.sgother { color: var(--muted); }
.row.mine.airloc .meta.psig { color: var(--sg-text-mine); }

/* ---------- п. 7: группировка пузырей (3 мин): 2 px внутри группы, 10 px между, хвостик у последнего, имя у первого ---------- */
.row.mcrow:not(.first) { margin-top: 2px; }
.row.mcrow.theirs:not(.last) > .avatar { visibility: hidden; }

/* ---------- п. 3: свайп строки «Чатов» влево → «Прочитано» / «Закрепить» ---------- */
.cvsw { position: relative; border-radius: var(--r16); overflow: hidden; touch-action: pan-y; }
.cvsw > .conv { position: relative; z-index: 1; background: var(--surface); touch-action: pan-y; transition: transform var(--m-swipe) var(--e-spring), background-color var(--m-fast); }
.cvsw > .conv.on { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); }
.cvsw > .conv:hover { background: var(--surface2); }
.cvact { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; background: var(--swipe-pin); color: #fff; font-size: 12px; line-height: 16px; font-weight: 600; }
.cvact.read { background: var(--accent-fill); }
.cvai { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cvai .ic { width: 24px; height: 24px; }
.cvact.over .cvai { animation: alt-bounce var(--m-bounce) var(--e-arcon); }
.conv .pinmini { display: inline-flex; align-items: center; color: var(--muted); flex: none; }
.conv .pinmini .ic { width: 14px; height: 14px; }
.menu.cvmenu { min-width: 200px; }

/* ---------- п. 4: беседа въезжает справа и уводится пальцем от левого края (телефон) ---------- */
.swback { position: relative; overflow: hidden; }
.swback > .swside { display: flex !important; position: absolute; inset: 0; z-index: 0; will-change: transform; }
.swback > .swfront { display: flex !important; position: absolute; inset: 0; z-index: 2; box-shadow: -12px 0 28px rgba(0, 0, 0, .35); will-change: transform; }
.swback > .swdim { position: absolute; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; }

/* ---------- п. 5: нижнее меню-капсула (телефон): подписи всегда, активная — accent на подложке, значок подпрыгивает ---------- */
@keyframes alt-bounce { 0% { transform: scale(1); } 40% { transform: scale(1.16); } 100% { transform: scale(1); } }
.navpill.bump { animation: alt-bounce var(--m-bounce) var(--e-arcon); }
@media (max-width: 599px) {
  body:not(.navchat) { --navh: calc(68px + env(safe-area-inset-bottom)); }
  .shell { padding-bottom: var(--navh); }
  .appnav { position: fixed; left: 12px; right: 12px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 60; height: 60px; padding: 0 6px; border-top: 0; border-radius: var(--pill); background: var(--surface); box-shadow: var(--shadow-2); justify-content: center; transition: transform var(--m-screen) var(--e-screen); }
  [data-theme="dark"] .appnav { box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
  .navtabs { height: 60px; align-items: center; justify-content: space-around; }
  .navit { height: 52px; min-width: 64px; padding: 0; gap: 2px; justify-content: center; }
  .navbox { width: 48px; height: 28px; }
  .navpill { width: 44px; height: 28px; transition: background-color var(--m-base) var(--e-base), color var(--m-base) var(--e-base); }
  .navpill .ic { width: 22px; height: 22px; }
  .navlab { font-size: 11px; line-height: 14px; font-weight: 600; }
  .navbadge { top: -6px; right: -2px; }
  .navdot { top: -2px; right: 2px; }
  /* в беседе капсула уезжает вниз (а не исчезает) */
  .shell.inchat .appnav { display: flex; transform: translateY(calc(100% + 16px + env(safe-area-inset-bottom))); pointer-events: none; visibility: hidden;
    transition: transform var(--m-screen) var(--e-screen), visibility 0s linear var(--m-screen); }
}

/* ---------- п. 6: кнопка ввода — микрофон ↔ кружок ↔ самолётик, морфинг 180 мс ---------- */
.send-btn.morphbtn { position: relative; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform var(--m-fast) var(--e-fast), opacity var(--m-fast); }
.morphbtn .mph { position: absolute; inset: 0; display: grid; place-items: center; transition: transform var(--m-morph) var(--e-base), opacity var(--m-morph) var(--e-base); pointer-events: none; }
.morphbtn .mph .ic { width: 22px; height: 22px; margin: 0; }
.morphbtn .mph.plane .ic { margin-left: 2px; }
.morphbtn .mph.mcirc .ic { width: 24px; height: 24px; }
.morphbtn .mph.mic, .morphbtn .mph.mcirc { opacity: 0; transform: scale(.6); }
.morphbtn[data-mode="voice"] .mph.mic, .morphbtn[data-mode="circle"] .mph.mcirc { opacity: 1; transform: none; }
.morphbtn[data-mode="voice"] .mph.plane, .morphbtn[data-mode="circle"] .mph.plane { opacity: 0; transform: scale(.6) rotate(-20deg); }
.send-btn.morphbtn.rec { transform: scale(1.3); }
.rec-hint { font-size: 13px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rec-hint.warn { color: var(--danger); }

/* ---------- п. 8: истории «магнитом» ---------- */
.sbmini { display: flex; align-items: center; height: 44px; min-width: 44px; padding: 0 4px; border-radius: var(--pill); flex: none; transition: opacity var(--m-fast); }
.sbmini.sbhid { opacity: 0; pointer-events: none; }
.sbmini:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sbmini .avatar.sbm { position: relative; width: 26px; height: 26px; font-size: 10px; border: 2px solid var(--surface); box-sizing: content-box; }
.sbmini .avatar.sbm + .avatar.sbm { margin-left: -8px; }
.sbmini .avatar.sbm.sbnew { box-shadow: 0 0 0 1.5px var(--accent); }
.storybar.sbmag { max-height: 0; padding-top: 0; padding-bottom: 0; border-bottom-width: 0; overflow: hidden; visibility: hidden;
  transition: max-height var(--m-sheet) var(--e-spring), padding var(--m-sheet) var(--e-spring), visibility 0s linear var(--m-sheet); }
.storybar.sbmag.sbopen { max-height: 132px; padding-top: 4px; padding-bottom: 8px; border-bottom-width: 1px; visibility: visible;
  transition: max-height var(--m-sheet) var(--e-spring), padding var(--m-sheet) var(--e-spring), visibility 0s; }
.stv.stvin { animation: alt-story-in var(--m-story) var(--e-screen); }
@keyframes alt-story-in { from { transform: scale(.16); opacity: .5; clip-path: circle(30% at 50% 50%); } to { transform: none; opacity: 1; clip-path: circle(75% at 50% 50%); } }

/* ---------- п. 9: меню сообщения — затемнение 45 %, пузырь приподнят (копия ×1.04 с тенью), меню всплывает ---------- */
.liftov { background: var(--menu-scrim) !important; backdrop-filter: none !important; }
.mcscrim { position: fixed; inset: 0; z-index: 119; animation: fade var(--m-base) var(--e-base); }
.liftov .msheet, .liftov .sheetbox { position: relative; z-index: 1; animation: alt-menu-in var(--m-menu) var(--e-base); transform-origin: 50% 100%; }
.mcpop.mcmenu { animation: alt-menu-in var(--m-menu) var(--e-base); }
@keyframes alt-menu-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.msliftw { position: fixed !important; z-index: 0; margin: 0 !important; padding: 0 !important; pointer-events: none; animation: none !important; display: flex;
  transform-origin: 50% 50%; transition: transform var(--m-base) var(--e-base); background: none !important; }
.msliftw.mine, .msliftw.out { justify-content: flex-end; }
.msliftw.up { transform: scale(1.04); }
.msliftw .bubble, .msliftw .abub { max-width: 100% !important; box-shadow: var(--shadow-3); }
.msliftw .more-btn, .msliftw .abmore { display: none; }

/* ---------- п. 11: строка «Меньше анимации» ---------- */
.stmotion .stnote { font-size: 13px; line-height: 18px; color: var(--muted); padding: 0 16px 12px; }
.stmotion.sys .toggle { pointer-events: none; opacity: .6; }

/* ===================== 1.39: шторка-скрепка, профиль, живые иконки (как app2 / макет v7) ===================== */
/* шторка: высота листа = высота окна; положение — translateY (attY в app.js); ПК — лист ≤ 480 по центру */
.atov { position: fixed; inset: 0; z-index: 95; overflow: hidden; }
.atscrim { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity var(--m-sheet) var(--e-sheet); }
.atwrap { position: absolute; inset: 0; max-width: 480px; margin: 0 auto; pointer-events: none; }
.atsheet { position: absolute; inset: 0; pointer-events: auto; display: flex; flex-direction: column; background: var(--surface); border-radius: 24px 24px 0 0;
  box-shadow: var(--shadow-3); transform: translateY(100%); transition: transform var(--m-sheet) var(--e-sheet); will-change: transform; overflow: hidden; padding: 0; animation: none; }
.atsheet.tall { border-radius: 0; }
@media (min-width: 520px) { .atsheet.tall { border-radius: 24px 24px 0 0; } }
.atgripz { flex: none; height: 52px; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.atgripz .atgrip { width: 36px; height: 4px; margin: 0; border-radius: 2px; background: color-mix(in srgb, var(--muted) 60%, transparent); }
.atgripz:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 12px; }
.attitle { font-size: 15px; line-height: 20px; font-weight: 600; }
.atsheet.tall .atgripz { display: none; }
.athead { min-height: 56px; padding: 6px 6px; touch-action: none; cursor: grab; }
.athead .icon-btn { min-width: 44px; min-height: 44px; }
.atair { flex: none; display: flex; gap: 8px; align-items: flex-start; margin: 0 12px 8px; padding: 8px 12px; border-radius: var(--r12); background: var(--air-soft); color: var(--air); font-size: 13px; line-height: 18px; font-weight: 500; }
.atair .ic { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.atsheet .atbody { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 3px; }
.atsheet .atbody:not([data-tab="gal"]) { padding: 4px 16px; }
.atgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.atgrid .attile { border-radius: 0; aspect-ratio: auto; min-height: 0; }
.atgrid .attile.cam, .atgrid .attile.tallt { grid-row: span 2; }
.atgrid .attile.cam::after { display: none; }
.atgrid .attile.cam .atcamic { top: 50%; left: 50%; right: auto; width: 52px; height: 52px; margin: -26px 0 0 -26px; }
.atgrid .attile.cam .atcamic .ic { width: 28px; height: 28px; }
.attile.tallt { background: var(--surface2); color: var(--text); text-align: center; padding: 8px; }
.atcamic.big { position: static; width: 56px; height: 56px; margin: 0 0 4px; background: var(--accent-soft); color: var(--accent); }
.atcamic.big .ic { width: 28px; height: 28px; }
.attile.stub { color: var(--text); }
.attile.stub .ic { color: var(--accent); }
/* выбор: плитка уменьшается до .92 за 160 мс, синий кружок с номером (белая рамка 2) */
.atgrid .attile.pick { transition: transform 160ms var(--e-base); }
.atgrid .attile.pick.on { transform: scale(.92); }
.atgrid .attile.pick .atnum { top: 6px; right: 6px; left: auto; width: 24px; height: 24px; min-width: 0; border-radius: 50%; border: 2px solid #fff; box-sizing: border-box;
  background: rgba(0, 0, 0, .22); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; z-index: 1; }
.atgrid .attile.pick.on .atnum { background: var(--accent-fill); }
.atgrid .attile.pick:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* нижняя полоса: вкладки-пилюли 56 (surface2) + выезжающая строка «Подпись · ✎ · Отправить N» */
.atfoot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px)); pointer-events: none;
  transition: transform var(--m-sheet) var(--e-sheet); }
.atfoot > * { pointer-events: auto; }
.attabs { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px; box-sizing: border-box; border-radius: var(--pill); background: var(--surface2);
  overflow-x: auto; scrollbar-width: none; box-shadow: var(--shadow-2); }
.attabs::-webkit-scrollbar { display: none; }
.attab { position: relative; flex: 1 0 auto; height: 40px; padding: 0 14px; border-radius: var(--pill); background: none; color: var(--text2, var(--muted)); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--m-base) var(--e-base), color var(--m-base) var(--e-base); }
.attab::before { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }      /* цель касания 48 */
.attab.on { background: var(--accent-soft); color: var(--accent); }
.attab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.atsend { position: absolute; left: 12px; right: 12px; bottom: 100%; margin: 0 0 -4px; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: var(--pill);
  background: var(--surface); box-shadow: var(--shadow-2); transform: translateY(100%); opacity: 0; pointer-events: none;
  transition: transform var(--m-sheet) var(--e-sheet), opacity var(--m-base) var(--e-base); }
.atsend.on { transform: translateY(-8px); opacity: 1; pointer-events: auto; }
.atsend .atcap { flex: 1; min-width: 0; min-height: 44px; border: 0; background: var(--surface2); border-radius: var(--pill); padding: 10px 14px; }
.atsend .atcap:focus { box-shadow: 0 0 0 2px var(--accent); }
.atqslot:empty { display: none; }
.atsend .atq { min-height: 44px; }
.atsend .ated-btn { flex: none; width: 44px; height: 44px; }
.atsend .send-btn.atgo { position: relative; flex: none; width: auto; min-width: 0; height: 48px; padding: 0 16px 0 14px; gap: 6px; border-radius: var(--pill); background: var(--accent-fill); color: var(--on-accent);
  display: inline-flex; align-items: center; font-size: 15px; font-weight: 600; white-space: nowrap; }
.atsend .send-btn.atgo .ic { width: 20px; height: 20px; margin: 0; }
.atsend .atgo .atcnt { position: static; min-width: 0; height: auto; padding: 0; background: none; color: inherit; font: inherit; box-shadow: none; display: inline; }
@media (max-width: 360px) { .atsend .atgot { display: none; } }
/* вкладки «Контакт» и «Ещё» */
.atbig.off { opacity: .5; }
.atsub { margin: 14px 4px 8px; font-size: 14px; font-weight: 600; color: var(--text2, var(--muted)); }
.atclist { display: flex; flex-direction: column; gap: 2px; }
.atcrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 8px; border-radius: var(--r12); text-align: left; background: none; color: var(--text); }
.atcrow:hover { background: var(--surface2); }
.atct { display: flex; flex-direction: column; min-width: 0; }
.atct b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atct small { font-size: 13px; color: var(--muted); }
.atcq { width: 100%; min-height: 44px; margin: 0 0 8px; padding: 10px 14px; border: 0; border-radius: var(--r12); background: var(--surface2); font-size: 16px; box-sizing: border-box; }
/* скрепка поворачивается на −20°, пока шторка открыта */
#attbtn .ic { transition: transform var(--m-base) var(--e-base); }
#attbtn.open .ic { transform: rotate(-20deg); }

/* профиль собеседника / свой профиль: экран въезжает справа 280 мс */
.pfov { position: absolute; inset: 0; z-index: 30; background: var(--bg); overflow: hidden; transform: none; transition: transform var(--m-screen) var(--e-screen);
  box-shadow: -12px 0 28px rgba(0, 0, 0, .25); }
.pfov.pfself { position: fixed; z-index: 90; }
.pfov.pfin { transform: translateX(100%); }
.pfscroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.pfscroll > * { max-width: 640px; margin-left: auto; margin-right: auto; }
.pfscroll > .pfhead { max-width: none; }
.pfhead { position: relative; height: 236px; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 14px; box-sizing: border-box; overflow: hidden; user-select: none; -webkit-user-select: none; cursor: grab; }
.pfav { position: absolute; left: 50%; top: 72px; width: 96px; height: 96px; margin-left: -48px; border-radius: 48px; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; }
.pfav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfav.air { color: var(--on-air); }
.pfav.air .ic { width: 44px; height: 44px; }
.pfini { font-size: 36px; font-weight: 700; line-height: 1; }
.pfgrad { position: absolute; left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .5)); opacity: 0; pointer-events: none; }
.pfname { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 0 20px; --pfk: 0%; }
.pfname b { font-size: 22px; line-height: 28px; font-weight: 700; color: color-mix(in srgb, #fff var(--pfk), var(--text)); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfname small { font-size: 13px; line-height: 18px; color: color-mix(in srgb, #fff var(--pfk), var(--muted)); }
.pfname.onphoto b, .pfname.onphoto small { text-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.pfback { position: absolute; top: calc(8px + env(safe-area-inset-top, 0px)); left: 6px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; --pfk: 0%;
  color: color-mix(in srgb, #fff var(--pfk), var(--text)); background: transparent; }
.pfback .ic { width: 24px; height: 24px; }
.pfhead.pfspring, .pfhead.pfspring .pfav, .pfhead.pfspring .pfgrad, .pfhead.pfspring .pfname > *, .pfhead.pfspring .pfini, .pfhead.pfspring .pfback {
  transition: all var(--m-swipe) var(--e-spring); }
.pfbtns { display: flex; justify-content: center; gap: 8px; padding: 6px 16px 14px; }
.pfbtn { width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; background: none; color: var(--accent); min-height: 44px; }
.pfbc { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; transition: background-color var(--m-base) var(--e-base), color var(--m-base) var(--e-base); }
.pfbc .ic { width: 22px; height: 22px; }
.pfbl { font-size: 12px; line-height: 16px; color: var(--text2, var(--muted)); }
.pfbtn.on .pfbc { background: var(--accent-fill); color: var(--on-accent); }
.pfbtn.off { opacity: .4; }
.pfbtn:focus-visible .pfbc { outline: 2px solid var(--accent); outline-offset: 2px; }
.pfcard { margin: 0 16px 12px; border-radius: 20px; background: var(--surface); padding: 6px 0; display: flex; flex-direction: column; }
.pffact { display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 44px; text-align: left; background: none; color: var(--text); width: 100%; box-sizing: border-box; }
button.pffact:hover { background: var(--surface2); }
.pffact > .ic { width: 18px; height: 18px; color: var(--muted); flex: none; margin-left: auto; }
.pffi { width: 36px; height: 36px; border-radius: var(--r12); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.pffi .ic { width: 18px; height: 18px; }
.pfft { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pfv { font-size: 15px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfft small { font-size: 13px; line-height: 18px; color: var(--muted); }
.pfch { font-size: 14px; font-weight: 600; color: var(--text2, var(--muted)); padding: 6px 16px 2px; }
.pfair .pfairl { display: flex; align-items: center; gap: 8px; padding: 6px 16px; color: var(--air); font-size: 14px; }
.pfair .pfairl .ic { width: 16px; height: 16px; flex: none; }
.pfair .pfroute { margin: 6px 16px 8px; width: auto; }
.pfhint { padding: 12px 16px; color: var(--muted); font-size: 14px; }
.pftabsbox { padding: 0 0 8px; background: none; margin: 4px 0 0; }
.pftabs { display: flex; gap: 6px; padding: 8px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.pftab { position: relative; flex: none; height: 34px; padding: 0 14px; border-radius: var(--pill); background: var(--surface2); color: var(--text2, var(--muted)); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pftab::before { content: ''; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }      /* цель касания 48 */
.pftab.on { background: var(--accent-soft); color: var(--accent); }
.pfcnt { font-size: 12px; font-weight: 600; opacity: .75; }
.pfgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 0 2px; }
.pfm { position: relative; aspect-ratio: 1; padding: 0; background: var(--surface2); overflow: hidden; }
.pfm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfplay { position: absolute; left: 6px; bottom: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.pfplay .ic { width: 11px; height: 11px; }
.pf-files, .pf-links, .pf-voice { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.pffile, .pfvoice { background: var(--surface); border-radius: var(--r16); padding: 8px 10px; }
.pfdate { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pflink { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r16); background: var(--surface); color: var(--text); text-decoration: none; }
.pfmore, .pfolder { margin: 10px 16px 0; width: calc(100% - 32px); }

/* живые иконки (≤ 400 мс, только по действию; «Меньше анимации» — выключено правилом html.rm *) */
.morphbtn .mph.plane.fly .ic { animation: alt-plane-fly var(--m-base) var(--e-base); }
@keyframes alt-plane-fly { 50% { transform: translate(8px, -8px); } }
@keyframes alt-rec-in { from { transform: scale(.3); } to { transform: none; } }
@keyframes alt-rec-br { from { opacity: 1; } to { opacity: .35; } }
.meta.psig .ptk.tkin .tk2 { transform-box: fill-box; transform-origin: center; animation: alt-tk2 var(--m-fast) var(--e-base) both; }
@keyframes alt-tk2 { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
.meta.psig .ptk.read.tkrd { animation: alt-tk-read var(--m-base) var(--e-base); }
@keyframes alt-tk-read { from { color: var(--sg-text-mine, rgba(255, 255, 255, .72)); } }
@media (prefers-reduced-motion: reduce) { .morphbtn .mph.plane.fly .ic, .meta.psig .ptk.tkin .tk2, .meta.psig .ptk.read.tkrd { animation: none; } }

/* ===== 1.39: стикеры, крупные эмодзи, панель «Эмодзи · Стикеры · GIF» (stickers.js) ===== */
.bubble.stkb { background: transparent !important; border: 0 !important; box-shadow: none; padding: 2px 0 0; color: var(--text); }
.bubble.stkb .name { padding: 0 4px; }
.bubble.stkb .meta.psig { display: inline-flex; float: none; margin: 2px 0 0; padding: 2px 8px; border-radius: var(--pill); background: var(--surface2); color: var(--text2); }
.row.mine .bubble.stkb { display: flex; flex-direction: column; align-items: flex-end; }
.stkbox { display: block; padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; border-radius: var(--r16); }
.stkbox:focus-visible, .bigemo img:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stkbox .stkimg { width: 160px; height: 160px; object-fit: contain; display: block; }
.bigemo { display: flex; gap: 4px; align-items: center; line-height: 1; padding: 2px 0; }
.bigemo img { width: 64px; height: 64px; cursor: pointer; }
.bigemo .bemo { font-size: 56px; line-height: 64px; }
.stkx { display: flex; flex-direction: column; gap: 2px; padding: 6px 12px; border-radius: var(--r16); background: var(--surface2); }
.stkx .txt { font-family: ui-monospace, monospace; }
.stkx small { color: var(--muted); font-size: 12px; }
.emoji-pop.stkpop { display: flex; flex-direction: column; width: min(380px, 94vw); max-height: min(420px, 60vh); padding: 0; gap: 0; overflow: hidden; }
.stkpanel { display: flex; flex-direction: column; min-height: 0; }
.atstk { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.stktabs { display: flex; gap: 6px; padding: 8px; border-bottom: 1px solid var(--border); flex: none; }
.stktab { flex: 1; height: 36px; border-radius: var(--pill); font-weight: 600; color: var(--text2); background: transparent; }
.stktab.on { background: var(--accent-soft); color: var(--accent); }
.stkbody { overflow-y: auto; padding: 6px 8px 10px; flex: 1; min-height: 120px; }
.stkh { font-size: 12px; font-weight: 600; color: var(--muted); margin: 8px 4px 4px; }
.stknote { font-size: 13px; color: var(--muted); margin: 8px 4px; line-height: 1.35; }
.stknote.air { color: var(--text); background: var(--air-soft); border-radius: var(--r12); padding: 8px 10px; }
.stkgrid { display: grid; gap: 4px; }
.stkgrid.emoj { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
.stkgrid.stk { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.stkgrid.gif { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.stkcell { height: 44px; border-radius: 10px; font-size: 26px; display: flex; align-items: center; justify-content: center; background: none; }
.stkgrid.stk .stkcell { height: 88px; }
.stkcell:hover, .stkcell:focus-visible { background: var(--surface2); }
.stkgrid.stk img { width: 72px; height: 72px; }
.gifcell { position: relative; border-radius: var(--r12); overflow: hidden; background: var(--surface2); aspect-ratio: 1; }
.gifpick { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.gifpick video, .gifpick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gifdel { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: flex; align-items: center; justify-content: center; }
.gifdel .ic { width: 16px; height: 16px; }
/* 1.41: «Люди» — мьют вместо поля ввода; имя отправителя в общем чате — кнопка (личка, долгое нажатие — профиль) */
.postnote.pnmute { background: var(--air-soft); color: var(--text); }
.bubble .name .nmlink { cursor: pointer; border-radius: 6px; }
.bubble .name .nmlink:hover { text-decoration: underline; }
.bubble .name .nmlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===================== 1.42: вид ПК как телефон, фон чатов, скрепка, автоудаление, истории, разделитель ===================== */
/* А1: колонка сообщений и поле ввода — не шире 760 по центру; карточки списка без двойной рамки (подложка «свайпа» не
   выглядывает из-под строки: отступы — у обёртки, строка — на фоне списка) */
.msgs { max-width: 760px; }
.composer-in { max-width: 760px; }
.cvsw { margin: 1px 8px; }
.cvsw > .conv { width: 100%; margin: 0; background: var(--bg); }
.cvsw > .conv.on { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--bg); }
.cvsw > .conv:hover { background: var(--surface); }
.cvsw:not(.swiping) > .cvact { visibility: hidden; }
.cvsw > .conv[style*="translateX"] ~ .cvact, .cvsw:has(> .conv[style*="translateX"]) > .cvact { visibility: visible; }

/* А4: живой фон под сообщениями — слой под шапкой и полем ввода (isolation: свой контекст наложения) */
#chatview { position: relative; isolation: isolate; }
.chatbg { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); pointer-events: none; }
.chatbg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }
.chatbg .chatbg-pat { position: absolute; inset: 0; background-repeat: repeat; }
#chatview .chat-head { position: relative; z-index: 2; }
#chatview .msgs-wrap { background: transparent; }
#chatview .composer-wrap { background: transparent; position: relative; z-index: 2; }
#chatview .sep:not(.newsep) { background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text); }
.thprev.bgprev { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--r16); padding: 12px; }
.bgsw { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.bgsw1 { border: 2px solid transparent; border-radius: 14px; padding: 4px; background: none; text-align: left; color: var(--text2); }
.bgsw1.on { border-color: var(--accent); }
.bgsw1 i { display: block; height: 46px; border-radius: 10px; }
.bgsw1 span { display: block; font-size: 12px; font-weight: 600; margin-top: 5px; padding-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* А2: ряд значков скрепки — круг 44 и подпись под ним; активный — accent */
.attabs { height: auto; padding: 10px 4px 8px; gap: 0; justify-content: space-around; background: var(--surface); border-radius: 0; box-shadow: none;
  border-top: 1px solid var(--border); overflow-x: auto; margin: 0 -12px; }
.attab { flex: 0 0 56px; height: auto; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none !important; border-radius: 0;
  font-size: 11.5px; line-height: 14px; font-weight: 600; color: var(--text2); }
.attab .attic { width: 44px; height: 44px; border-radius: 50%; background: var(--surface2); display: grid; place-items: center; color: var(--text2);
  transition: background-color var(--m-base) var(--e-base), color var(--m-base) var(--e-base); }
.attab .attic .ic { width: 22px; height: 22px; }
.attab.on { color: var(--accent); }
.attab.on .attic { background: var(--accent-fill); color: #fff; }
.atfoot { padding-left: 12px; padding-right: 12px; }
/* ПК: окно 420 над скрепкой, высота ≤ окно − 100 (attPcPlace), ряд значков всегда виден */
.atov.pc .atscrim { opacity: 0 !important; background: transparent; }
.atov.pc .atwrap { position: absolute; inset: auto; margin: 0; max-width: none; transform-origin: left bottom; animation: alt-pop-in 200ms cubic-bezier(.2, .9, .3, 1.2); }
.atov.pc.out .atwrap { opacity: 0; transform: scale(.94); transition: opacity 160ms, transform 160ms; }
.atov.pc .atsheet { transform: none !important; border-radius: 18px; border: 1px solid var(--border); box-shadow: var(--shadow-3); }
.atov.pc .atgripz, .atov.pc .athead { display: none !important; }
.atov.pc .atfoot { transform: none !important; }
.atov.pc .atgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@keyframes alt-pop-in { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* А3: автоудаление — служебная строка, значок таймера на аватарке шапки, часики у времени, шторка */
.row.svcrow { justify-content: center; margin: 8px 0; }
.svc { display: inline-flex; align-items: center; gap: 6px; max-width: 88%; padding: 6px 14px; border-radius: 14px; font-size: 12.5px; line-height: 17px; font-weight: 500; text-align: center;
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--text); }
.svc .ic { width: 14px; height: 14px; flex: none; }
#headav { position: relative; }
.tmrbadge { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent-fill); color: #fff; display: grid; place-items: center;
  border: 2px solid var(--surface); box-sizing: border-box; pointer-events: none; }
.tmrbadge .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.meta.psig .pi.pexp svg { width: 12px; height: 12px; }
.ttlsheet { padding: 0 6px; }
.ttlopts { padding: 4px 10px 6px; display: flex; flex-direction: column; }
.ttlopt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border-radius: 12px; font-size: 16px; color: var(--text); text-align: left; background: none; }
.ttlopt:hover { background: var(--surface2); }
.ttlopt i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong, var(--muted)); display: grid; place-items: center; flex: none; box-sizing: border-box; }
.ttlopt.on i { border-color: var(--accent); }
.ttlopt.on i::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.ttlcustom { display: none; gap: 8px; padding: 0 20px 6px 54px; }
.ttlcustom.show { display: flex; }
.ttlcustom input, .ttlcustom select { height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font: inherit; font-size: 15px; padding: 0 10px; }
.ttlcustom input { width: 84px; }
.ttlexpl { margin: 4px 16px 8px; font-size: 13px; line-height: 18px; color: var(--text2); background: var(--surface2); border-radius: 12px; padding: 10px 12px; }
.ttlsheet .atair { margin: 0 16px 8px; }
.ttlact { display: flex; gap: 10px; padding: 6px 16px 8px; }
.ttlact .btn { flex: 1; }

/* А5: на время морфинга шарики могут вылетать за пределы ряда */
.storybar.sbmag.sbfly { overflow: visible; }

/* А6: разделитель панели (окно ≥ 840) и узкая колонка аватарок */
@media (min-width: 840px) {
  .main { grid-template-columns: var(--side-w, clamp(300px, 28vw, 400px)) minmax(0, 1fr); }
  .main.info-open { grid-template-columns: var(--side-w, clamp(300px, 28vw, 400px)) minmax(0, 1fr) 340px; }
  .main > .side { position: relative; }
  .sidediv { position: absolute; top: 0; bottom: 0; right: -5px; width: 9px; cursor: col-resize; z-index: 30; touch-action: none; }
  .sidediv::after { content: ''; position: absolute; left: 3px; top: 50%; width: 3px; height: 40px; margin-top: -20px; border-radius: 3px; background: var(--border-strong, var(--muted)); opacity: 0; transition: opacity var(--m-fast); }
  .sidediv:hover::after, .sidediv.drag::after, .sidediv:focus-visible::after { background: var(--accent); opacity: 1; }
  body.sidedrag { cursor: col-resize; user-select: none; }
  .main.sidenarrow .side-head, .main.sidenarrow #storybar, .main.sidenarrow .gcbanner, .main.sidenarrow .section-title, .main.sidenarrow .forumhead { display: none !important; }
  .main.sidenarrow .convlist { padding: 10px 0; }
  .main.sidenarrow .cvsw { margin: 2px 6px; }
  .main.sidenarrow .conv { justify-content: center; padding: 8px 0; min-height: 60px; position: relative; gap: 0; }
  .main.sidenarrow .conv .mid { position: absolute; top: 3px; right: 2px; flex: none; width: auto; pointer-events: none; }
  .main.sidenarrow .conv .mid .top, .main.sidenarrow .conv .mid .bot > :not(.badge) { display: none; }
  .main.sidenarrow .conv .badge { min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 4px; border: 2px solid var(--bg); box-sizing: content-box; }
}
@media (min-width: 840px) and (max-width: 1279px) { .main.info-open { grid-template-columns: var(--side-w, clamp(300px, 28vw, 400px)) minmax(0, 1fr); } }
@media (max-width: 839px) { .sidediv { display: none; } }

/* А8: GIF-реакции — наборы kind "gifs" (Реакции ALT, GIF сервера) в панели и в ленте */
.stkgrid.gifr { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.stkgrid.gifr .stkcell.gifr { height: auto; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 14px; overflow: hidden; background: var(--surface2); }
.stkgrid.gifr .stkcell.gifr img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stkimg.stkgif { border-radius: 18px; }
