﻿/* GrowthHub 2025 - Complete Styles */

/* ─── Animations ─── */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}


        /* ═══════════════════════════════════════════════════════════════
           GROWTHHUB 2025 PREMIUM SAAS DESIGN SYSTEM
           Inspired by: Notion, Linear, Sunsama, Motion, Superhuman
           ═══════════════════════════════════════════════════════════════ */
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* ─── CSS Variables / Design Tokens ─── */
        :root {
            /* Primary Palette - Deep Indigo/Purple */
            --primary: #6366f1;
            --primary-hover: #4f46e5;
            --primary-light: rgba(99, 102, 241, 0.1);
            --primary-glow: rgba(99, 102, 241, 0.4);
            
            /* Secondary */
            --secondary: #8b5cf6;
            --accent: #06b6d4;
            
            /* Semantic Colors */
            --success: #10b981;
            --success-light: rgba(16, 185, 129, 0.1);
            --danger: #ef4444;
            --danger-light: rgba(239, 68, 68, 0.1);
            --warning: #f59e0b;
            --warning-light: rgba(245, 158, 11, 0.1);
            
            /* Light Mode Neutrals */
            --bg-primary: #fafbfc;
            --bg-secondary: #ffffff;
            --bg-tertiary: #f8fafc;
            --bg-elevated: #ffffff;
            
            --text-primary: #0f172a;
            --text-secondary: #64748b;
            --text-tertiary: #94a3b8;
            --text-inverse: #ffffff;
            
            --border-default: #e2e8f0;
            --border-subtle: #f1f5f9;
            --border-strong: #cbd5e1;
            
            /* Glassmorphism */
            --glass-bg: rgba(255, 255, 255, 0.8);
            --glass-border: rgba(255, 255, 255, 0.2);
            --glass-blur: 20px;
            
            /* Shadows - Subtle elevation */
            --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.04);
            --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
            --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.06);
            --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
            
            /* Spacing System (8px base) */
            --space-1: 4px;
            --space-2: 8px;
            --space-3: 12px;
            --space-4: 16px;
            --space-5: 20px;
            --space-6: 24px;
            --space-8: 32px;
            --space-10: 40px;
            --space-12: 48px;
            
            /* Border Radius */
            --radius-sm: 6px;
            --radius-md: 10px;
            --radius-lg: 16px;
            --radius-xl: 24px;
            --radius-full: 9999px;
            
            /* Transitions */
            --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
            --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
            --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
            --transition-spring: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
            
            /* Emergency */
            --emergency: #dc2626;
            --emergency-light: rgba(220, 38, 38, 0.1);
        }

        /* ─── Dark Mode Variables ─── */
        body.dark-mode {
            --bg-primary: #0c0f17;
            --bg-secondary: #111827;
            --bg-tertiary: #1e293b;
            --bg-elevated: #1e293b;
            
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --text-tertiary: #64748b;
            
            --border-default: #334155;
            --border-subtle: #1e293b;
            --border-strong: #475569;
            
            --glass-bg: rgba(17, 24, 39, 0.85);
            --glass-border: rgba(255, 255, 255, 0.08);
            
            --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
            --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
            --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
            --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.5);
            --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.2);
            
            --primary-light: rgba(99, 102, 241, 0.15);
            --success-light: rgba(16, 185, 129, 0.15);
            --danger-light: rgba(239, 68, 68, 0.15);
        }

        /* Hub overlay mode: hide global chrome that overlaps the full-screen Hub */
        body.hub-mode #topBar,
        body.hub-mode .top-bar-toggle,
        body.hub-mode #navToggleBtn,
        body.hub-mode #floatingNav,
        body.hub-mode #quickLinksToggleBtn,
        body.hub-mode #quickLinks {
            display: none !important;
        }

        /* Settings: Animations OFF */
        body.no-animations *,
        body.no-animations *::before,
        body.no-animations *::after {
            animation: none !important;
            transition: none !important;
        }

        body.no-animations {
            scroll-behavior: auto;
        }

        /* Custom Scrollbar - 2025 Minimal */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }

        ::-webkit-scrollbar-track {
            background: transparent;
        }

        ::-webkit-scrollbar-thumb {
            background: var(--border-default);
            border-radius: var(--radius-full);
        }

        ::-webkit-scrollbar-thumb:hover {
            background: var(--text-tertiary);
        }

        body.dark-mode ::-webkit-scrollbar-thumb {
            background: var(--border-default);
        }

        body.dark-mode ::-webkit-scrollbar-thumb:hover {
            background: var(--border-strong);
        }

        /* Firefox Scrollbar */
        * {
            scrollbar-width: thin;
            scrollbar-color: var(--border-default) transparent;
        }

        /* Text Selection - Premium accent */
        ::selection {
            background: var(--primary);
            color: white;
        }

        ::-moz-selection {
            background: var(--primary);
            color: white;
        }

        /* Quick Links Toggle Button - Premium Purple Glow */
        .quick-links-toggle-btn {
            position: fixed;
            left: 20px;
            top: 50%;
            transform: translateY(-50%);
            width: 52px;
            height: 52px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid rgba(139, 92, 246, 0.6);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 1000;
            transition: all var(--transition-base);
            box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 0 50px rgba(139, 92, 246, 0.15), inset 0 0 20px rgba(139, 92, 246, 0.08);
            animation: panelGlow 2s ease-in-out infinite;
        }

        body.dark-mode .quick-links-toggle-btn {
            background: rgba(15, 23, 42, 0.95);
            box-shadow: 0 0 25px rgba(139, 92, 246, 0.5), 0 0 50px rgba(139, 92, 246, 0.2), inset 0 0 20px rgba(139, 92, 246, 0.1);
        }

        @keyframes panelGlow {
            0%, 100% { 
                box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 0 50px rgba(139, 92, 246, 0.15), inset 0 0 20px rgba(139, 92, 246, 0.08);
                border-color: rgba(139, 92, 246, 0.6);
            }
            50% { 
                box-shadow: 0 0 35px rgba(139, 92, 246, 0.6), 0 0 70px rgba(139, 92, 246, 0.3), inset 0 0 25px rgba(139, 92, 246, 0.12);
                border-color: rgba(167, 139, 250, 0.9);
            }
        }

        body.dark-mode .quick-links-toggle-btn {
            animation: panelGlowDark 2s ease-in-out infinite;
        }

        @keyframes panelGlowDark {
            0%, 100% { 
                box-shadow: 0 0 25px rgba(139, 92, 246, 0.5), 0 0 50px rgba(139, 92, 246, 0.2), inset 0 0 20px rgba(139, 92, 246, 0.1);
                border-color: rgba(139, 92, 246, 0.6);
            }
            50% { 
                box-shadow: 0 0 35px rgba(139, 92, 246, 0.7), 0 0 70px rgba(139, 92, 246, 0.35), inset 0 0 25px rgba(139, 92, 246, 0.15);
                border-color: rgba(167, 139, 250, 0.9);
            }
        }

        .quick-links-toggle-btn svg {
            width: 22px;
            height: 22px;
            stroke: #8b5cf6;
            stroke-width: 2.5;
            fill: none;
            transition: all 0.3s ease;
            filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7));
            animation: arrowGlow 2s ease-in-out infinite;
        }

        body.dark-mode .quick-links-toggle-btn svg {
            stroke: #a78bfa;
            filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.9));
        }

        @keyframes arrowGlow {
            0%, 100% { 
                filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7));
                stroke: #8b5cf6;
            }
            50% { 
                filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.9));
                stroke: #7c3aed;
            }
        }

        body.dark-mode .quick-links-toggle-btn svg {
            animation: arrowGlowDark 2s ease-in-out infinite;
        }

        @keyframes arrowGlowDark {
            0%, 100% { 
                filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.9));
                stroke: #a78bfa;
            }
            50% { 
                filter: drop-shadow(0 0 15px rgba(196, 181, 253, 1));
                stroke: #c4b5fd;
            }
        }

        .quick-links-toggle-btn:hover {
            transform: translateY(-50%) scale(1.08);
            box-shadow: 0 0 45px rgba(139, 92, 246, 0.7), 0 0 80px rgba(139, 92, 246, 0.35);
        }

        .quick-links-toggle-btn:hover svg {
            stroke: #7c3aed;
            filter: drop-shadow(0 0 15px rgba(124, 58, 237, 1));
        }

        body.dark-mode .quick-links-toggle-btn:hover svg {
            stroke: #c4b5fd;
            filter: drop-shadow(0 0 18px rgba(196, 181, 253, 1));
        }

        @media (max-width: 768px) {
            .quick-links-toggle-btn {
                display: none;
                left: 10px;
                top: 52%;
                bottom: auto;
                transform: translateY(-50%);
                width: 40px;
                height: 40px;
                border-radius: 50%;
                opacity: 1;
                animation: none;
                background: rgba(255, 255, 255, 0.85);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                border: 1px solid rgba(139, 92, 246, 0.25);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.1);
                z-index: 10001;
            }

            body.dark-mode .quick-links-toggle-btn {
                background: rgba(30, 41, 59, 0.85);
                border-color: rgba(139, 92, 246, 0.3);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
            }

            .quick-links-toggle-btn svg {
                width: 16px;
                height: 16px;
                animation: none;
                filter: none;
                stroke: #8b5cf6;
                opacity: 0.8;
            }

            /* Quick Links Panel - Premium Side Drawer */
            .quick-links {
                display: flex !important;
                flex-direction: column;
                flex-wrap: nowrap;
                position: fixed;
                left: 8px;
                right: auto;
                top: 52%;
                bottom: auto;
                transform: translate(-120%, -50%);
                gap: 8px;
                padding: 10px 8px;
                max-height: 62vh;
                max-width: 68px;
                width: 68px;
                background: rgba(255, 255, 255, 0.92);
                backdrop-filter: blur(18px);
                -webkit-backdrop-filter: blur(18px);
                border-radius: 16px;
                border: 1px solid rgba(139, 92, 246, 0.16);
                box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
                z-index: 10000;
                justify-content: flex-start;
                align-items: center;
                transition: transform 0.32s cubic-bezier(0.2, 0.85, 0.35, 1), opacity 0.22s ease;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            body.dark-mode .quick-links {
                background: rgba(15, 23, 42, 0.88);
                border-color: rgba(139, 92, 246, 0.22);
                box-shadow: 0 10px 30px rgba(2, 6, 23, 0.45), 0 1px 0 rgba(148, 163, 184, 0.14) inset;
            }

            .quick-links::before {
                content: none;
            }

            .quick-links.hidden {
                transform: translate(-135%, -50%);
                opacity: 0;
                pointer-events: none;
                left: 8px;
            }

            .quick-links:not(.hidden) {
                transform: translate(0, -50%);
                opacity: 1;
                left: 8px;
            }

            .quick-link {
                width: 44px;
                height: 44px;
                font-size: 1.2rem;
                flex-shrink: 0;
                border-radius: 12px;
                border: 1px solid rgba(139, 92, 246, 0.12);
                box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
            }

            body.dark-mode .quick-link {
                border-color: rgba(139, 92, 246, 0.15);
            }

            .add-link-btn {
                width: 44px !important;
                height: 44px !important;
                font-size: 1.2rem;
                padding: 0 !important;
                flex-shrink: 0;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 12px;
            }

            .add-link-btn span {
                font-size: 1.4rem !important;
                width: 100%;
                height: 100%;
                display: flex;
                align-items: center;
                justify-content: center;
            }
        }

        #quickLinksToggleIcon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #quickLinksToggleIcon svg {
            width: 20px;
            height: 20px;
            stroke: var(--primary);
            stroke-width: 2;
            fill: none;
            transition: transform var(--transition-base);
        }

        body.dark-mode #quickLinksToggleIcon svg {
            stroke: var(--primary-light);
        }

        body.quick-links-hidden #quickLinksToggleIcon svg {
            transform: rotate(180deg);
        }

        /* Quick Links Float */
        .quick-links {
            position: fixed;
            left: 70px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            gap: 12px;
            z-index: 999;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .quick-links.hidden {
            left: -100px;
            opacity: 0;
            pointer-events: none;
        }

        .quick-link {
            width: 46px;
            height: 46px;
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-primary);
            box-shadow: var(--shadow-md);
            cursor: pointer;
            transition: all var(--transition-base);
            text-decoration: none;
            font-size: 1.4rem;
            border: 1px solid var(--border-subtle);
            color: var(--primary);
        }

        .quick-link:hover {
            transform: scale(1.08);
            box-shadow: var(--shadow-lg);
            border-color: var(--primary);
        }

        body.dark-mode .quick-link {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }

        body.dark-mode .quick-link:hover {
            border-color: var(--primary-light);
        }

        /* Individual icon colors - subtle accents */
        .quick-link-chatgpt {
            background: var(--bg-primary);
        }

        .quick-link-youtube {
            background: var(--bg-primary);
        }

        .quick-link-gmail {
            background: var(--bg-primary);
        }

        .quick-link-telegram {
            background: var(--bg-primary);
        }

        .quick-link-claude {
            background: var(--bg-primary);
        }

        .quick-link-unistudy {
            background: var(--bg-primary);
        }

        body.dark-mode .quick-link-chatgpt,
        body.dark-mode .quick-link-youtube,
        body.dark-mode .quick-link-gmail,
        body.dark-mode .quick-link-telegram,
        body.dark-mode .quick-link-claude,
        body.dark-mode .quick-link-unistudy {
            background: var(--bg-secondary);
        }

        .quick-link svg {
            width: 22px;
            height: 22px;
            transition: transform var(--transition-fast);
        }

        .quick-link:hover svg {
            transform: scale(1.1);
        }

        .add-link-btn {
            background: var(--primary) !important;
            color: white !important;
            font-weight: 600;
            box-shadow: var(--shadow-md), var(--shadow-glow) !important;
            border: none !important;
            position: relative;
            overflow: hidden;
            width: 46px !important;
            height: 46px !important;
            padding: 0 !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            border-radius: var(--radius-lg) !important;
        }

        .add-link-btn:hover {
            background: var(--primary-hover) !important;
            transform: scale(1.08);
        }

        .add-link-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
            transition: left 0.5s ease;
        }

        .add-link-btn:hover::before {
            left: 100%;
        }

        .add-link-btn span {
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 1;
        }

        /* Dark mode quick link icon colors */
        body.dark-mode .quick-link-chatgpt {
            color: #10a37f;
        }

        body.dark-mode .quick-link-youtube {
            color: #f87171;
        }

        body.dark-mode .quick-link-gmail {
            color: #f87171;
        }

        body.dark-mode .quick-link-telegram {
            color: #22d3ee;
        }

        body.dark-mode .quick-link-claude {
            color: #D97757;
        }

        body.dark-mode .quick-link-unistudy {
            color: var(--primary-light);
        }

        /* Right Navigation Toggle Button - Premium Purple Glow (Identical to Left) */
        .nav-toggle-btn {
            position: fixed;
            right: 20px;
            top: 18px;
            transform: none;
            width: 52px;
            height: 52px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid rgba(139, 92, 246, 0.6);
            border-radius: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 1000;
            transition: all var(--transition-base);
            box-shadow: 0 0 25px rgba(139, 92, 246, 0.4), 0 0 50px rgba(139, 92, 246, 0.15), inset 0 0 20px rgba(139, 92, 246, 0.08);
            animation: panelGlow 2s ease-in-out infinite;
        }

        body.dark-mode .nav-toggle-btn {
            background: rgba(15, 23, 42, 0.95);
            box-shadow: 0 0 25px rgba(139, 92, 246, 0.5), 0 0 50px rgba(139, 92, 246, 0.2), inset 0 0 20px rgba(139, 92, 246, 0.1);
            animation: panelGlowDark 2s ease-in-out infinite;
        }

        .nav-toggle-btn svg {
            width: 22px;
            height: 22px;
            stroke: #8b5cf6;
            stroke-width: 2.5;
            fill: none;
            transition: all 0.3s ease;
            filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.7));
            animation: arrowGlow 2s ease-in-out infinite;
        }

        body.dark-mode .nav-toggle-btn svg {
            stroke: #a78bfa;
            filter: drop-shadow(0 0 8px rgba(167, 139, 250, 0.9));
            animation: arrowGlowDark 2s ease-in-out infinite;
        }

        .nav-toggle-btn:hover {
            transform: translateY(-50%) scale(1.08);
            box-shadow: 0 0 45px rgba(139, 92, 246, 0.7), 0 0 80px rgba(139, 92, 246, 0.35);
        }

        .nav-toggle-btn:hover svg {
            stroke: #7c3aed;
            filter: drop-shadow(0 0 15px rgba(124, 58, 237, 1));
        }

        body.dark-mode .nav-toggle-btn:hover svg {
            stroke: #c4b5fd;
            filter: drop-shadow(0 0 18px rgba(196, 181, 253, 1));
        }

        @media (max-width: 768px) {
            .nav-toggle-btn {
                display: none;
                right: 10px;
                top: 12px;
                bottom: auto;
                transform: none;
                width: 40px;
                height: 40px;
                border-radius: 50%;
                opacity: 1;
                animation: none;
                background: rgba(255, 255, 255, 0.85);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                border: 1px solid rgba(139, 92, 246, 0.25);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.1);
                z-index: 10001;
            }

            body.dark-mode .nav-toggle-btn {
                background: rgba(30, 41, 59, 0.85);
                border-color: rgba(139, 92, 246, 0.3);
                box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.05);
            }

            .nav-toggle-btn svg {
                width: 16px;
                height: 16px;
                animation: none;
                filter: none;
                stroke: #8b5cf6;
                opacity: 0.8;
            }

            /* Floating Nav Panel - Premium Side Drawer */
            .floating-nav {
                display: flex !important;
                flex-direction: column;
                flex-wrap: nowrap;
                position: fixed;
                right: 8px;
                left: auto;
                top: 52%;
                bottom: auto;
                transform: translate(120%, -50%);
                gap: 8px;
                padding: 10px;
                width: min(170px, calc(100vw - 56px));
                max-height: 62vh;
                background: rgba(255, 255, 255, 0.92);
                backdrop-filter: blur(18px);
                -webkit-backdrop-filter: blur(18px);
                border-radius: 16px;
                border: 1px solid rgba(139, 92, 246, 0.16);
                box-shadow: 0 12px 28px rgba(15, 23, 42, 0.15), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
                z-index: 10000;
                justify-content: flex-start;
                align-items: stretch;
                transition: transform 0.32s cubic-bezier(0.2, 0.85, 0.35, 1), opacity 0.22s ease;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            body.dark-mode .floating-nav {
                background: rgba(15, 23, 42, 0.88);
                border-color: rgba(139, 92, 246, 0.22);
                box-shadow: 0 12px 30px rgba(2, 6, 23, 0.48), 0 1px 0 rgba(148, 163, 184, 0.14) inset;
            }

            .floating-nav::before {
                content: none;
            }

            .floating-nav.hidden {
                transform: translate(135%, -50%);
                opacity: 0;
                pointer-events: none;
                right: 8px;
            }

            .floating-nav:not(.hidden) {
                transform: translate(0, -50%);
                opacity: 1;
                right: 8px;
            }

            .nav-chip {
                padding: 9px 11px;
                font-size: 0.8rem;
                white-space: nowrap;
                border-radius: 11px;
                box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
            }
        }

        #navToggleIcon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #navToggleIcon svg {
            width: 20px;
            height: 20px;
            stroke: var(--primary);
            stroke-width: 2;
            fill: none;
            transition: transform var(--transition-base);
        }

        body.dark-mode #navToggleIcon svg {
            stroke: var(--primary-light);
        }

        body.nav-hidden #navToggleIcon svg {
            transform: scaleX(-1);
        }

        /* Floating Navigation */
        .floating-nav {
            position: fixed;
            right: 70px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            gap: var(--space-3);
            z-index: 100;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .floating-nav.hidden {
            right: -250px;
            opacity: 0;
            pointer-events: none;
        }

        /* Top Fixed Bar - 2025 Minimal */
        .top-bar {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: var(--bg-secondary);
            backdrop-filter: blur(var(--glass-blur));
            border-bottom: 1px solid var(--border-subtle);
            padding: var(--space-4) var(--space-6);
            z-index: 9999;
            box-shadow: var(--shadow-sm);
            transition: all var(--transition-base);
        }

        body.dark-mode .top-bar {
            background: rgba(17, 24, 39, 0.95);
            border-bottom-color: var(--border-default);
        }

        .top-bar.hidden {
            transform: translateY(-100%);
        }

        /* Hide the greeting/top bar and its toggle arrow only when the
           body has the `top-bar-hidden` class. This prevents a large
           blank gap when the top bar was previously force-hidden. */
        body.top-bar-hidden .top-bar,
        body.top-bar-hidden .top-bar-toggle,
        body.top-bar-hidden .top-bar-minimized-view {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }

        .top-bar-toggle {
            position: fixed;
            top: calc(var(--space-3) + 4px);
            right: calc(var(--space-6) + 50px);
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(148, 163, 184, 0.18);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10000;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
        }

        /* When greeting is hidden, keep the arrow visible on the left edge.
           This keeps the restore control reachable without overlapping the
           settings button or greeting area. */
        .top-bar-toggle.bar-hidden {
            top: 12px;
            right: auto;
            left: 16px;
            z-index: 10050;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            border-color: transparent;
            box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
        }

        .top-bar-toggle.bar-hidden #toggleIcon svg {
            stroke: white;
        }

        .top-bar-toggle:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-md);
            transform: scale(1.1);
        }

        body.dark-mode .top-bar-toggle {
            background: var(--bg-tertiary);
            border-color: var(--border-strong);
        }

        body.dark-mode .top-bar-toggle.bar-hidden {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            border-color: transparent;
        }

        #toggleIcon {
            width: 16px;
            height: 16px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        #toggleIcon svg {
            width: 16px;
            height: 16px;
            stroke: var(--text-secondary);
            stroke-width: 2;
            fill: none;
            transition: transform var(--transition-base);
        }

        body.top-bar-hidden #toggleIcon svg {
            transform: rotate(180deg);
        }

        /* Global Sound Toggle — always above every modal/overlay */
        .global-sound-toggle {
            position: fixed;
            top: var(--space-3);
            right: calc(var(--space-6) + 42px);
            background: var(--bg-secondary);
            border: 1px solid var(--border-default);
            border-radius: var(--radius-full);
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10060;  /* above settings-modal (10000) and settings-btn (10001) */
            transition: all 0.3s ease;
            box-shadow: var(--shadow-sm);
            font-size: 16px;
            /* Prevent accidental double-fires on touch */
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
            user-select: none;
            -webkit-user-select: none;
        }

        .global-sound-toggle:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-md);
            transform: scale(1.1);
        }

        .global-sound-toggle.muted {
            opacity: 0.6;
        }

        .global-sound-toggle.muted::after {
            content: '';
            position: absolute;
            width: 2px;
            height: 24px;
            background: #ef4444;
            transform: rotate(45deg);
            border-radius: 2px;
        }

        body.dark-mode .global-sound-toggle {
            background: var(--bg-tertiary);
            border-color: var(--border-strong);
        }

        /* Position when top bar is hidden (phone mode) */
        body.top-bar-hidden .global-sound-toggle {
            top: 12px;
            right: auto;
            left: 64px;
        }
        body.top-bar-hidden .settings-btn-topbar {
            top: 12px;
            right: auto;
            left: 22px;
        }

        .top-bar-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: var(--space-4);
            flex-wrap: nowrap;
            min-height: fit-content;
        }

        /* Greeting Card - Clean Style */
        .greeting-card {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            padding: var(--space-3) var(--space-4);
            display: flex;
            align-items: center;
            gap: var(--space-3);
            transition: all var(--transition-base);
            cursor: pointer;
            flex-shrink: 0;
        }

        .greeting-card:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        body.dark-mode .greeting-card {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        .greeting-emoji {
            font-size: 1.5rem;
            cursor: pointer;
            flex-shrink: 0;
        }

        .greeting-text {
            display: flex;
            flex-direction: column;
            gap: 1px;
            cursor: pointer;
        }

        .greeting-time {
            font-size: 0.7rem;
            color: var(--text-tertiary);
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        body.dark-mode .greeting-time {
            color: var(--text-secondary);
        }

        .greeting-name {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        /* Quote Card */
        .quote-card {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-lg);
            padding: var(--space-3) var(--space-4);
            flex: 1;
            max-width: 600px;
            min-width: 200px;
            transition: all var(--transition-base);
            overflow: hidden;
        }

        .quote-card:hover {
            border-color: var(--success);
        }

        body.dark-mode .quote-card {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        .quote-text {
            font-size: 0.85rem;
            font-style: italic;
            font-weight: 500;
            color: var(--text-secondary);
            text-align: center;
            line-height: 1.4;
            cursor: pointer;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .quote-icon {
            display: inline-block;
            font-style: normal;
            margin-right: var(--space-2);
        }

        /* Floating Emoji Animation - Full Screen Random */
        .floating-emoji {
            position: fixed;
            font-size: 2.5rem;
            pointer-events: none;
            z-index: 9999;
            animation: floatRandom 2s ease-out forwards;
        }

        @keyframes floatRandom {
            0% {
                transform: scale(0.5) rotate(0deg);
                opacity: 0;
            }
            20% {
                transform: scale(1.2) rotate(var(--rotate, 15deg));
                opacity: 1;
            }
            100% {
                transform: scale(0.8) rotate(var(--rotate, 15deg)) translateY(-80px);
                opacity: 0;
            }
        }

        /* Motivation Popup - Small Toast Style */
        .motivation-popup {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            font-weight: 800;
            color: white;
            background: linear-gradient(135deg, #dc2626, #ef4444);
            pointer-events: none;
            z-index: 99999;
            animation: motivationPop 2.5s ease-out forwards;
            font-family: 'Inter', sans-serif;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
            text-align: center;
            padding: 20px 40px;
            border-radius: 20px;
            box-shadow: 0 15px 50px rgba(220, 38, 38, 0.5);
            max-width: 90%;
        }

        @keyframes motivationPop {
            0% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.5);
            }
            15% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1.1);
            }
            25% {
                transform: translate(-50%, -50%) scale(1);
            }
            75% {
                opacity: 1;
                transform: translate(-50%, -50%) scale(1);
            }
            100% {
                opacity: 0;
                transform: translate(-50%, -50%) scale(0.8) translateY(-30px);
            }
        }

        /* 100% Celebration Overlay */
        .celebration-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 99999;
            animation: celebrationFadeIn 0.5s ease-out;
        }

        .celebration-content {
            text-align: center;
            animation: celebrationBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }

        .celebration-emoji {
            font-size: 6rem;
            margin-bottom: 20px;
            animation: celebrationSpin 1s ease-out;
        }

        .celebration-message {
            font-size: 3rem;
            font-weight: 800;
            background: linear-gradient(135deg, #22c55e 0%, #10b981 25%, #fbbf24 50%, #f59e0b 75%, #22c55e 100%);
            background-size: 200% auto;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: celebrationGradient 2s linear infinite;
            margin-bottom: 15px;
            text-shadow: 0 0 40px rgba(34, 197, 94, 0.5);
        }

        .celebration-submessage {
            font-size: 1.3rem;
            color: #94a3b8;
            font-weight: 500;
            margin-bottom: 30px;
        }

        .celebration-close {
            padding: 15px 40px;
            background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
            color: white;
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 40px rgba(34, 197, 94, 0.4);
        }

        .celebration-close:hover {
            transform: scale(1.05);
            box-shadow: 0 15px 50px rgba(34, 197, 94, 0.6);
        }

        .confetti {
            position: absolute;
            width: 12px;
            height: 12px;
            border-radius: 2px;
            animation: confettiFall 3s ease-out forwards;
        }

        @keyframes celebrationFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        @keyframes celebrationBounce {
            0% { transform: scale(0.3) translateY(100px); opacity: 0; }
            50% { transform: scale(1.1) translateY(-20px); }
            100% { transform: scale(1) translateY(0); opacity: 1; }
        }

        @keyframes celebrationSpin {
            0% { transform: rotate(-20deg) scale(0); }
            50% { transform: rotate(10deg) scale(1.2); }
            100% { transform: rotate(0deg) scale(1); }
        }

        @keyframes celebrationGradient {
            0% { background-position: 0% center; }
            100% { background-position: 200% center; }
        }

        @keyframes confettiFall {
            0% {
                transform: translateY(-100vh) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }

        /* Emergency 100% Celebration - Chill Vibes */
        .emergency-celebration-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.9) 0%, rgba(139, 92, 246, 0.9) 50%, rgba(236, 72, 153, 0.9) 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 99999;
            animation: celebrationFadeIn 0.5s ease-out;
            overflow: hidden;
        }

        .emergency-celebration-content {
            text-align: center;
            animation: celebrationBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            z-index: 2;
        }

        .chill-emoji {
            font-size: 7rem;
            margin-bottom: 20px;
            animation: chillFloat 3s ease-in-out infinite;
        }

        @keyframes chillFloat {
            0%, 100% { transform: translateY(0) rotate(-5deg); }
            50% { transform: translateY(-20px) rotate(5deg); }
        }

        .chill-message {
            font-size: 2.8rem;
            font-weight: 800;
            color: white;
            text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            margin-bottom: 10px;
        }

        .chill-submessage {
            font-size: 1.2rem;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 500;
            margin-bottom: 30px;
        }

        .chill-close {
            padding: 15px 35px;
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(10px);
            color: white;
            border: 2px solid rgba(255, 255, 255, 0.4);
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .chill-close:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.05);
        }

        .chill-bubble {
            position: absolute;
            border-radius: 50%;
            opacity: 0.6;
            animation: bubbleFloat 8s ease-in-out infinite;
        }

        @keyframes bubbleFloat {
            0% {
                transform: translateY(100vh) scale(0);
                opacity: 0;
            }
            10% {
                opacity: 0.6;
            }
            90% {
                opacity: 0.6;
            }
            100% {
                transform: translateY(-100vh) scale(1);
                opacity: 0;
            }
        }

        /* Emergency Celebration - Chill Vibes */
        .emergency-celebration-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.95) 0%, rgba(139, 92, 246, 0.95) 50%, rgba(236, 72, 153, 0.95) 100%);
            z-index: 99999;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: celebrationFadeIn 0.5s ease-out;
            overflow: hidden;
        }

        .emergency-celebration-content {
            text-align: center;
            animation: celebrationBounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            z-index: 2;
        }

        .chill-emoji {
            font-size: 6rem;
            animation: chillBounce 2s ease-in-out infinite;
            filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
        }

        @keyframes chillBounce {
            0%, 100% { transform: translateY(0) rotate(-5deg); }
            50% { transform: translateY(-20px) rotate(5deg); }
        }

        .chill-message {
            font-size: 3.5rem;
            font-weight: 900;
            color: white;
            margin: 20px 0 10px;
            text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            letter-spacing: 2px;
        }

        .chill-submessage {
            font-size: 1.3rem;
            color: rgba(255, 255, 255, 0.95);
            margin-bottom: 30px;
            font-weight: 500;
        }

        .chill-close {
            padding: 15px 40px;
            background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
            color: #7c3aed;
            border: none;
            border-radius: 50px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
        }

        .chill-close:hover {
            transform: scale(1.05);
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
        }

        .chill-timer {
            font-size: 0.9rem;
            color: rgba(255, 255, 255, 0.7);
            margin-top: 15px;
        }

        /* Alarm Phase - Red alarms flying away */
        .alarm-phase {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.95) 0%, rgba(220, 38, 38, 0.98) 100%);
        }

        .alarm-container {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .flying-alarm {
            position: absolute;
            font-size: 3rem;
            animation: alarmFlyAway 1.5s ease-in forwards;
            filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.8));
        }

        @keyframes alarmFlyAway {
            0% {
                transform: scale(1) rotate(0deg);
                opacity: 1;
            }
            50% {
                transform: scale(1.5) rotate(20deg);
                opacity: 1;
            }
            100% {
                transform: scale(0) rotate(360deg) translateY(-200px);
                opacity: 0;
            }
        }

        .alarm-text {
            font-size: 2rem;
            font-weight: 800;
            color: white;
            text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            animation: alarmPulse 0.5s ease-in-out infinite;
            z-index: 10;
        }

        @keyframes alarmPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .chill-phase {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.95) 0%, rgba(139, 92, 246, 0.95) 50%, rgba(34, 197, 94, 0.95) 100%);
            animation: chillFadeIn 0.8s ease-out;
        }

        @keyframes chillFadeIn {
            from { opacity: 0; transform: scale(0.9); }
            to { opacity: 1; transform: scale(1); }
        }

        /* Celebration Timer */
        .celebration-timer {
            font-size: 0.9rem;
            color: rgba(255, 255, 255, 0.6);
            margin-top: 20px;
        }

        .chill-bubble {
            position: absolute;
            border-radius: 50%;
            opacity: 0.6;
            animation: bubbleFloat 6s ease-in-out infinite;
        }

        @keyframes bubbleFloat {
            0% {
                transform: translateY(100vh) scale(0);
                opacity: 0;
            }
            20% {
                opacity: 0.6;
            }
            80% {
                opacity: 0.6;
            }
            100% {
                transform: translateY(-100vh) scale(1.5);
                opacity: 0;
            }
        }

        /* Emergency Help Modal */
        .emergency-help-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            z-index: 100000;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease-out;
            padding: 20px;
        }

        .emergency-help-content {
            background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
            border-radius: 24px;
            padding: 30px;
            max-width: 500px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
            position: relative;
            box-shadow: 0 25px 80px rgba(239, 68, 68, 0.3);
            border: 2px solid rgba(239, 68, 68, 0.2);
            animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        body.dark-mode .emergency-help-content {
            background: linear-gradient(135deg, #1f1f1f 0%, #2a1a1a 100%);
            border-color: rgba(239, 68, 68, 0.3);
        }

        @keyframes slideUp {
            from { transform: translateY(50px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }

        .emergency-help-close {
            position: absolute;
            top: 15px;
            right: 15px;
            background: rgba(239, 68, 68, 0.1);
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            font-size: 1.2rem;
            cursor: pointer;
            color: #ef4444;
            transition: all 0.3s ease;
        }

        .emergency-help-close:hover {
            background: #ef4444;
            color: white;
            transform: rotate(90deg);
        }

        .emergency-help-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 25px;
            padding-bottom: 15px;
            border-bottom: 2px solid rgba(239, 68, 68, 0.2);
        }

        .emergency-help-icon {
            font-size: 2.5rem;
            animation: pulse 2s ease-in-out infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .emergency-help-header h2 {
            font-size: 1.5rem;
            font-weight: 800;
            background: linear-gradient(135deg, #ef4444, #dc2626);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .emergency-help-body {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .help-item {
            display: flex;
            gap: 14px;
            padding: 14px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 14px;
            border: 1px solid rgba(239, 68, 68, 0.1);
            transition: all 0.3s ease;
        }

        body.dark-mode .help-item {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(239, 68, 68, 0.2);
        }

        .help-item:hover {
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
        }

        .help-emoji {
            font-size: 1.8rem;
            flex-shrink: 0;
        }

        .help-item strong {
            display: block;
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .help-item p {
            font-size: 0.85rem;
            color: var(--text-secondary);
            line-height: 1.5;
            margin: 0;
        }

        .emergency-help-got-it {
            width: 100%;
            padding: 16px;
            margin-top: 20px;
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            border: none;
            border-radius: 14px;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
        }

        .emergency-help-got-it:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
        }

        /* Progress Toast - Auto Dismiss */
        .progress-toast {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.8);
            padding: 30px 50px;
            border-radius: 24px;
            z-index: 99998;
            text-align: center;
            animation: toastPop 3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
            pointer-events: none;
        }

        .progress-toast.toast-50 {
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
            box-shadow: 0 20px 60px rgba(251, 191, 36, 0.4);
        }

        .progress-toast.toast-80 {
            background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
            box-shadow: 0 20px 60px rgba(34, 197, 94, 0.4);
        }

        .progress-toast .toast-emoji {
            font-size: 4rem;
            display: block;
            margin-bottom: 15px;
            animation: toastEmoji 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s both;
        }

        .progress-toast .toast-message {
            font-size: 1.8rem;
            font-weight: 800;
            color: white;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
            margin-bottom: 8px;
        }

        .progress-toast .toast-sub {
            font-size: 1rem;
            color: rgba(255, 255, 255, 0.9);
            font-weight: 500;
        }

        @keyframes toastPop {
            0% { 
                transform: translate(-50%, -50%) scale(0.3);
                opacity: 0;
            }
            15% { 
                transform: translate(-50%, -50%) scale(1.1);
                opacity: 1;
            }
            25% { 
                transform: translate(-50%, -50%) scale(1);
            }
            80% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 1;
            }
            100% { 
                transform: translate(-50%, -60%) scale(0.8);
                opacity: 0;
            }
        }

        @keyframes toastEmoji {
            0% { transform: scale(0) rotate(-180deg); }
            100% { transform: scale(1) rotate(0deg); }
        }

        /* Mini confetti burst for toasts */
        .mini-confetti {
            position: absolute;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animation: miniConfettiBurst 1s ease-out forwards;
        }

        @keyframes miniConfettiBurst {
            0% {
                transform: translate(0, 0) scale(1);
                opacity: 1;
            }
            100% {
                transform: translate(var(--x), var(--y)) scale(0);
                opacity: 0;
            }
        }

        /* ═══════════════════════════════════════════════════════════════
           APP TOUR / HOW TO USE GUIDE
           ═══════════════════════════════════════════════════════════════ */
        .tour-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.35);
            z-index: 100005;
            animation: tourFadeIn 0.3s ease-out;
        }

        @keyframes tourFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .tour-highlight {
            position: absolute;
            border: 3px solid #22d3ee;
            border-radius: 16px;
            box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 211, 238, 0.5), inset 0 0 20px rgba(34, 211, 238, 0.1);
            pointer-events: none;
            z-index: 100006;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            animation: tourPulse 2s ease-in-out infinite;
        }

        @keyframes tourPulse {
            0%, 100% { box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 211, 238, 0.5); }
            50% { box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4), 0 0 50px rgba(34, 211, 238, 0.8); }
        }

        .tour-tooltip {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border: 2px solid rgba(34, 211, 238, 0.4);
            border-radius: 16px;
            padding: 16px 20px;
            max-width: 400px;
            width: calc(100vw - 40px);
            z-index: 100006;
            box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 211, 238, 0.2);
            animation: tourSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @keyframes tourSlideUp {
            from { opacity: 0; transform: translateX(-50%) translateY(100px); }
            to { opacity: 1; transform: translateX(-50%) translateY(0); }
        }

        @media (max-width: 480px) {
            .tour-tooltip {
                bottom: 10px;
                left: 10px;
                right: 10px;
                transform: none;
                width: auto;
                max-width: none;
                padding: 14px 16px;
            }
            
            @keyframes tourSlideUp {
                from { opacity: 0; transform: translateY(100px); }
                to { opacity: 1; transform: translateY(0); }
            }
        }

        .tour-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .tour-step-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
        }

        .tour-step-number {
            background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
            color: #0f172a;
            width: 26px;
            height: 26px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 0.8rem;
        }

        .tour-step-label {
            color: #94a3b8;
            font-size: 0.8rem;
            font-weight: 500;
        }

        .tour-title {
            color: #f8fafc;
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 6px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .tour-title-emoji {
            font-size: 1.1rem;
        }

        .tour-description {
            color: #cbd5e1;
            font-size: 0.8rem;
            line-height: 1.4;
            margin-bottom: 12px;
        }

        .tour-actions {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
            align-items: center;
        }

        .tour-btn {
            padding: 8px 14px;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.75rem;
            cursor: pointer;
            transition: all 0.2s ease;
            border: none;
            white-space: nowrap;
        }

        .tour-btn-skip {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .tour-btn-skip:hover {
            background: rgba(239, 68, 68, 0.25);
        }

        .tour-btn-prev {
            background: rgba(148, 163, 184, 0.15);
            color: #94a3b8;
            border: 1px solid rgba(148, 163, 184, 0.3);
        }

        .tour-btn-prev:hover {
            background: rgba(148, 163, 184, 0.25);
        }

        .tour-btn-next {
            background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
            color: #0f172a;
            box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
        }

        .tour-btn-next:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
        }

        .tour-btn-finish {
            background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
        }

        .tour-btn-finish:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
        }

        .tour-progress {
            display: flex;
            gap: 4px;
            justify-content: flex-end;
        }

        .tour-progress-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: rgba(148, 163, 184, 0.3);
            transition: all 0.3s ease;
        }

        .tour-progress-dot.active {
            background: #22d3ee;
            width: 18px;
            border-radius: 3px;
        }

        .tour-progress-dot.completed {
            background: #22c55e;
        }

        /* Welcome modal for tour */
        .tour-welcome {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border: 2px solid rgba(99, 102, 241, 0.4);
            border-radius: 24px;
            padding: 40px;
            max-width: 450px;
            width: 90%;
            z-index: 100006;
            text-align: center;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(99, 102, 241, 0.2);
            animation: tourTooltipIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .tour-welcome-icon {
            font-size: 4rem;
            margin-bottom: 20px;
            animation: tourWelcomeWave 1s ease-in-out infinite;
        }

        @keyframes tourWelcomeWave {
            0%, 100% { transform: rotate(-10deg); }
            50% { transform: rotate(10deg); }
        }

        .tour-welcome h2 {
            color: #f8fafc;
            font-size: 1.8rem;
            font-weight: 800;
            margin-bottom: 12px;
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .tour-welcome p {
            color: #94a3b8;
            font-size: 1rem;
            line-height: 1.6;
            margin-bottom: 28px;
        }

        .tour-welcome-actions {
            display: flex;
            gap: 12px;
            justify-content: center;
            flex-wrap: wrap;
        }

        /* ═══════════════════════════════════════════════════════════════
           DONATION POPUP - BUY ME A COFFEE
           ═══════════════════════════════════════════════════════════════ */
        .donation-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(8px);
            z-index: 99999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            overflow-y: auto;
            animation: celebrationFadeIn 0.4s ease-out;
        }

        .donation-popup {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border: 2px solid rgba(236, 72, 153, 0.4);
            border-radius: 24px;
            padding: 36px;
            max-width: 420px;
            width: 90%;
            max-height: calc(100dvh - 32px);
            overflow-y: auto;
            text-align: center;
            position: relative;
            box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(236, 72, 153, 0.2);
            animation: tourTooltipIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        @media (max-width: 480px) {
            .donation-popup {
                padding: 26px 18px;
                border-radius: 20px;
                width: 100%;
            }

            .donation-close-btn {
                top: 10px;
                right: 10px;
            }

            .donation-emoji {
                font-size: 3.2rem;
            }

            .donation-title {
                font-size: 1.55rem;
            }

            .bkash-number {
                font-size: 1.2rem;
                letter-spacing: 1px;
            }
        }

        .donation-close-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: rgba(239, 68, 68, 0.3);
            color: #f87171;
            font-size: 1.4rem;
            cursor: pointer;
            transition: all 0.2s ease;
            z-index: 10;
            -webkit-tap-highlight-color: transparent;
            touch-action: manipulation;
        }

        .donation-close-btn:hover {
            background: rgba(239, 68, 68, 0.4);
            transform: scale(1.1);
        }

        .donation-emoji {
            font-size: 4rem;
            margin-bottom: 15px;
            animation: donationBounce 2s ease-in-out infinite;
        }

        @keyframes donationBounce {
            0%, 100% { transform: translateY(0) rotate(-5deg); }
            50% { transform: translateY(-10px) rotate(5deg); }
        }

        .donation-title {
            color: #f8fafc;
            font-size: 1.8rem;
            font-weight: 800;
            margin-bottom: 12px;
            background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .donation-text {
            color: #94a3b8;
            font-size: 0.95rem;
            line-height: 1.6;
            margin-bottom: 24px;
        }

        .donation-bkash {
            background: linear-gradient(135deg, rgba(233, 30, 99, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
            border: 2px solid rgba(236, 72, 153, 0.4);
            border-radius: 16px;
            padding: 16px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
        }

        .bkash-icon {
            font-size: 2rem;
            background: linear-gradient(135deg, #e91e63 0%, #ec4899 100%);
            padding: 12px;
            border-radius: 12px;
        }

        .bkash-details {
            flex: 1;
            text-align: left;
        }

        .bkash-label {
            color: #94a3b8;
            font-size: 0.8rem;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .bkash-number {
            color: #f8fafc;
            font-size: 1.4rem;
            font-weight: 800;
            font-family: 'Courier New', monospace;
            letter-spacing: 2px;
        }

        .copy-btn {
            padding: 10px 16px;
            background: linear-gradient(135deg, #ec4899 0%, #f97316 100%);
            color: white;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .copy-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
        }

        .donation-note {
            color: #64748b;
            font-size: 0.85rem;
            margin-bottom: 20px;
        }

        .feedback-section {
            margin-bottom: 20px;
        }

        .feedback-text {
            color: #94a3b8;
            font-size: 0.9rem;
            margin-bottom: 12px;
        }

        .email-box {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
            border: 2px solid rgba(99, 102, 241, 0.4);
            border-radius: 12px;
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .email-box:hover {
            border-color: rgba(99, 102, 241, 0.6);
            transform: translateY(-2px);
        }

        .email-icon {
            font-size: 1.3rem;
        }

        .email-address {
            flex: 1;
            color: #a5b4fc;
            font-size: 0.95rem;
            font-weight: 600;
            text-align: left;
        }

        .copy-email-btn {
            padding: 8px 14px;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .copy-email-btn:hover {
            transform: scale(1.05);
        }

        .divider {
            display: flex;
            align-items: center;
            margin: 20px 0;
            color: #475569;
            font-size: 0.85rem;
        }

        .divider::before,
        .divider::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
        }

        .divider span {
            padding: 0 15px;
        }

        .coffee-section {
            margin-bottom: 20px;
        }

        .coffee-text {
            color: #f8fafc;
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 15px;
        }

        .donation-skip {
            padding: 12px 30px;
            background: rgba(148, 163, 184, 0.15);
            color: #94a3b8;
            border: 1px solid rgba(148, 163, 184, 0.3);
            border-radius: 12px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .donation-skip:hover {
            background: rgba(148, 163, 184, 0.25);
        }

        /* ═══════════════════════════════════════════════════════════════
           COLORFUL CONFIRM POPUP STYLES
           ═══════════════════════════════════════════════════════════════ */
        .colorful-confirm-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
            z-index: 999999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            animation: celebrationFadeIn 0.3s ease-out;
        }

        .colorful-confirm-popup {
            background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
            border-radius: 24px;
            padding: 32px;
            max-width: 380px;
            width: 90%;
            text-align: center;
            position: relative;
            animation: tourTooltipIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            overflow: hidden;
        }

        /* Type-specific borders and shadows */
        .colorful-confirm-popup.type-warning {
            border: 2px solid rgba(251, 191, 36, 0.5);
            box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 50px rgba(251, 191, 36, 0.15);
        }

        .colorful-confirm-popup.type-danger {
            border: 2px solid rgba(239, 68, 68, 0.5);
            box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 50px rgba(239, 68, 68, 0.15);
        }

        .colorful-confirm-popup.type-info {
            border: 2px solid rgba(99, 102, 241, 0.5);
            box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 50px rgba(99, 102, 241, 0.15);
        }

        .colorful-confirm-popup.type-success {
            border: 2px solid rgba(34, 197, 94, 0.5);
            box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5), 0 0 50px rgba(34, 197, 94, 0.15);
        }

        .colorful-confirm-icon {
            font-size: 3.5rem;
            margin-bottom: 16px;
            animation: confirmIconBounce 1.5s ease-in-out infinite;
        }

        @keyframes confirmIconBounce {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .colorful-confirm-title {
            font-size: 1.5rem;
            font-weight: 800;
            margin-bottom: 10px;
            color: #f8fafc;
        }

        .type-warning .colorful-confirm-title {
            background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .type-danger .colorful-confirm-title {
            background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .type-info .colorful-confirm-title {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .type-success .colorful-confirm-title {
            background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .colorful-confirm-message {
            color: #94a3b8;
            font-size: 1rem;
            line-height: 1.6;
            margin-bottom: 28px;
        }

        .colorful-confirm-buttons {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        .colorful-confirm-btn {
            padding: 12px 28px;
            border-radius: 12px;
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.25s ease;
            border: none;
            min-width: 120px;
        }

        .colorful-confirm-btn.confirm {
            color: white;
        }

        .type-warning .colorful-confirm-btn.confirm {
            background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
        }

        .type-danger .colorful-confirm-btn.confirm {
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
        }

        .type-info .colorful-confirm-btn.confirm {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
        }

        .type-success .colorful-confirm-btn.confirm {
            background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
            box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
        }

        .colorful-confirm-btn.confirm:hover {
            transform: translateY(-2px) scale(1.02);
        }

        .colorful-confirm-btn.cancel {
            background: rgba(148, 163, 184, 0.15);
            color: #94a3b8;
            border: 1px solid rgba(148, 163, 184, 0.3);
        }

        .colorful-confirm-btn.cancel:hover {
            background: rgba(148, 163, 184, 0.25);
            transform: translateY(-2px);
        }

        @media (max-width: 480px) {
            .colorful-confirm-popup {
                padding: 24px 20px;
            }

            .colorful-confirm-icon {
                font-size: 2.8rem;
            }

            .colorful-confirm-title {
                font-size: 1.3rem;
            }

            .colorful-confirm-buttons {
                flex-direction: column;
            }

            .colorful-confirm-btn {
                width: 100%;
            }
        }

        body.dark-mode {
            --primary: #818cf8;
            --primary-dark: #6366f1;
            --secondary: #a78bfa;
            --accent: #22d3ee;
            --success: #34d399;
            --danger: #f87171;
            --warning: #fbbf24;
            --dark: #f1f5f9;
            --light: #0f172a;
            --card-bg: #1e293b;
            --text-primary: #f1f5f9;
            --text-secondary: #cbd5e1;
            --emergency: #f87171;
        }

        body.dark-mode .shimmer-loading {
            background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
        }

        body.dark-mode {
            background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
        }

        body.dark-mode .header,
        body.dark-mode .section,
        body.dark-mode .progress-section {
            background: rgba(30, 41, 59, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 
                0 20px 50px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.05) inset;
        }

        body.dark-mode .progress-section {
            background: rgba(30, 41, 59, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        body.dark-mode #growthContent .progress-section {
            background: rgba(30, 41, 59, 0.6) !important;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        body.dark-mode .greeting-card,
        body.dark-mode .quote-card {
            background: rgba(30, 41, 59, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
        }

        body.dark-mode .greeting-card:hover,
        body.dark-mode .quote-card:hover {
            border-color: #818cf8;
        }

        body.dark-mode .greeting-name {
            color: #818cf8;
        }

        body.dark-mode .day-details-content {
            background: #1e293b;
            color: #f1f5f9;
        }

        body.dark-mode .day-task-title {
            color: #f1f5f9;
        }

        body.dark-mode .day-task-item {
            background: #1e293b;
            border-color: #475569;
            color: #f1f5f9;
        }

        body.dark-mode .day-task-item.completed {
            background: rgba(16, 185, 129, 0.2);
            border-color: #34d399;
        }

        body.dark-mode .day-task-item.incomplete {
            background: rgba(239, 68, 68, 0.2);
            border-color: #f87171;
        }

        body.dark-mode .day-task-icon {
            color: #f1f5f9;
        }

        body.dark-mode .day-task-title {
            color: #f1f5f9;
        }

        body.dark-mode .day-details-content {
            background: #1e293b;
            color: #f1f5f9;
        }

        body.dark-mode .day-details-content h3 {
            color: #f1f5f9;
        }

        body.dark-mode .task-card,
        body.dark-mode .routine-item,
        body.dark-mode .resource-card,
        body.dark-mode .planning-task,
        body.dark-mode .modal-content,
        body.dark-mode .step-item {
            background: #1e293b;
            border: 2px solid;
            border-image: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%) 1;
        }

        body.dark-mode .task-card:hover,
        body.dark-mode .routine-item:hover,
        body.dark-mode .resource-card:hover {
            border-color: #818cf8;
        }

        body.dark-mode .calendar-day {
            background: #1e293b;
            border: 2px solid;
            border-image: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%) 1;
        }

        body.dark-mode .form-group input,
        body.dark-mode .form-group select,
        body.dark-mode .form-group textarea {
            background: #0f172a;
            border-color: #475569;
            color: #f1f5f9;
        }

        body.dark-mode .nav-chip,
        body.dark-mode .control-btn {
            background: #1e293b;
            border-color: #475569;
            color: #f1f5f9;
        }

        body.dark-mode #darkModeNavBtn {
            background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
            color: white !important;
        }

        body.dark-mode .resource-list li {
            background: #0f172a;
            color: #cbd5e1;
        }

        body.dark-mode .consistency-chart,
        body.dark-mode .stat-card {
            background: #1e293b;
            border-color: #475569;
        }

        body.dark-mode .emoji-option {
            background: #1e293b;
            border-color: #475569;
        }

        body.dark-mode .context-menu {
            background: #1e293b;
            border: 1px solid #475569;
        }

        body.dark-mode .context-menu-item:hover {
            background: #334155;
        }

        body.dark-mode .calendar-day {
            background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
            border-color: #334155;
        }

        body.dark-mode .calendar-day:hover {
            border-color: #818cf8;
            background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        }

        body.dark-mode .calendar-day.today {
            border: 3px solid #60a5fa;
            background: linear-gradient(135deg, rgba(96, 165, 250, 0.3) 0%, rgba(59, 130, 246, 0.3) 100%);
            box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25), 0 6px 20px rgba(96, 165, 250, 0.4);
        }

        body.dark-mode .calendar-day.today .calendar-day-number {
            color: #60a5fa;
        }

        body.dark-mode .calendar-day.completed-low {
            background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.25) 100%);
            border-color: #f87171;
            box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
        }

        body.dark-mode .calendar-day.completed-low .calendar-day-percent {
            color: #fca5a5;
            text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
            font-weight: 800;
        }

        body.dark-mode .calendar-day.completed-medium {
            background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(234, 88, 12, 0.25) 100%);
            border-color: #fb923c;
            box-shadow: 0 0 15px rgba(249, 115, 22, 0.3);
        }

        body.dark-mode .calendar-day.completed-medium .calendar-day-percent {
            color: #fdba74;
            text-shadow: 0 0 8px rgba(249, 115, 22, 0.6);
            font-weight: 800;
        }

        body.dark-mode .calendar-day.completed-high {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.3) 100%);
            border-color: #34d399;
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
        }

        body.dark-mode .calendar-day.completed-high .calendar-day-percent {
            color: #6ee7b7;
            text-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
            font-weight: 800;
        }

        body.dark-mode .calendar-day-number {
            color: #e2e8f0;
        }

        body.dark-mode .progress-bar {
            box-shadow: 0 0 30px rgba(99, 102, 241, 0.8);
        }

        body.dark-mode .progress-bar.low {
            box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
        }

        body.dark-mode .progress-bar.medium {
            box-shadow: 0 0 30px rgba(249, 115, 22, 0.8);
        }

        body.dark-mode .progress-bar.high {
            box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
        }

        body.dark-mode .calendar-day-header {
            color: #94a3b8;
        }

        body.dark-mode .chart-bar {
            background: linear-gradient(to top, #334155 0%, #475569 100%);
        }

        body.dark-mode .chart-bar.low {
            background: linear-gradient(to top, #991b1b 0%, #dc2626 100%);
            box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
        }

        body.dark-mode .chart-bar.medium {
            background: linear-gradient(to top, #c2410c 0%, #ea580c 100%);
            box-shadow: 0 0 15px rgba(249, 115, 22, 0.5);
        }

        body.dark-mode .chart-bar.high {
            background: linear-gradient(to top, #047857 0%, #059669 100%);
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
        }

        body.dark-mode .chart-label,
        body.dark-mode .chart-value {
            color: #cbd5e1;
        }

        body.dark-mode .nav-btn {
            background: #1e293b !important;
            border-color: #475569 !important;
            color: #f1f5f9 !important;
        }

        body.dark-mode .nav-btn:hover {
            background: #334155 !important;
            border-color: #818cf8 !important;
        }

        .picture-title {
            color: var(--text-primary);
        }

        body.dark-mode .picture-title {
            color: #f1f5f9 !important;
        }

        .picture-info-box {
            background: white;
        }

        body.dark-mode .picture-info-box {
            background: #1e293b !important;
        }

        body.dark-mode #routinePicturesGrid>div {
            background: #1e293b !important;
            border-color: #475569 !important;
        }

        body.dark-mode #routinePicturesGrid>div:hover {
            border-color: #818cf8 !important;
        }

        body.dark-mode .routine-picture-card {
            background: #1e293b !important;
            border-color: #475569 !important;
        }

        body.dark-mode .routine-picture-card:hover {
            border-color: #818cf8 !important;
        }

        body.dark-mode .routine-picture-card>div:last-of-type {
            background: #1e293b !important;
        }

        body.dark-mode .picture-actions button {
            background: rgba(30, 41, 59, 0.95) !important;
            border-color: #475569 !important;
            color: #f1f5f9 !important;
        }

        body.dark-mode .picture-actions button:last-child {
            color: #f87171 !important;
        }

        body.dark-mode #routinePicturesGrid>div {
            background: #1e293b !important;
            border-color: #475569 !important;
        }

        body.dark-mode #routinePicturesGrid>div:hover {
            border-color: #818cf8 !important;
        }

        /* Dark mode storage bar fix */
        body.dark-mode #storageProgressBar {
            color: white;
        }

        body.dark-mode .section>div[style*="background: var(--card-bg)"] {
            background: #1e293b !important;
            border-color: #475569 !important;
        }

        /* Prevent horizontal scroll and pull-to-refresh issues on mobile */
        html {
            overflow-x: hidden;
            overscroll-behavior: none;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
            background: var(--bg-primary);
            min-height: 100vh;
            color: var(--text-primary);
            line-height: 1.6;
            padding: 20px;
            /* Reduced top padding so header isn't pushed too far down on phone & PC */
            padding-top: 88px;
            padding-bottom: 100px;
            position: relative;
            transition: background var(--transition-slow), color var(--transition-slow);
            overflow-x: hidden;
            overscroll-behavior-x: none;
            touch-action: pan-y;
            -webkit-overflow-scrolling: touch;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        /* Mobile: remove large top inset so content sits near the top */
        @media (max-width: 640px) {
            body { padding-top: calc(12px + env(safe-area-inset-top, 0)); }
        }

        /* Subtle background gradient - Light Mode */
        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background:
                radial-gradient(ellipse 80% 50% at 20% -10%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse 60% 40% at 80% 110%, rgba(139, 92, 246, 0.06) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }

        /* Dark mode background */
        body.dark-mode {
            background: linear-gradient(180deg, #0c0f17 0%, #111827 50%, #0c0f17 100%);
        }

        body.dark-mode::before {
            background:
                radial-gradient(ellipse 100% 80% at 20% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 50%),
                radial-gradient(ellipse 80% 60% at 80% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
                radial-gradient(ellipse 50% 50% at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
            animation: ambientPulse 12s ease-in-out infinite;
        }

        @keyframes ambientPulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        body.top-bar-hidden {
            padding-top: 8px;
        }

        body.top-bar-hidden #growthContent,
        body.top-bar-hidden #emergencyContent,
        body.top-bar-hidden #hubContent {
            margin-top: 0 !important;
            padding-top: 0 !important;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            position: relative;
            z-index: 1;
        }

        /* Consistent spacing for content modes */
        #growthContent,
        #emergencyContent,
        #hubContent {
            padding: 0;
        }

        /* Emergency Mode: ensure same centered box width as Growth Plan */
        #emergencyContent {
            max-width: 1200px;
            margin: 0 auto;
            position: relative;
            z-index: 1;
        }

        /* Emergency and Growth sections should have same visual styling */
        #emergencyContent .section,
        #growthContent .section {
            margin-bottom: var(--space-6);
        }
        
        /* Emergency Mode sections - match Growth Plan card styling (borders/spacing/radius) */
        #emergencyContent .section {
            background: var(--bg-secondary);
            padding: var(--space-6);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-subtle);
        }

        body.dark-mode #emergencyContent .section {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }

        #emergencyContent .progress-section {
            padding: 24px;
            background: rgba(255, 255, 255, 0.95);
            border: 2px solid transparent;
            background-image: linear-gradient(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.95)), linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            background-origin: border-box;
            background-clip: padding-box, border-box;
            border-radius: 20px;
            box-shadow: 0 8px 24px rgba(239, 68, 68, 0.08);
            margin-bottom: 28px;
        }

        body.dark-mode #emergencyContent .progress-section {
            background: rgba(30, 41, 59, 0.95);
            background-image: linear-gradient(rgba(30, 41, 59, 0.95), rgba(30, 41, 59, 0.95)), linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        }

        /* Floating Navigation - 2025 Clean Chips */
        .floating-nav {
            position: fixed;
            right: 70px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
            z-index: 100;
            transition: all var(--transition-slow);
        }

        .floating-nav.hidden {
            right: -250px;
            opacity: 0;
            pointer-events: none;
        }

        .nav-chip {
            background: var(--bg-secondary);
            padding: var(--space-2) var(--space-4);
            border-radius: var(--radius-full);
            font-weight: 600;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all var(--transition-base);
            border: 1px solid var(--border-default);
            box-shadow: var(--shadow-sm);
            white-space: nowrap;
            color: var(--text-primary);
        }

        .nav-chip:hover {
            transform: translateX(-4px);
            border-color: var(--primary);
            box-shadow: var(--shadow-md);
        }

        body.dark-mode .nav-chip {
            background: var(--bg-tertiary);
            border-color: var(--border-strong);
        }

        /* Header - 2025 Premium SaaS Style */
        .header {
            text-align: center;
            /* Make header more compact vertically */
            padding: var(--space-6) var(--space-6);
            background: var(--bg-secondary);
            border-radius: var(--radius-xl);
            margin-bottom: var(--space-6);
            box-shadow: var(--shadow-md);
            border: 1px solid var(--border-subtle);
            position: relative;
            overflow: hidden;
            transition: all var(--transition-slow);
        }

        @media (max-width: 640px) {
            .header { padding: var(--space-4) var(--space-4); }
        }

        .header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
            opacity: 0.8;
        }

        .header:hover {
            box-shadow: var(--shadow-lg), var(--shadow-glow);
            border-color: var(--border-default);
        }

        body.dark-mode .header {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }

        .header h1 {
            font-size: 2.2rem;
            font-weight: 800;
            color: var(--text-primary);
            margin-bottom: var(--space-2);
            letter-spacing: -0.5px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-3);
        }

        .header .subtitle {
            color: var(--text-secondary);
            font-size: 0.95rem;
            font-weight: 500;
            margin-bottom: var(--space-5);
            letter-spacing: 0.2px;
        }

        .date-badges {
            display: flex;
            gap: var(--space-3);
            justify-content: center;
            flex-wrap: wrap;
        }

        .date-badge {
            padding: var(--space-2) var(--space-5);
            border-radius: var(--radius-full);
            font-weight: 600;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: var(--space-2);
            transition: all var(--transition-base);
            border: 1px solid transparent;
        }

        .date-badge.start {
            background: var(--primary-light);
            color: var(--primary);
            border-color: rgba(99, 102, 241, 0.2);
        }

        .date-badge.start:hover {
            background: var(--primary);
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
        }

        .date-badge.today {
            background: var(--success-light);
            color: var(--success);
            border-color: rgba(16, 185, 129, 0.2);
        }

        /* Emergency Toggle - Clean Pills */
        .emergency-toggle {
            display: flex;
            justify-content: center;
            gap: var(--space-3);
            margin-top: var(--space-5);
        }

        .mode-btn {
            padding: var(--space-3) var(--space-6);
            border-radius: var(--radius-full);
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all var(--transition-base);
            border: 2px solid transparent;
            display: flex;
            align-items: center;
            gap: var(--space-2);
            position: relative;
            background: var(--bg-tertiary);
            color: var(--text-secondary);
        }

        .mode-btn:hover {
            transform: translateY(-2px);
        }

        .mode-btn.growth {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            border-color: var(--border-default);
        }

        .mode-btn.growth.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
        }

        .mode-btn.emergency {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            border-color: var(--border-default);
        }

        .mode-btn.emergency.active {
            background: var(--danger);
            color: white;
            border-color: var(--danger);
            box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
        }

        .mode-btn.emergency.active::before {
            content: '';
            position: absolute;
            top: -3px;
            right: -3px;
            width: 10px;
            height: 10px;
            background: white;
            border-radius: 50%;
            animation: emergencyPulse 1.5s ease-in-out infinite;
        }

        .mode-btn.hub {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            border-color: var(--border-default);
        }

        .mode-btn.hub.active {
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            color: white;
            border-color: transparent;
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
        }

        .mode-btn .hub-badge {
            background: #ef4444;
            color: white;
            font-size: 0.65rem;
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 700;
            margin-left: 4px;
        }

        @keyframes emergencyPulse {
            0%, 100% { opacity: 0.6; transform: scale(1); }
            50% { opacity: 1; transform: scale(1.2); }
        }

        /* Progress Section - Clean & Modern */
        .progress-section {
            background: var(--bg-secondary);
            padding: var(--space-6);
            border-radius: var(--radius-xl);
            margin-bottom: var(--space-6);
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-subtle);
            transition: all var(--transition-base);
        }

        .progress-section:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-default);
        }

        body.dark-mode .progress-section {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }

        .progress-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-4);
        }

        .progress-header h2 {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .progress-day {
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 600;
            display: none;
        }

        /* Premium Progress Bar - 2025 Satisfying Style */
        .progress-bar-container {
            width: 100%;
            height: 36px;
            background: #f1f5f9;
            border-radius: 16px;
            overflow: hidden;
            position: relative;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
        }

        body.dark-mode .progress-bar-container {
            background: rgba(30, 41, 59, 0.8);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .progress-bar {
            height: 100%;
            transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.5s ease, box-shadow 0.5s ease;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 var(--space-3);
            color: white;
            font-weight: 700;
            font-size: 0.9rem;
            text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
            border-radius: var(--radius-full);
            min-width: 50px;
        }

        /* 0-39%: Red to Orange transition */
        .progress-bar.level-0 {
            background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 100%);
            box-shadow: none;
            min-width: 0;
            width: 0% !important;
        }

        .progress-bar.level-10 {
            background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
            box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
        }

        .progress-bar.level-20 {
            background: linear-gradient(90deg, #f87171 0%, #fb923c 100%);
            box-shadow: 0 0 16px rgba(251, 146, 60, 0.35);
        }

        .progress-bar.level-30 {
            background: linear-gradient(90deg, #fb923c 0%, #f97316 100%);
            box-shadow: 0 0 14px rgba(249, 115, 22, 0.35);
        }

        /* 40-69%: Yellow/Orange transition */
        .progress-bar.level-40 {
            background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%);
            box-shadow: 0 0 18px rgba(251, 191, 36, 0.4);
        }

        .progress-bar.level-50 {
            background: linear-gradient(90deg, #fbbf24 0%, #facc15 100%);
            box-shadow: 0 0 20px rgba(250, 204, 21, 0.45);
        }

        .progress-bar.level-60 {
            background: linear-gradient(90deg, #facc15 0%, #a3e635 100%);
            box-shadow: 0 0 18px rgba(163, 230, 53, 0.4);
        }

        /* 70-100%: Green with glow animation */
        .progress-bar.level-70 {
            background: linear-gradient(90deg, #a3e635 0%, #22c55e 100%);
            box-shadow: 0 0 20px rgba(34, 197, 94, 0.5);
            animation: greenPulse 2s ease-in-out infinite;
        }

        .progress-bar.level-80 {
            background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
            box-shadow: 0 0 25px rgba(22, 163, 74, 0.6);
            animation: greenPulse 1.8s ease-in-out infinite;
        }

        .progress-bar.level-90 {
            background: linear-gradient(90deg, #16a34a 0%, #15803d 100%);
            box-shadow: 0 0 30px rgba(21, 128, 61, 0.7);
            animation: greenPulse 1.5s ease-in-out infinite;
        }

        .progress-bar.level-100 {
            background: linear-gradient(90deg, #15803d 0%, #166534 50%, #15803d 100%);
            box-shadow: 0 0 40px rgba(22, 101, 52, 0.8), 0 0 60px rgba(34, 197, 94, 0.4);
            animation: perfectGlow 1.2s ease-in-out infinite, celebrateShine 3s linear infinite;
        }

        @keyframes greenPulse {
            0%, 100% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.4); }
            50% { box-shadow: 0 0 35px rgba(34, 197, 94, 0.7), 0 0 50px rgba(34, 197, 94, 0.3); }
        }

        @keyframes perfectGlow {
            0%, 100% { 
                box-shadow: 0 0 30px rgba(22, 101, 52, 0.6), 0 0 50px rgba(34, 197, 94, 0.3);
                transform: scale(1);
            }
            50% { 
                box-shadow: 0 0 50px rgba(22, 101, 52, 0.9), 0 0 80px rgba(34, 197, 94, 0.5);
                transform: scale(1.01);
            }
        }

        @keyframes celebrateShine {
            0% { background-position: -200% center; }
            100% { background-position: 200% center; }
        }

        .progress-bar.level-100 {
            background: linear-gradient(90deg, #15803d 0%, #166534 25%, #22c55e 50%, #166534 75%, #15803d 100%);
            background-size: 200% 100%;
        }

        /* Keep old classes for backward compatibility */
        .progress-bar.low {
            background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
        }

        .progress-bar.medium {
            background: linear-gradient(90deg, #f97316 0%, #fbbf24 100%);
        }

        .progress-bar.high {
            background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
        }

        /* Subtle shimmer animation for progress bar */
        .progress-bar::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
            animation: shimmer 2.5s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        /* Section Styles - 2025 Clean Cards */
        .section {
            background: var(--bg-secondary);
            padding: var(--space-6);
            border-radius: var(--radius-xl);
            margin-bottom: var(--space-6);
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-subtle);
            scroll-margin-top: 20px;
            transition: all var(--transition-base);
            position: relative;
        }

        .section:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-default);
        }

        body.dark-mode .section {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }
        
        .section.collapsed {
            padding-bottom: var(--space-3);
        }
        
        .progress-section.collapsed {
            padding-bottom: var(--space-3);
        }
        
        .section-content {
            transition: all var(--transition-slow);
            overflow: visible;
            max-height: 10000px;
        }
        
        .section.collapsed .section-content {
            overflow: hidden;
        }
        
        .progress-section.collapsed .section-content {
            overflow: hidden;
            max-height: 0 !important;
            opacity: 0;
            margin-top: 0;
        }
        
        .section.collapsed .section-content {
            max-height: 0 !important;
            opacity: 0;
            margin-top: 0;
        }
        
        .collapse-toggle {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-default);
            cursor: pointer;
            font-size: 0.9rem;
            padding: var(--space-2);
            border-radius: var(--radius-sm);
            transition: all var(--transition-fast);
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
        }
        
        .collapse-toggle:hover {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
        }
        
        .collapse-toggle.collapsed {
            transform: rotate(-90deg);
        }

        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-4);
            gap: var(--space-3);
        }
        
        .section-header-left {
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .section-title {
            font-size: 1rem;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: var(--space-2);
            color: var(--text-primary);
        }

        /* Premium Buttons - 2025 Style */
        .add-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: var(--space-3) var(--space-5);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: var(--space-2);
            transition: all var(--transition-base);
            box-shadow: var(--shadow-sm);
            position: relative;
            overflow: hidden;
        }

        .add-btn:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
            box-shadow: var(--shadow-md), 0 4px 16px rgba(99, 102, 241, 0.3);
        }

        .add-btn:active {
            transform: translateY(0);
        }

        /* Tasks Grid */
        .tasks-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: var(--space-4);
        }

        /* Task Cards - 2025 Minimal Design */
        .task-card {
            background: var(--bg-secondary);
            padding: var(--space-4);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-xs);
            transition: all var(--transition-base);
            cursor: grab;
            position: relative;
            user-select: none;
        }

        .task-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 3px;
            height: 100%;
            background: var(--primary);
            border-radius: 3px 0 0 3px;
            opacity: 0.6;
            transition: opacity var(--transition-fast);
        }

        body.dark-mode .task-card {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        .task-card.dragging {
            opacity: 0.6;
            cursor: grabbing;
            transform: rotate(1deg) scale(1.02);
            box-shadow: var(--shadow-lg);
        }

        .task-card:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-md);
        }

        .task-card:hover::before {
            opacity: 1;
        }

        .task-card.completed {
            background: var(--success-light);
            border-color: var(--success);
        }

        .task-card.completed::before {
            background: var(--success);
        }

        body.dark-mode .task-card.completed {
            background: rgba(16, 185, 129, 0.1);
        }

        .task-card.completed .task-title {
            position: relative;
            color: var(--text-tertiary);
        }

        .task-card.completed .task-title::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            top: 50%;
            height: 1px;
            background: var(--text-tertiary);
            animation: strikethrough 0.2s ease-out;
        }

        @keyframes strikethrough {
            from { transform: scaleX(0); }
            to { transform: scaleX(1); }
        }

        .task-header {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            margin-bottom: var(--space-2);
        }

        .task-checkbox {
            width: 20px;
            height: 20px;
            cursor: pointer;
            accent-color: var(--primary);
            pointer-events: none;
        }

        .task-icon {
            font-size: 1.3rem;
        }

        .task-time {
            background: var(--primary-light);
            color: var(--primary);
            padding: var(--space-1) var(--space-3);
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            font-weight: 600;
            margin-left: auto;
        }

        body.dark-mode .task-time {
            background: rgba(99, 102, 241, 0.2);
        }

        .task-title {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.4;
        }

        .resource-card.dragging,
        .planning-task.dragging {
            opacity: 0.6;
            cursor: grabbing;
        }

        .resource-card,
        .planning-task {
            cursor: grab;
        }

        /* Context Menu */
        .context-menu {
            position: fixed;
            background: white;
            border-radius: 12px;
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
            padding: var(--space-2);
            z-index: 10000;
            display: none;
            min-width: 160px;
            border: 1px solid var(--border-subtle);
            animation: contextFadeIn 0.15s ease;
        }

        @keyframes contextFadeIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .context-menu.active {
            display: block;
        }

        .context-menu-item {
            padding: var(--space-2) var(--space-3);
            cursor: pointer;
            border-radius: var(--radius-sm);
            font-weight: 500;
            font-size: 0.85rem;
            transition: all var(--transition-fast);
            display: flex;
            align-items: center;
            gap: var(--space-2);
            color: var(--text-secondary);
        }

        .context-menu-item:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .context-menu-item.delete {
            color: var(--danger);
        }

        .context-menu-item.delete:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .context-menu-divider {
            height: 1px;
            background: var(--border-default);
            margin: var(--space-1) var(--space-2);
        }

        body.dark-mode .context-menu {
            background: var(--bg-secondary);
            border-color: var(--border-default);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
        }

        body.dark-mode .context-menu-item:hover {
            background: var(--bg-tertiary);
        }

        body.dark-mode .context-menu-item.delete:hover {
            background: rgba(239, 68, 68, 0.15);
        }

        /* Daily Routine - 2025 Clean Timeline */
        .routine-timeline {
            display: flex;
            flex-direction: column;
            gap: var(--space-3);
        }

        .routine-item {
            display: flex;
            align-items: center;
            gap: var(--space-4);
            padding: var(--space-4);
            background: var(--bg-secondary);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-subtle);
            transition: all var(--transition-base);
            cursor: move;
        }

        body.dark-mode .routine-item {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        .routine-item.dragging {
            opacity: 0.5;
            cursor: grabbing;
        }

        .routine-item:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        .routine-item:hover .routine-actions {
            opacity: 1;
        }

        .routine-number {
            width: 32px;
            height: 32px;
            background: var(--primary);
            color: white;
            border-radius: var(--radius-full);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
            flex-shrink: 0;
        }

        .routine-content {
            flex: 1;
            display: flex;
            align-items: center;
            gap: var(--space-3);
        }

        .routine-text {
            flex: 1;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .routine-time {
            padding: var(--space-1) var(--space-3);
            background: var(--primary-light);
            color: var(--primary);
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            font-weight: 600;
        }

        .routine-actions {
            display: flex;
            gap: var(--space-2);
            opacity: 0;
            transition: opacity var(--transition-fast);
        }

        .routine-action-btn {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-default);
            cursor: pointer;
            font-size: 0.9rem;
            padding: var(--space-1);
            border-radius: var(--radius-sm);
            transition: all var(--transition-fast);
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .routine-action-btn:hover {
            border-color: var(--primary);
        }

        .routine-action-btn.delete:hover {
            background: var(--danger-light);
            border-color: var(--danger);
        }

        /* Resources Section - 2025 Card Grid */
        .resources-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: var(--space-4);
        }

        .resource-card {
            background: var(--bg-secondary);
            padding: var(--space-4);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-subtle);
            transition: all var(--transition-base);
            position: relative;
        }

        body.dark-mode .resource-card {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        .resource-card:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        .resource-card:hover .resource-actions {
            opacity: 1;
        }

        .resource-title {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: var(--space-3);
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .resource-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }

        .resource-list li {
            padding: var(--space-2) var(--space-3);
            background: var(--bg-tertiary);
            border-radius: var(--radius-sm);
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-secondary);
        }

        body.dark-mode .resource-list li {
            background: var(--bg-secondary);
        }

        .resource-actions {
            position: absolute;
            top: var(--space-3);
            right: var(--space-3);
            display: flex;
            gap: var(--space-1);
            opacity: 0;
            transition: opacity var(--transition-fast);
        }

        .resource-action-btn {
            background: var(--bg-secondary);
            border: 1px solid var(--border-default);
            cursor: pointer;
            font-size: 0.85rem;
            padding: var(--space-1);
            border-radius: var(--radius-sm);
            transition: all var(--transition-fast);
        }

        .resource-action-btn:hover {
            border-color: var(--primary);
        }

        .resource-action-btn.delete:hover {
            background: var(--danger-light);
            border-color: var(--danger);
        }

        input[type="date"] {
            padding: 12px 14px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            background: white;
            color: #1e293b;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            min-width: 220px;
        }

        input[type="date"]::-webkit-calendar-picker-indicator {
            cursor: pointer;
            border-radius: 4px;
            margin-right: 2px;
            opacity: 0.8;
            filter: invert(0) brightness(0.4);
        }

        input[type="date"]:hover {
            border-color: #6366f1;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
            background: #f8fafc;
        }

        input[type="date"]:focus {
            outline: none;
            border-color: #6366f1;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
        }

        body.dark-mode input[type="date"] {
            background: #0f172a;
            border-color: #334155;
            color: #f1f5f9;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }

        body.dark-mode input[type="date"]::-webkit-calendar-picker-indicator {
            filter: invert(1) brightness(0.8);
        }

        body.dark-mode input[type="date"]:hover {
            border-color: #818cf8;
            background: #1e293b;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
        }

        body.dark-mode input[type="date"]:focus {
            border-color: #818cf8;
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
        }
        /* Emoji Picker - 2025 Premium Grid */
        .emoji-picker {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: var(--space-2);
            margin-bottom: var(--space-4);
        }

        .emoji-option {
            font-size: 1.4rem;
            padding: var(--space-2);
            background: var(--bg-tertiary);
            border: 1px solid var(--border-subtle);
            border-radius: var(--radius-md);
            cursor: pointer;
            text-align: center;
            transition: all var(--transition-fast);
        }

        .emoji-option:hover {
            background: var(--bg-hover);
            border-color: var(--primary);
            transform: scale(1.08);
        }

        .emoji-option.selected {
            border-color: var(--primary);
            background: var(--primary-muted);
            box-shadow: var(--shadow-glow);
        }

        body.dark-mode .emoji-option {
            background: var(--bg-tertiary);
            border-color: var(--border-subtle);
        }

        body.dark-mode .emoji-option:hover {
            background: var(--bg-hover);
            border-color: var(--primary-light);
        }

        body.dark-mode .emoji-option.selected {
            border-color: var(--primary-light);
            background: var(--primary-muted);
            box-shadow: 0 0 12px rgba(129, 140, 248, 0.4);
        }

        /* Calendar - 2025 Clean Grid */
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: var(--space-3);
            max-width: 560px;
            min-width: 320px;
            margin: 0 auto;
            width: 100%;
            padding-bottom: 10px; /* Extra space for hover scale */
        }

        /* Emergency Calendar - Bigger Size */
        #emergencyCalendarSection .calendar-grid {
            max-width: 700px;
            gap: var(--space-4);
        }

        #emergencyCalendarSection .calendar-day {
            min-height: 72px;
            font-size: 1rem;
        }

        #emergencyCalendarSection .calendar-day-header {
            font-size: 0.9rem;
            padding: var(--space-4) 0;
        }

        .calendar-day-header {
            text-align: center;
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--text-secondary);
            padding: var(--space-3) 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .calendar-day {
            aspect-ratio: 1;
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-lg);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: all var(--transition-fast);
            cursor: pointer;
            font-size: 0.85rem;
            min-height: 58px;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
        }

        body.dark-mode .calendar-day {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
            box-shadow: none;
        }

        .calendar-day:hover {
            transform: scale(1.05);
            border-color: var(--primary);
            box-shadow: var(--shadow-sm);
        }

        .calendar-day-number {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .calendar-day-percent {
            font-size: 0.7rem;
            font-weight: 600;
            margin-top: 3px;
            color: var(--text-secondary);
        }

        /* Today highlight with strong blue border */
        .calendar-day.today {
            border: 3px solid #3b82f6 !important;
            background: rgba(59, 130, 246, 0.1);
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.2);
            animation: todayPulse 2s ease-in-out infinite;
        }

        @keyframes todayPulse {
            0%, 100% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 4px 12px rgba(59, 130, 246, 0.2); }
            50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.25), 0 6px 20px rgba(59, 130, 246, 0.3); }
        }

        .calendar-day.today .calendar-day-number {
            color: #3b82f6;
            font-weight: 700;
        }

        body.dark-mode .calendar-day.today {
            border-color: #60a5fa !important;
            background: rgba(96, 165, 250, 0.15);
            box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2), 0 4px 12px rgba(96, 165, 250, 0.25);
        }

        body.dark-mode .calendar-day.today .calendar-day-number {
            color: #60a5fa;
        }

        .calendar-day.start-date {
            border: 2px solid var(--warning);
            background: var(--warning-light);
        }

        .calendar-day.start-date .calendar-day-number {
            color: var(--warning);
            font-weight: 700;
        }

        /* Completion states */
        .calendar-day.completed-low {
            background: var(--danger-light);
            border-color: var(--danger);
        }

        .calendar-day.completed-low .calendar-day-percent {
            color: var(--danger);
        }

        .calendar-day.completed-medium {
            background: var(--warning-light);
            border-color: var(--warning);
        }

        .calendar-day.completed-medium .calendar-day-percent {
            color: #d97706;
        }

        .calendar-day.completed-high {
            background: var(--success-light);
            border-color: var(--success);
        }

        .calendar-day.completed-high .calendar-day-percent {
            color: var(--success);
        }

        /* Calendar Badge */
        .calendar-day-badge {
            position: absolute;
            top: 2px;
            right: 2px;
            background: var(--danger);
            color: white;
            font-size: 0.55rem;
            font-weight: 700;
            padding: 2px 4px;
            border-radius: var(--radius-full);
            min-width: 14px;
            text-align: center;
            line-height: 1;
        }

        .calendar-day {
            aspect-ratio: 1;
            background: white;
            border: 2px solid;
            border-image: linear-gradient(135deg, #ec4899 0%, #f59e0b 100%) 1;
            border-radius: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
            font-size: 0.8rem;
            min-width: 0;
            overflow: hidden;
        }

        /* Responsive calendar for smaller devices */
        @media (max-width: 768px) {
            .calendar-grid {
                max-width: 100%;
                gap: 4px;
            }

            .calendar-day-header {
                font-size: 0.65rem;
                padding: 4px 0;
                min-height: 18px;
            }

            .calendar-day {
                font-size: 0.65rem;
            }

            .calendar-day-number {
                font-size: 0.75rem;
                font-weight: 700;
                line-height: 1;
            }

            .calendar-day-percent {
                font-size: 0.55rem;
                margin-top: 2px;
                line-height: 1;
                max-width: 100%;
                word-wrap: break-word;
            }
        }

        @media (max-width: 480px) {
            .calendar-grid {
                max-width: 100%;
                gap: 3px;
            }

            .calendar-day-header {
                font-size: 0.55rem;
                padding: 2px 0;
                min-height: 16px;
            }

            .calendar-day {
                font-size: 0.6rem;
                border-radius: 8px;
                border-width: 1.5px;
            }

            .calendar-day-number {
                font-size: 0.7rem;
            }

            .calendar-day-percent {
                font-size: 0.5rem;
            }

            .calendar-day-badge {
                font-size: 0.5rem;
                padding: 1px 3px;
                top: 1px;
                right: 1px;
            }
        }

        /* Emergency Calendar Badge */
        .calendar-day-badge {
            position: absolute;
            top: 2px;
            right: 2px;
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: white;
            font-size: 0.65rem;
            font-weight: 800;
            padding: 3px 6px;
            border-radius: 10px;
            min-width: 18px;
            text-align: center;
            box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4);
            border: 1px solid rgba(255, 255, 255, 0.3);
            z-index: 10;
            animation: badgePulse 2s ease-in-out infinite;
        }

        @keyframes badgePulse {
            0%, 100% {
                transform: scale(1);
                box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4);
            }
            50% {
                transform: scale(1.1);
                box-shadow: 0 5px 15px rgba(239, 68, 68, 0.6);
            }
        }

        body.dark-mode .calendar-day-badge {
            background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
            box-shadow: 0 3px 10px rgba(220, 38, 38, 0.5);
        }

        .calendar-day:hover {
            transform: scale(1.08);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .calendar-day.clickable {
            cursor: pointer;
        }

        .calendar-day.clickable:hover {
            border-color: #6366f1;
        }

        .calendar-day-number {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .calendar-day-percent {
            font-size: 0.65rem;
            font-weight: 700;
            margin-top: 2px;
        }

        .calendar-day.today {
            border: 3px solid #3b82f6;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(147, 197, 253, 0.2) 100%);
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 6px 20px rgba(59, 130, 246, 0.3);
            animation: todayPulse 2s ease-in-out infinite;
        }

        @keyframes todayPulse {

            0%,
            100% {
                box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), 0 6px 20px rgba(59, 130, 246, 0.3);
            }

            50% {
                box-shadow: 0 0 0 5px rgba(59, 130, 246, 0.35), 0 10px 25px rgba(59, 130, 246, 0.4);
            }
        }

        .calendar-day.today .calendar-day-number {
            color: #2563eb;
            font-size: 1rem;
        }

        .calendar-day.start-date {
            border: 3px solid #f59e0b;
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(251, 146, 60, 0.2) 100%);
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25), 0 6px 20px rgba(245, 158, 11, 0.3);
        }

        .calendar-day.start-date .calendar-day-number {
            color: #d97706;
            font-weight: 800;
        }

        body.dark-mode .calendar-day.start-date {
            border: 3px solid #fbbf24;
            background: linear-gradient(135deg, rgba(251, 191, 36, 0.3) 0%, rgba(252, 211, 77, 0.3) 100%);
            box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.25), 0 6px 20px rgba(251, 191, 36, 0.4);
        }

        body.dark-mode .calendar-day.start-date .calendar-day-number {
            color: #fbbf24;
        }

        .calendar-day.completed-low {
            background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
            border-color: #f87171;
        }

        .calendar-day.completed-low .calendar-day-percent {
            color: #dc2626;
        }

        .calendar-day.completed-medium {
            background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
            border-color: #fb923c;
        }

        .calendar-day.completed-medium .calendar-day-percent {
            color: #c2410c;
        }

        .calendar-day.completed-high {
            background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
            border-color: #34d399;
        }

        .calendar-day.completed-high .calendar-day-percent {
            color: #059669;
        }

        /* Planning Steps - 2025 Clean Cards */
        .planning-tasks {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
            gap: var(--space-4);
        }

        .planning-task {
            background: var(--bg-primary);
            padding: var(--space-5);
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-subtle);
            box-shadow: var(--shadow-sm);
            transition: all var(--transition-base);
        }

        .planning-task:hover {
            border-color: var(--primary);
            box-shadow: var(--shadow-md);
        }

        body.dark-mode .planning-task {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }

        .planning-task-header {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            margin-bottom: var(--space-4);
            font-weight: 600;
            font-size: 1rem;
            color: var(--text-primary);
        }

        .steps-container {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
            margin-left: var(--space-10);
        }

        .step-item {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3);
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-subtle);
            position: relative;
            transition: all var(--transition-fast);
        }

        .step-item:hover {
            background: var(--bg-hover);
            border-color: var(--border-default);
        }

        .step-item:hover .step-actions {
            opacity: 1;
        }

        body.dark-mode .step-item {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        body.dark-mode .step-item:hover {
            background: var(--bg-hover);
        }

        .step-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .step-text {
            flex: 1;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .step-item.completed .step-text {
            text-decoration: line-through;
            color: var(--text-tertiary);
        }

        .step-actions {
            display: flex;
            gap: var(--space-1);
            opacity: 0;
            transition: opacity var(--transition-fast);
        }

        .step-action-btn {
            background: none;
            border: none;
            cursor: pointer;
            font-size: 0.9rem;
            padding: var(--space-1);
            border-radius: var(--radius-sm);
            transition: all var(--transition-fast);
            color: var(--text-tertiary);
        }

        .step-action-btn:hover {
            background: var(--bg-hover);
            color: var(--text-secondary);
        }

        .step-action-btn.delete:hover {
            background: rgba(239, 68, 68, 0.1);
            color: var(--danger);
        }

        body.dark-mode .step-action-btn.delete:hover {
            background: rgba(239, 68, 68, 0.15);
        }

        .add-step-btn {
            margin-left: var(--space-10);
            margin-top: var(--space-2);
            padding: var(--space-2) var(--space-4);
            background: transparent;
            border: 1px dashed var(--border-default);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-tertiary);
            transition: all var(--transition-fast);
        }

        .add-step-btn:hover {
            border-color: var(--primary);
            color: var(--primary);
            background: var(--primary-muted);
        }

        body.dark-mode .add-step-btn:hover {
            border-color: var(--primary-light);
            color: var(--primary-light);
        }

        /* Stats - 2025 Dashboard Style */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: var(--space-5);
        }

        .stat-card {
            background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
            padding: var(--space-6);
            border-radius: var(--radius-xl);
            border: 1px solid rgba(99, 102, 241, 0.1);
            transition: all var(--transition-base);
            position: relative;
            overflow: hidden;
        }

        .stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
            opacity: 0;
            transition: opacity var(--transition-base);
        }

        .stat-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
            border-color: rgba(99, 102, 241, 0.2);
        }

        .stat-card:hover::before {
            opacity: 1;
        }

        body.dark-mode .stat-card {
            background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
            border-color: rgba(99, 102, 241, 0.15);
        }

        body.dark-mode .stat-card:hover {
            box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
        }

        .stat-label {
            font-size: 0.75rem;
            color: var(--text-tertiary);
            font-weight: 600;
            margin-bottom: var(--space-3);
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .stat-value {
            font-size: 2.5rem;
            font-weight: 800;
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1.1;
        }

        body.dark-mode .stat-value {
            background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
            -webkit-background-clip: text;
            background-clip: text;
        }

        .stat-comparison {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            margin-top: var(--space-3);
            font-size: 0.8rem;
            font-weight: 600;
            padding: var(--space-1) var(--space-2);
            border-radius: var(--radius-sm);
            width: fit-content;
        }

        .stat-comparison.improved { 
            color: var(--success); 
            background: rgba(16, 185, 129, 0.1);
        }
        .stat-comparison.declined { 
            color: var(--danger); 
            background: rgba(239, 68, 68, 0.1);
        }
        .stat-comparison.same { 
            color: var(--text-tertiary); 
            background: var(--bg-tertiary);
        }

        /* Chart - Beautiful Bar Design */
        .consistency-chart {
            background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
            padding: var(--space-6);
            border-radius: var(--radius-xl);
            border: 1px solid rgba(99, 102, 241, 0.1);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
        }

        body.dark-mode .consistency-chart {
            background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
            border-color: rgba(99, 102, 241, 0.15);
        }

        .chart-bars {
            display: flex;
            align-items: flex-end;
            justify-content: space-around;
            height: 240px;
            gap: var(--space-3);
            padding-bottom: var(--space-6);
            position: relative;
        }

        .chart-bar {
            flex: 1;
            background: linear-gradient(to top, #e2e8f0 0%, #cbd5e1 100%);
            border-radius: var(--radius-md) var(--radius-md) 0 0;
            position: relative;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            min-height: 18px;
            max-width: 72px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        }

        body.dark-mode .chart-bar {
            background: linear-gradient(to top, #334155 0%, #475569 100%);
        }

        .chart-bar.has-data:hover {
            transform: translateY(-6px) scale(1.05);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        .chart-bar.low {
            background: linear-gradient(to top, #fecaca 0%, #ef4444 50%, #dc2626 100%);
            box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
        }

        .chart-bar.medium {
            background: linear-gradient(to top, #fef08a 0%, #fbbf24 50%, #f59e0b 100%);
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
        }

        .chart-bar.high {
            background: linear-gradient(to top, #bbf7d0 0%, #22c55e 50%, #16a34a 100%);
            box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
        }

        .chart-label {
            position: absolute;
            bottom: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.72rem;
            font-weight: 500;
            color: var(--text-tertiary);
            white-space: nowrap;
        }

        .chart-value {
            position: absolute;
            top: -18px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.72rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        /* Controls - Clean Buttons */
        .controls-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: var(--space-3);
        }

        .control-btn {
            padding: var(--space-3) var(--space-4);
            border: 1px solid var(--border-default);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all var(--transition-base);
            background: var(--bg-secondary);
            color: var(--text-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-2);
        }

        .control-btn:hover {
            transform: translateY(-1px);
            box-shadow: var(--shadow-sm);
        }

        .control-btn.export {
            border-color: var(--success);
            color: var(--success);
        }

        .control-btn.export:hover {
            background: var(--success-light);
        }

        .control-btn.import {
            border-color: var(--primary);
            color: var(--primary);
        }

        .control-btn.import:hover {
            background: var(--primary-light);
        }

        .control-btn.reset-progress,
        .control-btn.reset-all {
            border-color: var(--danger);
            color: var(--danger);
        }

        .control-btn.reset-progress:hover,
        .control-btn.reset-all:hover {
            background: var(--danger-light);
        }

        body.dark-mode .control-btn {
            background: var(--bg-tertiary);
            border-color: var(--border-default);
        }

        /* Modal - 2025 Clean Design */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(8px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: var(--space-4);
        }

        .modal.active {
            display: flex;
        }

        /* Hide side panels when any modal is active */
        .modal.active ~ .quick-links-toggle-btn,
        .modal.active ~ .nav-toggle-btn,
        .modal.active ~ .quick-links,
        .modal.active ~ .floating-nav,
        .modal.active ~ .top-bar-toggle,
        .day-details-modal.active ~ .quick-links-toggle-btn,
        .day-details-modal.active ~ .nav-toggle-btn,
        .day-details-modal.active ~ .quick-links,
        .day-details-modal.active ~ .floating-nav,
        .day-details-modal.active ~ .top-bar-toggle {
            display: none !important;
        }

        .modal.active,
        .day-details-modal.active {
            z-index: 1001;
        }

        body:has(.modal.active) .top-bar-toggle,
        body:has(.day-details-modal.active) .top-bar-toggle {
            display: none !important;
        }

        .modal-content {
            background: var(--bg-secondary);
            padding: var(--space-8);
            border-radius: var(--radius-xl);
            max-width: 480px;
            width: 100%;
            box-shadow: var(--shadow-xl);
            animation: modalSlideIn 0.25s ease-out;
            max-height: 90vh;
            overflow-y: auto;
            border: 1px solid var(--border-default);
        }

        body.dark-mode .modal-content {
            background: var(--bg-secondary);
            border-color: var(--border-strong);
        }

        @keyframes modalSlideIn {
            from {
                transform: translateY(-20px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-6);
        }

        .modal-header h3 {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--text-primary);
        }

        .close-btn {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-default);
            font-size: 1.2rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: all var(--transition-fast);
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .close-btn:hover {
            color: var(--danger);
            border-color: var(--danger);
            background: var(--danger-light);
        }

        .form-group {
            margin-bottom: var(--space-4);
        }

        .form-group label {
            display: block;
            margin-bottom: var(--space-2);
            font-weight: 600;
            color: var(--text-primary);
            font-size: 0.85rem;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: var(--space-3) var(--space-4);
            border: 1px solid var(--border-default);
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            font-weight: 500;
            transition: all var(--transition-fast);
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-family: inherit;
        }

        body.dark-mode .form-group input,
        body.dark-mode .form-group select,
        body.dark-mode .form-group textarea {
            background: var(--bg-tertiary);
            border-color: var(--border-strong);
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-light);
        }

        .modal-buttons {
            display: flex;
            gap: var(--space-3);
            margin-top: var(--space-6);
        }

        .modal-buttons button {
            flex: 1;
            padding: var(--space-3) var(--space-4);
            border: none;
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-base);
        }

        .btn-primary {
            background: var(--primary);
            color: white;
        }

        .btn-primary:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
        }

        .btn-danger {
            background: var(--danger);
            color: white;
        }

        .btn-danger:hover {
            background: #dc2626;
            transform: translateY(-1px);
        }

        .close-btn {
            background: none;
            border: none;
            font-size: 1.8rem;
            cursor: pointer;
            color: var(--text-secondary);
            transition: color 0.2s ease;
        }

        .close-btn:hover {
            color: var(--danger);
        }

        .form-group {
            margin-bottom: 18px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 700;
            color: var(--text-primary);
            font-size: 0.9rem;
        }

        .form-group input,
        .form-group select,
        .form-group textarea {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 500;
            transition: all 0.3s ease;
            background: white;
            font-family: inherit;
        }

        .form-group textarea {
            resize: vertical;
            min-height: 80px;
        }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #6366f1;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
        }

        .modal-buttons {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }

        .modal-buttons button {
            flex: 1;
            padding: 12px 20px;
            border: none;
            border-radius: 10px;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            box-shadow: 0 6px 18px rgba(102, 126, 234, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
        }

        .btn-danger {
            background: #ef4444;
            color: white;
            box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
        }

        .btn-danger:hover {
            background: #dc2626;
            transform: translateY(-2px);
        }

        /* Credit Chip */
        .credit-chip {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            padding: 10px 20px;
            border-radius: 25px;
            color: white;
            font-size: 0.85rem;
            font-weight: 600;
            z-index: 100;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        .credit-chip a {
            color: #93c5fd;
            text-decoration: none;
            transition: color 0.2s ease;
        }

        .credit-chip a:hover {
            color: #60a5fa;
        }

        /* Desktop (769px and above) */
        @media (min-width: 769px) {
            .nav-toggle-btn {
                display: flex !important;
            }

            .quick-links-toggle-btn {
                display: flex !important;
            }

            .floating-nav {
                display: flex !important;
            }

            .quick-links {
                display: flex !important;
            }
        }

        /* Responsive */
        /* Tablet only (600px - 768px) - Hide floating nav on tablets */
        @media (min-width: 600px) and (max-width: 768px) {
            /* Hide/reposition floating elements on tablets only */
            .floating-nav {
                display: none;
            }

            .nav-toggle-btn {
                display: none;
            }

            .quick-links-toggle-btn {
                display: none;
            }

            .quick-links {
                display: none;
            }

            html {
                font-size: 14px;
            }

            body {
                padding: 15px;
                padding-top: 180px;
                padding-bottom: 80px;
            }

            .container {
                padding: 0;
                max-width: 100%;
            }

            .top-bar {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                padding: 12px 15px;
                z-index: 1000;
                border-bottom: 2px solid rgba(99, 102, 241, 0.2);
            }

            .top-bar-toggle {
                top: 8px;
                right: 15px;
                width: 36px;
                height: 36px;
                font-size: 1rem;
            }

            .top-bar-content {
                flex-direction: column;
                gap: 10px;
                width: 100%;
            }

            .greeting-card {
                width: 100%;
                min-width: auto;
                padding: 15px 20px;
                gap: 12px;
                border-radius: 15px;
            }

            .greeting-emoji {
                font-size: 2rem;
                min-width: 2rem;
            }

            .greeting-text {
                gap: 3px;
                flex: 1;
            }

            .greeting-time {
                font-size: 0.85rem;
            }

            .greeting-name {
                font-size: 1.2rem;
            }

            .quote-card {
                max-width: 100%;
                width: 100%;
                padding: 15px 20px;
                border-radius: 15px;
                font-size: 0.95rem;
                line-height: 1.5;
            }

            .quote-text {
                font-size: 0.95rem;
            }

            .quote-icon {
                margin-right: 5px;
            }

            .header {
                padding: 25px 20px;
                margin-bottom: 18px;
            }

            .header h1 {
                font-size: 1.6rem;
                gap: 10px;
            }

            #darkModeToggle {
                padding: 6px 10px !important;
                font-size: 1rem !important;
                border-radius: 8px;
            }

            .header .subtitle {
                font-size: 0.95rem;
            }

            .date-badges {
                flex-direction: column;
                gap: 10px;
                width: 100%;
            }

            .date-badge {
                width: 100%;
                padding: 10px 16px;
                font-size: 0.85rem;
                border-radius: 10px;
            }

            .emergency-toggle {
                flex-direction: column;
                gap: 10px;
                margin-top: 12px;
                width: 100%;
            }

            .mode-btn {
                width: 100%;
                padding: 10px 16px;
                font-size: 0.85rem;
                border-radius: 10px;
            }

            .progress-section {
                padding: 18px;
                margin-bottom: 18px;
                border-radius: 15px;
            }

            .progress-header {
                flex-direction: column;
                gap: 8px;
                margin-bottom: 12px;
            }

            .progress-header h2 {
                font-size: 1.3rem;
            }

            .progress-day {
                font-size: 0.85rem;
            }

            .progress-bar-container {
                height: 24px;
                border-radius: 12px;
            }

            .progress-bar {
                font-size: 0.75rem;
                border-radius: 12px;
            }

            .section {
                padding: 18px;
                margin-bottom: 18px;
                border-radius: 15px;
            }

            .section-header {
                flex-direction: column;
                gap: 12px;
                margin-bottom: 16px;
            }

            .section-title {
                font-size: 1.3rem;
                font-weight: 700;
            }

            .add-btn {
                width: 100%;
                padding: 12px 16px;
                font-size: 0.9rem;
                border-radius: 10px;
                border: none;
            }

            .tasks-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .task-card {
                padding: 14px;
                border-radius: 12px;
            }

            .task-title {
                font-size: 0.95rem;
                font-weight: 600;
            }

            .task-time {
                padding: 4px 10px;
                font-size: 0.75rem;
                border-radius: 6px;
            }

            .resources-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .resource-card {
                padding: 15px;
            }

            .resource-title {
                font-size: 1rem;
            }

            .calendar-grid {
                gap: 4px;
                max-width: 100%;
            }

            .calendar-day {
                aspect-ratio: 1;
                font-size: 0.7rem;
            }

            .calendar-day-number {
                font-size: 0.8rem;
            }

            .calendar-day-percent {
                font-size: 0.6rem;
                margin-top: 1px;
            }

            .calendar-day-header {
                font-size: 0.7rem;
                padding: 4px 0;
            }

            .calendar-day.today {
                border: 2px solid #3b82f6;
            }

            .calendar-day.today .calendar-day-number {
                font-size: 0.9rem;
            }

            .stats-grid {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .stat-card {
                padding: 16px;
            }

            .stat-value {
                font-size: 1.8rem;
            }

            .stat-label {
                font-size: 0.85rem;
            }

            .consistency-chart {
                height: 220px;
            }

            .chart-bars {
                height: 160px;
                gap: 3px;
            }

            .planning-tasks {
                grid-template-columns: 1fr;
                gap: 12px;
            }

            .planning-task {
                padding: 16px;
            }

            .planning-task-header {
                font-size: 1rem;
            }

            .steps-container {
                margin-left: 32px;
                gap: 8px;
            }

            .step-item {
                padding: 8px 10px;
            }

            .step-text {
                font-size: 0.85rem;
            }

            .emoji-picker {
                grid-template-columns: repeat(6, 1fr);
                gap: 6px;
            }

            .emoji-option {
                font-size: 1.3rem;
                padding: 8px;
            }

            .routine-timeline {
                gap: 12px;
            }

            .routine-item {
                padding: 12px;
                gap: 12px;
            }

            .routine-number {
                width: 36px;
                height: 36px;
                font-size: 0.95rem;
            }

            .routine-text {
                font-size: 0.9rem;
            }

            .routine-time {
                font-size: 0.75rem;
                padding: 4px 12px;
            }

            .routine-actions {
                opacity: 1;
                gap: 4px;
            }

            .routine-action-btn {
                font-size: 0.95rem;
            }

            .controls-grid {
                grid-template-columns: 1fr;
                gap: 10px;
            }

            .control-btn {
                padding: 12px 16px;
                font-size: 0.85rem;
                width: 100%;
            }

            .modal-content {
                padding: 24px;
                max-width: 95%;
            }

            .modal-header h3 {
                font-size: 1.4rem;
            }

            .form-group label {
                font-size: 0.85rem;
            }

            .form-group input,
            .form-group select,
            .form-group textarea {
                font-size: 0.9rem;
                padding: 10px 14px;
            }

            .modal-buttons {
                gap: 10px;
            }

            .modal-buttons button {
                padding: 10px 16px;
                font-size: 0.85rem;
            }

            .notes-textarea {
                min-height: 150px;
                font-size: 0.9rem;
            }

            .day-details-content {
                padding: 24px;
                max-width: 95%;
            }

            .day-task-item {
                padding: 10px 12px;
                gap: 10px;
                margin-bottom: 6px;
            }

            .day-task-icon {
                font-size: 1.3rem;
            }

            .day-task-title {
                font-size: 0.9rem;
            }

            .day-task-status {
                font-size: 0.75rem;
                padding: 3px 10px;
            }

            .credit-chip {
                display: none; /* Hide on mobile - link moved to coffee popup */
            }

            .nav-btn {
                padding: 6px 12px !important;
                font-size: 1rem !important;
            }

            #routinePicturesGrid {
                grid-template-columns: 1fr !important;
            }

            .routine-picture-card {
                max-height: 300px !important;
            }

            .picture-info-box {
                padding: 10px !important;
            }

            .picture-actions {
                gap: 4px;
            }

            .picture-actions button {
                padding: 6px 8px !important;
                font-size: 0.8rem !important;
            }
        }

        /* Extra small devices (under 480px) */
        /* Small Mobile (480px and below) */
        @media (max-width: 480px) {
            html {
                font-size: 12px;
            }

            body {
                padding: 10px;
                padding-top: 150px;
                padding-bottom: 20px;
            }

            .container {
                padding: 0;
                max-width: 100%;
            }

            .top-bar {
                padding: 10px 12px;
            }

            .top-bar-content {
                flex-wrap: wrap;
                gap: 6px;
                width: calc(100% - 80px);
                align-items: center;
            }

            .header {
                padding: 18px 15px;
                margin-bottom: 14px;
            }

            .header h1 {
                font-size: 1.3rem;
                gap: 8px;
            }

            .header .subtitle {
                font-size: 0.9rem;
            }

            .greeting-card {
                padding: 6px 10px;
                gap: 6px;
                font-size: 0.8rem;
                flex-shrink: 1;
            }

            .greeting-emoji {
                display: none;
            }

            .greeting-time {
                font-size: 0.6rem;
            }

            .greeting-name {
                font-size: 0.8rem;
            }

            .quote-card {
                width: 100%;
                flex: unset;
                max-width: 100%;
                min-width: 0;
                padding: 5px 10px;
                font-size: 0.7rem;
                line-height: 1.3;
                overflow: hidden;
                order: 3;
            }

            .quote-text {
                font-size: 0.7rem;
                line-height: 1.3;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            .date-badges {
                gap: 8px;
            }

            .date-badge {
                padding: 8px 12px;
                font-size: 0.8rem;
            }

            .mode-btn {
                padding: 8px 12px;
                font-size: 0.8rem;
            }

            .section {
                padding: 14px;
                margin-bottom: 14px;
            }

            .section-title {
                font-size: 1.1rem;
            }

            .progress-header h2 {
                font-size: 1.1rem;
            }

            .modal-content {
                padding: 18px;
                margin: 0 10px;
            }

            .emoji-picker {
                grid-template-columns: repeat(5, 1fr);
                gap: 8px;
            }

            .emoji-picker-item {
                font-size: 1.2rem;
                padding: 8px;
            }

            .calendar-day {
                font-size: 0.6rem;
                padding: 3px;
                overflow: hidden;
            }

            .calendar-day-number {
                font-size: 0.65rem;
            }

            .add-btn {
                padding: 10px 12px;
                font-size: 0.8rem;
            }

            .task-card {
                padding: 12px;
            }

            .task-title {
                font-size: 0.9rem;
            }

            .modal-header h2,
            .modal-header h3 {
                font-size: 1.1rem;
            }

            .form-group label {
                font-size: 0.9rem;
            }

            .form-group input,
            .form-group textarea,
            .form-group select {
                font-size: 0.9rem;
                padding: 8px 10px;
            }

            .btn-primary,
            .btn-danger {
                padding: 10px 12px;
                font-size: 0.85rem;
            }
        }

        /* Extra Small Mobile (320px - for very small phones) */
        @media (max-width: 360px) {
            html {
                font-size: 11px;
            }

            body {
                padding: 8px;
                padding-top: 140px;
                padding-bottom: 15px;
            }

            .header h1 {
                font-size: 1.1rem;
            }

            .section-title {
                font-size: 1rem;
            }

            .greeting-emoji {
                font-size: 1.2rem;
            }

            .emoji-picker {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        .hidden {
            display: none;
        }

        /* Day Details Modal */
        .day-details-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .day-details-modal.active {
            display: flex;
        }

        .day-details-content {
            background: white;
            padding: 32px;
            border-radius: 20px;
            max-width: 700px;
            width: 100%;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
            animation: modalSlideIn 0.3s ease-out;
            max-height: 90vh;
            overflow-y: auto;
        }

        .day-task-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 60px 12px 12px;
            background: #f8fafc;
            border-radius: 10px;
            margin-bottom: 8px;
            border: 2px solid #e5e7eb;
        }

        .day-task-item.completed {
            background: #d1fae5;
            border-color: #34d399;
        }

        .day-task-item.incomplete {
            background: #fee2e2;
            border-color: #f87171;
        }

        .day-task-icon {
            font-size: 1.5rem;
        }

        .day-task-title {
            flex: 1;
            font-weight: 600;
            color: var(--text-primary);
        }

        .day-task-status {
            font-size: 0.85rem;
            font-weight: 700;
            padding: 4px 12px;
            border-radius: 12px;
        }

        .day-task-status.completed {
            background: #10b981;
            color: white;
        }

        .day-task-status.incomplete {
            background: #ef4444;
            color: white;
        }

        /* Notes Section */
        .notes-section {
            background: rgba(255, 255, 255, 0.95);
            padding: 28px;
            border-radius: 24px;
            margin-bottom: 24px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
            border: 1px solid rgba(255, 255, 255, 0.3);
        }

        .notes-textarea {
            width: 100%;
            min-height: 200px;
            padding: var(--space-4);
            border: 1px solid var(--border-default);
            border-radius: var(--radius-lg);
            font-size: 0.9rem;
            font-family: inherit;
            resize: vertical;
            transition: all var(--transition-fast);
            background: var(--bg-tertiary);
            color: var(--text-primary);
            line-height: 1.6;
        }

        .notes-textarea::placeholder {
            color: var(--text-tertiary);
        }

        .notes-textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-light);
            background: var(--bg-secondary);
        }

        body.dark-mode .notes-textarea {
            background: var(--bg-tertiary);
            border-color: var(--border-strong);
        }

        body.dark-mode .notes-textarea:focus {
            background: var(--bg-secondary);
        }

        /* Emergency notification badge in header */
        .emergency-notification {
            position: relative;
        }

        .emergency-badge {
            position: absolute;
            top: -6px;
            right: -6px;
            background: var(--danger);
            color: white;
            font-size: 0.75rem;
            font-weight: 700;
            width: 20px;
            height: 20px;
            border-radius: var(--radius-full);
            display: none;
            align-items: center;
            justify-content: center;
            border: 2px solid white;
            box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
            animation: none;
            line-height: 1;
            padding: 0;
            min-width: unset;
            text-align: center;
        }

        body.dark-mode .emergency-badge {
            border-color: var(--bg-secondary);
        }

        .emergency-badge:not(:empty) {
            display: flex;
        }

        @keyframes badgePulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        /* ═══════════════════════════════════════════════════════════════
           POMODORO TIMER - Premium Focus Mode
           ═══════════════════════════════════════════════════════════════ */
        
        .pomodoro-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(12px);
            z-index: 99000;
            align-items: center;
            justify-content: center;
            padding: var(--space-4);
            overflow-y: auto;
        }

        .pomodoro-modal.active {
            display: flex;
        }

        .pomodoro-container {
            background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
            border-radius: var(--radius-xl);
            max-width: 380px;
            width: 100%;
            max-height: calc(100vh - 32px);
            max-height: calc(100dvh - 32px);
            overflow-y: auto;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 60px rgba(99, 102, 241, 0.15);
            animation: pomodoroSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            border: 1px solid var(--border-default);
            position: relative;
            scrollbar-width: thin;
            scrollbar-color: var(--border-default) transparent;
        }

        .pomodoro-container::-webkit-scrollbar {
            width: 6px;
        }

        .pomodoro-container::-webkit-scrollbar-track {
            background: transparent;
        }

        .pomodoro-container::-webkit-scrollbar-thumb {
            background: var(--border-default);
            border-radius: 3px;
        }

        body.dark-mode .pomodoro-container {
            background: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(99, 102, 241, 0.2);
        }

        @keyframes pomodoroSlideIn {
            from {
                transform: scale(0.8) translateY(40px);
                opacity: 0;
            }
            to {
                transform: scale(1) translateY(0);
                opacity: 1;
            }
        }

        .pomodoro-header {
            padding: 14px 20px 12px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid var(--border-subtle);
        }

        .pomodoro-header h2 {
            font-size: 1.1rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 8px;
            background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .pomodoro-beeps {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .pomodoro-beep {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            display: inline-block;
            box-shadow: 0 0 0 2px var(--glass-border);
            animation: pulse 1.6s ease-in-out infinite;
        }

        .pomodoro-beep.beep-focus {
            background: var(--success);
        }

        .pomodoro-beep.beep-running {
            background: var(--success);
            opacity: 0.75;
        }

        .pomodoro-beep.beep-alarm {
            background: var(--warning);
        }

        .alarm-status-dot {
            font-size: 12px;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.1); }
        }

        .pomodoro-close {
            background: var(--bg-tertiary);
            border: 1px solid var(--border-default);
            width: 32px;
            height: 32px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 1rem;
            transition: all var(--transition-fast);
            color: var(--text-secondary);
        }

        .pomodoro-close:hover {
            background: var(--danger-light);
            color: var(--danger);
            border-color: var(--danger);
        }

        .pomodoro-close.minimize-btn:hover {
            background: var(--primary-light);
            color: var(--primary);
            border-color: var(--primary);
            transform: none;
        }

        /* Session Type Tabs */
        .pomodoro-tabs {
            display: flex;
            padding: 12px 20px 10px;
            gap: 6px;
        }

        .pomodoro-tab {
            flex: 1;
            padding: 8px 6px;
            border-radius: var(--radius-md);
            border: none;
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-fast);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        .pomodoro-tab:hover {
            background: var(--primary-light);
            color: var(--primary);
        }

        .pomodoro-tab.active {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
        }

        .pomodoro-tab.active.break-tab {
            background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        }

        .pomodoro-tab.active.long-break-tab {
            background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
            box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
        }

        /* Timer Display */
        .pomodoro-timer-section {
            padding: 16px 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .timer-circle-container {
            position: relative;
            width: 180px;
            height: 180px;
            margin-bottom: 16px;
            /* Remove problematic styles that cause positioning issues */
        }

        .timer-circle-bg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        .timer-circle-progress {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        .timer-circle-bg circle {
            fill: none;
            stroke: var(--border-default);
            stroke-width: 6;
            cx: 90;
            cy: 90;
            r: 80;
        }

        .timer-circle-progress circle {
            fill: none;
            stroke: url(#pomodoroGradient);
            stroke-width: 6;
            stroke-linecap: round;
            stroke-dasharray: 502.65; /* 2 * π * 80 = ~502.65 */
            stroke-dashoffset: 0;
            transition: stroke-dashoffset 1s linear;
        }

        .timer-circle-progress.break circle {
            stroke: url(#breakGradient);
        }

        .timer-circle-progress.long-break circle {
            stroke: url(#longBreakGradient);
        }

        .timer-display {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            pointer-events: none;
        }

        .timer-time {
            font-size: 2.5rem;
            font-weight: 900;
            font-family: 'Inter', monospace;
            letter-spacing: -2px;
            font-variant-numeric: tabular-nums;
            font-feature-settings: 'tnum' 1;
            min-width: 6ch;
            text-align: center;
            background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1;
        }

        .timer-label {
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-tertiary);
            margin-top: 2px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        /* Animated pulse when running */
        .timer-circle-container.running .timer-display {
            animation: timerPulse 2s ease-in-out infinite;
        }

        @keyframes timerPulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.85; }
        }

        /* Timer Controls */
        .pomodoro-controls {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-bottom: 6px;
        }

        .pomodoro-btn {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all var(--transition-spring);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .pomodoro-btn.primary {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .pomodoro-btn.primary:hover {
            transform: scale(1.08);
            box-shadow: 0 10px 30px rgba(99, 102, 241, 0.5);
        }

        .pomodoro-btn.primary.running {
            background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
            box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
        }

        .pomodoro-btn.secondary {
            background: var(--bg-tertiary);
            border: 2px solid var(--border-default);
            color: var(--text-secondary);
        }

        .pomodoro-btn.secondary:hover {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
            transform: scale(1.05);
        }

        /* Session Counter */
        .session-counter {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-top: 12px;
            padding: 10px 16px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-full);
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-secondary);
        }

        .session-dots {
            display: flex;
            gap: 6px;
        }

        .session-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--border-default);
            transition: all var(--transition-fast);
        }

        .session-dot.completed {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
        }

        /* Settings Panel */
        .pomodoro-settings {
            padding: 16px 24px;
            border-top: 1px solid var(--border-subtle);
            display: none;
        }

        .pomodoro-settings.active {
            display: block;
        }

        .settings-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
        }

        .settings-row label {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .settings-row input[type="number"] {
            width: 70px;
            padding: 8px 12px;
            border: 2px solid var(--border-default);
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            font-weight: 600;
            text-align: center;
            background: var(--bg-tertiary);
            color: var(--text-primary);
            transition: all var(--transition-fast);
        }

        .settings-row input[type="number"]:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px var(--primary-light);
        }

        /* Sound Toggle Switch */
        .sound-toggle {
            position: relative;
            width: 48px;
            height: 26px;
            background: var(--border-default);
            border-radius: var(--radius-full);
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .sound-toggle.active {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        }

        .sound-toggle::after {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
            transition: all var(--transition-fast);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }

        .sound-toggle.active::after {
            left: 25px;
        }

        /* Tips Section */
        .pomodoro-tips {
            padding: 16px 24px 20px;
            border-top: 1px solid var(--border-subtle);
        }

        .tips-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            cursor: pointer;
            padding: 8px 0;
        }

        .tips-header h4 {
            font-size: 0.9rem;
            font-weight: 700;
            color: var(--text-primary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .tips-toggle-icon {
            transition: transform var(--transition-fast);
            color: var(--text-tertiary);
        }

        .tips-toggle-icon.expanded {
            transform: rotate(180deg);
        }

        .tips-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
        }

        .tips-content.expanded {
            max-height: 400px;
        }

        .tip-card {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
            border: 1px solid rgba(99, 102, 241, 0.2);
            border-radius: var(--radius-md);
            padding: 12px 14px;
            margin-top: 12px;
            font-size: 0.85rem;
            line-height: 1.5;
            color: var(--text-secondary);
        }

        .tip-card strong {
            color: var(--primary);
        }

        .tip-card:first-child {
            margin-top: 8px;
        }

        /* Bottom Actions */
        .pomodoro-footer {
            display: flex;
            padding: 12px 24px 20px;
            gap: 10px;
        }

        .footer-btn {
            flex: 1;
            padding: 12px 16px;
            border-radius: var(--radius-md);
            border: none;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all var(--transition-fast);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .footer-btn.settings-btn {
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            border: 1px solid var(--border-default);
        }

        .footer-btn.settings-btn:hover {
            background: var(--primary-light);
            color: var(--primary);
            border-color: var(--primary);
        }

        .footer-btn.settings-btn.active {
            background: var(--primary-light);
            color: var(--primary);
            border-color: var(--primary);
        }

        /* ═══════════════════════════════════════════════════════════════
           ALARM MODAL - Separate Window
           ═══════════════════════════════════════════════════════════════ */
        
        .alarm-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(12px);
            z-index: 100000;
            align-items: center;
            justify-content: center;
            padding: var(--space-4);
        }

        .alarm-modal.active {
            display: flex;
        }

        .alarm-modal-container {
            background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
            border-radius: var(--radius-xl);
            max-width: 400px;
            width: 100%;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
            animation: pomodoroSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            border: 1px solid var(--border-default);
        }

        .alarm-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-subtle);
        }

        .alarm-modal-header h2 {
            font-size: 1.2rem;
            font-weight: 800;
            background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .alarm-section {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-subtle);
        }

        .alarm-section:last-child {
            border-bottom: none;
        }

        .alarm-section h3 {
            font-size: 0.95rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 12px;
        }

        /* Quick Timer */
        .quick-timer-inputs {
            display: flex;
            align-items: center;
            gap: 10px;
            flex-wrap: wrap;
        }

        .timer-input-group {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .timer-number-input {
            width: 60px;
            padding: 10px;
            border-radius: var(--radius-md);
            border: 2px solid var(--border-default);
            background: var(--bg-tertiary);
            color: var(--text-primary);
            font-size: 1.1rem;
            font-weight: 700;
            text-align: center;
        }

        .timer-number-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .timer-input-group span {
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 600;
        }

        .quick-timer-btn {
            padding: 10px 20px;
            border-radius: var(--radius-full);
            border: none;
            background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
            color: white;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .quick-timer-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        }

        .quick-timer-display {
            margin-top: 16px;
            padding: 20px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-lg);
            text-align: center;
        }

        .circular-timer-wrapper {
            position: relative;
            width: 160px;
            height: 160px;
            margin: 0 auto 16px;
        }

        .circular-timer {
            width: 100%;
            height: 100%;
            transform: rotate(-90deg);
        }

        .circular-timer-bg {
            fill: none;
            stroke: var(--bg-secondary);
            stroke-width: 8;
        }

        .circular-timer-progress {
            fill: none;
            stroke: url(#timerGradient);
            stroke-width: 8;
            stroke-linecap: round;
            stroke-dasharray: 283;
            stroke-dashoffset: 0;
            transition: stroke-dashoffset 0.3s ease;
        }

        .circular-timer-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }

        #quickTimerTime {
            font-size: 2rem;
            font-weight: 900;
            font-family: 'Inter', monospace;
            background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .quick-timer-controls {
            display: flex;
            justify-content: center;
            gap: 10px;
            margin-top: 12px;
        }

        .quick-timer-controls button {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: none;
            background: var(--bg-secondary);
            font-size: 1.2rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .quick-timer-controls button:hover {
            background: var(--primary);
            transform: scale(1.1);
        }

        /* Scheduled Alarms */
        .scheduled-alarms {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .alarm-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-lg);
        }

        .alarm-time-input-big {
            flex: 1;
            padding: 12px 16px;
            border-radius: var(--radius-md);
            border: 2px solid var(--border-default);
            background: var(--bg-secondary);
            color: var(--text-primary);
            font-size: 1.2rem;
            font-weight: 700;
            font-family: 'Inter', monospace;
        }

        .alarm-time-input-big:focus {
            outline: none;
            border-color: var(--primary);
        }

        /* 12-Hour Time Picker */
        .alarm-time-picker {
            display: flex;
            align-items: center;
            gap: 4px;
            background: var(--bg-tertiary);
            padding: 8px 12px;
            border-radius: var(--radius-lg);
            border: 2px solid var(--border-default);
        }

        .alarm-time-select {
            background: var(--bg-secondary);
            border: none;
            color: var(--text-primary);
            font-size: 1.1rem;
            font-weight: 700;
            font-family: 'Inter', monospace;
            padding: 8px 4px;
            border-radius: var(--radius-sm);
            cursor: pointer;
            text-align: center;
            appearance: none;
            -webkit-appearance: none;
        }

        .alarm-time-select:focus {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        .alarm-time-select.ampm {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            padding: 8px 10px;
            font-size: 0.9rem;
        }
        
        body.dark-mode .alarm-time-select.ampm {
            color: var(--text-primary);
            background: var(--bg-secondary);
            border: 2px solid var(--border-default);
        }

        .alarm-time-input {
            background: var(--bg-secondary);
            border: none;
            color: var(--text-primary);
            font-size: 1.1rem;
            font-weight: 700;
            font-family: 'Inter', monospace;
            padding: 8px 4px;
            border-radius: var(--radius-sm);
            text-align: center;
            width: 50px;
            -moz-appearance: textfield;
        }

        .alarm-time-input::-webkit-outer-spin-button,
        .alarm-time-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .alarm-time-input:focus {
            outline: 2px solid var(--primary);
            outline-offset: 2px;
        }

        .time-separator {
            color: var(--text-primary);
            font-size: 1.2rem;
            font-weight: 800;
        }

        .alarm-row-label {
            font-size: 0.85rem;
            color: var(--text-tertiary);
            min-width: 60px;
        }

        /* Toggle Switch Style */
        .alarm-toggle-btn {
            position: relative;
            width: 60px;
            height: 32px;
            border-radius: 16px;
            border: none;
            background: var(--bg-tertiary);
            cursor: pointer;
            transition: all 0.3s ease;
            padding: 0;
            overflow: hidden;
        }

        .alarm-toggle-btn .toggle-slider {
            position: absolute;
            left: 4px;
            top: 4px;
            width: 24px;
            height: 24px;
            background: white;
            border-radius: 50%;
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .alarm-toggle-btn .toggle-label {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.65rem;
            font-weight: 800;
            color: var(--text-tertiary);
            transition: all 0.3s ease;
        }

        .alarm-toggle-btn:hover {
            background: var(--bg-secondary);
        }

        .alarm-toggle-btn.active {
            background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
        }

        .alarm-toggle-btn.active .toggle-slider {
            left: calc(100% - 28px);
        }

        .alarm-toggle-btn.active .toggle-label {
            left: 8px;
            right: auto;
            color: white;
        }

        /* Alarm Toast Notification */
        .alarm-toast {
            position: fixed;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            padding: 14px 24px;
            border-radius: 50px;
            font-size: 0.95rem;
            font-weight: 700;
            z-index: 9999999;
            opacity: 0;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .alarm-toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        .alarm-toast-success {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
        }

        .alarm-toast-warning {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            color: white;
        }

        .alarm-toast-info {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
        }

        /* Shake animation for invalid input */
        .shake-input {
            animation: shakeInput 0.5s ease-in-out;
        }

        @keyframes shakeInput {
            0%, 100% { transform: translateX(0); }
            20% { transform: translateX(-8px); }
            40% { transform: translateX(8px); }
            60% { transform: translateX(-6px); }
            80% { transform: translateX(6px); }
        }

        /* Old inline alarm section hidden - using modal instead */
        .pomodoro-alarms {
            display: none;
        }

        /* Alarm Notification Overlay — z-index max to force on top */
        .alarm-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.95);
            backdrop-filter: blur(20px);
            z-index: 2147483647;
            align-items: center;
            justify-content: center;
            padding: var(--space-4);
        }

        .alarm-overlay.active {
            display: flex;
        }

        .alarm-content {
            background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
            border-radius: var(--radius-xl);
            padding: 30px;
            text-align: center;
            animation: alarmPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
            max-width: 340px;
            width: 100%;
            box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
        }

        body.dark-mode .alarm-content {
            background: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
        }

        @keyframes alarmPop {
            0% { transform: scale(0.5); opacity: 0; }
            70% { transform: scale(1.05); }
            100% { transform: scale(1); opacity: 1; }
        }

        .alarm-emoji {
            font-size: 4rem;
            margin-bottom: 12px;
            animation: alarmBounce 0.6s ease-in-out infinite;
        }

        @keyframes alarmBounce {
            0%, 100% { transform: translateY(0) scale(1); }
            50% { transform: translateY(-10px) scale(1.1); }
        }

        .alarm-title {
            font-size: 1.5rem;
            font-weight: 800;
            margin-bottom: 6px;
            background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .alarm-subtitle {
            font-size: 0.9rem;
            color: var(--text-secondary);
            margin-bottom: 16px;
        }

        .alarm-buttons {
            display: flex;
            flex-direction: row;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .alarm-btn {
            padding: 14px 30px;
            border-radius: var(--radius-full);
            border: none;
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
            color: white;
            font-size: 0.95rem;
            font-weight: 700;
            cursor: pointer;
            transition: all var(--transition-spring);
            box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
        }

        .alarm-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
        }

        .alarm-btn.break-choice {
            padding: 12px 24px;
            font-size: 0.9rem;
            background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
        }

        .alarm-btn.break-choice.long {
            background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
            box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
        }

        .alarm-btn.dismiss-btn {
            margin-top: 8px;
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            box-shadow: none;
            padding: 10px 20px;
            font-size: 0.85rem;
        }

        .alarm-btn.dismiss-btn:hover {
            background: var(--border-default);
        }

        .alarm-btn.break-btn {
            background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
            box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
        }

        /* Alarm slots in pomodoro */
        .pomodoro-alarms {
            padding: 0 20px 12px;
        }

        .alarms-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 8px 0;
            cursor: pointer;
            user-select: none;
        }

        .alarms-header h4 {
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--text-primary);
            margin: 0;
        }

        .alarms-toggle-icon {
            font-size: 0.7rem;
            color: var(--text-tertiary);
            transition: transform 0.3s ease;
        }

        .alarms-content.active ~ .alarms-toggle-icon,
        .alarms-content[style*="block"] ~ .alarms-toggle-icon {
            transform: rotate(180deg);
        }

        .alarms-content {
            display: none;
            padding-top: 8px;
        }

        .alarm-slot {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px;
            background: var(--bg-tertiary);
            border-radius: var(--radius-md);
            margin-bottom: 8px;
        }

        .alarm-time-input {
            flex: 1;
            background: var(--bg-secondary);
            border: 1px solid var(--border-default);
            border-radius: var(--radius-sm);
            padding: 6px 10px;
            font-size: 0.85rem;
            color: var(--text-primary);
            font-weight: 600;
        }

        .alarm-time-input:focus {
            outline: none;
            border-color: var(--primary);
        }

        .alarm-label {
            font-size: 0.75rem;
            color: var(--text-tertiary);
            min-width: 50px;
        }

        .alarm-set-btn {
            padding: 6px 12px;
            border-radius: var(--radius-full);
            border: none;
            background: var(--border-default);
            color: var(--text-secondary);
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .alarm-set-btn:hover {
            background: var(--primary);
            color: white;
        }

        .alarm-set-btn.active {
            background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
            color: white;
        }

        /* Pomodoro Button in Header */
        #pomodoroBtn {
            position: relative;
        }

        #pomodoroBtn::before {
            content: '';
            position: absolute;
            top: -2px;
            right: -2px;
            width: 10px;
            height: 10px;
            background: #10b981;
            border-radius: 50%;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        #pomodoroBtn.timer-active::before {
            opacity: 1;
            animation: timerIndicator 1.5s ease-in-out infinite;
        }

        @keyframes timerIndicator {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.7; }
        }

        /* Mobile Responsive */
        @media (max-width: 480px) {
            .pomodoro-container {
                max-width: 100%;
                margin: 10px;
                border-radius: var(--radius-lg);
            }

            .timer-circle-container {
                width: 180px;
                height: 180px;
            }

            .timer-time {
                font-size: 2.8rem;
            }

            .pomodoro-tabs {
                padding: 12px 16px 8px;
            }

            .pomodoro-tab {
                padding: 8px 6px;
                font-size: 0.75rem;
            }

            .pomodoro-btn {
                width: 50px;
                height: 50px;
                font-size: 1.2rem;
            }
            
            /* Mini Timer Mobile */
            .mini-timer {
                padding: 10px 16px;
                gap: 12px;
                border-radius: 40px;
            }
            
            .mini-timer-emoji {
                font-size: 1.2rem;
            }
            
            .mini-timer-time {
                font-size: 1.2rem;
            }
            
            .mini-timer-label {
                font-size: 0.6rem;
            }
            
            .mini-timer-btn {
                width: 32px;
                height: 32px;
                font-size: 0.9rem;
            }
        }

        /* ═══════════════════════════════════════════════════════════════
           PREVENT TEXT SELECTION ON INTERACTIVE ELEMENTS
           ═══════════════════════════════════════════════════════════════ */
        
        .pomodoro-btn,
        .pomodoro-tab,
        .pomodoro-close,
        .footer-btn,
        .alarm-btn,
        .sound-toggle,
        .tips-header,
        .session-counter,
        .nav-chip,
        .quick-link,
        .add-link-btn,
        .mode-btn,
        .control-btn,
        .greeting-card,
        .quote-card,
        .greeting-emoji,
        .greeting-text,
        .quote-text,
        .quote-text *,
        .quote-icon,
        .greeting-card *,
        .quote-card *,
        .nav-toggle-btn,
        .quick-links-toggle-btn,
        .top-bar-toggle,
        .top-bar-minimized-view,
        .top-bar-minimized-view *,
        button,
        button * {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        /* ═══════════════════════════════════════════════════════════════
           TOP BAR MINIMIZE FEATURE
           ═══════════════════════════════════════════════════════════════ */
        
        .top-bar-minimize-btn {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            transition: all 0.2s ease;
            z-index: 10;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        .top-bar-minimize-btn span {
            user-select: none;
            -webkit-user-select: none;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .top-bar-minimize-btn svg {
            width: 18px;
            height: 18px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        .top-bar-minimize-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            color: var(--text-primary);
        }

        body.dark-mode .top-bar-minimize-btn {
            background: rgba(255, 255, 255, 0.05);
            border-color: rgba(255, 255, 255, 0.1);
        }

        .top-bar.minimized {
            transform: translateY(-100%);
            opacity: 0;
            pointer-events: none;
        }

        .top-bar.minimized .top-bar-content {
            display: none;
        }

        .top-bar.minimized .top-bar-minimized-view {
            display: none;
        }

        .top-bar.minimized .top-bar-minimize-btn {
            display: none;
        }

        .top-bar-minimized-view {
            display: none;
            align-items: center;
            justify-content: center;
            gap: 12px;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        /* ═══════════════════════════════════════════════════════════════
           FLOATING MINI TIMER (when minimized during session)
           ═══════════════════════════════════════════════════════════════ */
        
        .mini-timer {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(139, 92, 246, 0.95) 100%);
            backdrop-filter: blur(20px);
            padding: 12px 24px;
            border-radius: 50px;
            display: none;
            align-items: center;
            gap: 16px;
            z-index: 2500;
            box-shadow: 0 10px 40px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
            cursor: grab;
            transition: box-shadow 0.3s ease, transform 0.1s ease;
            animation: miniTimerSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            touch-action: none;
            user-select: none;
            /* Ensure it starts in center bottom by default */
            right: auto;
        }

        .mini-timer.dragging {
            cursor: grabbing;
            transform: scale(1.05);
            box-shadow: 0 15px 50px rgba(99, 102, 241, 0.6);
            transition: none;
        }

        .mini-timer.active {
            display: flex;
        }

        /* Hide mini timer when pomodoro modal is open */
        .pomodoro-modal.active ~ .mini-timer {
            display: none !important;
        }

        .mini-timer.break-mode {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.95) 0%, rgba(6, 182, 212, 0.95) 100%);
            box-shadow: 0 10px 40px rgba(16, 185, 129, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
        }

        .mini-timer.long-break-mode {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.95) 0%, rgba(236, 72, 153, 0.95) 100%);
            box-shadow: 0 10px 40px rgba(245, 158, 11, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
        }

        .mini-timer.quick-timer-mode {
            background: linear-gradient(135deg, rgba(236, 72, 153, 0.95) 0%, rgba(245, 158, 11, 0.95) 100%);
            box-shadow: 0 10px 40px rgba(236, 72, 153, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
        }

        @keyframes miniTimerSlideUp {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0);
            }
        }

        .mini-timer-emoji {
            font-size: 1.5rem;
        }

        .mini-timer-time {
            font-size: 1.4rem;
            font-weight: 800;
            color: white;
            font-family: 'Inter', monospace;
            letter-spacing: -1px;
        }

        .mini-timer-label {
            font-size: 0.7rem;
            font-weight: 600;
            color: rgba(255, 255, 255, 0.8);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .mini-timer-controls {
            display: flex;
            gap: 8px;
        }

        .mini-timer-btn {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: rgba(255, 255, 255, 0.2);
            color: white;
            font-size: 1rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .mini-timer-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        /* Timer Running Indicator Dot (Green) */
        .timer-running-dot {
            position: absolute;
            top: -3px;
            right: -3px;
            width: 12px;
            height: 12px;
            background: #22c55e;
            border-radius: 50%;
            border: 2px solid white;
            animation: timerPulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
        }

        @keyframes timerPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.8; }
        }

        /* Time Adjustment Buttons */
        .time-adjust-controls {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
        }

        .time-adjust-btn {
            width: 36px;
            height: 32px;
            border-radius: 8px;
            border: 2px solid var(--border-default);
            background: var(--bg-tertiary);
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            user-select: none;
        }

        .time-adjust-btn.big {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
            border-color: rgba(99, 102, 241, 0.4);
            color: var(--primary);
        }

        .time-adjust-btn:hover {
            background: var(--primary-light);
            border-color: var(--primary);
            color: var(--primary);
            transform: scale(1.05);
        }

        .time-adjust-btn.big:hover {
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
        }

        .time-adjust-btn:active {
            transform: scale(0.95);
        }

        /* Sound Toggle in Header */
        .pomodoro-sound-toggle {
            width: 36px;
            height: 36px;
            border-radius: var(--radius-md);
            border: 1px solid var(--border-default);
            background: var(--bg-tertiary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.1rem;
            transition: all 0.2s ease;
            color: var(--text-secondary);
        }

        .pomodoro-sound-toggle:hover {
            background: var(--primary-light);
            border-color: var(--primary);
        }

        .pomodoro-sound-toggle.muted {
            color: var(--danger);
            border-color: var(--danger);
            background: var(--danger-light);
        }

        .pomodoro-sound-toggle.active {
            background: var(--primary);
            border-color: var(--primary);
            color: white;
        }

        /* Alarm Indicator Button with Dots */
        .alarm-indicator-btn {
            position: relative;
        }

        .alarm-active-dot {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 8px;
            height: 8px;
            background: #f59e0b;
            border-radius: 50%;
            animation: dotPulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 6px #f59e0b;
        }

        .timer-active-dot {
            position: absolute;
            top: 2px;
            left: 2px;
            width: 8px;
            height: 8px;
            background: #10b981;
            border-radius: 50%;
            animation: dotPulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 6px #10b981;
        }

        /* Main Pomodoro Button Dots */
        .main-alarm-dot {
            position: absolute;
            top: -2px;
            left: 50%;
            right: auto;
            width: 10px;
            height: 10px;
            background: #f59e0b;
            border-radius: 50%;
            animation: dotPulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 8px #f59e0b;
            border: 2px solid var(--bg-primary);
            transform: translateX(-50%);
        }

        /* Header Alarm Button Dot */
        .header-alarm-dot {
            position: absolute;
            top: -3px;
            right: -3px;
            width: 8px;
            height: 8px;
            background: #f59e0b;
            border-radius: 50%;
            animation: dotPulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 6px #f59e0b;
            border: 1.5px solid var(--bg-secondary);
        }

        .main-timer-dot {
            position: absolute;
            top: -2px;
            left: -2px;
            width: 10px;
            height: 10px;
            background: #10b981;
            border-radius: 50%;
            animation: dotPulse 1.5s ease-in-out infinite;
            box-shadow: 0 0 8px #10b981;
            border: 2px solid var(--bg-primary);
        }

        @keyframes dotPulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.6; transform: scale(0.8); }
        }

        /* Floating Motivation Text - Full Screen Random */
        .floating-motivation {
            position: fixed;
            pointer-events: none;
            font-size: 1.4rem;
            font-weight: 800;
            z-index: 9999;
            animation: floatMotivation 2s ease-out forwards;
            text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
            padding: 10px 20px;
            background: rgba(0, 0, 0, 0.7);
            border-radius: 12px;
            backdrop-filter: blur(10px);
        }

        @keyframes floatMotivation {
            0% {
                transform: scale(0.5) rotate(0deg);
                opacity: 0;
            }
            20% {
                transform: scale(1.1) rotate(var(--rotate, 10deg));
                opacity: 1;
            }
            80% {
                transform: scale(1) rotate(var(--rotate, 10deg));
                opacity: 1;
            }
            100% {
                transform: scale(0.8) rotate(var(--rotate, 10deg));
                opacity: 0;
            }
        }
    

body { background: #0f172a; color: #e2e8f0; } body.dark-mode { background: #0f172a; color: #e2e8f0; }


        /* Account Modal Styles */
        .account-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .account-modal-backdrop {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            animation: fadeIn 0.3s ease;
        }

        .account-modal-content {
            position: relative;
            background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid rgba(99, 102, 241, 0.3);
            border-radius: 24px;
            padding: 32px;
            max-width: 420px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .account-modal-header {
            text-align: center;
            margin-bottom: 24px;
        }

        .account-modal-title {
            font-size: 1.75rem;
            font-weight: 700;
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 8px;
        }

        .account-modal-subtitle {
            font-size: 0.95rem;
            color: var(--text-secondary);
        }

        .account-form-group {
            margin-bottom: 20px;
        }

        .account-form-label {
            display: block;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .account-form-input {
            width: 100%;
            padding: 14px 16px;
            background: var(--bg-secondary);
            border: 2px solid rgba(99, 102, 241, 0.2);
            border-radius: 12px;
            color: var(--text-primary);
            font-size: 0.95rem;
            transition: all 0.3s ease;
            box-sizing: border-box;
        }

        .account-form-input:focus {
            outline: none;
            border-color: rgba(99, 102, 241, 0.6);
            box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
        }

        .account-btn {
            width: 100%;
            padding: 14px 20px;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }

        .account-btn-primary {
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            color: white;
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
        }

        .account-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .account-btn-secondary {
            background: var(--bg-secondary);
            color: var(--text-primary);
            border: 2px solid rgba(99, 102, 241, 0.3);
        }

        .account-btn-secondary:hover {
            background: rgba(99, 102, 241, 0.1);
        }

        .account-divider {
            display: flex;
            align-items: center;
            text-align: center;
            margin: 24px 0;
            color: var(--text-secondary);
            font-size: 0.85rem;
        }

        .account-divider::before,
        .account-divider::after {
            content: '';
            flex: 1;
            border-bottom: 1px solid rgba(99, 102, 241, 0.2);
        }

        .account-divider span {
            padding: 0 12px;
        }

        .account-switch-text {
            text-align: center;
            margin-top: 20px;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .account-switch-link {
            color: #6366f1;
            cursor: pointer;
            font-weight: 600;
            text-decoration: none;
        }

        .account-switch-link:hover {
            text-decoration: underline;
        }

        .account-close-btn {
            position: absolute;
            top: 16px;
            right: 16px;
            background: rgba(99, 102, 241, 0.1);
            border: none;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1.25rem;
            color: var(--text-primary);
            transition: all 0.2s ease;
        }

        .account-close-btn:hover {
            background: rgba(99, 102, 241, 0.2);
            transform: rotate(90deg);
        }

        .account-user-info {
            background: linear-gradient(135deg, rgba(99,102,241,0.1) 0%, rgba(168,85,247,0.1) 100%);
            border: 2px solid rgba(99, 102, 241, 0.3);
            border-radius: 16px;
            padding: 20px;
            margin-bottom: 24px;
            text-align: center;
        }

        .account-user-avatar {
            width: 80px;
            height: 80px;
            border-radius: 50%;
            margin: 0 auto 12px;
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
        }

        .account-user-email {
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .account-user-badge {
            display: inline-block;
            padding: 4px 12px;
            background: rgba(16, 185, 129, 0.2);
            border: 1px solid rgba(16, 185, 129, 0.4);
            border-radius: 12px;
            font-size: 0.75rem;
            color: #10b981;
            font-weight: 600;
        }

        .account-sync-status {
            background: var(--bg-secondary);
            border-radius: 12px;
            padding: 16px;
            margin-bottom: 20px;
        }

        .account-sync-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .account-sync-label {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .account-sync-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.85rem;
        }

        .account-sync-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            animation: pulse 2s infinite;
        }

        .account-sync-dot.online {
            background: #10b981;
        }

        .account-sync-dot.offline {
            background: #f59e0b;
        }

        .account-sync-info {
            font-size: 0.8rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        /* Tour Modal Styles */
        .tour-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 10001;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tour-modal-backdrop {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(10px);
            animation: fadeIn 0.3s ease;
        }

        .tour-content {
            position: relative;
            background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
            border: 2px solid rgba(99, 102, 241, 0.4);
            border-radius: 24px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
            animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            text-align: center;
            z-index: 10002;
            pointer-events: auto;
        }

        .tour-emoji {
            font-size: 4rem;
            margin-bottom: 20px;
            animation: bounce 1s infinite;
        }

        .tour-title {
            font-size: 2rem;
            font-weight: 700;
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-bottom: 16px;
        }

        .tour-description {
            font-size: 1.05rem;
            color: var(--text-secondary);
            line-height: 1.7;
            margin-bottom: 24px;
        }

        .tour-feature-list {
            text-align: left;
            margin: 24px 0;
        }

        .tour-feature-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px;
            background: rgba(99, 102, 241, 0.05);
            border-radius: 12px;
            margin-bottom: 12px;
        }

        .tour-feature-icon {
            font-size: 1.5rem;
            flex-shrink: 0;
        }

        .tour-feature-text {
            flex: 1;
        }

        .tour-feature-title {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .tour-feature-desc {
            font-size: 0.9rem;
            color: var(--text-secondary);
            line-height: 1.5;
        }

        .tour-progress {
            display: flex;
            justify-content: center;
            gap: 8px;
            margin: 24px 0;
        }

        .tour-progress-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(99, 102, 241, 0.3);
            transition: all 0.3s ease;
        }

        .tour-progress-dot.active {
            width: 24px;
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
        }

        .tour-buttons {
            display: flex;
            gap: 12px;
            margin-top: 24px;
            position: relative;
            z-index: 10003;
        }

        .tour-btn {
            flex: 1;
            padding: 14px 20px;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            pointer-events: auto;
            position: relative;
            z-index: 10004;
        }

        .tour-btn-primary {
            background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
            color: white;
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
        }

        .tour-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .tour-btn-secondary {
            background: var(--bg-secondary);
            color: var(--text-primary);
            border: 2px solid rgba(99, 102, 241, 0.3);
        }

        .tour-btn-secondary:hover {
            background: rgba(99, 102, 241, 0.1);
        }

        /* Toast Notification */
        .account-toast {
            position: fixed;
            bottom: 24px;
            right: 24px;
            background: var(--bg-primary);
            border: 2px solid rgba(99, 102, 241, 0.3);
            border-radius: 12px;
            padding: 16px 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            z-index: 10002;
            display: flex;
            align-items: center;
            gap: 12px;
            max-width: 400px;
            animation: slideInFromRight 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .account-toast.success {
            border-color: rgba(16, 185, 129, 0.5);
        }

        .account-toast.error {
            border-color: rgba(239, 68, 68, 0.5);
        }

        .account-toast-icon {
            font-size: 1.5rem;
            flex-shrink: 0;
        }

        .account-toast-message {
            flex: 1;
            font-size: 0.95rem;
            color: var(--text-primary);
        }

        /* Animations */
        @keyframes fadeIn {
            from {
                opacity: 0;
            }
            to {
                opacity: 1;
            }
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(40px) scale(0.9);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        @keyframes slideInFromRight {
            from {
                opacity: 0;
                transform: translateX(100px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes bounce {
            0%, 100% {
                transform: translateY(0);
            }
            50% {
                transform: translateY(-10px);
            }
        }

        @keyframes pulse {
            0%, 100% {
                opacity: 1;
            }
            50% {
                opacity: 0.5;
            }
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .account-modal-content,
            .tour-content {
                padding: 24px;
                width: 95%;
            }

            .account-modal-title,
            .tour-title {
                font-size: 1.5rem;
            }

            .tour-emoji {
                font-size: 3rem;
            }

            .account-toast {
                right: 16px;
                bottom: 16px;
                max-width: calc(100% - 32px);
            }
        }

        /* Inline Task Planning (under each task) */
        .task-planning-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid var(--border-subtle);
        }

        .task-planning-btn,
        .task-planning-add {
            border: 1px solid var(--border-default);
            background: var(--bg-secondary);
            color: var(--text-primary);
            border-radius: 12px;
            padding: 8px 10px;
            font-size: 0.85rem;
            font-weight: 700;
            cursor: pointer;
            transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
        }

        .task-planning-btn {
            flex: 1;
            text-align: left;
        }

        .task-planning-add {
            white-space: nowrap;
            border-color: rgba(99, 102, 241, 0.35);
            background: rgba(99, 102, 241, 0.08);
            color: var(--primary);
        }

        .task-planning-btn:hover,
        .task-planning-add:hover {
            transform: translateY(-1px);
            border-color: var(--border-strong);
        }

        .task-planning-inline {
            margin-top: 10px;
            padding: 10px;
            border-radius: 14px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-subtle);
        }

        .task-planning-empty {
            color: var(--text-secondary);
            font-size: 0.85rem;
            font-weight: 600;
        }

        .task-step-inline {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 10px;
            border-radius: 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border-subtle);
        }

        .task-step-inline + .task-step-inline {
            margin-top: 8px;
        }

        .task-step-inline.completed {
            opacity: 0.8;
        }

        .task-step-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .task-step-text {
            flex: 1;
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
            word-break: break-word;
        }

        .task-step-inline.completed .task-step-text {
            color: var(--text-secondary);
            text-decoration: line-through;
        }

        .task-step-link {
            margin-left: 8px;
            text-decoration: none;
            font-weight: 700;
            color: var(--primary);
        }

        .task-step-actions {
            display: flex;
            gap: 6px;
            flex-shrink: 0;
        }

        .task-step-action {
            border: 1px solid var(--border-default);
            background: var(--bg-secondary);
            border-radius: 10px;
            padding: 6px 8px;
            cursor: pointer;
            font-size: 0.85rem;
            transition: background var(--transition-fast), transform var(--transition-fast);
        }

        .task-step-action:hover {
            background: var(--bg-tertiary);
            transform: translateY(-1px);
        }

        .task-step-action.delete {
            border-color: rgba(239, 68, 68, 0.3);
        }

        /* Task Action Buttons (Edit/Delete on Task Cards) */
        .task-actions {
            display: flex;
            gap: 6px;
            margin-left: auto;
            flex-shrink: 0;
        }

        .task-action-btn {
            border: 1px solid var(--border-default);
            background: var(--bg-secondary);
            border-radius: 10px;
            padding: 6px 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: background var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .task-action-btn:hover {
            background: var(--bg-tertiary);
            transform: translateY(-1px);
        }

        .task-action-btn.delete {
            border-color: rgba(239, 68, 68, 0.3);
        }

        .task-action-btn.delete:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        /* ═══════════════════════════════════════════════════════════════
           HIDDEN TASK ACTIONS - Show on hover/right-click
           Phone: long tap shows context menu
           PC: right-click shows context menu, hover shows buttons
           ═══════════════════════════════════════════════════════════════ */
        .task-actions-hidden {
            opacity: 0;
            transform: translateX(10px);
            transition: opacity 0.2s ease, transform 0.2s ease;
            pointer-events: none;
        }

        /* Desktop: Show on hover */
        @media (hover: hover) and (pointer: fine) {
            .task-card:hover .task-actions-hidden {
                opacity: 1;
                transform: translateX(0);
                pointer-events: auto;
            }
        }

        /* Mobile: Keep hidden (use context menu via long tap) */
        @media (hover: none) and (pointer: coarse) {
            .task-actions-hidden {
                display: none !important;
            }
        }

        /* ═══════════════════════════════════════════════════════════════
           DARK MODE FONT IMPROVEMENTS
           Better readability with proper contrast
           ═══════════════════════════════════════════════════════════════ */
        body.dark-mode {
            --text-primary: #f1f5f9;
            --text-secondary: #a1b4c8;
            --text-tertiary: #78909c;
        }

        body.dark-mode .task-title {
            color: var(--text-primary);
            font-weight: 600;
        }

        body.dark-mode .task-card {
            background: var(--bg-secondary);
            border-color: var(--border-default);
        }

        body.dark-mode .task-card:hover {
            border-color: var(--primary);
        }

        body.dark-mode .task-checkbox {
            border-color: var(--border-strong);
        }

        body.dark-mode .task-time,
        body.dark-mode .task-planning-btn {
            color: var(--text-secondary);
        }

        body.dark-mode .section-title {
            color: var(--text-primary);
        }

        body.dark-mode .progress-text {
            color: var(--text-secondary);
        }

        /* ═══════════════════════════════════════════════════════════════
           BUTTON COLORS - CONSISTENT BOTH MODES
           ═══════════════════════════════════════════════════════════════ */
        .btn-primary,
        .groups-btn.primary,
        .groups-action-btn.create,
        .hub-signin-btn,
        .task-planning-add {
            background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
            color: white !important;
            border: none !important;
        }

        .btn-primary:hover,
        .groups-btn.primary:hover,
        .groups-action-btn.create:hover,
        .hub-signin-btn:hover,
        .task-planning-add:hover {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
            transform: translateY(-1px);
        }

        .btn-secondary,
        .groups-btn.secondary,
        .groups-action-btn.join {
            background: var(--bg-tertiary) !important;
            color: var(--text-primary) !important;
            border: 1px solid var(--border-default) !important;
        }

        body.dark-mode .btn-secondary,
        body.dark-mode .groups-btn.secondary,
        body.dark-mode .groups-action-btn.join {
            background: var(--bg-secondary) !important;
            border-color: var(--border-strong) !important;
        }

        /* Context Menu Dark Mode */
        body.dark-mode .context-menu {
            background: var(--bg-secondary);
            border: 1px solid var(--border-default);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        }

        body.dark-mode .context-menu-item {
            color: var(--text-primary);
        }

        body.dark-mode .context-menu-item:hover {
            background: var(--bg-tertiary);
        }

        body.dark-mode .context-menu-item.delete:hover {
            background: rgba(239, 68, 68, 0.15);
            color: #f87171;
        }
    
/* ============================================================
   PORTED FIXES FROM NETLIFY-MAIN
   ============================================================ */

/* --- Welcome Banner --- */
.welcome-banner {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.welcome-banner-card {
    background: linear-gradient(145deg, #1a1f35 0%, #0f1322 100%);
    border: 2px solid rgba(99,102,241,0.3);
    border-radius: 24px;
    padding: 36px 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: slideUp 0.4s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.welcome-banner-card h2 {
    margin: 0 0 8px; font-size: 1.5rem; color: #fff;
}
.welcome-banner-card .version-tag {
    display: inline-block; padding: 4px 14px; background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 20px; font-size: 0.7rem; font-weight: 700; color: #fff; letter-spacing: 1px; margin-bottom: 16px;
}
.welcome-banner-card p {
    color: rgba(255,255,255,0.7); font-size: 0.9rem; line-height: 1.6; margin: 0 0 12px;
}
.welcome-banner-card .upcoming-badge {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
    background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
    border-radius: 12px; color: #f59e0b; font-size: 0.8rem; font-weight: 600; margin-bottom: 20px;
}
.welcome-banner-login-btn {
    width: 100%; padding: 14px 24px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.welcome-banner-login-btn:hover {
    transform: translateY(-2px); box-shadow: 0 6px 30px rgba(99,102,241,0.4);
}

/* --- Unmute Popup --- */
.unmute-popup {
    position: fixed;
    top: 72px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(145deg, #1a1f35, #0f1322);
    border: 2px solid rgba(245,158,11,0.3);
    border-radius: 20px;
    padding: 28px 24px;
    z-index: 200000;
    text-align: center;
    max-width: 340px;
    width: 85%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: unmuteSlideDown 0.3s ease;
}
@keyframes unmuteSlideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.unmute-popup-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199999;
}

/* --- Desktop Sync Button --- */
.desktop-sync-btn {
    position: fixed;
    top: var(--space-3);
    right: calc(var(--space-6) + 84px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-full);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    font-size: 15px;
    color: var(--text-secondary);
}
.desktop-sync-btn:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
    transform: scale(1.1);
    color: #8b5cf6;
}
.desktop-sync-btn:active {
    transform: scale(0.95);
}
.desktop-sync-btn.syncing .desk-sync-icon {
    animation: desk-sync-spin 0.6s linear infinite;
}
.desktop-sync-btn.sync-done {
    border-color: #10b981;
    color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}
body.dark-mode .desktop-sync-btn {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
}
body.top-bar-hidden .desktop-sync-btn {
    top: 12px;
    right: auto;
    left: 106px;
}
.desk-sync-icon {
    display: inline-block;
    transition: transform 0.2s ease;
}
@keyframes desk-sync-spin {
    to { transform: rotate(360deg); }
}
@media (max-width: 1024px) {
    .desktop-sync-btn {
        display: none !important;
    }
}

/* --- Pull-to-Refresh (PTR) --- */
.ptr-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    pointer-events: none;
    transform: translateY(-80px);
    transition: transform 0.3s cubic-bezier(0.17, 0.67, 0.21, 1.02);
}
.ptr-container.ptr-pulling {
    transition: none;
}
.ptr-container.ptr-visible {
    transform: translateY(0);
}
.ptr-indicator {
    width: 44px;
    height: 44px;
    margin-top: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.ptr-indicator::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: var(--bg-card, #1e293b);
}
.ptr-spinner {
    width: 22px;
    height: 22px;
    border: 2.5px solid transparent;
    border-top-color: #8b5cf6;
    border-right-color: #ec4899;
    border-radius: 50%;
    position: relative;
    z-index: 1;
    transition: transform 0.15s ease;
}
.ptr-container.ptr-pulling .ptr-spinner {
    animation: none;
}
.ptr-container.ptr-refreshing .ptr-spinner {
    animation: ptr-spin 0.7s linear infinite;
}
.ptr-container.ptr-done .ptr-indicator {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}
.ptr-container.ptr-done .ptr-spinner {
    animation: none;
    border-color: transparent;
}
.ptr-container.ptr-done .ptr-spinner::after {
    content: '\2713';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #10b981;
    font-size: 14px;
    font-weight: 800;
}
@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

/* --- Calendar Mobile Fix (600px) --- */
@media (max-width: 600px) {
    .calendar-grid {
        max-width: 100%;
        gap: 2px;
        min-width: unset;
    }

    .calendar-day-header {
        font-size: 0.6rem;
        padding: 4px 0;
        min-height: 18px;
        letter-spacing: 0;
    }

    .calendar-day {
        font-size: 0.65rem;
        border-radius: 8px;
        border-width: 1.5px;
        min-height: 40px;
        aspect-ratio: unset;
        padding: 4px 2px;
        box-shadow: none;
    }

    .calendar-day:hover {
        transform: none;
        box-shadow: none;
    }

    .calendar-day.today {
        border-width: 2px;
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
        animation: none;
    }

    .calendar-day.start-date {
        border-width: 2px;
        box-shadow: none;
    }

    .calendar-day-number {
        font-size: 0.72rem;
    }

    .calendar-day-percent {
        font-size: 0.5rem;
        margin-top: 1px;
    }

    .calendar-day-badge {
        font-size: 0.45rem;
        padding: 1px 3px;
        top: 0;
        right: 0;
        min-width: 14px;
        animation: none;
        box-shadow: none;
    }

    /* Emergency calendar also compact on mobile */
    #emergencyCalendarSection .calendar-grid {
        max-width: 100%;
        gap: 2px;
    }

    #emergencyCalendarSection .calendar-day {
        min-height: 44px;
        font-size: 0.7rem;
    }

    #emergencyCalendarSection .calendar-day-header {
        font-size: 0.6rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   APP TOUR / HOW TO USE GUIDE
   ═══════════════════════════════════════════════════════════════ */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100005;
    animation: tourFadeIn 0.3s ease-out;
}

@keyframes tourFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tour-highlight {
    position: absolute;
    border: 3px solid #22d3ee;
    border-radius: 16px;
    box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 211, 238, 0.5), inset 0 0 20px rgba(34, 211, 238, 0.1);
    pointer-events: none;
    z-index: 100006;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: tourPulse 2s ease-in-out infinite;
}

@keyframes tourPulse {
    0%, 100% { box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 211, 238, 0.5); }
    50% { box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.4), 0 0 50px rgba(34, 211, 238, 0.8); }
}

.tour-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(34, 211, 238, 0.4);
    border-radius: 16px;
    padding: 16px 20px;
    max-width: 400px;
    width: calc(100vw - 40px);
    z-index: 100006;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(34, 211, 238, 0.2);
    animation: tourSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tourSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(100px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 480px) {
    .tour-tooltip {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        max-width: none;
        padding: 14px 16px;
    }
    
    @keyframes tourSlideUp {
        from { opacity: 0; transform: translateY(100px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.tour-step-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tour-step-number {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    color: #0f172a;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
}

.tour-step-label {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
}

.tour-title {
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-title-emoji {
    font-size: 1.1rem;
}

.tour-description {
    color: #cbd5e1;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.tour-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.tour-btn {
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

.tour-btn-skip {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.tour-btn-skip:hover {
    background: rgba(239, 68, 68, 0.25);
}

.tour-btn-prev {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.tour-btn-prev:hover {
    background: rgba(148, 163, 184, 0.25);
}

.tour-btn-next {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
    color: #0f172a;
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
}

.tour-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 211, 238, 0.4);
}

.tour-btn-finish {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.tour-btn-finish:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.tour-progress {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.tour-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.3);
    transition: all 0.3s ease;
}

.tour-progress-dot.active {
    background: #22d3ee;
    width: 18px;
    border-radius: 3px;
}

.tour-progress-dot.completed {
    background: #22c55e;
}

/* Welcome modal for tour */
.tour-welcome {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    z-index: 100006;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(99, 102, 241, 0.2);
    animation: tourWelcomeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tourWelcomeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.tour-welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: tourWelcomeWave 1s ease-in-out infinite;
}

@keyframes tourWelcomeWave {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.tour-welcome h2 {
    color: #f8fafc;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tour-welcome p {
    color: #94a3b8;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.tour-welcome-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
/* ═══════════════════════════════════════════════════════════════
   v5.4 — PREMIUM POLISH LAYER
   Additive refinements only: ring-overlay upgrades for the new
   GHAlarmCore popups, a11y focus rings, calmer motion for people
   who ask for it, tabular timer digits, safe-area support, and
   quieter scrollbars. No existing selector is overridden
   destructively — this layer only builds on top.
   ═══════════════════════════════════════════════════════════════ */

/* ── Ring overlay additions (GHAlarmCore popups) ── */
body.gh-ringing { overflow: hidden; }   /* the popup demands attention */

.gh-late-chip {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0 auto 14px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
  width: fit-content;
}
.gh-mute-hint {
  display: none;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}
.alarm-overlay .alarm-content {
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ── Timer digits: no more jumping widths ── */
#miniTimerTime,
#timerTime,
#quickTimerTime,
#quickTimerDisplay,
.timer-display,
.timer-time,
#pomodoroTimerDisplay,
.mini-timer-time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

/* ── Accessibility: consistent, visible keyboard focus ── */
:where(button, [role="button"], input, select, textarea, a, .toggle-btn):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ── Selection + scrollbars, tuned to the brand ── */
::selection {
  background: color-mix(in srgb, var(--primary) 28%, transparent);
  color: var(--text-primary);
}
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text-tertiary) 45%, transparent) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-tertiary) 40%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--text-tertiary) 65%, transparent);
  background-clip: content-box;
}

/* ── Motion respect ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── PWA safe areas (notched phones) ── */
@supports (padding: env(safe-area-inset-bottom)) {
  #miniTimer { margin-bottom: env(safe-area-inset-bottom); }
}

/* ── Subtle press feedback on primary controls ── */
.btn:active,
.action-btn:active,
.toggle-btn:active {
  transform: translateY(1px) scale(0.99);
}
