        /* Dark Femme Fatale Tech Aesthetic - Enhanced Authority */
        :root {
            /* Ultra-dark foundation */
            --bg-primary: #080808;
            --bg-secondary: #0f0f0f;
            --bg-tertiary: #151515;
            --bg-quaternary: #1a1a1a;
            
            /* Glass panels with subtle tints */
            --glass-primary: rgba(20, 20, 20, 0.85);
            --glass-secondary: rgba(25, 15, 22, 0.75);
            --glass-tertiary: rgba(25, 15, 20, 0.7);
            --glass-hover: rgba(35, 20, 35, 0.8);
            
            /* Sophisticated borders */
            --border-glass: rgba(120, 80, 120, 0.12);
            --border-active: rgba(139, 92, 246, 0.25);
            --border-burgundy: rgba(107, 28, 62, 0.2);
            
            /* Enhanced Typography */
            --text-primary: #f0f0f0;
            --text-secondary: #c8c8c8;
            --text-tertiary: #909090;
            --text-muted: #606060;
            --text-accent: #c9a96e;
            
            /* Refined Femme fatale accents */
            --accent-purple: #7c3aed;
            --accent-purple-glow: rgba(124, 58, 237, 0.4);
            --accent-burgundy: #722f37;
            --accent-burgundy-glow: rgba(114, 47, 55, 0.4);
            --accent-rose-gold: #c9a96e;
            --accent-electric: #8b5cf6;
            
            /* Enhanced shadows */
            --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.7);
            --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.8);
            --shadow-subtle: 0 4px 16px rgba(0, 0, 0, 0.5);
            --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.1);
            --shadow-magnetic: 0 12px 48px rgba(0, 0, 0, 0.6);
            
            /* Blur effects */
            --blur-glass: blur(20px);
            --blur-subtle: blur(10px);
        }


        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Display", Roboto, sans-serif;
            font-weight: 400;
            line-height: 1.5;
            color: var(--text-primary);
            background: linear-gradient(135deg, #080808 0%, #0f0f0f 50%, #151515 100%);
            height: 100vh;
            overflow: hidden;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(114, 47, 55, 0.02) 0%, transparent 50%);
            pointer-events: none;
            z-index: -1;
        }

        /* Navigation */
        .nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border-bottom: 1px solid var(--border-glass);
            z-index: 1000;
            box-shadow: var(--shadow-glass);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .nav:hover {
            box-shadow: var(--shadow-glass), 0 0 30px rgba(139, 92, 246, 0.1);
        }

        .nav-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 2rem;
        }

        .logo-container {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .logo-container a {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
        }

        .veila-logo {
            width: 32px;
            height: 32px;
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .veila-logo::before {
            content: '';
            width: 24px;
            height: 24px;
            background: linear-gradient(135deg, #4c1d95 0%, #6b1c3e 70%, #d4af37 100%);
            clip-path: polygon(0% 0%, 50% 100%, 100% 0%, 80% 0%, 50% 65%, 20% 0%);
            filter: drop-shadow(0 0 8px rgba(76, 29, 149, 0.3));
        }

        .logo-text {
            font-size: 1.5rem;
            font-weight: 200;
            color: var(--text-primary);
            letter-spacing: 0.5px;
        }

        .nav-links {
            display: flex;
            gap: 2rem;
            align-items: center;
        }

        .nav-link {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 300;
            transition: color 0.3s ease;
        }

        .nav-link:hover {
            color: var(--accent-rose-gold);
        }

        .sign-out-btn {
            padding: 0.75rem 1.5rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            color: var(--text-primary);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 400;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .sign-out-btn:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            transform: translateY(-1px);
        }

        /* User Menu */
        .user-menu {
            position: relative;
        }

        .user-button {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1.25rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            color: var(--text-primary);
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .user-button:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            transform: translateY(-2px) scale(1.02);
            box-shadow: var(--shadow-glow);
        }

        .user-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            font-weight: 600;
            color: white;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        .user-caret {
            font-size: 0.7rem;
            transition: transform 0.2s ease;
        }

        .user-menu.open .user-caret {
            transform: rotate(180deg);
        }

        .user-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 16px;
            box-shadow: var(--shadow-deep);
            min-width: 280px;
            z-index: 1000;
            display: none;
            margin-top: 0.5rem;
            padding: 0.5rem 0;
        }

        .user-dropdown.active {
            display: block;
            animation: dropdownSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .user-dropdown-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid var(--border-glass);
            margin-bottom: 0.5rem;
        }

        .user-dropdown-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            font-weight: 600;
            color: white;
        }

        .user-dropdown-info {
            flex: 1;
        }

        .user-dropdown-name {
            font-size: 0.95rem;
            font-weight: 400;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
        }

        .user-dropdown-email {
            font-size: 0.8rem;
            color: var(--text-tertiary);
        }

        .user-dropdown-divider {
            height: 1px;
            background: var(--border-glass);
            margin: 0.5rem 0;
        }

        .user-dropdown-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1.5rem;
            color: var(--text-primary);
            text-decoration: none;
            transition: background 0.2s ease;
            font-size: 0.9rem;
            font-weight: 300;
        }

        .user-dropdown-item:hover {
            background: var(--glass-hover);
        }

        .user-dropdown-icon {
            font-size: 1rem;
            width: 16px;
            text-align: center;
        }

        /* Authentication Modal */
        .auth-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(10px);
            display: none; /* Hidden by default, shown only when needed */
            align-items: center;
            justify-content: center;
            z-index: 2000;
        }
        
        .auth-overlay.show {
            display: flex; /* Show when .show class is added */
        }

        .auth-modal {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border-radius: 20px;
            border: 1px solid var(--border-glass);
            padding: 4rem;
            width: 90%;
            max-width: 450px;
            box-shadow: var(--shadow-deep);
            position: relative;
            overflow: hidden;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .auth-modal:hover {
            box-shadow: var(--shadow-deep), 0 0 40px rgba(139, 92, 246, 0.15);
        }

        .auth-modal::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(76, 29, 149, 0.05) 0%, rgba(107, 28, 62, 0.02) 100%);
            pointer-events: none;
            border-radius: 20px;
        }

        .auth-back-home {
            position: absolute;
            top: 2rem;
            left: 2rem;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.9rem;
            font-weight: 300;
            transition: color 0.3s ease;
            z-index: 10;
        }

        .auth-back-home:hover {
            color: var(--text-primary);
        }

        .auth-header {
            text-align: center;
            margin-bottom: 2.5rem;
            position: relative;
            z-index: 1;
        }

        .auth-header .logo-container {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .auth-header .veila-logo {
            width: 32px;
            height: 32px;
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .auth-header .veila-logo::before {
            content: '';
            width: 24px;
            height: 24px;
            background: linear-gradient(135deg, #4c1d95 0%, #6b1c3e 70%, #d4af37 100%);
            clip-path: polygon(0% 0%, 50% 100%, 100% 0%, 80% 0%, 50% 65%, 20% 0%);
            filter: drop-shadow(0 0 8px rgba(76, 29, 149, 0.3));
        }

        .auth-header .logo-text {
            font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, sans-serif;
            font-size: 1.5rem;
            font-weight: 200;
            color: var(--text-primary);
            letter-spacing: 0.5px;
        }

        .auth-header h1 {
            font-size: 2rem;
            color: var(--text-primary);
            margin-bottom: 1rem;
            font-weight: 300;
            letter-spacing: 1px;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .auth-header p {
            color: var(--text-secondary);
            font-size: 1rem;
            font-weight: 400;
            line-height: 1.7;
        }

        .auth-form {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            position: relative;
            z-index: 1;
        }

        .form-group {
            display: flex;
            flex-direction: column;
        }

        .form-group label {
            font-size: 0.85rem;
            font-weight: 400;
            margin-bottom: 0.75rem;
            color: var(--text-secondary);
            letter-spacing: 0.5px;
        }

        .form-group input {
            padding: 1.25rem 1.5rem;
            border: 1px solid var(--border-glass);
            border-radius: 16px;
            font-size: 1rem;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-primary);
            font-weight: 400;
        }

        .form-group input::placeholder {
            color: var(--text-muted);
        }

        .form-group input:focus {
            outline: none;
            border-color: var(--accent-electric);
            background: var(--glass-primary);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 8px 32px rgba(139, 92, 246, 0.15);
            transform: translateY(-2px);
        }

        .auth-button {
            padding: 1.25rem 2rem;
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            color: white;
            border: none;
            border-radius: 16px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            margin-top: 1rem;
            box-shadow: var(--shadow-subtle), 0 0 15px rgba(124, 58, 237, 0.4);
            position: relative;
            overflow: hidden;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

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

        .auth-button:hover::before {
            left: 100%;
        }

        .auth-button:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: var(--shadow-magnetic), 0 0 30px rgba(124, 58, 237, 0.5);
        }

        .auth-button:disabled {
            background: var(--glass-tertiary);
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .auth-switch {
            text-align: center;
            margin-top: 2rem;
            font-size: 0.85rem;
            position: relative;
            z-index: 1;
        }

        .auth-switch button, .auth-switch-link {
            background: none;
            border: none;
            color: var(--accent-electric);
            cursor: pointer;
            text-decoration: none;
            transition: color 0.2s ease;
            font-weight: 400;
            margin-left: 0.5rem;
        }

        .auth-switch button:hover, .auth-switch-link:hover {
            color: var(--text-accent);
        }

        .auth-error {
            background: var(--glass-tertiary);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: #ff6b6b;
            padding: 1rem;
            border-radius: 12px;
            font-size: 0.85rem;
            margin-bottom: 1rem;
            backdrop-filter: var(--blur-subtle);
        }

        .auth-success {
            background: var(--glass-tertiary);
            border: 1px solid rgba(34, 197, 94, 0.3);
            color: #4ade80;
            padding: 1rem;
            border-radius: 12px;
            font-size: 0.85rem;
            margin-bottom: 1rem;
            backdrop-filter: var(--blur-subtle);
        }

        /* Main App Layout */
        .app-container {
            display: flex;
            height: calc(100vh - 60px);
            overflow: hidden;
            margin-top: 60px;
        }

        /* Sidebar */
        .sidebar {
            width: 320px;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            display: flex;
            flex-direction: column;
            height: 100%;
            border-right: 1px solid var(--border-glass);
            box-shadow: var(--shadow-glass);
            position: relative;
            margin-top: 0;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .sidebar:hover {
            box-shadow: var(--shadow-glass), 0 0 30px rgba(139, 92, 246, 0.1);
        }

        .sidebar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(180deg, rgba(76, 29, 149, 0.03) 0%, rgba(107, 28, 62, 0.02) 100%);
            pointer-events: none;
        }

        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-glass);
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: relative;
            z-index: 1;
            gap: 1rem;
        }
        
        .sidebar-header .agent-selector {
            flex: 1;
            min-width: 0;
        }

        .sidebar-actions {
            display: flex;
            gap: 0.75rem;
            align-items: center;
        }

        .new-conversation-btn, .edit-prompt-btn {
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            color: white;
            border: none;
            border-radius: 50%;
            padding: 0.875rem;
            font-size: 1.3rem;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 48px;
            box-shadow: var(--shadow-subtle), 0 0 15px rgba(124, 58, 237, 0.4);
            position: relative;
            overflow: hidden;
        }

        .edit-prompt-btn {
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-primary);
            border: 1px solid var(--border-glass);
            font-size: 1.1rem;
        }

        .new-conversation-btn:hover, .edit-prompt-btn:hover {
            transform: translateY(-3px) scale(1.08);
            box-shadow: var(--shadow-glow), 0 0 25px rgba(124, 58, 237, 0.5);
        }

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

        .new-conversation-btn:hover::before, .edit-prompt-btn:hover::before {
            left: 100%;
        }

        .conversations-list {
            flex: 1;
            overflow-y: auto;
            overflow-x: visible;
            padding: 1rem 0;
            position: relative;
            z-index: 1;
        }
        
        /* Allow dropdowns to overflow the container */
        .conversations-list:has(.dropdown-menu:not([style*="display: none"])) {
            overflow: visible;
        }

        .conversation-item {
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border-bottom: 1px solid rgba(120, 80, 120, 0.08);
            margin: 0 1rem;
            border-radius: 12px;
            margin-bottom: 0.75rem;
            position: relative;
            z-index: auto;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .conversation-item.dropdown-open {
            z-index: 10000;
            pointer-events: none;
        }

        .conversation-item.dropdown-open .conversation-dropdown {
            pointer-events: auto;
        }

        .conversation-item:hover {
            background: var(--glass-hover);
            box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
        }

        .conversation-item.active {
            background: var(--glass-secondary);
            border: 1px solid var(--border-glass);
            box-shadow: var(--shadow-subtle), 0 0 20px rgba(139, 92, 246, 0.15);
            margin-left: 6px;
        }

        .conversation-title {
            font-size: 0.95rem;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 0.75rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.4;
        }

        .conversation-meta {
            font-size: 0.8rem;
            color: var(--text-tertiary);
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-weight: 400;
        }

        .conversation-actions {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            position: relative;
        }

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

        .conversation-dropdown {
            position: relative;
            z-index: 999998;
        }

        .dropdown-btn {
            background: none;
            border: none;
            cursor: pointer;
            padding: 0.5rem;
            color: var(--text-tertiary);
            opacity: 0;
            transition: all 0.3s ease;
            font-size: 1rem;
            border-radius: 6px;
        }

        .conversation-item:hover .dropdown-btn {
            opacity: 1;
        }

        .dropdown-btn:hover {
            background: var(--glass-hover);
            color: var(--text-secondary);
        }

        .dropdown-menu {
            position: absolute;
            top: 0;
            left: 100%;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            box-shadow: var(--shadow-deep);
            min-width: 140px;
            z-index: 999999;
            display: none;
            margin-left: 0.5rem;
        }

        .dropdown-menu.active {
            display: block;
            animation: dropdownSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .dropdown-menu button {
            width: 100%;
            padding: 0.75rem 1rem;
            background: none;
            border: none;
            text-align: left;
            cursor: pointer;
            font-size: 0.85rem;
            color: var(--text-primary);
            transition: background 0.2s ease;
            font-weight: 300;
            border-radius: 12px;
        }

        .dropdown-menu button:hover {
            background: var(--glass-hover);
        }

        .favorite-indicator {
            color: var(--accent-rose-gold);
            font-size: 0.9rem;
            margin-right: 0.5rem;
            text-shadow: 0 0 5px rgba(212, 175, 55, 0.5);
        }

        .conversation-title-input {
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--accent-electric);
            border-radius: 8px;
            padding: 0.5rem;
            font-size: 0.9rem;
            width: 100%;
            margin-bottom: 0.5rem;
            color: var(--text-primary);
            font-weight: 300;
        }

        .conversation-title-input:focus {
            outline: none;
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
        }

        /* Traces Header with Stats */
        .traces-header {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
            padding: 0.25rem 0.5rem 0.25rem 3rem; /* Extra left padding for toggle button */
            border-bottom: 1px solid var(--border-glass);
        }

        .traces-title {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-primary);
            letter-spacing: 1px;
            margin-top: 0;
        }

        .stats-compact {
            flex: 1;
        }

        .traces-sidebar.collapsed .traces-header {
            display: none;
        }

        .stats:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-glass), 0 0 25px rgba(139, 92, 246, 0.1);
        }

        .stats-grid {
            display: flex;
            flex-direction: column;
            gap: 0.125rem;
            margin-bottom: 0;
        }

        .stat {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.125rem 0;
            border-bottom: 1px solid var(--border-glass);
        }

        .stat:last-child {
            border-bottom: none;
        }

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

        .stat-value {
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .clear-button {
            width: 100%;
            padding: 1rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-primary);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            font-size: 0.85rem;
            font-weight: 500;
            position: relative;
            z-index: 1;
            letter-spacing: 0.5px;
        }

        .clear-button:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: var(--shadow-glow), 0 0 20px rgba(239, 68, 68, 0.2);
            background: var(--glass-hover);
            border-color: rgba(239, 68, 68, 0.3);
            color: #ff6b6b;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
        }

        .chat-container {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border-radius: 16px;
            border: 1px solid var(--border-glass);
            height: calc(100vh - 6rem);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: var(--shadow-deep);
            position: relative;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .chat-container:hover {
            box-shadow: var(--shadow-deep), 0 0 30px rgba(139, 92, 246, 0.1);
            border-color: rgba(139, 92, 246, 0.15);
        }

        .welcome-message {
            text-align: center;
            padding: 4rem 2rem;
            color: var(--text-secondary);
        }

        .welcome-message h2 {
            font-size: 2rem;
            margin-bottom: 1.5rem;
            color: var(--text-primary);
            font-weight: 300;
            letter-spacing: 1px;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .welcome-message p {
            font-size: 1.1rem;
            line-height: 1.7;
            color: var(--text-tertiary);
            font-weight: 400;
            max-width: 600px;
            margin: 0 auto;
        }

        .chat-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 1.5rem;
            border-bottom: 1px solid var(--border-glass);
        }

        .chat-header-left {
            flex: 1;
        }

        .chat-header-right {
            display: flex;
            align-items: center;
        }

        .chat-title {
            font-size: 1.6rem;
            font-weight: 300;
            color: var(--text-primary);
            margin-bottom: 0.75rem;
            letter-spacing: 0.5px;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .chat-subtitle {
            font-size: 1rem;
            color: var(--text-tertiary);
            font-weight: 400;
            line-height: 1.6;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 2rem;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .empty-state {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--text-tertiary);
        }

        .empty-state h3 {
            font-size: 2.2rem;
            margin-bottom: 1.5rem;
            color: var(--text-secondary);
            font-weight: 300;
            letter-spacing: 1px;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        .empty-state p {
            margin-bottom: 1rem;
            font-size: 1.1rem;
            font-weight: 400;
            line-height: 1.7;
            max-width: 600px;
        }

        .message-content {
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            padding: 1.5rem 1.75rem;
            border-radius: 18px;
            margin-bottom: 0.75rem;
            border: 1px solid var(--border-glass);
            color: var(--text-primary);
            box-shadow: var(--shadow-glass);
            font-weight: 400;
            line-height: 1.7;
            font-size: 0.95rem;
            position: relative;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .message-content:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-glass), 0 0 20px rgba(139, 92, 246, 0.1);
        }

        .message.user .message-content {
            background: linear-gradient(135deg, var(--glass-tertiary) 0%, var(--glass-secondary) 100%);
            border: 1px solid var(--border-burgundy);
            box-shadow: var(--shadow-glass), 0 0 20px rgba(114, 47, 55, 0.15);
            font-weight: 500;
        }

        .message.assistant .message-content {
            background: linear-gradient(135deg, var(--glass-primary) 0%, var(--glass-secondary) 100%);
            border: 1px solid var(--border-glass);
            font-weight: 400;
        }

        .reasoning-section {
            background: var(--glass-tertiary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-burgundy);
            border-radius: 14px;
            padding: 1.25rem 1.5rem;
            margin-top: 1rem;
            box-shadow: var(--shadow-subtle), 0 0 20px rgba(114, 47, 55, 0.2);
            position: relative;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            overflow: hidden;
        }

        .reasoning-section.streaming {
            border-color: var(--accent-electric);
            box-shadow: var(--shadow-subtle), 0 0 25px rgba(139, 92, 246, 0.3);
        }

        .reasoning-section.streaming::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, transparent, var(--accent-electric), transparent);
            animation: reasoningProgress 2s infinite;
        }

        @keyframes reasoningProgress {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        .reasoning-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }

        .reasoning-header h4 {
            color: var(--accent-rose-gold);
            font-size: 0.9rem;
            font-weight: 500;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            margin: 0;
        }

        .reasoning-status {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-left: auto;
        }

        .thinking-indicator {
            display: flex;
            gap: 0.3rem;
        }

        .thinking-dot {
            width: 0.3rem;
            height: 0.3rem;
            background: var(--accent-electric);
            border-radius: 50%;
            animation: thinkingPulse 1.4s ease-in-out infinite both;
        }

        .thinking-dot:nth-child(1) { animation-delay: -0.32s; }
        .thinking-dot:nth-child(2) { animation-delay: -0.16s; }
        .thinking-dot:nth-child(3) { animation-delay: 0s; }

        @keyframes thinkingPulse {
            0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
            40% { opacity: 1; transform: scale(1.2); }
        }

        .reasoning-content {
            color: var(--text-secondary);
            font-size: 0.95rem;
            line-height: 1.6;
            font-weight: 400;
            position: relative;
        }

        .reasoning-step {
            margin-bottom: 0.75rem;
            opacity: 0;
            transform: translateY(10px);
            animation: stepFadeIn 0.5s ease-out forwards;
        }

        .reasoning-step:last-child {
            margin-bottom: 0;
        }

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

        .typing-cursor {
            display: inline-block;
            width: 2px;
            height: 1.2em;
            background: var(--accent-electric);
            margin-left: 2px;
            animation: cursorBlink 1s infinite;
        }

        @keyframes cursorBlink {
            0%, 50% { opacity: 1; }
            51%, 100% { opacity: 0; }
        }

        .reasoning-complete {
            color: var(--accent-rose-gold);
            font-size: 0.8rem;
            margin-top: 0.5rem;
            opacity: 0;
            animation: fadeInUp 0.5s ease-out 0.5s forwards;
        }

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

        .chat-input-container {
            border-top: 1px solid var(--border-glass);
            padding: 2rem;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
        }

        #userInput {
            flex: 1;
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            padding: 1.25rem 1.5rem;
            font-size: 1rem;
            resize: none;
            height: 60px;
            max-height: 180px;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-primary);
            font-weight: 400;
            font-family: inherit;
            line-height: 1.6;
        }

        #userInput:focus {
            outline: none;
            border-color: var(--accent-electric);
            background: var(--glass-primary);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 8px 32px rgba(139, 92, 246, 0.15);
            transform: translateY(-2px);
        }

        .send-button {
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            color: white;
            border: none;
            border-radius: 20px;
            padding: 1rem 2rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            font-size: 1rem;
            box-shadow: var(--shadow-subtle), 0 0 15px rgba(124, 58, 237, 0.4);
            position: relative;
            overflow: hidden;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .send-button:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: var(--shadow-magnetic), 0 0 30px rgba(124, 58, 237, 0.5);
        }

        .demo-send-btn {
            position: absolute;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 40px;
            height: 40px;
            border: 1px solid #6b1c3e;
            border-radius: 50%;
            background: rgba(25, 15, 25, 0.3);
            color: #6b1c3e;
            font-size: 20px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            backdrop-filter: blur(10px);
        }

        .demo-send-btn:hover {
            border-color: #8b5cf6;
            color: #8b5cf6;
            box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
            background: rgba(139, 92, 246, 0.1);
            transform: translateY(-50%) translateY(-1px);
        }

        .demo-send-btn:active {
            transform: translateY(-50%) translateY(0);
        }

        .file-input-container {
            position: relative;
        }

        .file-input-btn {
            padding: 1rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.9rem;
            color: var(--text-primary);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: block;
            text-align: center;
            white-space: nowrap;
            font-weight: 400;
        }

        .file-input-btn:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            transform: translateY(-1px);
        }

        .file-input-btn input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .attachments {
            margin-top: 1rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
        }

        .attachment {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.6rem 1rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border-radius: 20px;
            font-size: 0.8rem;
            color: var(--text-primary);
            font-weight: 300;
            border: 1px solid var(--border-glass);
        }

        .attachment-remove {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-tertiary);
            font-size: 1rem;
            padding: 0.125rem;
            border-radius: 50%;
            transition: all 0.2s ease;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .attachment-remove:hover {
            color: #ef4444;
            background: rgba(239, 68, 68, 0.1);
        }

        .loading-message {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1.25rem 1.5rem;
            background: var(--glass-tertiary);
            backdrop-filter: var(--blur-subtle);
            border-radius: 20px 20px 20px 4px;
            font-size: 0.9rem;
            color: var(--text-tertiary);
            font-weight: 300;
            border: 1px solid rgba(120, 80, 120, 0.08);
            box-shadow: var(--shadow-subtle);
        }

        .loading-dots {
            display: flex;
            gap: 0.4rem;
        }

        .loading-dot {
            width: 0.35rem;
            height: 0.35rem;
            background: var(--text-tertiary);
            border-radius: 50%;
            animation: loading 1.4s ease-in-out infinite both;
            box-shadow: 0 0 5px rgba(139, 92, 246, 0.1);
        }

        .loading-dot:nth-child(1) { animation-delay: -0.32s; }
        .loading-dot:nth-child(2) { animation-delay: -0.16s; }
        .loading-dot:nth-child(3) { animation-delay: 0s; }

        @keyframes loading {
            0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
            40% { opacity: 1; transform: scale(1.1); }
        }

        /* Moon Loading Animation */
        .moon-loading {
            display: inline-block;
            font-size: 1.5rem;
            animation: moonPulse 2s ease-in-out infinite;
        }

        @keyframes moonPulse {
            0%, 100% { 
                transform: scale(1) rotate(0deg);
                opacity: 0.7;
            }
            25% { 
                transform: scale(1.1) rotate(5deg);
                opacity: 0.9;
            }
            50% { 
                transform: scale(1.2) rotate(0deg);
                opacity: 1;
            }
            75% { 
                transform: scale(1.1) rotate(-5deg);
                opacity: 0.9;
            }
        }

        .ai-loading-message {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: var(--text-tertiary);
            font-style: italic;
        }

        /* Simplified loading message without card styling */
        .loading-message-simple {
            background: none !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0.5rem 0 !important;
            margin: 0.5rem auto !important;
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .loading-message-simple .moon-loading {
            font-size: 1.2rem;
        }

        /* Apply moon animation to workspace loading messages */
        .ai-message.loading {
            background: none !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0.25rem !important;
            margin: 0.25rem 0 !important;
        }

        .ai-message.loading .ai-message-header {
            display: none;
        }

        .ai-message.loading .ai-message-content {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            background: none !important;
            padding: 0 !important;
        }

        .ai-message.loading .ai-message-content:before {
            content: "🌙";
            animation: moonPulse 2s ease-in-out infinite;
        }

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

        /* Drag and Drop Overlay */
        .drag-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(8, 8, 8, 0.85);
            backdrop-filter: blur(20px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s ease-in-out;
            border-radius: 16px;
            border: 2px dashed var(--accent-electric);
        }

        .drag-overlay.active {
            opacity: 1;
        }

        .drag-overlay-content {
            text-align: center;
            color: var(--text-primary);
            pointer-events: none;
        }

        .drag-icon {
            font-size: 4rem;
            margin-bottom: 1rem;
            animation: dragBounce 1.5s ease-in-out infinite;
        }

        .drag-overlay-content h3 {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
            color: var(--accent-electric);
            font-weight: 600;
        }

        .drag-overlay-content p {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

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

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

        .trace-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            padding: 2rem;
        }

        .trace-modal-overlay.show {
            display: flex;
        }

        .trace-modal-content {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            width: 100%;
            max-width: 1000px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow-deep);
        }

        .trace-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem 2rem;
            border-bottom: 1px solid var(--border-glass);
            flex-shrink: 0;
        }

        .trace-modal-title {
            font-size: 1.5rem;
            font-weight: 400;
            color: var(--text-primary);
        }

        .trace-modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .trace-modal-close:hover {
            background: var(--glass-secondary);
            color: var(--text-primary);
        }

        .trace-controls {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 2rem;
            border-bottom: 1px solid var(--border-glass);
            flex-shrink: 0;
        }

        .trace-filter input {
            flex: 1;
            padding: 0.5rem 1rem;
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            background: var(--glass-secondary);
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .trace-filter input:focus {
            outline: none;
            border-color: var(--accent-electric);
        }

        .trace-controls select {
            padding: 0.5rem;
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            background: var(--glass-secondary);
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .trace-export-btn {
            padding: 0.5rem 1rem;
            background: var(--accent-electric);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .trace-export-btn:hover {
            background: var(--accent-purple);
        }

        .trace-list {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 2rem;
        }

        .trace-card {
            background: var(--glass-secondary);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            margin-bottom: 1rem;
            transition: all 0.3s ease;
        }

        .trace-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-subtle);
        }

        .trace-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            cursor: pointer;
        }

        .trace-id-badge {
            font-family: monospace;
            font-size: 0.8rem;
            background: var(--glass-tertiary);
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
            color: var(--text-secondary);
        }

        .trace-timestamp {
            font-size: 0.8rem;
            color: var(--text-tertiary);
        }

        .trace-actions {
            display: flex;
            gap: 0.5rem;
        }

        .trace-action-btn {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            border-radius: 6px;
            padding: 0.5rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .trace-action-btn:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }

        .trace-content {
            display: none;
            padding: 0 1.5rem 1.5rem;
            border-top: 1px solid var(--border-glass);
        }

        .trace-card.expanded .trace-content {
            display: block;
        }

        .trace-input, .trace-output {
            margin-bottom: 1rem;
        }

        .trace-input strong, .trace-output strong {
            display: block;
            font-size: 0.8rem;
            text-transform: uppercase;
            color: var(--accent-rose-gold);
            margin-bottom: 0.5rem;
        }

        .trace-input div, .trace-output div {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            padding: 1rem;
            font-size: 0.9rem;
            color: var(--text-primary);
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        @media (max-width: 768px) {
            .trace-modal-overlay { padding: 1rem; }
            .trace-modal-content { max-height: 90vh; }
            .trace-modal-header, .trace-controls, .trace-list { padding-left: 1rem; padding-right: 1rem; }
            .trace-controls { flex-direction: column; align-items: stretch; gap: 0.5rem; }
        }

        ::-webkit-scrollbar {
            width: 4px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--glass-secondary);
            border-radius: 10px;
            backdrop-filter: var(--blur-subtle);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--glass-hover);
        }

        @media (max-width: 768px) {
            .nav-content { padding: 0 1rem; flex-direction: column; gap: 1rem; }
            .logo h1 { font-size: 1.4rem; font-weight: 300; }
            .stats { display: none; }
            .welcome-message { padding: 3rem 1rem; }
            .welcome-message h2 { font-size: 1.6rem; font-weight: 300; }
            .welcome-message p { font-size: 1rem; font-weight: 400; }
            .chat-header { padding: 1.5rem 1rem; }
            .chat-title { font-size: 1.3rem; font-weight: 300; }
            .chat-subtitle { font-size: 0.9rem; font-weight: 400; }
            .user-button { padding: 0.5rem 1rem; font-size: 0.9rem; font-weight: 500; }
            .user-avatar { width: 24px; height: 24px; font-size: 0.7rem; }
            .stat-value { font-size: 0.9rem; font-weight: 500; }
            .stat-label { font-size: 0.7rem; font-weight: 400; }
        }

        ::selection {
            background: var(--accent-purple-glow);
            color: var(--text-primary);
        }

        ::-moz-selection {
            background: var(--accent-purple-glow);
            color: var(--text-primary);
        }

        .account-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
            padding: 2rem;
        }

        .account-modal-overlay.show {
            display: flex;
        }

        .account-modal-content {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            max-width: 800px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            box-shadow: var(--shadow-deep);
        }

        .account-modal-content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(76, 29, 149, 0.05) 0%, rgba(107, 28, 62, 0.02) 100%);
            border-radius: 20px;
            pointer-events: none;
        }

        .account-modal-inner {
            position: relative;
            z-index: 1;
            padding: 2rem;
        }

        .account-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 2rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--border-glass);
        }

        .account-modal-title {
            font-size: 1.5rem;
            font-weight: 400;
            color: var(--text-primary);
        }

        .account-modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .account-modal-close:hover {
            background: var(--glass-secondary);
            color: var(--text-primary);
        }

        .account-tabs {
            display: flex;
            gap: 1rem;
            margin-bottom: 2rem;
            border-bottom: 1px solid var(--border-glass);
        }

        .account-tab {
            padding: 1rem 1.5rem;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.3s ease;
            border-bottom: 2px solid transparent;
        }

        .account-tab.active {
            color: var(--text-primary);
            border-bottom-color: var(--accent-electric);
        }

        .account-tab:hover {
            color: var(--text-primary);
            background: var(--glass-hover);
        }

        .account-tab-content {
            display: none;
        }

        .account-tab-content.active {
            display: block;
        }

        .account-section {
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 16px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .account-section h3 {
            font-size: 1.1rem;
            font-weight: 400;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

        .account-form-group {
            margin-bottom: 1.5rem;
        }

        .account-form-group label {
            display: block;
            font-size: 0.9rem;
            font-weight: 400;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
        }

        .account-form-group input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            background: var(--glass-primary);
            color: var(--text-primary);
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .account-form-group input:focus {
            outline: none;
            border-color: var(--accent-electric);
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
        }

        .account-button {
            padding: 0.75rem 1.5rem;
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            color: white;
            border: none;
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: 400;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-right: 0.75rem;
        }

        .account-button:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-glow);
        }

        .account-button-secondary {
            background: var(--glass-secondary);
            color: var(--text-primary);
            border: 1px solid var(--border-glass);
        }

        .account-button-secondary:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
        }

        .usage-stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .usage-stat {
            background: var(--glass-tertiary);
            padding: 1rem;
            border-radius: 12px;
            text-align: center;
        }

        .usage-stat-value {
            font-size: 1.5rem;
            font-weight: 300;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .usage-stat-label {
            font-size: 0.8rem;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .plan-card {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            border-radius: 16px;
            padding: 1.5rem;
            margin-bottom: 1rem;
            position: relative;
        }

        .plan-card.current {
            border-color: var(--accent-electric);
            background: var(--glass-hover);
        }

        .plan-card.current::before {
            content: 'Current Plan';
            position: absolute;
            top: -8px;
            left: 1rem;
            background: var(--accent-electric);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        .plan-name {
            font-size: 1.2rem;
            font-weight: 400;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .plan-price {
            font-size: 1.5rem;
            font-weight: 300;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

        .plan-price .period {
            font-size: 0.9rem;
            color: var(--text-tertiary);
        }

        .plan-features {
            list-style: none;
            margin-bottom: 1.5rem;
        }

        .plan-features li {
            padding: 0.25rem 0;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .plan-features li::before {
            content: '✓';
            color: var(--accent-electric);
            font-weight: bold;
            margin-right: 0.5rem;
        }

        .agent-selector {
            position: relative;
            margin-right: 1rem;
        }

        .agent-dropdown {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 400;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .agent-dropdown:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            transform: translateY(-1px);
        }

        .agent-avatar {
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.6rem;
            font-weight: 600;
            color: white;
        }

        .agent-caret {
            font-size: 0.7rem;
            transition: transform 0.2s ease;
        }

        .agent-selector.open .agent-caret {
            transform: rotate(180deg);
        }

        .agent-menu {
            position: absolute;
            top: 100%;
            left: 0;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 16px;
            box-shadow: var(--shadow-deep);
            min-width: 250px;
            z-index: 1000;
            display: none;
            margin-top: 0.5rem;
            padding: 0.5rem 0;
        }

        .agent-menu.active {
            display: block;
            animation: dropdownSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .agent-menu-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            cursor: pointer;
            transition: background 0.2s ease;
            color: var(--text-primary);
            text-decoration: none;
        }

        .agent-menu-item:hover {
            background: var(--glass-hover);
        }

        .agent-menu-item.active {
            background: var(--glass-hover);
            border-left: 3px solid var(--accent-electric);
        }

        .agent-menu-divider {
            height: 1px;
            background: var(--border-glass);
            margin: 0.5rem 0;
        }

        .create-agent-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1rem;
            color: var(--accent-electric);
            font-size: 0.9rem;
            font-weight: 400;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .create-agent-btn:hover {
            background: var(--glass-hover);
            color: var(--text-accent);
        }

        .agent-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 2000;
        }

        .agent-modal-overlay.active {
            display: flex;
        }

        .agent-modal {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 24px;
            box-shadow: var(--shadow-deep);
            max-width: 500px;
            width: 90%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }

        .agent-modal-inner {
            padding: 2rem;
        }

        .agent-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .agent-modal-title {
            font-size: 1.25rem;
            font-weight: 400;
            color: var(--text-primary);
        }

        .agent-modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            border-radius: 8px;
            transition: all 0.3s ease;
        }

        .agent-modal-close:hover {
            background: var(--glass-secondary);
            color: var(--text-primary);
        }

        .agent-form {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .agent-form-group {
            display: flex;
            flex-direction: column;
        }

        .agent-form-group label {
            font-size: 0.9rem;
            font-weight: 400;
            margin-bottom: 0.5rem;
            color: var(--text-secondary);
        }

        .agent-form-group input,
        .agent-form-group textarea {
            padding: 0.75rem 1rem;
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            background: var(--glass-secondary);
            color: var(--text-primary);
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .agent-form-group input:focus,
        .agent-form-group textarea:focus {
            outline: none;
            border-color: var(--accent-electric);
            box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
        }

        .agent-form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

        .agent-form-actions {
            display: flex;
            gap: 1rem;
            justify-content: flex-end;
        }

        .agent-form-btn {
            padding: 0.75rem 1.5rem;
            border: none;
            border-radius: 12px;
            font-size: 0.9rem;
            font-weight: 400;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .agent-form-btn.primary {
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            color: white;
        }

        .agent-form-btn.primary:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-subtle);
        }

        .agent-form-btn.secondary {
            background: var(--glass-secondary);
            color: var(--text-secondary);
            border: 1px solid var(--border-glass);
        }

        .agent-form-btn.secondary:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }

        .agent-form-btn.danger {
            background: #dc2626;
            color: white;
            border: 1px solid #dc2626;
        }

        .agent-form-btn.danger:hover {
            background: #b91c1c;
            border-color: #b91c1c;
            transform: translateY(-1px);
            box-shadow: var(--shadow-subtle);
        }

        .traces-sidebar {
            width: 320px;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            display: flex;
            flex-direction: column;
            height: 100%;
            overflow: hidden;
            border-left: 1px solid var(--border-glass);
            box-shadow: var(--shadow-glass);
            position: relative;
            margin-top: 0;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            flex-shrink: 0;
        }

        .traces-sidebar:hover {
            box-shadow: var(--shadow-glass), 0 0 30px rgba(139, 92, 246, 0.1);
        }

        .traces-sidebar::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(180deg, rgba(76, 29, 149, 0.03) 0%, rgba(107, 28, 62, 0.02) 100%);
            pointer-events: none;
        }

        .validation-queue {
            flex: 1;
            display: flex;
            flex-direction: column;
            padding: 1rem;
            margin-top: 0.25rem;
            overflow: hidden;
        }

        .validation-queue-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .validation-queue-header h3 {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin: 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .validation-count {
            background: var(--accent-electric);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .validation-list {
            flex: 1;
            overflow-y: auto;
            padding-right: 0.5rem;
            max-height: calc(100vh - 400px); /* Adjust based on header and buttons above */
            min-height: 200px;
        }

        .validation-item {
            background: var(--glass-primary);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            padding: 0.5rem;
            position: relative;
        }

        .validation-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.25rem;
        }

        .validation-trace-id {
            font-size: 0.7rem;
            color: var(--text-tertiary);
            font-family: monospace;
        }

        .validation-trace-id.clickable-trace {
            cursor: pointer;
            color: var(--accent-primary);
            text-decoration: underline;
            transition: color 0.2s ease;
        }

        .validation-trace-id.clickable-trace:hover {
            color: var(--accent-electric);
        }

        .validation-date {
            font-size: 0.65rem;
            color: var(--text-muted);
        }

        .validation-prompt {
            font-size: 0.8rem;
            color: var(--text-secondary);
            line-height: 1.3;
            margin-bottom: 0.75rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .validation-actions {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
        }

        .validation-btn {
            background: var(--glass-secondary);
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            padding: 0.25rem 0.4rem;
            cursor: pointer;
            font-size: 0.8rem;
            transition: all 0.2s ease;
        }

        .validation-btn:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-subtle);
        }

        .validation-btn.thumbs-up:hover {
            background: #10b981;
            border-color: #10b981;
        }

        .validation-btn.thumbs-down:hover {
            background: #ef4444;
            border-color: #ef4444;
        }

        .validation-btn.delete:hover {
            background: #6b7280;
            border-color: #6b7280;
        }

        /* Validation Filter Buttons */
        .validation-filter-btn {
            opacity: 0.5;
            background: var(--glass-secondary) !important;
        }

        .validation-filter-btn.active {
            opacity: 1;
            background: var(--accent-primary) !important;
            color: white !important;
            border-color: var(--accent-primary) !important;
        }

        .validation-filter-btn:hover {
            opacity: 0.8;
        }

        /* Micro-interactions */
        @keyframes magneticPulse {
            0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
            70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
            100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
        }

        @keyframes shimmerGold {
            0% { background-position: -200px 0; }
            100% { background-position: calc(200px + 100%) 0; }
        }

        .cta-btn::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.1), transparent);
            background-size: 200px 100%;
            animation: shimmerGold 3s infinite;
            pointer-events: none;
        }

        .feature-card::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(139, 92, 246, 0.1) 0%, transparent 50%);
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        .feature-card:hover::after {
            opacity: 1;
        }

        .success-pulse {
            animation: magneticPulse 2s infinite;
        }

        .loading-dot {
            width: 0.4rem;
            height: 0.4rem;
            background: linear-gradient(45deg, var(--accent-electric), var(--accent-rose-gold));
            border-radius: 50%;
            animation: loading 1.4s ease-in-out infinite both;
            box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
        }

        ::selection {
            background: rgba(124, 58, 237, 0.3);
            color: var(--text-primary);
        }

        ::-moz-selection {
            background: rgba(124, 58, 237, 0.3);
            color: var(--text-primary);
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(45deg, var(--glass-secondary), var(--glass-hover));
            border-radius: 10px;
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(45deg, var(--glass-hover), var(--accent-electric));
            box-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
        }

        .logo h1 {
            font-size: 1.6rem;
            font-weight: 300;
            color: var(--text-primary);
            letter-spacing: 0.5px;
            text-shadow: 0 0 15px rgba(201, 169, 110, 0.2);
        }

        .logo-icon {
            font-size: 1.9rem;
            color: var(--accent-rose-gold);
            text-shadow: 0 0 15px rgba(201, 169, 110, 0.4);
        }

        .beta-tag {
            font-size: 0.75rem;
            font-weight: 500;
            color: var(--text-tertiary);
            background: var(--glass-secondary);
            padding: 0.3rem 0.8rem;
            border-radius: 12px;
            border: 1px solid var(--border-burgundy);
            letter-spacing: 0.5px;
            text-transform: uppercase;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .beta-tag:hover {
            background: var(--glass-hover);
            transform: translateY(-1px);
        }

        .message {
            max-width: 800px;
            margin: 0 auto;
            width: 100%;
            animation: messageSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            margin-bottom: 2rem;
        }

        .message.user {
            align-self: flex-end;
        }

        .message.assistant {
            align-self: flex-start;
        }

        .message.user .content {
            background: var(--glass-tertiary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-primary);
            margin-left: auto;
            max-width: 75%;
            padding: 1.5rem 1.75rem;
            border-radius: 20px 20px 4px 20px;
            font-size: 0.95rem;
            line-height: 1.7;
            white-space: pre-wrap;
            border: 1px solid var(--border-burgundy);
            box-shadow: var(--shadow-glass), 0 0 20px rgba(114, 47, 55, 0.15);
            position: relative;
            font-weight: 500;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .message.user .content::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(114, 47, 55, 0.05) 0%, rgba(107, 28, 62, 0.02) 100%);
            border-radius: 20px 20px 4px 20px;
            pointer-events: none;
        }

        .message.assistant .content {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-secondary);
            padding: 1.5rem 1.75rem;
            border-radius: 20px 20px 20px 4px;
            font-size: 0.95rem;
            line-height: 1.7;
            white-space: pre-wrap;
            border: 1px solid var(--border-glass);
            box-shadow: var(--shadow-glass);
            font-weight: 400;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .message.assistant .content:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-glass), 0 0 20px rgba(139, 92, 246, 0.1);
        }

        .message.user .content:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-glass), 0 0 25px rgba(114, 47, 55, 0.2);
        }

        .message .reasoning {
            margin-top: 1.5rem;
            padding: 1.25rem 1.5rem;
            background: var(--glass-tertiary);
            backdrop-filter: var(--blur-subtle);
            border-radius: 16px;
            font-size: 0.9rem;
            color: var(--text-secondary);
            font-weight: 400;
            border: 1px solid var(--border-burgundy);
            box-shadow: var(--shadow-subtle), 0 0 20px rgba(114, 47, 55, 0.2);
            position: relative;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .message .reasoning::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(114, 47, 55, 0.05) 0%, rgba(107, 28, 62, 0.02) 100%);
            border-radius: 16px;
            pointer-events: none;
        }

        .message .reasoning:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-subtle), 0 0 25px rgba(114, 47, 55, 0.25);
        }

        .message .reasoning strong {
            color: var(--accent-rose-gold);
            display: block;
            margin-bottom: 0.75rem;
            font-weight: 500;
            font-size: 0.85rem;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            position: relative;
            z-index: 1;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }

        .message .reasoning p {
            position: relative;
            z-index: 1;
            line-height: 1.6;
        }

        .message-footer {
            font-size: 0.8rem;
            color: var(--text-muted);
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            padding: 0 0.75rem;
            margin-top: 0.75rem;
        }

        .message-actions {
            display: flex;
            gap: 0.75rem;
        }

        .rate-button, .share-button {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            padding: 0.4rem 0.8rem;
            font-size: 0.8rem;
            color: var(--text-tertiary);
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            font-weight: 400;
        }

        .rate-button:hover, .share-button:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            color: var(--text-secondary);
            transform: translateY(-1px) scale(1.02);
        }

        .rate-button.active {
            background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-electric) 100%);
            border-color: var(--accent-electric);
            color: white;
            box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
        }

        .memory-citations {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-top: 0.75rem;
        }

        .citations-list {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .citation {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.4rem 0.8rem;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-subtle);
            border-radius: 20px;
            cursor: pointer;
            border: 1px solid var(--border-glass);
            color: var(--text-tertiary);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            font-size: 0.8rem;
            font-weight: 400;
        }

        .citation:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            color: var(--text-secondary);
            box-shadow: var(--shadow-glow);
            transform: translateY(-1px) scale(1.02);
        }

        .chat-form {
            max-width: 90%;
            margin: 0 auto;
        }

        .input-row {
            display: flex;
            gap: 0.75rem;
            align-items: flex-end;
        }

        .textarea-container {
            position: relative;
            flex: 1;
        }

        .input-row textarea {
            flex: 1;
            padding: 1.25rem 60px 1.25rem 1.5rem;
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            font-size: 1rem;
            line-height: 1.6;
            resize: none;
            font-family: inherit;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            color: var(--text-primary);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            width: 100%;
            font-weight: 400;
            min-height: 60px;
            max-height: 180px;
        }

        .input-row textarea:focus {
            outline: none;
            border-color: var(--accent-electric);
            background: var(--glass-primary);
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 8px 32px rgba(139, 92, 246, 0.15);
            transform: translateY(-2px);
        }

        .input-row textarea::placeholder {
            color: var(--text-muted);
            font-weight: 400;
        }

        .file-input-container {
            position: relative;
        }

        .file-input-btn {
            padding: 1.25rem 1.5rem;
            background: var(--glass-secondary);
            backdrop-filter: var(--blur-subtle);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            cursor: pointer;
            font-size: 0.9rem;
            color: var(--text-primary);
            transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            display: block;
            text-align: center;
            white-space: nowrap;
            font-weight: 400;
            height: 60px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .file-input-btn:hover {
            background: var(--glass-hover);
            border-color: var(--border-active);
            transform: translateY(-2px) scale(1.02);
            box-shadow: var(--shadow-glow);
        }

        .file-input-btn input {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .chat-input {
            padding: 2rem;
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border-top: 1px solid var(--border-glass);
            width: 100%;
        }

        .chat-input.show {
            display: block !important;
        }

        #viewTracesBtn, #clearTraces {
            width: 100%;
            max-width: 280px;
            padding: 0.75rem;
            margin: 0.25rem auto;
            text-transform: none;
            font-size: 0.85rem;
        }

        .reasoning-section.collapsed {
            background: var(--glass-secondary);
            border: 1px solid rgba(120, 80, 120, 0.08);
            transition: all 0.3s ease;
        }

        .reasoning-section.collapsed:hover {
            border-color: var(--border-active);
            transform: translateY(-1px);
        }

        .expand-chevron {
            transition: transform 0.2s ease;
        }

        .trace-expanded-content {
            display: none;
            margin-top: 1rem;
            border-top: 1px solid var(--border-glass);
            padding-top: 1rem;
        }

        .trace-card.expanded .trace-expanded-content {
            display: block;
            animation: slideDown 0.3s ease-out;
        }

        .trace-detail-section {
            margin-bottom: 1.5rem;
        }

        .trace-detail-label {
            display: block;
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            color: var(--accent-rose-gold);
            margin-bottom: 0.5rem;
            letter-spacing: 0.5px;
        }

        .trace-detail-content {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            padding: 1rem;
            font-size: 0.9rem;
            color: var(--text-primary);
            line-height: 1.5;
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        .trace-detail-content.reasoning {
            background: linear-gradient(135deg, var(--glass-secondary), var(--glass-tertiary));
            border-left: 3px solid var(--accent-rose-gold);
        }

        .trace-metadata {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1rem;
            padding-top: 0.75rem;
            border-top: 1px solid var(--border-glass);
            font-size: 0.8rem;
        }

        .trace-date {
            color: var(--text-secondary);
        }

        .trace-status {
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
        }

        .trace-status.validated {
            background: rgba(34, 197, 94, 0.2);
            color: #22c55e;
            border: 1px solid rgba(34, 197, 94, 0.3);
        }

        .trace-status.invalid {
            background: rgba(239, 68, 68, 0.2);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .trace-status.pending {
            background: rgba(251, 191, 36, 0.2);
            color: #fbbf24;
            border: 1px solid rgba(251, 191, 36, 0.3);
        }

        .trace-validation-section {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background: var(--glass-secondary);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            margin-top: 1rem;
        }

        .trace-validation-info {
            flex: 1;
        }

        .trace-validation-status {
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }

        .trace-validate-btn {
            background: linear-gradient(135deg, var(--accent-rose-gold), #d4af37);
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .trace-validate-btn:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
        }

        .trace-validate-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .trace-agent-badge {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
            font-size: 0.7rem;
            margin-left: 0.5rem;
        }

        .trace-expand-btn {
            background: var(--glass-secondary);
            border: 1px solid var(--border-glass);
            color: var(--text-primary);
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            font-size: 0.8rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
        }

        .trace-expand-btn:hover {
            background: var(--glass-tertiary);
            transform: translateY(-1px);
        }

        .trace-expand-icon {
            transition: transform 0.3s ease;
        }

        .trace-card.expanded .trace-expand-icon {
            transform: rotate(180deg);
        }

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

        .trace-empty-state {
            text-align: center;
            padding: 3rem 2rem;
            color: var(--text-secondary);
        }

        .trace-empty-state h3 {
            color: var(--text-primary);
            margin-bottom: 1rem;
        }

        .prompt-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 2000;
            padding: 2rem;
        }

        .prompt-modal-overlay.show {
            display: flex;
        }

        .prompt-modal-content {
            background: var(--glass-primary);
            backdrop-filter: var(--blur-glass);
            border: 1px solid var(--border-glass);
            border-radius: 20px;
            width: 100%;
            max-width: 1000px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: var(--shadow-deep);
        }

        .prompt-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1.5rem 2rem;
            border-bottom: 1px solid var(--border-glass);
            flex-shrink: 0;
        }

        .prompt-modal-title {
            font-size: 1.5rem;
            font-weight: 400;
            color: var(--text-primary);
        }

        .prompt-controls {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem 2rem;
            border-bottom: 1px solid var(--border-glass);
            flex-shrink: 0;
        }

        .prompt-filter input {
            flex: 1;
            padding: 0.5rem 1rem;
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            background: var(--glass-secondary);
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .prompt-filter input:focus {
            outline: none;
            border-color: var(--accent-electric);
        }

        .prompt-controls select {
            padding: 0.5rem;
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            background: var(--glass-secondary);
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .prompt-export-btn {
            padding: 0.5rem 1rem;
            background: var(--accent-electric);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s ease;
        }

        .prompt-export-btn:hover {
            background: var(--accent-purple);
        }

        .prompt-list {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 2rem;
        }

        .prompt-card {
            background: var(--glass-secondary);
            border: 1px solid var(--border-glass);
            border-radius: 12px;
            margin-bottom: 1rem;
            transition: all 0.3s ease;
        }

        .prompt-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-subtle);
        }

        .prompt-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem 1.5rem;
            cursor: pointer;
        }

        .prompt-id-badge {
            font-family: monospace;
            font-size: 0.8rem;
            background: var(--glass-tertiary);
            padding: 0.25rem 0.5rem;
            border-radius: 6px;
            color: var(--text-secondary);
        }

        .prompt-timestamp {
            font-size: 0.8rem;
            color: var(--text-tertiary);
        }

        .prompt-actions {
            display: flex;
            gap: 0.5rem;
        }

        .prompt-action-btn {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            border-radius: 6px;
            padding: 0.5rem;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .prompt-action-btn:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }

        .prompt-content {
            display: none;
            padding: 0 1.5rem 1.5rem;
            border-top: 1px solid var(--border-glass);
        }

        .prompt-card.expanded .prompt-content {
            display: block;
        }

        .prompt-input, .prompt-output {
            margin-bottom: 1rem;
        }

        .prompt-input strong, .prompt-output strong {
            display: block;
            font-size: 0.8rem;
            text-transform: uppercase;
            color: var(--accent-rose-gold);
            margin-bottom: 0.5rem;
        }

        .prompt-input div, .prompt-output div {
            background: var(--glass-tertiary);
            border: 1px solid var(--border-glass);
            border-radius: 8px;
            padding: 1rem;
            font-size: 0.9rem;
            color: var(--text-primary);
            white-space: pre-wrap;
            word-wrap: break-word;
        }

        @media (max-width: 768px) {
            .prompt-modal-overlay { padding: 1rem; }
            .prompt-modal-content { max-height: 90vh; }
            .prompt-modal-header, .prompt-controls, .prompt-list { padding-left: 1rem; padding-right: 1rem; }
            .prompt-controls { flex-direction: column; align-items: stretch; gap: 0.5rem; }
        }

        .trace-tags-section {
            margin: 1rem 0;
            padding: 1rem;
            background: var(--glass-tertiary);
            border-radius: 8px;
        }

        .trace-tags-display {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .trace-tag {
            background: var(--accent-electric);
            color: white;
            padding: 0.25rem 0.75rem;
            border-radius: 16px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .trace-tag:hover {
            background: var(--accent-purple);
        }

        .auto-tag-badge {
            background: var(--glass-secondary);
            color: var(--text-tertiary);
            padding: 0.125rem 0.5rem;
            border-radius: 8px;
                font-size: 0.7rem;
            margin-left: 0.5rem;
        }

        .add-tag-btn {
            background: var(--glass-secondary);
            border: 1px dashed var(--border-glass);
            color: var(--text-secondary);
            padding: 0.375rem 0.75rem;
            border-radius: 16px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .add-tag-btn:hover {
            background: var(--glass-hover);
            border-style: solid;
            border-color: var(--accent-electric);
            color: var(--text-primary);
        }

        .trace-domain {
            margin-top: 0.5rem;
            font-size: 0.8rem;
            color: var(--text-tertiary);
        }

        .domain-badge {
            background: var(--glass-secondary);
            padding: 0.25rem 0.5rem;
            border-radius: 8px;
            color: var(--text-primary);
            font-weight: 500;
        }

        .auto-tag-badge, .verified-badge {
            font-size: 0.7rem;
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            margin-left: 0.5rem;
            font-weight: 400;
            text-transform: none;
        }

        .auto-tag-badge {
            background-color: rgba(139, 92, 246, 0.15);
            color: var(--accent-electric);
        }

        .verified-badge {
            background-color: rgba(46, 164, 79, 0.15);
            color: #57ab5a;
        }

        .trace-tag, .trace-concept {
            padding: 0.35rem 0.75rem;
            border-radius: 16px;
            font-size: 0.8rem;
            font-weight: 400;
            transition: all 0.3s ease;
        }

        .trace-tag {
            background: var(--glass-secondary);
            color: var(--text-primary);
            border: 1px solid var(--border-glass);
            cursor: pointer;
        }

        .trace-tag:hover {
            border-color: var(--accent-electric);
            background: var(--glass-hover);
        }

        .trace-concept {
            background: transparent;
            color: var(--text-tertiary);
            border: 1px dashed var(--border-glass);
        }

        @font-face {
            font-family: 'Manrope';
            src: url('../assets/fonts/Manrope-VariableFont_wght.ttf') format('truetype');
            font-weight: 200 800;
            font-style: normal;
            font-display: swap;
        }

        .conversation-dropdown.active {
            z-index: 9998;
}
/* Usage counter */
.usage-counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 1rem;
    min-width: 100px;
}

#usageText {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.usage-bar {
    width: 80px;
    height: 4px;
    background: var(--glass-secondary);
    border-radius: 2px;
    overflow: hidden;
    border: 1px solid var(--border-glass);
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-electric) 0%, var(--accent-purple) 100%);
    transition: width 0.3s ease;
    border-radius: 1px;
}

.usage-fill.warning {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}

.usage-fill.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}

.model-dropdown {
    position: relative;
    margin-left: 1rem;
}

.model-menu {
    background: var(--glass-primary);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    overflow-y: auto;
    max-height: 350px;
    min-height: fit-content;
}

.model-menu-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-menu-item:hover {
    background: var(--glass-hover);
}

.model-menu-item.active {
    background: var(--glass-active);
    color: var(--accent-electric);
}

.model-menu-item.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.model-menu-item.disabled:hover {
    background: transparent !important;
}

#modelSelector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#modelSelector:hover {
    border-color: var(--accent-electric);
}

#modelSelector.open {
    border-color: var(--accent-electric);
    background: var(--glass-hover);
}

/* Add/update these CSS rules */
.model-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px); /* Center horizontally and initial animation offset */
    min-width: 200px;
    max-height: 400px;
    background: var(--glass-primary);
    backdrop-filter: var(--blur-glass);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.model-dropdown .dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0); /* Keep centered when active */
}

/* Add a class for when the dropdown should appear below */
.model-dropdown .dropdown-menu.dropdown-below {
    bottom: auto;
    top: calc(100% + 8px);
}

/* ============================================================================= */
/* ENHANCED REASONING DISPLAY SYSTEM */
/* ============================================================================= */

/* AI Reasoning Section */
.ai-reasoning {
    margin-bottom: 1rem;
    padding: 1.5rem;
    background: var(--glass-tertiary);
    backdrop-filter: var(--blur-subtle);
    border: 1px solid var(--border-burgundy);
    border-radius: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
    box-shadow: var(--shadow-subtle), 0 0 20px rgba(114, 47, 55, 0.15);
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ai-reasoning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(114, 47, 55, 0.05) 0%, rgba(107, 28, 62, 0.02) 100%);
    border-radius: 16px;
    pointer-events: none;
    z-index: 0;
}

.ai-reasoning:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-subtle), 0 0 25px rgba(114, 47, 55, 0.25);
}

/* Reasoning Header */
.reasoning-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
    position: relative;
    z-index: 1;
}

.reasoning-header h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-rose-gold);
    margin: 0;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.reasoning-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Thinking Indicator */
.thinking-indicator {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.thinking-dot {
    width: 0.3rem;
    height: 0.3rem;
    background: var(--accent-electric);
    border-radius: 50%;
    animation: thinkingPulse 1.4s ease-in-out infinite both;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

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

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

@keyframes thinkingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Reasoning Content */
.reasoning-content {
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.reasoning-step {
    margin-bottom: 0.75rem;
    padding: 0.75rem 0;
    border-left: 3px solid var(--accent-electric);
    padding-left: 1rem;
    color: var(--text-primary);
    animation: stepFadeIn 0.5s ease-out;
}

.reasoning-step:last-child {
    margin-bottom: 0;
}

@keyframes stepFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Streaming Animation */
.ai-reasoning.streaming .reasoning-content {
    min-height: 2rem;
}

.ai-reasoning.streaming .reasoning-header h4 {
    background: linear-gradient(90deg, var(--accent-rose-gold), var(--accent-electric), var(--accent-rose-gold));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmerText 2s linear infinite;
}

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

/* Trace References */
.trace-reference {
    color: var(--accent-electric);
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: monospace;
    font-size: 0.9em;
    padding: 0.1rem 0.2rem;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.trace-reference:hover {
    color: var(--accent-rose-gold);
    background: rgba(201, 169, 110, 0.1);
    border-color: rgba(201, 169, 110, 0.3);
    text-decoration: none;
}

/* Trace Tooltip */
.trace-tooltip {
    background: var(--glass-primary) !important;
    backdrop-filter: var(--blur-glass) !important;
    border: 1px solid var(--border-glass) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-deep) !important;
    color: var(--text-primary) !important;
    font-size: 0.85rem !important;
    max-width: 400px !important;
    z-index: 10000 !important;
}

.trace-tooltip-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-electric);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-glass);
    font-family: monospace;
}

.trace-tooltip-content {
    line-height: 1.5;
}

.trace-tooltip-content strong {
    color: var(--accent-rose-gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.trace-tooltip-content strong:first-child {
    margin-top: 0;
}

.trace-tooltip-content p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.tooltip-loading {
    color: var(--text-tertiary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
    animation: pulseOpacity 1.5s ease-in-out infinite;
}

@keyframes pulseOpacity {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* AI Response Section */
.ai-response {
    position: relative;
    padding: 1.5rem;
    background: var(--glass-primary);
    backdrop-filter: var(--blur-subtle);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
    white-space: pre-line;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    animation: responseSlideIn 0.5s ease-out;
}

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

.ai-response:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glass), 0 0 20px rgba(139, 92, 246, 0.1);
}

/* Trace Validation Section */
.trace-validation {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--glass-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-glass);
    animation: validationSlideIn 0.3s ease-out 0.5s both;
}

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

.trace-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trace-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    background: var(--glass-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
}

.trace-actions {
    display: flex;
    gap: 0.5rem;
}

.validate-btn, .view-trace-btn {
    background: var(--glass-primary);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.validate-btn:hover, .view-trace-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-subtle);
    border-color: var(--border-active);
}

.validate-btn.thumbs-up:hover {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    color: white;
}

.validate-btn.thumbs-down:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #ef4444;
    color: white;
}

.view-trace-btn:hover {
    background: var(--accent-electric);
    border-color: var(--accent-electric);
    color: white;
}

/* Message Files */
.message-files {
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.file-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.6rem;
    background: var(--glass-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.file-tag:hover {
    background: var(--glass-hover);
    border-color: var(--border-active);
}

.file-size {
    color: var(--text-tertiary);
    font-size: 0.7rem;
}

/* Enhanced message animations */
@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ai-reasoning, .ai-response {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .reasoning-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .trace-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .trace-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================================= */
/* COLLAPSIBLE TRACES SIDEBAR */
/* ============================================================================= */

/* Update existing traces-sidebar for collapsible functionality */
.traces-sidebar {
    transition: width 0.3s ease, opacity 0.3s ease;
    position: relative;
}

.traces-sidebar.collapsed {
    width: 60px !important;
}

/* Toggle Button */
.traces-toggle {
    position: absolute;
    top: 1rem;
    left: 0.5rem;
    width: 28px;
    height: 28px;
    background: var(--glass-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
    z-index: 10;
}

.traces-toggle:hover {
    background: var(--glass-light);
    color: var(--text-primary);
    border-color: var(--accent-electric);
}

.traces-sidebar.collapsed .traces-toggle span {
    transform: rotate(180deg);
}

/* Mini Stats (visible when collapsed) */
.traces-mini-stats {
    margin-top: 3.5rem;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: default;
    min-width: 40px;
}

.mini-stat:hover {
    background: var(--glass-light);
}

.mini-stat-icon {
    font-size: 16px;
    line-height: 1;
}

.mini-stat-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

/* Full Content (hidden when collapsed) */
.traces-full-content {
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 0.5rem;
    padding-top: 0.5rem;
}

.traces-sidebar.collapsed .traces-full-content {
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

.traces-sidebar.collapsed .traces-mini-stats {
    display: flex !important;
}

.traces-sidebar:not(.collapsed) .traces-mini-stats {
    display: none !important;
}

/* Smooth transitions for content */
.traces-sidebar * {
    transition: opacity 0.3s ease;
}

/* Tooltip for mini stats */
.mini-stat[title] {
    position: relative;
}

.mini-stat[title]:hover::after {
    content: attr(title);
    position: absolute;
    left: 120%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-dark);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid var(--border-glass);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mini-stat[title]:hover::before {
    content: '';
    position: absolute;
    left: 115%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--border-glass);
    z-index: 999;
}
