.chat-utils{
    border-radius: 10px !important;
}
.chat-toolbar-wrapper {
                max-width: 100%;
                min-width: 45vw;
                padding: 5px 15px;
                background: color(srgb 0.175 0.175 0.175 / 0.38) !important;
                border-radius: 20px !important;
                box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
                backdrop-filter: blur(10px);
                -webkit-backdrop-filter: blur(10px);
                border: 1px solid var(--glass-border, rgba(130, 64, 255, 0.3));
                min-height: 60px;
                transition: all 0.3s ease;
            }
            @media screen and (max-width: 768px) {
                .chat-toolbar-wrapper {
                    min-width: 100%;
                    padding-left: 5px !important;
                    padding-right: 5px !important;
                    margin-left: 0;
                    margin-right: 0;
                }
                .toolbar-scroll-container {
                    padding-left: 0 !important;
                    padding-right: 0 !important;
                    margin-left: 0 !important;
                    margin-right: 0 !important;
                    justify-content: flex-start;
                    scroll-snap-type: x mandatory;
                }
                .toolbar-btn {
                    scroll-snap-align: start;
                    min-width: auto;
                    flex-shrink: 0;
                }
            }
            .chat-toolbar-container {
                width: 100%;
                overflow: hidden;
                position: relative;
            }
            
            .chat-toolbar {
                display: flex;
                align-items: center;
                padding: 0;
                min-height: 50px;
            }
            
.toolbar-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px 10px;
    gap: 8px;
    justify-content: flex-start;
    scroll-padding-left: 10px;
    scroll-padding-right: 10px;
    scroll-behavior: smooth;
    position: relative;
}
            
            .toolbar-scroll-container::-webkit-scrollbar {
                display: none;
            }
            
            .toolbar-btn,#sendMessage {
                flex: 0 0 auto;
                display: flex !important;
                width: auto;
                height: 48px;
                display: flex;
                justify-content: center;
                align-items: center;
                border-radius: 0.25em;
                background: rgba(64, 20, 93, 0.48);
                color: var(--primary-light, #D2B8FF);
                border: none;
                font-size: 20px;
                transition: all 0.3s ease;
                box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
                cursor: pointer;
                padding: 0 12px;
                white-space: nowrap;
            }
            
            .toolbar-btn {
                min-width: auto;
            }

            /* Group-chat-only toolbar buttons — hidden until JS removes this class */
            .toolbar-btn.gc-only-btn {
                display: none !important;
            }
            
            .toolbar-btn:hover, .toolbar-btn.active, #sendMessage:hover, #sendMessage.active {
                background: rgba(130, 64, 255, 0.35);
                transform: translateY(-3px);
                box-shadow: 0 6px 12px rgba(130, 64, 255, 0.25);
            }
            .tool-label {
            font-size: 12px;
            margin-left: 5px;
            min-width: auto;
            display: flex;
            justify-content: center;
            align-items: center;
            }
            /* Content views */
            .toolbar-content-view {
                width: 100%;
                display: flex;
                align-items: center;
                gap: 10px;
            }
            .spin { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
            .toolbar-back-btn {
                background: transparent;
                box-shadow: none !important;
                border: none;
                color: var(--primary-light, #D2B8FF);
                font-size: 18px;
                cursor: pointer;
                width: 48px;
                height: 48px;
                min-width: 48px;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 50%;
                transition: all 0.3s ease;
                box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
            }
            
            .toolbar-back-btn:hover {
                transform: translateY(-3px);
                box-shadow: none;
            }
            
            .toolbar-title {
                font-weight: 500;
                color: var(--primary-light, #D2B8FF);
                margin-right: 10px;
                white-space: nowrap;
            }
            
            /* Emoji styles */
            .emoji-scroll-container {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                gap: 10px;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
                flex-grow: 1;
                padding: 0 5px;
            }
            
            .emoji-scroll-container::-webkit-scrollbar {
                display: none;
            }
            
            .emoji-btn {
                flex: 0 0 auto;
                width: 40px;
                height: 40px;
                font-size: 20px;
                background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
                border: none;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: transform 0.2s;
            }
            
            .emoji-btn:hover {
                transform: scale(1.2);
                background: rgba(130, 64, 255, 0.3);
            }
            
            /* Translation styles */
            .translation-scroll-container {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                gap: 10px;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
                flex-grow: 1;
                padding: 0 5px;
            }
            
            .translation-scroll-container::-webkit-scrollbar {
                display: none;
            }
            
            /* Suggestions styles */
            .suggestions-scroll-container {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                gap: 10px;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
                flex-grow: 1;
                padding: 0 5px;
            }
            
            .suggestions-scroll-container::-webkit-scrollbar {
                display: none;
            }
            
            /* Settings Modal Styles - Enhanced Compact & Professional */
.settings-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.settings-modal {
    background: var(--bg-secondary, #2d2d2d);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 8px 16px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 92%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--glass-border, rgba(130, 64, 255, 0.3));
}

.settings-modal-overlay.show .settings-modal {
    transform: scale(1) translateY(0);
}

.settings-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--glass-border, rgba(130, 64, 255, 0.2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-primary, #1a1a1a);
    position: sticky;
    top: 0;
    z-index: 10;
    border-radius: 15px 15px 0 0;
}

.settings-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(110, 32, 244, 0.15), transparent);
}

.settings-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.3px;
}

.settings-modal-title i {
    color: var(--primary-light, #D2B8FF);
    font-size: 22px;
}

.settings-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    font-size: 20px;
    color: var(--text-secondary, #aeb0b4);
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.settings-close-btn:hover {
    background: rgba(130, 64, 255, 0.2);
    color: var(--primary-light, #D2B8FF);
    transform: rotate(90deg);
}

.settings-modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(110, 32, 244, 0.3) transparent;
}

.settings-modal-body::-webkit-scrollbar {
    width: 6px;
}

.settings-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.settings-modal-body::-webkit-scrollbar-thumb {
    background: rgba(110, 32, 244, 0.2);
    border-radius: 3px;
}

.settings-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(110, 32, 244, 0.35);
}

.settings-quick-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-quick-nav::-webkit-scrollbar {
    display: none;
}

.settings-quick-nav-btn {
    border: 1.5px solid var(--glass-border, rgba(130, 64, 255, 0.2));
    border-radius: 10px;
    padding: 8px 14px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary, #aeb0b4);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    white-space: nowrap;
}

.settings-quick-nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.settings-quick-nav-btn:hover::before {
    left: 100%;
}

.settings-quick-nav-btn i {
    font-size: 18px;
    color: var(--primary-light, #D2B8FF);
    transition: transform 0.2s;
}

.settings-quick-nav-btn .settings-quick-nav-label {
    line-height: 1.2;
    font-size: 11px;
}

.settings-quick-nav-btn:hover {
    border-color: rgba(110, 32, 244, 0.3);
    background: rgba(110, 32, 244, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(110, 32, 244, 0.15);
}

.settings-quick-nav-btn:hover i {
    transform: scale(1.1);
}

.settings-quick-nav-btn.active {
    border-color: #6E20F4;
    background: linear-gradient(135deg, rgba(110, 32, 244, 0.12) 0%, rgba(139, 76, 248, 0.15) 100%);
    color: #6E20F4;
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.2);
}

.settings-quick-nav-btn.active i {
    color: #6E20F4;
    transform: scale(1.1);
}

.settings-section {
    margin-bottom: 18px;
    padding: 16px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--glass-border, rgba(130, 64, 255, 0.2));
    border-radius: 12px;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

#language-settings {
    position: relative;
    z-index: 5;
    overflow: visible;
}

.settings-section:hover {
    border-color: rgba(110, 32, 244, 0.15);
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.08);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    text-align: left;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    letter-spacing: -0.2px;
    text-align: left;
}

.settings-section-title i {
    color: var(--primary-light, #D2B8FF);
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.settings-description {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 8px;
    text-align: left;
}

.settings-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(130, 64, 255, 0.25);
    margin-left: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.settings-tooltip i {
    font-size: 12px;
    line-height: 1;
}

.settings-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    background: rgba(20, 20, 20, 0.95);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    padding: 8px 10px;
    border-radius: 8px;
    width: max-content;
    max-width: 240px;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    z-index: 30;
    white-space: normal;
}

.settings-tooltip::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(20, 20, 20, 0.95);
    opacity: 0;
    pointer-events: none;
}

.settings-tooltip:hover,
.settings-tooltip:focus {
    color: #ffffff;
    border-color: rgba(130, 64, 255, 0.45);
    background: rgba(130, 64, 255, 0.18);
}

.settings-tooltip:hover::after,
.settings-tooltip:focus::after,
.settings-tooltip:hover::before,
.settings-tooltip:focus::before {
    opacity: 1;
}

/* ============================================================
   AUTO IMAGE GENERATION TOOLBAR INDICATOR
   ============================================================ */
.auto-image-toolbar-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
    transition: color 0.25s ease, text-shadow 0.25s ease;
    /* Off state: dimmed */
    color: rgba(255, 200, 80, 0.3);
    text-shadow: none;
}

.auto-image-toolbar-indicator.active {
    /* On state: full color with glow */
    color: #ffd740;
    text-shadow: 0 0 8px rgba(255, 215, 64, 0.6);
}

.auto-image-toolbar-indicator:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 200, 80, 0.45);
}

/* JS-generated tooltip (appended to body to escape overflow:hidden parents) */
.auto-image-tooltip-popup {
    position: fixed;
    z-index: 99999;
    background: rgba(20, 20, 20, 0.96);
    color: #fff;
    font-size: 12px;
    line-height: 1.45;
    padding: 8px 11px;
    border-radius: 8px;
    max-width: 240px;
    text-align: left;
    pointer-events: none;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.15s ease;
    white-space: normal;
    word-wrap: break-word;
}

.auto-image-tooltip-popup.visible {
    opacity: 1;
}

.auto-image-tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(20, 20, 20, 0.96);
}

/* Settings section subtitle for better contrast in dark theme */
.settings-section-subtitle {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75) !important;
    margin-top: 4px;
}

/* Preference and advanced setting descriptions */
.preference-description,
.advanced-setting-description {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75) !important;
    margin-top: 4px;
}

/* Ensure text-muted elements in settings modal have better contrast */
#settingsModal .text-muted,
#settingsModal .settings-section .text-muted,
.settings-modal .text-muted {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Form labels in settings modal */
#settingsModal .form-label,
#settingsModal label,
.settings-modal .form-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Additional overrides for better contrast in settings modal */
#settingsModal .form-floating > label,
.settings-modal .form-floating > label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Form control placeholders */
#settingsModal .form-control::placeholder,
#settingsModal .form-select::placeholder,
.settings-modal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Language Dropdown */
.language-dropdown-wrapper {
    position: relative;
    width: 100%;
    margin-top: 8px;
}

.language-dropdown-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(130, 64, 255, 0.25);
    border-radius: 12px;
    color: var(--text-primary, #ffffff);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.language-dropdown-trigger:hover {
    border-color: rgba(130, 64, 255, 0.45);
    background: rgba(130, 64, 255, 0.08);
}

.language-dropdown-trigger .lang-flag {
    font-size: 1.4rem;
    line-height: 1;
}

.language-dropdown-trigger .lang-name {
    flex: 1;
    text-align: left;
}

.language-dropdown-trigger .dropdown-chevron {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease;
}

.language-dropdown-wrapper.open .dropdown-chevron {
    transform: rotate(180deg);
}

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: rgba(30, 30, 35, 0.98);
    border: 1px solid rgba(130, 64, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    max-height: 280px;
    overflow-y: auto;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.language-dropdown-wrapper.open .language-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.language-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.language-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(130, 64, 255, 0.3);
    border-radius: 3px;
}

.language-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.language-dropdown-item:hover {
    background: rgba(130, 64, 255, 0.15);
}

.language-dropdown-item.selected {
    background: rgba(130, 64, 255, 0.2);
}

.language-dropdown-item .lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.language-dropdown-item .lang-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.language-dropdown-item .check-icon {
    color: #10B981;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.language-dropdown-item.selected .check-icon {
    opacity: 1;
}

/* Legacy language option (hidden now) */
.language-option {
    display: none;
}

/* Image Ratio Options - Horizontal Scroll */
.settings-ratio-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 4px 0 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-ratio-scroll::-webkit-scrollbar {
    display: none;
}

.settings-ratio-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    margin: 0;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.settings-ratio-grid::-webkit-scrollbar {
    display: none;
}

.ratio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(130, 64, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 72px;
    flex-shrink: 0;
}

.ratio-option:hover {
    border-color: #8240FF;
    background: rgba(130, 64, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(130, 64, 255, 0.2);
}

.ratio-option.selected {
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    border-color: #6E20F4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(110, 32, 244, 0.25);
}

.ratio-option .ratio-preview {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ratio-option.selected .ratio-preview {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.ratio-preview.ratio-1-1 {
    width: 40px;
    height: 40px;
}

.ratio-preview.ratio-16-9 {
    width: 48px;
    height: 27px;
}

.ratio-preview.ratio-9-16 {
    width: 27px;
    height: 48px;
}

.ratio-preview.ratio-4-3 {
    width: 40px;
    height: 30px;
}

.ratio-preview.ratio-3-4 {
    width: 30px;
    height: 40px;
}

.ratio-option .ratio-label {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
}

.ratio-option.selected .ratio-label {
    color: white;
}

.ratio-option .check-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #10B981;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.ratio-option.selected .check-badge {
    display: flex;
}

/* Border adjustments for better visibility */
#settingsModal .settings-section-header,
.settings-modal .settings-section-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* Ensure all section titles have good contrast */
#settingsModal .settings-section-title,
.settings-modal .settings-section-title {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Update tab navigation for better contrast */
#settingsModal .nav-tabs .nav-link,
.settings-modal .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
}

#settingsModal .nav-tabs .nav-link.active,
.settings-modal .nav-tabs .nav-link.active {
    color: rgba(255, 255, 255, 0.95) !important;
    border-bottom-color: #6E20F4 !important;
}

/* Character count and helper text */
#settingsModal .character-count,
#settingsModal .form-text,
.settings-modal .character-count,
.settings-modal .form-text {
    color: rgba(255, 255, 255, 0.65) !important;
}

/* Form-select dropdown styling for settings modal */
#settingsModal .form-select,
.settings-modal .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 16px 12px !important;
    padding-right: 2.5rem !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(130, 64, 255, 0.2) !important;
}

#settingsModal .form-select:focus,
.settings-modal .form-select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23D2B8FF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
    border-color: #6E20F4 !important;
    box-shadow: 0 0 0 3px rgba(110, 32, 244, 0.2) !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Style dropdown options */
#settingsModal .form-select option,
.settings-modal .form-select option {
    background: #2d2d2d !important;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem !important;
}

/* Ensure form-select works with form-floating */
#settingsModal .form-floating > .form-select,
.settings-modal .form-floating > .form-select {
    padding-right: 2.5rem !important;
    background-position: right 0.75rem center !important;
}

.settings-field {
    position: relative;
    margin-bottom: 12px;
}

.settings-field:last-child {
    margin-bottom: 0;
}

.suggestion-preset-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.suggestion-preset-grid::-webkit-scrollbar {
    display: none;
}

.suggestion-preset-option {
    flex-shrink: 0;
}

.suggestion-preset-option {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.suggestion-preset-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.suggestion-preset-option .preset-pill {
    border: 1px solid rgba(181, 138, 254, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #ffffff);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-preset-option input:checked + .preset-pill {
    background: linear-gradient(135deg, #b58afe, #a855f7);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 8px rgba(181, 138, 254, 0.3);
}

.suggestion-preset-option input:disabled + .preset-pill {
    opacity: 0.5;
    cursor: not-allowed;
}

.suggestion-preset-option .preset-gate {
    margin-left: 6px;
    font-size: 10px;
    font-weight: 700;
    color: #ffb347;
}

.settings-field-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    margin-bottom: 0;
    gap: 12px;
    width: 100%;
    position: relative;
}

.settings-field-header .settings-label {
    flex: 1 1 auto;
    margin-bottom: 0;
    text-align: left !important;
    padding-right: 0;
    justify-content: flex-start !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-field-header .settings-switch-container {
    flex: 0 0 auto;
    margin-left: auto;
    position: relative;
}

.settings-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    text-align: left !important;
    justify-content: flex-start !important;
}

.settings-section-title .settings-tooltip,
.settings-label .settings-tooltip {
    margin-left: 8px;
}

@media (max-width: 768px) {
    .settings-section {
        padding: 12px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    .settings-section-header {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    .settings-section-title {
        font-size: 15px;
    }

    .settings-label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .settings-field {
        margin-bottom: 10px;
    }

    .settings-range-container {
        gap: 8px;
        padding: 6px 0;
    }

    .settings-range-value {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 32px;
    }

    .language-option {
        min-height: 58px;
        padding: 0.6rem 0.4rem;
    }

    .ratio-option {
        min-height: 76px;
        padding: 0.6rem 0.4rem;
    }

    .settings-tooltip {
        width: 20px;
        height: 20px;
    }

    .settings-tooltip::after {
        max-width: 220px;
    }
}

.settings-input,
.settings-select,
.settings-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--glass-border, rgba(130, 64, 255, 0.2));
    border-radius: 10px;
    font-size: 13px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
    color: var(--text-primary, #ffffff);
    font-family: inherit;
}

.settings-input:focus,
.settings-select:focus,
.settings-textarea:focus {
    outline: none;
    border-color: var(--primary-color, #8240FF);
    background: var(--bg-tertiary, rgba(255, 255, 255, 0.1));
    box-shadow: 0 0 0 3px rgba(130, 64, 255, 0.2);
}

.settings-textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.5;
}

.settings-range-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.settings-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(to right, #e1e5e9 0%, #e1e5e9 100%);
    outline: none;
    transition: all 0.2s ease;
}

.settings-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(110, 32, 244, 0.3);
    border: 2px solid #ffffff;
}

.settings-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(110, 32, 244, 0.4);
}

.settings-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(110, 32, 244, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-range::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(110, 32, 244, 0.4);
}

.settings-range-value {
    min-width: 36px;
    text-align: center;
    font-weight: 700;
    color: #6E20F4;
    background: rgba(110, 32, 244, 0.08);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    letter-spacing: -0.2px;
}

.settings-tone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.settings-tone-option {
    padding: 10px 14px;
    border: 1.5px solid #e1e5e9;
    border-radius: 10px;
    background: #f8f9fa;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

.settings-tone-option:hover {
    border-color: rgba(110, 32, 244, 0.3);
    background: rgba(110, 32, 244, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.15);
}

.settings-tone-option.selected {
    border-color: #6E20F4;
    background: linear-gradient(135deg, rgba(110, 32, 244, 0.12) 0%, rgba(139, 76, 248, 0.15) 100%);
    color: #6E20F4;
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.2);
}

.settings-voice-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
}

.settings-voice-grid-0 {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
}

/* Voice Card Styles - Matching cold-onboarding design */
.voice-card {
    background: var(--glass-bg, rgba(255, 255, 255, 0.05)) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    cursor: pointer !important;
    position: relative !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.voice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(130, 64, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.voice-card:hover {
    border-color: var(--primary-light, #D2B8FF);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(130, 64, 255, 0.2);
}

.voice-card:hover::before {
    opacity: 1;
}

.voice-card.selected {
    border-color: var(--primary-color, #8240FF) !important;
    background: linear-gradient(135deg, rgba(130, 64, 255, 0.15) 0%, rgba(210, 184, 255, 0.08) 100%) !important;
    box-shadow: 0 4px 20px rgba(130, 64, 255, 0.25), inset 0 0 20px rgba(130, 64, 255, 0.05) !important;
}

.voice-card.selected::before {
    opacity: 1;
    background: linear-gradient(90deg, transparent, var(--primary-color, #8240FF), transparent);
}

.voice-card-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

/* Ensure voice-info takes remaining space */
.voice-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.voice-icon {
    width: 44px;
    min-width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #D2B8FF 0%, #8240FF 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(130, 64, 255, 0.3);
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    order: -1;
}

.voice-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(130, 64, 255, 0.4);
}

.voice-icon.playing {
    animation: voiceIconPulse 1s ease-in-out infinite;
}

@keyframes voiceIconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(130, 64, 255, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 6px 20px rgba(130, 64, 255, 0.5); }
}

.voice-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: rotate(45deg);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.voice-card.selected .voice-icon {
    box-shadow: 0 4px 16px rgba(130, 64, 255, 0.5);
    animation: iconPulse 2s ease-in-out infinite;
}

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

.voice-icon i {
    font-size: 1.2rem;
    color: white;
    position: relative;
    z-index: 1;
}

/* Hide play sample button - functionality moved to icon */
.play-sample-btn {
    display: none !important;
}

.voice-info {
    flex: 1;
}

.voice-name {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin-bottom: 2px;
    font-size: 0.875rem;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.voice-card.selected .voice-name {
    color: var(--primary-light, #D2B8FF);
}

.voice-description {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #aeb0b4);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.voice-card.selected .voice-description {
    color: rgba(210, 184, 255, 0.8);
}

.play-sample-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
    padding: 12px 20px;
    border-radius: 10px;
    color: var(--text-primary, #ffffff);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.play-sample-btn::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;
}

.play-sample-btn:hover {
    background: linear-gradient(135deg, rgba(210, 184, 255, 0.2) 0%, rgba(130, 64, 255, 0.3) 100%);
    border-color: var(--primary-color, #8240FF);
    box-shadow: 0 4px 12px rgba(130, 64, 255, 0.3);
    transform: translateY(-1px);
}

.play-sample-btn:hover::before {
    left: 100%;
}

.play-sample-btn.playing {
    background: linear-gradient(135deg, #D2B8FF 0%, #8240FF 100%);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(130, 64, 255, 0.4);
    animation: pulse 1.5s ease-in-out infinite;
}

.play-sample-btn i {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.play-sample-btn:hover i {
    transform: scale(1.1);
}

.play-sample-btn.playing i {
    animation: playPulse 0.8s ease-in-out infinite;
}

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

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

.voice-card .check-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #8240FF 0%, #D2B8FF 100%);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(130, 64, 255, 0.4);
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.voice-card.selected .check-badge {
    display: flex;
    animation: checkmarkAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.voice-card .check-badge i {
    font-size: 0.875rem;
    font-weight: bold;
}

/* Legacy support for settings-voice-option class - but voice-card overrides all styles */
.voice-card.settings-voice-option,
.voice-card.settings-premium-voice-option {
    /* Reset any legacy styles */
    padding: 20px !important;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1)) !important;
    border-radius: 16px !important;
    background: var(--glass-bg, rgba(255, 255, 255, 0.05)) !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow: hidden !important;
    gap: 16px !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Ensure old legacy styles don't apply to voice cards */
.settings-voice-option:not(.voice-card) {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: none;
    display: block;
    position: relative;
    overflow: visible;
}

/* Ensure no duplicate checkmarks from pseudo-elements on voice cards */
.voice-card.settings-voice-option::before,
.voice-card.settings-voice-option::after,
.voice-card.settings-premium-voice-option::before,
.voice-card.settings-premium-voice-option::after {
    display: none !important;
    content: none !important;
}

.settings-voice-option:hover {
    border-color: transparent;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.settings-voice-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #ffffff;
    margin-bottom: 4px;
}

.settings-voice-description {
    font-size: 0.75rem;
    color: #aeb0b4;
    text-align: left;
    line-height: 1.4;
}

.settings-save-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.25);
    position: relative;
    overflow: hidden;
}

.settings-save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.settings-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(110, 32, 244, 0.35);
}

.settings-save-btn:hover::before {
    left: 100%;
}

.settings-save-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.25);
}

.settings-chat-footer {
    padding: 16px 24px;
    background: var(--bg-primary, #1a1a1a);
    border-top: 1px solid var(--glass-border, rgba(130, 64, 255, 0.2));
    position: sticky;
    bottom: 0;
    z-index: 1;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

/* Voice Provider Switch Styles - Enhanced */
.settings-switch-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    flex-shrink: 0;
}

.settings-switch-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    transition: color 0.2s ease;
    user-select: none;
}

.settings-switch-label.standard-label {
    color: #495057;
}

.settings-switch-label.premium-label {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

.settings-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cbd5e0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 28px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.settings-switch input:checked + .settings-switch-slider {
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    box-shadow: 0 0 0 3px rgba(110, 32, 244, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.settings-switch input:checked + .settings-switch-slider:before {
    transform: translateX(24px);
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.3);
}

.settings-switch input:checked ~ .settings-switch-label.premium-label {
    color: #6E20F4;
    font-weight: 700;
}

.settings-switch:not(:has(input:checked)) ~ .settings-switch-label.standard-label {
    color: #495057;
    font-weight: 700;
}

.premium-icon {
    font-size: 14px;
    animation: pulse 2s ease-in-out infinite;
}

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

.premium-feature-indicator {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.08);
    border-left: 3px solid #ffc107;
    border-radius: 6px;
}

.premium-feature-indicator small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #856404;
}

.settings-info-box {
    padding: 10px 14px;
    background: rgba(110, 32, 244, 0.06);
    border: 1px solid rgba(110, 32, 244, 0.15);
    border-radius: 8px;
    font-size: 12px;
    color: #6E20F4;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* Enhanced Voice Option Styles */
.settings-voice-option,
.settings-evenlab-voice-option {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    background: #f8f9fa;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.settings-voice-option:hover,
.settings-evenlab-voice-option:hover {
    border-color: #6E20F4;
    background: rgba(110, 32, 244, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(110, 32, 244, 0.1);
}

.settings-voice-option.selected,
.settings-evenlab-voice-option.selected {
    border-color: #6E20F4;
    background: rgba(110, 32, 244, 0.1);
    color: #6E20F4;
    box-shadow: 0 4px 15px rgba(110, 32, 244, 0.15);
}

/* Disable old pseudo-element checkmarks for voice cards - using .check-badge instead */
.voice-card.settings-voice-option.selected::before,
.voice-card.settings-evenlab-voice-option.selected::before {
    display: none !important;
    content: none !important;
}

/* Keep the old style for non-voice-card voice options (if any exist) */
.settings-voice-option:not(.voice-card).selected::before,
.settings-evenlab-voice-option:not(.voice-card).selected::before {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    background: #6E20F4;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Legacy voice name/description - only apply to non-voice-card elements */
.settings-voice-option:not(.voice-card) .settings-voice-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.settings-voice-option:not(.voice-card) .settings-voice-description {
    font-size: 12px;
    color: #666;
    text-align: center;
    line-height: 1.3;
}

/* Override for voice-card elements */
.voice-card .settings-voice-name,
.voice-card .settings-voice-description {
    display: none !important;
}

/* Provider-specific voice containers */
#openai-voices,
#evenlab-voices {
    transition: all 0.3s ease;
}

/* Override evenlab styles for voice-card elements */
.voice-card.settings-evenlab-voice-option.selected {
    border-color: var(--primary-color, #8240FF) !important;
    background: linear-gradient(135deg, rgba(130, 64, 255, 0.15) 0%, rgba(210, 184, 255, 0.08) 100%) !important;
    box-shadow: 0 4px 20px rgba(130, 64, 255, 0.25), inset 0 0 20px rgba(130, 64, 255, 0.05) !important;
}

/* Keep old style for non-voice-card evenlab options */
#evenlab-voices .settings-evenlab-voice-option:not(.voice-card).selected {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

/* Disable evenlab checkmark for voice cards */
#evenlab-voices .voice-card.settings-evenlab-voice-option.selected::before {
    display: none !important;
    content: none !important;
}

/* Keep old style for non-voice-card evenlab options */
#evenlab-voices .settings-evenlab-voice-option:not(.voice-card).selected::before {
    background: #28a745;
}

#evenlab-voices .settings-evenlab-voice-option:hover {
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}
#showPrompts-toggle, #sendImageMessage, #sendMessage {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 576px) {
    .toolbar-scroll-container {
        padding: 5px 5px;
        gap: 6px;
        margin-left: -5px;
        margin-right: -5px;
        width: calc(100% + 10px);
    }
    
    .toolbar-btn, .toolbar-back-btn {
        min-width: 100px;
        height: 42px;
        font-size: 16px;
        padding: 0 8px;
    }
    .toolbar-back-btn{
        min-width: unset;
    }
    .tool-label {
        font-size: 11px;
        min-width: 50px;
    }
    
    .chat-toolbar-wrapper {
        padding: 5px !important;
        margin: 0;
    }
    
    .settings-modal {
        width: 96%;
        max-height: 92vh;
        border-radius: 14px;
        margin: 10px;
    }

    .settings-modal-header {
        padding: 14px 18px;
        border-radius: 15px 15px 0 0;
    }

    .settings-modal-title {
        font-size: 18px;
    }

    .settings-modal-title i {
        font-size: 20px;
    }

    .settings-close-btn {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .settings-modal-body {
        padding: 16px 18px;
    }

    .settings-quick-nav {
        gap: 6px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    /* Icon-only on mobile: hide label text, show compact square buttons */
    .settings-quick-nav-label {
        display: none;
    }

    .settings-quick-nav-btn {
        min-width: 44px;
        width: 44px;
        height: 44px;
        padding: 0 !important;
        justify-content: center;
        gap: 0;
    }

    .settings-quick-nav-btn i {
        font-size: 18px;
    }

    .settings-section {
        padding: 14px;
        margin-bottom: 18px;
    }

    .settings-section-header {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }

    .settings-section-title {
        font-size: 15px;
    }

    .settings-section-title i {
        font-size: 16px;
        width: 18px;
    }

    .settings-field {
        margin-bottom: 14px;
    }

    .settings-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .settings-description {
        font-size: 11px;
    }

    .settings-chat-footer {
        padding: 14px 18px;
    }

    .settings-save-btn {
        padding: 11px 18px;
        font-size: 13px;
    }
    
    .settings-tone-grid,
    .settings-voice-grid {
        gap: 8px;
    }

    .settings-voice-option {
        padding: 10px;
    }

    .settings-range-container {
        gap: 10px;
    }

    .settings-range-value {
        min-width: 32px;
        padding: 5px 8px;
        font-size: 12px;
    }
}

/* Enhanced Suggestions Styles */
.suggestions-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    flex-grow: 1;
    padding: 0 5px;
}

.suggestions-scroll-container::-webkit-scrollbar {
    display: none;
}

.suggestion-btn {
    flex: 0 0 auto;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid rgba(110, 32, 244, 0.1);
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.suggestion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(110, 32, 244, 0.1), transparent);
    transition: left 0.5s;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    color: white;
    border-color: #6E20F4;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(110, 32, 244, 0.25);
}

.suggestion-btn:hover::before {
    left: 100%;
}

.suggestion-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(110, 32, 244, 0.15);
}

/* Professional list design for suggestions container */
#suggestionsList .suggestion-card {
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

#suggestionsList .suggestion-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

#suggestionsList .suggestion-card:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 25px rgba(110, 32, 244, 0.15);
    border-color: rgba(110, 32, 244, 0.2);
}

#suggestionsList .suggestion-card:hover::before {
    transform: scaleY(1);
}

#suggestionsList .suggestion-text {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin: 0;
    transition: color 0.3s ease;
}

#suggestionsList .suggestion-card:hover .suggestion-text {
    color: #6E20F4;
}

#suggestionsList .suggestion-icon {
    color: #6E20F4;
    font-size: 16px;
    margin-right: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#suggestionsList .suggestion-card:hover .suggestion-icon {
    opacity: 1;
}

/* Loading state for suggestions */
#suggestionsList .loading-spinner {
    padding: 40px 0;
}

#suggestionsList .loading-spinner .spinner-border {
    color: #6E20F4;
    width: 2rem;
    height: 2rem;
}

/* Empty state */
#suggestionsList .empty-suggestions {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

#suggestionsList .empty-suggestions i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 16px;
}
/* Add scroll indicators for mobile */
@media (max-width: 768px) {
    .toolbar-scroll-container::before,
    .toolbar-scroll-container::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 20px;
        pointer-events: none;
        z-index: 1;
        transition: opacity 0.3s ease;
    }
    
    .toolbar-scroll-container::before {
        left: 0;
    }
    
    .toolbar-scroll-container::after {
        right: 0;
    }
}

/* Modern Gift Card Styles - Minimalist White Theme */
.card-progress-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.96);
    color: #fff;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.28);
    border: 2px solid rgba(255, 255, 255, 0.92);
    opacity: 0;
    transform: scale(0.55);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 7;
    pointer-events: none;
}

.card-progress-badge i {
    font-size: 15px;
    line-height: 1;
}

.modern-gift-container {
    width: 100%;
    background: transparent;
    border-radius: 0;
    padding: 8px 4px;
    transition: all 0.2s ease;
    box-shadow: none;
    border: none;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.gift-card:hover .modern-gift-container {
    transform: translateY(-2px);
}

.gift-image-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 50%;
    background: #f5f5f7;
    border: 2px solid #ebebeb;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.gift-card:hover .gift-image-wrapper {
    border-color: #8240FF;
    box-shadow: 0 2px 12px rgba(130, 64, 255, 0.2);
}

.gift-card.selected .gift-image-wrapper {
    border-color: #8240FF;
    box-shadow: 0 0 0 3px rgba(130, 64, 255, 0.15);
}

.gift-card.is-sent .card-progress-badge {
    opacity: 1;
    transform: scale(1);
}

.gift-card.is-sent .gift-image-wrapper {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.gift-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
    border-radius: 50%;
}

.gift-card:hover .gift-image {
    transform: scale(1.08);
}

.gift-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 0;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    box-shadow: none !important;
}

.gift-cost-badge:has(.cost-amount) {
    color: #fff;
    background: transparent;
    box-shadow: none;
}

.gift-cost-badge:has(.free-label) {
    color: #10b981;
    background: transparent;
    box-shadow: none;
}

.gift-coin-icon {
    font-size: 11px;
    color: #f59e0b;
    animation: none;
}

.cost-amount {
    font-weight: 600;
    letter-spacing: 0;
    color: #1a1a1a;
    font-size: 0.7rem;
}

.free-label {
    font-weight: 600;
    letter-spacing: 0;
    color: #10b981;
    font-size: 0.7rem;
}

/* Hide elements no longer needed */
.gift-overlay,
.gift-shine,
.gift-info,
.gift-title,
.gift-selection-indicator {
    display: none !important;
}

.gift-card.selected .modern-gift-container {
    border: none;
    box-shadow: none;
}

/* Premium gift styling */
.gift-card[data-cost]:not([data-cost=""]) .modern-gift-container {
    background: transparent;
}

.modern-gift-container::before {
    display: none;
}

/* Inactive gift styling */
.gift-card.inactive {
    opacity: 0.45;
}

.gift-card.inactive .gift-image-wrapper {
    border-color: #ddd;
}

/* Gift filter styling (matches SelectPose dark theme) */
#giftsOverlay .pose-filter-container {
    padding: 8px 16px;
}

#giftsOverlay .pose-filter-toggle {
    background: var(--glass-bg, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--glass-border, rgba(130, 64, 255, 0.15));
}

#giftsOverlay .pose-filter-btn {
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
}

#giftsOverlay .pose-filter-btn.active {
    color: #ffffff;
}

.gift-card[data-cost]:not([data-cost=""]):hover .modern-gift-container::before {
    display: none;
}

.gift-card[data-cost]:not([data-cost=""]) .gift-image-wrapper::after {
    display: none;
}

/* Loading state for gift images */
.gift-image[src*="placeholder"] {
    background: #f0f0f2;
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gift-image-wrapper {
        width: 56px;
        height: 56px;
    }

    .gift-cost-badge {
        font-size: 0.65rem;
    }
}

@media (max-width: 576px) {
    .gift-image-wrapper {
        width: 50px;
        height: 50px;
    }
}

/* Modern Prompt Card Styles (matching Gift Cards) */
.modern-prompt-container {
    width: 100%;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.modern-prompt-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(110, 32, 244, 0.6) 50%, 
        transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.prompt-card:hover .modern-prompt-container {
    box-shadow: 
        0 20px 40px rgba(110, 32, 244, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(110, 32, 244, 0.2);
}

.prompt-card:hover .modern-prompt-container::before {
    transform: translateX(100%);
}

.prompt-image-wrapper {
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #ffffff;
}

.prompt-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    border-radius: 16px 16px 0 0;
}

.prompt-card:hover .prompt-image {
    transform: scale(1.1);
}

.prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(110, 32, 244, 0) 0%,
        rgba(110, 32, 244, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.prompt-card:hover .prompt-overlay {
    opacity: 1;
}

.prompt-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%
    );
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.prompt-card:hover .prompt-shine {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

.prompt-info {
    padding: 16px 20px 20px;
    text-align: center;
    position: relative;
}

.prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s ease;
}

.prompt-card:hover .prompt-title {
    color: #6E20F4;
}

.prompt-cost-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 25px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.prompt-cost-badge:has(.cost-amount) {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #8b5a00;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.prompt-cost-badge:has(.free-label) {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.prompt-card:hover .prompt-cost-badge {
    transform: scale(1.05);
}

.prompt-coin-icon {
    font-size: 14px;
    animation: coinSpin 2s ease-in-out infinite;
}

.prompt-selection-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: rgba(16, 185, 129, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.prompt-selection-indicator i {
    color: white;
    font-size: 16px;
}

.prompt-card.selected .prompt-selection-indicator {
    opacity: 1;
    transform: scale(1);
}

.prompt-card.is-completed .card-progress-badge {
    opacity: 1;
    transform: scale(1);
}

.prompt-card.selected .modern-prompt-container {
    border-color: #10b981;
    box-shadow: 
        0 0 0 3px rgba(16, 185, 129, 0.2),
        0 12px 24px rgba(16, 185, 129, 0.15);
}

.prompt-card.is-completed .modern-prompt-container {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow:
        0 0 0 2px rgba(16, 185, 129, 0.18),
        0 12px 24px rgba(16, 185, 129, 0.12);
}

/* Premium prompt styling */
.prompt-card[data-cost]:not([data-cost=""]) .modern-prompt-container {
    background: linear-gradient(145deg, #fff8e1 0%, #fff3c4 100%);
}

.prompt-card[data-cost]:not([data-cost=""]) .prompt-image-wrapper::after {
    content: '✨';
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 16px;
    animation: sparkle 2s ease-in-out infinite;
}

/* Loading state for prompt images */
.prompt-image[src*="placeholder"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.template-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#promptTab-creative .modern-prompt-container {
    color: #111827;
}

#promptTab-creative .modern-prompt-container .prompt-image-wrapper {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.gift-cost-badge {
    color: #f8fafc;
}

.gift-cost-badge:has(.cost-amount) {
    color: #f8fafc;
}

.gift-coin-icon {
    color: #fbbf24;
}

.gift-cost-badge .cost-amount {
    color: #f8fafc;
}

.gift-cost-badge .free-label {
    color: #86efac;
}

.custom-prompt-modal .modal-backdrop,
.custom-prompt-modal + .modal-backdrop {
    --bs-backdrop-opacity: 0.65;
}

.custom-prompt-modal-dialog {
    width: min(720px, calc(100vw - 1.5rem));
    max-width: 720px;
    margin: 1rem auto;
}

.custom-prompt-modal-content {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
}

.custom-prompt-modal-content .modal-header,
.custom-prompt-modal-content .modal-footer {
    border-color: rgba(148, 163, 184, 0.18);
    padding: 1rem 1.25rem;
}

.custom-prompt-modal-content .modal-title {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #0f172a;
}

.custom-prompt-modal-content .modal-title i {
    color: #7c3aed;
}

.custom-prompt-modal-content .modal-body {
    padding: 1.25rem;
}

.custom-prompt-modal-layout {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.custom-prompt-preview-card {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid rgba(129, 140, 248, 0.18);
    border-radius: 20px;
    padding: 0.95rem;
}

.custom-prompt-preview-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.custom-prompt-preview-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    align-self: flex-start;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
    color: #6d28d9;
    font-size: 0.72rem;
    font-weight: 700;
}

.custom-prompt-preview-label {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
}

.custom-prompt-preview-image-wrap {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
}

.custom-prompt-preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.custom-prompt-preview-hint {
    margin: 0.8rem 0 0;
    font-size: 0.78rem;
    color: #475569;
}

.custom-prompt-form .form-label {
    color: #0f172a;
    font-weight: 700;
}

.custom-prompt-form .form-text {
    color: #64748b;
}

.custom-prompt-form textarea.form-control {
    min-height: 188px;
    border-radius: 16px;
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: none;
}

.custom-prompt-form textarea.form-control:focus {
    border-color: rgba(124, 58, 237, 0.55);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.style-tag-btn {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #ffffff;
    color: #334155;
}

.style-tag-btn:hover {
    border-color: rgba(124, 58, 237, 0.35);
    color: #6d28d9;
}

@media (max-width: 767.98px) {
    .custom-prompt-modal-dialog {
        width: calc(100vw - 1rem);
    }

    .custom-prompt-modal-layout {
        grid-template-columns: 1fr;
    }

    .custom-prompt-form textarea.form-control {
        min-height: 156px;
    }
}

/* Enhanced Model Selection Styles - Compact & Professional */
.settings-model-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
    max-width: 100%;
}

#models-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

/* Premium model grid responsive layout: 3 columns on large screens, 2 on tablet, 1 on mobile */
.settings-model-grid--premium {
    grid-template-columns: repeat(3, 1fr) !important;
}

@media (max-width: 1024px) {
    .settings-model-grid--premium {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 576px) {
    .settings-model-grid--premium {
        grid-template-columns: 1fr;
    }
}

.settings-model-option {
    padding: 14px 16px;
    border: 1.5px solid #e1e5e9;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.settings-model-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(110, 32, 244, 0.08), transparent);
    transition: left 0.4s;
}

.settings-model-option:hover {
    border-color: rgba(110, 32, 244, 0.4);
    background: rgba(110, 32, 244, 0.03);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(110, 32, 244, 0.12);
}

.settings-model-option:hover::before {
    left: 100%;
}

.settings-model-option.selected {
    border-color: #6E20F4;
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    color: white;
    box-shadow: 
        0 0 0 3px rgba(110, 32, 244, 0.15),
        0 4px 16px rgba(110, 32, 244, 0.2);
    transform: translateY(-1px);
}

.settings-model-option.selected .settings-model-name,
.settings-model-option.selected .settings-model-description,
.settings-model-option.selected .settings-model-provider,
.settings-model-option.selected .settings-model-stats {
    color: white;
}

.settings-model-option.selected::after {
    content: "✓";
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.settings-model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.settings-model-name {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.4;
    margin: 0;
    flex: 1;
    letter-spacing: -0.2px;
}

.settings-model-description {
    font-size: 12px;
    color: #6c757d;
    line-height: 1.5;
    margin: 0;
}

.settings-model-provider {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
    margin: 4px 0;
}

.settings-model-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.settings-model-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.settings-model-stat-label {
    font-size: 11px;
    color: #8e8e93;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-model-stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

.settings-model-option.selected .settings-model-stat-label,
.settings-model-option.selected .settings-model-stat-value {
    color: rgba(255, 255, 255, 0.9);
}

/* Premium Model Indicators */
.settings-model-option.premium-model {
    border-color: #ffd700;
    background: linear-gradient(145deg, #fffbf0 0%, #fff8e1 100%);
}

.settings-model-option.premium-model::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
}

.settings-model-option.premium-model:hover {
    border-color: #ffb300;
    box-shadow: 
        0 12px 30px rgba(255, 193, 7, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-model-option.premium-model.selected {
    border-color: #ffd700;
    background: linear-gradient(145deg, #ffd700 0%, #ffb300 100%);
    color: #8b5a00;
    box-shadow: 
        0 0 0 4px rgba(255, 215, 0, 0.3),
        0 8px 25px rgba(255, 193, 7, 0.25);
}

.settings-model-option.premium-model.selected .settings-model-name,
.settings-model-option.premium-model.selected .settings-model-description,
.settings-model-option.premium-model.selected .settings-model-provider,
.settings-model-option.premium-model.selected .settings-model-stats {
    color: #8b5a00;
}

.settings-model-option.premium-model.selected::after {
    background: rgba(139, 90, 0, 0.2);
    color: #8b5a00;
    border-color: rgba(139, 90, 0, 0.3);
}

.settings-model-option.premium-model.selected .settings-model-stat-label,
.settings-model-option.premium-model.selected .settings-model-stat-value {
    color: rgba(139, 90, 0, 0.8);
}

.premium-model-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(45deg, #ffd700 0%, #ffb300 100%);
    color: #8b5a00;
    border-radius: 0 14px 0 14px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    z-index: 1;
}

/* Disabled state for premium models without subscription */
.settings-model-option.premium-model.disabled {
    opacity: 0.6;
    cursor: pointer;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
}

.settings-model-option.premium-model.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #ffd700;
}

/* Loading state */
.model-loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.model-loading-spinner .spinner-border {
    color: #6E20F4;
    width: 2rem;
    height: 2rem;
}

.model-error-container {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    background: #f8f9fa;
}

.model-retry-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: #6E20F4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-retry-btn:hover {
    background: #5a1ac7;
    transform: translateY(-1px);
}

/* Speed indicators */
.speed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.speed-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #dee2e6;
}

.speed-fast .speed-dot:nth-child(-n+3),
.speed-very-fast .speed-dot {
    background: #28a745;
}

.speed-medium .speed-dot:nth-child(-n+2) {
    background: #ffc107;
}

.speed-slow .speed-dot:first-child {
    background: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-model-grid {
        gap: 10px;
    }
    
    .settings-model-option {
        padding: 16px;
    }
    
    .settings-model-name {
        font-size: 15px;
    }
    
    .settings-model-description {
        font-size: 12px;
    }
    
    .settings-model-stats {
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .settings-model-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .settings-model-stat {
        min-width: 60px;
    }
}

/* Enhanced mobile keyboard handling - replace existing mobile styles */
@media screen and (max-width: 768px) {
    #chatInput {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1050 !important; /* Higher z-index */
        padding: 10px 15px !important;
        /* Ensure it stays above keyboard */
        padding-bottom: max(env('safe-area-inset-bottom'), 10px) !important;
    }
    
    /* Ensure the input field is visible */
    #userMessage {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px !important; /* iOS touch target size */
        border-radius: 8px !important;
        border: unset!important;
        border-color: unset!important;
        z-index: 1051 !important;
        position: relative !important;
    }
    
    /* Ensure the toolbar wrapper doesn't cover the input */
    .chat-toolbar-wrapper {
        z-index: 1049 !important;
        position: relative !important;
    }
    
    /* Make sure any overlays don't interfere */
    #suggestionsContainer,
    #personas-container,
    #promptContainer,
    #giftsOverlay {
        z-index: 1048 !important;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    @media screen and (max-width: 768px) {
        #chatInput {
            /* iOS Safari specific positioning */
            position: -webkit-sticky !important;
            position: sticky !important;
            bottom: 0 !important;
        }
        
        /* Prevent any white divs from covering input */
        body * {
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .modern-prompt-container {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .prompt-title {
        color: #e2e8f0;
    }
    
    .prompt-card:hover .prompt-title {
        color: #8B4CF8;
    }
}

#sendMessage, #chatInput .load {
    border-left: 0 !important;
    box-shadow: none;
}

#chatInput {
    position: absolute;
    bottom: 0;
    width: 100%;
    right: 0;
    left: 0;
    z-index: 1000;
    padding: 10px;
}

body.keyboard-open #chatInput {
    background-color: transparent !important;
    box-shadow: none !important;
}

#chatContainer {
    height: 100%;
    overflow-y: scroll !important; /* Ensure scroll is always enabled */
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer and Edge */
    /* Remove any properties that might interfere with scrolling */
    touch-action: pan-y; /* Allow vertical scrolling on touch devices */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

#chatContainer::-webkit-scrollbar {
    display: none; /* Hide scrollbar for WebKit browsers */
}

/* Enhanced Model Selection Styles */
.settings-model-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 10px;
}

.settings-model-option {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.settings-model-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(110, 32, 244, 0.1), transparent);
    transition: left 0.5s;
}

.settings-model-option:hover {
    border-color: #6E20F4;
    background: linear-gradient(145deg, #ffffff 0%, rgba(110, 32, 244, 0.02) 100%);
    transform: translateY(-4px);
    box-shadow: 
        0 12px 30px rgba(110, 32, 244, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-model-option:hover::before {
    left: 100%;
}

.settings-model-option.selected {
    border-color: #6E20F4;
    background: linear-gradient(145deg, #6E20F4 0%, #8B4CF8 100%);
    color: white;
    box-shadow: 
        0 0 0 4px rgba(110, 32, 244, 0.2),
        0 8px 25px rgba(110, 32, 244, 0.25);
    transform: translateY(-2px);
}

.settings-model-option.selected .settings-model-name,
.settings-model-option.selected .settings-model-description,
.settings-model-option.selected .settings-model-provider,
.settings-model-option.selected .settings-model-stats {
    color: white;
}

.settings-model-option.selected::after {
    content: "✓";
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.settings-model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.settings-model-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

.settings-model-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin: 0;
}

.settings-model-provider {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
    margin: 4px 0;
}

.settings-model-stats {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.settings-model-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.settings-model-stat-label {
    font-size: 11px;
    color: #8e8e93;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-model-stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

.settings-model-option.selected .settings-model-stat-label,
.settings-model-option.selected .settings-model-stat-value {
    color: rgba(255, 255, 255, 0.9);
}

/* Premium Model Indicators */
.settings-model-option.premium-model {
    border-color: #ffd700;
    background: linear-gradient(145deg, #fffbf0 0%, #fff8e1 100%);
}

.settings-model-option.premium-model::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
}

.settings-model-option.premium-model:hover {
    border-color: #ffb300;
    box-shadow: 
        0 12px 30px rgba(255, 193, 7, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-model-option.premium-model.selected {
    border-color: #ffd700;
    background: linear-gradient(145deg, #ffd700 0%, #ffb300 100%);
    color: #8b5a00;
    box-shadow: 
        0 0 0 4px rgba(255, 215, 0, 0.3),
        0 8px 25px rgba(255, 193, 7, 0.25);
}

.settings-model-option.premium-model.selected .settings-model-name,
.settings-model-option.premium-model.selected .settings-model-description,
.settings-model-option.premium-model.selected .settings-model-provider,
.settings-model-option.premium-model.selected .settings-model-stats {
    color: #8b5a00;
}

.settings-model-option.premium-model.selected::after {
    background: rgba(139, 90, 0, 0.2);
    color: #8b5a00;
    border-color: rgba(139, 90, 0, 0.3);
}

.settings-model-option.premium-model.selected .settings-model-stat-label,
.settings-model-option.premium-model.selected .settings-model-stat-value {
    color: rgba(139, 90, 0, 0.8);
}

.premium-model-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(45deg, #ffd700 0%, #ffb300 100%);
    color: #8b5a00;
    border-radius: 0 14px 0 14px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    z-index: 1;
}

/* Disabled state for premium models without subscription */
.settings-model-option.premium-model.disabled {
    opacity: 0.6;
    cursor: pointer;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
}

.settings-model-option.premium-model.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #ffd700;
}

/* Loading state */
.model-loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.model-loading-spinner .spinner-border {
    color: #6E20F4;
    width: 2rem;
    height: 2rem;
}

.model-error-container {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    background: #f8f9fa;
}

.model-retry-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: #6E20F4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-retry-btn:hover {
    background: #5a1ac7;
    transform: translateY(-1px);
}

/* Speed indicators */
.speed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.speed-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #dee2e6;
}

.speed-fast .speed-dot:nth-child(-n+3),
.speed-very-fast .speed-dot {
    background: #28a745;
}

.speed-medium .speed-dot:nth-child(-n+2) {
    background: #ffc107;
}

.speed-slow .speed-dot:first-child {
    background: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-model-grid {
        gap: 10px;
        grid-template-columns: 1fr !important;
    }
    
    .settings-model-option {
        padding: 16px;
    }
    
    .settings-model-name {
        font-size: 15px;
    }
    
    .settings-model-description {
        font-size: 12px;
    }
    
    .settings-model-stats {
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .settings-model-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .settings-model-stat {
        min-width: 60px;
    }
}

/* Enhanced mobile keyboard handling - replace existing mobile styles */
@media screen and (max-width: 768px) {
    #chatInput {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1050 !important; /* Higher z-index */
        padding: 10px 15px !important;
        /* Ensure it stays above keyboard */
        padding-bottom: max(env('safe-area-inset-bottom'), 10px) !important;
    }
    
    /* Ensure the input field is visible */
    #userMessage {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px !important; /* iOS touch target size */
        border-radius: 8px !important;
        border: unset!important;
        border-color: unset!important;
        z-index: 1051 !important;
        position: relative !important;
    }
    
    /* Ensure the toolbar wrapper doesn't cover the input */
    .chat-toolbar-wrapper {
        z-index: 1049 !important;
        position: relative !important;
    }
    
    /* Make sure any overlays don't interfere */
    #suggestionsContainer,
    #personas-container,
    #promptContainer,
    #giftsOverlay {
        z-index: 1048 !important;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    @media screen and (max-width: 768px) {
        #chatInput {
            /* iOS Safari specific positioning */
            position: -webkit-sticky !important;
            position: sticky !important;
            bottom: 0 !important;
        }
        
        /* Prevent any white divs from covering input */
        body * {
            -webkit-overflow-scrolling: touch;
        }
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .modern-prompt-container {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .prompt-title {
        color: #e2e8f0;
    }
    
    .prompt-card:hover .prompt-title {
        color: #8B4CF8;
    }
}

#sendMessage, #chatInput .load {
    border-left: 0 !important;
    box-shadow: none;
}

#chatInput {
    position: absolute;
    bottom: 0;
    width: 100%;
    right: 0;
    left: 0;
    z-index: 1000;
    padding: 10px;
}

body.keyboard-open #chatInput {
    background-color: transparent !important;
    box-shadow: none !important;
}

#chatContainer {
    height: 100%;
    overflow-y: scroll !important; /* Ensure scroll is always enabled */
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer and Edge */
    /* Remove any properties that might interfere with scrolling */
    touch-action: pan-y; /* Allow vertical scrolling on touch devices */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

#chatContainer::-webkit-scrollbar {
    display: none; /* Hide scrollbar for WebKit browsers */
}

/* Enhanced Model Selection Styles */
.settings-model-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 10px;
}

.settings-model-option {
    padding: 20px;
    border: 2px solid #e9ecef;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.settings-model-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(110, 32, 244, 0.1), transparent);
    transition: left 0.5s;
}

.settings-model-option:hover {
    border-color: #6E20F4;
    background: linear-gradient(145deg, #ffffff 0%, rgba(110, 32, 244, 0.02) 100%);
    transform: translateY(-4px);
    box-shadow: 
        0 12px 30px rgba(110, 32, 244, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-model-option:hover::before {
    left: 100%;
}

.settings-model-option.selected {
    border-color: #6E20F4;
    background: linear-gradient(145deg, #6E20F4 0%, #8B4CF8 100%);
    color: white;
    box-shadow: 
        0 0 0 4px rgba(110, 32, 244, 0.2),
        0 8px 25px rgba(110, 32, 244, 0.25);
    transform: translateY(-2px);
}

.settings-model-option.selected .settings-model-name,
.settings-model-option.selected .settings-model-description,
.settings-model-option.selected .settings-model-provider,
.settings-model-option.selected .settings-model-stats {
    color: white;
}

.settings-model-option.selected::after {
    content: "✓";
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.settings-model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.settings-model-name {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

.settings-model-description {
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin: 0;
}

.settings-model-provider {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 500;
    margin: 4px 0;
}

.settings-model-stats {
    display: flex;
    gap: 16px;
    margin-top:  8px;
}

.settings-model-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.settings-model-stat-label {
    font-size: 11px;
    color: #8e8e93;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-model-stat-value {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
}

.settings-model-option.selected .settings-model-stat-label,
.settings-model-option.selected .settings-model-stat-value {
    color: rgba(255, 255, 255, 0.9);
}

/* Premium Model Indicators */
.settings-model-option.premium-model {
    border-color: #ffd700;
    background: linear-gradient(145deg, #fffbf0 0%, #fff8e1 100%);
}

.settings-model-option.premium-model::before {
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
}

.settings-model-option.premium-model:hover {
    border-color: #ffb300;
    box-shadow: 
        0 12px 30px rgba(255, 193, 7, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-model-option.premium-model.selected {
    border-color: #ffd700;
    background: linear-gradient(145deg, #ffd700 0%, #ffb300 100%);
    color: #8b5a00;
    box-shadow: 
        0 0 0 4px rgba(255, 215, 0, 0.3),
        0 8px 25px rgba(255, 193, 7, 0.25);
}

.settings-model-option.premium-model.selected .settings-model-name,
.settings-model-option.premium-model.selected .settings-model-description,
.settings-model-option.premium-model.selected .settings-model-provider,
.settings-model-option.premium-model.selected .settings-model-stats {
    color: #8b5a00;
}

.settings-model-option.premium-model.selected::after {
    background: rgba(139, 90, 0, 0.2);
    color: #8b5a00;
    border-color: rgba(139, 90, 0, 0.3);
}

.settings-model-option.premium-model.selected .settings-model-stat-label,
.settings-model-option.premium-model.selected .settings-model-stat-value {
    color: rgba(139, 90, 0, 0.8);
}

.premium-model-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(45deg, #ffd700 0%, #ffb300 100%);
    color: #8b5a00;
    border-radius: 0 14px 0 14px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
    z-index: 1;
}

/* Disabled state for premium models without subscription */
.settings-model-option.premium-model.disabled {
    opacity: 0.6;
    cursor: pointer;
    background: linear-gradient(145deg, #f8f9fa 0%, #e9ecef 100%);
    border-color: #dee2e6;
}

.settings-model-option.premium-model.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #ffd700;
}

/* Loading state */
.model-loading-container {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.model-loading-spinner .spinner-border {
    color: #6E20F4;
    width: 2rem;
    height: 2rem;
}

.model-error-container {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    background: #f8f9fa;
}

.model-retry-btn {
    margin-top: 12px;
    padding: 8px 16px;
    background: #6E20F4;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.model-retry-btn:hover {
    background: #5a1ac7;
    transform: translateY(-1px);
}

/* Speed indicators */
.speed-indicator {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.speed-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #dee2e6;
}

.speed-fast .speed-dot:nth-child(-n+3),
.speed-very-fast .speed-dot {
    background: #28a745;
}

.speed-medium .speed-dot:nth-child(-n+2) {
    background: #ffc107;
}

.speed-slow .speed-dot:first-child {
    background: #dc3545;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .settings-model-grid {
        gap: 10px;
    }
    
    .settings-model-option {
        padding: 16px;
    }
    
    .settings-model-name {
        font-size: 15px;
    }
    
    .settings-model-description {
        font-size: 12px;
    }
    
    .settings-model-stats {
        gap: 12px;
    }
}

@media (max-width: 576px) {
    .settings-model-stats {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .settings-model-stat {
        min-width: 60px;
    }
}

/* Enhanced mobile keyboard handling - replace existing mobile styles */
@media screen and (max-width: 768px) {
    #chatInput {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1050 !important; /* Higher z-index */
        padding: 10px 15px !important;
        /* Ensure it stays above keyboard */
        padding-bottom: max(env('safe-area-inset-bottom'), 10px) !important;
    }
    
    /* Ensure the input field is visible */
    #userMessage {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 44px !important; /* iOS touch target size */
        border-radius: 8px !important;
        border: unset!important;
        border-color: unset!important;
        z-index: 1051 !important;
        position: relative !important;
    }
    
    /* Ensure the toolbar wrapper doesn't cover the input */
    .chat-toolbar-wrapper {
        z-index: 1049 !important;
        position: relative !important;
    }
    
    /* Make sure any overlays don't interfere */
    #suggestionsContainer,
    #personas-container,
    #promptContainer,
    #giftsOverlay {
        z-index: 1048 !important;
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    @media screen and (max-width: 768px) {
        #chatInput {
            /* iOS Safari specific positioning */
            position: -webkit-sticky !important;
            position: sticky !important;
            bottom: 0 !important;
        }
        
        /* Prevent any white divs from covering input */
        body * {
            -webkit-overflow-scrolling: touch;
        }
    }
}


/* Enhanced user message styling to match loaded chat messages */
/* Ensure user message containers align to the right */
.d-flex.flex-row.justify-content-end.message-container,
.message-container.user-message,
.d-flex.message-container.user-message,
.message-container:has(.user-message) {
    justify-content: flex-end !important;
    align-items: flex-end !important;
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
}

/* Target message containers that contain user-message */
.message-container:has(.user-message) {
    justify-content: flex-end !important;
    width: 100% !important;
}

.user-message {
    color: #fff !important;
    border-radius: 15px 0 15px 15px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    border: none !important;
    display: inline-block !important;
    width: fit-content !important;
    min-width: fit-content !important;
    word-wrap: break-word !important;
    white-space: normal !important;
}

.user-message span {
    color: #fff !important;
}

/* Enhanced input text contrast for #userMessage */
#userMessage {
    color: rgba(255, 255, 255, 0.95) !important;
}

#userMessage::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ============================================
   Pose Filter Toggle - Professional Native App Style
   ============================================ */
.pose-filter-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 20px 8px;
    background: transparent;
}

.pose-filter-toggle {
    display: flex;
    position: relative;
    background: var(--glass-bg, rgba(0, 0, 0, 0.2));
    border-radius: 12px;
    padding: 4px;
    gap: 0;
    border: 1px solid var(--glass-border, rgba(130, 64, 255, 0.15));
    box-shadow: 
        inset 0 2px 4px rgba(0, 0, 0, 0.1),
        0 1px 2px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pose-filter-btn {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.pose-filter-btn i {
    font-size: 14px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.pose-filter-btn:hover:not(.active) {
    color: var(--text-primary, rgba(255, 255, 255, 0.85));
}

.pose-filter-btn:hover:not(.active) i {
    transform: scale(1.1);
}

.pose-filter-btn.active {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.pose-filter-btn.active i {
    transform: scale(1.05);
}

/* Animated slider background */
.pose-filter-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #6E20F4 0%, #8B4CF8 100%);
    border-radius: 8px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 
        0 2px 8px rgba(110, 32, 244, 0.4),
        0 4px 16px rgba(110, 32, 244, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Filter-specific slider colors */
.pose-filter-toggle[data-active="sfw"] .pose-filter-slider {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 
        0 2px 8px rgba(16, 185, 129, 0.4),
        0 4px 16px rgba(16, 185, 129, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.pose-filter-toggle[data-active="nsfw"] .pose-filter-slider {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    box-shadow: 
        0 2px 8px rgba(239, 68, 68, 0.4),
        0 4px 16px rgba(239, 68, 68, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Badge indicators for SFW/NSFW buttons */
.pose-filter-btn[data-filter="sfw"] i {
    color: #10b981;
}

.pose-filter-btn[data-filter="nsfw"] i {
    color: #ef4444;
}

.pose-filter-btn[data-filter="sfw"].active i,
.pose-filter-btn[data-filter="nsfw"].active i,
.pose-filter-btn[data-filter="all"].active i {
    color: #ffffff;
}

/* Pose count badge */
.pose-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 4px;
    transition: all 0.3s ease;
}

.pose-filter-btn.active .pose-filter-count {
    background: rgba(255, 255, 255, 0.25);
}

/* Hidden state for filtered items */
.prompt-card.pose-filtered-hidden,
.gift-card.gift-filtered-hidden {
    display: none !important;
}

/* Animation for cards appearing/disappearing */
.prompt-card,
.gift-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.prompt-card.pose-filtering-out,
.gift-card.gift-filtering-out {
    opacity: 0;
    transform: scale(0.95);
}

.prompt-card.pose-filtering-in,
.gift-card.gift-filtering-in {
    animation: poseFilterIn 0.3s ease forwards;
}

@keyframes poseFilterIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Empty state when no poses match filter */
.pose-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, rgba(255, 255, 255, 0.6));
    width: 100%;
}

.pose-empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pose-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .pose-filter-container {
        padding: 10px 16px 6px;
    }
    
    .pose-filter-toggle {
        width: 100%;
        justify-content: space-between;
    }
    
    .pose-filter-btn {
        flex: 1;
        padding: 8px 12px;
        font-size: 12px;
        gap: 4px;
    }
    
    .pose-filter-btn i {
        font-size: 13px;
    }
    
    .pose-filter-btn span {
        display: block;
    }
}

/* ============================================================================
   FIXED CHAT LAYOUT - Only messages area scrolls
   ============================================================================ */

/* Navbar adjustments for fixed chat layout - work alongside existing fixed navbar */
body.chat-active .navbar.fixed-top {
    z-index: 1030; /* Keep Bootstrap default */
}

/* Fixed chat wrapper - accounts for navbar and footer height */
#chat-wrapper {
    position: fixed !important;
    top: 70px; /* Height of navbar */
    left: 0;
    right: 0;
    bottom: 120px; /* Height of footer toolbar */
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    z-index: 1000;
    background-size: cover;
    background-position: center;
}

/* Mobile height adjustments */
@media (max-width: 768px) {
    #chat-wrapper {
        top: 60px; /* Smaller navbar on mobile */
        bottom: 110px; /* Smaller footer on mobile */
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    #chat-wrapper {
        top: 55px;
        bottom: 100px;
    }
}

/* Ensure navbar content is visible in chat mode */
body.chat-active nav.navbar {
    background: transparent !important;
}

/* When chat is active, prevent body scroll */
body.chat-active {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
    height: 100%;
    touch-action: none;
}

body.chat-active .content {
    overflow: hidden !important;
}

/* Fixed chat wrapper - fills entire viewport */
#chat-wrapper {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
    z-index: 1000;
    background-size: cover;
    background-position: center;
    padding-top: 0; /* Will be adjusted by JS for navbar height */
}

/* When navbar is present, adjust chat-wrapper */
body.chat-active .navbar.fixed-top + #chat-wrapper,
body.chat-active nav.fixed-top ~ #chat-wrapper {
    padding-top: 60px; /* Height of navbar */
}

/* Ensure chat-wrapper covers everything */
body.chat-active #chat-wrapper {
    top: 0 !important;
    padding-top: 0 !important;
    background-color: #0f0f1a;
    z-index: 999; /* Below navbar but above content */
}

/* Navbar stays on top */
body.chat-active .navbar {
    z-index: 1001;
}

/* Account for navbar height so messages aren't hidden behind it */
body.chat-active #chat-messages-area {
    padding-top: 130px; /* identity bar (~56px) + gallery row (~70px) */
}

/* Fixed Header Area - doesn't scroll */
#chat-header-area {
    flex-shrink: 0;
    z-index: 1001;
    background: transparent;
}

/* Scrollable Messages Area - only this scrolls */
#chat-messages-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 990;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

/* Hide scrollbar for messages area on mobile */
#chat-messages-area::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

#chat-messages-area {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Fixed Footer Area - doesn't scroll */
#chat-footer-area {
    flex-shrink: 0;
    z-index: 1002;
    background: transparent;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Fixed footer wrapper styling */
.chat-fixed-footer {
    position: relative;
    width: 100%;
    background: transparent;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Chat input container - no longer absolute positioned */
#chatInput {
    position: relative !important;
    width: 100%;
    padding: 5px 15px;
    margin: 0;
    background: transparent;
}

/* Ensure chat toolbar stays at bottom */
.chat-toolbar-wrapper {
    position: relative;
    bottom: 0;
    margin-bottom: 0;
}

/* Overlays positioning - adjusted for fixed layout */
#suggestionsContainer,
#personas-container,
#promptContainer,
#giftsOverlay,
#goalsOverlay {
    position: fixed !important;
    bottom: 0px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: 95% !important;
    max-height: 55vh;
    z-index: 2000 !important;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    #chat-wrapper {
        /* Handle mobile viewport quirks */
        height: 100vh;
        height: -webkit-fill-available;
        height: stretch;
    }
    
    #chat-messages-area {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }
    
    .chat-fixed-footer {
        padding-bottom: max(5px, env(safe-area-inset-bottom));
    }
    
    /* Adjust overlays for mobile */
    #suggestionsContainer,
    #personas-container,
    #promptContainer,
    #giftsOverlay,
    #goalsOverlay {
        bottom: 0px !important;
        width: 98% !important;
        max-height: 50vh;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    #chat-wrapper {
        height: -webkit-fill-available;
    }
    
    .chat-fixed-footer {
        padding-bottom: 20px; /* iOS safe area fallback */
    }
}

/* Prevent text selection during scroll on mobile */
#chat-messages-area {
    user-select: text;
    -webkit-user-select: text;
}

/* Smooth scrolling for messages */
#chatContainer {
    scroll-behavior: smooth;
}

/* Ensure navbar doesn't interfere */
.navbar.fixed-top {
    z-index: 1030;
}

/* Hide site footer on chat to prevent double footers */
body.chat-active .site-footer,
body.chat-active footer.site-footer {
    display: none !important;
}

/* Position sticky-bottom correctly when chat is active */
body.chat-active .sticky-bottom {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1002;
    background: transparent;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Footer toolbar adjustments for fixed layout */
#footer-toolbar {
    position: relative;
    z-index: 1002;
}

/* Mobile adjustments for footer positioning */
@media (max-width: 768px) {
    body.chat-active .sticky-bottom {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}
