.fullscreen-chat {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1a1a1a;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.fullscreen-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 20px 25px;
    border-bottom: 1px solid #404040;
    position: relative;
    z-index: 10000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
.header-left {
    display: flex;
    align-items: center;
}
.conversation-menu-btn {
    background: linear-gradient(135deg, #23404e 0%, #2d5363 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(35, 64, 78, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.conversation-menu-btn:hover {
    background: linear-gradient(135deg, #2d5363 0%, #3a6b7a 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(35, 64, 78, 0.4);
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.image-settings-btn {
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 96, 100, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-settings-btn:hover {
    background: linear-gradient(135deg, #00838f 0%, #0097a7 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 96, 100, 0.4);
}
.close-fullscreen-btn {
    background: linear-gradient(135deg, #2d5363 0%, #23404e 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(35, 64, 78, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.close-fullscreen-btn:hover {
    background: linear-gradient(135deg, #23404e 0%, #1a2a35 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(35, 64, 78, 0.4);
}

.chat-modal-name {
    color: #e0e0e0;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    flex: 1;
    margin: 0 20px;
}

.credit-balance-display {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #23404e 0%, #2d5363 100%);
    padding: 12px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(35, 64, 78, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    margin-right: 20px;
}

.credit-balance-display::before {
    content: '💰 Credits';
    position: absolute;
    top: -8px;
    left: 20px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.credit-label {
    color: #e0e0e0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.credit-amount {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    min-width: 50px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    margin-right: 15px;
}

.credit-amount:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

.credit-amount.low-credits {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b6b;
    animation: pulse 2s infinite;
}

.credit-amount.guest-credits {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border-color: rgba(255, 193, 7, 0.4);
}

/* Ensure proper spacing between credit groups */
.credit-balance-display > *:not(:last-child) {
    margin-right: 0;
}

/* Credit group container for better organization */
.credit-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pmv-tts-control-wrap {
    display: flex;
    align-items: center;
    margin-right: 12px;
}
.pmv-tts-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e0e0e0;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.pmv-tts-label input[type="checkbox"] {
    cursor: pointer;
}
.refresh-credits-btn {
    background: linear-gradient(135deg, #006064 0%, #00838f 100%);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 96, 100, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
}

.refresh-credits-btn:hover {
    background: linear-gradient(135deg, #00838f 0%, #0097a7 100%);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 96, 100, 0.4);
}

/* Ensure the header actions are properly spaced */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

/* Image settings button styling */
.image-settings-btn {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-settings-btn:hover {
    background: linear-gradient(135deg, #ffa500 0%, #ffb84d 100%);
    transform: translateY(-2px) scale(1.05);
}

.image-gen-btn {
    background: linear-gradient(135deg, #ff8c00 0%, #ffa500 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    width: 44px;
    height: 44px;
    margin-right: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-gen-btn:hover {
    background: linear-gradient(135deg, #ffa500 0%, #ffb84d 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 140, 0, 0.4);
}

.image-gen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10003;
    display: none;
    align-items: center;
    justify-content: center;
}
.image-gen-modal.active {
    display: flex;
}
.image-gen-modal-content {
    background: #2d2d2d;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #444;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.image-gen-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
    background: #1a1a1a;
    border-radius: 16px 16px 0 0;
}
.image-gen-modal-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 20px;
}
.image-gen-modal-close {
    background: #2d5363;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-gen-modal-close:hover {
    background: #23404e;
    transform: scale(1.1);
}
.image-gen-modal-body {
    padding: 20px;
}
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.preset-card {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.preset-card:hover {
    border-color: #ffa500;
    background: #252525;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 140, 0, 0.2);
}
.preset-card.selected {
    border-color: #ffa500;
    background: #2a2520;
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.3);
}
.preset-card-name {
    font-weight: bold;
    color: #e0e0e0;
    margin-bottom: 5px;
    font-size: 16px;
}
.preset-card-desc {
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.input-flex-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.input-flex-row textarea {
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
}
.fullscreen-chat-send-btn {
    margin: 0;
}

.fullscreen-chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
    position: relative;
}

.fullscreen-chat-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(35, 64, 78, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(0, 96, 100, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.fullscreen-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: transparent;
    position: relative;
    z-index: 1;
}

.fullscreen-chat-input-container {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 20px;
    border-top: 1px solid #404040;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.fullscreen-chat-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #404040, transparent);
}

.fullscreen-chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #333333;
    border-radius: 25px;
    background: #1a1a1a;
    color: #ffffff;
    font-size: 15px;
    resize: vertical;
    min-height: 50px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fullscreen-chat-input:focus {
    outline: none;
    border-color: #23404e;
    box-shadow: 0 0 0 3px rgba(35, 64, 78, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    background: #1f1f1f;
}

.fullscreen-chat-send-btn {
    background: linear-gradient(135deg, #23404e 0%, #2d5363 100%);
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    margin-left: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(35, 64, 78, 0.3);
    position: relative;
    overflow: hidden;
}

.fullscreen-chat-send-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;
}

.fullscreen-chat-send-btn:hover {
    background: linear-gradient(135deg, #2d5363 0%, #3a6b7a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(35, 64, 78, 0.4);
}

.fullscreen-chat-send-btn:hover::before {
    left: 100%;
}

.fullscreen-chat-send-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(35, 64, 78, 0.3);
}

.fullscreen-chat-send-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

.chat-message {
    margin-bottom: 6px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    animation: messageSlideIn 0.4s ease-out;
}

.chat-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.chat-message.user {
    background: linear-gradient(135deg, #23404e 0%, #2d5363 100%);
    color: #ffffff;
    margin-left: auto;
    text-align: right;
    border: none;
    border-bottom-right-radius: 6px;
}

.chat-message.user::before {
    content: '';
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-left-color: #2d5363;
    border-bottom: none;
    border-right: none;
}

.chat-message.bot {
    background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
    color: #ffffff;
    margin-right: auto;
    border: none;
    border-bottom-left-radius: 6px;
}

.chat-message.bot::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #333333;
    border-bottom: none;
    border-left: none;
}

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

.speaker-name {
    font-weight: 700;
    margin-bottom: 4px;
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.chat-message-content-wrapper {
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 15px;
}

.chat-message-content-wrapper img {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chat-message-content-wrapper img {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.typing-indicator {
    color: #888;
    font-style: italic;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
    border-radius: 18px;
    margin-bottom: 15px;
    display: inline-block;
    margin-right: auto;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: typingPulse 1.5s ease-in-out infinite;
}

.typing-indicator::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-right-color: #333333;
    border-bottom: none;
    border-left: none;
}

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

.spinner {
    border: 3px solid #333;
    border-top: 3px solid #23404e;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

.conversation-sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: #232323;
    border-right: 1px solid #404040;
    z-index: 10001;
    transition: left 0.3s ease;
    overflow-y: auto;
    display: block;
}

.conversation-sidebar.open {
    left: 0;
}

.conversation-sidebar.hidden {
    display: none;
}

.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #404040;
    background: #232629;
}

.sidebar-header h3 {
    margin: 0 0 10px 0;
    color: #e0e0e0;
}

.sidebar-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.new-chat-btn, .save-chat-btn, .export-chat-btn {
    background: #23404e;
    color: #e0e0e0;
    border: 1px solid #232629;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.new-chat-btn:hover, .save-chat-btn:hover, .export-chat-btn:hover {
    background: #2d5363;
    transform: translateY(-1px);
}

.close-sidebar-btn {
    background: #2d5363;
    color: #fff;
    border: 1px solid #2d5363;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.close-sidebar-btn:hover {
    background: #23404e;
    transform: translateY(-1px);
}

.conversation-list {
    padding: 15px;
}

.loading-container {
    color: #888;
    text-align: center;
    padding: 20px;
}

.image-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10002;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-settings-content {
    background: #2d2d2d;
    border-radius: 8px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    width: 90%;
    border: 1px solid #444;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #444;
    background: #1a1a1a;
}

.settings-header h3 {
    margin: 0;
    color: #e0e0e0;
}

.close-settings-modal {
    background: #2d5363;
    color: #fff;
    border: 1px solid #2d5363;
    border-radius: 8px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.close-settings-modal:hover {
    background: #23404e;
    transform: translateY(-1px);
}

.settings-body {
    padding: 20px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section h4 {
    color: #e0e0e0;
    margin-bottom: 15px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    color: #e0e0e0;
    margin-bottom: 5px;
    font-weight: bold;
}

.setting-group input[type="text"],
.setting-group input[type="number"],
.setting-group select,
.setting-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 14px;
}

.setting-group input[type="checkbox"] {
    margin-right: 8px;
}

.setting-description {
    color: #888;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

.settings-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #444;
}

.button-primary {
    background: #23404e;
    color: #e0e0e0;
    border: 1px solid #232629;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.button-primary:hover {
    background: #2d5363;
    transform: translateY(-1px);
}

.button-secondary {
    background: #6c757d;
    color: #fff;
    border: 1px solid #6c757d;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.button-secondary:hover {
    background: #545b62;
    transform: translateY(-1px);
}

/* MOBILE FIXES FOR CHAT LAYOUT */
@media (max-width: 768px) {
    .fullscreen-chat {
        height: 100dvh !important; /* Use dynamic viewport height to account for mobile browser UI */
        max-height: 100dvh !important;
        overflow: hidden !important;
    }
    
    .fullscreen-chat-header {
        padding: 10px !important;
        flex-shrink: 0 !important;
        min-height: 60px !important;
        max-height: 60px !important;
    }
    
                    .chat-modal-name {
    font-size: 14px !important;
    color: #e0e0e0 !important;
    font-weight: bold !important;
}

.credit-balance-display {
    display: none !important; /* Hide credit display on mobile to save space */
}
    
                    .token-usage-display,
.image-usage-display {
    display: none !important; /* Hide usage displays on mobile to save space */
}
    
    .fullscreen-chat-content {
        flex: 1 !important;
        overflow-y: auto !important;
        padding: 10px !important;
        background: #1a1a1a !important;
        min-height: 0 !important; /* Allow flex item to shrink */
    }
    
    .fullscreen-chat-history {
        padding: 10px !important;
        background: #1a1a1a !important;
        color: #e0e0e0 !important;
    }
    
    .fullscreen-chat-input-container {
        padding: 10px !important;
        background: #2a2a2a !important;
        border-top: 1px solid #404040 !important;
        flex-shrink: 0 !important;
        position: relative !important;
        z-index: 10001 !important;
    }
    
    .input-flex-row {
        display: flex !important;
        align-items: flex-end !important;
        gap: 8px !important;
    }
    
    #chat-input {
        flex: 1 !important;
        padding: 14px 18px !important;
        border: 2px solid #333333 !important;
        border-radius: 20px !important;
        background: #1a1a1a !important;
        color: #ffffff !important;
        font-size: 16px !important; /* Prevent zoom on iOS */
        resize: none !important;
        min-height: 44px !important;
        max-height: 120px !important;
        transition: all 0.3s ease !important;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }
    
    #chat-input:focus {
        outline: none !important;
        border-color: #23404e !important;
        background: #1f1f1f !important;
        color: #ffffff !important;
        box-shadow: 0 0 0 3px rgba(35, 64, 78, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    }
    
    .fullscreen-chat-send-btn {
        background: linear-gradient(135deg, #23404e 0%, #2d5363 100%) !important;
        color: #ffffff !important;
        border: none !important;
        padding: 14px 20px !important;
        border-radius: 20px !important;
        cursor: pointer !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        flex-shrink: 0 !important;
        min-height: 44px !important;
        transition: all 0.3s ease !important;
        box-shadow: 0 4px 12px rgba(35, 64, 78, 0.3) !important;
    }
    
    .chat-message {
        margin-bottom: 6px !important;
        padding: 10px 14px !important;
        border-radius: 16px !important;
        max-width: 85% !important;
        word-wrap: break-word !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
        animation: messageSlideIn 0.4s ease-out !important;
    }
    
    .chat-message.user {
        background: linear-gradient(135deg, #23404e 0%, #2d5363 100%) !important;
        color: #ffffff !important;
        margin-left: auto !important;
        border: none !important;
        border-bottom-right-radius: 6px !important;
    }
    
    .chat-message.bot {
        background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%) !important;
        color: #ffffff !important;
        margin-right: auto !important;
        border: none !important;
        border-bottom-left-radius: 6px !important;
    }
    
    .speaker-name {
        color: #e0e0e0 !important;
        font-weight: bold !important;
        margin-bottom: 3px !important;
        display: block !important;
    }
    
    .chat-message-content-wrapper {
        color: inherit !important;
        word-wrap: break-word !important;
    }
    
    .conversation-sidebar {
        width: 280px !important;
        height: 100dvh !important; /* Use dynamic viewport height */
        background: #232323 !important;
        border-right: 1px solid #404040 !important;
    }
    
    /* Ensure buttons stay visible */
    .conversation-menu-btn,
    .image-settings-btn,
    .close-fullscreen-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
        margin-right: 5px !important;
        border-radius: 8px !important;
        transition: all 0.2s ease !important;
    }
    
    .conversation-menu-btn:hover,
    .image-settings-btn:hover,
    .close-fullscreen-btn:hover {
        transform: translateY(-1px) !important;
    }
}

/* Additional mobile viewport fix for iOS */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 768px) {
        .fullscreen-chat {
            height: -webkit-fill-available !important;
        }
        
        .conversation-sidebar {
            height: -webkit-fill-available !important;
        }
    }
}

/* Scroll indicator and message animations */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.new-message-indicator:hover {
    background: #0056b3 !important;
    transform: translateY(-2px);
    transition: all 0.2s ease;
}

.chat-message {
    animation: messageSlideIn 0.3s ease-out;
}

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

.chat-message.push-up {
    transition: transform 0.3s ease-out;
}
