/* Force light mode - app has no dark theme */
:root { color-scheme: light only; }

/* Hide scrollbar globally on chat messages (Firefox + WebKit + IE) */
.chat-messages {
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE/Edge */
}
.chat-messages::-webkit-scrollbar {
    display: none;                /* Chrome/Safari/Opera */
}

/* Aria Chat Interface Styles */

.chat-interface {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #000000;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

.chat-app {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: #f7f7f8;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    transition: transform 0.3s ease;
}

/* Mobile sidebar overlay styles */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1099;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Header hiding removed - was causing Android header disappear bug */
.sidebar-overlay.active ~ .main-chat .chat-input-container {
    display: none;
}

/* User Menu Dropdown */
.user-menu-dropdown {
    position: absolute;
    bottom: 70px;
    left: 12px;
    width: 220px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-size: 14px;
}

.user-menu-item:hover {
    background: #f5f5f5;
}

.user-menu-item svg {
    flex-shrink: 0;
    color: #666;
}

/* Search Bar */
.sidebar-search {
    padding: 12px;
    border-bottom: 1px solid #e5e5e5;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 8px;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

.search-icon {
    color: #6b7280;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 20px !important;
    background: transparent;
    color: #000000;
}

.search-input::placeholder {
    color: #9ca3af;
}

.new-chat-icon {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.new-chat-icon:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Navigation */
.sidebar-navigation {
    padding: 8px 0;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
}

.nav-section {
    margin-bottom: 8px;
}

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

.nav-item {
    width: 100%;
    background: none;
    border: none;
    border-radius: 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #000000;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    margin: 1px 0;
    font-weight: 500;
}

.nav-item:hover {
    background: #f3f4f6;
}

.nav-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 8px 16px;
}

.nav-item.nav-main {
    font-weight: 600;
}

.nav-icon {
    flex-shrink: 0;
}

.chatgpt-icon {
    border-radius: 4px;
    background: #000000;
    color: #ffffff;
    padding: 2px;
}

/* Chat History */
.chat-history {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 0;
    background: #ffffff;
}

.chat-history-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.chat-history-section {
    margin-bottom: 0;
}

.chat-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 1px 0;
    position: relative;
    group: hover;
}

.chat-item:hover {
    background: #f3f4f6;
}

.chat-item.active {
    background: #e8f4fd;
    border-left: 3px solid #0066cc;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-title {
    font-size: 14px;
    color: #000000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.4;
    font-weight: 400;
}

.chat-options {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #6b7280;
}

.chat-item:hover .chat-options {
    opacity: 1;
}

.chat-options:hover {
    background: #d1d5db;
    color: #374151;
}

/* Loading and Empty States */
.chat-item-loading,
.chat-item-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    color: #666;
    font-size: 14px;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e5e5;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Prompts Section */
.prompts-section {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}

/* Prompts Header */
.prompts-header {
    padding: 12px 0 16px;
}

.prompts-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.prompts-header-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.prompts-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompts-close-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.add-prompt-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-prompt-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prompt-item {
    padding: 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.prompt-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.prompt-item.active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.prompt-item-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.prompt-title {
    font-weight: 500;
    color: #111827;
    font-size: 14px;
}

.prompt-description {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

.prompt-item-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
}

.prompt-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    background: #f9fafb;
    color: #374151;
}

.prompt-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.prompt-action-btn svg {
    flex-shrink: 0;
}

.prompt-edit-btn {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

.prompt-edit-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.prompt-use-btn {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
    font-weight: 600;
}

.prompt-use-btn:hover {
    background: #d1fae5;
    border-color: #6ee7b7;
}

.prompt-delete-btn {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.prompt-delete-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Prompt Modal */
.prompt-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.prompt-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.prompt-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.prompt-modal-header {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.prompt-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    flex: 1;
}

.close-modal-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-modal-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.prompt-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #111827;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.chat-meta {
    margin-top: 4px;
}

.message-count {
    font-size: 12px;
    color: #888;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    border-top: 1px solid #e5e5e5;
    flex: 0 0 auto;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.user-settings-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-settings-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.username-initial {
    color: #ffffff;
    font-size: 18px;
    font-weight: 500;
}

.username {
    font-size: 14px;
    color: #000000;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-plan {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
    height: 56px;
    min-height: 56px;
    flex-shrink: 0;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1001;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-button {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s ease;
}

.menu-button:hover {
    background: #f3f4f6;
}

@media (min-width: 769px) {
    .menu-button {
        display: none;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .chat-header {
        left: 260px;
        width: calc(100% - 260px);
    }

    .chat-messages {
        padding-top: 72px;
    }
}

.chat-header-left h1 {
    font-size: 18px;
    font-weight: 600;
    color: #000000;
    margin: 0;
}

.version-number {
    color: #6b7280;
    font-weight: 400;
}

.chat-header-right {
    display: flex;
    gap: 4px;
}

.chat-header-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.chat-header-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Voice Selector */
.voice-selector-container {
    position: relative;
    margin-left: 12px;
}

.voice-selector {
    background: #ffffff;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    color: #24292f;
    cursor: pointer;
    min-width: 200px;
    max-width: 250px;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
}

.voice-selector:focus {
    outline: none;
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.1);
}

.voice-selector:hover {
    border-color: #8c959f;
}

/* Voice selector for mobile */
@media (max-width: 768px) {
    .voice-selector {
        min-width: 150px;
        max-width: 180px;
        font-size: 13px;
        padding: 6px 8px;
    }
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 72px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 768px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.welcome-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.welcome-message h2 {
    font-size: 32px;
    font-weight: 600;
    color: #000000;
    margin: 0;
}

/* Chat Message */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.chat-message.user {
    align-items: flex-end;
    max-width: 100%;
}

.chat-message.assistant {
    align-self: flex-start;
    max-width: 90%;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 20px !important;
    line-height: 1.7;
    color: #000000;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.chat-message.user .message-content {
    background: #f0f0f0;
    color: #000000;
    border-radius: 18px 18px 6px 18px;
    margin-left: auto;
    margin-right: 5%;
    text-align: left;
    max-width: 90%;
}

.chat-message.assistant .message-content {
    max-width: 90% !important;
    margin-right: 5% !important;
    background: transparent;
    color: #000000;
    padding: 0;
    border-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 5%;
    margin-right: 5%;
    max-width: 90%;
}

/* === Overflow prevention for code blocks, tables, and inline content === */
.message-content pre,
.markdown-body pre {
    overflow-x: auto;
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
    border-radius: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    margin: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.message-content code,
.markdown-body code {
    word-break: break-all;
    overflow-wrap: break-word;
}

.message-content pre code,
.markdown-body pre code {
    word-break: normal;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.message-content table,
.markdown-body table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
    border-collapse: collapse;
    margin: 8px 0;
    -webkit-overflow-scrolling: touch;
}

.message-content th,
.message-content td,
.markdown-body th,
.markdown-body td {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
}

.message-content,
.markdown-body {
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
}

/* Message Actions */
.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chat-message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: none;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 6px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
}

.message-action-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Chat Input - ChatGPT Style */
.chat-input-container {
    padding: 12px 20px 16px;
    background: #ffffff;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.chat-input-container::after {
    content: "";
    position: absolute;
    left: -1px;
    right: -1px;
    top: 100%;
    height: var(--kb-height, 0px);
    background: #fff;
    z-index: 999;
}


@media (min-width: 769px) {
    .chat-input-container {
        left: 260px;
        width: calc(100% - 260px);
    }
}

.chat-input-wrapper {
    max-width: 768px;
    margin: 0 auto;
    position: relative;
}

.chat-input-inner {
    display: flex;
    align-items: center;
    background: #f4f4f4;
    border: 1px solid #d1d5db;
    border-radius: 26px;
    padding: 2px 8px;
    gap: 8px;
    min-height: 34px;
    box-sizing: border-box;
}

.attachment-button {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-button:hover {
    background: #e5e5e5;
    color: #374151;
}

.chat-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    font-size: 20px !important;
    line-height: 1.5;
    resize: none;
    max-height: 120px;
    overflow-y: auto;
    background: transparent;
    color: #000000;
    padding: 0;
    font-family: inherit;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-input:focus {
    white-space: normal;
    overflow: visible;
}

.chat-input:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.chat-input::placeholder {
    color: #8e8ea0;
}

.microphone-button {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.microphone-button:hover {
    background: #e5e5e5;
    color: #374151;
}

/* Voice conversation states - uses .listening class for active state */
.microphone-button.listening {
    background: #22c55e !important;
    color: #ffffff !important;
    animation: micPulse 1.5s ease-in-out infinite;
}
.microphone-button.speaking {
    background: #8b5cf6 !important;
    color: #ffffff !important;
}
.microphone-button.processing {
    background: #f59e0b !important;
    color: #ffffff !important;
}

.voice-sphere-button {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-sphere-button:hover {
    background: #e5e5e5;
}

/* Voice Avatar Sphere - Talios Solana Gradient */
.voice-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.voice-avatar:hover {
    transform: scale(1.1);
}

.voice-avatar.speaking {
    animation: spherePulse 1s ease-in-out infinite alternate;
}

.sphere-inner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.voice-avatar.speaking .sphere-inner {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

@keyframes spherePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 194, 255, 0.7);
    }
    100% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(0, 194, 255, 0);
    }
}

/* Voice-to-Voice Modal Styles */
.voice-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.voice-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.voice-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}


/* Bottom controls container */
.voice-bottom-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.voice-control-btn {
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
}

.voice-control-btn:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

/* Large Animated Sphere - Talios Solana Gradient */
.voice-avatar-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    margin: 0 auto;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 40% 40%, #14F195 0%, #00FFA3 20%, #00C2FF 45%, #4B7BF5 70%, #9945FF 100%);
    filter: brightness(1.2) saturate(1.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
    font-weight: 600;
    box-shadow:
        0 10px 30px rgba(0, 194, 255, 0.3),
        0 0 20px rgba(20, 241, 149, 0.4),
        0 0 30px rgba(124, 58, 237, 0.15),
        inset 0 0 60px rgba(255, 255, 255, 0.4);
    animation: liquidFloat 6s ease-in-out infinite, glowPulse 4s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Speaking animation states */
.voice-avatar-large.speaking {
    animation: voiceRhythm 0.9s ease-in-out infinite;
    box-shadow:
        0 15px 40px rgba(20, 241, 149, 0.5),
        0 0 30px rgba(0, 194, 255, 0.6),
        0 0 50px rgba(0, 194, 255, 0.3),
        inset 0 0 80px rgba(255, 255, 255, 0.5);
}

/* Flowing liquid shape */
.voice-avatar-large::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    background:
        radial-gradient(ellipse 140px 80px at 45% 40%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 25%, rgba(224, 242, 254, 0.4) 50%, transparent 75%),
        radial-gradient(ellipse 100px 120px at 35% 65%, rgba(255, 255, 255, 0.7) 0%, rgba(240, 248, 255, 0.5) 30%, transparent 60%);
    border-radius: 50%;
    filter: blur(8px);
    animation: liquidMorph 12s ease-in-out infinite;
}

/* Secondary liquid layer */
.voice-avatar-large::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    right: 20%;
    bottom: 20%;
    background:
        radial-gradient(ellipse 80px 100px at 60% 35%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(4px);
    animation: liquidMorph2 15s ease-in-out infinite reverse;
}

/* WebGL canvas orb overrides */
.voice-avatar-large[style*="background:none"] {
    overflow: visible !important;
}
.voice-avatar-large[style*="background:none"]::before,
.voice-avatar-large[style*="background:none"]::after {
    display: none !important;
}
.voice-avatar-large[style*="background:none"].speaking {
    animation: none !important;
    box-shadow: none !important;
}

.voice-status {
    color: rgba(0, 0, 0, 0.8);
    font-size: 18px;
    font-weight: 500;
    max-width: 300px;
    line-height: 1.4;
}

.voice-mic-btn {
    background: rgba(0, 0, 0, 0.1) !important;
    border: 2px solid rgba(0, 0, 0, 0.3) !important;
    width: 64px !important;
    height: 64px !important;
}

.voice-mic-btn:hover {
    background: rgba(0, 0, 0, 0.2) !important;
    border-color: rgba(0, 0, 0, 0.5) !important;
    transform: scale(1.05) !important;
}

.voice-mic-btn.listening {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: rgba(34, 197, 94, 0.5) !important;
    animation: micPulse 1.5s ease-in-out infinite;
}

/* Microphone icon */
.microphone-button svg {
    display: block;
    color: inherit;
}

.microphone-button.listening svg {
    color: inherit;
}

/* Animation Keyframes */
/* Animated glow around sphere */
@keyframes glowPulse {
    0% {
        box-shadow:
            0 10px 30px rgba(0, 194, 255, 0.3),
            0 0 20px rgba(20, 241, 149, 0.4),
            0 0 30px rgba(124, 58, 237, 0.15),
            inset 0 0 60px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow:
            0 15px 40px rgba(20, 241, 149, 0.5),
            0 0 30px rgba(0, 194, 255, 0.6),
            0 0 50px rgba(0, 194, 255, 0.3),
            inset 0 0 80px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow:
            0 10px 30px rgba(0, 194, 255, 0.3),
            0 0 20px rgba(20, 241, 149, 0.4),
            0 0 30px rgba(124, 58, 237, 0.15),
            inset 0 0 60px rgba(255, 255, 255, 0.4);
    }
}

@keyframes voiceRhythm {
    0% {
        transform: scale(0.95) translateY(0px);
    }
    15% {
        transform: scale(1.15) translateY(-4px);
    }
    30% {
        transform: scale(0.98) translateY(2px);
    }
    45% {
        transform: scale(1.2) translateY(-6px);
    }
    60% {
        transform: scale(0.92) translateY(3px);
    }
    75% {
        transform: scale(1.18) translateY(-5px);
    }
    100% {
        transform: scale(1.0) translateY(0px);
    }
}

@keyframes liquidFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes liquidMorph {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    20% {
        transform: translate(-15px, -8px) scale(1.1);
    }
    40% {
        transform: translate(8px, -12px) scale(0.9);
    }
    60% {
        transform: translate(12px, 6px) scale(1.05);
    }
    80% {
        transform: translate(-6px, 10px) scale(0.95);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

@keyframes liquidMorph2 {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    25% {
        transform: translate(10px, -6px) scale(1.15);
    }
    50% {
        transform: translate(-8px, 8px) scale(0.85);
    }
    75% {
        transform: translate(6px, -10px) scale(1.08);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

@keyframes micPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 59, 48, 0);
    }
}

.send-button {
    background: #000000;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover {
    background: #2d2d2d;
}

.send-button:disabled {
    background: #e5e5e5;
    cursor: not-allowed;
}

.send-button svg {
    color: #ffffff;
    width: 20px;
    height: 20px;
}

.send-button:disabled svg {
    color: #9ca3af;
}

/* Hide microphone button when typing or files pending */
.chat-input-inner.typing .microphone-button {
    display: none;
}

.chat-input-inner.typing {
    gap: 16px;
}

/* Icon switching when typing */
.chat-input-inner.typing .send-button .equalizer-icon {
    display: none;
}

.chat-input-inner.typing .send-button .send-icon {
    display: block !important;
}

/* Remove footer disclaimer from fixed position */
.chat-footer-disclaimer {
    display: none;
}

/* Typing indicator - uses unified blue status style */
.typing-indicator .message-content {
    padding: 8px 0;
    background: transparent !important;
    box-shadow: none !important;
}

.typing-indicator .tool-live-status {
    margin: 0;
}

/* Universal Tool Status Indicator */
.tool-live-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 8px 0 4px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    font-size: 13px;
    color: #6366f1;
    animation: statusSlideIn 0.3s ease-out;
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    position: relative;
}

.tool-live-status .status-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.tool-live-status .status-icon svg {
    width: 100%;
    height: 100%;
}

.tool-live-status .status-text {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-live-status .status-dots {
    display: flex;
    gap: 3px;
    align-items: center;
    min-width: 18px;
}

.tool-live-status .status-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #6366f1;
    animation: statusDotPulse 1.4s ease-in-out infinite;
}

.tool-live-status .status-dots span:nth-child(1) { animation-delay: 0s; }
.tool-live-status .status-dots span:nth-child(2) { animation-delay: 0.2s; }
.tool-live-status .status-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Checkmark shown when tool completes */
.tool-live-status .status-dots svg {
    width: 14px;
    height: 14px;
    color: #22c55e;
}

/* Progress bar (image gen, video gen) */
.tool-live-status .status-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(99, 102, 241, 0.1);
    overflow: hidden;
}

.tool-live-status .status-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 0 2px 2px 0;
    transition: width 0.8s ease-out;
    width: 0%;
}

/* Done state: brief flash before removal */
.tool-live-status.status-done {
    animation: statusFadeOut 0.6s ease-in forwards;
}

.tool-live-status.status-done .status-dots svg {
    color: #22c55e;
}

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

@keyframes statusFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-6px);
    }
}

@keyframes statusDotPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dark mode */
html.dark .tool-live-status {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
    border-color: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

html.dark .tool-live-status .status-dots span {
    background: #a5b4fc;
}

html.dark .tool-live-status .status-progress {
    background: rgba(99, 102, 241, 0.15);
}

html.dark .tool-live-status .status-progress-fill {
    background: linear-gradient(90deg, #818cf8, #a78bfa);
}

/* DISABLED — app uses light mode only
@media (prefers-color-scheme: dark) {
    .tool-live-status {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(139, 92, 246, 0.08));
        border-color: rgba(99, 102, 241, 0.2);
        color: #a5b4fc;
    }
    .tool-live-status .status-dots span {
        background: #a5b4fc;
    }
}
*/

.disclaimer-link {
    color: #6b7280;
    text-decoration: underline;
}

.disclaimer-link:hover {
    color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        height: auto;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        z-index: 1100;
        transform: translateX(-100%);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
        background: #ffffff;
        border-right: 1px solid #e5e5e5;
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-chat {
        width: 100%;
        height: auto; /* Use dynamic viewport height */
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
    }

    .chat-messages {
        flex: 1 1 auto;
        padding: 72px 12px 120px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        min-height: 0;
        box-sizing: border-box;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .chat-messages::-webkit-scrollbar { display: none; }

    .chat-message.user .message-content {
        max-width: 80%;
        margin-left: auto;
        margin-right: 0;
    }

    .chat-message.assistant .message-content {
        max-width: 90%;
        margin-left: 20px;
        margin-right: 20px;
        font-size: 20px !important;
        line-height: 1.7;
    }

    .chat-message.user .message-content {
        font-size: 20px !important;
        line-height: 1.7;
    }

    .chat-message.assistant .message-actions {
        margin-left: 20px;
    }

    .chat-input-container {
        padding: 6px 10px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid #e5e5e5;
        z-index: 1000;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
        transform: translateZ(0);
    }

    .chat-input-wrapper {
        max-width: 100%;
        margin: 0;
    }

    .chat-input-inner {
        margin: 0;
        padding: 2px 6px;
        gap: 6px;
        min-height: 30px;
    }

    .chat-input {
        font-size: 20px !important;
        min-height: 20px;
        max-height: 100px;
        padding: 0;
    }

    .chat-input::placeholder {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .chat-footer-disclaimer {
        position: fixed;
        bottom: 4px;
        left: 12px;
        right: 12px;
        max-width: none;
        padding: 0 8px;
        font-size: 11px;
        z-index: 999;
        text-align: center;
        background: rgba(247, 247, 248, 0.9);
        backdrop-filter: blur(8px);
        border-radius: 8px;
        padding: 4px 8px;
    }

    .chat-message {
        max-width: 90%;
        margin-bottom: 16px;
    }

    /* Ensure proper scrolling behavior */
    .chat-messages::-webkit-scrollbar {
        display: none;
    }

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

/* Prompt Selection Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: #111827;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #374151;
}

.modal-body {
    padding: 24px;
}

.modal-description {
    margin: 0 0 20px 0;
    color: #6b7280;
    line-height: 1.5;
}

.prompt-option {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prompt-option:hover {
    border-color: #d1d5db;
}

.prompt-option.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.prompt-option-header {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.prompt-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.prompt-info {
    flex: 1;
}

.prompt-info h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.prompt-info p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.prompt-radio {
    position: relative;
}

.prompt-radio input[type="radio"] {
    opacity: 0;
    position: absolute;
}

.prompt-radio label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
}

.prompt-radio input[type="radio"]:checked + label {
    border-color: #3b82f6;
}

.prompt-radio input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #3b82f6;
}

.modal-footer {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.default-prompt .prompt-icon {
    background: linear-gradient(45deg, #3b82f6, #1d4ed8);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
/* AI message content width handled above */

/* Mode Selector Styles */
.mode-selector-container {
    display: flex;
    align-items: center;
    margin-right: 12px;
}

.mode-selector {
    background: #ffffff;
    color: #000;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mode-selector:hover {
    border-color: #ccc;
    background: #f5f5f5;
}

.mode-selector:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.2);
}

.mode-selector option {
    background: #ffffff;
    color: #000;
    padding: 8px;
}

/* ChatGPT Style Mode Toggle */
.mode-toggle {
    display: flex;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    margin-left: 12px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.mode-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.mode-btn.active {
    background: #10a37f;
    color: #fff;
}

@media (max-width: 768px) {
    .mode-toggle {
        margin-left: 8px;
    }
    .mode-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ChatGPT Style Model Selector */
.model-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-left: 12px;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
}

.model-selector:hover {
    background: rgba(0,0,0,0.05);
}

.model-name {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

.model-selector > svg {
    color: #888;
    transition: transform 0.2s;
}

.model-selector.open > svg {
    transform: rotate(180deg);
}

.model-selector .check-icon {
    transform: none !important;
}

.model-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 1000;
}

.model-selector.open .model-dropdown {
    display: block;
}

.model-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.model-option:hover {
    background: #f5f5f5;
}

.option-icon {
    font-size: 20px;
    width: 32px;
    text-align: center;
}

.option-info {
    flex: 1;
}

.option-title {
    font-weight: 600;
    color: #000;
    font-size: 14px;
}

.option-desc {
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}

.check-icon {
    display: none;
    color: #000;
}

.model-option.active .check-icon {
    display: block;
}

/* Fix Model Selector Colors */
.chat-header {
    background: #fff !important;
}

.model-name {
    color: #000 !important;
    font-size: 16px;
    font-weight: 600;
}

.model-selector > svg {
    color: #666 !important;
}

.model-selector .check-icon {
    transform: none !important;
}

.model-selector:hover {
    background: rgba(0,0,0,0.05);
}

/* Fix dropdown for light mode */
.model-dropdown {
    background: #ffffff;
    border-color: #e0e0e0;
}

.option-icon {
    font-size: 20px !important;
}

/* Ensure SSH icon shows */
.model-option[data-mode="ssh"] .option-icon::before {
    content: "🖥️";
}

/* Model Icon in header */
.model-icon {
    font-size: 18px;
    margin-right: 6px;
}

/* Force visibility */
.model-selector .model-name {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* === Generated Image Styles === */
.markdown-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.markdown-body img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.chat-message.assistant .markdown-body img {
    max-width: min(512px, 100%);
    display: block;
}

/* Image lightbox overlay */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
}
.image-lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.lightbox-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}
.lightbox-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    backdrop-filter: blur(4px);
    text-decoration: none;
}
.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}
.lightbox-btn svg {
    stroke: #fff;
}
.lightbox-download:hover {
    background: rgba(59, 130, 246, 0.5);
}
.lightbox-close:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* === Generated Video Styles === */
.markdown-body video,
.chat-message.assistant video {
    max-width: min(640px, 100%);
    border-radius: 12px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: block;
    background: #000;
}
.chat-message.assistant video:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* === File Attachment Styles in Chat Messages === */
.chat-file-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    font-size: 13px;
    color: #374151;
}

.chat-file-attachment.document {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 8px 14px;
    transition: background 0.15s;
}

.chat-file-attachment.document:hover {
    filter: brightness(0.97);
}

.file-icon-svg {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.file-icon-svg svg {
    width: 28px;
    height: 28px;
}

.chat-file-attachment.image {
    padding: 0;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
}

.chat-attachment-img {
    max-width: 200px;
    max-height: 140px;
    border-radius: 12px;
    object-fit: cover;
    cursor: pointer;
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-attachment-img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.chat-file-attachment .file-icon {
    font-size: 18px;
}

.chat-file-attachment .file-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    font-size: 13px;
}

/* User message with files: keep text neatly inside balloon */
.chat-message.user .chat-file-attachments {
    margin-bottom: 10px;
}

.chat-message.user .chat-attachment-img {
    max-width: 180px;
    max-height: 120px;
    border-radius: 10px;
}

/* Mobile adjustments for file attachments */
@media (max-width: 768px) {
    .chat-attachment-img {
        max-width: 160px !important;
        max-height: 110px !important;
    }
}

/* Voice orb responsive sizing */
@media (max-width: 768px) {
    .voice-avatar-large[style*="background:none"] {
        width: 300px !important;
        height: 300px !important;
    }
    #voiceOrbCanvas {
        width: 300px !important;
        height: 300px !important;
    }
}

.prompt-expand-btn {
    background: #eff6ff;
    color: #3b82f6;
    border-color: #bfdbfe;
}

.prompt-expand-btn:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.prompt-conversations {
    margin-top: 8px;
    border-top: 1px solid #e5e7eb;
    padding-top: 4px;
}

.prompt-convo-item {
    padding: 6px 8px;
    font-size: 12px;
    color: #374151;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.prompt-convo-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.custom-prompt-badge {
    display: inline-block;
    font-size: 9px;
    padding: 1px 5px;
    background: #10b981;
    color: #fff;
    border-radius: 3px;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 4px;
    letter-spacing: 0.3px;
}

/* ===== File Preview ===== */
#file-preview-container {
    position: absolute;
    bottom: 100%;
    left: 10px;
    display: none;
    gap: 8px;
    padding: 6px 10px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 100;
    max-width: calc(100% - 20px);
    flex-wrap: wrap;
}
#file-preview-container:empty { display: none; padding: 0; margin: 0; box-shadow: none; }
#file-preview-container.has-files { display: flex; }
.file-preview-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #fff; border-radius: 10px; max-width: 220px; border: 1px solid #e0e0e0; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.file-preview-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.file-preview-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; flex-shrink: 0; }
.file-preview-icon svg { width: 28px; height: 28px; }
.file-preview-name { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #333; }
.file-preview-remove { font-size: 16px; cursor: pointer; color: #bbb; padding: 2px 4px; border-radius: 50%; background: none; border: none; line-height: 1; transition: all 0.15s; flex-shrink: 0; }
.file-preview-remove:hover { color: #fff; background: #e53935; }


/* Upload progress indicator */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f0f4ff;
    border-radius: 8px;
    font-size: 13px;
    color: #1565C0;
    font-weight: 500;
    animation: fadeIn 0.2s ease;
}

.upload-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #90CAF9;
    border-top-color: #1565C0;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== iOS Safe Area ===== */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
    .main-chat {
        height: 100dvh;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .chat-input-container {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .chat-messages {
        padding-bottom: 130px;
    }
    .sidebar {
        padding-top: env(safe-area-inset-top);
    }
    .sidebar-search {
        position: sticky;
        top: env(safe-area-inset-top, 0);
        z-index: 1200;
        background: #fff;
    }
}

/* ===== Android PWA Safe Area ===== */
@media (display-mode: standalone) {
    .sidebar {
        padding-top: env(safe-area-inset-top, 24px);
    }
    .chat-header {
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(56px + env(safe-area-inset-top, 0px));
    }
    .chat-messages {
        padding-top: calc(72px + env(safe-area-inset-top, 0px));
    }
}

/* ===== File Download Cards ===== */
.chat-download-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 8px 0;
    max-width: 360px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.chat-download-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.download-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.download-card-icon svg {
    width: 32px;
    height: 32px;
}
.download-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.download-card-name {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.download-card-type {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.download-card-btn {
    border: none;
    cursor: pointer;
    padding: 0;
    font: inherit;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.download-card-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
