/* ============ Aura Link — вайб-стиль ============ */
:root {
  --a1: #ffd84d; --a2: #f59a00; --a3: #ff5e3a;
  --bg: #0a0806; --bg2: #14100b;
  --on-accent: #1a0f00;
  --text: #f6f3ee; --muted: rgba(246, 243, 238, .55); --faint: rgba(246, 243, 238, .32);
  --glass: rgba(255, 255, 255, .055); --glass-2: rgba(255, 255, 255, .085); --line: rgba(255, 255, 255, .09);
  --bubble-in: rgba(255, 255, 255, .075);
  --grad: linear-gradient(135deg, var(--a1), var(--a2) 55%, var(--a3));
  --r: 18px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.16, 1, .3, 1);
  --side-w: 340px;
  color-scheme: dark;
  --g-amber: linear-gradient(135deg, #ffd84d, #f59a00 60%, #ff5e3a);
  --g-neon: linear-gradient(135deg, #ff4fd8, #8b5cff 60%, #00e5ff);
  --g-ocean: linear-gradient(135deg, #5ef2ff, #3b9dff 60%, #43e9a0);
  --g-sunset: linear-gradient(135deg, #ffb86b, #ff5e7e 60%, #a855f7);
  --g-forest: linear-gradient(135deg, #c6f56b, #2fd17f 60%, #0fb5a8);
  --g-violet: linear-gradient(135deg, #d6c8ff, #8b5cf6 60%, #ec4899);
  --g-mono: linear-gradient(135deg, #fff, #9aa0ad);
}
[data-vibe="mono"]   { --a1: #ffffff; --a2: #bfc3cc; --a3: #7d8494; --bg: #060708; --bg2: #101215; --on-accent: #0b0c0e; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.4 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background .8s;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
::selection { background: color-mix(in srgb, var(--a2) 45%, transparent); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .2); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- живой фон ---------- */
#aurora { position: fixed; inset: -20%; z-index: 0; filter: blur(80px) saturate(140%); opacity: .55; pointer-events: none; transition: opacity 1s; }
#aurora i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; mix-blend-mode: screen; will-change: transform; }
#aurora i:nth-child(1) { background: radial-gradient(circle, var(--a1), transparent 65%); left: 5%; top: 0; animation: drift1 26s ease-in-out infinite alternate; }
#aurora i:nth-child(2) { background: radial-gradient(circle, var(--a2), transparent 65%); right: 0; top: 20%; animation: drift2 32s ease-in-out infinite alternate; }
#aurora i:nth-child(3) { background: radial-gradient(circle, var(--a3), transparent 65%); left: 30%; bottom: -5%; animation: drift3 38s ease-in-out infinite alternate; }
#aurora i:nth-child(4) { background: radial-gradient(circle, var(--a1), transparent 70%); right: 25%; bottom: 10%; width: 30vmax; height: 30vmax; opacity: .6; animation: drift1 44s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate(18vw, 14vh) scale(1.25) rotate(40deg); } }
@keyframes drift2 { to { transform: translate(-22vw, 10vh) scale(.8); } }
@keyframes drift3 { to { transform: translate(10vw, -18vh) scale(1.15); } }
#grain { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
#fx { position: fixed; inset: 0; z-index: 90; pointer-events: none; width: 100%; height: 100%; }
#dragbar { position: fixed; top: 0; left: 0; right: 0; height: 0; z-index: 5; -webkit-app-region: drag; }
.native #dragbar { height: 34px; right: 140px; }

/* ---------- экраны ---------- */
.screen { position: fixed; inset: 0; z-index: 2; display: none; }
.screen.show { display: flex; animation: screenIn .7s var(--out) both; }
@keyframes screenIn { from { opacity: 0; transform: scale(1.02); filter: blur(8px); } }
#boot, #login, #setup { align-items: center; justify-content: center; padding: 16px; }

.orb { width: 72px; height: 72px; border-radius: 28%; background: var(--grad); display: grid; place-items: center; position: relative;
  box-shadow: 0 10px 40px -8px var(--a2), inset 0 1px 0 rgba(255, 255, 255, .5); animation: orbPulse 3.2s ease-in-out infinite; }
.orb::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; background: var(--grad); filter: blur(18px); opacity: .5; z-index: -1; animation: orbGlow 3.2s ease-in-out infinite; }
.orb span { font-weight: 800; font-size: 34px; color: var(--on-accent); letter-spacing: -1px; }
.orb.big { width: 110px; height: 110px; } .orb.big span { font-size: 52px; }
.orb.tiny { width: 30px; height: 30px; border-radius: 10px; animation: none; box-shadow: 0 4px 14px -4px var(--a2); }
.orb.tiny::after { display: none; } .orb.tiny span { font-size: 15px; }
.orb.float { animation: orbPulse 3.2s ease-in-out infinite, floaty 6s ease-in-out infinite; }
@keyframes orbPulse { 50% { transform: scale(1.06) rotate(-3deg); } }
@keyframes orbGlow { 50% { opacity: .85; transform: scale(1.15); } }
@keyframes floaty { 50% { translate: 0 -12px; } }

.glass { background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%); }
.glass-panel { background: rgba(0, 0, 0, .28); backdrop-filter: blur(30px) saturate(150%); -webkit-backdrop-filter: blur(30px) saturate(150%); }

.login-card { width: min(400px, 100%); padding: 36px 30px 28px; border-radius: 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); animation: cardIn .9s var(--spring) both .1s; }
.login-card h1, .login-card h2 { margin: 6px 0 0; }
.login-card p { margin: 0; }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
.title-glow { font-size: 34px; font-weight: 800; letter-spacing: -.5px; background: linear-gradient(90deg, var(--a1), var(--a2), var(--a3), var(--a1)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmerText 6s linear infinite; }
@keyframes shimmerText { to { background-position: 300% 0; } }
.err { color: #ff7a8a; min-height: 1.2em; font-size: 13px; }
.hint { font-size: 12px; color: var(--faint); margin: -6px 0 0 !important; align-self: flex-start; }
.sep { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; width: 100%; margin: 6px 0; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dev { width: 100%; } .dev .row { display: flex; gap: 8px; }

/* ---------- кнопки и поля ---------- */
.btn { height: 42px; padding: 0 18px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 600; transition: transform .25s var(--spring), background .2s, box-shadow .3s; position: relative; overflow: hidden; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, .12); transform: translateY(-1px); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--grad); color: var(--on-accent); border: 0; box-shadow: 0 8px 28px -10px var(--a2); }
.btn.primary:hover { box-shadow: 0 12px 34px -8px var(--a2); }
.btn.danger { color: #ff8b98; }
.btn.wide { width: 100%; height: 48px; font-size: 16px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.shine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); animation: shine 4s ease-in-out infinite 1s; }
@keyframes shine { 30%, 100% { transform: translateX(120%); } }
.field { width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); outline: none; transition: border-color .2s, box-shadow .3s; }
.field:focus { border-color: color-mix(in srgb, var(--a2) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 18%, transparent); }
textarea.field { height: auto; padding: 12px 14px; resize: none; }
.field-wrap { position: relative; width: 100%; }
.field-wrap .at { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.field.with-at { padding-left: 32px; padding-right: 40px; }
.field-wrap .state { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 16px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); transition: color .2s, background .2s, transform .3s var(--spring); flex: none; }
.icon-btn:hover { color: var(--text); background: var(--glass-2); }
.icon-btn:active { transform: scale(.88); }
.icon-btn.small { width: 30px; height: 30px; } .icon-btn.small svg { width: 16px; height: 16px; }
.icon-btn.glow { background: var(--grad); color: var(--on-accent); box-shadow: 0 6px 20px -8px var(--a2); }
.icon-btn.glow:hover { transform: rotate(90deg) scale(1.06); background: var(--grad); color: var(--on-accent); }
.clickable { cursor: pointer; }

/* ---------- аватары ---------- */
.av { --s: 44px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; position: relative; display: grid; place-items: center; font-size: calc(var(--s) * .5);
  background: var(--avg, var(--grad)); user-select: none; }
.av.sq { border-radius: 32%; }
.av img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.av .ini { font-weight: 700; font-size: calc(var(--s) * .4); color: rgba(0, 0, 0, .7); }
.av[data-c="amber"]  { --avg: linear-gradient(135deg, #ffd84d, #f59a00 60%, #ff5e3a); }
.av[data-c="neon"]   { --avg: linear-gradient(135deg, #ff4fd8, #8b5cff 60%, #00e5ff); }
.av[data-c="ocean"]  { --avg: linear-gradient(135deg, #5ef2ff, #3b9dff 60%, #43e9a0); }
.av[data-c="sunset"] { --avg: linear-gradient(135deg, #ffb86b, #ff5e7e 60%, #a855f7); }
.av[data-c="forest"] { --avg: linear-gradient(135deg, #c6f56b, #2fd17f 60%, #0fb5a8); }
.av[data-c="violet"] { --avg: linear-gradient(135deg, #d6c8ff, #8b5cf6 60%, #ec4899); }
.av[data-c="mono"]   { --avg: linear-gradient(135deg, #fff, #9aa0ad); }
.av .dot { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: #3ee08f; border: 2.5px solid var(--bg2);
  transform: scale(0); transition: transform .4s var(--spring); }
.av.on .dot { transform: scale(1); }
.av.on .dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #3ee08f; animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: .9; } to { transform: scale(2); opacity: 0; } }
.avatar-pick { --s: 96px; margin: 4px 0 6px; transition: transform .4s var(--spring); }
.avatar-pick:hover { transform: scale(1.06) rotate(-4deg); }
.avatar-pick .av { --s: 96px; box-shadow: 0 12px 30px -10px var(--a2); }

/* ---------- основное окно ---------- */
#main.show { display: flex; }

/* ---------- панель вкладок (как в Discord) ---------- */
#rail { width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: rgba(0, 0, 0, .42);
  border-right: 1px solid var(--line); position: relative; z-index: 4; }
.native #rail { padding-top: 40px; }
.rail-scroll { flex: 1; min-height: 0; width: 100%; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px; scrollbar-width: none; padding: 2px 0; }
.rail-scroll::-webkit-scrollbar { display: none; }
.rail-group { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.rail-group:empty, .rail-sep.hide { display: none; }
.rail-sep { width: 32px; height: 2px; border-radius: 1px; background: var(--line); flex: none; }
.ri { position: relative; width: 72px; height: 48px; display: flex; justify-content: center; flex: none; cursor: pointer; }
.ri-face { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: rgba(255, 255, 255, .07); color: var(--a1);
  transition: border-radius .25s var(--out), background .25s, color .25s, transform .3s var(--spring), box-shadow .3s; }
.ri-face .av { --s: 48px !important; border-radius: 0; font-size: 24px; }
.ri-face .av .dot { display: none; }
.ri-face .orb.tiny { width: 48px; height: 48px; border-radius: 0; box-shadow: none; }
.ri-face .orb.tiny span { font-size: 22px; }
.ri:hover .ri-face, .ri.on .ri-face { border-radius: 16px; }
.ri:active .ri-face { transform: translateY(1px) scale(.94); }
.ri.on .ri-face { box-shadow: 0 6px 22px -8px var(--a2); }
.ri.action .ri-face { color: var(--a1); }
.ri.action:hover .ri-face { background: var(--grad); color: var(--on-accent); }
.ri.action:hover svg { animation: spin .5s var(--out); }
/* белая полоска слева: точка — есть непрочитанные, длиннее — наведение, во всю высоту — открыт */
.ri .pill { position: absolute; left: 0; top: 50%; width: 4px; height: 8px; margin-top: -4px; border-radius: 0 4px 4px 0; background: var(--text);
  transform: scale(0); transform-origin: left center; transition: transform .25s var(--spring), height .25s var(--spring), margin .25s var(--spring); }
.ri.unread .pill { transform: scale(1); }
.ri:hover .pill { transform: scale(1); height: 20px; margin-top: -10px; }
.ri.on .pill { transform: scale(1); height: 40px; margin-top: -20px; background: var(--grad); }
.rbadge { position: absolute; right: 8px; bottom: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ff3b6b; color: #fff;
  font-size: 11.5px; font-weight: 800; display: grid; place-items: center; border: 3px solid #0b0b0d; box-sizing: content-box; animation: badgePop .5s var(--spring); }
.ri .ronline { position: absolute; right: 10px; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #3ee08f; border: 3px solid #0b0b0d; }
.ri.enter { animation: riIn .55s var(--spring) both; }
@keyframes riIn { from { opacity: 0; transform: scale(.3); } }
.ri.leaving { animation: riOut .3s ease forwards; }
@keyframes riOut { to { opacity: 0; transform: scale(.3); height: 0; } }
.rail-tip { position: fixed; z-index: 70; pointer-events: none; padding: 7px 12px; border-radius: 10px; font-size: 14px; font-weight: 700; white-space: nowrap;
  background: #0b0b0d; color: var(--text); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); opacity: 0; transform: translateX(-6px) scale(.92); transform-origin: left center;
  transition: opacity .15s, transform .25s var(--spring); }
.rail-tip::before { content: ""; position: absolute; left: -5px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 0; border-right-color: #0b0b0d; }
.rail-tip.show { opacity: 1; transform: none; }
.rail-tip small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.fav-btn.on { color: var(--a1); }
.fav-btn.on svg { fill: currentColor; }
.fav-btn.pulse svg { animation: favPop .6s var(--spring); }
@keyframes favPop { 0% { transform: scale(.4) rotate(-40deg); } 60% { transform: scale(1.4) rotate(12deg); } 100% { transform: none; } }
.ci .star { color: var(--a1); font-size: 12px; flex: none; }
#side { width: var(--side-w); flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); position: relative; z-index: 3; min-width: 0; }
.native #side { padding-top: 6px; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; }
.native .side-head { padding-top: 30px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; letter-spacing: -.2px; }
.search-wrap { margin: 0 14px; position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; color: var(--faint); }
.search-wrap input { width: 100%; height: 40px; border-radius: 13px; border: 1px solid transparent; background: rgba(255, 255, 255, .06); padding: 0 12px 0 38px; outline: none; transition: .25s; }
.search-wrap input:focus { background: rgba(0, 0, 0, .25); border-color: color-mix(in srgb, var(--a2) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 14%, transparent); }
.chips { display: flex; gap: 6px; padding: 12px 14px 8px; position: relative; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; z-index: 1; height: 30px; padding: 0 12px; border-radius: 10px; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; transition: color .3s; }
.chip:hover { color: var(--text); }
.chip.on { color: var(--on-accent); }
.chip-glider { position: absolute; top: 12px; height: 30px; border-radius: 10px; background: var(--grad); box-shadow: 0 4px 16px -6px var(--a2); transition: left .45s var(--spring), width .45s var(--spring); z-index: 0; }

.chat-list { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 8px; position: relative; }
.ci { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 16px; position: relative; cursor: pointer; transition: background .25s;
  --mx: 50%; --my: 50%; isolation: isolate; }
.ci::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(180px circle at var(--mx) var(--my), color-mix(in srgb, var(--a2) 22%, transparent), transparent 70%); }
.ci:hover::before { opacity: 1; }
.ci:hover { background: rgba(255, 255, 255, .03); }
.ci.active { background: color-mix(in srgb, var(--a2) 16%, rgba(255, 255, 255, .04)); }
.ci.active::after { content: ""; position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px; border-radius: 3px; background: var(--grad); animation: barIn .4s var(--spring); }
@keyframes barIn { from { transform: scaleY(0); } }
.ci .body { flex: 1; min-width: 0; }
.ci .top, .ci .bot { display: flex; align-items: center; gap: 8px; }
.ci .name { flex: 1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci .time { font-size: 12px; color: var(--faint); flex: none; }
.ci .prev { flex: 1; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ci .prev b { color: var(--text); font-weight: 500; opacity: .8; }
.ci .prev.typing { color: var(--a1); }
.ci .ticks { color: var(--a1); display: inline-flex; }
.badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--grad); color: var(--on-accent); font-size: 12px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px var(--a2); }
.badge.bounce, .ci.enter .badge { animation: badgePop .5s var(--spring); }
@keyframes badgePop { from { transform: scale(0); } 60% { transform: scale(1.25); } }
.ci.enter { animation: ciIn .55s var(--spring) both; }
@keyframes ciIn { from { opacity: 0; transform: translateX(-24px) scale(.96); } }
.list-empty { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 14px; animation: screenIn .6s var(--out); }
.list-empty .big-emoji { font-size: 44px; display: block; margin-bottom: 10px; animation: floaty 4s ease-in-out infinite; }
.net { font-size: 12px; text-align: center; color: var(--a1); height: 0; overflow: hidden; transition: height .3s; }
.net.show { height: 24px; line-height: 24px; }
.net.show::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--a1); margin-right: 8px; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.me-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.me-card .av { --s: 38px; cursor: pointer; }
.me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.me-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-info small { color: var(--faint); }
#settingsBtn:hover svg { animation: spin 1.2s var(--out); }
@keyframes spin { to { transform: rotate(180deg); } }

/* ---------- чат ---------- */
#chat { flex: 1; min-width: 0; position: relative; display: flex; }
.empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; animation: screenIn .8s var(--out); }
.empty h2 { margin: 16px 0 0; font-size: 28px; } .empty p { margin: 0 0 8px; }
.room { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.room.switch { animation: roomIn .5s var(--out); }
@keyframes roomIn { from { opacity: 0; transform: translateX(14px); } }
.room-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); z-index: 4; position: relative; }
.native .room-head { padding-top: 36px; }
.glass-bar { background: rgba(0, 0, 0, .18); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.room-head .av { --s: 40px; }
.room-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.room-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-title small { color: var(--muted); font-size: 13px; height: 18px; overflow: hidden; }
.room-title small.live { color: var(--a1); }
.room-title small span { display: inline-block; animation: subIn .35s var(--out); }
@keyframes subIn { from { opacity: 0; transform: translateY(8px); } }
.back { display: none; }

.msgs { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 16px clamp(10px, 4vw, 48px) 8px; display: flex; flex-direction: column; scroll-behavior: auto; }
.msgs-top { min-height: 10px; display: flex; justify-content: center; padding: 8px; color: var(--faint); font-size: 13px; }
.msgs-top.loading::after { content: ""; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--a1); animation: spin360 .8s linear infinite; }
@keyframes spin360 { to { transform: rotate(360deg); } }
.day { align-self: center; margin: 14px 0 8px; padding: 4px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); background: rgba(0, 0, 0, .25);
  backdrop-filter: blur(10px); position: sticky; top: 4px; z-index: 2; }
.newsep { align-self: stretch; display: flex; align-items: center; gap: 12px; margin: 10px 0; color: var(--a1); font-size: 12.5px; font-weight: 700; }
.newsep::before, .newsep::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--a2), transparent); }
.sys { align-self: center; margin: 8px 0; padding: 5px 14px; font-size: 13px; color: var(--muted); border-radius: 14px; background: rgba(255, 255, 255, .05); text-align: center; max-width: 80%; }
.sys b { color: var(--text); font-weight: 600; }

.m { display: flex; gap: 8px; align-items: flex-end; max-width: min(640px, 82%); margin-top: 2px; position: relative; }
.m.first { margin-top: 10px; }
.m.own { align-self: flex-end; flex-direction: row-reverse; }
.m .av { --s: 32px; visibility: hidden; }
.m.last .av { visibility: visible; }
.m.dm .av, .m.own .av { display: none; }
.bubble { position: relative; padding: 8px 12px 6px; border-radius: var(--r); background: var(--bubble-in); border: 1px solid rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); min-width: 60px; max-width: 100%; word-wrap: break-word; overflow-wrap: anywhere; transition: transform .25s var(--spring), box-shadow .3s; }
.m.own .bubble { background: var(--grad); color: var(--on-accent); border: 0; box-shadow: 0 8px 26px -14px var(--a2); }
.m:not(.own).last .bubble { border-bottom-left-radius: 6px; }
.m.own.last .bubble { border-bottom-right-radius: 6px; }
.m:not(.own):not(.first) .bubble { border-top-left-radius: 8px; }
.m.own:not(.first) .bubble { border-top-right-radius: 8px; }
.m:not(.own):not(.last) .bubble { border-bottom-left-radius: 8px; }
.m.own:not(.last) .bubble { border-bottom-right-radius: 8px; }
.bubble .who { font-size: 13px; font-weight: 700; margin-bottom: 2px; display: block; background: var(--avg, var(--grad)); -webkit-background-clip: text; background-clip: text; color: transparent; cursor: pointer; }
.m.dm .who, .m.own .who, .m:not(.first) .who { display: none; }
.bubble .txt { white-space: pre-wrap; }
.bubble .txt a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bubble .meta { float: right; margin: 6px 0 -2px 10px; font-size: 11.5px; opacity: .65; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; user-select: none; }
.bubble .meta svg { width: 16px; height: 16px; }
.ticks .t2 { transition: opacity .3s, transform .4s var(--spring); }
.ticks:not(.read) .t2 { opacity: 0; transform: translateX(-4px); }
.ticks.read { color: inherit; }
.ticks.pending { animation: blink 1s infinite; }
.bubble .edited { font-style: italic; }
.bubble.deleted .txt { font-style: italic; opacity: .6; }
.m:hover .bubble { transform: translateY(-1px); }
.m.flash .bubble { animation: flash 1.2s ease; }
@keyframes flash { 30% { box-shadow: 0 0 0 3px var(--a1), 0 0 30px var(--a2); transform: scale(1.03); } }

.quote { display: block; padding: 4px 10px; margin: 2px 0 6px; border-left: 3px solid var(--a1); border-radius: 6px 10px 10px 6px; background: rgba(255, 255, 255, .07); font-size: 13.5px; cursor: pointer;
  max-width: 100%; overflow: hidden; }
.m.own .quote { border-left-color: currentColor; background: rgba(0, 0, 0, .12); }
.quote b { display: block; font-size: 12.5px; }
.quote span { display: block; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bubble.emoji-only { background: transparent !important; border: 0; box-shadow: none !important; backdrop-filter: none; padding: 0 4px; color: var(--text) !important; }
.bubble.emoji-only .txt { font-size: 52px; line-height: 1.15; display: inline-block; }
.bubble.emoji-only .meta { float: none; display: flex; justify-content: flex-end; margin: 0; background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 1px 6px; width: max-content; margin-left: auto; opacity: .8; }
.m.fresh .bubble.emoji-only .txt { animation: emojiDance 1.1s var(--spring); }
@keyframes emojiDance { 0% { transform: scale(0) rotate(-30deg); } 40% { transform: scale(1.35) rotate(12deg); } 60% { transform: scale(.9) rotate(-6deg); } 100% { transform: scale(1); } }

.bubble.img { padding: 4px; min-width: 0; }
.bubble.img .shot { display: block; border-radius: calc(var(--r) - 5px); overflow: hidden; cursor: zoom-in; background: rgba(255, 255, 255, .05); position: relative; max-width: min(380px, 100%); }
.bubble.img .shot img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s, transform .6s var(--out); transform: scale(1.04); }
.bubble.img .shot img.ok { opacity: 1; transform: none; }
.bubble.img .shot::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%); background-size: 200% 100%; animation: skel 1.4s infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.bubble.img .cap { padding: 6px 8px 2px; }
.bubble.img .meta.over { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .45); color: #fff; padding: 2px 7px; border-radius: 10px; opacity: 1; margin: 0; }

.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; clear: both; }
.rc { height: 26px; padding: 0 8px; border-radius: 13px; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; background: rgba(255, 255, 255, .1); border: 1px solid transparent;
  transition: transform .3s var(--spring), background .2s; animation: rcIn .45s var(--spring); }
.rc small { font-size: 12px; font-weight: 700; }
.rc.mine { background: color-mix(in srgb, var(--a2) 35%, transparent); border-color: color-mix(in srgb, var(--a1) 60%, transparent); }
.m.own .rc { background: rgba(0, 0, 0, .15); }
.m.own .rc.mine { background: rgba(0, 0, 0, .3); border-color: rgba(0, 0, 0, .25); }
.rc:hover { transform: scale(1.1); }
.rc.bump { animation: rcBump .6s var(--spring); }
@keyframes rcIn { from { transform: scale(0); } }
@keyframes rcBump { 40% { transform: scale(1.45) rotate(-10deg); } }

.m .acts { position: absolute; top: 50%; transform: translateY(-50%) scale(.6); opacity: 0; display: flex; gap: 2px; transition: .25s var(--spring); pointer-events: none; }
.m:not(.own) .acts { left: 100%; margin-left: 6px; }
.m.own .acts { right: 100%; margin-right: 6px; }
.m:hover .acts { opacity: 1; transform: translateY(-50%) scale(1); pointer-events: auto; }
.acts button { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: rgba(0, 0, 0, .3); backdrop-filter: blur(10px); transition: .2s; }
.acts button:hover { color: var(--text); background: rgba(255, 255, 255, .14); transform: scale(1.12); }
.acts svg { width: 16px; height: 16px; }

/* появление сообщений */
.m.fresh { animation: msgIn .6s var(--spring) both; }
.m.own.fresh { animation-name: msgInOwn; }
@keyframes msgIn { from { opacity: 0; transform: translate(-18px, 18px) scale(.85); filter: blur(6px); } }
@keyframes msgInOwn { from { opacity: 0; transform: translate(18px, 22px) scale(.8); filter: blur(6px); } }
.m.stagger { animation: msgFade .5s var(--out) both; animation-delay: calc(var(--i) * 28ms); }
@keyframes msgFade { from { opacity: 0; transform: translateY(14px); } }
.m.leaving { animation: msgOut .4s ease forwards; }
@keyframes msgOut { to { opacity: 0; transform: scale(.7); filter: blur(8px); } }

/* эффекты сообщений */
.m.fx-slam .bubble { animation: slam .7s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes slam { 0% { transform: scale(3.2) rotate(-6deg); opacity: 0; filter: blur(4px); } 55% { transform: scale(.92); opacity: 1; filter: none; } 75% { transform: scale(1.05); } 100% { transform: scale(1); } }
.shake { animation: shake .5s ease .3s; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
.bubble.ink .txt, .bubble.ink .shot { filter: blur(7px); transition: filter .5s; position: relative; }
.bubble.ink .txt { background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px); -webkit-background-clip: text; background-clip: text; animation: inkMove 1.5s linear infinite; }
.bubble.ink:hover .txt, .bubble.ink.shown .txt, .bubble.ink:hover .shot, .bubble.ink.shown .shot { filter: none; background: none; -webkit-background-clip: border-box; animation: none; }
@keyframes inkMove { to { background-position: 20px 0; } }
.m.fx-stars .bubble, .m.fx-fire .bubble, .m.fx-hearts .bubble, .m.fx-confetti .bubble { animation: glowPulse 1.6s ease; }
@keyframes glowPulse { 30% { box-shadow: 0 0 0 2px var(--a1), 0 0 40px -4px var(--a2); } }

.to-bottom { position: absolute; right: 22px; bottom: 92px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; z-index: 5; color: var(--text);
  transform: scale(0) translateY(20px); transition: transform .4s var(--spring); }
.to-bottom.show { transform: none; }
.to-bottom span:not(:empty) { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--grad); color: var(--on-accent); font-size: 11px; font-weight: 700; display: grid; place-items: center; }

.typing-bar { height: 0; padding: 0 clamp(10px, 4vw, 48px); transition: height .3s var(--out); overflow: hidden; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.typing-bar.show { height: 28px; }
.wave { display: inline-flex; gap: 3px; padding: 7px 10px; border-radius: 12px; background: var(--bubble-in); }
.wave i { width: 6px; height: 6px; border-radius: 50%; background: var(--a1); animation: wave 1.2s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .15s; background: var(--a2); } .wave i:nth-child(3) { animation-delay: .3s; background: var(--a3); }
@keyframes wave { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ---------- ввод ---------- */
.composer-wrap { padding: 6px clamp(10px, 4vw, 48px) 16px; position: relative; z-index: 4; }
.reply-bar { display: flex; align-items: center; gap: 10px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height .35s var(--out), opacity .3s, margin .3s; padding: 0 8px; }
.reply-bar.show { max-height: 60px; opacity: 1; margin-bottom: 6px; }
.rb-line { width: 3px; align-self: stretch; border-radius: 3px; background: var(--grad); margin: 4px 0; }
.rb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; }
.rb-body b { color: var(--a1); }
.rb-body span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 6px; border-radius: 22px; transition: border-color .3s, box-shadow .4s; }
.composer:focus-within { border-color: color-mix(in srgb, var(--a2) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a2) 12%, transparent), 0 10px 40px -16px var(--a2); }
.composer textarea { flex: 1; background: none; border: 0; outline: none; resize: none; padding: 9px 6px; max-height: 180px; line-height: 1.4; min-height: 38px; }
.composer textarea::placeholder { color: var(--faint); }
.send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: var(--on-accent); flex: none; transition: transform .35s var(--spring), opacity .3s, filter .3s;
  box-shadow: 0 6px 20px -8px var(--a2); transform: scale(.82); filter: saturate(.4) brightness(.8); }
.send.ready { transform: scale(1); filter: none; }
.send.ready:hover { transform: scale(1.1) rotate(-12deg); }
.send:active { transform: scale(.85) !important; }
.send.fly svg { animation: flyOut .5s var(--out); }
@keyframes flyOut { 0% { transform: none; } 45% { transform: translate(18px, -18px) scale(.6); opacity: 0; } 55% { transform: translate(-18px, 18px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.send.has-fx { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--a1), 0 6px 24px -6px var(--a2); }
.drop-zone { position: absolute; inset: 10px; border-radius: 24px; border: 2px dashed var(--a1); background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px);
  display: grid; place-items: center; text-align: center; font-size: 18px; font-weight: 600; z-index: 20; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drop-zone.show { opacity: 1; }
.big-emoji { font-size: 54px; animation: floaty 2s ease-in-out infinite; }

/* ---------- инфо-панель ---------- */
.info { width: 0; flex: none; overflow: hidden; border-left: 1px solid transparent; transition: width .45s var(--out), border-color .3s; }
.info.show { width: 320px; border-left-color: var(--line); }
.info-inner { width: 320px; height: 100%; overflow-y: auto; padding: 22px 18px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.native .info-inner { padding-top: 44px; }
.info-inner .av { --s: 108px; font-size: 54px; margin: 10px 0 8px; box-shadow: 0 16px 40px -14px var(--a2); animation: cardIn .6s var(--spring); }
.info-inner h3 { margin: 4px 0 0; font-size: 20px; }
.info-inner .uname { color: var(--a1); font-size: 14px; }
.info-inner .bio { color: var(--muted); font-size: 14px; margin: 8px 0; white-space: pre-wrap; }
.info-close { align-self: flex-end; }
.info-sec { width: 100%; text-align: left; margin-top: 14px; }
.info-sec h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.mem { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.mem:hover { background: var(--glass); }
.mem .av { --s: 36px; font-size: 18px; margin: 0; box-shadow: none; animation: none; }
.mem > div:not(.av) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mem small { color: var(--faint); font-size: 12px; }
.mem .role { font-size: 11px; color: var(--a1); }
.info-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 16px; }

/* ---------- всплывающие окна ---------- */
#layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); pointer-events: auto; display: grid; place-items: center; padding: 16px; animation: fadeIn .3s ease; }
.scrim.closing { animation: fadeOut .25s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.modal { width: min(440px, 100%); max-height: min(680px, 92vh); border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 12px; position: relative;
  background: color-mix(in srgb, var(--bg2) 82%, transparent); border: 1px solid var(--line); backdrop-filter: blur(30px) saturate(150%); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, .7);
  animation: modalIn .5s var(--spring); overflow: hidden; }
.scrim.closing .modal { animation: modalOut .25s ease forwards; }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.92); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(12px) scale(.95); } }
.modal h3 { margin: 0; font-size: 20px; }
.modal .close { position: absolute; right: 14px; top: 14px; }
.modal .scroll { overflow-y: auto; margin: 0 -8px; padding: 0 8px; min-height: 60px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, .25); border-radius: 14px; position: relative; }
.tabs button { flex: 1; height: 34px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); position: relative; z-index: 1; transition: color .3s; }
.tabs button.on { color: var(--on-accent); }
.tabs .glider { position: absolute; top: 4px; bottom: 4px; border-radius: 10px; background: var(--grad); transition: left .4s var(--spring), width .4s var(--spring); }
.urow { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; cursor: pointer; transition: background .2s, transform .3s var(--spring); animation: ciIn .45s var(--spring) both; }
.urow:hover { background: var(--glass-2); }
.urow:active { transform: scale(.98); }
.urow .av { --s: 42px; }
.urow > div:not(.av) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.urow small { color: var(--muted); }
.urow .check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; transition: .3s var(--spring); }
.urow.sel .check { background: var(--grad); border-color: transparent; color: var(--on-accent); transform: scale(1.1); }
.urow .check svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; transition: .2s; }
.urow.sel .check svg { opacity: 1; }
.picked { display: flex; flex-wrap: wrap; gap: 6px; }
.picked:empty { display: none; }
.pchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border-radius: 15px; background: var(--glass-2); font-size: 13px; animation: rcIn .35s var(--spring); cursor: pointer; }
.pchip .av { --s: 22px; font-size: 12px; }
.grow-row { display: flex; gap: 10px; align-items: center; }
.emoji-btn-big { width: 54px; height: 54px; border-radius: 18px; font-size: 28px; flex: none; transition: transform .3s var(--spring); }
.emoji-btn-big:hover { transform: scale(1.08) rotate(-6deg); }
.empty-note { text-align: center; color: var(--muted); padding: 24px 8px; font-size: 14px; }
.empty-note .big-emoji { display: block; font-size: 40px; margin-bottom: 8px; }

/* меню и поповеры */
.pop { position: fixed; pointer-events: auto; border-radius: 18px; padding: 6px; min-width: 200px; z-index: 60;
  background: color-mix(in srgb, var(--bg2) 85%, transparent); border: 1px solid var(--line); backdrop-filter: blur(28px) saturate(160%); box-shadow: 0 20px 60px -12px rgba(0, 0, 0, .7);
  animation: popIn .32s var(--spring); transform-origin: var(--ox, 50%) var(--oy, 50%); }
.pop.closing { animation: popOut .18s ease forwards; }
@keyframes popIn { from { opacity: 0; transform: scale(.75); } }
@keyframes popOut { to { opacity: 0; transform: scale(.85); } }
.pop .mi { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 12px; border-radius: 12px; text-align: left; font-size: 14px; transition: background .15s; animation: miIn .35s var(--out) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes miIn { from { opacity: 0; transform: translateX(-8px); } }
.pop .mi:hover { background: var(--glass-2); }
.pop .mi svg { width: 18px; height: 18px; color: var(--muted); }
.pop .mi.danger { color: #ff8b98; } .pop .mi.danger svg { color: #ff8b98; }
.pop .rrow { display: flex; gap: 2px; padding: 4px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.pop .rrow button { width: 38px; height: 38px; border-radius: 50%; font-size: 22px; transition: transform .3s var(--spring); animation: rcIn .4s var(--spring) both; animation-delay: calc(var(--i) * 35ms); }
.pop .rrow button:hover { transform: scale(1.35) translateY(-3px); }
.pop .rrow button.mine { background: color-mix(in srgb, var(--a2) 30%, transparent); }
.emoji-pop { width: 340px; padding: 10px; }
.emoji-pop .cats { display: flex; gap: 2px; margin-bottom: 6px; }
.emoji-pop .cats button { flex: 1; height: 32px; border-radius: 10px; font-size: 17px; opacity: .55; transition: .2s; }
.emoji-pop .cats button.on { opacity: 1; background: var(--glass-2); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; height: 230px; overflow-y: auto; align-content: start; }
.emoji-grid button { aspect-ratio: 1; font-size: 23px; border-radius: 10px; transition: transform .25s var(--spring), background .15s; }
.emoji-grid button:hover { transform: scale(1.3); background: var(--glass-2); }
.fx-pop { width: 250px; }
.fx-pop h5 { margin: 6px 10px 6px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.fx-pop .mi .e { font-size: 20px; width: 24px; text-align: center; }
.fx-pop .mi.on { background: color-mix(in srgb, var(--a2) 22%, transparent); }

/* настройки */
.settings { width: min(520px, 100%); }
.set-sec { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 14px; }
.set-sec h4 { margin: 4px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.vibes { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.vibe { height: 74px; border-radius: 16px; position: relative; overflow: hidden; border: 2px solid transparent; text-align: left; padding: 8px 10px; font-weight: 700; font-size: 13px; color: #fff;
  transition: transform .35s var(--spring), border-color .2s; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.vibe::before { content: ""; position: absolute; inset: -40%; background: var(--vg); animation: vibeSpin 8s linear infinite; z-index: -1; filter: blur(6px); }
.vibe:hover { transform: translateY(-3px) scale(1.03); }
.vibe.on { border-color: #fff; box-shadow: 0 8px 26px -10px var(--a2); }
.vibe.on::after { content: "✓"; position: absolute; right: 8px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; color: #000; font-size: 12px; display: grid; place-items: center; animation: rcIn .4s var(--spring); }
@keyframes vibeSpin { to { transform: rotate(360deg); } }
.seg { display: flex; padding: 4px; background: rgba(0, 0, 0, .25); border-radius: 13px; gap: 4px; }
.seg button { flex: 1; height: 32px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); transition: .25s; }
.seg button.on { background: var(--glass-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.sw { width: 46px; height: 28px; border-radius: 14px; background: rgba(255, 255, 255, .14); position: relative; transition: background .3s; flex: none; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .4s var(--spring); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.sw.on { background: var(--grad); } .sw.on::after { transform: translateX(18px); }
.prof-row { display: flex; gap: 14px; align-items: center; }
.prof-row .avatar-pick { --s: 76px; margin: 0; } .prof-row .avatar-pick .av { --s: 76px; }
.prof-row .fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; }
.palette .av { --s: 34px; cursor: pointer; border: 2px solid transparent; transition: transform .3s var(--spring); }
.palette .av:hover { transform: scale(1.12); }
.palette .av.on { border-color: #fff; transform: scale(1.12); }

/* просмотр фото */
.viewer { position: fixed; inset: 0; z-index: 70; pointer-events: auto; background: rgba(0, 0, 0, 0); transition: background .35s; cursor: zoom-out; }
.viewer.open { background: rgba(0, 0, 0, .85); backdrop-filter: blur(10px); }
.viewer img { position: fixed; transition: all .45s var(--out); border-radius: 12px; object-fit: contain; }
.preview-img { max-width: 100%; max-height: 50vh; border-radius: 16px; object-fit: contain; align-self: center; animation: cardIn .5s var(--spring); }

#toast { position: fixed; left: 50%; top: 22px; z-index: 80; transform: translate(-50%, -120px); padding: 10px 18px; border-radius: 14px; font-size: 14px; pointer-events: none;
  background: color-mix(in srgb, var(--bg2) 88%, transparent); border: 1px solid var(--line); backdrop-filter: blur(20px); transition: transform .5s var(--spring); box-shadow: 0 12px 40px -10px rgba(0, 0, 0, .6); }
#toast.show { transform: translate(-50%, 0); }

/* ---------- спокойный режим анимаций ---------- */
[data-motion="calm"] #aurora i { animation-duration: 90s; }
[data-motion="calm"] .shine::after, [data-motion="calm"] .title-glow, [data-motion="calm"] .orb, [data-motion="calm"] .orb::after { animation: none; }
[data-motion="off"] *, [data-motion="off"] *::before, [data-motion="off"] *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; }
[data-motion="off"] #aurora { opacity: .35; }
@media (prefers-reduced-motion: reduce) {
  [data-motion="max"] #aurora i { animation-duration: 120s; }
}

/* ---------- телефон ---------- */
@media (max-width: 760px) {
  :root { --side-w: 100%; }
  #side { position: absolute; inset: 0; border: 0; transition: transform .45s var(--out), opacity .45s; }
  #chat { position: absolute; inset: 0; transform: translateX(100%); transition: transform .45s var(--out); background: color-mix(in srgb, var(--bg) 40%, transparent); }
  #main.in-chat #chat { transform: none; }
  #main.in-chat #side { transform: translateX(-30%); opacity: 0; pointer-events: none; }
  .back { display: grid; }
  .info.show { position: absolute; inset: 0; width: 100%; z-index: 10; background: color-mix(in srgb, var(--bg2) 92%, transparent); }
  .info-inner { width: 100%; }
  .m { max-width: 88%; }
  .m .acts { display: none; }
  .emoji-pop { width: calc(100vw - 20px); }
  .to-bottom { right: 14px; }
}

/* ---------- без шапки: поиск сверху, вкладки-фильтры в левой панели ---------- */
.side-search { margin: 14px 14px 10px; }
.native .side-search { margin-top: 40px; }
.ri.tab .ri-face { color: var(--muted); }
.ri.tab:hover .ri-face { color: var(--a1); background: rgba(255, 255, 255, .12); }
.ri.tab.on .ri-face { background: var(--grad); color: var(--on-accent); }
.ri.tab.on svg { animation: favPop .5s var(--spring); }
.ri.tab[data-f="fav"].on svg { fill: currentColor; }

/* ---------- однотонная чёрная тема: без переливов, зерна и градиентов ---------- */
[data-vibe="black"] { --a1: #ffffff; --a2: #e6e6e6; --a3: #d0d0d0; --bg: #000000; --bg2: #0d0d0d; --on-accent: #000000;
  --grad: #f2f2f2; --bubble-in: #1a1a1a; --glass: rgba(255, 255, 255, .04); --line: rgba(255, 255, 255, .08); }
[data-vibe="black"] #aurora, [data-vibe="black"] #grain { display: none; }
[data-vibe="black"] .glass-panel, [data-vibe="black"] .glass-bar { background: #000; backdrop-filter: none; -webkit-backdrop-filter: none; }
[data-vibe="black"] #rail { background: #000; }
[data-vibe="black"] .orb, [data-vibe="black"] .orb::after { box-shadow: none; }
[data-vibe="black"] .orb::after { display: none; }
[data-vibe="black"] .title-glow { animation: none; background: none; color: #fff; }
.vibe[data-v="black"] { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }

/* аватар по умолчанию (человек без своего фото) */
.av.def { background: #fff; }
.av.def img { object-fit: cover; transform: scale(1.04); }

/* ---------- анимация отправки: свечение у поля ввода → шар улетает вверх ---------- */
.send-glow { position: absolute; left: 50%; bottom: 34px; width: min(560px, 78%); height: 190px; transform: translate(-50%, 0); pointer-events: none;
  z-index: 3; opacity: 0; filter: blur(30px) saturate(160%); mix-blend-mode: screen; transition: opacity .3s ease; will-change: transform, opacity; }
.send-glow.charging { opacity: .9; }
.send-glow i { position: absolute; border-radius: 50%; }
.send-glow .g1 { left: -4%; top: 22%; width: 62%; height: 82%; background: radial-gradient(circle, var(--a3), transparent 68%); animation: glowA 1.9s ease-in-out infinite alternate; }
.send-glow .g2 { right: -4%; top: 12%; width: 60%; height: 90%; background: radial-gradient(circle, var(--a2), transparent 68%); animation: glowB 2.3s ease-in-out infinite alternate; }
.send-glow .g3 { left: 24%; top: 0; width: 52%; height: 72%; background: radial-gradient(circle, var(--a1), transparent 68%); animation: glowC 1.6s ease-in-out infinite alternate; }
.send-glow .core { left: 33%; top: 26%; width: 34%; height: 56%; background: radial-gradient(circle, #fff, transparent 66%); opacity: .35; }
@keyframes glowA { to { transform: translate(22%, -10%) scale(1.15); } }
@keyframes glowB { to { transform: translate(-20%, 8%) scale(.9); } }
@keyframes glowC { to { transform: translate(10%, 14%) scale(1.2); } }
.top-glow { position: absolute; left: 6%; right: 6%; top: 0; height: 150px; pointer-events: none; z-index: 3; opacity: 0; mix-blend-mode: screen; filter: blur(22px);
  background: radial-gradient(ellipse 50% 60% at 50% 0, #fff, color-mix(in srgb, var(--a1) 70%, transparent) 30%, color-mix(in srgb, var(--a3) 50%, transparent) 55%, transparent 75%); }

/* ---------- фон регулируется в настройках: размытие, яркость, скорость, затемнение, зерно ---------- */
#aurora { filter: blur(var(--bg-blur, 80px)) saturate(140%); opacity: calc(var(--bg-base, .55) * var(--bg-bright, 1)); }
#aurora i:nth-child(1) { animation-duration: calc(26s / var(--bg-spd, 1)); }
#aurora i:nth-child(2) { animation-duration: calc(32s / var(--bg-spd, 1)); }
#aurora i:nth-child(3) { animation-duration: calc(38s / var(--bg-spd, 1)); }
#aurora i:nth-child(4) { animation-duration: calc(44s / var(--bg-spd, 1)); }
[data-bg-still] #aurora i, [data-bg-still] #specks i { animation-play-state: paused; }
#grain { opacity: var(--bg-grain, .07); }
#bgdim { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: #000; opacity: var(--bg-dim, 0); transition: opacity .3s; }
#specks { position: fixed; inset: 0; z-index: 1; pointer-events: none; display: none; overflow: hidden; }

/* ---------- тема «Чёрная дыра»: светлые и тёмно-синие пятна перетекают друг в друга ---------- */
[data-vibe="hole"] { --a1: #e6ecf8; --a2: #9db1d8; --a3: #3d5894; --bg: #0d1a38; --bg2: #0b1631; --on-accent: #081226; --bg-base: 1;
  --grad: linear-gradient(135deg, #f2f5fb, #b8c7e4 55%, #8fa4cc); --bubble-in: rgba(8, 16, 40, .5); --line: rgba(255, 255, 255, .1); }
[data-vibe="hole"] #aurora { inset: -25%; }
[data-vibe="hole"] #aurora i { mix-blend-mode: normal; }
[data-vibe="hole"] #aurora i:nth-child(1) { background: radial-gradient(circle, #f3f6fc 0, #f3f6fc 30%, transparent 68%); width: 62vmax; height: 62vmax; left: 30%; top: 30%;
  animation: holeA calc(17s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
[data-vibe="hole"] #aurora i:nth-child(2) { background: radial-gradient(circle, #a9bcdf 0, #a9bcdf 35%, transparent 70%); width: 70vmax; height: 70vmax; left: -10%; top: 40%;
  animation: holeB calc(21s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
[data-vibe="hole"] #aurora i:nth-child(3) { background: radial-gradient(circle, #2c4680 0, #2c4680 35%, transparent 70%); width: 60vmax; height: 60vmax; right: -10%; top: 0; left: auto;
  animation: holeC calc(19s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
[data-vibe="hole"] #aurora i:nth-child(4) { background: radial-gradient(circle, #e4ebf7 0, #e4ebf7 25%, transparent 66%); width: 40vmax; height: 40vmax; right: 10%; bottom: 0; left: auto; opacity: 1;
  animation: holeD calc(15s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
[data-vibe="hole"] #aurora i:nth-child(5) { background: radial-gradient(circle, #040915 0, #040915 34%, transparent 68%); width: 52vmax; height: 52vmax; left: 0; top: 0;
  animation: holeE calc(23s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
[data-vibe="hole"] #aurora i:nth-child(6) { background: radial-gradient(circle, #071026 0, #071026 30%, transparent 66%); width: 36vmax; height: 36vmax; left: 45%; top: 55%;
  animation: holeF calc(13s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
@keyframes holeA { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-30vw, -25vh) scale(1.2); } 100% { transform: translate(-10vw, 20vh) scale(.85); } }
@keyframes holeB { 0% { transform: translate(0, 0); } 50% { transform: translate(35vw, -30vh) scale(.9); } 100% { transform: translate(15vw, 10vh) scale(1.15); } }
@keyframes holeC { 0% { transform: translate(0, 0); } 50% { transform: translate(-25vw, 35vh) scale(1.25); } 100% { transform: translate(-40vw, 5vh) scale(.9); } }
@keyframes holeD { 0% { transform: translate(0, 0); } 50% { transform: translate(-45vw, -40vh) scale(1.3); } 100% { transform: translate(-15vw, -60vh) scale(.8); } }
@keyframes holeE { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40vw, 45vh) scale(1.3); } 100% { transform: translate(60vw, 10vh) scale(.9); } }
@keyframes holeF { 0% { transform: translate(0, 0); } 50% { transform: translate(-35vw, -45vh) scale(.8); } 100% { transform: translate(20vw, -20vh) scale(1.2); } }
[data-vibe="hole"] #specks { display: block; }
#specks i { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .85; }
#specks i:nth-child(odd) { background: #0a1430; }
#specks i:nth-child(even) { background: #f4f7fd; filter: blur(1.5px); box-shadow: 0 0 10px #fff; }
#specks i:nth-child(1) { width: 14px; height: 14px; left: 18%; top: 30%; animation: speckA calc(19s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
#specks i:nth-child(2) { width: 6px; height: 6px; left: 62%; top: 22%; animation: speckB calc(15s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
#specks i:nth-child(3) { width: 10px; height: 10px; left: 78%; top: 64%; animation: speckB calc(23s / var(--bg-spd, 1)) ease-in-out infinite alternate-reverse; }
#specks i:nth-child(4) { width: 5px; height: 5px; left: 34%; top: 72%; animation: speckA calc(17s / var(--bg-spd, 1)) ease-in-out infinite alternate-reverse; }
#specks i:nth-child(5) { width: 18px; height: 18px; left: 48%; top: 48%; animation: speckB calc(27s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
#specks i:nth-child(6) { width: 4px; height: 4px; left: 86%; top: 14%; animation: speckA calc(13s / var(--bg-spd, 1)) ease-in-out infinite alternate; }
#specks i:nth-child(7) { width: 9px; height: 9px; left: 8%; top: 82%; animation: speckB calc(21s / var(--bg-spd, 1)) ease-in-out infinite alternate-reverse; }
@keyframes speckA { to { transform: translate(14vw, -18vh); } }
@keyframes speckB { to { transform: translate(-16vw, 14vh); } }
[data-vibe="hole"] .glass-panel { background: rgba(6, 12, 30, .45); }
[data-vibe="hole"] #rail { background: rgba(4, 9, 24, .55); }
[data-vibe="hole"] .glass-bar { background: rgba(6, 12, 30, .35); }
[data-vibe="hole"] .m:not(.own) .bubble { background: rgba(8, 16, 40, .55); }
[data-vibe="mono"] #aurora i:nth-child(n+5) { display: none; }

/* ползунки в настройках */
.slider { display: grid; grid-template-columns: 96px 1fr 54px; align-items: center; gap: 12px; font-size: 14px; }
.slider b { font-weight: 600; font-size: 13px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.slider input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--a1) 0, var(--a2) var(--p, 50%), rgba(255, 255, 255, .12) var(--p, 50%)); }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
  transition: transform .25s var(--spring); }
.slider input[type=range]:active::-webkit-slider-thumb { transform: scale(1.25); }
#sBg.off .slider, #sBg.off .toggle-row { opacity: .4; pointer-events: none; }

/* ---------- «жидкая» подсветка выбранной вкладки слева ---------- */
.rail-tabs { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.rail-tabs .ri.tab { z-index: 1; }
.tab-blob { --glow: color-mix(in srgb, var(--a2) 75%, transparent); position: absolute; left: 50%; top: 0; width: 48px; height: 48px; margin-left: -24px; border-radius: 16px;
  background: var(--grad); box-shadow: 0 0 18px 0 var(--glow); z-index: 0; pointer-events: none; }
.rail-tabs .ri.tab.on .ri-face { background: transparent; box-shadow: none; }
.rail-tabs .ri.tab.on .ri-face .orb.tiny { background: transparent; }
.rail-tabs .ri.tab.on .ri-face .orb.tiny span { color: var(--on-accent); }

/* вкладки слева: без полоски; «А» тёмная, пока «Все чаты» не выбраны */
.rail-tabs .ri.tab .pill { display: none; }
.rail-tabs .ri.tab:not(.on) .ri-face .orb.tiny { background: transparent; }
.rail-tabs .ri.tab:not(.on) .ri-face .orb.tiny span { color: var(--muted); transition: color .25s; }
.rail-tabs .ri.tab:not(.on):hover .ri-face .orb.tiny span { color: var(--a1); }

/* ================= сообщения в стиле iOS (iMessage) ================= */
:root { --ios-blue: #0a84ff; --ios-gray: #262629; --ios-chip: #3a3a3d;
  --ios-tail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 21'%3E%3Cpath d='M0 0h6c0 9 2.6 15.2 10.6 20.3.4.3.2.7-.3.7C10.2 21.4 4.6 20.2 0 16.9z'/%3E%3C/svg%3E"); }
#msgs .m { max-width: min(620px, 72%); }
#msgs .m .bubble { border-radius: 18px; padding: 7px 12px; background: var(--ios-gray); color: #fff; border: 0; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 15.5px; line-height: 1.32; letter-spacing: -.1px; }
#msgs .m.own .bubble { background: var(--ios-blue); color: #fff; }
#msgs .m.own.last .bubble { border-bottom-right-radius: 8px; }
#msgs .m:not(.own).last .bubble { border-bottom-left-radius: 8px; }
/* хвостик у последнего пузыря в серии */
#msgs .m.last .bubble:not(.emoji-only):not(.img)::after { content: ""; position: absolute; bottom: 0; width: 17px; height: 21px; background: inherit; pointer-events: none;
  -webkit-mask: var(--ios-tail) 0 0 / 100% 100% no-repeat; mask: var(--ios-tail) 0 0 / 100% 100% no-repeat; }
#msgs .m.own.last .bubble::after { right: -5px; }
#msgs .m:not(.own).last .bubble::after { left: -5px; transform: scaleX(-1); }
#msgs .m.last .bubble.emoji-only, #msgs .m .bubble.emoji-only { background: transparent; padding: 0 4px; }
#msgs .bubble .meta { opacity: .55; font-size: 11px; margin-top: 5px; }
#msgs .bubble .meta .ticks { display: none; }
#msgs .bubble .who { background: none; -webkit-text-fill-color: currentColor; color: rgba(255, 255, 255, .55); font-size: 12.5px; font-weight: 600; }
#msgs .m.own .quote { background: rgba(255, 255, 255, .18); border-left-color: #fff; }
#msgs .m:not(.own) .quote { background: rgba(255, 255, 255, .07); border-left-color: var(--ios-blue); }
#msgs .m:hover .bubble { transform: none; }

/* реакции — круглые значки на верхнем углу пузыря, как тапбэки в iOS */
#msgs .m.has-r { margin-top: 20px; }
#msgs .bubble .reacts { position: absolute; top: -18px; display: flex; flex-wrap: nowrap; gap: 0; margin: 0; z-index: 2; }
#msgs .m.own .bubble .reacts { left: -14px; }
#msgs .m:not(.own) .bubble .reacts { right: -14px; flex-direction: row-reverse; }
#msgs .rc { position: relative; width: 30px; height: 30px; padding: 0; border-radius: 50%; justify-content: center; font-size: 15px; border: 0;
  background: var(--ios-chip); box-shadow: 0 0 0 2.5px var(--bg), 0 4px 10px rgba(0, 0, 0, .35); }
#msgs .m.own .bubble .reacts .rc + .rc { margin-left: -9px; }
#msgs .m:not(.own) .bubble .reacts .rc + .rc { margin-right: -9px; }
#msgs .rc.mine, #msgs .m.own .rc.mine { background: var(--ios-blue); border: 0; }
#msgs .m.own .rc { background: var(--ios-chip); }
#msgs .rc small { position: absolute; right: -5px; bottom: -4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: #636366; color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
#msgs .rc small:empty { display: none; }
#msgs .rc:hover { transform: scale(1.15); z-index: 3; }

/* «Доставлено / Прочитано» под последним своим сообщением */
.ios-status { align-self: flex-end; font-size: 11.5px; font-weight: 600; color: var(--muted); margin: 3px 4px 2px 0; animation: msgFade .3s ease both; }
.ios-status.bad { color: #ff453a; }

/* ================= iOS: меню сообщения, стеклянная шапка, «печатает…», въезд чата ================= */
/* 1. меню сообщения: размытие вокруг, пузырь поднимается вперёд */
.focus-scrim { position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  animation: fadeIn .25s ease both; }
.focus-scrim.out { animation: fadeOut .24s ease forwards; }
#msgs .m.lifted { position: relative; z-index: 31; }
#msgs .m.lifted .bubble { transform: scale(1.04); transition: transform .35s var(--spring); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
#msgs .m.lifted .acts { display: none; }
.focus-ui { position: absolute; inset: 0; z-index: 32; pointer-events: none; }
.focus-ui > * { position: fixed; pointer-events: auto; animation: focusIn .38s var(--spring) both; }
.focus-ui.out > * { animation: focusOut .2s ease forwards; }
@keyframes focusIn { from { opacity: 0; transform: scale(.6); } }
@keyframes focusOut { to { opacity: 0; transform: scale(.85); } }
.focus-react { display: flex; gap: 2px; padding: 6px 8px; border-radius: 30px; background: rgba(44, 44, 48, .92); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.focus-react button { width: 40px; height: 40px; border-radius: 50%; font-size: 24px; transition: transform .3s var(--spring); animation: rcIn .4s var(--spring) both; animation-delay: calc(var(--i) * 30ms); }
.focus-react button:hover { transform: scale(1.3) translateY(-4px); }
.focus-react button.mine { background: var(--ios-blue); }
.focus-list { width: 230px; border-radius: 14px; overflow: hidden; background: rgba(44, 44, 48, .92); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation-delay: .04s; }
.focus-list .mi { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 44px; padding: 0 16px; font-size: 15px; color: #fff; text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, .08); transition: background .15s; }
.focus-list .mi:last-child { border-bottom: 0; }
.focus-list .mi:hover { background: rgba(255, 255, 255, .08); }
.focus-list .mi svg { width: 19px; height: 19px; color: #fff; }
.focus-list .mi.danger, .focus-list .mi.danger svg { color: #ff453a; }

/* 2. стеклянная шапка: переписка проплывает под ней */
.room-head { position: absolute; top: 0; left: 0; right: 0; z-index: 6; border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%); }
.msgs { padding-top: 74px; }
.native .msgs { padding-top: 100px; }
.day { top: -6px; }

[data-vibe="black"] .room-head { background: rgba(0, 0, 0, .6); }

/* 3. «печатает…» — серый пузырь с тремя точками */
#msgs .typing-m { margin-top: 8px; animation: typingIn .4s var(--spring) both; transform-origin: left bottom; }
#msgs .typing-m.out { animation: typingOut .25s ease forwards; }
@keyframes typingIn { from { opacity: 0; transform: scale(.4); } }
@keyframes typingOut { to { opacity: 0; transform: scale(.5); } }
#msgs .typing-b { display: flex; gap: 5px; align-items: center; padding: 12px 14px; min-width: 0; }
#msgs .typing-b::after { content: ""; position: absolute; left: -5px; bottom: 0; width: 17px; height: 21px; background: inherit; transform: scaleX(-1);
  -webkit-mask: var(--ios-tail) 0 0 / 100% 100% no-repeat; mask: var(--ios-tail) 0 0 / 100% 100% no-repeat; }
#msgs .typing-b i { width: 8px; height: 8px; border-radius: 50%; background: #8e8e93; animation: iosDot 1.3s ease-in-out infinite; }
#msgs .typing-b i:nth-child(2) { animation-delay: .18s; }
#msgs .typing-b i:nth-child(3) { animation-delay: .36s; }
@keyframes iosDot { 0%, 60%, 100% { opacity: .35; transform: scale(.85); } 30% { opacity: 1; transform: scale(1.05); } }
.typing-bar { display: none !important; }

/* 8. въезд чата как в iOS */
#chat { overflow: hidden; }

.room.push { z-index: 2; animation: pushIn .52s cubic-bezier(.32, .72, 0, 1) both; box-shadow: -30px 0 60px rgba(0, 0, 0, .45); }
@keyframes pushIn { from { transform: translateX(100%); } }
.room-ghost { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
[data-vibe="black"] .room-head { backdrop-filter: blur(22px) saturate(180%); -webkit-backdrop-filter: blur(22px) saturate(180%); }

/* ---------- шапка чата как в iOS: «‹ Назад» слева, собеседник по центру, кнопки справа ---------- */
.room-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.rh-left { display: flex; justify-content: flex-start; min-width: 0; }
.rh-right { display: flex; justify-content: flex-end; gap: 2px; min-width: 0; }
.rh-center { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 46vw; }
.rh-center .room-title { align-items: flex-start; }
.rh-center .room-title b { max-width: 30vw; }
.ios-back { display: inline-flex; align-items: center; gap: 0; height: 36px; padding: 0 10px 0 2px; border-radius: 10px; color: var(--ios-blue); font-size: 16px;
  transition: opacity .2s, background .2s; }
.ios-back svg { width: 26px; height: 26px; stroke-width: 2.4; margin-right: -2px; }
.ios-back:hover { background: rgba(255, 255, 255, .06); }
.ios-back:active { opacity: .5; }
.back { display: none; }
.ios-back { color: #fff; }

/* ---------- заставка: неоновые сферы (hero.jpg) — чёрное растворяется в фоне, сферы парят и дышат светом ---------- */
.hero { position: relative; width: 300px; height: 300px; margin-bottom: -40px; pointer-events: none; animation: heroFloat 7s ease-in-out infinite; }
.hero img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; user-select: none;
  -webkit-mask: radial-gradient(circle, #000 45%, transparent 72%); mask: radial-gradient(circle, #000 45%, transparent 72%);
  animation: heroGlow 5s ease-in-out infinite; }
.hero::after { content: ""; position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, rgba(120, 90, 255, .28), transparent 70%);
  filter: blur(30px); z-index: -1; animation: heroGlow 5s ease-in-out infinite reverse; }
.hero.small { width: 170px; height: 170px; margin: -20px 0 -26px; }
@keyframes heroFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-12px) rotate(1.5deg); } }
@keyframes heroGlow { 0%, 100% { filter: brightness(1) saturate(1); } 50% { filter: brightness(1.45) saturate(1.25); } }

/* ---------- заставка: зацикленный неоновый вихрь (hero.webm) и надпись Aura Link, выходящая из него ---------- */
.hero video { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; display: block;
  -webkit-mask: radial-gradient(circle, #000 42%, transparent 70%); mask: radial-gradient(circle, #000 42%, transparent 70%); }
.hero { width: 340px; height: 340px; margin-bottom: 0; }
.hero.small { width: 200px; height: 200px; margin: -26px 0 0; }
.brand-wrap { margin: -92px 0 2px; line-height: 0; position: relative; z-index: 2; font-size: inherit;
  filter: drop-shadow(0 0 10px rgba(111, 107, 255, .55)) drop-shadow(0 0 28px rgba(224, 76, 255, .3)); animation: btGlow 4.5s ease-in-out infinite; }
.login-card .brand-wrap { margin-top: -58px; }
.brand-title { width: 430px; max-width: 80vw; height: auto; overflow: visible; display: block; }
.login-card .brand-title { width: 300px; }
.brand-title text { font-family: "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif; font-weight: 800; font-size: 84px; letter-spacing: -1.5px; }
.bt-stroke { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 700; stroke-dashoffset: 0; }
@keyframes btGlow { 0%, 100% { filter: drop-shadow(0 0 10px rgba(111, 107, 255, .55)) drop-shadow(0 0 28px rgba(224, 76, 255, .3)); }
  50% { filter: drop-shadow(0 0 16px rgba(79, 216, 255, .7)) drop-shadow(0 0 40px rgba(224, 76, 255, .45)); } }
/* проигрывание: выплывает из центра вихря → контур прорисовывается → заливка → подпись и кнопка */
.intro .brand-title { animation: btRise 1.8s cubic-bezier(.16, 1, .3, 1) both; }
.intro .bt-stroke { animation: btDraw 2.1s .3s cubic-bezier(.55, 0, .2, 1) both; }
.intro .bt-fill { animation: btFill 1.2s 1.55s ease both; }
.intro .brand-wrap ~ * { animation: btAfter .7s 2.1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes btRise { 0% { opacity: 0; transform: translateY(-90px) scale(.4); filter: blur(18px); } 55% { opacity: 1; filter: blur(3px); } 100% { opacity: 1; transform: none; filter: blur(0); } }
@keyframes btDraw { 0% { stroke-dashoffset: 700; } 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; } }
@keyframes btFill { from { opacity: 0; } to { opacity: 1; } }
@keyframes btAfter { from { opacity: 0; transform: translateY(12px); } }

/* ---------- заставка v2: надпись в центре вихря, ленты обволакивают её; всё медленнее и плавнее ---------- */
.hero { width: 460px; height: 460px; animation: heroFloat 11s ease-in-out infinite; }
.hero.small { width: 260px; height: 260px; margin: -30px 0 -20px; }
.hero video { position: absolute; inset: 0; z-index: 2; }                        /* вихрь поверх надписи: светлые ленты «обнимают» буквы */
.hero .brand-wrap { position: absolute; left: 50%; top: 50%; margin: 0; z-index: 1; transform: translate(-50%, -50%); }
.hero .brand-title { width: 330px; }
.hero.small .brand-title { width: 190px; }
.login-card .brand-wrap { margin-top: 0; }
.intro .brand-title { animation: btRise 3.4s cubic-bezier(.33, 0, .15, 1) both; }
.intro .bt-stroke { animation: btDraw 4.2s .7s cubic-bezier(.45, 0, .25, 1) both; }
.intro .bt-fill { animation: btFill 2.6s 3s cubic-bezier(.4, 0, .2, 1) both; }
.intro .hero video { animation: heroVid 2.4s ease both; }
.intro .hero ~ * { animation: btAfter 1s 4s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes btRise { 0% { opacity: 0; transform: scale(.55); filter: blur(22px); } 45% { opacity: .85; filter: blur(6px); } 100% { opacity: 1; transform: none; filter: blur(0); } }
@keyframes heroVid { from { opacity: 0; transform: scale(.85) rotate(-8deg); } to { opacity: 1; transform: none; } }
#empty { gap: 0; }

/* ---------- заставка v3: надпись сделана из того же вихря — внутри букв течёт та же аура ---------- */
.hero { --letters: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 120'%3E%3Ctext x='280' y='88' text-anchor='middle' font-family='Segoe UI Variable Display, Segoe UI, sans-serif' font-weight='800' font-size='84' letter-spacing='-1.5'%3EAura Link%3C/text%3E%3C/svg%3E"); }
.hero video.in-letters { z-index: 3; mix-blend-mode: screen; filter: brightness(3.4) saturate(1.6) contrast(1.15);
  -webkit-mask: var(--letters) center / 330px auto no-repeat; mask: var(--letters) center / 330px auto no-repeat; }
.hero.small video.in-letters { -webkit-mask-size: 190px auto; mask-size: 190px auto; }
.hero .bt-fill { opacity: .32; }
.hero .bt-stroke { stroke-width: 1.4; opacity: .85; }
.intro .hero .bt-fill { animation: btFillDim 2.6s 3s cubic-bezier(.4, 0, .2, 1) both; }
.intro .hero video.in-letters { animation: inLetters 3.2s 2.6s cubic-bezier(.4, 0, .2, 1) both; }
@keyframes btFillDim { from { opacity: 0; } to { opacity: .32; } }
@keyframes inLetters { from { opacity: 0; } to { opacity: 1; } }

/* ---------- заставка v4: надпись стоит на месте, аура кольцами обволакивает её со всех сторон ---------- */
.intro .hero .brand-title, .intro .hero .bt-stroke, .intro .hero .bt-fill { animation: none; }
.hero .bt-fill { opacity: 1; }
.hero .bt-stroke { opacity: .55; stroke-width: 1.2; stroke-dashoffset: 0; }
.hero .brand-wrap { z-index: 2; }
.hero .ring { position: absolute; inset: 0; transform: scaleX(1.45); pointer-events: none; }
.hero .ring.back { z-index: 1; }
.hero .ring.front { z-index: 3; opacity: .85;
  -webkit-mask: radial-gradient(ellipse 30% 13% at 50% 50%, transparent 65%, #000 100%); mask: radial-gradient(ellipse 30% 13% at 50% 50%, transparent 65%, #000 100%); }
.hero .orbit { position: absolute; inset: 0; animation: orbitSpin 48s linear infinite; }
.hero .ring.front .orbit { animation-duration: 70s; animation-direction: reverse; }
@keyframes orbitSpin { from { transform: rotate(calc(var(--k) * 120deg)); } to { transform: rotate(calc(var(--k) * 120deg + 360deg)); } }
.hero .orbit video { position: absolute; inset: auto; left: 22%; top: 2%; width: 56%; height: 56%; z-index: auto; object-fit: cover; mix-blend-mode: screen;
  -webkit-mask: radial-gradient(circle, #000 40%, transparent 70%); mask: radial-gradient(circle, #000 40%, transparent 70%); }
.hero .ring.front .orbit video { top: 8%; transform: rotate(180deg); }
.intro .hero .ring.back { animation: ringIn 3.2s cubic-bezier(.16, 1, .3, 1) both; }
.intro .hero .ring.front { animation: ringInFront 3.6s .2s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes ringIn { from { opacity: 0; transform: scaleX(1.45) scale(.55) rotate(-25deg); } to { opacity: 1; transform: scaleX(1.45); } }
@keyframes ringInFront { from { opacity: 0; transform: scaleX(1.45) scale(1.35) rotate(25deg); } to { opacity: .85; transform: scaleX(1.45); } }
[data-motion="off"] .hero .orbit { animation: none; }

/* ---------- заставка v5: надпись Aura Link приносит и уносит ветер (wind.js) ---------- */
.wind-title { width: min(720px, 58vw); height: 240px; position: relative; flex: none; }
.wind-title canvas { width: 100%; height: 100%; display: block; }
.wind-title.small { width: 340px; max-width: 100%; height: 130px; margin: -6px 0 -10px; }

/* ---------- мягкое свечение за надписью, как у Apple: переливается, пока надпись стоит ---------- */
.wind-title::before, .wind-title::after { content: ""; position: absolute; left: 50%; top: 50%; width: 62%; height: 46%; border-radius: 50%; pointer-events: none; z-index: 0;
  transform: translate(-50%, -50%); background: linear-gradient(90deg, #5ac8fa, #7d7aff, #bf5af2, #ff6482, #ff9f0a, #5ac8fa); background-size: 300% 100%;
  filter: blur(46px) saturate(130%); opacity: calc(var(--glow, 0) * .55); animation: appleGlow 9s linear infinite, appleBreath 5s ease-in-out infinite; }
.wind-title::after { width: 40%; height: 30%; filter: blur(30px); opacity: calc(var(--glow, 0) * .35); animation-duration: 6s, 4s; animation-direction: reverse, normal; }
.wind-title canvas { position: relative; z-index: 1; }
.wind-title.small::before { filter: blur(26px); }
.wind-title.small::after { filter: blur(18px); }
@keyframes appleGlow { to { background-position: 300% 0; } }
@keyframes appleBreath { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.12, 1.2); } }

/* свечение: лёгкое, на всю ширину надписи, мягко пульсирует */
.wind-title::before { width: 88%; height: 58%; opacity: calc(var(--glow, 0) * .3);
  animation: appleGlow 10s linear infinite, glowPulse 3.2s ease-in-out infinite; }
.wind-title::after { display: none; }
.wind-title.small::before { width: 92%; height: 62%; }
@keyframes glowPulse { 0%, 100% { transform: translate(-50%, -50%) scale(1); filter: blur(40px) saturate(120%) brightness(.85); }
  50% { transform: translate(-50%, -50%) scale(1.05, 1.12); filter: blur(46px) saturate(130%) brightness(1.2); } }
.wind-title.small::before { animation: appleGlow 10s linear infinite, glowPulseSm 3.2s ease-in-out infinite; }
@keyframes glowPulseSm { 0%, 100% { transform: translate(-50%, -50%) scale(1); filter: blur(22px) brightness(.85); }
  50% { transform: translate(-50%, -50%) scale(1.05, 1.12); filter: blur(26px) brightness(1.2); } }
.wind-title { height: 340px; }

/* ================= голосовые сообщения ================= */
.composer { position: relative; }
.composer .mic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--text); background: rgba(255, 255, 255, .08);
  transition: transform .3s var(--spring), background .2s; animation: rcIn .35s var(--spring); }
.composer .mic:hover { background: rgba(255, 255, 255, .16); transform: scale(1.08); }
.composer .mic:active { transform: scale(.9); }
.composer:not(.has-text) #sendBtn { display: none; }
.composer.has-text .mic { display: none; }
.composer.has-text #sendBtn { animation: rcIn .35s var(--spring); }
/* полоса записи */
.rec-bar { position: absolute; inset: 0; z-index: 2; display: none; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: inherit;
  background: color-mix(in srgb, var(--bg2) 92%, transparent); }
.composer.recording .rec-bar { display: flex; animation: recIn .35s var(--spring); }
@keyframes recIn { from { opacity: 0; transform: scale(.96); } }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff453a; flex: none; animation: recDot 1s ease-in-out infinite; box-shadow: 0 0 10px #ff453a; }
@keyframes recDot { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 14px; min-width: 38px; color: var(--text); }
.rec-wave { flex: 1; height: 34px; display: flex; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; }
.rec-wave i { width: 3px; height: 3px; border-radius: 2px; background: #ff6961; flex: none; transition: height .08s linear; }
#recCancel:hover { color: #ff453a; }
/* пузырь-плеер */
#msgs .bubble.voice-b { padding: 8px 12px 6px 8px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.vplay { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fff; color: var(--ios-blue);
  transition: transform .25s var(--spring); }
.vplay:active { transform: scale(.88); }
.m:not(.own) .vplay { background: var(--ios-blue); color: #fff; }
.vplay svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.vplay .i-pause { display: none; stroke: currentColor; stroke-width: 3.2; fill: none; }
.voice.playing .i-play { display: none; }
.voice.playing .i-pause { display: block; }
.vwave { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; min-width: 130px; }
.vwave i { flex: 1; max-width: 3px; min-width: 2px; border-radius: 2px; background: rgba(255, 255, 255, .42); transition: background .15s; }
.vwave i.on { background: #fff; }
.m:not(.own) .vwave i.on { background: #4da3ff; }
.vside { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.vtime { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.vspeed { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; background: rgba(255, 255, 255, .18); color: inherit; }
.vspeed:hover { background: rgba(255, 255, 255, .3); }

/* ================= звонки ================= */
.call-ui { position: fixed; inset: 0; z-index: 75; pointer-events: auto; overflow: hidden; background: #000; color: #fff; animation: callIn .45s cubic-bezier(.22, 1, .36, 1) both; }
.call-ui.closing { animation: callOut .4s ease forwards; }
@keyframes callIn { from { opacity: 0; transform: scale(1.04); } }
@keyframes callOut { to { opacity: 0; transform: scale(.98); } }
.call-bg { position: absolute; inset: -10%; display: grid; place-items: center; filter: blur(70px) saturate(160%) brightness(.55); transform: scale(1.4); }
.call-bg .av { --s: 60vmin !important; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; background: #000; }
.call-ui.has-remote-video .call-remote { opacity: 1; }
.call-center { position: absolute; left: 0; right: 0; top: 13%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; transition: top .5s cubic-bezier(.22, 1, .36, 1), transform .5s; }
.call-ui.has-remote-video .call-center { top: 28px; transform: scale(.55); transform-origin: top center; }
.call-ui.has-remote-video .call-av { display: none; }
.call-av { position: relative; margin-bottom: 14px; }
.call-av .av { box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.call-av i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); opacity: 0; }
.call-ui[data-state="ringing"] .call-av i { animation: callRing 2.4s ease-out infinite; }
.call-ui[data-state="ringing"] .call-av i:nth-child(3) { animation-delay: .8s; }
.call-ui[data-state="ringing"] .call-av i:nth-child(4) { animation-delay: 1.6s; }
@keyframes callRing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
.call-center h2 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -.3px; text-shadow: 0 2px 20px rgba(0, 0, 0, .4); }
.call-status { font-size: 16px; color: rgba(255, 255, 255, .75); font-variant-numeric: tabular-nums; min-height: 20px; }
.call-ui[data-state="ended"] .call-status { color: #ff6961; }
.call-local { position: absolute; right: 22px; top: 22px; width: 220px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; transform: scaleX(-1) scale(.6);
  opacity: 0; transition: opacity .4s, transform .5s var(--spring); box-shadow: 0 12px 40px rgba(0, 0, 0, .55); background: #111; z-index: 2; }
.call-ui.has-local .call-local { opacity: 1; transform: scaleX(-1); }
.call-controls { position: absolute; left: 0; right: 0; bottom: 6%; display: flex; justify-content: center; gap: 34px; z-index: 3; }
.cbtn { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #fff; animation: rcIn .45s var(--spring) both; }
.cbtn span { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: transform .25s var(--spring), background .2s; }
.cbtn span svg { width: 28px; height: 28px; }
.cbtn:hover span { transform: scale(1.07); }
.cbtn:active span { transform: scale(.92); }
.cbtn.on span { background: #fff; color: #000; }
.cbtn small { font-size: 12.5px; color: rgba(255, 255, 255, .85); }
.cbtn.end span, .cbtn.decline span { background: #ff3b30; }
.cbtn.end span svg, .cbtn.decline span svg { transform: rotate(0deg); }
.cbtn.accept span { background: #34c759; animation: acceptPulse 1.6s ease-in-out infinite; }
@keyframes acceptPulse { 50% { box-shadow: 0 0 0 14px rgba(52, 199, 89, 0); } 0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, .55); } }
.native .call-ui .call-local { top: 46px; }
/* запись о звонке в переписке */
.call-log { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 2px 4px 2px 0; }
.call-log .cl-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .2); flex: none; }
.call-log .cl-ic svg { width: 18px; height: 18px; }
.call-log .cl-t { display: flex; flex-direction: column; }
.call-log .cl-t b { font-weight: 600; font-size: 15px; }
.call-log .cl-t small { opacity: .7; font-size: 12.5px; }
.bubble.call-b.missed .cl-t b { color: #ff6961; }
.bubble.call-b.missed .cl-ic { background: rgba(255, 69, 58, .2); color: #ff6961; }

/* ---------- демонстрация экрана ---------- */
.call-ui.remote-screen .call-remote { object-fit: contain; background: #000; }
.call-ui.local-screen .call-local { transform: none; object-fit: contain; background: #000; outline: 2px solid #34c759; }
.call-ui.local-screen.has-local .call-local { transform: none; }
.scrim.over-call { z-index: 80; position: fixed; }
.src-modal { width: min(760px, 100%); }
.src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding-bottom: 6px; }
.src-grid h4 { grid-column: 1 / -1; margin: 8px 0 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.src { display: flex; flex-direction: column; gap: 8px; padding: 8px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 2px solid transparent; text-align: left;
  transition: border-color .2s, background .2s, transform .25s var(--spring); }
.src:hover { border-color: var(--ios-blue); background: rgba(10, 132, 255, .12); transform: translateY(-2px); }
.src > img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; border-radius: 8px; background: #000; }
.src span { display: flex; align-items: center; gap: 6px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.src span .ic { width: 16px; height: 16px; flex: none; }

/* строка «Создать группу» во вкладке «Группы» */
.ci.create-group .cg-ic { width: 50px; height: 50px; border-radius: 32%; flex: none; display: grid; place-items: center; color: var(--text);
  background: rgba(255, 255, 255, .06); border: 1.5px dashed rgba(255, 255, 255, .28); transition: transform .3s var(--spring), background .2s, border-color .2s; }
.ci.create-group .cg-ic svg { width: 22px; height: 22px; }
.ci.create-group:hover .cg-ic { transform: rotate(90deg) scale(1.05); background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); }
.ci.create-group .name { font-weight: 600; }
.ci.create-group { animation: ciIn .45s var(--spring) both; }

/* ---------- поиск: разделы и подсветка совпадений ---------- */
.sr-head { padding: 12px 12px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); animation: fadeIn .3s ease; }
.sr-wait { padding: 14px; text-align: center; font-size: 13px; color: var(--faint); }
.ci.sr-msg .prev { white-space: nowrap; }
.ci mark { background: rgba(10, 132, 255, .35); color: #fff; border-radius: 4px; padding: 0 2px; }

/* ---------- архив (как в WhatsApp) ---------- */
.ci .arch-ic { width: 50px; height: 50px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(255, 255, 255, .07); color: var(--text); }
.ci .arch-ic svg { width: 22px; height: 22px; }
.ci.arch-row .name, .ci.arch-back .name { font-weight: 600; }
.ci .arch-count { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.ci.arch-back .arch-ic { background: transparent; }
.ci.arch-back .arch-ic svg { width: 26px; height: 26px; stroke-width: 2.4; }
.ci.arch-back { margin-bottom: 4px; }

/* выбор звонка под кнопкой-трубкой */
.call-pick { width: 210px; }
.call-pick .mi { height: 42px; font-size: 14.5px; }
.call-pick .cp-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(52, 199, 89, .18); color: #34c759; flex: none; }
.call-pick .cp-ic svg { width: 16px; height: 16px; color: #34c759; }

/* ---------- избранные сообщения ---------- */
.bubble .meta .mstar { color: #ffd60a; font-size: 11px; margin-right: 1px; animation: rcIn .4s var(--spring); }
.m.own .bubble .meta .mstar { color: #fff; }
.ci .arch-ic.star { background: rgba(255, 214, 10, .15); color: #ffd60a; }
.ci .arch-ic.star svg { fill: currentColor; }
.ci.star-row .name { font-weight: 600; }
.ci.star-msg .unstar { flex: none; width: 30px; height: 30px; border-radius: 50%; color: #ffd60a; font-size: 16px; opacity: .8; transition: transform .25s var(--spring), opacity .2s; }
.ci.star-msg .unstar:hover { opacity: 1; transform: scale(1.2); }

/* ---------- «О себе» и конфиденциальность ---------- */
.field-label { font-size: 12.5px; color: var(--muted); margin: 4px 2px -4px; }
.info-sec.about { text-align: left; margin-top: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); }
.info-sec.about .bio { margin: 0; color: var(--text); font-size: 14.5px; }

/* ---------- статусы ---------- */
.st-ring { width: var(--rs); height: var(--rs); border-radius: 50%; padding: 2.5px; flex: none; display: grid; place-items: center; }
.st-ring-in { width: 100%; height: 100%; border-radius: 50%; background: var(--bg); display: grid; place-items: center; }
.st-add { position: relative; flex: none; }
.st-add b { position: absolute; right: -2px; bottom: -2px; width: 20px; height: 20px; border-radius: 50%; background: #30d158; color: #fff; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; border: 2.5px solid var(--bg); line-height: 1; }
.ci.st-me .name { font-weight: 600; }
.st-new { flex: none; width: 34px; height: 34px; border-radius: 50%; background: rgba(48, 209, 88, .18); color: #30d158; font-size: 18px; font-weight: 700; transition: transform .25s var(--spring); }
.st-new:hover { transform: scale(1.12); }
.st-viewer { position: fixed; inset: 0; z-index: 78; pointer-events: auto; background: rgba(0, 0, 0, .92); display: grid; place-items: center; animation: fadeIn .25s ease; }
.st-viewer.closing { animation: fadeOut .25s ease forwards; }
.st-stage { position: relative; height: min(92vh, 860px); aspect-ratio: 9 / 16; max-width: 94vw; border-radius: 18px; overflow: hidden; background: #000; animation: modalIn .4s var(--spring); }
.st-body { position: absolute; inset: 0; display: grid; place-items: center; }
.st-text { padding: 40px 28px; font-size: clamp(22px, 3.2vh, 34px); font-weight: 600; text-align: center; line-height: 1.3; color: #fff; white-space: pre-wrap; overflow-wrap: anywhere; text-shadow: 0 2px 16px rgba(0, 0, 0, .25); }
.st-img { width: 100%; height: 100%; object-fit: contain; }
.st-cap { position: absolute; left: 0; right: 0; bottom: 70px; padding: 12px 18px; text-align: center; font-size: 16px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.st-bars { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 3; display: flex; gap: 4px; }
.st-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.st-bars b { display: block; height: 100%; background: #fff; }
.st-head { position: absolute; left: 12px; right: 12px; top: 22px; z-index: 3; display: flex; align-items: center; gap: 10px; color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .4); }
.st-head div { display: flex; flex-direction: column; }
.st-head b { font-size: 14.5px; }
.st-head small { font-size: 12px; opacity: .8; }
.st-nav { position: absolute; top: 70px; bottom: 70px; width: 35%; z-index: 2; cursor: pointer; }
.st-nav.prev { left: 0; }
.st-nav.next { right: 0; width: 65%; }
.st-foot { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 3; display: flex; justify-content: center; gap: 10px; }
.st-foot button { height: 34px; padding: 0 14px; border-radius: 17px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 13.5px; backdrop-filter: blur(10px); }
.st-foot button:hover { background: rgba(0, 0, 0, .65); }
.st-close { position: fixed; right: 22px; top: 18px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 16px; z-index: 4; }
.native .st-close { top: 44px; }
.st-modal { width: min(420px, 100%); }
.st-compose { position: relative; height: 300px; border-radius: 18px; display: grid; place-items: center; overflow: hidden; transition: background .4s; }
.st-input { width: 100%; height: 100%; background: transparent; border: 0; outline: none; resize: none; color: #fff; font-size: 24px; font-weight: 600; text-align: center;
  padding: 90px 24px 20px; }
.st-input::placeholder { color: rgba(255, 255, 255, .6); }
.st-prev { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.st-pick { position: relative; z-index: 2; }
.st-prev:not(.hidden) ~ .st-pick { position: absolute; bottom: 12px; }
.st-colors { display: flex; gap: 10px; justify-content: center; }
.st-colors button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; transition: transform .25s var(--spring); }
.st-colors button.on { border-color: #fff; transform: scale(1.15); }

/* ================= редактор фото и видео перед отправкой ================= */
.me-ui { position: fixed; inset: 0; z-index: 79; pointer-events: auto; background: #000; display: flex; flex-direction: column; color: #fff; animation: fadeIn .25s ease; }
.me-ui.closing { animation: fadeOut .25s ease forwards; }
.me-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 12px 16px; }
.native .me-top { padding-top: 40px; }
.me-top b { font-size: 16px; }
.me-info { justify-self: end; font-size: 12.5px; color: rgba(255, 255, 255, .55); font-variant-numeric: tabular-nums; }
.me-btn { justify-self: start; height: 34px; padding: 0 12px; border-radius: 10px; color: #fff; font-size: 15px; }
.me-btn:hover { background: rgba(255, 255, 255, .1); }
.me-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.me-canvas { position: absolute; }
.me-crop { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .6); outline: 1.5px solid #fff; cursor: move; touch-action: none; }
.me-crop i { position: absolute; background: rgba(255, 255, 255, .35); pointer-events: none; }
.me-crop .g1, .me-crop .g2 { top: 0; bottom: 0; width: 1px; }
.me-crop .g1 { left: 33.33%; } .me-crop .g2 { left: 66.66%; }
.me-crop .g3, .me-crop .g4 { left: 0; right: 0; height: 1px; }
.me-crop .g3 { top: 33.33%; } .me-crop .g4 { top: 66.66%; }
.me-crop b { position: absolute; width: 22px; height: 22px; border: 3.5px solid #fff; touch-action: none; }
.me-crop b[data-h="nw"] { left: -4px; top: -4px; border-right: 0; border-bottom: 0; cursor: nwse-resize; }
.me-crop b[data-h="ne"] { right: -4px; top: -4px; border-left: 0; border-bottom: 0; cursor: nesw-resize; }
.me-crop b[data-h="sw"] { left: -4px; bottom: -4px; border-right: 0; border-top: 0; cursor: nesw-resize; }
.me-crop b[data-h="se"] { right: -4px; bottom: -4px; border-left: 0; border-top: 0; cursor: nwse-resize; }
.me-tools { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; flex-wrap: wrap; }
.me-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .1); transition: background .2s, transform .25s var(--spring); }
.me-ic:hover { background: rgba(255, 255, 255, .18); }
.me-ic:active { transform: scale(.9); }
.me-ic.on { background: #fff; color: #000; }
.me-chip { height: 32px; padding: 0 12px; border-radius: 16px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .08); }
.me-chip.on { background: #fff; color: #000; }
.me-chip:disabled { opacity: .3; }
.me-bottom { display: flex; gap: 10px; padding: 10px 16px 18px; align-items: center; }
.me-cap { flex: 1; height: 44px; border-radius: 22px; border: 0; outline: none; padding: 0 16px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 15px; }
.me-go { height: 44px; padding: 0 22px; border-radius: 22px; background: var(--ios-blue); color: #fff; font-weight: 600; font-size: 15px; margin-left: auto; transition: transform .25s var(--spring); }
.me-go:active { transform: scale(.95); }
.me-go:disabled { opacity: .4; }
.me-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.me-play { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 26px;
  backdrop-filter: blur(10px); transition: opacity .2s, transform .25s var(--spring); }
.me-play.hide { opacity: 0; pointer-events: none; transform: scale(.8); }
.me-tools.video { flex-direction: column; align-items: stretch; }
.me-strip { position: relative; height: 56px; border-radius: 10px; overflow: hidden; background: #111; touch-action: none; cursor: pointer; }
.me-frames { display: flex; height: 100%; }
.me-frames canvas { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.me-dim { position: absolute; top: 0; bottom: 0; background: rgba(0, 0, 0, .65); pointer-events: none; }
.me-dim.l { left: 0; } .me-dim.r { right: 0; }
.me-sel { position: absolute; top: 0; bottom: 0; border: 3px solid #ffd60a; border-left-width: 14px; border-right-width: 14px; border-radius: 8px; pointer-events: none; box-sizing: border-box; }
.me-sel b { position: absolute; top: -3px; bottom: -3px; width: 26px; pointer-events: auto; cursor: ew-resize; touch-action: none; }
.me-sel .me-hl { left: -20px; } .me-sel .me-hr { right: -20px; }
.me-head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .6); pointer-events: none; }
.me-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.me-range { font-size: 13px; color: rgba(255, 255, 255, .8); font-variant-numeric: tabular-nums; flex: 1; min-width: 180px; }
.me-q { display: flex; gap: 6px; }
.me-busy { position: absolute; inset: 0; z-index: 5; background: rgba(0, 0, 0, .78); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.me-ring { position: relative; width: 84px; height: 84px; }
.me-ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.me-ring circle { fill: none; stroke: rgba(255, 255, 255, .15); stroke-width: 3; }
.me-ring circle.p { stroke: var(--ios-blue); stroke-dasharray: 100.5; stroke-dashoffset: 100.5; stroke-linecap: round; transition: stroke-dashoffset .2s; }
.me-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.me-alert { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); z-index: 6; padding: 10px 16px; border-radius: 12px; background: #ff453a; color: #fff; font-size: 14px; animation: rcIn .3s var(--spring); }

/* видео в переписке */
#msgs .bubble.video-b { padding: 4px; }
.vid-wrap { position: relative; display: block; border-radius: 14px; overflow: hidden; background: #000; max-width: min(380px, 100%); }
.vid-wrap video { display: block; width: 100%; height: 100%; object-fit: cover; }
.vid-play { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 20px; backdrop-filter: blur(8px); }
.vid-dur { position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: 8px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.vid-wrap.playing .vid-play, .vid-wrap.playing .vid-dur { display: none; }
.st-video { width: 100%; height: 100%; object-fit: contain; }
#msgs .bubble.video-b .meta.over { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .45); color: #fff; padding: 2px 7px; border-radius: 10px; opacity: 1; margin: 0; }

/* ---------- телефон (Android-приложение и узкое окно): панель вкладок + список, чат поверх всего ---------- */
@media (max-width: 760px) {
  #rail { position: absolute; left: 0; top: 0; bottom: 0; width: 62px; z-index: 5; padding: 10px 0; gap: 6px; transition: transform .45s var(--out), opacity .45s; }
  #rail .ri { width: 62px; height: 44px; }
  #rail .ri-face { width: 44px; height: 44px; }
  #rail .ri-face .orb.tiny { width: 44px; height: 44px; }
  .tab-blob { width: 44px; height: 44px; margin-left: -22px; }
  #side { left: 62px !important; right: 0; width: auto; }
  #chat { z-index: 6; }
  #main.in-chat #rail { transform: translateX(-40%); opacity: 0; pointer-events: none; }
  .side-search { margin-top: 12px; }
  .msgs { padding-left: 10px; padding-right: 10px; }
  #msgs .m { max-width: 86%; }
  .rh-center { max-width: 60vw; }
  .rh-center .room-title b { max-width: 40vw; }
  .ios-back span { display: none; }
  .call-controls { gap: 22px; }
  .cbtn span { width: 60px; height: 60px; }
  .gc-grid { left: 10px; right: 10px; top: 70px; bottom: 140px; }
  .gc-grid[data-n="3"], .gc-grid[data-n="4"] { grid-template-columns: 1fr 1fr; }
  .call-local { width: 120px; }
  .st-stage { height: 100vh; max-width: 100vw; border-radius: 0; }
  .settings, .modal { max-height: 94vh; }
  .me-tools { gap: 6px; }
  .me-range { min-width: 0; flex-basis: 100%; }
}
.android .room-head { padding-top: 10px; }

/* ---------- телефон: вкладки внизу, как в WhatsApp ---------- */
@media (max-width: 760px) {
  #rail { top: auto; bottom: 0; left: 0; right: 0; width: auto; height: 62px; flex-direction: row; justify-content: space-around; align-items: center; padding: 4px; gap: 0;
    border-right: 0; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
  .rail-tabs { flex-direction: row; width: auto; flex: 5; justify-content: space-around; gap: 0; }
  .tab-blob, #rail .rail-sep, #railScroll, .rail-tip { display: none !important; }
  #rail .ri { width: auto; flex: 1; height: 54px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
  #rail .ri .pill { display: none; }
  #rail .ri-face { width: 56px; height: 30px; border-radius: 15px !important; background: transparent; color: var(--muted); position: relative; overflow: visible; }
  #rail .ri-face svg { width: 22px; height: 22px; }
  #rail .ri-face .orb.tiny { width: 30px; height: 30px; background: transparent !important; }
  #rail .ri-face .orb.tiny span { font-size: 18px; color: var(--muted) !important; }
  #rail .ri.on .ri-face { background: rgba(255, 255, 255, .14); color: var(--text); }
  #rail .ri.on .ri-face .orb.tiny span { color: var(--text) !important; }
  #rail .ri::after { content: attr(data-label); font-size: 10.5px; color: var(--muted); white-space: nowrap; line-height: 1; }
  #rail .ri.on::after { color: var(--text); font-weight: 600; }
  #rail .ri.unread .ri-face::before { content: ""; position: absolute; top: 1px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: #30d158; }
  #rail .rbadge { right: calc(50% - 30px); top: -4px; bottom: auto; border-width: 2px; }
  #rail .ri.action .ri-face { background: transparent; color: var(--muted); }
  #rail .ri.action:hover .ri-face { background: transparent; }
  #rail .ri:active .ri-face { transform: scale(.92); }
  #side { left: 0 !important; top: 0; bottom: 62px; }
  #main.in-chat #rail { transform: translateY(100%); opacity: 0; pointer-events: none; }
}

/* ---------- поиск + настройки в одной строке (шестерёнка видна только на телефоне) ---------- */
.side-top { display: flex; align-items: center; gap: 8px; margin: 14px 14px 10px; }
.native .side-top { margin-top: 40px; }
.side-top .side-search { margin: 0 !important; flex: 1; min-width: 0; }
.top-settings { display: none; }

@media (max-width: 760px) {
  .side-top { margin-top: 12px; }
  .top-settings { display: grid; width: 40px; height: 40px; border-radius: 13px; background: rgba(255, 255, 255, .06); color: var(--text); }
  .top-settings svg { width: 20px; height: 20px; }
  #railSettings { display: none !important; }

  /* шапка чата как в WhatsApp: ‹ · аватар и имя слева · кнопки справа — ничего не налезает */
  .room-head { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; padding-left: 4px; padding-right: 6px; }
  .rh-center { max-width: none; justify-content: flex-start; gap: 10px; }
  .rh-center .room-title { min-width: 0; }
  .rh-center .room-title b { max-width: 100%; display: block; }
  .rh-center .room-title small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .room-head .av { --s: 38px; }
  .rh-right { gap: 0; }
  .rh-right .icon-btn { width: 40px; height: 40px; }
  .rh-right .icon-btn svg { width: 22px; height: 22px; }
  .ios-back { padding: 0 2px; }
}

/* ---------- телефон: настройки на весь экран, въезжают справа, как в WhatsApp ---------- */
.modal .close .back-ic { display: none; }
@media (max-width: 760px) {
  .scrim:has(> .settings) { padding: 0; place-items: stretch; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; animation: none; }
  .modal.settings { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; padding: 0 16px 16px; gap: 0; background: var(--bg);
    box-shadow: none; animation: setIn .42s cubic-bezier(.32, .72, 0, 1) both; }
  .scrim.closing:has(> .settings) { animation: none; }
  .scrim.closing .modal.settings { animation: setOut .3s cubic-bezier(.32, .72, 0, 1) forwards; }
  .modal.settings h3 { display: flex; align-items: center; height: 56px; padding-left: 40px; font-size: 20px; flex: none; border-bottom: 1px solid var(--line); margin: 0 -16px 8px; padding-right: 16px; }
  .modal.settings h3 { padding-left: 56px; }
  .modal.settings .close { left: 6px; right: auto; top: 8px; width: 40px; height: 40px; color: var(--text); }
  .modal.settings .close svg:first-child { display: none; }
  .modal.settings .close .back-ic { display: block; width: 26px; height: 26px; stroke-width: 2.4; }
  .modal.settings .scroll { flex: 1; margin: 0 -16px; padding: 0 16px 24px; }
  .android .modal.settings h3 { margin-top: 0; }
}
@keyframes setIn { from { transform: translateX(100%); } }
@keyframes setOut { to { transform: translateX(100%); } }

/* ---------- лёгкий режим для слабых телефонов (включается сам) ---------- */
.lite #aurora i, .lite #specks i { animation: none !important; will-change: auto; }
.lite #grain, .lite #specks, .lite .send-glow, .lite .top-glow { display: none !important; }
.lite *, .lite *::before, .lite *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.lite .glass-panel { background: color-mix(in srgb, var(--bg) 82%, #000); }
.lite .room-head, .lite .glass-bar { background: color-mix(in srgb, var(--bg) 94%, #000); }
.lite #rail { background: color-mix(in srgb, var(--bg) 96%, #000); }
.lite .scrim { background: rgba(0, 0, 0, .6); }
.lite .pop, .lite .modal, .lite .focus-menu { background: var(--bg2); }
.lite .wind-title { filter: none; }
.lite .room.push { box-shadow: none; }
.lite .call-av i { animation: none !important; display: none; }
.lite .wind-title, .lite .wind-title::before, .lite .wind-title::after { animation: none !important; }

/* ---------- профиль по нажатию на аватар ---------- */
.info-face { border-radius: 50%; padding: 0; }
.qa-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; margin: 14px 0 2px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 14px; background: rgba(255, 255, 255, .06); color: var(--text); transition: background .2s, transform .2s; }
.qa:active { transform: scale(.95); }
.qa span { display: grid; place-items: center; }
.qa svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qa small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.qa.on { color: #ffd60a; }
.qa.on[data-qa="fav"] svg { fill: currentColor; }
.info-list { display: flex; flex-direction: column; border-radius: 14px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.il { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 14px; text-align: left; width: 100%; }
.il + .il { border-top: 1px solid var(--line); }
.il b { font-weight: 500; font-size: 15px; }
.il small { color: var(--faint); font-size: 12px; }
button.il:active { background: rgba(255, 255, 255, .06); }
.info-sec h4 .cnt { text-transform: none; letter-spacing: 0; }
.info-media { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: 12px; overflow: hidden; }
.info-media .small { grid-column: 1 / -1; font-size: 13px; padding: 6px 2px; }
.info-media .im { position: relative; aspect-ratio: 1; padding: 0; overflow: hidden; background: rgba(255, 255, 255, .05); }
.info-media img, .info-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.info-media .vid i { position: absolute; left: 5px; bottom: 4px; font-style: normal; font-size: 11px; color: #fff; text-shadow: 0 1px 3px #000; }

/* ---------- галочки как в WhatsApp: одна серая — отправлено, две зелёные — прочитано ---------- */
#msgs .bubble .meta { opacity: 1; }
#msgs .bubble .meta > :not(.ticks) { opacity: .55; }
#msgs .bubble .meta .ticks { display: inline-flex; opacity: .6; }
#msgs .bubble .meta.over > :not(.ticks) { opacity: .9; }
.ticks svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ticks.read, .ci .ticks.read, #msgs .bubble .meta .ticks.read { color: #30d158; opacity: 1; }
.ci .ticks:not(.read) { color: var(--muted); }

/* ---------- фото в переписке: без бегущего блика после загрузки ---------- */
.bubble.img .shot:has(img.ok)::before { display: none; }
.bubble.img .shot img { transform: none; transition: opacity .25s; }

/* ---------- просмотр фото: увеличение пальцами, нажатием, колёсиком ---------- */
.viewer { touch-action: none; user-select: none; -webkit-user-select: none; }
.viewer img { transform-origin: 0 0; will-change: transform; -webkit-user-drag: none; }
.viewer-x { position: fixed; top: 14px; right: 14px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .14); color: #fff; opacity: 0; transition: opacity .3s; }
.viewer.open .viewer-x { opacity: 1; }
.viewer-x svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.native .viewer-x { top: 40px; }
.lite .viewer.open { backdrop-filter: none; background: rgba(0, 0, 0, .92); }

/* ---------- чёрный список ---------- */
.block-bar { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; margin: 0 auto 6px; max-width: 760px;
  border-radius: 16px; background: rgba(255, 255, 255, .06); color: var(--muted); font-size: 14px; text-align: center; }
.block-bar.hidden { display: none; }
.composer-wrap.blocked .composer, .composer-wrap.blocked .reply-bar { display: none !important; }
.il.danger-row { color: #ff453a; font-weight: 500; font-size: 15px; border-radius: 14px; background: rgba(255, 69, 58, .08); padding: 13px 14px; }
.blocked-list { display: flex; flex-direction: column; gap: 4px; }
.blocked-list .urow { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.blocked-list .urow > div:not(.av) { flex: 1; min-width: 0; }
.btn.small { padding: 6px 12px; font-size: 13px; min-height: 0; }

/* ---------- галочки «доставлено» ---------- */
.ticks.dlv .t2 { opacity: 1; transform: none; }

/* ---------- список: значки «без звука», «закреп», упоминание ---------- */
.ci .ci-ic { display: inline-grid; place-items: center; color: var(--faint); margin-left: 4px; flex: none; }
.ci .ci-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ci .badge.muted { background: rgba(255, 255, 255, .22) !important; color: var(--text) !important; }
.ci .badge.at { min-width: 20px; margin-right: 4px; }

/* ---------- меню сообщения: удалить ---------- */
.del-opts { display: flex; flex-direction: column; gap: 8px; }

/* ---------- переслать ---------- */
.fw-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; }
.fw-row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; text-align: left; color: var(--text); }
.fw-row:hover { background: rgba(255, 255, 255, .05); }
.fw-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-row .chk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); flex: none; transition: .2s; }
.fw-row.on .chk { background: #30d158; border-color: #30d158; box-shadow: inset 0 0 0 4px var(--bg2); }
.fwd-l { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-style: italic; opacity: .7; margin-bottom: 4px; }
.fwd-l svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- свайп-ответ ---------- */
#msgs .m { position: relative; }
#msgs .m::before { content: ""; position: absolute; left: -30px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; opacity: 0; transition: opacity .15s;
  background: rgba(255, 255, 255, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14 4 9l5-5'/%3E%3Cpath d='M4 9h10.5a5.5 5.5 0 0 1 0 11H11'/%3E%3C/svg%3E") center / 16px no-repeat; }
#msgs .m.swipe-ready::before { opacity: 1; }

/* ---------- файл ---------- */
.file { display: flex; align-items: center; gap: 12px; padding: 4px 2px; color: inherit; text-decoration: none; min-width: 200px; max-width: 300px; }
.f-ic { width: 44px; height: 48px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  background: rgba(255, 255, 255, .18); color: inherit; position: relative; clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%); }
.f-t { display: flex; flex-direction: column; min-width: 0; }
.f-t b { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-t small { opacity: .65; font-size: 12px; }

/* ---------- опрос ---------- */
.poll { display: flex; flex-direction: column; gap: 6px; min-width: 230px; max-width: 320px; }
.pq { font-size: 15.5px; font-weight: 600; }
.pk, .pf { font-size: 12px; opacity: .6; }
.po { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: inherit; text-align: left; overflow: hidden; }
.pbar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .16); transition: width .5s cubic-bezier(.32, .72, 0, 1); }
.pdot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; opacity: .6; flex: none; position: relative; }
.po.mine .pdot { background: #30d158; border-color: #30d158; opacity: 1; }
.pt { flex: 1; position: relative; font-size: 14.5px; }
.pn { position: relative; font-size: 13px; font-weight: 600; opacity: .8; }

/* ---------- геопозиция ---------- */
#msgs .bubble.loc-b { padding: 4px; }
.loc { display: block; position: relative; width: 260px; height: 160px; border-radius: 14px; overflow: hidden; background: #2b2f36; color: #fff; text-decoration: none; }
.map { position: absolute; inset: 0; }
.map img { position: absolute; width: 256px; height: 256px; max-width: none; }
.loc-pin { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -22px 0 0 -11px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #ff3b30; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); border: 2px solid #fff; }
.loc-t { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 8px; background: rgba(0, 0, 0, .55); font-size: 12px; }
.loc-b .meta { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .45); color: #fff; padding: 2px 7px; border-radius: 10px; opacity: 1 !important; margin: 0; }

/* ---------- стикер ---------- */
#msgs .bubble.sticker-b { background: transparent !important; padding: 0; }
#msgs .bubble.sticker-b::after { display: none; }
.stk { width: 150px; height: 150px; display: block; }
.stk-f { font-size: 110px; line-height: 1.1; display: block; }

/* ---------- кружок ---------- */
#msgs .bubble.round-b { background: transparent !important; padding: 0; position: relative; }
#msgs .bubble.round-b::after { display: none; }
.round-wrap { display: block; width: 220px; height: 220px; border-radius: 50%; overflow: hidden; position: relative; cursor: pointer; background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12); }
.round-wrap video { width: 100%; height: 100%; object-fit: cover; }
.round-wrap.sound { box-shadow: 0 0 0 3px #30d158; }
.round-dur { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; }
.round-b .meta.over { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .45); color: #fff; padding: 2px 7px; border-radius: 10px; opacity: 1; margin: 0; }

/* ---------- один просмотр ---------- */
.once { display: flex; align-items: center; gap: 10px; padding: 6px 2px; color: inherit; font-size: 14.5px; font-weight: 500; }
.once-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed currentColor; font-size: 15px; flex: none; }
.once:disabled { opacity: .6; }
.once-view { position: fixed; inset: 0; z-index: 75; background: #000; display: grid; place-items: center; pointer-events: auto; animation: fadeIn .25s ease; }
.once-view.closing { animation: fadeOut .25s ease forwards; }
.once-view img, .once-view video { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.once-view .viewer-x { opacity: 1; }
.once-note { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 6px 12px; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 12.5px; white-space: nowrap; }

/* ---------- скрепка ---------- */
.att-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; color: #fff; }
.att-ic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.att-ic.media { background: #0a84ff; } .att-ic.file { background: #5e5ce6; } .att-ic.once { background: #ff9f0a; } .att-ic.round { background: #ff375f; }
.att-ic.poll { background: #30d158; } .att-ic.loc { background: #34c759; filter: hue-rotate(40deg); } .att-ic.stk { background: #bf5af2; }
.att-pop .mi { gap: 12px; }
/* опрос */
.poll-opts { display: flex; flex-direction: column; gap: 8px; }
/* геопозиция: превью */
.loc-prev { width: 100%; height: 170px; }
/* стикеры */
.stk-pop { width: min(340px, calc(100vw - 20px)); padding: 10px; }
.stk-pop h5 { margin: 2px 4px 8px; font-size: 13px; color: var(--muted); }
.stk-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; max-height: 300px; overflow-y: auto; }
.stk-grid button { aspect-ratio: 1; border-radius: 10px; padding: 4px; }
.stk-grid button:hover { background: rgba(255, 255, 255, .08); }
.stk-grid img { width: 100%; height: 100%; }
/* запись кружка */
.round-rec { position: fixed; inset: 0; z-index: 72; background: rgba(0, 0, 0, .88); pointer-events: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; animation: fadeIn .25s ease; }
.round-rec.closing { animation: fadeOut .25s ease forwards; }
.rr-stage { position: relative; width: min(78vw, 320px); aspect-ratio: 1; }
.rr-cam { position: absolute; inset: 8px; border-radius: 50%; overflow: hidden; background: #111; }
.rr-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.round-rec.done .rr-cam video { transform: none; }
.rr-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.rr-ring circle { fill: none; stroke: #ff375f; stroke-width: 3; stroke-dasharray: 302; stroke-dashoffset: 302; transition: stroke-dashoffset .1s linear; }
.rr-time { color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }
.rr-ctrl { display: flex; align-items: center; gap: 22px; }
.rr-btn { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; display: grid; place-items: center; }
.rr-btn i { width: 54px; height: 54px; border-radius: 50%; background: #ff375f; transition: .25s; }
.rr-btn.on i { width: 26px; height: 26px; border-radius: 6px; }
.round-rec.done .rr-btn { opacity: .3; }

/* ---------- упоминания ---------- */
.mention { color: #64d2ff; font-weight: 600; cursor: pointer; }
.m.own .mention { color: inherit; text-decoration: underline; }
.mention.me { background: rgba(100, 210, 255, .18); border-radius: 5px; padding: 0 3px; }
.mention-pop { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px); max-width: 360px; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 4px; z-index: 8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); display: flex; flex-direction: column; animation: fadeIn .15s ease; }
.mention-pop button { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; text-align: left; color: var(--text); }
.mention-pop button:hover { background: rgba(255, 255, 255, .06); }
.mention-pop span { display: flex; flex-direction: column; }
.mention-pop small { color: var(--muted); font-size: 12px; }
.composer-wrap { position: relative; }

/* ---------- превью ссылки ---------- */
.lp { display: block; }
.lp-card { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding: 8px 10px; border-left: 3px solid #64d2ff; border-radius: 8px; background: rgba(255, 255, 255, .07);
  color: inherit; text-decoration: none; max-width: 320px; overflow: hidden; }
.lp-card img { width: calc(100% + 20px); margin: -8px -10px 4px; max-height: 170px; object-fit: cover; }
.lp-site { font-size: 12px; color: #64d2ff; font-weight: 600; }
.m.own .lp-site { color: inherit; opacity: .8; }
.lp-card b { font-size: 14px; line-height: 1.3; }
.lp-desc { font-size: 12.5px; opacity: .75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- профиль: строки настроек чата ---------- */
.il.row { flex-direction: row; align-items: center; justify-content: space-between; color: var(--text); font-size: 15px; }
.il.row em { font-style: normal; color: var(--faint); font-size: 13.5px; }
.inv-link { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); font-size: 13.5px; word-break: break-all; user-select: all; -webkit-user-select: all; }
.ttl-opts { display: flex; flex-direction: column; gap: 8px; }
.cg-join { margin-left: auto; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--text); font-size: 12.5px; white-space: nowrap; }

/* ---------- обои ---------- */
.room.has-wall { background: var(--wall); }
.room.has-wall .msgs { background: transparent; }
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wall { aspect-ratio: 3 / 4; border-radius: 14px; display: flex; align-items: flex-end; justify-content: center; padding: 8px; color: #fff; font-size: 12.5px; border: 2px solid transparent; }
.wall.on { border-color: #30d158; }
.wall span { background: rgba(0, 0, 0, .45); padding: 2px 8px; border-radius: 8px; }

/* ---------- поиск в чате ---------- */
.chat-search { position: absolute; left: 0; right: 0; top: 0; z-index: 7; display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; padding: 10px 10px 8px;
  background: var(--bg2); border-bottom: 1px solid var(--line); animation: fadeIn .15s ease; }
.native .chat-search { padding-top: 36px; }
.chat-search .search-wrap { margin: 0; }
.cs-res { grid-column: 1 / -1; max-height: 55vh; overflow-y: auto; display: flex; flex-direction: column; }
.cs-res button { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; text-align: left; padding: 8px 6px; border-radius: 10px; color: var(--text); }
.cs-res button:hover { background: rgba(255, 255, 255, .05); }
.cs-res button span { grid-column: 1 / -1; font-size: 13.5px; color: var(--muted); }
.cs-res small { color: var(--faint); font-size: 12px; }
.cs-res mark { background: rgba(255, 214, 10, .35); color: inherit; border-radius: 3px; }

/* ---------- «Чтобы звонки доходили» ---------- */
.setup-list { display: flex; flex-direction: column; gap: 6px; }
.setup-step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); color: var(--text); text-align: left; }
.ss-n { width: 26px; height: 26px; border-radius: 50%; background: #0a84ff; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.setup-step.done .ss-n { background: #30d158; }
.ss-t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ss-t small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.ss-go { font-size: 22px; color: var(--faint); }

/* ---------- окно звонка как в WhatsApp ---------- */
.call-ui { background: #0b141a; }
.call-bg { filter: blur(60px) saturate(120%) brightness(.35); }
.call-center { top: max(9vh, 56px); gap: 6px; }
.call-center h2 { order: 0; font-size: 28px; font-weight: 500; }
.call-center .call-status { order: 1; font-size: 15px; color: rgba(255, 255, 255, .8); }
.call-kind { order: 2; font-size: 12.5px; color: rgba(255, 255, 255, .5); }
.call-av { order: 3; margin: 9vh 0 0; }
.call-av .av { --s: min(42vw, 180px) !important; }
/* видео: собеседник на весь экран, имя и время — маленько слева сверху */
.call-ui.has-remote-video .call-center { top: 18px; left: 18px; right: auto; transform: none; align-items: flex-start; text-align: left; gap: 2px; }
.native .call-ui.has-remote-video .call-center, .android .call-ui.has-remote-video .call-center { top: 40px; }
.call-ui.has-remote-video .call-center h2 { font-size: 18px; }
.call-ui.has-remote-video .call-kind { display: none; }
.call-ui.has-remote-video .call-center, .call-ui.local-full .call-center { text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
/* своя камера: маленькое окошко справа сверху; до ответа — на весь экран */
.call-local { right: 16px; top: 16px; width: 104px; aspect-ratio: 3 / 4; border-radius: 14px; box-shadow: 0 8px 26px rgba(0, 0, 0, .5); z-index: 2; transition: all .45s cubic-bezier(.22, 1, .36, 1); }
.android .call-ui .call-local { top: 40px; }
.call-ui.local-full .call-local { inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; z-index: 0; opacity: 1; }
.call-ui.local-full .call-av, .call-ui.local-full .call-bg { display: none; }
.call-ui.rear .call-local, .call-ui.rear.has-local .call-local { transform: none; }
/* панель кнопок снизу — тёмная плашка с круглыми кнопками без подписей */
.call-controls { left: 50%; right: auto; transform: translateX(-50%); bottom: max(4vh, 22px); gap: 14px; padding: 12px 16px; border-radius: 34px;
  background: rgba(31, 44, 52, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.call-controls:empty { display: none; }
.call-controls .cbtn small { display: none; }
.call-controls .cbtn span { width: 54px; height: 54px; background: rgba(255, 255, 255, .1); }
.call-controls .cbtn span svg { width: 25px; height: 25px; }
.call-controls .cbtn.on span { background: #fff; color: #0b141a; }
.call-controls .cbtn.end span { background: #f15c6d; }
/* входящий: две большие кнопки внизу, с подписями, без плашки */
.call-ui.incoming .call-controls { background: none; box-shadow: none; gap: 90px; bottom: max(9vh, 40px); }
.call-ui.incoming .cbtn small { display: block; font-size: 13px; }
.call-ui.incoming .cbtn span { width: 68px; height: 68px; }
.call-ui.incoming .cbtn.decline span { background: #f15c6d; }
.call-ui.incoming .cbtn.accept span { background: #25d366; }
@media (max-width: 760px) {
  .call-controls { gap: 10px; padding: 10px 12px; }
  .call-controls .cbtn span { width: 52px; height: 52px; }
  .call-ui.incoming .call-controls { gap: 70px; }
}
