/* ═════════════════════════════════════════════════════════════════════════════
   ORBIT · Система руху (Design Revision 2.0)
   Підключається ОСТАННІМ — після app.css, ds.css, rev2.css, apple.css.

   Принципи (як і в усьому інтерфейсі — «швидко, природно, преміально, без перебору»):
   • Усе, що рухається, бере швидкість і криву з одного словника нижче; жодних «власних» чисел у компонентах.
   • Поява — повільніша й м’яка (--m-out), зникнення — вдвічі швидше (--m-in): інтерфейс не змушує чекати.
   • Чим менший елемент і ближче до пальця — тим швидше. Нічого не стрибає й не зникає різко.
   • «Пружина» (--m-spring) — лише для дрібних живих речей: стікери, реакції, перемикачі, кнопки дзвінка.
   • Екстрені режими поважаємо: «Економний режим» (body.lite) і системне «зменшити рух» вимикають усе
     (правила в ds.css), тож тут окремо про це дбати не треба.
   ═════════════════════════════════════════════════════════════════════════════ */

/* ───────── 1. Словник ───────── */
:root {
  --m-instant: 90ms;   /* реакція на дотик: натискання кнопки */
  --m-fast: 150ms;     /* підсвічування, закриття меню, дрібні зміни */
  --m-base: 230ms;     /* меню, вкладки, поява повідомлення */
  --m-slow: 340ms;     /* вікна, листи, панелі, переходи між екранами */
  --m-hero: 560ms;     /* заставка, перший показ */

  --m-out: cubic-bezier(.22, 1, .36, 1);        /* поява: швидкий старт, м’яке «приземлення» */
  --m-in: cubic-bezier(.4, 0, 1, 1);            /* зникнення: розгін без гальмування */
  --m-inout: cubic-bezier(.65, 0, .35, 1);      /* рух між двома місцями на екрані */
  --m-sheet: cubic-bezier(.32, .72, 0, 1);      /* листи й бічні панелі, як в iOS */
  --m-spring: cubic-bezier(.34, 1.32, .64, 1);  /* легке пружинення (≈ 4 % перельоту) */

  /* старі імена вказують на новий словник — увесь наявний CSS підтягується до єдиного ритму */
  --dur-1: var(--m-fast); --dur-2: var(--m-base); --dur-3: var(--m-slow);
  --ease-out: var(--m-out); --ease-in-out: var(--m-inout); --spring: var(--m-spring);
}

/* ───────── 2. Ключові кадри ─────────
   Здебільшого описано лише «from»: кінцевий стан — природний стан елемента, тому нічого не «залипає». */
@keyframes m-fade { from { opacity: 0; } }
@keyframes m-fade-out { to { opacity: 0; } }
@keyframes m-rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes m-pop { from { opacity: 0; transform: scale(.86); } }
@keyframes m-zoom { from { opacity: 0; transform: scale(.95); } }
@keyframes m-menu { from { opacity: 0; transform: scale(.94); } }
@keyframes m-menu-out { to { opacity: 0; transform: scale(.97); } }
@keyframes m-modal { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes m-modal-out { to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes m-sheet { from { transform: translateY(100%); } }
@keyframes m-sheet-out { to { transform: translateY(100%); } }
@keyframes m-msg { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes m-slide { from { opacity: 0; transform: translateX(16px); } }
@keyframes m-slide-rtl { from { opacity: 0; transform: translateX(-16px); } }
@keyframes m-toast { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes m-toast-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes m-sticker { from { opacity: 0; transform: scale(.62) rotate(-5deg); } 62% { opacity: 1; transform: scale(1.05) rotate(1deg); } }
@keyframes m-row { from { opacity: 0; transform: translateY(-8px); } }

/* ───────── 3. Натискання: усі кнопки відповідають одразу й повертаються м’яко ───────── */
.btn, .icon-btn, .chip, .chip2, .rail-btn, .tabbar button, .cam-btn, .pe-tab, .ring-btn, .cbtn, .pk-eb, .tt-btn, .seg-b, .tabs button {
  transition: transform var(--m-base) var(--m-spring), background-color var(--m-fast) var(--m-out), color var(--m-fast) var(--m-out),
    border-color var(--m-fast) var(--m-out), box-shadow var(--m-base) var(--m-out), opacity var(--m-fast) var(--m-out), filter var(--m-fast) var(--m-out);
}
.btn:active, .icon-btn:active, .chip:active, .chip2:active, .rail-btn:active, .tabbar button:active, .cam-btn:active, .pe-tab:active,
.cbtn:active, .pk-eb:active, .tt-btn:active { transform: scale(.95); transition-duration: var(--m-instant); }
.ring-btn:hover { transform: scale(1.06); } .ring-btn:active { transform: scale(.92); transition-duration: var(--m-instant); }
.crow, .srow, .member-row, .dg-row, .fold-row, .pm-item, .menu-item { transition: background-color var(--m-fast) var(--m-out), transform var(--m-base) var(--m-spring), color var(--m-fast) var(--m-out); }

/* ───────── 4. Меню, підказки, панель емодзі: виростають із точки натискання ───────── */
body:not(.zz) .popmenu, body:not(.zz) .menu.ctx, body:not(.zz) .emoji-pop, body:not(.zz) .sp-menu {
  animation: m-menu var(--m-base) var(--m-out) backwards; transform-origin: top left;
}
[dir="rtl"] .popmenu, [dir="rtl"] .menu.ctx { transform-origin: top right; }
body:not(.zz) .popmenu.leaving, body:not(.zz) .menu.ctx.leaving, body:not(.zz) .emoji-pop.leaving, body:not(.zz) .sp-menu.leaving {
  animation: m-menu-out var(--m-fast) var(--m-in) both; pointer-events: none;
}
/* швидкі реакції в меню повідомлення з’являються по черзі, як у iMessage */
.menu.ctx .react-row .rq { animation: m-pop var(--m-base) var(--m-spring) backwards; animation-delay: calc(50ms + var(--i, 0) * 24ms); }
.menu.ctx .react-row .rq:nth-child(2) { --i: 1; } .menu.ctx .react-row .rq:nth-child(3) { --i: 2; } .menu.ctx .react-row .rq:nth-child(4) { --i: 3; }
.menu.ctx .react-row .rq:nth-child(5) { --i: 4; } .menu.ctx .react-row .rq:nth-child(6) { --i: 5; } .menu.ctx .react-row .rq:nth-child(7) { --i: 6; }

/* ───────── 5. Вікна: по центру — м’яке «виринання», на телефоні — лист знизу ───────── */
body:not(.zz) .modal-back { animation: m-fade var(--m-base) var(--m-out) backwards; }
body:not(.zz) .modal { animation: m-modal var(--m-slow) var(--m-out) backwards; }
body:not(.zz) .modal-back.closing { animation: m-fade-out var(--m-fast) var(--m-in) both; pointer-events: none; }
body:not(.zz) .modal-back.closing .modal { animation: m-modal-out var(--m-fast) var(--m-in) both; }
@media (max-width: 640px) {
  body:not(.zz) .modal { animation: m-sheet var(--m-slow) var(--m-sheet) backwards; }
  body:not(.zz) .modal-back.closing { animation: m-fade-out var(--m-base) var(--m-sheet) both; }
  body:not(.zz) .modal-back.closing .modal { animation: m-sheet-out var(--m-base) var(--m-sheet) both; }
}
/* профіль: вміст з’являється зверху вниз, без перебору (4 кроки по 28 мс) */
.profile { animation: none; }
.profile > .p-top, .profile > .btnrow, .profile > .badges, .profile > .p-row { animation: m-rise var(--m-slow) var(--m-out) backwards; }
.profile > .p-top { animation-delay: 30ms; } .profile > .btnrow { animation-delay: 60ms; } .profile > .badges { animation-delay: 85ms; } .profile > .p-row { animation-delay: 110ms; }

/* ───────── 6. Сповіщення ───────── */
.toast { animation: m-toast var(--m-slow) var(--m-spring) backwards; }
.toast.out { opacity: 1; transition: none; animation: m-toast-out var(--m-base) var(--m-in) both; }

/* ───────── 7. Вкладки та сегментовані перемикачі: «повзунок» плавно їде до обраного пункту ───────── */
@supports selector(:has(*)) {
  .seg { position: relative; isolation: isolate; --n: 2; --i: 0; }
  .seg:has(> :nth-child(3)) { --n: 3; } .seg:has(> :nth-child(4)) { --n: 4; } .seg:has(> :nth-child(5)) { --n: 5; } .seg:has(> :nth-child(6)) { --n: 6; }
  .seg:has(> :nth-child(2):is(.active, .on)) { --i: 1; } .seg:has(> :nth-child(3):is(.active, .on)) { --i: 2; }
  .seg:has(> :nth-child(4):is(.active, .on)) { --i: 3; } .seg:has(> :nth-child(5):is(.active, .on)) { --i: 4; } .seg:has(> :nth-child(6):is(.active, .on)) { --i: 5; }
  .seg::before {
    content: ""; position: absolute; z-index: -1; top: 2px; bottom: 2px; inset-inline-start: 2px; width: calc((100% - 4px) / var(--n));
    border-radius: 8px; background: var(--thumb); box-shadow: 0 1px 3px rgba(0, 0, 0, .28), 0 0 0 .5px rgba(0, 0, 0, .06);
    transform: translateX(calc(var(--i) * 100%)); transition: transform var(--m-base) var(--m-sheet);
  }
  [dir="rtl"] .seg::before { transform: translateX(calc(var(--i) * -100%)); }
  .seg:not(:has(> :is(.active, .on)))::before { opacity: 0; }
  .seg > .seg-b, .seg > button { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .seg .seg-b.active, .seg button.on, .seg button.active { background: transparent; box-shadow: none; }
  /* під час плавної зміни теми (ds.css, html.theme-fade) дозволені лише кольорові переходи — повзунку залишаємо й рух */
  html.theme-fade .seg::before { transition: transform var(--m-base) var(--m-sheet), background-color .28s var(--m-inout), box-shadow .28s var(--m-inout), opacity var(--m-fast) !important; }
}

/* ───────── 8. Екрани й панелі ───────── */
.view-in, .tabview-in { animation: m-rise var(--m-base) var(--m-out) backwards; }
.pm-grid, .pm-list, .call-out, .calling { animation: m-rise var(--m-slow) var(--m-out) backwards; }
.sbody.slide-in { animation: m-slide var(--m-base) var(--m-out) backwards; }
[dir="rtl"] .sbody.slide-in { animation-name: m-slide-rtl; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--m-base); animation-timing-function: var(--m-out); }
/* телефон: списки чатів, меню серверів і панель учасників виїжджають як справжні панелі, затемнення гасне плавно */
@media (max-width: 899px) {
  .rail, .side, .members { transition: transform var(--m-slow) var(--m-sheet); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--m-base) var(--m-out), visibility 0s linear var(--m-base); }
  .app.nav-open .scrim, .app.mem-open .scrim { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .app.list-page .scrim { display: none !important; }
}

/* ───────── 9. Повідомлення, стікери, реакції ───────── */
.bubble.pop-in { animation: m-msg var(--m-base) var(--m-out) backwards; transform-origin: bottom left; }
.row.mine .bubble.pop-in { transform-origin: bottom right; }
.bubble.pop-in img.sticker { animation: m-sticker var(--m-slow) var(--m-spring) backwards; }
@media (hover: hover) { img.sticker { transition: transform var(--m-base) var(--m-spring); } img.sticker:hover { transform: scale(1.04); } img.sticker:active { transform: scale(.97); transition-duration: var(--m-instant); } }
.rx { transition: background-color var(--m-fast) var(--m-out), border-color var(--m-fast) var(--m-out), transform var(--m-base) var(--m-spring); }
.rx:active { transform: scale(.92); transition-duration: var(--m-instant); }
.rx.rx-pop { animation: m-pop var(--m-slow) var(--m-spring) backwards; }
.row.flash .bubble { animation-duration: 1.4s; }
.stk-b, .stk-big, .stk-set { animation-duration: var(--m-base); }
.att-img.m-fade { animation: m-fade var(--m-base) var(--m-out) backwards; }
/* новий чат у списку з’являється м’яко; рядки, що змінили місце, їдуть (див. flipList в util.js) */
[data-cid].m-new { animation: m-row var(--m-base) var(--m-out) backwards; }

/* ───────── 10. Фото, перегляд, одноразові фото ───────── */
.lightbox, .once-view, .ann-back { animation: m-fade var(--m-base) var(--m-out) backwards; }
@keyframes m-zoom-out { to { opacity: 0; transform: scale(.97); } }
/* закриття: перегляд фото, галерея й оголошення тихо гаснуть (клас .leaving ставить leave() із motion.js) */
.lightbox.leaving, .ann-back.leaving { animation: m-fade-out var(--m-fast) var(--m-in) both; pointer-events: none; }
.lightbox.leaving img, .lightbox.leaving video, .lightbox.leaving .gal-stage > * { animation: m-zoom-out var(--m-fast) var(--m-in) both; }
body:not(.zz) .ann-back.leaving .ann-card { animation: m-modal-out var(--m-fast) var(--m-in) both; }
.lightbox img, .lightbox video, .gal-stage img, .once-view img, .once-view .circle-big { animation: m-zoom var(--m-slow) var(--m-out) backwards; }
body:not(.zz) .ann-card { animation: m-modal var(--m-slow) var(--m-out) backwards; }

/* ───────── 11. Дзвінки ───────── */
#rings.enter .ring-card { animation: ringIn var(--m-slow) var(--m-spring) backwards; }
#rings.leaving .ring-card { animation: ringOut var(--m-base) var(--m-in) both; pointer-events: none; }
.vr-user, .vc-user, .voice-user, .tile { animation-duration: var(--m-slow); }
.controls .cbtn { transition: transform var(--m-base) var(--m-spring), background-color var(--m-fast) var(--m-out), color var(--m-fast) var(--m-out), box-shadow var(--m-base) var(--m-out); }

/* ───────── 12. Завантаження: однаковий спінер і «дихання» плейсхолдера ───────── */
.spinner, .ov2-spin { animation-duration: .8s; animation-timing-function: linear; }
.att-img.loading { animation: shimmer 1.1s var(--m-inout) infinite alternate; }


/* Список учасників — на фоні людини (шпалери / своє фото), скляна підкладка, прокручується лише список */
@media (min-width: 900px) { .members { position: relative; } }
.members { isolation: isolate; display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.members > .mem-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.members > .chat-bg { z-index: -1; }
.members:not(.has-bg) > .chat-bg { display: none; }
body:not(.zz) .members.has-bg { background: transparent; }
body:not(.zz) .members.has-bg > .mem-scroll { background: color-mix(in srgb, var(--bg1) 46%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
:root[data-theme="light"] body:not(.zz) .members.has-bg > .mem-scroll { background: color-mix(in srgb, #fff 50%, transparent); }
/* Чат голосового каналу (панель праворуч) — теж на фоні людини, «скло» поверх шпалер */
body:not(.zz) .chanview.vlay .chat.vchat { background: color-mix(in srgb, var(--bg2) 42%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3); }
:root[data-theme="light"] body:not(.zz) .chanview.vlay .chat.vchat { background: color-mix(in srgb, #fff 46%, transparent); }
body.lite:not(.zz) .members.has-bg > .mem-scroll, body.lite:not(.zz) .chanview.vlay .chat.vchat { -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (max-width: 899px) { .members > .mem-scroll { height: 100%; } }

/* ── Компактне вікно дзвінка (як у Discord): менший контейнер, менші аватари, без зайвої порожнечі.
   Кнопки керування — свого звичайного розміру. ── */
/* Особистий / груповий дзвінок: дзвінок — смуга вгорі, чату лишається більша частина */
/* Особистий / груповий дзвінок (як у Discord): чат і його верхня панель лишаються на місці, а вікно дзвінка —
   окремий шар ПОВЕРХ області чату. Під вікном у стрічці — відступ, тож давні повідомлення можна прогорнути й прочитати. */
.chanview.with-stage:not(.vlay) { position: relative; --call-h: clamp(220px, 31vh, 290px); }
.chanview.with-stage:not(.vlay):has(> .stage.has-video) { --call-h: clamp(280px, 50vh, 580px); }
.chanview.with-stage:not(.vlay):not(.chat-hidden) > .stage { position: absolute; top: 10px; left: 12px; right: 12px; z-index: 8; height: var(--call-h);
  border-radius: 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  background:
    radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 62%),
    radial-gradient(70% 70% at 110% 115%, rgba(124, 140, 255, .12), transparent 64%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg1) 94%, #000), color-mix(in srgb, var(--bg0) 96%, #000));
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .65), 0 1px 0 rgba(255, 255, 255, .05) inset;
  animation: callIn .28s cubic-bezier(.2, .8, .2, 1); }
:root[data-theme="light"] .chanview.with-stage:not(.vlay):not(.chat-hidden) > .stage { background: radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 62%), linear-gradient(180deg, var(--bg1), var(--bg2)); box-shadow: 0 18px 44px -20px rgba(20, 30, 50, .35); }
@keyframes callIn { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
.chanview.with-stage:not(.vlay):not(.chat-hidden) > .chat { flex: 1 1 auto; border-top: 0; }
.chanview.with-stage:not(.vlay):not(.chat-hidden) > .chat > .msgs { padding-top: calc(var(--call-h) + 22px); }
.chanview.with-stage:not(.vlay):not(.chat-hidden) > .chat > .pinbar:not(:empty), .chanview.with-stage:not(.vlay):not(.chat-hidden) > .chat > .missedbar:not(:empty) { margin-top: calc(var(--call-h) + 18px); }
.chanview.with-stage:not(.vlay):not(.chat-hidden) > .chat > .pinbar:not(:empty) ~ .msgs, .chanview.with-stage:not(.vlay):not(.chat-hidden) > .chat > .missedbar:not(:empty) ~ .msgs { padding-top: 8px; }
.chanview.with-stage.chat-hidden:not(.vlay) > .stage { flex: 1 1 auto; height: auto; }
@media (max-width: 899px) { .chanview.with-stage:not(.vlay):not(.chat-hidden) > .stage { top: 8px; left: 8px; right: 8px; } }
@media (prefers-reduced-motion: reduce) { .chanview.with-stage:not(.vlay) > .stage { animation: none; } }
/* Особистий / груповий дзвінок без відео: лише круглі аватари по центру — без сірих карток, рамок і підкладок */
.stage.pv:not(.has-video) .grid { display: flex !important; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: 28px; padding: 12px 16px 4px; overflow: auto; }
.stage.pv:not(.has-video) .grid > .tile { flex: 0 0 auto; width: auto; height: auto; min-height: 0; background: none; box-shadow: none; outline: none; border-radius: 0; overflow: visible; flex-direction: column; gap: 10px; cursor: default; }
.stage.pv:not(.has-video) .tile-av .avatar { width: 96px !important; height: 96px !important; font-size: 40px !important; transition: box-shadow .15s; }
.stage.pv:not(.has-video) .tile.speaking .tile-av .avatar { box-shadow: 0 0 0 3px #3ddc6f, 0 0 22px rgba(61, 220, 111, .35); }
.stage.pv:not(.has-video) .tile-label { position: static; background: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: var(--text); padding: 0; font-weight: 600; font-size: 13.5px; justify-content: center; }
.stage.pv:not(.has-video) .tile-tools { top: -4px; right: -10px; }
.stage.pv:not(.has-video) .tile-um { top: 0; left: 0; }
.chanview.with-stage:not(.vlay) .stage .controls { padding: 6px 12px 10px; }

/* Картка трансляції на весь екран (розгортається сама картка, не <video>: без нативних кнопок паузи) */
.tile:fullscreen { border-radius: 0; background: #000; outline: none; cursor: default; }
.tile:fullscreen video { object-fit: contain; }
.tile:fullscreen .tile-tools { display: flex; }
/* Перемикач «Звук демонстрації» */
.cbtn.sa-btn.na { opacity: .45; cursor: not-allowed; }

/* ── Фон профілю (ORBIT Premium): ОДИН цілісний фон на все вікно профілю — від верхнього краю до нижнього,
   позаду заголовка, аватара, тексту, кнопок і карток. Той самий шар (.p-bg) — у попередньому перегляді та в картці голосового каналу. ── */
.p-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; border-radius: inherit; background: var(--bg3) center / cover no-repeat; }
.p-bg video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* затемнення для читабельності: зверху легше (видно фон), донизу щільніше (текст і кнопки читаються) — у кольорі теми */
.p-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 34%, transparent) 0%, color-mix(in srgb, var(--bg2) 70%, transparent) 32%, color-mix(in srgb, var(--bg2) 84%, transparent) 100%); }
/* вікно профілю */
.modal.has-pbg { position: relative; isolation: isolate; overflow: hidden; }
.modal.has-pbg > :not(.p-bg) { position: relative; z-index: 1; }
.modal.has-pbg > .modal-head { background: transparent; }
.modal.has-pbg .profile .p-top .avatar { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bg2) 70%, transparent), 0 10px 30px rgba(0, 0, 0, .35); }
.modal.has-pbg .profile .p-name, .modal.has-pbg .profile .p-user, .modal.has-pbg .profile .p-bio, .modal.has-pbg .profile .p-row { text-shadow: 0 1px 2px color-mix(in srgb, var(--bg2) 70%, transparent); }
.modal.has-pbg .profile .alias-box, .modal.has-pbg .profile .modrow, .modal.has-pbg .profile .pm-cell, .modal.has-pbg .profile .pm-voice, .modal.has-pbg .profile .pm-file { background: color-mix(in srgb, var(--bg2) 72%, transparent); }
/* попередній перегляд у налаштуваннях — та сама картка, фон на всю її площу */
.profile.has-pbg { position: relative; isolation: isolate; }
.profile.has-pbg > *:not(.p-bg) { position: relative; z-index: 1; }
.pbg-prev .profile.pbg-preview.has-pbg > .p-top { padding-top: 64px; }
.pbg-box { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.pbg-prev .profile.pbg-preview { padding: 0 0 14px; border-radius: 18px; background: var(--bg2); border: 1px solid var(--line); min-height: 150px; }
.pbg-prev .profile.pbg-preview:not(.has-pbg) > .p-top { padding-top: 16px; }
.pbg-prev .profile.pbg-preview > .p-top { padding: 0 16px; display: flex; align-items: flex-end; gap: 12px; text-align: start; }
.profile.p-own, .btnrow.p-own { justify-content: center; }

/* ── Голосовий канал сервера — окремий режим: фон у стилі ORBIT, великі картки учасників одразу ── */
.chanview.vlay .stage {
  background:
    radial-gradient(120% 70% at 50% -12%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 62%),
    radial-gradient(70% 60% at 108% 112%, rgba(124, 140, 255, .11), transparent 64%),
    radial-gradient(60% 50% at -8% 105%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--bg1) 92%, #000), var(--bg0));
}
.chanview.vlay .stage::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .35), transparent 60%), radial-gradient(1px 1px at 78% 26%, rgba(255, 255, 255, .25), transparent 60%), radial-gradient(1.5px 1.5px at 64% 72%, rgba(255, 255, 255, .22), transparent 60%), radial-gradient(1px 1px at 30% 82%, rgba(255, 255, 255, .2), transparent 60%), radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, .25), transparent 60%); }
:root[data-theme="light"] .chanview.vlay .stage::before { display: none; }
.chanview.vlay .stage > * { position: relative; }
.chanview.vlay .stage .grid { gap: 16px; padding: 20px 22px 6px; align-content: center; justify-content: center; }
.chanview.vlay .stage:not(.has-video) .grid { display: grid !important; grid-template-rows: none !important; grid-auto-rows: auto; margin-inline: auto; width: 100%; }
.chanview.vlay .stage:not(.has-video) .grid[data-n="1"] { grid-template-columns: minmax(0, 640px) !important; }
.chanview.vlay .stage:not(.has-video) .grid[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 520px)) !important; }
.chanview.vlay .stage:not(.has-video) .grid[data-n="3"], .chanview.vlay .stage:not(.has-video) .grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 440px)) !important; }
.chanview.vlay .stage:not(.has-video) .grid[data-n="5"], .chanview.vlay .stage:not(.has-video) .grid[data-n="6"] { grid-template-columns: repeat(3, minmax(0, 360px)) !important; }
.chanview.vlay .stage:not(.has-video) .grid[data-many] { grid-template-columns: repeat(4, minmax(0, 300px)) !important; }
.chanview.vlay .stage .tile { aspect-ratio: 16 / 10; min-height: 0; border-radius: 20px; cursor: default;
  background: linear-gradient(160deg, color-mix(in srgb, var(--bg3) 88%, var(--accent)), color-mix(in srgb, var(--bg2) 92%, #000));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 12px 34px -18px rgba(0, 0, 0, .7); }
.chanview.vlay .stage .tile.screen, .chanview.vlay .stage .tile.cam { cursor: pointer; }
/* картка учасника на фоні ЙОГО профілю (той самий фон, що в профілі): на всю картку, позаду аватара й імені, із затемненням */
.chanview.vlay .stage .tile.has-pbg { isolation: isolate; }
.chanview.vlay .stage .tile.has-pbg > .p-bg.tile-bg { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.chanview.vlay .stage .tile.has-pbg > .p-bg.tile-bg::after { background: radial-gradient(60% 70% at 50% 45%, rgba(6, 9, 16, .18), rgba(6, 9, 16, .55) 100%), linear-gradient(180deg, rgba(6, 9, 16, .1), rgba(6, 9, 16, .55)); }
.chanview.vlay .stage .tile.has-pbg > :not(.p-bg) { position: relative; z-index: 1; }
.chanview.vlay .stage .tile.has-pbg > .tile-label, .chanview.vlay .stage .tile.has-pbg > .tile-tools, .chanview.vlay .stage .tile.has-pbg > .tile-um { position: absolute; z-index: 2; }
.chanview.vlay .stage .tile.has-pbg .tile-av .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .14), 0 12px 30px rgba(0, 0, 0, .45); }
.chanview.vlay .stage .tile.has-pbg.speaking .tile-av .avatar { box-shadow: 0 0 0 3px #3ddc6f, 0 0 26px rgba(61, 220, 111, .45); }
.chanview.vlay .stage .tile-av .avatar { width: clamp(72px, 9vw, 120px) !important; height: clamp(72px, 9vw, 120px) !important; font-size: clamp(30px, 3.8vw, 50px) !important; transition: box-shadow .15s; }
.chanview.vlay .stage .tile.speaking { outline-color: #3ddc6f; }
.chanview.vlay .stage .tile.speaking .tile-av .avatar { box-shadow: 0 0 0 3px #3ddc6f, 0 0 26px rgba(61, 220, 111, .35); }
.chanview.vlay .stage .tile-label { font-size: 14px; padding: 5px 11px; }
/* голосовий режим: праву панель учасників сервера ховаємо (учасники дзвінка — у центрі й під каналом) */
.app.vmode .members { display: none !important; }
@media (min-width: 900px) { .app.vmode { grid-template-columns: 72px 316px minmax(0, 1fr) 0 !important; } }
/* Своя трансляція: замість живого перегляду (він знімав би сам себе) — спокійна картка */
.tile.screen.mine-share { cursor: default; flex-direction: column; gap: 8px; color: var(--muted); font-size: 13.5px; text-align: center; padding: 12px; }
.tile.screen.mine-share .ms-ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.tile.screen.mine-share b { color: var(--text); font-size: 14.5px; }
.tile .p-bg video, .chanview.vlay .stage .tile .p-bg video { object-fit: cover; background: transparent; }
