@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Fira+Code:wght@400;500&family=Alexandria:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #1a1b26;
    /* Tokyo Night Background */
    --glass-bg: rgba(22, 22, 30, 0.85);
    /* Sidebar Background */
    --border-color: rgba(65, 72, 104, 0.4);
    /* Border/Grid Color */
    --accent-cyan: #7dcfff;
    /* Tokyo Night Cyan */
    --accent-purple: #bb9af7;
    /* Tokyo Night Purple */
    --text-primary: #a9b1d6;
    /* Main Text */
    --text-secondary: #565f89;
    /* Muted Text */
    --font-main: 'Alexandria', 'Inter', sans-serif;
    --font-alt: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

/* Removed .msg-stats */

.hidden {
    display: none !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.grid {
    position: absolute;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) translateY(-50%);
    opacity: 0.15;
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(-50%);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(-25%);
    }
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    z-index: -1;
}

#orb1 {
    width: 400px;
    height: 400px;
    background: var(--accent-cyan);
    top: -100px;
    right: -100px;
    animation: float 15s ease-in-out infinite;
}

#orb2 {
    width: 500px;
    height: 500px;
    background: var(--accent-purple);
    bottom: -150px;
    left: -150px;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(50px, 30px);
    }
}

/* Main Layout */
.app-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Sidebar */
.sidebar {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    /* Prevent sidebar itself from scrolling */
}

.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--accent-cyan);
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.sidebar-toggle-btn:active {
    transform: scale(0.9);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 998;
    transition: opacity 0.3s ease;
}

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

.logo-text {
    font-family: var(--font-alt);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(to right, var(--accent-cyan), #fff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-cyan);
}

h3 {
    font-family: var(--font-alt);
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.stat-item {
    margin-bottom: 20px;
}

.stat-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-family: var(--font-alt);
    margin-bottom: 8px;
    color: var(--text-primary);
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    width: 0%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    font-family: var(--font-main);
    outline: none;
    transition: all 0.3s ease;
}

.glass-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(125, 207, 255, 0.2);
}

/* Dropdown specific styling */
#model-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%237dcfff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C2.185 5.355 2.401 5 2.808 5h9.404c.407 0 .623.355.357.658l-4.796 5.482a.503.503 0 0 1-.768 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 35px;
}

#model-select option {
    background-color: #1a1b26;
    /* Tokyo Night background */
    color: #a9b1d6;
    padding: 10px;
}

/* Google Workspace Section */
.google-workspace {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Relax and fill height */
    overflow: hidden;
}

/* Removed .msg-stats-with-progress */
.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.workspace-header h3 {
    margin: 0;
}

.workspace-actions {
    display: flex;
    gap: 6px;
}

.icon-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.icon-action-btn:hover {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.icon-action-btn.danger:hover {
    color: #ff4d6d;
    border-color: #ff4d6d;
}

.status-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #555;
    flex-shrink: 0;
    transition: all 0.3s;
}

.status-dot.linked {
    background: #00f3ff;
    box-shadow: 0 0 6px #00f3ff;
}

.full-width {
    width: 100%;
}

#google-status-text {
    font-family: var(--font-alt);
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.file-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.file-item:hover {
    background: rgba(0, 243, 255, 0.06);
    border-color: var(--accent-cyan);
}

.file-item .file-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.file-item-info {
    flex: 1;
    overflow: hidden;
}

.file-name {
    font-size: 11px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-type {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.file-item:hover .file-actions {
    opacity: 1;
}

.file-action-btn {
    background: rgba(0, 243, 255, 0.08);
    border: 1px solid rgba(0, 243, 255, 0.2);
    color: var(--accent-cyan);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 9px;
    font-family: var(--font-alt);
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.file-action-btn:hover {
    background: rgba(0, 243, 255, 0.2);
}

.loader-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 243, 255, 0.1);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* File Viewer Modal */
.file-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1400px, 95vw);
    max-height: 85vh;
    background: rgba(10, 10, 20, 0.97);
    backdrop-filter: blur(20px);
    border: 1px solid var(--accent-cyan);
    border-radius: 14px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.2);
}

.file-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
    font-family: var(--font-alt);
    font-size: 12px;
    letter-spacing: 1px;
    color: var(--accent-cyan);
}

.file-modal-actions {
    display: flex;
    gap: 8px;
}

.file-modal-content {
    padding: 18px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    flex: 1;
}

.danger-btn {
    border-color: rgba(255, 77, 109, 0.4) !important;
    color: #ff4d6d !important;
}

.danger-btn:hover {
    background: rgba(255, 77, 109, 0.1) !important;
}

/* Google Workspace File Formatting */
.protocol-accordion {
    background: rgba(14, 165, 233, 0.05);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 12px;
    margin: 12px 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.protocol-accordion summary {
    padding: 12px 16px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    background: rgba(14, 165, 233, 0.05);
    transition: background 0.2s ease;
}

.protocol-accordion summary:hover {
    background: rgba(14, 165, 233, 0.1);
}

.protocol-accordion .protocol-content {
    padding: 16px;
    border-top: 1px solid rgba(14, 165, 233, 0.1);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
}

.protocol-accordion .protocol-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.protocol-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 243, 255, 0.2);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: protocol-spin 1s linear infinite;
}

@keyframes protocol-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Google Workspace File Formatting - LUXURY PROTOCOL */
.protocol-accordion {
    background: rgba(14, 165, 233, 0.04);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 12px;
    margin: 18px 0;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.protocol-accordion[open] {
    border-color: rgba(0, 243, 255, 0.5);
    background: rgba(14, 165, 233, 0.06);
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.15);
}

.protocol-accordion summary {
    padding: 16px 20px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    background: rgba(14, 165, 233, 0.08);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
}

.protocol-accordion summary::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 1px;
    background: var(--accent-cyan);
    transition: width 0.3s ease;
}

.protocol-accordion[open] summary::after {
    width: 100%;
}

.protocol-accordion summary:hover {
    background: rgba(14, 165, 233, 0.15);
    color: #fff;
}

.protocol-accordion .protocol-content {
    padding: 24px;
    border-top: 1px solid rgba(0, 243, 255, 0.1);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    background: rgba(10, 11, 18, 0.9);
    color: #a9b1d6;
    line-height: 1.6;
}

.protocol-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 243, 255, 0.1);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: protocol-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
    transition: all 0.4s ease;
    flex-shrink: 0;
}

@keyframes protocol-success-glow {
    0% {
        box-shadow: 0 0 5px #50fa7b;
    }

    50% {
        box-shadow: 0 0 20px #50fa7b;
    }

    100% {
        box-shadow: 0 0 5px #50fa7b;
    }
}

.protocol-spinner.success {
    animation: protocol-success-glow 2s infinite !important;
    border: 2px solid #50fa7b !important;
    background: #50fa7b !important;
    color: #1a1b26 !important;
    border-radius: 50%;
    transform: scale(1.1);
    font-size: 14px;
    font-weight: bold;
}

.protocol-spinner.error {
    animation: none !important;
    border: 2px solid #ff5555 !important;
    background: #ff5555 !important;
    color: #fff !important;
    border-radius: 50%;
    transform: scale(1.1);
    font-size: 14px;
    font-weight: bold;
}

.protocol-status-badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
}

@keyframes protocol-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.system-protocol-pill {
    display: none;
}

.doc-content {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    padding: 10px;
}

.doc-content p {
    margin-bottom: 12px;
}

.sheet-container {
    width: 100%;
    overflow-x: auto;
}

.sheet-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    margin-top: 10px;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #e0e0e0;
}

.sheet-table th,
.sheet-table td {
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 8px;
    text-align: left;
}

.sheet-table th {
    background: rgba(0, 243, 255, 0.1);
    font-weight: bold;
    color: var(--accent-cyan);
}

.sheet-table tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Explorer Tabs */
.explorer-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
}

/* Chat Input Tags */
.chat-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0px 14px;
    margin-bottom: 6px;
}

.chat-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 10px;
    font-family: var(--font-alt);
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.chat-tag-remove {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.chat-tag-remove:hover {
    opacity: 1;
    color: #ff4d6d;
}

.explorer-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    color: var(--text-secondary);
    font-family: var(--font-alt);
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.explorer-tab:hover {
    color: #fff;
    background: rgba(0, 243, 255, 0.05);
}

.explorer-tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.1);
}

/* Skeleton Loading UI */
.skeleton-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    margin-bottom: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.05) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
}

@keyframes skeleton-pulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border-radius: 4px;
}

.skeleton-text {
    width: 60%;
    height: 12px;
    margin-bottom: 6px;
}

.skeleton-text-short {
    width: 30%;
    height: 10px;
}

.explorer-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 50vh;
}

/* Sidebar Sources (NotebookLM Style) */
.sidebar-files-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 15px;
    flex: 1;
    /* FILL SPACE AFTER REMOVING DROP ZONE */
    min-height: 0;
    overflow: hidden;
    /* Contain file list */
}

.mini-tabs {
    gap: 0;
    margin-bottom: 5px;
}

.mini-tabs .explorer-tab {
    padding: 6px;
    font-size: 8px;
}

.sidebar-file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    padding-right: 4px;
    flex: 1;
    /* Take up available space */
    min-height: 0;
    /* Allow scrolling */
}

/* Global Neural Drop Zone - LUXURY OVERLAY */
.global-drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 10, 20, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px dashed rgba(0, 243, 255, 0.3);
    margin: 20px;
    width: calc(100vw - 40px);
    height: calc(100vh - 40px);
    border-radius: 24px;
}

.global-drop-zone.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.global-drop-zone .drop-zone-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 2;
}

.drop-icon-wrapper {
    width: 120px;
    height: 120px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.2);
    border: 1px solid rgba(0, 243, 255, 0.3);
    animation: drop-float 3s ease-in-out infinite;
}

@keyframes drop-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.global-drop-zone h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: var(--accent-cyan);
    letter-spacing: 4px;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    margin: 0;
}

.global-drop-zone p {
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 1px;
}

.drop-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

.sidebar-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: default;
}

.sidebar-file-item:hover {
    background: rgba(0, 243, 255, 0.05);
}

.source-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.source-checkbox {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.source-checkbox:checked {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.source-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-size: 10px;
    font-weight: 700;
}

.sidebar-file-info {
    flex: 1;
    overflow: hidden;
    cursor: pointer;
}

.sidebar-file-name {
    font-size: 11px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-file-type {
    font-size: 8px;
    color: var(--text-secondary);
    text-transform: uppercase;
}


/* Global Neural Drop Zone - LUXURY OVERLAY */
.global-drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 10, 20, 0.9);
    backdrop-filter: blur(25px) saturate(160%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-drop-zone.active {
    opacity: 1;
    pointer-events: auto;
}

.global-drop-zone .drop-zone-content {
    text-align: center;
    background: rgba(0, 243, 255, 0.03);
    border: 1px solid rgba(0, 243, 255, 0.2);
    padding: 60px;
    border-radius: 32px;
    box-shadow: 0 0 100px rgba(0, 10, 20, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.global-drop-zone.active .drop-zone-content {
    transform: scale(1);
}

.drop-icon-wrapper {
    width: 100px;
    height: 100px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    margin-bottom: 20px;
    box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    border: 1px solid rgba(0, 243, 255, 0.3);
    animation: drop-pulse 2s infinite ease-in-out;
}

@keyframes drop-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(0, 243, 255, 0.2);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 50px rgba(0, 243, 255, 0.4);
    }
}

.global-drop-zone h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: var(--accent-cyan);
    letter-spacing: 5px;
    text-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
    margin: 0;
}

.global-drop-zone p {
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.drop-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 243, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
    pointer-events: none;
}

.chat-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.chat-header {
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.system-monitor {
    display: flex;
    gap: 20px;
    font-family: var(--font-alt);
    font-size: 11px;
    letter-spacing: 1px;
}

.monitor-item {
    color: var(--text-secondary);
}

.monitor-item span {
    color: var(--accent-cyan);
    margin-left: 4px;
    font-weight: 700;
}

.sec-item span.secure {
    color: var(--accent-cyan) !important;
}

.sec-item span:not(.secure) {
    color: #ff3b30 !important;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-alt);
    font-size: 11px;
    letter-spacing: 1px;
}

.header-model-select {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--accent-cyan);
    font-family: var(--font-alt);
    font-size: 10px;
    padding: 4px 28px 4px 10px;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%237dcfff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C2.185 5.355 2.401 5 2.808 5h9.404c.407 0 .623.355.357.658l-4.796 5.482a.503.503 0 0 1-.768 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 8px) center;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.header-model-select:hover {
    border-color: var(--accent-cyan);
    background-color: rgba(0, 243, 255, 0.1);
}

.header-model-select option {
    background: #1a1b26;
    color: var(--text-primary);
}

#active-model-name {
    display: none;
    /* Hidden because select shows current model */
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(0, 243, 255, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 243, 255, 0);
    }
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 12px;
    line-height: 1.6;
    font-size: 14px;
    position: relative;
    animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid var(--accent-cyan);
    color: var(--accent-cyan);
    text-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Message stats removed per user request */

/* Speed */



.message.user {
    align-self: flex-end;
    background: rgba(188, 0, 255, 0.1);
    border-right: 2px solid var(--accent-purple);
}

/* Typing Indicator (Modern Argos Style) */
.typing-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 8px 0;
    min-height: 24px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    opacity: 0.3;
    box-shadow: 0 0 5px var(--accent-cyan);
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

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

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

@keyframes typing-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    40% {
        transform: translateY(-6px);
        opacity: 1;
        box-shadow: 0 0 10px var(--accent-cyan);
    }
}

/* Markdown Styles inside Messages */
.msg-content h1,
.msg-content h2,
.msg-content h3,
.msg-content h4 {
    margin: 15px 0 10px 0;
    font-family: var(--font-alt);
    color: var(--accent-cyan);
}

.msg-content h1 {
    font-size: 1.2rem;
}

.msg-content h2 {
    font-size: 1.1rem;
}

.msg-content h3 {
    font-size: 1rem;
}

.msg-content h4 {
    font-size: 0.9rem;
}

.msg-content p {
    margin-bottom: 10px;
}

.msg-content ul,
.msg-content ol {
    margin: 10px 0 10px 20px;
}

.msg-content li {
    margin-bottom: 5px;
}

.msg-content a {
    color: var(--accent-cyan);
    text-decoration: underline;
    text-underline-offset: 3px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.msg-content a:hover {
    opacity: 1;
    text-shadow: 0 0 8px var(--accent-cyan);
}

.msg-content strong {
    color: #fff;
    font-weight: 700;
}

/* Thought Section in Sidebar */
.thought-section {
    flex: 1;
    margin-top: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 150px;
    transition: all 0.3s ease;
}

.thought-section.hidden {
    opacity: 0;
    pointer-events: none;
    height: 0;
    min-height: 0;
    margin-top: 0;
    padding: 0;
}

.thought-log {
    flex: 1;
    font-family: monospace;
    font-size: 11px;
    color: var(--accent-cyan);
    opacity: 0.8;
    overflow-y: auto;
    padding-right: 5px;
}

.debug-log {
    color: #ff00ff;
    font-size: 9px;
    margin: 5px 0;
    opacity: 0.5;
}

.stats-log {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 10px;
}

/* Input Area */
.input-area {
    padding: 20px;
}

.input-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    resize: none;
    padding: 10px 0;
    outline: none;
}

#send-btn {
    background: var(--accent-cyan);
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #000;
    transition: all 0.2s;
}

.glass-btn {
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--accent-cyan);
    font-family: var(--font-alt);
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 10px 20px;
}

.glass-btn:hover {
    background: var(--accent-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--accent-cyan);
}

.glass-btn.small {
    padding: 6px 12px;
    font-size: 10px;
}

.icon-btn {

    background: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.icon-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
}

.icon-btn.active {
    background: rgba(0, 243, 255, 0.1);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}

#listen-btn {
    color: var(--accent-purple);
    border-color: rgba(188, 0, 255, 0.3);
}

#listen-btn:hover {
    background: rgba(188, 0, 255, 0.1);
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(188, 0, 255, 0.2);
}

.icon-btn.listening {
    background: rgba(255, 0, 255, 0.1);
    color: var(--accent-purple);
    border-color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
    animation: listen-pulse 1.5s infinite;
}

/* Deletion Confirmation Card */
.deletion-card {
    background: rgba(255, 75, 75, 0.05);
    border: 1px solid rgba(255, 75, 75, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 10px 0;
    backdrop-filter: blur(10px);
    animation: slide-up 0.3s ease-out;
}

.deletion-card h4 {
    color: #ff4b4b;
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.deletion-card p {
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.protocol-btn-group {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

/* --- Enhanced Upload Card --- */
.upload-card {
    background: rgba(26, 27, 38, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin: 10px 0;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    animation: slide-up 0.3s ease-out;
}

.upload-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.upload-icon {
    font-size: 24px;
    color: var(--accent-cyan);
}

.upload-details {
    flex: 1;
}

.upload-filename {
    font-weight: 600;
    color: var(--accent-cyan);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.upload-filesize {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Progress Section */
.upload-progress-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), #bb9af7);
    border-radius: 3px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

/* Stats Section */
.upload-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-value {
    font-family: var(--font-alt);
    font-size: 12px;
    color: var(--text-primary);
}

.upload-card-footer {
    display: flex;
    justify-content: flex-end;
}

.upload-card.completed {
    border-color: rgba(125, 255, 184, 0.3);
}

.upload-card.completed .upload-icon {
    color: #7dffb8;
}

.upload-card.completed .upload-progress-fill {
    background: #7dffb8;
    box-shadow: 0 0 10px rgba(125, 255, 184, 0.3);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.protocol-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.protocol-btn.accept {
    background: #ff4b4b;
    color: #fff;
}

.protocol-btn.accept:hover {
    background: #ff6b6b;
    box-shadow: 0 0 15px rgba(255, 75, 75, 0.4);
}

.protocol-btn.refuse {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.protocol-btn.refuse:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
}

.deletion-card.done {
    opacity: 0.6;
    pointer-events: none;
    border-style: dashed;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes listen-pulse {
    0% {
        box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 0, 255, 0.8);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 0, 255, 0.5);
    }
}


/* Code Blocks */
.code-block {
    position: relative;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #0d1117;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

pre {
    margin: 0 !important;
    padding: 20px !important;
    background: transparent !important;
    white-space: pre-wrap !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    overflow-x: auto !important;
}

code {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: #e0e6ed !important;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    padding: 6px 12px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--accent-cyan);
    font-family: var(--font-alt);
    font-size: 10px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.copy-btn:hover {
    background: var(--accent-cyan);
    color: #000;
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* Neural Call Overlay */
.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.call-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.call-background {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 243, 255, 0.05) 0%, #000 70%);
    overflow: hidden;
}

.call-content {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.neural-orb-container {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.neural-orb {
    width: 120px;
    height: 120px;
    background: var(--accent-cyan);
    border-radius: 50%;
    box-shadow: 0 0 60px var(--accent-cyan);
    position: relative;
    z-index: 5;
    transition: all 0.3s ease;
}

/* Call Overlay States */
.call-overlay.listening .neural-orb {
    background: #bc00ff;
    box-shadow: 0 0 80px #bc00ff;
    animation: orb-breathe 2s infinite ease-in-out;
}

.call-overlay.speaking .neural-orb {
    animation: orb-vibrate 0.15s infinite;
}

.call-overlay.thinking .neural-orb {
    animation: orb-swirl 1s infinite linear;
}

.call-overlay.error .neural-orb {
    background: #ff5555;
    box-shadow: 0 0 100px #ff0000;
}

.call-overlay.error .orb-ring {
    border-color: rgba(255, 0, 0, 0.4);
}

.orb-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-radius: 50%;
}

.ring1 {
    animation: ring-expand 4s infinite linear;
}

.ring2 {
    animation: ring-expand 4s infinite linear 1.33s;
}

.ring3 {
    animation: ring-expand 4s infinite linear 2.66s;
}

@keyframes orb-breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes orb-vibrate {
    0% {
        transform: translate(0, 0) scale(1.05);
    }

    25% {
        transform: translate(2px, -2px) scale(1.05);
    }

    50% {
        transform: translate(-2px, 2px) scale(1.05);
    }

    75% {
        transform: translate(2px, 2px) scale(1.05);
    }

    100% {
        transform: translate(-2px, -2px) scale(1.05);
    }
}

@keyframes orb-swirl {
    from {
        transform: rotate(0deg);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    to {
        transform: rotate(360deg);
        border-radius: 60% 40% 30% 70% / 50% 60% 40% 60%;
    }
}

@keyframes ring-expand {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Neural Sync Bridge */
.neural-sync-container {
    margin: 15px 12px 12px 12px;
    /* Added margin-top for separation */
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 243, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sync-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.sync-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
}

.sync-icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.sync-icon-btn:hover {
    color: var(--accent-cyan);
    background: rgba(0, 243, 255, 0.1);
}

.sync-path-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sync-controls {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sync-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    color: #fff;
    font-size: 0.75rem;
    width: 100%;
    outline: none;
}

.sync-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
}

.sync-actions {
    display: flex;
    gap: 6px;
}

.sync-btn {
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

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

.sync-btn.primary {
    background: var(--accent-cyan);
    color: #000;
    flex-grow: 1;
}

.sync-btn:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.sync-btn:active {
    transform: scale(0.95);
}

.syncing-animation {
    border-color: var(--accent-cyan);
    animation: sync-pulse 1.5s infinite;
}

@keyframes sync-pulse {
    0% {
        box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
        border-color: var(--accent-cyan);
    }

    100% {
        box-shadow: 0 0 5px rgba(0, 243, 255, 0.2);
    }
}

.call-status {
    font-family: var(--font-alt);
    font-size: 14px;
    letter-spacing: 4px;
    color: var(--accent-cyan);
    text-shadow: 0 0 10px var(--accent-cyan);
}

.call-transcript {
    font-family: var(--font-main);
    font-size: 18px;
    color: #fff;
    max-width: 600px;
    min-height: 2em;
    opacity: 0.7;
}

.call-controls {
    margin-top: 20px;
}

.end-call-btn {
    width: 64px;
    height: 64px;
    background: #ff3b30;
    border: none;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(255, 59, 48, 0.4);
    transition: all 0.3s ease;
}

.diagnostic-btn {
    margin-top: 15px;
    width: 100%;
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    color: #ffa500;
    font-size: 11px;
}

.diagnostic-btn:hover {
    background: rgba(255, 165, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.3);
}

/* Thought Accordion Inline */
.thought-accordion {
    margin: 15px 0;
    border: 1px solid rgba(255, 59, 48, 0.4);
    border-radius: 8px;
    background: var(--bg-color) !important;
    /* Tokyo Night Background */
    overflow: hidden;
    transition: all 0.3s ease;
    text-shadow: none !important;
}

.thought-accordion summary {
    padding: 10px 15px;
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30 !important;
    /* Vibrant red */
    font-family: var(--font-alt);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid transparent;
    text-shadow: none !important;
}

.thought-accordion[open] summary {
    border-bottom: 1px solid rgba(255, 59, 48, 0.2);
    background: rgba(255, 59, 48, 0.2);
}

.thought-accordion summary::before {
    content: '▶';
    font-size: 8px;
    transition: transform 0.2s;
    color: #ff3b30;
}

.thought-accordion[open] summary::before {
    transform: rotate(90deg);
}

.thought-content {
    padding: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #ff5555 !important;
    /* Softer red for dark mode */
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-color) !important;
    text-shadow: none !important;
}

.insecure-banner .banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.insecure-banner.hidden {
    bottom: -100px;
    opacity: 0;
    pointer-events: none;
}

.banner-icon {
    font-size: 20px;
}

.banner-text {
    font-family: var(--font-alt);
    font-size: 13px;
    letter-spacing: 1px;
}

.banner-link {
    background: #ff3b30;
    color: #fff;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: var(--font-alt);
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
    animation: banner-pulse 2s infinite ease-in-out;
}

@keyframes banner-pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(255, 59, 48, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(255, 59, 48, 0.8);
    }
}

/* Message Stats */
.msg-stats {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 12px;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 243, 255, 0.2);
    border-left: 3px solid var(--accent-cyan);
    padding: 10px 15px;
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 11px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.toast.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Upload Progress Bar (Stats Bar Version) */
.upload-progress-container {
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 243, 255, 0.1);
    margin: 0 8px;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    box-shadow: 0 0 10px var(--accent-cyan);
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 8px;
    color: var(--accent-cyan);
    font-family: var(--font-alt);
    letter-spacing: 0.5px;
    min-width: 40px;
}

.msg-stats-with-progress {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 📱 Mobile Responsiveness 📱 */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 300px 1fr;
        padding: 10px;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
        padding: 0;
        gap: 0;
        height: 100dvh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0 20px 20px 0;
        background: var(--bg-color);
        padding: 20px;
        display: flex;
        /* Ensure it stays flex */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.7);
    }

    .sidebar-toggle-btn {
        display: flex;
    }

    .chat-area {
        height: 100vh;
        border-radius: 0;
        border: none;
    }

    .chat-header {
        border-radius: 0;
        padding: 12px 16px;
    }

    .system-monitor {
        display: none;
    }

    .messages-container {
        padding: 12px;
        gap: 12px;
    }

    .message {
        max-width: 95%;
    }

    .input-area {
        margin: 10px;
        border-radius: 24px;
        padding: 12px;
    }

    .file-modal {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        top: 0;
        left: 0;
        transform: none;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 85vw;
    }

    #active-model-name {
        display: none;
    }

    .header-model-select {
        max-width: 140px;
    }
}