/* ================================================================
   THE ORACLE - PREMIUM DESKTOP REDESIGN
   Perplexity.ai-Inspired Enterprise UI
   Created by: Dakota Stewart
   Delphi Labs - AGI MODEL 7

   CRITICAL: All styles are wrapped in @media (min-width: 769px)
   to protect mobile styles from any changes
   ================================================================ */

/* ================================================================
   CRITICAL: Hide boot overlay immediately on desktop
   This runs BEFORE JavaScript and blocks any flash
   ================================================================ */
@media (min-width: 769px) {
    #bootOverlay {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        position: absolute !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
}

/* ================================================================
   DESKTOP-ONLY STYLES - Protected Mobile
   All styles below only apply to screens 769px and wider
   ================================================================ */

@media (min-width: 769px) {
    /* ================================================================
       PERPLEXITY COLOR PALETTE
       ================================================================ */
    :root {
        /* Perplexity-inspired dark theme with purple accent */
        --perp-bg-primary: #191A1A;
        --perp-bg-secondary: #1F1F1F;
        --perp-bg-tertiary: #2F2F2F;
        --perp-bg-elevated: #2A2A2A;

        --perp-border: #3F3F3F;
        --perp-border-subtle: #333333;

        --perp-text-primary: #FFFFFF;
        --perp-text-secondary: #D1D5DB;
        --perp-text-muted: #9CA3AF;
        --perp-text-subtle: #6B7280;

        --perp-accent: #8B5CF6;
        --perp-accent-hover: #A78BFA;
        --perp-accent-subtle: rgba(139, 92, 246, 0.1);
        --perp-accent-glow: rgba(139, 92, 246, 0.2);
    }

    /* ================================================================
       GLOBAL TYPOGRAPHY - Inter, No Italics
       ================================================================ */
    html, body {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
        background: var(--perp-bg-primary) !important;
        background-color: var(--perp-bg-primary) !important;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    /* Remove ALL italics globally */
    * {
        font-style: normal !important;
    }

    /* Headings - Clean, no uppercase */
    h1, h2, h3, h4, h5, h6 {
        font-weight: 600;
        letter-spacing: -0.02em;
        text-transform: none !important;
    }

    /* Premium Scrollbar */
    ::-webkit-scrollbar {
        width: 6px;
    }

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

    ::-webkit-scrollbar-thumb {
        background: #3F3F3F;
        border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: #4F4F4F;
    }

    /* Firefox scrollbar */
    * {
        scrollbar-width: thin;
        scrollbar-color: #3F3F3F transparent;
    }

    /* ================================================================
       HIDE COMPLETELY - Boot, Music, Turbo, Footer, Mode Pills
       ================================================================ */

    /* Boot Overlay - HIDE */
    #bootOverlay {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    /* Turbo/Overdrive Button - HIDE */
    #overdriveBtn {
        display: none !important;
    }

    /* Overdrive Overlay - HIDE */
    .overdrive-overlay,
    .overdrive-container,
    .overdrive-speed-indicator,
    .time-warp-overlay {
        display: none !important;
    }

    /* Bottom Mode Pills - HIDE (already in Instant dropdown) */
    .chat-mode-selector,
    #chatModeSelector {
        display: none !important;
    }

    /* Legal Footer - HIDE */
    .legal-footer {
        display: none !important;
    }

    /* Cinematic Soundwave (Background Music) - HIDE */
    .cinematic-soundwave,
    #cinematicSoundwave {
        display: none !important;
    }

    /* THINK Tab Toggle - HIDE (dev/debug feature) */
    .deep-think-toggle-btn {
        display: none !important;
    }

    /* Debug Console Toggle - HIDE (dev feature) */
    #artifact-console-toggle {
        display: none !important;
    }

    /* Game Hub Overlay - HIDE by default */
    #gameHubOverlay {
        display: none !important;
    }
    #gameHubOverlay.show {
        display: flex !important;
    }

    /* ================================================================
       BACKGROUND - Solid Dark, No Effects
       ================================================================ */
    .cyber-bg,
    .cyber-bg::before,
    .cyber-bg::after,
    .matrix-rain,
    .particle,
    .scanline,
    .noise-overlay {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .app-container {
        background: var(--perp-bg-primary) !important;
    }

    /* Corporate: Subtle neural canvas background */
    #neuralCanvas {
        display: block !important;
        opacity: 0.4 !important; /* Very subtle - barely visible */
    }

    /* ================================================================
       SIDEBAR - Clean Enterprise Look
       ================================================================ */
    .sidebar {
        background: #1A1A1A !important;
        border-right: 1px solid var(--perp-border) !important;
        box-shadow: none !important;
    }

    .sidebar::before,
    .sidebar::after {
        display: none !important;
    }

    /* Sidebar Header */
    .sidebar-header {
        background: #1A1A1A !important;
        border-bottom: 1px solid var(--perp-border) !important;
        padding: 24px 20px !important;
    }

    .sidebar-header::before {
        display: none !important;
    }

    /* Sidebar Logo - Clean */
    .sidebar-logo {
        font-family: 'Inter', sans-serif !important;
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.05em !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: var(--perp-text-primary) !important;
        color: var(--perp-text-primary) !important;
        filter: none !important;
        animation: none !important;
        text-shadow: none !important;
    }

    .sidebar-logo::after {
        display: none !important;
    }

    .sidebar-logo.corporate {
        font-size: 1.5rem !important;
        letter-spacing: 0.02em !important;
    }

    .version-tag,
    .version-tag.corporate {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 500 !important;
        color: var(--perp-text-muted) !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        text-shadow: none !important;
        animation: none !important;
    }

    /* Status Indicator - green dot only, no border */
    .status-indicator {
        margin-top: 12px;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .status-dot-corporate {
        background: #22C55E !important;
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.5) !important;
    }

    .status-text-corporate {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 500 !important;
        color: var(--perp-text-muted) !important;
        letter-spacing: 0 !important;
    }

    /* Brain Container - dark background, no white box */
    .brain-container,
    .brain-container-corporate {
        filter: none !important;
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .brain-container::before,
    .brain-container::after,
    .brain-container-corporate::before,
    .brain-container-corporate::after {
        opacity: 0.5 !important;
        display: none !important;
    }

    .brain-core::before,
    .brain-core::after {
        animation: none !important;
    }

    /* User Info */
    .user-info {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        margin: 16px !important;
        padding: 14px !important;
    }

    /* Hide person icon next to user email */
    .user-avatar {
        display: none !important;
    }

    .user-name {
        font-weight: 500 !important;
        color: var(--perp-text-primary) !important;
    }

    .user-status {
        color: var(--perp-text-muted) !important;
        font-size: 0.8rem !important;
    }

    .user-pro-badge {
        background: var(--perp-accent) !important;
        color: white !important;
        border-radius: 6px !important;
        font-size: 0.7rem !important;
        font-weight: 600 !important;
        padding: 3px 8px !important;
    }

    /* Balance Display */
    .balance-display {
        background: var(--perp-bg-secondary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        margin: 0 16px 16px !important;
        padding: 14px !important;
    }

    .balance-item {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 10px !important;
        padding: 12px !important;
        margin-bottom: 8px !important;
    }

    .balance-item:hover {
        border-color: var(--perp-accent) !important;
        background: var(--perp-bg-elevated) !important;
    }

    .balance-action {
        background: var(--perp-accent) !important;
        color: white !important;
        border-radius: 6px !important;
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
    }

    .balance-manage-btn {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        color: var(--perp-text-secondary) !important;
        border-radius: 10px !important;
        font-weight: 500 !important;
    }

    .balance-manage-btn:hover {
        border-color: var(--perp-accent) !important;
        background: var(--perp-bg-elevated) !important;
    }

    .balance-cancel-btn {
        background: transparent !important;
        border: 1px solid #6B7280 !important;
        color: #6B7280 !important;
        font-weight: 500 !important;
    }

    .balance-cancel-btn:hover {
        border-color: #9CA3AF !important;
        color: #9CA3AF !important;
    }

    /* System Status Bar */
    .system-status-bar {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        margin: 16px !important;
        padding: 14px !important;
    }

    .status-label {
        color: var(--perp-text-muted) !important;
        font-size: 0.8rem !important;
        font-weight: 500 !important;
    }

    .status-value {
        color: var(--perp-text-primary) !important;
        font-weight: 600 !important;
    }

    .progress-bar-corporate {
        background: var(--perp-bg-tertiary) !important;
        border-radius: 8px !important;
        overflow: hidden;
    }

    .progress-fill {
        background: linear-gradient(90deg, #8B5CF6, #A78BFA) !important;
        border-radius: 8px !important;
    }

    /* Sidebar Buttons - Sentence Case, Clean */
    .sidebar-buttons {
        padding: 12px 16px !important;
        gap: 8px !important;
    }

    .sidebar-btn {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 10px !important;
        color: var(--perp-text-secondary) !important;
        padding: 12px 16px !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        box-shadow: none !important;
        transition: all 0.15s ease !important;
    }

    .sidebar-btn:hover {
        border-color: var(--perp-accent) !important;
        background: var(--perp-bg-elevated) !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .sidebar-btn:active {
        background: var(--perp-accent-subtle) !important;
    }

    .sidebar-btn .btn-icon {
        margin-right: 10px !important;
        font-size: 1rem !important;
    }

    .sidebar-btn.secondary {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
    }

    .sidebar-btn.logout {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        color: #EF4444 !important;
    }

    .sidebar-btn.logout:hover {
        border-color: #EF4444 !important;
        background: rgba(239, 68, 68, 0.1) !important;
    }

    /* ================================================================
       MAIN CONTENT AREA - Full Height Chat
       ================================================================ */
    .main-content {
        background: var(--perp-bg-primary) !important;
        display: flex;
        flex-direction: column;
        height: 100vh;
        position: relative;
    }

    /* ================================================================
       TOP BAR - Clean Floating Design (No Border, Slightly Bigger)
       ================================================================ */
    .topbar {
        position: absolute !important;
        top: 16px !important;
        left: 20px !important;
        right: auto !important;
        width: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        border-bottom: none !important;
        border-radius: 0 !important;
        padding: 10px 0 !important;
        z-index: 100 !important;
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        box-shadow: none !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* Remove any red/colored lines from topbar */
    .topbar::before,
    .topbar::after {
        display: none !important;
        content: none !important;
    }

    /* Chat Title (ORACLE logo) - Slightly bigger */
    .chat-title {
        font-family: 'Inter', sans-serif !important;
        font-size: 1.05rem !important;
        font-weight: 600 !important;
        color: var(--perp-text-primary) !important;
        text-transform: none !important;
        letter-spacing: 0.02em !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: var(--perp-text-primary) !important;
        text-shadow: none !important;
        animation: none !important;
        margin-right: 14px !important;
        border: none !important;
        border-bottom: none !important;
        text-decoration: none !important;
    }

    /* Header Mode Dropdown */
    .header-mode-dropdown {
        margin: 0 !important;
    }

    .header-mode-btn {
        background: transparent !important;
        border: none !important;
        border-bottom: none !important;
        border-radius: 6px !important;
        color: var(--perp-text-secondary) !important;
        padding: 8px 12px !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
        text-decoration: none !important;
    }

    .header-mode-btn:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border: none !important;
    }

    .mode-current-icon {
        font-size: 1rem !important;
    }

    .mode-current-name {
        font-weight: 500 !important;
        font-size: 0.9rem !important;
    }

    .mode-arrow {
        font-size: 0.75rem !important;
        color: var(--perp-text-subtle) !important;
    }

    /* Topbar Actions - Minimal Buttons */
    .topbar-actions {
        display: flex !important;
        gap: 6px !important;
        margin-left: 0 !important;
    }

    .action-btn {
        background: transparent !important;
        border: none !important;
        border-radius: 8px !important;
        color: var(--perp-text-muted) !important;
        padding: 6px 10px !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 500 !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        transition: all 0.15s ease !important;
        box-shadow: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
    }

    .action-btn:hover {
        background: var(--perp-bg-tertiary) !important;
        color: var(--perp-text-primary) !important;
        transform: none !important;
        box-shadow: none !important;
    }

    .action-btn.active {
        background: var(--perp-accent-subtle) !important;
        color: var(--perp-accent) !important;
    }

    .action-btn .icon {
        font-size: 0.9rem !important;
        margin-right: 2px !important;
    }

    .action-btn .text {
        text-transform: none !important;
        font-size: 0.8rem !important;
    }

    /* Hide these buttons from topbar (move to Oracle dropdown) */
    #codeMatrixBtn,
    #tasksBtn,
    .action-btn[onclick*="openBookLab"] {
        display: none !important;
    }

    /* Settings Button - Clean, no border */
    .settings-btn {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        border: none !important;
        border-radius: 6px !important;
        padding: 6px !important;
        z-index: auto !important;
        box-shadow: none !important;
        margin-left: 8px !important;
        color: var(--perp-text-muted) !important;
    }

    .settings-btn:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        border: none !important;
        color: var(--perp-text-primary) !important;
    }

    /* Remove any red lines/borders from topbar elements */
    .topbar *,
    .topbar *::before,
    .topbar *::after {
        border-bottom: none !important;
        text-decoration: none !important;
    }

    /* Completely hide topbar red/accent line */
    .topbar::after {
        display: none !important;
        content: none !important;
        background: none !important;
        height: 0 !important;
        opacity: 0 !important;
    }

    /* ================================================================
       HEADER MODE MENU (Dropdown)
       ================================================================ */
    .header-mode-menu {
        background: var(--perp-bg-secondary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
        padding: 8px !important;
    }

    .header-mode-option {
        background: transparent !important;
        border: none !important;
        border-radius: 8px !important;
        padding: 12px 16px !important;
        color: var(--perp-text-secondary) !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        transition: background 0.15s ease !important;
    }

    .header-mode-option:hover {
        background: var(--perp-bg-tertiary) !important;
    }

    .header-mode-option.selected {
        background: var(--perp-accent-subtle) !important;
        color: var(--perp-accent) !important;
    }

    .header-mode-option .option-check {
        margin-left: auto !important;
        color: var(--perp-accent) !important;
    }

    /* ================================================================
       CORPORATE ICONS - Replace emojis with clean symbols
       ================================================================ */

    /* Hide all emoji icons in topbar and dropdowns */
    .mode-current-icon,
    .header-mode-option .option-icon,
    .oracle-tools-option .option-icon,
    #entityBtn .icon,
    .action-btn .icon {
        font-family: 'Inter', -apple-system, sans-serif !important;
        font-style: normal !important;
        font-size: 0.85rem !important;
        opacity: 0.7 !important;
    }

    /* Instant mode: ⚡ → star (matches thinking indicator) */
    #currentModeIcon,
    #optionInstant .option-icon {
        font-size: 0 !important;
    }
    #currentModeIcon::before,
    #optionInstant .option-icon::before {
        content: '★' !important;
        font-size: 0.8rem !important;
        color: #10b981 !important;
    }

    /* Research mode: 🔬 → target */
    #optionResearch .option-icon {
        font-size: 0 !important;
    }
    #optionResearch .option-icon::before {
        content: '◎' !important;
        font-size: 0.8rem !important;
        color: #9ca3af !important;
    }

    /* Code mode: 💻 → brackets */
    #optionCode .option-icon {
        font-size: 0 !important;
    }
    #optionCode .option-icon::before {
        content: '</>' !important;
        font-size: 0.7rem !important;
        font-weight: 600 !important;
        letter-spacing: -1px !important;
        color: #9ca3af !important;
    }

    /* Agents mode: 🤖 → grid */
    #optionAgents .option-icon {
        font-size: 0 !important;
    }
    #optionAgents .option-icon::before {
        content: '▣' !important;
        font-size: 0.8rem !important;
        color: #9ca3af !important;
    }

    /* Create mode: 🎨 → image frame (grey) */
    #optionCreate .option-icon {
        font-size: 0 !important;
    }
    #optionCreate .option-icon::before {
        content: '▢' !important;
        font-size: 0.85rem !important;
        color: #9ca3af !important;
    }

    /* Entity button */
    #entityBtn .icon {
        font-size: 0 !important;
    }
    #entityBtn .icon::before {
        content: '●' !important;
        font-size: 0.6rem !important;
        color: #8b5cf6 !important;
    }

    /* Oracle Tools dropdown icons - clean corporate grey */
    #oracleToolsMenu .oracle-tools-option .option-icon {
        font-size: 0 !important;
        color: transparent !important;
        width: 20px !important;
        height: 20px !important;
        text-align: center !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
        overflow: hidden !important;
    }

    #oracleToolsMenu .oracle-tools-option .option-icon::before {
        font-size: 0.9rem !important;
        color: #9ca3af !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    /* Oracle Voice */
    #oracleToolsMenu .oracle-tools-option:nth-child(1) .option-icon::before {
        content: '◉' !important;
    }
    /* Code Lab */
    #oracleToolsMenu .oracle-tools-option:nth-child(2) .option-icon::before {
        content: '</>' !important;
        font-size: 0.7rem !important;
        font-weight: 600 !important;
    }
    /* Tasks */
    #oracleToolsMenu .oracle-tools-option:nth-child(3) .option-icon::before {
        content: '☐' !important;
    }
    /* Book Lab */
    #oracleToolsMenu .oracle-tools-option:nth-child(4) .option-icon::before {
        content: '≡' !important;
        font-size: 1rem !important;
    }
    /* Roblox Builder */
    #oracleToolsMenu .oracle-tools-option:nth-child(5) .option-icon::before {
        content: '▦' !important;
    }

    /* ================================================================
       WELCOME / GREETING SECTION - Positioned above centered input
       ================================================================ */
    .welcome-overlay {
        background: transparent !important;
        position: absolute !important;
        top: 28% !important;
        left: 50% !important;
        transform: translate(calc(-50% + 130px), -50%) !important;
    }

    /* Adjust welcome overlay when sidebar is collapsed */
    .app-container.sidebar-collapsed .welcome-overlay {
        transform: translate(calc(-50% + 40px), -50%) !important;
    }

    .welcome-content {
        text-align: center !important;
    }

    .welcome-brain {
        margin-bottom: 24px !important;
    }

    .welcome-brain video {
        filter: drop-shadow(0 4px 16px rgba(139, 92, 246, 0.3)) !important;
        opacity: 0.9 !important;
    }

    .welcome-greeting,
    h1.welcome-greeting,
    #welcomeGreeting {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
        font-size: 28px !important;
        font-weight: 500 !important;
        font-style: normal !important;
        -webkit-font-style: normal !important;
        color: #FFFFFF !important;
        letter-spacing: -0.02em !important;
        text-align: center !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: #FFFFFF !important;
        text-shadow: none !important;
        animation: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .welcome-subtitle {
        font-family: 'Inter', sans-serif !important;
        font-size: 1rem !important;
        font-weight: 400 !important;
        color: var(--perp-text-muted) !important;
        margin-top: 8px !important;
    }

    /* Hide toast notifications on desktop */
    .toast {
        display: none !important;
    }

    /* ================================================================
       INPUT FIELD - Perplexity Style (Centered then Bottom)
       ================================================================ */

    /* INITIAL STATE: Centered in middle of screen (no messages yet) */
    .input-area {
        position: fixed !important;
        top: 50% !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        width: 100% !important;
        max-width: 800px !important;
        transform: translate(calc(-50% + 130px), -50%) !important;
        background: transparent !important;
        border: none !important;
        padding: 0 20px !important;
        z-index: 100 !important;
        box-sizing: border-box !important;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    /* Adjust centered state when sidebar is collapsed */
    .app-container.sidebar-collapsed .input-area {
        transform: translate(calc(-50% + 40px), -50%) !important;
    }

    /* AFTER FIRST MESSAGE: Move to bottom of screen */
    .app-container.has-messages .input-area {
        top: auto !important;
        bottom: 24px !important;
        max-width: 900px !important;
        transform: translateX(calc(-50% + 130px)) !important;
    }

    .app-container.has-messages.sidebar-collapsed .input-area {
        transform: translateX(calc(-50% + 40px)) !important;
    }

    .input-wrapper {
        background: transparent !important;
        padding: 0 !important;
        border: none !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
    }

    /* INITIAL STATE: Taller input box like Gemini (rectangular) */
    .input-container {
        background: #1e1e1e !important;
        border: 1px solid #3a3a3a !important;
        border-radius: 14px !important;
        padding: 20px 24px !important;
        min-height: 120px !important;
        box-shadow: none !important;
        transition: all 0.3s ease !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        overflow: visible !important;
        width: 100% !important;
    }

    /* AFTER FIRST MESSAGE: Taller input box at bottom too (rectangular) */
    .app-container.has-messages .input-container {
        min-height: 100px !important;
        padding: 18px 22px !important;
        border-radius: 14px !important;
    }

    /* Animated silver shimmer border effect - ALWAYS VISIBLE */
    .input-container::before {
        content: '' !important;
        position: absolute !important;
        inset: -2px !important;
        border-radius: 16px !important;
        background: linear-gradient(90deg,
            transparent 0%,
            rgba(180, 180, 190, 0.4) 20%,
            rgba(220, 220, 230, 0.6) 50%,
            rgba(180, 180, 190, 0.4) 80%,
            transparent 100%) !important;
        background-size: 200% 100% !important;
        animation: shimmerBorder 3s ease-in-out infinite !important;
        z-index: -1 !important;
        opacity: 1 !important;
    }

    .input-container:focus-within::before {
        opacity: 1 !important;
        background: linear-gradient(90deg,
            transparent 0%,
            rgba(200, 200, 220, 0.5) 20%,
            rgba(240, 240, 255, 0.7) 50%,
            rgba(200, 200, 220, 0.5) 80%,
            transparent 100%) !important;
    }

    .input-container:focus-within {
        border-color: #4a4a4a !important;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 4px 20px rgba(0, 0, 0, 0.3) !important;
    }

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

    /* ================================================================
       INPUT SUGGESTIONS DROPDOWN - Google-style autocomplete
       ================================================================ */
    .input-suggestions {
        display: none;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        background: #252525 !important;
        border: 1px solid #404040 !important;
        border-top: none !important;
        border-radius: 0 0 20px 20px !important;
        max-height: 400px !important;
        overflow-y: auto !important;
        z-index: 1000 !important;
        padding: 8px 0 !important;
        margin-top: -10px !important;
    }

    .input-suggestions.active {
        display: block !important;
    }

    .suggestion-item {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 10px 20px !important;
        cursor: pointer !important;
        transition: background 0.15s ease !important;
    }

    .suggestion-item:hover,
    .suggestion-item.selected {
        background: #353535 !important;
    }

    .suggestion-icon {
        width: 28px !important;
        height: 28px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #9ca3af !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
    }

    .suggestion-icon svg {
        width: 18px !important;
        height: 18px !important;
        stroke: currentColor !important;
    }

    .suggestion-content {
        flex: 1 !important;
        min-width: 0 !important;
    }

    .suggestion-text {
        color: #e0e0e0 !important;
        font-size: 14px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .suggestion-type {
        color: #6b7280 !important;
        font-size: 12px !important;
        margin-top: 2px !important;
    }

    .suggestion-divider {
        height: 1px !important;
        background: #404040 !important;
        margin: 8px 20px !important;
    }

    .suggestion-header {
        padding: 8px 20px 4px !important;
        color: #6b7280 !important;
        font-size: 11px !important;
        font-weight: 500 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
    }

    /* INITIAL STATE: Textarea in taller box */
    #messageInput {
        background: transparent !important;
        border: none !important;
        color: var(--perp-text-primary) !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 1rem !important;
        font-weight: 400 !important;
        padding: 0 !important;
        line-height: 1.6 !important;
        min-height: 50px !important;
        max-height: 200px !important;
        resize: none !important;
        flex: 1 !important;
    }

    /* AFTER FIRST MESSAGE: Still tall textarea */
    .app-container.has-messages #messageInput {
        min-height: 40px !important;
        max-height: 150px !important;
        font-size: 1rem !important;
    }

    #messageInput::placeholder {
        color: #6b7280 !important;
        font-weight: 400 !important;
    }

    /* Input actions positioned absolutely - next to send button */
    .input-actions {
        position: absolute !important;
        right: 60px !important;
        bottom: 16px !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* AFTER FIRST MESSAGE: Keep actions positioned next to send */
    .app-container.has-messages .input-actions {
        right: 58px !important;
        bottom: 14px !important;
    }

    .input-action-btn {
        background: transparent !important;
        border: none !important;
        color: #6b7280 !important;
        padding: 6px !important;
        border-radius: 50% !important;
        transition: all 0.15s ease !important;
        font-size: 18px !important;
        width: 32px !important;
        height: 32px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }

    .input-action-btn:hover {
        background: transparent !important;
        color: #9ca3af !important;
    }

    /* Send button positioned at bottom right */
    .input-buttons {
        position: absolute !important;
        right: 16px !important;
        bottom: 16px !important;
        gap: 8px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* AFTER FIRST MESSAGE: Keep button position for taller box */
    .app-container.has-messages .input-buttons {
        right: 14px !important;
        bottom: 14px !important;
    }

    .send-btn {
        background: transparent !important;
        border: none !important;
        color: #6b7280 !important;
        padding: 0 !important;
        transition: all 0.15s ease !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* AFTER FIRST MESSAGE: Keep send button same size */
    .app-container.has-messages .send-btn {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
    }

    .send-btn:hover {
        background: transparent !important;
        color: #ffffff !important;
        transform: none !important;
        box-shadow: none !important;
    }

    /* Hide image generation, web, and mic buttons on desktop - only file and send */
    .input-action-btn[onclick*="showImageGenModal"],
    .input-action-btn.search-toggle-btn,
    #searchToggleBtn,
    #micBtn,
    .input-action-btn[onclick*="toggleMicInput"] {
        display: none !important;
    }

    /* ================================================================
       SEARCH SUGGESTIONS - Only visible in initial state (no messages)
       ================================================================ */

    /* Show suggestions by default (initial state - centered box) */
    .input-suggestions.active {
        display: block !important;
    }

    /* Hide suggestions after first message (box at bottom) */
    .app-container.has-messages .input-suggestions,
    .app-container.has-messages .input-suggestions.active {
        display: none !important;
    }

    .stop-btn {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 8px !important;
        color: var(--perp-text-muted) !important;
        padding: 8px 10px !important;
        height: 36px !important;
    }

    .input-footer {
        display: none !important; /* Hide footer hints */
    }

    /* ================================================================
       CHAT CONTAINER / MESSAGES - Full Height
       ================================================================ */
    .chat-think-wrapper {
        flex: 1 !important;
        padding-top: 70px !important; /* Space for floating top bar */
        padding-bottom: 20px !important; /* Minimal padding when no messages */
    }

    /* After first message, add bottom padding for floating input */
    .app-container.has-messages .chat-think-wrapper {
        padding-bottom: 140px !important; /* Space for floating input at bottom */
    }

    .chat-container {
        background: var(--perp-bg-primary) !important;
        padding: 24px !important;
        padding-top: 40px !important;
        height: 100% !important;
        overflow-y: auto !important;
        max-width: 900px !important;
        margin: 0 auto !important;
    }

    .message {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        margin-bottom: 24px !important;
        max-width: 100% !important;
    }

    .message.ai {
        margin-left: 0 !important;
        margin-right: auto !important;
    }

    .message.ai .message-content {
        background: transparent !important;
        border: none !important;
    }

    .message.ai .message-text {
        font-family: 'Inter', sans-serif !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.7 !important;
        color: var(--perp-text-secondary) !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }

    .message.ai .message-text h1,
    .message.ai .message-text h2,
    .message.ai .message-text h3,
    .message.ai .message-text h4,
    .message.ai .message-text h5,
    .message.ai .message-text h6 {
        color: var(--perp-text-primary) !important;
        font-weight: 600 !important;
        margin-top: 24px !important;
        margin-bottom: 12px !important;
    }

    .message.ai .message-text p {
        margin-bottom: 16px !important;
    }

    .message.ai .message-text ul,
    .message.ai .message-text ol {
        margin: 16px 0 !important;
        padding-left: 24px !important;
    }

    .message.ai .message-text li {
        margin-bottom: 8px !important;
        color: var(--perp-text-secondary) !important;
    }

    .message.ai .message-text li::marker {
        color: var(--perp-text-subtle) !important;
    }

    .message.ai .message-text code {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 6px !important;
        padding: 2px 6px !important;
        font-size: 0.9em !important;
        color: var(--perp-accent-hover) !important;
    }

    .message.ai .message-text pre {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin: 16px 0 !important;
        overflow-x: auto !important;
    }

    .message.ai .message-text pre code {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        color: var(--perp-text-secondary) !important;
    }

    .message.ai .message-text a {
        color: var(--perp-accent) !important;
        text-decoration: none !important;
    }

    .message.ai .message-text a:hover {
        color: var(--perp-accent-hover) !important;
        text-decoration: underline !important;
    }

    /* User Messages */
    .message.user .message-text {
        background: var(--perp-accent) !important;
        color: white !important;
        border-radius: 16px 16px 4px 16px !important;
        padding: 12px 16px !important;
        font-size: 15px !important;
        line-height: 1.6 !important;
    }

    /* Source Citations */
    .source-citation,
    .citation-pill {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 6px !important;
        padding: 4px 10px !important;
        font-size: 12px !important;
        color: var(--perp-text-muted) !important;
    }

    /* ================================================================
       LOADING / "WORKING..." STATE
       ================================================================ */
    .thinking-indicator,
    .loading-indicator,
    .deep-thinking-indicator {
        background: transparent !important;
        border: none !important;
    }

    .thinking-text,
    .loading-text {
        font-family: 'Inter', sans-serif !important;
        font-size: 1rem !important;
        font-weight: 500 !important;
        color: var(--perp-text-primary) !important;
    }

    .thinking-dots span,
    .loading-dots span {
        background: var(--perp-accent) !important;
    }

    /* ================================================================
       SIDE PANELS - System Control Center (FIXED DARK)
       ================================================================ */
    .side-panel {
        background: #1F1F1F !important;
        border-left: 1px solid var(--perp-border) !important;
        border-radius: 16px 0 0 16px !important;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5) !important;
    }

    /* Force dark background - override any light styles */
    .side-panel,
    .side-panel *,
    #systemPanel,
    #systemPanel * {
        background-color: transparent;
    }

    #systemPanel {
        background: #1F1F1F !important;
    }

    #systemPanel .panel-content {
        background: #1F1F1F !important;
    }

    .panel-header {
        background: #1F1F1F !important;
        border-bottom: 1px solid var(--perp-border) !important;
        padding: 20px 24px !important;
    }

    .panel-title {
        font-family: 'Inter', sans-serif !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: #FFFFFF !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
    }

    .panel-close {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 8px !important;
        color: #6B7280 !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 1.2rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .panel-close:hover {
        background: var(--perp-bg-elevated) !important;
        color: #FFFFFF !important;
    }

    .panel-content {
        background: #1F1F1F !important;
        padding: 20px 24px !important;
    }

    /* Metric Sections */
    .metric-section {
        background: #2F2F2F !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
    }

    /* Section Headers - Gray, NOT red */
    .metric-section-title {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: #9CA3AF !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        margin-bottom: 12px !important;
        /* Remove any red/gradient colors */
        background: none !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: #9CA3AF !important;
    }

    .metric-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid #3F3F3F !important;
    }

    .metric-item:last-child {
        border-bottom: none !important;
    }

    .metric-label {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 400 !important;
        color: #D1D5DB !important;
    }

    .metric-value {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        color: #FFFFFF !important;
    }

    /* ================================================================
       DEVICE CARDS
       ================================================================ */
    .device-grid {
        gap: 10px !important;
    }

    .device-card {
        background: #2A2A2A !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 10px !important;
        padding: 14px !important;
        text-align: center !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
    }

    .device-card:hover {
        border-color: var(--perp-accent) !important;
        background: #333333 !important;
    }

    .device-icon {
        font-size: 1.5rem !important;
        margin-bottom: 6px !important;
        color: #6B7280 !important;
    }

    .device-name {
        font-size: 0.85rem !important;
        font-weight: 500 !important;
        color: #D1D5DB !important;
        margin-bottom: 4px !important;
    }

    .device-status {
        font-size: 0.75rem !important;
        color: #9CA3AF !important;
    }

    /* ================================================================
       INTEGRATIONS - Purple Bars Only, No Rainbow
       ================================================================ */
    .integration-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    .integration-item {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px !important;
        background: #2A2A2A !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 10px !important;
        cursor: pointer !important;
        transition: all 0.15s ease !important;
    }

    .integration-item:hover {
        border-color: var(--perp-accent) !important;
        background: #333333 !important;
    }

    .integration-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 1.1rem !important;
        /* Single purple color for all */
        background: #8B5CF6 !important;
        background-image: none !important;
    }

    .integration-info {
        flex: 1 !important;
    }

    .integration-name {
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        color: #FFFFFF !important;
    }

    .integration-status {
        font-size: 0.75rem !important;
        color: #9CA3AF !important;
    }

    .integration-toggle {
        width: 40px !important;
        height: 22px !important;
        background: #374151 !important;
        border-radius: 11px !important;
        position: relative !important;
        transition: background 0.2s ease !important;
    }

    .integration-toggle::after {
        content: '' !important;
        position: absolute !important;
        top: 2px !important;
        left: 2px !important;
        width: 18px !important;
        height: 18px !important;
        background: white !important;
        border-radius: 50% !important;
        transition: transform 0.2s ease !important;
    }

    .integration-toggle.active {
        background: #8B5CF6 !important;
    }

    .integration-toggle.active::after {
        transform: translateX(18px) !important;
    }

    /* ================================================================
       TOGGLE SWITCHES - Purple ON, Gray OFF
       ================================================================ */
    .toggle-switch {
        width: 44px !important;
        height: 24px !important;
        background: #374151 !important;
        border-radius: 12px !important;
        position: relative !important;
        cursor: pointer !important;
        transition: background 0.2s ease !important;
    }

    .toggle-switch::after {
        content: '' !important;
        position: absolute !important;
        top: 2px !important;
        left: 2px !important;
        width: 20px !important;
        height: 20px !important;
        background: white !important;
        border-radius: 10px !important;
        transition: transform 0.2s ease !important;
    }

    .toggle-switch.active {
        background: #8B5CF6 !important;
    }

    .toggle-switch.active::after {
        transform: translateX(20px) !important;
    }

    /* Theme Color Buttons */
    .theme-btn {
        border: 2px solid transparent !important;
        transition: all 0.15s ease !important;
    }

    .theme-btn:hover {
        transform: scale(1.1) !important;
    }

    .theme-btn.active {
        border-color: white !important;
        box-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
    }

    /* ================================================================
       DEEP THINK PANEL
       ================================================================ */
    .deep-think-panel {
        background: var(--perp-bg-secondary) !important;
        border-left: 1px solid var(--perp-border) !important;
    }

    .deep-think-header {
        background: var(--perp-bg-secondary) !important;
        border-bottom: 1px solid var(--perp-border) !important;
        padding: 16px !important;
    }

    .deep-think-title {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 600 !important;
        color: var(--perp-text-primary) !important;
        text-transform: none !important;
    }

    .think-label {
        text-transform: none !important;
        letter-spacing: 0 !important;
    }

    .think-metrics {
        background: var(--perp-bg-tertiary) !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin: 16px !important;
    }

    .metric-row .metric-label {
        font-size: 0.8rem !important;
        color: var(--perp-text-muted) !important;
    }

    .metric-bar {
        background: var(--perp-bg-tertiary) !important;
        border-radius: 4px !important;
        height: 6px !important;
    }

    .metric-fill {
        background: var(--perp-accent) !important;
        border-radius: 4px !important;
    }

    .thought-stream {
        background: var(--perp-bg-tertiary) !important;
        border-radius: 12px !important;
        margin: 16px !important;
        padding: 16px !important;
    }

    .current-thought {
        background: var(--perp-bg-tertiary) !important;
        border-radius: 12px !important;
        margin: 16px !important;
        padding: 16px !important;
    }

    .thought-label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        color: var(--perp-text-muted) !important;
        text-transform: none !important;
    }

    .thought-content {
        font-size: 0.9rem !important;
        color: var(--perp-text-primary) !important;
    }

    /* ================================================================
       ENTITY DROPDOWN
       ================================================================ */
    .entity-category-dropdown {
        background: var(--perp-bg-secondary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
    }

    .entity-option {
        background: transparent !important;
        border: none !important;
        padding: 12px 16px !important;
        transition: background 0.15s ease !important;
    }

    .entity-option:hover {
        background: var(--perp-bg-tertiary) !important;
    }

    .entity-option.active {
        background: var(--perp-accent-subtle) !important;
    }

    /* ================================================================
       MODALS - Clean & Minimal
       ================================================================ */
    .modal,
    .panel,
    .overlay {
        background: rgba(25, 26, 26, 0.9) !important;
        backdrop-filter: blur(10px) !important;
    }

    .modal-content {
        background: #1F1F1F !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 16px !important;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4) !important;
    }

    .modal-header {
        border-bottom: 1px solid var(--perp-border) !important;
        padding: 20px 24px !important;
        background: #1F1F1F !important;
    }

    .modal-title {
        font-family: 'Inter', sans-serif !important;
        font-size: 1.2rem !important;
        font-weight: 600 !important;
        color: var(--perp-text-primary) !important;
        text-transform: none !important;
    }

    .modal-close {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 8px !important;
        color: #6B7280 !important;
    }

    .modal-close:hover {
        background: var(--perp-bg-elevated) !important;
        color: #FFFFFF !important;
    }

    /* ================================================================
       ANIMATIONS - Subtle, Professional
       ================================================================ */
    .sidebar-logo,
    .version-tag,
    .brain-container,
    .brain-core,
    .brain-ring,
    .emotion-ring,
    .power-status,
    .power-dot {
        animation: none !important;
    }

    /* Keep only subtle hover transitions */
    button,
    .action-btn,
    .sidebar-btn,
    .integration-item,
    .device-card {
        transition: all 0.15s ease !important;
    }

    /* ================================================================
       HIDE DECORATIVE ELEMENTS
       ================================================================ */
    .neural-lines,
    .neural-line,
    .wisp,
    .cortical-spark,
    .quantum-spark {
        display: none !important;
    }

    /* AGI Core Orb - Subtle */
    #agiCoreOrb {
        opacity: 0.1 !important;
    }

    /* ================================================================
       PAST QUERIES BOX
       ================================================================ */
    .past-queries,
    .query-history,
    .chat-history-item {
        background: var(--perp-bg-secondary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        padding: 16px !important;
    }

    .query-title,
    .chat-history-title {
        font-weight: 500 !important;
        color: var(--perp-text-primary) !important;
    }

    .query-preview,
    .chat-history-preview {
        font-size: 13px !important;
        color: var(--perp-text-muted) !important;
    }

    .past-queries:hover,
    .query-history:hover,
    .chat-history-item:hover {
        background: var(--perp-bg-elevated) !important;
    }

    /* ================================================================
       MEMORY PALACE
       ================================================================ */
    .memory-palace-overlay {
        background: rgba(25, 26, 26, 0.95) !important;
    }

    .memory-palace-container {
        background: var(--perp-bg-secondary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 16px !important;
    }

    .palace-header {
        border-bottom: 1px solid var(--perp-border) !important;
    }

    .palace-title {
        font-family: 'Inter', sans-serif !important;
        font-weight: 600 !important;
        color: var(--perp-text-primary) !important;
        text-transform: none !important;
    }

    .palace-close {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 8px !important;
    }

    .memory-item,
    .chat-memory-card {
        background: var(--perp-bg-tertiary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
    }

    .memory-item:hover,
    .chat-memory-card:hover {
        border-color: var(--perp-accent) !important;
        background: var(--perp-bg-elevated) !important;
    }

    /* ================================================================
       DOCUMENT PREVIEW PANEL
       ================================================================ */
    .document-preview-panel {
        background: var(--perp-bg-secondary) !important;
        border-left: 1px solid var(--perp-border) !important;
    }

    .doc-preview-header {
        background: var(--perp-bg-secondary) !important;
        border-bottom: 1px solid var(--perp-border) !important;
    }

    .doc-preview-footer {
        background: var(--perp-bg-secondary) !important;
        border-top: 1px solid var(--perp-border) !important;
    }

    /* ================================================================
       ORACLE TOOLS DROPDOWN
       ================================================================ */
    .oracle-tools-dropdown {
        position: relative !important;
    }

    .oracle-tools-btn {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .oracle-tools-btn .dropdown-arrow {
        font-size: 0.7rem !important;
        color: var(--perp-text-subtle) !important;
        margin-left: 2px !important;
    }

    .oracle-tools-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 998;
        background: transparent;
    }

    .oracle-tools-backdrop.show {
        display: block;
    }

    .oracle-tools-menu {
        display: none;
        position: fixed;
        top: 60px;
        left: 20px;
        background: var(--perp-bg-secondary) !important;
        border: 1px solid var(--perp-border) !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
        padding: 8px !important;
        z-index: 999;
        min-width: 180px;
    }

    .oracle-tools-menu.show {
        display: block;
    }

    .oracle-tools-option {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 12px 16px !important;
        background: transparent !important;
        border: none !important;
        border-radius: 8px !important;
        color: var(--perp-text-secondary) !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.9rem !important;
        font-weight: 500 !important;
        cursor: pointer !important;
        transition: background 0.15s ease !important;
        text-align: left !important;
    }

    .oracle-tools-option:hover {
        background: var(--perp-bg-tertiary) !important;
        color: var(--perp-text-primary) !important;
    }

    .oracle-tools-option .option-icon {
        font-size: 1rem !important;
    }

    .oracle-tools-option .option-name {
        flex: 1 !important;
    }

    /* ================================================================
       SEARCH BUTTON IN INPUT BAR
       ================================================================ */
    .search-toggle-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .search-toggle-btn.active,
    .search-toggle-btn:has(+ #webModeBtn.active) {
        color: var(--perp-accent) !important;
        background: var(--perp-accent-subtle) !important;
    }

    .search-toggle-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Hide Search from top bar on desktop */
    #webModeBtn {
        display: none !important;
    }

    /* Show topbar-actions on mobile only - hidden on desktop */
    .topbar-actions {
        display: none !important;
    }

    /* ================================================================
       FIX: Oracle dropdown spacing from settings button
       ================================================================ */
    .oracle-tools-dropdown {
        margin-right: 16px !important;
    }

    .oracle-tools-btn .text {
        white-space: nowrap !important;
    }

    /* ================================================================
       FIX: Ensure web/search button visible in input bar
       ================================================================ */
    .input-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .search-toggle-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* ================================================================
       FIX: User message - Grey bubble like Gemini
       ================================================================ */
    .message.user {
        max-width: 60% !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Hide user avatar on desktop - clean like Gemini */
    .message.user .message-avatar {
        display: none !important;
    }

    /* Clean AI avatar - just the brain, no colors/borders/effects */
    .message.ai .message-avatar {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        animation: none !important;
        width: 32px !important;
        height: 32px !important;
    }

    /* Remove spinning ring around AI avatar */
    .message.ai .message-avatar::before {
        display: none !important;
    }

    .message.user .message-content {
        background: #303030 !important;
        border: none !important;
        border-radius: 20px 20px 4px 20px !important;
        padding: 12px 16px !important;
        box-shadow: none !important;
    }

    .message.user .message-text {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        color: #e0e0e0 !important;
        font-size: 15px !important;
        line-height: 1.5 !important;
        box-shadow: none !important;
    }

    /* ================================================================
       FIX: Settings panel - force dark background
       ================================================================ */
    .side-panel,
    #systemPanel,
    .side-panel .panel-content,
    #systemPanel .panel-content {
        background: #1F1F1F !important;
        background-color: #1F1F1F !important;
    }

    .side-panel .panel-header,
    #systemPanel .panel-header {
        background: #1F1F1F !important;
        background-color: #1F1F1F !important;
    }

    /* Settings panel sections - dark cards */
    .side-panel .metric-section,
    #systemPanel .metric-section {
        background: #252525 !important;
        background-color: #252525 !important;
    }

    /* Settings panel labels - gray */
    .side-panel .metric-label,
    #systemPanel .metric-label {
        color: #D1D5DB !important;
    }

    /* Settings panel values - white */
    .side-panel .metric-value,
    #systemPanel .metric-value {
        color: #FFFFFF !important;
    }

    /* Settings panel section titles - gray, not orange/red */
    .side-panel .metric-section-title,
    #systemPanel .metric-section-title {
        color: #9CA3AF !important;
        background: none !important;
        -webkit-text-fill-color: #9CA3AF !important;
    }

    /* ================================================================
       FIX: Greeting - no italics
       ================================================================ */
    .welcome-greeting,
    .welcome-greeting *,
    #welcomeGreeting,
    #welcomeGreeting * {
        font-style: normal !important;
        font-weight: 500 !important;
    }

    /* Force remove any em/i styling in greeting */
    .welcome-greeting em,
    .welcome-greeting i,
    #welcomeGreeting em,
    #welcomeGreeting i {
        font-style: normal !important;
    }

    /* ================================================================
       ENTITY CATEGORY DROPDOWN - Corporate Redesign
       Perplexity-inspired clean design, no gaming/flashy effects
       ================================================================ */

    /* Modal Background */
    .entity-category-dropdown {
        background: #1A1A1A !important;
        border: 1px solid #3F3F3F !important;
        border-radius: 16px !important;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
    }

    /* Header */
    .entity-dropdown-header {
        background: #1F1F1F !important;
        border-bottom: 1px solid #3F3F3F !important;
        padding: 18px 24px !important;
    }

    /* Header Title - Plain white, sentence case */
    .dropdown-title {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        background: none !important;
        -webkit-background-clip: unset !important;
        -webkit-text-fill-color: #FFFFFF !important;
        color: #FFFFFF !important;
    }

    /* Close Button - Gray, no glow */
    .dropdown-close {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        background: #2F2F2F !important;
        border: 1px solid #3F3F3F !important;
        border-radius: 8px !important;
        color: #6B7280 !important;
        font-size: 16px !important;
        font-weight: 400 !important;
        transition: all 0.15s ease !important;
        box-shadow: none !important;
    }

    .dropdown-close:hover {
        background: #3F3F3F !important;
        color: #FFFFFF !important;
        transform: none !important;
        border-color: #4F4F4F !important;
    }

    .dropdown-close:active {
        background: #4F4F4F !important;
        transform: scale(0.95) !important;
    }

    /* Scrollbar - Subtle */
    .entity-dropdown-content::-webkit-scrollbar-thumb {
        background: #4F4F4F !important;
        border-radius: 4px !important;
    }

    .entity-dropdown-content::-webkit-scrollbar-thumb:hover {
        background: #5F5F5F !important;
    }

    .entity-dropdown-content::-webkit-scrollbar-track {
        background: #1A1A1A !important;
    }

    /* Category Section */
    .entity-category {
        padding: 12px 16px !important;
        border-bottom: 1px solid #2F2F2F !important;
    }

    .entity-category:last-child {
        border-bottom: none !important;
    }

    /* Category Headers - Dark background, gray text, purple accent */
    .category-header {
        background: #2F2F2F !important;
        border-left: 3px solid #8B5CF6 !important;
        border-radius: 0 8px 8px 0 !important;
        padding: 10px 14px !important;
        margin-bottom: 10px !important;
    }

    .category-name {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        letter-spacing: 0 !important;
        text-transform: none !important;
        color: #9CA3AF !important;
        display: block !important;
        margin-bottom: 2px !important;
    }

    .category-desc {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.7rem !important;
        font-weight: 400 !important;
        color: #6B7280 !important;
    }

    /* Category entities scrollbar */
    .category-entities::-webkit-scrollbar-thumb {
        background: #4F4F4F !important;
    }

    .category-entities::-webkit-scrollbar-thumb:hover {
        background: #5F5F5F !important;
    }

    .category-entities::-webkit-scrollbar-track {
        background: #1F1F1F !important;
    }

    /* Entity Cards */
    .entity-option {
        background: #1F1F1F !important;
        border: 1px solid #3F3F3F !important;
        border-radius: 12px !important;
        padding: 12px 16px !important;
        transition: all 0.15s ease !important;
    }

    .entity-option::before {
        display: none !important; /* Remove gradient overlay */
    }

    .entity-option:hover {
        background: #2A2A2A !important;
        border-color: #4F4F4F !important;
        transform: none !important;
    }

    .entity-option.active {
        background: #2A2A2A !important;
        border-color: #8B5CF6 !important;
    }

    /* Entity Orb/Avatar - Keep colored circles but remove glow */
    .entity-orb-mini {
        width: 44px !important;
        height: 44px !important;
        box-shadow: none !important;
    }

    .entity-icon {
        filter: none !important;
    }

    /* Entity Names - Sentence case, white */
    .entity-info .entity-name {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
        text-transform: none !important;
        color: #FFFFFF !important;
        letter-spacing: 0 !important;
        margin-bottom: 3px !important;
    }

    /* Entity Descriptions - Muted gray */
    .entity-info .entity-desc {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 400 !important;
        color: #9CA3AF !important;
    }

    /* Active Badge - Purple, sentence case */
    .active-badge {
        background: #8B5CF6 !important;
        color: #FFFFFF !important;
        font-family: 'Inter', sans-serif !important;
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        text-transform: none !important;
        letter-spacing: 0 !important;
        padding: 4px 10px !important;
        border-radius: 12px !important;
        box-shadow: none !important;
    }

    /* ================================================================
       ORACLE THINKING INDICATOR - Shimmer Bar + Rotating Status
       (Matches Coding Studio style)
       ================================================================ */

    .oracle-thinking {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 14px 20px 6px;
    }

    .oracle-thinking-shimmer {
        height: 3px;
        border-radius: 2px;
        overflow: hidden;
        background: #1e1e24;
        width: 100%;
        max-width: 320px;
    }

    .oracle-thinking-shimmer-bar {
        height: 100%;
        width: 40%;
        border-radius: 2px;
        background: linear-gradient(90deg, #8ab4f8, #c084fc, #8ab4f8);
        background-size: 200% 100%;
        animation: oracleShimmerSlide 1.8s ease-in-out infinite;
    }

    @keyframes oracleShimmerSlide {
        0% { transform: translateX(-100%); background-position: 200% 0; }
        50% { background-position: 0% 0; }
        100% { transform: translateX(350%); background-position: 200% 0; }
    }

    .oracle-thinking-status {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        color: #9aa0a6;
        min-height: 20px;
    }

    .oracle-text {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 13px;
        font-weight: 400;
        color: #9aa0a6;
        animation: oracleTextFadeIn 0.4s ease-out;
    }

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

    .oracle-thinking-dots {
        display: inline-flex;
        gap: 3px;
        align-items: center;
    }

    .oracle-thinking-dots i {
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: #8ab4f8;
        display: inline-block;
        font-style: normal;
        animation: oracleDotBounce 1.4s ease-in-out infinite;
    }

    .oracle-thinking-dots i:nth-child(2) { animation-delay: 0.2s; }
    .oracle-thinking-dots i:nth-child(3) { animation-delay: 0.4s; }

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

    /* ================================================================
       THINKING PROGRESS STEPS - Perplexity "Working..." Style
       Shows progressive steps during AI processing
       ================================================================ */

    .thinking-progress-container {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 16px 20px;
        background: transparent;
    }

    .thinking-progress-step {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 14px;
        line-height: 1.4;
        transition: opacity 0.3s ease;
    }

    .thinking-progress-step.completed .step-icon {
        color: #10B981;
    }

    .thinking-progress-step.completed .step-text {
        color: #9CA3AF;
    }

    .thinking-progress-step.current .step-icon {
        color: #8B5CF6;
    }

    .thinking-progress-step.current .step-text {
        color: #FFFFFF;
        font-weight: 500;
    }

    .thinking-progress-step.pending {
        opacity: 0;
        height: 0;
        overflow: hidden;
    }

    .step-icon {
        flex-shrink: 0;
        width: 16px;
        text-align: center;
        font-size: 14px;
    }

    .step-spinner {
        width: 14px;
        height: 14px;
        border: 2px solid rgba(139, 92, 246, 0.3);
        border-top-color: #8B5CF6;
        border-radius: 50%;
        animation: stepSpin 0.8s linear infinite;
        display: inline-block;
    }

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

    .step-text {
        flex: 1;
    }

    /* Web search sources display */
    .thinking-sources {
        margin-left: 26px;
        margin-top: 6px;
        padding-left: 12px;
        border-left: 2px solid #3F3F3F;
    }

    .thinking-source-item {
        font-size: 12px;
        color: #6B7280;
        padding: 3px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 300px;
    }

    .thinking-source-query {
        font-size: 12px;
        color: #9CA3AF;
        font-style: italic;
        margin-bottom: 4px;
    }

    /* Fade out animation for thinking indicator */
    .thinking-indicator.fade-out {
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    /* ================================================================
       SHIMMER THINKING INDICATOR — Animated gradient bar + rotating status
       Used across main chat, deep think, and code building modes
       ================================================================ */

    .oracle-shimmer {
        display: flex;
        flex-direction: column;
        gap: 10px;
        padding: 14px 20px 8px;
    }

    .oracle-shimmer-bar-wrap {
        height: 3px;
        border-radius: 2px;
        overflow: hidden;
        background: #1e1e24;
        width: 100%;
        max-width: 320px;
    }

    .oracle-shimmer-bar {
        height: 100%;
        width: 40%;
        border-radius: 2px;
        background: linear-gradient(90deg, #a78bfa, #c084fc, #a78bfa);
        background-size: 200% 100%;
        animation: oracle-shimmer-slide 1.8s ease-in-out infinite;
    }

    /* Deep think mode: wider, more saturated bar */
    .oracle-shimmer.deep-think-shimmer .oracle-shimmer-bar-wrap {
        max-width: 400px;
    }
    .oracle-shimmer.deep-think-shimmer .oracle-shimmer-bar {
        background: linear-gradient(90deg, #8b5cf6, #a855f7, #d946ef, #a855f7, #8b5cf6);
        background-size: 300% 100%;
        animation: oracle-shimmer-slide 2.2s ease-in-out infinite;
    }

    @keyframes oracle-shimmer-slide {
        0%   { transform: translateX(-100%); background-position: 200% 0; }
        50%  { background-position: 0% 0; }
        100% { transform: translateX(350%); background-position: 200% 0; }
    }

    .oracle-shimmer-status {
        display: flex;
        align-items: center;
        gap: 8px;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
        font-size: 13px;
        color: #9ca3af;
        min-height: 20px;
    }

    .oracle-shimmer-status span:first-child {
        animation: oracle-text-fade 0.4s ease-out;
    }

    @keyframes oracle-text-fade {
        from { opacity: 0; transform: translateY(4px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .oracle-shimmer-dots {
        display: inline-flex;
        gap: 3px;
        align-items: center;
    }

    .oracle-shimmer-dots i {
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: #a78bfa;
        animation: oracle-dot-bounce 1.4s ease-in-out infinite;
        font-style: normal;
    }

    .oracle-shimmer-dots i:nth-child(2) { animation-delay: 0.2s; }
    .oracle-shimmer-dots i:nth-child(3) { animation-delay: 0.4s; }

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

    /* Deep think mode: purple dots */
    .oracle-shimmer.deep-think-shimmer .oracle-shimmer-dots i {
        background: #c084fc;
    }

    /* ================================================================
       EPIC CODE MODE BUILDING ANIMATION
       Premium loading experience for artifact creation
       ================================================================ */

    /* Ensure the thinking indicator takes full width in code building mode */
    .thinking-indicator.code-building-mode {
        width: 100%;
        max-width: 600px;
    }

    .code-building-container {
        position: relative;
        padding: 24px;
        width: 100%;
        min-width: 400px;
        background: linear-gradient(135deg, rgba(16, 16, 20, 0.98) 0%, rgba(24, 24, 32, 0.95) 100%);
        border: 1px solid rgba(139, 92, 246, 0.3);
        border-radius: 20px;
        overflow: hidden;
        box-shadow:
            0 0 40px rgba(139, 92, 246, 0.15),
            0 0 80px rgba(99, 102, 241, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
    }

    /* Animated grid background */
    .code-building-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background:
            linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px),
            linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px);
        background-size: 20px 20px;
        animation: gridPulse 4s ease-in-out infinite;
        pointer-events: none;
    }

    @keyframes gridPulse {
        0%, 100% { opacity: 0.3; }
        50% { opacity: 0.6; }
    }

    /* Matrix rain effect container */
    .matrix-rain {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 100%;
        overflow: hidden;
        opacity: 0.15;
        pointer-events: none;
    }

    .matrix-column {
        position: absolute;
        top: -100%;
        font-family: 'SF Mono', 'Fira Code', monospace;
        font-size: 12px;
        color: #8B5CF6;
        text-shadow: 0 0 8px #8B5CF6;
        writing-mode: vertical-rl;
        animation: matrixFall linear infinite;
        white-space: nowrap;
    }

    @keyframes matrixFall {
        0% { transform: translateY(0); }
        100% { transform: translateY(300%); }
    }

    /* Header with main title */
    .code-building-header {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 20px;
    }

    .code-building-icon {
        width: 56px;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.1));
        border: 1px solid rgba(139, 92, 246, 0.4);
        border-radius: 16px;
        font-size: 28px;
        animation: iconFloat 3s ease-in-out infinite;
    }

    @keyframes iconFloat {
        0%, 100% { transform: translateY(0) scale(1); }
        50% { transform: translateY(-4px) scale(1.05); }
    }

    .code-building-title {
        flex: 1;
    }

    .code-building-title h3 {
        margin: 0 0 4px 0;
        font-size: 18px;
        font-weight: 600;
        color: #FFFFFF;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    }

    .code-building-phase {
        font-size: 14px;
        color: #A78BFA;
        font-weight: 500;
        animation: phaseGlow 2s ease-in-out infinite;
    }

    @keyframes phaseGlow {
        0%, 100% { opacity: 1; text-shadow: 0 0 10px rgba(167, 139, 250, 0.5); }
        50% { opacity: 0.8; text-shadow: 0 0 20px rgba(167, 139, 250, 0.8); }
    }

    /* 3D Spinning Cube */
    .code-cube-container {
        perspective: 200px;
        width: 40px;
        height: 40px;
    }

    .code-cube {
        width: 100%;
        height: 100%;
        position: relative;
        transform-style: preserve-3d;
        animation: cubeRotate 4s linear infinite;
    }

    .code-cube-face {
        position: absolute;
        width: 40px;
        height: 40px;
        border: 2px solid rgba(139, 92, 246, 0.6);
        background: rgba(139, 92, 246, 0.1);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #A78BFA;
    }

    .code-cube-face.front  { transform: translateZ(20px); }
    .code-cube-face.back   { transform: rotateY(180deg) translateZ(20px); }
    .code-cube-face.right  { transform: rotateY(90deg) translateZ(20px); }
    .code-cube-face.left   { transform: rotateY(-90deg) translateZ(20px); }
    .code-cube-face.top    { transform: rotateX(90deg) translateZ(20px); }
    .code-cube-face.bottom { transform: rotateX(-90deg) translateZ(20px); }

    @keyframes cubeRotate {
        0% { transform: rotateX(0deg) rotateY(0deg); }
        100% { transform: rotateX(360deg) rotateY(360deg); }
    }

    /* Epic Progress Bar */
    .code-progress-section {
        position: relative;
        z-index: 2;
        margin-bottom: 20px;
    }

    .code-progress-bar-container {
        height: 8px;
        background: rgba(30, 30, 40, 0.8);
        border-radius: 4px;
        overflow: hidden;
        border: 1px solid rgba(139, 92, 246, 0.2);
    }

    .code-progress-bar {
        height: 100%;
        background: linear-gradient(90deg, #8B5CF6, #A78BFA, #C4B5FD, #A78BFA, #8B5CF6);
        background-size: 200% 100%;
        border-radius: 4px;
        animation: progressShimmer 2s ease-in-out infinite;
        transition: width 0.5s ease-out;
    }

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

    .code-progress-glow {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 20px;
        background: radial-gradient(ellipse, rgba(139, 92, 246, 0.8), transparent);
        filter: blur(4px);
        animation: glowPulse 1s ease-in-out infinite;
    }

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

    /* Stats Grid */
    .code-stats-grid {
        position: relative;
        z-index: 2;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .code-stat-item {
        padding: 12px;
        background: rgba(20, 20, 28, 0.7);
        border: 1px solid rgba(139, 92, 246, 0.15);
        border-radius: 12px;
        text-align: center;
    }

    .code-stat-value {
        font-size: 20px;
        font-weight: 700;
        color: #A78BFA;
        font-family: 'SF Mono', 'Fira Code', monospace;
        margin-bottom: 2px;
        animation: countUp 0.3s ease-out;
    }

    @keyframes countUp {
        from { transform: scale(1.2); opacity: 0.5; }
        to { transform: scale(1); opacity: 1; }
    }

    /* Real-time stat update pulse effect */
    .code-stat-value.stat-updated {
        animation: statPulse 0.3s ease-out;
        color: #C4B5FD;
    }

    @keyframes statPulse {
        0% { transform: scale(1); }
        50% { transform: scale(1.15); color: #DDD6FE; text-shadow: 0 0 10px rgba(167, 139, 250, 0.5); }
        100% { transform: scale(1); }
    }

    .code-stat-label {
        font-size: 11px;
        color: #6B7280;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Live Code Snippet Flyby */
    .code-snippets-container {
        position: relative;
        z-index: 2;
        height: 60px;
        overflow: hidden;
        background: rgba(15, 15, 20, 0.8);
        border-radius: 10px;
        border: 1px solid rgba(139, 92, 246, 0.15);
        margin-bottom: 16px;
        font-family: 'SF Mono', 'Fira Code', monospace;
        font-size: 12px;
    }

    .code-snippet-line {
        position: absolute;
        white-space: nowrap;
        padding: 4px 12px;
        color: #E2E8F0;
        animation: snippetFly 4s linear infinite;
        opacity: 0;
    }

    @keyframes snippetFly {
        0% { transform: translateX(100%); opacity: 0; }
        10% { opacity: 1; }
        90% { opacity: 1; }
        100% { transform: translateX(-100%); opacity: 0; }
    }

    .code-snippet-line .keyword { color: #C792EA; }
    .code-snippet-line .function { color: #82AAFF; }
    .code-snippet-line .string { color: #C3E88D; }
    .code-snippet-line .number { color: #F78C6C; }
    .code-snippet-line .comment { color: #676E95; }

    /* Fun Message */
    .code-fun-message {
        position: relative;
        z-index: 2;
        text-align: center;
        font-size: 13px;
        color: #9CA3AF;
        font-style: italic;
        padding: 8px;
        min-height: 20px;
    }

    .code-fun-message span {
        display: inline-block;
        animation: messageAppear 0.5s ease-out;
    }

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

    /* Libraries Loading */
    .code-libraries {
        position: relative;
        z-index: 2;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 16px;
        justify-content: center;
    }

    .code-library-badge {
        padding: 4px 10px;
        background: rgba(139, 92, 246, 0.1);
        border: 1px solid rgba(139, 92, 246, 0.3);
        border-radius: 20px;
        font-size: 11px;
        color: #A78BFA;
        font-family: 'SF Mono', 'Fira Code', monospace;
        animation: badgePopIn 0.4s ease-out backwards;
    }

    @keyframes badgePopIn {
        from { transform: scale(0); opacity: 0; }
        to { transform: scale(1); opacity: 1; }
    }

    /* Elapsed Time */
    .code-elapsed-time {
        position: absolute;
        top: 16px;
        right: 16px;
        font-size: 12px;
        color: #6B7280;
        font-family: 'SF Mono', 'Fira Code', monospace;
        z-index: 3;
    }

    /* Particle Effects */
    .code-particles {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        pointer-events: none;
        overflow: hidden;
        z-index: 1;
    }

    .code-particle {
        position: absolute;
        width: 4px;
        height: 4px;
        background: #8B5CF6;
        border-radius: 50%;
        animation: particleFloat 3s ease-in-out infinite;
    }

    @keyframes particleFloat {
        0%, 100% {
            transform: translateY(0) scale(1);
            opacity: 0.6;
        }
        50% {
            transform: translateY(-20px) scale(1.5);
            opacity: 1;
        }
    }

    /* ================================================================
       AUTONOMOUS MESSAGES - Clean corporate styling
       ================================================================ */

    /* Hide sound/listen button on autonomous messages */
    .autonomous-listen-btn,
    .autonomous-message .listen-btn,
    .autonomous-message .sound-btn,
    .message.autonomous .listen-btn,
    .message.autonomous .sound-btn {
        display: none !important;
    }

    /* Clean autonomous badge - white text, subtle border */
    .autonomous-badge,
    .message.autonomous .autonomous-badge {
        background: transparent !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 12px !important;
        color: #ffffff !important;
        font-family: 'Inter', -apple-system, sans-serif !important;
        font-size: 0.7rem !important;
        font-weight: 500 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.03em !important;
        padding: 4px 10px !important;
        box-shadow: none !important;
    }


    /* ================================================================
       PRODUCT CARDS - Clickable product cards for shopping results
       ================================================================ */

    .product-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 16px;
        margin: 20px 0;
        width: 100%;
    }

    .product-card {
        display: flex;
        flex-direction: column;
        background: #1e1e1e;
        border: 1px solid #2a2a2a;
        border-radius: 12px;
        overflow: hidden;
        text-decoration: none;
        color: inherit;
        transition: all 0.2s ease;
    }

    .product-card:hover {
        transform: translateY(-2px);
        border-color: #3a3a3a;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }

    .product-card-image {
        width: 100%;
        height: 180px;
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        background-color: #fff;
        border-radius: 12px 12px 0 0;
    }

    .product-card-no-image {
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 3rem;
        color: rgba(255, 255, 255, 0.9);
    }

    .product-source-initial {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        font-weight: 700;
        color: #fff;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }

    .product-card-content {
        padding: 14px;
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .product-card-title {
        font-size: 0.9rem;
        font-weight: 500;
        color: #e5e7eb;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .product-card-price {
        font-size: 1.1rem;
        font-weight: 700;
        color: #ffffff;
    }

    .product-card-rating {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 0.85rem;
    }

    .product-star {
        color: #4a4a4a;
    }

    .product-star.filled {
        color: #fbbf24;
    }

    .product-star.half {
        background: linear-gradient(90deg, #fbbf24 50%, #4a4a4a 50%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

    .rating-num {
        color: #9ca3af;
        font-size: 0.8rem;
        margin-left: 4px;
    }

    .product-card-source {
        font-size: 0.75rem;
        color: #6b7280;
        margin-top: 4px;
    }

    /* ================================================================
       VOICE MODE CONTROLS - Desktop uniform styling
       ================================================================ */

    .oracle-controls-container {
        position: fixed !important;
        bottom: 40px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        gap: 12px !important;
        align-items: center !important;
        z-index: 10000 !important;
    }

    /* All three buttons: Screen Share, Stop, Close - uniform styling */
    .oracle-screen-share-btn,
    .oracle-stop-btn,
    .oracle-close-btn {
        width: 48px !important;
        height: 48px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 8px !important;
        color: rgba(255, 255, 255, 0.8) !important;
        cursor: pointer !important;
        transition: all 0.2s ease !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Stop button - ensure visible with square stop icon */
    .oracle-stop-btn {
        display: flex !important;
    }

    .oracle-stop-btn:hover {
        background: rgba(255, 100, 100, 0.2) !important;
        border-color: rgba(255, 100, 100, 0.4) !important;
        color: #ff6b6b !important;
    }

    .oracle-screen-share-btn:hover {
        background: rgba(100, 150, 255, 0.2) !important;
        border-color: rgba(100, 150, 255, 0.4) !important;
        color: #6b9fff !important;
    }

    .oracle-close-btn:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        border-color: rgba(255, 255, 255, 0.3) !important;
    }
}

/* ================================================================
   END OF DESKTOP-ONLY STYLES
   ================================================================ */
