/* Orbiq — фирменный стиль из брендбука: тёмный космос (#0B0B10), фиолетовый акцент #6D5CFF,
   заголовки — Manrope, текст — Inter, скругления 8–24px. Анимации прежние: пружинки и плавные появления. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); 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: "Manrope"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/fonts/manrope-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 600 800; font-display: swap; src: url(/fonts/manrope-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --accent: #6d5cff;
  --accent-2: #8c7dff;
  --on-accent: #fff;
  --brand-grad: linear-gradient(135deg, #7b5cff 0%, #5b6cff 55%, #4f8cff 100%);
  --bg: #0b0b10;
  --panel: #12121a;
  --panel-2: #1a1b25;
  --panel-3: #262736;
  --hover: rgba(140, 125, 255, .07);
  --press: rgba(140, 125, 255, .13);
  --sep: rgba(140, 125, 255, .14);
  --text: #e6e6f7;
  --muted: rgba(230, 230, 247, .6);
  --faint: rgba(230, 230, 247, .3);
  --chrome: rgba(13, 13, 20, .82);
  --chat-bg: #0b0b10;
  --bubble-in: #1a1b25;
  --bubble-out: var(--brand-grad);
  --danger: #ff4d6d;
  --ok: #00d1a3;
  --warn: #ffb020;
  --shadow: 0 12px 44px rgba(0, 0, 0, .55);
  --font: 15px;
  --font-head: "Manrope", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --spring: cubic-bezier(.32, .72, 0, 1);
  --pop: cubic-bezier(.2, .9, .3, 1.2);
  --tabbar-h: 0px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f4fa;
  --panel: #fff;
  --panel-2: #f0f0f8;
  --panel-3: #e2e2ee;
  --hover: rgba(109, 92, 255, .05);
  --press: rgba(109, 92, 255, .1);
  --sep: rgba(60, 50, 120, .14);
  --text: #12121a;
  --muted: rgba(30, 28, 60, .6);
  --faint: rgba(30, 28, 60, .32);
  --chrome: rgba(250, 250, 255, .84);
  --chat-bg: #e9e8f5;
  --bubble-in: #fff;
  --danger: #f03a5f;
  --ok: #00b38b;
  --shadow: 0 12px 40px rgba(40, 30, 110, .14);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--font)/1.4 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; letter-spacing: inherit; }
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.fill { fill: currentColor; stroke: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: color-mix(in srgb, currentColor 12%, transparent); padding: 1px 5px; border-radius: 5px; }

/* ───────── Базовые элементы ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 15px;
  background: var(--accent); color: var(--on-accent);
  transition: transform .18s var(--spring), opacity .15s, background .15s;
}
.btn svg.i { width: 19px; height: 19px; }
.btn:active:not(:disabled) { transform: scale(.97); opacity: .85; }
.btn:disabled { opacity: .45; }
.btn.ghost { background: var(--panel-2); color: var(--text); }
:root[data-theme="light"] .btn.ghost { background: var(--panel-3); }
.btn.tinted { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.btn.danger { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.btn.wide { width: 100%; }
.small-btn { min-height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  color: var(--accent); transition: background .15s, transform .18s var(--spring), opacity .15s;
}
.icon-btn:hover { background: var(--hover); }
.icon-btn:active { transform: scale(.88); opacity: .7; }
.icon-btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.icon-btn.rel, .rel { position: relative; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px 4px; }
.input {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 0;
  background: var(--panel-2); outline: none; transition: box-shadow .15s;
}
:root[data-theme="light"] .modal .input { background: var(--panel-2); }
.input:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }
.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.4; }
.input.small { font-size: 13.5px; }
.center-input { text-align: center; font-weight: 700; font-size: 19px; }
.search-input { padding-left: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%; border: 2.4px solid color-mix(in srgb, currentColor 22%, transparent);
  border-top-color: currentColor; animation: spin .75s linear infinite; display: inline-block; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; vertical-align: 1px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tag.danger { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.online-t { color: var(--accent); }
.chev { width: 18px !important; height: 18px !important; color: var(--faint); }
.desk-only { display: grid; }

.avatar {
  --s: 48px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; position: relative;
  display: grid; place-items: center; color: #fff; font-weight: 600; font-size: calc(var(--s) * .4); letter-spacing: 0;
  background: var(--g, var(--accent)); user-select: none;
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.avatar .dot {
  position: absolute; right: 0; bottom: 0; width: calc(var(--s) * .28); height: calc(var(--s) * .28);
  min-width: 10px; min-height: 10px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--panel);
}
.avatar svg.i { width: 48%; height: 48%; }
.avatar.tint { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }

/* ───────── Вход ───────── */
.auth { height: 100%; display: grid; place-items: center; padding: 20px; overflow: auto; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; padding: 8px 4px 24px; animation: rise .5s var(--spring) both; }
.logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 4px; }
.logo-mark { width: 76px; height: 76px; border-radius: 22px; background: var(--accent); display: grid; place-items: center; }
.logo-mark svg { width: 42px; height: 42px; }
.logo h1 { font-size: 30px; margin: 0; letter-spacing: -.6px; font-weight: 700; }
.tagline { text-align: center; color: var(--muted); margin: 6px 0 26px; font-size: 15px; }
.tabs { display: flex; background: var(--panel-2); border-radius: 10px; padding: 2px; margin-bottom: 18px; }
:root[data-theme="light"] .tabs { background: var(--panel-3); }
.tabs button { flex: 1; padding: 7px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14px; transition: background .2s, box-shadow .2s; }
.tabs button.on { background: var(--panel-3); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
:root[data-theme="light"] .tabs button.on { background: #fff; }
.auth .input { background: var(--panel); padding: 13px 15px; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin-top: 18px; line-height: 1.45; }
.auth-note svg { width: 16px; height: 16px; margin-top: 1px; color: var(--ok); }

/* ───────── Каркас ───────── */
.app { display: flex; height: 100%; height: 100dvh; position: relative; overflow: hidden; }
.sidebar {
  width: 380px; min-width: 320px; max-width: 420px; display: flex; flex-direction: column; position: relative;
  background: var(--panel); border-right: .5px solid var(--sep); transition: transform .45s var(--spring), filter .45s;
}
:root[data-theme="dark"] .sidebar { background: #000; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; background: var(--chat-bg); }
.side-head { padding: 8px 12px 6px; padding-top: max(8px, env(safe-area-inset-top)); flex: none; }
.side-top { display: flex; align-items: center; gap: 6px; height: 44px; }
.me-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; transition: transform .2s var(--spring); }
.me-btn:active { transform: scale(.9); }
.large-title { flex: 1; margin: 0 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.search { position: relative; flex: 1; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 36px; padding: 0 12px 0 34px; border-radius: 10px; border: 0;
  background: var(--panel-2); outline: none; font-size: 15.5px;
}
:root[data-theme="dark"] .sidebar .search input { background: #1c1c1e; }
:root[data-theme="light"] .search input { background: rgba(118, 118, 128, .12); }
.search input::placeholder { color: var(--muted); }
.side-head .search { margin-top: 6px; }
.side-tabs { display: flex; gap: 6px; padding: 6px 12px 8px; overflow-x: auto; scrollbar-width: none; flex: none; }
.side-tabs::-webkit-scrollbar { display: none; }
.side-tabs button { padding: 6px 13px; border-radius: 16px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; background: var(--panel-2); transition: background .2s, color .2s; }
:root[data-theme="dark"] .side-tabs button { background: #1c1c1e; }
:root[data-theme="light"] .side-tabs button { background: rgba(118, 118, 128, .12); }
.side-tabs button.on { background: var(--accent) !important; color: #fff; }
/* Уровни (как в Steam), VIP-панель, квесты, достижения */
.lvl { display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; border: max(2px, calc(var(--s) * .07)) solid var(--c); color: var(--text); font-weight: 700; font-size: calc(var(--s) * .4); flex: none; }
.lvl-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; background: none; }
.lvl-mini { display: inline-flex; }
.vp-head { display: flex; align-items: center; gap: 14px; }
.vp-name { font-size: 18px; font-weight: 700; }
.vp-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.vp-xp { margin-top: 14px; }
.vp-xpn { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 6px; }
.vq-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.vq-bar i { display: block; height: 100%; background: var(--accent); transition: width .5s ease; }
.vp-lock { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 14px; color: var(--muted); }
.vp-lock svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.vp-sec { margin-top: 20px; }
.vp-cap { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--sep, rgba(127, 127, 127, .15)); }
.vp-cap span:first-child { color: var(--text); font-weight: 600; }
.vp-hint { font-size: 13px; color: var(--muted); margin: 8px 0; }
.vq { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--sep, rgba(127, 127, 127, .1)); }
.vq.claimed { opacity: .5; }
.vq-ico { display: inline-grid; place-items: center; width: 22px; color: var(--muted); flex: none; }
.vq-ico svg { width: 20px; height: 20px; }
.vq-t { font-weight: 600; font-size: 15px; }
.vq-t span { font-weight: 500; font-size: 12px; color: var(--muted); margin-left: 6px; }
.vq-d { font-size: 13px; color: var(--muted); margin: 1px 0 6px; }
.vq-n { font-size: 12px; color: var(--muted); flex: none; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.vq-done { color: var(--accent); flex: none; display: inline-grid; }
.vq-done svg { width: 18px; height: 18px; }
.vq-btn { flex: none; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 8px; background: var(--accent); color: #fff; }
.va-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.va { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 12px 6px; border-radius: 10px; border: 1px solid var(--sep, rgba(127, 127, 127, .15)); background: none; color: var(--muted); }
.va svg { width: 22px; height: 22px; margin-bottom: 2px; }
.va b { font-size: 13px; font-weight: 600; }
.va small { font-size: 11px; }
.va.got { color: var(--text); cursor: pointer; }
.va.got svg { color: var(--accent); }
.va.got small { color: var(--muted); }
.va.shown { border-color: var(--accent); }
.showcase { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.ach-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 88px; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--sep, rgba(127, 127, 127, .15)); }
.ach-tile svg { width: 22px; height: 22px; color: var(--accent); }
.ach-tile b { font-size: 11.5px; font-weight: 600; }
.chip.danger { color: var(--danger); }
/* Слушать вместе */
.listen-bar { display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 14px; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 18%, var(--panel)), var(--panel)); border-bottom: 1px solid var(--sep, rgba(127, 127, 127, .15)); }
.listen-bar .pb-t { font-size: 13px; font-weight: 700; color: var(--accent); }
.listen-bar .pb-s { font-size: 14px; }
.lb-eq { display: flex; align-items: flex-end; gap: 2px; width: 18px; height: 18px; flex: none; }
.lb-eq i { flex: 1; background: var(--accent); border-radius: 1px; height: 30%; }
.listen-bar.on .lb-eq i { animation: lb-eq .9s ease-in-out infinite; }
.listen-bar.on .lb-eq i:nth-child(2) { animation-delay: -.3s; }
.listen-bar.on .lb-eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes lb-eq { 50% { height: 100%; } }
/* Статус-настроение */
.st-emo { flex: none; margin-left: 4px; font-size: 14px; line-height: 1; }
.st-card { display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 14px; background: var(--panel-2); font-size: 14px; }
.st-set { margin-top: 8px; padding: 6px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 600; font-size: 14px; }
.st-row { display: flex; gap: 8px; align-items: center; }
.st-emo-pick { width: 46px; height: 46px; flex: none; border-radius: 12px; background: var(--panel-2); font-size: 24px; }
.st-presets, .st-times { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.st-presets .chip, .st-times .chip { font-size: 13px; }
/* Несколько значков */
.badge-lines { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.badge-lines .badge-line { margin: 0; }
.badge-ico + .badge-ico { margin-left: 2px; }
.badge-pick { display: flex; flex-direction: column; gap: 6px; }
.badge-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); font-weight: 600; width: 100%; text-align: left; }
.badge-opt > svg { width: 20px; height: 20px; }
.badge-opt .switch { pointer-events: none; }
.badge-prev { margin-top: 10px; font-size: 14px; color: var(--muted); }
.badge-prev b { color: var(--text); margin-left: 4px; }
/* Огоньки дружбы, без звука */
.streak { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 600; margin-left: 5px; color: var(--muted); white-space: nowrap; }
.streak.risk { opacity: .6; }
.sk-ico { display: inline-grid; }
.sk-ico svg { width: 13px; height: 13px; }
/* Огонёк в шапке чата и карточка */
.streak-pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px 4px 7px; border-radius: 8px; color: var(--lc); background: color-mix(in srgb, var(--lc) 12%, transparent); flex: none; margin-right: 2px; }
.streak-pill svg { width: 16px; height: 16px; }
.streak-pill b { font-size: 14px; font-weight: 600; }
.streak-pill.risk { opacity: .55; }
.streak-pill.pop { animation: sk-pop .5s ease; }
@keyframes sk-pop { 40% { transform: scale(1.18); } }
.sk-head { display: flex; align-items: center; gap: 14px; }
.sk-big { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; color: var(--lc); border: 2px solid var(--lc); flex: none; }
.sk-big svg { width: 26px; height: 26px; }
.sk-n { font-size: 32px; font-weight: 700; line-height: 1; }
.sk-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.sk-note { margin-top: 16px; font-size: 14px; color: var(--muted); }
.sk-note.risk { color: var(--lc); }
.sk-rows { margin-top: 12px; border-top: 1px solid var(--sep, rgba(127, 127, 127, .15)); }
.sk-row { display: flex; justify-content: space-between; padding: 10px 0; font-size: 14px; border-bottom: 1px solid var(--sep, rgba(127, 127, 127, .1)); }
.sk-row span { color: var(--muted); }
.sk-row b { font-weight: 600; }
.sk-bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; margin: -2px 0 8px; }
.sk-bar i { display: block; height: 100%; background: var(--lc); }
.ci-mute { flex: none; display: inline-grid; margin-left: 4px; color: var(--muted); }
.ci-mute svg { width: 14px; height: 14px; }
/* Кубик, дартс, монетка */
.dice-msg { display: flex; flex-direction: column; align-items: center; padding: 4px 8px 2px; min-width: 120px; }
.dice-msg .die { font-size: 92px; line-height: 1; color: var(--text); display: inline-block; }
.dice-msg .coin, .dice-msg .dart { font-size: 78px; line-height: 1.1; display: inline-block; position: relative; }
.dice-msg .dart i { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; background: #fff; border: 3px solid #1d1747; transform: translate(var(--r), calc(var(--r) * -.6)); }
.coin-d { display: inline-grid; place-items: center; width: 1em; height: 1em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe9a0, #f5b82e 55%, #c98a12); box-shadow: inset 0 0 0 .05em #b07610, inset 0 0 0 .09em #ffd76a; color: #8a5a00; line-height: 1; }
.coin-d b { font-size: .5em; font-weight: 800; }
.dice-msg .coin-d { font-size: 80px; }
.dice-res { font-size: 14px; font-weight: 700; margin-top: 4px; padding: 2px 10px; border-radius: 10px; background: color-mix(in srgb, var(--panel-2) 85%, transparent); }
.dice-msg.roll .die { animation: die-roll 1.3s cubic-bezier(.2, .7, .3, 1); }
.dice-msg.roll .coin { animation: coin-flip 1.3s cubic-bezier(.2, .7, .3, 1); }
.dice-msg.roll .dart { animation: dart-in 1s cubic-bezier(.2, .7, .3, 1); }
.dice-msg.roll .dart i { animation: dart-hit 1s ease-out; }
.dice-msg.roll .dice-res { animation: dice-res 1.6s ease; }
@keyframes die-roll { 0% { transform: translateY(-40px) rotate(0) scale(.6); filter: blur(2px); } 60% { transform: translateY(6px) rotate(720deg) scale(1.05); filter: blur(0); } 80% { transform: translateY(-6px) rotate(700deg); } 100% { transform: rotate(720deg); } }
@keyframes coin-flip { 0% { transform: translateY(-50px) rotateY(0); } 70% { transform: translateY(4px) rotateY(1440deg); } 100% { transform: rotateY(1440deg); } }
@keyframes dart-in { 0% { transform: scale(.4); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
@keyframes dart-hit { 0%, 60% { opacity: 0; transform: translate(80px, -80px) scale(2); } 100% { opacity: 1; } }
@keyframes dice-res { 0%, 70% { opacity: 0; transform: scale(.6); } 100% { opacity: 1; transform: scale(1); } }
.dice-row { display: flex; gap: 4px; padding: 6px 6px 2px; border-top: 1px solid var(--sep, rgba(127, 127, 127, .15)); margin-top: 4px; }
.dice-row button { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: 24px; padding: 6px 0; border-radius: 10px; }
.dice-row button span { font-size: 11px; color: var(--muted); }
.dice-row button:hover { background: var(--hover); }
/* Напоминания */
.remind-open { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 10px; border-radius: 10px; font-weight: 600; font-size: 14px; color: inherit; background: rgba(255, 255, 255, .14); width: 100%; }
.msg.in .remind-open { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.remind-open svg { width: 16px; height: 16px; }
/* Объявление администрации */
.announce { display: flex; gap: 10px; align-items: flex-start; margin: 6px 10px 2px; padding: 10px 6px 10px 12px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, #6d5cff 22%, var(--panel)), color-mix(in srgb, #4f6bff 14%, var(--panel))); box-shadow: inset 0 0 0 1px rgba(140, 125, 255, .3); animation: ih-in .4s ease; }
.ann-ico { font-size: 22px; line-height: 1.2; }
.ann-t { font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; }
.ann-x { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.announce .icon-btn { width: 30px; height: 30px; flex: none; }
.ann-cur { font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); margin-bottom: 8px; }
/* Подсказка «На экран Домой» для iPhone */
.ios-hint { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9500; padding: 0 12px calc(env(safe-area-inset-bottom) + 8px); display: flex; flex-direction: column; align-items: center; animation: ih-in .45s var(--pop, ease); pointer-events: none; }
.ios-hint.top { top: 0; bottom: auto; flex-direction: column-reverse; padding: calc(env(safe-area-inset-top) + 8px) 12px 0; }
.ios-hint.out { opacity: 0; transform: translateY(20px); transition: .25s; }
@keyframes ih-in { from { opacity: 0; transform: translateY(40px); } }
.ih-card { pointer-events: auto; position: relative; width: min(420px, 100%); background: var(--panel); color: var(--text); border-radius: 20px; padding: 16px 16px 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(140, 125, 255, .25); }
.ih-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); }
.ih-x svg { width: 16px; height: 16px; }
.ih-head { display: flex; gap: 12px; align-items: center; padding-right: 30px; }
.ih-head img { width: 48px; height: 48px; border-radius: 12px; }
.ih-head b { display: block; font-size: 16px; }
.ih-head span { font-size: 13px; color: var(--muted); }
.ih-card ol { margin: 12px 0 2px; padding-left: 22px; font-size: 14.5px; line-height: 1.5; }
.ih-card li { margin-bottom: 4px; }
.ios-share { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: #0a84ff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ih-arrow { color: var(--accent); margin-top: 2px; animation: ih-bob 1.2s ease-in-out infinite; }
.ih-arrow svg { width: 30px; height: 30px; stroke-width: 3; }
.ios-hint.top .ih-arrow { transform: rotate(180deg); animation: none; }
@keyframes ih-bob { 50% { transform: translateY(6px); } }
/* Истории */
.stories-bar { display: flex; gap: 4px; padding: 8px 10px 2px; overflow-x: auto; scrollbar-width: none; flex: none; }
.stories-bar::-webkit-scrollbar { display: none; }
.story-av { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 68px; flex: none; }
.story-av .ring { padding: 2.5px; border-radius: 50%; border: 2.5px solid transparent; display: grid; }
.story-av.new .ring { background: linear-gradient(var(--bg), var(--bg)) padding-box, linear-gradient(135deg, #bf5af2, #6d5cff 50%, #4f8cff) border-box; }
.story-av.seen .ring { border-color: var(--muted); opacity: .8; }
.story-av .plus { position: absolute; top: 40px; left: 44px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 2px solid var(--bg); }
.story-av .plus svg { width: 12px; height: 12px; stroke-width: 3; }
.story-av .nm { font-size: 12px; color: var(--muted); max-width: 66px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-view { position: fixed; inset: 0; z-index: 8000; background: #000; color: #fff; display: flex; flex-direction: column; animation: lock-in .2s ease; user-select: none; -webkit-user-select: none; touch-action: none; }
.story-view.out { opacity: 0; transition: opacity .2s; }
@media (min-width: 761px) { .story-view { padding: 0 max(0px, calc((100vw - 56.25vh) / 2)); } .sv-body { border-radius: 14px; margin-bottom: 14px; } }
.sv-bars { display: flex; gap: 4px; padding: calc(env(safe-area-inset-top) + 10px) 10px 6px; position: relative; z-index: 3; }
.sv-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.sv-bars i b { display: block; height: 100%; width: 0; background: #fff; }
.sv-bars i.done b { width: 100%; }
.sv-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px 12px; position: relative; z-index: 3; }
.sv-head b { display: block; font-size: 15px; }
.sv-head span { font-size: 12px; opacity: .7; }
.sv-head .icon-btn { color: #fff; }
.sv-body { flex: 1; display: grid; place-items: center; overflow: hidden; background: center / cover no-repeat; position: relative; }
.sv-body img, .sv-body video { max-width: 100%; max-height: 100%; object-fit: contain; }
.sv-text { position: absolute; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; font-size: clamp(22px, 5vw, 34px); font-weight: 700; line-height: 1.25; white-space: pre-wrap; word-break: break-word; }
.sv-err { opacity: .7; }
.sv-tap { position: absolute; top: 90px; bottom: 70px; z-index: 2; }
.sv-tap.left { left: 0; width: 33%; }
.sv-tap.right { right: 0; width: 67%; }
.sv-views { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 16px); left: 50%; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 20px; background: rgba(0, 0, 0, .45); color: #fff; font-weight: 600; backdrop-filter: blur(8px); }
.sv-views svg { width: 18px; height: 18px; }
.story-text-prev { border-radius: 16px; aspect-ratio: 9 / 12; max-height: 46vh; display: grid; place-items: center; padding: 20px; margin: 0 auto 12px; transition: background .3s; }
.story-text-prev textarea { width: 100%; min-height: 40%; background: none; border: none; color: #fff; font-size: 24px; font-weight: 700; text-align: center; resize: none; outline: none; font-family: inherit; }
.story-text-prev textarea::placeholder { color: rgba(255, 255, 255, .7); }
.story-bgs { display: flex; gap: 8px; justify-content: center; }
.story-bgs button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.story-bgs button.on { border-color: var(--text); }
/* Код-пароль */
.lock-screen { position: fixed; inset: 0; z-index: 9000; background: var(--bg); display: grid; place-items: center; animation: lock-in .2s ease; }
.lock-screen.out { opacity: 0; transition: opacity .25s; }
@keyframes lock-in { from { opacity: 0; } }
.lock-box { text-align: center; width: min(320px, 90vw); }
.lock-box .logo-mark { margin: 0 auto 14px; }
.lock-box h2 { margin: 0 0 4px; font-size: 21px; }
.lock-box [data-s] { min-height: 18px; }
.lock-dots { display: flex; justify-content: center; gap: 16px; margin: 26px 0 28px; }
.lock-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); transition: background .15s, border-color .15s, transform .15s; }
.lock-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
.lock-dots.shake { animation: lock-shake .4s; }
@keyframes lock-shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.lock-pad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px 22px; justify-content: center; }
.lock-pad button { width: 72px; height: 72px; border-radius: 50%; background: var(--panel-2); font-size: 28px; font-weight: 500; color: var(--text); display: grid; place-items: center; transition: transform .15s, background .15s; }
.lock-pad button:active { transform: scale(.92); background: var(--hover); }
.lock-pad [data-del] { background: none; }
.lock-pad svg { width: 26px; height: 26px; }
.lock-box .link-btn { margin-top: 26px; color: var(--accent); font-size: 14px; }
.vip-tag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border-radius: 6px; color: #fff; background: #e0a800; vertical-align: 2px; margin-left: 4px; }
.switch.locked { opacity: .45; }
/* Папки и архив */
.side-tabs .tab-n { font-style: normal; margin-left: 6px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .22); padding: 0 6px; border-radius: 8px; }
.side-tabs button:not(.on) .tab-n { background: var(--accent); color: #fff; }
.side-tabs .tab-add { padding: 6px 9px; display: grid; place-items: center; }
.side-tabs .tab-add svg { width: 15px; height: 15px; }
.side-tabs .arch-back { display: inline-flex; align-items: center; gap: 6px; background: none !important; color: var(--text); font-weight: 600; font-size: 16px; padding: 4px 4px; }
.side-tabs .arch-back svg { width: 20px; height: 20px; color: var(--accent); }
.archive-row .arch-ico { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); color: var(--muted); flex: none; }
.archive-row .arch-ico svg { width: 24px; height: 24px; }
.badge.muted-badge { background: var(--muted); }
.folder-row { display: flex; align-items: center; gap: 6px; padding: 8px 2px; border-bottom: 1px solid var(--sep, rgba(127, 127, 127, .15)); }
.folder-chats { max-height: 46vh; overflow-y: auto; margin: 0 -6px; }
.folder-chat { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; cursor: pointer; }
.folder-chat:hover { background: var(--hover); }
.folder-chat input { width: 20px; height: 20px; accent-color: var(--accent); }
.chat-list { flex: 1; overflow-y: auto; padding: 0 0 calc(24px + var(--tabbar-h)); -webkit-overflow-scrolling: touch; }

.chat-item { display: flex; gap: 12px; padding: 7px 12px 7px 12px; cursor: pointer; align-items: center; position: relative; transition: background .2s; user-select: none; -webkit-user-select: none; }
.chat-item > .grow { align-self: stretch; display: flex; flex-direction: column; justify-content: center; position: relative; padding: 2px 0; }
.chat-item > .grow::after { content: ""; position: absolute; left: 0; right: -12px; bottom: -7px; border-bottom: .5px solid var(--sep); }
.chat-item:last-child > .grow::after { display: none; }
.chat-item:hover { background: var(--hover); }
.chat-item:active, .chat-item.pressing { background: var(--press); }
.chat-item.pressing { transform: scale(.98); transition: transform .45s var(--spring), background .2s; }
.chat-item.on { background: var(--accent); color: #fff; }
.chat-item.on > .grow::after { display: none; }
.chat-item.on .ci-prev, .chat-item.on .ci-time, .chat-item.on .ci-prev b, .chat-item.on .ci-name svg { color: rgba(255, 255, 255, .85) !important; }
.chat-item.pinned:not(.on) { background: color-mix(in srgb, var(--panel-2) 45%, transparent); }
.ci-top { display: flex; gap: 6px; align-items: center; }
.ci-name { font-weight: 600; flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; font-size: 16px; }
.ci-name > svg.i { width: 15px; height: 15px; color: var(--muted); }
.ci-ver { display: flex; color: var(--ok); }
.ci-ver svg { width: 14px; height: 14px; }
.ci-time { font-size: 14px; color: var(--muted); flex: none; display: flex; align-items: center; gap: 2px; }
.ci-time svg { width: 17px; height: 17px; color: var(--accent); }
.chat-item.on .ci-time svg { color: #fff; }
.ci-bottom { display: flex; gap: 6px; align-items: flex-start; margin-top: 1px; }
.ci-prev { flex: 1; min-width: 0; color: var(--muted); font-size: 14.5px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-height: 2.6em; }
.ci-prev b { color: var(--text); font-weight: 500; }
.ci-prev .typing { color: var(--accent); }
.chat-item.on .ci-prev .typing { color: #fff; }
.ci-pin { color: var(--faint); display: flex; margin-top: 3px; }
.ci-pin svg { width: 15px; height: 15px; transform: rotate(45deg); }
.badge { min-width: 21px; height: 21px; padding: 0 6.5px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; flex: none; margin-top: 2px; font-variant-numeric: tabular-nums; }
.chat-item.on .badge { background: #fff; color: var(--accent); }
.badge.req { background: var(--ok); }
.list-head { padding: 14px 16px 6px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); line-height: 1.5; }
.empty > svg { width: 52px; height: 52px; opacity: .35; margin-bottom: 12px; stroke-width: 1.4; }
.empty-t { color: var(--text); font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.empty.small { padding: 22px 12px; font-size: 14px; }
.req-dot { position: absolute; top: 0; right: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--danger); border: 2px solid var(--panel); }

.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; font-size: 14px; flex: none;
  background: color-mix(in srgb, var(--danger) 13%, var(--panel)); color: var(--danger); }
.banner svg { width: 18px; height: 18px; flex: none; }
.banner.info { background: color-mix(in srgb, var(--accent) 11%, var(--panel)); color: var(--text); }
.banner.info svg { color: var(--accent); }
.banner.info .icon-btn { width: 30px; height: 30px; color: var(--muted); }
.banner.muted-banner { background: transparent; color: var(--muted); justify-content: center; font-size: 13px; padding: 4px; }
.sidebar .banner.info { margin: 0 12px 8px; border-radius: 12px; }

/* ───────── Нижняя панель (телефон) ───────── */
.tabbar { display: none; }

/* ───────── Мини-плеер ───────── */
.miniplayer {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; position: relative; cursor: pointer; flex: none;
  background: var(--chrome); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: .5px solid var(--sep);
}
.miniplayer .cover { width: 36px; height: 36px; border-radius: 7px; }
.miniplayer .mp-title { font-weight: 600; font-size: 14px; }
.miniplayer .mp-artist { font-size: 12.5px; color: var(--muted); }
.miniplayer .mp-bar { position: absolute; left: 0; bottom: -.5px; height: 2px; background: var(--accent); transition: width .25s linear; }
.miniplayer .icon-btn { width: 34px; height: 34px; color: var(--text); }
.miniplayer .icon-btn svg { width: 19px; height: 19px; }
.cover { background: var(--panel-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); flex: none; overflow: hidden; }
.cover svg.i { width: 45%; height: 45%; }
.mp-side { display: none; }

/* ───────── Шапка чата ───────── */
.chat-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top)); min-height: 56px; flex: none;
  background: var(--chrome); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  border-bottom: .5px solid var(--sep); position: relative; z-index: 5;
}
.chat-head .title { font-weight: 600; font-size: 16.5px; display: flex; gap: 4px; align-items: center; }
.chat-head .title > svg { width: 15px; height: 15px; color: var(--ok); }
.chat-head .status { font-size: 13px; color: var(--muted); }
.chat-head .status.on { color: var(--accent); }
.chat-head .clickable { cursor: pointer; display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1; padding: 2px 4px; border-radius: 10px; }
.chat-head .clickable.center { text-align: center; justify-content: center; cursor: default; }
.chat-head .clickable.center .title { justify-content: center; }
.head-spacer { width: 40px; flex: none; }
.back-btn { display: none; }
.back-btn.show { display: grid; }
.pin-bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; cursor: pointer; flex: none;
  background: var(--chrome); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: .5px solid var(--sep); animation: fadeDown .3s var(--spring); }
.pin-line { width: 2.5px; align-self: stretch; border-radius: 2px; background: var(--accent); }
.pb-t { font-size: 13.5px; font-weight: 600; color: var(--accent); }
.pb-s { font-size: 14px; color: var(--muted); }
.pin-bar > svg { color: var(--faint); width: 18px; height: 18px; transform: rotate(45deg); margin-right: 8px; }
.pin-bar .icon-btn { width: 32px; height: 32px; color: var(--muted); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-8px); } }

/* ───────── Сообщения ───────── */
.messages-wrap { flex: 1; position: relative; overflow: hidden; background: var(--chat-bg); }
:root[data-theme="dark"] .messages-wrap { background: radial-gradient(120% 80% at 50% 0%, #121216 0%, var(--chat-bg) 70%); }
.messages { height: 100%; overflow-y: auto; padding: 10px clamp(12px, 1.6vw, 24px) 8px; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.messages .spacer { flex: 1; }
.msgs-loading { align-self: center; margin: auto; color: var(--muted); }
.day-sep { align-self: center; margin: 10px 0 6px; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; position: sticky; top: 6px; z-index: 2;
  background: color-mix(in srgb, var(--panel) 72%, transparent); color: var(--muted); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
:root[data-theme="light"] .day-sep { background: rgba(0, 0, 0, .18); color: #fff; }
.e2e-note { align-self: center; max-width: 320px; text-align: center; margin: 18px auto; padding: 16px 18px; border-radius: 16px; font-size: 13.5px; line-height: 1.45;
  background: color-mix(in srgb, var(--panel) 75%, transparent); color: var(--muted); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
:root[data-theme="light"] .e2e-note { background: rgba(0, 0, 0, .14); color: #fff; }
.e2e-note svg { width: 26px; height: 26px; color: var(--ok); margin-bottom: 6px; }
:root[data-theme="light"] .e2e-note svg { color: #fff; }
.e2e-note b { color: inherit; display: block; margin-bottom: 4px; font-size: 15px; }
:root[data-theme="dark"] .e2e-note b { color: var(--text); }

.msg { display: flex; gap: 6px; align-items: flex-end; margin: 1.5px 0; max-width: 100%; }
.msg.out { flex-direction: row-reverse; }
.msg.first { margin-top: 7px; }
.msg-av { cursor: pointer; flex: none; width: 32px; }
.msg-av .avatar { --s: 32px; visibility: hidden; }
.msg.last .msg-av .avatar { visibility: visible; }
.bubble {
  max-width: min(520px, 80%); padding: 6px 11px 6px; border-radius: 18px; background: var(--bubble-in);
  position: relative; overflow-wrap: anywhere; transition: transform .35s var(--spring);
}
:root[data-theme="light"] .msg.in .bubble { box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.msg.in.last .bubble { border-bottom-left-radius: 6px; }
.msg.out .bubble { background: var(--bubble-out); color: #fff; }
.msg.out.last .bubble { border-bottom-right-radius: 6px; }
.msg.in:not(.first) .bubble { border-top-left-radius: 6px; }
.msg.out:not(.first) .bubble { border-top-right-radius: 6px; }
.bubble.pressing { transform: scale(.96); }
.msg.flash .bubble { animation: flash 1.2s; }
@keyframes flash { 25% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); } }
.bubble .sender { font-size: 13.5px; font-weight: 600; margin-bottom: 1px; display: flex; align-items: center; gap: 2px; }
.bubble .text { white-space: pre-wrap; line-height: 1.38; }
.bubble .text.big { font-size: 44px; line-height: 1.12; }
.bubble.media { padding: 3px; }
.bubble.media .sender { padding: 3px 8px 2px; }
.bubble.media .meta { position: absolute; top: auto; right: 9px; bottom: 8px; margin: 0; background: rgba(0, 0, 0, .45); color: #fff; padding: 1px 7px; border-radius: 10px; opacity: 1; backdrop-filter: blur(6px); }
.bubble.media .caption { padding: 6px 8px 3px; white-space: pre-wrap; }
.bubble.media.has-caption .caption .meta, .bubble.media.has-caption > .meta { position: static; background: none; padding: 0; float: right; margin: 6px 4px 0 10px; color: inherit; opacity: .7; backdrop-filter: none; }
.bubble.media.has-caption .fwd, .bubble.media.has-caption .reply-q { margin: 4px 6px 5px; }
.meta { float: right; margin: 7px 0 -5px 10px; font-size: 11.5px; display: flex; align-items: center; gap: 3px; opacity: .6; user-select: none; font-variant-numeric: tabular-nums; position: relative; top: 1px; }
.msg.out .meta { opacity: .75; }
.meta svg { width: 15px; height: 15px; }
.meta .fire { width: 12px; height: 12px; color: var(--warn); }
.meta .pinned-ico { width: 12px; height: 12px; transform: rotate(45deg); }
.msg.out .meta .read svg { stroke-width: 2.2; }
.meta-row { display: flex; justify-content: flex-end; }
.meta-row .meta { float: none; margin: 4px 0 -2px; }
.fwd { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--accent); margin: 1px 0 4px; }
.fwd svg { width: 15px; height: 15px; flex: none; }
.fwd b { font-weight: 600; }
.msg.out .fwd { color: rgba(255, 255, 255, .9); }
.reply-q { border-left: 3px solid currentColor; padding: 3px 9px; margin: 2px 0 5px; border-radius: 6px; font-size: 14px; cursor: pointer;
  background: color-mix(in srgb, currentColor 11%, transparent); color: var(--accent); }
.msg.out .reply-q { color: #fff; }
.reply-q .rq-name { font-weight: 600; }
.reply-q .rq-text { color: var(--text); opacity: .8; }
.msg.out .reply-q .rq-text { color: #fff; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; clear: both; }
.react { padding: 2px 8px; border-radius: 13px; font-size: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); display: flex; gap: 4px; align-items: center; transition: transform .25s var(--pop); }
.react span { font-size: 13px; font-weight: 600; color: var(--accent); }
.react:active { transform: scale(.88); }
.react.mine { background: var(--accent); }
.react.mine span { color: #fff; }
.msg.out .react { background: rgba(255, 255, 255, .2); }
.msg.out .react span { color: #fff; }
.msg.out .react.mine { background: #fff; }
.msg.out .react.mine span { color: var(--accent); }
.img-holder { overflow: hidden; border-radius: 15px; position: relative; }
.img-msg { display: block; border-radius: 15px; max-width: 100%; height: auto; max-height: 440px; object-fit: cover; cursor: zoom-in; background: var(--panel-2); transition: filter .3s; }
.img-msg.blur { filter: blur(14px); }
.video-msg { width: min(340px, 100%); max-height: 440px; border-radius: 15px; display: block; background: #000; }
.video-ph { width: min(320px, 70vw); max-height: 440px; border-radius: 15px; background: #111 center/cover no-repeat; display: grid; place-items: center; color: #fff; cursor: pointer; position: relative; overflow: hidden; }
.video-ph .play-c { width: 52px; height: 52px; border-radius: 50%; background: rgba(0, 0, 0, .5); display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); position: relative; transition: transform .25s var(--pop); }
.video-ph:active .play-c { transform: scale(.9); }
.video-ph .play-c svg.i { width: 22px; height: 22px; margin-left: 2px; }
.video-ph .v-info { position: absolute; left: 8px; top: 8px; font-size: 12px; padding: 2px 7px; border-radius: 9px; background: rgba(0, 0, 0, .5); }
.video-ph .ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.video-ph .ring circle { fill: none; stroke: rgba(255, 255, 255, .25); stroke-width: 2.5; }
.video-ph .ring .fg { stroke: #fff; stroke-dasharray: 100.5; stroke-dashoffset: calc(100.5 - 100.5 * var(--p, 0)); transition: stroke-dashoffset .2s; stroke-linecap: round; }
.video-ph .pct { font-size: 11px; font-weight: 600; position: relative; }
.video-ph.failed { cursor: default; aspect-ratio: 16/10; }
.v-fail { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 16px; font-size: 13.5px; }

.audio-msg { display: flex; gap: 10px; align-items: center; min-width: 230px; padding: 3px 0; }
.audio-msg .cover { width: 46px; height: 46px; border-radius: 10px; position: relative; cursor: pointer; }
.audio-msg .cover .ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .3); color: #fff; }
.audio-msg .cover .ov svg { width: 20px; height: 20px; }
.audio-msg .a-title { font-weight: 600; }
.audio-msg .a-sub { font-size: 13px; opacity: .7; }
.msg.out .audio-msg .cover { background-color: rgba(255, 255, 255, .22); color: #fff; }

.voice-msg { display: flex; align-items: center; gap: 10px; min-width: 220px; padding: 3px 0; }
.play-round { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; transition: transform .2s var(--pop); }
.play-round:active { transform: scale(.88); }
.play-round .spinner { width: 18px; height: 18px; }
.msg.out .play-round { background: #fff; color: var(--accent); }
.play-round svg { width: 18px; height: 18px; }
.wave { display: flex; align-items: center; gap: 2px; height: 28px; flex: 1; cursor: pointer; }
.wave i { flex: 1; min-width: 2px; max-width: 3.5px; border-radius: 2px; background: currentColor; opacity: .32; transition: opacity .15s; }
.msg.in .wave { color: var(--accent); }
.wave i.p { opacity: 1; }
.voice-msg .v-row { display: flex; align-items: center; gap: 8px; }
.v-speed { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: rgba(127,127,127,.18); color: inherit; opacity: .75; font-variant-numeric: tabular-nums; }
.v-speed.on { opacity: 1; background: var(--accent); color: #fff; }
.round .round-speed { position: absolute; left: 50%; top: 7%; transform: translateX(-50%); display: none; z-index: 2; background: rgba(0,0,0,.55); color: #fff; opacity: 1; }
.round.playing .round-speed { display: block; }
.round .round-speed.on { background: var(--accent); }
.voice-msg .v-time { font-size: 12.5px; opacity: .7; min-width: 34px; margin-top: 2px; font-variant-numeric: tabular-nums; }

.file-msg { display: flex; gap: 10px; align-items: center; min-width: 210px; cursor: pointer; padding: 3px 0; }
.file-msg .f-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; }
.file-msg .f-ico svg { width: 20px; height: 20px; }
.msg.out .file-msg .f-ico { background: rgba(255, 255, 255, .25); }
.file-msg .f-name { font-weight: 600; }
.file-msg .f-size { font-size: 13px; opacity: .7; }

/* Посты каналов: слева, широкие, с комментариями */
.msg.post { justify-content: flex-start; margin: 5px 0; }
.msg.post .bubble { max-width: min(560px, 94%); width: 100%; border-radius: 16px !important; padding-bottom: 0; }
.msg.post .bubble.media { padding: 3px 3px 0; }
.post-head { display: flex; align-items: center; gap: 7px; color: var(--accent) !important; margin-bottom: 4px !important; }
.post-head .avatar { font-size: 10px; }
.msg.post .bubble > .text, .msg.post .bubble > .reacts { margin-bottom: 6px; }
.msg.post .bubble.media > .meta { bottom: 52px; }
.comments-bar { display: flex; align-items: center; gap: 8px; width: calc(100% + 22px); margin: 6px -11px 0; padding: 9px 12px; clear: both;
  border-top: .5px solid var(--sep); color: var(--accent); font-size: 14.5px; font-weight: 500; text-align: left; border-radius: 0 0 16px 16px; transition: background .15s; }
.bubble.media .comments-bar { width: calc(100% + 6px); margin: 4px -3px 0; }
.comments-bar:hover { background: var(--hover); }
.comments-bar svg { width: 18px; height: 18px; }
.comments-bar svg:last-child { color: var(--faint); }
.react-add { position: absolute; right: -10px; top: -10px; width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--muted); opacity: 0; transform: scale(.6); transition: all .25s var(--pop); }
.react-add svg { width: 16px; height: 16px; }
.msg.post:hover .react-add { opacity: 1; transform: none; }
.thread-post { margin-bottom: 4px; }
.thread-post .msg.post .bubble { padding-bottom: 6px; }
.messages-wrap.thread .msg.post .bubble { max-width: 100%; }

.scroll-down {
  position: absolute; right: 14px; bottom: 12px; width: 42px; height: 42px; border-radius: 50%; z-index: 3;
  background: var(--chrome); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
  display: grid; place-items: center; color: var(--muted); animation: popIn .3s var(--pop);
}
.scroll-down .badge { position: absolute; top: -7px; right: -3px; margin: 0; }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } }

/* ───────── Поле ввода ───────── */
.composer-wrap { padding: 6px clamp(8px, 1.2vw, 18px); padding-bottom: max(8px, env(safe-area-inset-bottom)); flex: none;
  background: var(--chrome); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-top: .5px solid var(--sep); }
.reply-bar { display: flex; gap: 10px; align-items: center; padding: 2px 4px 8px 6px; animation: fadeUp .25s var(--spring); }
.reply-bar svg.lead { color: var(--accent); }
.reply-bar .rb-name { color: var(--accent); font-weight: 600; font-size: 14px; }
.reply-bar .rb-text { font-size: 14px; color: var(--muted); }
.reply-bar .icon-btn { width: 32px; height: 32px; color: var(--muted); }
.composer { display: flex; align-items: flex-end; gap: 2px; }
.composer textarea {
  flex: 1; border: .5px solid var(--sep); outline: none; background: var(--panel); resize: none; border-radius: 19px;
  padding: 8px 14px; max-height: 180px; min-height: 38px; line-height: 1.35; margin: 2px 4px; overflow-y: hidden; font-size: 16px;
}
:root[data-theme="dark"] .composer textarea { background: #1c1c1e; }
.composer .icon-btn { width: 42px; height: 42px; color: var(--muted); }
.composer .icon-btn.on { color: var(--warn); background: none; }
.send-btn { width: 38px; height: 38px; margin: 2px 2px 2px 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; transition: transform .25s var(--pop), background .2s; }
.send-btn svg { width: 19px; height: 19px; }
.send-btn[data-act="mic"] { background: transparent; color: var(--muted); }
.send-btn[data-act="mic"] svg { width: 22px; height: 22px; }
.send-btn:active { transform: scale(.85); }
.send-btn.rec { background: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger) 22%, transparent); } }
.composer.readonly { justify-content: center; }
.ttl-chip { font-size: 10px; font-weight: 700; color: var(--warn); position: absolute; bottom: 3px; right: 1px; }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 10px; height: 42px; color: var(--danger); font-variant-numeric: tabular-nums; }
.rec-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-bar canvas { flex: 1; height: 30px; min-width: 0; }
.drop-zone { position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); z-index: 10; font-size: 19px; font-weight: 600; color: var(--accent); pointer-events: none; }
.upload-progress { margin: 0 4px 6px; background: var(--panel); border-radius: 12px; padding: 8px 12px; font-size: 13px; display: flex; align-items: center; gap: 10px; animation: fadeUp .25s var(--spring); }
.upload-progress .bar { flex: 1; height: 3px; border-radius: 2px; background: var(--panel-3); overflow: hidden; }
.upload-progress .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.readonly-bar { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; color: var(--muted); font-size: 14px; text-align: center; }
.readonly-bar svg { width: 17px; height: 17px; color: var(--accent); }

/* ───────── Всплывающие меню ───────── */
.popover {
  position: fixed; z-index: 60; min-width: 220px; padding: 0; overflow: hidden;
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: saturate(1.8) blur(30px); -webkit-backdrop-filter: saturate(1.8) blur(30px);
  border-radius: 14px; box-shadow: 0 10px 50px rgba(0, 0, 0, .35), 0 0 0 .5px var(--sep); animation: popin .28s var(--pop); transform-origin: top left;
}
:root[data-theme="dark"] .popover { background: rgba(40, 40, 42, .96); }
.popover.closing { animation: popout .14s ease-in forwards; }
@keyframes popin { from { opacity: 0; transform: scale(.85); } }
@keyframes popout { to { opacity: 0; transform: scale(.92); } }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 16px; text-align: left; font-size: 16px; color: var(--text); text-decoration: none !important; }
.popover .menu-item { justify-content: space-between; flex-direction: row-reverse; border-top: .5px solid var(--sep); }
.popover .menu-item:first-child, .popover .react-row + .menu-item, .popover > div + .menu-item { border-top: 0; }
.popover .menu-item svg { color: var(--text); }
.menu-item:hover { background: var(--hover); }
.menu-item:active { background: var(--press); }
.menu-item svg { width: 20px; height: 20px; color: var(--muted); }
.menu-item.danger, .menu-item.danger svg { color: var(--danger) !important; }
.react-row { display: flex; gap: 0; padding: 6px; border-bottom: 6px solid color-mix(in srgb, var(--bg) 40%, transparent); }
.react-row button { font-size: 25px; width: 40px; height: 40px; border-radius: 50%; transition: transform .25s var(--pop); flex: 1; }
.react-row button:hover { background: var(--hover); transform: scale(1.2); }
.react-row button:active { transform: scale(.9); }
.emoji-pop { width: 340px; max-width: calc(100vw - 20px); padding: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); max-height: 290px; overflow-y: auto; }
.emoji-grid button { font-size: 25px; height: 40px; border-radius: 8px; transition: transform .2s var(--pop); }
.emoji-grid button:hover { background: var(--hover); transform: scale(1.15); }
.emoji-cat { grid-column: 1 / -1; font-size: 12px; color: var(--muted); padding: 8px 4px 4px; font-weight: 600; text-transform: uppercase; }
/* Стикеры: вкладки в панели, сетка, стикер в чате */
.pick-tabs { display: flex; gap: 4px; padding: 2px 2px 6px; }
.pick-tabs button { flex: 1; height: 32px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.pick-tabs button.on { background: var(--hover); color: var(--text); }
.pick-body { height: 300px; overflow-y: auto; }
.pick-body .emoji-grid { max-height: none; overflow: visible; }
.sticker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
.sticker-grid button { aspect-ratio: 1; border-radius: 12px; padding: 4px; transition: transform .2s var(--pop); }
.sticker-grid button:hover { background: var(--hover); transform: scale(1.06); }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.sticker { width: 168px; height: 168px; cursor: pointer; }
.sticker img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; -webkit-user-drag: none; }
.sticker.tap { animation: sticker-tap .3s var(--pop); }
@keyframes sticker-tap { 40% { transform: scale(.92); } }
.bubble.round-b .sticker + .meta { position: static; display: inline-flex; float: right; transform: none; background: rgba(0, 0, 0, .4); color: #fff; padding: 1px 7px; border-radius: 10px; margin-top: 2px; }

/* ───────── Окна (на телефоне — шторки снизу) ───────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 50;
  display: grid; place-items: center; padding: 16px; animation: fade .25s ease;
}
.modal-back.closing { animation: fadeOut .22s ease forwards; }
.modal-back.closing .modal { animation: modalOut .22s ease-in forwards; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.modal {
  width: 100%; max-width: 430px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); animation: modalIn .42s var(--spring); transition: transform .35s var(--spring);
}
:root[data-theme="dark"] .modal { background: #1c1c1e; }
:root[data-theme="light"] .modal { background: var(--panel-2); }
.modal.wide { max-width: 560px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(16px) scale(.97); } }
.sheet-grab { display: none; }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 8px 20px; }
.modal-head h2 { font-size: 18px; margin: 0; flex: 1; font-weight: 700; letter-spacing: -.3px; }
.modal-head .icon-btn { width: 30px; height: 30px; background: var(--panel-2); color: var(--muted); }
:root[data-theme="light"] .modal-head .icon-btn { background: var(--panel-3); }
.modal-head .icon-btn svg { width: 16px; height: 16px; stroke-width: 2.6; }
.modal-body { padding: 6px 16px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.modal-foot { padding: 0 16px 16px; display: flex; gap: 10px; justify-content: flex-end; }
.modal-foot .btn { flex: 1; }
.profile-top { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 4px 0 16px; text-align: center; }
.profile-top .name { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }
.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit .cam, .pcard-av .cam { position: absolute; right: 0; bottom: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; border: 3px solid var(--panel); }
.avatar-edit .cam svg, .pcard-av .cam svg { width: 15px; height: 15px; }
.menu-group { background: var(--panel); border-radius: 12px; overflow: hidden; margin-bottom: 14px; }
:root[data-theme="dark"] .modal .menu-group { background: #2c2c2e; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; cursor: pointer; position: relative; width: 100%; text-align: left; transition: background .15s; }
.list-row:hover { background: var(--hover); }
.list-row:active { background: var(--press); }
.menu-group > .list-row + .list-row::before, .menu-group > .menu-item + .menu-item::before, .menu-group > .menu-item + a.menu-item::before {
  content: ""; position: absolute; left: 60px; right: 0; top: 0; border-top: .5px solid var(--sep); }
.menu-group > .menu-item { position: relative; }
.list-row .check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--faint); display: grid; place-items: center; flex: none; transition: all .2s var(--pop); }
.list-row.sel .check { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.08); }
.list-row .check svg { width: 13px; height: 13px; stroke-width: 3; }
.section-title { font-size: 13px; font-weight: 500; color: var(--muted); margin: 18px 0 6px 12px; text-transform: uppercase; letter-spacing: .02em; }
.setting { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.setting .grow > div:first-child { font-weight: 500; }
.switch { width: 51px; height: 31px; border-radius: 16px; background: var(--panel-3); position: relative; transition: background .25s; flex: none; }
:root[data-theme="dark"] .switch { background: #39393d; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }
.swatches { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 4px 8px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; outline: 2px solid transparent; transition: transform .25s var(--pop); }
.swatch:active { transform: scale(.85); }
.swatch.on { border-color: var(--panel); outline-color: var(--text); }
.seg { display: flex; background: rgba(118, 118, 128, .24); border-radius: 9px; padding: 2px; flex: none; }
:root[data-theme="light"] .seg { background: rgba(118, 118, 128, .12); }
.seg button { padding: 6px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500; transition: background .25s, box-shadow .25s; display: inline-flex; align-items: center; gap: 5px; justify-content: center; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 35%, transparent); }
:root[data-theme="light"] .seg button.on { background: var(--accent); }
.code-box { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; letter-spacing: 1px; background: var(--panel-2); border-radius: 12px; padding: 14px; text-align: center; user-select: all; }
.safety-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; font-family: ui-monospace, Menlo, monospace; font-size: 17px; text-align: center; background: var(--panel-2); padding: 16px; border-radius: 14px; }
.safety-emoji { font-size: 34px; text-align: center; letter-spacing: 4px; margin: 14px 0; }
.invite-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--panel-2); border-radius: 12px; margin-bottom: 8px; }
.invite-row code { font-size: 15px; font-weight: 600; letter-spacing: .5px; background: none; }
.crop-area { width: 280px; height: 280px; margin: 0 auto; position: relative; border-radius: 16px; overflow: hidden; background: #000; touch-action: none; cursor: grab; }
.crop-area canvas { width: 100%; height: 100%; display: block; }
.crop-area::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 200px rgba(0, 0, 0, .55); pointer-events: none; }
.crop-area.rect { border-radius: 14px; }
.crop-area.rect::after { border-radius: 0; box-shadow: none; outline: 2px solid rgba(255, 255, 255, .35); outline-offset: -2px; }
input[type="range"] { width: 100%; accent-color: var(--accent); }

/* ───────── Боковое меню ───────── */
.drawer-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; animation: fade .3s ease; }
.drawer-back.closing { animation: fadeOut .24s ease forwards; }
.drawer { position: fixed; left: 0; top: 0; bottom: 0; width: 320px; max-width: 86vw; z-index: 41; display: flex; flex-direction: column;
  background: var(--bg); box-shadow: var(--shadow); animation: slideIn .45s var(--spring); }
.drawer.closing { animation: slideOut .24s ease-in forwards; }
@keyframes slideIn { from { transform: translateX(-100%); } }
@keyframes slideOut { to { transform: translateX(-100%); } }
.drawer-top { padding: 20px 16px 14px; padding-top: max(20px, env(safe-area-inset-top)); position: relative; background: var(--panel) center/cover; }
:root[data-theme="dark"] .drawer-top { background-color: #1c1c1e; }
.drawer-top.has-banner { color: #fff; }
.drawer-top.has-banner::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0, 0, 0, .1), rgba(0, 0, 0, .65)); }
.drawer-top > * { position: relative; }
.drawer-me { display: block; text-align: left; width: 100%; }
.drawer-me .avatar { margin-bottom: 10px; }
.drawer-me .name { font-weight: 700; font-size: 19px; display: flex; align-items: center; letter-spacing: -.3px; }
.drawer-me .uname { opacity: .65; font-size: 14px; margin-top: 1px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 12px max(16px, env(safe-area-inset-bottom)); }
.drawer .menu-item { padding: 10px 14px; font-size: 16px; }
.drawer .menu-item .avatar { --s: 30px; }
.mi-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.mi-ico svg { width: 18px !important; height: 18px !important; color: #fff !important; }
.menu-item.danger .mi-ico { background: var(--danger); }
.menu-item.danger .mi-ico svg { color: #fff !important; }
.drawer .menu-group > .menu-item + .menu-item::before { left: 58px; }
.drawer .foot { padding: 8px 14px; font-size: 12px; color: var(--faint); line-height: 1.6; font-family: ui-monospace, Menlo, monospace; }

/* ───────── Просмотр фото ───────── */
.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .94); display: grid; place-items: center; animation: fade .25s ease; touch-action: pan-x pinch-zoom; }
.lightbox.closing { animation: fadeOut .22s ease forwards; }
.lb-img { max-width: 100vw; max-height: 100dvh; object-fit: contain; transition: transform .35s var(--spring); animation: zoomIn .4s var(--spring); }
@keyframes zoomIn { from { transform: scale(.88); opacity: .4; } }
.lb-tools { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: flex; gap: 8px; z-index: 2; }
.lightbox .icon-btn { color: #fff; background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); }
.lb-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 20px max(20px, env(safe-area-inset-bottom)); color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); white-space: pre-wrap; }

.toasts { position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--text); padding: 11px 18px; border-radius: 22px; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25), 0 0 0 .5px var(--sep); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px);
  animation: toastIn .5s var(--spring); text-align: center; }
:root[data-theme="dark"] .toast { background: rgba(44, 44, 46, .88); }
.toast.err { color: var(--danger); }
.toast.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.95); } }

/* ───────── Музыка ───────── */
.music { flex: 1; overflow-y: auto; background: var(--bg); }
.np { position: relative; padding: 28px 24px 24px; overflow: hidden; color: #fff; isolation: isolate; background: #1c1c1e; }
.np-bg { position: absolute; inset: -40px; background: center/cover no-repeat; filter: blur(50px) saturate(1.5) brightness(.55); z-index: -1; transform: scale(1.2); }
.np-inner { display: flex; gap: 22px; align-items: center; max-width: 900px; margin: 0 auto; }
.np .cover { width: 168px; height: 168px; border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .45); background-color: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .7); }
.np-title { font-size: 26px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; }
.np-artist { font-size: 16px; opacity: .75; margin-top: 4px; }
.np-controls { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.np-controls .icon-btn { color: rgba(255, 255, 255, .85); }
.np-controls .icon-btn:hover { background: rgba(255, 255, 255, .12); }
.np-controls .icon-btn.on { color: #fff; background: rgba(255, 255, 255, .2); }
.np-play { width: 58px; height: 58px; border-radius: 50%; background: #fff; color: #000; display: grid; place-items: center; transition: transform .25s var(--pop); }
.np-play:active { transform: scale(.9); }
.np-play svg { width: 24px; height: 24px; }
.seek { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; font-variant-numeric: tabular-nums; opacity: .85; }
.seek input { flex: 1; accent-color: #fff; }
.viz-bars { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; z-index: -1; opacity: .25; pointer-events: none; display: flex; align-items: flex-end; gap: 3px; padding: 0 3px; }
.viz-bars i { flex: 1; background: #fff; border-radius: 2px 2px 0 0; height: 20%; animation: eq 1.1s ease-in-out infinite; }
.viz-bars i:nth-child(3n) { animation-duration: .8s; } .viz-bars i:nth-child(4n+1) { animation-duration: 1.4s; } .viz-bars i:nth-child(5n+2) { animation-delay: -.4s; } .viz-bars i:nth-child(7n) { animation-delay: -.7s; }
.viz-bars.paused i { animation-play-state: paused; }
.np-load { font-size: 13px; opacity: .8; margin-top: 10px; }
.miniplayer .mp-bar.loading { opacity: .5; transition: width .15s linear; }
.vol { display: flex; align-items: center; gap: 6px; margin-left: auto; width: 140px; }
.vol input { accent-color: #fff; }
.music-tabs-wrap { max-width: 948px; margin: 16px auto 0; padding: 0 24px; }
.music-tabs { display: inline-flex; }
.music-tabs button { white-space: nowrap; }
.music-tools { display: flex; gap: 10px; padding: 14px 24px; align-items: center; flex-wrap: wrap; max-width: 948px; margin: 0 auto; }
.music-tools .search { min-width: 200px; }
.tracks { padding: 0 12px 40px; max-width: 948px; margin: 0 auto; }
.track { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.track:hover { background: var(--hover); }
.track.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.track.on .t-title { color: var(--accent); }
.track .cover { width: 46px; height: 46px; border-radius: 8px; position: relative; }
.track .num { width: 22px; text-align: center; color: var(--faint); font-size: 13px; font-variant-numeric: tabular-nums; }
.track .t-title { font-weight: 600; }
.track .t-sub { font-size: 13px; color: var(--muted); }
.track .t-dur { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.eq { display: flex; gap: 2px; align-items: flex-end; height: 14px; justify-content: center; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq .8s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.55s; }
.eq.paused i { animation-play-state: paused; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }
.np-stream { max-width: 900px; margin: 0 auto; }
.cover.svc { background: var(--svc) !important; color: #111 !important; }
.cover.svc svg.i { width: 55%; height: 55%; }
.mlink { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 10px; border-radius: 13px; cursor: pointer; min-width: 240px;
  background: color-mix(in srgb, var(--svc) 14%, transparent); transition: transform .2s var(--pop); }
.mlink:active { transform: scale(.97); }
.mlink-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--svc); color: #111; flex: none; }
.mlink-ico svg.i { width: 24px; height: 24px; }
.mlink-t { font-weight: 600; font-size: 14px; }
.mlink-s { font-size: 12px; opacity: .65; max-width: 250px; }
.mlink-play { width: 32px; height: 32px; border-radius: 50%; background: var(--svc); color: #111; display: grid; place-items: center; flex: none; }
.mlink-play svg { width: 14px; height: 14px; }
.mlink-frame { display: block; width: 100%; min-width: 280px; border: 0; border-radius: 12px; margin-top: 6px; background: #111; }
.mlink-frame.big { min-width: 0; margin: 0; }

/* ───────── Приветствие ───────── */
.welcome { flex: 1; display: grid; place-items: center; padding: 20px; background: var(--chat-bg); }
.welcome-card { text-align: center; max-width: 340px; color: var(--muted); animation: rise .6s var(--spring) both; }
.welcome-card .logo-mark { margin: 0 auto 16px; }
.welcome-card h2 { color: var(--text); margin: 0 0 4px; font-size: 24px; letter-spacing: -.4px; }
.welcome-hint { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; font-size: 13px; padding: 6px 12px; border-radius: 14px; background: color-mix(in srgb, var(--panel) 70%, transparent); }
.welcome-hint svg { width: 14px; height: 14px; color: var(--ok); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* ───────── Профиль ───────── */
.pcard-banner { height: 140px; border-radius: 14px; background: var(--g) center/cover no-repeat; position: relative; }
.pcard-banner.edit { cursor: pointer; }
.pcard-banner .cam { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center; }
.pcard-banner .cam svg { width: 15px; height: 15px; }
.pcard-av { margin: -52px 0 0 16px; width: fit-content; position: relative; }
.pcard-av .avatar { box-shadow: 0 0 0 5px var(--panel); }
:root[data-theme="dark"] .pcard-av .avatar { box-shadow: 0 0 0 5px #1c1c1e; }
:root[data-theme="light"] .pcard-av .avatar { box-shadow: 0 0 0 5px var(--panel-2); }
.pcard-av.edit { cursor: pointer; }
.pcard-info { padding: 10px 4px 16px; }
.pcard-info .name { font-size: 22px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; }
.pcard-info .links { display: flex; gap: 14px; margin-top: 6px; }
.pcard-info .links button { font-size: 13.5px; color: var(--accent); }
.pcard-bio { margin-top: 10px; white-space: pre-wrap; line-height: 1.45; }

/* значки-галочки */
.badge-ico { display: inline-flex; vertical-align: -3px; margin-left: 3px; }
.badge-ico svg.i { width: 16px; height: 16px; }
.chat-head .badge-ico svg.i { width: 16px; height: 16px; }
.b-verified { color: #0a84ff; }
.b-vip { color: #bf5af2; }
.b-creator { color: #ff9f0a; }
.b-mod { color: #30d158; }
.chat-item.on .badge-ico { color: #fff; }
.badge-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; border-radius: 14px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, currentColor 14%, transparent); }
.badge-line svg.i { width: 15px; height: 15px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 16px; background: var(--panel-2); font-size: 13.5px; font-weight: 500; border: 1.5px solid transparent; transition: all .2s; }
:root[data-theme="dark"] .modal .chip, :root[data-theme="dark"] .admin .chip { background: #2c2c2e; }
.chip svg.i { width: 15px; height: 15px; }
.chip.on { border-color: currentColor; background: color-mix(in srgb, currentColor 12%, transparent) !important; }
.chips .chip.on { color: var(--accent); }

/* ───────── Админ-панель ───────── */
.admin { flex: 1; overflow-y: auto; background: var(--bg); }
.admin-inner { max-width: 980px; margin: 0 auto; padding: 16px 16px 40px; }
.admin-tabs { display: inline-flex; margin-bottom: 16px; }
.admin-tabs button { padding: 7px 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--panel); border-radius: 16px; padding: 14px 16px; animation: rise .45s var(--spring) both; }
:root[data-theme="dark"] .stat, :root[data-theme="dark"] .panel { background: #1c1c1e; }
.stat:nth-child(2) { animation-delay: .03s; } .stat:nth-child(3) { animation-delay: .06s; } .stat:nth-child(4) { animation-delay: .09s; }
.stat:nth-child(5) { animation-delay: .12s; } .stat:nth-child(6) { animation-delay: .15s; } .stat:nth-child(n+7) { animation-delay: .18s; }
.stat-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); margin-bottom: 10px; }
.stat-ico svg { width: 18px; height: 18px; }
.stat-v { font-size: 26px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 14px; font-weight: 500; }
.stat-s { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.panel { background: var(--panel); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.panel.flush { padding: 4px 0; overflow: hidden; }
.panel-t { font-weight: 600; margin-bottom: 12px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.bar { width: 100%; max-width: 34px; background: var(--accent); border-radius: 6px 6px 3px 3px; transform-origin: bottom; animation: grow .7s var(--spring) both; }
@keyframes grow { from { transform: scaleY(0); } }
.bar-v { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-l { font-size: 10.5px; color: var(--faint); height: 14px; white-space: nowrap; }
.admin-tools { display: flex; gap: 10px; margin-bottom: 10px; }
.admin-tools .search input { background: var(--panel); height: 40px; }
:root[data-theme="dark"] .admin-tools .search input { background: #1c1c1e; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-user { position: relative; }
.adm-user + .adm-user::before { content: ""; position: absolute; left: 66px; right: 0; top: 0; border-top: .5px solid var(--sep); }
.adm-user.banned .list-row { opacity: .55; }
.adm-user.open { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.adm-user.open .chev { transform: rotate(90deg); }
.adm-user .chev { transition: transform .3s var(--spring); }
.adm-num { text-align: right; line-height: 1.15; }
.adm-num b { display: block; font-variant-numeric: tabular-nums; }
.adm-num span { font-size: 11.5px; color: var(--muted); }
.adm-detail { padding: 4px 16px 16px 66px; animation: fadeUp .3s var(--spring); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: .5px solid var(--sep); font-size: 14.5px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }

/* ───────── Анимации списков ───────── */
.chat-list .enter { animation: listIn .45s var(--spring) both; }
@keyframes listIn { from { opacity: 0; transform: translateY(-10px); } }
.messages .enter { animation: msgIn .42s var(--spring) both; }
.messages .msg.out.enter { transform-origin: bottom right; }
.messages .msg.in.enter { transform-origin: bottom left; }
@keyframes msgIn { from { opacity: 0; transform: translateY(16px) scale(.94); } }
.main > .chat-head, .main > .messages-wrap, .main > .composer-wrap { animation: none; }

/* ───────── Телефон ───────── */
@media (max-width: 760px) {
  :root { --tabbar-h: calc(50px + env(safe-area-inset-bottom)); }
  .desk-only { display: none !important; }
  .sidebar { width: 100%; max-width: none; min-width: 0; border-right: 0; }
  .large-title { font-size: 30px; letter-spacing: -.6px; }
  .side-top { height: 48px; }
  .main { position: fixed; inset: 0; transform: translateX(100%); transition: transform .5s var(--spring); z-index: 20; box-shadow: -10px 0 30px rgba(0, 0, 0, .25); }
  .app.show-main .main { transform: none; }
  .app.show-main .sidebar { transform: translateX(-28%); filter: brightness(.85); }
  .back-btn { display: grid; }
  .messages { padding: 8px 8px 6px; }
  .bubble { max-width: 84%; }
  .composer-wrap { padding-left: 4px; padding-right: 4px; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; height: var(--tabbar-h); padding-bottom: env(safe-area-inset-bottom);
    background: var(--chrome); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); border-top: .5px solid var(--sep);
  }
  .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 10.5px; font-weight: 500; position: relative; transition: color .2s; }
  .tabbar button svg { width: 25px; height: 25px; transition: transform .3s var(--pop); }
  .tabbar button:active svg { transform: scale(.85); }
  .tabbar button.on { color: var(--accent); }
  .tab-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 600; font-style: normal; display: none; place-items: center; }
  .tab-badge.on { display: grid; animation: popIn .35s var(--pop); }
  .mp-side { display: block; }
  .mp-side .miniplayer { border-top: .5px solid var(--sep); }
  .np-inner { flex-direction: column; text-align: center; }
  .np .cover { width: 220px; height: 220px; }
  .np-controls { justify-content: center; flex-wrap: wrap; }
  .vol { display: none; }
  .music-tools { padding: 12px; }
  .music-tabs-wrap { padding: 0 12px; }
  .music-tabs { display: flex; width: 100%; }
  .music-tabs button { flex: 1; font-size: 12.5px; padding: 7px 6px; }
  .tracks { padding: 0 4px 100px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat-v { font-size: 22px; }
  .adm-detail { padding-left: 16px; }
  .bars { gap: 3px; height: 140px; }

  /* Окна — шторками снизу, их можно смахнуть вниз */
  .modal-back { place-items: end stretch; padding: 0; }
  .modal { max-width: none !important; border-radius: 14px 14px 0 0; max-height: calc(100dvh - max(28px, env(safe-area-inset-top))); padding-bottom: env(safe-area-inset-bottom); animation: sheetIn .5s var(--spring); }
  .modal-back.closing .modal { animation: sheetOut .25s ease-in forwards; }
  .sheet-grab { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--faint); margin: 7px auto 0; flex: none; }
  .modal-head { padding-top: 6px; }
  @keyframes sheetIn { from { transform: translateY(100%); } }
  @keyframes sheetOut { to { transform: translateY(100%); } }
  .popover { min-width: 240px; }
}

@media (min-width: 761px) {
  .chat-item { margin: 0 8px; border-radius: 12px; padding: 7px 10px; }
  .chat-item > .grow::after { display: none; }
  .chat-item.pinned:not(.on) { background: none; }
}

/* ───────── Эффекты, спойлеры, лайк ───────── */
.fx-layer { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 120; }
.bubble { position: relative; }
.heart-pop { position: absolute; left: 50%; top: 50%; font-size: 54px; pointer-events: none; z-index: 4; transform: translate(-50%, -50%) scale(0);
  animation: heartPop .9s var(--pop) forwards; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
@keyframes heartPop { 30% { transform: translate(-50%, -50%) scale(1.25); } 55% { transform: translate(-50%, -50%) scale(.95); } 80% { opacity: 1; transform: translate(-50%, -60%) scale(1); } to { opacity: 0; transform: translate(-50%, -110%) scale(.8); } }
[data-fx] { cursor: pointer; }
.spoiler { border-radius: 5px; cursor: pointer; color: transparent; padding: 0 2px; -webkit-user-select: none; user-select: none;
  background: radial-gradient(circle, currentColor 0 1px, transparent 1.4px) 0 0 / 5px 5px, color-mix(in srgb, var(--muted) 35%, transparent);
  background-color: color-mix(in srgb, var(--text) 22%, transparent); color: transparent; animation: spoil 1.4s linear infinite; transition: color .3s, background .3s; }
.spoiler { background-image: radial-gradient(circle, rgba(255, 255, 255, .75) 0 .8px, transparent 1.3px); background-size: 5px 5px; }
@keyframes spoil { to { background-position: 5px 10px; } }
.spoiler.shown { color: inherit; background: color-mix(in srgb, currentColor 10%, transparent); animation: none; -webkit-user-select: text; user-select: text; cursor: text; }

/* ───────── Кружочки ───────── */
.bubble.round-b { background: none !important; padding: 0; box-shadow: none; }
.bubble.round-b .meta { right: 50%; transform: translateX(50%); bottom: -4px; }
.round { --p: 0; width: min(240px, 62vw); aspect-ratio: 1; border-radius: 50%; position: relative; overflow: hidden; cursor: pointer;
  background: #111 center/cover no-repeat; display: grid; place-items: center; transition: width .35s var(--spring), transform .2s; margin-bottom: 14px; }
.round video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.round.playing { width: min(300px, 78vw); }
.round:active { transform: scale(.97); }
.round .play-c { width: 52px; height: 52px; border-radius: 50%; background: rgba(0, 0, 0, .45); display: grid; place-items: center; color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.round .play-c svg { width: 22px; height: 22px; margin-left: 2px; }
.round-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); pointer-events: none; }
.round-ring circle { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: calc(301.6 * (1 - var(--p))); opacity: 0; transition: opacity .2s; }
.round.playing .round-ring circle, .round.loading .round-ring circle { opacity: .95; }
.round-dur { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .45); padding: 1px 8px; border-radius: 10px; backdrop-filter: blur(6px); }
.round.playing .round-dur { opacity: 0; }

.round-rec { --p: 0; position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: rgba(0, 0, 0, .78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); animation: fadeIn .25s; padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.round-rec.closing { animation: fadeOut .22s forwards; }
.rr-stage { position: relative; width: min(78vw, 360px); aspect-ratio: 1; animation: rrIn .45s var(--spring); }
@keyframes rrIn { from { transform: scale(.6); opacity: 0; } }
.rr-video { position: absolute; inset: 7px; width: calc(100% - 14px); height: calc(100% - 14px); object-fit: cover; border-radius: 50%; background: #111; }
.rr-video.mirror { transform: scaleX(-1); }
.rr-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.rr-ring circle { fill: none; stroke: rgba(255, 255, 255, .18); stroke-width: 2.5; }
.rr-ring .fg { stroke: var(--danger); stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: calc(301.6 * (1 - var(--p))); }
.rr-time { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.rr-time .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rr-tools { display: flex; gap: 26px; align-items: center; }
.rr-btn { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; transition: transform .2s var(--pop); }
.rr-btn.rr-main { width: 72px; height: 72px; background: var(--accent); }
.rr-btn:active { transform: scale(.9); }
.rr-btn svg { width: 24px; height: 24px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ───────── Поиск по чату ───────── */
.find-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--panel-2); border-radius: 10px; padding: 0 10px; height: 36px; color: var(--muted); }
.find-box svg { width: 17px; height: 17px; flex: none; }
.find-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; }
.find-count { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
svg.i.up { transform: rotate(-90deg); }
svg.i.down { transform: rotate(90deg); }
.msg.found .bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent); }

/* ───────── Обои чата ───────── */
.walls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.wall-pick { height: 62px; border-radius: 12px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 6px 8px; color: #fff; font-size: 12.5px; font-weight: 600;
  background: var(--chat-bg); border: 2px solid transparent; transition: transform .2s var(--pop); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.wall-pick.on { border-color: var(--accent); }
.wall-pick:active { transform: scale(.95); }
.wall-pick[data-w="none"] { color: var(--text); text-shadow: none; background: var(--panel-2); }
.wall-pick[data-w="nebula"], :root[data-wall="nebula"] .messages-wrap { background: radial-gradient(60% 50% at 20% 20%, #4b2a8a 0%, transparent 70%), radial-gradient(55% 45% at 85% 35%, #1d4f8f 0%, transparent 70%), radial-gradient(60% 60% at 50% 100%, #8a2a6b 0%, transparent 70%), #0a0716; }
.wall-pick[data-w="aurora"], :root[data-wall="aurora"] .messages-wrap { background: radial-gradient(70% 40% at 30% 0%, #1fae84 0%, transparent 70%), radial-gradient(60% 40% at 80% 20%, #2a6ee0 0%, transparent 70%), radial-gradient(70% 50% at 50% 110%, #5a2ea8 0%, transparent 70%), #04121a; }
.wall-pick[data-w="stars"], :root[data-wall="stars"] .messages-wrap { background: radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 32%, #fff 50%, transparent 51%), radial-gradient(1.4px 1.4px at 40% 70%, #cfe3ff 50%, transparent 51%), radial-gradient(1px 1px at 88% 82%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 22% 88%, #fff 50%, transparent 51%), radial-gradient(1.3px 1.3px at 58% 12%, #ffe9c7 50%, transparent 51%), radial-gradient(80% 60% at 50% 120%, #1b2350 0%, transparent 70%), #05060d; background-size: 260px 260px, 310px 310px, 230px 230px, 290px 290px, 200px 200px, 340px 340px, 100% 100%, auto; }
.wall-pick[data-w="sunset"], :root[data-wall="sunset"] .messages-wrap { background: radial-gradient(70% 55% at 50% 110%, #ff7a3d 0%, transparent 70%), radial-gradient(60% 50% at 10% 40%, #c2347a 0%, transparent 70%), radial-gradient(60% 50% at 90% 10%, #5b2a9e 0%, transparent 70%), #1a0b1e; }
.wall-pick[data-w="ocean"], :root[data-wall="ocean"] .messages-wrap { background: radial-gradient(70% 50% at 20% 100%, #0f7b8c 0%, transparent 70%), radial-gradient(60% 50% at 90% 30%, #1b4fa8 0%, transparent 70%), linear-gradient(180deg, #03111f, #062238); }
:root:not([data-wall="none"]) .messages-wrap::before { content: ''; position: absolute; inset: -20%; pointer-events: none; z-index: 0;
  background: radial-gradient(40% 30% at 30% 30%, rgba(255, 255, 255, .07), transparent 70%), radial-gradient(35% 30% at 70% 70%, rgba(255, 255, 255, .05), transparent 70%);
  animation: wallDrift 18s ease-in-out infinite alternate; }
:root[data-wall="stars"] .messages-wrap::before { background: radial-gradient(1px 1px at 30% 40%, #fff 50%, transparent 51%) 0 0 / 180px 180px, radial-gradient(1px 1px at 60% 80%, #fff 50%, transparent 51%) 0 0 / 220px 220px; animation: twinkle 4s ease-in-out infinite alternate; }
@keyframes wallDrift { to { transform: translate(6%, -5%) rotate(8deg) scale(1.08); } }
@keyframes twinkle { from { opacity: .25; } to { opacity: 1; } }
:root:not([data-wall="none"]) .messages { position: relative; z-index: 1; }
:root:not([data-wall="none"]) .day-sep, :root:not([data-wall="none"]) .e2e-note { background: rgba(0, 0, 0, .35); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
:root:not([data-wall="none"]) .msg.in .bubble { background: color-mix(in srgb, var(--bubble-in, var(--panel)) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Окно «Приложения Orbiq» */
.app-dl { border: 1px solid color-mix(in srgb, currentColor 14%, transparent); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.app-dl.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.app-dl a.btn { text-decoration: none; }
#push-ask .grow svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* Бета */
.b-beta { color: #ff6b3d; }
.beta-pill { display: inline-block; margin-left: 8px; padding: 2px 7px; border-radius: 7px; font-size: 11px; font-weight: 800; letter-spacing: .08em; vertical-align: 4px;
  color: #fff; background: linear-gradient(135deg, #ff6b3d, #bf5af2); line-height: 1.35; }
.auth .logo h1 .beta-pill { vertical-align: 8px; font-size: 12px; }
.adm-cnt:not(:empty) { margin-left: 6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #ff453a; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 18px; display: inline-block; text-align: center; }
.bug { padding: 12px 14px; border-bottom: .5px solid var(--sep); }
.bug:last-child { border-bottom: 0; }
.bug.done { opacity: .55; }
.bug-text { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.45; }
.change { display: flex; gap: 12px; padding: 10px 0; border-bottom: .5px solid var(--sep); }
.change:last-child { border-bottom: 0; }
.change-dot { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), #bf5af2); }
.change-dot svg.i { width: 18px; height: 18px; }.faint { color: var(--faint); }

/* ── Запись как в Telegram: удержание кнопки ── */
.composer.recording > :not(.rec-ui):not(#send-btn) { display: none !important; }
.rec-ui { flex: 1; display: flex; align-items: center; min-width: 0; }
.composer.recording:not(.locked) .rec-trash { display: none; }
.composer.locked .rec-slide { display: none; }
.rec-slide { display: flex; align-items: center; gap: 4px; padding: 0 10px; color: var(--muted); font-size: 14px; white-space: nowrap; transition: opacity .1s; }
.rec-slide svg { width: 16px; height: 16px; animation: nudgeL 1.2s infinite; }
@keyframes nudgeL { 50% { transform: translateX(-4px); } }
.send-btn { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.send-btn.holding { transform: scale(1.75); background: var(--danger) !important; color: #fff !important; box-shadow: 0 0 0 10px color-mix(in srgb, var(--danger) 22%, transparent); z-index: 96; position: relative; }
.send-btn.swap svg { animation: recSwap .35s var(--pop); }
@keyframes recSwap { 0% { transform: scale(.3) rotate(-60deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.rec-lock { position: fixed; z-index: 97; width: 40px; height: 76px; border-radius: 20px; background: var(--panel); color: var(--muted);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35); display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; animation: fadeUp .25s var(--spring); pointer-events: none; }
.rec-lock svg { width: 18px; height: 18px; }
.rec-lock .rec-arrow svg { transform: rotate(-90deg); animation: bobUp 1.2s infinite; }
@keyframes bobUp { 50% { translate: 0 -4px; } }
.round-rec .rr-hint { display: flex; gap: 22px; color: rgba(255, 255, 255, .75); font-size: 14.5px; }
.round-rec .rr-hint span { display: flex; align-items: center; gap: 5px; transition: opacity .1s; }
.round-rec .rr-hint svg { width: 16px; height: 16px; }
.round-rec .rr-tools { display: none; }
.round-rec.locked .rr-tools { display: flex; }
.round-rec.locked .rr-hint { display: none; }
.round-rec:not(.locked) { pointer-events: none; }
.rr-wait { position: absolute; inset: 0; display: grid; place-items: center; }
.round-rec.live .rr-wait { display: none; }
.round-rec:not(.live) .rr-time { opacity: .4; }
/* ── Изменено, опросы, «один просмотр», отложенные, ответ свайпом ── */
.meta .edited { font-size: 11px; margin-right: 2px; }
.poll { min-width: min(280px, 70vw); padding: 2px 0 2px; }
.poll-q { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.poll-kind { font-size: 12.5px; opacity: .65; margin: 2px 0 8px; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; margin: 5px 0; border-radius: 10px;
  background: color-mix(in srgb, currentColor 9%, transparent); overflow: hidden; min-height: 38px; }
.poll-opt .po-bar { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, currentColor 18%, transparent); transition: width .45s var(--spring); }
.poll-opt.mine .po-bar { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.msg.out .poll-opt.mine .po-bar { background: rgba(255, 255, 255, .32); }
.poll-opt > span:not(.po-bar) { position: relative; }
.poll-opt .po-check { width: 18px; height: 18px; display: grid; place-items: center; flex: none; border-radius: 50%; border: 1.5px solid currentColor; opacity: .7; }
.poll-opt.mine .po-check { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; }
.msg.out .poll-opt.mine .po-check { background: #fff; color: var(--accent); border-color: #fff; }
.poll-opt .po-check svg { width: 12px; height: 12px; }
.poll-opt .po-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-opt .po-pct { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.poll-total { font-size: 12.5px; opacity: .65; margin-top: 6px; }
.poll-edit { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.once-msg { display: flex; align-items: center; gap: 10px; padding: 6px 4px; text-align: left; min-width: 220px; color: inherit; }
.once-msg .once-ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--warn) 85%, transparent); color: #fff; flex: none; }
.once-msg.done .once-ico { background: color-mix(in srgb, currentColor 18%, transparent); color: inherit; }
.once-msg b { display: block; font-weight: 600; }
.once-msg .small { opacity: .7; }
.once-view img, .once-view video { max-width: 100vw; max-height: 100vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.once-tag { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); color: #fff; background: rgba(0, 0, 0, .55); padding: 6px 12px; border-radius: 14px; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.once-tag svg { width: 15px; height: 15px; color: var(--warn); }
.once-close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; color: #fff; }
.sched-bar { display: flex; align-items: center; gap: 8px; padding: 7px 10px 8px; color: var(--accent); font-size: 14px; cursor: pointer; }
.sched-bar svg { width: 17px; height: 17px; }
.sched-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: .5px solid var(--sep); }
.sched-row:last-child { border-bottom: 0; }
.sched-row .small svg { width: 13px; height: 13px; vertical-align: -2px; }
.menu-title { display: flex; align-items: center; gap: 6px; padding: 6px 12px 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.menu-title svg { width: 14px; height: 14px; }
.edit-bar .lead { color: var(--accent); }
.msg.swipe-ready .bubble { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.msg { position: relative; }
/* ── Фирменные компоненты (брендбук) ── */
h1, h2, h3, .large-title, .chat-head .title, .modal-head h2, .panel-t, .np-title, .logo h1, .poll-q, .stat-v { font-family: var(--font-head); letter-spacing: -.02em; }
.large-title, .logo h1 { font-weight: 800; }
.btn { border-radius: 12px; font-weight: 600; }
.btn:not(.ghost):not(.tinted):not(.danger) { background: var(--accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent); }
/* Второстепенная — контурная, как в брендбуке */
.btn.ghost { background: transparent; color: var(--accent-2, var(--accent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
:root[data-theme="light"] .btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 60%, transparent); }
.input { border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--sep); }
.input:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.composer textarea { border-radius: 20px; border-color: var(--sep); background: var(--panel-2); }
.composer textarea:focus { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.modal { border-radius: 22px; }
.chip { border-radius: 10px; }
.logo-mark { background: radial-gradient(circle at 50% 50%, rgba(109, 92, 255, .55), transparent 68%), linear-gradient(135deg, #1c1c2c, #0b0b10);
  box-shadow: inset 0 0 0 1px rgba(140, 125, 255, .25), 0 10px 30px rgba(109, 92, 255, .25); }
.logo-mark svg { width: 46px; height: 46px; filter: drop-shadow(0 0 8px rgba(140, 125, 255, .8)); }
.chat-item.on { background: var(--bubble-out) !important; }
.send-btn:not([data-act="mic"]) { background: var(--accent); }
.online-t { color: var(--ok); }

/* @упоминания */
.mention { color: var(--accent); font-weight: 600; }
.msg.out .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.mention.me { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 5px; padding: 0 3px; }
.mention-box { position: fixed; z-index: 60; background: var(--panel); border: .5px solid var(--sep); border-radius: 14px; padding: 5px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.mention-opt { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: 10px; text-align: left; }
.mention-opt:hover, .mention-opt.on { background: var(--panel-2); }
.mention-opt .muted { font-size: 13px; margin-left: auto; }

/* ── Звонок ── */
.call { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(36px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--accent) 45%, #0B0B10) 0%, #0B0B10 70%); color: #fff; }
.call-top { font-size: 13px; opacity: .7; }
.call-lock { display: inline-flex; align-items: center; gap: 6px; }
.call-lock svg { width: 14px; height: 14px; }
.call-who { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: -8vh; }
.call-ava { border-radius: 50%; box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
.call-ava.live { animation: callPulse 2.2s ease-out infinite; }
@keyframes callPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 28px transparent; } }
.call-name { font-size: 28px; font-weight: 700; text-align: center; }
.call-st { font-size: 16px; opacity: .75; font-variant-numeric: tabular-nums; }
.call-btns { display: flex; gap: 44px; align-items: flex-start; }
.call-b { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.16); color: #fff; position: relative; transition: transform .15s, background .2s; }
.call-b:active { transform: scale(.92); }
.call-b svg { width: 28px; height: 28px; }
.call-b span { position: absolute; top: 76px; font-size: 12px; white-space: nowrap; opacity: .75; }
.call-b.on { background: #fff; color: #111; }
.call-b.green { background: #30d158; }
.call-b.red { background: #ff453a; }
.call-b.red svg { transform: rotate(135deg); }
.call-log { display: flex; align-items: center; gap: 10px; padding: 4px 2px; min-width: 190px; color: inherit; text-align: left; font-weight: 600; }
.call-log svg { width: 20px; height: 20px; padding: 7px; box-sizing: content-box; border-radius: 50%; background: color-mix(in srgb, #30d158 22%, transparent); color: #30d158; }
.call-log.missed svg { background: color-mix(in srgb, #ff453a 22%, transparent); color: #ff453a; }
