/* Общие стили */
*, *::before, *::after {
    box-sizing: border-box;      /* Глобально: padding и border не увеличивают размеры */
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* iOS Safari fix */
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden; /* Запрещаем скролл за пределы */
    color: #5F6368;
    background-color: #FFFFFF;
}

.phone-frame {
    /* Используем ширину и высоту экрана за вычетом 20px отступов по краям */
    width: calc(100vw - 20px);  /* Ширина: 100% ширины окна минус 20px (по 10px с каждой стороны) */
    height: calc(100vh - 20px); /* Высота: 100% высоты окна минус 20px (по 10px с каждой стороны) */
    
    /* Визуальные стили рамки устройства */
    border: 8px solid black;       /* Чёрная рамка толщиной 8 пикселей */
    border-radius: 36px;           /* Скруглённые углы для стилизации под смартфон */
    
    /* Внутренний отступ и расчёт размеров */
    padding: 10px;                 /* Внутренний отступ внутри phone-frame */
    box-sizing: border-box;        /* Включаем padding и border в расчёт итоговой ширины и высоты */
    
    /* Цвет фона устройства */
    background-color: #fff;        /* Белый фон внутри экрана телефона */
    
    /* Настройка сетки для размещения всех контейнеров */
    display: grid;                 /* Используем CSS Grid Layout для разметки элементов */
    
    /* === ВАЖНО: Одна колонка на всю ширину === */
    grid-template-columns: 1fr;    /* Одна колонка, занимает 100% ширины */
    justify-items: stretch;        /* Элементы растягиваются на всю ширину колонки */
    
    /* Определяем строки сетки (9 контейнеров) */
    grid-template-rows: 
        auto                      /* Контейнер 1: Баннер (авто высота) */
        auto                      /* Контейнер 2, 3, 4: Горизонтальная линия (авто высота) */
        auto                      /* Контейнер 5: Имя собеседника */
        auto                      /* Контейнер 6: Описание */
        auto                      /* Контейнер 7: Кнопка вызова */
        1fr                       /* Контейнер 8: Нижний блок (занимает оставшееся место) */
        auto;                     /* Контейнер 9: Подвал */
    
    /* Расстояние между строками сетки */
    gap: 2px;                    /* Отступ между контейнерами 10px */
    
    /* Позиционирование и ограничение содержимого */
    position: relative;           /* Для позиционирования вложенных элементов */
/*    overflow: visible;  чтобы выпадающее меню не пряталось */

    max-width: 340px;
    overflow: hidden;
}



/* Общий контейнер для всех элементов */
.container {
/*
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
*/
}



/* Контейнер 1: Генеральный хедер */
.header-general {
    width: 94%;                  /* Ширина 94% */
    height: 50px;               /* Высота  */
    background-color: #fbfbfb;  /* Цвет #FBFBFB */
    display: flex;              /* Flexbox для расположения элементов */
    align-items: center;        /* Вертикальное центрирование */
    justify-content: space-between; /* Распределение по сторонам */
    margin: 0 auto;             /* Центрирование в родителе */
    margin-top: 10px;           /* Отступ сверху */
    margin-bottom: 10px;        /* Отступ снизу */
    border-radius: 12px;        /* Скругленные углы */
    box-sizing: border-box;
    padding: 0 10px;            /* Внутренние отступы */
}

/* Левая секция с логотипом */
.header-logo-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Логотип в хедере */
.header-logo {
    width: 49px;
    height: 49px;
    border-radius: 8px;
    border: none;
        width: 34px; /* увеличен размер динамика */
        height: 34px;
        /* Сдвиг вправо: подберите значение при визуальной проверке */
        transform: translateX(6px);
    box-shadow: none;
}

/* Центральный пустой div */
.header-center {
    flex: 1;                    /* Занимает оставшееся место */
}

/* Правая секция с иконкой пользователя */
.header-user-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #F3F3F3;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.header-user-icon:hover {
    background-color: #E8E8E8;
}

.header-user-icon svg {
    width: 24px;
    height: 24px;
}

/* Правая секция с иконками (user + share) */
.header-right-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Кнопка Поделиться */
.header-share-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #F3F3F3;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.header-share-btn:hover {
    background-color: #E8E8E8;
}

.header-share-btn svg {
    width: 22px;
    height: 22px;
}

/* ========================================
   Share Modal
   ======================================== */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.share-modal-overlay.active {
    display: flex;
}

.share-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: shareModalIn 0.25s ease-out;
}

@keyframes shareModalIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.share-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.share-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.share-modal-close:hover {
    color: #333;
}

.share-modal-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 12px;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.share-option:hover {
    transform: scale(1.05);
}

.share-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-icon svg {
    width: 26px;
    height: 26px;
}

.share-icon.whatsapp {
    background: #25D366;
}

.share-icon.telegram {
    background: #0088cc;
}

.share-icon.viber {
    background: #7360f2;
}

.share-icon.messenger {
    background: linear-gradient(180deg, #00B2FF 0%, #006AFF 100%);
}

.share-icon.sms {
    background: #34C759;
}

.share-icon.email {
    background: #EA4335;
}

.share-icon.copy {
    background: #666;
}


/* Контейнер 2, 4, 3: Горизонтальная линия с выравниванием */
.top-bar {
    width: 100%;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
    padding: 5px 0;
    margin-bottom: 0;
    box-sizing: border-box;
    gap: 8px;
}

.top-bar > * {
    flex-shrink: 0;
    flex-grow: 0;
}

/* Контейнер 3: Телефонный номер */
.phone-number {
    height: 60px;
    font-size: 20px;
    line-height: 60px;
    text-align: center;
    flex-grow: 1;
    text-align: center;
    font-style: italic;
    color: gray;
}

/* Контейнер 4: Переключатель языка */















/* Контейнер 5: Имя собеседника */
.contact-name {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    height: 40px;
    line-height: 70px;
    margin-top: 0; /* Убираем отступ сверху */
    padding-top: 0; /* Убираем внутренний отступ сверху */
}


/* Контейнер 6: Описание собеседника */
.contact-description {
    font-size: 12px;
    color: gray;
    text-align: left;
    padding: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.2;
/*    width: 60%;*/
}

/* Контейнер 7: Кнопка вызова */
.call-button {
    display: flex;
    flex-direction: column; /* Элементы располагаются вертикально */
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.call-button button {
    width: 60%;
    height: 60px;
    font-size: 16px;
    font-weight: 500;
    background-color: #1F2937;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    transition: all 0.2s ease;
}

.call-button button:hover {
    background-color: #111827;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
}

/* Контейнер 8: Нижний блок */
.extra-info {
    width: 50%; /* Та же ширина, что и у кнопки ВЫЗОВ */
    height: auto;
    border: 0px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto; /* Центрирование */
    margin-top: 8px; /* Отступ от кнопки */
    font-size: 13px;
    color: #80868B;
}


/* Контейнер 9: Подвал */
/* Основной контейнер футера */
.footer {
    text-align: center;
    height: 360px; 
    display: flex;
    flex-direction: column;
    position: relative;  /* Для абсолютного позиционирования индикатора */
    width: 94%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0;
    position: absolute;
    bottom: -230px;
    background-color: #FFFFFF;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1), 0 -4px 12px rgba(0, 0, 0, 0.08);
    transition: bottom 0.3s ease;
    padding: 12px;
    box-sizing: border-box;
    border-top: 1px solid #DADCE0;
}

/* Верхняя полоска (неактивная) - draggable для подъёма футера */
.inactive-bar {
    width: 90%;
    height: 8px;
    background-color: #DADCE0;
    border-radius: 4px;
    margin: 0 auto 20px;
    cursor: grab;
    position: relative;
    z-index: 100;
    /* Увеличиваем кликабельную область через псевдоэлемент */
}

.inactive-bar::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    bottom: -10px;
}

.inactive-bar:active {
    cursor: grabbing;
}

/* Блок с кнопкой вызова и микрофоном */
.button-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;  /* Равномерное распределение: края прижаты, центр посередине */
    align-items: center;
    margin-bottom: 20px;
    min-height: 70px;
    padding: 0 8%;                   /* Отступы от краев footer */
}

/* Левый блок: индикатор речи бота — стиль как у микрофона */
.side-box-left {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #9CA3AF; /* Тот же серый что и micIcon.inactive */
    border: none;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Тонкое радужное кольцо (конусный градиент) вокруг круга, соответствует цветам логотипа */
.side-box-left::before {
    /* Отключено: убираем радужные дуги сверху/снизу */
    display: none;
}

/* Ensure inner content (icon, meter) sits above the ring */
.side-box-left > .voice-indicator { position: relative; z-index: 2; }

.voice-indicator {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.voice-indicator.active .voice-idle {
    opacity: 0;
    transform: scale(0.85);
}

.voice-indicator.active .voice-wave {
    opacity: 1;
    transform: scale(1);
}

/* Сделать фон круга белым, когда индикатор активен (бот говорит) */
.voice-indicator.active {
    background: #ffffff;
    border-radius: 50%;
    transition: background 0.25s ease;
}

.voice-idle {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white; /* Белая иконка на сером фоне, как микрофон */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.speaker-icon {
    width: 28px;
    height: 28px;
    display: block;
}

.speaker-slash {
    /* не используется, слэш задан inline */
}

/* Mic SVG styling */
.mic-svg {
    width: 28px;
    height: 28px;
    display: block;
    color: white;
}

/* Active mic: пульсация сохраняется через родительский #micIcon */
#micIcon.inactive .mic-svg { color: white; }
#micIcon.active .mic-svg { color: white; }

.voice-wave {
    position: absolute;
    /* inset: 8px; Убираем, чтобы использовать всё пространство 55px блока (минус паддинг родителя) */
    width: 100%;
    height: 100%;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

/* Круговой бар-метр */

.circle-meter {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

/* Параметры метра: --bar-w (ширина палочки), --radius (радиус от центра) */
.circle-meter .circle-bar {
    --s: 0.12; /* scaleY */
    --rot: 0deg; /* rotation */
    position: absolute;
    
    /* Центрирование: размещаем в центре контейнера */
    left: 50%;
    top: 50%;
    width: var(--bar-w, 2px);
    height: var(--bar-h, 14px);
    
    /* Сдвиг на половину ширины влево для точного центра */
    margin-left: calc(var(--bar-w, 2px) / -2);
    /* Сдвиг вверх на половину высоты, чтобы центр вращения был по центру палочки (перед сдвигом) */
    margin-top: calc(var(--bar-h, 14px) / -2);

    border-radius: 2px;
    
    /* Логика трансформации: 
       1. rotate: поворачиваем на угол
       2. translate Y: сдвигаем "вверх" от центра (отдаляем от центра круга)
       3. scaleY: масштабируем
    */
    transform: rotate(var(--rot)) translateY(calc(-1 * var(--radius, 16px))) scaleY(var(--s));
    
    transform-origin: center center; /* Вращаем вокруг собственного центра, остальное делает translate */
    
    transition: transform 200ms cubic-bezier(.2,.8,.2,1);
    will-change: transform;
    opacity: 0.9;
}

/* При активном состоянии делаем цвета ярче */
.voice-indicator.active .circle-bar { box-shadow: 0 2px 6px rgba(241, 245, 255, 0.12) inset; }

.voice-indicator.active .voice-idle { opacity: 0; transform: scale(0.85); }
.voice-indicator.active .voice-wave { opacity: 1; transform: scale(1); }

/* Небольшое затемнение в idle состоянии */
.voice-indicator .circle-bar { background: linear-gradient(180deg, #cfe9ff, #aacfff); }
.voice-indicator.active .circle-bar { background: linear-gradient(180deg, #6fb3ff, #2f6efb); }
.wave-bar:nth-child(12)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(13)  { height: 32px; background: #34d399; animation-delay: 0.44s; }
.wave-bar:nth-child(14)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(15)  { height: 8px;  background: #2f6efb; animation-delay: 0s; }
.wave-bar:nth-child(16)  { height: 12px; background: #2f6efb; animation-delay: 0.12s; }
.wave-bar:nth-child(17)  { height: 16px; background: #24c6f7; animation-delay: 0.2s; }
.wave-bar:nth-child(18)  { height: 22px; background: #24c6f7; animation-delay: 0.28s; }
.wave-bar:nth-child(19)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(20)  { height: 32px; background: #34d399; animation-delay: 0.44s; }
.wave-bar:nth-child(21)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(22)  { height: 8px;  background: #2f6efb; animation-delay: 0s; }
.wave-bar:nth-child(23)  { height: 12px; background: #2f6efb; animation-delay: 0.12s; }
.wave-bar:nth-child(24)  { height: 16px; background: #24c6f7; animation-delay: 0.2s; }
.wave-bar:nth-child(25)  { height: 22px; background: #24c6f7; animation-delay: 0.28s; }
.wave-bar:nth-child(26)  { height: 28px; background: #34d399; animation-delay: 0.36s; }
.wave-bar:nth-child(27)  { height: 32px; background: #34d399; animation-delay: 0.44s; }
.wave-bar:nth-child(28)  { height: 28px; background: #34d399; animation-delay: 0.36s; }

@keyframes wavePulse {
    0%, 100% { transform: scaleY(0.65); opacity: 0.5; }
    50% { transform: scaleY(1.2); opacity: 1; }
}

/* Квадратные кнопки */
.square-button {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background-color: #c3ffc3;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    /* border: 1px solid black; */
    cursor: pointer;
    color: gray;
}

.round-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #ff8e8e; /*red;*/
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.round-button svg {
    width: 32px;
    height: 32px;
    transform: rotate(135deg); /* Перевёрнутая трубка */
}

/* === КНОПКА ВЫЗОВА С ТРЕМЯ СОСТОЯНИЯМИ === */
.call-action-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.call-action-btn:hover {
    transform: scale(1.05);
}

.call-action-btn:active {
    transform: scale(0.95);
}

.call-action-btn svg {
    width: 32px;
    height: 32px;
    display: none;
}

/* Картинка для вращающейся анимации состояния "ожидание вызова" */
.calling-spinner-img {
    width: 49px;
    height: 49px;
    display: none;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Состояние 1: Готов к звонку (голубая) */
.call-action-btn.state-ready {
    background: #1A73E8;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.3), 0 1px 3px rgba(26, 115, 232, 0.2);
}

.call-action-btn.state-ready .icon-call {
    display: block;
}

.call-action-btn.state-ready:hover {
    background: #0D47A1;
    box-shadow: 0 3px 8px rgba(26, 115, 232, 0.4), 0 2px 4px rgba(26, 115, 232, 0.3);
}

/* Состояние 2: Идёт вызов (светлый фон с тенью) */
.call-action-btn.state-calling {
    background: #FFFFFF;
    cursor: pointer;
}

.call-action-btn.state-calling .icon-waiting {
    display: block;
}

.call-action-btn.state-calling .calling-spinner-img {
    display: block;
}

/* Состояние 3: Разговор (красная) */
.call-action-btn.state-active {
    background: #E85D75;
    box-shadow: 0 2px 6px rgba(232, 93, 117, 0.3), 0 1px 3px rgba(232, 93, 117, 0.2);
}

.call-action-btn.state-active:hover {
    background: #DC4C62;
}

.call-action-btn.state-active .icon-hangup {
    display: block;
    transform: rotate(135deg); /* Перевёрнутая трубка = отбой */
}








/* Контейнер с активными ссылками */
.link-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; 
    gap: 10px; 
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    color: #80868B;
    font-size: 13px;
}

/* Левый блок с текстом: текст выровнен по левому краю */
.fut_l {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Выровнять текст по левому краю */
    gap: 6px;
    font-size: 11px;
    color: gray;
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* Правый блок с текстом: текст выровнен по правому краю */
.fut_p {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Выровнять текст по правому краю */
    gap: 6px;
    font-size: 11px;
    color: gray;
    flex: 1;
    min-width: 0;
    text-align: right;
}

/* Вертикальная полоса */
.fut_line {
    width: 2px;
    height: 100%;
    background-color: gray;
    flex-shrink: 0;
}

/* Стили для ссылок */
.link-button {
    text-decoration: underline;
    color: gray;
    font-weight: bold;
}

/* Стили для баланса */
.balance {
    font-weight: bold;
    color: #2a7d2a;
    font-size: 13px;
}


.milaf {
    text-decoration: underline;
    color: black;
    font-weight: bold;
    font-size: 10px;
    color: gray;
}





/* Нижний блок с пятью иконками */
.bottom-icons {
    display: flex;
    justify-content: center; /* Центрирование иконок */
    gap: 15px; /* Равномерные отступы между иконками */
    padding-top: 10px;
    border-top: 2px solid black;
    margin-top: 10px;
}

.icon-box {
    width: 50px;
    height: 50px;
    border: 1px solid black;
    border-radius: 10px;
}

/* Активный класс: футер полностью выехал */
.footer.active {
    bottom: 0;
}

/* Добавим стиль, когда футер возвращается */
.footer.returning {
    transition: bottom 0.5s ease-in; /* Плавный возврат */
}







.green {
    background-color: #28a745 !important;
    color: white !important;
}

.yellow {
    background-color: #ffc107 !important;
    color: black !important;
}

.red {
    background-color: #dc3545 !important;
    color: white !important;
}




#micContainer {
    /* Правый элемент в flex space-between */
    width: 55px;
    height: 55px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
}

#micContainer.fade-out {
    opacity: 0.3;
}

#micIcon {
    width: 55px;              /* Немного меньше для вписывания */
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

#micIcon.inactive {
    background-color: #9CA3AF;
}

#micIcon.active {
    background-color: #1A73E8;
    animation: pulse-mic 1.5s infinite;
}

#micIcon.disabled {
    background-color: #9CA3AF;
}

/* Анимация пульсации для активного микрофона */
@keyframes pulse-mic {
    0% {
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(26, 115, 232, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(26, 115, 232, 0);
    }
}

/* Общие стили для круглых кнопок - GOOGLE STYLE */
.button-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #DADCE0;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s ease;
    background: #FFFFFF;
    box-shadow: none;
    flex-shrink: 0;
}

.button-circle:hover {
    background: #F1F3F4;
}

.button-circle:active {
    background: #E8EAED;
}

/* Кнопка Домой - GOOGLE STYLE */
.back-button {
    background: #FFFFFF;
    border: 1px solid #DADCE0;
}

.back-button svg {
    width: 18px;
    height: 18px;
    fill: #5F6368;
}

.back-button:hover {
    background: #F1F3F4;
}

/* === ИНФО О БОТЕ (ХЕДЕР) === */
.bot-info-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 60%;
    position: relative; /* Для позиционирования */
    background: transparent;
    z-index: 50;
    padding: 4px;
    border-radius: 8px;
}

/* Состояние при клике: расширяется и перекрывает */
.bot-info-block.expanded {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 90%;
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #e0e0e0;
    z-index: 100;
}

.bot-public-name {
    font-size: 15px; 
    font-weight: 500;
    line-height: 1.4;
    color: #202124; /* Google тёмный текст */
    
    /* Ограничение в 2 строки с многоточием */
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bot-info-block.expanded .bot-public-name {
    -webkit-line-clamp: unset; /* Показываем полностью при раскрытии */
    font-size: 18px;
    margin-bottom: 5px;
}

.bot-internal-name {
    font-size: 11px;
    font-style: italic;
    color: #888;
    margin-top: 2px;
    text-align: right;
    align-self: flex-end;
    
    /* Ограничение в 1 строку */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bot-info-block.expanded .bot-internal-name {
    white-space: normal;
    font-size: 12px;
}

/* === ИНФО О КЛИЕНТЕ (ХЕДЕР) - СТАРЫЙ КОД УДАЛИТЬ ПОТОМ === */
.user-info-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 8px;
    min-width: 0;
}

.user-info-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.user-info-id {
    font-size: 9px;
    color: #999;
    font-weight: 400;
    align-self: flex-end;
    margin-top: 1px;
}

/* === КНОПКА ЯЗЫКА - GOOGLE STYLE === */
.button-circle.language-switch {
    position: relative;
    background: #FFFFFF;
    border: 1px solid #DADCE0;
    font-size: 11px;
    font-weight: 500;
    color: #5F6368;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.button-circle.language-switch:hover {
    background: #F1F3F4;
}

.lang-code {
    font-size: 11px;
    font-weight: 500;
    color: #5F6368;
    text-transform: uppercase;
}

/* === ВЫПАДАЮЩЕЕ МЕНЮ ЯЗЫКОВ - PREMIUM === */
#language-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: none;
    padding: 6px 0;
}

#language-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Элемент языка в списке */
.language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    transition: background 0.15s ease;
    cursor: pointer;
}

.language-item:hover {
    background: linear-gradient(90deg, #f0f9ff, #e8f4fd);
}

.language-item .lang-code-item {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    min-width: 45px;
    flex-shrink: 0;
}

.language-item .lang-name-item {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === КНОПКА ЯЗЫКА ЗАБЛОКИРОВАНА (во время звонка) === */
.button-circle.language-switch.disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}









.container_m_kontakt {
    width: 100%;                 /* Занимает всю ширину родителя */
    max-width: 100%;             /* Не выходит за границы */
    overflow: hidden;            /* Отключаем общий скролл */
    margin: 0;                   /* Убираем margin - пусть grid управляет */
    padding: 10px;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    height: 46vh;                /* Высота в процентах от родителя */
    overflow-y: auto;            /* Скролл внутри */
    box-sizing: border-box;      /* padding включён в ширину */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
}



/* Основной контейнер */
.container_kontakt {
    margin: 0 0 8px 0;
    padding: 12px 14px;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    background-color: #FFFFFF;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.public-name-item {
    display: flex;
    justify-content: space-between;
}
.public-name-item > a {
    text-decoration: none;
}
.public-name-item-title {
    font-size: 18px;
    font-weight: bold;
}

/* Контейнер для описания контактов */
.contact-descr {
    /* overflow-y: auto;  Вертикальный скролл */
    overflow-wrap: break-word; /* Перенос длинных слов */
}

/* Название контактов */
.name_contact{
    font-size: 18px;
    font-weight: bold;
    background-color: #e9e9e9;
    padding: 8px;
    border-radius: 5px;
}

/* Стили для ссылок */
.link_name {
    color: #1A73E8;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #1A73E8;
    transition: all 0.2s ease;
}

.link_name:hover {
    color: #0D47A1;
    border-bottom-color: #0D47A1;
    text-decoration: underline;
}



/* Контейнер со списком контактов */
.contacts-wrapper {
    height: 60%; /* Высота в процентах от родителя */
    overflow-y: auto; /* Скролл внутри */
    padding: 8px;
    border: 1px solid #DADCE0;
    background: #FFFFFF;
    border-radius: 8px;
}









@media (max-width: 769px) {
    .phone-frame {
        width: calc(100vw - 16px); /* Чуть уже для мобильных */
        height: calc(100vh - 16px); /* Fallback */
        height: calc(100dvh - 16px); /* Dynamic viewport height - учитывает адресную строку браузера */
        max-height: calc(100vh - 16px);
        margin: 8px;
        padding: 8px;
        border: 6px solid black; /* Чуть тоньше рамка */
        border-radius: 28px;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        
        /* Адаптивная сетка для мобильных */
        grid-template-rows: 
            auto    /* Баннер - по содержимому */
            auto    /* Горизонтальная линия - по содержимому */
            auto    /* Имя собеседника */
            auto    /* Описание */
            auto    /* Кнопка вызова */
            1fr     /* Нижний блок - занимает оставшееся пространство */
            auto;   /* Подвал */
    }
    
    /* Уменьшаем размеры элементов для мобильных */
    .banner {
        /* height была фиксированной 60px, убираем или ставим auto */
        height: auto;
        min-height: 60px;
        line-height: normal;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    .top-bar {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        height: auto;
        min-height: 50px;
        padding-top: 0;
        margin-top: 5px;
    }
}

/* === NEW MAIN WRAPPER === */
.main-interface-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 5px; /* небольшой отступ от top-bar */
    position: relative;
    /* Убираем высоту, пусть контент сам регулирует, но ограничиваем максимумом */
    height: auto; 
    flex-grow: 1; /* чтобы занимал свободное место, если родитель позволяет */
}

/* Переопределяем стили для элементов внутри враппера */

/* 1. ИНФО (contact-description) */
.contact-description {
    /* Сброс старых стилей позиционирования если были conflicting */
    width: 90%;
    margin-bottom: 20px; /* Отступ до статус зоны */
    text-align: left;
    align-self: center; /* Центрируем контейнер */
    margin-left: auto; /* Добавляем auto для центрирования */
    margin-right: auto; /* Добавляем auto для центрирования */
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* transition для плавного скрытия если нужно, но в JS используется display:none */
}

/* Логотип бота */
.contact-description-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.bot-logo-img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 50px;
    width: auto;
}

/* Описание бота */
.contact-description-text {
    font-size: 14px;
    color: #3C4043;
    line-height: 1.6;
    white-space: normal;
    word-wrap: break-word;
    border: 1px solid #DADCE0;
    background-color: #FFFFFF;
    padding: 14px 16px;
    /* margin: 0; */
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
}

/* 2. AREA (status-area) */
.status-area {
    /* Теперь это просто блок в потоке main-interface-wrapper */
    position: relative; 
    width: 66%;
    max-width: 320px;
    height: 80px; 
    min-height: 80px;
    margin: 0 auto 20px auto; /* 20px отступ снизу до окна "Вы сказали" */
    
    /* display: flex не нужен, так как внутри absolutes, но для порядка */
}

/* 3. USER MESSAGE (user-message-container) */
.user-message-container {
    /* Теперь это не absolute относительно всего экрана, а относительно потока или враппера */
    position: relative !important; /* Важно перебить старый absolute */
    top: auto !important;
    left: auto !important;
    transform: none !important;
    
    width: 90%;
    max-width: 350px;
    margin: 0 auto; /* Центрирование */
    
    /* Остальные стили (background, shadow) остаются */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid rgba(200,200,200,0.3);
    backdrop-filter: blur(8px);
    
    display: none; /* JS сам включит flex */
    flex-direction: column;
    animation: slideUpFlow 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Веб-сайт бота (внутри текста описания) */
.bot-website-container {
    width: 100%;
    display: none;
    justify-content: flex-start;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #DADCE0;
}

.bot-website-link {
    font-size: 13px;
    color: #1A73E8;
    text-decoration: none;
    transition: all 0.2s ease;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid #1A73E8;
}

.bot-website-link::after {
    content: "↗";
    font-size: 10px;
    font-weight: normal;
    opacity: 0.8;
}

.bot-website-link:hover {
    color: #0D47A1;
    border-bottom-color: #0D47A1;
    background-color: transparent;
}

/* ... old code ... */
@keyframes slideUpFlow {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === BLOCKED STATE FOR TOP BAR === */
/* Класс, который будет добавляться к top-bar во время звонка */
.top-bar.blocked {
    opacity: 0.5; /* Полупрозрачность */
    pointer-events: none; /* Отключаем клики */
    filter: grayscale(100%); /* Ч/б для наглядности (опционально) */
    transition: all 0.3s ease;
}

/* #micContainer — НЕ абсолютное позиционирование! Он живёт в flex-потоке .button-container */

/* --- User Message Container --- */
/* (Старые стили удаляются/перезаписываются блоком выше, но удалим дубликат для чистоты) */
/* .user-message-container {...} удален, т.к. переопределен в .main-interface-wrapper секции */

.user-message-label {
    background: #FFFFFF;
    color: #80868B;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    text-align: left;
    border-bottom: 1px solid #DADCE0;
}

.user-message-textarea {
    width: 100%;
    padding: 16px;
    font-size: 14px;
    color: #202124;
    line-height: 1.6;
    font-weight: 400;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    font-family: inherit;
    text-align: left; /* Текст слева */
    min-height: 60px; 
    max-height: 250px;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Dialing Progress Bar - накладывается поверх inactive-bar */
.dialing-progress-container {
    position: absolute;
    top: 12px;  /* Совпадает с padding footer для точного наложения на inactive-bar */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 8px;  /* Такой же размер как inactive-bar */
    background-color: transparent;  /* Прозрачный фон - серая полоска видна под ним */
    border: none;
    border-radius: 4px;
    overflow: hidden;
    z-index: 150;
    cursor: grab;
}
.dialing-progress-container::before {
    /* Увеличенная область для захвата drag */
    content: '';
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    bottom: -10px;
}
.dialing-progress-container:active {
    cursor: grabbing;
}
.dialing-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #1A73E8 0%, #1A73E8 100%);
    border-radius: 4px;
}

/* ========================================
   Translation Loader Overlay
   ======================================== */
.translation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.translation-overlay.active {
    display: flex;
}

.translation-loader {
    text-align: center;
    color: white;
}

.translation-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #1A73E8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.translation-loader h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.translation-loader p {
    margin: 5px 0;
    font-size: 14px;
    opacity: 0.8;
}
