/**
 * Full Web Assistant v4.6.6 - Aberlour Style Design
 */

:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --text-color: #1f2937;
    --title-text-color: #ffffff;
    --background-color: #ffffff;
    --user-message-color: #e0e7ff;
    --user-message-text-color: #ffffff;
    --ai-message-color: #f3f4f6;
    --ai-message-text-color: #1f2937;
    --border-color: #e5e7eb;
    --button-color: #1e40af;
    --button-text-color: #ffffff;
}

.fwa-assistant-container, .fwa-assistant-container * {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

.fwa-assistant-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-color);
}

/* Hide zoom button on desktop - only show on mobile */
.fwa-zoom-btn {
    display: none !important;
}

/* Trigger Button */
.fwa-assistant-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.fwa-assistant-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.fwa-assistant-trigger .fwa-icon { font-size: 18px; }

/* Chat Window */
.fwa-assistant-chat {
    display: none;
    flex-direction: column;
    background: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 999999;
    border: 1px solid #e0e0e0;
}

/* When chat is visible (set by JS) */
.fwa-assistant-chat[data-visible="true"],
.fwa-assistant-chat[style*="display: flex"] {
    display: flex !important;
}

.fwa-assistant-container[data-mode="floating"] .fwa-assistant-chat {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 480px;
    height: 680px;
    max-width: calc(100vw - 40px);
    max-height: calc(100dvh - 40px);
}

/* Modal */
.fwa-assistant-modal { display: none; position: fixed; inset: 0; z-index: 999999; }
.fwa-assistant-modal[data-visible="true"] { display: flex; align-items: center; justify-content: center; }
.fwa-assistant-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.fwa-assistant-modal-content { position: relative; z-index: 1; width: 90%; max-width: 550px; height: 85%; max-height: 750px; border-radius: 16px; overflow: hidden; }
.fwa-assistant-modal-content .fwa-assistant-chat { width: 100%; height: 100%; display: flex; flex-direction: column; border-radius: 16px; }

/* Inline */
.fwa-assistant-container[data-mode="inline"] .fwa-assistant-chat {
    width: 100%; min-height: 500px; border-radius: 16px; border: 1px solid var(--border-color);
    display: flex; flex-direction: column;
}

/* Unified Header */
.fwa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--title-text-color);
}

.fwa-header-logo img {
    height: 40px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    padding: 4px;
}

.fwa-header-info {
    flex: 1;
}

.fwa-header-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: inherit;
}

.fwa-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fwa-header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    color: inherit;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    touch-action: manipulation;
}

.fwa-header-badge:hover { background: rgba(255,255,255,0.3); }
.fwa-badge-flag { font-size: 14px; }

/* Header badge when auto-translate is active */
.fwa-header-badge.translating {
    background: rgba(34, 197, 94, 0.3);
    animation: pulse-translate 2s infinite;
}

@keyframes pulse-translate {
    0%, 100% { background: rgba(34, 197, 94, 0.3); }
    50% { background: rgba(34, 197, 94, 0.5); }
}

.fwa-header-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
    color: inherit;
}

.fwa-header-btn:hover { background: rgba(255,255,255,0.3); }
.fwa-close-btn { font-size: 20px; font-weight: 300; }

/* Messages */
.fwa-assistant-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    -webkit-overflow-scrolling: touch;
}

.fwa-message { max-width: 100%; }

.fwa-message-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: #6b7280;
}

.fwa-message-avatar { font-size: 16px; }
.fwa-message-sender { font-weight: 600; color: var(--primary-color); }
.fwa-message-dot { opacity: 0.5; }
.fwa-message-label { font-style: italic; }
.fwa-message-time { }

.fwa-play-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
    padding: 2px 6px;
    border-radius: 4px;
    touch-action: manipulation;
}
.fwa-play-btn:hover { opacity: 1; background: rgba(0,0,0,0.05); }

/* Listen button */
.fwa-listen-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    touch-action: manipulation;
    transition: all 0.2s;
}
.fwa-listen-btn:hover { background: #e5e7eb; border-color: #d1d5db; }
.fwa-listen-btn:active { transform: scale(0.95); }
.fwa-listen-icon { font-size: 12px; }

/* Stop button state */
.fwa-listen-btn.speaking {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.fwa-listen-btn.speaking:hover {
    background: #fecaca;
    border-color: #f87171;
}

/* TTS Consent Popup */
.fwa-tts-consent-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000010;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fwa-tts-consent-popup.visible { display: flex; }

.fwa-tts-consent-box {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.fwa-tts-consent-icon { font-size: 40px; margin-bottom: 12px; }
.fwa-tts-consent-box p { margin: 0 0 8px; color: #374151; }
.fwa-tts-consent-box p strong { color: #111827; }
.fwa-tts-consent-note { font-size: 13px; color: #6b7280 !important; margin-bottom: 16px !important; }

.fwa-tts-consent-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.fwa-tts-btn-yes, .fwa-tts-btn-no {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    border: none;
    transition: all 0.2s;
}

.fwa-tts-btn-yes {
    background: var(--primary-color, #1e40af);
    color: #fff;
}
.fwa-tts-btn-yes:hover { opacity: 0.9; }

.fwa-tts-btn-no {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.fwa-tts-btn-no:hover { background: #e5e7eb; }

.fwa-message-bubble {
    padding: 14px 18px;
    border-radius: 16px;
    background: var(--ai-message-color);
    color: var(--ai-message-text-color);
    border: 1px solid #e5e7eb;
}

.fwa-message-user .fwa-message-bubble {
    background: var(--user-message-color);
    color: var(--user-message-text-color);
    border-color: transparent;
}

.fwa-message-user .fwa-message-meta { justify-content: flex-end; }
.fwa-message-user .fwa-message-sender { color: var(--text-color); }

/* Message body - Professional paragraph formatting */
.fwa-message-body {
    line-height: 1.65;
    font-size: 15px;
}
.fwa-message-body p { 
    margin: 0 0 14px; 
}
.fwa-message-body p:last-child { 
    margin: 0; 
}
.fwa-message-body a { 
    color: var(--primary-color); 
    text-decoration: underline;
}

/* Headings in responses */
.fwa-message-body h3.fwa-heading,
.fwa-message-body h4.fwa-heading {
    margin: 16px 0 8px 0;
    font-weight: 700;
    color: var(--text-color);
}
.fwa-message-body h3.fwa-heading {
    font-size: 1.1em;
}
.fwa-message-body h4.fwa-heading {
    font-size: 1.05em;
}
.fwa-message-body h3.fwa-heading:first-child,
.fwa-message-body h4.fwa-heading:first-child {
    margin-top: 0;
}

/* Lists in responses */
.fwa-message-body ul.fwa-list,
.fwa-message-body ol.fwa-list {
    margin: 12px 0;
    padding-left: 24px;
}
.fwa-message-body ul.fwa-list {
    list-style-type: disc;
}
.fwa-message-body ol.fwa-list {
    list-style-type: decimal;
}
.fwa-message-body .fwa-list li {
    margin-bottom: 8px;
    padding-left: 4px;
    line-height: 1.5;
}
.fwa-message-body .fwa-list li:last-child {
    margin-bottom: 0;
}
.fwa-message-body .fwa-list li strong {
    color: var(--primary-color);
}

/* Nested sublists (bullets under numbered items) */
.fwa-message-body ul.fwa-sublist {
    margin: 6px 0 12px 0;
    padding-left: 20px;
    list-style-type: disc;
}
.fwa-message-body .fwa-sublist li {
    margin-bottom: 4px;
    font-size: 0.95em;
}

/* Legacy list support */
.fwa-message-body ul, 
.fwa-message-body ol {
    margin: 10px 0;
    padding-left: 22px;
}
.fwa-message-body li {
    margin-bottom: 6px;
}
.fwa-message-body strong,
.fwa-message-body b {
    font-weight: 600;
}
.fwa-message-body .fwa-source-ref { 
    margin-top: 12px; 
    font-size: 13px; 
    color: #6b7280; 
    border-top: 1px solid #e5e7eb; 
    padding-top: 8px; 
}

/* Language Change Notification */
.fwa-language-notification {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 8px auto;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: #4f46e5;
    max-width: fit-content;
    animation: notif-fade-in 0.3s ease;
}
.fwa-lang-notif-icon {
    font-size: 18px;
}
.fwa-lang-notif-text {
    font-weight: 500;
}
.fwa-lang-notif-text strong {
    font-weight: 700;
}
@keyframes notif-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Typing Indicator - "Thinking ForWord..." */
.fwa-typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--ai-message-color);
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    max-width: fit-content;
}

.fwa-typing-text {
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 2px;
}

.fwa-typing-text .fwa-brand {
    color: var(--primary-color, #1e40af);
    font-weight: 600;
}

.fwa-typing-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 2px;
}

.fwa-typing-dot {
    width: 5px;
    height: 5px;
    background: var(--primary-color, #1e40af);
    border-radius: 50%;
    animation: fwa-dot-fade 1.4s ease-in-out infinite;
}

.fwa-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.fwa-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes fwa-dot-fade {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

/* Suggested Questions - Compact & Collapsible */
.fwa-questions-wrapper {
    border-top: 1px solid #fcd34d;
    background: linear-gradient(135deg, #fef9c3 0%, #fef3c7 100%);
}

.fwa-questions-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #713f12;
    touch-action: manipulation;
    transition: all 0.2s;
}

.fwa-questions-toggle:hover { background: linear-gradient(135deg, #facc15 0%, #eab308 100%); }
.fwa-q-icon { font-size: 14px; }
.fwa-q-title { flex: 1; text-align: left; font-size: 13px; }
.fwa-q-hint { font-size: 10px; font-weight: 400; opacity: 0.8; }
.fwa-q-badge { background: #ca8a04; color: #fff; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; }
.fwa-q-chevron { transition: transform 0.2s; font-size: 10px; }
.fwa-questions-toggle.expanded .fwa-q-chevron { transform: rotate(180deg); }

.fwa-questions-content {
    display: none;
    padding: 10px 14px;
    gap: 6px;
    background: #fffef5;
}

.fwa-questions-content.expanded { display: flex; flex-direction: column; }

.fwa-question-btn {
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    color: #78350f;
    touch-action: manipulation;
    transition: all 0.15s;
}

.fwa-question-btn:hover { background: #fef9c3; border-color: #eab308; transform: translateX(3px); }

/* Input Area */
.fwa-input-area {
    padding: 12px 16px 16px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.fwa-input-row {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.fwa-input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px 0 0 10px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 44px;
    max-height: 250px;
    overflow-y: auto;
    transition: height 0.1s ease;
    caret-color: #1f2937; /* Black cursor for visibility */
}

.fwa-input:focus { border-color: var(--primary-color); }

/* Listening state indicator */
.fwa-speak-btn.listening {
    background: #fee2e2 !important;
    border-color: #ef4444 !important;
    color: #dc2626 !important;
    animation: pulse-listening 1.5s infinite;
}

@keyframes pulse-listening {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

.fwa-send-btn {
    padding: 12px 20px;
    background: var(--button-color);
    color: var(--button-text-color);
    border: none;
    border-radius: 0 10px 10px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
}

.fwa-send-btn:hover { opacity: 0.9; }
.fwa-send-btn:disabled { opacity: 0.5; }

/* Control Buttons */
.fwa-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.fwa-ctrl-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 44px;
}

.fwa-ctrl-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.fwa-ctrl-btn:active { transform: scale(0.97); }
.fwa-ctrl-btn.listening { background: #fee2e2; border-color: #ef4444; color: #dc2626; }
.fwa-ctrl-btn.active { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
.fwa-translate-btn.active { background: #dcfce7; border-color: #22c55e; color: #166534; }

.fwa-ctrl-icon { font-size: 14px; }

/* Listen Button on Messages - at far right of meta line */
.fwa-message-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.fwa-listen-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: white;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    touch-action: manipulation;
    margin-left: auto;
}

.fwa-listen-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.fwa-listen-btn.playing {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.fwa-message-bubble {
    position: relative;
}

/* Branding with Exit Fast button */
.fwa-branding {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    padding: 8px 12px;
    position: relative;
}

.fwa-branding-text {
    text-align: center;
}

.fwa-branding a { 
    color: var(--primary-color); 
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    font-weight: 700;
    transition: all 0.2s;
}
.fwa-branding a:hover { 
    color: var(--secondary-color);
    text-decoration-style: solid;
}

/* Exit Fast Button */
.fwa-exit-fast-btn {
    position: absolute;
    right: 12px;
    background: #dc2626;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fwa-exit-fast-btn:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

/* Modals */
.fwa-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fwa-modal.visible { display: flex; }

.fwa-modal-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.fwa-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.fwa-modal-head h3 { margin: 0; font-size: 18px; }

.fwa-modal-x {
    width: 32px; height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}

.fwa-lang-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.fwa-lang-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 44px;
}

.fwa-lang-opt:hover { border-color: #a5b4fc; background: #f5f7ff; }
.fwa-lang-opt.selected { border-color: #6366f1; background: #eef2ff; }
.fwa-lang-flag { font-size: 22px; }
.fwa-lang-name { font-weight: 600; font-size: 13px; }
.fwa-lang-native { font-size: 11px; color: #6b7280; }

.fwa-voice-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.fwa-voice-opt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    touch-action: manipulation;
}

.fwa-voice-opt:hover { border-color: #a5b4fc; }
.fwa-voice-opt.selected { border-color: #6366f1; background: #eef2ff; }

.fwa-voice-info { display: flex; align-items: center; gap: 10px; }
.fwa-voice-icon { font-size: 18px; }
.fwa-voice-name { font-weight: 600; font-size: 13px; }
.fwa-voice-lang { font-size: 11px; color: #6b7280; }

.fwa-voice-test {
    padding: 6px 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
}

.fwa-speed-ctrl {
    padding: 14px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 16px;
}

.fwa-speed-ctrl label { display: block; margin-bottom: 8px; font-weight: 500; }

#speed-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: #e5e7eb;
    border-radius: 3px;
}

#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.fwa-modal-close-btn {
    width: 100%;
    padding: 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

/* Language Confirmation Popup */
.fwa-lang-confirm-content {
    text-align: center;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

.fwa-lang-confirm-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.fwa-lang-confirm-text {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 10px;
    text-align: left;
    font-weight: 600;
}

.fwa-lang-other-title {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.fwa-lang-confirm-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.fwa-lang-other-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.fwa-lang-confirm-btn {
    padding: 12px 16px;
    background: #f3f4f6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.fwa-lang-confirm-btn:hover {
    background: #e0e7ff;
    border-color: #6366f1;
}

.fwa-lang-detected {
    background: #dcfce7;
    border-color: #22c55e;
}

.fwa-lang-detected:hover {
    background: #bbf7d0;
    border-color: #16a34a;
}

.fwa-lang-other {
    padding: 10px 12px;
    font-size: 12px;
}

.fwa-lang-confirm-cancel {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 14px;
    cursor: pointer;
}

.fwa-lang-confirm-cancel:hover {
    color: #374151;
}

/* Toast */
.fwa-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000010;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Text Sizes - Increased for better readability */
.fwa-text-small .fwa-message-body { font-size: 15px; line-height: 1.5; }
.fwa-text-medium .fwa-message-body { font-size: 17px; line-height: 1.5; }
.fwa-text-large .fwa-message-body { font-size: 20px; line-height: 1.6; }

/* Mobile - Fullscreen immersive experience */
@media (max-width: 768px) {
    .fwa-assistant-trigger { padding: 12px 16px; bottom: 16px; right: 16px; }
    
    /* Show zoom button on mobile only */
    .fwa-zoom-btn {
        display: flex !important;
    }
    
    /* Fullscreen chat on mobile - use 100% instead of vh for keyboard compatibility */
    .fwa-assistant-container[data-mode="floating"] .fwa-assistant-chat,
    .fwa-assistant-container[data-mode="modal"] .fwa-assistant-chat {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        z-index: 1000000 !important;
    }
    
    .fwa-assistant-modal[data-visible="true"] { padding: 0; }
    .fwa-assistant-modal[data-visible="true"] .fwa-assistant-modal-backdrop { display: none; }
    .fwa-assistant-modal[data-visible="true"] .fwa-assistant-modal-content { 
        width: 100% !important; 
        height: 100% !important; 
        max-width: 100% !important; 
        max-height: 100% !important; 
        border-radius: 0 !important; 
    }
    
    /* MOBILE HEADER - Bigger, more professional */
    .fwa-header { 
        padding: 12px 14px !important; 
        gap: 10px !important;
        min-height: auto !important;
    }
    .fwa-header-logo img {
        height: 36px !important;
        width: 36px !important;
        padding: 3px !important;
        border-radius: 8px !important;
    }
    .fwa-header-info h3 { 
        font-size: 17px !important; 
        line-height: 1.2 !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .fwa-header-controls {
        gap: 6px !important;
    }
    .fwa-header-badge {
        padding: 6px 10px !important;
        font-size: 12px !important;
        gap: 4px !important;
        border-radius: 6px !important;
    }
    .fwa-badge-flag { font-size: 14px !important; }
    .fwa-header-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }
    .fwa-close-btn { font-size: 20px !important; }
    
    /* 5 buttons in a row on mobile */
    .fwa-controls { 
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 5px !important;
        padding: 8px !important;
        margin-bottom: 0 !important;
    }
    
    .fwa-ctrl-btn { 
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 3px !important;
        padding: 8px 2px !important;
        min-height: 52px !important;
        border-radius: 10px !important;
    }
    
    .fwa-ctrl-icon { font-size: 18px !important; }
    .fwa-ctrl-text { 
        display: block !important; 
        font-size: 9px !important; 
        text-align: center !important;
        line-height: 1.2 !important;
        font-weight: 500 !important;
    }
    
    /* Bigger input area on mobile */
    .fwa-input-area { 
        padding: 10px 12px !important; 
    }
    .fwa-input-row { 
        gap: 8px !important; 
        margin-bottom: 8px !important; 
    }
    .fwa-input { 
        font-size: 17px !important; 
        min-height: 48px !important;
        padding: 12px 14px !important;
        border-radius: 12px !important;
    }
    .fwa-send-btn { 
        min-height: 48px !important; 
        padding: 10px 18px !important; 
        font-size: 16px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
    }
    
    /* Better message readability on mobile */
    .fwa-message-body { font-size: 17px; line-height: 1.6; }
    .fwa-text-small .fwa-message-body { font-size: 17px; }
    .fwa-text-medium .fwa-message-body { font-size: 19px; }
    .fwa-text-large .fwa-message-body { font-size: 22px; }
    
    /* Message bubbles bigger padding */
    .fwa-message-bubble {
        padding: 14px 16px !important;
        border-radius: 14px !important;
    }
    .fwa-message-meta {
        font-size: 12px !important;
        margin-bottom: 6px !important;
    }
    
    /* Branding */
    .fwa-branding { 
        font-size: 10px !important; 
        padding: 8px 0 !important;
        margin: 0 !important;
    }
    
    .fwa-branding .fwa-contact-human-btn {
        font-size: 9px !important;
        padding: 3px 8px !important;
    }
    
    .fwa-branding .fwa-exit-fast-btn {
        font-size: 9px !important;
        padding: 3px 8px !important;
    }
    
    /* Suggested questions bigger */
    .fwa-questions-toggle {
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    .fwa-questions-wrapper {
        margin: 0 !important;
    }
    .fwa-question-btn {
        font-size: 14px !important;
        padding: 10px 14px !important;
    }
    
    /* Messages area takes remaining space */
    .fwa-assistant-messages {
        flex: 1 !important;
        min-height: 0 !important;
    }
    
    /* ============================================
       ZOOM LEVELS - Mobile Only Accessibility
       ============================================ */
    
    /* ZOOM LEVEL 1 (Zoom +) - 1.15x scale */
    .fwa-zoom-1 .fwa-header { padding: 14px 16px !important; gap: 12px !important; }
    .fwa-zoom-1 .fwa-header-logo img { height: 42px !important; width: 42px !important; }
    .fwa-zoom-1 .fwa-header-info h3 { font-size: 19px !important; }
    .fwa-zoom-1 .fwa-header-badge { padding: 7px 12px !important; font-size: 14px !important; }
    .fwa-zoom-1 .fwa-badge-flag { font-size: 16px !important; }
    .fwa-zoom-1 .fwa-header-btn { width: 40px !important; height: 40px !important; font-size: 15px !important; }
    .fwa-zoom-1 .fwa-close-btn { font-size: 24px !important; }
    
    .fwa-zoom-1 .fwa-ctrl-btn { min-height: 60px !important; padding: 10px 3px !important; }
    .fwa-zoom-1 .fwa-ctrl-icon { font-size: 22px !important; }
    .fwa-zoom-1 .fwa-ctrl-text { font-size: 10px !important; }
    
    .fwa-zoom-1 .fwa-input { font-size: 19px !important; min-height: 54px !important; padding: 14px 16px !important; }
    .fwa-zoom-1 .fwa-send-btn { min-height: 54px !important; padding: 12px 20px !important; font-size: 18px !important; }
    
    .fwa-zoom-1 .fwa-message-body { font-size: 19px !important; line-height: 1.6 !important; }
    .fwa-zoom-1 .fwa-message-bubble { padding: 16px 18px !important; }
    .fwa-zoom-1 .fwa-message-meta { font-size: 14px !important; }
    
    .fwa-zoom-1 .fwa-questions-toggle { font-size: 15px !important; padding: 12px 16px !important; }
    .fwa-zoom-1 .fwa-question-btn { font-size: 16px !important; padding: 12px 16px !important; }
    .fwa-zoom-1 .fwa-branding { font-size: 12px !important; }
    
    /* ZOOM LEVEL 2 (Zoom ++) - 1.3x scale */
    .fwa-zoom-2 .fwa-header { padding: 16px 18px !important; gap: 14px !important; }
    .fwa-zoom-2 .fwa-header-logo img { height: 48px !important; width: 48px !important; }
    .fwa-zoom-2 .fwa-header-info h3 { font-size: 22px !important; }
    .fwa-zoom-2 .fwa-header-badge { padding: 8px 14px !important; font-size: 16px !important; }
    .fwa-zoom-2 .fwa-badge-flag { font-size: 18px !important; }
    .fwa-zoom-2 .fwa-header-btn { width: 46px !important; height: 46px !important; font-size: 17px !important; }
    .fwa-zoom-2 .fwa-close-btn { font-size: 28px !important; }
    
    .fwa-zoom-2 .fwa-controls { grid-template-columns: repeat(5, 1fr) !important; gap: 4px !important; }
    .fwa-zoom-2 .fwa-ctrl-btn { min-height: 68px !important; padding: 10px 2px !important; }
    .fwa-zoom-2 .fwa-ctrl-icon { font-size: 26px !important; }
    .fwa-zoom-2 .fwa-ctrl-text { font-size: 11px !important; }
    
    .fwa-zoom-2 .fwa-input { font-size: 22px !important; min-height: 60px !important; padding: 16px 18px !important; }
    .fwa-zoom-2 .fwa-send-btn { min-height: 60px !important; padding: 14px 22px !important; font-size: 20px !important; }
    
    .fwa-zoom-2 .fwa-message-body { font-size: 22px !important; line-height: 1.7 !important; }
    .fwa-zoom-2 .fwa-message-bubble { padding: 18px 20px !important; border-radius: 16px !important; }
    .fwa-zoom-2 .fwa-message-meta { font-size: 16px !important; }
    
    .fwa-zoom-2 .fwa-questions-toggle { font-size: 17px !important; padding: 14px 18px !important; }
    .fwa-zoom-2 .fwa-question-btn { font-size: 18px !important; padding: 14px 18px !important; }
    .fwa-zoom-2 .fwa-branding { font-size: 13px !important; }
}

/* Extra small devices */
@media (max-width: 380px) {
    .fwa-ctrl-btn { 
        padding: 6px 2px !important; 
        min-height: 48px !important;
    }
    .fwa-ctrl-text { font-size: 8px !important; }
    .fwa-ctrl-icon { font-size: 16px !important; }
    .fwa-header-info h3 { font-size: 15px !important; }
    .fwa-header-badge { padding: 5px 8px !important; font-size: 11px !important; }
}

/* iOS safe areas */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (max-width: 768px) {
        .fwa-header {
            padding-top: calc(10px + env(safe-area-inset-top)) !important;
        }
        .fwa-input-area {
            padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* Prevent body scroll when chat is open - ONLY on mobile */
@media (max-width: 768px) {
    body.fwa-chat-open { 
        overflow: hidden !important; 
        position: fixed;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
    }
}

.fwa-iframe-body { background: transparent !important; }
