        :root, body.dark-theme {
            --bg-dark: #0a0a0a;
            --bg-medium: #1a1a1a;
            --bg-light: rgba(255, 255, 255, 0.03);
            --text-primary: #e0e0e0;
            --text-secondary: #9ca3af; 
            --accent: #FFBF00;
            --accent-glow: rgba(255, 191, 0, 0.2);
            --danger: #ef4444;
            --danger-glow: rgba(239, 68, 68, 0.2);
            --success: #22c55e;
            --success-glow: rgba(34, 197, 94, 0.2);
            --primary-glow: rgba(224, 224, 224, 0.1);
        }

        body.light-theme {
            --bg-dark: #f0f2f5;
            --bg-medium: #ffffff;
            --bg-light: #e4e6eb;
            --text-primary: #050505;
            --text-secondary: #65676b;
            --accent: #FFD700; /* Brighter Yellow */
            --accent-glow: rgba(255, 215, 0, 0.3);
            --danger: #dc2626;
            --danger-glow: rgba(220, 38, 38, 0.2);
            --success: #16a34a;
            --success-glow: rgba(22, 163, 74, 0.2);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        html, body {
            height: 100%;
            scroll-behavior: smooth;
            overflow-x: hidden; /* Prevent horizontal scroll */
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-dark);
            color: var(--text-primary);
            display: flex;
            justify-content: center;
            align-items: flex-start;
            overflow-y: auto;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            transition: background-color 0.3s, color 0.3s;
        }
        
        /* === CUSTOM GOLD SCROLLBARS === */
        ::-webkit-scrollbar {
            width: 10px;
            height: 10px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.03);
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb {
            background: rgba(100, 100, 100, 0.5);
            border-radius: 10px;
            border: 2px solid var(--bg-dark);
            transition: all 0.3s ease;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
            box-shadow: 0 0 10px rgba(255, 191, 0, 0.4);
        }

        /* Firefox scrollbar */
        * {
            scrollbar-width: thin;
            scrollbar-color: rgba(100, 100, 100, 0.5) rgba(255, 255, 255, 0.03);
        }

        /* === DATETIME PICKER INPUT STYLING === */
        input[type="date"],
        input[type="time"],
        input[type="datetime-local"] {
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
            border: 2px solid rgba(255, 191, 0, 0.3);
            border-radius: 12px;
            padding: 0.9rem 1.2rem;
            color: var(--text-primary);
            font-family: 'Inter', sans-serif;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        input[type="date"]:hover,
        input[type="time"]:hover,
        input[type="datetime-local"]:hover {
            border-color: rgba(255, 191, 0, 0.6);
            background: linear-gradient(135deg, rgba(255, 191, 0, 0.1) 0%, rgba(255, 191, 0, 0.05) 100%);
            box-shadow: 0 4px 12px rgba(255, 191, 0, 0.2);
            transform: translateY(-1px);
        }

        input[type="date"]:focus,
        input[type="time"]:focus,
        input[type="datetime-local"]:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 4px rgba(255, 191, 0, 0.15), 0 4px 12px rgba(255, 191, 0, 0.3);
            background: linear-gradient(135deg, rgba(255, 191, 0, 0.12) 0%, rgba(255, 191, 0, 0.06) 100%);
        }

        /* Gold calendar/clock icon */
        input[type="date"]::-webkit-calendar-picker-indicator,
        input[type="time"]::-webkit-calendar-picker-indicator,
        input[type="datetime-local"]::-webkit-calendar-picker-indicator {
            filter: brightness(0) saturate(100%) invert(79%) sepia(68%) saturate(515%) hue-rotate(360deg) brightness(104%) contrast(101%);
            cursor: pointer;
            opacity: 0.8;
            transition: all 0.2s;
            width: 20px;
            height: 20px;
        }

        input[type="date"]::-webkit-calendar-picker-indicator:hover,
        input[type="time"]::-webkit-calendar-picker-indicator:hover,
        input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
            opacity: 1;
            transform: scale(1.1);
        }
        

        /* === CUSTOM DROPDOWN ENGINE === */
        /* COMPLETELY HIDE native selects - they were bleeding through custom dropdowns */
        select {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
            position: absolute !important;
            pointer-events: none !important;
            z-index: -99999 !important;
            width: 0 !important;
            height: 0 !important;
        }

        /* Fix Z-Index overlap for open dropdowns */
        .custom-select-wrapper.open {
            z-index: 9999 !important;
        }

        /* Custom dropdown wrapper */
        /* Custom Dropdown - Dynamic Island Style */
        .custom-select-wrapper { 
            position: relative; 
            width: 180px; 
            z-index: 99999;
        }
        .custom-select {
            width: 100%;
            background: rgba(30, 30, 30, 0.85);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            color: var(--text-primary);
            padding: 1rem 1.25rem;
            border-radius: 12px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: background 0.15s ease, border-color 0.15s ease;
            position: relative;
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
        
        /* ONLY limit width for settings modal dropdowns */
        #settings-modal .custom-select-wrapper {
            max-width: 200px;
            margin-left: auto;
        }
        
        /* Make settings dropdown options smaller */
        #settings-modal .custom-select-options.open {
            min-height: auto !important;
            max-height: 150px !important;
        }
        
        /* Fix label wrapping in settings */
        #settings-modal .setting label {
            white-space: nowrap;
            min-width: 120px;
        }
        .custom-select:hover {
            background: rgba(40, 40, 40, 0.95);
            border-color: rgba(255, 191, 0, 0.2);
        }
        .custom-select.open {
            background: rgba(35, 35, 35, 0.95);
            border-color: rgba(255, 191, 0, 0.3);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 191, 0, 0.25);
        }
        .custom-select::after {
            content: 'Γû▓';
            font-size: 0.6em;
            color: var(--accent);
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            transform: rotate(180deg); /* Points DOWN when closed */
        }
        .custom-select.open::after { 
            transform: rotate(0deg); /* Points UP when open - perfectly straight */
        }
        .custom-select-options {
            position: fixed; /* Fixed to viewport since it's on body */
            z-index: 9999999 !important; /* MAX Z-INDEX */
            background: rgba(25, 25, 25, 0.98);
            backdrop-filter: blur(40px) saturate(200%);
            -webkit-backdrop-filter: blur(40px) saturate(200%);
            border-radius: 16px;
            overflow-x: hidden;
            overflow-y: auto;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
            border: 1px solid rgba(255, 191, 0, 0.15);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
            max-height: 400px;
            height: auto;
            /* Default animation state (for downward opening) */
            transform: translateY(10px) scale(0.95);
        }

        .custom-select-options.opening-up {
            /* Animation state for upward opening */
            transform: translateY(-10px) scale(0.95);
            box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
        }

        .custom-select-options.open {
            display: block !important;
            min-height: 200px;
            opacity: 1;
            transform: translateY(0) scale(1); /* Slides into place */
            pointer-events: auto;
        }
        .custom-select-options::-webkit-scrollbar { width: 6px; }
        .custom-select-options::-webkit-scrollbar-track { background: transparent; }
        .custom-select-options::-webkit-scrollbar-thumb { 
            background: rgba(255, 191, 0, 0.3); 
            border-radius: 3px;
        }
        .custom-select-options::-webkit-scrollbar-thumb:hover { 
            background: var(--accent); 
        }

        .custom-select.open .custom-select-options {
            opacity: 1;
            transform: translateY(0) scale(1); /* Slides UP into place */
            pointer-events: auto;
        }
        .custom-select-option {
            padding: 0.85rem 1.2rem;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
            animation: slide-fade-in 0.3s forwards;
            opacity: 0;
            color: rgba(255, 255, 255, 0.8);
            border-radius: 16px;
            margin: 0.3rem 0.5rem;
            font-size: 0.95rem;
        }
        .custom-select-option:hover {
            background: rgba(255, 191, 0, 0.15);
            color: rgba(255, 255, 255, 0.95);
            transform: scale(0.98);
        }
        .custom-select-option.selected {
            background: rgba(255, 191, 0, 0.2);
            color: var(--accent);
            font-weight: 600;
            box-shadow: inset 0 0 0 1px rgba(255, 191, 0, 0.3);
        }

        /* Custom scrollbar for options */
        .custom-options::-webkit-scrollbar {
            width: 8px;
        }

        .custom-options::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
        }

        .custom-options::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }

        .custom-options::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }
        
        /* CUSTOM CALENDAR STYLING */
        input[type="datetime-local"] {
            background: linear-gradient(135deg, var(--bg-light) 0%, rgba(26, 26, 46, 0.9) 100%);
            border: 2px solid rgba(255, 191, 0, 0.2);
            color: var(--text-primary);
            padding: 1rem 1.25rem;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            width: 100%;
        }
        
        input[type="datetime-local"]:hover {
            border-color: rgba(255, 191, 0, 0.5);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 191, 0, 0.2);
        }
        
        input[type="datetime-local"]:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 4px rgba(255, 191, 0, 0.25);
        }
        
        /* Calendar picker styling */
        input[type="datetime-local"]::-webkit-calendar-picker-indicator {
            filter: invert(1) sepia(1) saturate(5) hue-rotate(360deg) brightness(1.2);
            cursor: pointer;
            padding: 4px;
            border-radius: 4px;
            transition: all 0.2s;
        }
        
        input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
            background: rgba(255, 191, 0, 0.2);
        }
       
        body::-webkit-scrollbar { width: 10px; }
        body::-webkit-scrollbar-track { background: var(--bg-dark); }
        body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 6px; border: 2px solid var(--bg-dark); }
        body::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

        /* Survey container scrollbar */
        #survey-container::-webkit-scrollbar { width: 10px; }
        #survey-container::-webkit-scrollbar-track { background: var(--bg-dark); }
        #survey-container::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 6px; border: 2px solid var(--bg-dark); }
        #survey-container::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.4); }

        body.light-theme {
             background-image: none;
        }
       
        html.has-open-modal {
            overflow: hidden;
        }
        body.has-open-modal #clara-fab, body.has-open-modal .clara-tooltip {
            display: none;
        }
       
        /* --- Animations --- */
        @keyframes slide-fade-in {
            from {
                opacity: 0;
                transform: translateY(10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes breathe {
            from {
                transform: scale(1);
                box-shadow: 0 8px 20px var(--accent-glow);
            }
            to {
                transform: scale(1.07);
                box-shadow: 0 12px 30px var(--accent-glow);
            }
        }

        @keyframes pulsate-glow {
            0%, 100% {
                box-shadow: 0 0 15px var(--accent-glow), inset 0 0 10px rgba(255, 191, 0, 0.1);
                border-color: var(--accent);
            }
            50% {
                box-shadow: 0 0 30px var(--accent-glow), inset 0 0 15px rgba(255, 191, 0, 0.2);
                border-color: var(--accent);
            }
        }

        /* --- Quote Splash Screen --- */
        #splash-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.98);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            padding: 2rem;
            text-align: center;
            transition: opacity 0.5s ease-out;
        }

        #quote-text {
            font-size: clamp(1.5rem, 4vw, 2.2rem);
            font-weight: 500;
            max-width: 800px;
            line-height: 1.4;
            margin-bottom: 2rem;
            color: #fff;
            min-height: 150px;
        }

        .splash-buttons {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        #splash-screen button {
            background: transparent;
            border: 2px solid var(--accent);
            color: var(--accent);
            padding: 1rem 2.5rem;
            font-size: 1.2rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }

        #splash-screen button#enter-btn {
            background: var(--accent);
            color: #0a0a0a;
        }


        #splash-screen button:hover {
            opacity: 0.8;
            box-shadow: 0 4px 10px var(--accent-glow);
        }

        /* Interactive Flame Styles */
        .vfx-fire-container {
            display: inline-block;
            margin-bottom: 2rem;
            position: relative;
            cursor: pointer;
            transition: transform 0.3s ease;
        }

        .vfx-fire-main {
            font-size: 6rem;
            filter: drop-shadow(0 0 20px rgba(255, 191, 0, 0.7));
            animation: flicker 2s infinite ease-in-out;
            transition: all 0.3s ease;
        }

        .vfx-fire-container:hover .vfx-fire-main {
            transform: scale(1.15);
            filter: drop-shadow(0 0 30px rgba(255, 191, 0, 1));
        }

        .flame-particle {
            position: absolute;
            font-size: 2rem;
            pointer-events: none;
            opacity: 0;
            animation: flameRise 1.5s ease-out forwards;
        }

        @keyframes flicker {
            0%, 100% { transform: scale(1) rotate(-2deg); opacity: 1; }
            50% { transform: scale(1.05) rotate(2deg); opacity: 0.95; }
        }

        @keyframes flameRise {
            0% {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
            100% {
                opacity: 0;
                transform: translateY(-120px) scale(0.3) rotate(20deg);
            }
        }

        /* --- Login Screen Styles --- */
        #google-login-btn:hover, #facebook-login-btn:hover, #github-login-btn:hover {
            transform: translateY(-3px) scale(1.02);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5) !important;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(100px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes slideOutRight {
            from {
                opacity: 1;
                transform: translateX(0);
            }
            to {
                opacity: 0;
                transform: translateX(100px);
            }
        }

        @keyframes fadeIn {
            from { opacity: 0; transform: translate(-50%, -45%); }
            to { opacity: 1; transform: translate(-50%, -50%); }
        }

        @keyframes fadeOut {
            from { opacity: 1; transform: translate(-50%, -50%); }
            to { opacity: 0; transform: translate(-50%, -45%); }
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Profile Dropdown Styles */
        .dropdown-menu-item {
            width: 100%;
            padding: 0.75rem 1rem;
            background: transparent;
            border: none;
            color: var(--text-primary);
            font-size: 0.9rem;
            font-weight: 500;
            text-align: left;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            border-radius: 8px;
            transition: all 0.2s ease;
        }

        .dropdown-menu-item:hover {
            background: rgba(255,255,255,0.05);
        }

        .dropdown-menu-item svg {
            flex-shrink: 0;
        }

        /* --- Main Layout --- */
        #app-wrapper {
            width: 100%;
            max-width: 1200px;
            opacity: 0;
            transform: scale(0.95);
            transition: opacity 0.5s ease, transform 0.5s ease;
            padding: 2rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        #app-wrapper.visible {
            opacity: 1;
            transform: scale(1);
        }
       
        .top-bar {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .top-bar button, .currency-display, .user-display, .clock-display {
            background: var(--bg-light);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            color: var(--text-secondary);
            padding: 0.7rem 1.2rem;
            font-size: 0.9rem;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
            height: 40px;
            position: relative; /* For notification dot */
        }

        .notification-dot {
            width: 8px;
            height: 8px;
            background-color: var(--accent);
            border-radius: 50%;
            border: 1px solid var(--bg-medium);
            flex-shrink: 0;
            display: none; /* Hidden by default */
        }
        .notification-dot.visible {
            display: block;
        }
       
        .clock-display {
            cursor: pointer;
            font-variant-numeric: tabular-nums;
        }

        .currency-display {
            background: var(--bg-medium);
            border: 1px solid var(--bg-light);
        }

        .currency-display span {
            color: var(--accent);
            font-size: 1.1rem;
        }
         .currency-display.in-debt span {
            color: var(--danger);
        }
       
        .top-bar button:hover {
            background: var(--bg-medium);
            color: var(--text-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px var(--primary-glow);
        }
        .user-display {
            padding: 0.25rem 1rem 0.25rem 0.25rem;
            cursor: default;
        }
        .user-display img {
            width: 32px;
            height: 32px;
            border-radius: 50%;
        }

        .main-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 2rem;
            width: 100%;
        }

        .panel {
            padding: 1.5rem;
            background: rgba(10, 10, 10, 0.7); /* Dark black glass */
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.15); /* Subtle shiny border */
            backdrop-filter: blur(20px) saturate(120%);
            -webkit-backdrop-filter: blur(20px) saturate(120%);
            box-shadow: 
                0 8px 32px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.08); /* Subtle top shine */
            position: relative;
        }
       
        body.light-theme .panel {
             background-color: var(--bg-medium);
             border: 1px solid var(--bg-light);
        }


        .main-panel {
             min-height: 600px;
        }
       
        body.dark-when-running .panel:not(#timer-panel) {
            opacity: 0.3;
        }
       
        .panel.dimmed {
            opacity: 0.4;
            pointer-events: none;
        }

        .panel-title {
            font-size: 1.5rem;
            font-weight: 900;
            margin-bottom: 1.5rem;
            text-transform: uppercase;
            letter-spacing: 2px;
            color: var(--text-secondary);
        }
       
        /* --- Timer Panel (The Forge) --- */
        #timer-panel {
            justify-content: space-between;
            align-items: center;
            transition: all 0.5s ease-out; /* Added for animation */
        }

        #timer-panel.forging {
            animation: pulsate-glow 4s ease-in-out infinite;
        }
       
        #timer-panel .panel-title {
            font-size: 1.2rem;
        }

        #current-task-display {
            min-height: 50px;
            font-size: 1.2rem;
            font-weight: 500;
            text-align: center;
            color: var(--accent);
            transition: color 0.3s ease;
        }

        #timer-display {
            font-size: clamp(5rem, 15vw, 8rem);
            font-weight: 900;
            margin: 1rem 0;
            color: var(--text-primary);
            letter-spacing: -5px;
        }
       
        .timer-buttons button {
            background: var(--accent);
            color: #0a0a0a;
            border: none;
            padding: 1rem 3rem;
            font-size: 1.5rem;
            font-weight: 700;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.2s ease;
            margin: 0 0.5rem;
            min-width: 200px;
        }
       
        .timer-buttons button:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 15px var(--accent-glow);
        }
       
        .timer-buttons button#pause-btn {
            background: var(--bg-light);
            color: var(--text-primary);
        }
         .timer-buttons button#pause-btn:hover {
            box-shadow: 0 8px 15px var(--primary-glow);
         }
       
        .timer-buttons button#reset-btn {
            background: transparent;
            border: 2px solid var(--text-secondary);
            color: var(--text-secondary);
            font-size: 1rem;
            padding: 0.5rem 1rem;
            min-width: auto;
        }
       
        .rank-display {
            width: 100%;
            padding-top: 2rem;
            border-top: 1px solid var(--bg-light);
            text-align: center;
        }
       
        .rank-display p {
            color: var(--text-secondary);
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.5rem;
        }

        .rank-display span {
            color: var(--text-primary);
            font-weight: 700;
            font-size: 1.2rem;
        }
        #pay-rate-display {
            color: var(--accent);
        }

        .progress-bar-container {
            width: 100%;
/* Intel Survey Dropdown Fixes */
#intel-survey-panel select {
    width: 100%;
    max-width: none; /* remove 300px limit */
}
#intel-survey-panel .custom-select-trigger {
    width: 100%; /* Fill space */
    min-width: 0;
}
#intel-survey-panel .dropdown-wrapper {
    width: 100%;
    max-width: 500px; /* Reasonable max width but filling space */
}
/* Ensure dropdowns can overflow the survey pages */
#survey-container {
    overflow: visible !important; 
}
#survey-pages {
    overflow: visible !important;
}
.survey-page {
    overflow: visible !important;
}
            min-width: 150px;
            height: 8px;
            background-color: var(--bg-light);
            border-radius: 4px;
            overflow: hidden;
            margin-top: 1rem;
        }

        #rank-progress-bar {
            height: 100%;
            width: 0%;
            background-color: var(--accent);
            border-radius: 4px;
            transition: width 0.5s ease-out;
        }

        /* --- To-Do Panel (The Ledger) --- */
        #todo-panel { display: flex; flex-direction: column; }
        #add-task-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
        #task-input { flex-grow: 1; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 0.8rem; color: var(--text-primary); font-size: 1rem; transition: border-color 0.2s; min-width: 200px;}
        #task-input:focus { outline: none; border-color: var(--accent); background: rgba(255, 255, 255, 0.2); }
        #pomo-estimate { width: 60px; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 0.8rem; color: var(--text-primary); font-size: 1rem; text-align: center; }
        #goal-input { width: 100%; background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 6px; padding: 0.8rem; color: var(--text-primary); font-size: 1rem; margin-bottom: 1rem; }
        #add-task-btn, #breakdown-task-btn, #add-goal-btn { background: var(--accent); border: none; color: #0a0a0a; font-size: 1.5rem; font-weight: 700; border-radius: 6px; width: 50px; cursor: pointer; transition: all 0.2s; display: flex; justify-content: center; align-items: center; }
        #breakdown-task-btn { background: rgba(255, 255, 255, 0.15); color: var(--accent); border: 1px solid rgba(255, 255, 255, 0.1); }
        #add-task-btn:hover, #add-goal-btn:hover { transform: scale(1.05); box-shadow: 0 4px 10px var(--accent-glow); }
        #breakdown-task-btn:hover { transform: scale(1.05); box-shadow: 0 4px 10px var(--primary-glow); background: rgba(255, 255, 255, 0.25); }

        #task-suggestions { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
        .suggestion-item { background: var(--bg-medium); color: var(--text-primary); padding: 0.8rem; border-radius: 6px; cursor: pointer; transition: background 0.2s; text-align: left; border: 1px solid var(--bg-light); animation: slide-fade-in 0.3s ease-out forwards; }
        .suggestion-item:hover { background: var(--bg-light); }
       
        .task-list { list-style: none; flex-grow: 1; overflow-y: auto; padding-right: 10px; }
        .task-list::-webkit-scrollbar { width: 8px; }
        .task-list::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px;}
        .task-list::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px;}
        .task-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
        .task-item { display: flex; align-items: center; background: var(--bg-medium); padding: 1rem; border-radius: 8px; margin-bottom: 0.5rem; cursor: pointer; border: 2px solid transparent; transition: all 0.2s ease; }
        .task-item:hover { border-color: var(--accent-glow); transform: translateY(-2px); }
        .task-item.selected { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }
        .task-text { flex-grow: 1; font-size: 1rem; }
        .task-pomos { font-weight: 700; color: var(--accent); margin: 0 1rem; }
        .delete-task-btn { background: transparent; border: none; color: var(--text-secondary); font-size: 1.2rem; cursor: pointer; transition: color 0.2s; }
        .delete-task-btn:hover { color: var(--danger); }
        #completed-tasks { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--bg-light); }
        #completed-tasks .task-item { opacity: 0.5; }
        #completed-tasks .task-item .task-text { text-decoration: line-through; }

        /* --- Blueprint Panel (The War Room) --- */
        #blueprint-panel {
            grid-column: 1 / -1;
        }

        .goals-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .goal-item {
            background: var(--bg-medium);
            border-radius: 8px;
            padding: 1.5rem;
            border: 1px solid var(--bg-light);
        }

        .goal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .goal-header h3 {
            font-size: 1.2rem;
            font-weight: 700;
            color: var(--accent);
        }

        .milestones-list {
            list-style: none;
            margin-left: 1.5rem;
            border-left: 2px solid var(--bg-light);
            padding-left: 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .milestone-item {
            background: var(--bg-dark);
            padding: 1rem;
            border-radius: 6px;
        }

        .milestone-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }

        .milestone-header h4 {
            font-size: 1rem;
            font-weight: 600;
        }

        .blueprint-tasks-list {
            list-style: none;
            padding-left: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .blueprint-task-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem;
            background: var(--bg-medium);
            border-radius: 4px;
        }

        .blueprint-actions button {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 0.2rem;
            transition: color 0.2s;
        }
        .blueprint-actions button:hover {
            color: var(--accent);
        }
        .blueprint-actions button.delete:hover {
            color: var(--danger);
        }

        #add-goal-form {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1.5rem;
        }
        #goal-input {
            flex-grow: 1;
            background: var(--bg-light);
            border: 1px solid transparent;
            border-radius: 6px;
            padding: 0.8rem;
            color: var(--text-primary);
            font-size: 1rem;
        }
        #add-goal-btn {
            background: var(--accent);
            border: none;
            color: #0a0a0a;
            font-size: 1.5rem;
            font-weight: 700;
            border-radius: 6px;
            width: 50px;
            cursor: pointer;
        }

        /* --- Stats and Graph Panel --- */
        #reckoning-panel { 
            grid-column: 1 / -1; 
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }
        .stats-grid { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
            gap: 1.5rem;
        }
        .stat-box { 
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(10px);
            padding: 1.5rem; 
            border-radius: 12px; 
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
            border: 1px solid rgba(255, 255, 255, 0.05);
            cursor: pointer;
            position: relative;
            overflow: hidden;
            box-shadow: 
                0 4px 6px rgba(0, 0, 0, 0.3),
                0 1px 3px rgba(0, 0, 0, 0.2);
        }
        /* Subtle shine effect */
        .stat-box::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(
                45deg,
                transparent 30%,
                rgba(255, 255, 255, 0.03) 50%,
                transparent 70%
            );
            transform: rotate(45deg);
            pointer-events: none;
        }
        .stat-box:hover {
            transform: translateY(-5px) scale(1.02);
            box-shadow: 
                0 12px 24px rgba(0, 0, 0, 0.4),
                0 8px 16px var(--accent-glow),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            border-color: var(--accent);
        }
        .stat-box.positive:hover { 
            box-shadow: 
                0 12px 24px rgba(0, 0, 0, 0.4),
                0 8px 16px var(--success-glow),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            border-color: var(--success); 
        }
        .stat-box.negative:hover { 
            box-shadow: 
                0 12px 24px rgba(0, 0, 0, 0.4),
                0 8px 16px var(--danger-glow),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            border-color: var(--danger); 
        }

        .stat-box .label { 
            font-size: 0.9rem; 
            color: var(--text-secondary); 
            text-transform: uppercase; 
            letter-spacing: 1px; 
            margin-bottom: 0.75rem;
        }
        .stat-box .value { 
            font-size: 2.5rem; 
            font-weight: 900; 
            color: var(--text-primary); 
            margin-bottom: 0.5rem;
            line-height: 1;
            transition: color 0.3s ease;
        }
        .stat-box .value.positive { color: var(--success); }
        .stat-box .value.negative { color: var(--danger); }

        .percentage-change {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.9rem;
            font-weight: 700;
        }
        .percentage-change.positive { color: var(--success); }
        .percentage-change.negative { color: var(--danger); }
       
        .chart-box {
            background-color: var(--bg-medium); 
            padding: 1.5rem; 
            border-radius: 8px;
            border: 1px solid var(--bg-light);
            grid-column: 1 / -1;
        }
        .chart-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        .chart-header h3 {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-primary);
        }
        .chart-container {
            height: 300px;
            position: relative;
        }


        /* --- Orders & Log Panels --- */
        #orders-panel { grid-column: 1 / -1; text-align: center;}
        #orders-content { font-size: 1.1rem; line-height: 1.6; color: var(--text-secondary); text-align: center; }
       
        .panel-button {
            background: var(--bg-light);
            border: none;
            color: var(--text-secondary);
            padding: 0.7rem 1.2rem;
            font-size: 0.9rem;
            font-weight: 600;
            border-radius: 8px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
            margin-top: 1rem;
        }

        .panel-button.accent {
            background: var(--accent);
            color: #0a0a0a;
        }

        .panel-button:hover {
            background: var(--bg-medium);
            color: var(--text-primary);
            transform: translateY(-2px);
            box-shadow: 0 4px 10px var(--primary-glow);
        }
        .panel-button.accent:hover {
            color: #0a0a0a;
            background: var(--accent);
            opacity: 0.8;
            box-shadow: 0 4px 10px var(--accent-glow);
        }


        #log-panel { grid-column: 1 / -1; }
        .daily-log-list { list-style: none; max-height: 200px; overflow-y: auto; padding-right: 10px; }
        .daily-log-list::-webkit-scrollbar { width: 8px; }
        .daily-log-list::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
        .daily-log-list::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px; }
        .daily-log-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
        .log-item { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0.2rem; border-bottom: 1px solid var(--bg-light); font-size: 0.95rem;}
        .log-item:last-child { border-bottom: none; }
        .log-item-task { color: var(--text-primary); flex: 1; }
        .log-item-time { color: var(--text-secondary); font-weight: 500; }

        /* --- Modals --- */
        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 500; display: none; opacity: 0; transition: opacity 0.3s ease; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);}
        .modal-overlay.visible { display: block; opacity: 1; }
        .modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.95); background: var(--bg-medium); border-radius: 12px; z-index: 501; width: 90%; max-width: 500px; display: none; flex-direction: column; max-height: 90vh; border: 1px solid var(--bg-light); opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
        #confirm-purchase-overlay { z-index: 600; } 
        #confirm-purchase-modal { z-index: 601; }
        .modal.visible { display: flex; opacity: 1; transform: translate(-50%, -50%) scale(1); }
        .modal-header { padding: 1.5rem; border-bottom: 1px solid var(--bg-light); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
        .modal-header h2 { font-size: 1.2rem; }
        .close-modal-btn { background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
        .modal-content { padding: 1.5rem; scroll-behavior: smooth; overflow-y: auto; }
        .modal-content::-webkit-scrollbar { width: 8px; }
        .modal-content::-webkit-scrollbar-track { background: var(--bg-dark); }
        .modal-content::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px; }
        .modal-content::-webkit-scrollbar-thumb:hover { background: var(--accent); }
        .modal-content .modal-form, .modal-content .settings-section, .modal-content .armory-grid { animation: slide-fade-in 0.4s 0.1s ease-out forwards; opacity: 0; }
        .modal-form { display: flex; flex-direction: column; gap: 1rem; }
        .modal-form input, .modal-form textarea { background: var(--bg-light); border: 1px solid transparent; border-radius: 6px; padding: 0.8rem; color: var(--text-primary); font-size: 1rem; font-family: 'Inter', sans-serif; }
        .modal-form textarea { resize: vertical; min-height: 100px; }
        .modal-form button { background: var(--accent); border: none; color: var(--bg-dark); padding: 0.8rem; font-size: 1rem; font-weight: 700; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
        .modal-form button:hover { opacity: 0.8; }
        #manual-log-quote, #confirm-purchase-text, #debrief-text, #warning-text { font-style: italic; color: var(--text-secondary); margin-bottom: 1rem; text-align: center; }
        #confirm-purchase-text, #debrief-text, #warning-text { font-size: 1.1rem; }
        #debrief-text { white-space: pre-wrap; text-align: left; }
        #confirm-purchase-modal .modal-content {
            border-radius: 12px;
        }
        #confirm-input {
            background: var(--bg-light);
            border: 1px solid var(--bg-medium);
            border-radius: 6px;
            padding: 0.8rem;
            color: var(--text-primary);
            font-size: 1rem;
            font-family: 'Inter', sans-serif;
            transition: border-color 0.2s;
        }
        #confirm-input:focus {
            outline: none;
            border-color: var(--accent);
        }
        
        .modal-button-group {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin-top: 1.5rem;
        }

        .modal-action-btn {
            background: var(--bg-light);
            color: var(--text-primary);
            border: none;
            padding: 0.8rem 2rem;
            font-size: 1rem;
            font-weight: 700;
            border-radius: 999px; /* Pill shape */
            cursor: pointer;
            transition: all 0.2s ease;
            min-width: 120px;
        }
        .modal-action-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px var(--primary-glow);
        }
        .modal-action-btn.primary {
            background: var(--accent);
            color: #0a0a0a;
        }
        .modal-action-btn.primary:hover {
            box-shadow: 0 4px 15px var(--accent-glow);
        }
        .modal-action-btn.danger {
            background: var(--danger);
            color: #fff;
        }
        .modal-action-btn.danger:hover {
            box-shadow: 0 4px 15px var(--danger-glow);
        }


        #confirm-yes-btn:hover {
            box-shadow: 0 0 20px var(--accent-glow);
        }

        #confirm-no-btn, #warning-cancel-btn { background: var(--bg-light); color: var(--text-primary); }
       
        #confirm-no-btn:hover, #warning-cancel-btn:hover { 
            box-shadow: 0 0 20px var(--primary-glow);
        }

        /* --- Armory Specific --- */
        .armory-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 1rem;
        }
        .armory-card {
            background: var(--bg-dark);
            padding: 1.25rem;
            border-radius: 8px;
            border: 1px solid var(--bg-light);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            transition: all 0.2s ease;
        }
        .armory-card:hover {
            transform: translateY(-4px);
            border-color: var(--accent);
            box-shadow: 0 8px 25px var(--accent-glow);
        }
        .armory-card:has(.armory-purchase-btn.credit):hover {
            border-color: var(--danger);
            box-shadow: 0 8px 25px var(--danger-glow);
        }
        .armory-card .item-name {
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
        }
        .armory-card .item-desc {
            font-size: 0.9rem;
            color: var(--text-secondary);
            flex-grow: 1;
            margin-bottom: 1rem;
        }
        .armory-purchase-btn {
            background: var(--accent);
            color: var(--bg-dark);
            border: none;
            padding: 0.6rem 1rem;
            font-weight: 700;
            border-radius: 6px;
            cursor: pointer;
            transition: opacity 0.2s, background-color 0.2s;
            width: 100%;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.3rem;
        }
        .armory-purchase-btn:hover { opacity: 0.8; }
        .armory-purchase-btn.credit { background: var(--danger); color: var(--text-primary); }

        /* --- Settings Specific --- */
        .settings-section { 
            margin-bottom: 2rem; 
            overflow: visible !important;
            position: relative;
        }
        /* Fix stacking context: Top sections must float ABOVE bottom sections */
        .settings-section:nth-of-type(1) { z-index: 50; } /* Timer */
        .settings-section:nth-of-type(2) { z-index: 40; } /* Sound */
        .settings-section:nth-of-type(3) { z-index: 30; } /* Appearance */
        .settings-section:nth-of-type(4) { z-index: 20; } /* Content & Tone */
        .settings-section:nth-of-type(5) { z-index: 10; } /* Account */
        
        .settings-section h3 { text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 1rem; border-bottom: 1px solid var(--bg-light); padding-bottom: 0.5rem;}
        .setting { 
            display: flex; 
            justify-content: space-between; 
            align-items: center; 
            margin-bottom: 1rem;
            overflow: visible !important;
            position: relative;
        }
        /* Internal Stacking: Top rows overlap bottom rows */
        .setting:nth-child(1) { z-index: 10; }
        .setting:nth-child(2) { z-index: 9; }
        .setting:nth-child(3) { z-index: 8; }
        .setting:nth-child(4) { z-index: 7; }
        .setting:nth-child(5) { z-index: 6; }

        .setting label { font-size: 1rem; }
        .setting input[type="number"] { width: 60px; text-align: center; background: var(--bg-light); border: 1px solid var(--bg-light); color: var(--text-primary); border-radius: 4px; padding: 0.3rem; font-size: 1rem; }
        .setting select { 
            background: linear-gradient(135deg, var(--bg-light) 0%, rgba(26, 26, 46, 0.8) 100%);
            border: 2px solid transparent;
            color: var(--text-primary); 
            border-radius: 12px; 
            padding: 0.75rem 2.5rem 0.75rem 1rem;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            appearance: none;
            background-image: 
                linear-gradient(135deg, var(--bg-light) 0%, rgba(26, 26, 46, 0.8) 100%),
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffbf00' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat, no-repeat;
            background-position: center, right 0.75rem center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
        .setting select:hover {
            border-color: rgba(255, 191, 0, 0.3);
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(255, 191, 0, 0.15);
            background:linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(255, 191, 0, 0.05) 100%);
        }
        .setting select:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(255, 191, 0, 0.2);
        }
        .setting select option {
            background: var(--bg-dark);
            color: var(--text-primary);
            padding: 0.75rem;
        }
        .setting .slider-container { display: flex; align-items: center; gap: 1rem; }
        .setting input[type="range"] { flex-grow: 1; }
        .appearance-options { display: flex; gap: 0.5rem; }
        .appearance-options input { display: none; }
        .appearance-options label {
            padding: 0.5rem 1rem;
            border-radius: 6px;
            border: 1px solid var(--bg-light);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .appearance-options input:checked + label {
            background: var(--accent);
            color: #0a0a0a;
            border-color: var(--accent);
        }

        #delete-data-btn {
            width: 100%;
            background: var(--danger);
            color: #fff;
            border: none;
            padding: 0.8rem;
            font-size: 1rem;
            font-weight: 700;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        #delete-data-btn:hover {
            opacity: 0.8;
            box-shadow: 0 0 15px var(--danger-glow);
            transform: translateY(-2px);
        }

        /* Toggle Switch CSS */
        .switch { position: relative; display: inline-block; width: 50px; height: 28px; }
        .switch input { opacity: 0; width: 0; height: 0; }
        .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-light); transition: .4s; border-radius: 28px; }
        .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
        input:checked + .slider { background-color: var(--accent); }
        input:checked + .slider:before { transform: translateX(22px); }
       
        /* Clara's smaller thinking mode toggle */
        #clara-thinking-mode-switch { width: 40px; height: 22px; }
        #clara-thinking-mode-switch .slider { border-radius: 22px; }
        #clara-thinking-mode-switch .slider:before { height: 16px; width: 16px; left: 3px; bottom: 3px; }
        #clara-thinking-mode:checked + .slider:before { transform: translateX(18px); }

        .hidden { display: none; }

        @media (max-width: 900px) {
            .main-grid { grid-template-columns: 1fr; }
        }
        @media (max-width: 480px) {
            .stat-box .value { font-size: 2rem; }
            .timer-buttons { display: flex; flex-direction: column; gap: 1rem; width: 100%; align-items: stretch; }
            .timer-buttons button { width: 100%; margin: 0; }
        }

        /* --- Contact & Legal Panel --- */
        #contact-panel {
            grid-column: 1 / -1;
            text-align: center;
        }

        .contact-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 2rem;
            margin-bottom: 2rem;
            text-align: left;
        }

        .contact-column h3 {
            text-transform: uppercase;
            letter-spacing: 1px;
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 1rem;
            border-bottom: 1px solid var(--bg-light);
            padding-bottom: 0.5rem;
        }

        .contact-column p, .contact-column a, .witty-btn {
            color: var(--text-primary);
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
            transition: color 0.2s ease;
        }
        .contact-column a:hover, .witty-btn:hover {
            color: var(--accent);
        }
        .witty-btn {
            background: none;
            border: none;
            padding: 0;
            width: 100%;
            cursor: pointer;
            font-size: inherit;
            font-family: inherit;
            text-align: left;
        }


        .contact-column svg {
            width: 18px;
            height: 18px;
            fill: var(--accent);
            flex-shrink: 0;
        }

        .legal-links {
            display: flex;
            justify-content: center;
            gap: 0;
            border-top: 1px solid var(--bg-light);
            padding-top: 1.5rem;
            flex-wrap: wrap;
        }

        .legal-btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 0.9rem;
            transition: color 0.2s ease;
            position: relative;
            padding: 0 1.5rem;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
        }
       
        .legal-btn:not(:last-child)::after {
            content: '';
            position: absolute;
            right: 0;
            top: 50%;
            transform: translateY(-50%);
            height: 16px;
            width: 2px;
            background-color: var(--bg-light);
        }

        .legal-btn:hover {
            color: var(--accent);
            text-decoration: underline;
        }

        #terms-content h3, #privacy-content h3, #help-content h3, #copyright-content h3 {
            color: var(--accent);
            margin-top: 1.5rem;
            margin-bottom: 0.5rem;
        }
        #terms-content p, #privacy-content p, #help-content p, #copyright-content p {
            color: var(--text-secondary);
            line-height: 1.6;
            margin-bottom: 1rem;
        }
        #help-content ul {
            list-style-position: inside;
            padding-left: 1rem;
        }
        #help-content li {
             margin-bottom: 0.5rem;
        }

        /* Updates Modal Specific */
        #updates-modal .modal-content {
            padding: 0;
        }
        #updates-header {
            padding: 2rem 1.5rem;
            text-align: center;
            border-bottom: 1px solid var(--bg-light);
        }
        #updates-header h2 {
            font-size: 1.8rem;
            color: var(--accent);
            margin-bottom: 0.5rem;
        }
        #updates-header p {
            color: var(--text-secondary);
        }
        .update-section {
            padding: 1.5rem;
        }
        .update-section h3 {
            font-size: 1.1rem;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 1px solid var(--bg-light);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .update-section ul {
            list-style: none;
            padding-left: 0;
        }
        .update-section li {
            margin-bottom: 0.75rem;
            display: grid;
            grid-template-columns: auto 1fr;
            align-items: start;
            gap: 0.75rem;
            line-height: 1.5;
        }
        .update-section li svg {
            flex-shrink: 0;
            margin-top: 4px;
            width: 16px;
            height: 16px;
        }
        .update-section li div strong {
            display: block;
            margin-bottom: 0.25rem;
        }
        .update-section .new-feature svg { fill: var(--success); }
        .update-section .ui-ux svg { fill: var(--accent); }
        .update-section .bug-fix svg { fill: var(--danger); }

        /* --- Payment History Modal --- */
        #payment-history-list {
            list-style: none;
        }
        .transaction-item {
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 1rem;
            padding: 0.8rem 0;
            border-bottom: 1px solid var(--bg-light);
        }
        .transaction-item:last-child {
            border-bottom: none;
        }
        .transaction-desc {
            font-size: 1rem;
            color: var(--text-primary);
        }
        .transaction-desc .timestamp {
            font-size: 0.8rem;
            color: var(--text-secondary);
            display: block;
            margin-top: 0.2rem;
        }
        .transaction-amount {
            font-size: 1.1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }
        .transaction-amount.credit {
            color: var(--success);
        }
        .transaction-amount.debit {
            color: var(--danger);
        }

        /* --- AI Assistant --- */
        #clara-fab {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 999;
            width: 64px;
            height: 64px;
            border-radius: 50%;
            background: var(--accent);
            border: none;
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 8px 20px var(--accent-glow);
            transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
            animation: breathe 1.5s ease-in-out infinite alternate;
        }
        #clara-fab:hover {
            transform: scale(1.1);
            box-shadow: 0 12px 25px var(--accent-glow);
        }
        #clara-fab svg {
            width: 32px;
            height: 32px;
            fill: #0a0a0a;
        }
        #clara-notification {
            position: absolute;
            top: 0;
            right: 0;
            width: 16px;
            height: 16px;
            background-color: var(--danger);
            border-radius: 50%;
            border: 2px solid var(--accent);
            transform: scale(0);
            transition: transform 0.3s ease;
        }
        #clara-notification.visible {
            transform: scale(1);
        }
       
        .clara-tooltip {
            position: fixed;
            bottom: 2.75rem;
            right: 7rem;
            background: var(--bg-light);
            color: var(--text-primary);
            padding: 0.5rem 1rem;
            border-radius: 6px;
            z-index: 998;
            opacity: 0;
            transform: translateX(10px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            pointer-events: none;
            white-space: nowrap;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        }
        .clara-tooltip.visible {
            opacity: 1;
            transform: translateX(0);
        }


        #clara-modal {
            max-width: 800px;
            width: 90vw;
        }
        #clara-modal .modal-content {
            padding: 0.5rem; /* Gap around the edges */
            display: flex;
            flex-direction: row;
            height: 75vh;
            max-height: 700px;
            background: transparent; /* Transparent wrapper */
            box-shadow: none; /* Remove modal shadow, let children cast it */
            border: none;
            gap: 12px; /* Gap between sidebar and chat panel */
        }
       
        #clara-sidebar {
            width: 200px;
            background: var(--bg-dark);
            /* border-right: 1px solid var(--bg-light); Removed right border */
            border-radius: 24px; /* Fully rounded capsule */
            padding: 1rem;
            display: flex;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3); /* Floating shadow */
            flex-direction: column;
            flex-shrink: 0;
            transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }
        #sidebar-toggle-container {
            position: absolute;
            top: 1rem;
            right: -12px;
            z-index: 10;
        }
        #sidebar-toggle-btn {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: var(--bg-light);
            border: 1px solid var(--bg-medium);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            justify-content: center;
            align-items: center;
            transition: all 0.2s ease;
        }
        #sidebar-toggle-btn:hover {
            transform: scale(1.1);
            background: var(--accent);
            color: #0a0a0a;
        }
        #sidebar-toggle-btn svg {
            width: 16px;
            height: 16px;
            transition: transform 0.3s ease;
        }
        #sidebar-toggle-tooltip {
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%) translateX(10px);
            background: var(--bg-dark);
            color: var(--text-primary);
            padding: 0.3rem 0.7rem;
            border-radius: 4px;
            font-size: 0.8rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s ease;
            margin-left: 5px;
        }
        #sidebar-toggle-container:hover #sidebar-toggle-tooltip {
            opacity: 1;
            transform: translateY(-50%) translateX(15px);
        }

        .sidebar-btn {
            width: 100%;
            padding: 0.75rem;
            background: rgba(44, 44, 44, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-radius: 6px;
            color: var(--text-primary);
            font-weight: 600;
            cursor: pointer;
            margin-bottom: 1rem;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            overflow: hidden;
            position: relative;
        }
        .sidebar-btn .btn-tooltip {
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translateY(-50%) translateX(10px);
            background: var(--bg-dark);
            color: var(--text-primary);
            padding: 0.3rem 0.7rem;
            border-radius: 4px;
            font-size: 0.8rem;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s ease 0.1s; /* Add a slight delay */
            margin-left: 10px;
            z-index: 15;
            border: 1px solid var(--bg-light);
        }
        .sidebar-btn .btn-icon {
            flex-shrink: 0;
            margin-right: 0.75rem;
            transition: margin 0.3s ease;
        }
        .sidebar-btn .btn-text {
            white-space: nowrap;
            opacity: 1;
            transition: opacity 0.2s ease;
        }
        .sidebar-btn:hover {
            background-color: rgba(44, 44, 44, 0.6);
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            transform: scale(1.02);
        }
        #chat-history-list {
            list-style: none;
            overflow-y: auto;
            flex-grow: 1;
        }
        #chat-history-list::-webkit-scrollbar { width: 8px; }
        #chat-history-list::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
        #chat-history-list::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px; }
        #chat-history-list::-webkit-scrollbar-thumb:hover { background: var(--accent); }
        .chat-history-item {
            display: flex;
            align-items: center;
            padding: 0.75rem;
            border-radius: 6px;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            color: var(--text-secondary);
            transition: all 0.2s;
            position: relative;
        }
        .chat-history-item .chat-text {
            opacity: 1;
            transition: opacity 0.2s ease;
        }
        .chat-history-item:hover {
            background-color: rgba(44, 44, 44, 0.4);
            color: var(--text-primary);
        }
        .chat-history-item.active {
            background: var(--accent);
            color: #0a0a0a;
            font-weight: 700;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }
        .chat-history-item:hover .chat-actions-island {
            opacity: 1;
            transform: translateY(-50%) translateX(0) scale(1);
        }
        .chat-actions-island {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%) translateX(10px) scale(0.9);
            display: flex;
            gap: 2px;
            opacity: 0;
            transition: all 0.2s ease-out;
            background: var(--bg-dark);
            padding: 4px;
            border-radius: 16px;
            border: 1px solid var(--bg-light);
            box-shadow: 0 0 10px rgba(0,0,0,0.2);
        }
        .chat-actions-island button {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s;
        }
         .chat-actions-island button:hover {
             background-color: var(--bg-light);
         }
         .chat-history-item.active .chat-actions-island {
             background-color: rgba(0,0,0,0.2);
             border-color: rgba(0,0,0,0.2);
             backdrop-filter: blur(5px);
             -webkit-backdrop-filter: blur(5px);
         }
         .chat-history-item.active .chat-actions-island button {
             color: #0a0a0a;
         }
         .chat-history-item.active .chat-actions-island button:hover {
             background-color: rgba(0,0,0,0.15);
         }
        
        /* Collapsed Sidebar Styles */
        #clara-modal.sidebar-collapsed #clara-sidebar {
            width: 60px;
            padding: 1rem 0.5rem;
        }
        #clara-modal.sidebar-collapsed .sidebar-btn:hover .btn-tooltip {
            opacity: 1;
            transform: translateY(-50%) translateX(15px);
        }
        #clara-modal.sidebar-collapsed #sidebar-toggle-btn svg {
            transform: rotate(180deg);
        }
        #clara-modal.sidebar-collapsed .sidebar-btn {
            justify-content: center;
        }
        #clara-modal.sidebar-collapsed .sidebar-btn .btn-icon {
            margin-right: 0;
        }
        #clara-modal.sidebar-collapsed .sidebar-btn .btn-text,
        #clara-modal.sidebar-collapsed .chat-history-item .chat-text {
            opacity: 0;
            width: 0;
            pointer-events: none;
        }
        #clara-modal.sidebar-collapsed .chat-history-item {
            justify-content: center;
        }
        #clara-modal.sidebar-collapsed .chat-history-item.active:after {
            content: 'ΓÇóΓÇóΓÇó';
            position: absolute;
            top: 50%;
            font-size: 0.9rem;
            letter-spacing: 2px;
            font-weight: bold;
            right: 50%;
            transform: translate(50%, -50%);
            opacity: 1;
        }
        #clara-modal.sidebar-collapsed .chat-history-item .chat-actions-island {
            left: 55px; /* Position it just outside the collapsed sidebar */
            transform: translateY(-50%) scale(0.9);
            pointer-events: none;
        }
        #clara-modal.sidebar-collapsed .chat-history-item:hover .chat-actions-island {
            opacity: 1;
            transform: translateY(-50%) scale(1);
            background: var(--bg-light);
            pointer-events: all;
        }
        #clara-modal.sidebar-collapsed .chat-history-item:hover .chat-actions-island button:hover {
            background-color: var(--bg-dark);
            color: var(--text-primary);
        }

        /* --- Clara Header & Panel --- */

        
        /* Interactive Clara Icon */
        .clara-icon-svg {
            width: 28px; 
            height: 28px;
            cursor: pointer;
            transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            fill: var(--accent-glow);
            stroke: var(--accent);
        }
        .clara-icon-svg:hover {
            transform: scale(1.2) rotate(180deg);
            filter: drop-shadow(0 0 8px var(--accent));
        }
        
        /* Animation States */
        @keyframes float-idle {
            0%, 100% { transform: translateY(0px) rotate(0deg); }
            50% { transform: translateY(-4px) rotate(5deg); }
        }
        @keyframes pulse-typing {
            0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent)); }
            50% { transform: scale(1.15); filter: drop-shadow(0 0 12px var(--accent)); }
            100% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent)); }
        }
        @keyframes listen-shake {
             0% { transform: translateX(0); }
             25% { transform: translateX(-2px) rotate(-5deg); }
             75% { transform: translateX(2px) rotate(5deg); }
             100% { transform: translateX(0); }
        }

        .clara-state-idle {
            animation: float-idle 6s ease-in-out infinite;
        }
        .clara-state-typing {
            animation: pulse-typing 1.2s ease-in-out infinite !important; /* Override idle */
            fill: #fff !important; /* Flash white when thinking/typing */
        }
        .clara-state-listening {
             animation: listen-shake 2s ease-in-out infinite;
        }

        #clara-modal.sidebar-collapsed #chat-history-list {
             padding-right: 0;
        }


        #clara-main-panel {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            position: relative; /* For temp chat indicator */
            transition: padding-top 0.3s ease;
        }
        #temp-chat-indicator {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            background-color: var(--accent);
            color: #0a0a0a;
            text-align: center;
            padding: 0.5rem;
            font-size: 0.9rem;
            font-weight: 700;
            z-index: 5;
        }
        #clara-header {
             display: flex;
             justify-content: space-between;
             align-items: center;
             padding: 0.6rem 1.5rem; /* Further reduced vertical padding */
             border-bottom: 1px solid var(--bg-light);
             flex-shrink: 0;
             position: relative;
             z-index: 2;
             background: var(--bg-medium); /* Match sidebar */
        }

        #clara-chat-log {
            flex-grow: 1;
            padding: 1.5rem;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            overflow-x: hidden; /* This will prevent the horizontal scrollbar */
        }
        #clara-chat-log::-webkit-scrollbar { width: 8px; }
        #clara-chat-log::-webkit-scrollbar-track { background: var(--bg-medium); border-radius: 4px; }
        #clara-chat-log::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px; }
        #clara-chat-log::-webkit-scrollbar-thumb:hover { background: var(--accent); }
        .ai-message { position: relative; max-width: 85%; padding: 0.7rem 1rem; border-radius: 12px; line-height: 1.5; animation: slide-fade-in 0.4s ease-out; overflow-wrap: break-word; word-break: break-word; }
        .ai-message.user {
            background: rgba(255, 191, 0, 0.85);
            color: #0a0a0a;
            align-self: flex-end;
            border-bottom-right-radius: 2px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            border: 1px solid rgba(255, 191, 0, 0.5);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        .ai-message.assistant {
            background: rgba(44, 44, 44, 0.4);
            color: var(--text-primary);
            align-self: flex-start;
            border-bottom-left-radius: 2px;
            position: relative; /* Crucial for reaction UI */
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .react-btn {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            right: 8px; /* Position inside the message bubble */
            width: 28px;
            height: 28px;
            border-radius: 16px;
            background: rgba(0,0,0,0.1);
            border: 1px solid rgba(255,255,255,0.1);
            color: var(--text-primary);
            cursor: pointer;
            opacity: 0;
            transition: all 0.2s ease-out;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 0.9rem;
            pointer-events: none;
            z-index: 10;
        }
        .ai-message.assistant:hover .react-btn { 
            opacity: 1; 
            pointer-events: all;
        }
        .react-btn:hover {
            background: rgba(0,0,0,0.2);
        }

       
        .reaction-palette {
            position: absolute;
            display: flex;
            gap: 8px;
            top: 50%;
            left: calc(100% + 5px); /* Position it to the side of the message */
            transform: translateY(-50%) scale(0.9);
            background: var(--bg-medium);
            border-radius: 20px;
            padding: 8px 12px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            z-index: 11;
            opacity: 0;
            pointer-events: none;
            transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .ai-message.assistant.show-palette .reaction-palette {
            opacity: 1;
            pointer-events: all;
            transform: translateY(-50%) scale(1);
        }
       

        .reaction-palette span { font-size: 1.2rem; cursor: pointer; transition: transform 0.15s ease; }
        .reaction-palette span:hover { transform: scale(1.4) rotate(-10deg); }

        .ai-message .message-reaction {
            position: absolute;
            bottom: -8px;
            background: var(--bg-medium);
            border-radius: 12px;
            padding: 2px 6px;
            font-size: 0.8rem;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3);
            border: 1px solid var(--bg-light);
            z-index: 2;
        }
        .ai-message.user .message-reaction {
            left: -8px;
        }
        .ai-message.assistant .message-reaction {
            right: -8px;
        }


        .ai-message.typing { background: var(--bg-light); color: var(--text-primary); align-self: flex-start; border-bottom-left-radius: 2px; display: flex; align-items: center; gap: 5px; }
        .typing-dot {
            width: 8px;
            height: 8px;
            background-color: var(--text-secondary);
            border-radius: 50%;
            animation: typing-bounce 1.2s infinite ease-in-out;
        }
        .typing-dot:nth-child(2) { animation-delay: 0.2s; }
        .typing-dot:nth-child(3) { animation-delay: 0.4s; }
        @keyframes typing-bounce {
            0%, 60%, 100% { transform: translateY(0); }
            30% { transform: translateY(-6px); }
        }

        #clara-chat-form { flex-shrink: 0; padding: 1rem; border-top: 1px solid var(--bg-light); position: relative; z-index: 10; }
        .ai-chat-controls { display: none; } /* Hide the old empty controls */
       
        #clara-input-wrapper {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: rgba(44, 44, 44, 0.2); /* Glassy dark - MORE TRANSLUCENT */
            border-radius: 12px;
            padding: 0.5rem;
            position: relative;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 20px rgba(0,0,0,0.3);
        }
        #slash-tip {
            position: absolute;
            bottom: 6rem; /* Positioned higher */
            right: 1rem;
            background: var(--bg-dark);
            border: 1px solid var(--bg-light);
            padding: 0.5rem 0.8rem;
            border-radius: 8px;
            font-size: 0.9rem;
            color: var(--text-secondary);
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        #slash-tip kbd {
            background: var(--bg-light);
            padding: 2px 5px;
            border-radius: 3px;
            font-family: monospace;
        }
        #slash-tip.visible {
            opacity: 1;
            transform: translateY(-50%) translateX(0);
        }
        #clara-input {
            flex-grow: 1;
            background: transparent;
            border: none;
            outline: none;
            padding: 0.6rem;
            color: var(--text-primary);
            font-size: 1rem;
        }
        #clara-chat-form button[type="submit"] {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            background: var(--accent);
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.2s ease, background-color 0.2s ease;
        }
        #clara-chat-form button[type="submit"]:hover {
            transform: scale(1.05);
        }
         #clara-chat-form button[type="submit"]:disabled {
             opacity: 0.5;
             cursor: not-allowed;
         }
        #clara-chat-form button[type="submit"] svg {
            transition: transform 0.2s ease;
            width: 18px;
            height: 18px;
        }
         #clara-chat-form button[type="submit"]:hover svg {
             transform: rotate(15deg);
        }

        /* Clara Chat Role Selector Overrides */
        #clara-input-wrapper .custom-select-wrapper {
            width: 100% !important; /* Fit the 180px container */
            min-width: 0 !important; /* Override global 300px */
        }

        #clara-input-wrapper .custom-select-trigger {
            background: rgba(255, 255, 255, 0.05) !important;
            border: none !important;
            border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
            border-radius: 8px !important;
            padding: 0.5rem 0.75rem !important;
            min-height: 0 !important;
            height: 42px !important;
            font-size: 0.9rem;
            box-shadow: none !important;
            justify-content: space-between !important;
            margin-bottom: 0 !important;
        }

        #clara-input-wrapper .custom-select-trigger:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: none; /* Disable global floating effect */
        }

        #clara-input-wrapper .custom-options {
            bottom: 100%; /* Pop UP upwards */
            top: auto;
            margin-bottom: 8px;
            min-width: 220px;
            border-radius: 12px;
            background: rgba(10, 10, 10, 0.95);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        #clara-input-wrapper .custom-option {
             padding: 0.75rem 1rem;
             font-size: 0.9rem;
        }
        /* Custom Dropdown for AI Personality & Clock */
        .custom-select-wrapper { 
            position: relative; 
            width: 180px; 
            z-index: 10;
        }
        .custom-select {
            background-color: var(--bg-light);
            color: var(--text-primary);
            padding: 0.5rem 1rem;
            border-radius: 20px; /* Pill shape */
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            position: relative;
        }
        .custom-select:hover {
            transform: scale(1.05);
        }
        .custom-select.open {
             box-shadow: 0 0 15px var(--accent-glow);
             transform: scale(1.05);
        }
        #clara-input-wrapper .custom-select {
            background-color: rgba(44, 44, 44, 0.4);
        }
        .custom-select::after {
            content: 'Γû▓';
            font-size: 0.6em;
            transition: transform 0.3s ease;
            transform: rotate(180deg);
        }
        .custom-select.open::after { transform: rotate(0deg); }
        .custom-select-options {
            display: none;
            position: absolute;
            bottom: calc(100% + 5px);
            left: 50%;
            min-width: 300px; /* Made much wider for better readability */
            background: var(--bg-dark); /* Darker background for the menu */
            border: 1px solid var(--bg-light);
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.8);
            z-index: 10000; /* Very high z-index to appear over everything */
            overflow: hidden;
            animation: fade-scale-in 0.2s ease-out;
            opacity: 0; /* Initial state for animation */
            transform: translateX(-50%) translateY(-10px) scale(0.95); /* Center horizontally and add initial animation state */
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s ease;
            max-height: 380px; /* Increased height for better spacing */
            overflow-y: auto; /* Add scroll if needed */
        }
        .custom-select-options::-webkit-scrollbar { width: 8px; }
        .custom-select-options::-webkit-scrollbar-track { background: transparent; }
        .custom-select-options::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 4px;}
        .custom-select-options::-webkit-scrollbar-thumb:hover { background: var(--accent); }

        .custom-select.open .custom-select-options {
            display: block; /* Ensure it becomes visible */
            opacity: 1;
            transform: translateX(-50%) translateY(0) scale(1);
            pointer-events: auto;
        }
        .custom-select-option {
            padding: 0.75rem 1rem;
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            animation: slide-fade-in 0.3s forwards;
            opacity:0;
        }
        .custom-select-option:hover, .custom-select-option.selected {
            background-color: var(--accent);
            color: #0a0a0a;
            transform: translateX(4px);
            box-shadow: inset 4px 0 0 rgba(0,0,0,0.3);
        }


        /* --- Stats Detail Modal --- */
        #stats-detail-modal { max-width: 800px; }
        .stats-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;}
        .stats-toggle-group { display: flex; gap: 0.5rem; }
        .stats-toggle-group button { background: var(--bg-light); border: 1px solid var(--bg-light); color: var(--text-secondary); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; transition: all 0.2s ease; }
        .stats-toggle-group button.active { background: var(--accent); color: #0a0a0a; border-color: var(--accent); }
        #stats-canvas-container { 
            height: 350px; 
            padding-top: 1rem;
        }


        .loader {
            border: 2px solid #f3f3f3; 
            border-top: 2px solid var(--accent);
            border-radius: 50%;
            width: 16px;
            height: 16px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
       
        /* --- Enhanced Clock Modal --- */
        #clock-modal .modal-content {
            padding-top: 0.5rem;
            padding-bottom: 0.75rem;
        }
        #clock-display-area {
            height: 200px;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 0.25rem;
        }
        .analogue-clock {
            width: 170px;
            height: 170px;
            border: 3px solid var(--text-primary);
            border-radius: 50%;
            position: relative;
        }
        .clock-hand {
            position: absolute;
            bottom: 50%;
            left: 50%;
            transform-origin: bottom center;
            background-color: var(--text-primary);
            border-radius: 2px;
        }
        #hour-hand { width: 5px; height: 45px; margin-left: -2.5px;}
        #minute-hand { width: 3px; height: 65px; margin-left: -1.5px;}
        #second-hand { width: 2px; height: 75px; margin-left: -1px; background-color: var(--accent);}
        .clock-center {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 10px;
            height: 10px;
            background-color: var(--accent);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            border: 2px solid var(--bg-medium);
        }
        .digital-clock-detailed, .digital-clock-minimal {
            text-align: center;
            font-variant-numeric: tabular-nums;
        }
        .digital-clock-detailed .time { font-size: clamp(2.5rem, 10vw, 3.5rem); font-weight: 900; letter-spacing: -2px;}
        .digital-clock-detailed .date { font-size: 1rem; color: var(--text-secondary); }
        .digital-clock-minimal .time { font-size: clamp(3rem, 15vw, 5.5rem); font-weight: 900; letter-spacing: -5px;}
        .word-clock {
            font-size: clamp(1.4rem, 7vw, 1.8rem);
            line-height: 1.2;
            font-weight: 700;
            text-align: center;
            color: var(--text-secondary);
        }
        .word-clock .lit {
            color: var(--text-primary);
        }
        .clock-controls {
            display: flex;
            justify-content: center;
            margin-bottom: 0.5rem;
        }
        #time-quote {
            text-align: center;
            font-style: italic;
            color: var(--text-secondary);
            max-width: 90%;
            margin: 0 auto;
            font-size: 0.8rem;
            min-height: 2.5em; /* Reserve space for AI text */
        }
        #ai-time-loader {
            display: none;
            margin: 0.5rem auto;
        }

        /* --- New Clock Styles --- */
        .ascension-clock {
            width: 170px;
            height: 170px;
            border: 3px solid var(--text-primary);
            border-radius: 50%;
            position: relative;
            overflow: hidden; /* Important for cloud effect */
        }
        .ascension-clock .clock-hand {
            position: absolute;
            bottom: 50%;
            left: 50%;
            transform-origin: bottom center;
            background-color: var(--text-primary);
            border-radius: 2px;
            z-index: 10;
        }
        .ascension-clock #hour-hand { width: 5px; height: 45px; margin-left: -2.5px;}
        .ascension-clock #minute-hand { width: 3px; height: 65px; margin-left: -1.5px;}

        .ascension-clock .jet-container {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) rotate(-45deg);
            width: 80px;
            height: 80px;
        }
        .ascension-clock .jet-container svg path {
            fill: var(--accent);
            transition: all 0.3s ease;
            filter: drop-shadow(0 0 5px var(--accent-glow));
        }
        #clara-main-panel {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            position: relative; /* For temp chat indicator */
            transition: padding-top 0.3s ease;
            background: var(--bg-dark); /* Match sidebar */
        }
        #clara-background-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
        }
        .orbital-clock {
            width: 170px;
            height: 170px;
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        .orbital-clock .orbit {
            position: absolute;
            top: 50%;
            left: 50%;
            /* transform: translate(-50%, -50%); <-- This was the conflicting line, removed */
            border: 1px solid var(--text-secondary);
            border-radius: 50%;
        }
        #orbit-s { width: 160px; height: 160px; }
        #orbit-m { width: 110px; height: 110px; }
        #orbit-h { width: 60px; height: 60px; }
        .planet {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background-color: var(--accent);
            box-shadow: 0 0 15px var(--accent-glow);
            position: absolute;
            top: -5px;
            left: calc(50% - 5px);
        }
        #orbit-m .planet { background-color: var(--text-primary); box-shadow: none; }
        #orbit-h .planet { background-color: var(--text-primary); box-shadow: none; width: 12px; height: 12px; top: -6px; left: calc(50% - 6px); }
        .orbital-center {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: var(--accent);
        }

        /* --- Name Modal Specific --- */
        #name-modal .modal-content {
            text-align: center;
        }
        #name-modal button {
            width: 100%;
        }

                /* --- New Dropdown Styles --- */
            .custom-select-search {
                width: 100%;
                padding: 8px 12px;
                border: none;
                background: var(--bg-dark);
                color: var(--text-primary);
                font-family: inherit;
                font-size: 0.9rem;
                outline: none;
                border-bottom: 1px solid var(--bg-light);
            }
            .custom-select-search::placeholder {
                color: var(--text-secondary);
            }
            .custom-select-category {
                padding: 8px 12px;
                font-size: 0.75rem;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                color: var(--text-secondary);
                font-weight: 600;
                pointer-events: none;
                margin-top: 4px;
            }
            .custom-select-option {
                padding: 8px 20px; /* Indent options slightly */
            }
            
            /* --- Danger Zone Special Styling --- */
            .danger-zone-category {
                color: #ff4444 !important;
                border-top: 1px solid rgba(255, 68, 68, 0.2);
                margin-top: 8px;
                padding-top: 12px;
            }

            /* --- REAL Animated Flame --- */
            .vfx-fire-container {
                position: relative;
                width: 120px;
                height: 120px;
                margin: 1rem auto 2rem auto;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            .vfx-fire-main {
                font-size: 5rem;
                filter: drop-shadow(0 0 25px rgba(255, 100, 0, 0.8)) 
                        drop-shadow(0 0 50px rgba(255, 140, 0, 0.6));
                animation: flame-wiggle 3.5s ease-in-out infinite, flame-glow 2s ease-in-out infinite;
            }
            .vfx-fire-glow {
                display: none;
            }

            @keyframes flame-wiggle {
                0%, 100% {
                    transform: translateY(0) scale(1) rotate(-3deg);
                }
                25% {
                    transform: translateY(-5px) scale(1.05) rotate(3deg);
                }
                50% {
                    transform: translateY(0) scale(1.08) rotate(-2deg);
                }
                75% {
                    transform: translateY(-3px) scale(1.02) rotate(2deg);
                }
            }

            @keyframes flame-glow {
                0%, 100% {
                    filter: drop-shadow(0 0 25px rgba(255, 100, 0, 0.8)) 
                            drop-shadow(0 0 50px rgba(255, 140, 0, 0.6));
                }
                50% {
                    filter: drop-shadow(0 0 35px rgba(255, 80, 0, 1)) 
                            drop-shadow(0 0 70px rgba(255, 140, 0, 0.9));
                }
            }

            /* CUSTOM DATETIME INPUTS - YELLOW/BLACK THEME */
            input[type="date"],
            input[type="time"],
            input[type="datetime-local"],
            input[type="month"],
            input[type="week"] {
                background: rgba(26, 26, 26, 0.8);
                border: 2px solid rgba(255, 191, 0, 0.3);
                border-radius: 10px;
                padding: 0.8rem 1rem;
                color: #ffffff;
                font-family: inherit;
                font-size: 1rem;
                font-weight: 500;
                cursor: pointer;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
            }

            input[type="date"]:hover,
            input[type="time"]:hover,
            input[type="datetime-local"]:hover,
            input[type="month"]:hover,
            input[type="week"]:hover {
                border-color: var(--accent);
                box-shadow: 0 0 20px rgba(255, 191, 0, 0.3);
                transform: translateY(-2px);
            }

            input[type="date"]:focus,
            input[type="time"]:focus,
            input[type="datetime-local"]:focus,
            input[type="month"]:focus,
            input[type="week"]:focus {
                outline: none;
                border-color: var(--accent);
                box-shadow: 0 0 30px rgba(255, 191, 0, 0.5);
            }

            /* Calendar picker styling (Webkit browsers) */
            input[type="date"]::-webkit-calendar-picker-indicator,
            input[type="time"]::-webkit-calendar-picker-indicator,
            input[type="datetime-local"]::-webkit-calendar-picker-indicator {
                filter: invert(1) brightness(100%) saturate(200%) hue-rotate(10deg);
                cursor: pointer;
                transition: all 0.2s;
            }

            input[type="date"]::-webkit-calendar-picker-indicator:hover,
            input[type="time"]::-webkit-calendar-picker-indicator:hover,
            input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
                transform: scale(1.2);
                filter: invert(0.7) brightness(150%) saturate(300%) hue-rotate(0deg);
            }

            /* Date/time text */
            input[type="date"]::-webkit-datetime-edit,
            input[type="time"]::-webkit-datetime-edit,
            input[type="datetime-local"]::-webkit-datetime-edit {
                color: #ffffff;
                font-weight: 500;
            }

            input[type="date"]::-webkit-datetime-edit-fields-wrapper,
            input[type="time"]::-webkit-datetime-edit-fields-wrapper,
            input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
                padding: 0.2rem;
            }

            /* Individual date/time fields */
            input[type="date"]::-webkit-datetime-edit-text,
            input[type="time"]::-webkit-datetime-edit-text,
            input[type="datetime-local"]::-webkit-datetime-edit-text {
                color: rgba(255, 191, 0, 0.6);
            }

            input[type="date"]::-webkit-datetime-edit-month-field,
            input[type="date"]::-webkit-datetime-edit-day-field,
            input[type="date"]::-webkit-datetime-edit-year-field,
            input[type="time"]::-webkit-datetime-edit-hour-field,
            input[type="time"]::-webkit-datetime-edit-minute-field,
            input[type="time"]::-webkit-datetime-edit-ampm-field,
            input[type="datetime-local"]::-webkit-datetime-edit-month-field,
            input[type="datetime-local"]::-webkit-datetime-edit-day-field,
            input[type="datetime-local"]::-webkit-datetime-edit-year-field,
            input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
            input[type="datetime-local"]::-webkit-datetime-edit-minute-field,
            input[type="datetime-local"]::-webkit-datetime-edit-ampm-field {
                color: #ffffff;
                background: rgba(255, 191, 0, 0.1);
                border-radius: 4px;
                padding: 0.3rem 0.4rem;
                margin: 0 2px;
                transition: all 0.2s;
            }

            input[type="date"]::-webkit-datetime-edit-month-field:hover,
            input[type="date"]::-webkit-datetime-edit-day-field:hover,
            input[type="date"]::-webkit-datetime-edit-year-field:hover,
            input[type="time"]::-webkit-datetime-edit-hour-field:hover,
            input[type="time"]::-webkit-datetime-edit-minute-field:hover,
            input[type="time"]::-webkit-datetime-edit-ampm-field:hover,
            input[type="datetime-local"]::-webkit-datetime-edit-month-field:hover,
            input[type="datetime-local"]::-webkit-datetime-edit-day-field:hover,
            input[type="datetime-local"]::-webkit-datetime-edit-year-field:hover,
            input[type="datetime-local"]::-webkit-datetime-edit-hour-field:hover,
            input[type="datetime-local"]::-webkit-datetime-edit-minute-field:hover,
            input[type="datetime-local"]::-webkit-datetime-edit-ampm-field:hover {
                background: var(--accent);
                color: #0a0a0a;
            }

            /* Performance optimization for Intel section */
            #reckoning-chart-container,
            .chart-container {
                will-change: transform;
                transform: translateZ(0);
                -webkit-transform: translateZ(0);
            }

            canvas {
                will-change: transform;
            }

