
        :root {
            /* --- ONYX (Dark Mode - Default) --- */
            --bg-body: #050505;
            --bg-gradient: radial-gradient(circle at 50% 0%, #1c1c2e 0%, #000000 70%);
            
            --glass-panel: rgba(20, 20, 22, 0.75);
            --glass-border: rgba(255, 255, 255, 0.1);
            --glass-input: rgba(0, 0, 0, 0.25);
            --glass-hover: rgba(255, 255, 255, 0.05);

            /* --- ARCADE GLASS LAYERS --- */
            --glass-bg-1: rgba(30, 32, 40, 0.78);
            --glass-bg-2: rgba(24, 26, 34, 0.68);
            --glass-bg-3: rgba(18, 20, 28, 0.56);
            --glass-border-soft: rgba(255, 255, 255, 0.08);
            --glass-border-strong: rgba(255, 255, 255, 0.16);

            /* --- ARCADE GLOWS --- */
            --glow-accent: rgba(10, 132, 255, 0.35);
            --glow-success: rgba(50, 215, 75, 0.35);
            --glow-warm: rgba(255, 214, 10, 0.25);

            /* --- ARCADE TYPOGRAPHY --- */
            --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --font-mono: 'SF Mono', 'JetBrains Mono', 'Fira Code', monospace;

            /* --- ARCADE SPACING (4PX GRID) --- */
            --space-1: 4px;
            --space-2: 8px;
            --space-3: 12px;
            --space-4: 16px;
            --space-5: 20px;
            --space-6: 24px;
            --space-8: 32px;
            
            /* --- GOLDEN RATIO SPACING (Login UI) --- */
            --space-unit: 8px;
            --space-xs: calc(var(--space-unit) * 0.618);
            --space-sm: var(--space-unit);
            --space-md: calc(var(--space-unit) * 1.618);
            --space-lg: calc(var(--space-unit) * 2.618);
            --space-xl: calc(var(--space-unit) * 4.236);

            /* --- ARCADE MOTION --- */
            --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
            --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
            --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
            
            --text-primary: #ffffff;
            --text-secondary: #a1a1aa;
            --text-muted: #666;
            
            --lines: rgba(255, 255, 255, 0.08);
            --shadow-soft: 0 4px 15px rgba(0,0,0,0.2);
            --shadow-deep: 0 20px 60px rgba(0,0,0,0.6);

            /* Accents (Dynamic) */
            --accent: #0a84ff; 
            --success: #32d74b;
            --danger: #ff453a;
            --warning: #ffd60a;
            --text-on-accent: #ffffff;
            
            --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            --slot-height: 60px;
            
            /* Legacy variables mapped for compatibility */
            --glass-surface: var(--glass-panel);
            --bg-deep: var(--bg-body);
        }

/* --- ONYX FINANCE HUD COLORS (Restoration) --- */
/* Only applies when NOT in Nova mode */

/* 1. Income Label (Green) */
:root:not([data-base="nova"]) #btnFinIncome .fin-label {
    color: var(--success) !important;
}

/* 2. Burn Label (Red) */
:root:not([data-base="nova"]) #btnFinBurn .fin-label {
    color: var(--danger) !important;
}

/* 3. Projected Label (Pure White) */
:root:not([data-base="nova"]) #btnFinProj .fin-label {
    color: #ffffff !important;
}

        /* --- NOVA (Light Mode - Activated via HTML attribute) --- */
        [data-base="nova"] {
            --bg-body: #eef2f6;
            --bg-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #dfe4ea 80%);
    
            --glass-panel: rgba(255, 255, 255, 0.85); /* Frosted Ice */
            --glass-border: rgba(0, 0, 0, 0.08);
            --glass-input: rgba(255, 255, 255, 0.5);
            --glass-hover: rgba(0, 0, 0, 0.05);
    
            --text-primary: #1c1c1e;
            --text-secondary: #636366;
            --text-muted: #999;
    
            --lines: rgba(0, 0, 0, 0.06);
            --shadow-soft: 0 4px 15px rgba(0,0,0,0.05);
            --shadow-deep: 0 20px 40px rgba(0,0,0,0.15);

        /* COLOR OVERRIDES FOR LIGHT MODE */
            --success: #15803d; /* Dark Emerald (Readable on White) */
            --danger: #dc2626;  /* Dark Red */
            --accent: #007aff;  /* Deep Apple Blue */
        }

        /* --- THEME MAPPING OVERRIDES --- */
        body { 
            background: var(--bg-body); 
            background-image: var(--bg-gradient); 
            color: var(--text-primary); 
        }

        /* Apply Glass Theme to all Windows/Panels */
        .card, .modal-content, #desktopDock, 
        #radioModal, #weatherModal, #hourglassModal, #themeModal,
        #notesHubModal, .sidebar, .mobile-view-switcher {
            background: var(--glass-panel) !important;
            border-color: var(--glass-border) !important;
            color: var(--text-primary) !important;
            box-shadow: var(--shadow-soft) !important;
        }

        /* Inputs & Forms */
        input, select, textarea, .list-input, .stmt-search-input {
            background: var(--glass-input) !important;
            border-color: var(--glass-border) !important;
            color: var(--text-primary) !important;
        }

        input::placeholder, textarea::placeholder { 
            color: var(--text-secondary) !important; 
        }

        /* Text Colors */
        h3, label, .fin-label, .orbit-sub, .hub-item-date, .folder-arrow { 
            color: var(--text-secondary) !important; 
        }

        .hub-item-id { 
            color: var(--text-muted) !important; 
        }

        /* Grid Lines */
        .fc-theme-standard td, .fc-theme-standard th { 
            border-color: var(--lines) !important; 
        }

        /* Hover States */
        .hub-item:hover, .list-item:hover, .list-folder:hover {
            background: var(--glass-hover) !important;
        }

        /* Orbit Dots (Special handling for Light Mode visibility) */
        [data-base="nova"] .orbit-dot.past { 
            background: rgba(0,0,0,0.1) !important; 
        }
        [data-base="nova"] .orbit-dot.future { 
            border-color: rgba(0,0,0,0.1) !important; 
        }
        [data-base="nova"] .orbit-sidebar { 
            background: rgba(255,255,255,0.3) !important; 
        }

/* --- GLOBAL LIQUID SCROLLBARS --- */
/* Target all elements in the app */
::-webkit-scrollbar {
    width: 6px;  /* Vertical width */
    height: 6px; /* Horizontal height */
}

/* The Track (Background) - Invisible */
::-webkit-scrollbar-track {
    background: transparent;
}

/* The Handle (Thumb) - Glass Pill */
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15); /* Subtle glass */
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.05); /* Tiny border for definition */
}

/* Hover State - Brighter */
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
    cursor: grab;
}

/* Corner (where X and Y bars meet) */
::-webkit-scrollbar-corner {
    background: transparent;
}

/* --- FIREFOX COMPATIBILITY --- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* --- THEME CONTRAST FIXES --- */
/* Apply the dynamic text color to buttons and checks */
.btn-ai, .btn-save, .btn-notify, .btn-delete, .radio-btn.play {
    color: var(--text-on-accent) !important;
}

/* Checkboxes */
.glass-checkbox:checked::after {
    color: var(--text-on-accent) !important;
    text-shadow: none !important; /* Remove shadow for clean look on white */
}
.task-check.checked::before {
    color: var(--text-on-accent) !important;
}

/* --- RADIO VISUALIZER (ENHANCED) --- */
.radio-vis {
    height: 140px; 
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.05) 0%, transparent 70%);
    display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden;
    gap: 4px; /* Spacing */
}

/* Liquid Pills instead of bars */
.radio-wave-bar {
    width: 8px; 
    background: var(--accent); 
    margin: 0;
    border-radius: 10px; /* Pill shape */
    animation: liquidWave 1.2s infinite ease-in-out;
    box-shadow: 0 0 20px var(--accent); /* Heavy glow */
    opacity: 0.8;
}

@keyframes liquidWave {
    0%, 100% { height: 10px; opacity: 0.3; transform: scaleY(1); }
    50% { height: 80px; opacity: 1; transform: scaleY(1.1); }
}

/* --- SOLID APP SHELL (Native Feel) --- */
        html, body {
            margin: 0; padding: 0;
            width: 100%; height: 100%;
            
            /* The "Solid" Fix: Lock the shell to the viewport */
            position: fixed; 
            inset: 0;
            overflow: hidden; /* Prevent global scroll */
            overscroll-behavior: none; /* Kill the "rubber band" bounce */
            
            /* Aesthetics */
            font-family: var(--font-main);
            background: var(--bg-deep);
            background-image: var(--bg-gradient);
            color: var(--text-primary);
            
            /* Interaction */
            touch-action: none; /* Disable browser zooming/panning globally */
            -webkit-user-select: none; user-select: none;
            -webkit-font-smoothing: antialiased;
            -webkit-tap-highlight-color: transparent;
        }

        /* ADD THIS: Global Box Sizing to prevent columns from being pushed out */
        *, *::before, *::after {
            box-sizing: border-box;
        }

        /* --- MOBILE DRAG FIXES --- */
        .fc-event, .fc-timegrid-slot, .fc-scroller {
            -webkit-user-select: none; user-select: none;
            -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
        }

/* --- CALENDAR CONTAINER & ANIMATIONS --- */
#calendar {
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
    height: 100%; width: 100%; 
    
    /* UPDATED: Added transform to transition for the depth effect */
    transition: opacity 0.2s ease-in-out, filter 0.2s, transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
    will-change: opacity, filter, transform;
}

/* Spotlight Depth Effect */
.spotlight-blur-mode {
    filter: blur(12px) !important;
    opacity: 0.3 !important;
    transform: scale(1) !important; /* Push back in Z-space */
    pointer-events: none; /* Prevent clicking calendar while searching */
}

        /* The Active Swipe State (Motion Blur Only - NO SCALING) */
        .swipe-active {
            opacity: 0.6 !important; /* Dim slightly */
            /* FIX: Removed 'transform: scale(0.99)' to stop the "Jump" */
            filter: blur(4px) !important; /* Horizontal motion blur feel */
        }

        /* --- TOUCH RIPPLE --- */
        .touch-ripple {
            position: absolute; width: 50px; height: 50px;
            background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
            border: 1px solid rgba(255,255,255,0.4);
            border-radius: 50%; pointer-events: none;
            transform: translate(-50%, -50%) scale(0.5); opacity: 1;
            transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s ease-out;
            z-index: 9999; box-shadow: 0 0 15px rgba(255,255,255,0.2);
        }
        .touch-ripple.active { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }

        .app-container {
            display: flex; flex-direction: row;
            height: 100dvh; width: 100vw; position: relative; overflow: hidden;
        }

        /* --- GLASS SIDEBAR (With Living Pulse) --- */
.sidebar {
    width: 280px; min-width: 280px;
    background-color: rgba(15, 15, 18, 0.65); /* Base color */
    
    /* NEW: The Breathing Light Beam */
    background-image: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
    background-size: 100% 200%; /* Double height for scrolling effect */
    animation: beamVertical 12s ease-in-out infinite;
    
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    padding: 20px;
    display: flex; flex-direction: column; gap: 15px;
    border-right: 1px solid var(--glass-border);
    z-index: 20;
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    overflow-y: auto;
    touch-action: pan-y; 
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
}
/* Custom Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
    width: 5px; /* Slim width */
}

.sidebar::-webkit-scrollbar-track {
    background: transparent; /* Invisible track */
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1); /* Subtle glass pill */
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2); /* Slightly brighter on interaction */
}

        .brand {
            font-size: 18px; font-weight: 700; margin-bottom: 10px;
            display: flex; align-items: center; gap: 10px;
            color: var(--text-primary); /* CHANGED FROM white */
            letter-spacing: -0.5px;
        }

        .main-content {
            flex-grow: 1; height: 100%; width: 100%;
            position: relative; z-index: 1;
            display: flex; flex-direction: column; overflow: hidden; 
        }

/* Sidebar Specific Time Picker Overrides */
        #glassTimePickerSidebar {
            width: 100%; position: relative; /* Inline, not absolute */
            top: 0; margin-top: 5px; 
            box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
            border: 1px solid rgba(255,255,255,0.05);
        }
        #glassTimePickerSidebar .time-cell { width: 100%; font-size: 12px; height: 30px; }

        /* --- GLASS CARDS --- */
        .card {
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid var(--glass-border);
            border-radius: 14px;
            padding: 15px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            position: relative;
        }
        h3 { margin: 0 0 12px 0; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.5px; }
        .stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 500; color: #ccc; }
        .stat-row span:last-child { color: white; font-weight: 700; font-family: monospace; }

/* --- CONTROLS (LIQUID GLASS) --- */
        button { 
            cursor: pointer; border: 1px solid rgba(255,255,255,0.1); 
            border-radius: 12px; padding: 12px 16px; 
            font-weight: 600; font-size: 13px; 
            transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            position: relative; overflow: hidden;
            backdrop-filter: blur(10px);
        }
        /* Top shine reflection */
        button::after {
            content: ''; position: absolute; top: 0; left: 0; right: 0; height: 40%;
            background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
            pointer-events: none; border-radius: 12px 12px 60% 60%;
        }
        button:active { transform: scale(0.97); }

        /* Primary Action (Liquid Blue) */
        .btn-ai {
            /* 1. Generate Gradient: Accent -> 40% Darker Accent */
            background: radial-gradient(
                circle at 50% 0%, 
                var(--accent), 
                color-mix(in srgb, var(--accent), black 40%)
            );
            
            color: var(--text-on-accent) !important; 
            width: 100%; margin-bottom: 10px;
            
            /* 2. Generate Glow: Accent with 70% Transparency */
            box-shadow: 
                0 4px 15px color-mix(in srgb, var(--accent), transparent 70%), 
                inset 0 1px 0 rgba(255,255,255,0.3);
                
            /* 3. Border: Slightly Darker Accent */
            border: 1px solid color-mix(in srgb, var(--accent), black 20%);
        }

        /* Secondary Action (Frosted Glass) */
        .btn-secondary {
            background: rgba(255,255,255,0.08); color: var(--text-primary);
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        }
        .btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }

        /* Save Action (Liquid Green) */
        .btn-save { 
            background: radial-gradient(circle at 50% 0%, #34c759, #248a3d);
            color: white; width: 100%; 
            box-shadow: 0 4px 15px rgba(50, 215, 75, 0.3), inset 0 1px 0 rgba(255,255,255,0.3);
            border: 1px solid rgba(52, 199, 89, 0.5);
        }

        /* Danger Action (Liquid Red) */
        .btn-delete { 
            background: radial-gradient(circle at 50% 0%, rgba(255, 69, 58, 0.2), rgba(255, 69, 58, 0.1));
            color: #ff453a; width: 100%; margin-top: 10px; 
            border: 1px solid rgba(255, 69, 58, 0.3);
            box-shadow: 0 4px 15px rgba(255, 69, 58, 0.1);
        }
        .btn-delete:hover { background: rgba(255, 69, 58, 0.25); color: #ff6055; }

        .btn-notify { background: var(--accent); color: white; width: 100%; margin-bottom: 10px; font-size: 11px; }

        /* --- GLASS CHECKBOX TOGGLES --- */
        .glass-checkbox {
            appearance: none; -webkit-appearance: none;
            width: 22px; height: 22px;
            background: rgba(0,0,0,0.4);
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.2);
            cursor: pointer; position: relative;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .glass-checkbox:checked {
            transform: scale(1.1);
            border-color: transparent;
        }
        .glass-checkbox:checked::after {
            content: '\2713'; position: absolute; top: 50%; left: 50%;
            transform: translate(-50%, -50%);
            color: white; font-size: 12px; font-weight: 900;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
        }
        /* Custom Colors per Type */
        #eventIsIncome:checked, #remIsIncome:checked { background: var(--success) !important; box-shadow: 0 0 15px var(--success); }
        #addTravel:checked { background: #ac8e68 !important; box-shadow: 0 0 15px #ac8e68; }
        #checkIntel:checked { background: var(--accent) !important; box-shadow: 0 0 15px var(--accent); }
        #eventHasAlarm:checked { background: var(--danger) !important; box-shadow: 0 0 15px var(--danger); }

/* --- INDENTED GLASS INPUTS --- */
        /* ADDED: input[type="date"] to the list */
        input[type="text"], input[type="password"], input[type="email"], select, textarea, input[type="number"], input[type="datetime-local"], input[type="time"], input[type="date"] {
            width: 100%;
            background: rgba(0, 0, 0, 0.25);
            backdrop-filter: blur(10px);
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 0 2px rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            color: white; padding: 12px; border-radius: 12px; outline: none; box-sizing: border-box; 
            font-family: var(--font-main); font-size: 13px;
            transition: all 0.2s ease-out;
        }
        /* Fix for the calendar icon color */
        input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); opacity: 0.6; cursor: pointer; }

        input:focus, textarea:focus, select:focus { 
            background: rgba(0, 0, 0, 0.4);
            border-color: var(--accent); 
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.8), 0 0 15px rgba(10, 132, 255, 0.15);
        }

        /* AUTH SCREEN STYLES */
        .auth-icon {
            font-size: 42px; margin-bottom: 15px;
            background: linear-gradient(135deg, #fff 0%, #a1a1aa 100%);
            -webkit-background-clip: text; -webkit-text-fill-color: transparent;
            filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
        }
        .auth-switch-link {
            margin-top: 15px; font-size: 11px; color: var(--text-secondary); 
            cursor: pointer; transition: color 0.2s; text-decoration: underline; text-underline-offset: 3px;
        }
        .auth-switch-link:hover { color: var(--accent); }

/* --- MOBILE ACTION SHEET (iOS Style) --- */
        #mobileActionSheet {
            position: fixed; bottom: 0; left: 0; width: 100%;
            background: rgba(20, 20, 22, 0.85);
            backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
            border-top: 1px solid rgba(255,255,255,0.15);
            border-radius: 24px 24px 0 0;
            padding: 20px 20px 40px 20px; /* Extra padding for bottom safe area */
            z-index: 9999;
            transform: translateY(110%); /* Hidden by default */
            transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
            display: flex; flex-direction: column; gap: 8px;
            box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
        }

        #mobileActionSheet.active { transform: translateY(0); }

        .sheet-header {
            text-align: center; margin-bottom: 15px;
            color: #8e8e93; font-size: 11px; font-weight: 700; 
            text-transform: uppercase; letter-spacing: 1px;
        }

        .sheet-btn {
            background: rgba(255,255,255,0.08); 
            border: none; color: white;
            padding: 16px; border-radius: 14px;
            font-size: 16px; font-weight: 600;
            display: flex; align-items: center; gap: 15px;
            cursor: pointer; transition: background 0.2s;
        }
        .sheet-btn:active { background: rgba(255,255,255,0.15); transform: scale(0.98); }
        .sheet-btn i { font-size: 18px; width: 24px; text-align: center; }

        /* Specific Colors */
        .sheet-btn.primary { color: var(--accent); }
        .sheet-btn.danger { color: #ff453a; background: rgba(255, 69, 58, 0.15); }
        .sheet-btn.cancel { margin-top: 10px; background: black; color: #8e8e93; justify-content: center; }

/* CHOPPER MODE CURSOR (Grinder Teeth) */
body.key-ctrl .fc-event,
body.key-ctrl .fc-event * { /* Apply to children too */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23ff453a" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12l5-5 5 5 5-5 5 5"/></svg>'), crosshair !important;
    pointer-events: auto !important; /* Ensure clicks go through */
}

/* Red Border on the Dragged Event */
body.key-ctrl .fc-event-dragging {
    border: 2px dashed #ff453a !important;
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.4) !important;
    opacity: 0.7 !important;
}

/* --- SEARCH HIGHLIGHT (SUPERNOVA) --- */
@keyframes superNova {
    0% {
        box-shadow: 0 0 0 0 rgba(10, 132, 255, 0);
        border-color: transparent;
        transform: scale(1);
        z-index: 9999;
    }
    50% {
        /* Layer 1: Bright Blue Core */
        /* Layer 2: Wide Faint Aura */
        box-shadow: 0 0 30px 10px rgba(10, 132, 255, 0.9),
                    0 0 100px 40px rgba(10, 132, 255, 0.4);
        
        /* Flash White Border to distinct it from background */
        border-color: #ffffff;
        
        /* Lift it up */
        transform: scale(1.05);
        z-index: 9999;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(10, 132, 255, 0);
        border-color: transparent;
        transform: scale(1);
        z-index: 9999;
    }
}

.search-focus {
    /* Force shadow to be visible outside the event box */
    overflow: visible !important; 
    
    /* Ensure it sits on top of everything (grid lines, other events) */
    z-index: 9999 !important; 
    
    /* 3 Cycles of 1.0s */
    animation: superNova 1.0s ease-in-out 3 !important; 
    
    /* Ensure border rendering */
    border-width: 2px !important;
    border-style: solid !important;
}

/* --- WELCOME SPLASH SCREEN --- */
#welcomeScreen {
    position: fixed; inset: 0; 
    background: #000000;
    z-index: 20000; /* Above everything */
    display: none; /* Hidden by default */
    flex-direction: column; 
    align-items: center; justify-content: center;
    transition: opacity 0.8s ease-in-out;
}

.welcome-logo {
    font-size: 60px; color: white; margin-bottom: 20px;
    filter: drop-shadow(0 0 30px rgba(10, 132, 255, 0.6));
    animation: pulseLogo 2s infinite ease-in-out;
}

.welcome-text {
    font-size: 24px; font-weight: 800; color: white; 
    letter-spacing: -0.5px; margin-bottom: 10px;
    opacity: 0; animation: slideUpFade 0.5s ease-out forwards 0.2s;
}

.welcome-sub {
    font-size: 12px; color: #666; font-family: monospace;
    opacity: 0; animation: slideUpFade 0.5s ease-out forwards 0.5s;
}

@keyframes pulseLogo {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

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

.fade-out { opacity: 0 !important; pointer-events: none; }

/* --- AGENT INSIGHT ALERT (Responsive) --- */
#agentAlert {
    position: fixed; top: 96px; left: 54%; transform: translateX(-50%) translateY(-100px);
    background: rgba(10, 10, 14, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px; /* Desktop: Perfect Pill */
    padding: 12px 25px;
    display: flex; align-items: center; gap: 15px; /* More breathing room */
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    z-index: 20000;
    opacity: 0; pointer-events: none;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    
    /* Desktop: Single line, nice and wide */
    white-space: nowrap;
    max-width: 90vw;
}

#agentAlert.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1; pointer-events: auto;
}

.agent-icon-box {
    width: 32px; height: 32px; border-radius: 50%; /* Slightly larger icon */
    background: linear-gradient(135deg, #0a84ff, #5e5ce6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 14px;
    box-shadow: 0 0 15px rgba(10, 132, 255, 0.4);
    
    /* CRITICAL: Prevent icon from getting squashed */
    flex-shrink: 0; 
}

.agent-text { 
    font-size: 13px; color: white; font-weight: 500; letter-spacing: 0.3px; 
}

/* --- MOBILE TWEAKS --- */
@media (max-width: 768px) {
    #agentAlert {
        top: 60px; /* Safe zone */
        width: 90%; /* Take up most width */
        white-space: normal; /* Allow text wrapping */
        border-radius: 20px; /* Softer corners for multi-line */
        padding: 15px; /* More internal space */
        align-items: flex-start; /* Align icon to top if text is long */
    }
    
    .agent-text {
        font-size: 12px;
        line-height: 1.4; /* Readable multi-line */
        margin-top: 2px; /* Visual alignment with icon center */
    }
}

/* --- FINANCE HUD MODAL (PRO - V2) --- */
#financeModal .modal-content {
    width: 600px;
    max-width: 95%; /* Mobile Fit */
    background: rgba(10, 10, 14, 0.85); /* Slightly darker for readability */
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 0 100px rgba(0,0,0,0.9), inset 0 0 30px rgba(255,255,255,0.02);
    border-radius: 24px;
    padding: 0; overflow: hidden; position: relative;
    display: flex; flex-direction: column; /* For vertical layout */
    max-height: 90vh; /* Prevent cut-off on mobile */
}

/* 1. SLOWER SCANNER */
.hud-scanner {
    position: absolute; top: -50%; left: 0; right: 0; height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(10, 132, 255, 0.1), transparent); /* Fainter */
    animation: scanDown 8s linear infinite; /* 4s -> 8s (Much slower) */
    pointer-events: none; z-index: 0;
}
@keyframes scanDown { 0% { top: -20%; opacity: 0; } 20% { opacity: 0.5; } 100% { top: 120%; opacity: 0; } }

.fin-header {
    padding: 25px 30px; position: relative; z-index: 1; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    display: flex; justify-content: space-between; align-items: flex-end;
}

.fin-big-num { font-size: 32px; font-weight: 800; letter-spacing: -1px; color: white; line-height: 1; text-shadow: 0 0 30px rgba(255,255,255,0.1); }
.fin-label { font-size: 8px; text-transform: uppercase; color: #8e8e93; font-weight: 700; letter-spacing: 1.5px; margin-bottom: 8px; }

.fin-grid { 
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05); position: relative; z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05);
}
/* Grid Pulse (Kept subtle) */
.fin-grid::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(10, 132, 255, 0.2), transparent);
    animation: pulseGrid 4s ease-in-out infinite; pointer-events: none; mix-blend-mode: overlay;
}
@keyframes pulseGrid { 0% { opacity: 0.1; transform: translateX(-50%); } 50% { opacity: 0.4; } 100% { opacity: 0.1; transform: translateX(50%); } }

.fin-stat-box { 
    background: rgba(15, 15, 20, 0.6); 
    padding: 20px 10px; 
    text-align: center; 
    backdrop-filter: blur(10px);
    
    /* Interaction */
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer; /* Changed to pointer */
    position: relative;
    user-select: none;
}

.fin-stat-box:hover { 
    background: rgba(255, 255, 255, 0.08); 
    transform: translateY(-2px) scale(1.02); 
    z-index: 2; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(255,255,255,0.05);
}

/* ACTIVE TAB STATE (Selected) */
.fin-stat-box.active {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2), 0 0 20px rgba(0,0,0,0.5);
    z-index: 3;
}

/* Chart Area */
.fin-chart-box { 
    height: 180px; /* Slightly shorter to save space */ 
    padding: 20px 10px 0 10px; background: rgba(0,0,0,0.2); 
    position: relative; z-index: 1; flex-shrink: 0;
}

/* SCROLLABLE LIST AREA */
.fin-list { 
    padding: 20px 30px; position: relative; z-index: 1; 
    overflow-y: auto; /* Enable Scroll */
    flex-grow: 1; /* Take remaining height */
    min-height: 150px; /* Ensure at least 5 items visible */
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Custom Scrollbar for the list */
.fin-list::-webkit-scrollbar { width: 4px; }
.fin-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.fin-item { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: transform 0.2s, background 0.2s; padding-left: 5px; padding-right: 5px; border-radius: 8px;
}
.fin-item:hover { background: rgba(255,255,255,0.03); transform: scale(1.01); }
.fin-item:last-child { border-bottom: none; }

.fin-tag { 
    font-size: 9px; padding: 2px 6px; border-radius: 6px; font-weight: 700;
    background: rgba(255,255,255,0.08); color: #ccc; margin-left: 8px;
    border: 1px solid rgba(255,255,255,0.05); white-space: nowrap;
}

/* --- FINANCIAL SAFETY NET MODAL --- */
#safetyNetModal .modal-content {
    width: 320px; text-align: center; padding: 30px 20px;
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border-radius: 24px;
    box-shadow: 0 50px 100px rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.1);
    transform: scale(0.9); opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#safetyNetModal.active .modal-content {
    transform: scale(1); opacity: 1;
}

.safety-icon {
    font-size: 40px; margin-bottom: 15px;
    animation: pulseWarn 2s infinite;
}

@keyframes pulseWarn { 
    0% { transform: scale(1); opacity: 1; } 
    50% { transform: scale(1.1); opacity: 0.8; } 
    100% { transform: scale(1); opacity: 1; } 
}

/* Theme: Warning (Amber) */
.safety-warning { border-color: #ff9f0a !important; box-shadow: 0 0 50px rgba(255, 159, 10, 0.2) !important; }
.safety-warning .safety-icon { color: #ff9f0a; text-shadow: 0 0 20px rgba(255, 159, 10, 0.6); }
.safety-warning h3 { color: #ff9f0a; }

/* Theme: Danger (Red) */
.safety-danger { border-color: #ff453a !important; box-shadow: 0 0 50px rgba(255, 69, 58, 0.3) !important; }
.safety-danger .safety-icon { color: #ff453a; text-shadow: 0 0 20px rgba(255, 69, 58, 0.6); }
.safety-danger h3 { color: #ff453a; }

.safety-bar-bg {
    width: 100%; height: 6px; background: rgba(255,255,255,0.1);
    border-radius: 3px; margin: 20px 0 10px 0; overflow: hidden;
}
.safety-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease-out; }

/* --- STATEMENT VIEW (COMPLETE) --- */
#finStatementView {
    display: none; /* Hidden by default */
    flex-direction: column; height: 100%;
    animation: fadeIn 0.2s ease-out;
}

.stmt-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 30px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stmt-controls { display: flex; align-items: center; gap: 10px; } /* Updated gap */

/* SEARCH BAR (Compact to Expanded) */
.stmt-search-wrapper {
    position: relative; margin-right: 10px;
    display: flex; align-items: center; /* Keeps it vertically centered */
}

.stmt-search-input {
    /* 1. Strip Native Mobile Styles */
    -webkit-appearance: none; appearance: none;
    
    /* 2. Visuals */
    background: rgba(255, 255, 255, 0.08) !important; 
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    border-radius: 8px; 
    
    /* 3. COMPACT STATE (20% shorter) */
    height: 32px; 
    padding: 0 10px 0 30px; /* Use line-height for vertical centering */
    line-height: 28px;
    font-size: 11px; 
    width: 120px; /* Slightly narrower too */
    
    /* Smooth Morphing */
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    outline: none;
}

.stmt-search-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
    opacity: 1; 
}

/* 4. EXPANDED STATE (On Tap) */
.stmt-search-input:focus { 
    width: 180px; 
    height: 32px; /* Grow taller */
    background: rgba(0, 0, 0, 0.8) !important;
    border-color: var(--accent) !important; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.stmt-search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    font-size: 10px; 
    color: rgba(255, 255, 255, 0.9) !important; 
    pointer-events: none;
}

.stmt-btn {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    color: #ccc; border-radius: 8px; width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.2s;
}
.stmt-btn:hover { background: rgba(255,255,255,0.15); color: white; }

/* NEW: Export Button Style */
.btn-export {
    background: rgba(50, 215, 75, 0.15) !important; 
    border-color: rgba(50, 215, 75, 0.3) !important;
    color: #32d74b !important;
}
.btn-export:hover { background: rgba(50, 215, 75, 0.25) !important; }

.stmt-date-display {
    font-size: 14px; font-weight: 700; color: white; text-transform: uppercase;
    letter-spacing: 1px; min-width: 140px; text-align: center;
}

/* NEW: Category Heatmap */
.stmt-heatmap {
    display: flex; gap: 8px; padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.01);
    overflow-x: auto; white-space: nowrap;
}
.heatmap-pill {
    font-size: 9px; padding: 2px 8px; border-radius: 4px;
    background: rgba(255,255,255,0.05); color: #8e8e93; border: 1px solid rgba(255,255,255,0.05);
}
.heatmap-pill b { color: white; margin-left: 4px; }

/* TABLE & ACCORDION STYLES */
.stmt-container { flex-grow: 1; overflow-y: auto; padding: 0; position: relative; }
.stmt-container::-webkit-scrollbar { width: 4px; }
.stmt-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.stmt-table { width: 100%; border-collapse: collapse; font-size: 12px; }

.stmt-table th {
    text-align: left; padding: 12px 20px;
    color: #8e8e93; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
    background: rgba(20,20,25,0.95); position: sticky; top: 0; z-index: 10;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
}

/* Sortable Headers */
.stmt-table th.sortable { cursor: pointer; user-select: none; transition: color 0.2s; }
.stmt-table th.sortable:hover { color: white; background: rgba(255,255,255,0.05); }
.stmt-table th.active-sort { color: var(--accent) !important; }

/* Sort Icon */
.sort-icon { font-size: 9px; margin-left: 5px; opacity: 0.5; display: inline-block; width: 10px; }
.active-sort .sort-icon { opacity: 1; }

.stmt-table td {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: #ccc;
}

.stmt-row { cursor: pointer; transition: background 0.2s; }
.stmt-row:hover { background: rgba(255,255,255,0.03); }
.stmt-row.expanded { background: rgba(255,255,255,0.05); }

.stmt-amount { font-family: monospace; font-size: 13px; font-weight: 700; text-align: right; }
.stmt-date { opacity: 0.6; font-variant-numeric: tabular-nums; }
.stmt-cat { 
    font-size: 9px; padding: 2px 6px; border-radius: 4px; 
    background: rgba(255,255,255,0.05); color: #8e8e93; display: inline-block;
}

/* Inspector / Details Row */
.stmt-details-row { display: none; background: rgba(0,0,0,0.2); }
.stmt-details-row.active { display: table-row; animation: slideDown 0.2s ease-out; }

.stmt-inspector {
    padding: 15px 20px;
    display: flex; gap: 15px; align-items: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.stmt-input {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 8px; border-radius: 6px; font-size: 11px;
    width: 100%; outline: none; transition: border 0.2s;
}
.stmt-input:focus { border-color: var(--accent); }

.stmt-actions { display: flex; flex-direction: column; gap: 5px; min-width: 80px; }

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

/* --- STATEMENT DYNAMIC FOOTER --- */
.stmt-footer {
    padding: 15px 30px; background: rgba(0,0,0,0.3); 
    border-top: 1px solid rgba(255,255,255,0.1); 
    display: flex; justify-content: space-between; align-items: center;
}
.stmt-stat { display: flex; flex-direction: column; align-items: flex-end; }
.stmt-stat-label { font-size: 9px; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.stmt-stat-val { font-size: 13px; font-weight: 700; font-family: monospace; }

/* --- AI AUDIT CARDS --- */
.audit-container {
    padding: 0 30px 15px 30px;
    display: none; /* Hidden by default */
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

.audit-card {
    flex: 1;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 12px;
    display: flex; flex-direction: column; gap: 5px;
    backdrop-filter: blur(10px);
}

.audit-header {
    font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 6px;
}

.audit-body {
    font-size: 11px; line-height: 1.4; color: #ccc;
}

/* Colors */
.ac-green .audit-header { color: #32d74b; }
.ac-red .audit-header { color: #ff453a; }
.ac-blue .audit-header { color: #0a84ff; }

/* Mobile Stack */
@media (max-width: 768px) {
    .audit-container { flex-direction: column; }
}

/* --- UPDATING STATE (Visual Buffer) --- */
.evt-updating {
    opacity: 0.8 !important;
    animation: pulseIntel 1.5s infinite ease-in-out !important;
    cursor: wait !important;
    pointer-events: none; /* Prevent touching while saving */
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
}

@keyframes pulseIntel {
    0% { box-shadow: 0 0 0 rgba(10, 132, 255, 0); }
    50% { box-shadow: 0 0 20px rgba(10, 132, 255, 0.6); filter: brightness(1.2); }
    100% { box-shadow: 0 0 0 rgba(10, 132, 255, 0); }
}

/* --- GAME OVERLAY --- */
        #gameOverlay {
            position: fixed; inset: 0; z-index: 20000;
            background:
                radial-gradient(1200px circle at 50% -20%, rgba(10, 132, 255, 0.16), transparent 60%),
                rgba(5, 6, 10, 0.6);
            backdrop-filter: blur(24px) saturate(160%);
            -webkit-backdrop-filter: blur(24px) saturate(160%);
            display: none; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.3s ease;
        }
        #gameOverlay.active { opacity: 1; }
        
        #gameUI {
            width: 90%; max-width: 420px; height: 72vh;
            background: linear-gradient(180deg, var(--glass-bg-1), var(--glass-bg-2));
            border: 1px solid var(--glass-border-soft);
            box-shadow:
                0 30px 80px rgba(0, 0, 0, 0.6),
                0 0 60px rgba(10, 132, 255, 0.08);
            border-radius: 22px; padding: 20px;
            display: flex; flex-direction: column;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(18px) saturate(160%);
            -webkit-backdrop-filter: blur(18px) saturate(160%);
        }

        #gameUI::before {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background:
                linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 35%),
                radial-gradient(600px circle at 20% 0%, rgba(255, 255, 255, 0.06), transparent 55%);
            opacity: 0.7;
            pointer-events: none;
        }

        #gameUI::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
            background-size: 3px 3px;
            opacity: 0.12;
            pointer-events: none;
            mix-blend-mode: screen;
        }

        #gameUI > * {
            position: relative;
            z-index: 1;
        }

        .game-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: var(--space-3);
            margin-bottom: var(--space-4);
        }

        .game-header-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .game-title {
            font-weight: 800;
            font-size: 19px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            font-family: var(--font-display);
            color: var(--accent);
        }

        @supports (-webkit-background-clip: text) or (background-clip: text) {
            .game-title {
                background: linear-gradient(120deg, #ffffff, var(--accent));
                -webkit-background-clip: text;
                background-clip: text;
                color: transparent;
            }
        }

        .game-title {
            text-shadow: 0 0 18px var(--glow-accent);
        }

        .game-score {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 2px;
            font-family: var(--font-mono);
        }

        .game-score-label {
            font-size: 9px;
            letter-spacing: 0.2em;
            color: var(--text-secondary);
        }

        .game-score-value {
            font-size: 16px;
            font-weight: 700;
            color: #ffffff;
            display: inline-flex;
            align-items: center;
        }

        .game-close-btn {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--glass-bg-3);
            border: 1px solid var(--glass-border-soft);
            border-radius: 10px;
            color: #d1d1d6;
            padding: 0;
            cursor: pointer;
            transition: transform 0.2s var(--ease-spring), border-color 0.2s var(--ease-smooth),
                background 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth), color 0.2s;
        }

        .game-close-btn:hover {
            transform: translateY(-1px);
            color: #ffffff;
            background: rgba(255, 255, 255, 0.12);
            border-color: var(--glass-border-strong);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px var(--glow-accent);
        }

        .game-close-btn:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .game-icon {
            width: 16px;
            height: 16px;
            display: block;
        }

        .game-stat-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            color: #d1d5db;
        }

        .game-stat-icon .game-icon {
            width: 18px;
            height: 18px;
        }

        /* --- TETRIS HUD (Desktop Only) --- */
        .game-meta-row {
            display: none;
            width: 100%;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 12px;
        }

        #gameUI.tetris-mode .game-meta-row.tetris-only { display: flex; }
        #gameUI.flappy-mode .game-meta-row.flappy-only { display: flex; }

        .flappy-only { display: none; }

        /* === FLAPPY PREMIUM MINIMAL UI === */
        
        /* Floating HUD - always visible in flappy mode */
        .flappy-floating-hud {
            display: none;
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 5;
        }

        #gameUI.flappy-mode .flappy-floating-hud {
            display: block;
        }

        .flappy-hud-pill {
            position: absolute;
            background: rgba(0, 0, 0, 0.35);
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 10px;
            padding: 4px 10px;
            font-size: 10px;
            font-weight: 600;
            color: rgba(255,255,255,0.75);
            font-family: var(--font-mono);
            letter-spacing: 0.03em;
        }

        .flappy-hud-level {
            top: 8px;
            left: 8px;
        }

        .flappy-hud-time {
            bottom: 8px;
            right: 8px;
        }

        /* Settings gear button */
        .flappy-settings-btn {
            width: 32px;
            height: 32px;
            display: none;
            align-items: center;
            justify-content: center;
            background: var(--glass-bg-3);
            border: 1px solid var(--glass-border-soft);
            border-radius: 8px;
            color: #d1d1d6;
            cursor: pointer;
            transition: all 0.15s ease;
            font-size: 18px;
            line-height: 1;
        }

        #gameUI.flappy-mode .flappy-settings-btn {
            display: inline-flex;
        }

        .flappy-settings-btn:hover {
            background: rgba(255, 255, 255, 0.12);
            color: #fff;
            transform: translateY(-1px);
            border-color: var(--glass-border-strong);
        }

        /* Compact settings dropdown - forced overlay */
        #gameUI .flappy-settings-panel {
            position: absolute !important;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            right: auto !important;
            bottom: auto !important;
            width: 145px;
            background: rgba(12, 12, 16, 0.95);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 10px;
            z-index: 200;
            display: none;
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }

        #gameUI .flappy-settings-panel.active {
            display: block !important;
        }

        .flappy-settings-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 8px;
        }

        .flappy-settings-row .game-meta-label {
            font-size: 9px;
            color: #666;
        }

        .flappy-settings-row select {
            flex: 1;
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 6px;
            color: white;
            font-size: 11px;
            padding: 5px 8px;
            outline: none;
        }

        .flappy-settings-toggles {
            display: flex;
            gap: 6px;
            margin-bottom: 8px;
        }

        .flappy-settings-toggles .game-stat {
            flex: 1;
            min-width: 0;
            padding: 6px 8px;
            background: rgba(255,255,255,0.04);
            border: 1px solid rgba(255,255,255,0.08);
        }

        .flappy-settings-toggles .game-meta-label {
            font-size: 8px;
        }

        .flappy-settings-toggles .game-stat-value {
            font-size: 11px;
        }

        .flappy-settings-panel .game-mode-desc-inline {
            display: none;
        }

        .flappy-settings-stats {
            width: 100%;
            padding: 6px 10px;
            font-size: 10px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 6px;
            color: #aaa;
        }

        .flappy-settings-stats:hover {
            background: rgba(255,255,255,0.1);
            color: #fff;
        }

        .game-mode-select {
            display: flex; flex-direction: column; gap: 6px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.25));
            border: 1px solid var(--glass-border-soft);
            border-radius: 14px;
            padding: 10px;
            min-width: 140px;
            backdrop-filter: blur(12px) saturate(140%);
            -webkit-backdrop-filter: blur(12px) saturate(140%);
        }

        .game-mode-select select {
            appearance: none;
            -webkit-appearance: none;
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 10px;
            color: white;
            font-size: 11px;
            padding: 6px 26px 6px 8px;
            outline: none;
            font-family: var(--font-mono);
            letter-spacing: 0.02em;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
            background-repeat: no-repeat;
            background-position: right 8px center;
            background-size: 12px;
        }

        .game-mode-select select:focus-visible {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25);
        }

        .game-mode-desc-inline {
            font-size: 9px;
            color: #8e8e93;
            line-height: 1.4;
            margin-top: 6px;
            max-width: 180px;
            transition: opacity 0.2s var(--ease-smooth), transform 0.2s var(--ease-smooth);
        }

        .game-mode-desc-inline.is-updating {
            opacity: 0.5;
            transform: translateY(2px);
        }

        .game-meta-label {
            font-size: 9px;
            letter-spacing: 0.08em;
            color: #9aa0a6;
            text-transform: uppercase;
        }

        .game-stat-row {
            display: flex; align-items: stretch; gap: 8px;
            padding: 10px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.3));
            border: 1px solid var(--glass-border-soft);
            border-radius: 14px;
            flex: 1;
            justify-content: space-between;
            backdrop-filter: blur(14px) saturate(140%);
            -webkit-backdrop-filter: blur(14px) saturate(140%);
        }

        .game-stat {
            display: flex; flex-direction: column; gap: 6px;
            align-items: center; min-width: 56px;
            padding: 8px 10px;
            border-radius: 12px;
            background: rgba(10, 12, 18, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.06);
            position: relative;
            transition: transform 0.2s var(--ease-spring), border-color 0.2s var(--ease-smooth),
                background 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
        }

        .game-stat:not(:last-child)::after {
            content: "";
            position: absolute;
            right: -5px;
            top: 18%;
            bottom: 18%;
            width: 1px;
            background: rgba(255, 255, 255, 0.06);
        }

        .game-stat:hover {
            transform: translateY(-2px);
            border-color: var(--glass-border-strong);
            background: rgba(20, 24, 32, 0.6);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35), 0 0 18px rgba(10, 132, 255, 0.12);
        }


        /* === FLAPPY UNIFIED LAYOUT (Same for all orientations) === */
        #gameUI.flappy-mode {
            width: 100%;
            max-width: 100%;
            height: 100%;
        }

        #gameUI.flappy-mode .game-meta-row.flappy-only {
            display: none !important;
        }

        #gameUI.flappy-mode #gameWrapper {
            flex: none;
            height: 90%;
            border-radius: 12px;
            min-height: 0;
            overflow: hidden;
        }

        #gameUI.flappy-mode .game-header {
            margin-bottom: 8px;
            padding-top: 15px;
        }

        /* Portrait: Full screen */
        @media (max-width: 768px) and (orientation: portrait) {
            #gameUI.flappy-mode {
                width: 100vw;
                height: 100vh;
                border-radius: 0;
                padding: calc(10px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));
            }

            #gameUI.flappy-mode #gameWrapper {
                border-radius: 12px !important;
                border: none !important;
            }

        }

        /* Landscape: Full width, shorter height */
        @media (max-width: 1024px) and (orientation: landscape) {
            #gameUI.flappy-mode {
                width: 100%;
                max-width: 100%;
                height: 85vh;
                padding: 10px;
            }

        }

        .game-stat-row.animate .game-stat {
            animation: statEntry 420ms var(--ease-spring) both;
            animation-delay: var(--stat-delay, 0ms);
        }

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

        .game-stat-value {
            font-size: 13px;
            font-weight: 700;
            color: white;
            font-family: var(--font-mono);
            font-variant-numeric: tabular-nums;
            text-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }

        .value-pulse {
            animation: valuePulse 420ms var(--ease-spring);
        }

        @keyframes valuePulse {
            0% { transform: scale(1); }
            35% { transform: scale(1.08); }
            100% { transform: scale(1); }
        }

        @media (prefers-reduced-motion: reduce) {
            .game-stat-row.animate .game-stat,
            .value-pulse {
                animation: none !important;
                transform: none !important;
            }
        }

        /* Replay Controls */
        .replay-controls {
            display: none;
            position: absolute;
            top: 10px; right: 10px;
            gap: 8px;
            align-items: center;
            background: rgba(10,10,12,0.7);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 10px;
            padding: 6px 8px;
            z-index: 15;
        }

        #gameWrapper.replay-active .replay-controls { display: flex; }

        .replay-status {
            font-size: 9px;
            letter-spacing: 1px;
            color: #ffd700;
            font-weight: 700;
        }

        /* Game Over Details */
        .game-over-details {
            display: none;
            width: 80%;
            background: rgba(0,0,0,0.25);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 10px;
            margin-bottom: 12px;
        }

        #gameUI.tetris-mode .game-over-details.tetris-only { display: flex; flex-direction: column; gap: 6px; }
        #gameUI.flappy-mode .game-over-details.flappy-only { display: flex; flex-direction: column; gap: 6px; }

        .game-over-stat {
            display: flex; justify-content: space-between; align-items: center;
            font-size: 11px; color: #a1a1aa; font-family: monospace;
        }

        .game-over-label { color: #8e8e93; }

        .game-over-value { color: white; font-weight: 700; }

        /* Leaderboard */
        .game-leaderboard {
            display: none;
            width: 85%;
            margin-bottom: 12px;
            padding: 10px;
            border-radius: 12px;
            background: rgba(0,0,0,0.25);
            border: 1px solid rgba(255,255,255,0.08);
        }

        #gameUI.tetris-mode .game-leaderboard { display: flex; flex-direction: column; gap: 8px; }

        .game-leaderboard-title {
            font-size: 9px; letter-spacing: 1px; color: #8e8e93; font-weight: 700;
        }

        .game-leaderboard-list {
            display: flex; flex-direction: column; gap: 6px;
            max-height: 140px; overflow: auto;
        }

        .game-leaderboard-entry {
            display: flex; justify-content: space-between; align-items: center;
            font-size: 11px; color: #d1d1d6; font-family: monospace;
        }

        .game-leaderboard-rank { color: #ffd700; font-weight: 700; }

        .game-replay-row { display: none; margin-bottom: 14px; }
        #gameUI.tetris-mode .game-replay-row { display: flex; }

        /* Help Button */
        .game-help-btn {
            width: 24px; height: 24px;
            display: flex; align-items: center; justify-content: center;
            background: rgba(255,255,255,0.08);
            border: 1px solid var(--glass-border-soft);
            border-radius: 8px;
            font-weight: 700; color: #cbd5e1;
            cursor: pointer;
            transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease-smooth),
                border-color 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
        }
        .game-help-btn:hover {
            background: var(--accent);
            color: white;
            border-color: var(--accent);
        }

        .game-help-btn .game-icon {
            width: 14px;
            height: 14px;
        }

        /* Stats Button */
        .game-stats-btn {
            cursor: pointer;
            transition: all 0.2s;
            border-radius: 8px;
        }
        .game-stats-btn:hover {
            background: rgba(255,255,255,0.1);
        }

        .game-toggle-btn {
            cursor: pointer;
            transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease-smooth),
                border-color 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth),
                opacity 0.2s var(--ease-smooth);
            border-radius: 12px;
            opacity: 0.55;
            position: relative;
            overflow: hidden;
        }

        .game-toggle-btn:hover {
            background: rgba(255,255,255,0.12);
            opacity: 0.85;
            transform: translateY(-1px);
        }

        .game-toggle-btn.active {
            opacity: 1;
            background: linear-gradient(135deg, rgba(50, 215, 75, 0.2), rgba(10, 132, 255, 0.18));
            border: 1px solid rgba(50, 215, 75, 0.35);
            box-shadow: 0 0 18px rgba(50, 215, 75, 0.2);
        }

        .game-toggle-btn::after {
            content: "";
            position: absolute;
            top: 7px;
            right: 7px;
            width: 6px;
            height: 6px;
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.25);
            box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
        }

        .game-toggle-btn.active::after {
            background: var(--success);
            box-shadow: 0 0 10px var(--glow-success);
        }

        .game-toggle-btn.active .game-stat-icon {
            color: #eafff4;
        }

        /* === GAME MODAL OVERLAY (Shared) === */
        .game-modal-overlay {
            position: fixed;
            inset: 0;
            z-index: 21000;
            background: rgba(5, 5, 10, 0.85);
            backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
            display: none;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s ease;
        }
        .game-modal-overlay.active {
            opacity: 1;
        }

        .game-modal-content {
            width: 90%;
            max-width: 420px;
            max-height: 85vh;
            background: rgba(25, 25, 30, 0.95);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 20px;
            padding: 20px;
            overflow-y: auto;
            box-shadow: 0 30px 80px rgba(0,0,0,0.6);
        }

        .game-stats-modal-content {
            max-width: 480px;
        }

        .game-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
            padding-bottom: 12px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        .game-modal-header h3 {
            margin: 0;
            font-size: 18px;
            font-weight: 800;
            color: white;
        }
        .game-modal-close {
            width: 28px; height: 28px;
            display: flex; align-items: center; justify-content: center;
            background: rgba(255,255,255,0.1);
            border-radius: 50%;
            cursor: pointer;
            color: #a1a1aa;
            font-size: 12px;
            transition: all 0.2s;
        }
        .game-modal-close:hover {
            background: #ff453a;
            color: white;
        }

        .game-modal-body {
            color: #d1d1d6;
            font-size: 13px;
            line-height: 1.5;
        }

        .game-modal-intro {
            color: #a1a1aa;
            margin-bottom: 15px;
            font-size: 12px;
        }

        /* Mode Descriptions */
        .game-mode-descriptions {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 20px;
        }

        .game-mode-desc-item {
            background: rgba(0,0,0,0.25);
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 12px;
            padding: 12px;
        }

        .game-mode-desc-title {
            font-size: 14px;
            font-weight: 700;
            color: var(--accent);
            margin-bottom: 6px;
        }

        .game-mode-desc-text {
            font-size: 11px;
            color: #a1a1aa;
            line-height: 1.5;
        }

        .game-mode-desc-goal {
            font-size: 10px;
            color: #ffd700;
            margin-top: 6px;
            font-weight: 600;
        }

        /* Tips Section */
        .game-modal-tips {
            background: rgba(10, 132, 255, 0.1);
            border: 1px solid rgba(10, 132, 255, 0.2);
            border-radius: 12px;
            padding: 12px;
        }

        .game-modal-tips-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--accent);
            margin-bottom: 8px;
            letter-spacing: 0.5px;
        }

        .game-modal-tips ul {
            margin: 0;
            padding-left: 16px;
            font-size: 11px;
            color: #a1a1aa;
        }

        .game-modal-tips li {
            margin-bottom: 4px;
        }

        .game-modal-tips strong {
            color: white;
        }

        /* === STATS MODAL STYLES === */
        .stats-section {
            margin-bottom: 18px;
        }

        .stats-section-title {
            font-size: 10px;
            font-weight: 700;
            color: #8e8e93;
            letter-spacing: 1px;
            text-transform: uppercase;
            margin-bottom: 10px;
            padding-bottom: 6px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
        }

        .stats-grid-small {
            grid-template-columns: repeat(4, 1fr);
        }

        .stats-item {
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            padding: 10px 8px;
            text-align: center;
        }

        .stats-value {
            font-size: 16px;
            font-weight: 800;
            color: white;
            font-family: monospace;
        }

        .stats-label {
            font-size: 9px;
            color: #8e8e93;
            margin-top: 4px;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        /* Line Clear Breakdown */
        .stats-breakdown {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .stats-breakdown-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            font-family: monospace;
            font-size: 12px;
        }

        .stats-breakdown-label {
            color: #a1a1aa;
        }

        .stats-breakdown-value {
            color: white;
            font-weight: 700;
        }

        .flappy-heatmap-wrap {
            width: 100%;
            height: 130px;
            border-radius: 12px;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(0,0,0,0.2);
            overflow: hidden;
        }

        #flappyDeathHeatmap {
            width: 100%;
            height: 130px;
            display: block;
        }

        /* Mode Records */
        .stats-mode-records {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        .stats-mode-record {
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .stats-mode-name {
            font-size: 10px;
            color: #8e8e93;
            text-transform: uppercase;
            letter-spacing: 0.3px;
        }

        .stats-mode-value {
            font-size: 14px;
            font-weight: 700;
            color: white;
            font-family: monospace;
        }

        /* Milestones / Achievements */
        .stats-milestones {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }

        .stats-milestone {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: rgba(0,0,0,0.2);
            border: 1px solid rgba(255,255,255,0.06);
            border-radius: 10px;
        }

        .stats-milestone.achieved {
            background: rgba(50, 215, 75, 0.1);
            border-color: rgba(50, 215, 75, 0.25);
        }

        .stats-milestone.locked {
            opacity: 0.5;
        }

        .stats-milestone-icon {
            font-size: 18px;
            color: #ffd700;
        }

        .stats-milestone.locked .stats-milestone-icon {
            color: #8e8e93;
        }

        .stats-milestone-info {
            flex: 1;
            min-width: 0;
        }

        .stats-milestone-name {
            font-size: 11px;
            font-weight: 700;
            color: white;
            margin-bottom: 2px;
        }

        .stats-milestone-desc {
            font-size: 9px;
            color: #8e8e93;
        }

        /* Mobile adjustments for stats grid */
        @media (max-width: 480px) {
            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }
            .stats-milestones {
                grid-template-columns: 1fr;
            }
            .stats-mode-records {
                grid-template-columns: 1fr;
            }
        }

        /* ADD THIS: Widen the Arcade view on Desktop to prevent cropping */
        @media (min-width: 1024px) {
            #gameUI {
                max-width: 600px !important; /* Plenty of width for the grid + glow */
                height: 85vh;                /* Taller aspect ratio */
            }
        }

/* --- SPOTLIGHT SEARCH (Mac Style) --- */
#spotlightModal {
    position: fixed; top: 15%; left: 50%; transform: translateX(-50%);
    width: 600px; max-width: 90%;
    z-index: 20000; display: none; flex-direction: column;
    filter: drop-shadow(0 20px 50px rgba(0,0,0,0.8));
    opacity: 0; transition: opacity 0.2s ease, top 0.2s ease;
}

#spotlightModal.active { display: flex; opacity: 1; top: 20%; }

/* Mobile Adjustment: Prevent keyboard blocking */
@media (max-width: 1024px) {
    #spotlightModal.active { top: 10%; }
}

.spotlight-bar {
    background: rgba(30, 30, 35, 0.85);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 15px;
    display: flex; align-items: center; gap: 15px;
}

.spotlight-input {
    background: transparent !important; border: none !important; box-shadow: none !important;
    font-size: 20px !important; font-weight: 300 !important; color: white !important;
    padding: 0 !important; margin: 0 !important; height: auto !important;
    width: 100%; outline: none;
}

/* --- RESPONSIVE CLOSE BUTTON --- */
.sl-close-trigger { cursor: pointer; transition: opacity 0.2s; }
.sl-close-trigger:hover { opacity: 0.8; }

/* Desktop State: Badge */
.sl-esc-badge {
    font-size: 10px; background: rgba(255,255,255,0.1); 
    padding: 4px 8px; border-radius: 4px; color: #8e8e93; display: block;
}
/* Mobile State: Icon */
.sl-mobile-x { display: none; font-size: 22px; color: #8e8e93; padding: 5px; }

@media (max-width: 1024px) {
    .sl-esc-badge { display: none; }
    .sl-mobile-x { display: block; }
}

.spotlight-results {
    margin-top: 10px;
    background: rgba(30, 30, 35, 0.95);
    backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px;
    max-height: 400px; overflow-y: auto;
    display: none; /* Hidden until results exist */
    flex-direction: column; gap: 4px;
}

.spotlight-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 15px; border-radius: 8px; cursor: pointer;
    transition: all 0.1s;
    border-left: 2px solid transparent;
}

.spotlight-item:hover, .spotlight-item.selected {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--accent);
}

.sl-title { font-size: 14px; font-weight: 600; color: white; }
.sl-meta { font-size: 11px; color: #8e8e93; text-transform: uppercase; margin-top: 2px; }
.sl-date { font-size: 12px; color: #ccc; font-variant-numeric: tabular-nums; text-align: right; }

/* --- DESKTOP DOCK STYLES (iPad & Desktop) --- */
        #desktopDock {
            display: none; /* Hidden on Mobile by default */
        }

        /* CHANGED: Trigger on Tablets (700px+) instead of just Desktop (1024px+) */
        @media (min-width: 700px) {
            
            /* 1. HIDE MOBILE DOCK (Prevent Double Dock on iPad) */
            .mobile-view-switcher { display: none !important; }

            /* 2. SHOW & STYLE DESKTOP DOCK */
            #desktopDock {
                display: flex;
                position: fixed; 
                bottom: 30px; 
                left: 50%; 
                transform: translateX(-50%);
                z-index: 100;
                
                background: rgba(20, 20, 22, 0.75);
                backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
                border: 1px solid rgba(255, 255, 255, 0.1);
                border-radius: 100px;
                padding: 6px 12px;
                gap: 12px;
                box-shadow: 0 20px 50px rgba(0,0,0,0.6);
                align-items: center;
                
                cursor: grab;
                transition: transform 0.2s ease, box-shadow 0.2s ease;
                user-select: none;
                
                /* Ensure it fits on smaller tablet screens */
                max-width: 90vw; 
                overflow-x: auto;
            }
            
            #desktopDock:active {
                cursor: grabbing;
            }
            
            #desktopDock:not(.custom-pos):hover { 
                transform: translateX(-50%) translateY(-2px); 
                border-color: rgba(255,255,255,0.2); 
            }

            #desktopDock.custom-pos {
                transform: none !important; 
            }
            #desktopDock.custom-pos:hover { 
                transform: translateY(-2px) !important; 
                border-color: rgba(255,255,255,0.2);
            }

            .dock-group { display: flex; gap: 4px; align-items: center; }
            
            .dock-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.1); margin: 0 4px; }

            .dock-btn {
                background: transparent; border: none; color: #8e8e93;
                cursor: pointer; border-radius: 8px;
                transition: all 0.2s;
                display: flex; align-items: center; justify-content: center;
            }
            
            .icon-btn { width: 32px; height: 32px; font-size: 14px; border-radius: 50%; }
            .icon-btn:hover { background: rgba(255,255,255,0.1); color: white; }
            .icon-btn:active { transform: scale(0.9); }

            .text-btn {
                padding: 6px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase;
                border-radius: 20px; letter-spacing: 0.5px;
            }
            .text-btn:hover { color: white; }
            
            .text-btn.active {
                background: rgba(255, 255, 255, 0.15);
                color: var(--text-primary);
                box-shadow: 0 4px 15px rgba(0,0,0,0.2);
            }
        }

/* --- KEYBOARD NAVIGATION VISUALS --- */

/* The Button Glow */
#desktopDock button.dock-focused {
    box-shadow: 0 0 20px var(--accent), inset 0 0 10px rgba(255,255,255,0.2);
    border-color: white;
    transform: translateY(-4px) scale(1.05); /* Lift slightly higher than hover */
    z-index: 10;
}

/* The Helper Text (Floating Pill) */
#dockKeyTooltip {
    position: fixed;
    bottom: 80px; /* Default starting position */
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 6px 12px;
    
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 900;
    
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.19, 1, 0.22, 1), left 0.2s ease;
}

#dockKeyTooltip.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* LASSO SELECTION BOX */
#lassoBox {
    position: fixed;
    background: rgba(10, 132, 255, 0.15); /* Accent Blue, low opacity */
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(10, 132, 255, 0.2);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: none;
    pointer-events: none; /* Let mouse pass through to detect events */
    border-radius: 4px;
}

/* Candidate Highlights (While dragging box) */
.fc-event.lasso-candidate {
    filter: brightness(1.3) !important;
    transform: scale(1.02) !important;
    z-index: 100 !important;
}

/* --- APP LOCK (During Intel Sync) --- */
body.app-locked {
    cursor: wait !important;
}
body.app-locked * {
    pointer-events: none !important; /* Block ALL clicks */
}

/* --- AUTH ERROR STYLES --- */
        .auth-error-banner {
            background: rgba(255, 69, 58, 0.2);
            border: 1px solid rgba(255, 69, 58, 0.4);
            color: #ffb4b0;
            padding: 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 20px;
            display: none; /* Hidden by default */
            animation: fadeIn 0.3s ease-out;
            backdrop-filter: blur(10px);
            box-shadow: 0 4px 15px rgba(255, 69, 58, 0.1);
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        
        @keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
        
        /* Shake Animation for Wrong Password */
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }
        .shake-anim { animation: shake 0.3s ease-in-out; }

/* --- GLASS PIN PAD --- */
        .pin-display {
            margin-bottom: 20px; display: flex; justify-content: center; gap: 15px;
            height: 20px; align-items: center;
        }
        .pin-dot {
            width: 12px; height: 12px; border-radius: 50%;
            background: rgba(255,255,255,0.1);
            border: 1px solid rgba(255,255,255,0.1);
            transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .pin-dot.filled {
            background: var(--accent);
            box-shadow: 0 0 15px var(--accent);
            transform: scale(1.3); border-color: var(--accent);
        }

        .pin-grid {
            display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;
            width: 220px; margin: 0 auto 25px auto;
        }
        .pin-key {
            width: 60px; height: 60px; border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 20px; font-weight: 500; color: white; cursor: pointer;
            
            /* Glass Button Style */
            background: radial-gradient(140% 140% at 0% 0%, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            backdrop-filter: blur(5px);
            transition: all 0.1s;
            user-select: none;
        }
        .pin-key:active { transform: scale(0.9); background: rgba(255,255,255,0.2); }
        .pin-key.del { color: var(--danger); font-size: 18px; background: rgba(255, 69, 58, 0.1); }

/* --- VISION SLIDERS (CLEAR JELLY PILL) --- */
        .form-group input[type=range] {
            width: 100%; -webkit-appearance: none; background: transparent; margin: 20px 0; height: 40px;
        }
        
        /* The Track */
        .form-group input[type=range]::-webkit-slider-runnable-track {
            width: 100%; height: 28px;
            background: rgba(0, 0, 0, 0.3); /* Slightly darker track for contrast */
            border-radius: 20px;
            border: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(5px);
        }

        /* The Thumb: Crystal Clear Liquid Droplet */
        .form-group input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 54px; height: 32px; 
            border-radius: 16px;
            margin-top: -3px; 
            
            cursor: pointer;
            
            /* Crisper border to define the liquid edge */
            border: 1px solid rgba(255, 255, 255, 0.6);
            
            /* TRANSPARENT GRADIENT: Only white highlights, mostly clear body */
            background: radial-gradient(ellipse at 30% 20%, 
                rgba(255, 255, 255, 0.95) 0%,   /* Bright Glint (Wet look) */
                rgba(255, 255, 255, 0.2) 20%,   /* Faint milky glass */
                rgba(255, 255, 255, 0.05) 50%,  /* Mostly transparent */
                rgba(255, 255, 255, 0) 100%
            );
            
            /* Shadows for volume without greyness */
            box-shadow: 
                inset 0 0 8px rgba(255, 255, 255, 0.3), /* Internal refraction */
                0 4px 12px rgba(0, 0, 0, 0.4);          /* Drop Shadow */
            
            /* Low blur to keep it looking 'clear' not 'frosted' */
            backdrop-filter: blur(2px);
            transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .form-group input[type=range]:active::-webkit-slider-thumb { 
            transform: scale(1.1); 
            background: radial-gradient(ellipse at 30% 20%, 
                rgba(255, 255, 255, 1) 0%, 
                rgba(255, 255, 255, 0.3) 25%, 
                rgba(255, 255, 255, 0.1) 100%
            );
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.5), 0 8px 20px rgba(0,0,0,0.5);
        }

/* --- SPECIAL REMINDER MODAL --- */
        .reminder-modal-header { display: flex; align-items: center; gap: 15px; margin-bottom: 25px; }
        
        .reminder-check-large {
            width: 28px; height: 28px; border-radius: 10px; 
            border: 2px solid rgba(255,255,255,0.3);
            cursor: pointer; display: flex; align-items: center; justify-content: center;
            transition: 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
            background: rgba(0,0,0,0.2);
        }
        .reminder-check-large:hover { border-color: white; }
        .reminder-check-large.checked { 
            background: var(--accent); border-color: var(--accent); 
            box-shadow: 0 0 20px rgba(10, 132, 255, 0.4); transform: scale(1.1);
        }
        .reminder-check-large.checked::after { content: '\2713'; color: white; font-weight: 900; font-size: 16px; }
        
        .reminder-title-input {
            background: transparent !important; border: none !important; border-bottom: 1px solid rgba(255,255,255,0.1) !important;
            font-size: 20px !important; font-weight: 700 !important; color: white; width: 100%; padding: 5px 0 !important;
            border-radius: 0 !important; box-shadow: none !important;
        }
        .reminder-title-input:focus { border-bottom-color: var(--accent) !important; }

        /* --- CUSTOM GLASS TIME PICKER --- */
        .time-picker-trigger {
            background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
            border-radius: 12px; padding: 12px; color: white; cursor: pointer;
            text-align: center; font-family: monospace; font-size: 15px; font-weight: 600;
            transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 10px;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
        }
        .time-picker-trigger:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.3); }

        .glass-time-dropdown {
            position: absolute; background: rgba(20, 20, 22, 0.95);
            backdrop-filter: blur(40px); -webkit-backdrop-filter: blur(40px);
            border: 1px solid rgba(255,255,255,0.15); border-radius: 18px;
            padding: 15px; z-index: 10000; box-shadow: 0 20px 60px rgba(0,0,0,0.8);
            display: none; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
            width: 260px; top: 100%; left: 0; margin-top: 10px;
        }
        .glass-time-dropdown.active { display: grid; animation: fadeIn 0.2s ease-out; }
        
        .time-col { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; align-items: center; padding-right: 2px; }
        .time-col::-webkit-scrollbar { width: 3px; } 
        .time-col::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
        
        .time-cell {
            width: 45px; height: 40px; display: flex; align-items: center; justify-content: center;
            border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: #8e8e93;
            transition: 0.2s; flex-shrink: 0;
        }
        .time-cell:hover { background: rgba(255,255,255,0.1); color: white; }
        
        /* Selected State (Liquid Blue) */
        .time-cell.selected { 
            background: linear-gradient(
                135deg, 
                var(--accent), 
                color-mix(in srgb, var(--accent), black 40%)
            ); 
            
            color: var(--text-on-accent); 
            
            box-shadow: 0 4px 15px color-mix(in srgb, var(--accent), transparent 70%); 
            
            transform: scale(1.05);
        }
        
        .time-col-label { font-size: 10px; text-transform: uppercase; color: #666; text-align: center; margin-bottom: 8px; font-weight: 700; letter-spacing: 1px; }

/* --- TAGS --- */
        .tags-container { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
        .tag-btn {
            background: rgba(255,255,255,0.06); color: #8e8e93;
            padding: 6px 12px; border-radius: 20px; font-size: 11px; cursor: pointer;
            border: 1px solid transparent;
        }
        .tag-btn.active {
            background: rgba(10, 132, 255, 0.2); color: var(--accent);
            border-color: rgba(10, 132, 255, 0.4);
        }

        /* --- FULLCALENDAR OVERHAUL --- */
        #calendar { 
            height: 100%; width: 100%; 
            /* Add opacity to transition so it fades smoothly */
            transition: filter 0.2s ease-out, opacity 0.2s ease-out; 
        }
        
        .motion-blurred { 
            filter: blur(5px) !important; 
            opacity: 0.6 !important; /* Dim it */
            /* Removed transform: scale(0.99) so it doesn't shrink */
        }

/* --- LISTS WIDGET --- */
        .list-tabs { display: flex; gap: 10px; margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
        .list-tab { 
            font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); cursor: pointer; padding: 5px 10px; border-radius: 6px; transition: all 0.2s; 
        }
        .list-tab.active { background: rgba(255,255,255,0.1); color: white; }
        
        .list-container { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }
        
        .list-item { 
            display: flex; align-items: center; gap: 10px; 
            padding: 8px; border-radius: 8px; background: rgba(255,255,255,0.03); 
            transition: all 0.2s; border: 1px solid transparent;
        }
        .list-item:hover { background: rgba(255,255,255,0.06); }
        .list-item.checked { opacity: 0.5; text-decoration: line-through; }
        
        .list-input-row { display: flex; gap: 5px; margin-top: 10px; }
        .list-input { 
            flex: 1; background: rgba(0,0,0,0.3) !important; font-size: 12px !important; padding: 8px !important; 
        }
        .btn-add-mini {
            padding: 0; width: 30px; height: 32px; display: flex; align-items: center; justify-content: center;
            background: var(--accent); color: white; border-radius: 8px; border: none;
        }
        
        .del-mini { margin-left: auto; color: #ff453a; opacity: 0; cursor: pointer; font-size: 10px; transition: 0.2s; }
        .list-item:hover .del-mini { opacity: 1; }

/* Header Layout (With Living Pulse) */
.fc-header-toolbar {
    /* Base Glass */
    background-color: rgba(15, 15, 18, 0.65); 
    
    /* NEW: The Horizontal Shimmer */
    background-image: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
    background-size: 200% 100%; /* Double width for scrolling effect */
    animation: beamHorizontal 15s ease-in-out infinite;

    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 0 !important; padding: 15px 25px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    z-index: 20; 
    position: relative;
}
        .fc-toolbar-title { font-size: 22px !important; font-weight: 700; display: flex; align-items: center; gap: 15px; }
        .fc-button {
            background: rgba(255,255,255,0.08) !important; border: none !important;
            border-radius: 8px !important; font-weight: 600; font-size: 13px;
            text-transform: capitalize; padding: 8px 14px !important; box-shadow: none !important;
        }
        .fc-button-active { background: #3a3a3c !important; color: white !important; }

        /* FIXED: Remove white outer border for immersion */
        .fc-theme-standard .fc-scrollgrid { border: none !important; }

        .fc-theme-standard td, .fc-theme-standard th { border-color: var(--lines) !important; }
        .fc-timegrid-slot { height: var(--slot-height) !important; border-bottom: 1px solid var(--lines) !important; }
        .fc-timegrid-slot-label-cushion { font-size: 11px !important; color: #636366 !important; font-weight: 600 !important; text-transform: uppercase; }
        .fc-day-today { background: rgba(255, 255, 255, 0.02) !important; }
        
        /* --- TIME INDICATOR (UPDATED) --- */
        
        /* 1. The Red Line */
        .fc-timegrid-now-indicator-line { 
            border-color: var(--danger) !important; 
            border-width: 2px 0 0 0 !important; 
            z-index: 100 !important; 
            box-shadow: 0 0 8px rgba(255, 69, 58, 0.5); 
            overflow: visible !important; /* ALLOW BADGE TO SHOW */
        }
        
        /* 2. HIDE Default Axis Arrow (The one on the far left) */
        .fc-timegrid-now-indicator-arrow { display: none !important; }

        /* 3. CUSTOM BADGE (Attached to the Line) */
        .custom-now-badge {
            position: absolute;
            top: -10px; /* Pull up to center vertically on the line */
            left: 0;    /* Align to start of the line */
            background: var(--danger); 
            color: white; 
            font-size: 11px; 
            font-weight: 700; 
            padding: 2px 6px; 
            border-radius: 4px; 
            z-index: 102;
            white-space: nowrap;
            box-shadow: 0 2px 8px rgba(0,0,0,0.4);
            pointer-events: none; /* Let clicks pass through */
        }

/* --- LIQUID EVENTS (JUMP FIX) --- */
        .fc-event {
            border: none !important; box-shadow: none !important; background: transparent !important;
            border-radius: 6px !important; margin: 1px 2px !important;
            /* FIX: Removed global transition. This stops events from "sliding/jumping" 
               when swiping between days on mobile. */
            will-change: transform; 
        }
        
        /* DESKTOP ONLY: Enable smooth animations for Mouse interaction */
        @media (hover: hover) {
            /* Restore transition only where it's needed (Hovering) */
            .fc-event { 
                transition: transform 0.1s ease-out, box-shadow 0.2s, opacity 0.2s; 
            }

            .fc-event:hover { transform: scale(1.011); z-index: 50 !important; }
            
            /* Snappy click effect (Mouse only) */
            .fc-event:active { 
                transform: scale(0.98) !important; 
                filter: brightness(1.1); 
            }
        }

        /* DRAGGING (GLOBAL): Lifted Precision Mode */
        /* This applies to both Mobile & Desktop when actually moving an event */
        .fc-event-dragging, 
        .fc-event-resizing, 
        .fc-event-mirror {
            transform: scale(1) !important; /* Strict 1:1 scale for precision */
            animation: none !important;
            
            z-index: 100 !important;
            cursor: grabbing;
            
            /* Visual Lift: Deep shadow to show it's held */
            box-shadow: 0 15px 30px rgba(0,0,0,0.5) !important;
            
            /* See-through: Helps align with grid lines underneath */
            opacity: 0.85 !important;
            border: 1px solid rgba(255,255,255,0.3) !important;
        }
/* --- GHOST EVENT (Dragging to Create) --- */
        .fc-event-mirror {
            /* Replace the ugly white/grey with Dark Glass */
            background: rgba(20, 20, 22, 0.6) !important; 
            border: 1px solid rgba(255, 255, 255, 0.3) !important;
            backdrop-filter: blur(10px) !important;
            -webkit-backdrop-filter: blur(10px) !important;
            
            /* Text Styling */
            color: white !important;
            font-weight: 600 !important;
            font-size: 11px !important;
            box-shadow: 0 10px 30px rgba(0,0,0,0.5) !important;
            border-radius: 6px !important;
        }

        /* --- SELECTION HIGHLIGHT (The grid background underneath) --- */
        .fc-highlight {
            background: rgba(255, 255, 255, 0.05) !important; /* Very subtle tint */
            border: none !important;
        }

        .evt-layout {
            height: 100%; width: 100%; padding: 4px 6px; box-sizing: border-box;
            display: flex; flex-direction: column; justify-content: space-between;
            font-family: var(--font-main); position: relative; overflow: hidden;
            
            /* Liquid Glass Look */
            background: linear-gradient(135deg, var(--evt-bg-start), var(--evt-bg-end));
            border: 1px solid var(--evt-border);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 4px 10px rgba(0,0,0,0.1);
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            color: white; border-radius: 6px;
        }

        /* Color Definition */
        .evt-Work { --evt-bg-start: rgba(0, 122, 255, 0.45); --evt-bg-end: rgba(0, 122, 255, 0.15); --evt-border: rgba(0, 122, 255, 0.5); }
        .evt-Health { --evt-bg-start: rgba(48, 209, 88, 0.45); --evt-bg-end: rgba(48, 209, 88, 0.15); --evt-border: rgba(48, 209, 88, 0.5); }
        .evt-Social { --evt-bg-start: rgba(255, 159, 10, 0.45); --evt-bg-end: rgba(255, 159, 10, 0.15); --evt-border: rgba(255, 159, 10, 0.5); }
        .evt-Leisure { --evt-bg-start: rgba(191, 90, 242, 0.45); --evt-bg-end: rgba(191, 90, 242, 0.15); --evt-border: rgba(191, 90, 242, 0.5); }
        .evt-Home { --evt-bg-start: rgba(94, 92, 230, 0.45); --evt-bg-end: rgba(94, 92, 230, 0.15); --evt-border: rgba(94, 92, 230, 0.5); }
        .evt-Travel { --evt-bg-start: rgba(142, 142, 147, 0.35); --evt-bg-end: rgba(142, 142, 147, 0.1); --evt-border: rgba(142, 142, 147, 0.4); color: #e5e5ea; }
        
        .evt-completed { opacity: 0.6; filter: grayscale(70%); }
        .evt-selected .evt-layout { border: 2px solid white !important; box-shadow: 0 0 20px rgba(255,255,255,0.25) !important; transform: scale(1.02); }

        .evt-top { display: flex; justify-content: space-between; align-items: flex-start; }
        .evt-time { font-size: 10px; font-weight: 600; opacity: 0.8; letter-spacing: 0.5px; }
        .evt-title { font-size: 11px; font-weight: 700; line-height: 1.15; margin-top: 1px; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
        .evt-cost { font-size: 10px; font-weight: 700; background: rgba(0,0,0,0.4); padding: 1px 4px; border-radius: 4px; }
        
        .evt-intel { font-size: 9px; margin-top: auto; display: flex; gap: 4px; padding-bottom: 2px; flex-wrap: wrap; }
        .evt-intel span { background: rgba(0,0,0,0.25); padding: 1px 5px; border-radius: 4px; display: flex; align-items: center; gap: 3px; border: 1px solid rgba(255,255,255,0.1); }
        
        .evt-icon-row { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
        .evt-btm { font-size: 9px; opacity: 0.9; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- MOBILE MENU & MODALS --- */
        .mobile-menu-btn {
            display: none; position: absolute; top: calc(15px + env(safe-area-inset-top)); left: 15px; z-index: 50;
            background: rgba(30,30,35,0.8); border: 1px solid var(--glass-border); color: white;
            padding: 8px 12px; border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.4);
            backdrop-filter: blur(10px);
        }

/* --- MOBILE FLOATING DOCK (Clean & Mini) --- */
        .mobile-view-switcher {
            display: none; 
            
            /* CHANGE THIS LINE: absolute -> fixed */
            position: fixed; 
            
            bottom: calc(1px + env(safe-area-inset-bottom)); 
            left: 50%; transform: translateX(-50%);
            z-index: 100 !important;
            
            /* Main Container: The Only Glass Element */
            background: rgba(20, 20, 22, 0.7); 
            backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
            
            /* The Only Border */
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 100px;
            
            /* Shadow for lift */
            box-shadow: 0 15px 40px rgba(0,0,0,0.6);
            
            /* Layout */
            display: flex; 
            padding: 3px; 
            gap: 0; 
        }

        .view-btn {
            /* 1. Kill iOS/Browser Defaults */
            -webkit-appearance: none; appearance: none;
            outline: none;
            
            /* 2. Kill Visuals */
            background: transparent !important; 
            border: none !important; 
            box-shadow: none !important; 
            
            /* 3. Text Style */
            color: #8e8e93; 
            font-size: 10px; /* Mini */
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            
            /* 4. Sizing */
            padding: 8px 16px; 
            border-radius: 100px;
            margin: 0;
            transition: color 0.2s, background 0.2s;
            
            /* NEW: FIX RAPID TAPPING LAG */
            touch-action: manipulation; 
        }

        .view-btn.active {
            /* Active: Soft light fill ONLY. No shadow. */
            background: rgba(255, 255, 255, 0.15) !important; 
            color: white !important;
            box-shadow: none !important; /* Force remove emboss */
        }

        .modal {
            position: fixed; z-index: 200; left: 0; top: 0; width: 100%; height: 100%;
            background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            display: none; align-items: center; justify-content: center;
            opacity: 0; transition: opacity 0.2s;
        }
        .modal.active { display: flex; opacity: 1; }

        /* Confirm Modal - Above Admin Command Center */
        #confirmModal {
            z-index: 110000;
        }

        /* DESKTOP MODAL STYLE */
        .modal-content {
            background: rgba(25, 25, 28, 0.95); /* Slightly darker for contrast */
            backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
            padding: 30px; border-radius: 24px; 
            
            /* WIDENED: 700px -> 800px to fix cramping */
            width: 800px; 
            
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 40px 80px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
            transform: scale(0.95); transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
            display: flex; flex-direction: column;
        }

        /* NEW: Proper Layout for the Cost/Income/Travel Row */
        .event-toggle-row {
            display: grid;
            grid-template-columns: 1.5fr 1fr 1fr 1fr; /* Cost gets more space */
            gap: 15px;
            align-items: end; /* Align bottoms so inputs/checkboxes line up */
            padding-top: 15px;
            padding-bottom: 10px;
            border-top: 1px solid rgba(255,255,255,0.1);
            margin-top: auto; /* Push to bottom of column if space permits */
        }
        
        .event-toggle-item {
            display: flex; flex-direction: column; align-items: center; gap: 6px;
        }
        .event-toggle-item label {
            font-size: 9px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin: 0;
        }
        .modal.active .modal-content { transform: scale(1); }

        .form-group { margin-bottom: 15px; }
        .form-group label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary); letter-spacing: 0.5px; }

        /* FIXED: Force 2-Column Grid on Desktop */
        .landscape-grid { 
            display: grid; 
            grid-template-columns: 1fr 1fr; 
            gap: 25px; 
            width: 100%;
        }

        /* --- CONTEXT MENUS --- */
        .context-menu {
            position: absolute; z-index: 1000;
            background: rgba(28, 28, 32, 0.95); backdrop-filter: blur(25px);
            border: 1px solid var(--glass-border); border-radius: 12px;
            width: 190px; box-shadow: 0 15px 40px rgba(0,0,0,0.5);
            display: none; padding: 6px; overflow: hidden;
        }
        .context-item { padding: 8px 12px; font-size: 13px; cursor: pointer; color: #fff; display: flex; align-items: center; gap: 10px; border-radius: 6px; transition: background 0.1s; }
        
        /* FIXED: Only allow hover effects on devices with a mouse (Fixes double-tap bug) */
        @media (hover: hover) {
            .context-item:hover { background: var(--accent); }
        }
        
        .context-item:active { background: var(--accent); opacity: 0.8; } /* Immediate feedback on touch */

        .context-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 4px 0; }
        .color-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.3); transition: transform 0.2s; }
        .color-dot:hover { transform: scale(1.2); border-color: white; }
        
        .c-Work { background: #007aff; } .c-Health { background: #30d158; } 
        .c-Social { background: #ff9f0a; } .c-Leisure { background: #bf5af2; }
        .c-Home { background: #5e5ce6; } .c-Travel { background: #ac8e68; }

        /* --- NOTIFICATIONS --- */
        .toast-notification {
            position: fixed; 
            top: 50%; left: 50%; 
            /* Start centered but slightly smaller for pop effect */
            transform: translate(-50%, -50%) scale(0.9);
            
            background: rgba(25, 25, 28, 0.95); 
            backdrop-filter: blur(20px);
            border: 1px solid var(--glass-border); 
            border-radius: 24px;
            padding: 20px 30px; /* Larger padding for center stage */
            box-shadow: 0 20px 60px rgba(0,0,0,0.6);
            
            z-index: 9999; 
            
            /* Hidden State */
            opacity: 0; 
            pointer-events: none; /* Click-through when hidden */
            
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy Pop */
            
            display: flex; flex-direction: column; align-items: center; text-align: center;
        }

        .toast-notification.active { 
            opacity: 1; 
            transform: translate(-50%, -50%) scale(1); /* Full size */
            pointer-events: auto; /* Enable clicks */
        }
        
        .toast-title { font-weight: 700; color: #fff; font-size: 16px; margin-bottom: 5px; }
        .toast-message { font-size: 13px; color: #a1a1aa; line-height: 1.5; }

        /* HEADER WIDGETS */
        .header-widget-container { display: flex; align-items: center; gap: 12px; margin-left: 15px; }
        
        #header-status-box {
            display: flex; flex-direction: column; justify-content: center;
            background: rgba(44, 44, 46, 0.5); border: 1px solid var(--glass-border);
            border-radius: 8px; padding: 4px 16px; min-height: 46px; width: 330px;
            backdrop-filter: blur(10px); box-shadow: 0 4px 10px rgba(0,0,0,0.2);
        }
        .header-clock { 
            font-size: 15px; font-weight: 800; 
            color: var(--text-primary); /* CHANGED FROM #fff */
            line-height: 1.2; letter-spacing: -0.5px; 
        }
        .header-event-status { font-size: 11px; color: #8e8e93; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
        .status-accent { color: var(--accent); font-weight: 600; }
        .status-active { color: var(--success); font-weight: 700; }
        
        #header-quote-box {
            background: rgba(44, 44, 46, 0.5); border: 1px solid var(--glass-border);
            border-radius: 8px; padding: 6px 16px; min-height: 46px; height: auto;
            display: flex; align-items: center; font-size: 11px; color: var(--text-secondary); font-style: italic;
            max-width: 500px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
            backdrop-filter: blur(10px); line-height: 1.4;
        }

/* --- DESKTOP HEADER (Executive Dashboard Final) --- */
        @media (min-width: 1024px) {
            
            /* 1. Container: Fixed height to prevent layout collapse */
    .fc-header-toolbar {
        position: relative !important;
        display: flex !important;
        align-items: center !important;
        height: 80px !important;
        margin-bottom: 0 !important;
        padding: 0 40px !important;
        
        /* UPDATED: Desktop Beam Logic */
        background-color: transparent !important; /* Keep base clear */
        border: none !important;
        
        /* Stronger Beam (5% opacity vs 2%) */
        background-image: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.02) 50%, transparent 100%) !important;
        background-size: 200% 100%;
        animation: beamHorizontal 30s ease-in-out infinite;
    }

/* HIDE MOBILE DOCK ON DESKTOP */
            .mobile-view-switcher {
                display: none !important;
            }

            /* 2. Hide Default Buttons (They live in bottom dock now) */
            .fc-toolbar-chunk .fc-button-group,
            .fc-toolbar-chunk .fc-button { display: none !important; }

            /* 3. Absolute Positioning for Perfect Centering */
            .fc-toolbar-chunk { position: absolute !important; top: 50%; transform: translateY(-50%); }
            
            /* Left: Clock */
            .fc-toolbar-chunk:first-child { left: 40px; }
            
            /* Center: Title */
            .fc-toolbar-chunk:nth-child(2) { 
                left: 50%; 
                transform: translate(-50%, -50%); 
                width: auto; justify-content: center; 
            }
            
            /* Right: Quote */
            .fc-toolbar-chunk:last-child { right: 40px; justify-content: flex-end; }

            /* 4. The Clock Widget (Text Only Mode) */
            #header-status-box {
                background: transparent !important;
                border: none !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                padding: 0 !important;
                align-items: flex-start !important;
            }
            .header-clock { font-size: 20px !important; line-height: 1.2 !important; }
            .header-event-status { font-size: 11px !important; opacity: 0.7; }

            /* 5. The Main Title (Glitch Fix) */
            
            /* HIDE the default FullCalendar Title (The source of the glitch) */
            .fc-toolbar-title {
                display: none !important;
            }

            /* STYLE our Custom Box instead */
            #customTitleBox {
                font-size: 24px !important;
                font-weight: 700 !important;
                letter-spacing: -0.5px;
                font-style: italic !important;
                display: flex; gap: 8px;
                justify-content: center;
                align-items: center;
            }
            
            /* Text Colors */
            .title-month { color: #8e8e93; font-weight: 800; text-transform: uppercase; }
            .title-date { 
                color: var(--text-primary); /* CHANGED FROM white */
                font-weight: 800; 
            }

            /* 6. The Quote Box (Right Column) */
            #header-quote-box {
                max-width: none !important;
                font-size: 12px;
                color: #8e8e93;
                background: transparent;
                border: none;
                padding: 0;
                min-height: 0;
                font-style: italic;
                text-align: right;
            }
        }

/* --- AMBIENT PULSE ANIMATIONS --- */
@keyframes beamVertical {
    0% { background-position: 0% 0%; }
    50% { background-position: 0% 100%; } /* Move Light Down */
    100% { background-position: 0% 0%; }  /* Move Light Up */
}

@keyframes beamHorizontal {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; } /* Move Light Right */
    100% { background-position: 0% 50%; }  /* Move Light Left */
}

@keyframes mobileBeamSweep {
    0%   { transform: translateX(-30%); }
    50%  { transform: translateX(30%); }
    100% { transform: translateX(-30%); }
}

/* --- APPLE VOID YEAR VIEW (Aligned & Headless) --- */
        
        /* 1. Base Container & Variable Override */
        .fc-multiMonthYear-view { 
            background: transparent !important; 
            --fc-border-color: transparent !important; 
            --fc-page-bg-color: transparent !important;
            --fc-neutral-bg-color: transparent !important;
        }
        
        /* 2. NUCLEAR BORDER & BACKGROUND REMOVAL */
        .fc-multiMonthYear-view .fc-scrollgrid,
        .fc-multiMonthYear-view table,
        .fc-multiMonthYear-view tr,
        .fc-multiMonthYear-view th,
        .fc-multiMonthYear-view td,
        .fc-multiMonthYear-view .fc-day-other,
        .fc-multiMonthYear-view .fc-multimonth-daygrid {
            border: none !important;
            box-shadow: none !important;
            background: transparent !important;
        }

        /* 3. Force 3-Column Layout on Mobile */
        .fc-multimonth-month {
            width: 33.333% !important;
            float: left;
            padding: 0 2px 20px 2px !important;
            min-width: 0 !important;
        }
        
        /* 4. Month Titles (Red) */
        .fc-multimonth-title {
            font-size: 11px !important;
            font-weight: 800 !important;
            color: #ff453a !important;
            padding-left: 2px !important;
            margin-bottom: 2px !important;
        }

        /* 5. REMOVE DAY HEADERS (S M T W...) - The Fix */
        .fc-multiMonthYear-view thead,
        .fc-multiMonthYear-view .fc-col-header-row {
            display: none !important;
        }

        /* 6. DAY NUMBERS (The Alignment Fix) */
        /* Make EVERY day a fixed 20x20 box, centered perfectly */
        .yv-day {
            width: 20px; height: 20px; 
            margin: 0 auto; /* Center horizontally in cell */
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            font-size: 10px; font-weight: 500; color: white;
            line-height: 1;
            pointer-events: none;
        }

        /* 7. Holiday Style (Adds Faint Yellow Background) */
        .yv-holiday {
            background: rgba(255, 215, 0, 0.15); 
            color: #ffd700 !important;
            font-weight: 700;
        }

        /* 8. "Today" Style (Adds Red Background) */
        .fc-multiMonthYear-view .fc-day-today .yv-day {
            background: #ff453a !important;
            color: white !important;
            font-weight: 700;
            box-shadow: 0 2px 5px rgba(255, 69, 58, 0.4);
        }
        /* Ensure Today overrides Holiday if both apply */
        .fc-multiMonthYear-view .fc-day-today .yv-holiday {
            background: #ff453a !important;
            color: white !important;
        }
        
        .fc-multiMonthYear-view .fc-day-today { background: transparent !important; }

        /* 9. Desktop Dot Indicator */
        .yv-dot {
            width: 3px; height: 3px; border-radius: 50%;
            background: rgba(255,255,255,0.4);
            margin: 0 auto;
        }

        /* 10. Clickable Cell Area */
        .fc-multiMonthYear-view .fc-daygrid-day-frame {
            min-height: 24px !important;
            cursor: pointer;
            display: flex; flex-direction: column; justify-content: center;
        }
        
        /* 11. Clean Up (Hide Events/Links) */
        .fc-multiMonthYear-view .fc-daygrid-event-harness, 
        .fc-multiMonthYear-view .fc-event,
        .fc-multiMonthYear-view .fc-more-link {
            display: none !important;
        }

        /* --- DESKTOP SCALING --- */
        @media (min-width: 1024px) {
            .fc-multimonth-title { font-size: 20px !important; margin-bottom: 10px !important; }
            .yv-day { font-size: 13px; width: 28px; height: 28px; } /* Scale up numbers */
            .fc-multiMonthYear-view .fc-daygrid-day-frame { min-height: 45px !important; }
            .fc-multimonth-month { padding: 0 15px 30px 15px !important; }
        }

/* --- SMART ACCORDIONS --- */
        .acc-header {
            display: flex; justify-content: space-between; align-items: center;
            cursor: pointer; padding: 10px 4px;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            margin-bottom: 5px;
        }
        .acc-header label { 
            margin: 0 !important; 
            cursor: pointer;
            
            /* MATCH MODAL HEADERS EXACTLY */
            font-size: 11px; 
            font-weight: 700; 
            text-transform: uppercase; 
            color: var(--text-secondary); 
            letter-spacing: 0.5px;
            font-family: var(--font-main);
        }
        
        /* Optional: Hover state for the whole bar */
        .acc-header:hover label {
            color: white; /* Light up on hover */
        }
        .acc-icon { transition: transform 0.3s ease; font-size: 10px; color: var(--text-secondary); }
        
        /* State: Open */
        .acc-header.active .acc-icon { transform: rotate(180deg); color: white; }
        .acc-header.active { border-bottom-color: transparent; }

        .acc-content {
            max-height: 0; 
            overflow: hidden;
            opacity: 0;
            transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s;
        }
        
        .acc-content.open {
            max-height: 400px; /* Height limit for animation to work */
            opacity: 1;
            margin-bottom: 15px;
        }

/* --- MOBILE MEDIA QUERIES --- */
        @media (max-width: 1024px) {
            .sidebar {
                position: absolute; top: 0; bottom: 0; left: 0; 
                height: 100dvh; 
                transform: translateX(-100%);
                box-shadow: 10px 0 30px rgba(0,0,0,0.5);
                box-sizing: border-box;
                padding-top: calc(15px + env(safe-area-inset-top)) !important;
                padding-bottom: calc(40px + env(safe-area-inset-bottom)) !important;
            }
            .sidebar.active { transform: translateX(0); }
            
            /* Sidebar Brand Alignment for Mobile */
            .sidebar .brand {
                margin-left: 55px; 
                margin-bottom: 30px;
                font-size: 19px;
            }

            .mobile-menu-btn { display: block; }
            .mobile-view-switcher { display: flex; }
            
            /* Compact Header for Mobile (Vision Upgrade) */
            .fc-header-toolbar {
                display: grid !important; grid-template-columns: 1fr; gap: 8px !important;
                padding: 10px 10px 5px 10px !important; 
                padding-top: calc(15px + env(safe-area-inset-top)) !important;
                height: auto !important;
                
                /* Glass Panel */
                background: rgba(12, 14, 20, 0.75) !important;
                backdrop-filter: blur(30px) saturate(140%);
                -webkit-backdrop-filter: blur(30px) saturate(140%);
                border: none !important;
                border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
                position: relative;
                overflow: visible;
            }

            /* Accent Beam (GPU-accelerated via transform, follows theme) */
            .fc-header-toolbar::before {
                content: '';
                position: absolute;
                top: env(safe-area-inset-top, 0px); left: 0;
                width: 200%;
                height: 2px;
                background: linear-gradient(90deg,
                    transparent 0%,
                    color-mix(in srgb, var(--accent), transparent 100%) 20%,
                    color-mix(in srgb, var(--accent), transparent 40%) 50%,
                    color-mix(in srgb, var(--accent), transparent 100%) 80%,
                    transparent 100%
                );
                will-change: transform;
                animation: mobileBeamSweep 20s ease-in-out infinite;
                pointer-events: none;
                z-index: 1;
            }

            /* Diffused Glow Behind Beam (follows theme accent) */
            .fc-header-toolbar::after {
                content: '';
                position: absolute;
                top: calc(env(safe-area-inset-top, 0px) - 20px); left: 0; right: 0;
                height: 60px;
                background: radial-gradient(
                    ellipse 60% 100% at 50% 0%,
                    color-mix(in srgb, var(--accent), transparent 88%),
                    transparent 70%
                );
                pointer-events: none;
                z-index: 0;
            }
            
            /* 1. DATE TITLE (TOP) */
            .fc-toolbar-chunk:nth-child(2) { 
                grid-row: 1; 
                display: flex; justify-content: center; width: 100%; 
                padding: 0; margin-bottom: 5px;
            }
            
            /* HIDE DEFAULT TITLE (Prevents Glitch/Jump) */
            .fc-toolbar-title { 
                display: none !important; 
            }

            /* STYLE OUR CUSTOM TITLE BOX (Mobile Version) */
            #customTitleBox {
                display: block !important;
                font-size: 1.5rem !important; 
                font-weight: 800;
                font-style: italic !important;
                text-align: center; margin: 0 !important;
                color: white;
            }

            /* 2. STATUS BOX (MIDDLE) - Transparent Vision Style */
            .header-widget-container { 
                grid-row: 2; 
                width: 100%; justify-content: center; 
                margin-left: 0 !important; 
            }

            #header-status-box { 
                width: 100%; 
                max-width: none;
                margin: 0 auto; 
                min-height: 0; 
                padding: 2px 0; 
                
                /* Remove Glass/Border */
                background: transparent !important;
                border: none !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                
                display: flex; flex-direction: column; align-items: center; /* Force Center */
            }
            
            .header-clock { font-size: 16px !important; margin-bottom: 2px; } 
            .header-event-status { font-size: 11px !important; text-align: center; }
            #header-quote-box { display: none !important; }

            /* 3. BUTTONS (BOTTOM) */
            .fc-toolbar-chunk:nth-child(1) { 
                grid-row: 3; 
                display: flex; justify-content: center; width: 100%; 
                gap: 10px; 
                margin-top: 5px;
            }
            
            .fc-toolbar-chunk:nth-child(3) { display: none; }
            
            /* Liquid Glass Buttons */
            .fc-button { 
                padding: 6px 12px !important; 
                font-size: 11px !important;
                background: rgba(255, 255, 255, 0.06) !important;
                border: 1px solid rgba(255, 255, 255, 0.12) !important;
                border-radius: 10px !important;
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                box-shadow: 
                    0 2px 8px rgba(0, 0, 0, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
                outline: none !important;
                transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            }
            .fc-button:active {
                transform: scale(0.97);
                background: rgba(255, 255, 255, 0.12) !important;
            }

            /* Now + Undo: Liquid Glass Joined Pill */
            .fc-nowBtn-button {
                border-radius: 12px 0 0 12px !important;
                margin-right: -1px !important;
                border: 1px solid rgba(255, 255, 255, 0.1) !important;
                border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
            }
            .fc-undoBtn-button {
                border-radius: 0 12px 12px 0 !important;
                margin-left: -1px !important;
                border: 1px solid rgba(255, 255, 255, 0.1) !important;
                border-left: none !important;
            }
            .fc-nowBtn-button,
            .fc-undoBtn-button {
                background: rgba(255, 255, 255, 0.04) !important;
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                box-shadow: 
                    0 2px 8px rgba(0, 0, 0, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
            }
            .fc-nowBtn-button:active,
            .fc-undoBtn-button:active {
                background: rgba(255, 255, 255, 0.1) !important;
                transform: scale(0.97);
            }

            /* Fix Modal Sizing on Mobile */
            .landscape-grid { grid-template-columns: 1fr; gap: 0; }
            .modal-content { 
                width: 90% !important; max-width: none; 
                max-height: 85vh; 
                overflow-y: auto; 
                overflow-x: hidden;
                overscroll-behavior: contain;
                padding: 15px; 
                display: flex; flex-direction: column;
            }
            .form-group { margin-bottom: 12px; }
            .form-group input, .form-group select { padding: 8px; font-size: 12px; } 

            /* Super compact date inputs to prevent overlap */
            input[type="datetime-local"] {
                font-size: 11px !important;
                padding: 6px 2px !important; 
                letter-spacing: -0.5px;
                width: 100%;
            }
            
            .fc-dayGridMonth-button, .fc-rollingWeek-button, .fc-timeGridWeek-button, .fc-today-button { display: none !important; }

            /* --- FIX: Mobile Year/Month View Polish (v5) --- */

            /* 1. Year View: THE "LIFT" FIX */
            .fc-multiMonthYear-view .fc-multimonth-month:last-child {
                margin-bottom: 135px !important; 
            }

            /* 2. Year View: Header Spacing */
            .fc-multimonth-header {
                position: relative !important;
                top: auto !important;
                background: transparent !important;
                box-shadow: none !important;
                padding-top: 40px !important;
            }

            /* 3. Month View (Perfect State) */
            .fc-dayGridMonth-view .fc-scroller {
                height: auto !important; 
                overflow-y: auto !important;
                overflow-x: hidden !important;
            }

            .fc-dayGridMonth-view .fc-scrollgrid-sync-table {
                padding-bottom: 200px !important;
            }

            .fc-dayGridMonth-view .fc-scrollgrid-section-header,
            .fc-dayGridMonth-view .fc-scrollgrid-section-header > * {
                position: relative !important;
                top: auto !important;
                background: transparent !important;
                border: none !important;
                box-shadow: none !important;
            }
            
            .fc-dayGridMonth-view .fc-scrollgrid {
                border: none !important;
            }

            /* 4. BUTTON GROUP STYLING (Liquid Glass Joined Pills) */
            .fc-button-group {
                display: inline-flex !important;
                border-radius: 12px !important;
                overflow: hidden !important;
                margin: 0 !important;
                background: rgba(255, 255, 255, 0.04) !important;
                border: 1px solid rgba(255, 255, 255, 0.1) !important;
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                box-shadow: 
                    0 2px 8px rgba(0, 0, 0, 0.3),
                    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
            }
            
            /* Inner buttons: transparent, no individual borders, subtle separators */
            .fc-button-group > .fc-button {
                border-radius: 0 !important;
                margin: 0 !important;
                background: transparent !important;
                border: none !important;
                border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
            }
            
            /* Remove separator from the last one */
            .fc-button-group > .fc-button:last-child {
                border-right: none !important;
            }
            
            /* Active/Press State for Group buttons */
            .fc-button-group > .fc-button:active {
                background: rgba(255, 255, 255, 0.1) !important;
            }
        }
        
/* --- MOBILE LANDSCAPE: COMPACT HEADER --- */
@media (max-width: 1000px) and (max-height: 500px) and (orientation: landscape) {
    .fc-header-toolbar {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 5px 10px !important;
        gap: 10px !important;
    }

    /* Single row layout - title left, clock center, buttons right */
    .fc-toolbar-chunk:nth-child(2) {
        order: 1;
        margin-bottom: 0 !important;
    }

    #customTitleBox {
        font-size: 1rem !important;
    }

    .header-widget-container {
        order: 2;
        margin-left: auto !important;
        flex-direction: row !important;
        gap: 8px !important;
    }

    #header-status-box {
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .header-clock {
        font-size: 14px !important;
        margin-bottom: 0 !important;
    }

    .header-event-status {
        font-size: 10px !important;
    }

    .fc-toolbar-chunk:nth-child(1) {
        display: none !important;
    }

    .fc-button {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }
}

        /* Auto-Fill List */
        .autofill-item {
            padding: 12px; border-bottom: 1px solid var(--lines); display: flex; justify-content: space-between; align-items: center;
        }
        .autofill-item:last-child { border-bottom: none; }

/* === ADVANCED AUTOFILL PANEL === */
.advanced-toggle {
    width: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    padding: 12px 16px;
    color: #a78bfa;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s var(--ease-smooth);
}

.advanced-toggle:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15));
    border-color: rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.advanced-toggle .toggle-arrow {
    margin-left: auto;
    transition: transform 0.3s var(--ease-spring);
}

.advanced-toggle.expanded .toggle-arrow {
    transform: rotate(180deg);
}

.advanced-panel {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s var(--ease-smooth), 
                opacity 0.3s var(--ease-smooth),
                padding 0.3s var(--ease-smooth);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 14px;
    margin-top: 12px;
    border: 1px solid transparent;
}

.advanced-panel.expanded {
    max-height: 280px;
    opacity: 1;
    padding: 18px;
    border-color: rgba(139, 92, 246, 0.15);
}

.goal-input-wrapper {
    margin-bottom: 0;
}

.goal-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a78bfa;
    margin-bottom: 10px;
}

.goal-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 14px;
    color: white;
    font-size: 13px;
    font-family: var(--font-main);
    resize: none;
    height: 70px;
    transition: all 0.2s var(--ease-smooth);
    box-sizing: border-box;
}

.goal-textarea:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: rgba(255, 255, 255, 0.06);
}

.goal-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.goal-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}

.goal-char-count {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.intensity-wrapper {
    margin-top: 18px;
}

.intensity-track-container {
    position: relative;
    padding-bottom: 24px;
}

.intensity-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, 
        #34d399 0%, 
        #fbbf24 50%, 
        #ef4444 100%
    );
    outline: none;
    cursor: pointer;
}

.intensity-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 
                inset 0 1px 0 rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring);
}

.intensity-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.intensity-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    border: none;
}

.intensity-markers {
    display: flex;
    justify-content: space-between;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

.intensity-hint {
    text-align: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    font-style: italic;
    min-height: 16px;
}

/* === MOBILE GOAL SETTINGS SHEET === */
.goal-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px 24px 0 0;
    padding: 20px 20px 40px 20px;
    z-index: 10000;
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
}

.goal-sheet.active {
    transform: translateY(0);
}

.goal-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #a78bfa;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.goal-sheet-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #8e8e93;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.goal-sheet-body {
    margin-bottom: 20px;
}

.goal-sheet-apply {
    width: 100%;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8), rgba(99, 102, 241, 0.8));
    border: none;
    border-radius: 14px;
    padding: 16px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Visual indicator when goal is set */
.advanced-toggle {
    position: relative;
}

.advanced-toggle.has-goal {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(99, 102, 241, 0.25));
    border-color: rgba(139, 92, 246, 0.5);
}

.advanced-toggle.has-goal::after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #a78bfa;
    border-radius: 50%;
}

/* Hide accordion panel on mobile, show button that opens sheet */
@media (max-width: 1024px) {
    .advanced-panel {
        display: none !important;
    }
}

/* Hide goal sheet on desktop */
@media (min-width: 1025px) {
    .goal-sheet {
        display: none !important;
    }
}

/* --- MOBILE BOTTOM FADE: Removed (calendar now extends to screen edge) --- */

/* --- HOLIDAYS (HIDDEN IN GRID) --- */
        .evt-holiday {
            /* Completely hide the event in the grid so only the Header Badge shows */
            display: none !important;
            background: transparent !important;
            border: none !important;
            pointer-events: none;
        }

/* --- FLOATING HOURGLASS WIDGET --- */
#hourglassModal {
    /* Floating Window State (Desktop) */
    position: fixed; 
    top: 100px; left: 100px; /* Default spawn point */
    width: 320px; /* Compact width */
    z-index: 1000; /* Above calendar events, below popups */
    
    background: rgba(10, 10, 12, 0.95); /* Deep Black */
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    
    display: none; /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0; transform: scale(0.95);
}

#hourglassModal.active {
    display: flex; opacity: 1; transform: scale(1);
}

/* Internal Content Wrapper */
#hourglassModal .modal-content {
    background: transparent; box-shadow: none; border: none;
    width: 100%; padding: 0 25px 25px 25px;
    display: flex; flex-direction: column; align-items: center;
}

/* Drag Handle Header */
.hg-header {
    width: 100%; height: 40px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 15px; margin-bottom: 10px;
    cursor: grab; /* Indicates draggable */
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.hg-header:active { cursor: grabbing; }

.hg-title {
    font-size: 10px; font-weight: 800; color: #666; 
    text-transform: uppercase; letter-spacing: 2px;
}

.hg-close-btn {
    cursor: pointer; color: #666; font-size: 14px;
    transition: color 0.2s;
}
.hg-close-btn:hover { color: white; }

/* Canvas Adjustment */
#hgCanvas {
    width: 160px; height: 240px; /* Slightly tighter */
    margin: 10px 0;
    filter: drop-shadow(0 0 25px rgba(10, 132, 255, 0.2));
}

/* Controls */
.hg-controls { display: flex; gap: 8px; width: 100%; justify-content: center; }
.hg-input { 
    width: 50px !important; font-size: 16px !important; padding: 8px !important; 
    text-align: center; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: white; border-radius: 8px;
}
.hg-label { font-size: 8px; color: #666; font-weight: 700; margin-top: 4px; text-transform: uppercase; text-align: center; }

.hg-accordion {
    width: 100%;
    margin-top: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.hg-accordion:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.hg-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.2s ease;
}

.hg-accordion-header:hover {
    color: rgba(255, 255, 255, 0.95);
}

.hg-accordion-header:active {
    opacity: 0.6;
}

.hg-accordion-icon {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.hg-accordion-header:hover .hg-accordion-icon {
    color: rgba(255, 255, 255, 0.7);
}

.hg-accordion-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 16px;
}

.hg-accordion-panel.hg-accordion-open {
    padding-bottom: 16px;
}

.hg-label-accent {
    font-size: 9px;
    color: var(--accent);
    opacity: 0.6;
    font-weight: 400;
    margin-left: 4px;
}

.hg-glass-btn {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    width: 100%;
    text-align: center;
}

.hg-glass-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 1);
    transform: none;
}

.hg-glass-btn:active {
    transform: translateY(0);
    opacity: 0.7;
}

.hg-glass-input {
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: white;
    transition: all 0.2s ease;
    width: 100%;
}

.hg-glass-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.hg-glass-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-weight: 400;
}

.hg-slider-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hg-slider-row label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    min-width: 60px;
}

.hg-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.hg-toggle-row label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    min-width: 60px;
}

.hg-toggle {
    position: relative;
    appearance: none;
    width: 40px;
    height: 22px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.3s ease;
    outline: none;
}

.hg-toggle:checked {
    background: var(--accent);
}

.hg-toggle::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hg-toggle:checked::before {
    transform: translateX(18px);
}

[data-base="nova"] .hg-toggle {
    background: rgba(0, 0, 0, 0.1);
}

[data-base="nova"] .hg-toggle::before {
    background: #333;
}

.hg-slider-row input[type="range"] {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    transition: background 0.2s ease;
}

.hg-slider-row input[type="range"]::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.hg-slider-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.hg-slider-row input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(0.95);
}

.hg-preset-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.hg-preset-create,
.hg-stats-grid + .hg-glass-btn {
    margin-top: 8px;
}

#hgExportStats {
    margin-bottom: 16px;
}

#hgPreviewAudio {
    margin-bottom: 16px;
}

.hg-preset-create {
    margin-bottom: 16px;
}

.hg-preset-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none !important;
}

.hg-preset-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: rgba(255, 255, 255, 0.9);
    transform: none;
}

.hg-preset-btn:active {
    opacity: 0.7;
    transform: none;
}

.hg-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.hg-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.hg-stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.hg-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 4px;
}

.hg-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: white;
    font-variant-numeric: tabular-nums;
}

[data-base="nova"] .hg-accordion {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-base="nova"] .hg-accordion-header {
    color: rgba(0, 0, 0, 0.6);
}

[data-base="nova"] .hg-accordion-header:hover {
    color: rgba(0, 0, 0, 0.9);
}

[data-base="nova"] .hg-glass-btn {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.7);
}

[data-base="nova"] .hg-glass-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.95);
}

[data-base="nova"] .hg-glass-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #333;
}

[data-base="nova"] .hg-stat-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-base="nova"] .hg-stat-label {
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-base="nova"] .hg-stat-value {
    color: #333 !important;
}

[data-base="nova"] .hg-preset-btn {
    color: rgba(0, 0, 0, 0.5) !important;
}

[data-base="nova"] .hg-preset-btn:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    color: rgba(0, 0, 0, 0.85) !important;
}

#hourglassModal button:focus-visible,
#hourglassModal input:focus-visible,
.hg-accordion-header:focus-visible,
.hg-preset-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

#hgDisplay.hg-completion-state {
    color: var(--accent) !important;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    animation:
        etherealFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards,
        etherealPulse 3s ease-in-out 1.2s infinite,
        shimmerEffect 4s linear 1.2s infinite;
    text-shadow:
        0 0 30px var(--accent),
        0 0 60px var(--accent),
        0 0 90px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 0 20px var(--accent));
}

#hgDisplay.hg-completion-state::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: radial-gradient(
        circle at 50% 50%,
        var(--accent) 0%,
        transparent 70%
    );
    opacity: 0.1;
    animation: floatAura 4s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

[data-base="nova"] #hgDisplay.hg-completion-state {
    color: var(--accent) !important;
    text-shadow:
        0 0 20px var(--accent),
        0 0 40px rgba(0, 0, 0, 0.1);
}

[data-base="nova"] #hgDisplay.hg-completion-state::before {
    opacity: 0.05;
}

@keyframes etherealFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
        filter: blur(10px) drop-shadow(0 0 0 var(--accent));
    }
    50% {
        opacity: 0.7;
        filter: blur(2px) drop-shadow(0 0 15px var(--accent));
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0) drop-shadow(0 0 20px var(--accent));
    }
}

@keyframes etherealPulse {
    0%, 100% {
        text-shadow:
            0 0 30px var(--accent),
            0 0 60px var(--accent),
            0 0 90px rgba(255, 255, 255, 0.3);
        opacity: 0.95;
    }
    50% {
        text-shadow:
            0 0 40px var(--accent),
            0 0 80px var(--accent),
            0 0 120px rgba(255, 255, 255, 0.4);
        opacity: 1;
    }
}

@keyframes shimmerEffect {
    0% {
        filter:
            drop-shadow(0 0 20px var(--accent))
            brightness(1);
    }
    25% {
        filter:
            drop-shadow(0 0 25px var(--accent))
            brightness(1.1);
    }
    50% {
        filter:
            drop-shadow(0 0 30px var(--accent))
            brightness(1.15);
    }
    75% {
        filter:
            drop-shadow(0 0 25px var(--accent))
            brightness(1.1);
    }
    100% {
        filter:
            drop-shadow(0 0 20px var(--accent))
            brightness(1);
    }
}

@keyframes floatAura {
    0%, 100% {
        transform: scale(1);
        opacity: 0.08;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.15;
    }
}

@media (prefers-reduced-motion: reduce) {
    #hgDisplay.hg-completion-state {
        animation: none;
        transition: opacity 0.3s ease;
    }
}

/* MOBILE OVERRIDE: Enforce Center Alignment & Symmetry */
@media (max-width: 1024px) {
    #hourglassModal {
        /* Position: Dead Center */
        top: 50% !important; 
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        
        /* Visuals */
        transform: translate(-50%, -50%) scale(0.95);
        margin: 0 !important; 
        width: 90%; 
        max-width: 320px;
    }
    
    #hourglassModal.active {
        transform: translate(-50%, -50%) scale(1);
    }
    
    /* FIX: Force symmetric padding on the internal wrapper */
    #hourglassModal .modal-content {
        padding: 0 20px 25px 20px !important; /* Equal Left/Right Padding */
        width: 100% !important;
        box-sizing: border-box !important;
        align-items: center !important;
    }

    /* FIX: Ensure canvas doesn't push alignment */
    #hgCanvas {
        display: block;
        margin: 10px auto !important; /* Force center */
    }
    
    /* Disable dragging on mobile */
    .hg-header { cursor: default; }
}


/* --- SIDEBAR LAYOUT & ACCORDION --- */
.sidebar-spacer {
    flex-grow: 1; 
    min-height: 20px; 
}

.sidebar-acc-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px; cursor: pointer; 
    transition: all 0.2s; user-select: none;
    border-radius: 8px;
    margin-bottom: 0; /* Remove gap below header */
    
    /* FIX FOR MOBILE TAPPING: */
    touch-action: manipulation; 
    -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}

.sidebar-acc-header:hover { 
    background: rgba(255,255,255,0.03); 
}

/* POINTER EVENTS NONE: Ensures the click always hits the parent div */
.sidebar-acc-title {
    font-size: 10px; font-weight: 800; color: #666; 
    text-transform: uppercase; letter-spacing: 1px;
    transition: color 0.2s;
    pointer-events: none; 
}

.sidebar-acc-icon {
    font-size: 10px; color: #666; 
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
    pointer-events: none;
}

/* Active State */
.sidebar-acc-header.active .sidebar-acc-title { color: white; }
.sidebar-acc-header.active .sidebar-acc-icon { color: white; transform: rotate(90deg); }

/* --- BULLETPROOF GRID ACCORDION --- */
.sidebar-acc-body {
    display: grid;
    grid-template-rows: 0fr; 
    transition: grid-template-rows 0.3s ease-out;
    
    /* FIX: Make transparent to remove the "weird shadow" box */
    background: transparent; 
    
    border-radius: 8px;
    margin-top: 0; /* Remove gap */
}

.sidebar-acc-body.open {
    grid-template-rows: 1fr;
    padding-bottom: 5px;
}

/* The Inner Wrapper is crucial for Grid animation */
.sidebar-acc-inner {
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- TOOL BUTTON (Restored Minimalist Look - removes ghost button for this menu) --- */
.tool-btn {
    /* 1. Structural Reset */
    appearance: none; -webkit-appearance: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100%;
    
    /* 2. Minimalist Aesthetics (Matches original ghost style) */
    text-align: left;
    padding: 8px 0 8px 12px !important; /* Indented, tight padding */
    color: #8e8e93 !important; /* Darker gray text */
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    
    /* 3. Layout */
    display: flex; 
    align-items: center; 
    gap: 10px;
    
    /* 4. Mobile Paint Fixes (Keep these!) */
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateZ(0);
    transition: color 0.2s, transform 0.2s;
}

/* Remove the liquid shine if it was inheriting it */
.tool-btn::after { display: none !important; }

/* Simple Hover/Active State */
.tool-btn:active {
    color: white !important;
    transform: translateX(4px); /* Subtle slide instead of background flash */
    background: transparent !important;
}

.tool-btn i {
    width: 16px; 
    text-align: center;
    font-size: 12px;
    color: inherit; /* Icon matches text color */
}

/* --- WEATHER WIDGET (FLOATING) --- */
#weatherModal {
    position: fixed; top: 120px; left: 450px; /* Offset from Hourglass */
    width: 340px; z-index: 1000;
    
    /* Dynamic Weather Background (Set via JS) */
    background: linear-gradient(180deg, rgba(20, 30, 40, 0.95) 0%, rgba(10, 10, 12, 0.98) 100%);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    
    display: none; flex-direction: column; overflow: hidden;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0; transform: scale(0.95);
}

#weatherModal.active { display: flex; opacity: 1; transform: scale(1); }

/* Internal Layout */
.wx-content { padding: 0 25px 25px 25px; color: white; display: flex; flex-direction: column; }

/* Current Conditions (Big) */
.wx-current {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; margin-top: 5px;
}
.wx-temp { font-size: 48px; font-weight: 200; letter-spacing: -2px; line-height: 1; }
.wx-desc { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.7); text-transform: capitalize; }
.wx-icon-large { font-size: 40px; filter: drop-shadow(0 0 20px rgba(255,255,255,0.3)); }

/* Stat Grid (Humidity/Wind) */
.wx-grid { 
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px;
}
.wx-stat {
    background: rgba(255,255,255,0.05); padding: 10px; border-radius: 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.wx-stat-label { font-size: 9px; color: rgba(255,255,255,0.5); text-transform: uppercase; font-weight: 700; }
.wx-stat-val { font-size: 14px; font-weight: 600; }

/* Hourly Scroll (Horizontal) */
.wx-hourly {
    display: flex; overflow-x: auto; gap: 15px; padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.wx-hourly::-webkit-scrollbar { display: none; } /* Chrome */

.wx-hour-col {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 40px;
}
.wx-hour-time { font-size: 10px; color: rgba(255,255,255,0.5); }
.wx-hour-icon { font-size: 14px; }
.wx-hour-temp { font-size: 12px; font-weight: 700; }

/* Mobile Override */
@media (max-width: 1024px) {
    #weatherModal {
        top: 50% !important; left: 50% !important; margin: 0 !important;
        transform: translate(-50%, -50%) scale(0.95);
        width: 90%; max-width: 320px;
    }
    #weatherModal.active { transform: translate(-50%, -50%) scale(1); }
    .hg-header { cursor: default; } /* Re-use hg-header class for consistency */
}

/* --- WEATHER SUGGESTIONS --- */
.wx-sugg-header {
    font-size: 9px; font-weight: 700; color: rgba(255,255,255,0.6); 
    margin: 15px 0 8px 0; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 6px;
}

.wx-sugg-list {
    display: flex; flex-direction: column; gap: 6px;
    padding-bottom: 5px;
}

.wx-sugg-item {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.05);
    padding: 12px 14px; /* Slightly taller for easy tapping */
    border-radius: 12px; /* Softer corners */
    font-size: 12px; font-weight: 600; color: white;
    display: flex; align-items: center; justify-content: space-between;
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden; /* Contain long text */
}

/* Ensure text truncates if too long */
.wx-sugg-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 10px;
}

.wx-sugg-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(4px); /* Satisfying slide */
    border-color: rgba(255,255,255,0.2);
}

.wx-sugg-item i { font-size: 10px; opacity: 0.5; }

/* --- RADIO WIDGET --- */
#radioModal {
    position: fixed; top: 150px; left: 150px; width: 300px;
    background: rgba(15, 15, 18, 0.95);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    display: none; flex-direction: column; overflow: hidden;
    z-index: 1000;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0; transform: scale(0.95);
}
#radioModal.active { display: flex; opacity: 1; transform: scale(1); }

/* --- RADIO VISUALIZER (LIQUID PLASMA ENGINE) --- */
.radio-vis {
    height: 140px;
    width: 100%;
    
    /* 1. The Liquid Canvas */
    background: #000000; /* Contrast filter needs a black floor */
    filter: contrast(20); /* The Magic: Merges blurred elements */
    
    display: flex; 
    align-items: center; 
    justify-content: center;
    position: relative; 
    overflow: hidden;
    gap: 15px; /* Wider gap for distinct blobs */
    
    /* 2. Blend into the Glass Modal */
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.radio-wave-bar {
    width: 25px; /* Thicker blobs */
    height: 25px; /* Start as circles */
    
    /* 3. The Liquid Source */
    background: var(--accent); 
    filter: blur(10px); /* Blur edges so they merge */
    border-radius: 50%;
    
    animation: plasmaPulse 1.5s infinite ease-in-out;
    opacity: 0.8;
}

/* LIVE MODE: Alien Plasma Aesthetic (Fixed Visibility) */
.radio-wave-bar.live {
    animation: none !important;
    transition: none !important;
    
    /* 1. Brighter Base */
    background: rgba(10, 132, 255, 0.5); 
    
    /* 2. Softer Core: Reduced inset to 10px so it doesn't hide the bar */
    box-shadow: 
        inset 0 0 10px rgba(255, 255, 255, 0.9), /* Internal Core */
        0 0 20px var(--accent),                  /* Inner Glow */
        0 0 40px var(--accent);                  /* Outer Atmosphere */
        
    border-radius: 100px;
    will-change: height, width, transform, opacity;
    mix-blend-mode: screen; 
    margin: 0 4px;
}

@keyframes plasmaPulse {
    0%, 100% { 
        height: 25px; 
        transform: translateY(0) scale(1);
    }
    50% { 
        height: 90px; /* Stretch into a pill */
        transform: translateY(0) scale(1.1);
        background: #ffffff; /* Flash white core at peak */
    }
}
/* Track Info */
.radio-info { padding: 20px; text-align: center; }
.radio-title { font-size: 14px; font-weight: 700; color: white; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.radio-status { font-size: 10px; color: var(--accent); text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }

/* Controls */
.radio-controls {
    display: flex; justify-content: center; gap: 20px; padding-bottom: 25px;
    align-items: center;
}
.radio-btn {
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.radio-btn:hover { background: rgba(255,255,255,0.2); transform: scale(1.1); }
.radio-btn.play { width: 50px; height: 50px; background: var(--accent); box-shadow: 0 0 20px rgba(10, 132, 255, 0.4); }

.radio-explicit-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: -8px;
    padding-bottom: 18px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.radio-explicit-label {
    font-weight: 700;
    color: var(--text-secondary);
}

.radio-explicit-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.radio-explicit-switch .toggle-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-explicit-switch .toggle-switch {
    width: 34px;
    height: 18px;
}

.radio-explicit-switch .toggle-switch::after {
    width: 14px;
    height: 14px;
}

.radio-explicit-toggle .toggle-checkbox:checked + .toggle-switch::after {
    transform: translateX(14px);
}

/* --- THEME PICKER WIDGET --- */
#themeModal {
    position: fixed; top: 150px; left: 500px; width: 280px;
    background: rgba(10, 10, 12, 0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    display: none; flex-direction: column;
    z-index: 1000;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0; transform: scale(0.95);
}
#themeModal.active { display: flex; opacity: 1; transform: scale(1); }

.theme-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    padding: 20px;
}
.theme-option {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 15px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: transform 0.2s, border-color 0.2s;
}
.theme-option:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.3); }
.theme-swatch { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.theme-name { font-size: 10px; font-weight: 700; color: #8e8e93; text-transform: uppercase; }

/* Mobile overrides */
@media (max-width: 1024px) {
    #radioModal, #themeModal {
        top: 50% !important; left: 50% !important; width: 90%; max-width: 320px;
        transform: translate(-50%, -50%) scale(0.95); margin: 0;
    }
    #radioModal.active, #themeModal.active { transform: translate(-50%, -50%) scale(1); }
}
        
/* Sidebar Settings Button (Clean Text Style) - NOT WEATHER/HOURGLASS CONNECTED */
.btn-settings {
    /* Override Global Button Styles */
    background: transparent !important; 
    border: none !important; 
    box-shadow: none !important;
    backdrop-filter: none !important;
    
    color: #8e8e93; 
    width: 100%; text-align: left; padding: 12px;
    margin-top: auto; /* Pushes to bottom */
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; font-weight: 600;
    transition: all 0.2s;
}

.btn-settings:hover { 
    color: white; 
    transform: translateX(4px); /* Subtle slide feedback instead of a box */
}
/* Remove the ::after shine effect from global buttons */
.btn-settings::after { display: none; }
        
        /* Toggle Switch */
        .toggle-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
        .toggle-switch {
            position: relative; width: 40px; height: 24px;
            background: rgba(255,255,255,0.1); border-radius: 20px;
            transition: 0.3s; cursor: pointer;
        }

/* --- ACCOUNT MODAL --- */
.account-modal-content {
    width: 380px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    position: relative;
}

.account-modal-glass {
    background: linear-gradient(135deg, rgba(20, 35, 70, 0.7), rgba(12, 18, 30, 0.92));
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 30px 80px rgba(0,0,0,0.45), 0 12px 30px rgba(10, 132, 255, 0.12);
    overflow: hidden;
}

.account-modal-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 60%);
    opacity: 0.7;
    pointer-events: none;
}

.account-modal-glass > * {
    position: relative;
    z-index: 1;
}

.account-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.account-orb {
    position: absolute;
    border-radius: 999px;
    opacity: 0.2;
    background: radial-gradient(circle, rgba(90, 160, 255, 0.5), rgba(12, 18, 30, 0));
}

.account-orb.orb-one {
    width: 160px;
    height: 160px;
    top: -40px;
    right: -50px;
}

.account-orb.orb-two {
    width: 220px;
    height: 220px;
    bottom: -90px;
    left: -80px;
}

.account-orb.orb-three {
    width: 140px;
    height: 140px;
    bottom: 20%;
    right: -40px;
}

.account-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: #a1a1aa;
    font-size: 18px;
}

.account-email {
    font-size: 12px;
    color: #a1a1aa;
    margin-top: 4px;
}

.account-section {
    background: rgba(10, 12, 24, 0.55);
    border: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 12px;
}

.account-section-title {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    margin-bottom: 10px;
    font-weight: 600;
}

.account-label {
    font-size: 11px;
    color: #8e8e93;
    display: block;
    margin-bottom: 6px;
}

.account-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.account-input {
    flex: 1;
    background: rgba(8, 12, 24, 0.65);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px 12px;
    color: #fff;
}

.account-input:focus {
    outline: none;
    border-color: rgba(108, 200, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(64, 160, 255, 0.2);
}

.account-save-btn {
    width: auto;
    padding: 10px 14px;
    font-size: 12px;
}

.account-toggle-btn {
    width: 100%;
    margin-top: 10px;
}

.account-password {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #d1d1d6;
    margin-bottom: 8px;
}

.account-usage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-usage-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-usage-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #e5e7eb;
}

.account-usage-count {
    font-size: 11px;
    color: rgba(255,255,255,0.65);
}

.account-usage-bar {
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 999px;
    overflow: hidden;
}

.account-usage-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(10, 132, 255, 0.4), rgba(10, 132, 255, 0.8));
    transition: width 0.4s ease;
}

.account-usage-sub {
    font-size: 10px;
    color: rgba(255,255,255,0.5);
}

.account-usage-reset {
    margin-top: 8px;
    font-size: 10px;
    color: rgba(255,255,255,0.45);
}

.account-unlimited-badge {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    color: #32d74b;
    border: 1px solid rgba(52,199,89,0.4);
    background: rgba(52,199,89,0.15);
    letter-spacing: 0.08em;
}

.account-connection-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #d1d1d6;
    margin-bottom: 10px;
}

.account-pill {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: #a1a1aa;
}

.account-pill.linked {
    background: rgba(52,199,89,0.15);
    color: #32d74b;
    border: 1px solid rgba(52,199,89,0.3);
}

.account-subscription {
    margin-top: 6px;
}

.account-cancel-notice {
    margin-top: 8px;
    font-size: 11px;
    color: rgba(255, 214, 10, 0.9);
    background: rgba(255, 214, 10, 0.08);
    border: 1px solid rgba(255, 214, 10, 0.2);
    padding: 8px 10px;
    border-radius: 10px;
}

.account-actions {
    display: flex;
    gap: 8px;
    margin: 10px 0;
}

.account-actions button {
    flex: 1;
}

.account-danger-zone {
    margin-top: 10px;
}

.account-close-btn {
    width: 100%;
    background: transparent;
    color: #8e8e93;
    margin-top: 5px;
}

@media (max-width: 480px) {
    .account-modal-glass {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    .account-modal-content {
        max-height: 85vh;
        padding: 20px 20px 24px;
    }
    .account-close-btn {
        padding: 16px 20px;
        margin-top: 12px;
    }
    .account-input-row {
        flex-direction: column;
        align-items: stretch;
    }
    .account-save-btn {
        width: 100%;
    }
    .account-actions {
        flex-direction: column;
    }
}
        .toggle-switch::after {
            content: ''; position: absolute; top: 2px; left: 2px;
            width: 20px; height: 20px; background: white; border-radius: 50%;
            transition: 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        }
        .toggle-checkbox:checked + .toggle-switch { background: var(--accent); }
        .toggle-checkbox:checked + .toggle-switch::after { transform: translateX(16px); }

/* Ghost Button (Pure Text - Removes all Glass/Borders) */
.btn-ghost {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 6px !important; /* Minimal padding */
    
    color: #666;
    font-size: 10px;
    font-weight: 500;
    width: 100%;
    margin-top: 5px;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-ghost:hover { color: #8e8e93; }

/* CRITICAL: Kill the shine effect */
.btn-ghost::after { display: none !important; }

/* --- SIDEBAR LISTS & FOLDERS --- */
        .folder-grid { display: flex; flex-direction: column; gap: 8px; }
        
        /* New: Fixed Height Container for Scrollable Lists */
        .list-container { 
            max-height: 26vh; 
            overflow-y: auto; 
            display: flex; flex-direction: column; gap: 8px; 
            padding-right: 4px; /* Space for scrollbar */
        }
        /* Custom Scrollbar for lists */
        .list-container::-webkit-scrollbar { width: 4px; }
        .list-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

        /* New: Time Input Styling */
        input[type="time"] {
            background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border);
            color: white; border-radius: 8px; font-family: var(--font-main);
            padding: 8px; cursor: pointer; transition: 0.2s;
        }
        input[type="time"]:focus { border-color: var(--accent); background: rgba(0,0,0,0.5); }
        input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; opacity: 0.7; }
        
        /* Folder Styling (Kept from before) */
        .list-folder {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px; border-radius: 14px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.05);
            cursor: pointer; transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            position: relative; overflow: hidden;
        }
        .list-folder:hover {
            background: rgba(255, 255, 255, 0.08);
            transform: translateX(4px);
            border-color: rgba(255, 255, 255, 0.1);
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
        }
        .folder-icon { font-size: 18px; margin-right: 12px; filter: drop-shadow(0 0 8px rgba(255,255,255,0.2)); }
        .folder-title { font-size: 13px; font-weight: 600; flex: 1; }
        .folder-arrow { color: var(--text-secondary); font-size: 10px; }

        /* Animation for sliding views */
        .slide-view { animation: slideIn 0.3s cubic-bezier(0.19, 1, 0.22, 1); }
        @keyframes slideIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform: translateX(0); } }

        /* Back Button */
        .nav-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 700; transition: 0.2s; }
        .nav-header:hover { opacity: 0.8; transform: translateX(-2px); }

/* --- CALENDAR REMINDERS (Solid Chips) --- */
        .evt-task {
            /* Opaque background to stand out from liquid events */
            background: #2c2c2e !important; 
            border: 1px solid rgba(255, 255, 255, 0.3) !important;
            border-left: 3px solid var(--accent) !important; /* Blue accent stripe */
            border-radius: 6px !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
            z-index: 60 !important; /* Sit above normal events */
        }
        .evt-task.completed {
            opacity: 0.6;
            background: #1c1c1e !important;
            border-left-color: #8e8e93 !important;
            text-decoration: line-through;
        }
/* Checkbox inside Calendar */
        .task-check {
            width: 16px; height: 16px; border-radius: 5px;
            /* Key structural styles */
            z-index: 50; 
            position: relative; 
            border: 2px solid rgba(255,255,255,0.5);
            display: flex; align-items: center; justify-content: center;
            margin-right: 8px; flex-shrink: 0; background: rgba(0,0,0,0.3);
            cursor: pointer; transition: all 0.2s;
            pointer-events: auto; /* Force catch clicks */
        }

        /* 1. The Invisible Hit Area (Expands touch target to ~45px) */
        .task-check::after {
            content: '';
            position: absolute;
            top: -15px; bottom: -15px; left: -15px; right: -15px;
            background: transparent;
            z-index: 51;
        }

        /* 2. The Visual Checkmark (Now using ::before so it doesn't conflict) */
        .task-check.checked::before { 
            content: '\2713'; 
            font-size: 10px; color: white; font-weight: 900; 
            z-index: 52; /* Sits visually on top */
        }

        /* 3. Original Hover & Checked States */
        .task-check:hover { border-color: white; transform: scale(1.1); }
        
        .task-check.checked {
            background: var(--accent); border-color: var(--accent);
            box-shadow: 0 0 10px rgba(10, 132, 255, 0.4);
        }

/* --- WINDOW MANAGER STYLES (Matrix Update) --- */

/* The Resize Handle (Subtle Glowing Corner) */
.resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize; /* Diagonal cursor */
    z-index: 10;
    
    /* Visual indicator: A tiny glowing corner */
    background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.1) 50%);
    border-radius: 0 0 24px 0; /* Match modal border radius */
    transition: background 0.2s;
}

.resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
    box-shadow: 0 0 10px var(--accent);
}

/* Ensure modals can be resized */
.modal-content, #radioModal, #weatherModal, #hourglassModal, #themeModal {
    min-width: 250px;
    min-height: 150px;
    /* Smooth opacity/transform, but INSTANT geometry changes for performance */
    transition: opacity 0.2s, transform 0.2s; 
}

/* Active Window State (Highest Z-Index) */
.window-focused {
    z-index: 2000 !important;
    border-color: rgba(255,255,255,0.3) !important; /* Slight highlight */
    box-shadow: 0 40px 100px rgba(0,0,0,0.9) !important; /* Deeper shadow for lift */
}

/* 1. The Note Window (Distinct from 'modal' to prevent auto-close bug) */
.note-window {
    display: flex; flex-direction: column; overflow: hidden; position: fixed;
    backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    transition: opacity 0.2s, transform 0.2s, background 0.3s;
    min-width: 200px; min-height: 200px;
}

/* Force items to stack neatly at the top */
#notesListContainer {
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    padding: 15px;
    width: 100%; /* Force container to fill modal */
    box-sizing: border-box;
}

.hub-item {
    display: flex; 
    flex-direction: row; /* FORCE ROW */
    justify-content: space-between; 
    align-items: center;
    
    width: 100%;
    height: 48px; /* Fixed neat height */
    padding: 0 16px;
    
    background: rgba(255,255,255,0.03); 
    border: 1px solid rgba(255,255,255,0.08); 
    border-radius: 12px;
    
    cursor: pointer;
    transition: all 0.1s;
    box-sizing: border-box;
}

.hub-item:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}

/* Left Group: ID + Title */
.hub-item-left {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 1; 
    min-width: 0; /* Allows truncation to work */
    height: 100%;
}

.hub-item-id {
    font-size: 10px; 
    font-weight: 900; 
    color: #fff; 
    opacity: 0.9;
    text-transform: uppercase; 
    letter-spacing: 1px;
    white-space: nowrap;
}

.hub-item-sep {
    width: 1px; height: 12px; background: rgba(255,255,255,0.2);
}

.hub-item-title {
    font-size: 13px; 
    font-weight: 500; 
    color: #a1a1aa;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

/* Right Group: Date */
.hub-item-date {
    font-size: 11px; 
    font-weight: 600; 
    color: #666; 
    white-space: nowrap;
    margin-left: 10px;
    font-variant-numeric: tabular-nums;
}

/* --- CINEMATIC FX ENGINE --- */

/* 1. Screen Shake (High Frequency Jitter) */
@keyframes cameraShake {
    0% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-10px, -10px) rotate(-2deg); }
    20% { transform: translate(10px, 10px) rotate(2deg); }
    30% { transform: translate(-10px, 10px) rotate(0deg); }
    40% { transform: translate(10px, -10px) rotate(1deg); }
    50% { transform: translate(-5px, 5px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

.fx-shake-active {
    animation: cameraShake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

/* 2. The Whiteout (Exposure Blowout) */
@keyframes flashBang {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.fx-flash-active {
    animation: flashBang 0.6s ease-out forwards;
}

/* 3. The Bolt Strike (Electric Crack) */
@keyframes boltStrike {
    0% { opacity: 0; clip-path: inset(0 0 100% 0); } /* Start hidden at top */
    10% { opacity: 1; clip-path: inset(0 0 0 0); }   /* Instant strike down */
    50% { opacity: 1; stroke-width: 5; }             /* Bloom */
    100% { opacity: 0; stroke-width: 0; }            /* Fade */
}

.fx-bolt-active path {
    animation: boltStrike 0.4s ease-out forwards;
}

/* --- RICH TEXT EDITOR STYLES --- */
.note-toolbar {
    display: flex; align-items: center; gap: 4px;
    padding: 10px 15px 0 15px; 
    background: transparent; /* Removed background */
    border: none;            /* Removed border */
}

.note-toolbar button, .color-btn {
    background: transparent; border: none; color: #8e8e93;
    width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s; font-size: 12px;
}

.note-toolbar button:hover, .color-btn:hover {
    background: rgba(255,255,255,0.1); color: white;
}

.toolbar-sep {
    width: 1px; height: 16px; background: rgba(255,255,255,0.1); margin: 0 4px;
}

#stickyEditor {
    flex: 1; 
    width: 100%;
    padding: 15px;
    overflow-y: auto;
    color: #ddd; 
    font-family: 'Inter', sans-serif; 
    font-size: 14px; 
    line-height: 1.6;
    outline: none;
}

#stickyEditor::-webkit-scrollbar { width: 4px; }
#stickyEditor::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

#stickyEditor img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* --- ORBIT & FINANCE SPLIT LAYOUT (Tuned v2) --- */

/* 1. Modal Resizing (Restored Height) */
#financeModal .modal-content {
    flex-direction: row !important;
    width: 1000px !important;
    max-width: 95vw;
    
    /* THE FIX: Back to compact height */
    height: 800px !important; 
    max-height: 90vh;
    
    padding: 0 !important;
    overflow: hidden;
}

/* 2. The Orbit Sidebar (Left) */
.orbit-sidebar {
    width: 280px; /* Slightly wider to accommodate 14 cols */
    background: rgba(0, 0, 0, 0.4); /* Slightly darker backdrop */
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex; flex-direction: column;
    padding: 30px;
    flex-shrink: 0;
    
    /* Center the visualization vertically */
    justify-content: center; 
    position: relative;
}

/* Header stays at top via absolute pos or flex trickery, 
   but for simplicity let's keep it in flow but push the grid */
.orbit-header {
    font-size: 12px; font-weight: 800; color: #fff; 
    margin-bottom: 5px; letter-spacing: 2px; text-transform: uppercase;
    text-align: center; /* Center align text */
}

.orbit-sub {
    font-size: 10px; color: #888; margin-bottom: 30px; 
    font-family: monospace; text-align: center;
}

/* 3. The Dot Grid (High Vis) */
.orbit-grid {
    display: grid;
    /* 14 Cols = 2 Weeks per row. Cuts height in half. */
    grid-template-columns: repeat(14, 1fr); 
    gap: 6px;
    align-content: center;
    margin: 0 auto; /* Center horizontally */
}

.orbit-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.orbit-dot:hover {
    transform: scale(2);
    background: white !important;
    border-color: white !important;
    box-shadow: 0 0 15px white;
    z-index: 20;
}

/* VISIBILITY TUNING */
.orbit-dot.past { 
    background: rgba(255, 255, 255, 0.2); /* Much brighter gray */
} 

.orbit-dot.today { 
    background: var(--accent); 
    box-shadow: 0 0 20px var(--accent); 
    transform: scale(1.5);
    z-index: 10;
}

.orbit-dot.future { 
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18); /* Stronger borders */
    box-sizing: border-box;
}

/* 4. The Finance Main Area (Right) */
.finance-wrapper {
    flex: 1;
    display: flex; flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* --- MOBILE RESPONSIVE (Orbit Toggle System) --- */
@media (max-width: 1024px) {
    /* 1. Toggle Buttons */
    #btnMobileOrbit { display: flex !important; }
    .mobile-orbit-back { display: block !important; }

    /* 2. REVERT MODAL TO FLOATING CARD */
    #financeModal .modal-content {
        flex-direction: column !important;
        width: 95% !important; 
        height: 85vh !important; 
        max-height: 85vh !important;
        border-radius: 24px !important; 
        
        /* CHANGED: Use variable so it turns White in Nova, Dark in Onyx */
        background: var(--glass-panel) !important; 
        
        overflow: hidden !important; 
        border: 1px solid var(--glass-border) !important;
        box-shadow: var(--shadow-deep) !important;
    }
    
    /* 3. Orbit Sidebar: Deep Black Overlay */
    .orbit-sidebar {
        display: none;
        width: 100%; height: 100%;
        padding: 20px;
        background: #050505; /* Keep Orbit Deep Black for contrast */
        z-index: 50;
    }

    /* 4. ACTIVE STATE */
    .orbit-sidebar.active {
        display: flex;
        flex-direction: column;
        align-items: center; 
        justify-content: center;
    }

    /* 5. THE YEAR BLOCK (14 Cols) */
    .orbit-sidebar.active .orbit-grid {
        display: grid;
        grid-template-columns: repeat(14, 1fr); 
        gap: 6px; /* Slightly tighter for compact view */
        margin: 20px 0;
        width: 100%;
        max-width: 320px; 
    }

    /* 6. DOT AESTHETICS (Tweet Style) */
    .orbit-sidebar.active .orbit-dot {
        width: 10px; height: 10px; /* Slightly smaller to fit compact height */
        border-radius: 50%;
        transition: transform 0.2s;
    }

    /* PAST: Solid Bright */
    .orbit-sidebar.active .orbit-dot.past {
        background: rgba(255, 255, 255, 0.3); 
        border: none;
    }

    /* FUTURE: Solid Dark */
    .orbit-sidebar.active .orbit-dot.future { 
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.2); /* Stronger borders */
        box-sizing: border-box;
    }


    /* TODAY: Supernova */
    .orbit-sidebar.active .orbit-dot.today {
        background: var(--accent);
        box-shadow: 0 0 20px var(--accent);
        transform: scale(1.3);
    }

    /* 7. Hide Finance when Orbit is active */
    .finance-wrapper.hidden { display: none; }
    
    /* 8. Text Formatting */
    .orbit-header { text-align: center; font-size: 14px; letter-spacing: 3px; margin-bottom: 5px; }
    .orbit-sub { text-align: center; font-size: 12px; opacity: 0.5; }
}

/* Orbit Phantom Hover Selection (Hover Preview) */
.orbit-dot.phantom {
    background: white !important;
    opacity: 0.5 !important;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    transform: scale(1.1);
    transition: none; /* Instant feedback */
}

/* Hide Quote on Tablet/Mobile to save space (IPAD PRO FIX) */
@media (max-width: 1400px) { /* Increased from 1200 to 1400 */
    #header-quote-box {
        display: none !important;
    }
}

/* --- ERA VISUALS (Solid Tint Polish) --- */

.era-header-wrapper {
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    height: 100%;
    align-items: center;
    justify-content: center; /* Default: Vertically centered */
    position: relative;
    box-sizing: border-box;
}

/* When an Era is present, push content to bottom */
.era-header-wrapper.has-era {
    justify-content: flex-end; 
}

/* The Text Container */
.era-text-group {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 6px;
    /* Allow text to take available space, pushing bar down */
    flex: 1; 
}

.era-header-bar {
    display: block;
    height: 4px;
    width: 24px;
    
    /* FIX: Full Pill Shape + Lift from bottom */
    border-radius: 10px; 
    margin-bottom: 4px; /* Lifts it off the cutoff line */
    margin-top: 0;      /* Let flexbox handle top spacing */
    
    /* Dynamic Color */
    background-color: var(--era-color, #fff); 
    box-shadow: 0 0 10px var(--era-color, #fff); /* Omni-directional glow */
    
    opacity: 1;
    z-index: 10;
    flex-shrink: 0; 
    cursor: default; 
}

.era-header-bar:hover::after { display: none; }

/* Era Date Inputs in Modal */
.era-date-input {
    flex: 1;
    min-width: 0; /* Allow flex shrink */
    box-sizing: border-box;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-family: var(--font-main);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.era-date-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0,0,0,0.5);
}

.era-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.5;
    cursor: pointer;
}

/* Era Tooltip */
.era-tooltip {
    position: fixed;
    z-index: 999999;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    padding: 14px 18px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) inset;
    max-width: 260px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.era-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.era-tooltip-color {
    width: 4px;
    height: 100%;
    min-height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.era-tooltip-content {
    flex: 1;
}

.era-tooltip-title {
    font-size: 14px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.era-tooltip-dates {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.era-tooltip-goal {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-style: italic;
    line-height: 1.4;
}

.era-tooltip-goal:empty {
    display: none;
}

/* 2. ORBIT DOT AESTHETICS (Solid Tints) */

/* A. MOBILE AESTHETICS (< 1024px) */
@media (max-width: 1024px) {
    /* ONYX Era Future: Colored Hollow Ring */
    :root:not([data-base="nova"]) .orbit-dot.era-future {
        background: transparent !important;
        border: 1px solid var(--era-color) !important;
        box-shadow: none !important;
        opacity: 0.3 !important;
    }
    
    /* NOVA Era Future: Colored Hollow Ring */
    [data-base="nova"] .orbit-dot.era-future {
        background: transparent !important;
        border: 1px solid var(--era-color) !important;
        box-shadow: none !important;
        opacity: 0.44 !important;
    }
}

/* B. GLOBAL / DESKTOP STYLES */

/* ONYX Era Future: Colored Hollow Ring */
:root:not([data-base="nova"]) .orbit-dot.era-future {
    background: transparent !important;
    border: 1px solid var(--era-color) !important;
    box-shadow: none !important;
    opacity: 0.25 !important;
}
/* NOVA Era Future: Colored Hollow Ring */
[data-base="nova"] .orbit-dot.era-future {
    background: transparent !important;
    border: 1px solid var(--era-color) !important;
    box-shadow: none !important;
    opacity: 0.44 !important;
    box-sizing: border-box;
}

/* Past Era Dots: Solid colored fill */
.orbit-dot.era-filled {
    background: var(--era-color) !important;
    box-shadow: 0 0 10px var(--era-color) !important; /* Glow for active/past energy */
    border: none !important;
    opacity: 0.8;
}

/* Selection Mode */
.orbit-dot.selecting {
    animation: pulseSelect 0.5s infinite alternate;
}
@keyframes pulseSelect { from { opacity: 0.3; } to { opacity: 1; transform: scale(1.2); } }

/* --- NOVA THEME VISIBILITY FIXES --- */

/* 1. Atmosphere / Weather Widget */
[data-base="nova"] .wx-content { color: #333 !important; }
[data-base="nova"] .wx-desc { color: #666 !important; }
[data-base="nova"] .wx-stat-label { color: #888 !important; }
[data-base="nova"] .wx-hour-time { color: #888 !important; }
[data-base="nova"] .wx-sugg-header { color: #666 !important; }
[data-base="nova"] .wx-sugg-item { 
    background: rgba(0,0,0,0.05) !important; 
    color: #333 !important; 
    border-color: rgba(0,0,0,0.1) !important;
}
[data-base="nova"] .wx-sugg-item:hover { background: rgba(0,0,0,0.1) !important; }

/* 2. Check-In & Forms */
[data-base="nova"] .form-group span { color: #333 !important; }

/* 3. Ensure Secondary Buttons are visible */
[data-base="nova"] .btn-secondary {
    color: #333 !important;
    background: rgba(0,0,0,0.05) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

/* --- MOBILE SIDEBAR RESTORATION --- */
@media (max-width: 1024px) {
    .sidebar {
        /* 1. Force heavy blur so the calendar underneath disappears */
        backdrop-filter: blur(40px) !important;
        -webkit-backdrop-filter: blur(40px) !important;

        /* 2. Restore the "Living" Beam Animation (Gradient Overlay) */
        /* We use background-image so it sits ON TOP of the theme color */
        background-image: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%) !important;
        background-size: 100% 200%;
        animation: beamVertical 12s ease-in-out infinite;
        
        /* 3. Deep shadow to separate it cleanly from the app */
        box-shadow: 15px 0 50px rgba(0,0,0,0.6) !important;
        
        /* 4. Ensure border helps definition */
        border-right: 1px solid rgba(255,255,255,0.1) !important;
    }
}

/* --- HEALTH HUB DETECT BUTTON (Floating & Pulse) --- */

/* Pulse Button in Event Header (Top Right) */
.hh-pulse-btn {
    position: absolute;
    top: 25px; right: 25px;
    z-index: 10;
    
    background: rgba(50, 215, 75, 0.15);
    color: #32d74b;
    border: 1px solid rgba(50, 215, 75, 0.3);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    animation: pulseGreen 2s infinite;
    display: flex; align-items: center; gap: 8px;
}
.hh-pulse-btn:hover { background: rgba(50, 215, 75, 0.25); }

@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(50, 215, 75, 0); }
    100% { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0); }
}

/* --- HEALTH HUB UI --- */

/* 1. DESKTOP MODAL DIMENSIONS */
@media (min-width: 1025px) {
    #healthHubModal {
        width: 500px !important; min-width: 500px !important;
    }
}

/* 2. MAIN LAYOUT ENGINE */
.hh-tab-content {
    /* Force the view to fill the scrolling wrapper */
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex; flex-direction: column; /* Stack children */
}

/* Specific styling for the Workout View to fix the 'narrow' bug */
#hhWorkoutView {
    display: flex; 
    flex-direction: column; 
    width: 100%; /* Fill the 500px modal */
    box-sizing: border-box;
}

/* 3. CARDS & BLOCKS */
.hh-card, .hh-exercise-block {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    
    /* THE FIX: Force full width relative to parent */
    width: 100%; 
    box-sizing: border-box;
    
    display: flex; flex-direction: column; gap: 10px;
}

.hh-grid-row {
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px; 
    width: 100%;
}

/* 4. VISION OS SLIDERS (Clean) */
#hhUniversalInputs input[type=range] {
    -webkit-appearance: none;
    width: 100% !important; /* Stretch to container */
    height: 20px; 
    
    /* Clean styles */
    background: transparent !important; 
    border: none !important;
    box-shadow: none !important;
    filter: none !important;
    
    margin: 5px 0; padding: 0; cursor: pointer;
    display: block;
}

/* Track */
#hhUniversalInputs input[type=range]::-webkit-slider-runnable-track {
    width: 100%; height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px; border: none;
}

/* Thumb */
#hhUniversalInputs input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px; width: 18px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    margin-top: -7px; border: none;
}

/* 5. EXERCISE UI */
.hh-exercise-header {
    display: flex; gap: 8px; margin-bottom: 8px; align-items: center; width: 100%;
}
.hh-exercise-header input {
    font-size: 13px !important; font-weight: 700 !important;
    padding: 6px !important; height: 30px !important;
    flex: 1; min-width: 0;
}
.hh-move-controls {
    display: flex; flex-direction: column; gap: 2px; margin-right: 4px;
}
.hh-move-btn {
    font-size: 8px; color: #666; cursor: pointer; padding: 2px;
}
.hh-move-btn:hover { color: white; background: rgba(255,255,255,0.1); border-radius: 2px; }

/* 6. SET ROWS */
.hh-set-row {
    display: grid; grid-template-columns: 20px 1fr 1fr 20px; 
    gap: 8px; align-items: center; margin-bottom: 4px;
    font-size: 10px; color: var(--text-secondary); width: 100%;
}
.hh-set-row input {
    padding: 4px !important; font-size: 12px !important; 
    text-align: center; height: 26px !important; width: 100% !important;
}
.hh-exercise-header .btn-delete, .hh-set-row .fa-xmark {
    width: 20px; height: 20px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0.6;
}
.hh-set-row .fa-xmark:hover { opacity: 1; color: #ff453a; }

/* 7. MOBILE OPTIMIZATION */
@media (max-width: 1024px) {
    #healthHubModal {
        top: 50% !important; left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 95% !important; min-width: 0 !important;
        height: 80vh !important; max-height: 700px;
        border-radius: 24px !important;
    }
    .hh-grid-row {
        grid-template-columns: 1fr !important; gap: 15px !important;
    }
}

/* --- HEALTH HUB AESTHETICS (Transparency Fix) --- */

/* 1. Force the Window to be Translucent */
#healthHubModal {
    background: rgba(30, 30, 35, 0.8) !important;
    backdrop-filter: blur(30px) !important;
    -webkit-backdrop-filter: blur(30px) !important;
}

/* 2. Make Cards Inside Opaque for Readability */
#healthHubModal .hh-card, 
#healthHubModal .hh-exercise-block {
    background: rgba(45, 45, 50, 0.5) !important; /* Darker, less transparent */
    border: 1px solid rgba(255,255,255,0.1) !important;
}

/* 3. Nova Theme Override for Light Mode */
[data-base="nova"] #healthHubModal {
    background: rgba(245, 247, 250, 0.8) !important; /* Light Frost */
}
[data-base="nova"] #healthHubModal .hh-card, 
[data-base="nova"] #healthHubModal .hh-exercise-block {
    background: rgba(255, 255, 255, 0.6) !important;
    border-color: rgba(0,0,0,0.05) !important;
}

/* --- NOVA THEME: HEALTH HUB & WIDGET POLISH --- */

/* 1. Health Hub: Force all text inside cards to be dark */
[data-base="nova"] #healthHubModal .hh-card,
[data-base="nova"] #healthHubModal .hh-exercise-block {
    color: var(--text-primary) !important; /* Make base text dark */
}

[data-base="nova"] #healthHubModal .hh-card div,
[data-base="nova"] #healthHubModal .hh-card span,
[data-base="nova"] #healthHubModal .hh-exercise-block span {
    color: inherit !important; /* Make sure children inherit the dark color */
    text-shadow: none !important; /* Remove any glows meant for dark mode */
}

/* 2. Health Hub Stats: Make faint elements visible */
[data-base="nova"] .hh-heat-cell {
    background: rgba(0, 0, 0, 0.08) !important; /* Darker empty dots */
}

[data-base="nova"] .muscle-group {
    fill: rgba(0, 0, 0, 0.04) !important;   /* Faint grey fill for body */
    stroke: rgba(0, 0, 0, 0.1) !important; /* Darker outline */
}

[data-base="nova"] .sub-chip {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #666;
}

[data-base="nova"] .sub-chip.active {
    background: #e5e5ea !important; /* Light grey active state */
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}

[data-base="nova"] #statsChartTitle,
[data-base="nova"] #statsChartValue,
[data-base="nova"] #statsChartSub {
    color: var(--text-primary) !important;
}

/* 3. Finance Statement & AI: Increase text contrast */
[data-base="nova"] .stmt-date {
    color: #888 !important; /* Darker grey for dates */
    opacity: 1 !important; /* Override fading effect */
}

[data-base="nova"] .audit-body {
    color: #555 !important; /* Darker grey for AI analysis text */
}

/* 4. Sidebar & Calendar: Fix remaining text */
[data-base="nova"] #stat-balance {
    color: var(--text-primary) !important; /* Fix "Saved %" */
}

[data-base="nova"] .yv-day {
    color: var(--text-primary) !important; /* Make Year View day numbers dark */
}

/* Ensure "Today" in Year View has white text on its red background */
[data-base="nova"] .fc-multiMonthYear-view .fc-day-today .yv-day {
    color: white !important; 
}

[data-base="nova"] #ai-result,
[data-base="nova"] .hh-exercise-block,
[data-base="nova"] .hh-card [style*="color:white"],
[data-base="nova"] .hh-card [style*="color:#aaa"],
[data-base="nova"] .hh-card [style*="color:#ccc"] {
    color: #4a5568 !important; /* A medium-dark gray for body text */
    text-shadow: none !important;
}

[data-base="nova"] .hh-exercise-block div[style*="font-weight:700"],
[data-base="nova"] .hh-card div[style*="font-weight:800"] {
    color: #1a202c !important; /* A near-black for titles */
}

/* Make ratings and accents use the dark green 'success' color */
[data-base="nova"] [style*="#32d74b"] {
    color: var(--success) !important;
}

/* 2. Fix Inactive Elements in STATS tab */
[data-base="nova"] .hh-heat-cell {
    background: rgba(0, 0, 0, 0.06) !important; /* Darker empty dots */
}
[data-base="nova"] .muscle-group {
    fill: rgba(0, 0, 0, 0.03) !important;
    stroke: rgba(0, 0, 0, 0.1) !important;
}

/* 3. RESTORE ACCENT COLORS for Consistency & Anatomy */
[data-base="nova"] .hh-heat-cell[data-level="1"] { background: var(--accent) !important; opacity: 0.3; }
[data-base="nova"] .hh-heat-cell[data-level="2"] { background: var(--accent) !important; opacity: 0.5; }
[data-base="nova"] .hh-heat-cell[data-level="3"] { background: var(--accent) !important; opacity: 0.8; }
[data-base="nova"] .hh-heat-cell[data-level="4"] { background: var(--accent) !important; opacity: 1; }

[data-base="nova"] .muscle-active-low { 
    fill: var(--accent) !important; 
    stroke: var(--accent) !important;
    opacity: 0.4;
}
[data-base="nova"] .muscle-active-med { 
    fill: var(--success) !important; 
    stroke: var(--success) !important;
    opacity: 0.6;
}
[data-base="nova"] .muscle-active-high { 
    fill: var(--danger) !important; 
    stroke: var(--danger) !important;
    opacity: 0.8;
}

/* --- HEALTH STATS UI --- */
.filter-chip {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #888;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-chip:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.filter-chip.active {
    background: var(--accent);
    color: var(--text-on-accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3); /* Dynamic glow */
}

/* Nova Theme Override for Chips */
[data-base="nova"] .filter-chip {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #666;
}
[data-base="nova"] .filter-chip.active {
    background: var(--accent);
    color: white;
}

/* --- HEALTH HUB HEATMAP (6-Month Compact) --- */
.hh-heatmap-container {
    display: grid;
    grid-template-rows: repeat(7, 1fr); /* 7 Days Vertical */
    grid-auto-flow: column; /* Flow Weeks Horizontal */
    gap: 4px;
    height: 90px;
    width: 100%;
    overflow: hidden;
    padding: 2px; /* Breathing room for glow */
}

.hh-heat-cell {
    width: 100%;
    height: 100%;
    border-radius: 50%; /* Start as tiny dots (Inactive) */
    background: rgba(255,255,255,0.05);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: scale(0.5); /* Make empty dots small */
}

.hh-heat-cell:hover {
    transform: scale(1.5) !important;
    background: white !important;
    border-radius: 2px !important;
    z-index: 10;
    box-shadow: 0 0 10px white;
}

/* LEVELS (Active cells become Squares and Scale Up) */
.hh-heat-cell[data-level] {
    border-radius: 3px; /* Square shape */
    transform: scale(1); /* Full size */
}

.hh-heat-cell[data-level="1"] { background: var(--accent); opacity: 0.3; }
.hh-heat-cell[data-level="2"] { background: var(--accent); opacity: 0.5; }
.hh-heat-cell[data-level="3"] { background: var(--accent); opacity: 0.8; box-shadow: 0 0 5px var(--accent); }
.hh-heat-cell[data-level="4"] { background: var(--accent); opacity: 1.0; box-shadow: 0 0 10px var(--accent); }

/* NOVA THEME FIX */
[data-base="nova"] .hh-heat-cell { background: rgba(0,0,0,0.05); }

/* Team Sport: Stat Row */
.hh-team-row {
    display: grid;
    grid-template-columns: 2fr 1fr 10px 1fr 20px; /* Label | Made | / | Attempts | Del */
    gap: 8px;
    align-items: center;
}

.hh-slash-sep {
    color: #666; font-size: 14px; font-weight: 300; text-align: center;
}

/* Combat & Recovery: Simple Rows */
.hh-simple-row {
    display: grid;
    grid-template-columns: 3fr 1fr 20px; /* Name | Value | Del */
    gap: 10px;
    align-items: center;
}

/* Sub-Filter Chips (Exercises) */
.sub-chip {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    color: #888;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.sub-chip:hover { background: rgba(255,255,255,0.08); color: white; }
.sub-chip.active {
    background: rgba(255,255,255,0.15);
    color: var(--accent);
    border-color: var(--accent);
}

/* --- HEALTH HUB TOGGLE (Stats Context) --- */
.hh-toggle-row {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
    
    /* Spacing tweaks */
    margin-top: 10px; 
    padding-top: 12px; 
    padding-bottom: 5px; /* Give it bottom breathing room */
    border-top: 1px solid rgba(255,255,255,0.05);
}

.hh-toggle-label {
    font-size: 10px; 
    font-weight: 700; 
    color: #666; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    transition: color 0.2s;
}

.hh-toggle-label.active {
    color: white;
}

/* Re-using your existing switch logic but refining sizing */
.toggle-switch-small {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
}
.toggle-switch-small input { opacity: 0; width: 0; height: 0; }
.toggle-switch-small .slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.1);
    transition: .4s;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}
.toggle-switch-small .slider:before {
    position: absolute; content: "";
    height: 12px; width: 12px;
    left: 2px; bottom: 2px;
    background-color: #888; /* Dimmed when off */
    transition: .4s;
    border-radius: 50%;
}
.toggle-switch-small input:checked + .slider {
    background-color: rgba(10, 132, 255, 0.2); /* Blue tint */
    border-color: var(--accent);
}
.toggle-switch-small input:checked + .slider:before {
    transform: translateX(16px);
    background-color: white;
    box-shadow: 0 0 10px white;
}
/* Toggle Nova Theme Fix */
[data-base="nova"] .toggle-switch-small .slider { background-color: rgba(0,0,0,0.1); }

/* --- SPLIT STATS LAYOUT --- */
.hh-split-container {
    display: flex;
    gap: 15px;
    height: 140px; /* Fixed height for consistent SVG rendering */
    width: 100%;
}

.hh-split-left {
    flex: 7; /* 70% Width */
    display: flex;
    flex-direction: column;
}

.hh-split-right {
    flex: 3; /* 30% Width */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid rgba(255,255,255,0.05);
    padding-left: 10px;
}

/* --- ANATOMY SVG --- */
.anatomy-svg {
    height: 100%;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}

.muscle-group {
    fill: rgba(255,255,255,0.05); /* Default: Inactive/Ghost */
    stroke: rgba(255,255,255,0.2);
    stroke-width: 1;
    transition: all 0.5s ease-in-out;
}

/* ACTIVATION LEVELS (Applied via JS) */
.muscle-active-low { fill: rgba(10, 132, 255, 0.4); stroke: rgba(10, 132, 255, 0.8); filter: drop-shadow(0 0 5px rgba(10,132,255,0.3)); }
.muscle-active-med { fill: rgba(50, 215, 75, 0.5); stroke: rgba(50, 215, 75, 0.8); filter: drop-shadow(0 0 8px rgba(50,215,75,0.4)); }
.muscle-active-high { fill: rgba(255, 69, 58, 0.6); stroke: rgba(255, 69, 58, 1); filter: drop-shadow(0 0 12px rgba(255,69,58,0.5)); }

/* Tooltip for Muscles */
.muscle-tooltip {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}


/* --- OVERALL NOVA THEME MOBILE POLISH --- */

/* 1. Header Fixes */
[data-base="nova"] #customTitleBox { color: #1c1c1e !important; text-shadow: none !important; }
[data-base="nova"] .fc-button {
    background: #ffffff !important; color: #444 !important; 
    border: 1px solid #d1d1d6 !important; box-shadow: none !important;
}
[data-base="nova"] .fc-button-group, [data-base="nova"] .fc-header-toolbar { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important; }

/* Nova Glass Panel + Beam Override */
[data-base="nova"] .fc-header-toolbar {
    background: rgba(240, 242, 246, 0.85) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}
[data-base="nova"] .fc-header-toolbar::before {
    background: linear-gradient(90deg,
        transparent 0%,
        color-mix(in srgb, var(--accent), transparent 100%) 20%,
        color-mix(in srgb, var(--accent), transparent 60%) 50%,
        color-mix(in srgb, var(--accent), transparent 100%) 80%,
        transparent 100%
    ) !important;
}
[data-base="nova"] .fc-header-toolbar::after {
    background: radial-gradient(
        ellipse 60% 100% at 50% 0%,
        color-mix(in srgb, var(--accent), transparent 92%),
        transparent 70%
    ) !important;
}
/* Nova Liquid Glass Buttons */
[data-base="nova"] .fc-button {
    background: rgba(255, 255, 255, 0.7) !important;
    color: #444 !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}
[data-base="nova"] .fc-button-group {
    background: rgba(255, 255, 255, 0.5) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}
[data-base="nova"] .fc-button-group > .fc-button {
    background: transparent !important;
    border: none !important;
    border-right: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: none !important;
}
[data-base="nova"] .fc-button-group > .fc-button:last-child {
    border-right: none !important;
}
[data-base="nova"] .fc-nowBtn-button,
[data-base="nova"] .fc-undoBtn-button {
    background: rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

/* 2. BACKGROUND & SHADOW KILLER */
[data-base="nova"] body { background-color: #eef2f6 !important; background-image: none !important; }
[data-base="nova"] .app-container { overflow: hidden !important; clip-path: inset(0 0 0 0); }
[data-base="nova"] .app-container::after { display: none !important; }

/* 3. FINANCE HUD TEXT COLORS */
[data-base="nova"] #financeModal #finNetFlow, 
[data-base="nova"] #financeModal #finSaveRate,
[data-base="nova"] #financeModal #finIncomeVal, 
[data-base="nova"] #financeModal #stmtSumIn,
[data-base="nova"] #financeModal .stmt-amount[style*="32d74b"], 
[data-base="nova"] #financeModal span[style*="32d74b"] { color: var(--success) !important; }

[data-base="nova"] #financeModal #finBurnVal, 
[data-base="nova"] #financeModal #stmtSumOut,
[data-base="nova"] #financeModal .stmt-amount[style*="ff453a"],
[data-base="nova"] #financeModal span[style*="ff453a"] { color: var(--danger) !important; }

[data-base="nova"] #finProjVal { color: var(--accent) !important; }
[data-base="nova"] .fin-label { color: #666 !important; opacity: 1 !important; }
[data-base="nova"] .fin-big-num { text-shadow: none !important; }

/* 4. SIDEBAR & TABS */
[data-base="nova"] .list-tab { color: #8e8e93 !important; } 
[data-base="nova"] .list-tab.active { color: #1c1c1e !important; background: rgba(0,0,0,0.05) !important; }
[data-base="nova"] .sidebar-acc-title, [data-base="nova"] .sidebar-acc-icon { color: #1c1c1e !important; opacity: 0.7; }
[data-base="nova"] .tool-btn, [data-base="nova"] .tool-btn span, [data-base="nova"] .tool-btn i {
    color: #1c1c1e !important; text-shadow: none !important;
}
[data-base="nova"] .tool-btn:hover { background: rgba(0,0,0,0.05) !important; }

/* 5. ORBIT FIXES (Text & Back Button) */
[data-base="nova"] #btnMobileOrbit {
    color: #333 !important; border: 1px solid rgba(0,0,0,0.15) !important; background: rgba(255,255,255,0.5) !important;
}
[data-base="nova"] .mobile-orbit-back {
    background: #ffffff !important; color: #1c1c1e !important;
    border: 1px solid #d1d1d6 !important; box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

[data-base="nova"] .orbit-sidebar { background-color: #eef2f6 !important; color: #1c1c1e !important; }
[data-base="nova"] .orbit-header { color: #1c1c1e !important; }
[data-base="nova"] .orbit-sub { color: #666 !important; }

/* FIX: Force the "Day X" number to be Blue, not White */
[data-base="nova"] #orbitStats span { color: var(--accent) !important; }

[data-base="nova"] .orbit-dot.past { background: rgba(0,0,0,0.15) !important; }
[data-base="nova"] .orbit-dot.future { background: transparent !important; border: 1px solid rgba(0,0,0,0.1) !important; }
[data-base="nova"] .orbit-dot.today { background: var(--accent) !important; box-shadow: 0 0 15px var(--accent) !important; }

/* 6. DOCK & MENU */
[data-base="nova"] .mobile-view-switcher, [data-base="nova"] .mobile-menu-btn {
    background: #ffffff !important; border: 1px solid #d1d1d6 !important;
    box-shadow: none !important; filter: none !important;
}
[data-base="nova"] .view-btn.active { background: #e5e5ea !important; color: #000 !important; }
[data-base="nova"] .mobile-menu-btn i { color: #1c1c1e !important; }

/* 7. SIDEBAR LAYERING */
[data-base="nova"] .sidebar {
    z-index: 1001 !important; box-shadow: 10px 0 20px rgba(0,0,0,0.03) !important; 
    border-right: 1px solid #e5e5ea !important; background-image: none !important;
    background-color: #f2f2f7 !important;
}

/* Fix Radio Volume Buttons in Nova Mode */
[data-base="nova"] .radio-btn {
    color: #333 !important; /* Dark Grey */
    background: rgba(0,0,0,0.05) !important; /* Light tint background */
}
[data-base="nova"] .radio-btn:hover {
    background: rgba(0,0,0,0.1) !important;
}
/* Keep the Play button as Accent color */
[data-base="nova"] .radio-btn.play {
    color: white !important;
    background: var(--accent) !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
}

/* Fix Chronos Digital Display in Nova */
[data-base="nova"] #hgDisplay {
    color: #333 !important;
    text-shadow: none !important; /* Remove neon glow for readability */
}
/* Ensure labels (MIN/SEC) are visible */
[data-base="nova"] .hg-label {
    color: #666 !important;
}

[data-base="nova"] .hg-input {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #333 !important;
}

/* --- NOVA SETTINGS HOVER FIX --- */
[data-base="nova"] .btn-settings:hover {
    color: #1c1c1e !important; /* Dark text on hover */
    background: rgba(0,0,0,0.05) !important; /* Subtle dark tint instead of glass */
}

/* --- MONO + NOVA (High Contrast Fix) --- */
/* When Light Mode (Nova) AND Mono Theme are active together: */
[data-base="nova"][data-theme="mono"] {
    /* 1. Flip Accent to Dark Grey (Fixes Hourglass, Header Text, Plus Buttons) */
    --accent: #1c1c1e; 
    
    /* 2. Flip Text-on-Accent to White (Fixes Play Button Icon) */
    --text-on-accent: #ffffff;
}

/* Specific Fix for LifeFM Play Button in Mono+Nova */
/* Ensure it has a border so it pops */
[data-base="nova"][data-theme="mono"] .radio-btn.play {
    box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
}

/* --- NOVA FINANCE HUD (Light Mode Clean Up) --- */

/* 1. The Grid Container Lines */
[data-base="nova"] .fin-grid {
    /* Make the gap lines subtle grey instead of harsh dark */
    background: rgba(0,0,0,0.06) !important; 
    border-color: rgba(0,0,0,0.06) !important;
}

/* 2. Inactive Tabs (The Fix) */
[data-base="nova"] .fin-stat-box {
    /* Was Dark Grey -> Now Soft Grey/Translucent */
    background: rgba(0, 0, 0, 0.03) !important; 
    color: #333 !important;
    box-shadow: none !important;
}

/* 3. Hover State */
[data-base="nova"] .fin-stat-box:hover {
    background: rgba(0, 0, 0, 0.06) !important;
}

/* 4. Active Tab (Selected) */
[data-base="nova"] .fin-stat-box.active {
    background: #ffffff !important; /* Pure White */
    color: #000 !important;
    /* Soft shadow to lift it */
    box-shadow: 0 4px 15px rgba(0,0,0,0.08) !important;
    z-index: 5;
}

/* 5. Chart Area Background */
[data-base="nova"] .fin-chart-box {
    /* Remove dark tint, make it barely visible grey */
    background: linear-gradient(180deg, rgba(0,0,0,0.02) 0%, transparent 100%) !important;
}

/* HEALTH HUB BATTERY DISPLAY */
[data-base="nova"] .fa-fire { text-shadow: none !important; }

/* --- DESKTOP HEADER UPGRADE (Liquid Style Aesthetic) --- */
@media (min-width: 1024px) {
    #customTitleBox {
        display: flex !important;
        align-items: baseline !important; /* Align text by baseline for perfect flow */
        gap: 12px !important;
        font-style: normal !important;
        letter-spacing: 0 !important;
    }

    /* MONTH: Slightly larger, still distinct */
    .title-month {
        font-size: 16px !important; /* Sized up +2px */
        font-weight: 800 !important;
        text-transform: uppercase;
        letter-spacing: 2px !important; 
        color: var(--accent) !important;
        opacity: 1;
    }

    /* DIVIDER */
    .title-sep {
        width: 1px;
        height: 16px; /* Shorter to match text size */
        background: var(--lines);
        transform: rotate(15deg);
        opacity: 0.5;
    }

    /* DATE: Smaller to match the flow */
    .title-date {
        font-size: 19px !important; /* Reduced from 28px */
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        color: var(--text-primary) !important;
    }
    
    /* YEAR: Matches Month size */
    .title-year {
        font-size: 16px !important; /* Reduced from 28px */
        font-weight: 300 !important;
        color: var(--text-secondary) !important;
        letter-spacing: 2px !important;
    }
}

    


    @keyframes pulseAlarm {
        0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 69, 58, 0.7); }
        70% { transform: scale(1.1); box-shadow: 0 0 0 30px rgba(255, 69, 58, 0); }
        100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 69, 58, 0); }
    }



    @keyframes floatUp { from { transform: scale(0.9) translateY(20px); } to { transform: scale(1) translateY(0); } }

/* --- AUTH + PRICING + ADMIN UI --- */
.login-page, .pricing-page, .admin-page {
    background: var(--bg-gradient);
    color: #fff;
    font-family: 'Inter', sans-serif;
}

/* Override the global "Solid App Shell" lockdown for login page so it scrolls */
html:has(body.login-page),
body.login-page {
    position: static !important;
    overflow: auto !important;
    overflow-y: auto !important;
    touch-action: manipulation !important;
    overscroll-behavior: auto !important;
    height: auto !important;
    min-height: 100%;
}

.login-container, .pricing-container, .admin-container {
    max-width: 720px;
    margin: 60px auto;
    padding: 24px;
    background: var(--glass-panel);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

/* --- Login Redesign --- */
.login-scene {
    position: relative;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background: radial-gradient(circle at top left, rgba(58, 90, 255, 0.25), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(87, 208, 255, 0.2), transparent 55%),
        radial-gradient(circle at 50% 80%, rgba(128, 140, 255, 0.25), transparent 60%),
        linear-gradient(180deg, #05070f 0%, #050508 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 80px;
}

.login-cursor-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        180px 180px at var(--cursor-x, 50%) var(--cursor-y, 50%),
        rgba(100, 180, 255, 0.15),
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.login-cursor-glow.is-active {
    opacity: 1;
}

.login-particles {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(rgba(255,255,255,0.3) 1px, transparent 0),
        radial-gradient(rgba(255,255,255,0.2) 1px, transparent 0),
        radial-gradient(rgba(255,255,255,0.15) 1px, transparent 0);
    background-size: 131px 131px, 179px 179px, 233px 233px;
    background-position: 0 0, 47px 83px, 120px 37px;
    opacity: 0.28;
    animation: loginFloat 18s linear infinite;
    pointer-events: none;
}

.login-orbs .login-orb {
    position: absolute;
    border-radius: 999px;
    opacity: 0.35;
    filter: blur(80px);
    mix-blend-mode: screen;
    background: radial-gradient(circle, rgba(255,255,255,0.6), rgba(69,137,255,0.15));
    animation: orbPulse 10s ease-in-out infinite;
}

.login-orb.orb-one {
    width: 220px;
    height: 220px;
    top: 12%;
    left: 8%;
}

.login-orb.orb-two {
    width: 320px;
    height: 320px;
    bottom: 12%;
    right: 8%;
    opacity: 0.55;
}

.login-orb.orb-three {
    width: 180px;
    height: 180px;
    bottom: 28%;
    left: 20%;
    opacity: 0.4;
}

.login-orb.orb-four {
    width: 140px;
    height: 140px;
    top: 35%;
    right: 18%;
    opacity: 0.5;
    animation-delay: -6s;
}

.login-aurora {
    position: absolute;
    width: 75%;
    height: 75%;
    background: radial-gradient(circle at top, rgba(75, 140, 255, 0.25), transparent 60%),
        radial-gradient(circle at bottom, rgba(108, 240, 255, 0.18), transparent 55%);
    filter: blur(30px);
    opacity: 0.85;
    animation: loginPulse 12s ease-in-out infinite, auroraShift 20s ease-in-out infinite;
    pointer-events: none;
}

.login-shell {
    position: relative;
    z-index: 2;
    max-width: 980px;
    width: 100%;
    transition: filter 0.2s var(--ease-smooth),
        transform 0.2s var(--ease-smooth),
        opacity 0.2s var(--ease-smooth);
}

.login-shell.is-blurred {
    filter: blur(4px);
    transform: scale(0.99);
    opacity: 0.9;
    pointer-events: none;
}

.login-card {
    background: linear-gradient(135deg, rgba(20, 35, 70, 0.7), rgba(12, 18, 30, 0.92));
    border-radius: 32px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 30px 80px rgba(0,0,0,0.55);
    padding: 40px 36px;
    backdrop-filter: blur(24px);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.1), transparent 40%);
    opacity: 0.5;
    pointer-events: none;
}

.login-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
}

.login-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.login-panel-right {
    border-left: 1px solid rgba(255,255,255,0.08);
    padding-left: 32px;
}

.login-panel form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.login-panel form .login-input {
    align-self: stretch;
}

.login-panel form .login-input + .login-input {
    margin-top: calc(var(--space-xs) * -0.382);
}

.btn-row {
    width: 100%;
    display: flex;
    justify-content: center;
}

.login-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.login-subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
}

.login-subtitle-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.login-subtitle-sep {
    color: #6B7280;
    margin: 0 2px;
}

/* High-specificity trigger to override global button styles */
.login-page .learn-more-trigger {
    /* Reset ALL global button styles */
    all: unset;
    
    /* Match .login-pricing-link exactly */
    display: inline;
    font-size: 13px;
    font-weight: 400;
    color: #6cc8ff;
    cursor: pointer;
    transition: color 0.2s ease;
    
    /* Ensure no button artifacts */
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0;
    border-radius: 0 !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

.login-page .learn-more-trigger::after {
    display: none !important; /* Kill global button shine */
}

.login-page .learn-more-trigger:hover {
    color: #fff;
    text-decoration: underline;
}

.login-page .learn-more-trigger:focus-visible {
    outline: 2px solid rgba(108, 200, 255, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

.btn-google {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    color: #1c1f2a;
    border: none;
    border-radius: 14px;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
}

.google-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4285f4, #34a853);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.login-input {
    width: 100%;
    background: rgba(8, 12, 24, 0.65);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    font-size: 16px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
    outline: none;
    border-color: rgba(108, 200, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(64, 160, 255, 0.2);
}

.login-input::placeholder {
    color: rgba(255,255,255,0.45);
}

.login-page .login-pricing-link {
    all: unset;
    display: inline;
    font-size: 13px;
    font-weight: 400;
    color: #6cc8ff;
    cursor: pointer;
    transition: color 0.2s ease;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

.login-page .login-pricing-link::after {
    display: none !important;
}

.login-page .login-pricing-link:hover {
    color: #fff;
    text-decoration: underline;
}

.login-page .login-pricing-link:focus-visible {
    outline: 2px solid rgba(108, 200, 255, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

.login-footnote {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.01em;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.login-action-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    margin-top: var(--space-xs);
}

body.modal-open {
    overflow: hidden;
}

.pricing-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.2s var(--ease-smooth), visibility 0.2s var(--ease-smooth);
}

.pricing-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pricing-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
}

.pricing-modal-content {
    position: relative;
    z-index: 1;
    width: min(1040px, 92vw);
    max-height: 90vh;
    overflow: auto;
    background: rgba(15, 20, 35, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 28px 32px 32px;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pricing-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.pricing-modal-heading h2 {
    margin: 0;
    font-size: 28px;
}

.pricing-modal-subtitle {
    margin: 6px 0 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.65);
}

.pricing-modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.billing-toggle {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 2px;
}

.billing-toggle-btn {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.billing-toggle-btn.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 14px rgba(10, 132, 255, 0.35);
}

.pricing-modal-close {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pricing-cards-modal {
    gap: 20px;
}

.pricing-modal .pricing-card {
    background: rgba(8, 12, 24, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
}

.pricing-modal .pricing-card.featured {
    border-color: rgba(10, 132, 255, 0.55);
    box-shadow: 0 18px 40px rgba(10, 132, 255, 0.2);
}

.pricing-modal .pricing-card .btn-row {
    margin-top: auto;
}

.pricing-modal .pricing-card h3 {
    margin: 0 0 8px;
}

.pricing-modal .pricing-card .price {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 700;
}

.pricing-modal .pricing-card .price span {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
    margin-left: 4px;
}

.pricing-modal .pricing-card ul {
    margin: 0 0 18px;
    padding-left: 18px;
    color: rgba(255, 255, 255, 0.7);
}

.pricing-modal .pricing-card li {
    margin-bottom: 6px;
}

/* --- Learn More Modal --- */
.learn-more-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden; /* Prevent any scroll */
    z-index: 50; /* Match pricing modal */
    transition: opacity 0.2s var(--ease-smooth), visibility 0.2s var(--ease-smooth);
}

.learn-more-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.learn-more-modal.is-closing {
    transition-duration: 0.15s;
    transition-timing-function: ease-in;
}

.learn-more-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.learn-more-content {
    position: relative;
    z-index: 1;
    width: min(720px, 90vw);
    max-width: 90vw; /* Prevent horizontal overflow */
    max-height: none; /* No scroll on desktop */
    overflow: visible;
    overflow-x: hidden; /* Prevent horizontal scroll */
    background: linear-gradient(135deg, rgba(15, 25, 55, 0.95), rgba(8, 12, 25, 0.98));
    border: 1px solid transparent;
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* Animated gradient border glow */
.learn-more-content::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, rgba(59, 158, 255, 0.4), rgba(139, 92, 246, 0.2), rgba(59, 158, 255, 0.1));
    border-radius: 17px;
    z-index: -1;
    opacity: 0.5;
    animation: learnMoreBorderGlow 3s ease-in-out infinite;
}

@keyframes learnMoreBorderGlow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.learn-more-modal.is-open .learn-more-content {
    opacity: 1;
    transform: scale(1);
}

.learn-more-modal.is-closing .learn-more-content {
    transition-duration: 0.15s;
    transition-timing-function: ease-in;
}

.learn-more-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.learn-more-logo {
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    color: #fff;
}

.learn-more-close {
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: #9CA3AF;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.learn-more-close:hover {
    color: #fff;
}

.learn-more-close:focus-visible {
    outline: 2px solid rgba(108, 200, 255, 0.6);
    outline-offset: 2px;
    border-radius: 6px;
}

.learn-more-headline {
    margin: 0 0 16px !important;
    font-size: 32px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #fff !important;
    text-transform: none !important; /* Override global h3 uppercase */
    letter-spacing: normal !important; /* Override global h3 letter-spacing */
}

.learn-more-subheadline {
    margin: 0 0 40px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: #9CA3AF;
    max-width: 540px;
}

.learn-more-pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.pillar-card {
    position: relative;
    padding: 20px;
    padding-bottom: 36px; /* Space for tap hint */
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
    
    /* Staggered entrance animation */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

/* Gradient glow overlay per pillar */
.pillar-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--pillar-glow, rgba(59, 158, 255, 0.15)), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pillar-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-4px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.12);
}

.pillar-card:hover::before {
    opacity: 1;
}

/* Unique glow color per pillar */
.pillar-card:nth-child(1) { --pillar-glow: rgba(59, 158, 255, 0.25); }   /* Blue - Calendar */
.pillar-card:nth-child(2) { --pillar-glow: rgba(251, 191, 36, 0.25); }  /* Amber - Energy */
.pillar-card:nth-child(3) { --pillar-glow: rgba(34, 197, 94, 0.25); }   /* Green - Finance */
.pillar-card:nth-child(4) { --pillar-glow: rgba(168, 85, 247, 0.25); }  /* Purple - Habits */

/* Staggered entrance animation when modal opens */
.learn-more-modal.is-open .pillar-card {
    animation: pillarReveal 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.learn-more-modal.is-open .pillar-card:nth-child(1) { animation-delay: 0.1s; }
.learn-more-modal.is-open .pillar-card:nth-child(2) { animation-delay: 0.2s; }
.learn-more-modal.is-open .pillar-card:nth-child(3) { animation-delay: 0.3s; }
.learn-more-modal.is-open .pillar-card:nth-child(4) { animation-delay: 0.4s; }

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

.pillar-icon {
    font-size: 32px;
}

.pillar-title {
    margin-top: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.pillar-desc {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: #9CA3AF;
}

/* Tap hint for mobile */
.pillar-tap-hint {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pillar-card:hover .pillar-tap-hint {
    opacity: 1;
}

/* Selected card indicator */
.pillar-card.is-selected {
    border-color: rgba(59, 158, 255, 0.5) !important;
    background: rgba(59, 158, 255, 0.08) !important;
}

.pillar-card.is-selected::before {
    opacity: 1 !important;
}

/* Unified detail panel (desktop) */
.pillar-detail-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.19, 1, 0.22, 1), margin-top 0.4s ease;
    overflow: hidden;
    margin-top: 0;
}

.pillar-detail-panel.is-open {
    grid-template-rows: 1fr;
    margin-top: 20px;
}

.pillar-detail-content {
    min-height: 0;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s, padding 0.3s ease;
}

.pillar-detail-panel.is-open .pillar-detail-content {
    padding: 24px;
    opacity: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
}

.pillar-detail-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}

.pillar-detail-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.7;
}

.pillar-detail-list li {
    margin-bottom: 8px;
}

.pillar-detail-list li:last-child {
    margin-bottom: 0;
}

.learn-more-ctas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
}

.learn-more-btn-secondary,
.learn-more-btn-primary {
    min-width: 180px;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Glass-style secondary button */
.learn-more-btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(59, 158, 255, 0.3);
    color: #3B9EFF;
    backdrop-filter: blur(10px);
}

.learn-more-btn-secondary:hover {
    background: rgba(59, 158, 255, 0.1);
    border-color: rgba(59, 158, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 158, 255, 0.15);
}

/* Gradient primary button with glow */
.learn-more-btn-primary {
    background: linear-gradient(135deg, #3B9EFF 0%, #2563eb 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(59, 158, 255, 0.4);
}

/* Shine overlay */
.learn-more-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.learn-more-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 158, 255, 0.5);
}

.learn-more-btn-primary:hover::after {
    opacity: 1;
}

.learn-more-btn-secondary:focus-visible,
.learn-more-btn-primary:focus-visible {
    outline: 2px solid rgba(108, 200, 255, 0.6);
    outline-offset: 2px;
}

.learn-more-footer {
    margin-top: 24px;
    font-size: 13px;
    color: #6B7280;
    text-align: center;
}

.learn-more-trust {
    margin-top: 12px;
    font-size: 12px;
    color: rgba(34, 197, 94, 0.9);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.trust-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(34, 197, 94, 0.2);
    border-radius: 50%;
    font-size: 10px;
}

.learn-more-view[hidden] {
    display: none;
}

.learn-more-demo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.learn-more-back {
    background: none;
    border: none;
    padding: 0;
    color: #3B9EFF;
    font-size: 13px;
    cursor: pointer;
}

.learn-more-back:hover {
    text-decoration: underline;
}

.learn-more-back:focus-visible {
    outline: 2px solid rgba(108, 200, 255, 0.6);
    outline-offset: 2px;
    border-radius: 6px;
}

.learn-more-demo-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}

.learn-more-demo-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    text-align: center;
}

.learn-more-demo-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 158, 255, 0.15);
    color: #3B9EFF;
    font-size: 22px;
}

.learn-more-demo-note {
    margin-top: 12px;
    font-size: 13px;
    color: #9CA3AF;
    text-align: center;
}

.learn-more-ctas-demo {
    margin-top: 24px;
}

/* Mobile Bottom Sheet */
.pillar-sheet {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .pillar-sheet {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 200; /* Above learn-more modal */
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .pillar-sheet.is-open {
        pointer-events: auto;
        opacity: 1;
    }

    .pillar-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .pillar-sheet.is-open .pillar-sheet-backdrop {
        opacity: 1;
    }

    .pillar-sheet-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, rgba(25, 35, 65, 0.98), rgba(12, 18, 30, 0.99));
        border-radius: 20px 20px 0 0;
        padding: 12px 24px 40px;
        padding-bottom: calc(40px + env(safe-area-inset-bottom));
        transform: translateY(100%);
        transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
        max-height: 60vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    }

    .pillar-sheet.is-open .pillar-sheet-content {
        transform: translateY(0);
    }

    .pillar-sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        margin: 0 auto 20px;
    }

    .pillar-sheet-title {
        font-size: 20px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 16px;
    }

    .pillar-sheet-list {
        margin: 0 0 24px;
        padding-left: 20px;
        color: rgba(255, 255, 255, 0.75);
        font-size: 15px;
        line-height: 1.7;
    }

    .pillar-sheet-list li {
        margin-bottom: 10px;
    }

    .pillar-sheet-list li:last-child {
        margin-bottom: 0;
    }

    .pillar-sheet-dismiss {
        width: 100%;
        padding: 16px;
        background: rgba(59, 158, 255, 0.15);
        border: 1px solid rgba(59, 158, 255, 0.3);
        border-radius: 12px;
        color: #3B9EFF;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .pillar-sheet-dismiss:hover {
        background: rgba(59, 158, 255, 0.25);
        border-color: rgba(59, 158, 255, 0.5);
    }
}

@media (max-width: 768px) {
    .learn-more-content {
        width: 90vw;
        max-height: 85vh;
        padding: 32px;
    }

    .learn-more-headline {
        font-size: 24px !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        color: #fff !important;
    }

    .learn-more-subheadline {
        font-size: 14px !important;
        color: #9CA3AF !important;
        margin-bottom: 32px !important;
    }

    .learn-more-pillars {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .pillar-card {
        padding: 18px;
        padding-bottom: 32px;
    }

    .pillar-icon {
        font-size: 28px;
    }

    .pillar-title {
        font-size: 14px;
    }

    .pillar-desc {
        font-size: 12px;
    }

    .pillar-tap-hint {
        display: flex;
        opacity: 0.5;
    }

    /* Hide desktop panel on tablet/mobile */
    .pillar-detail-panel {
        display: none;
    }

    .learn-more-ctas {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .learn-more-content {
        width: 95vw;
        max-width: 95vw;
        max-height: 90vh;
        overflow-y: auto; /* Enable scroll on mobile */
        overflow-x: hidden; /* Prevent horizontal scroll */
        overscroll-behavior: contain; /* Prevent scroll past bounds */
        -webkit-overflow-scrolling: touch;
        padding: 24px 20px;
    }

    .learn-more-header {
        margin-bottom: 20px;
    }

    /* Ensure headline is visible - override global h3 styles */
    .learn-more-headline {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        font-size: 20px !important;
        line-height: 1.3 !important;
        color: #fff !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        margin: 0 0 12px !important;
    }

    /* Ensure subheadline is visible */
    .learn-more-subheadline {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        font-size: 13px !important;
        color: #9CA3AF !important;
        margin-bottom: 20px !important;
    }

    .learn-more-pillars {
        gap: 10px;
    }

    .pillar-card {
        padding: 14px;
        padding-bottom: 28px;
    }

    .pillar-icon {
        font-size: 24px;
    }

    .pillar-title {
        font-size: 13px;
        margin-top: 10px;
    }

    .pillar-desc {
        font-size: 11px;
        line-height: 1.4;
    }

    .pillar-tap-hint {
        bottom: 6px;
        right: 6px;
        font-size: 9px;
        opacity: 0.6;
    }

    .learn-more-ctas {
        flex-direction: column-reverse;
        width: 100%;
        margin-top: 24px;
    }

    .learn-more-btn-secondary,
    .learn-more-btn-primary {
        width: 100%;
        min-width: unset;
        padding: 14px 20px;
    }

    .learn-more-footer {
        margin-top: 16px;
        font-size: 12px;
    }

    .learn-more-trust {
        font-size: 11px;
    }
}

.pro-badge {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #1a1a1a;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 6px;
}

.pro-badge.admin-badge {
    background: linear-gradient(135deg, #a855f7, #6366f1);
    color: #fff;
}

.sidebar-upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 14px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.8), rgba(36, 99, 235, 0.9));
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(10, 132, 255, 0.25);
}

.sidebar-upgrade-btn:hover {
    filter: brightness(1.05);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.4);
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.12);
}

.login-reflection {
    margin-top: 18px;
    height: 120px;
    background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent);
    border-radius: 32px;
    filter: blur(6px);
    opacity: 0.3;
    transform: scaleY(-1);
}

@keyframes loginPulse {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.85; }
    50% { transform: translateY(12px) scale(1.05); opacity: 0.65; }
}

@keyframes loginFloat {
    0% { background-position: 0 0, 40px 40px; }
    100% { background-position: 160px 200px, 240px 260px; }
}

@keyframes orbPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 0.5; }
}

@keyframes auroraShift {
    0%, 100% { transform: translateX(0) scale(1); }
    50% { transform: translateX(12px) scale(1.02); }
}

@media (max-width: 900px) {
    .login-scene { align-items: flex-start; }
    .login-card { padding: 28px; }
    .login-grid { grid-template-columns: 1fr; }
    .login-panel-right { border-left: none; padding-left: 0; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
}

@media (max-width: 600px) {
    .login-scene { padding: 20px 16px 60px; }
    .login-title { font-size: 26px; }
    .login-card { border-radius: 24px; }
    .login-reflection { display: none; }
    .login-particles { opacity: 0.18; }
    .login-panel { gap: var(--space-sm); }
    .login-title { margin-bottom: 0; }
}

.btn-primary, .btn-secondary {
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.btn-primary { background: #0a84ff; color: #fff; }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; }

.login-page .btn-primary,
.login-page .btn-secondary {
    padding: 14px 24px 15px;
    border-radius: 12px;
    letter-spacing: 0.02em;
    font-weight: 600;
    transition: transform 0.15s var(--ease-smooth),
        box-shadow 0.2s var(--ease-smooth),
        background 0.2s var(--ease-smooth);
    width: fit-content;
    min-width: 220px;
    max-width: 280px;
    margin: 0 auto;
}

.login-page .btn-primary {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.25),
        0 6px 12px rgba(10, 132, 255, 0.22),
        0 14px 24px rgba(10, 132, 255, 0.12);
}

.login-page .btn-secondary {
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.22),
        0 8px 18px rgba(0, 0, 0, 0.25);
}

.login-page .btn-primary:hover,
.login-page .btn-secondary:hover {
    transform: translateY(-1px);
}

.login-page .btn-primary:active,
.login-page .btn-secondary:active {
    transform: translateY(0);
}

@media (max-width: 600px) {
    .login-page .btn-primary,
    .login-page .btn-secondary {
        width: min(260px, 100%);
        max-width: 100%;
    }
}

.pricing-cards { display: flex; gap: 16px; flex-wrap: wrap; }
.pricing-card { flex: 1; min-width: 240px; padding: 16px; border: 1px solid var(--glass-border); border-radius: 12px; }
.pricing-card.featured { border-color: #0a84ff; }

.upgrade-modal {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
}
.upgrade-modal-content {
    background: var(--glass-panel);
    padding: 20px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    max-width: 420px;
    text-align: center;
}

.trial-banner {
    position: fixed;
    top: 140px;
    right: 12px;
    background: rgba(10,132,255,0.9);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    z-index: 9998;
    border: none;
    cursor: pointer;
    font: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trial-banner-text {
    white-space: nowrap;
}

.trial-banner-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 16px;
    line-height: 1;
    opacity: 0.7;
    border-radius: 999px;
}

.trial-banner-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .trial-banner {
        display: none !important;
    }

    #lifeBalanceCard { order: 1; }
    #sidebarUpgradeBtn { order: 2; }
    #tasksListsCard { order: 3; }
    #aiCoreCard { order: 4; }
    #quickAssistCard { order: 5; }
    .sidebar-spacer { order: 20; }
    #utilHeader { order: 21; }
    #utilBody { order: 22; }
    .btn-settings { order: 23; }
}

/* --- ANALYSIS MODAL --- */
body.analysis-modal-open {
    overflow: hidden;
}

.analysis-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 22000;
    background: rgba(5, 5, 12, 0.8);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s var(--ease-smooth);
}

.analysis-modal-overlay.active {
    opacity: 1;
}

.analysis-modal {
    width: min(720px, 92vw);
    max-height: 86vh;
    overflow-y: auto;
    background: var(--glass-panel);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    box-shadow: var(--shadow-deep);
    padding: 18px;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(10px);
    transition: transform 0.25s var(--ease-smooth), opacity 0.25s var(--ease-smooth);
}

.analysis-modal-overlay.active .analysis-modal {
    opacity: 1;
    transform: translateY(0);
}

.analysis-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--lines);
}

.analysis-title {
    font-size: 18px;
    font-weight: 800;
}

.analysis-period {
    font-size: 12px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.analysis-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.analysis-period-buttons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.analysis-period-btn {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.analysis-period-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.18);
}

.analysis-period-btn.active {
    color: #fff;
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.28);
}

.analysis-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.analysis-action-btn {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.analysis-action-btn:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.22);
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.analysis-cache-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 12px;
    margin-left: 8px;
    font-weight: 500;
    vertical-align: middle;
}

.analysis-cache-indicator.saved {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.analysis-cache-indicator.fresh {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.analysis-cache-indicator i {
    font-size: 9px;
}

/* Inline refresh button next to Saved badge */
.analysis-refresh-inline {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    border-radius: 4px;
    opacity: 0.7;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.analysis-refresh-inline:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.analysis-refresh-inline i {
    font-size: 10px;
}

.analysis-refresh-inline i.fa-spin {
    animation: spin 1s linear infinite;
}

.analysis-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.12);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s var(--ease-smooth);
}

.analysis-modal-close:hover {
    background: var(--danger);
    color: #fff;
}

.analysis-gauges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.analysis-gauge-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    --status-color: #8e8e93;
}

.analysis-animate-item {
    opacity: 0;
    transform: translateY(8px);
    animation: analysisFadeUp 0.4s var(--ease-smooth) forwards;
}

.analysis-card-clickable {
    cursor: pointer;
    transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth);
}

.analysis-card-clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.analysis-tooltip {
    position: relative;
}

.analysis-tooltip[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: -10px;
    transform: translate(-50%, -100%);
    background: rgba(15, 15, 15, 0.95);
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 11px;
    max-width: 220px;
    text-align: center;
    white-space: normal;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--shadow-soft);
    z-index: 20;
    pointer-events: none;
}

.gauge-ring {
    width: 86px;
    height: 86px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--status-color) calc(var(--gauge-percent) * 1%), rgba(255,255,255,0.08) 0);
}

.gauge-center {
    width: 66px;
    height: 66px;
    border-radius: 999px;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-value {
    font-size: 16px;
    font-weight: 700;
}

.gauge-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.analysis-section {
    margin-bottom: 18px;
}

.analysis-section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.analysis-trends {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analysis-trend-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    --status-color: #8e8e93;
}

.analysis-trend-label {
    font-size: 13px;
    font-weight: 600;
}

.analysis-trend-summary {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.analysis-sparkline {
    width: 120px;
    height: 36px;
    display: block;
}

.analysis-drilldown .analysis-sparkline {
    width: 240px;
    height: 60px;
}

.analysis-sparkline polyline {
    stroke: var(--status-color);
}

.analysis-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.analysis-stat-card {
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--status-color);
    --status-color: #8e8e93;
}

.analysis-stat-icon {
    font-size: 14px;
    color: var(--status-color);
    margin-bottom: 6px;
}

.analysis-stat-value {
    font-size: 16px;
    font-weight: 700;
}

.analysis-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
    min-height: 28px;
}

.analysis-insights {
    border-top: 1px solid var(--lines);
    padding-top: 12px;
}

.analysis-insights summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.analysis-insights-body {
    margin-top: 8px;
    font-size: 12px;
    color: #d1d1d6;
    line-height: 1.6;
    white-space: pre-wrap;
}

.analysis-insights-body.analysis-loading {
    color: var(--text-secondary);
}

.analysis-loading-spinner {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.analysis-insights-actions {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.analysis-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(59, 130, 246, 0.3));
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analysis-apply-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.5), rgba(59, 130, 246, 0.5));
    border-color: rgba(139, 92, 246, 0.6);
    transform: translateY(-1px);
}

.analysis-apply-btn i {
    font-size: 14px;
}

/* Apply to Schedule Modal */
.apply-schedule-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 120000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.apply-schedule-overlay.active {
    opacity: 1;
}

.apply-schedule-modal {
    width: 90%;
    max-width: 420px;
    background: linear-gradient(145deg, rgba(30, 30, 35, 0.98), rgba(20, 20, 25, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.apply-schedule-overlay.active .apply-schedule-modal {
    transform: scale(1);
}

.apply-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apply-schedule-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.apply-schedule-title i {
    color: #a855f7;
}

.apply-schedule-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-schedule-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.apply-schedule-body {
    padding: 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.apply-schedule-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 16px 0;
}

.apply-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.apply-suggestion-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-suggestion-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.apply-suggestion-item input[type="checkbox"] {
    margin-top: 2px;
    accent-color: #a855f7;
    width: 16px;
    height: 16px;
}

.apply-suggestion-content {
    flex: 1;
}

.apply-suggestion-title {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 4px;
}

.apply-suggestion-desc {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
    line-height: 1.4;
}

.apply-suggestion-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.apply-suggestion-time {
    font-size: 10px;
    color: #666;
}

.apply-suggestion-category {
    font-size: 10px;
    color: #a855f7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apply-schedule-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.apply-schedule-cancel {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-schedule-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.apply-schedule-confirm {
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.apply-schedule-confirm:hover {
    background: linear-gradient(135deg, #9333ea, #7c3aed);
    transform: translateY(-1px);
}

.apply-schedule-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.analysis-loading-spinner::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: analysisSpin 0.8s linear infinite;
}

.analysis-empty {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 0;
}

.analysis-categories {
    display: grid;
    gap: 8px;
}

.analysis-category-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.analysis-category-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.analysis-category-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    margin-top: 6px;
}

.analysis-category-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--status-color);
}

.analysis-category-value {
    font-size: 12px;
    color: var(--text-secondary);
}

.analysis-drilldown-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s var(--ease-smooth);
}

.analysis-drilldown-overlay.active {
    opacity: 1;
}

.analysis-drilldown {
    width: min(520px, 92vw);
    max-height: 80vh;
    overflow-y: auto;
    background: var(--glass-panel);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow-deep);
    padding: 16px;
    color: var(--text-primary);
}

.analysis-drilldown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.analysis-drilldown-title {
    font-size: 16px;
    font-weight: 700;
}

.analysis-drilldown-summary {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.analysis-drilldown-items {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.analysis-drilldown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}

.analysis-drilldown-reco {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

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

.analysis-status-ok {
    --status-color: var(--success);
}

.analysis-status-warning {
    --status-color: var(--warning);
}

.analysis-status-danger {
    --status-color: var(--danger);
}

.analysis-status-neutral {
    --status-color: #8e8e93;
}

@media (max-width: 640px) {
    .analysis-modal {
        padding: 14px;
        width: min(560px, 94vw);
    }

    .analysis-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .analysis-gauges {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analysis-trend-row {
        grid-template-columns: 1fr;
        gap: 6px;
        align-items: flex-start;
    }

    .analysis-trend-summary {
        white-space: normal;
    }

    .analysis-sparkline {
        width: 100%;
    }

    .analysis-drilldown .analysis-sparkline {
        width: 100%;
    }

    .analysis-stats {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Startup Loading Screen */
.startup-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease-out;
}

.startup-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    animation: pulse 1.618s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.618);
        opacity: 1;
    }
}

/* ============================================
   ADMIN COMMAND CENTER
   ============================================ */

/* Admin sidebar button */
.admin-cmd-btn {
    background: linear-gradient(135deg, rgba(59, 158, 255, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%) !important;
    border: 1px solid rgba(59, 158, 255, 0.3) !important;
    color: #3B9EFF !important;
}

.admin-cmd-btn:hover {
    background: linear-gradient(135deg, rgba(59, 158, 255, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%) !important;
    border-color: rgba(59, 158, 255, 0.5) !important;
}

/* Modal Container */
.admin-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.admin-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.admin-modal.is-closing {
    transition-duration: 0.15s;
}

/* Backdrop */
.admin-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

/* Content Panel */
.admin-content {
    position: relative;
    z-index: 1;
    width: min(1100px, 94vw);
    max-height: 90vh;
    background: rgba(18, 18, 20, 0.98);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.96) translateY(10px);
    transition: opacity 0.3s cubic-bezier(0.19, 1, 0.22, 1), 
                transform 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Animated gradient border glow */
.admin-content::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 21px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(59, 158, 255, 0.6), rgba(139, 92, 246, 0.6), rgba(59, 158, 255, 0.6));
    background-size: 200% 200%;
    animation: adminGlow 4s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes adminGlow {
    0%, 100% { background-position: 0% 50%; opacity: 0.6; }
    50% { background-position: 100% 50%; opacity: 1; }
}

.admin-modal.is-open .admin-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Header */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-logo i {
    color: #3B9EFF;
}

.admin-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Tab Navigation */
/* Tab Navigation - Clean Glass Style */
.admin-tabs {
    display: flex;
    gap: 6px;
    padding: 16px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: transparent;
}

.admin-tab {
    padding: 10px 18px;
    border: 1px solid transparent;
    background: transparent;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.admin-tab i {
    font-size: 14px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.admin-tab:hover {
    color: #bbb;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
}

.admin-tab:hover i {
    opacity: 0.9;
}

.admin-tab.active {
    color: #3B9EFF;
    background: rgba(59, 158, 255, 0.08);
    border-color: rgba(59, 158, 255, 0.2);
    box-shadow: 0 0 20px rgba(59, 158, 255, 0.08);
}

.admin-tab.active i {
    color: #3B9EFF;
    opacity: 1;
}

/* Body */
.admin-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
}

/* Filter Chips - Minimal Outline Style */
.admin-filter-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.admin-chip {
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #777;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.admin-chip:hover {
    border-color: rgba(255, 255, 255, 0.15);
    color: #bbb;
    background: rgba(255, 255, 255, 0.02);
}

.admin-chip.active {
    background: rgba(59, 158, 255, 0.08);
    border-color: rgba(59, 158, 255, 0.25);
    color: #3B9EFF;
    box-shadow: 0 0 16px rgba(59, 158, 255, 0.06);
}

/* Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.admin-stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.3s ease;
    animation: statReveal 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}

.admin-stat-card:nth-child(1) { animation-delay: 0.05s; }
.admin-stat-card:nth-child(2) { animation-delay: 0.1s; }
.admin-stat-card:nth-child(3) { animation-delay: 0.15s; }
.admin-stat-card:nth-child(4) { animation-delay: 0.2s; }
.admin-stat-card:nth-child(5) { animation-delay: 0.25s; }
.admin-stat-card:nth-child(6) { animation-delay: 0.3s; }
.admin-stat-card:nth-child(7) { animation-delay: 0.35s; }
.admin-stat-card:nth-child(8) { animation-delay: 0.4s; }

@keyframes statReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admin-stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.admin-stat-card.accent {
    background: rgba(59, 158, 255, 0.08);
    border-color: rgba(59, 158, 255, 0.2);
}

.admin-stat-card.accent .stat-icon {
    color: #FFD700;
}

.admin-stat-card.warning {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

.admin-stat-card.warning .stat-icon {
    color: #ef4444;
}

.stat-icon {
    font-size: 16px;
    color: #3B9EFF;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Charts Section */
.admin-charts {
    display: grid;
    grid-template-columns: 1fr 1fr 200px;
    gap: 20px;
}

.admin-chart-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 18px;
    animation: statReveal 0.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: 0.45s;
    opacity: 0;
    transform: translateY(10px);
}

.admin-chart-card.small {
    animation-delay: 0.5s;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.chart-subtitle {
    font-size: 12px;
    color: #666;
}

.chart-container {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chart-inner {
    height: 120px;
}

.chart-inner svg {
    width: 100%;
    height: 100%;
}

.chart-container svg {
    display: block;
}

.chart-line {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-area {
    opacity: 0.3;
}

.chart-dot {
    transition: r 0.2s ease;
}

.chart-dot:hover {
    r: 5;
}

.chart-legend {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px 0;
    font-size: 11px;
    font-weight: 500;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 8px;
}

.chart-legend span {
    display: inline-block;
}

.chart-legend .chart-label {
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
}

.chart-legend .chart-max,
.chart-legend .chart-min {
    color: #3B9EFF;
    font-weight: 600;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 100%;
    padding-bottom: 4px;
}

.bar-item {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.bar-item .bar {
    width: 100%;
    background: linear-gradient(to top, rgba(59, 158, 255, 0.3), rgba(59, 158, 255, 0.8));
    border-radius: 3px 3px 0 0;
    transition: height 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    animation: barGrow 0.6s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    animation-delay: var(--delay, 0ms);
    transform-origin: bottom;
    transform: scaleY(0);
}

@keyframes barGrow {
    to { transform: scaleY(1); }
}

/* Donut Chart */
.chart-container.donut {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.donut-chart {
    position: relative;
    width: 100px;
    height: 100px;
}

.donut-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #3B9EFF 0deg,
        #3B9EFF calc(var(--percentage, 0) * 3.6deg),
        rgba(255, 255, 255, 0.1) calc(var(--percentage, 0) * 3.6deg),
        rgba(255, 255, 255, 0.1) 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #fff calc(100% - 11px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 12px), #fff calc(100% - 11px));
    animation: donutFill 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

@keyframes donutFill {
    from { transform: rotate(-90deg); }
    to { transform: rotate(-90deg); }
}

.donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.donut-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.donut-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

.donut-legend {
    margin-top: 12px;
    font-size: 11px;
    color: #888;
}

/* === USERS TAB === */

.admin-users-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 300px;
}

.admin-search-box i {
    color: #666;
    font-size: 14px;
}

.admin-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.admin-search-box input::placeholder {
    color: #555;
}

.admin-user-count {
    font-size: 14px;
    color: #888;
}

.admin-user-count span {
    color: #fff;
    font-weight: 600;
}

/* Users Table */
.admin-users-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-users-table th {
    text-align: left;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-select-col {
    width: 36px;
}

.admin-select {
    width: 16px;
    height: 16px;
    accent-color: #3B9EFF;
}

.admin-users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #ccc;
}

.admin-users-table tr:last-child td {
    border-bottom: none;
}

.admin-users-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Batch Action Bar - Floating Style */
.admin-batch-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    margin-top: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.admin-batch-bar.active {
    display: flex;
    animation: batchBarReveal 0.3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

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

.batch-count {
    font-size: 13px;
    font-weight: 500;
    color: #bbb;
}

.batch-count span {
    color: #3B9EFF;
    font-weight: 600;
}

.batch-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* === AUDIT TAB === */

.admin-audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-audit-filter {
    width: 260px;
}

.admin-audit-filter select {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 14px;
    outline: none;
    appearance: none;
}

.admin-audit-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-audit-table th {
    text-align: left;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-audit-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #ccc;
    vertical-align: top;
}

.admin-audit-table tr:last-child td {
    border-bottom: none;
}

.admin-audit-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.audit-action {
    color: #3B9EFF;
    font-weight: 600;
}

.audit-details {
    color: #9CA3AF;
    max-width: 360px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === HEALTH TAB === */

.admin-health-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.admin-health-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.health-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}

.health-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.chart-empty {
    font-size: 12px;
    color: #666;
    text-align: center;
    padding: 16px 0;
}

/* === COHORTS TAB === */

.admin-cohort-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-cohort-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.admin-cohort-controls {
    display: flex;
    gap: 8px;
}

.admin-cohort-heatmap {
    margin-top: 16px;
    overflow-x: auto;
}

.cohort-table {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cohort-row {
    display: flex;
    gap: 6px;
}

.cohort-cell {
    flex: 1;
    min-width: 52px;
    padding: 8px 6px;
    border-radius: 6px;
    font-size: 11px;
    text-align: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

.cohort-label {
    flex: 0 0 120px;
    text-align: left;
    color: #ccc;
    background: rgba(255, 255, 255, 0.02);
}

.cohort-header .cohort-cell {
    background: transparent;
    color: #888;
    font-size: 10px;
    text-transform: uppercase;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B9EFF, #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    color: #fff;
}

.user-email {
    font-size: 12px;
    color: #666;
}

.tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.tier-badge.tier-free {
    background: rgba(255, 255, 255, 0.08);
    color: #888;
}

.tier-badge.tier-trial {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.tier-badge.tier-pro {
    background: rgba(59, 158, 255, 0.15);
    color: #3B9EFF;
}

.tier-badge.tier-grandfathered {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    margin-left: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.status-badge.blocked {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.date-cell {
    color: #666;
    font-size: 12px;
}

/* User Action Buttons - Clean Icon Style */
.user-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    color: #777;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: translateY(-1px);
}

.action-btn.block:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    color: #ef4444;
}

.action-btn.unblock:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.25);
    color: #22c55e;
}

/* Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}

.admin-page-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    border-radius: 8px;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.admin-page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.admin-page-info {
    font-size: 13px;
    color: #666;
}

.admin-page-info span {
    color: #fff;
    font-weight: 500;
}

/* === PRICING TAB === */

.admin-pricing-form {
    max-width: 600px;
}

.admin-pricing-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.admin-pricing-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: #888;
}

.admin-pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.pricing-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-field label {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-input-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color 0.2s ease;
}

.pricing-input-wrap:focus-within {
    border-color: rgba(59, 158, 255, 0.5);
}

.pricing-currency,
.pricing-suffix {
    font-size: 14px;
    color: #666;
}

.pricing-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 8px;
    outline: none;
    width: 100%;
}

.pricing-input-wrap input::-webkit-outer-spin-button,
.pricing-input-wrap input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.admin-features-title {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.admin-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.feature-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feature-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.feature-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #3B9EFF;
}

.toggle-label {
    font-size: 14px;
    color: #ccc;
}

.admin-pricing-actions {
    display: flex;
    gap: 12px;
}

/* Admin Buttons - Clean Glass Style */
.admin-btn-secondary,
.admin-btn-primary {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.admin-btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #999;
    backdrop-filter: blur(10px);
}

.admin-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
}

.admin-btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-btn-primary {
    background: rgba(59, 158, 255, 0.12);
    border: 1px solid rgba(59, 158, 255, 0.3);
    color: #3B9EFF;
    backdrop-filter: blur(10px);
}

.admin-btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(59, 158, 255, 0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-btn-primary:hover {
    background: rgba(59, 158, 255, 0.18);
    border-color: rgba(59, 158, 255, 0.45);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 158, 255, 0.15);
}

.admin-btn-primary:hover::after {
    opacity: 1;
}

.admin-btn-primary.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.admin-btn-primary.success:hover {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
}

/* === RESPONSIVE === */

@media (max-width: 900px) {
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-charts {
        grid-template-columns: 1fr;
    }
    
    .admin-chart-card.small {
        max-width: 300px;
    }
    
    .admin-pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-features-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-content {
        width: 100%;
        height: 85vh;
        max-height: 85vh;
        border-radius: 0;
    }
    
    .admin-content::before {
        display: none;
    }
    
    .admin-header {
        padding: calc(16px + env(safe-area-inset-top)) 20px 16px;
    }
    
    .admin-tabs {
        padding: 10px 16px;
        overflow-x: auto;
    }
    
    .admin-tab {
        padding: 8px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .admin-body {
        padding: 20px 16px;
    }
    
    .admin-filter-chips {
        flex-wrap: wrap;
    }
    
    .admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .admin-stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    .admin-search-box {
        width: 100%;
    }
    
    .admin-users-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .admin-audit-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .admin-audit-filter {
        width: 100%;
    }

    .admin-health-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-cohort-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-cohort-controls {
        flex-wrap: wrap;
    }
    
    .admin-user-count {
        text-align: right;
    }

    .admin-batch-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .batch-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-pricing-actions {
        flex-direction: column;
    }
    
    .admin-btn-secondary,
    .admin-btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   ADMIN SECURITY TAB
   ============================================ */

/* Security Stats Grid */
.security-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.security-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s ease;
}

.security-stat-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.security-stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 18px;
    flex-shrink: 0;
}

.security-stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.security-stat-value {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    line-height: 1.1;
}

.security-stat-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Security Events Section */
.security-events-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 24px;
    overflow: hidden;
}

.security-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.security-events-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.security-events-header h3 i {
    color: #3b82f6;
}

.security-events-filters {
    display: flex;
    gap: 8px;
}

.security-events-filters select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ccc;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.security-events-filters select:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.security-events-filters select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
}

.security-events-table-wrap {
    max-height: 280px;
    overflow-y: auto;
}

.security-events-table {
    width: 100%;
    border-collapse: collapse;
}

.security-events-table th,
.security-events-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.security-events-table th {
    background: rgba(0, 0, 0, 0.2);
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    position: sticky;
    top: 0;
}

.security-events-table td {
    color: #ccc;
}

.security-events-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.severity-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.monospace {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
}

.event-details {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #888;
}

.security-events-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #666;
}

.security-events-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    color: #22c55e;
}

.security-events-empty p {
    margin: 0;
    font-size: 13px;
}

/* Security Bottom Grid */
.security-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.security-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
}

.security-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.security-panel-header h3 {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.security-panel-header h3 i {
    color: #a855f7;
}

.security-panel-header h3 i.fa-ban {
    color: #ef4444;
}

.security-panel-body {
    padding: 16px;
    max-height: 250px;
    overflow-y: auto;
}

.security-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    color: #666;
}

.security-panel-empty i {
    font-size: 28px;
    margin-bottom: 10px;
    color: #22c55e;
}

.security-panel-empty p {
    margin: 0;
    font-size: 12px;
}

/* Suspicious Device Cards */
.suspicious-device-card {
    background: rgba(168, 85, 247, 0.08);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 12px;
}

.suspicious-device-card:last-child {
    margin-bottom: 0;
}

.device-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.device-fingerprint {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #a855f7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.device-count {
    font-size: 11px;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.device-users {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.device-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.device-user-email {
    color: #ccc;
}

.device-user-date {
    color: #666;
}

/* Blocked IP Cards */
.blocked-ip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.blocked-ip-card:last-child {
    margin-bottom: 0;
}

.blocked-ip-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blocked-ip-address {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #ef4444;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blocked-ip-reason {
    font-size: 11px;
    color: #888;
}

.blocked-ip-expiry {
    font-size: 10px;
    color: #666;
}

/* Block IP Form */
.block-ip-form {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.block-ip-form input,
.block-ip-form select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    padding: 10px 14px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.block-ip-form input::placeholder {
    color: #666;
}

.block-ip-form input:focus,
.block-ip-form select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.block-ip-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.block-ip-actions button {
    flex: 1;
}

.admin-btn-sm {
    padding: 6px 12px !important;
    font-size: 11px !important;
}

/* Security Tab Mobile Responsiveness */
@media (max-width: 900px) {
    .security-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .security-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .security-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .security-stat-card {
        padding: 12px;
        gap: 10px;
    }
    
    .security-stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .security-stat-value {
        font-size: 18px;
    }
    
    .security-events-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .security-events-filters {
        width: 100%;
    }
    
    .security-events-filters select {
        flex: 1;
    }
    
    .security-events-table th,
    .security-events-table td {
        padding: 10px 12px;
    }
    
    .event-details {
        max-width: 100px;
    }
}
