        /* --- CORE VARIABLES --- */
        :root {
            --bg-color: #050505;
            --terminal-green: #33ff00;
            --terminal-dim: #1a8000;
            --terminal-alert: #ff3300; /* New color for AI thinking/errors */
            --font-stack: 'Courier New', Courier, monospace;
        }

        /* --- RESET & BASE --- */
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            background-color: var(--bg-color);
            color: var(--terminal-green);
            font-family: var(--font-stack);
            height: 100vh;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            text-shadow: 0 0 4px var(--terminal-green);
        }

        /* --- CRT SCREEN CONTAINER --- */
        .crt-container {
            width: 95%;
            height: 95%;
            border: 2px solid var(--terminal-dim);
            padding: 20px;
            position: relative;
            background: radial-gradient(circle, #111 0%, #000 100%);
            box-shadow: 0 0 20px var(--terminal-dim) inset;
            overflow: hidden;
        }

        .crt-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                rgba(18, 16, 16, 0) 50%, 
                rgba(0, 0, 0, 0.25) 50%
            );
            background-size: 100% 4px;
            pointer-events: none;
            z-index: 100;
            animation: flicker 0.15s infinite;
        }

        /* --- BOOT SCREEN --- */
        #boot-screen {
            font-size: 16px;
            line-height: 1.5;
            height: 100%;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
        }
        .boot-line { margin-bottom: 2px; }

        /* --- MAIN DASHBOARD --- */
        #main-interface {
            display: none;
            height: 100%;
            overflow-y: auto;
            padding-right: 5px;
        }

        header {
            border-bottom: 2px dashed var(--terminal-dim);
            padding-bottom: 10px;
            margin-bottom: 20px;
            display: flex;
            justify-content: space-between;
            text-transform: uppercase;
        }

        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
        }

        /* --- WIDGET STYLING --- */
        .widget {
            border: 1px solid var(--terminal-green);
            padding: 15px;
            position: relative;
            background: rgba(0, 20, 0, 0.6);
            opacity: 0;
            animation: widget-appear 0.5s forwards;
            display: flex;
            flex-direction: column;
        }

        .widget-wide {
            grid-column: span 2;
        }
        @media (max-width: 700px) {
            .widget-wide { grid-column: span 1; }
        }

        .widget:nth-child(1) { animation-delay: 0.1s; }
        .widget:nth-child(2) { animation-delay: 0.3s; }
        .widget:nth-child(3) { animation-delay: 0.5s; }
        .widget:nth-child(4) { animation-delay: 0.7s; }
        .widget:nth-child(5) { animation-delay: 0.9s; }

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

        .widget-title {
            position: absolute;
            top: -12px;
            left: 10px;
            background-color: var(--bg-color);
            padding: 0 5px;
            font-weight: bold;
            text-transform: uppercase;
            letter-spacing: 1px;
            z-index: 2;
        }

        /* --- TASK LIST & AI OPTIMIZER --- */
        ul.task-list { list-style: none; margin-top: 10px; }
        .task-list li { 
            margin-bottom: 8px; 
            display: flex; 
            justify-content: space-between;
            align-items: center;
        }
        .task-text::before { content: "[ ] "; }
        .task-list li.completed .task-text { color: var(--terminal-dim); text-decoration: line-through; }
        .task-list li.completed .task-text::before { content: "[x] "; }
        
        .ai-btn {
            background: none;
            border: 1px solid var(--terminal-dim);
            color: var(--terminal-dim);
            cursor: pointer;
            font-family: inherit;
            font-size: 0.8em;
            padding: 2px 5px;
            margin-left: 10px;
            transition: all 0.2s;
        }
        .ai-btn:hover {
            color: var(--terminal-green);
            border-color: var(--terminal-green);
            text-shadow: 0 0 5px var(--terminal-green);
        }

        .subtask-list {
            margin-left: 20px;
            margin-top: 5px;
            font-size: 0.85em;
            color: #ccffcc;
            display: none; /* Hidden until generated */
        }
        .subtask-list div::before { content: ">> "; color: var(--terminal-dim); }

        /* --- AI CORTEX WIDGET --- */
        #ai-log {
            flex-grow: 1;
            height: 150px;
            overflow-y: auto;
            margin-bottom: 10px;
            font-size: 0.9em;
            border-bottom: 1px dotted var(--terminal-dim);
            padding-bottom: 5px;
        }
        .ai-msg { color: var(--terminal-green); margin-bottom: 5px; }
        .user-msg { color: #fff; margin-bottom: 5px; }
        .system-msg { color: var(--terminal-dim); margin-bottom: 5px; font-style: italic;}
        
        .input-line { display: flex; align-items: center; }
        #ai-input {
            background: transparent;
            border: none;
            color: #fff;
            font-family: inherit;
            font-size: 1em;
            flex-grow: 1;
            margin-left: 10px;
            outline: none;
        }

        /* --- GENERIC WIDGET CONTENT --- */
        .weather-ascii { white-space: pre; font-size: 14px; text-align: center; margin-top: 10px; }
        .temp-display { text-align: center; font-size: 2em; margin-top: 10px; }
        .rss-item { margin-bottom: 10px; border-bottom: 1px dotted var(--terminal-dim); padding-bottom: 5px; }
        .rss-date { font-size: 0.8em; color: var(--terminal-dim); }
        .rss-link { display: block; color: var(--terminal-green); text-decoration: none; }
        .cmd-footer { margin-top: 30px; border-top: 2px dashed var(--terminal-dim); padding-top: 10px; display: flex; align-items: center; }
        .blinking-cursor { display: inline-block; width: 10px; height: 18px; background-color: var(--terminal-green); animation: blink 1s step-end infinite; margin-left: 5px; }

        @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
        @keyframes flicker {
            0% { opacity: 0.97; } 50% { opacity: 0.95; } 100% { opacity: 0.97; }
        }
        
        /* Loading animation for AI */
        .processing::after {
            content: " .";
            animation: dots 1s steps(5, end) infinite;
        }
        @keyframes dots {
            0%, 20% { content: " ."; }
            40% { content: " .."; }
            60% { content: " ..."; }
            80%, 100% { content: " ...."; }
        }

        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track { background: #000; }
        ::-webkit-scrollbar-thumb { background: var(--terminal-dim); }
        ::-webkit-scrollbar-thumb:hover { background: var(--terminal-green); }
