/* =============================================
   Topbar — сквозная шапка над колонками
   ============================================= */
.topbar {
    display: none;
    height: var(--topbar-height);
    background: #131526;
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.topbar--visible { display: flex; }

body.topbar-visible .app-layout {
    height: calc(100vh - var(--topbar-height));
}

/* Кнопка-иконка ссылки на канал (mobile only) */
.btn--topbar-nav {
    position: relative;   /* якорь для угловой бирки непрочитанных .tv-unread-badge */
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: none;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition);
}
.btn--topbar-nav:hover { background: rgba(255,255,255,.2); color: #fff; }
.btn--topbar-nav svg   { width: 18px; height: 18px; }

/* На мобильном колонки должны занимать высоту layout, а не весь экран */
@media (max-width: 768px) {
    body.topbar-visible .app-layout {
        height: calc(min(100dvh, var(--kb-vh, 100000px)) - var(--topbar-height));
    }
    body.topbar-visible .col {
        height: calc(min(100dvh, var(--kb-vh, 100000px)) - var(--topbar-height));
        top: 0;
    }

    /* Мобилка: чуть крупнее топбар и кнопки (префикс .topbar-voice — чтобы
       выиграть по специфичности у базовых правил, идущих ниже по файлу) */
    :root { --topbar-height: 78px; }
    .topbar-voice .btn--topbar-nav,
    .topbar-voice .btn--topbar-mic,
    .topbar-voice .btn--topbar-spk,
    .topbar-voice .btn--topbar-lock,
    .topbar-voice .btn--topbar-spk-route { width: 50px; height: 50px; }
    .topbar-voice .btn--topbar-leave { width: 56px; height: 56px; }
    .topbar-voice .btn--topbar-leave .tv-quality { --tvq-r: 38px; }  /* кнопка крупнее — дуга дальше */
    .topbar-voice .btn--topbar-nav svg,
    .topbar-voice .btn--topbar-mic svg,
    .topbar-voice .btn--topbar-spk svg,
    .topbar-voice .btn--topbar-lock svg,
    .topbar-voice .btn--topbar-spk-route svg { width: 21px; height: 21px; }
    .topbar-voice .btn--topbar-leave svg { width: 30px; height: 30px; }
}

/* topbar — единый блок, контент через topbar-voice */
/* =============================================
     Topbar — голосовой индикатор
     ============================================= */
.topbar-voice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 12px;
    gap: 12px;
}
/* Только десктоп (≥769px): чуть больше отступ слева до кнопки-человечков.
   min-width не срабатывает на мобилке, поэтому там остаётся базовые 12px. */
@media (min-width: 769px) {
    .topbar-voice { padding-left: 18px; }
}
/* Только мобилка: правый отступ от края экрана на 4px меньше базовых 12px.
   Ставим ПОСЛЕ базового .topbar-voice, иначе база (идёт ниже) перекроет. */
@media (max-width: 768px) {
    .topbar-voice { padding-right: 8px; }
}

/* Левая часть: кнопка-человечки (переход в чат звонка) + зелёная точка + название */
.topbar-voice__left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Кнопка перехода в чат звонка — тот же бокс (прозрачный бордер), что у микрофона.
   Размеры здесь НЕ задаём, иначе они протекают в мобилку и ужимают кнопку:
   на десктопе базовые 44px (= микрофон), на мобилке 50px из мобильной медиа-секции
   (= остальные серые кнопки). */
.topbar-voice__left .btn--topbar-nav {
    border: 2px solid transparent;
}

/* Зелёная точка «в эфире» — без мигания; зазор справа от кнопки-человечков.
   Точка/название есть только на десктопе, поэтому это desktop-only по факту. */
.topbar-voice__live-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--color-green);
    flex-shrink: 0;
    margin-left: 14px;
}

/* Название-ссылка на чат звонка — лёгкое полупрозрачное подчёркивание */
.topbar-voice__chat-name {
    color: #a0aec0;
    font-size: 18px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(255,255,255,.25);
    text-underline-offset: 3px;
}
.topbar-voice__chat-name:hover {
    color: #fff;
    text-decoration-color: rgba(255,255,255,.5);
}

/* Иконка внутри кнопки #tvChatLink (человечки/чат) — центрируем, чтобы угловая бирка легла поверх */
.tv-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Жёлтая бирка непрочитанных на кнопке #tvChatLink справа-сверху:
   круг при одной цифре (min-width = height), пилюля при нескольких. Мерцает. */
.tv-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ffcc00;
    color: #2a2a2a;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    animation: tv-unread-pulse 2s ease-in-out infinite;
}
.tv-unread-badge[hidden] { display: none; }
@keyframes tv-unread-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .5; }
}

.topbar-voice__controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn--topbar-leave {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-red);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;      /* якорь для дуги-шкалы качества связи */
    margin-right: 22px;      /* место справа под дугу + отступ от края экрана */
    transition: background var(--transition);
}
.btn--topbar-leave:hover { background: color-mix(in srgb, var(--color-red) 85%, black); }
.btn--topbar-leave svg   { width: 24px; height: 24px; }

/* Дуга-шкала качества связи вокруг правой стороны кнопки «Отключиться».
   5 радиальных штрихов по сектору 90° (от +45° внизу до −45° вверху), снаружи кнопки.
   Оверлей точно совпадает с кнопкой (inset:0) → центр дуги = центр кнопки при любом размере. */
.tv-quality { position: absolute; inset: 0; pointer-events: none; --tvq-r: 35px; }
.tv-quality__seg {
    position: absolute;
    left: 50%; top: 50%;
    width: 4px; height: 7px;            /* узкий по радиусу, длинный вдоль дуги (по касательной) */
    margin-top: -3.5px;                 /* вертикально центрируем штрих на точке-центре */
    border-radius: 2px;
    transform-origin: left center;      /* вращаем вокруг центра кнопки */
    transform: rotate(var(--a)) translateX(var(--tvq-r));
    background: rgba(255,255,255,.28);
    transition: background var(--transition);
}
.tv-quality--l5 .tv-quality__seg--on,
.tv-quality--l4 .tv-quality__seg--on { background: var(--color-green); }
.tv-quality--l3 .tv-quality__seg--on { background: #eab308; }
.tv-quality--l2 .tv-quality__seg--on { background: #f97316; }
.tv-quality--l1 .tv-quality__seg--on { background: var(--color-red); }

.btn--topbar-mic {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), border-color var(--transition);
}
.btn--topbar-mic:hover       { background: rgba(255,255,255,.2); }
.btn--topbar-mic.muted       { background: rgba(220,38,38,.25); color: #fca5a5; border: 2px solid rgba(220,38,38,.6); }
.btn--topbar-mic.muted:hover { background: rgba(220,38,38,.4); }
/* «Я говорю» — дубль зелёного индикатора речи из кол-3, тот же зелёный glow + бордер. */
.btn--topbar-mic.speaking       { border-color: rgba(22,163,74,.9); box-shadow: 0 0 2px 4px rgba(22,163,74,.25); }
.btn--topbar-mic.speaking:hover { background: rgba(255,255,255,.2); }
.btn--topbar-mic svg         { width: 18px; height: 18px; }

/* =============================================
     Topbar — панель записи экрана (то же тёмное поле, своё содержимое)
     ============================================= */
.topbar-rec { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0 16px; gap: 12px; color: #e6e8f0; }
.topbar-rec__left { display: flex; align-items: center; gap: 24px; min-width: 0; }  /* корзина слева, отступ до точки */
.topbar-rec__info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-rec__label { font-size: 15px; font-weight: 500; color: #cbd2e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-rec__time { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; flex-shrink: 0; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--color-red); flex-shrink: 0; animation: rec-blink 1.2s ease-in-out infinite; }
.topbar-rec--stopped .rec-dot { animation: none; background: var(--color-green); }
.topbar-rec--paused .rec-dot  { animation: none; background: #fbbf24; }  /* на паузе — жёлтая, без мигания */
@keyframes rec-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.topbar-rec__controls { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
/* Кнопки записи — как в звонке: полупрозрачные с цветным бордером (кроме Стоп — сплошной красный). */
.btn--rec { width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; background: rgba(255,255,255,.1); color: #fff; transition: background var(--transition), border-color var(--transition), color var(--transition); }
.btn--rec:hover { background: rgba(255,255,255,.2); }
.btn--rec svg { width: 20px; height: 20px; }
/* Стоп — сплошной красный и КРУПНЕЕ (как «Отключиться» в звонке). */
.btn--rec-stop { width: 50px; height: 50px; background: var(--color-red); }
.btn--rec-stop:hover { background: color-mix(in srgb, var(--color-red) 85%, black); }
.btn--rec-stop svg { width: 24px; height: 24px; }
/* Корзина — без цвета, красный намёк на ховере. */
.btn--rec-trash:hover { background: rgba(220,38,38,.2); color: #fca5a5; border-color: rgba(220,38,38,.6); }
/* Пауза — без цвета, жёлтая на ховере. */
.btn--rec-pause:hover { background: rgba(251,191,36,.2); color: #fbbf24; border-color: rgba(251,191,36,.6); }
/* Плей (на паузе) — голубая (как есть). */
.btn--rec-play { background: rgba(56,189,248,.2); color: #38bdf8; border-color: rgba(56,189,248,.6); }
.btn--rec-play:hover { background: rgba(56,189,248,.35); }
/* Готово — без цвета, зелёная на ховере. */
.btn--rec-done:hover { background: color-mix(in srgb, var(--color-green) 22%, transparent); color: var(--color-green); border-color: color-mix(in srgb, var(--color-green) 55%, transparent); }
/* Стоп залочен на время отсчёта — серый, некликабельный. */
.btn--rec-stop--off, .btn--rec-stop--off:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.35); cursor: not-allowed; }

/* Заглушка на старте записи: белый полупрозрачный блюр поверх контента, ПОД топбаром
   (начинается на высоте топбара, поэтому его не перекрывает). Как попап звонка, но белая. */
.rec-overlay {
  position: fixed;
  top: var(--topbar-height); left: 0; right: 0; bottom: 0;
  z-index: 8000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.92);
}
.rec-overlay__count { font-size: 160px; font-weight: 700; line-height: 1; color: #1a2036; font-variant-numeric: tabular-nums; }
.rec-overlay__count--prep { font-size: 28px; font-weight: 500; opacity: .8; }
.rec-overlay__close { display: inline-flex; align-items: center; gap: 10px; padding: 14px 30px 13px; border-radius: 999px; border: none; cursor: pointer; background: rgba(20,25,45,.1); color: #1a2036; font-size: 18px; font-weight: 400; }
.rec-overlay__close:hover { background: rgba(20,25,45,.18); }
.rec-overlay__close svg { width: 24px; height: 24px; }
@media (max-width: 768px) { .rec-overlay__count { font-size: 120px; } }
@media (max-width: 768px) {
  .topbar-rec .btn--rec { width: 50px; height: 50px; }
  .topbar-rec .btn--rec svg { width: 22px; height: 22px; }
  .topbar-rec .btn--rec-stop { width: 56px; height: 56px; }         /* как «Отключиться» на мобилке */
  .topbar-rec .btn--rec-stop svg { width: 28px; height: 28px; }
}


/* =============================================
     Chat header — voice badge + voice btn
     ============================================= */
.chat-header__members-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

.voice-badge {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-green);
    white-space: nowrap;
    padding-left: 2px;
    line-height: 1;
}

.btn--voice-active {
    color: #dc2626;
}
.btn--voice-active:hover { background: rgba(220,38,38,.08); }

/* =============================================
     Incoming call modal
     ============================================= */
/* Входящий звонок — полноэкранный стиль как у экрана будильника
   (тёмно-синий фон, белый текст, крупные элементы). */
.call-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(10, 14, 30, .92);
}

.call-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    color: #fff;
    animation: call-modal-in 220ms ease;
}

@keyframes call-modal-in {
    from { opacity: 0; transform: scale(.9); }
    to   { opacity: 1; transform: scale(1); }
}

.call-modal__icon {
    color: var(--color-green, #22c55e);
    transform-origin: 50% 60%;
    animation: call-ring-shake 1s ease-in-out infinite;
}
.call-modal__icon svg { width: 58px; height: 58px; }

@keyframes call-ring-shake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-6deg); }
    80% { transform: rotate(4deg); }
}

/* Список участников голосового канала — «мёртвый» снимок. Белый фон, чтобы цвета
   отделов у имён читались; ограниченная высота с прокруткой. Без аватаров/статусов. */
.call-modal__members {
    margin: 14px 0 22px;
    width: min(320px, 78vw);
    max-height: 290px;
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 13px 0;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
    /* скролл остаётся, но полосу прокрутки прячем (выглядит грубо) */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE/Edge */
}
.call-modal__members::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* WebKit/WebView */
.call-modal__members[hidden] { display: none; }
.call-modal__member {
    padding: 6px 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Инфо о звонке (режим «требовать описание») — над списком собеседников: бирка срочности + тема. */
.call-modal__callinfo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 2px 16px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eef0f4;
    text-align: center;
}
.call-modal__badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.call-modal__urg {
    flex: 0 0 auto;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}
.call-modal__urg--low      { background: #e4e7ee; color: #3a3f4a; }              /* Несрочно — серый */
.call-modal__urg--medium   { background: #ffe6a8; color: #6b4a00; }              /* Среднесрочно — жёлтый */
.call-modal__urg--urgent   { background: var(--color-red); color: #fff; }        /* Срочно — красный */
.call-modal__urg--extreme  { background: #1e1e1e; color: #fff; }                 /* Экстренно — чёрный */
.call-modal__urg--reminder { background: #17b8cf; color: #fff; }                 /* Напоминаю — бирюзовый */
.call-modal__topic {
    font-size: 15px;
    color: #1f2937;
    font-weight: 400;
    line-height: 1.3;
    white-space: normal;      /* многострочно — длинная тема переносится */
    overflow-wrap: anywhere;
    text-align: center;
}

/* Один звонящий — не список, а просто имя: без белого фона, крупно, белым (как раньше).
   Контейнер под имя — почти во всю ширину экрана (отступы от краёв даёт padding:24px у оверлея),
   на десктопе ограничен. Так длинное имя не жмётся в узкую колонку. */
.call-modal__members--single {
    background: none;
    box-shadow: none;
    padding: 0;
    max-height: none;
    overflow: visible;
    width: calc(100vw - 48px);
    max-width: 560px;
    box-sizing: border-box;
}
.call-modal__members--single .call-modal__member {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    white-space: normal;   /* длинное имя переносим, а не режем */
    overflow: visible;
    text-overflow: clip;
}

.call-modal__actions {
    display: flex;
    gap: 44px;
    margin-top: 0;
}

.call-modal__btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background var(--transition), transform var(--transition);
}
.call-modal__btn:active { transform: scale(.93); }
.call-modal__btn svg    { width: 28px; height: 28px; }

.call-modal__btn--accept  { background: var(--color-green); }
.call-modal__btn--accept:hover  { background: color-mix(in srgb, var(--color-green) 85%, black); }

.call-modal__btn--decline { background: var(--color-red); }
.call-modal__btn--decline:hover { background: color-mix(in srgb, var(--color-red) 85%, black); }

/* Кнопка-иконка «без звука» под кнопками приёма/отклонения — глушит рингтон, модалка остаётся */
.call-modal__mute {
    margin-top: 24px;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .8);
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition);
}
.call-modal__mute svg { width: 24px; height: 24px; display: block; }
.call-modal__mute:hover { background: rgba(255, 255, 255, .2); }
.call-modal__mute--off { opacity: .4; cursor: default; }

.member-row__call-btn {
    margin-left: auto;
    color: var(--color-green);
    flex-shrink: 0;
}
.member-row__call-btn:hover { background: rgba(22,163,74,.1); }

/* Идёт дозвон (блокировка): полупрозрачный оранжевый фон + оранжевый счётчик, кнопка
   заблокирована. Идёт ПОСЛЕ базового .member-row__call-btn, поэтому оранжевый выигрывает
   у зелёного при равной специфичности. opacity:1 перебивает тусклый вид disabled-кнопок. */
.member-row__call-btn--ringing,
.member-row__call-btn--ringing:hover {
    background: rgba(249,115,22,.15);
    color: #f97316;
    opacity: 1 !important;
    cursor: default;
}
.member-row__call-btn--ringing .member-row__call-count { color: #f97316; }

.member-row__name-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.member-row__voice-time {
    font-size: 11px;
    color: var(--color-green);
    font-weight: 500;
    line-height: 1.2;
    /* Фиксированное место под счётчик (3 цифры + « м») — чтобы шкалы связи вставали ровно в столбик,
       а не «плавали» от числа минут. tabular-nums — одинаковая ширина цифр. */
    display: inline-block;
    min-width: 34px;
    font-variant-numeric: tabular-nums;
}
/* Подпись « м» — как в кабинете (блёклая, opacity .4); единообразно во всех счётчиках */
.member-row__voice-time::after,
.contact-voice-time::after,
.member-row__call-total::after {
    content: ' м';
    font-weight: 400;
    opacity: .4;
}

/* Отключённый участник созвона — суммарное время в этом созвоне: светло-серым, тот же
   формат «N м». Живого тика нет (значение зафиксировано завершившейся сессией). */
.member-row__call-total {
    position: relative;
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    line-height: 1.2;
    cursor: default;
}
/* Мгновенная подсказка при наведении — через ::before (::after занят подписью « м»). */
@media (hover: hover) {
    .member-row__call-total[data-tip]:hover::before {
        content: attr(data-tip);
        position: absolute;
        left: 0;
        bottom: calc(100% + 6px);
        background: #1a1c22;
        color: #fff;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.3;
        white-space: nowrap;
        box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
        pointer-events: none;
        z-index: 10000;
    }
}
/* Строка под именем: иконка «зачёркнутый чат» (гость) + счётчик длительности */
.member-row__voice-line {
    display: flex;
    align-items: center;
    gap: 4px;
}
/* Шкала связи участника с сервером: 5 делений 6×3px, зазор 2px. Активные — цветом по уровню. */
.sig-bar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;   /* отступ от счётчика времени (сверх gap строки) */
}
.sig-bar__seg {
    width: 6px;
    height: 2px;
    border-radius: 2px;   /* закруглённые деления */
    background: rgba(127, 127, 127, .35);   /* неактивное деление — блёклое, читается на любом фоне */
}
.sig-bar--bad  .sig-bar__seg--on { background: var(--color-red); }
.sig-bar--mid  .sig-bar__seg--on { background: #e8a20c; }
.sig-bar--good .sig-bar__seg--on { background: var(--color-green); }
.member-row__guest-mark {
    display: flex;
    align-items: center;
    color: var(--color-text-muted);
}
.member-row__guest-mark svg { width: 12px; height: 12px; }

/* =============================================
     Contacts — voice state
     ============================================= */
.contact-item__name-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.contact-voice-mic {
    display: flex;
    align-items: center;
    flex: 0 0 14px;
    color: var(--color-green);
}
.contact-voice-mic svg { width: 14px; height: 14px; }

.contact-voice-mic--muted { color: var(--color-red) !important; }

.contact-voice-time {
    font-size: 11px;
    color: var(--color-green);
    font-weight: 500;
    line-height: 1.2;
}

/* Toast */
.contacts-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1c22;
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    z-index: 9999;
    pointer-events: none;
    animation: toast-in 200ms ease;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* =============================================
   Voice bar (col3)
   ============================================= */
.voice-bar { padding: 8px 8px; margin-bottom: 5px; display: flex; flex-direction: column; gap: 6px; }

.btn--voice,
.btn--voice-leave {
  width: 100%;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  border: none;
}
.btn--voice svg,
.btn--voice-leave svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--voice        { background: var(--color-green); color: #fff; }
.btn--voice:hover  { background: color-mix(in srgb, var(--color-green) 85%, black); }

.btn--voice-leave       { background: var(--color-red); color: #fff; }
.btn--voice-leave:hover { background: color-mix(in srgb, var(--color-red) 85%, black); }

/* Кнопка «Люди» в шапке чата (col-2) — по стилю как «Позвонить всем»: лёгкий фон
   primary, текст primary, без иконки, компактная. На десктопе скрыта (col-3 всегда видна). */
.btn--people {
  background: color-mix(in srgb, var(--color-primary) 5%, transparent);
  color: var(--color-primary);
  border: none;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  flex-shrink: 0;
}
.btn--people:hover { background: color-mix(in srgb, var(--color-primary) 12%, transparent); }
/* Кнопка «Люди» (блок участников) — только на мобилке. На десктопе col-3 всегда видна.
   Селектор с .chat-header для специфичности: в chat.css (грузится позже) есть
   .chat-header__members-wrap { display: inline-flex }, которое иначе перебивает display:none. */
@media (min-width: 769px) {
  .chat-header .chat-header__members-wrap { display: none; }
}

/* Ряд под "Отключиться": слева «Добавить собеседников» (созвоны), справа «Позвонить всем». */
.voice-bar__actions { display: flex; align-items: center; gap: 8px; }
.voice-bar__actions .btn--add-members-list { margin: 0; flex: 0 0 auto; }  /* убираем прежний отступ top-of-list */
.btn--voice-call-all       { background: color-mix(in srgb, var(--color-primary) 5%, transparent); color: var(--color-primary); width: auto; flex: 0 0 auto; gap: 6px; margin: 0 0 0 auto; }  /* лёгкий фон; размер по содержимому, прижать вправо */
.btn--voice-call-all:hover { background: color-mix(in srgb, var(--color-primary) 16%, transparent); }
.btn--voice-call-all svg   { width: 16px; height: 16px; flex-shrink: 0; }

/* =============================================
   Member row — voice timer
   ============================================= */
.member-row__name-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.member-row__voice-time {
  font-size: 11px;
  color: var(--color-green);
  font-weight: 500;
  line-height: 1.2;
}

/* =============================================
   Contacts — voice state
   ============================================= */
.contact-item__name-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.contact-voice-mic     { display: flex; align-items: center; flex: 0 0 14px; color: var(--color-green); }
.contact-voice-mic svg { width: 14px; height: 14px; }

.contact-voice-time {
  font-size: 11px;
  color: var(--color-green);
  font-weight: 500;
  line-height: 1.2;
}

/* =============================================
   Toast
   ============================================= */
.contacts-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1c22;
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  animation: toast-in 200ms ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* =============================================
   Member row — mic muted
   ============================================= */

/* Lock button in topbar */
.btn--topbar-lock {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #a0aec0;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--topbar-lock:hover  { background: rgba(255,255,255,.2); color: #fff; }
.btn--topbar-lock.locked { background: rgba(251,191,36,.2); color: #fbbf24; border: 2px solid rgba(251,191,36,.6); }
.btn--topbar-lock.locked:hover { background: rgba(251,191,36,.35); }
.btn--topbar-lock svg    { width: 18px; height: 18px; }

/* Locked notice above join button */
.voice-locked-notice {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #f59e0b;
  padding: 4px 8px;
  background: rgba(245,158,11,.1);
  border-radius: var(--radius-sm);
  justify-content: center;
}

.btn--topbar-spk-route {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 2px solid transparent;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--topbar-spk-route:hover  { background: rgba(255,255,255,.2); color: #fff; }
.btn--topbar-spk-route.spk-ear    { background: rgba(56,189,248,.2); color: #38bdf8; border-color: rgba(56,189,248,.6); }
.btn--topbar-spk-route.spk-ear:hover { background: rgba(56,189,248,.35); }
.btn--topbar-spk-route.spk-loud   { background: rgba(49,179,125,.2); color: #31b37d; border-color: rgba(49,179,125,.6); }
.btn--topbar-spk-route.spk-loud:hover { background: rgba(49,179,125,.35); }
.btn--topbar-spk-route.spk-bt     { background: rgba(99,102,241,.22); color: #818cf8; border-color: rgba(99,102,241,.6); }
.btn--topbar-spk-route.spk-bt:hover { background: rgba(99,102,241,.35); }
.btn--topbar-spk-route svg    { width: 18px; height: 18px; }

/* Поповер выбора аудио-маршрута (Bluetooth / громкая / наушник) */
.spk-route-popover {
    position: fixed;
    z-index: 10000;
    background: #131526;
    border: none;
    border-radius: 0 0 12px 12px;
    padding: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 190px;
}
.spk-route-popover__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #cbd5e1;
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    text-align: left;
}
.spk-route-popover__item:hover  { background: rgba(255,255,255,.08); color: #fff; }
.spk-route-popover__item.active { background: rgba(255,255,255,.14); color: #fff; }
.spk-route-popover__icon        { display: flex; flex-shrink: 0; }
.spk-route-popover__icon svg    { width: 18px; height: 18px; }

/* ── Общая бирка срочности звонка в топбаре (десктоп) ──────────────────────── */
.topbar-voice__urg {
    flex: 0 0 auto;
    margin-left: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 2px solid transparent;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.topbar-voice__urg:hover        { background: rgba(255,255,255,.2); }
/* Заданная бирка — сплошная заливка по степени (те же цвета, что в call-modal) */
.topbar-voice__urg--medium   { background: #ffe6a8; color: #6b4a00; }
.topbar-voice__urg--medium:hover  { background: #ffdd8c; }
.topbar-voice__urg--urgent   { background: var(--color-red); color: #fff; }
.topbar-voice__urg--urgent:hover  { background: var(--color-red); filter: brightness(1.08); }
.topbar-voice__urg--extreme  { background: #1e1e1e; color: #fff; border-color: rgba(255,255,255,.4); }
.topbar-voice__urg--extreme:hover { background: #2c2c2c; }

/* Меню выбора срочности — пункты-плашки по цвету степени */
.topbar-urg-popover { min-width: 150px; }
.topbar-urg-popover__item {
    width: 100%;
    padding: 9px 12px;
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    cursor: pointer;
}
.topbar-urg-popover__reset {
    background: transparent;
    color: #cbd5e1;
}
.topbar-urg-popover__reset:hover { background: rgba(255,255,255,.08); color: #fff; }
.topbar-urg-popover__item.active { outline: 2px solid rgba(255,255,255,.55); outline-offset: -2px; }

.btn--topbar-spk {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.btn--topbar-spk:hover      { background: rgba(255,255,255,.2); }
.btn--topbar-spk.muted      { background: rgba(220,38,38,.25); color: #fca5a5; border: 2px solid rgba(220,38,38,.6); }
.btn--topbar-spk.muted:hover { background: rgba(220,38,38,.4); }
.btn--topbar-spk svg        { width: 19px; height: 19px; }