        :root {
            /* Default theme variables will be overwritten by theme switcher */
            --bg-primary: #0a0a0a;
            --bg-secondary: #1a1a1a;
            --accent: #4a9eff;
            --accent-gradient: linear-gradient(45deg, #4a9eff, #8c5eff);
            --text-primary: #ffffff;
            --text-secondary: #a0a0a0;
            --border: #2a2a2a;
            --error: #ff4a4a;
            --success: #4aff4a;
            --accent-rgb: 74, 158, 255;
        }

        /* Theme definitions */
        [data-theme="dark-default"] {
            --bg-primary: #0a0a0a;
            --bg-secondary: #1a1a1a;
            --accent: #4a9eff;
            --accent-gradient: linear-gradient(45deg, #4a9eff, #8c5eff);
            --text-primary: #ffffff;
            --text-secondary: #a0a0a0;
            --border: #2a2a2a;
            --accent-rgb: 74, 158, 255;
        }

        [data-theme="midnight-blue"] {
            --bg-primary: #0f172a;
            --bg-secondary: #1e293b;
            --accent: #60a5fa;
            --accent-gradient: linear-gradient(45deg, #60a5fa, #818cf8);
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --border: #334155;
            --accent-rgb: 96, 165, 250;
        }

        [data-theme="forest"] {
            --bg-primary: #0c1711;
            --bg-secondary: #1a2f23;
            --accent: #34d399;
            --accent-gradient: linear-gradient(45deg, #34d399, #059669);
            --text-primary: #ecfdf5;
            --text-secondary: #6ee7b7;
            --border: #065f46;
            --accent-rgb: 52, 211, 153;
        }

        [data-theme="sunset"] {
            --bg-primary: #18100f;
            --bg-secondary: #2f1c1b;
            --accent: #f59e0b;
            --accent-gradient: linear-gradient(45deg, #f59e0b, #d97706);
            --text-primary: #fef3c7;
            --text-secondary: #fbbf24;
            --border: #92400e;
            --accent-rgb: 245, 158, 11;
        }

        [data-theme="dracula"] {
            --bg-primary: #282a36;
            --bg-secondary: #44475a;
            --accent: #bd93f9;
            --accent-gradient: linear-gradient(45deg, #bd93f9, #ff79c6);
            --text-primary: #f8f8f2;
            --text-secondary: #6272a4;
            --border: #44475a;
            --accent-rgb: 189, 147, 249;
        }

        [data-theme="nord"] {
            --bg-primary: #2e3440;
            --bg-secondary: #3b4252;
            --accent: #88c0d0;
            --accent-gradient: linear-gradient(45deg, #88c0d0, #81a1c1);
            --text-primary: #eceff4;
            --text-secondary: #d8dee9;
            --border: #434c5e;
            --accent-rgb: 136, 192, 208;
        }

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

        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            display: flex;
            height: 100vh;
            line-height: 1.6;
        }

        .sidebar {
            width: 300px;
            background: var(--bg-secondary);
            padding: 1.5rem;
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            gap: 1rem;
            overflow-y: auto;
        }

        .chat-list {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            margin: 1rem 0;
            overflow-y: auto;
        }

        .chat-item {
            padding: 0.75rem 1rem;
            border-radius: 0.5rem;
            background: var(--bg-primary);
            cursor: pointer;
            transition: all 0.2s ease;
            border: 1px solid var(--border);
            font-size: 0.9rem;
            color: var(--text-secondary);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .chat-item:hover {
            background: var(--bg-secondary);
            border-color: var(--accent);
        }

        .chat-item.active {
            background: var(--accent);
            color: white;
            border-color: var (--accent);
        }

        .chat-item .delete-btn {
            opacity: 0;
            padding: 0.25rem 0.5rem;
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .chat-item:hover .delete-btn {
            opacity: 1;
        }

        .chat-item .delete-btn:hover {
            color: var(--error);
            transform: scale(1.1);
        }

        .chat-controls {
            display: flex;
            gap: 0.5rem;
            align-items: center;
            flex-wrap: wrap;
            width: 100%;
        }

        .chat-controls-buttons {
            display: flex;
            gap: 0.25rem;
            margin-left: auto;
            flex-shrink: 0;
            flex-wrap: nowrap;
        }

        .icon-button {
            padding: 0.6rem !important;
            min-width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-primary) !important;
            border: 1px solid var(--border) !important;
        }

        .icon-button:hover {
            background: var(--bg-secondary) !important;
            border-color: var(--accent) !important;
            transform: translateY(-1px);
        }

        .new-chat-button {
            flex: 0 1 auto;
            min-width: 120px;
            white-space: nowrap;
        }

        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
        }

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

        .message {
            max-width: 850px;
            padding: 1.5rem;
            border-radius: 0.8rem;
            border: 1px solid var(--border);
            font-size: 1rem;
            line-height: 1.7;
            animation: messageIn 0.3s ease-out;
        }

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

        .user-message {
            background: var(--bg-secondary);
            align-self: flex-end;
            border-bottom-right-radius: 0;
        }

        .assistant-message {
            background: var(--bg-secondary);
            align-self: flex-start;
            border-bottom-left-radius: 0;
        }

        .input-area {
            padding: 1.5rem;
            border-top: 1px solid var(--border);
            background: var(--bg-secondary);
        }

        .input-container {
            max-width: 850px;
            margin: 0 auto;
            display: flex;
            gap: 1rem;
        }

        select, textarea, input, button {
            padding: 1rem;
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            background: var(--bg-primary);
            color: var(--text-primary);
            font-size: 0.95rem;
            transition: all 0.2s ease;
        }

        button {
            background: var(--accent-gradient);
            border: none;
            padding: 0.8rem 1.5rem;
            cursor: pointer;
            font-weight: 500;
        }

        button:hover {
            opacity: 0.9;
            transform: translateY(-1px);
        }

        button:active {
            transform: translateY(0);
        }

        #modelSelector {
            width: 100%;
            margin-bottom: 1rem;
        }

        #systemPrompt {
            width: 100%;
            height: 150px;
            resize: vertical;
            font-family: inherit;
        }

        #userInput {
            flex: 1;
            padding: 1rem 1.2rem;
            line-height: 1.5;
            resize: none;
            overflow: hidden;
            min-height: 56px;
            max-height: 300px;
        }

        .settings-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .settings-group label {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .message pre {
            background: var(--bg-primary);
            padding: 1rem;
            border-radius: 0.5rem;
            overflow-x: auto;
            position: relative;
        }

        /* Add styles for HTML preview */
        .preview-iframe {
            width: 100%;
            min-height: 300px;
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            background: white;
            margin-top: 1rem;
        }

        .preview-controls {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .preview-button {
            padding: 0.5rem 1rem;
            font-size: 0.8rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            color: var(--text-primary);
            border-radius: 0.3rem;
            cursor: pointer;
        }

        .preview-button:hover {
            border-color: var(--accent);
            background: var(--bg-primary);
        }

        .message code {
            font-family: 'Fira Code', monospace;
            font-size: 0.9rem;
        }

        .message p {
            margin-bottom: 1rem;
        }

        .message ul, .message ol {
            margin-left: 1.5rem;
            margin-bottom: 1rem;
        }

        .status {
            padding: 0.5rem;
            border-radius: 0.5rem;
            font-size: 0.9rem;
            text-align: center;
            margin-top: 1rem;
        }

        .status.error {
            background: var(--error);
            color: white;
        }

        .status.success {
            background: var(--success);
            color: white;
        }

        .think-container {
            margin-bottom: 0.5rem;
            padding: 0.25rem 0.5rem;
            border-radius: 0.3rem;
            background: var(--bg-primary);
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.8rem;
            border: 1px solid rgba(255, 255, 255, 0.1);
            opacity: 0.7;
            cursor: pointer;
        }

        .think-container:hover {
            opacity: 0.9;
        }

        .think-text {
            color: var(--text-secondary);
            font-family: monospace;
            font-size: 0.75rem;
            opacity: 0.8;
        }

        .toggle-icon {
            user-select: none;
            transition: transform 0.3s ease;
            font-size: 0.7rem;
            color: var(--text-secondary);
        }

        .toggle-icon.collapsed {
            transform: rotate(-90deg);
        }

        .thinking-content {
            color: var(--text-secondary);
            font-size: 0.9rem;
            padding: 0.5rem;
            margin-top: 0.25rem;
            border-left: 2px solid rgba(255, 255, 255, 0.1);
            margin-left: 0.5rem;
            transition: all 0.3s ease;
            max-height: 300px;
            overflow-y: auto;
        }

        .thinking-content.collapsed {
            max-height: 0;
            opacity: 0;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        .message-content {
            margin-bottom: 1rem;
        }

        .citations {
            border-top: 1px solid var (--border);
            margin-top: 1rem;
            padding-top: 1rem;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .citation-ref {
            color: var(--accent);
            cursor: pointer;
            text-decoration: none;
            font-size: 0.8rem;
            vertical-align: super;
        }

        .citation-ref:hover {
            text-decoration: underline;
        }

        .citation-list {
            list-style: none;
            padding: 0;
        }

        .citation-item {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
            line-height: 1.4;
        }

        .citation-number {
            color: var (--accent);
            min-width: 1.5rem;
        }

        .citation-link {
            color: var (--text-secondary);
            text-decoration: none;
            word-break: break-all;
        }

        .citation-link:hover {
            color: var (--accent);
            text-decoration: underline;
        }

        /* Add new styles for theme selector */
        .theme-selector {
            margin-top: 1rem;
            padding: 0.5rem;
            background: var(--bg-primary);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            color: var(--text-primary);
            width: 100%;
        }

        .theme-selector option {
            background: var(--bg-primary);
            color: var (--text-primary);
            padding: 0.5rem;
        }

        /* Add these new styles */
        .theme-dropdown {
            position: relative;
            display: inline-block;
        }

        .theme-menu {
            display: none;
            position: absolute;
            right: 0;
            top: 100%;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            padding: 0.5rem;
            z-index: 1000;
            margin-top: 0.5rem;
            min-width: 180px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .theme-menu.show {
            display: block;
            animation: fadeIn 0.2s ease-out;
        }

        .theme-option {
            display: block;
            padding: 0.5rem 1rem;
            color: var(--text-primary);
            cursor: pointer;
            border-radius: 0.3rem;
            transition: all 0.2s ease;
            text-align: left;
            width: 100%;
            background: none;
            border: none;
        }

        .theme-option:hover {
            background: var(--bg-primary);
            transform: translateY(0);
        }

        .theme-option.active {
            background: var (--accent);
            color: white;
        }

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

        /* Add these new mobile-responsive styles */
        @media (max-width: 768px) {
            body {
                flex-direction: column;
                height: 100%;
            }

            .sidebar {
                width: 100%;
                max-height: min-content;
                border-right: none;
                border-bottom: 1px solid var(--border);
                padding: 1rem;
                gap: 0.75rem;
            }

            .chat-controls {
                flex-wrap: wrap;
            }

            .new-chat-button {
                flex: 1;
            }

            .chat-controls-buttons {
                margin-left: 0; /* Reset margin on mobile */
            }

            .icon-button {
                padding: 0.5rem !important;
                min-width: 32px;
                height: 32px;
                font-size: 0.9rem;
            }

            .theme-menu {
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 80%;
                max-width: 300px;
                margin: 0;
                background: var(--bg-primary);
                border: 2px solid var(--border);
                box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
            }

            .theme-option {
                padding: 0.8rem 1rem;
                font-size: 1rem;
            }

            #modelSelector {
                padding: 0.6rem;
                font-size: 0.9rem;
                margin-bottom: 0.75rem;
            }

            #systemPrompt {
                height: 100px;
                font-size: 0.9rem;
            }

            .chat-list {
                max-height: 200px;
                margin: 0.5rem 0;
            }

            .chat-item {
                padding: 0.6rem 0.8rem;
                font-size: 0.85rem;
            }

            #messages {
                padding: 1rem;
                gap: 1rem;
            }

            .message {
                padding: 1rem;
                font-size: 0.95rem;
                max-width: 100%;
            }

            .input-area {
                padding: 1rem;
            }

            #userInput {
                font-size: 0.95rem;
                padding: 0.8rem;
            }

            /* Add backdrop for mobile theme menu */
            .theme-backdrop {
                display: none;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 999;
            }

            .theme-backdrop.show {
                display: block;
            }

            /* Adjust status messages for mobile */
            .status {
                position: fixed;
                bottom: 1rem;
                left: 50%;
                transform: translateX(-50%);
                z-index: 1000;
                width: 90%;
                max-width: 400px;
                margin: 0;
            }
        }

        /* Add styles for collapsible sidebar on mobile */
        .sidebar-toggle {
            display: none;
            position: fixed;
            bottom: 1rem;
            right: 1rem;
            width: 48px;
            height: 48px;
            border-radius: 24px;
            background: var(--accent-gradient);
            border: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            padding: 0;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        @media (max-width: 768px) {
            .sidebar-toggle {
                display: flex;
            }

            .sidebar.collapsed {
                display: none;
            }

            .sidebar.expanded {
                display: flex;
                animation: slideIn 0.3s ease-out;
            }

            @keyframes slideIn {
                from { transform: translateY(-100%); }
                to { transform: translateY(0); }
            }

            /* Add these new styles */
            .sidebar.expanded {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                z-index: 1000;
                background: var(--bg-secondary);
                overflow-y: auto;
                -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
            }

            /* Prevent body scroll when sidebar is open */
            body.sidebar-open {
                overflow: hidden;
            }
        }

        /* Add new logo styles */
        .logo-wrapper {
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
            text-align: center;
            position: relative;
            border-bottom: 1px solid var(--border);
        }

        .logo {
            font-size: 1.4rem;
            font-weight: bold;
            text-transform: uppercase;
            color: var(--text-primary);
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            transition: all 0.3s ease;
            position: relative;
            padding: 0.25rem 0.5rem;
            border-radius: 0.5rem;
        }

        .logo::before {
            content: '';
            position: absolute;
            inset: 0;
            background: var(--accent-gradient);
            opacity: 0.1;
            border-radius: inherit;
            transition: opacity 0.3s ease;
        }

        .logo:hover::before {
            opacity: 0.2;
        }

        .logo-text {
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            position: relative;
        }

        .logo-text::after {
            content: 'BETA';
            position: absolute;
            top: -0.35rem;
            right: -0.8rem;
            font-size: 0.5rem;
            background: var(--accent-gradient);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-weight: bold;
            letter-spacing: 0.05em;
        }

        @media (max-width: 768px) {
            .logo-wrapper {
                padding: 0.5rem;
                margin-bottom: 0.25rem;
            }

            .logo {
                font-size: 1.2rem;
            }

            .logo-text::after {
                font-size: 0.45rem;
                top: -0.3rem;
                right: -0.7rem;
            }
        }

        /* Add styles for message actions */
        .message-actions {
            display: none;
            gap: 0.5rem;
            margin-top: 0.5rem;
            padding-top: 0.5rem;
            border-top: 1px solid var(--border);
        }

        .message:hover .message-actions {
            display: flex;
        }

        .message-content {
            position: relative;
            margin-bottom: 0;
        }

        /* Add markdown preview styles */
        .preview-toggle {
            position: absolute;
            right: 0.5rem;
            top: 0.5rem;
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
        }

        .preview-container {
            display: none;
            padding: 1rem;
            background: var(--bg-primary);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            margin-top: 0.5rem;
            max-height: 150px;
            overflow-y: auto;
            width: 100%;
        }

        .preview-container.show {
            display: block;
        }

        /* Add styles for copy buttons */
        .copy-button {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
            background: var(--bg-secondary);
            border: 1px solid var (--border);
            border-radius: 0.25rem;
            opacity: 0;
            transition: opacity 0.2s;
            cursor: pointer;
            z-index: 10;
        }

        .message:hover .copy-button,
        pre:hover .copy-button {
            opacity: 1;
        }

        .copy-button:hover {
            background: var(--accent);
            color: white;
        }

        .message table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            border-radius: 0.5rem;
            overflow: hidden;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
        }

        .message th {
            background: var(--accent);
            color: var(--text-primary);
            font-weight: 600;
            text-align: left;
            padding: 0.75rem 1rem;
            border: 1px solid var(--border);
        }

        .message td {
            padding: 0.75rem 1rem;
            border: 1px solid var(--border);
            background: var(--bg-primary);
        }

        .message tr:nth-child(even) td {
            background: var(--bg-secondary);
        }

        .message tr:hover td {
            background: rgba(var(--accent-rgb), 0.1);
        }

        /* Add responsive table styles */
        @media (max-width: 768px) {
            .message table {
                display: block;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }

            .message td, 
            .message th {
                white-space: nowrap;
                min-width: 120px;
            }
        }

        /* Onboarding Styles */
        .onboarding-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 9999;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none; /* Allow clicks through the overlay */
        }

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

        .onboarding-tooltip {
            position: fixed; /* Change to fixed */
            background: var(--accent-gradient);
            padding: 1.5rem;
            border-radius: 1rem;
            max-width: 320px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            color: white;
            font-size: 0.95rem;
            line-height: 1.6;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 10000; /* Ensure tooltip is above overlay */
        }

        .onboarding-tooltip.active {
            opacity: 1;
            transform: translateY(0);
        }

        .onboarding-tooltip::after {
            content: '';
            position: absolute;
            width: 12px;
            height: 12px;
            background: var(--accent);
            transform: rotate(45deg);
        }

        .onboarding-tooltip[data-position="bottom"]::after {
            top: -6px;
            left: 50%;
            margin-left: -6px;
        }

        .onboarding-tooltip[data-position="top"]::after {
            bottom: -6px;
            left: 50%;
            margin-left: -6px;
        }

        .onboarding-tooltip[data-position="left"]::after {
            right: -6px;
            top: 50%;
            margin-top: -6px;
        }

        .onboarding-tooltip[data-position="right"]::after {
            left: -6px;
            top: 50%;
            margin-top: -6px;
        }

        .onboarding-buttons {
            display: flex;
            gap: 0.75rem;
            margin-top: 1rem;
        }

        .onboarding-button {
            padding: 0.5rem 1rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 0.5rem;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .onboarding-button:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-1px);
        }

        .onboarding-button.primary {
            background: white;
            color: var(--accent);
        }

        .onboarding-button.primary:hover {
            background: rgba(255, 255, 255, 0.9);
        }

        .highlight-element {
            position: relative;
            z-index: 10000;
            /* Add subtle highlight animation */
            animation: pulse 2s infinite;
            box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.4);
            border-radius: 4px;
        }

        @keyframes pulse {
            0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
            70% { box-shadow: 0 0 0 10px rgba(var(--accent-rgb), 0); }
            100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
        }

        /* Add kbd style for keyboard shortcuts */
        .kbd {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            padding: 2px 6px;
            font-family: monospace;
            font-size: 0.9em;
            margin: 0 2px;
        }

        /* Update the theme menu positioning */
        .theme-menu {
            display: none;
            position: absolute;
            left: 0;      /* Align with left edge of button */
            top: 100%;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 0.5rem;
            padding: 0.5rem;
            z-index: 1000;
            margin-top: 0.5rem;
            min-width: 180px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        /* Update onboarding styles */
        .onboarding-tooltip {
            position: fixed;
            background: var(--accent-gradient);
            padding: 1.5rem;
            border-radius: 1rem;
            width: Min(320px, 90vw);  /* Responsive width */
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            color: white;
            font-size: 0.95rem;
            line-height: 1.6;
            opacity: 0;
            transform: translateY(20px);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 10000;
        }

        /* Add mobile-specific styles for onboarding */
        @media (max-width: 768px) {
            .onboarding-tooltip {
                position: fixed;
                left: 50% !important;
                bottom: 20px !important;
                top: auto !important;
                transform: translateX(-50%);
                width: 90vw;
                max-width: 320px;
                margin: 0;
            }

            .onboarding-tooltip[data-position] {
                left: 50% !important;
                transform: translateX(-50%);
            }

            .onboarding-tooltip[data-position]::after {
                display: none;  /* Hide arrows on mobile */
            }

            /* Ensure highlighted elements are visible */
            .highlight-element {
                position: relative;
                z-index: 10001;
            }
        }

        /* Add image generation styles */
        .image-generation-container {
            position: relative;
            width: 100%;
            padding: 1rem;
            border-radius: 0.5rem;
            background: var(--bg-secondary);
            margin-bottom: 1rem;
        }

        .loading-spinner {
            position: relative;
            width: 100%;
            height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-primary);
            border-radius: 0.5rem;
            overflow: hidden;
        }

        .loading-spinner::before {
            content: '';
            position: absolute;
            width: 150%;
            height: 150%;
            background: linear-gradient(
                90deg,
                transparent,
                rgba(var(--accent-rgb), 0.2),
                rgba(var(--accent-rgb), 0.4),
                rgba(var(--accent-rgb), 0.2),
                transparent
            );
            animation: shimmer 2s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .generated-image {
            width: 100%;
            max-width: 512px;
            height: auto;
            border-radius: 0.5rem;
            display: block;
            margin: 0 auto;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .generated-image.show {
            opacity: 1;
        }

        .image-controls {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .image-controls button {
            padding: 0.5rem 1rem;
            font-size: 0.9rem;
            background: var(--bg-primary);
            border: 1px solid var(--border);
            border-radius: 0.3rem;
            cursor: pointer;
        }

        .image-controls button:hover {
            background: var(--bg-secondary);
            border-color: var(--accent);
        }

        /* Add these new styles */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.2s ease-out;
        }

        .modal-content {
            background: var(--bg-secondary);
            padding: 1.5rem;
            border-radius: 1rem;
            width: 90%;
            max-width: 500px;
            animation: slideUp 0.3s ease-out;
        }

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

        .modal-header h3 {
            margin: 0;
            color: var(--text-primary);
        }

        .close-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
        }

        .generate-btn {
            width: 100%;
            margin-top: 1rem;
            background: var(--accent-gradient);
        }

        #imagePrompt {
            width: 100%;
            height: 100px;
            resize: vertical;
            font-family: inherit;
        }

        .spinner-text {
            color: var(--text-secondary);
            text-align: center;
            margin-top: 1rem;
            animation: pulse 2s infinite;
        }

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

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

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