        /* ===== THEME UPDATE v2.3 - Sep 30 2025 - No Ghost Typing Indicator ===== */
        :root {
            --ff-primary: var(--brand-green);
            --ff-primary-dark: var(--brand-green);
            --ff-secondary: var(--brand-green-light);
            --ff-secondary-dark: var(--brand-green);
            --ff-accent: var(--brand-blue-dark);
            --ff-accent-dark: var(--brand-blue-dark);
        }

        .skip-link,
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .skip-link:focus {
            clip: auto;
            width: auto;
            height: auto;
            margin: 16px;
            padding: 12px 16px;
            z-index: 10001;
            background: var(--brand-white);
            color: var(--brand-navy);
            border-radius: 10px;
            box-shadow: var(--brand-shadow-soft);
            font-weight: 700;
            text-decoration: none;
        }
        
        /* Dark Theme (Default) - Ultra Dark Mode */
        [data-theme="dark"] {
            --theme-bg-primary: #0A0A0B;    /* Ultra Deep Black */
            --theme-bg-secondary: #0F0F11;  /* Very Dark Gray */
            --theme-surface: #1A1A1D;       /* Dark Surface */
            --theme-surface-light: #252529; /* Lighter Dark Surface */
            --theme-border: #333338;        /* Dark Border */
            --theme-text-primary: #F8FAFC;  /* Almost White */
            --theme-text-secondary: #E2E8F0; /* Light Gray - better contrast */
            --theme-text-muted: #CBD5E1;    /* Medium Gray - better contrast */
            --theme-chat-bg: linear-gradient(135deg, #0A0A0B 0%, #1A1A1D 50%, #252529 100%);
            --theme-message-bg: #1A1A1D;    /* Ultra Dark message background */
            --theme-assistant-bubble: #252529; /* Dark bubble for AI messages */
            --theme-input-bg: #252529;      /* Ultra Dark input background */
            --theme-input-border: #333338;  /* Ultra Dark input border */
        }

        /* Light Theme */
        [data-theme="light"] {
            --theme-bg-primary: #FFFFFF;     /* Pure White */
            --theme-bg-secondary: #F8FAFC;   /* Light Gray */
            --theme-surface: #F1F5F9;        /* Light Slate */
            --theme-surface-light: #E2E8F0;  /* Lighter Slate */
            --theme-border: #CBD5E1;         /* Light Border */
            --theme-text-primary: #0F172A;   /* Dark Navy */
            --theme-text-secondary: #475569; /* Medium Gray - better contrast */
            --theme-text-muted: #64748B;     /* Darker Gray - better contrast */
            --theme-chat-bg: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
            --theme-message-bg: #FFFFFF;
            --theme-assistant-bubble: #F1F5F9; /* Light bubble for AI messages */
            --theme-input-bg: #FFFFFF;
            --theme-input-border: #E2E8F0;
        }
        
        * {
            box-sizing: border-box;
        }
        
        body {
            font-family: 'Inter', sans-serif;
            background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 100%);
            margin: 0;
            padding: 0;
            height: var(--app-height, 100vh);
            overflow: hidden;
            color: var(--theme-text-primary);
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .app-container {
            display: flex;
            height: var(--app-height, 100vh);
            background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 100%);
            position: relative;
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .app-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="%23FFD23F" opacity="0.1"/></svg>') repeat;
            background-size: 50px 50px;
            pointer-events: none;
            z-index: 0;
        }
        
        .sidebar {
            width: 320px;
            background: linear-gradient(180deg, var(--theme-surface) 0%, var(--theme-bg-secondary) 100%);
            border-right: 2px solid var(--ff-primary);
            display: flex;
            flex-direction: column;
            padding: 24px 24px 24px 24px; /* Removed extra top padding */
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 4px 0 20px rgba(5, 150, 105, 0.15);
            position: relative;
            z-index: 1;
            overflow: hidden;
        }
        
        /* ChatGPT-Style Sidebar Hide/Show System */
        .sidebar.hidden,
        .sidebar-start-collapsed .sidebar {
            transform: translateX(-100%);
            width: 30px !important;
            min-width: 30px !important;
            flex: 0 0 30px !important;
            overflow: hidden !important;
            padding: 0 !important;
        }

        .sidebar.hidden > *,
        .sidebar-start-collapsed .sidebar > * {
            display: none !important;
        }

        .app-container.sidebar-hidden .chat-container,
        .sidebar-start-collapsed .chat-container {
            margin-left: 30px !important;
            width: calc(100% - 30px) !important;
            flex: 1 !important;
            max-width: calc(100% - 30px) !important;
        }
        
        .chat-container {
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            flex: 1;
            min-width: 0; /* Allows flex item to shrink below content size */
        }
        
        /* ChatGPT-Style Sidebar Hamburger Menu */
        .sidebar-hamburger {
            background: var(--theme-surface);
            border: 1px solid var(--theme-border);
            padding: 6px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            transition: all 0.2s ease;
            color: var(--theme-text-secondary);
            position: relative;
            z-index: 100;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
            margin-left: 8px;
            flex-shrink: 0;
        }
        
        .sidebar-hamburger:hover {
            background: var(--theme-surface-light);
            color: var(--theme-text-primary);
            transform: scale(1.05);
        }
        
        .sidebar-hamburger:focus {
            outline: none;
            box-shadow: 0 0 0 2px var(--ff-primary);
        }
        
        .sidebar-hamburger svg {
            width: 18px;
            height: 18px;
            stroke-width: 2;
        }
        
        /* Restore Button - Shows in collapsed sidebar area */
        .restore-sidebar-btn {
            position: fixed;
            top: 20px;
            left: 12px;
            background: var(--theme-surface);
            border: 1px solid var(--theme-border);
            padding: 6px;
            border-radius: 6px;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            transition: all 0.2s ease;
            color: var(--theme-text-secondary);
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        
        .app-container.sidebar-hidden .restore-sidebar-btn,
        .sidebar-start-collapsed .restore-sidebar-btn {
            display: flex;
        }
        
        .restore-sidebar-btn:hover {
            background: var(--theme-surface-light);
            color: var(--theme-text-primary);
            transform: scale(1.05);
        }
        
        .restore-sidebar-btn:focus {
            outline: none;
            box-shadow: 0 0 0 2px var(--ff-primary);
        }
        
        .restore-sidebar-btn svg {
            width: 18px;
            height: 18px;
            stroke-width: 2;
        }
        
        /* Mobile adjustments */
        @media (max-width: 768px) {
            .sidebar-hamburger {
                display: flex !important;
            }
            
            .restore-sidebar-btn {
                position: fixed;
                top: 16px;
                left: 16px;
                z-index: 1001;
                width: 32px;
                height: 32px;
                padding: 8px;
            }
            
            .restore-sidebar-btn svg {
                width: 16px;
                height: 16px;
            }
        }
        
        .sidebar::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 2px;
            height: 100%;
            background: linear-gradient(180deg, var(--ff-secondary) 0%, var(--ff-primary) 50%, var(--ff-secondary) 100%);
        }
        
        .sidebar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 32px;
            padding: 0;
            background: transparent;
            border-radius: 0;
            box-shadow: none;
            position: relative;
            overflow: visible;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            text-decoration: none;
            z-index: 10;
            color: var(--theme-text-primary);
            border: none;
            width: 100%;
            max-width: 100%;
        }
        
        /* Simplified header - no card styling */
        .sidebar-header-content {
            display: flex;
            align-items: center;
            gap: 18px;
            flex: 1;
            min-width: 0;
        }
        
        /* Removed shimmer effect for cleaner, static design */
        
        .sidebar-logo {
            width: 54px;
            height: 54px;
            background: transparent;
            border-radius: 0;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: none;
            position: relative;
            flex-shrink: 0;
        }
        
        .sidebar-logo::before {
            display: none;
        }
        
        .sidebar-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            display: block;
            filter: none;
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-6px); }
        }
        
        .sidebar-title {
            font-size: 24px;
            font-weight: 900;
            letter-spacing: -0.02em;
            line-height: 1;
            background: linear-gradient(135deg, 
                #059669 0%, 
                #10B981 25%, 
                #3B82F6 50%, 
                #8B5CF6 75%, 
                #EC4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-fill-color: transparent;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
            position: relative;
        }
        
        /* Enhanced gradient for light mode - darker, more visible colors */
        [data-theme="light"] .sidebar-title {
            background: linear-gradient(135deg, 
                #047857 0%, 
                #059669 20%, 
                #1D4ED8 50%, 
                #7C3AED 80%, 
                #BE185D 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
        }
        
        .sidebar-subtitle {
            font-size: 13px;
            color: var(--theme-text-secondary);
            margin-top: 6px;
            font-weight: 600;
            letter-spacing: 0.01em;
            opacity: 0.8;
        }
        
        /* Conversation History Section */
        .history-section {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        
        .history-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 8px;
        }
        
        .history-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--theme-text-primary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .new-chat-btn {
            background: linear-gradient(135deg, var(--ff-secondary) 0%, var(--ff-primary) 100%);
            color: white;
            border: none;
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 6px;
            box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
        }
        
        .new-chat-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
        }
        
        /* Search Bar */
        .history-search {
            position: relative;
            margin: 0 8px;
        }
        
        .search-input {
            width: 100%;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 10px;
            padding: 12px 40px 12px 16px;
            font-size: 14px;
            color: var(--theme-text-primary);
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }
        
        .search-input:focus {
            outline: none;
            background: rgba(255, 255, 255, 0.08);
            border-color: var(--ff-primary);
            box-shadow: 0 0 0 3px rgba(13, 124, 102, 0.2);
        }
        
        .search-input::placeholder {
            color: var(--theme-text-muted);
        }
        
        .search-icon {
            position: absolute;
            right: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--theme-text-muted);
            pointer-events: none;
        }
        
        /* Conversation List */
        .conversation-list {
            flex: 1;
            overflow-y: auto;
            padding: 0 8px;
        }
        
        .conversation-list::-webkit-scrollbar {
            width: 4px;
        }
        
        .conversation-list::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .conversation-list::-webkit-scrollbar-thumb {
            background: var(--ff-primary);
            border-radius: 2px;
        }
        
        /* Date Groups */
        .date-group {
            margin-bottom: 20px;
        }
        
        .date-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--theme-text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
            padding: 0 8px;
        }
        
        /* Conversation Items */
        .conversation-item {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(71, 85, 105, 0.3);
            border-radius: 10px;
            padding: 12px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            width: 100%;
            text-align: left;
            font: inherit;
            color: inherit;
            appearance: none;
        }
        
        .conversation-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
            background: transparent;
            transition: background 0.3s ease;
        }
        
        .conversation-item:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: var(--ff-primary);
            transform: translateX(4px);
        }
        
        .conversation-item:hover::before {
            background: var(--ff-primary);
        }
        
        .conversation-item.active {
            background: rgba(13, 124, 102, 0.15);
            border-color: var(--ff-primary);
        }
        
        .conversation-item.active::before {
            background: var(--ff-secondary);
        }
        
        .conversation-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--theme-text-primary);
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .conversation-preview {
            font-size: 11px;
            color: var(--theme-text-secondary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            margin-bottom: 4px;
        }
        
        .conversation-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 10px;
            color: var(--theme-text-muted);
        }
        
        .conversation-time {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .conversation-messages {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        /* Empty State */
        .empty-history {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 48px 24px;
            text-align: center;
        }
        
        .empty-icon {
            font-size: 48px;
            margin-bottom: 16px;
            opacity: 0.5;
        }
        
        .empty-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--theme-text-primary);
            margin-bottom: 8px;
        }
        
        .empty-subtitle {
            font-size: 12px;
            color: var(--theme-text-secondary);
        }
        
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--theme-chat-bg);
            position: relative;
            z-index: 1;
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .chat-header {
            background: var(--theme-message-bg);
            border-bottom: 1px solid var(--theme-border);
            padding: 20px 32px;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 20px;
            position: relative;
            z-index: 10;
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        all 0.3s ease;
        }

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

        /* Sports Dropdown Styles */
        .sports-selector {
            display: flex;
            justify-content: center;
            align-items: center;
        }

        .sports-dropdown {
            position: relative;
            min-width: 200px;
            z-index: 1000;
        }

        .sports-dropdown-toggle {
            background: linear-gradient(135deg, #3B82F6, #8B5CF6);
            color: white;
            border: none;
            border-radius: 12px;
            padding: 10px 20px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            transition: all 0.3s ease;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
        }

        .sports-dropdown-toggle:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
            background: linear-gradient(135deg, #2563EB, #7C3AED);
        }

        .sport-icon {
            font-size: 20px;
            margin-right: 4px;
        }

        .dropdown-arrow {
            transition: transform 0.3s ease;
            font-size: 12px;
        }

        .sports-dropdown.active .dropdown-arrow {
            transform: rotate(180deg);
        }

        .sports-dropdown.single-sport .sports-dropdown-toggle {
            cursor: default;
            pointer-events: none;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.22);
        }

        .sports-dropdown.single-sport .sports-dropdown-toggle:hover {
            transform: none;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.22);
            background: linear-gradient(135deg, #3B82F6, #8B5CF6);
        }

        .sports-dropdown.single-sport .dropdown-arrow,
        .sports-dropdown.single-sport .sports-dropdown-menu {
            display: none;
        }

        .sports-dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 12px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            z-index: 9999;
            min-width: 100%;
            overflow: hidden;
        }

        .sports-dropdown.active .sports-dropdown-menu {
            opacity: 1;
            visibility: visible;
        }

        .sport-option {
            padding: 12px 20px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 12px;
            transition: all 0.2s ease;
            border-bottom: 1px solid var(--theme-border);
            font-weight: 500;
            color: var(--theme-text);
        }

        .sport-option:last-child {
            border-bottom: none;
        }

        .sport-option:hover {
            background: var(--theme-hover-bg);
            padding-left: 24px;
        }

        .sport-option.active {
            background: linear-gradient(135deg, #3B82F6, #8B5CF6);
            color: white;
        }

        .sport-option .sport-name {
            flex: 1;
        }

        .sport-option .sport-tag {
            font-size: 11px;
            padding: 2px 6px;
            border-radius: 4px;
            background: rgba(59, 130, 246, 0.1);
            color: #3B82F6;
            font-weight: 600;
        }

        .sport-option.active .sport-tag {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        /* Disabled Sport Options */
        .sport-option-disabled {
            cursor: not-allowed !important;
            opacity: 0.6;
            background: rgba(128, 128, 128, 0.1) !important;
        }

        .sport-option-disabled:hover {
            background: rgba(128, 128, 128, 0.1) !important;
            padding-left: 20px !important;
            transform: none !important;
        }

        .coming-soon {
            font-size: 10px !important;
            padding: 2px 6px !important;
            border-radius: 4px !important;
            background: rgba(251, 146, 60, 0.2) !important;
            color: #f59e0b !important;
            font-weight: 600 !important;
            font-style: italic;
        }

        /* Responsive design for sports dropdown */
        @media (max-width: 768px) {
            .sports-selector {
                display: none;
            }

            .sports-dropdown {
                width: 100%;
                min-width: unset;
            }

            .sports-dropdown-toggle {
                padding: 8px 16px;
                font-size: 15px;
            }

            .sport-icon {
                font-size: 18px;
            }

            .sports-dropdown-menu {
                width: calc(100% + 30px);
                left: -15px;
                transform: none;
                border-radius: 0 0 12px 12px;
            }
        }


        .chat-title {
            font-size: 28px;
            font-weight: 900;
            background: linear-gradient(135deg, #047857 0%, #059669 30%, #2563EB 70%, #7C3AED 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            display: flex;
            align-items: center;
            gap: 12px;
            position: relative;
            z-index: 1;
            letter-spacing: -0.5px;
            text-shadow: none;
        }
        
        .chat-title::before {
            content: '';
            font-size: 22px;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
            margin-right: 4px;
        }
        
        /* Header Controls */
        .header-controls {
            display: flex;
            align-items: center;
            gap: 16px;
            justify-content: flex-end;
        }
        
        /* Online Status */
        .online-status {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(13, 124, 102, 0.15) 100%);
            border-radius: 20px;
            border: 1px solid rgba(16, 185, 129, 0.25);
            font-size: 12px;
            font-weight: 600;
            color: var(--theme-text-primary);
            backdrop-filter: blur(15px);
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            position: relative;
            z-index: 1;
            box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
        }
        
        .status-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            transition: all 0.3s ease;
            position: relative;
        }
        
        .status-dot.online {
            background: #059669;
            box-shadow: 0 0 8px rgba(5, 150, 105, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.3);
        }
        
        .status-dot.offline {
            background: #EF4444;
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
        }
        
        .status-dot.checking {
            background: #F59E0B;
            animation: statusPulse 2s infinite;
            box-shadow: 0 0 8px rgba(245, 158, 11, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
        }
        
        @keyframes statusPulse {
            0%, 100% {
                opacity: 1;
                transform: scale(1);
                box-shadow: 0 0 8px rgba(245, 158, 11, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
            }
            50% {
                opacity: 0.7;
                transform: scale(1.1);
                box-shadow: 0 0 12px rgba(245, 158, 11, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.3);
            }
        }
        
        /* Theme Toggle */
        .theme-toggle {
            position: relative;
            width: 56px;
            height: 28px;
            background: linear-gradient(135deg, var(--theme-surface) 0%, var(--theme-surface-light) 100%);
            border: 1px solid var(--theme-border);
            border-radius: 14px;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            padding: 3px;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
        }

        .theme-toggle:hover {
            border-color: var(--ff-primary);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(13, 124, 102, 0.1);
            transform: scale(1.02);
        }

        .theme-toggle-thumb {
            width: 22px;
            height: 22px;
            background: linear-gradient(135deg, var(--ff-primary) 0%, var(--ff-secondary) 100%);
            border-radius: 50%;
            transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                        background 0.4s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.3);
        }

        .theme-toggle-thumb svg {
            transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .theme-toggle:active .theme-toggle-thumb svg {
            transform: rotate(25deg) scale(0.85);
        }

        .theme-toggle[data-theme="light"] .theme-toggle-thumb {
            transform: translateX(28px);
            background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
        }

        .theme-toggle[data-theme="dark"] .theme-toggle-thumb {
            transform: translateX(0);
        }
        
        .home-button {
            background: linear-gradient(135deg, var(--ff-secondary) 0%, var(--ff-secondary-dark) 100%);
            color: white;
            border: none;
            border-radius: 12px;
            padding: 12px 20px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
            position: relative;
            overflow: hidden;
        }
        
        .home-button::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 ease;
        }
        
        .home-button:hover {
            background: linear-gradient(135deg, var(--ff-secondary-dark) 0%, var(--ff-secondary) 100%);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
        }
        
        .home-button:hover::before {
            left: 100%;
        }
        
        /* Auth Buttons */
        .auth-button {
            background: linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
            color: white;
            border: none;
            border-radius: 12px;
            padding: 10px 18px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 8px;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25), 0 2px 4px rgba(0, 0, 0, 0.05);
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .auth-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
            transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .auth-button:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35), 0 4px 8px rgba(0, 0, 0, 0.1);
            background: linear-gradient(135deg, #4F46E5 0%, #3B82F6 50%, #2563EB 100%);
        }
        
        .auth-button:hover::before {
            left: 100%;
        }
        
        .auth-button:active {
            transform: translateY(-1px);
            transition: all 0.1s ease;
        }
        
        .signup-button {
            background: linear-gradient(135deg, #059669 0%, #047857 50%, #065F46 100%);
            box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25), 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        .signup-button:hover {
            background: linear-gradient(135deg, #10B981 0%, #059669 50%, #047857 100%);
            box-shadow: 0 8px 20px rgba(5, 150, 105, 0.35), 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        
        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 24px 32px;
            display: flex;
            flex-direction: column;
            gap: 0;
            background: var(--theme-chat-bg);
            scroll-behavior: smooth;
        }
        
        /* Container for centered conversation */
        .conversation-container {
            max-width: 800px;
            margin: 0 auto;
            width: 100%;
            padding: 0 60px; /* Extra padding to avoid model selector overlap */
        }
        
        @media (max-width: 768px) {
            .conversation-container {
                padding: 0 20px;
                max-width: 100%;
            }
        }
        
        .chat-messages::-webkit-scrollbar {
            width: 6px;
        }
        
        .chat-messages::-webkit-scrollbar-track {
            background: transparent;
            border-radius: 3px;
        }
        
        .chat-messages::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 3px;
            transition: background 0.2s ease;
        }
        
        .chat-messages::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }
        
        .message {
            display: flex;
            gap: 16px;
            max-width: 100%;
            margin-bottom: 24px;
            animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }
        
        @keyframes messageSlideIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .message.user {
            align-self: flex-end;
            flex-direction: row-reverse;
            max-width: 80%;
        }
        
        .message.assistant {
            align-self: flex-start;
            max-width: 85%;
        }
        
        .message-avatar {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 500;
            font-size: 12px;
            flex-shrink: 0;
            margin-top: 4px;
            transition: all 0.2s ease;
        }
        
        .message.user .message-avatar {
            background: var(--ff-secondary);
            color: white;
            box-shadow: none;
        }
        
        .message.assistant .message-avatar {
            background: var(--ff-primary);
            color: white;
            box-shadow: none;
        }
        
        .message-content {
            background: transparent;
            padding: 16px 0;
            border-radius: 0;
            box-shadow: none;
            line-height: 1.7;
            color: var(--theme-text-primary);
            border: none;
            position: relative;
            font-size: 15px;
            word-wrap: break-word;
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .message.user .message-content {
            background: var(--ff-secondary);
            color: white;
            border: none;
            box-shadow: none;
            border-radius: 18px;
            padding: 12px 16px;
        }

        .message.assistant .message-content {
            background: var(--theme-assistant-bubble);
            color: var(--theme-text-primary);
            padding: 16px;
            border-radius: 18px;
            border: 1px solid var(--theme-border);
        }

        .message.error .message-content {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            color: #ef4444;
            padding: 12px 16px;
            border-radius: 18px;
        }

        .error-icon {
            font-size: 20px;
            margin-bottom: 8px;
        }

        .chat-input-container {
            padding: 20px 24px;
            background: var(--theme-message-bg);
            border-top: 1px solid var(--theme-border);
            position: relative;
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .chat-context-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            max-width: 768px;
            margin: 0 auto 12px;
            flex-wrap: wrap;
        }

        .chat-context-controls {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .chat-context-control {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            border-radius: 14px;
            border: 1px solid var(--theme-border);
            background: rgba(148, 163, 184, 0.08);
            min-height: 42px;
        }

        .chat-context-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--theme-text-muted);
            white-space: nowrap;
        }

        .chat-context-select {
            border: none;
            outline: none;
            background: transparent;
            color: var(--theme-text-primary);
            font-size: 13px;
            font-weight: 600;
            padding-right: 6px;
            cursor: pointer;
        }

        .chat-context-select option {
            color: #0f172a;
        }

        .data-freshness-pill {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            min-height: 42px;
            padding: 10px 14px;
            border-radius: 999px;
            border: 1px solid var(--theme-border);
            background: rgba(16, 185, 129, 0.08);
            color: var(--theme-text-secondary);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.2;
        }

        .data-freshness-dot {
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: #10b981;
            box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.14);
            flex-shrink: 0;
        }

        .data-freshness-pill.is-warning,
        .data-freshness-pill.is-stale {
            background: rgba(245, 158, 11, 0.1);
        }

        .data-freshness-pill.is-warning .data-freshness-dot,
        .data-freshness-pill.is-stale .data-freshness-dot {
            background: #f59e0b;
            box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.14);
        }

        .data-freshness-pill.is-critical {
            background: rgba(239, 68, 68, 0.1);
        }

        .data-freshness-pill.is-critical .data-freshness-dot {
            background: #ef4444;
            box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
        }

        .chat-input-wrapper {
            display: flex;
            gap: 8px;
            align-items: flex-end;
            background: var(--theme-input-bg);
            border-radius: 24px;
            padding: 12px 16px;
            border: 1px solid var(--theme-input-border);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            max-width: 768px;
            margin: 0 auto;
        }
        
        .chat-input-wrapper:focus-within {
            border-color: #10b981;
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
            transform: translateY(-1px);
        }
        
        .chat-input {
            flex: 1;
            border: none;
            outline: none;
            resize: none;
            font-size: 16px;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            line-height: 1.5;
            max-height: 200px;
            min-height: 24px;
            background: transparent;
            color: var(--theme-text-primary);
            font-weight: 400;
            transition: color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .chat-input::placeholder {
            color: var(--theme-text-muted);
            font-weight: 400;
            transition: color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .send-button {
            background: #10b981;
            color: white;
            border: none;
            border-radius: 50%;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
            flex-shrink: 0;
            position: relative;
            overflow: hidden;
        }
        
        .send-button:hover:not(:disabled) {
            background: #059669;
            transform: scale(1.05);
        }
        
        .send-button:active:not(:disabled) {
            transform: scale(0.95);
        }
        
        .send-button:disabled {
            opacity: 0.4;
            cursor: not-allowed;
            background: #d1d5db;
            transform: none;
        }
        
        .send-button svg {
            width: 16px;
            height: 16px;
        }
        
        /* Additional dark mode improvements */
        [data-theme="dark"] .chat-input-wrapper {
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }
        
        [data-theme="dark"] .message-content {
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
        }
        
        [data-theme="dark"] .example-prompt {
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }
        
        [data-theme="dark"] .example-prompt:hover {
            box-shadow: 0 4px 16px rgba(13, 124, 102, 0.2);
        }
        
        /* Enhanced focus states */
        .example-prompt:focus {
            outline: 2px solid var(--ff-primary);
            outline-offset: 2px;
        }
        
        .sidebar-button:focus {
            outline: 2px solid var(--ff-primary);
            outline-offset: 2px;
        }
        
        /* Smooth transitions for all interactive elements */
        * {
            transition-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }
        
        /* Theme-specific text gradients */
        [data-theme="light"] .chat-title {
            background: linear-gradient(135deg, #0D7C66 0%, #10B981 25%, #3B82F6 60%, #8B5CF6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        [data-theme="dark"] .chat-title {
            background: linear-gradient(135deg, #059669 0%, #3B82F6 30%, #8B5CF6 70%, #EC4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        /* Animated gradient effect */
        @keyframes gradientShift {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }
        
        .chat-title {
            background-size: 200% 200%;
            animation: gradientShift 6s ease-in-out infinite;
        }
        
        /* Hover effect for text */
        .chat-title:hover {
            transform: scale(1.02);
            animation-duration: 3s;
        }
        
        /* Light mode header element fixes for better visibility */
        [data-theme="light"] .online-status {
            background: rgba(13, 124, 102, 0.08);
            border: 1px solid rgba(13, 124, 102, 0.15);
            color: #0F172A;
        }
        
        [data-theme="light"] .theme-toggle {
            background: #F1F5F9;
            border: 1px solid #CBD5E1;
        }
        
        [data-theme="light"] .theme-toggle-thumb {
            background: linear-gradient(135deg, #047857 0%, #059669 100%);
            color: white;
        }
        
        [data-theme="light"] .auth-button {
            background: linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1E40AF 100%);
            color: white;
            border: 1px solid rgba(59, 130, 246, 0.2);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        [data-theme="light"] .auth-button:hover {
            background: linear-gradient(135deg, #4F46E5 0%, #3B82F6 50%, #2563EB 100%);
            box-shadow: 0 8px 20px rgba(59, 130, 246, 0.25), 0 4px 8px rgba(0, 0, 0, 0.1);
            transform: translateY(-3px);
        }
        
        [data-theme="light"] .signup-button {
            background: linear-gradient(135deg, #059669 0%, #047857 50%, #065F46 100%);
            box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15), 0 2px 4px rgba(0, 0, 0, 0.05);
        }
        
        [data-theme="light"] .signup-button:hover {
            background: linear-gradient(135deg, #10B981 0%, #059669 50%, #047857 100%);
            box-shadow: 0 8px 20px rgba(5, 150, 105, 0.25), 0 4px 8px rgba(0, 0, 0, 0.1);
        }
        
        
        
        .welcome-screen {
            text-align: center;
            padding: 20px 32px 20px;
            color: var(--theme-text-primary);
            max-width: 720px;
            margin: 0 auto;
            position: relative;
        }

        .welcome-help-anchor {
            position: absolute;
            top: 28px;
            right: 32px;
            z-index: 20;
        }

        .welcome-icon {
            font-size: 48px;
            margin-bottom: 16px;
            display: inline-block;
        }

        /* Help tooltip in welcome screen */
        .welcome-help-btn {
            position: relative;
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 1.5px solid var(--theme-border);
            background: var(--theme-message-bg);
            color: var(--theme-text-secondary);
            font-size: 14px;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
            z-index: 5;
        }
        .welcome-help-btn:hover,
        .welcome-help-btn:focus {
            border-color: var(--ff-primary) !important;
            color: #fff !important;
            background: var(--ff-primary) !important;
            box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18) !important;
            outline: none !important;
        }
        .welcome-help-nudge {
            display: none;
            width: 220px;
            padding: 12px 14px;
            background: linear-gradient(155deg, rgba(4, 120, 87, 0.14), rgba(4, 120, 87, 0.05));
            border: 1px solid rgba(4, 120, 87, 0.22);
            border-radius: 14px;
            text-align: left;
            box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
            position: absolute;
            top: -8px;
            left: calc(100% + 12px);
            z-index: 30;
            animation: helpFadeIn 0.2s ease-out;
        }
        .welcome-help-nudge.show { display: block; }
        .welcome-help-nudge::after {
            content: "";
            position: absolute;
            top: 15px;
            left: -8px;
            width: 14px;
            height: 14px;
            background: rgba(4, 120, 87, 0.12);
            border-left: 1px solid rgba(4, 120, 87, 0.22);
            border-bottom: 1px solid rgba(4, 120, 87, 0.22);
            transform: rotate(45deg);
        }
        .welcome-help-nudge-close {
            position: absolute;
            top: 8px;
            right: 8px;
            width: 24px;
            height: 24px;
            border: none;
            background: transparent;
            color: var(--theme-text-secondary);
            cursor: pointer;
            border-radius: 999px;
            font-size: 18px;
            line-height: 1;
        }
        .welcome-help-nudge-close:hover,
        .welcome-help-nudge-close:focus {
            background: rgba(255, 255, 255, 0.08);
            color: var(--theme-text-primary);
            outline: none;
        }
        .help-nudge-cta {
            border: none;
            background: none;
            color: var(--theme-text-primary);
            font-size: 15px;
            font-weight: 800;
            line-height: 1.35;
            padding: 0;
            cursor: pointer;
            text-align: left;
        }
        .help-nudge-cta:hover,
        .help-nudge-cta:focus {
            color: var(--ff-primary);
            outline: none;
        }
        .welcome-help-popover {
            display: none;
            position: absolute;
            top: -24px;
            right: 0;
            left: auto;
            width: min(820px, calc(100vw - 48px));
            max-height: none;
            overflow: visible;
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 16px;
            padding: 22px;
            text-align: left;
            box-shadow: 0 12px 48px rgba(0,0,0,0.22), 0 0 0 1px rgba(4, 120, 87, 0.08);
            z-index: 50;
            animation: helpFadeIn 0.2s ease-out;
        }
        .welcome-help-popover.show { display: block; }
        @keyframes helpFadeIn {
            from { opacity: 0; transform: translateY(-8px) scale(0.98); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .help-popover-title {
            font-size: 20px;
            font-weight: 800;
            color: var(--theme-text-primary);
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .help-popover-subtitle {
            font-size: 13px;
            color: var(--theme-text-secondary);
            margin-bottom: 14px;
            line-height: 1.5;
        }
        .help-tabs {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 14px;
        }
        .help-tab-btn {
            border: 1px solid rgba(4, 120, 87, 0.14);
            background: rgba(4, 120, 87, 0.04);
            color: var(--theme-text-secondary);
            border-radius: 999px;
            padding: 8px 12px;
            font-size: 12px;
            font-weight: 700;
            line-height: 1;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .help-tab-btn:hover,
        .help-tab-btn:focus {
            border-color: rgba(4, 120, 87, 0.3);
            color: var(--theme-text-primary);
            outline: none;
        }
        .help-tab-btn.is-active {
            background: var(--ff-primary);
            border-color: var(--ff-primary);
            color: #fff;
            box-shadow: 0 8px 20px rgba(4, 120, 87, 0.22);
        }
        .help-tab-panel {
            display: none;
        }
        .help-tab-panel.is-active {
            display: block;
        }
        .help-intro-card {
            margin-bottom: 14px;
            padding: 14px 16px;
            border-radius: 14px;
            background:
                radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), transparent 34%),
                linear-gradient(160deg, rgba(4, 120, 87, 0.12), rgba(4, 120, 87, 0.03));
            border: 1px solid rgba(4, 120, 87, 0.14);
        }
        .help-intro-eyebrow {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--ff-primary);
            margin-bottom: 8px;
        }
        .help-intro-title {
            font-size: 17px;
            font-weight: 800;
            line-height: 1.35;
            color: var(--theme-text-primary);
            margin-bottom: 6px;
        }
        .help-intro-copy {
            font-size: 12px;
            line-height: 1.55;
            color: var(--theme-text-secondary);
        }
        .help-popover-body {
            font-size: 13px;
            line-height: 1.7;
            color: var(--theme-text-secondary);
            min-height: 372px;
        }
        .help-popover-body strong { color: var(--theme-text-primary); }
        .help-popover-section {
            margin-top: 14px;
            padding-top: 14px;
            border-top: 1px solid var(--theme-border);
        }
        .help-section-heading {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 700;
            color: var(--theme-text-primary);
            margin-bottom: 8px;
        }
        .help-section-heading svg {
            flex-shrink: 0;
            color: var(--ff-primary);
        }
        .help-feature-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-top: 10px;
        }
        .help-feature-item {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 8px 10px;
            background: rgba(4, 120, 87, 0.04);
            border-radius: 8px;
            font-size: 12px;
            line-height: 1.4;
            color: var(--theme-text-secondary);
        }
        .help-feature-item .hf-icon {
            flex-shrink: 0;
            width: 18px;
            height: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            margin-top: 1px;
        }
        .help-feature-item strong {
            color: var(--theme-text-primary);
            font-weight: 600;
        }
        .help-diagram {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 12px;
            margin-top: 10px;
        }
        .help-diagram-step {
            position: relative;
            min-height: 138px;
            padding: 12px;
            border-radius: 12px;
            background: rgba(4, 120, 87, 0.05);
            border: 1px solid rgba(4, 120, 87, 0.12);
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .help-diagram-step:not(:last-child)::after {
            content: "→";
            position: absolute;
            top: 50%;
            right: -17px;
            transform: translateY(-50%);
            color: var(--ff-primary);
            font-weight: 700;
            font-size: 18px;
        }
        .help-step-label {
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            color: var(--ff-primary);
        }
        .help-diagram-step strong {
            display: block;
            color: var(--theme-text-primary);
            line-height: 1.45;
        }
        .help-diagram-step span {
            font-size: 12px;
            line-height: 1.55;
            color: var(--theme-text-secondary);
        }
        .help-compact-list,
        .help-example-list {
            display: grid;
            gap: 10px;
            margin-top: 10px;
        }
        .help-example-item,
        .help-tip-box {
            padding: 12px 14px;
            border-radius: 12px;
            border: 1px solid rgba(4, 120, 87, 0.12);
            background: rgba(4, 120, 87, 0.045);
        }
        .help-example-list {
            grid-template-columns: 1fr 1fr;
        }
        .help-example-item code {
            white-space: normal;
            word-break: break-word;
        }
        .help-tip-box {
            margin-top: 10px;
        }
        .help-plan-tier {
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--ff-primary);
            margin-bottom: 6px;
        }
        .help-plan-copy {
            font-size: 12px;
            line-height: 1.6;
            color: var(--theme-text-secondary);
        }
        .help-tier-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 10px;
            font-size: 12px;
        }
        .help-tier-table th {
            text-align: left;
            padding: 6px 8px;
            font-weight: 700;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: var(--theme-text-secondary);
            border-bottom: 1px solid var(--theme-border);
        }
        .help-tier-table td {
            padding: 5px 8px;
            color: var(--theme-text-secondary);
            border-bottom: 1px solid rgba(0,0,0,0.04);
        }
        .help-tier-table tr:last-child td { border-bottom: none; }
        .help-tier-table .tier-name {
            font-weight: 600;
            color: var(--theme-text-primary);
        }
        .help-tier-check {
            color: var(--ff-primary);
            font-weight: 700;
        }
        .help-tier-dash {
            color: var(--theme-text-secondary);
            opacity: 0.35;
        }
        .help-code {
            background: rgba(16,185,129,0.1);
            color: #10b981;
            padding: 1px 6px;
            border-radius: 4px;
            font-size: 12px;
            font-family: 'SF Mono', 'Fira Code', monospace;
        }
        .help-popover-brand {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 18px;
            padding: 12px 14px;
            background: rgba(4, 120, 87, 0.06);
            border-radius: 10px;
            border: 1px solid rgba(4, 120, 87, 0.12);
        }
        .help-popover-brand a {
            color: var(--ff-primary);
            text-decoration: none;
            font-weight: 600;
            font-size: 13px;
        }
        .help-popover-brand a:hover { text-decoration: underline; }
        .help-popover-brand-text {
            font-size: 11px;
            color: var(--theme-text-secondary);
            line-height: 1.4;
        }
        .help-two-col {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
        }
        .help-two-col-tight {
            align-items: start;
            gap: 16px;
        }
        .help-col {
            min-width: 0;
        }

        .example-prompts {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: 14px;
        }

        .example-prompt {
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 12px;
            padding: 14px 16px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            text-align: left;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .example-prompt:hover {
            border-color: var(--ff-primary);
            transform: translateY(-1px);
            box-shadow: 0 4px 16px rgba(13, 124, 102, 0.15);
        }

        /* Command hints on welcome screen */
        .command-hints {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 8px;
            text-align: left;
        }
        .command-section-label {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 4px;
            margin-bottom: 0;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }
        .command-section-label::after {
            content: '';
            flex: 1;
            height: 1px;
            background: var(--theme-border);
        }
        .command-section-label.free-label {
            color: #10b981;
        }
        .command-section-label.pro-label {
            color: #3b82f6;
        }
        .command-hint {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .command-hint:hover {
            border-color: #10b981;
            background: var(--theme-hover-bg, rgba(16, 185, 129, 0.05));
            transform: translateY(-1px);
        }
        .command-hint.pro-hint {
            opacity: 0.65;
            border-style: dashed;
        }
        .command-hint.pro-hint:hover {
            border-color: #3b82f6;
            background: rgba(59, 130, 246, 0.05);
            opacity: 1;
        }
        .command-hint:active { transform: translateY(0); }
        .command-name {
            font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
            font-size: 12px;
            font-weight: 600;
            color: #10b981;
            background: rgba(16, 185, 129, 0.1);
            padding: 3px 7px;
            border-radius: 5px;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .command-hint.pro-hint .command-name {
            color: #3b82f6;
            background: rgba(59, 130, 246, 0.1);
        }
        .command-desc {
            font-size: 12px;
            color: var(--theme-text-secondary);
            line-height: 1.3;
            flex: 1;
        }
        .pro-badge {
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.05em;
            color: #3b82f6;
            background: rgba(59, 130, 246, 0.12);
            padding: 2px 6px;
            border-radius: 4px;
            flex-shrink: 0;
            text-transform: uppercase;
        }
        /* Pro toggle — native <details>/<summary>, no JS needed */
        .pro-toggle-details {
            grid-column: 1 / -1;
        }
        .pro-toggle-details > summary {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 14px;
            margin-top: 2px;
            background: rgba(59, 130, 246, 0.04);
            border: 1px dashed rgba(59, 130, 246, 0.2);
            border-radius: 10px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            color: #3b82f6;
            transition: all 0.2s ease;
            user-select: none;
            list-style: none;
        }
        .pro-toggle-details > summary::-webkit-details-marker { display: none; }
        .pro-toggle-details > summary::marker { display: none; content: ''; }
        .pro-toggle-details > summary:hover {
            background: rgba(59, 130, 246, 0.08);
            border-color: rgba(59, 130, 246, 0.35);
        }
        .pro-toggle-arrow {
            display: inline-block;
            font-size: 10px;
            transition: transform 0.2s ease;
        }
        .pro-toggle-details[open] .pro-toggle-arrow {
            transform: rotate(180deg);
        }
        .pro-commands-collapsible {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 8px;
            margin-top: 8px;
        }

        /* Command palette (slash autocomplete) */
        .command-palette {
            display: none;
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 768px;
            background: var(--theme-sidebar-bg, #fff);
            border: 1px solid var(--theme-border);
            border-radius: 12px;
            padding: 8px;
            margin-bottom: 8px;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
            z-index: 100;
            max-height: 320px;
            overflow-y: auto;
        }
        .command-palette.show { display: block; }
        .command-palette-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: 8px;
            cursor: pointer;
            transition: background 0.15s;
        }
        .command-palette-item:hover {
            background: var(--theme-hover-bg, rgba(16, 185, 129, 0.08));
        }
        .command-palette-item.command-palette-item-gated {
            opacity: 0.68;
        }
        .cp-cmd {
            font-family: monospace;
            font-weight: 600;
            color: #10b981;
            font-size: 14px;
            min-width: 100px;
        }
        .cp-desc {
            font-size: 13px;
            color: var(--theme-text-secondary);
        }
        .cp-tier-badge {
            margin-left: auto;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #60a5fa;
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.24);
            border-radius: 999px;
            padding: 3px 7px;
        }

        @media (max-width: 768px) {
            .command-hints {
                grid-template-columns: 1fr;
                gap: 6px;
            }
            .command-hint { padding: 10px 12px; }
            .command-section-label { margin-top: 6px; }
            .welcome-screen { padding: 24px 20px 16px !important; }
            .welcome-help-anchor { top: 16px; right: 16px; }
            .welcome-help-btn { width: 26px; height: 26px; font-size: 12px; }
            .welcome-help-nudge { display: none !important; }
            .welcome-help-popover { top: calc(100% + 8px); right: -8px; left: auto; width: min(92vw, 820px); max-height: calc(100vh - 70px); padding: 20px; }
            .help-popover-title { font-size: 17px; }
            .help-intro-title { font-size: 16px; }
            .help-popover-body { min-height: 0; }
            .help-tabs { gap: 6px; }
            .help-tab-btn { flex: 1 1 auto; }
            .help-feature-grid { grid-template-columns: 1fr; }
            .help-diagram { grid-template-columns: 1fr; }
            .help-diagram-step { min-height: 0; }
            .help-diagram-step:not(:last-child)::after {
                content: "↓";
                top: auto;
                right: 50%;
                bottom: -18px;
                transform: translateX(50%);
            }
            .help-example-list { grid-template-columns: 1fr; }
            .help-two-col { grid-template-columns: 1fr; gap: 0; }
            .help-tier-table { font-size: 11px; }
            .example-prompts { grid-template-columns: 1fr; gap: 8px; }
            .pro-commands-collapsible { grid-template-columns: 1fr; }
            .command-palette {
                left: 0;
                right: 0;
                transform: none;
                border-radius: 12px 12px 0 0;
                margin-bottom: 0;
                max-height: 50vh;
            }
        }
        @media (max-width: 480px) {
            .welcome-screen h2 { font-size: 1.15rem; }
            .welcome-screen > p { font-size: 12px !important; }
            .command-hint { padding: 8px 10px; }
            .command-name { font-size: 11px; padding: 2px 6px; }
            .command-desc { font-size: 11px; }
        }

        /* Typing indicator styles moved to avoid duplicate hardcoded colors */
        
        .sidebar-actions {
            margin-top: auto;
            padding-top: 20px;
            border-top: 1px solid var(--theme-border);
        }
        
        .sidebar-button {
            width: 100%;
            background: transparent;
            color: var(--theme-text-primary);
            border: none;
            border-radius: 10px;
            padding: 14px 16px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                        color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            font-size: 14px;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 10px;
            font-weight: 500;
        }
        
        .sidebar-button:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--theme-text-primary);
            transform: translateX(2px);
        }

        #delete-saved-conversation {
            color: #fca5a5;
            border: 1px solid rgba(239, 68, 68, 0.2);
        }

        #delete-saved-conversation:hover {
            background: rgba(239, 68, 68, 0.08);
            color: #fecaca;
        }
        
        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                left: -320px;
                top: 0;
                height: var(--app-height, 100vh);
                z-index: 1000;
                transition: left 0.3s ease;
                width: 320px;
                /* Override the desktop hide/show for mobile */
                transform: none !important;
            }
            
            .sidebar.mobile-open {
                left: 0;
            }
            
            /* Ensure chat container stays full width on mobile regardless of sidebar state */
            .chat-container {
                width: 100% !important;
                margin-left: 0 !important;
            }
            
            .app-container.sidebar-hidden .chat-container {
                width: 100% !important;
                margin-left: 0 !important;
            }
            
            .mobile-menu-btn {
                display: block;
            }
            
            .message {
                max-width: 95%;
            }
            
            .example-prompts {
                grid-template-columns: 1fr;
            }
            
            .sidebar-overlay {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(5, 150, 105, 0.3);
                backdrop-filter: blur(4px);
                z-index: 999;
                display: none;
            }
            
            .sidebar-overlay.active {
                display: block;
            }
        }
        
        /* Tablet Responsive (769px - 1023px) */
        @media (min-width: 769px) and (max-width: 1023px) {
            .sidebar {
                width: 280px; /* Slightly narrower on tablets */
            }
        }
        
        /* Desktop Responsive (1024px+) */
        @media (min-width: 1024px) {
            .mobile-menu-btn {
                display: none;
            }
        }

        .mobile-menu-btn {
            display: none;
            background: linear-gradient(135deg, var(--ff-primary) 0%, var(--ff-primary-dark) 100%);
            border: none;
            color: white;
            font-size: 18px;
            cursor: pointer;
            padding: 12px;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
            transition: all 0.3s ease;
        }
        
        .mobile-menu-btn:hover {
            background: linear-gradient(135deg, var(--ff-primary-dark) 0%, var(--ff-primary) 100%);
            transform: scale(1.05);
        }
        
        /* Success State Styles */
        .success-feedback {
            position: fixed;
            top: 20px;
            right: 20px;
            background: linear-gradient(135deg, var(--ff-primary) 0%, var(--ff-secondary) 100%);
            color: white;
            padding: 12px 20px;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(13, 124, 102, 0.3);
            z-index: 10000;
            animation: slideInFromRight 0.3s ease-out, fadeOut 0.3s ease-in 2.7s both;
        }
        
        @keyframes slideInFromRight {
            0% { transform: translateX(100%); opacity: 0; }
            100% { transform: translateX(0); opacity: 1; }
        }
        
        @keyframes fadeOut {
            to { opacity: 0; transform: translateX(100%); }
        }
        
        /* Focus states for accessibility */
        .theme-toggle:focus {
            outline: 3px solid var(--ff-secondary);
            outline-offset: 2px;
        }
        
        .online-status:focus {
            outline: 3px solid var(--ff-secondary);
            outline-offset: 2px;
        }
        
        .conversation-item:focus {
            outline: 2px solid var(--ff-primary);
            outline-offset: 2px;
        }
        
        /* High contrast mode support */
        @media (prefers-contrast: high) {
            .theme-toggle {
                border-width: 2px;
            }
            
            .status-dot {
                border: 2px solid currentColor;
            }
            
            .conversation-item {
                border-width: 2px;
            }
        }
        
        /* Custom Confirmation Modal */
        .custom-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        .custom-modal-overlay.show {
            display: flex;
            opacity: 1;
        }

        .custom-modal {
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 16px;
            padding: 32px;
            max-width: 420px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.2);
            position: relative;
            transform: scale(0.9) translateY(20px);
            transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

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

        .custom-modal-title {
            font-size: 20px;
            font-weight: 700;
            color: var(--theme-text-primary);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .custom-modal-message {
            font-size: 16px;
            color: var(--theme-text-secondary);
            line-height: 1.6;
            margin-bottom: 24px;
        }

        .custom-modal-buttons {
            display: flex;
            gap: 12px;
            justify-content: flex-end;
        }

        .custom-modal-button {
            padding: 12px 24px;
            border-radius: 10px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            border: none;
            display: flex;
            align-items: center;
            gap: 8px;
            min-width: 100px;
            justify-content: center;
        }

        .custom-modal-button.secondary {
            background: var(--theme-surface);
            color: var(--theme-text-primary);
            border: 1px solid var(--theme-border);
        }

        .custom-modal-button.secondary:hover {
            background: var(--theme-surface-light);
            transform: translateY(-1px);
        }

        .custom-modal-button.danger {
            background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
            color: white;
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
        }

        .custom-modal-button.danger:hover {
            background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
            box-shadow: 0 6px 16px rgba(220, 38, 38, 0.35);
            transform: translateY(-2px);
        }

        .custom-modal-button:active {
            transform: translateY(0);
        }

        /* Light theme adjustments */
        [data-theme="light"] .custom-modal-overlay {
            background: rgba(0, 0, 0, 0.4);
        }

        [data-theme="light"] .custom-modal {
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 32px rgba(0, 0, 0, 0.1);
        }

        /* Animation keyframes for modal entry */
        @keyframes modalFadeIn {
            from {
                opacity: 0;
                transform: scale(0.9) translateY(20px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }

        .custom-modal.animate-in {
            animation: modalFadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }


        /* Reduce motion for accessibility */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* Floating Model Selector - ChatGPT Style */
        .floating-model-selector {
            position: absolute;
            top: 120px;
            left: 32px;
            z-index: 1000;
            font-family: 'Inter', sans-serif;
            pointer-events: auto;
        }

        .model-selector-button {
            display: flex;
            align-items: center;
            gap: 8px;
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 8px;
            padding: 8px 12px;
            font-size: 13px;
            font-weight: 500;
            color: var(--theme-text-secondary);
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            position: relative;
            outline: none;
            pointer-events: auto;
            user-select: none;
        }

        .model-selector-button:hover {
            background: var(--theme-surface);
            border-color: var(--ff-primary);
            color: var(--theme-text-primary);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(13, 124, 102, 0.15);
        }

        .model-selector-button:focus {
            outline: none;
            border-color: var(--ff-secondary);
            box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
        }

        .model-selector-text {
            font-weight: 600;
            white-space: nowrap;
        }

        .model-selector-arrow {
            transition: transform 0.2s ease;
            opacity: 0.7;
        }

        .model-selector-button:hover .model-selector-arrow {
            opacity: 1;
        }

        .floating-model-selector.open .model-selector-arrow {
            transform: rotate(180deg);
        }

        /* Dropdown Menu */
        .model-dropdown-menu {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            min-width: 240px;
            background: var(--theme-message-bg);
            border: 1px solid var(--theme-border);
            border-radius: 12px;
            box-shadow:
                0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06),
                0 10px 25px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-8px);
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 1000;
            overflow: hidden;
        }

        .floating-model-selector.open .model-dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        .model-option {
            padding: 12px 16px;
            cursor: pointer;
            transition: all 0.15s ease,
                        background 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                        border-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
            border-bottom: 1px solid var(--theme-border);
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .model-option:last-child {
            border-bottom: none;
        }

        .model-option:hover {
            background: var(--theme-surface);
        }

        .model-option.selected {
            background: linear-gradient(135deg, rgba(13, 124, 102, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
            border-left: 3px solid var(--ff-primary);
        }

        .model-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--theme-text-primary);
        }

        .model-description {
            font-size: 12px;
            color: var(--theme-text-secondary);
            opacity: 0.8;
        }

        /* Light theme adjustments */
        [data-theme="light"] .model-selector-button {
            background: rgba(255, 255, 255, 0.8);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        [data-theme="light"] .model-selector-button:hover {
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 0 2px 8px rgba(13, 124, 102, 0.12);
        }

        [data-theme="light"] .model-dropdown-menu {
            background: rgba(255, 255, 255, 0.95);
            box-shadow: 
                0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06),
                0 10px 25px rgba(0, 0, 0, 0.15);
        }

        [data-theme="light"] .model-option:hover {
            background: rgba(13, 124, 102, 0.05);
        }

        /* Tablet responsiveness */
        @media (max-width: 1024px) and (min-width: 769px) {
            .floating-model-selector {
                top: 110px;
                left: 24px;
            }
        }

        /* Mobile responsiveness */
        @media (max-width: 768px) {
            .floating-model-selector {
                top: 100px;
                left: 20px;
                right: 20px;
            }

            .model-dropdown-menu {
                left: 0;
                right: 0;
                min-width: auto;
            }

            .model-selector-button {
                font-size: 12px;
                padding: 6px 10px;
            }

            .model-option {
                padding: 10px 12px;
            }

            .model-name {
                font-size: 13px;
            }
        }

        /* Loading state */
        .model-selector-button.loading {
            pointer-events: none;
            opacity: 0.7;
        }

        .model-selector-button.loading .model-selector-arrow {
            animation: gentleSpin 1s ease-in-out infinite;
        }

        @keyframes gentleSpin {
            0%, 100% { transform: rotate(0deg); }
            50% { transform: rotate(180deg); }
        }

        /* Enhanced accessibility */
        .model-selector-button:focus-visible {
            outline: 2px solid var(--ff-secondary);
            outline-offset: 2px;
        }

        .model-option:focus {
            outline: none;
            background: var(--theme-surface);
        }

        /* Backdrop overlay for mobile */
        .model-dropdown-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: transparent;
            z-index: 999;
            display: none;
        }

        .floating-model-selector.open + .model-dropdown-backdrop {
            display: block;
        }
        
        /* Chat Messages Styles - Removed duplicate rules that were overriding earlier styles */
        
        .message-text {
            line-height: 1.5;
            white-space: pre-wrap;
            word-wrap: break-word;
        }
        
        .message-text.rich-command {
            white-space: normal;
        }

        /* Markdown-rendered assistant messages */
        .message-text.md-rendered {
            white-space: normal;
        }

        .message-text.md-rendered .md-p {
            margin: 0 0 12px 0;
        }

        .message-text.md-rendered .md-p:last-child {
            margin-bottom: 0;
        }

        .message-text.md-rendered strong {
            font-weight: 700;
        }

        .message-text.md-rendered em {
            font-style: italic;
        }

        .message-text.md-rendered .md-heading {
            font-weight: 700;
            margin: 16px 0 8px 0;
            line-height: 1.3;
        }

        .message-text.md-rendered .md-heading:first-child {
            margin-top: 0;
        }

        .message-text.md-rendered h1.md-heading { font-size: 1.4em; }
        .message-text.md-rendered h2.md-heading { font-size: 1.25em; }
        .message-text.md-rendered h3.md-heading { font-size: 1.1em; }
        .message-text.md-rendered h4.md-heading { font-size: 1em; }

        .message-text.md-rendered .md-inline-code {
            background: rgba(255, 255, 255, 0.08);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 0.88em;
        }

        [data-theme="light"] .message-text.md-rendered .md-inline-code {
            background: rgba(0, 0, 0, 0.06);
        }

        .message-text.md-rendered .md-code-block {
            background: #1a1a2e;
            border-radius: 8px;
            padding: 14px 16px;
            margin: 12px 0;
            overflow-x: auto;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        [data-theme="light"] .message-text.md-rendered .md-code-block {
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
        }

        .message-text.md-rendered .md-code-block code {
            font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
            font-size: 0.85em;
            line-height: 1.6;
            color: #e2e8f0;
            white-space: pre;
        }

        [data-theme="light"] .message-text.md-rendered .md-code-block code {
            color: #1e293b;
        }

        .message-text.md-rendered .md-list {
            margin: 8px 0;
            padding-left: 24px;
        }

        .message-text.md-rendered ul.md-list {
            list-style-type: disc;
        }

        .message-text.md-rendered ol.md-list {
            list-style-type: decimal;
        }

        .message-text.md-rendered .md-list li {
            margin: 4px 0;
            line-height: 1.5;
        }

        .message-text.md-rendered .md-link {
            color: #38bdf8;
            text-decoration: underline;
            text-decoration-color: rgba(56, 189, 248, 0.4);
            text-underline-offset: 2px;
        }

        .message-text.md-rendered .md-link:hover {
            text-decoration-color: #38bdf8;
        }

        [data-theme="light"] .message-text.md-rendered .md-link {
            color: #2563eb;
            text-decoration-color: rgba(37, 99, 235, 0.4);
        }

        [data-theme="light"] .message-text.md-rendered .md-link:hover {
            text-decoration-color: #2563eb;
        }

        .message-text.md-rendered .md-hr {
            border: none;
            border-top: 1px solid var(--theme-border);
            margin: 16px 0;
        }

        .message-time {
            font-size: 11px;
            opacity: 0.6;
            margin-top: 4px;
            text-align: right;
        }
        
        .typing-dots {
            display: flex;
            gap: 4px;
            align-items: center;
        }
        
        .typing-dots span {
            width: 6px;
            height: 6px;
            background: var(--theme-text-secondary);
            border-radius: 50%;
            animation: typing-pulse 1.4s infinite ease-in-out;
            transition: background 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .typing-dots span:nth-child(1) { animation-delay: 0s; }
        .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
        .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
        
        @keyframes typing-pulse {
            0%, 60%, 100% { opacity: 0.3; }
            30% { opacity: 1; }
        }
        
        /* Subscription UI Styles */
        .user-info-section {
            margin-top: auto;
            padding: 16px;
            border-top: 1px solid var(--theme-border);
        }
        
        .subscription-info {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .tier-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            width: fit-content;
        }
        
        .tier-badge {
            background: rgba(107, 114, 128, 0.2);
            color: #6b7280;
        }
        
        .tier-badge[data-tier="PRO"] {
            background: rgba(16, 185, 129, 0.2);
            color: #10b981;
        }
        
        .tier-badge[data-tier="PREMIUM"] {
            background: rgba(147, 51, 234, 0.2);
            color: #9333ea;
        }
        
        .usage-info {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .usage-text {
            font-size: 12px;
            color: var(--theme-text-secondary);
        }
        
        .usage-bar {
            height: 4px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 2px;
            overflow: hidden;
        }
        
        .usage-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--ff-primary), var(--ff-accent));
            border-radius: 2px;
            transition: width 0.3s ease;
        }

        /* Remaining-queries meter sits beside the floating routing control, not under it */
        #rate-limit-meter {
            width: min(260px, calc(100% - 56px));
            margin-left: auto;
            margin-right: 32px;
            text-align: right;
            position: relative;
            z-index: 1;
        }

        @media (max-width: 768px) {
            #rate-limit-meter {
                position: fixed;
                top: 64px;
                right: 16px;
                width: min(180px, calc(100vw - 128px));
                margin: 0;
                text-align: right;
                z-index: 1000;
            }
        }
        
        /* Model option locked state */
        .model-option.locked {
            opacity: 0.5;
            cursor: not-allowed;
            background: rgba(239, 68, 68, 0.05);
        }
        
        .model-option.locked:hover {
            background: rgba(239, 68, 68, 0.05) !important;
        }
        
        .model-option.locked .model-name::after {
            content: " [locked]";
        }
        
        /* Send button styles */
        .send-button, .send-btn {
            background: var(--ff-primary);
            color: white;
            border: none;
            border-radius: 6px;
            padding: 8px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .send-button:hover, .send-btn:hover {
            background: var(--ff-primary-dark);
            transform: translateY(-1px);
        }
        
        .send-button svg, .send-btn svg {
            width: 16px;
            height: 16px;
        }

        /* RESPONSIVE LAYOUT - Proper responsive CSS without scaling hacks */

        .app-container {
            transform: none !important;
            width: 100vw !important;
            max-width: 100vw !important;
            display: flex !important;
            position: relative !important;
            background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 100%) !important;
            transition: background 0.3s ease !important;
            /* height controlled by MOBILE UX FIXES section via --app-height / dvh */
        }

        body {
            overflow: hidden;
            width: 100vw;
            margin: 0;
            padding: 0;
            font-family: 'Inter', sans-serif;
            background: linear-gradient(135deg, var(--theme-bg-primary) 0%, var(--theme-bg-secondary) 100%);
            color: var(--theme-text-primary);
            transition: background 0.3s ease, color 0.3s ease;
            /* height controlled by MOBILE UX FIXES section via --app-height / dvh */
        }

        .restore-sidebar-btn {
            position: fixed;
            top: 16px;
            left: 12px;
            background: var(--theme-surface);
            border: 1px solid var(--theme-border);
            padding: 6px;
            border-radius: 6px;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            transition: all 0.2s ease;
            color: var(--theme-text-secondary);
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }

        .floating-model-selector {
            position: absolute;
            top: 120px;
            left: 32px;
            z-index: 1000;
            font-family: 'Inter', sans-serif;
            pointer-events: auto;
        }

        @media (max-width: 768px) {
            .app-container {
                transform: none !important;
                width: 100vw !important;
                max-width: 100vw !important;
                /* height managed by --app-height / dvh in MOBILE UX FIXES */
            }

            .restore-sidebar-btn {
                top: 16px;
                left: 16px;
                z-index: 1001;
                width: 32px;
                height: 32px;
                padding: 8px;
            }

            .floating-model-selector {
                top: 100px;
                left: 20px;
                right: 20px;
            }

            .conversation-container {
                padding: 0 16px;
            }
        }

        .app-container.sidebar-hidden .chat-container {
            margin-left: 30px !important;
            width: calc(100% - 30px) !important;
            flex: 1 !important;
            max-width: calc(100% - 30px) !important;
        }

        @media (min-width: 769px) and (max-width: 1023px) {
            .floating-model-selector {
                top: 110px;
                left: 24px;
            }
        }

        @media (min-width: 1024px) {
            .floating-model-selector {
                top: 120px;
                left: 32px;
            }
        }

        /* High DPI display adjustments */
        @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
            .app-container {
                -webkit-font-smoothing: antialiased;
                -moz-osx-font-smoothing: grayscale;
            }
        }

        /* Success feedback notification */
        .success-feedback {
            position: fixed;
            top: 20px;
            right: 20px;
            background: linear-gradient(135deg, var(--ff-primary) 0%, var(--ff-secondary) 100%);
            color: white;
            padding: 12px 20px;
            border-radius: 12px;
            box-shadow: 0 4px 16px rgba(13, 124, 102, 0.3);
            z-index: 10000;
            animation: slideInFromRight 0.3s ease-out, fadeOut 0.3s ease-in 2.7s both;
        }

        /* Modal overlay adjustments */
        .custom-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        /* Mobile sidebar overlay */
        .sidebar-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(5, 150, 105, 0.3);
            backdrop-filter: blur(4px);
            z-index: 999;
            display: none;
        }

        /* Model dropdown backdrop */
        .model-dropdown-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: transparent;
            z-index: 999;
            display: none;
        }

        /* Mobile sidebar positioning */
        @media (max-width: 768px) {
            .sidebar {
                position: fixed;
                left: -320px;
                top: 0;
                height: var(--app-height, 100vh);
                z-index: 1000;
                transition: left 0.3s ease;
                width: 320px;
                transform: none !important;
            }

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

        /* Text rendering */
        .app-container * {
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        /* Global focus-visible styles for keyboard navigation */
        a:focus-visible,
        button:focus-visible,
        select:focus-visible,
        [tabindex]:focus-visible {
            outline: 2px solid #3b82f6;
            outline-offset: 2px;
        }

        a:focus:not(:focus-visible),
        button:focus:not(:focus-visible),
        select:focus:not(:focus-visible),
        [tabindex]:focus:not(:focus-visible) {
            outline: none;
        }

        /* ===== MOBILE UX FIXES - Feb 2026 ===== */

        /* Fix 100vh on mobile browsers (Safari URL bar, Android Chrome bottom bar) */
        /* Use CSS custom property set by JS visualViewport API as primary,
           fall back to dvh, then vh */
        body {
            height: var(--app-height, 100vh);
        }
        .app-container {
            height: var(--app-height, 100vh);
            max-height: var(--app-height, 100vh);
        }
        @supports (height: 100dvh) {
            body {
                height: var(--app-height, 100dvh);
            }
            .app-container {
                height: var(--app-height, 100dvh);
                max-height: var(--app-height, 100dvh);
            }
        }

        @media (max-width: 768px) {
            /* -- Sidebar hidden state: prevent 30px ghost margin on mobile -- */
            .sidebar.hidden,
            .sidebar-start-collapsed .sidebar {
                width: 0 !important;
                min-width: 0 !important;
                flex: 0 0 0px !important;
                overflow: hidden !important;
                padding: 0 !important;
                border: none !important;
            }

            /* -- Mobile open overrides: undo hidden state when mobile-open -- */
            .sidebar.hidden.mobile-open,
            .sidebar-start-collapsed .sidebar.mobile-open {
                width: 320px !important;
                min-width: 320px !important;
                flex: 0 0 320px !important;
                overflow: visible !important;
                padding: 0 !important;
                left: 0 !important;
                border: none !important;
            }

            .sidebar.hidden.mobile-open > *,
            .sidebar-start-collapsed .sidebar.mobile-open > * {
                display: block !important;
            }

            .app-container.sidebar-hidden .chat-container,
            .sidebar-start-collapsed .chat-container {
                margin-left: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
            }

            /* Hide restore button on mobile (mobile-menu-btn handles this) */
            .restore-sidebar-btn {
                display: none !important;
            }

            .app-container.sidebar-hidden .restore-sidebar-btn,
            .sidebar-start-collapsed .restore-sidebar-btn {
                display: none !important;
            }

            /* -- Header: switch from grid to flex, uniform sizing -- */
            .chat-header {
                display: flex !important;
                flex-wrap: nowrap !important;
                align-items: center !important;
                justify-content: space-between !important;
                padding: 12px 16px !important;
                gap: 10px !important;
                min-height: 52px !important;
            }

            .header-left {
                flex: 0 1 auto !important;
                gap: 10px !important;
                min-width: 0;
                overflow: hidden;
            }

            /* Hide FFN back-link on mobile */
            .header-left a[href*="fantasyfootballnerds"] {
                display: none !important;
            }

            .chat-title {
                font-size: 16px !important;
                white-space: nowrap !important;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .header-controls {
                flex: 0 0 auto !important;
                justify-content: flex-end !important;
                gap: 8px !important;
                flex-wrap: nowrap !important;
                overflow: visible !important;
            }

            /* --- Uniform 32px touch targets for all header buttons --- */
            .mobile-menu-btn {
                width: 32px !important;
                height: 32px !important;
                min-width: 32px !important;
                padding: 0 !important;
                font-size: 16px !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                border-radius: 6px !important;
                flex-shrink: 0 !important;
            }

            .auth-button {
                width: 32px !important;
                height: 32px !important;
                min-width: 32px !important;
                min-height: 32px !important;
                padding: 0 !important;
                font-size: 0 !important;
                border-radius: 8px !important;
                gap: 0 !important;
                display: flex !important;
                align-items: center !important;
                justify-content: center !important;
                flex-shrink: 0 !important;
                box-shadow: none !important;
            }

            .auth-button span {
                display: none !important;
            }

            .auth-button svg {
                width: 15px !important;
                height: 15px !important;
                margin: 0 !important;
                flex-shrink: 0 !important;
            }

            /* Compact theme toggle - proportional to 32px row */
            .theme-toggle {
                width: 40px !important;
                height: 22px !important;
                flex-shrink: 0 !important;
                padding: 2px !important;
            }

            .theme-toggle-thumb {
                width: 16px !important;
                height: 16px !important;
                font-size: 0 !important;
            }

            .theme-toggle[data-theme="light"] .theme-toggle-thumb {
                transform: translateX(18px) !important;
            }

            /* Sports selector stays hidden */
            .sports-selector {
                display: none !important;
            }

            /* Online status stays hidden */
            .online-status {
                display: none !important;
            }

            /* -- Chat input: safe area + extra bottom padding for browser bars -- */
            .chat-input-container {
                padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
                /* Ensure input is never behind browser chrome */
                padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
            }

            .chat-context-bar {
                gap: 10px;
                margin-bottom: 10px;
            }

            .chat-context-controls {
                width: 100%;
            }

            .chat-context-control {
                flex: 1 1 140px;
                justify-content: space-between;
            }

            .data-freshness-pill {
                width: 100%;
                justify-content: center;
            }

            .chat-input-wrapper {
                padding: 12px 16px !important;
                border-radius: 20px !important;
                max-width: 100% !important;
            }

            .chat-input {
                font-size: 16px !important; /* Prevents iOS zoom on focus */
            }

            /* -- Messages area: comfortable mobile padding -- */
            .chat-messages {
                padding: 20px 16px !important;
            }

            .conversation-container {
                padding: 0 4px !important;
            }

            /* Message widths */
            .message.user {
                max-width: 90% !important;
            }

            .message.assistant {
                max-width: 95% !important;
            }

            .message {
                gap: 10px !important;
                margin-bottom: 20px !important;
            }

            .message-avatar {
                width: 28px !important;
                height: 28px !important;
                font-size: 11px !important;
            }

            /* Model selector */
            .floating-model-selector {
                top: 64px !important;
                left: 16px !important;
                right: auto !important;
            }

            .model-selector-button {
                font-size: 12px !important;
                padding: 6px 10px !important;
            }

            /* Welcome screen */
            .welcome-screen {
                padding: 20px 20px 16px !important;
            }

            .example-prompts {
                grid-template-columns: 1fr !important;
                gap: 8px !important;
            }

            .example-prompt {
                padding: 14px !important;
            }

            /* Command palette full-width on mobile */
            .command-palette {
                left: 0 !important;
                right: 0 !important;
                transform: none !important;
                width: 100% !important;
                max-width: 100% !important;
                border-radius: 12px 12px 0 0 !important;
                margin-bottom: 0 !important;
            }
        }

        /* ===== END MOBILE UX FIXES ===== */
