/* ChatGPT Page Styles - Дизайн как в Telegram Mini App */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Принудительно применяем Telegram-стиль на мобильной веб-версии (не в ТГ) */
@media (max-width: 820px) {
    html, body {
        background: #000000 !important;
    }
    body:not(.telegram-webapp) .telegram-mini-header {
        display: flex !important;
    }
    body:not(.telegram-webapp) .regular-mobile-header {
        display: none !important;
    }
    body:not(.telegram-webapp) .chatgpt-container {
        background: #000000 !important;
    }
    /* Фон модального окна звонка как в TG-версии */
    body:not(.telegram-webapp) .voice-call-modal {
        background: #1a0b2e !important; /* Фиолетовый фон как был раньше */
    }
    /* Убираем все градиенты */
    body:not(.telegram-webapp) .voice-call-modal::after { 
        background: none !important;
        opacity: 0 !important;
        display: none !important;
    }
    body:not(.telegram-webapp) .voice-call-background,
    body:not(.telegram-webapp) .voice-call-gradient,
    body:not(.telegram-webapp) .voice-call-particles {
        display: none !important;
    }
    
    /* Убираем все градиенты */
    /* Включаем анимации шаров для мобильной версии */
    body:not(.telegram-webapp) .voice-call-modal .animated-background,
    body:not(.telegram-webapp) .voice-call-modal .floating-bubbles {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    body:not(.telegram-webapp) .voice-call-modal .sparks-background.active {
        display: block !important;
    }
    /* Стандартизируем цветовую схему внутреннего контента */
    body:not(.telegram-webapp) .voice-call-chat { background: rgba(15, 18, 35, 0.85) !important; }
}

html.telegram-webapp,
body.telegram-webapp {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000 !important;
    color: #ffffff;
    height: 100vh;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

.chatgpt-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 !important;
    padding: 0 !important;
    background: #000000;
    position: relative;
}

/* Telegram Mini App Header (импортированные стили с главной) */
.telegram-mini-header {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    background: linear-gradient(135deg, rgba(15, 15, 25, 0.98) 0%, rgba(20, 20, 35, 0.95) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(20, 184, 166, 0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.telegram-first-row {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-bottom: 0.5rem;
}

.telegram-logo-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.telegram-vision-text,
.telegram-flow-text {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 1px;
}

.telegram-logo-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.telegram-second-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0 0.5rem;
    margin-top: 0.5rem;
}

.telegram-buy-btn {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
    color: #ffffff;
    border: 1.5px solid rgba(20, 184, 166, 0.3);
    padding: 0.4rem 1rem;
    height: 36px;
    border-radius: 18px;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(20, 184, 166, 0.4),
        0 4px 16px rgba(20, 184, 166, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-width: 80px;
    justify-content: center;
}

.telegram-right-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.telegram-audio-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.telegram-balance-amount {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    padding: 0.25rem 0.5rem;
}

.telegram-avatar-circle-large {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 15px rgba(20, 184, 166, 0.5);
    border: 2px solid rgba(94, 234, 212, 0.3);
}

.telegram-avatar-letter-large {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
}

/* ChatGPT Заголовок */
.chatgpt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 100;
    width: 100%;
}

.chatgpt-close-btn {
    background: transparent;
    border: none;
    color: #5eead4;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.chatgpt-close-btn:hover {
    background: rgba(94, 234, 212, 0.1);
}

.chatgpt-title {
    flex: 1;
    text-align: center;
}

.chatgpt-title h1 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.chatgpt-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    display: block;
}

.chatgpt-menu-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.chatgpt-menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Селектор модели */
.chatgpt-model-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatgpt-menu-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
}

.chatgpt-model-btn {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.chatgpt-model-btn:hover {
    background: #333333;
}

.model-arrow {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.chatgpt-badge {
    background: #2a2a2a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 500;
}

/* Область чата - строго от хедера до области ввода */
.chatgpt-chat-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden; /* Запрещаем горизонтальный скролл */
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
    background: #000000 !important; /* Фон области чата */
    background-image: none !important;
    background-attachment: scroll !important;
    /* Область чата строго от бургера/счетчика до области ввода */
    max-width: 768px;
    width: 100%;
    position: fixed;
    top: calc(2.5rem + 45px); /* Базовое правило - переопределяется для TG и моб версий */
    left: 0;
    right: 0;
    bottom: calc(60px + 60px); /* Базовое правило - переопределяется для TG и моб версий */
    height: calc(100vh - 2.5rem - 45px - 60px - 60px); /* Базовое правило - переопределяется для TG и моб версий */
    padding-top: 0; /* Убираем padding-top, используем только top */
    padding-bottom: 0; /* Убираем padding-bottom, используем только bottom */
    z-index: 1;
}

/* Защита контейнера от изменения размера при открытии клавиатуры */
.chatgpt-container {
    height: 100vh;
    height: 100dvh; /* Динамический viewport height для мобильных */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    background: #000000 !important; /* Серый фон для области над хеддером */
    margin: 0 !important;
    padding: 0 !important;
}

/* Для мобильных устройств с клавиатурой - увеличиваем padding-top */
@media (max-height: 700px) {
    .chatgpt-chat-area {
        top: calc(2.5rem + 45px) !important; /* Исправлено на 45px вместо 40px */
        bottom: calc(60px + 60px) !important;
        height: calc(100vh - 2.5rem - 45px - 60px - 60px) !important; /* Исправлено на 45px вместо 40px */
    }
}
/* Принудительно оставляем верхний градиент шапки и не меняем фон при добавлении сообщений */
.chatgpt-chat-area .message,
.chatgpt-chat-area .user-message,
.chatgpt-chat-area .assistant-message {
    background: transparent !important;
    background-color: transparent !important;
}

.voice-call-message,
.voice-call-message .message-text,
.chatgpt-message,
.chatgpt-message .chatgpt-message-content {
    background-image: none !important;
}

/* JavaScript будет динамически устанавливать padding-top при открытии клавиатуры */
.chatgpt-chat-area.keyboard-open {
    padding-top: calc(2.5rem + 45px + 4rem) !important; /* Для моб версии - надпись (2.5rem) + хедер (45px) + отступ */
    padding-bottom: calc(80px + 60px + 7rem) !important; /* Увеличен padding-bottom */
}

.chatgpt-welcome-text {
    background: transparent;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    margin: 2rem auto 1rem auto;
    max-width: 768px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chatgpt-welcome-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.chatgpt-welcome-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
}

.chatgpt-welcome-logo {
    background: #000000;
    border-radius: 20px;
    padding: 1rem 2rem 2rem 2rem;
    text-align: center;
    margin: 0 auto 2rem auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chatgpt-robot-icon {
    font-size: 4rem;
    margin-top: -1rem;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.chatgpt-animated-logo {
    width: 250px; /* Увеличена гифка */
    height: 250px; /* Увеличена гифка */
    object-fit: contain;
    background: transparent;
}

/* Сообщения чата */
.chatgpt-message {
    margin-bottom: 1rem;
    margin-top: 0 !important; /* Запрещаем отрицательные отступы */
    display: flex;
    flex-direction: column;
    position: relative; /* Относительное позиционирование */
    z-index: 1; /* Ниже хэдера */
}

.chatgpt-message-user {
    align-items: flex-end;
}

.chatgpt-message-assistant {
    align-items: flex-start;
}

.chatgpt-message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 16px;
    word-wrap: break-word;
    line-height: 1.5;
    white-space: pre-wrap; /* Сохраняем переносы строк и отступы */
}

.chatgpt-message-user .chatgpt-message-content {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%) !important; /* Зеленый градиент */
    color: #ffffff !important; /* Белый текст */
    border-bottom-right-radius: 4px;
    font-weight: 500;
    box-shadow: 
        0 4px 16px rgba(16, 185, 129, 0.4),
        0 0 32px rgba(5, 150, 105, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chatgpt-message-assistant .chatgpt-message-content {
    background: #2f2f2f;
    color: #ffffff;
    border-bottom-left-radius: 4px;
    animation: messageAppear 0.5s ease-out;
}

/* Кнопка копировать под ответом */
.chatgpt-message-file-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chatgpt-message-copy-btn {
    background: rgba(42, 42, 42, 0.8); /* Серый фон без зеленого */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #ffffff; /* Белый цвет текста */
    padding: 0.4rem 0.85rem; /* Увеличен padding */
    margin-top: 0.5rem;
    font-size: 0.8rem; /* Увеличен размер шрифта */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* Увеличен gap */
    transition: all 0.2s;
    box-shadow: none !important; /* Убрано свечение */
}

.chatgpt-message-copy-btn:hover {
    background: rgba(42, 42, 42, 1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: none !important; /* Убрано свечение */
}

.chatgpt-message-copy-btn:active {
    transform: scale(0.95);
}

.chatgpt-message-copy-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #10b981; /* Зеленый цвет иконки */
}

/* Анимация появления сообщения */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация появления текста по буквам */
.chatgpt-message-typing {
    display: inline;
}

.chatgpt-message-typing span {
    opacity: 0;
    animation: charAppear 0.05s ease-out forwards;
}

@keyframes charAppear {
    to {
        opacity: 1;
    }
}

.chatgpt-message-system .chatgpt-message-content {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border-radius: 12px;
    text-align: center;
    max-width: 100%;
}

/* Индикатор печати */
.chatgpt-typing {
    display: flex;
    gap: 0.25rem;
    padding: 1rem;
}

.chatgpt-typing span {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.chatgpt-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatgpt-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Поле ввода */
.chatgpt-input-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #2f2f2f;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 24px;
    max-width: 768px;
    margin: 0 auto;
    position: fixed;
    bottom: 60px; /* Высота нижнего меню */
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: none !important;
    outline: none !important;
}

/* В TG версии опускаем область ввода ниже, чтобы было единым целым с нижним меню */
.telegram-webapp .chatgpt-input-area {
    bottom: 65px !important; /* Опущено ниже, ближе к нижнему меню (65px высота меню) */
}

/* В моб версии опускаем область ввода ниже к нижнему меню */
body:not(.telegram-webapp) .chatgpt-input-area {
    bottom: 60px !important; /* Опущено ниже к нижнему меню, чтобы были как единый блок */
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important; /* Тонкая граница для визуального объединения */
}

/* Когда клавиатура открыта и нижнее меню скрыто */
.chatgpt-input-area.keyboard-open {
    bottom: 0 !important;
    padding-bottom: calc(env(safe-area-inset-bottom) + 0.75rem);
}

/* Когда клавиатура открыта, file-preview поднимается вместе с input-area */
/* Используем общий селектор для обоих случаев (братский и соседний) */
body.keyboard-open .chatgpt-file-preview,
.chatgpt-input-area.keyboard-open ~ .chatgpt-file-preview,
.chatgpt-input-area.keyboard-open + .chatgpt-file-preview {
    bottom: calc(env(safe-area-inset-bottom) + 3.5rem) !important; /* Поднимается вместе с полем ввода */
}

.chatgpt-attach-btn {
    background: transparent; /* Без фона */
    border: none; /* Без границы */
    color: #10b981; /* Мягкий неоновый зеленый цвет */
    font-size: 0;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none; /* Убрано свечение */
}

.chatgpt-attach-btn:hover {
    background: transparent; /* Без фона */
    border: none; /* Без границы */
    box-shadow: none; /* Убрано свечение */
    transform: scale(1.05);
}

.chatgpt-attach-btn svg {
    width: 28px; /* Увеличена иконка */
    height: 28px; /* Увеличена иконка */
    stroke: #ffffff; /* Белый цвет иконки */
    stroke-width: 2.5; /* Увеличена толщина */
}

.chatgpt-input {
    flex: 1;
    background: transparent;
    border: none;
    border-radius: 24px;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
    outline: none;
    box-shadow: none;
}

/* Убираем все зеленые границы и эффекты */
.chatgpt-input-area * {
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.chatgpt-input:focus {
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
}

.chatgpt-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.chatgpt-call-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.8) 0%, rgba(5, 150, 105, 0.8) 100%); /* Неоновый градиент зеленого цвета */
    border: none !important;
    color: #ffffff; /* Белый цвет иконки */
    font-size: 0;
    font-weight: 600;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none !important;
    outline: none !important;
}

.chatgpt-call-btn:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(16, 185, 129, 1) 0%, rgba(5, 150, 105, 1) 100%);
}

.chatgpt-call-btn.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 1) 0%, rgba(220, 38, 38, 1) 100%); /* Красный цвет при активном звонке */
    animation: callPulse 2s ease-in-out infinite;
}

.chatgpt-call-btn svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    stroke-width: 2.5;
}

@keyframes callPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.chatgpt-send-btn {
    background: linear-gradient(135deg, #ffcc00 0%, #ffd700 25%, #ffcc00 50%, #ffed4e 75%, #ffcc00 100%); /* Желтый градиент */
    border: none !important;
    color: #000000; /* Черный цвет иконки для контраста */
    font-size: 0;
    font-weight: 600;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: none !important; /* Убрано свечение */
    outline: none !important; /* Убираем outline */
    /* Убрана анимация пульсации */
}

.chatgpt-send-btn:hover {
    box-shadow: none !important; /* Убрано свечение */
    transform: scale(1.05);
}

.chatgpt-send-btn svg {
    width: 22px;
    height: 22px;
    stroke: #000000; /* Черный цвет стрелки для контраста */
    stroke-width: 2.5;
}

.chatgpt-send-btn:active {
    transform: scale(0.95);
}

/* Адаптация для Telegram */
.telegram-webapp html,
.telegram-webapp body {
    height: 100% !important;
    overflow: hidden !important;
}

.telegram-webapp .chatgpt-container {
    height: 100vh !important;
    overflow: hidden !important;
}

.telegram-webapp .chatgpt-chat-area {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

/* Нижнее меню (импортированные стили с главной) */
.chatgpt-container .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000 !important;
    /* Нижнее меню такого же размера как на главной */
    padding: 0.3rem 0 0.4rem 0 !important;
    min-height: auto !important;
    border-top: none !important; /* Убираем полоски */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Нижнее меню для ChatGPT - такой же размер как на главной странице */
.telegram-webapp .chatgpt-container .bottom-nav {
    padding: 0.8rem 0 1rem 0 !important; /* Такой же размер как на главной странице для Telegram */
    min-height: 65px !important; /* Такой же размер как на главной странице */
}

.telegram-webapp .chatgpt-container .bottom-nav .nav-item {
    padding: 0 !important; /* Такой же размер как на главной странице */
    margin-bottom: 0 !important;
    gap: 0 !important; /* Убираем отступ между иконкой и текстом */
}

.telegram-webapp .chatgpt-container .bottom-nav .nav-icon {
    width: 20px !important; /* Такой же размер как на главной странице */
    height: 20px !important; /* Такой же размер как на главной странице */
    margin-bottom: 0.2rem !important; /* Отступ как на главной странице */
}

.telegram-webapp .chatgpt-container .bottom-nav .nav-text {
    font-size: 0.75rem !important; /* Такой же размер как на главной странице */
    margin-top: 0.1rem !important; /* Отступ как на главной странице */
    display: block !important; /* Убираем лишние стили */
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000 !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    padding: 0.3rem 0 0.4rem 0;
    z-index: 1000;
    box-shadow: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0 !important; /* Убираем отступ между иконкой и текстом */
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    min-width: 50px;
    position: relative;
}

/* Специфичные селекторы для ChatGPT нижнего меню с !important */
.chatgpt-container .bottom-nav .nav-item {
    gap: 0 !important; /* Убираем отступ между иконкой и текстом */
}

.chatgpt-container .bottom-nav .nav-icon {
    margin-bottom: 0.2rem !important; /* Отступ как на главной странице */
}

.chatgpt-container .bottom-nav .nav-text {
    margin-top: 0.1rem !important; /* Отступ как на главной странице */
}

.chatgpt-container .bottom-nav .nav-item::before,
.chatgpt-container .nav-item::before {
    display: none !important; /* Полностью убираем градиент фон */
}

.chatgpt-container .bottom-nav .nav-item.active::before,
.chatgpt-container .nav-item.active::before {
    display: none !important; /* Убираем градиент фон для активного элемента */
}

.chatgpt-container .bottom-nav .nav-item.active,
.chatgpt-container .nav-item.active {
    background: transparent !important; /* Убираем градиент фон */
    border: none !important;
    box-shadow: none !important; /* Убрано желтое свечение */
    animation: navItemPulse 2s ease-in-out infinite; /* Анимация пульсации */
}

.chatgpt-container .bottom-nav .nav-item:hover,
.chatgpt-container .nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.chatgpt-container .bottom-nav .nav-item.active:hover,
.chatgpt-container .nav-item.active:hover {
    background: transparent !important; /* Убираем градиент при наведении */
    box-shadow: none !important; /* Убрано желтое свечение */
    animation: navItemPulse 2s ease-in-out infinite; /* Анимация пульсации */
}

.chatgpt-container .bottom-nav .nav-item.active .nav-icon,
.chatgpt-container .nav-item.active .nav-icon {
    transform: scale(1.15) !important;
    filter: none !important; /* Убрано желтое свечение */
    animation: navIconPulse 2s ease-in-out infinite; /* Анимация пульсации иконки */
}

.chatgpt-container .bottom-nav .nav-item.active .nav-icon svg,
.chatgpt-container .nav-item.active .nav-icon svg {
    fill: #ffcc00 !important; /* Желтый цвет для активной иконки */
}

.chatgpt-container .bottom-nav .nav-item.active .nav-text,
.chatgpt-container .nav-item.active .nav-text {
    color: #ffcc00 !important; /* Желтый цвет для активного текста */
    font-weight: 600 !important;
    text-shadow: none !important; /* Убрано желтое свечение */
    animation: navTextPulse 2s ease-in-out infinite; /* Анимация пульсации текста */
}

@keyframes navItemPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes navIconPulse {
    0%, 100% {
        transform: scale(1.15);
    }
    50% {
        transform: scale(1.25);
    }
}

@keyframes navTextPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.nav-icon {
    font-size: 1.1rem;
    transition: transform 0.25s ease;
    margin-bottom: 0.2rem !important; /* Отступ как на главной странице */
}

.nav-text {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    transition: color 0.25s ease;
    margin-top: 0.1rem !important; /* Отступ как на главной странице */
}

.nav-item.active .nav-text {
    color: #5eead4;
    font-weight: 600;
}

/* Обработчик кликов на нижнее меню */
.nav-item:first-child .nav-text {
    cursor: pointer;
}

.nav-item:first-child {
    cursor: pointer;
}

/* Новый заголовок ChatGPT - Темно-серый фон */
/* Заголовок ChatGPT 5 над хэдером */
.chatgpt-title-above-header {
    position: fixed;
    top: 0;
    margin-top: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.5rem 0;
    z-index: 1002;
    background: #000000 !important;
    pointer-events: none;
    text-shadow: none;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: 2.5rem;
    line-height: 2.5rem;
}

.chatgpt-header-new {
    display: grid !important; /* Убеждаемся что grid виден */
    grid-template-columns: 36px 1fr auto !important; /* Бургер слева, пустое место по центру, счетчик справа */
    align-items: center !important; /* Выравнивание по центру по высоте */
    gap: 0.5rem; /* Уменьшен gap для экономии места */
    padding: 0.1rem 0.75rem 0.5rem 0.75rem; /* Уменьшен padding для экономии места */
    background: #000000 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    max-width: 768px;
    margin: 0 auto;
    position: fixed;
    top: 0; /* Базовое правило - переопределяется для TG и моб версий */
    left: 0;
    right: 0;
    z-index: 999;
    min-height: 45px;
    height: auto;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    visibility: visible !important; /* Убеждаемся что виден */
    opacity: 1 !important; /* Убеждаемся что виден */
}

/* Убеждаемся, что все элементы на одном уровне */
.chatgpt-header-new > * {
    display: flex;
    align-items: center;
}

/* Для мобильных устройств - еще меньше отступы */
@media (max-width: 480px) {
    .chatgpt-header-new {
        gap: 0.3rem;
        padding: 0.1rem 0.5rem 0.5rem 0.5rem;
        top: 0 !important; /* Поднят на самый верх вместе со счетчиком и бургером */
    }
    
    .chatgpt-title-above-header {
        top: 0 !important; /* Для мобильной версии без Telegram - заголовок на самом верху */
        margin-top: 0 !important; /* Поднято максимально вверх */
        padding-top: 0.25rem !important; /* Минимальный отступ */
        height: auto !important;
        line-height: 1.5 !important;
    }
    
    body:not(.telegram-webapp) .chatgpt-chat-area {
        top: calc(2.5rem + 45px) !important; /* Поднято максимально - надпись (2.5rem) + хедер (45px) */
        bottom: calc(60px + 60px) !important; /* Строго до области ввода */
        height: calc(100vh - 2.5rem - 45px - 60px - 60px) !important; /* Строго от хедера до области ввода */
        padding-top: 0 !important; /* Убираем padding-top, используем только top */
        padding-bottom: 0 !important; /* Убираем padding-bottom, используем только bottom */
        background: #000000 !important; /* Фон области чата */
    }
    
    body:not(.telegram-webapp) .chatgpt-header-new {
        top: 2.5rem !important; /* Поднято максимально - под надписью */
        padding-top: 0.25rem !important; /* Минимальный отступ */
    }
    
    body:not(.telegram-webapp) .chatgpt-title-above-header {
        margin-top: 0 !important; /* Поднято максимально вверх */
        padding-top: 0.25rem !important;
    }
}

/* Для Telegram - еще меньше отступы в хэдере и выравнивание */
.telegram-webapp .chatgpt-title-above-header {
    top: 99px !important; /* Под Telegram баннером */
    margin-top: 1.48rem !important; /* СТРОГО как на главной странице - логотип в правильном месте */
    background: transparent !important; /* Прозрачный фон, чтобы не было невидимых блоков */
    z-index: 1003 !important;
    height: auto !important; /* Автоматическая высота */
    line-height: normal !important; /* Нормальная высота строки */
    padding: 0 !important; /* Убираем padding */
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    font-size: 1.2rem !important; /* Как на главной странице */
}

.telegram-webapp .chatgpt-header-new {
    gap: 0.5rem !important;
    padding: 0.3rem 1rem 0.2rem 1rem !important;
    align-items: center !important;
    min-height: auto !important;
    top: calc(99px + 1.48rem) !important; /* ПОДНЯТО ВЫШЕ - как лого на главной, сразу под надписью */
    margin: 0 !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.2rem !important;
    background: #000000 !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1002 !important;
    transform: none !important;
}

.telegram-webapp .chatgpt-container {
    background: #000000 !important; /* Серый фон для области над хеддером */
}

.telegram-webapp .chatgpt-chat-area {
    top: calc(99px + 1.48rem + 50px) !important; /* ПОДНЯТО ВЫШЕ - под Telegram баннером, надписью и хедером */
    bottom: calc(65px + 60px) !important; /* Строго до области ввода (65px нижнее меню + 60px область ввода) */
    height: calc(100vh - 99px - 1.48rem - 50px - 65px - 60px) !important; /* Строго от хедера до области ввода */
    background: #000000 !important; /* Фон области чата */
    padding-top: 0 !important; /* Убираем padding-top, используем только top */
    padding-bottom: 0 !important; /* Убираем padding-bottom, используем только bottom */
}


.telegram-webapp .chatgpt-header-new > * {
    align-items: center !important;
    display: flex !important;
    height: auto !important;
}

.chatgpt-burger-btn {
    background: transparent !important; /* Без фона */
    border: none !important;
    color: #ffffff !important; /* Белый цвет для видимости */
    padding: 0 !important;
    cursor: pointer !important;
    font-size: 0 !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important; /* Убеждаемся что виден */
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease;
    visibility: visible !important; /* Убеждаемся что виден */
    opacity: 1 !important; /* Убеждаемся что виден */
    position: relative !important;
    z-index: 1000 !important;
}

.chatgpt-burger-btn:hover {
    transform: scale(1.1);
}

.chatgpt-burger-btn svg {
    width: 28px !important;
    height: 28px !important;
    stroke: #ffffff !important; /* Белый цвет бургера */
    stroke-width: 3 !important; /* Жирные полоски */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


.chatgpt-title-new {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    margin-top: 0.5rem; /* Опускаем заголовок ниже */
    justify-self: center; /* Центрирование в grid */
    grid-column: 2; /* Вторая колонка (центр) */
    position: relative; /* Относительное позиционирование */
    z-index: 1; /* Поверх других элементов */
    pointer-events: none; /* Не блокирует клики на другие элементы */
    display: block !important; /* Убеждаемся что заголовок виден */
}

/* Для Telegram версии - заголовок остается по центру */
.telegram-webapp .chatgpt-title-new {
    grid-column: 2 !important; /* Вторая колонка (центр) */
    text-align: center !important;
    justify-self: center !important;
    position: relative !important;
    margin-top: 0 !important; /* Убран отступ */
    top: 0 !important;
    display: block !important; /* Убеждаемся что заголовок виден */
    visibility: visible !important; /* Убеждаемся что заголовок виден */
    opacity: 1 !important; /* Убеждаемся что заголовок виден */
    color: #ffffff !important; /* Белый цвет текста */
    font-size: 1.2rem !important; /* Размер шрифта */
    font-weight: 600 !important; /* Жирность шрифта */
}

/* Контейнер для счетчика и таймера */
.chatgpt-limit-container {
    display: flex !important; /* Убеждаемся что виден */
    align-items: center;
    gap: 0.3rem; /* Уменьшен gap */
    justify-self: end; /* Прижимаем к правому краю */
    flex-shrink: 0; /* Не сжимается */
    margin-right: 0; /* Убрано отрицательное значение */
    margin-left: auto; /* Сдвигаем влево от центра */
    visibility: visible !important; /* Убеждаемся что виден */
    opacity: 1 !important; /* Убеждаемся что виден */
}

.chatgpt-limit-badge {
    background: linear-gradient(135deg, #ffcc00 0%, #ffd700 25%, #ffcc00 50%, #ffed4e 75%, #ffcc00 100%) !important; /* Желтый градиент */
    border: 1px solid rgba(255, 204, 0, 0.8) !important;
    box-shadow: none !important; /* Убрано свечение */
    border-radius: 50% !important;
    width: 30px !important; /* Уменьшен размер счетчика */
    height: 30px !important; /* Уменьшен размер счетчика */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1.1rem !important; /* Увеличен размер цифры */
    color: #000000 !important; /* Черный текст для контраста */
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.3s ease;
    visibility: visible !important; /* Убеждаемся что виден */
    opacity: 1 !important; /* Убеждаемся что виден */
    position: relative !important;
    z-index: 1000 !important;
    /* Убрана анимация пульсации */
}

.chatgpt-limit-badge:hover {
    transform: scale(1.1);
    box-shadow: none !important; /* Убрано свечение при наведении */
}

.chatgpt-limit-badge.badge-animate {
    animation: badgePulse 0.5s ease, badgeGlow 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes yellowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 204, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.4), 0 0 60px rgba(255, 204, 0, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 204, 0, 0.9), 0 0 60px rgba(255, 215, 0, 0.7), 0 0 90px rgba(255, 204, 0, 0.5);
        transform: scale(1.05);
    }
}

.chatgpt-timer-badge {
    background: linear-gradient(135deg, #ffcc00 0%, #ffd700 25%, #ffcc00 50%, #ffed4e 75%, #ffcc00 100%); /* Желтый градиент */
    border: 1px solid rgba(255, 204, 0, 0.8);
    box-shadow: none !important; /* Убрано свечение */
    border-radius: 12px;
    padding: 0.3rem 0.5rem; /* Уменьшен padding для таймера */
    font-size: 0.8rem; /* Уменьшен размер шрифта */
    color: #000000; /* Черный текст для контраста */
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    /* Убрана анимация пульсации */
}

/* Новый селектор модели */
.chatgpt-model-selector-new {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 60px; /* Отступ от нового заголовка */
}

/* Бургер меню */
.chatgpt-burger-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.98);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.burger-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1rem 1rem 1rem; /* Увеличен padding-top еще больше */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: calc(42px + 1rem); /* Отступ сверху увеличен */
}

.burger-menu-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.burger-menu-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.burger-menu-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.burger-menu-actions {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.burger-menu-action-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(94, 234, 212, 0.8) 0%, rgba(56, 189, 248, 0.8) 100%); /* Космический градиент */
    border: 1px solid rgba(94, 234, 212, 0.5);
    border-radius: 12px;
    color: #ffffff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    box-shadow: none; /* Убрано голубое свечение */
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.burger-menu-action-btn:hover {
    background: #0d9488;
}

.burger-menu-action-btn .action-icon {
    font-size: 1.2rem;
}

.burger-menu-sessions {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem 0.75rem 0.75rem; /* Увеличен padding-top */
}

.burger-menu-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    gap: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 56px;
}

.burger-menu-session-item:hover {
    background: rgba(94, 234, 212, 0.1) !important; /* Космический цвет */
    border-color: rgba(94, 234, 212, 0.3) !important; /* Космический цвет */
    box-shadow: none; /* Убрано голубое свечение */
    transform: translateX(2px);
}

.session-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0; /* Позволяет тексту обрезаться */
    overflow: hidden;
}

.session-title {
    font-size: 0.9375rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    margin-bottom: 0.125rem;
}

.session-date {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    line-height: 1.4;
}

.session-delete-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    font-size: 0;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.session-delete-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
    transform: scale(1.1);
}

.session-delete-btn svg {
    width: 18px;
    height: 18px;
}

.no-sessions {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 2rem;
    font-size: 0.9rem;
}

/* ===================================================================
   ОТСТУПЫ ДЛЯ МОБИЛЬНОЙ ВЕРСИИ (НЕ TELEGRAM)
   =================================================================== */

/* Для мобильной версии (не Telegram) - минимальные отступы, шапка сверху */
body:not(.telegram-webapp) .chatgpt-container {
    padding-top: 60px !important; /* Минимальный отступ для мобильной версии - только под шапку */
}

body:not(.telegram-webapp) .chatgpt-header-new {
    top: calc(0.5rem + 2.5rem) !important; /* Поднято еще выше - под надписью */
    margin-top: 0 !important; /* Без отступа для мобильной версии */
    position: fixed !important;
    z-index: 999 !important;
}

body:not(.telegram-webapp) .chatgpt-title-above-header {
    top: 0 !important; /* Заголовок на самом верху для мобильной версии */
    margin-top: 0.5rem !important; /* Поднято еще выше */
    z-index: 1002 !important; /* Увеличен z-index чтобы была видна поверх всего */
    display: block !important; /* Убеждаемся что видна */
    visibility: visible !important; /* Убеждаемся что видна */
    opacity: 1 !important; /* Убеждаемся что видна */
    color: #ffffff !important; /* Белый цвет */
    font-weight: 700 !important; /* Жирный шрифт */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important; /* Тень для видимости */
    background: transparent !important; /* Прозрачный фон */
    height: auto !important; /* Автоматическая высота */
    line-height: normal !important; /* Нормальная высота строки */
    padding: 0.5rem 0 !important; /* Небольшой padding */
    font-size: 1.2rem !important; /* Как на главной странице */
}

/* Серый фон над надписью в моб версии (для системной панели) */
body:not(.telegram-webapp) .chatgpt-title-above-header::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0.5rem; /* Поднято еще выше - уменьшена высота */
    background: #000000 !important; /* Серый фон для системной панели */
    z-index: 1001;
    pointer-events: none;
}

body:not(.telegram-webapp) .chatgpt-chat-area {
    margin-top: 0 !important;
    top: calc(0.5rem + 2.5rem + 45px) !important; /* Поднято еще выше - надпись (0.5rem + 2.5rem) + хедер (45px) */
    bottom: calc(60px + 60px) !important; /* Строго до области ввода */
    height: calc(100vh - 0.5rem - 2.5rem - 45px - 60px - 60px) !important; /* Строго от хедера до области ввода */
    padding-top: 0 !important; /* Убираем padding-top, используем только top */
    padding-bottom: 0 !important; /* Убираем padding-bottom, используем только bottom */
    background: #000000 !important; /* Фон области чата */
}

/* ===================================================================
   ОТСТУПЫ ДЛЯ TELEGRAM MINI APP
   =================================================================== */

/* УДАЛЕНО: Дублирующее правило - используется правило выше на строке 1057 */

/* Для Telegram версии - поднять текст выше, но бургер и счетчик остаются на месте */
/* Удалено дублирующее правило для .telegram-webapp .chatgpt-title-new */

/* Для Telegram - сдвигаем счетчик намного влево и уменьшаем размеры */
.telegram-webapp .chatgpt-limit-container {
    margin-left: -2rem; /* Сдвигаем счетчик влево */
    gap: 0.5rem; /* Увеличен gap между таймером и счетчиком */
    align-items: center; /* Выравнивание по центру */
}

.telegram-webapp .chatgpt-limit-badge {
    width: 30px; /* Уменьшен размер для Telegram */
    height: 30px; /* Уменьшен размер для Telegram */
    font-size: 1.1rem; /* Увеличен размер цифры */
    display: flex;
    align-items: center;
    justify-content: center;
}

.telegram-webapp .chatgpt-timer-badge {
    padding: 0.3rem 0.5rem; /* Уменьшен padding для Telegram */
    font-size: 0.8rem; /* Уменьшен размер шрифта */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Убираем лишнюю высоту строки */
    /* Убрана анимация пульсации */
}

.telegram-webapp .chatgpt-container {
    padding-top: 0 !important;
    margin-top: 0 !important; /* Убран margin-top, используем top в header */
}

/* УДАЛЕНО: Дублирующее правило - используется правило выше на строке 1078 */

/* УДАЛЕНО: Дублирующее правило - используется правило выше на строке 1449 */

/* Блок отображения загруженного файла - над input-area */
.chatgpt-file-preview {
    position: fixed;
    bottom: calc(80px + 60px); /* Над input-area (80px nav + 60px input-area) */
    left: 0;
    right: 0;
    background: #000000; /* Такой же фон как input-area */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Граница снизу для единого блока */
    padding: 0.5rem 1rem;
    z-index: 101;
    box-shadow: none; /* Убираем все эффекты свечения */
}

.file-preview-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.file-preview-name {
    color: #ffffff;
    font-size: 0.9rem;
    flex: 1;
}

.file-preview-remove {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff6b6b;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.file-preview-remove:hover {
    background: rgba(255, 107, 107, 0.3);
    border-color: rgba(255, 107, 107, 0.5);
}

.file-preview-loading {
    margin-top: 0.5rem;
    text-align: center;
    color: #14b8a6;
    font-size: 0.85rem;
}

/* Модальное окно с информацией о лимитах */
.limit-info-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.limit-info-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
}

.limit-info-content {
    position: relative;
    background: #2a2a2a;
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 350px;
    z-index: 1;
}

.limit-info-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.limit-info-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.limit-info-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1.5rem;
    text-align: center;
}

.limit-info-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.limit-info-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

.limit-info-number {
    color: #10b981; /* Мягкий неоновый зеленый цвет */
    font-weight: 600;
    font-size: 1.1rem;
}

.limit-info-paid {
    color: #10b981; /* Мягкий неоновый зеленый цвет */
    font-weight: 500;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chatgpt-logo-fallback {
    font-size: 4rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

/* Voice Call Modal Styles - Новый дизайн как в ChatGPT */
.voice-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a0b2e !important; /* Фиолетовый фон как был раньше */
    overflow: visible !important; /* Разрешаем видимость пузырей */
}

/* Градиентный анимированный фон - ОТКЛЮЧЕН */
.voice-call-background {
    display: none !important;
    background: none !important;
}

.voice-call-gradient {
    display: none !important;
    background: none !important;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Частицы */
.voice-call-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: particleFloat 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 13s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 15s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 17s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2.5s; animation-duration: 14s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4.5s; animation-duration: 16s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(100px) scale(1.5);
        opacity: 0;
    }
}

.voice-call-modal.active .particle {
    animation-duration: 8s;
    background: rgba(99, 102, 241, 0.8);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

/* Волны */

/* Заголовок */
.voice-call-header {
    position: absolute;
    top: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    z-index: 10004;
    background: none !important; /* Убираем градиент */
}

.voice-call-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.voice-call-header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.voice-call-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-end;
    flex: 1;
}

/* Анимированный круг вместо статуса */
.voice-call-animated-circle-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.voice-call-animated-circle {
    width: 80px;
    height: 80px;
    position: relative;
    z-index: 10007; /* Выше всего для видимости */
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-status-text {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-align: center;
    min-height: 1.25rem;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.voice-call-animated-circle.idle ~ .circle-status-text {
    color: rgba(255, 255, 255, 0.6);
}

.voice-call-animated-circle.listening ~ .circle-status-text {
    color: rgba(59, 130, 246, 0.95);
}

.voice-call-animated-circle.speaking ~ .circle-status-text {
    color: rgba(168, 85, 247, 0.95);
}

.voice-call-animated-circle.processing ~ .circle-status-text {
    color: rgba(251, 191, 36, 0.95);
}

.circle-core {
    width: 75px;
    height: 75px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%, 
        rgba(139, 92, 246, 0.95), 
        rgba(99, 102, 241, 0.8), 
        rgba(59, 130, 246, 0.6)
    );
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(139, 92, 246, 0.6),
        0 0 40px rgba(99, 102, 241, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.2);
}

.circle-core::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent);
    transform: translate(-50%, -50%);
    animation: innerGlow 2s ease-in-out infinite;
}

.circle-pulse {
    position: absolute;
    width: 75px;
    height: 75px;
    border-radius: 50%;
    border: 2px solid rgba(59, 130, 246, 0.6);
    z-index: 1;
    animation: circlePulse 2s ease-in-out infinite;
}

.voice-call-animated-circle.idle .circle-core {
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.4), rgba(99, 102, 241, 0.3), rgba(59, 130, 246, 0.2));
    transform: scale(1);
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.4),
        0 0 30px rgba(99, 102, 241, 0.3),
        inset 0 0 15px rgba(255, 255, 255, 0.15);
}

.voice-call-animated-circle.idle .circle-pulse {
    border-color: rgba(255, 255, 255, 0.3);
    animation: circlePulseIdle 2s ease-in-out infinite;
}

.voice-call-animated-circle.listening .circle-core {
    background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.95), rgba(99, 102, 241, 0.85), rgba(139, 92, 246, 0.7));
    animation: circleListening 1.5s ease-in-out infinite;
    box-shadow: 
        0 0 25px rgba(59, 130, 246, 0.7),
        0 0 50px rgba(99, 102, 241, 0.5),
        inset 0 0 25px rgba(255, 255, 255, 0.3);
}

.voice-call-animated-circle.listening .circle-pulse {
    border-color: rgba(59, 130, 246, 0.8);
    animation: circlePulseListening 1.5s ease-in-out infinite;
}

.voice-call-animated-circle.speaking .circle-core {
    background: radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.95), rgba(236, 72, 153, 0.85), rgba(139, 92, 246, 0.7));
    animation: circleSpeaking 1s ease-in-out infinite;
    box-shadow: 
        0 0 25px rgba(168, 85, 247, 0.7),
        0 0 50px rgba(236, 72, 153, 0.5),
        inset 0 0 25px rgba(255, 255, 255, 0.3);
}

.voice-call-animated-circle.speaking .circle-pulse {
    border-color: rgba(168, 85, 247, 0.8);
    animation: circlePulseSpeaking 1s ease-in-out infinite;
}

.voice-call-animated-circle.processing .circle-core {
    background: radial-gradient(circle at 30% 30%, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.85), rgba(234, 179, 8, 0.7));
    animation: circleProcessing 1.2s ease-in-out infinite;
    box-shadow: 
        0 0 25px rgba(251, 191, 36, 0.7),
        0 0 50px rgba(245, 158, 11, 0.5),
        inset 0 0 25px rgba(255, 255, 255, 0.3);
}

.voice-call-animated-circle.processing .circle-pulse {
    border-color: rgba(251, 191, 36, 0.8);
    animation: circlePulseProcessing 0.8s ease-in-out infinite;
}

@keyframes innerGlow {
    0%, 100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

@keyframes circlePulseIdle {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
}

@keyframes circlePulseListening {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.4);
        opacity: 0.4;
    }
}

@keyframes circlePulseSpeaking {
    0%, 100% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.5);
    opacity: 0.3;
}
}

@keyframes circlePulseProcessing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.4;
    }
}

@keyframes circleListening {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.8);
    }
}

@keyframes circleSpeaking {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 35px rgba(168, 85, 247, 0.9);
    }
}

@keyframes circleProcessing {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 30px rgba(251, 191, 36, 0.8);
    }
}

.voice-call-status-indicator {
    display: none !important;
}

.voice-call-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-align: center;
    flex: 1;
}

.voice-call-settings,
.voice-call-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.voice-call-settings:hover,
.voice-call-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.voice-call-close {
    font-size: 1.5rem;
    line-height: 1;
}

/* Чат с сообщениями */

.voice-call-chat {
    position: relative;
    width: min(72vw, 1040px);
    min-width: 440px;
    max-width: 1040px;
    height: calc(70vh - 120px);
    margin: 7rem auto 0;
    overflow-y: auto;
    padding: 2rem 1.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    z-index: 10004;
    background: rgba(15, 18, 35, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    backdrop-filter: blur(30px);
    box-shadow: 0 28px 68px rgba(10, 12, 24, 0.48);
}

/* Telegram WebApp - ОТДЕЛЬНЫЕ стили для TG версии */
body.telegram-webapp .voice-call-modal {
    background: #1a0b2e !important; /* Фиолетовый фон как был раньше */
}

body.telegram-webapp .voice-call-modal::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3.5rem;
    background: #050507 !important;
    z-index: 10001;
    pointer-events: none;
}

body.telegram-webapp .voice-call-header {
    top: 3.5rem !important;
    padding: 0.75rem 1rem !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    background: none !important; /* Убираем градиент */
    z-index: 10002 !important;
}

/* В TG версии убираем кнопку закрыть и переносим settings влево */
body.telegram-webapp .voice-call-close {
    display: none !important;
}

body.telegram-webapp .voice-call-settings {
    margin-left: 0 !important;
    order: -1 !important;
}

body.telegram-webapp .voice-call-header-left,
body.telegram-webapp .voice-call-header-right {
    flex: 0 0 auto !important;
    min-width: 60px !important;
    display: flex !important;
    align-items: center !important;
}

body.telegram-webapp .voice-call-header-center {
    flex: 1 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

body.telegram-webapp .voice-call-animated-circle-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

body.telegram-webapp .voice-call-animated-circle {
    width: 75px !important;
    height: 75px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transform: translateY(-5px) !important;
}

body.telegram-webapp .circle-core {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
}

body.telegram-webapp .circle-pulse {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
}

body.telegram-webapp .circle-core::before {
    width: 35px !important;
    height: 35px !important;
    border-radius: 50% !important;
}

body.telegram-webapp .voice-call-chat {
    margin: 3.5rem auto 0 !important;
    height: calc(100vh - 200px) !important;
    padding: 1.5rem 1rem 0.5rem !important;
    margin-bottom: 100px !important;
}

body.telegram-webapp .voice-call-controls {
    bottom: 0.5rem !important;
    position: fixed !important;
    z-index: 10006 !important; /* Выше пузырей (10005) для взаимодействия */
}

body.telegram-webapp .voice-call-background,
body.telegram-webapp .voice-call-gradient,
body.telegram-webapp .voice-call-particles {
    display: none !important;
    background: none !important;
    opacity: 0 !important;
}

/* Включаем анимации шаров для TG версии */
body.telegram-webapp .voice-call-modal .animated-background,
body.telegram-webapp .voice-call-modal .floating-bubbles {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.telegram-webapp .voice-call-modal .sparks-background.active {
    display: block !important;
}

/* Новая красивая анимация с шариками для TG */
body.telegram-webapp .voice-call-modal::after {
    background: none !important;
    opacity: 0 !important;
    display: none !important;
}

/* Анимированные шарики поднимающиеся вверх - для всех версий */
.voice-call-modal {
    position: relative;
    overflow: visible !important; /* Разрешаем видимость пузырей */
}

/* Анимация искр - шарики поднимающиеся снизу вверх */
.voice-call-modal .sparks-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10002;
    pointer-events: none;
    overflow: hidden;
    display: none;
}

.voice-call-modal .sparks-background.active {
    display: block;
}

/* Искры - шарики */
.voice-call-modal .spark {
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(99, 102, 241, 0.9);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.8), 0 0 20px rgba(139, 92, 246, 0.6);
    bottom: 0;
    pointer-events: none;
    z-index: 10003;
    opacity: 0;
    animation: sparkRise 20s linear infinite;
}

/* Разные позиции по горизонтали */
.voice-call-modal .spark-1 { left: 10%; animation-delay: 0s; }
.voice-call-modal .spark-2 { left: 20%; animation-delay: 2s; }
.voice-call-modal .spark-3 { left: 30%; animation-delay: 4s; }
.voice-call-modal .spark-4 { left: 40%; animation-delay: 1s; }
.voice-call-modal .spark-5 { left: 50%; animation-delay: 3s; }
.voice-call-modal .spark-6 { left: 60%; animation-delay: 5s; }
.voice-call-modal .spark-7 { left: 70%; animation-delay: 2.5s; }
.voice-call-modal .spark-8 { left: 80%; animation-delay: 4.5s; }
.voice-call-modal .spark-9 { left: 15%; animation-delay: 1.5s; }
.voice-call-modal .spark-10 { left: 85%; animation-delay: 3.5s; }

/* Анимация подъема снизу вверх */
@keyframes sparkRise {
    0% {
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(20px) scale(1.2);
        opacity: 0;
    }
}

/* Скрываем старые анимации */
.voice-call-modal .floating-bubbles,
.voice-call-modal .bubble,
.voice-call-modal .animated-background,
.voice-call-modal .wave,
.voice-call-modal .particle,
.voice-call-modal .gradient-orb {
    display: none !important;
}

/* Скрываем старые анимации для всех версий */
.voice-call-background,
.voice-call-background,
.voice-call-gradient,
.voice-call-particles {
    display: none !important;
}

/* Убрали градиентный фон - теперь простой фиолетовый */
/* Пульсирующий градиентный фон для всех версий */
.voice-call-modal::after {
    background: none !important;
    opacity: 0 !important;
    display: none !important;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

@media (max-width: 768px) {
    body.telegram-webapp .voice-call-header {
        top: 3.5rem !important;
        padding: 0.75rem 0.75rem !important;
    }
    
    body.telegram-webapp .voice-call-chat {
        margin: 3rem auto 0 !important;
        height: calc(100vh - 180px) !important;
        padding: 1rem 0.75rem 0.5rem !important;
        margin-bottom: 90px !important;
    }
    
    body.telegram-webapp .voice-call-animated-circle {
        width: 65px !important;
        height: 65px !important;
    }
    
    body.telegram-webapp .circle-core {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
    }
    
    body.telegram-webapp .circle-pulse {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
    }
    
    body.telegram-webapp .circle-core::before {
        width: 30px !important;
        height: 30px !important;
        border-radius: 50% !important;
    }
}

@media (max-width: 768px) {
    .voice-call-modal {
        background: #1a0b2e !important; /* Простой фиолетовый фон */
    }
    
    .voice-call-background,
    .voice-call-gradient,
    .voice-call-particles,
    /* Включаем анимации шаров для мобильной версии */
    .voice-call-modal .floating-bubbles {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    .voice-call-modal .bubble {
        display: block !important;
        visibility: visible !important;
        opacity: 0.6 !important;
    }
    
    .voice-call-modal::after {
        background: none !important;
        opacity: 0 !important;
        display: none !important;
    }
    
    .voice-call-message {
        max-width: 100%;
    }
    .voice-call-header {
        top: 3rem;
    }
    .voice-call-content {
        padding: 7.6rem 0 4.8rem;
        gap: 2.2rem;
    }

    .voice-call-chat {
        width: calc(100vw - 1.5rem);
        min-width: 0;
        max-width: 560px;
        height: 58vh;
        margin-top: 5rem;
        padding: 1.8rem 1.9rem;
        gap: 1.1rem;
    }

    .voice-call-controls {
        width: calc(100vw - 1.5rem);
        min-width: 0;
        max-width: 560px;
        padding: 0 2rem 1rem;
        bottom: 1.5rem;
        gap: 1.5rem;
    }

    .voice-call-control-btn.voice-call-record {
        width: 80px;
        height: 80px;
    }
    
    .voice-call-control-btn.voice-call-record svg {
        width: 36px;
        height: 36px;
    }
    
    .voice-call-animated-circle {
        width: 90px;
        height: 90px;
    }
    
    .circle-core {
        width: 70px;
        height: 70px;
    }
    
    .circle-core::before {
        width: 35px;
        height: 35px;
    }
    
    .circle-pulse {
        width: 70px;
        height: 70px;
    }
    
    .circle-status-text {
        font-size: 0.8rem;
    }
    
    .mic-hint {
        font-size: 0.7rem;
    }
}

.voice-call-chat::-webkit-scrollbar {
    width: 4px;
}

.voice-call-chat::-webkit-scrollbar-track {
    background: transparent;
}

.voice-call-chat::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.voice-call-chat::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(circle at 15% 10%, rgba(123, 154, 255, 0.18), transparent 45%),
                radial-gradient(circle at 85% 20%, rgba(236, 72, 153, 0.2), transparent 50%),
                radial-gradient(circle at 40% 85%, rgba(59, 130, 246, 0.16), transparent 55%);
    opacity: 0.75;
    z-index: 0;
}

.voice-call-message {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 100%;
    animation: messageSlideIn 0.4s ease-out;
    padding: 0.2rem;
    border-radius: 22px;
    z-index: 1;
}

/* Кнопки действий под сообщением */
.message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.voice-call-message:hover .message-actions {
    opacity: 1;
}

.msg-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s;
}

.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.msg-action-btn:active {
    transform: translateY(0);
}

.msg-action-btn svg {
    width: 14px;
    height: 14px;
}

.voice-call-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.voice-call-message.assistant {
    align-self: flex-start;
    flex-direction: row;
}

.message-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    transition: all 0.3s ease;
}

.message-avatar::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.voice-call-message:hover .message-avatar::before {
    opacity: 1;
}

.user-avatar {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.4) 0%, 
        rgba(99, 102, 241, 0.4) 50%,
        rgba(139, 92, 246, 0.4) 100%);
    border: 2.5px solid rgba(59, 130, 246, 0.6);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 4px 15px rgba(59, 130, 246, 0.3),
        inset 0 0 20px rgba(99, 102, 241, 0.2);
}

.assistant-avatar {
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.4) 0%, 
        rgba(236, 72, 153, 0.4) 50%,
        rgba(251, 113, 133, 0.4) 100%);
    border: 2.5px solid rgba(168, 85, 247, 0.6);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 4px 15px rgba(168, 85, 247, 0.3),
        inset 0 0 20px rgba(236, 72, 153, 0.2);
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
    flex: 1;
    min-width: 0;
}

.message-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 600;
    padding: 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.message-text {
    background: rgba(255, 255, 255, 0.12);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1rem 0.75rem; /* Уменьшен горизонтальный padding для большей ширины текста */
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    word-break: break-word;
    backdrop-filter: blur(15px);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.message-text::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%);
}

.voice-call-message.user .message-text {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.3) 0%, 
        rgba(99, 102, 241, 0.3) 50%,
        rgba(139, 92, 246, 0.3) 100%);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 
        0 8px 24px rgba(59, 130, 246, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.voice-call-message.assistant .message-text {
    background: linear-gradient(135deg, 
        rgba(168, 85, 247, 0.3) 0%, 
        rgba(236, 72, 153, 0.3) 50%,
        rgba(251, 113, 133, 0.3) 100%);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 
        0 8px 24px rgba(168, 85, 247, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.voice-call-message::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.voice-call-message:hover::after {
    opacity: 0.35;
}

.voice-call-message:hover .message-text {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(20, 25, 60, 0.4);
    border-color: rgba(255, 255, 255, 0.35);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* Старые стили для планеты - убраны */
.planet {
    display: none !important;
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 300px !important;
    height: 300px !important;
    min-width: 300px;
    min-height: 300px;
    max-width: 300px;
    max-height: 300px;
    border-radius: 50%;
    background: 
        /* Солнечный градиент с сиянием - анимированный */
        conic-gradient(from 0deg at 50% 50%, 
            rgba(255, 215, 0, 0.9) 0deg,
            rgba(255, 165, 0, 0.85) 45deg,
            rgba(255, 140, 0, 0.8) 90deg,
            rgba(255, 69, 0, 0.75) 135deg,
            rgba(255, 215, 0, 0.85) 180deg,
            rgba(255, 223, 0, 0.9) 225deg,
            rgba(255, 200, 0, 0.8) 270deg,
            rgba(255, 228, 181, 0.85) 315deg,
            rgba(255, 215, 0, 0.9) 360deg),
        /* Солнечное свечение - множественные слои */
        radial-gradient(ellipse at 30% 30%, rgba(255, 215, 0, 0.7) 0%, rgba(255, 165, 0, 0.5) 20%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 223, 0, 0.6) 0%, rgba(255, 140, 0, 0.4) 25%, transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 250, 205, 0.5) 0%, rgba(255, 215, 0, 0.3) 30%, transparent 60%),
        radial-gradient(ellipse at 20% 50%, rgba(255, 218, 185, 0.4) 0%, rgba(255, 140, 0, 0.25) 35%, transparent 65%),
        radial-gradient(ellipse at 80% 50%, rgba(255, 228, 181, 0.4) 0%, rgba(255, 165, 0, 0.25) 35%, transparent 65%),
        radial-gradient(ellipse at 50% 20%, rgba(255, 239, 213, 0.5) 0%, rgba(255, 215, 0, 0.3) 30%, transparent 60%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 248, 220, 0.5) 0%, rgba(255, 223, 0, 0.3) 30%, transparent 60%),
        /* Внешний космос */
        radial-gradient(circle at 50% 50%, #1a0a00 0%, #0d0500 25%, #050200 50%, #000000 75%, #000000 100%);
    background-size: 200% 200%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    box-shadow: 
        inset -80px -80px 160px rgba(0, 0, 0, 0.98),
        inset 80px 80px 160px rgba(255, 215, 0, 0.4),
        inset 0 0 120px rgba(255, 165, 0, 0.3),
        inset 0 0 200px rgba(255, 140, 0, 0.2),
        0 0 100px rgba(255, 215, 0, 0.9),
        0 0 200px rgba(255, 165, 0, 0.7),
        0 0 300px rgba(255, 140, 0, 0.5),
        0 0 400px rgba(255, 215, 0, 0.4);
    animation: planetRotate 30s linear infinite, planetGlowPulse 4s ease-in-out infinite, gradientFlow 15s ease-in-out infinite, cosmicShimmer 8s ease-in-out infinite, colorShift 10s ease-in-out infinite;
    overflow: visible;
    transition: none !important;
    filter: brightness(1.15) saturate(1.2);
    border: 2px solid rgba(255, 215, 0, 0.4);
    will-change: transform, filter, box-shadow;
    backface-visibility: hidden;
}

.planet::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110%;
    height: 110%;
    border-radius: 50%;
    background: 
        radial-gradient(ellipse at 40% 40%, rgba(255, 215, 0, 0.8) 0%, rgba(255, 165, 0, 0.6) 30%, transparent 70%),
        radial-gradient(ellipse at 60% 60%, rgba(255, 223, 0, 0.7) 0%, rgba(255, 140, 0, 0.5) 35%, transparent 75%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 250, 205, 0.6) 0%, rgba(255, 215, 0, 0.4) 40%, transparent 80%);
    opacity: 0.95;
    filter: blur(20px);
    animation: planetOrbit1 12s linear infinite, glowPulse 3s ease-in-out infinite, gradientFlowInner 10s ease-in-out infinite;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    mix-blend-mode: screen;
}

.planet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    background: 
        radial-gradient(circle at 35% 35%, rgba(255, 215, 0, 0.8) 0%, rgba(255, 165, 0, 0.6) 20%, transparent 55%),
        radial-gradient(circle at 65% 65%, rgba(255, 223, 0, 0.7) 0%, rgba(255, 140, 0, 0.5) 25%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(255, 250, 205, 0.6) 0%, rgba(255, 215, 0, 0.4) 15%, transparent 50%),
        radial-gradient(circle at 25% 50%, rgba(255, 218, 185, 0.5) 0%, rgba(255, 140, 0, 0.3) 20%, transparent 55%),
        radial-gradient(circle at 75% 50%, rgba(255, 228, 181, 0.5) 0%, rgba(255, 165, 0, 0.3) 20%, transparent 55%);
    opacity: 0.7;
    filter: blur(28px);
    animation: planetOrbit2 12s linear infinite reverse, cosmicGlow 3.5s ease-in-out infinite, nebulaShift 7s ease-in-out infinite;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    mix-blend-mode: screen;
}

@keyframes planetOrbit1 {
    0% {
        transform: rotate(0deg) translateX(30px) translateY(-15px) rotate(0deg);
    }
    100% {
        transform: rotate(360deg) translateX(30px) translateY(-15px) rotate(-360deg);
    }
}

@keyframes planetOrbit2 {
    0% {
        transform: rotate(0deg) translateX(-25px) translateY(20px) rotate(0deg);
    }
    100% {
        transform: rotate(-360deg) translateX(-25px) translateY(20px) rotate(360deg);
    }
}

@keyframes planetGlowPulse {
    0%, 100% {
        filter: brightness(1.2) saturate(1.3);
        box-shadow: 
            inset -80px -80px 160px rgba(0, 0, 0, 0.98),
            inset 80px 80px 160px rgba(255, 215, 0, 0.4),
            inset 0 0 120px rgba(255, 165, 0, 0.3),
            inset 0 0 200px rgba(255, 140, 0, 0.2),
            0 0 100px rgba(255, 215, 0, 0.9),
            0 0 200px rgba(255, 165, 0, 0.7),
            0 0 300px rgba(255, 140, 0, 0.5),
            0 0 400px rgba(255, 215, 0, 0.4);
    }
    50% {
        filter: brightness(1.4) saturate(1.5);
        box-shadow: 
            inset -80px -80px 160px rgba(0, 0, 0, 0.98),
            inset 80px 80px 160px rgba(255, 215, 0, 0.6),
            inset 0 0 120px rgba(255, 165, 0, 0.5),
            inset 0 0 200px rgba(255, 140, 0, 0.35),
            0 0 120px rgba(255, 215, 0, 1),
            0 0 250px rgba(255, 165, 0, 0.9),
            0 0 350px rgba(255, 140, 0, 0.7),
            0 0 450px rgba(255, 215, 0, 0.6);
    }
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
    25% {
        background-position: 50% 25%, 25% 50%, 75% 25%, 25% 75%, 75% 50%, 50% 25%, 50% 75%, 25% 50%;
    }
    50% {
        background-position: 100% 50%, 50% 100%, 0% 50%, 50% 0%, 0% 100%, 100% 0%, 100% 100%, 0% 0%;
    }
    75% {
        background-position: 50% 75%, 75% 50%, 25% 75%, 75% 25%, 25% 50%, 50% 75%, 50% 25%, 75% 50%;
    }
    100% {
        background-position: 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%;
    }
}

@keyframes gradientFlowInner {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) scale(1.1);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0%, 100% {
        filter: blur(20px) brightness(1);
        opacity: 0.8;
    }
    50% {
        filter: blur(25px) brightness(1.3);
        opacity: 1;
    }
}

@keyframes cosmicShimmer {
    0%, 100% {
        filter: brightness(1.15) saturate(1.2) hue-rotate(0deg);
    }
    25% {
        filter: brightness(1.25) saturate(1.3) hue-rotate(15deg);
    }
    50% {
        filter: brightness(1.3) saturate(1.4) hue-rotate(30deg);
    }
    75% {
        filter: brightness(1.25) saturate(1.3) hue-rotate(15deg);
    }
}


@keyframes cosmicGlow {
    0%, 100% {
        opacity: 0.5;
        filter: blur(25px);
    }
    50% {
        opacity: 0.8;
        filter: blur(30px);
    }
}

@keyframes planetPulse {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.15);
    }
}

@keyframes planetRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes colorShift {
    0%, 100% {
        filter: brightness(1.15) saturate(1.2) hue-rotate(0deg);
    }
    25% {
        filter: brightness(1.2) saturate(1.3) hue-rotate(10deg);
    }
    50% {
        filter: brightness(1.25) saturate(1.35) hue-rotate(20deg);
    }
    75% {
        filter: brightness(1.2) saturate(1.3) hue-rotate(10deg);
    }
}

@keyframes starFloat {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0px) translateX(0px);
    }
    33% {
        transform: translate(-50%, -50%) translateY(-5px) translateX(3px);
    }
    66% {
        transform: translate(-50%, -50%) translateY(3px) translateX(-3px);
    }
}

@keyframes nebulaShift {
    0%, 100% {
        opacity: 0.65;
        filter: blur(28px);
    }
    50% {
        opacity: 0.8;
        filter: blur(32px);
    }
}



/* Анимация пульса микрофона */
.mic-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    border-radius: 50%;
    border: 3px solid rgba(255, 215, 0, 0.7);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 40px rgba(255, 165, 0, 0.8);
}

.voice-call-modal.active .mic-pulse {
    animation: micPulse 1.5s ease-out infinite;
}

.voice-call-modal.active .mic-pulse:nth-child(2) {
    animation-delay: 0.5s;
}

.voice-call-modal.active .mic-pulse:nth-child(3) {
    animation-delay: 1s;
}

@keyframes micPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.7;
        border-color: rgba(138, 43, 226, 0.6);
        box-shadow: 0 0 40px rgba(75, 0, 130, 0.7);
    }
    100% {
        transform: translate(-50%, -50%) scale(2.8);
        opacity: 0;
        border-color: rgba(255, 215, 0, 0.3);
        box-shadow: 0 0 80px rgba(255, 215, 0, 0.4);
    }
}

/* Эффект при активации микрофона - фиксированный размер */
.voice-call-modal.active .planet {
    width: 300px !important;
    height: 300px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    box-shadow: 
        inset -80px -80px 160px rgba(0, 0, 0, 0.98),
        inset 80px 80px 160px rgba(255, 215, 0, 0.7),
        inset 0 0 140px rgba(255, 165, 0, 0.6),
        inset 0 0 220px rgba(255, 140, 0, 0.4),
        0 0 150px rgba(255, 215, 0, 1),
        0 0 300px rgba(255, 165, 0, 0.95),
        0 0 450px rgba(255, 140, 0, 0.8),
        0 0 600px rgba(255, 215, 0, 0.6);
    animation: planetRotate 25s linear infinite, planetGlowPulse 2.5s ease-in-out infinite, cosmicShimmer 3s ease-in-out infinite, colorShift 6s ease-in-out infinite;
    filter: brightness(1.5) saturate(1.6);
    border-color: rgba(255, 215, 0, 0.7);
}

.voice-call-modal.active .planet::before {
    opacity: 1;
    animation: cosmicTwinkle 2s ease-in-out infinite, planetOrbit1 10s linear infinite;
    filter: blur(3px);
}

.voice-call-modal.active .planet::after {
    opacity: 0.9;
    animation: planetOrbit2 12s linear infinite reverse, cosmicGlow 3s ease-in-out infinite;
    filter: blur(35px);
}


.voice-call-backdrop {
    display: none;
}

.voice-call-content {
    position: relative;
    background: transparent;
    border-radius: 0;
    padding: 9rem 0 6rem;
    max-width: 100%;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    z-index: 10004; /* Над пузырями (10003) чтобы контент был виден */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 3rem;
}

/* Старые элементы - скрыты */
.voice-call-sphere,
.voice-call-transcript,
.cosmic-background,
.planet,
.stars,
.mic-pulse {
    display: none !important;
}

/* Эффекты при активации (когда говорят) */
.voice-call-sphere.active {
    animation: spherePulse 0.8s ease-in-out infinite, sphereReact 0.2s ease-in-out infinite;
    box-shadow: 
        0 0 100px rgba(138, 43, 226, 1),
        0 0 180px rgba(0, 191, 255, 0.8),
        0 0 260px rgba(138, 43, 226, 0.6);
    background: radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.5) 0%, transparent 70%);
}

@keyframes spherePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 60px rgba(138, 43, 226, 0.6),
            0 0 120px rgba(0, 191, 255, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 
            0 0 80px rgba(138, 43, 226, 0.8),
            0 0 160px rgba(0, 191, 255, 0.6);
    }
}

@keyframes sphereReact {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08);
    }
}






.voice-call-controls {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(72vw, 1040px);
    min-width: 440px;
    max-width: 1040px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.2rem;
    z-index: 10006; /* Выше пузырей (10005) для взаимодействия */
    padding: 0 3.4rem 1.2rem;
}

.voice-call-control-btn.voice-call-record {
    width: 88px;
    height: 88px;
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.45);
    color: rgba(241, 245, 255, 0.95);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
    animation: micButtonPulse 2s ease-in-out infinite;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.mic-button-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.mic-hint {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    opacity: 0.9;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.voice-call-control-btn.voice-call-record {
    width: 88px;
    height: 88px;
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.45);
    color: rgba(241, 245, 255, 0.95);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
    animation: micButtonPulse 2s ease-in-out infinite;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.voice-call-control-btn.voice-call-record.muted {
    opacity: 1;
    animation: none;
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.voice-call-control-btn.voice-call-record.muted svg path {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.9) !important;
}

.voice-call-control-btn.voice-call-record:not(.muted) {
    background: rgba(34, 197, 94, 0.3) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.3);
}

.voice-call-control-btn.voice-call-record:not(.muted) svg path {
    fill: none !important;
    stroke: rgba(255, 255, 255, 0.9) !important;
}


@keyframes micButtonPulse {
    0%, 100% {
        box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3), 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5), 0 0 0 8px rgba(59, 130, 246, 0);
    }
}

@keyframes micButtonRing {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.15);
    }
}

@keyframes micButtonClick {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.88);
    }
    100% {
        transform: scale(0.92);
    }
}

.voice-call-control-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.voice-call-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.voice-call-control-btn:active {
    transform: scale(0.95);
}

.voice-call-control-btn.voice-call-record {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.45);
    color: rgba(241, 245, 255, 0.95);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.3);
}

.voice-call-control-btn.voice-call-record:hover {
    background: rgba(59, 130, 246, 0.35);
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 12px 26px rgba(59, 130, 246, 0.35);
}

.voice-call-control-btn.voice-call-record:active {
    transform: scale(0.94);
}

.voice-call-end {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border-color: rgba(239, 68, 68, 0.5);
}

.voice-call-end:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.5) 0%, rgba(220, 38, 38, 0.5) 100%);
    border-color: rgba(239, 68, 68, 0.7);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.voice-call-control-btn:active {
    transform: scale(0.95);
}

.voice-call-control-btn.voice-call-end {
    background: rgba(255, 59, 48, 0.3);
    border-color: rgba(255, 59, 48, 0.5);
}

.voice-call-control-btn.voice-call-end:hover {
    background: rgba(255, 59, 48, 0.5);
    border-color: rgba(255, 59, 48, 0.7);
}

.voice-call-control-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
}

/* Стили для кнопки микрофона */
.voice-call-control-btn.muted {
    opacity: 0.5;
    position: relative;
}

.voice-call-control-btn.muted::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 32px;
    background: rgba(239, 68, 68, 0.9);
    transform: translate(-50%, -50%) rotate(45deg);
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.6);
    animation: muteStrike 0.3s ease-out;
}

.voice-call-control-btn:not(.muted)::after {
    display: none;
}

/* Voice Selection Modal Styles - новый дизайн */
.voice-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10010 !important;
    display: none;
    align-items: center;
    justify-content: center;
}

.voice-selection-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.voice-selection-content-new {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f1419 100%);
    border-radius: 24px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    z-index: 10001;
    animation: voiceModalSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(138, 43, 226, 0.3);
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.voice-selection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-selection-title-new {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.voice-selection-title-new svg {
    color: rgba(138, 43, 226, 0.8);
}

.voice-selection-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    padding: 0;
}

.voice-selection-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
    color: #ffffff;
}

.voice-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 600px) {
    .voice-options-grid {
        grid-template-columns: 1fr;
    }
}

.voice-option-new {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.1) 0%, rgba(75, 0, 130, 0.05) 100%);
    border: 2px solid rgba(138, 43, 226, 0.2);
    border-radius: 16px;
    padding: 1.2rem 1.25rem 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
}

.voice-option-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.voice-option-new:hover::before {
    left: 100%;
}

.voice-option-new:hover {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.25) 0%, rgba(75, 0, 130, 0.15) 100%);
    border-color: rgba(138, 43, 226, 0.5);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.3), 0 0 20px rgba(138, 43, 226, 0.2);
}

.voice-option-new.active {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.4) 0%, rgba(75, 0, 130, 0.3) 100%);
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.5), inset 0 0 20px rgba(138, 43, 226, 0.2);
    transform: scale(1.05);
}

.voice-option-new.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: rgba(138, 43, 226, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.voice-option-icon {
    font-size: 2.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.voice-option-new.active .voice-option-icon {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.voice-option-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    text-align: left;
}

.voice-option-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    text-align: left;
}

.voice-option-main {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.voice-option-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.voice-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    align-self: flex-start;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

.voice-preview-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.voice-preview-btn.loading {
    cursor: wait;
    opacity: 0.75;
}

.voice-preview-btn.playing {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.4) 0%, rgba(59, 130, 246, 0.35) 100%);
    border-color: rgba(236, 72, 153, 0.5);
    color: #ffffff;
}

.voice-option-new.active .voice-preview-btn {
    border-color: rgba(255, 255, 255, 0.35);
}

/* Yandex Voices Grid */
.voice-options-grid-yandex {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    padding: 1rem;
}

.voice-option-yandex {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.15) 0%, rgba(75, 0, 130, 0.1) 100%);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 14px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
}

.voice-option-yandex:hover {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.25) 0%, rgba(75, 0, 130, 0.2) 100%);
    border-color: rgba(138, 43, 226, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(138, 43, 226, 0.3);
}

.voice-option-yandex.active {
    background: linear-gradient(135deg, rgba(138, 43, 226, 0.4) 0%, rgba(75, 0, 130, 0.3) 100%);
    border-color: rgba(138, 43, 226, 0.8);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.5);
}

.voice-option-yandex.active::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: rgba(138, 43, 226, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
}

.voice-option-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.voice-gender-badge {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.voice-gender-badge.female {
    filter: drop-shadow(0 0 6px rgba(255, 105, 180, 0.6));
}

.voice-gender-badge.male {
    filter: drop-shadow(0 0 6px rgba(59, 130, 246, 0.6));
}

.voice-name-block {
    flex: 1;
    min-width: 0;
}

.voice-name {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.2rem;
}

.voice-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.voice-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(138, 43, 226, 0.3);
    border: 2px solid rgba(138, 43, 226, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all 0.2s;
    flex-shrink: 0;
}

.voice-play-btn:hover {
    background: rgba(138, 43, 226, 0.5);
    border-color: rgba(138, 43, 226, 0.8);
    transform: scale(1.1);
}

.voice-play-btn:active {
    transform: scale(0.95);
}

.voice-selection-content {
    position: relative;
    background: #1c1c1c;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
    animation: voiceModalSlideIn 0.3s ease-out;
}

.voice-selection-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
}

.voice-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.voice-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: voicePulse 2s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(20, 184, 166, 0);
    }
}

.voice-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.voice-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(20, 184, 166, 0.5);
}

.voice-option.active {
    background: rgba(20, 184, 166, 0.2);
    border-color: #14b8a6;
}

.voice-info {
    flex: 1;
}

.voice-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.voice-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.voice-arrow {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 0.5rem;
}

.voice-selection-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.voice-start-btn {
    width: 100%;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0f766e 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-start-btn:hover {
    background: linear-gradient(135deg, #5eead4 0%, #14b8a6 50%, #0d9488 100%);
    transform: translateY(-2px);
}

.voice-cancel-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes voiceModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

