/* Общие стили */
*, *::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;
    background: transparent;
    padding: 0;
    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;
}


/* Контейнер 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;
}

/* Верхняя полоска (неактивная) */
.inactive-bar {
    width: 90%;
    height: 8px;
    background-color: #DADCE0;
    border-radius: 4px;
    margin: 0 auto 20px;
}

/* Блок с кнопкой вызова и микрофоном */
.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-color: #E0E0E0;       /* Серый фон */
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.4;                    /* Полупрозрачный, чтобы не отвлекал */
}

/* Квадратные кнопки */
.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;
}

/* === ИНДИКАТОР ЭКВАЛАЙЗЕР === */
.equalizer-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    
    /* Google-стиль фон */
    background: #FFFFFF;
    border: 1px solid #DADCE0;
    border-radius: 8px;
    
    width: 66%; /* 2/3 ширины экрана */
    max-width: 320px;
    
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.16);
    
    /* Анимация появления */
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    transform: scale(0.9); /* Для зум-эффекта при появлении */
}

.equalizer-indicator.active {
    display: flex;
    opacity: 1;
    transform: scale(1);
    /* margin override из .status-area уже работает, но на всякий случай тут не добавляем margin */
}

.equalizer-indicator.fade-out {
    opacity: 0;
    /* Убираем transform scale */
}

.eq-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 5px; /* Чуть плотнее для 9 штук */
    height: 32px;
}

.eq-bar {
    width: 6px; 
    border-radius: 3px;
    animation: eqBounce 0.8s ease-in-out infinite;
    background: #4d8ff5; 
}

/* Раскрашиваем палочки в градиент логотипа слева направо (9 штук) */
.eq-bar:nth-child(1) { background: #5dd6f5; animation-delay: 0s;     height: 10px; } /* Cyan */
.eq-bar:nth-child(2) { background: #5bcbf5; animation-delay: 0.1s;   height: 16px; } 
.eq-bar:nth-child(3) { background: #59c0f5; animation-delay: 0.2s;   height: 22px; } 
.eq-bar:nth-child(4) { background: #57b5f5; animation-delay: 0.15s;  height: 28px; } /* Center-ish */
.eq-bar:nth-child(5) { background: #55b2f5; animation-delay: 0s;     height: 32px; } /* Center Peak */
.eq-bar:nth-child(6) { background: #4d8ff5; animation-delay: 0.15s;  height: 28px; } /* Blue */
.eq-bar:nth-child(7) { background: #5c7ddc; animation-delay: 0.2s;   height: 22px; } 
.eq-bar:nth-child(8) { background: #6b6bc7; animation-delay: 0.1s;   height: 16px; } 
.eq-bar:nth-child(9) { background: #7b3fb5; animation-delay: 0s;     height: 10px; } /* Purple */

@keyframes eqBounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

.eq-text {
    color: #5F6368;
    font-size: 13px;
    font-weight: 500;
    opacity: 1;
    letter-spacing: 0.3px;
}



#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: 48px;              /* Немного меньше для вписывания */
    height: 48px;
    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: #E85D75;
}

/* Анимация пульсации для активного микрофона */
@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);
    }
}

#micImg {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Белый цвет иконки */
}


/* Общие стили для круглых кнопок - 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;
}

/* --- Старые стили --- */
.equalizer-indicator {
    /* Абсолютное позиционирование: элемент точно в центре родителя */
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
}

/* #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 */
.dialing-progress-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 8px;
    background-color: #DADCE0;
    border: none;
    border-radius: 4px;
    overflow: hidden;
    z-index: 150;
}
.dialing-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #1A73E8 0%, #1A73E8 100%);
    border-radius: 4px;
}
