/* Extracted from templates/base.html <style> block (W6 rework 2026-09-04). */
        /* =============================================================================
           PLOS GLASSMORPHISM DESIGN SYSTEM v4.0
           Pure black canvas + glass containers + minimal accents
           ============================================================================= */

        /* -----------------------------------------------------------------------------
           CSS RESET
           ----------------------------------------------------------------------------- */
        *, *::before, *::after {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* §4.11 skip-to-content — visually hidden until focused. */
        .skip-link {
            position: absolute;
            top: 0;
            left: 0;
            padding: 8px 16px;
            background: #000;
            color: #fff;
            text-decoration: none;
            font-weight: 600;
            z-index: 100000;
            transform: translateY(-100%);
            transition: transform .15s ease;
        }
        .skip-link:focus {
            transform: translateY(0);
            outline: 2px solid #4F8AFF;
            outline-offset: 2px;
        }

        /* -----------------------------------------------------------------------------
           DESIGN TOKENS
           ----------------------------------------------------------------------------- */
        :root {
            /* === OBSIDIAN CANVAS (Stitch v4 — near-black, easier on eyes) === */
            --bg-canvas: #0e0e0e;
            --bg-void: #050505;

            /* === GLASS LAYERS (NO COLORS - JUST TRANSPARENCY) === */
            --glass-subtle: rgba(255, 255, 255, 0.03);
            --glass-light: rgba(255, 255, 255, 0.05);
            --glass-medium: rgba(255, 255, 255, 0.07);
            --glass-strong: rgba(255, 255, 255, 0.10);
            --glass-hover: rgba(255, 255, 255, 0.12);

            /* === GLASS BLUR VALUES === */
            --blur-sm: blur(8px);
            --blur-md: blur(14px);
            --blur-lg: blur(20px);

            /* === BORDERS (SUBTLE WHITE ONLY) === */
            --border-glass: rgba(255, 255, 255, 0.08);
            --border-glass-strong: rgba(255, 255, 255, 0.12);
            --border-focus: rgba(79, 138, 255, 0.5);

            /* === SURFACE LAYERS (Stitch v4 elevation) === */
            --surface-lowest: #000000;
            --surface-low: #131313;
            --surface-container: #191919;
            --surface-high: #1f1f1f;
            --surface-highest: #262626;
            --surface-bright: #2c2c2c;

            /* === ACCENT COLORS === */
            --accent-blue: #2563EB;
            --accent-cyan: #0EA5E9;
            --accent-teal: #2DD4BF;
            --accent-green: #10B981;
            --accent-orange: #F97316;
            --accent-amber: #FBBF24;
            --accent-red: #EF4444;
            --accent-purple: #A78BFA;

            /* === FIXED LIFE AREA COLORS (never change these) === */
            --area-health: #10B981;
            --area-health-soft: rgba(16, 185, 129, 0.15);
            --area-finance: #2563EB;
            --area-finance-soft: rgba(37, 99, 235, 0.15);
            --area-productivity: #0EA5E9;
            --area-productivity-soft: rgba(14, 165, 233, 0.15);
            --area-learning: #A78BFA;
            --area-learning-soft: rgba(167, 139, 250, 0.15);
            --area-relationships: #F97316;
            --area-relationships-soft: rgba(249, 115, 22, 0.15);

            /* === SEMANTIC (FOR STATUS INDICATORS ONLY) === */
            --color-success: #10B981;
            --color-warning: #FBBF24;
            --color-error: #EF4444;
            --color-info: #0EA5E9;

            /* Soft versions for tiny badges */
            --color-success-soft: rgba(16, 185, 129, 0.15);
            --color-warning-soft: rgba(251, 191, 36, 0.15);
            --color-error-soft: rgba(239, 68, 68, 0.15);
            --color-info-soft: rgba(14, 165, 233, 0.15);

            /* === TEXT HIERARCHY (WCAG AA compliant on dark backgrounds) === */
            --text-primary: #FFFFFF;
            --text-secondary: #E5E5E5;
            --text-tertiary: #C5C5C5;
            --text-muted: #BFBFBF;
            --text-subtle: #B5B5B5;
            --text-disabled: #A0A0A0;

            /* === CHANNEL COLORS (SMALL ICONS/BADGES ONLY) === */
            --whatsapp: #25D366;
            --telegram: #0088CC;

            /* === TYPOGRAPHY === */
            --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
            --font-mono: 'SF Mono', Monaco, Consolas, monospace;

            --text-xs: 0.75rem;
            --text-sm: 0.875rem;
            --text-base: 1rem;
            --text-lg: 1.125rem;
            --text-xl: 1.25rem;
            --text-2xl: 1.5rem;
            --text-3xl: 1.875rem;

            --font-normal: 400;
            --font-medium: 500;
            --font-semibold: 600;
            --font-bold: 700;

            --leading-tight: 1.25;
            --leading-normal: 1.5;
            --leading-relaxed: 1.625;

            /* === SPACING === */
            --space-1: 0.25rem;
            --space-2: 0.5rem;
            --space-3: 0.75rem;
            --space-4: 1rem;
            --space-5: 1.25rem;
            --space-6: 1.5rem;
            --space-8: 2rem;
            --space-10: 2.5rem;
            --space-12: 3rem;

            /* === BORDER RADIUS === */
            --radius-sm: 0.375rem;
            --radius-md: 0.5rem;
            --radius-lg: 0.625rem;
            --radius-xl: 0.75rem;
            --radius-2xl: 1rem;
            --radius-full: 9999px;

            /* === SHADOWS (SOFT, NO GLOW) === */
            --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
            --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
            --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);

            /* === TRANSITIONS === */
            --transition-fast: 150ms ease;
            --transition-normal: 200ms ease;
            --transition-slow: 300ms ease;

            /* === LAYOUT (FULL WIDTH) === */
            --header-height: 64px;
            --max-width: 1600px;
            --content-padding: clamp(1rem, 2vw, 2.5rem);
            --body-padding: clamp(1.25rem, 3vw, 3.5rem);

            /* === BACKWARD-COMPATIBLE ALIASES === */
            /* Maps old --color-* names used in templates to current design tokens */
            --color-text: var(--text-primary);
            --color-text-secondary: var(--text-secondary);
            --color-text-muted: var(--text-muted);
            --color-muted: var(--text-muted);
            --color-primary: var(--accent-blue);
            --color-primary-light: rgba(79, 138, 255, 0.15);
            --color-primary-dark: #3b7aef;
            --color-surface: var(--glass-medium);
            --color-bg-card: var(--glass-medium);
            --color-border: var(--border-glass);
            --color-danger: var(--color-error);
            --color-error-dark: #dc2626;
            --color-success-light: rgba(16, 185, 129, 0.15);
            --color-warning-light: rgba(251, 191, 36, 0.15);
            --color-whatsapp-light: rgba(37, 211, 102, 0.15);
            --color-telegram-light: rgba(0, 136, 204, 0.15);
            --color-gray-50: rgba(255, 255, 255, 0.04);
            --color-gray-100: rgba(255, 255, 255, 0.06);
            --color-gray-200: rgba(255, 255, 255, 0.08);
            --color-gray-300: rgba(255, 255, 255, 0.12);
            --color-gray-400: rgba(255, 255, 255, 0.2);
            --color-gray-500: rgba(255, 255, 255, 0.35);
            --color-gray-600: rgba(255, 255, 255, 0.5);
            --color-gray-700: rgba(255, 255, 255, 0.7);
            --color-gray-800: rgba(255, 255, 255, 0.85);

            /* === MATERIAL DESIGN 3 TOKENS (Stitch Shell) === */
            --md-primary: #b4c5ff;
            --md-on-primary: #002a78;
            --md-primary-container: #2563eb;
            --md-on-primary-container: #eeefff;
            --md-primary-fixed: #dbe1ff;
            --md-primary-fixed-dim: #b4c5ff;
            --md-secondary: #cabeff;
            --md-on-secondary: #322569;
            --md-secondary-container: #4b3f84;
            --md-on-secondary-container: #bcaefc;
            --md-tertiary: #7ad2f4;
            --md-on-tertiary: #003545;
            --md-tertiary-container: #007795;
            --md-on-tertiary-container: #def4ff;
            --md-surface: #131313;
            --md-surface-dim: #131313;
            --md-surface-bright: #393939;
            --md-surface-container-lowest: #0e0e0e;
            --md-surface-container-low: #1b1b1b;
            --md-surface-container: #1f1f1f;
            --md-surface-container-high: #2a2a2a;
            --md-surface-container-highest: #353535;
            --md-on-surface: #e2e2e2;
            --md-on-surface-variant: #c3c6d7;
            --md-outline: #8d90a0;
            --md-outline-variant: #434655;
            --md-error: #ffb4ab;
            --md-error-container: #93000a;
            --md-on-error: #690005;
            --md-inverse-surface: #e2e2e2;
            --md-inverse-on-surface: #303030;
            --md-inverse-primary: #0053db;
            --md-surface-tint: #b4c5ff;

            /* === GAMIFICATION ACCENT (Stitch Shell) === */
            --accent-violet: #8B7EC8;
        }

        /* -----------------------------------------------------------------------------
           LIGHT MODE OVERRIDES
           ----------------------------------------------------------------------------- */
        html[data-theme="light"] {
            /* === LIGHT CANVAS === */
            --bg-canvas: #f5f5f7;
            --bg-void: #eeeef0;

            /* === SURFACE LAYERS (light mode) === */
            --surface-lowest: #ffffff;
            --surface-low: #f5f5f7;
            --surface-container: #eeeef0;
            --surface-high: #e8e8ea;
            --surface-highest: #dedede;
            --surface-bright: #f9f9f9;

            /* === FIXED LIFE AREA COLORS (deeper for light bg) === */
            --area-health: #059669;
            --area-health-soft: rgba(5, 150, 105, 0.12);
            --area-finance: #2563EB;
            --area-finance-soft: rgba(37, 99, 235, 0.10);
            --area-productivity: #0891D8;
            --area-productivity-soft: rgba(8, 145, 216, 0.10);
            --area-learning: #7C3AED;
            --area-learning-soft: rgba(124, 58, 237, 0.10);
            --area-relationships: #EA580C;
            --area-relationships-soft: rgba(234, 88, 12, 0.10);

            /* === GLASS LAYERS (SOLID WHITES WITH SUBTLE OPACITY) === */
            --glass-subtle: rgba(255, 255, 255, 0.5);
            --glass-light: rgba(255, 255, 255, 0.65);
            --glass-medium: rgba(255, 255, 255, 0.8);
            --glass-strong: rgba(255, 255, 255, 0.92);
            --glass-hover: rgba(255, 255, 255, 0.96);

            /* === BORDERS (SOFT GRAYS) === */
            --border-glass: rgba(0, 0, 0, 0.08);
            --border-glass-strong: rgba(0, 0, 0, 0.14);
            --border-focus: rgba(37, 99, 235, 0.5);

            /* === ACCENT COLORS (SLIGHTLY DEEPER FOR CONTRAST ON WHITE) === */
            --accent-blue: #1d4ed8;
            --accent-cyan: #0284C7;
            --accent-teal: #0D9488;
            --accent-green: #047857;
            --accent-orange: #c2410c;
            --accent-amber: #b45309;
            --accent-red: #b91c1c;
            --accent-purple: #6d28d9;

            /* === SEMANTIC === */
            --color-success: #059669;
            --color-warning: #D97706;
            --color-error: #DC2626;
            --color-info: #0284C7;

            /* Soft badge backgrounds */
            --color-success-soft: rgba(5, 150, 105, 0.1);
            --color-warning-soft: rgba(217, 119, 6, 0.1);
            --color-error-soft: rgba(220, 38, 38, 0.1);
            --color-info-soft: rgba(2, 132, 199, 0.1);

            /* === TEXT HIERARCHY (WCAG AA compliant on light backgrounds) === */
            --text-primary: #1a1a2e;
            --text-secondary: #374151;
            --text-tertiary: #4b5563;
            --text-muted: #4b5563;
            --text-subtle: #4b5563;
            --text-disabled: #737373;

            /* === SHADOWS (SOFTER FOR LIGHT BG) === */
            --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
            --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.04);
            --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
            --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.10), 0 8px 16px rgba(0, 0, 0, 0.05);

            /* === BACKWARD-COMPATIBLE ALIASES === */
            --color-text: var(--text-primary);
            --color-text-secondary: var(--text-secondary);
            --color-text-muted: var(--text-muted);
            --color-muted: var(--text-muted);
            --color-primary: var(--accent-blue);
            --color-primary-light: rgba(37, 99, 235, 0.08);
            --color-primary-dark: #1d4ed8;
            --color-surface: var(--glass-medium);
            --color-bg-card: var(--glass-medium);
            --color-border: var(--border-glass);
            --color-danger: var(--color-error);
            --color-error-dark: #b91c1c;
            --color-success-light: rgba(5, 150, 105, 0.08);
            --color-warning-light: rgba(217, 119, 6, 0.08);
            --color-whatsapp-light: rgba(37, 211, 102, 0.1);
            --color-telegram-light: rgba(0, 136, 204, 0.1);
            --color-gray-50: #fafafa;
            --color-gray-100: #f5f5f5;
            --color-gray-200: #e5e7eb;
            --color-gray-300: #d1d5db;
            --color-gray-400: #9ca3af;
            --color-gray-500: #6b7280;
            --color-gray-600: #4b5563;
            --color-gray-700: #374151;
            --color-gray-800: #1f2937;

            /* === MATERIAL DESIGN 3 TOKENS — LIGHT MODE (Stitch Shell) === */
            --md-primary: #0053db;
            --md-on-primary: #ffffff;
            --md-primary-container: #dbe1ff;
            --md-on-primary-container: #00174b;
            --md-secondary: #cabeff;
            --md-on-secondary: #322569;
            --md-secondary-container: #e6deff;
            --md-on-secondary-container: #1c0b54;
            --md-tertiary: #004d62;
            --md-on-tertiary: #ffffff;
            --md-tertiary-container: #baeaff;
            --md-on-tertiary-container: #001f29;
            --md-surface: #f5f5f7;
            --md-surface-dim: #d6d6d6;
            --md-surface-bright: #f5f5f7;
            --md-surface-container-lowest: #ffffff;
            --md-surface-container-low: #f0f0f0;
            --md-surface-container: #eaeaea;
            --md-surface-container-high: #e4e4e4;
            --md-surface-container-highest: #dedede;
            --md-on-surface: #1a1a1a;
            --md-on-surface-variant: #434655;
            --md-outline: #8d90a0;
            --md-outline-variant: #c3c6d7;
            --md-error: #ba1a1a;
            --md-error-container: #ffdad6;
            --md-on-error: #ffffff;
            --md-inverse-surface: #303030;
            --md-inverse-on-surface: #e2e2e2;
            --md-inverse-primary: #b4c5ff;
            --md-surface-tint: #0053db;
            --accent-violet: #7C3AED;
        }

        /* Light mode element-level fixes */
        html[data-theme="light"] body {
            color: var(--text-secondary);
        }

        html[data-theme="light"] .glass-card,
        html[data-theme="light"] .card {
            box-shadow: var(--shadow-md);
        }

        html[data-theme="light"] .glass-card:hover {
            box-shadow: var(--shadow-lg);
        }

        /* Obsidian shadow lighter in light mode */
        html[data-theme="light"] .obsidian-shadow {
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
        }

        /* Header in light mode */
        html[data-theme="light"] .global-header {
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-bottom: 1px solid var(--border-glass);
        }

        /* Theme toggle: show correct icon */
        html[data-theme="light"] .icon-sun { display: none; }
        html[data-theme="light"] .icon-moon { display: block; }
        html[data-theme="dark"] .icon-sun,
        :root .icon-sun { display: block; }
        html[data-theme="dark"] .icon-moon,
        :root .icon-moon { display: none; }

        /* Logo: switch dark/light variant */
        .logo-light { display: none; }
        .logo-dark { display: block; }
        html[data-theme="light"] .logo-light { display: block; }
        html[data-theme="light"] .logo-dark { display: none; }

        /* Mobile nav in light mode */
        html[data-theme="light"] .mobile-nav-panel {
            background: rgba(255, 255, 255, 0.95);
        }

        /* ── Quick Actions FAB ── pill dock, bottom-right above chat widget */
        .quick-actions-fab {
            position: fixed;
            bottom: 90px;
            right: 20px;
            z-index: 1000;
        }
        .qa-toggle {
            width: 40px;
            height: 40px;
            border-radius: 12px;
            background: rgba(255,255,255,0.07);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid rgba(255,255,255,0.10);
            color: var(--text-muted, #71717a);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
            position: relative;
            z-index: 2;
        }
        .qa-toggle:hover {
            background: rgba(255,255,255,0.12);
            color: var(--text-primary, #fff);
            box-shadow: 0 4px 16px rgba(0,0,0,0.3);
            transform: translateY(-1px);
        }
        .qa-toggle:active { transform: scale(0.95); }
        .qa-toggle .material-symbols-outlined {
            font-size: 20px;
            transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
        }
        .quick-actions-fab.open .qa-toggle {
            background: var(--accent-blue, #3b82f6);
            border-color: transparent;
            color: #fff;
            box-shadow: 0 4px 16px rgba(59,130,246,0.35);
        }
        .quick-actions-fab.open .qa-toggle .material-symbols-outlined {
            transform: rotate(45deg);
        }
        /* Scrim overlay */
        .qa-scrim {
            position: fixed; inset: 0;
            background: rgba(0,0,0,0.3);
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
            z-index: 999;
            opacity: 0; pointer-events: none;
            transition: opacity 0.2s;
        }
        .qa-scrim.open { opacity: 1; pointer-events: auto; }
        /* Menu */
        .qa-menu {
            position: absolute;
            bottom: 50px;
            right: 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            align-items: flex-end;
            opacity: 0;
            transform: translateY(8px);
            pointer-events: none;
            transition: opacity 0.15s, transform 0.2s cubic-bezier(0.4,0,0.2,1);
        }
        .qa-menu.open {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }
        .qa-item {
            display: flex;
            align-items: center;
            gap: 10px;
            height: 36px;
            padding: 0 14px 0 10px;
            border-radius: 10px;
            background: var(--surface-low, #18181b);
            border: 1px solid rgba(255,255,255,0.08);
            text-decoration: none;
            cursor: pointer;
            transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
            white-space: nowrap;
            opacity: 0;
            transform: translateY(6px);
        }
        .qa-menu.open .qa-item { opacity: 1; transform: translateY(0); }
        .qa-item .material-symbols-outlined { font-size: 16px; color: var(--qa-color); }
        .qa-item-label { font-size: 0.75rem; font-weight: 500; color: var(--text-secondary); }
        .qa-item:hover {
            background: rgba(255,255,255,0.06);
            border-color: var(--qa-color, rgba(255,255,255,0.15));
        }
        .qa-item:hover .qa-item-label { color: var(--text-primary); }
        /* Staggered entrance */
        .qa-menu.open .qa-item:nth-child(1) { transition-delay: 0.02s; }
        .qa-menu.open .qa-item:nth-child(2) { transition-delay: 0.04s; }
        .qa-menu.open .qa-item:nth-child(3) { transition-delay: 0.06s; }
        .qa-menu.open .qa-item:nth-child(4) { transition-delay: 0.08s; }
        .qa-menu.open .qa-item:nth-child(5) { transition-delay: 0.10s; }
        .qa-menu.open .qa-item:nth-child(6) { transition-delay: 0.12s; }
        @media (max-width: 768px) {
            .quick-actions-fab { bottom: 90px; right: 14px; }
        }
        /* Light mode */
        html[data-theme="light"] .qa-toggle {
            background: rgba(255,255,255,0.85);
            border-color: rgba(0,0,0,0.08);
            color: var(--text-muted);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            backdrop-filter: blur(12px);
        }
        html[data-theme="light"] .qa-toggle:hover {
            background: rgba(255,255,255,0.95);
            color: var(--text-primary);
            box-shadow: 0 4px 12px rgba(0,0,0,0.12);
        }
        html[data-theme="light"] .quick-actions-fab.open .qa-toggle {
            background: var(--accent-blue, #3b82f6);
            color: #fff;
            border-color: transparent;
        }
        html[data-theme="light"] .qa-item {
            background: #fff;
            border-color: rgba(0,0,0,0.06);
            box-shadow: 0 1px 6px rgba(0,0,0,0.06);
        }
        html[data-theme="light"] .qa-item:hover { background: #f9fafb; }
        html[data-theme="light"] .qa-scrim { background: rgba(0,0,0,0.12); }

        html[data-theme="light"] #quick-log-menu button:hover {
            box-shadow: var(--shadow-lg) !important;
        }

        /* Form inputs in light mode */
        html[data-theme="light"] .form-input,
        html[data-theme="light"] input[type="text"],
        html[data-theme="light"] input[type="email"],
        html[data-theme="light"] input[type="password"],
        html[data-theme="light"] input[type="number"],
        html[data-theme="light"] input[type="search"],
        html[data-theme="light"] textarea,
        html[data-theme="light"] select {
            background: rgba(255, 255, 255, 0.9);
            border-color: var(--border-glass-strong);
            color: var(--text-primary);
        }

        html[data-theme="light"] .form-input:focus,
        html[data-theme="light"] input:focus,
        html[data-theme="light"] textarea:focus,
        html[data-theme="light"] select:focus {
            border-color: var(--accent-blue);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        /* Buttons in light mode */
        html[data-theme="light"] .btn-ghost {
            color: var(--text-secondary);
        }

        html[data-theme="light"] .btn-ghost:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text-primary);
        }

        /* Footer in light mode */
        html[data-theme="light"] .global-footer {
            background: rgba(255, 255, 255, 0.6);
            border-top: 1px solid var(--border-glass);
        }

        /* Alerts/toasts in light mode */
        html[data-theme="light"] .alert {
            box-shadow: var(--shadow-md);
        }

        /* Modal backdrop lighter in light mode */
        html[data-theme="light"] .modal-backdrop.active {
            background: rgba(0, 0, 0, 0.4);
        }

        /* Account dropdown */
        html[data-theme="light"] .account-dropdown {
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        html[data-theme="light"] .account-dropdown a,
        html[data-theme="light"] .account-dropdown button {
            color: var(--text-secondary);
        }

        html[data-theme="light"] .account-dropdown a:hover,
        html[data-theme="light"] .account-dropdown button:hover {
            background: rgba(0, 0, 0, 0.04);
            color: var(--text-primary);
        }

        html[data-theme="light"] .mega-category-header {
            color: #666;
        }

        html[data-theme="light"] .mega-link {
            color: #333;
        }

        html[data-theme="light"] .mega-link:hover {
            color: #000;
        }

        html[data-theme="light"] .mega-signout {
            color: var(--color-error);
        }

        /* Life Areas dropdown */
        html[data-theme="light"] .la-dropdown {
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        html[data-theme="light"] .la-dropdown a:hover {
            background: rgba(0, 0, 0, 0.04);
        }

        /* Notification badge */
        html[data-theme="light"] .notif-badge {
            box-shadow: 0 0 0 2px #f5f5f7;
        }

        /* Toast notifications */
        html[data-theme="light"] .plos-toast {
            background: rgba(255, 255, 255, 0.95) !important;
            color: var(--text-primary) !important;
            border: 1px solid rgba(0, 0, 0, 0.08);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        }

        /* Page guide / explanation panels */
        html[data-theme="light"] .page-guide-panel {
            background: rgba(255, 255, 255, 0.98);
            border-left: 1px solid rgba(0, 0, 0, 0.1);
        }

        html[data-theme="light"] .explanation-modal {
            background: rgba(255, 255, 255, 0.98);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }

        /* Scrollbar in light mode */
        html[data-theme="light"] ::-webkit-scrollbar-track {
            background: #f0f0f0;
        }
        html[data-theme="light"] ::-webkit-scrollbar-thumb {
            background: #c4c4c4;
        }
        html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
            background: #a8a8a8;
        }

        /* -----------------------------------------------------------------------------
           BASE STYLES
           ----------------------------------------------------------------------------- */
        html {
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
        }

        body {
            font-family: var(--font-family);
            font-size: var(--text-base);
            line-height: var(--leading-normal);
            color: var(--text-secondary);
            background: var(--bg-canvas);
            min-height: 100vh;
            overflow-wrap: break-word;
            word-break: break-word;
        }

        a {
            color: var(--text-secondary);
            text-decoration: none;
            transition: color var(--transition-fast);
        }

        a:hover {
            color: var(--text-primary);
        }

        img, svg { display: block; max-width: 100%; }
        button { font-family: inherit; cursor: pointer; }
        input, textarea, select { font-family: inherit; font-size: inherit; }

        ::selection {
            background: rgba(79, 138, 255, 0.3);
            color: var(--text-primary);
        }

        /* =====================================================================
           GLOBAL SCROLLBAR — sleek gradient style everywhere
           ===================================================================== */

        /* WebKit (Chrome, Safari, Edge) — page + all elements */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }

        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.03);
        }

        ::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, rgba(79, 138, 255, 0.4), rgba(45, 212, 191, 0.4));
            border-radius: 10px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, rgba(79, 138, 255, 0.7), rgba(45, 212, 191, 0.7));
        }

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

        /* Firefox — page + all elements */
        * {
            scrollbar-width: thin;
            scrollbar-color: rgba(79, 138, 255, 0.4) rgba(255, 255, 255, 0.03);
        }

        :focus-visible {
            outline: 2px solid var(--border-focus);
            outline-offset: 2px;
        }

        /* -----------------------------------------------------------------------------
           GLASS CONTAINER SYSTEM
           ----------------------------------------------------------------------------- */
        .glass {
            background: transparent;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
        }

        .glass-subtle {
            background: transparent;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
        }

        .glass-strong {
            background: transparent;
            border: 1px solid var(--border-glass-strong);
            border-radius: var(--radius-xl);
        }

        /* -----------------------------------------------------------------------------
           STITCH SHELL: OBSIDIAN SHADOW + ANIMATIONS
           ----------------------------------------------------------------------------- */
        .obsidian-shadow {
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
        }

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

        .animate-fade-in {
            animation: fadeInSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }

        .stagger-1 { animation-delay: 0.1s; }
        .stagger-2 { animation-delay: 0.2s; }
        .stagger-3 { animation-delay: 0.3s; }
        .stagger-4 { animation-delay: 0.4s; }
        .stagger-5 { animation-delay: 0.5s; }
        .stagger-6 { animation-delay: 0.6s; }

        /* -----------------------------------------------------------------------------
           STITCH SHELL: MATERIAL SYMBOLS OUTLINED ICON FONT
           ----------------------------------------------------------------------------- */
        .material-symbols-outlined {
            font-family: 'Material Symbols Outlined';
            font-weight: normal;
            font-style: normal;
            font-size: 22px;
            line-height: 1;
            letter-spacing: normal;
            text-transform: none;
            display: inline-block;
            white-space: nowrap;
            word-wrap: normal;
            direction: ltr;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeLegibility;
            font-feature-settings: 'liga';
            font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
        }

        .material-symbols-outlined.fill-icon {
            font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
        }

        .material-symbols-outlined.icon-xs { font-size: 16px; }
        .material-symbols-outlined.icon-sm { font-size: 18px; }
        .material-symbols-outlined.icon-md { font-size: 24px; }
        .material-symbols-outlined.icon-lg { font-size: 32px; }
        .material-symbols-outlined.icon-xl { font-size: 40px; }

        /* -----------------------------------------------------------------------------
           TYPOGRAPHY
           ----------------------------------------------------------------------------- */
        .text-xs { font-size: var(--text-xs); }
        .text-sm { font-size: var(--text-sm); }
        .text-base { font-size: var(--text-base); }
        .text-lg { font-size: var(--text-lg); }
        .text-xl { font-size: var(--text-xl); }
        .text-2xl { font-size: var(--text-2xl); }
        .text-3xl { font-size: var(--text-3xl); }

        .font-normal { font-weight: var(--font-normal); }
        .font-medium { font-weight: var(--font-medium); }
        .font-semibold { font-weight: var(--font-semibold); }
        .font-bold { font-weight: var(--font-bold); }

        .text-primary { color: var(--text-primary); }
        .text-secondary { color: var(--text-secondary); }
        .text-muted { color: var(--text-muted); }
        .text-subtle { color: var(--text-subtle); }

        /* Status text colors (small text only) */
        .text-success { color: var(--color-success); }
        .text-warning { color: var(--color-warning); }
        .text-error { color: var(--color-error); }

        /* -----------------------------------------------------------------------------
           SVG ICON SYSTEM
           ----------------------------------------------------------------------------- */
        .icon {
            width: 20px;
            height: 20px;
            display: inline-block;
            vertical-align: middle;
            flex-shrink: 0;
        }
        .icon-xs { width: 12px; height: 12px; }
        .icon-sm { width: 16px; height: 16px; }
        .icon-md { width: 24px; height: 24px; }
        .icon-lg { width: 32px; height: 32px; }
        .icon-xl { width: 48px; height: 48px; }
        .icon-2xl { width: 64px; height: 64px; }

        /* Icon color variants */
        .icon-success { color: var(--color-success); }
        .icon-warning { color: var(--color-warning); }
        .icon-error { color: var(--color-error); }
        .icon-info { color: var(--accent-blue); }
        .icon-muted { color: var(--text-muted); }
        .icon-subtle { color: var(--text-subtle); }
        .icon-whatsapp { color: var(--whatsapp); }
        .icon-telegram { color: var(--telegram); }

        /* -----------------------------------------------------------------------------
           BUTTON SYSTEM
           ----------------------------------------------------------------------------- */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-4);
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            line-height: 1.5;
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-glass);
            cursor: pointer;
            transition: all var(--transition-fast);
            white-space: nowrap;
            text-decoration: none;
            background: transparent;
            color: var(--text-secondary);
        }

        .btn:hover:not(:disabled) {
            background: var(--glass-hover);
            border-color: var(--border-glass-strong);
            color: var(--text-primary);
        }

        .btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
        .btn-lg { padding: var(--space-3) var(--space-6); font-size: var(--text-base); }

        .btn-primary {
            background: var(--accent-blue);
            color: white;
            border-color: var(--accent-blue);
        }

        .btn-primary:hover:not(:disabled) {
            background: #6B9FFF;
            border-color: #6B9FFF;
            transform: translateY(-1px);
        }

        .btn-secondary {
            background: transparent;
            color: var(--text-secondary);
            border-color: var(--border-glass-strong);
        }

        .btn-secondary:hover:not(:disabled) {
            background: var(--glass-strong);
            color: var(--text-primary);
        }

        .btn-ghost {
            background: transparent;
            color: var(--text-muted);
            border-color: transparent;
        }

        .btn-ghost:hover:not(:disabled) {
            background: transparent;
            color: var(--text-primary);
        }

        .btn-danger {
            background: var(--color-error);
            color: white;
            border-color: var(--color-error);
        }

        .btn-icon {
            padding: var(--space-2);
        }

        .btn svg { width: 16px; height: 16px; flex-shrink: 0; }

        /* -----------------------------------------------------------------------------
           CARD SYSTEM (GLASS CONTAINERS)
           ----------------------------------------------------------------------------- */
        .card {
            background: transparent;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            overflow: hidden;
        }

        .card-header {
            padding: var(--space-4) var(--space-5);
            border-bottom: 1px solid var(--border-glass);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: var(--space-2);
        }

        .card-title {
            font-size: var(--text-base);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
        }

        .card-subtitle {
            font-size: var(--text-sm);
            color: var(--text-muted);
            margin-top: var(--space-1);
        }

        .card-body { padding: var(--space-5); }

        .card-footer {
            padding: var(--space-4) var(--space-5);
            border-top: 1px solid var(--border-glass);
            background: var(--glass-subtle);
        }

        /* -----------------------------------------------------------------------------
           OPTION TILES (Stitch v4 — icon + label grid items)
           Used for feature navigation, settings tiles, quick-action grids
           ----------------------------------------------------------------------------- */
        .option-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: var(--space-3);
        }

        .option-tile {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-5) var(--space-3);
            background: var(--glass-subtle);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            cursor: pointer;
            transition: all 150ms ease;
            text-decoration: none;
            color: inherit;
            text-align: center;
        }

        .option-tile:hover {
            background: transparent;
            border-color: var(--border-glass-strong);
            transform: translateY(-2px);
        }

        .option-tile-icon {
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-lg);
            font-size: 22px;
        }

        .option-tile-label {
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--text-secondary);
        }

        .option-tile-meta {
            font-size: var(--text-xs);
            color: var(--text-subtle);
        }

        /* Life area colored icon backgrounds */
        .option-tile-icon.area-health { background: var(--area-health-soft); color: var(--area-health); }
        .option-tile-icon.area-finance { background: var(--area-finance-soft); color: var(--area-finance); }
        .option-tile-icon.area-productivity { background: var(--area-productivity-soft); color: var(--area-productivity); }
        .option-tile-icon.area-learning { background: var(--area-learning-soft); color: var(--area-learning); }
        .option-tile-icon.area-relationships { background: var(--area-relationships-soft); color: var(--area-relationships); }

        /* Generic accent icon backgrounds */
        .option-tile-icon.accent-blue { background: rgba(37, 99, 235, 0.15); color: var(--accent-blue); }
        .option-tile-icon.accent-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
        .option-tile-icon.accent-teal { background: rgba(45, 212, 191, 0.15); color: var(--accent-teal); }
        .option-tile-icon.accent-orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
        .option-tile-icon.accent-purple { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }
        .option-tile-icon.accent-amber { background: rgba(251, 191, 36, 0.15); color: var(--accent-amber); }

        /* Horizontal option tile variant (icon left, text right) */
        .option-tile-h {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            background: var(--glass-subtle);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            cursor: pointer;
            transition: all 150ms ease;
            text-decoration: none;
            color: inherit;
        }

        .option-tile-h:hover {
            background: transparent;
            border-color: var(--border-glass-strong);
        }

        .option-tile-h .option-tile-icon {
            width: 40px;
            height: 40px;
            flex-shrink: 0;
        }

        .option-tile-h .option-tile-content {
            flex: 1;
            min-width: 0;
        }

        .option-tile-h .option-tile-label {
            text-align: left;
        }

        .option-tile-h .option-tile-meta {
            text-align: left;
        }

        /* Feature card with left accent bar (Stitch landing style) */
        .feature-card {
            display: flex;
            gap: var(--space-4);
            padding: var(--space-5);
            background: transparent;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            border-left: 3px solid var(--accent-blue);
            transition: all 150ms ease;
        }

        .feature-card:hover {
            background: var(--glass-strong);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
        }

        .feature-card-icon {
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-lg);
            flex-shrink: 0;
            font-size: 22px;
        }

        .feature-card-body { flex: 1; min-width: 0; }

        .feature-card-title {
            font-size: var(--text-base);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
            margin-bottom: var(--space-1);
        }

        .feature-card-desc {
            font-size: var(--text-sm);
            color: var(--text-muted);
            line-height: var(--leading-relaxed);
        }

        /* Life-area accent borders — removed, using icon-color-only pattern */

        /* Light mode option tiles */
        html[data-theme="light"] .option-tile:hover,
        html[data-theme="light"] .option-tile-h:hover {
            box-shadow: var(--shadow-sm);
        }

        html[data-theme="light"] .feature-card:hover {
            box-shadow: var(--shadow-md);
        }

        /* -----------------------------------------------------------------------------
           STAT CARDS
           ----------------------------------------------------------------------------- */
        .stat-card {
            background: transparent;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            padding: var(--space-5);
        }

        .stat-label {
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--text-muted);
            margin-bottom: var(--space-1);
        }

        .stat-value {
            font-size: var(--text-3xl);
            font-weight: var(--font-bold);
            color: var(--text-primary);
            line-height: 1.2;
        }

        /* Accent colors ONLY for stat values (numbers) */
        .stat-value-accent { color: var(--accent-blue); }
        .stat-value-success { color: var(--color-success); }

        .stat-subtext {
            font-size: var(--text-xs);
            color: var(--text-subtle);
            margin-top: var(--space-1);
        }

        /* -----------------------------------------------------------------------------
           BADGE SYSTEM (SMALL INDICATORS ONLY)
           ----------------------------------------------------------------------------- */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: var(--space-1);
            padding: 3px var(--space-2);
            font-size: var(--text-xs);
            font-weight: var(--font-medium);
            line-height: 1.4;
            border-radius: var(--radius-full);
            white-space: nowrap;
            background: var(--glass-strong);
            color: var(--text-muted);
        }

        .badge-success { background: var(--color-success-soft); color: var(--color-success); }
        .badge-warning { background: var(--color-warning-soft); color: var(--color-warning); }
        .badge-danger { background: var(--color-error-soft); color: var(--color-error); }
        .badge-info { background: var(--color-info-soft); color: var(--color-info-text); }

        .badge-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            flex-shrink: 0;
        }
        .badge-dot-success { background: var(--color-success); }
        .badge-dot-warning { background: var(--color-warning); }
        .badge-dot-error { background: var(--color-error); }

        /* -----------------------------------------------------------------------------
           FORM SYSTEM (DARK INPUTS, NO WHITE)
           ----------------------------------------------------------------------------- */
        .form-group { margin-bottom: var(--space-5); }

        .form-label {
            display: block;
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--text-muted);
            margin-bottom: var(--space-2);
        }

        .form-label-required::after { content: ' *'; color: var(--color-error); }

        .form-input,
        .form-select,
        .form-textarea {
            width: 100%;
            padding: var(--space-3) var(--space-4);
            font-size: var(--text-sm);
            line-height: 1.5;
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            transition: all var(--transition-fast);
        }

        .form-input:focus,
        .form-select:focus,
        .form-textarea:focus {
            outline: none;
            border-color: rgba(79, 138, 255, 0.4);
            box-shadow: 0 0 0 3px rgba(79, 138, 255, 0.1);
            background: rgba(255, 255, 255, 0.06);
        }

        .form-input::placeholder,
        .form-textarea::placeholder {
            color: var(--text-subtle);
        }

        .form-input-error {
            border-color: rgba(239, 68, 68, 0.5);
        }

        .form-help {
            font-size: var(--text-xs);
            color: var(--text-subtle);
            margin-top: var(--space-1);
        }

        .form-error {
            font-size: var(--text-xs);
            color: var(--color-error);
            margin-top: var(--space-1);
        }

        .form-textarea { min-height: 100px; resize: vertical; }

        .form-select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23666666'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right var(--space-3) center;
            background-size: 16px;
            padding-right: var(--space-10);
            cursor: pointer;
        }
        .form-select option,
        select option {
            background: #1e1e2e;
            color: #e2e8f0;
            padding: 8px 12px;
        }
        .form-select option:checked,
        select option:checked {
            background: #2d2d44;
        }

        /* Toggle Switch */
        .toggle {
            position: relative;
            display: inline-flex;
            width: 48px;
            height: 26px;
            flex-shrink: 0;
        }

        .toggle input { opacity: 0; width: 0; height: 0; }

        .toggle-slider {
            position: absolute;
            cursor: pointer;
            inset: 0;
            background: var(--glass-strong);
            border-radius: var(--radius-full);
            transition: var(--transition-fast);
            border: 1px solid var(--border-glass);
        }

        .toggle-slider::before {
            position: absolute;
            content: "";
            height: 20px;
            width: 20px;
            left: 2px;
            bottom: 2px;
            background: var(--text-subtle);
            border-radius: 50%;
            transition: var(--transition-fast);
        }

        .toggle input:checked + .toggle-slider {
            background: var(--accent-green);
            border-color: var(--accent-green);
        }

        .toggle input:checked + .toggle-slider::before {
            transform: translateX(22px);
            background: white;
        }

        /* -----------------------------------------------------------------------------
           ALERT SYSTEM
           ----------------------------------------------------------------------------- */
        .alert {
            display: flex;
            gap: var(--space-3);
            padding: var(--space-4);
            border-radius: var(--radius-lg);
            font-size: var(--text-sm);
            background: transparent;
            border: 1px solid var(--border-glass);
        }

        .alert-icon { flex-shrink: 0; font-size: var(--text-lg); }
        .alert-content { flex: 1; }
        .alert-title { font-weight: var(--font-semibold); margin-bottom: var(--space-1); color: var(--text-primary); }

        .alert-warning {
            border-left: 3px solid var(--color-warning);
        }

        .alert-danger {
            border-left: 3px solid var(--color-error);
        }

        .alert-success {
            border-left: 3px solid var(--color-success);
        }

        /* -----------------------------------------------------------------------------
           MODAL SYSTEM (GLASS LAYERS)
           ----------------------------------------------------------------------------- */
        .modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-normal);
        }

        .modal-backdrop.active { opacity: 1; visibility: visible; }

        .modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.95);
            background: var(--glass-strong);
            border: 1px solid var(--border-glass-strong);
            border-radius: var(--radius-2xl);
            box-shadow: var(--shadow-xl);
            max-width: 500px;
            width: calc(100% - var(--space-8));
            max-height: calc(100vh - var(--space-12));
            z-index: 1001;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-normal);
            display: flex;
            flex-direction: column;
        }

        .modal.active {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--space-4) var(--space-5);
            border-bottom: 1px solid var(--border-glass);
        }

        .modal-title {
            font-size: var(--text-lg);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
        }

        .modal-close {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .modal-close:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }

        .modal-body {
            padding: var(--space-5);
            overflow-y: auto;
            flex: 1 1 auto;
            min-height: 0;
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: var(--space-3);
            padding: var(--space-4) var(--space-5);
            border-top: 1px solid var(--border-glass);
            background: var(--glass-subtle);
            flex-shrink: 0;
        }

        /* -----------------------------------------------------------------------------
           PAGE GUIDE PANEL (SLIDE-IN FROM RIGHT)
           ----------------------------------------------------------------------------- */
        .page-guide-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 380px;
            max-width: 90vw;
            height: 100vh;
            background: var(--glass-strong);
            border-left: 1px solid var(--border-glass-strong);
            box-shadow: -8px 0 32px rgba(0, 0, 0, 0.4);
            z-index: 1001;
            transform: translateX(100%);
            transition: transform var(--transition-normal);
            display: flex;
            flex-direction: column;
        }

        .page-guide-panel.active {
            transform: translateX(0);
        }

        .page-guide-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--space-4) var(--space-5);
            border-bottom: 1px solid var(--border-glass);
        }

        .page-guide-title {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: var(--text-base);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
        }

        .page-guide-title svg {
            color: var(--accent-cyan);
        }

        .page-guide-close {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .page-guide-close:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }

        .page-guide-content {
            flex: 1;
            padding: var(--space-5);
            overflow-y: auto;
        }

        .page-guide-content h3 {margin-bottom: var(--space-3);}

        .page-guide-content p {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            line-height: var(--leading-relaxed);
            margin-bottom: var(--space-4);
        }

        .page-guide-content ul {
            list-style: none;
            margin-bottom: var(--space-5);
        }

        .page-guide-content li {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            padding: var(--space-2) 0;
            padding-left: var(--space-5);
            position: relative;
        }

        .page-guide-content li::before {
            content: "•";
            position: absolute;
            left: 0;
            color: var(--accent-cyan);
        }

        .page-guide-section {
            padding: var(--space-4);
            background: transparent;
            border-radius: var(--radius-lg);
            margin-bottom: var(--space-4);
        }

        .page-guide-section-title {
            font-size: var(--text-sm);
            font-weight: var(--font-semibold);
            color: var(--accent-cyan);
            margin-bottom: var(--space-2);
        }

        .page-guide-important {
            padding: var(--space-4);
            background: rgba(14, 165, 233, 0.1);
            border: 1px solid rgba(14, 165, 233, 0.3);
            border-radius: var(--radius-lg);
            margin-bottom: var(--space-4);
        }

        .page-guide-important-title {
            font-size: var(--text-sm);
            font-weight: var(--font-semibold);
            color: var(--accent-cyan);
            display: flex;
            align-items: center;
            gap: var(--space-2);
            margin-bottom: var(--space-2);
        }

        .page-guide-important p {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            margin-bottom: 0;
        }

        .page-guide-cta {
            margin-top: var(--space-4);
        }

        .page-guide-cta a {
            display: inline-flex;
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-4);
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--accent-cyan);
            text-decoration: none;
            background: rgba(14, 165, 233, 0.1);
            border: 1px solid rgba(14, 165, 233, 0.3);
            border-radius: var(--radius-md);
            transition: all var(--transition-fast);
        }

        .page-guide-cta a:hover {
            background: rgba(14, 165, 233, 0.2);
        }

        .page-guide-footer {
            padding: var(--space-4) var(--space-5);
            border-top: 1px solid var(--border-glass);
            background: var(--glass-subtle);
        }

        .page-guide-dismiss-option {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: var(--text-sm);
            color: var(--text-muted);
            cursor: pointer;
        }

        .page-guide-dismiss-option input {
            width: 16px;
            height: 16px;
            accent-color: var(--accent-cyan);
        }

        /* Page Guide Trigger Button — hidden */
        .page-guide-trigger {
            display: none !important;
            position: fixed;
            top: 80%;
            right: var(--space-4);
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-3);
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--text-secondary);
            background: transparent;
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-lg);
            cursor: pointer;
            z-index: 100;
            transition: all var(--transition-fast);
        }

        .page-guide-trigger:hover {
            background: var(--glass-strong);
            color: var(--text-primary);
        }

        .page-guide-trigger svg {
            width: 16px;
            height: 16px;
        }

        @media (max-width: 640px) {
            .page-guide-trigger span {
                display: none;
            }
            .page-guide-trigger {
                padding: var(--space-2);
            }
        }

        /* -----------------------------------------------------------------------------
           PERSONALIZATION CTA MODAL
           ----------------------------------------------------------------------------- */
        .personalization-cta-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.95);
            background: var(--glass-strong);
            border: 1px solid var(--border-glass-strong);
            border-radius: var(--radius-2xl);
            box-shadow: var(--shadow-xl);
            max-width: 420px;
            width: calc(100% - var(--space-8));
            z-index: 1001;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-normal);
        }

        .personalization-cta-modal.active {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .personalization-cta-header {
            padding: var(--space-6);
            text-align: center;
            position: relative;
        }

        .personalization-cta-header .page-guide-close {
            position: absolute;
            top: var(--space-4);
            right: var(--space-4);
        }

        .personalization-cta-icon {
            font-size: 48px;
            display: block;
            margin-bottom: var(--space-3);
        }

        .personalization-cta-title {
            font-size: var(--text-xl);
            font-weight: var(--font-bold);
            color: var(--text-primary);
            margin-bottom: var(--space-2);
        }

        .personalization-cta-subtitle {
            font-size: var(--text-sm);
            color: var(--text-secondary);
            line-height: var(--leading-relaxed);
        }

        .personalization-cta-body {
            padding: 0 var(--space-6) var(--space-6);
            text-align: center;
        }

        .personalization-cta-note {
            font-size: var(--text-xs);
            color: var(--text-muted);
            margin-bottom: var(--space-4);
        }

        .personalization-cta-btn {
            display: block;
            width: 100%;
            margin-bottom: var(--space-3);
            text-align: center;
            text-decoration: none;
        }

        .personalization-cta-btn:last-child {
            margin-bottom: 0;
        }

        /* -----------------------------------------------------------------------------
           EXPLANATION MODAL (Why am I seeing this?)
           ----------------------------------------------------------------------------- */
        .explanation-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.95);
            background: var(--glass-strong);
            border: 1px solid var(--border-glass-strong);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            max-width: 400px;
            width: calc(100% - var(--space-8));
            z-index: 1001;
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-normal);
        }

        .explanation-modal.active {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%) scale(1);
        }

        .explanation-modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--space-4) var(--space-5);
            border-bottom: 1px solid var(--border-glass);
        }

        .explanation-modal-title {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: var(--text-base);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
        }

        .explanation-modal-title svg {
            color: var(--accent-cyan);
        }

        .explanation-modal-content {
            padding: var(--space-5);
        }

        .explanation-item {
            display: flex;
            align-items: flex-start;
            gap: var(--space-3);
            padding: var(--space-3) 0;
            border-bottom: 1px solid var(--border-glass);
        }

        .explanation-item:last-child {
            border-bottom: none;
        }

        .explanation-item-icon {
            flex-shrink: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border-radius: var(--radius-md);
            color: var(--text-muted);
        }

        .explanation-item-content {
            flex: 1;
        }

        .explanation-item-label {
            font-size: var(--text-xs);
            font-weight: var(--font-medium);
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: var(--space-1);
        }

        .explanation-item-value {
            font-size: var(--text-sm);
            color: var(--text-primary);
        }

        .explanation-confidence {
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .explanation-confidence-bar {
            flex: 1;
            height: 6px;
            background: var(--glass-strong);
            border-radius: var(--radius-full);
            overflow: hidden;
        }

        .explanation-confidence-fill {
            height: 100%;
            background: var(--accent-cyan);
            border-radius: var(--radius-full);
        }

        .explanation-confidence-value {
            font-size: var(--text-xs);
            color: var(--text-muted);
            min-width: 36px;
        }

        /* -----------------------------------------------------------------------------
           PROGRESS BAR (ACCENT COLORS ALLOWED HERE)
           ----------------------------------------------------------------------------- */
        .progress {
            height: 6px;
            background: var(--glass-strong);
            border-radius: var(--radius-full);
            overflow: hidden;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
            border-radius: var(--radius-full);
            transition: width var(--transition-slow);
        }

        .progress-bar-success { background: var(--color-success); }
        .progress-bar-warning { background: var(--color-warning); }

        /* -----------------------------------------------------------------------------
           EMPTY STATE
           ----------------------------------------------------------------------------- */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: var(--space-12) var(--space-6);
        }

        .empty-state-icon {
            font-size: 48px;
            margin-bottom: var(--space-4);
            opacity: 0.6;
        }

        .empty-state-title {
            font-size: var(--text-lg);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
            margin-bottom: var(--space-2);
        }

        .empty-state-text {
            font-size: var(--text-sm);
            color: var(--text-muted);
            max-width: 360px;
            margin-bottom: var(--space-6);
        }

        /* -----------------------------------------------------------------------------
           GLOBAL HEADER (MINIMAL, FLAT)
           ----------------------------------------------------------------------------- */
        .global-header {
            background: rgba(14, 14, 14, 0.85);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border-bottom: 1px solid var(--border-glass);
            height: var(--header-height);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-container {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 0 var(--content-padding);
            height: 100%;
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .header-actions {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: var(--space-1);
            flex: 1;
        }

        /* §1.15 primary CTA pill — quick log shortcut in header. */
        .header-cta {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            height: 36px;
            padding: 0 14px;
            border-radius: 999px;
            background: linear-gradient(135deg, var(--accent-primary, #4F8AFF), var(--accent-purple, #8b5cf6));
            color: #fff;
            font-size: 13px;
            font-weight: 600;
            line-height: 1;
            text-decoration: none;
            white-space: nowrap;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
            transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
        }
        .header-cta:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
            opacity: 0.95;
        }
        .header-cta svg {
            width: 14px;
            height: 14px;
            flex-shrink: 0;
            stroke-width: 2.5;
        }
        @media (max-width: 768px) {
            .header-cta {
                width: 36px;
                padding: 0;
                justify-content: center;
            }
            .header-cta-label { display: none; }
        }

        /* Notification bell */
        .notif-bell {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            text-decoration: none;
            transition: background 0.2s, color 0.2s;
        }
        .notif-bell:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }
        .notif-bell svg { width: 20px; height: 20px; }

        /* Tour help button */
        .tour-help-btn {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
        }
        .tour-help-btn:hover {
            background: var(--glass-hover);
            color: var(--accent-cyan);
        }
        .tour-help-btn svg { width: 20px; height: 20px; }
        .notif-bell-badge {
            position: absolute;
            top: 4px;
            right: 4px;
            min-width: 16px;
            height: 16px;
            padding: 0 4px;
            font-size: 0.6875rem;
            font-weight: 700;
            line-height: 16px;
            text-align: center;
            color: #fff;
            background: var(--color-error);
            border-radius: 8px;
            display: none;
        }
        .notif-bell-badge.has-count { display: block; }

        .notif-wrapper {
            position: relative;
        }

        .notif-dropdown {
            display: none;
            position: absolute;
            top: calc(100% + 8px);
            right: 0;
            width: 380px;
            max-height: 480px;
            background: var(--bg-secondary, #1a1a2e);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
            box-shadow: 0 16px 48px rgba(0,0,0,0.4);
            z-index: 1000;
            overflow: hidden;
            flex-direction: column;
        }

        .notif-dropdown.open {
            display: flex;
        }

        .notif-dropdown-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--space-4);
            border-bottom: 1px solid var(--border-glass);
        }

        .notif-dropdown-title {
            font-size: var(--text-sm);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
        }

        .notif-mark-read {
            background: none;
            border: none;
            color: var(--accent-blue);
            font-size: var(--text-xs);
            cursor: pointer;
            font-family: inherit;
            padding: var(--space-1) var(--space-2);
            border-radius: var(--radius-sm);
            transition: background 0.2s;
        }

        .notif-mark-read:hover {
            background: rgba(79, 138, 255, 0.1);
        }

        .notif-dropdown-body {
            flex: 1;
            overflow-y: auto;
            max-height: 360px;
        }

        .notif-item {
            display: flex;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            border-bottom: 1px solid rgba(255,255,255,0.03);
            text-decoration: none;
            transition: background 0.15s;
            cursor: pointer;
        }

        .notif-item:hover {
            background: var(--glass-hover);
        }

        .notif-item:last-child {
            border-bottom: none;
        }

        .notif-item-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            flex-shrink: 0;
            margin-top: 6px;
        }

        .notif-item-dot.amber { background: #f59e0b; }
        .notif-item-dot.blue { background: #4F8AFF; }
        .notif-item-dot.red { background: #ef4444; }

        .notif-item-content {
            flex: 1;
            min-width: 0;
        }

        .notif-item-title {
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .notif-item-body {
            font-size: var(--text-xs);
            color: var(--text-muted);
            margin-top: 2px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .notif-item-time {
            font-size: 0.6875rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .notif-empty {
            padding: var(--space-8) var(--space-4);
            text-align: center;
            color: var(--text-muted);
            font-size: var(--text-sm);
        }

        .notif-loading {
            padding: var(--space-6) var(--space-4);
            text-align: center;
            color: var(--text-muted);
            font-size: var(--text-sm);
        }

        .notif-dropdown-footer {
            display: block;
            padding: var(--space-3) var(--space-4);
            text-align: center;
            font-size: var(--text-xs);
            color: var(--accent-blue);
            text-decoration: none;
            border-top: 1px solid var(--border-glass);
            transition: background 0.15s;
        }

        .notif-dropdown-footer:hover {
            background: var(--glass-hover);
        }

        @media (max-width: 480px) {
            .notif-dropdown {
                position: fixed;
                top: var(--header-height);
                right: 0;
                left: 0;
                width: 100%;
                max-height: calc(100vh - var(--header-height) - 20px);
                border-radius: 0 0 var(--radius-xl) var(--radius-xl);
            }
        }

        .header-brand {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            text-decoration: none;
            flex: 1;
        }

        .header-logo {
            height: 32px;
            display: flex;
            align-items: center;
        }

        .header-logo picture {
            display: flex;
            height: 100%;
        }

        .header-logo img {
            height: 100%;
            width: auto;
            object-fit: contain;
        }

        @media (max-width: 480px) {
            .header-brand-text { display: none; }
        }

        .header-nav {
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .header-nav-link {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: var(--radius-full);
            text-decoration: none;
            color: var(--text-muted);
            transition: all var(--transition-fast);
            position: relative;
        }

        .header-nav-link:hover {
            background: transparent;
            color: var(--text-primary);
        }

        .header-nav-link.active {
            background: transparent;
            color: var(--accent-blue);
        }

        .header-nav-link svg { width: 20px; height: 20px; }

        /* Tooltip on hover */
        .header-nav-link::after {
            content: attr(title);
            position: absolute;
            bottom: -30px;
            left: 50%;
            transform: translateX(-50%) translateY(4px);
            background: rgba(0, 0, 0, 0.9);
            color: var(--text-primary);
            font-size: 11px;
            padding: 3px 8px;
            border-radius: var(--radius-md);
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transition: all 0.15s ease;
            z-index: 200;
        }
        .header-nav-link:hover::after {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        @media (max-width: 768px) {
            .header-nav { display: none; }
            .account-menu { display: none; }
        }

        /* Mobile hamburger button */
        .mobile-menu-btn {
            display: none;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: var(--radius-full);
            transition: all var(--transition-fast);
        }

        .mobile-menu-btn:hover { background: transparent; color: var(--text-primary); }
        .mobile-menu-btn svg { width: 22px; height: 22px; }

        @media (max-width: 768px) {
            .mobile-menu-btn { display: flex; }
        }

        /* Mobile slide-out panel */
        .mobile-nav-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 10000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.25s, visibility 0.25s;
        }

        .mobile-nav-overlay.open { opacity: 1; visibility: visible; }

        .mobile-nav-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 280px;
            max-width: 85vw;
            height: 100vh;
            background: rgba(10, 10, 10, 0.97);
            border-left: 1px solid rgba(255, 255, 255, 0.08);
            z-index: 10001;
            transform: translateX(100%);
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            overflow-y: auto;
            padding: 0;
        }

        .mobile-nav-panel.open { transform: translateX(0); }

        .mobile-nav-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .mobile-nav-header span {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-primary);
        }

        .mobile-nav-close {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 44px;
            height: 44px;
            min-width: 44px;
            min-height: 44px;
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: var(--radius-full);
            transition: all var(--transition-fast);
            position: relative;
            z-index: 10;
        }

        .mobile-nav-close:hover { background: transparent; color: var(--text-primary); }
        .mobile-nav-close svg { width: 20px; height: 20px; }

        .mobile-nav-section {
            padding: 12px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .mobile-nav-section:last-child { border-bottom: none; }

        .mobile-nav-section-title {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            padding: 0 20px 8px;
        }

        .mobile-nav-link {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 20px;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.9rem;
            transition: all var(--transition-fast);
        }

        .mobile-nav-link:hover, .mobile-nav-link:active {
            background: transparent;
            color: var(--text-primary);
        }

        .mobile-nav-link.active {
            color: var(--accent-blue);
            background: rgba(79, 138, 255, 0.06);
        }

        .mobile-nav-link svg { width: 20px; height: 20px; flex-shrink: 0; }

        .mobile-nav-user {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .mobile-nav-user-avatar {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-full);
            background: transparent;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 1rem;
            color: var(--accent-blue);
            flex-shrink: 0;
        }

        .mobile-nav-user-info {
            min-width: 0;
        }

        .mobile-nav-user-name {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .mobile-nav-user-email {
            font-size: 0.75rem;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Account Menu */
        .account-menu { position: relative; }

        .account-trigger {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-1) var(--space-2);
            border: none;
            background: transparent;
            border-radius: var(--radius-lg);
            cursor: pointer;
            transition: all var(--transition-fast);
        }

        .account-trigger:hover { background: transparent; }

        .account-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--glass-strong);
            border: 1px solid var(--border-glass);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-primary);
            font-weight: var(--font-semibold);
            font-size: var(--text-sm);
            text-transform: uppercase;
        }

        .account-info { text-align: left; }

        .account-name {
            font-size: var(--text-sm);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
            line-height: 1.3;
        }

        .account-email {
            font-size: var(--text-xs);
            color: var(--text-secondary);
            line-height: 1.3;
        }

        @media (max-width: 640px) {
            .account-info { display: none; }
        }

        .account-chevron {
            width: 16px;
            height: 16px;
            color: var(--text-subtle);
            transition: transform var(--transition-fast);
        }

        .account-menu.open .account-chevron { transform: rotate(180deg); }

        @media (max-width: 640px) {
            .account-chevron { display: none; }
        }

        /* Account Dropdown (Mega-Menu) */
        .account-dropdown {
            position: absolute;
            top: calc(100% + var(--space-2));
            right: 0;
            width: 720px;
            background: #0a0a0a;
            border: 1px solid var(--border-glass-strong);
            border-radius: 16px;
            box-shadow: var(--shadow-xl);
            opacity: 0;
            visibility: hidden;
            transform: translateY(-8px);
            transition: all var(--transition-fast);
            z-index: 200;
            max-height: calc(100vh - 100px);
            overflow-y: auto;
            padding: 0;
        }
        html[data-theme="light"] .account-dropdown {
            background: #ffffff;
        }

        /* === Variant C — Mega-menu redesign === */
        /* Hero quick-action row (the only colorful zone) */
        .acc-hero {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            padding: 16px 16px 8px;
        }
        .acc-hero-card {
            position: relative;
            height: 84px;
            border-radius: 12px;
            border: 1px solid;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            text-decoration: none;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            padding: 8px;
            gap: 2px;
        }
        .acc-hero-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 18px rgba(0,0,0,0.35);
        }
        .acc-hero-card svg { width: 22px; height: 22px; margin-bottom: 4px; }
        .acc-hero-card .acc-hero-title { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.1; }
        .acc-hero-card .acc-hero-sub {
            font-size: 9px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            opacity: 0.7;
            font-weight: 700;
        }
        .acc-hero-mood {
            background: linear-gradient(135deg, rgba(99,102,241,0.32), rgba(99,102,241,0.06));
            border-color: rgba(99,102,241,0.4);
        }
        .acc-hero-mood svg, .acc-hero-mood .acc-hero-sub { color: #c7d2fe; }
        .acc-hero-reminder {
            background: linear-gradient(135deg, rgba(16,185,129,0.32), rgba(16,185,129,0.06));
            border-color: rgba(16,185,129,0.4);
        }
        .acc-hero-reminder svg, .acc-hero-reminder .acc-hero-sub { color: #a7f3d0; }
        .acc-hero-focus {
            background: linear-gradient(135deg, rgba(239,68,68,0.32), rgba(239,68,68,0.06));
            border-color: rgba(239,68,68,0.4);
        }
        .acc-hero-focus svg, .acc-hero-focus .acc-hero-sub { color: #fecaca; }

        /* User identity strip — uses our card surface */
        .acc-identity {
            margin: 8px 16px 12px;
            padding: 14px 16px;
            border-radius: 12px;
            border: 2px solid var(--border-subtle, rgba(255,255,255,0.08));
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .acc-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background: linear-gradient(135deg, #8b9eff, #4c6ef5);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-weight: 700;
            font-size: 17px;
            flex-shrink: 0;
        }
        .acc-identity-text { flex: 1; min-width: 0; }
        .acc-name {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary, #f9fafb);
            line-height: 1.3;
        }
        .acc-email {
            font-size: 11.5px;
            color: var(--text-muted, #9CA3AF);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-top: 2px;
        }
        .acc-stats { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
        .acc-stat-pill {
            font-size: 10px;
            padding: 4px 9px;
            border-radius: 999px;
            background: rgba(255,255,255,0.06);
            border: 1px solid rgba(255,255,255,0.1);
            color: var(--text-primary, #f9fafb);
            font-weight: 700;
            letter-spacing: 0.05em;
        }
        .acc-stat-pill.pro {
            background: linear-gradient(135deg, rgba(184,196,255,0.15), rgba(76,110,245,0.15));
            border-color: rgba(124,154,255,0.4);
            color: #b8c9ff;
        }

        /* Category card grid — uses PLOS card design (no rainbow) */
        .acc-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            padding: 0 16px 16px;
        }
        .acc-cat {
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 6px 6px 4px;
            transition: none;
        }
        .acc-cat:hover {
            border: none;
            transform: none;
        }
        .acc-cat-head {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
        }
        .acc-cat-head .material-symbols-outlined { font-size: 18px; }
        .acc-cat-title {
            font-size: 10.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }
        /* Per-category accent — only on icon + title, not on card body */
        .acc-cat[data-cat="daily"]    .acc-cat-head { color: #6c88ff; }
        .acc-cat[data-cat="intel"]    .acc-cat-head { color: #c084fc; }
        .acc-cat[data-cat="reviews"]  .acc-cat-head { color: #fbbf24; }
        .acc-cat[data-cat="track"]    .acc-cat-head { color: #6ee7b7; }
        .acc-cat[data-cat="connect"]  .acc-cat-head { color: #f472b6; }
        .acc-cat[data-cat="money"]    .acc-cat-head { color: #fcd34d; }
        .acc-cat[data-cat="grow"]     .acc-cat-head { color: #fb923c; }
        .acc-cat[data-cat="account"]  .acc-cat-head { color: #cbd5e1; }

        .acc-cat-links {
            display: flex;
            flex-direction: column;
            gap: 1px;
        }
        .acc-cat .acc-link {
            display: flex;
            align-items: center;
            height: 28px;
            padding: 0 8px;
            border-radius: 6px;
            font-size: 12.5px;
            color: #d4d4d4;
            text-decoration: none;
            transition: background 0.15s, color 0.15s;
            line-height: 1;
        }
        .acc-cat .acc-link:hover {
            background: rgba(255,255,255,0.06);
            color: #ffffff;
        }
        .acc-cat .acc-link.locked {
            color: #6e7681;
            cursor: default;
        }
        .acc-cat .acc-link.locked .material-symbols-outlined {
            font-size: 13px;
            margin-right: 4px;
        }
        .acc-cat .acc-link.signout {
            color: #f87171;
            margin-top: 4px;
            font-weight: 500;
        }
        .acc-cat .acc-link.signout:hover {
            background: rgba(239,68,68,0.12);
            color: #fca5a5;
        }
        .acc-cat .acc-link.upgrade {
            color: #fbbf24;
            font-weight: 600;
        }
        .acc-cat .acc-link.upgrade:hover {
            background: rgba(251,191,36,0.1);
        }

        /* Show more / less collapsing */
        .acc-cat .acc-link.acc-extra { display: none; }
        .acc-cat.expanded .acc-link.acc-extra { display: flex; }
        .acc-show-more {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            height: 24px;
            padding: 0 10px;
            margin-top: 6px;
            background: rgba(124, 154, 255, 0.1);
            border: 1px solid rgba(124, 154, 255, 0.25);
            color: #7c9aff;
            font-size: 10.5px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            cursor: pointer;
            border-radius: 999px;
            font-family: inherit;
            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
            width: fit-content;
        }
        .acc-show-more:hover {
            background: rgba(124, 154, 255, 0.18);
            border-color: rgba(124, 154, 255, 0.5);
            color: #b8c9ff;
        }
        .acc-show-more svg {
            width: 11px;
            height: 11px;
            transition: transform 0.2s ease;
        }
        .acc-cat.expanded .acc-show-more {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(255, 255, 255, 0.1);
            color: var(--text-muted, #9CA3AF);
        }
        .acc-cat.expanded .acc-show-more svg {
            transform: rotate(180deg);
        }
        html[data-theme="light"] .acc-show-more {
            background: rgba(76, 110, 245, 0.08);
            border-color: rgba(76, 110, 245, 0.25);
            color: #4c6ef5;
        }
        html[data-theme="light"] .acc-show-more:hover {
            background: rgba(76, 110, 245, 0.15);
            border-color: rgba(76, 110, 245, 0.45);
            color: #3b5bdb;
        }
        html[data-theme="light"] .acc-cat.expanded .acc-show-more {
            background: #f3f4f6;
            border-color: rgba(0,0,0,0.1);
            color: #6b7280;
        }

        /* Light mode */
        html[data-theme="light"] .acc-identity {
            background: #ffffff;
            border-color: rgba(0,0,0,0.1);
        }
        html[data-theme="light"] .acc-cat-head {
            border-bottom-color: rgba(0,0,0,0.08);
        }
        html[data-theme="light"] .acc-cat .acc-link { color: #374151; }
        html[data-theme="light"] .acc-cat .acc-link:hover { background: #f3f4f6; color: #111827; }
        html[data-theme="light"] .acc-name { color: #111827; }
        html[data-theme="light"] .acc-email { color: #6b7280; }
        html[data-theme="light"] .acc-stat-pill { background: #f3f4f6; border-color: rgba(0,0,0,0.08); color: #374151; }

        /* Mobile fallback */
        @media (max-width: 768px) {
            .account-dropdown { width: 92vw; max-width: 540px; }
            .acc-grid { grid-template-columns: 1fr; }
            .acc-hero { grid-template-columns: 1fr; }
            .acc-hero-card { height: 72px; }
        }

        .account-menu.open .account-dropdown {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        /* Mega-menu grid layout */
        .mega-menu {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0;
            padding: 16px;
        }

        .mega-category {
            padding: 12px 16px;
        }

        .mega-category-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.6875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: #858585;
            margin-bottom: 8px;
        }

        .mega-category-header .material-symbols-outlined {
            font-size: 16px;
        }

        .mega-link {
            display: block;
            padding: 6px 0 6px 24px;
            font-size: 0.875rem;
            color: #e2e2e2;
            text-decoration: none;
            border-radius: 8px;
            transition: color 0.15s;
            min-height: 36px;
            line-height: 36px;
            padding-top: 0;
            padding-bottom: 0;
        }

        .mega-link:hover {
            color: #fff;
        }

        .mega-signout {
            color: var(--color-error);
        }

        .mega-signout:hover {
            color: #f87171;
        }

        /* Progressive Feature Unlock — locked nav links
           Uses explicit dimmed colors instead of opacity to maintain
           WCAG AA 4.5:1 contrast ratio on both dark and light backgrounds.
           Dark bg (#0a0a0a): #808080 = 5.3:1 ✓
           Light bg (#fff):   #737373 = 4.7:1 ✓  */
        .mega-link.locked,
        .mobile-nav-link.locked {
            color: #808080;
            cursor: default;
            pointer-events: auto;
            position: relative;
        }
        html[data-theme="light"] .mega-link.locked,
        html[data-theme="light"] .mobile-nav-link.locked {
            color: #737373;
        }
        .mega-link.locked .material-symbols-outlined,
        .mobile-nav-link.locked .material-symbols-outlined {
            font-size: 14px;
            vertical-align: middle;
            margin-right: 2px;
            color: inherit;
        }
        .mobile-nav-link.locked svg {
            color: inherit;
            opacity: 0.7;
        }

        /* Feature unlock toast */
        .feature-unlock-toast {
            position: fixed;
            bottom: 100px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: var(--bg-elevated, #1a1a2e);
            color: var(--text-primary, #e2e2e2);
            border: 1px solid var(--border-glass, rgba(255,255,255,0.08));
            border-radius: 12px;
            padding: 12px 20px;
            font-size: 0.875rem;
            z-index: 10000;
            opacity: 0;
            transition: opacity 0.3s, transform 0.3s;
            pointer-events: none;
            max-width: 360px;
            text-align: center;
            backdrop-filter: blur(20px);
            box-shadow: 0 8px 32px rgba(0,0,0,0.4);
        }
        .feature-unlock-toast.visible {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        @media (max-width: 540px) {
            .account-dropdown {
                width: calc(100vw - 24px);
                right: -8px;
            }
            .mega-menu {
                grid-template-columns: 1fr;
                padding: 12px;
            }
        }

        /* Life Areas Nav Dropdown */
        .la-nav-wrap {
            position: relative;
            display: inline-flex;
        }
        .la-dropdown {
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%) translateY(-8px);
            width: 220px;
            background: black;
            border: 1px solid var(--border-glass-strong);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            opacity: 0;
            visibility: hidden;
            transition: all var(--transition-fast);
            z-index: 200;
            padding: var(--space-2);
            pointer-events: none;
        }
        /* Invisible bridge to prevent gap-related mouseout */
        .la-nav-wrap::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            height: 12px;
            display: none;
        }
        .la-nav-wrap:hover::after {
            display: block;
        }
        .la-nav-wrap:hover .la-dropdown {
            opacity: 1;
            visibility: visible;
            transform: translateX(-50%) translateY(0);
            pointer-events: auto;
        }
        .la-dropdown-section {
            padding: var(--space-2) var(--space-3);
            border-bottom: 1px solid var(--border-glass);
            margin-bottom: var(--space-1);
        }
        .la-dropdown-title {
            font-size: var(--text-xs);
            font-weight: var(--font-semibold);
            color: var(--text-subtle);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .la-dropdown-links { padding: var(--space-1) 0; }

        .dropdown-header {
            padding: var(--space-4);
            border-bottom: 1px solid var(--border-glass);
        }

        .dropdown-name {
            font-size: var(--text-sm);
            font-weight: var(--font-semibold);
            color: var(--text-primary);
        }

        .dropdown-email {
            font-size: var(--text-xs);
            color: var(--text-muted);
            word-break: break-all;
            margin-top: 2px;
        }

        .dropdown-section { padding: var(--space-2); }

        .dropdown-section-title {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-3);
            font-size: 0.6875rem;
            font-weight: var(--font-bold);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-subtle);
        }

        .dropdown-section-title svg { width: 14px; height: 14px; }

        .dropdown-link {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-2) var(--space-3);
            border-radius: var(--radius-lg);
            text-decoration: none;
            color: var(--text-secondary);
            font-size: var(--text-sm);
            transition: all var(--transition-fast);
        }

        .dropdown-link:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }

        .dropdown-link svg {
            width: 18px;
            height: 18px;
            color: var(--text-subtle);
            flex-shrink: 0;
        }

        .dropdown-link:hover svg { color: var(--text-muted); }

        .dropdown-link-content {
            display: flex;
            flex-direction: column;
            flex: 1;
            min-width: 0;
        }

        .dropdown-link-label {
            font-size: var(--text-sm);
            font-weight: var(--font-medium);
            color: var(--text-secondary);
        }

        .dropdown-link:hover .dropdown-link-label { color: var(--text-primary); }

        .dropdown-link-description {
            font-size: var(--text-xs);
            color: var(--text-subtle);
            line-height: 1.3;
        }

        .dropdown-divider {
            height: 1px;
            background: var(--border-glass);
            margin: var(--space-2);
        }

        .dropdown-link.logout { color: var(--color-error); }
        .dropdown-link.logout svg { color: var(--color-error); }
        .dropdown-link.logout:hover { background: var(--color-error-soft); }

        .upgrade-link {
            background: linear-gradient(135deg, rgba(79, 138, 255, 0.1), rgba(139, 92, 246, 0.1)) !important;
            border: 1px solid rgba(79, 138, 255, 0.2) !important;
            border-radius: var(--radius-md) !important;
            margin: 0 var(--space-2) var(--space-2) !important;
            color: #4F8AFF !important;
        }

        .upgrade-link:hover {
            background: linear-gradient(135deg, rgba(79, 138, 255, 0.2), rgba(139, 92, 246, 0.2)) !important;
            border-color: rgba(79, 138, 255, 0.4) !important;
        }

        .upgrade-badge {
            margin-left: auto;
            padding: 1px 6px;
            background: linear-gradient(135deg, #4F8AFF, #8b5cf6);
            color: white;
            border-radius: 4px;
            font-size: 0.6875rem;
            font-weight: 700;
            letter-spacing: 0.05em;
        }

        /* -----------------------------------------------------------------------------
           MAIN CONTENT (FULL WIDTH LAYOUT)
           ----------------------------------------------------------------------------- */
        .main-content {
            min-height: calc(100vh - var(--header-height));
            overflow-x: hidden;
            opacity: 0;
            transition: opacity 0.25s ease-in;
        }
        .main-content.ready {
            opacity: 1;
        }

        /* Global skeleton shimmer (available on all pages) */
        .skeleton-block {
            background: linear-gradient(90deg,
                rgba(255,255,255,0.03) 25%,
                rgba(255,255,255,0.06) 50%,
                rgba(255,255,255,0.03) 75%
            );
            background-size: 200% 100%;
            animation: skeleton-shimmer 1.5s infinite;
            border-radius: 8px;
        }
        @keyframes skeleton-shimmer {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* Staggered card entrance (used by app-card, glass-card, settings-card) */
        .app-card, .glass-card {
            opacity: 0;
            transform: translateY(10px);
            transition: opacity 0.3s ease-out, transform 0.3s ease-out;
        }
        .app-card.visible, .glass-card.visible {
            opacity: 1;
            transform: translateY(0);
        }

        .page-container {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: var(--space-6) var(--content-padding);
        }

        /* Full-width variant */
        .page-container-wide {
            max-width: none;
            padding: var(--space-6) var(--content-padding);
        }

        /* -------------------------------------------------------------------------
           BREADCRUMB NAVIGATION — Glass pill style
           ------------------------------------------------------------------------- */
        .plos-crumbs {
            display: flex;
            align-items: center;
            gap: 0;
            width: 100%;
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 8px var(--content-padding) 0;
            font-size: var(--text-xs);
            line-height: 1;
            overflow-x: auto;
            scrollbar-width: none;
            -webkit-overflow-scrolling: touch;
        }
        .plos-crumbs::-webkit-scrollbar { display: none; }
        .plos-crumbs:empty { display: none; }

        .plos-crumb {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 5px 12px;
            border-radius: 100px;
            text-decoration: none;
            color: var(--text-subtle);
            white-space: nowrap;
            transition: all var(--transition-fast);
            background: transparent;
        }
        .plos-crumb:hover {
            background: var(--glass-hover);
            color: var(--text-primary);
        }
        .plos-crumb svg {
            width: 13px;
            height: 13px;
            flex-shrink: 0;
            opacity: 0.6;
        }
        .plos-crumb:hover svg { opacity: 1; }

        .plos-crumb-sep {
            color: var(--text-subtle);
            opacity: 0.3;
            font-size: 11px;
            padding: 0 2px;
            user-select: none;
        }

        .plos-crumb-current {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: var(--text-secondary);
            font-weight: var(--font-medium);
            padding: 5px 12px;
            background: var(--glass-subtle, rgba(255,255,255,0.04));
            border-radius: 100px;
            white-space: nowrap;
        }
        .plos-crumb-current svg {
            width: 13px;
            height: 13px;
            flex-shrink: 0;
            opacity: 0.6;
        }

        @media (max-width: 640px) {
            .plos-crumbs {
                padding: var(--space-2) var(--space-3);
                font-size: 13px;
            }
            .plos-crumb { padding: 8px 12px; min-height: 36px; }
            .plos-crumb-current { padding: 8px 12px; min-height: 36px; font-size: 13px; }
            .plos-crumb-sep { font-size: 13px; padding: 0 4px; }
        }

        /* App shell (used by many pages) */
        .app-shell {
            width: 100%;
            min-height: calc(100vh - var(--header-height));
        }

        .app-container {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: var(--space-6) var(--content-padding);
        }

        .page-header {
            margin-bottom: var(--space-6);
        }

        .page-title {
            font-size: var(--text-2xl);
            font-weight: var(--font-bold);
            color: var(--text-primary);
            margin-bottom: var(--space-1);
        }

        .page-subtitle {
            font-size: var(--text-sm);
            color: var(--text-muted);
        }

        /* -----------------------------------------------------------------------------
           TRUST SIGNALS
           ----------------------------------------------------------------------------- */
        .trust-badge {
            display: inline-flex;
            align-items: center;
            gap: var(--space-1);
            padding: var(--space-1) var(--space-2);
            background: var(--glass-subtle);
            border: 1px solid var(--border-glass);
            color: var(--text-muted);
            font-size: var(--text-xs);
            font-weight: var(--font-medium);
            border-radius: var(--radius-md);
        }

        .trust-badge svg { width: 12px; height: 12px; color: var(--accent-green); }

        /* -----------------------------------------------------------------------------
           UTILITY CLASSES
           ----------------------------------------------------------------------------- */
        .hidden { display: none !important; }

        .flex { display: flex; }
        .flex-col { flex-direction: column; }
        .flex-1 { flex: 1; }
        .items-center { align-items: center; }
        .items-start { align-items: flex-start; }
        .justify-center { justify-content: center; }
        .justify-between { justify-content: space-between; }
        .justify-end { justify-content: flex-end; }
        .flex-wrap { flex-wrap: wrap; }

        .gap-1 { gap: var(--space-1); }
        .gap-2 { gap: var(--space-2); }
        .gap-3 { gap: var(--space-3); }
        .gap-4 { gap: var(--space-4); }
        .gap-5 { gap: var(--space-5); }
        .gap-6 { gap: var(--space-6); }

        .grid { display: grid; }

        .card-grid { display: grid; gap: var(--space-5); }
        .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
        .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
        .card-grid-4 { grid-template-columns: repeat(4, 1fr); }

        @media (max-width: 1200px) {
            .card-grid-4 { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 900px) {
            .card-grid-3, .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 600px) {
            .card-grid-2, .card-grid-3, .card-grid-4 { grid-template-columns: 1fr; }
        }

        .w-full { width: 100%; }

        .mt-1 { margin-top: var(--space-1); }
        .mt-2 { margin-top: var(--space-2); }
        .mt-3 { margin-top: var(--space-3); }
        .mt-4 { margin-top: var(--space-4); }
        .mt-6 { margin-top: var(--space-6); }
        .mt-8 { margin-top: var(--space-8); }

        .mb-2 { margin-bottom: var(--space-2); }
        .mb-4 { margin-bottom: var(--space-4); }
        .mb-6 { margin-bottom: var(--space-6); }

        .p-4 { padding: var(--space-4); }
        .p-5 { padding: var(--space-5); }
        .p-6 { padding: var(--space-6); }

        .text-center { text-align: center; }
        .text-right { text-align: right; }

        .truncate {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .rounded-full { border-radius: var(--radius-full); }

        /* =========================================================================
           GLOBAL FOOTER
           ========================================================================= */

        /* .floating-ai-btn removed — replaced by .chat-widget-trigger */

        .global-footer {
            border-top: 1px solid var(--border-glass);
            background: var(--surface-lowest);
            margin-top: var(--space-8);
            padding: var(--space-8) 0 0;
        }

        .footer-container {
            max-width: var(--max-width);
            margin: 0 auto;
            padding: 0 var(--content-padding);
        }

        .footer-grid {
            display: grid;
            grid-template-columns: 1.5fr 1fr 1fr 1fr;
            gap: var(--space-6);
        }

        .footer-brand-col {
            display: flex;
            flex-direction: column;
            gap: var(--space-3);
        }

        .footer-brand {
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .footer-logo {
            height: 24px;
            display: flex;
            align-items: center;
        }

        .footer-logo picture {
            display: flex;
            height: 100%;
        }

        .footer-logo img {
            height: 100%;
            width: auto;
            object-fit: contain;
        }

        .footer-brand-name {
            font-size: var(--text-base);
            font-weight: var(--font-bold);
            color: var(--text-primary);
            letter-spacing: 0.5px;
        }

        .footer-tagline {
            font-size: var(--text-xs);
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        .footer-version {
            font-size: 12px;
            color: var(--text-muted);
            background: transparent;
            padding: 4px 10px;
            border-radius: var(--radius-full);
            width: fit-content;
        }

        .footer-col {
            display: flex;
            flex-direction: column;
            gap: var(--space-2);
        }

        .footer-col-title {
            font-size: var(--text-xs);
            font-weight: var(--font-semibold);
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.8px;
            margin: 0 0 var(--space-1) 0;
        }

        .footer-link {
            font-size: var(--text-sm);
            color: var(--text-muted);
            text-decoration: none;
            transition: color var(--transition-fast);
            padding: 8px 0;
            min-height: 36px;
            display: inline-flex;
            align-items: center;
        }

        .footer-link:hover {
            color: var(--text-primary);
        }

        .footer-bottom {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: var(--space-5) 0;
            margin-top: var(--space-6);
            border-top: 1px solid var(--border-glass);
        }

        .footer-copyright {
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        .footer-made {
            font-size: var(--text-xs);
            color: var(--text-muted);
        }

        @media (max-width: 900px) {
            .footer-grid { grid-template-columns: 1fr 1fr; }
        }
        @media (max-width: 500px) {
            .footer-grid { grid-template-columns: 1fr; gap: var(--space-5); }
            .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }
        }

        /* -------------------------------------------------------------------------
           SKELETON LOADING SYSTEM
           ------------------------------------------------------------------------- */

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

        .skeleton {
            background: linear-gradient(
                90deg,
                var(--glass-subtle) 25%,
                var(--glass-light) 50%,
                var(--glass-subtle) 75%
            );
            background-size: 200% 100%;
            animation: skeleton-shimmer 1.5s ease-in-out infinite;
            border-radius: var(--radius-md);
        }

        .skeleton-text {
            height: 0.875rem;
            margin-bottom: var(--space-2);
            border-radius: var(--radius-sm);
        }
        .skeleton-text-sm { height: 0.75rem; }
        .skeleton-text-lg { height: 1.125rem; }
        .skeleton-text:last-child { width: 60%; }

        .skeleton-heading {
            height: 1.25rem;
            width: 40%;
            margin-bottom: var(--space-3);
            border-radius: var(--radius-sm);
        }

        .skeleton-circle {
            border-radius: var(--radius-full);
            flex-shrink: 0;
        }
        .skeleton-circle-sm { width: 32px; height: 32px; }
        .skeleton-circle-md { width: 48px; height: 48px; }
        .skeleton-circle-lg { width: 64px; height: 64px; }

        .skeleton-card {
            padding: var(--space-4);
            background: var(--glass-subtle);
            border: 1px solid var(--border-glass);
            border-radius: var(--radius-xl);
        }

        .skeleton-row {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3) 0;
        }

        .skeleton-bar {
            height: 8px;
            border-radius: var(--radius-full);
        }

        .skeleton-block {
            border-radius: var(--radius-lg);
        }

        /* Fade-in when content replaces skeleton */
        .skeleton-loaded {
            animation: fadeIn 0.3s ease-out;
        }

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

        /* -------------------------------------------------------------------------
           MOBILE RESPONSIVE FIXES
           ------------------------------------------------------------------------- */

        /* Tablet: touch targets + font scaling + full-width app-shell */
        @media (max-width: 768px) {
            .app-shell { width: 100% !important; }
            .btn { min-height: 44px; padding: var(--space-2) var(--space-4); }
            .btn-sm { min-height: 36px; padding: var(--space-2) var(--space-3); }
            .stat-value { font-size: var(--text-2xl); }
        }

        /* Small screens: tighter spacing + smaller text tokens */
        @media (max-width: 600px) {
            :root {
                --text-3xl: 1.5rem;
                --text-2xl: 1.25rem;
                --text-xl: 1.125rem;
            }
            .page-container { padding: var(--space-4) var(--space-3); }
            .card-body { padding: var(--space-4); }
            .card-header { padding: var(--space-3) var(--space-4); }
            .stat-value { font-size: var(--text-xl); }
        }

        /* Narrow phones: chat widget full-width fix */
        @media (max-width: 480px) {
            .chat-widget-panel {
                width: calc(100vw - var(--space-6));
                max-height: 70vh;
            }
            .page-container { padding: var(--space-3) var(--space-2); }
        }

        /* -------------------------------------------------------------------------
           GLOBAL RESPONSIVE SAFEGUARDS
           All pages inherit these — prevents overflow on any screen size
           ------------------------------------------------------------------------- */

        /* Ensure nothing overflows horizontally */
        html { overflow-x: hidden; }
        body { overflow-x: hidden; max-width: 100vw; }
        img, video, canvas, svg:not(.icon) { max-width: 100%; height: auto; }
        table { max-width: 100%; overflow-x: auto; display: block; }
        pre, code { overflow-x: auto; max-width: 100%; }

        /* Safe max-width for modals on all screens */
        .modal, .explanation-modal, .personalization-cta-modal {
            width: calc(100% - var(--space-6));
        }

        /* Footer grid: already has 900/500 breakpoints but add safer collapse */
        @media (max-width: 480px) {
            .footer-grid { grid-template-columns: 1fr; gap: var(--space-4); }
            .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }
        }

        /* Header: prevent brand from pushing nav off screen */
        .header-container { min-width: 0; }
        .header-brand { min-width: 0; flex-shrink: 0; }

        /* Ensure all page content stays within bounds */
        .main-content { width: 100%; min-width: 0; }

        /* Global responsive spacing for page containers */
        @media (max-width: 480px) {
            .main-content { min-height: calc(100vh - 56px); }
            :root { --header-height: 56px; }
            .header-logo { height: 28px; }
            .header-container { padding: 0 var(--space-3); }
            .header-actions { gap: var(--space-1); }
            .theme-toggle-btn { width: 32px; height: 32px; }
            .theme-toggle-btn svg { width: 16px; height: 16px; }
            .mobile-menu-btn { width: 36px; height: 36px; }
        }

        /* Responsive text: prevent overflow from long words/URLs */
        h1, h2, h3, h4, h5, h6, p, li, span, div {
            overflow-wrap: break-word;
            word-break: break-word;
        }

        /* Safe inline grid override — targets elements with inline grid styles */
        @media (max-width: 600px) {
            [style*="grid-template-columns: 1fr 1fr 1fr"],
            [style*="grid-template-columns: repeat(3"],
            [style*="grid-template-columns: repeat(4"],
            [style*="grid-template-columns: repeat(5"] {
                grid-template-columns: 1fr 1fr !important;
            }
        }
        @media (max-width: 400px) {
            [style*="grid-template-columns: 1fr 1fr"],
            [style*="grid-template-columns: repeat(2"],
            [style*="grid-template-columns: repeat(3"],
            [style*="grid-template-columns: repeat(4"],
            [style*="grid-template-columns: repeat(5"] {
                grid-template-columns: 1fr !important;
            }
        }

        /* Print styles */
        @media print {
            .global-header, .account-menu, .btn, .modal, .global-footer { display: none !important; }
            body { background: white; color: black; }
        }

        /* =============================================================================
           FEATURE GATE PROMPT (inline upgrade banner for free-tier limits)
           ============================================================================= */

        .feature-gate-prompt {
            display: flex;
            align-items: center;
            gap: var(--space-4);
            padding: var(--space-4) var(--space-5);
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(79, 138, 255, 0.08));
            border: 1px solid rgba(139, 92, 246, 0.2);
            border-radius: var(--radius-lg);
            margin-bottom: var(--space-4);
        }

        .feature-gate-icon {
            color: #8b5cf6;
            flex-shrink: 0;
        }

        .feature-gate-text {
            flex: 1;
        }

        .feature-gate-text strong {
            display: block;
            font-size: var(--text-sm);
            color: var(--text-primary);
            margin-bottom: 2px;
        }

        .feature-gate-text p {
            font-size: var(--text-xs);
            color: var(--text-muted);
            margin: 0;
        }

        .feature-gate-btn {
            flex-shrink: 0;
            padding: var(--space-2) var(--space-4);
            background: linear-gradient(135deg, #4F8AFF, #8b5cf6);
            color: white;
            border-radius: var(--radius-md);
            font-size: var(--text-xs);
            font-weight: var(--font-semibold);
            text-decoration: none;
            transition: opacity 0.2s;
        }

        .feature-gate-btn:hover {
            opacity: 0.9;
        }
