        .custom-lightbox {
            position: fixed; inset: 0; z-index: 9999; display: none; align-items: center; justify-content: center;
            background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            opacity: 0; transition: opacity 0.3s ease;
        }
        .custom-lightbox.active { display: flex; opacity: 1; }
        .custom-lightbox img {
            max-width: 95vw; max-height: 90vh; width: auto; height: auto;
            object-fit: contain; border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
            transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            -webkit-touch-callout: default; cursor: zoom-out;
        }
        .custom-lightbox.active img { transform: scale(1); }

        :root {
            /* Enhanced Warm Color Palette */
            --bg-primary: #fdfaf5;
            --bg-secondary: #f6f0e6;
            --bg-warm: #ede3d1;
            --bg-card: rgba(255, 252, 248, 0.92);
            --bg-card-strong: #fffbf5;
            --bg-surface: #ffffff;
            --text-primary: #2d241b;
            --text-secondary: #5c4e3e;
            --text-muted: #8a7865;
            --text-tertiary: #b0a090;
            --text-dark: #1a110a;
            --accent-warm: #c88457;
            --accent-gold: #b8894a;
            --accent-rose: #c89797;
            --accent-sage: #8fa88a;
            --accent-ink: #6b4e34;
            --accent-amber: #e8a849;
            /* Spacing Scale */
            --space-xs: 4px;
            --space-sm: 8px;
            --space-md: 16px;
            --space-lg: 24px;
            --space-xl: 32px;
            --space-2xl: 48px;
            --space-3xl: 64px;
            /* Shadow Scale - Refined */
            --shadow-xs: 0 1px 2px rgba(90, 65, 40, 0.04);
            --shadow-sm: 0 4px 14px rgba(90, 65, 40, 0.06);
            --shadow-md: 0 12px 32px rgba(90, 65, 40, 0.08);
            --shadow-lg: 0 24px 56px rgba(90, 65, 40, 0.12);
            --shadow-xl: 0 36px 80px rgba(90, 65, 40, 0.16);
            --shadow-glow: 0 0 40px rgba(200, 132, 87, 0.12);
            /* Transition Tokens */
            --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
            --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
            --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
            --duration-fast: 150ms;
            --duration-normal: 250ms;
            --duration-slow: 400ms;
            /* Radius Scale */
            --radius-xs: 8px;
            --radius-sm: 14px;
            --radius-md: 20px;
            --radius-lg: 28px;
            --radius-xl: 36px;
            --radius-full: 9999px;
            /* Border */
            --border-light: rgba(184, 137, 74, 0.08);
            --border-medium: rgba(184, 137, 74, 0.14);
            --border-strong: rgba(184, 137, 74, 0.22);
        }

        /* Prevents font flickering by waiting for Google Fonts to load */
        body {
            opacity: 0;
            transition: opacity 0.4s ease;
        }

        body.fonts-loaded {
            opacity: 1;
        }

        html {
            scrollbar-gutter: stable;
        }

        body {
            background: var(--bg-primary);
            background-image:
                radial-gradient(ellipse 80% 60% at 20% 5%, rgba(200, 132, 87, 0.09), transparent 30%),
                radial-gradient(ellipse 60% 50% at 85% 10%, rgba(143, 168, 138, 0.07), transparent 25%),
                radial-gradient(ellipse 50% 40% at 50% 80%, rgba(184, 137, 74, 0.04), transparent 30%),
                linear-gradient(175deg, var(--bg-primary) 0%, var(--bg-secondary) 45%, #f0e8d8 100%);
            background-attachment: scroll;
            color: var(--text-primary);
            font-family: 'Nunito', 'Noto Serif SC', sans-serif;
            overflow-x: hidden;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            min-height: 100vh;
            position: relative;
        }

        body::before {
            content: '';
            position: fixed;
            inset: 0;
            pointer-events: none;
            background-image:
                linear-gradient(rgba(107, 78, 52, 0.025) 1px, transparent 1px),
                linear-gradient(90deg, rgba(107, 78, 52, 0.025) 1px, transparent 1px);
            background-size: 64px 64px;
            mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 75%);
            z-index: -1;
        }

        /* Refined Warm Scrollbar */
        ::-webkit-scrollbar { width: 8px; }
        ::-webkit-scrollbar-track {
            background: rgba(184, 137, 74, 0.04);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(184, 137, 74, 0.18);
            border-radius: 4px;
            transition: background var(--duration-fast) var(--ease-out-expo);
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(184, 137, 74, 0.28);
        }

        .glass-header {
            background: rgba(253, 250, 245, 0.78);
            backdrop-filter: blur(24px) saturate(1.4);
            -webkit-backdrop-filter: blur(24px) saturate(1.4);
            border-bottom: 1px solid var(--border-light);
            z-index: 100;
            transition: background var(--duration-slow) var(--ease-out-expo),
                        box-shadow var(--duration-slow) var(--ease-out-expo);
            transform: translateZ(0);
            will-change: background, box-shadow;
        }

        .glass-header.scrolled {
            background: rgba(253, 250, 245, 0.94);
            box-shadow: var(--shadow-md);
            border-bottom-color: var(--border-medium);
        }

        .page-shell {
            position: relative;
            max-width: 76rem;
            margin: 0 auto;
        }

        .page-shell::before {
            content: '';
            position: absolute;
            inset: 0 0 auto 0;
            height: 320px;
            border-radius: 40px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0));
            pointer-events: none;
            z-index: -1;
        }

        .brand-mark {
            padding: 8px 18px;
            border-radius: var(--radius-full);
            background: rgba(255, 255, 255, 0.5);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-xs);
            transition: box-shadow var(--duration-normal) var(--ease-out-expo),
                        border-color var(--duration-normal) var(--ease-out-expo);
        }
        .brand-mark:hover {
            box-shadow: var(--shadow-sm);
            border-color: var(--border-medium);
        }

        .input-box {
            background: linear-gradient(170deg, rgba(255, 255, 255, 0.82), rgba(255, 251, 246, 0.94));
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-md);
            transition: box-shadow var(--duration-slow) var(--ease-out-expo),
                        border-color var(--duration-slow) var(--ease-out-expo),
                        transform var(--duration-slow) var(--ease-out-expo);
            position: relative;
            overflow: hidden;
        }
        .input-box::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(ellipse at center, rgba(200, 132, 87, 0.04) 0%, transparent 70%);
            opacity: 0;
            transition: opacity 0.6s var(--ease-out-expo);
            pointer-events: none;
        }
        .input-box:focus-within {
            box-shadow: var(--shadow-lg), var(--shadow-glow);
            border-color: var(--border-strong);
            transform: translateY(-2px);
        }
        .input-box:focus-within::before {
            opacity: 1;
        }

        .timeline-box {
            background: linear-gradient(175deg, rgba(255, 252, 248, 0.94), rgba(255, 249, 242, 0.9));
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-sm);
            transition: box-shadow var(--duration-normal) var(--ease-out-expo),
                        border-color var(--duration-normal) var(--ease-out-expo),
                        transform var(--duration-normal) var(--ease-out-expo);
            position: relative;
            overflow: hidden;
        }
        .timeline-box::before {
            content: '';
            position: absolute;
            inset: 0 auto 0 0;
            width: 3px;
            background: linear-gradient(180deg, rgba(200, 132, 87, 0.25), rgba(200, 132, 87, 0));
            border-radius: 3px 0 0 3px;
            opacity: 0;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
        }
        .timeline-box:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-medium);
            transform: translateY(-1px);
        }
        .timeline-box:hover::before {
            opacity: 1;
        }

        .todo-item {
            transition: opacity var(--duration-slow) var(--ease-out-expo),
                        transform var(--duration-slow) var(--ease-out-expo);
            border-bottom: 1px solid var(--border-light);
        }

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

        .todo-item.completed {
            opacity: 0;
            transform: scale(0.9) translateX(20px);
            pointer-events: none;
        }

        .btn-minimal {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 10px 18px;
            border-radius: var(--radius-full);
            font-size: 0.875rem;
            font-weight: 600;
            transition: background var(--duration-fast) var(--ease-out-expo),
                        transform var(--duration-fast) var(--ease-out-expo),
                        color var(--duration-fast) var(--ease-out-expo),
                        box-shadow var(--duration-fast) var(--ease-out-expo);
            background: rgba(184, 137, 74, 0.07);
            color: var(--text-secondary);
            border: 1px solid transparent;
            cursor: pointer;
            min-height: 44px;
        }
        .btn-minimal:hover {
            background: rgba(184, 137, 74, 0.13);
            transform: translateY(-1px);
            color: var(--text-primary);
        }
        .btn-minimal:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        .btn-primary {
            background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-gold) 100%);
            color: #FFFFFF;
            border: none;
            box-shadow: 0 4px 14px rgba(200, 132, 87, 0.3);
        }
        .btn-primary:hover {
            background: linear-gradient(135deg, #d8955e 0%, #c8944e 100%);
            box-shadow: 0 8px 22px rgba(200, 132, 87, 0.4);
            transform: translateY(-2px);
            color: #FFFFFF;
        }
        .btn-primary:active {
            transform: scale(0.97);
        }

        .tag-chip {
            position: relative;
            background: rgba(184, 137, 74, 0.08);
            color: var(--accent-ink);
            padding: 6px 14px;
            border-radius: var(--radius-full);
            font-size: 11px;
            font-weight: 700;
            border: 1px solid var(--border-light);
            transition: background var(--duration-fast) var(--ease-out-expo),
                        color var(--duration-fast) var(--ease-out-expo),
                        box-shadow var(--duration-fast) var(--ease-out-expo);
            cursor: pointer;
        }
        .tag-chip:hover {
            background: rgba(200, 132, 87, 0.15);
            color: var(--text-secondary);
            box-shadow: var(--shadow-xs);
        }

        .tag-del-btn {
            position: absolute;
            top: -6px;
            right: -6px;
            width: 14px;
            height: 14px;
            background: #FF4D4D;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 8px;
            opacity: 0;
            transform: scale(0.5);
            transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 2px 4px rgba(255, 77, 77, 0.2);
            pointer-events: none;
        }

        .tag-chip.visible-active .tag-del-btn,
        .tag-chip:hover .tag-del-btn {
            opacity: 1;
            transform: scale(1);
            pointer-events: auto;
        }

        /* Enhanced Modal styling */
        .modal-overlay {
            background: rgba(40, 30, 20, 0.2);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            z-index: 200;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
        }
        .modal-content {
            background: var(--bg-card-strong);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            animation: modalFadeUp 0.45s var(--ease-out-back);
            border: 1px solid var(--border-light);
        }
        @keyframes modalFadeUp {
            from {
                opacity: 0;
                transform: translateY(24px) scale(0.94);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }
        @media (prefers-reduced-motion: reduce) {
            .modal-content {
                animation: none;
            }
        }

        /* Warm fade animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

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

        .diary-entry-text {
            line-height: 1.8;
            letter-spacing: 0.01em;
            word-break: break-all;
            overflow-wrap: break-word;
        }

        /* Restored Calendar Styles */
        .calendar-overlay {
            position: fixed;
            inset: 0;
            background: rgba(30, 20, 10, 0.25);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            z-index: 150;
            display: none;
        }
        .calendar-overlay.active { display: block; }
        .calendar-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -45%) scale(0.94);
            width: 380px;
            max-width: calc(100vw - 40px);
            background: var(--bg-surface);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-xl);
            z-index: 160;
            display: none;
            flex-direction: column;
            overflow: hidden;
            transition: opacity var(--duration-slow) var(--ease-out-expo),
                        transform var(--duration-slow) var(--ease-out-expo);
            opacity: 0;
            border: 1px solid var(--border-light);
        }
        .calendar-modal.active {
            display: flex;
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
        .calendar-header {
            padding: 20px 24px;
            background: var(--bg-card-strong);
            border-bottom: 1px solid var(--border-light);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .calendar-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 6px;
            padding: 20px;
        }
        .calendar-weekday {
            font-size: 10px;
            font-weight: 800;
            color: var(--text-muted);
            text-align: center;
            padding-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .calendar-cell {
            aspect-ratio: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            border-radius: var(--radius-xs);
            cursor: pointer;
            transition: background var(--duration-fast) var(--ease-out-expo),
                        color var(--duration-fast) var(--ease-out-expo);
            color: var(--text-muted);
            position: relative;
            min-width: 36px;
            min-height: 36px;
        }
        .calendar-cell:hover {
            background: rgba(184, 137, 74, 0.08);
            color: var(--text-dark);
        }
        .calendar-cell.today {
            color: var(--accent-gold);
            background: rgba(184, 137, 74, 0.06);
            font-weight: 800;
        }
        .calendar-cell.has-entries::after {
            content: '';
            position: absolute;
            bottom: 5px;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: var(--accent-gold);
        }
        .calendar-cell.active-sel {
            background: var(--accent-gold) !important;
            color: white !important;
            box-shadow: 0 4px 12px rgba(184, 137, 74, 0.35);
        }
        @media (prefers-reduced-motion: reduce) {
            .calendar-modal { transition: none; }
        }

        .export-option-btn {
            flex: 1;
            padding: 10px 4px;
            border-radius: var(--radius-xs);
            border: 1px solid var(--border-light);
            font-size: 0.7rem;
            font-weight: 700;
            transition: background var(--duration-fast) var(--ease-out-expo),
                        color var(--duration-fast) var(--ease-out-expo),
                        border-color var(--duration-fast) var(--ease-out-expo);
            background: transparent;
            white-space: nowrap;
            cursor: pointer;
            min-height: 44px;
        }
        .export-option-btn:hover {
            background: rgba(184, 137, 74, 0.06);
        }
        .export-option-btn:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        .export-option-btn.active {
            background: var(--text-dark);
            color: #FFFFFF;
            border-color: var(--text-dark);
        }

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

            .btn-minimal {
                padding: 8px;
            }

            .search-box-wrapper {
                width: 100% !important;
                flex: 1;
            }
        }

        .date-badge {
            font-family: 'Playfair Display', 'Noto Serif SC', serif;
            font-size: 1.75rem;
            font-weight: 600;
            letter-spacing: -0.04em;
            color: var(--text-dark);
            line-height: 1;
        }
        .month-sub {
            font-size: 0.7rem;
            text-transform: uppercase;
            font-weight: 600;
            color: var(--text-muted);
            margin-top: 6px;
            letter-spacing: 0.16em;
        }

        /* Enhanced Range Slider Styles */
        .metric-slider-container {
            transition: width 0.45s var(--ease-out-expo),
                        border-color 0.45s var(--ease-out-expo),
                        background 0.45s var(--ease-out-expo),
                        box-shadow 0.45s var(--ease-out-expo);
            width: 46px;
            height: 46px;
            overflow: hidden;
            background: var(--bg-surface);
            border: 1px solid var(--border-light);
            display: flex;
            align-items: center;
            justify-content: flex-start;
            padding: 0 13px;
            border-radius: 23px;
            cursor: pointer;
            position: relative;
            box-shadow: var(--shadow-xs);
        }
        .metric-slider-container:hover {
            border-color: var(--border-medium);
        }
        .metric-slider-container.active {
            width: 176px;
            border-color: var(--border-medium);
            background: var(--bg-surface);
            box-shadow: var(--shadow-sm);
        }
        .metric-slider-container:focus-within {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        .range-input {
            -webkit-appearance: none;
            appearance: none;
            width: 80px;
            height: 4px;
            background: rgba(0, 0, 0, 0.06);
            border-radius: 2px;
            outline: none;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
            margin: 0 10px;
            opacity: 0;
            pointer-events: none;
            flex-shrink: 0;
        }
        .metric-slider-container.active .range-input {
            opacity: 1;
            pointer-events: auto;
        }
        .range-input::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 18px;
            height: 18px;
            background: var(--text-dark);
            border-radius: 50%;
            cursor: pointer;
            border: 3px solid white;
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        }
        .metric-icon-wrapper {
            width: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .metric-value-label {
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--text-dark);
            min-width: 25px;
            text-align: right;
            opacity: 0.35;
            flex-shrink: 0;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
            transition: opacity 0.3s;
        }

        .metric-slider-container.active .metric-value-label {
            opacity: 1;
        }

        .slider-energy::-webkit-slider-thumb {
            background: #FF9F00;
        }

        .slider-engagement::-webkit-slider-thumb {
            background: #007AFF;
        }

        .slider-diff::-webkit-slider-thumb {
            background: #5856D6;
        }

        /* Mobile Interaction Classes */
        .visible-active {
            opacity: 1 !important;
            pointer-events: auto !important;
            visibility: visible !important;
        }

        /* Universe Map Styles */
        #universeContainer {
            position: fixed;
            inset: 0;
            background: #0A0A0A;
            z-index: 500;
            display: none;
            overflow: hidden;
            font-family: 'Outfit', 'Noto Sans SC', sans-serif;
        }

        #universe-svg {
            width: 100vw;
            height: 100vh;
        }

        .node-label {
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            fill: rgba(255, 255, 255, 0.7);
            user-select: none;
        }

        .node-label:hover {
            fill: var(--accent-gold);
            filter: drop-shadow(0 0 8px rgba(184, 151, 110, 0.5));
        }

        .link {
            stroke: rgba(255, 255, 255, 0.05);
            stroke-width: 1px;
            transition: all 0.3s ease;
        }

        .link.active {
            stroke: rgba(184, 151, 110, 0.3);
            stroke-width: 1.5px;
        }

        .core-node {
            fill: var(--accent-gold);
            filter: drop-shadow(0 0 20px rgba(184, 151, 110, 0.8));
        }

        .universe-details-panel {
            position: absolute;
            right: 40px;
            top: 40px;
            max-height: calc(100vh - 80px);
            width: 320px;
            background: #DED9CF;
            border-radius: 32px;
            color: #4A3E2F;
            padding: 40px;
            box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
            overflow-y: auto;
            transform: translateX(450px);
            transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
            z-index: 600;
            display: flex;
            flex-direction: column;
            text-align: left;
        }

        .universe-details-panel.show {
            transform: translateX(0);
        }

        .universe-entry-text {
            font-size: 13px;
            line-height: 1.6;
            opacity: 0.8;
        }

        @keyframes wobble {
            0% {
                transform: translate(0, 0);
            }

            25% {
                transform: translate(3px, -3px) rotate(1.5deg);
            }

            50% {
                transform: translate(-3px, 3px) rotate(-1.5deg);
            }

            75% {
                transform: translate(2px, -2px);
            }

            100% {
                transform: translate(0, 0);
            }
        }

        .branch-wobble {
            animation: wobble 0.5s ease-in-out;
        }

        @media (max-width: 768px) {
            .universe-details-panel {
                right: 0;
                top: auto;
                bottom: 0;
                width: 100%;
                height: 70vh;
                max-height: 85vh;
                border-radius: 32px 32px 0 0;
                transform: translateY(100%);
                padding: 30px 20px;
            }

            .universe-details-panel.show {
                transform: translateY(0);
            }
        }

        /* Scroll Reveal Animation */
        .scroll-reveal {
            opacity: 0;
            transform: translateY(24px);
            transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .scroll-reveal.revealed {
            opacity: 1;
            transform: translateY(0);
        }

        /* Stagger delay for timeline cards */
        .stagger-1 {
            transition-delay: 0.05s;
        }

        .stagger-2 {
            transition-delay: 0.1s;
        }

        .stagger-3 {
            transition-delay: 0.15s;
        }

        .stagger-4 {
            transition-delay: 0.2s;
        }

        /* Empty State */
        .empty-state {
            padding: 80px 20px;
            text-align: center;
            color: var(--text-muted);
        }

        .empty-state-icon {
            width: 80px;
            height: 80px;
            margin: 0 auto 24px;
            background: linear-gradient(135deg, rgba(212, 165, 116, 0.1) 0%, rgba(201, 166, 107, 0.05) 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: gentlePulse 3s ease-in-out infinite;
        }

        @keyframes gentlePulse {

            0%,
            100% {
                transform: scale(1);
                opacity: 0.8;
            }

            50% {
                transform: scale(1.05);
                opacity: 1;
            }
        }

        .empty-state h3 {
            font-family: 'Playfair Display', 'Noto Serif SC', serif;
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 8px;
            color: var(--text-secondary);
        }

        .empty-state p {
            font-size: 0.875rem;
            line-height: 1.6;
            max-width: 280px;
            margin: 0 auto;
        }

        /* Refined Footer Stats */
        .footer-stat-value {
            font-family: 'Playfair Display', 'Noto Serif SC', serif;
            font-size: 1.6rem;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1;
        }
        .footer-stat-label {
            font-size: 0.72rem;
            text-transform: uppercase;
            font-weight: 600;
            color: var(--text-muted);
            letter-spacing: 0.14em;
            margin-top: 10px;
        }
        .footer-divider {
            width: 1px;
            height: 28px;
            background: var(--border-light);
        }
        /* Enhanced Greeting section */
        .greeting-section {
            margin-bottom: 2.5rem;
            padding: 32px 36px;
            border-radius: var(--radius-xl);
            background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 248, 240, 0.55));
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-sm);
            opacity: 0;
            animation: fadeInUp 0.7s 0.15s var(--ease-out-expo) forwards;
            position: relative;
            overflow: hidden;
        }
        .greeting-section::after {
            content: '';
            position: absolute;
            right: -20px;
            top: -30px;
            width: 200px;
            height: 200px;
            background: radial-gradient(circle, rgba(200, 132, 87, 0.1), transparent 65%);
            pointer-events: none;
        }
        .greeting-text {
            font-family: 'Playfair Display', 'Noto Serif SC', serif;
            font-size: clamp(2rem, 4vw, 3rem);
            font-weight: 600;
            color: var(--text-dark);
            line-height: 1.1;
            letter-spacing: -0.04em;
        }
        .greeting-sub {
            font-size: 1rem;
            color: var(--text-muted);
            margin-top: 12px;
            max-width: 36rem;
            line-height: 1.8;
        }
        /* Composer */
        .composer-card {
            padding: 28px 30px;
            border-radius: var(--radius-xl);
        }
        .composer-card textarea {
            min-height: 98px;
            font-size: 1.08rem;
            line-height: 1.9;
        }
        .composer-card textarea:focus-visible {
            outline: none;
        }
        .metrics-row {
            margin-top: 20px;
            padding-top: 18px;
            border-top: 1px solid var(--border-light);
        }
        .composer-actions {
            margin-top: 18px;
            padding-top: 2px;
        }
        /* Enhanced Filter Shell */
        .filter-shell {
            padding: 12px 16px;
            border-radius: var(--radius-md);
            background: rgba(255, 252, 248, 0.65);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-xs);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
        }

        .timeline-stack {
            gap: 20px !important;
        }

        .day-card {
            padding: 28px 30px;
            border-radius: 30px;
        }

        .day-rail {
            position: relative;
            min-width: 84px;
            padding-right: 12px;
        }

        .day-badge-wrap {
            display: inline-flex;
            flex-direction: column;
            align-items: flex-start;
            justify-content: center;
            min-width: 64px;
            padding: 4px 0;
            border-radius: 0;
            background: transparent;
            border: none;
        }

        .day-name-chip {
            align-self: flex-start;
            margin-top: 8px;
            background: transparent;
            padding-left: 0 !important;
            padding-right: 0 !important;
            border-radius: 0;
            letter-spacing: 0.08em;
        }

        .entry-stack {
            gap: 18px !important;
        }

        .entry-item {
            position: relative;
            padding: 18px 18px 18px 20px;
            border-radius: 18px;
            background: rgba(255, 255, 255, 0.3);
            border: 1px solid var(--border-light);
            box-shadow: none;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
        }

        .entry-item:hover {
            transform: none;
            border-color: var(--border-medium);
            box-shadow: var(--shadow-xs);
        }

        .entry-item::before {
            content: '';
            position: absolute;
            left: 0;
            top: 18px;
            bottom: 18px;
            width: 2px;
            border-radius: 999px;
            background: linear-gradient(180deg, rgba(203, 146, 99, 0.45), rgba(185, 138, 88, 0.1));
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .entry-item:hover::before {
            opacity: 1;
        }

        .entry-time {
            color: var(--text-tertiary);
            letter-spacing: 0.12em;
        }

        .entry-metrics {
            color: var(--text-muted);
            opacity: 0.72;
            letter-spacing: 0.06em;
        }

        .entry-divider {
            background: linear-gradient(90deg, transparent, rgba(185, 138, 88, 0.1), transparent) !important;
            margin: 0.15rem 0 !important;
        }

        .sticky-tools {
            position: sticky;
            top: 92px;
            z-index: 30;
        }

        /* Back to Top Button - Warm Theme */
        #backToTop {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 48px;
            height: 48px;
            background: var(--bg-card);
            border: 1px solid rgba(212, 165, 116, 0.15);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-md);
            cursor: pointer;
            z-index: 90;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            opacity: 0;
            visibility: hidden;
            transform: translateY(20px);
            color: var(--text-secondary);
        }

        #backToTop.visible {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
        }

        #backToTop:hover {
            transform: translateY(-5px);
            box-shadow: var(--shadow-lg);
            background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-gold) 100%);
            color: #FFFFFF;
            border-color: transparent;
        }

        @media (max-width: 768px) {
            .brand-mark {
                padding: 8px 12px;
            }

            .greeting-section {
                padding: 24px 22px;
                border-radius: 26px;
            }

            .composer-card {
                padding: 22px;
                border-radius: 28px;
            }

            .filter-shell {
                padding: 12px;
                border-radius: 22px;
            }

            .day-card {
                padding: 22px;
                border-radius: 24px;
            }

            .day-badge-wrap {
                min-width: 70px;
                padding: 14px 12px;
            }

            .entry-item {
                padding: 16px;
            }

            .sticky-tools {
                position: static;
            }
        }

        /* ─── UI/UX Pro Max Refresh ─── */
        /* Refined warm-amber palette with improved contrast & readability */
        :root {
            --bg-primary: #fdfaf5;
            --bg-secondary: #f6f0e6;
            --bg-warm: #ede3d1;
            --bg-card: rgba(255, 252, 248, 0.92);
            --bg-card-strong: #fffbf5;
            --bg-surface: #ffffff;
            --text-primary: #2d241b;
            --text-secondary: #5c4e3e;
            --text-muted: #8a7865;
            --text-tertiary: #b0a090;
            --text-dark: #1a110a;
            --accent-warm: #c88457;
            --accent-gold: #b8894a;
            --accent-rose: #c89797;
            --accent-sage: #8fa88a;
            --accent-ink: #6b4e34;
            --accent-amber: #e8a849;
            --shadow-xs: 0 1px 2px rgba(90, 65, 40, 0.04);
            --shadow-sm: 0 4px 14px rgba(90, 65, 40, 0.06);
            --shadow-md: 0 12px 32px rgba(90, 65, 40, 0.08);
            --shadow-lg: 0 24px 56px rgba(90, 65, 40, 0.12);
            --shadow-xl: 0 36px 80px rgba(90, 65, 40, 0.16);
            --shadow-glow: 0 0 40px rgba(200, 132, 87, 0.12);
            --radius-xs: 8px;
            --radius-sm: 14px;
            --radius-md: 20px;
            --radius-lg: 28px;
            --radius-xl: 36px;
            --radius-full: 9999px;
            --border-light: rgba(184, 137, 74, 0.08);
            --border-medium: rgba(184, 137, 74, 0.14);
            --border-strong: rgba(184, 137, 74, 0.22);
            --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
            --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
            --duration-fast: 150ms;
            --duration-normal: 250ms;
            --duration-slow: 400ms;
        }
        body {
            background-image:
                radial-gradient(ellipse 80% 60% at 20% 5%, rgba(200, 132, 87, 0.09), transparent 30%),
                radial-gradient(ellipse 60% 50% at 85% 10%, rgba(143, 168, 138, 0.07), transparent 25%),
                radial-gradient(ellipse 50% 40% at 50% 80%, rgba(184, 137, 74, 0.04), transparent 30%),
                linear-gradient(175deg, var(--bg-primary) 0%, var(--bg-secondary) 45%, #f0e8d8 100%);
        }
        body::before {
            background-image:
                linear-gradient(rgba(107, 78, 52, 0.025) 1px, transparent 1px),
                linear-gradient(90deg, rgba(107, 78, 52, 0.025) 1px, transparent 1px);
            background-size: 64px 64px;
            mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 75%);
        }
        .glass-header {
            background: rgba(253, 250, 245, 0.78);
            border-bottom: 1px solid var(--border-light);
        }
        .glass-header.scrolled {
            background: rgba(253, 250, 245, 0.94);
            box-shadow: var(--shadow-md);
        }
        .brand-mark {
            border-radius: var(--radius-full);
            background: rgba(255, 255, 255, 0.5);
            border-color: var(--border-light);
            box-shadow: var(--shadow-xs);
        }
        #siteName { color: var(--text-dark) !important; letter-spacing: 0; }
        #siteNameEn { color: var(--accent-gold) !important; }
        .btn-minimal {
            border-radius: var(--radius-full);
            background: rgba(184, 137, 74, 0.07);
            border: 1px solid transparent;
            color: var(--text-secondary);
            box-shadow: none;
            min-height: 44px;
            cursor: pointer;
            transition: background var(--duration-fast) var(--ease-out-expo),
                        transform var(--duration-fast) var(--ease-out-expo),
                        color var(--duration-fast) var(--ease-out-expo),
                        box-shadow var(--duration-fast) var(--ease-out-expo);
        }
        .btn-minimal:hover {
            background: rgba(184, 137, 74, 0.13);
            border-color: var(--border-medium);
            color: var(--text-primary);
            transform: translateY(-1px);
        }
        .btn-minimal:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        .btn-primary {
            background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-gold) 100%);
            color: #FFFFFF;
            border: none;
            box-shadow: 0 4px 14px rgba(200, 132, 87, 0.3);
        }
        .btn-primary:hover {
            background: linear-gradient(135deg, #d8955e 0%, #c8944e 100%);
            box-shadow: 0 8px 22px rgba(200, 132, 87, 0.4);
            transform: translateY(-2px);
            color: #FFFFFF;
        }
        .btn-primary:active { transform: scale(0.97); }
        .text-purple-600 { color: var(--accent-ink) !important; }
        .hover\:bg-purple-50:hover { background: rgba(107, 78, 52, 0.08) !important; }
        .page-shell { max-width: 58rem; }
        .page-shell::before { display: none; }
        /* Greeting — clean, padded, no border */
        .greeting-section {
            padding: 26px 0 18px;
            border: none;
            border-radius: 0;
            background: transparent;
            box-shadow: none;
            margin-bottom: 1.5rem;
        }
        .greeting-section::after { display: none; }
        .greeting-text { font-size: 2.45rem; letter-spacing: 0; color: var(--text-dark); }
        .greeting-sub { margin-top: 10px; font-size: 0.95rem; color: var(--text-muted); }
        /* Input Composer */
        .input-box {
            background: rgba(255, 253, 248, 0.84);
            border: 1px solid var(--border-medium);
            border-radius: var(--radius-xl);
            box-shadow: var(--shadow-md);
            transition: box-shadow var(--duration-slow) var(--ease-out-expo),
                        border-color var(--duration-slow) var(--ease-out-expo);
        }
        .input-box:focus-within {
            transform: none;
            border-color: var(--border-strong);
            box-shadow: var(--shadow-lg), var(--shadow-glow);
        }
        .input-box::before { display: none; }
        .composer-card { padding: 28px 30px; margin-bottom: 2rem; }
        .composer-card textarea {
            min-height: 112px;
            font-family: 'Noto Serif SC', 'Nunito', serif;
            font-size: 1.05rem;
            line-height: 1.9;
        }
        .composer-card textarea:focus-visible { outline: none; }
        .metrics-row { border-top-color: var(--border-light); }
        /* Metric Sliders */
        .metric-slider-container {
            border-radius: 23px;
            background: var(--bg-surface);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-xs);
            width: 46px;
            height: 46px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: flex-start;
            padding: 0 13px;
            cursor: pointer;
            position: relative;
            transition: width 0.45s var(--ease-out-expo),
                        border-color 0.45s var(--ease-out-expo),
                        box-shadow 0.45s var(--ease-out-expo);
        }
        .metric-slider-container.active { width: 176px; border-color: var(--border-medium); box-shadow: var(--shadow-sm); }
        .metric-slider-container:focus-within {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        /* Filter Shell */
        .filter-shell {
            position: static;
            padding: 12px 16px;
            border: 1px solid var(--border-light);
            border-radius: var(--radius-md);
            background: rgba(255, 252, 248, 0.65);
            box-shadow: var(--shadow-xs);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
        }
        .search-box-wrapper input {
            background: rgba(255, 253, 248, 0.7) !important;
            border: 1px solid var(--border-light) !important;
            border-radius: var(--radius-sm) !important;
        }
        .search-box-wrapper input:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        /* Timeline */
        .timeline-stack { gap: 20px !important; }
        .timeline-box {
            background: linear-gradient(175deg, rgba(255, 252, 248, 0.94), rgba(255, 249, 242, 0.9));
            border-radius: var(--radius-lg);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-sm);
            transition: box-shadow var(--duration-normal) var(--ease-out-expo),
                        border-color var(--duration-normal) var(--ease-out-expo),
                        transform var(--duration-normal) var(--ease-out-expo);
            position: relative;
            overflow: hidden;
        }
        .timeline-box::before {
            content: '';
            position: absolute;
            inset: 0 auto 0 0;
            width: 3px;
            background: linear-gradient(180deg, rgba(200, 132, 87, 0.25), rgba(200, 132, 87, 0));
            border-radius: 3px 0 0 3px;
            opacity: 0;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
        }
        .timeline-box:hover {
            box-shadow: var(--shadow-md);
            border-color: var(--border-medium);
            transform: translateY(-1px);
        }
        .timeline-box:hover::before { opacity: 1; }
        .day-card { padding: 24px; border-radius: var(--radius-lg); }
        .day-rail { min-width: 72px; padding-right: 6px; }
        .date-badge { font-size: 1.35rem; letter-spacing: 0; color: var(--text-secondary); }
        .month-sub, .day-name-chip { color: var(--text-tertiary); letter-spacing: 0.06em; }
        .entry-stack { gap: 12px !important; }
        /* Entry items — clean without border accents */
        .entry-item {
            padding: 16px 0 14px;
            background: transparent;
            border: 0;
            border-radius: 0;
            box-shadow: none;
            transition: opacity var(--duration-normal) var(--ease-out-expo);
        }
        .entry-item:hover { box-shadow: none; }
        .entry-item::before { display: none; }
        .diary-entry-text {
            font-family: 'Noto Serif SC', 'Nunito', serif;
            color: rgba(26, 17, 10, 0.78) !important;
            line-height: 2;
        }
        .entry-footer { margin-top: 12px !important; }
        .entry-metrics { opacity: 0.5; color: var(--text-muted); }
        .tag-chip {
            border-radius: var(--radius-full);
            background: rgba(184, 137, 74, 0.08);
            border: 1px solid var(--border-light);
            color: var(--accent-ink);
            padding: 6px 14px;
            font-size: 11px;
            font-weight: 700;
            cursor: pointer;
            transition: background var(--duration-fast) var(--ease-out-expo),
                        box-shadow var(--duration-fast) var(--ease-out-expo);
        }
        .tag-chip:hover {
            background: rgba(200, 132, 87, 0.15);
            box-shadow: var(--shadow-xs);
        }
        .entry-divider { background: var(--border-light) !important; margin: 0 !important; }
        /* Footer */
        footer { padding-top: 4rem !important; }
        .footer-stat-value { color: var(--text-muted); font-size: 1.15rem; }
        .footer-stat-label { color: var(--text-tertiary); letter-spacing: 0.08em; }
        .footer-divider { background: var(--border-light); }
        /* Modals & Calendar */
        .modal-content, .calendar-modal {
            border-radius: var(--radius-xl);
            border: 1px solid var(--border-light);
            box-shadow: var(--shadow-xl);
        }
        .modal-overlay {
            background: rgba(40, 30, 20, 0.2);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
        }
        /* Back to Top */
        #backToTop {
            bottom: 30px; right: 30px;
            width: 48px; height: 48px;
            background: var(--bg-card);
            border: 1px solid var(--border-medium);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: var(--shadow-md);
            cursor: pointer;
            z-index: 90;
            transition: opacity var(--duration-slow) var(--ease-out-expo),
                        transform var(--duration-slow) var(--ease-out-expo),
                        background var(--duration-fast) var(--ease-out-expo),
                        color var(--duration-fast) var(--ease-out-expo);
            opacity: 0; visibility: hidden;
            transform: translateY(20px);
            color: var(--text-secondary);
        }
        #backToTop.visible { opacity: 1; visibility: visible; transform: translateY(0); }
        #backToTop:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-lg);
            background: linear-gradient(135deg, var(--accent-warm) 0%, var(--accent-gold) 100%);
            color: #FFFFFF;
            border-color: transparent;
        }
        #backToTop:focus-visible {
            outline: 2px solid var(--accent-gold);
            outline-offset: 2px;
        }
        /* ─── Reduced Motion ─── */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }
        /* ─── Responsive ─── */
        @media (max-width: 768px) {
            .greeting-text { font-size: 2rem; }
            .composer-card, .day-card { padding: 20px; border-radius: var(--radius-md); }
            .filter-shell { gap: 12px; border-radius: var(--radius-sm); }
            .day-rail { min-width: auto; }
            .calendar-modal { width: calc(100vw - 40px); }
            #backToTop { bottom: 20px; right: 20px; width: 44px; height: 44px; }
        }
