:root {
            --widget-bg-color: #FFFFFF;
            --header-gradient-start: #52AE32; 
            --header-gradient-end: #78BE20; 
            --header-text-color: #FFFFFF; 
            --online-indicator-color: #78BE20; 
            --message-area-bg: #FFFFFF;
            --assistant-bubble-bg: #F0F7ED; 
            --assistant-text-color: #1A1A1A;
            --user-bubble-bg: #52AE32; 
            --user-text-color: #FFFFFF; 
            --quick-reply-border: #52AE32;
            --quick-reply-text: #52AE32;
            --quick-reply-bg: #FFFFFF;
            --quick-reply-bg-hover: #F0F7ED;
            --quick-reply-bg-active: #52AE32;
            --quick-reply-text-active: #FFFFFF;
            --input-placeholder-color: #8A9A82;
            --input-text-color: #212529;
            --input-area-border-color: #E0EAD9; 
            --send-button-gradient-start: #52AE32;
            --send-button-gradient-end: #78BE20;
            --icon-color: #5A7A50; 
            --widget-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
            --widget-border-radius: 20px;
            --dropdown-bg: #FFFFFF;
            --dropdown-shadow: 0 4px 12px rgba(0,0,0,0.1);
            --dropdown-item-hover-bg: #F0F7ED;
            --dropdown-text-color: #212529;
            --code-bg: #E0EAD9;
            --code-text: #212529;
            --link-color: #52AE32;
            --body-bg: #F5FAF3; 
            --dark-mode-toggle-bg: #F0F7ED;
            --dark-mode-toggle-icon: #5A7A50;
            --dark-mode-toggle-bg-hover: #E0EAD9;
        }

        html[data-theme="dark"] {
            --widget-bg-color: #1A2318; 
            --header-gradient-start: #3D8A26;
            --header-gradient-end: #52AE32;
            --header-text-color: #FFFFFF; 
            --message-area-bg: #1A2318;
            --assistant-bubble-bg: #263324; 
            --assistant-text-color: #E8F0E5; 
            --user-bubble-bg: #52AE32;
            --user-text-color: #FFFFFF; 
            --quick-reply-border: #78BE20;
            --quick-reply-text: #78BE20;
            --quick-reply-bg: #263324;
            --quick-reply-bg-hover: #344532;
            --quick-reply-bg-active: #52AE32;
            --quick-reply-text-active: #FFFFFF;
            --input-placeholder-color: #8A9A82; 
            --input-text-color: #E8F0E5;
            --input-area-border-color: #344532;
            --send-button-gradient-start: #3D8A26;
            --send-button-gradient-end: #52AE32;
            --icon-color: #A0B89A; 
            --widget-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
            --dropdown-bg: #263324;
            --dropdown-shadow: 0 4px 12px rgba(0,0,0,0.25);
            --dropdown-item-hover-bg: #344532;
            --dropdown-text-color: #E8F0E5;
            --code-bg: #263324;
            --code-text: #E8F0E5;
            --link-color: #78BE20;
            --body-bg: #0F1610; 
            --dark-mode-toggle-bg: #263324;
            --dark-mode-toggle-icon: #A0B89A;
            --dark-mode-toggle-bg-hover: #344532;
        }

        @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

        html, body {
            height: 100%;
            margin: 0;
        }

        body {
            font-family: 'Roboto', Arial, sans-serif;
            background-color: var(--body-bg);
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.3s ease;
        }

        .chat-widget {
            width: 700px;
            height: 800px;
            max-height: 90vh;
            background-color: var(--widget-bg-color);
            border-radius: var(--widget-border-radius);
            box-shadow: var(--widget-shadow);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
            z-index: 10;
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
        }

        .widget-header {
            background: linear-gradient(135deg, var(--header-gradient-start), var(--header-gradient-end));
            color: var(--header-text-color);
            padding: 20px 25px;
            display: flex;
            flex-direction: column;
            position: relative;
            border-top-left-radius: var(--widget-border-radius);
            border-top-right-radius: var(--widget-border-radius);
            z-index: 10;
            padding-bottom: 45px;
            transition: background 0.3s ease;
        }

        .widget-header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30px;
            background-color: var(--message-area-bg);
            border-top-left-radius: 50% 20px;
            border-top-right-radius: 50% 20px;
            transform: translateY(1px);
            transition: background-color 0.3s ease;
        }


        .header-main-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: relative;
            z-index: 1;
        }

        .header-avatar-title {
            display: flex;
            align-items: center;
        }

        .header-avatar {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #FFF; 
            margin-right: 15px;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
            border: 2px solid rgba(255,255,255,0.5);
        }
        .header-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .header-title {
            font-size: 1.25rem;
            font-weight: 500;
            color: var(--header-text-color); 
        }

        .header-actions {
            display: flex;
            align-items: center;
            position: relative;
        }
        .header-actions .icon-button {
            background: none;
            border: none;
            color: var(--header-text-color);
            padding: 7px;
            margin-left: 12px;
            cursor: pointer;
            opacity: 0.9;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
        }
        .header-actions .icon-button:hover {
            opacity: 1;
            background-color: rgba(255,255,255,0.2);
        }
        .header-actions .icon-button svg {
            width: 24px;
            height: 24px;
            fill: currentColor;
        }
        #darkModeToggle {
            margin-left: 0; 
            padding: 8px;
            background-color: var(--dark-mode-toggle-bg);
            border-radius: 50%;
            color: var(--dark-mode-toggle-icon);
            transition: background-color 0.2s ease, color 0.2s ease;
        }
        #darkModeToggle:hover {
            background-color: var(--dark-mode-toggle-bg-hover);
        }

        .header-status-row {
            margin-top: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.85rem;
            opacity: 0; 
            max-height: 0; 
            overflow: hidden;
            transition: opacity 0.4s ease, max-height 0.4s ease, margin-top 0.4s ease;
            color: var(--header-text-color);
            position: relative;
            z-index: 1;
            padding: 0 15px; 
            border-radius: 12px;
            background-color: rgba(255, 255, 255, 0.2); 
        }

        .header-status-row.active {
            opacity: 1;
            max-height: 40px; 
            margin-top: 15px; 
            padding: 6px 15px; 
        }
        
        .header-status-row .icon {
            margin-right: 8px;
            font-size: 1rem;
        }

        .online-indicator {
            width: 10px;
            height: 10px;
            background-color: var(--online-indicator-color);
            border-radius: 50%;
            margin-right: 8px;
            box-shadow: 0 0 6px var(--online-indicator-color);
        }

        .dropdown-menu {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            background-color: var(--dropdown-bg);
            border-radius: 8px;
            box-shadow: var(--dropdown-shadow);
            padding: 8px 0;
            z-index: 100;
            min-width: 190px;
            list-style: none;
            margin: 0;
            transition: background-color 0.3s ease, box-shadow 0.3s ease;
        }
        .dropdown-menu.active { display: block; }
        .dropdown-menu li {
            padding: 10px 18px;
            font-size: 0.95rem;
            color: var(--dropdown-text-color);
            cursor: pointer;
            display: flex;
            align-items: center;
            transition: background-color 0.2s ease, color 0.3s ease;
        }
        .dropdown-menu li:hover { background-color: var(--dropdown-item-hover-bg); }
        .dropdown-menu li .flag-icon {
            width: 22px;
            height: 22px; 
            margin-right: 12px;
            border: 1px solid #DDD;
            border-radius: 50%; 
            object-fit: cover; 
            flex-shrink: 0;
        }


        .chat-messages-container {
            flex-grow: 1;
            background-color: var(--message-area-bg);
            padding: 20px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 18px;
            scroll-behavior: smooth;
            position: relative;
            z-index: 1;
            transition: background-color 0.3s ease;
        }
        .chat-messages-container::-webkit-scrollbar { display: none; }
        .chat-messages-container { -ms-overflow-style: none; scrollbar-width: none; }

        .message-wrapper { display: flex; flex-direction: column; max-width: 85%; }
        .message-bubble {
            margin-top: 0;
            padding: 12px 18px;
            border-radius: 18px;
            font-size: 0.95rem;
            line-height: 1.5;
            word-wrap: break-word;
            transition: background-color 0.3s ease, color 0.3s ease;
        }
        .assistant-message { align-self: flex-start; }
        .assistant-message .message-bubble {
            background-color: var(--assistant-bubble-bg);
            color: var(--assistant-text-color);
            border-bottom-left-radius: 6px;
        }
        .user-message { align-self: flex-end; }
        .user-message .message-bubble {
            background-color: var(--user-bubble-bg);
            color: var(--user-text-color);
            border-bottom-right-radius: 6px;
        }
        .message-bubble p:last-child { margin-bottom: 0; }
        .message-bubble ul, .message-bubble ol { padding-left: 20px; margin: 0.5em 0; }
        .message-bubble li { margin-bottom: 0.25em; }
        .message-bubble a { color: var(--link-color); text-decoration: underline; transition: color 0.3s ease; }
        .message-bubble code {
            background-color: var(--code-bg); color: var(--code-text);
            padding: 0.2em 0.4em; border-radius: 4px; font-size: 0.9em;
            font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
            transition: background-color 0.3s ease, color 0.3s ease;
        }
        .message-bubble pre {
            background-color: var(--code-bg); color: var(--code-text);
            padding: 0.8em; border-radius: 6px; overflow-x: auto; margin: 0.5em 0;
            font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
            font-size: 0.9em;
            transition: background-color 0.3s ease, color 0.3s ease;
        }
        .message-bubble pre code { background-color: transparent; padding: 0; }
        .message-bubble h1, .message-bubble h2, .message-bubble h3 { margin-top: 0.8em; margin-bottom: 0.4em; line-height: 1.3; }
        .message-animation { animation: fadeIn 0.3s ease-out; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        .widget-input-area {
            background-color: var(--widget-bg-color);
            padding: 15px 20px;
            border-top: 1px solid var(--input-area-border-color);
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
            min-height: 5.5em;
            height: 5.5em;
            max-height: 5.5em;
            z-index: 5;
            border-bottom-left-radius: var(--widget-border-radius);
            border-bottom-right-radius: var(--widget-border-radius);
            transition: background-color 0.3s ease, border-top-color 0.3s ease;
        }
        
        .widget-input-area .input-wrapper {
            flex-grow: 1;
            position: relative;
            display: flex;
            align-items: center;
        }
        
        .widget-input-area .icon-button { 
            background: none; 
            border: none; 
            padding: 8px; 
            cursor: pointer; 
            color: var(--icon-color); 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            flex-shrink: 0; 
            transition: color 0.3s ease; 
        }
        .widget-input-area .icon-button:hover svg { fill: var(--send-button-gradient-start); }
        .widget-input-area .icon-button svg { width: 24px; height: 24px; fill: currentColor; transition: fill 0.2s ease-in-out; }
        .widget-input-area input[type="text"] {
            flex-grow: 1; 
            border: none; 
            outline: none; 
            background-color: transparent;
            font-size: 1rem; 
            color: var(--input-text-color); 
            padding: 10px 0;
            min-height: 24px;  
            height: auto;     
            font-family: 'Roboto', Arial, sans-serif;
            transition: color 0.3s ease, opacity 0.2s ease;
        }
        .widget-input-area input[type="text"]::placeholder { 
            color: var(--input-placeholder-color); 
            font-weight: 400; 
            transition: color 0.3s ease; 
        }
        
        .voice-button {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--send-button-gradient-start), var(--send-button-gradient-end));
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            position: relative;
            box-shadow: 0 3px 8px rgba(82, 174, 50, 0.4);
            transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background 0.3s ease, opacity 0.2s ease;
        }
        
        .voice-button:hover {
            box-shadow: 0 4px 12px rgba(82, 174, 50, 0.5);
        }
        
        .voice-button svg {
            width: 24px;
            height: 24px;
            fill: currentColor;
        }
        
        .voice-button.hidden {
            display: none;
        }
        
        .send-button {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--send-button-gradient-start), var(--send-button-gradient-end));
            color: white; 
            border: none; 
            cursor: pointer; 
            display: none;
            align-items: center;
            justify-content: center; 
            flex-shrink: 0;
            box-shadow: 0 3px 8px rgba(82, 174, 50, 0.4);
            transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, background 0.3s ease;
        }
        .send-button:hover {
            box-shadow: 0 4px 12px rgba(82, 174, 50, 0.5);
        }
        .send-button:active { transform: scale(0.95); }
        .send-button svg { width: 22px; height: 22px; fill: currentColor; }
        .send-button.active { display: flex; }

        .typing-indicator {
            display: flex;
            gap: 4px;
            align-items: center;
            padding: 8px 12px;
        }
        .typing-indicator span {
            width: 8px;
            height: 8px;
            background-color: var(--icon-color);
            border-radius: 50%;
            animation: typing-bounce 1.4s infinite ease-in-out both;
            transition: background-color 0.3s ease;
        }
        .typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
        .typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
        @keyframes typing-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1.0); } }

        .speech-status {
            position: absolute;
            bottom: 75px;
            left: 50%;
            transform: translateX(-50%);
            background-color: rgba(82, 174, 50, 0.95);
            color: white;
            padding: 10px 20px;
            border-radius: 20px;
            font-size: 0.9rem;
            text-align: center;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
            z-index: 50;
            max-width: 80%;
        }
        .speech-status.visible {
            opacity: 1;
            visibility: visible;
        }
        
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.65);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            opacity: 1;
            visibility: visible;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        .modal-overlay.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        .modal-content {
            background-color: var(--widget-bg-color);
            padding: 35px 40px;
            border-radius: 16px;
            text-align: center;
            max-width: 400px;
            width: 90%;
            box-shadow: 0 10px 40px rgba(0,0,0,0.25);
        }
        .modal-content h2 {
            margin-top: 0;
            color: var(--assistant-text-color);
            font-size: 1.5rem;
        }
        .modal-content p {
            color: var(--input-placeholder-color);
            line-height: 1.6;
            margin-bottom: 25px;
        }
        .modal-content button {
            background: linear-gradient(135deg, var(--send-button-gradient-start), var(--send-button-gradient-end));
            color: white;
            border: none;
            padding: 14px 35px;
            font-size: 1.1rem;
            font-weight: 500;
            border-radius: 30px;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            box-shadow: 0 4px 15px rgba(82, 174, 50, 0.35);
        }
        .modal-content button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(82, 174, 50, 0.45);
        }
        .modal-content button:active {
            transform: translateY(0);
        }

        @media (max-width: 750px) {
            body { padding: 0; align-items: stretch; }
            .chat-widget {
                width: 100%;
                height: 100%;
                max-height: 100%;
                border-radius: 0;
            }
            .widget-header {
                border-radius: 0;
            }
            .widget-input-area {
                border-radius: 0;
            }
        }

        @media (max-width: 600px) {
            .widget-header {
                padding: 15px 18px;
                padding-bottom: 40px;
            }
            .header-avatar {
                width: 42px;
                height: 42px;
                margin-right: 12px;
            }
            .header-title { font-size: 1.1rem; }
            .header-actions .icon-button { padding: 6px; margin-left: 8px; }
            .header-actions .icon-button svg { width: 22px; height: 22px; }
            .chat-messages-container { padding: 15px; gap: 15px; }
            .message-wrapper { max-width: 90%; }
            .message-bubble { padding: 10px 14px; font-size: 0.9rem; }
            .widget-input-area { padding: 10px 12px; gap: 8px; }
            .voice-button { width: 45px; height: 45px; }
            .send-button { width: 45px; height: 45px; }
        }

/* Recording Overlay Styles */
#speechRecognitionOverlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--send-button-gradient-start), var(--send-button-gradient-end));
    border-radius: inherit;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 6;
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

#speechRecognitionOverlay.active {
    display: flex;
    opacity: 1;
}

.recording-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recording-dot {
    width: 12px;
    height: 12px;
    background-color: #FF4444;
    border-radius: 50%;
    animation: pulse-dot 1s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.recording-timer-viber {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    min-width: 40px;
}

.cancel-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    padding: 8px 15px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cancel-zone.highlight {
    background-color: rgba(255, 68, 68, 0.3);
    color: #FF6B6B;
}

.cancel-arrow {
    font-size: 1.1rem;
    animation: slide-arrow 1s infinite ease-in-out;
}

@keyframes slide-arrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-5px); }
}

/* Trash Container */
.trash-container {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color 0.2s ease, transform 0.2s ease;
    z-index: 8;
}

.trash-container.visible {
    display: flex;
}

.trash-container.active {
    background-color: rgba(255, 68, 68, 0.3);
    transform: translateY(-50%) scale(1.15);
}

.trash-icon {
    width: 24px;
    height: 24px;
    fill: rgba(255, 255, 255, 0.9);
    transition: fill 0.2s ease;
}

.trash-container.active .trash-icon {
    fill: #FF6B6B;
}

.trash-lid {
    transition: transform 0.2s ease;
}

.trash-container.active .trash-lid {
    transform: rotate(-15deg);
}

.voice-button.recording {
    background: linear-gradient(135deg, #78BE20, #9BD855) !important;
    box-shadow: 0 0 0 4px rgba(82, 174, 50, 0.2);
    transform: scale(1.2); 
    animation: opacity-pulse 2s infinite ease-in-out;
    z-index: 7; 
}

@keyframes opacity-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}


.voice-button.sliding {
    transition: transform 0.1s ease-out; 
}

@media (max-width: 600px) {
    .cancel-zone {
        font-size: 0.8rem;
    }
}

/* ============================================
   MOBILE VOICE MODE - Professional Implementation
   ============================================ */

/* Mobile Voice Mode Container */
.mobile-voice-mode {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 15px 20px;
    gap: 15px;
    position: relative;
    width: 100%;
}

/* VOICE MODE (default): Hide desktop input elements */
.widget-input-area:not(.text-mode) .input-wrapper,
.widget-input-area:not(.text-mode) .voice-button,
.widget-input-area:not(.text-mode) .send-button,
.widget-input-area:not(.text-mode) #speechRecognitionOverlay {
    display: none !important;
}

/* TEXT MODE: Hide mobile voice UI */
.widget-input-area.text-mode .mobile-voice-mode {
    display: none !important;
}

/* TEXT MODE: Show input wrapper */
.widget-input-area.text-mode .input-wrapper {
    display: flex !important;
}

/* TEXT MODE: Show ONLY mic button initially (send hidden) */
.widget-input-area.text-mode .voice-button {
    display: flex !important;
    width: 45px;
    height: 45px;
}

/* TEXT MODE: Send button hidden by default */
.widget-input-area.text-mode .send-button {
    display: none !important;
}

/* TEXT MODE: When user types, show send button (hide mic) */
.widget-input-area.text-mode.has-text .voice-button {
    display: none !important;
}

.widget-input-area.text-mode.has-text .send-button {
    display: flex !important;
}

/* Text Input Toggle Button - Left Side */
.text-input-toggle {
    width: 2.8em;
    height: 2.8em;
    min-width: 2.8em;
    min-height: 2.8em;
    border-radius: 0;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: none;
}

.text-input-toggle svg {
    width: 1.6em;
    height: 1.6em;
    fill: var(--send-button-gradient-start);
    transition: fill 0.2s ease, transform 0.2s ease;
}

.text-input-toggle:hover svg {
    fill: var(--send-button-gradient-end);
    transform: scale(1.1);
}

.text-input-toggle:active {
    transform: translateY(-50%) scale(0.95);
}

.text-input-toggle:active svg {
    fill: var(--send-button-gradient-start);
}

/* Voice Instruction Text - Center */
.voice-instruction {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 0.8rem;
    color: var(--input-placeholder-color);
    transition: opacity 0.3s ease;
    font-weight: 400;
    white-space: nowrap;
    pointer-events: none;
    max-width: calc(100% - 140px);
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
}

/* Big Mic Button - Right Side */
.voice-button-big {
    width: 5em;
    height: 5em;
    min-width: 5em;
    min-height: 5em;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--send-button-gradient-start), var(--send-button-gradient-end));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(82, 174, 50, 0.3);
    margin-left: auto;
}

.voice-button-big svg {
    width: 2.5em;
    height: 2.5em;
    fill: var(--header-text-color);
    transition: width 0.3s ease, height 0.3s ease;
}

.voice-button-big:active:not(.recording) {
    transform: scale(0.95);
}

/* Big Mic Recording State - STABLE SIZE */
.voice-button-big.recording {
    width: 6em !important;
    height: 6em !important;
    min-width: 6em !important;
    min-height: 6em !important;
    background: linear-gradient(135deg, #78BE20, #9BD855) !important;
    animation: mic-pulse 1.5s infinite ease-in-out !important;
    box-shadow: 0 6px 25px rgba(82, 174, 50, 0.5) !important;
}

.voice-button-big.recording svg {
    width: 3em !important;
    height: 3em !important;
}

@keyframes mic-pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 6px 25px rgba(82, 174, 50, 0.5);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 8px 30px rgba(82, 174, 50, 0.7);
    }
}

/* Mobile Soundwave - Center During Recording */
.mobile-soundwave {
    display: none;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 40px;
    align-items: center;
    gap: 4px;
    z-index: 5;
    pointer-events: none;
}

.mobile-soundwave.active {
    display: flex;
}

.mobile-soundwave .soundwave-bar {
    width: 4px;
    background: linear-gradient(180deg, var(--send-button-gradient-start), var(--send-button-gradient-end));
    border-radius: 2px;
    animation: soundwave-animate 0.6s ease-in-out infinite;
    opacity: 0.9;
}

.mobile-soundwave .soundwave-bar:nth-child(1) { animation-delay: -0.5s; height: 10px; }
.mobile-soundwave .soundwave-bar:nth-child(2) { animation-delay: -0.4s; height: 15px; }
.mobile-soundwave .soundwave-bar:nth-child(3) { animation-delay: -0.3s; height: 20px; }
.mobile-soundwave .soundwave-bar:nth-child(4) { animation-delay: -0.2s; height: 25px; }
.mobile-soundwave .soundwave-bar:nth-child(5) { animation-delay: -0.1s; height: 30px; }
.mobile-soundwave .soundwave-bar:nth-child(6) { animation-delay: 0s; height: 25px; }
.mobile-soundwave .soundwave-bar:nth-child(7) { animation-delay: 0.1s; height: 20px; }
.mobile-soundwave .soundwave-bar:nth-child(8) { animation-delay: 0.2s; height: 15px; }
.mobile-soundwave .soundwave-bar:nth-child(9) { animation-delay: 0.3s; height: 10px; }

@keyframes soundwave-animate {
    0%, 100% { transform: scaleY(0.5); }
    50% { transform: scaleY(1.2); }
}

/* Hide instruction during recording */
.mobile-voice-mode.recording .voice-instruction {
    opacity: 0;
}

/* Dim text toggle during recording */
.mobile-voice-mode.recording .text-input-toggle {
    opacity: 0.3;
    pointer-events: none;
}

/* Responsive font size for very small screens */
@media (max-width: 360px) {
    .voice-instruction {
        font-size: 0.7rem;
        max-width: calc(100% - 120px);
    }
}

/* ============================================
   VOICE MODE - NOW UNIVERSAL ON ALL DEVICES
   ============================================ */

/* All voice mode switching styles are now applied universally above */
