@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');
        
        /* Simple Toggle Switch */
        #viewToggleSwitch {
            user-select: none;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        #viewToggleSwitch .toggle-track {
            position: relative;
            width: 24px;
            height: 14px;
            background-color: #e0e0e0;
            border-radius: 7px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        /* Add dots for main toggle */
        .toggle-notch-main {
            position: absolute;
            width: 2px;
            height: 2px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 50%;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
            z-index: 0;
        }

        #viewToggleSwitch .toggle-track::before {
            content: '';
            position: absolute;
            width: 10px;
            height: 10px;
            background: white;
            border-radius: 50%;
            top: 2px;
            left: 2px;
            transition: transform 0.3s;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
            z-index: 1;
        }

        #viewToggleSwitch .toggle-track.map-active {
            background-color: #d3f1d3;
        }

        #viewToggleSwitch .toggle-track.map-active::before {
            transform: translateX(10px);
        }

        #viewToggleSwitch .toggle-label {
            font-size: 9px;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.5px;
            color: #999;
            transition: color 0.3s ease;
        }
        
        #viewToggleSwitch .toggle-label.active {
            color: #a5d9a3;
        }
        
        /* 3-layer blur system for active left toggle label */
        #viewToggleSwitch .toggle-label.left.active {
            position: relative;
            display: inline-block;
        }
        
        #viewToggleSwitch .toggle-label.left.active::before {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            backdrop-filter: blur(0.96px);
            -webkit-backdrop-filter: blur(0.96px);
            filter: blur(0.48px);
            opacity: 0.6;
            z-index: -2;
        }
        
        #viewToggleSwitch .toggle-label.left.active::after {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            filter: blur(0.24px);
            opacity: 0.7;
            z-index: -1;
        }
        
        /* 3-layer blur system for active right toggle label */
        #viewToggleSwitch .toggle-label.right.active {
            position: relative;
            display: inline-block;
        }
        
        #viewToggleSwitch .toggle-label.right.active::before {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            backdrop-filter: blur(0.96px);
            -webkit-backdrop-filter: blur(0.96px);
            filter: blur(0.48px);
            opacity: 0.6;
            z-index: -2;
        }
        
        #viewToggleSwitch .toggle-label.right.active::after {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            filter: blur(0.24px);
            opacity: 0.7;
            z-index: -1;
        }

        

        #viewToggleSwitch .toggle-label.left {
            order: -1;
        }

        #viewToggleSwitch .toggle-label.right {
            order: 1;
        }

        #viewToggleSwitch .toggle-option {
            display: none;
        }
        
        #viewToggleSwitch .toggle-slider {
            display: none;
        }
        
        /* Theme Variables */
        :root {
            /* Warm Theme (Default) */
            /* TESTING NEW COLOR - Original: #ffffff, Tested: #FAF9F5, Middle: #F7F1E6 */
            /* To revert: change --bg-primary back to #ffffff */
            /* --bg-primary: #F7F1E6; */
             --bg-primary: #ffffff;
            --text-primary: #4a4a4a;
            --text-secondary: #6a6a6a;
            --text-accent: #8B7EC8;
            --calendar-content-height: 400px; /* Dynamic height for mobile calendar */
        }
        
        /* Box Shadow Toggle - when .no-shadows is added to body, all shadows are removed except folder list items, activity button, liquid glass groups, folder buttons, confirm dialog, and page nodes */
        body.no-shadows *:not(.folder-item):not(.shelf-header):not(.header-shelf-header):not(.calendar-close-btn):not(.calendar-filter-toggle):not(.node-group):not(.add-folder-btn):not(.add-shelf-btn):not(.retrieve-btn):not(.month-day-cell):not(.items):not(.confirm-box):not(.confirm-btn):not(.page-node):not(.a4-page) {
            box-shadow: none !important;
        }

        /* Turn off folder list shadows */
        .folder-item,
        .shelf-header,
        .header-shelf-header {
            box-shadow: none !important;
        }
        
        :root {
            --text-dark: #2c2c2c;
            --text-hover: #5a5a5a;
            --border-primary: #9a9a9a;
            --border-secondary: #b8b8b8;
            --input-bg: #ffffff; /* Updated to match main bg */
            --success: #4ade80;
            --warning: #f59e0b;
            --error: #ef4444;
            --info: #3b82f6;
            --purple: rgba(139, 126, 200, 0.4);
            --teal: #14b8a6;
            
            /* Additional UI colors */
            --tooltip-bg: #4a4a4a;
            --progress-bar: #9ca3af;
            --scrollbar-thumb: #a8a8a8;
            --scrollbar-thumb-hover: #8a8a8a;
            --error-hover: #dc2626;
            --textarea-bg: #ffffff;
            --input-focus-bg: #ffffff;
            --code-bg: #ffffff;
            --section-bg: #ffffff;
            --section-header-bg: #ffffff;
            --section-content-bg: #ffffff;
        }
        
        /* Ocean Theme */
        :root[data-theme="ocean"] {
            --bg-primary: #ffffff;
            --text-primary: #334155;
            --text-secondary: #1e293b;
            --text-accent: #0f172a;
            --text-dark: #0f172a;
            --text-hover: #475569;
            --border-primary: #1e293b;
            --border-secondary: #334155;
            --input-bg: #ffffff;
            --success: #059669;
            --warning: #0284c7;
            --error: #dc2626;
            --info: #0284c7;
            --purple: #5b21b6;
            --teal: #0891b2;
            
            /* Additional UI colors - Ocean variants */
            --tooltip-bg: #475569;
            --progress-bar: #3b82f6;
            --scrollbar-thumb: #64748b;
            --scrollbar-thumb-hover: #475569;
            --error-hover: #b91c1c;
            --textarea-bg: #ffffff;
            --input-focus-bg: #fafbfc;
            --code-bg: #f8fafc;
            --section-bg: #f8fafc;
            --section-header-bg: #e2e8f0;
            --section-content-bg: #f1f5f9;
        }
        
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
        }
        
        body {
            background: var(--bg-primary);
            color: var(--text-primary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 12.8px; /* Reduced from 13.3px */
            line-height: 0.2; /* Reduced from 1.6 */
            letter-spacing: 0.3px;
            padding: 0;
            min-height: 100vh;
            margin: 0;
            overflow-x: hidden;
        }

        /* Hide all scrollbars globally */
        * {
            scrollbar-width: none !important; /* Firefox */
            -ms-overflow-style: none !important; /* Internet Explorer 10+ */
        }
        
        *::-webkit-scrollbar {
            display: none !important; /* Safari and Chrome */
        }

        /* PWA Title Bar Border - appears at very top of window */
        @media (display-mode: standalone) {
            body:not(.in-iframe)::before {
                content: '';
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                height: 0.5px;
                background: rgb(210 240 210 / 55%);
                pointer-events: none;
                z-index: 10000;
            }
        }
        
        .terminal {
            width: 100%;
            height: 100vh;
            background: var(--bg-primary);
            border-right: none;
            padding: 0;
            overflow-y: hidden;
            position: fixed;
            left: 0;
            top: 0;
            transition: width 0.3s ease, box-shadow 0.3s ease; /* Restored smooth width transition */
            display: flex;
            flex-direction: column;
            z-index: 1002; /* Above calendar footer to ensure visibility */
            box-shadow: none;

        }

        
        /* Side window indicator - three dots on right edge */
        .side-window-indicator {
            position: fixed;
            right: 10px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            gap: 4px;
            cursor: pointer;
            z-index: 1003;
            opacity: 0.4;
            transition: right 0.5s ease, opacity 0.2s ease 0.5s; /* 0.5s delay - fade back in after side window closes */
            padding: 8px;
        }
        
        .side-window-indicator:hover {
            opacity: 0.8;
        }
        
        .side-window-indicator .dot {
            width: 2.4px; /* 40% smaller: 4px * 0.6 = 2.4px */
            height: 2.4px; /* 40% smaller: 4px * 0.6 = 2.4px */
            border-radius: 50%;
            background: var(--text-secondary);
            transition: background-color 0.2s ease;
        }
        
        /* Hide loading dots and all loading indicators in page nodes (iframes) for cleaner experience */
        body.in-iframe .side-window-indicator,
        .in-iframe .side-window-indicator,
        iframe .side-window-indicator,
        body.in-iframe .loading-spinner,
        .in-iframe .loading-spinner,
        body.in-iframe .calendar-loading,
        .in-iframe .calendar-loading,
        body.in-iframe [class*="loading"],
        .in-iframe [class*="loading"] {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }

        /* Hide bottom-stats in page node iframes until content ready */
        body.in-iframe .bottom-stats {
            opacity: 0 !important;
        }

        /* Hide inline input help in iframes - not needed in page nodes */
        body.in-iframe .inline-input-help {
            display: none !important;
        }

        /* Hide ALL loading elements in iframes - page nodes have their own overlay */
        body.in-iframe #initial-loading-screen,
        .in-iframe #initial-loading-screen,
        body.in-iframe .calendar-loading,
        body.in-iframe #calendarLoading,
        body.in-iframe #view-transition-loader,
        .in-iframe #view-transition-loader {
            display: none !important;
            visibility: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
        }
        
        /* Disable height transitions on page nodes for instant sizing */
       
        
        /* Move indicator with terminal when calendar opens */
        .terminal.with-calendar ~ .side-window-indicator,
        body:has(.terminal.with-calendar) .side-window-indicator {
            right: calc(21.45vw + 10px); /* Position relative to calendar width */
        }
        
        /* Move indicator with terminal when peeking */
        body:has(.calendar-container.peeking) .side-window-indicator {
            right: calc(2.145vw + 10px); /* Position relative to peek width (100% - 97.855%) */
            opacity: 0; /* Hide during peek */
            transition: right 1s ease, opacity 1 ease; /* Instant fade out during peek */
        }
        
        /* Hide indicator when calendar is open */
        .terminal.with-calendar .side-window-indicator {
            display: none;
        }
        
        /* Hide command list when date picker modal is open */
        body:has(#datePickerModal[style*="display: flex"]) #command-wrapper,
        body:has(.date-picker-modal[style*="display: flex"]) #command-wrapper {
            display: none !important;
        }

        
        .terminal.with-calendar {
            width: 78.55%;
            border: none;
            border-right: 0.5px solid rgb(210 240 210 / 55%);
            overflow-x: hidden;
            z-index: 1002; /* Above calendar footer to ensure border is visible */
            position: relative;
            min-height: 100vh;
        }
        
        /* Header adjusts width when calendar is open */
        .terminal.with-calendar .header {
            width: 78.55%;
            border-right: 0.5px solid rgb(210 240 210 / 55%);
        }
        
        .header {
            padding: 5px 20px 5px 5px;
            margin-bottom: 0;
            
            /* Liquid Glass Effect */
            background: linear-gradient(
                135deg,
                rgba(255, 255, 255, 0.1) 0%,
                rgba(255, 255, 255, 0.05) 40%,
                rgba(255, 255, 255, 0.02) 100%
            );
            backdrop-filter: blur(12px) saturate(150%);
            -webkit-backdrop-filter: blur(12px) saturate(150%);
            /* filter: url(#liquid-glass-filter); */
            
            /* Glass-like border and shadows */
            border-bottom: 0.5px solid rgba(255, 255, 255, 0.18);
            box-shadow: 
                inset 0 -1px 2px rgba(255, 255, 255, 0.3),
                inset 0 1px 2px rgba(0, 0, 0, 0.1),
                0 2px 10px rgba(0, 0, 0, 0.05),
                0 1px 3px rgba(255, 255, 255, 0.2);
            
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 1100;
            transition: width 0.3s ease, background 0.3s ease;
            flex-shrink: 0;
            margin-left: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: #ffffff42;
        }
        
        /* Only target header-items in the header-section (list area) */
        .header-section .header-item {
            font-size: 12px !important;
        }

        
        /* Date Picker Modal Styles */
        .date-picker-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            animation: fadeIn 0.25s ease;
        }
        
        
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        
        .date-picker-content {
            background: var(--bg-primary);
            border: none;
            border-radius: 0;
            box-shadow: none;
            width: 100vw;
            height: 100vh;
            max-width: none;
            max-height: none;
            min-height: none;
            overflow: auto;
            padding: 0px 0px 0px 0px;
            position: relative;
            opacity: 1;
            transition: opacity 0.2s ease;
        }
        
        .date-picker-content.loading {
            opacity: 0.7;
        }
        
        .date-picker-body {
            animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            display: flex;
            flex-direction: column;
        }
        
        /* Mobile optimizations for date picker */
        
        
        /* Clean tablet range: 769px - 1200px */
        @media (min-width: 769px) and (max-width: 1200px) {
            body:not(.map-mode) .content-area {
                padding: 0px 15px 0px 15px !important;
                margin-top: 0 !important;
            }
        }
        
        
        
        
        /* Clean desktop range: ≥1201px */
        @media (min-width: 1201px) {
            body:not(.map-mode) .content-area {
                padding: 0px 20px 0px 20px !important;
                margin-top: 0 !important;
            }
        }
        
        @keyframes slideUp {
            from { 
                transform: translateY(20px);
                opacity: 0;
            }
            to { 
                transform: translateY(0);
                opacity: 1;
            }
        }
        
        .date-picker-header {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
            position: relative;
            height: 15px;
            margin-bottom: 0;
            margin-top: 0;
            gap: 12px;
            z-index: 1000;
        }
        
        .view-toggle-container {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 4px 12px;
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10002;
            margin-top: -26px;
        }
        
        .toggle-switch-wrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            margin-top: 13px;
        }
        
        .toggle-switch-wrapper .toggle-label-month {
            margin-bottom: -4px;
                padding: 10px;
        }
        
        .toggle-switch-wrapper .toggle-switch {
            margin-top: -3px;
        }
        
        .year-navigation-container {
            display: flex;
            align-items: left;
            gap: 12px;
            position: absolute;
            left:5%;
            transform: translateX(-50%);
            top: -1px;
        }
        
        .toggle-label-month, .toggle-label-week, .toggle-label-year {
            font-size: 10px;
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.5px;
            color: #999;
            user-select: none;
            cursor: pointer;
            transition: color 0.3s ease;
        }
        
        /* 3-layer blur system for active week label */
        .toggle-label-week.active {
            position: relative;
            display: inline-block;
            color: #a5d9a3;
        }
        
        .toggle-label-week.active::before {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            backdrop-filter: blur(0.96px);
            -webkit-backdrop-filter: blur(0.96px);
            filter: blur(0.48px);
            opacity: 0.6;
            z-index: -2;
        }
        
        .toggle-label-week.active::after {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            filter: blur(0.24px);
            opacity: 0.7;
            z-index: -1;
        }

        /* 3-layer blur system for active month label */
        .toggle-label-month.active {
            position: relative;
            display: inline-block;
            color: #a5d9a3;
        }
        
        .toggle-label-month.active::before {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            backdrop-filter: blur(0.96px);
            -webkit-backdrop-filter: blur(0.96px);
            filter: blur(0.48px);
            opacity: 0.6;
            z-index: -2;
        }
        
        .toggle-label-month.active::after {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            filter: blur(0.24px);
            opacity: 0.7;
            z-index: -1;
        }

        /* 3-layer blur system for active year label */
        .toggle-label-year.active {
            position: relative;
            display: inline-block;
            color: #a5d9a3;
        }
        
        .toggle-label-year.active::before {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            backdrop-filter: blur(0.96px);
            -webkit-backdrop-filter: blur(0.96px);
            filter: blur(0.48px);
            opacity: 0.6;
            z-index: -2;
        }
        
        .toggle-label-year.active::after {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            filter: blur(0.24px);
            opacity: 0.7;
            z-index: -1;
        }
        
        .view-toggle-container .toggle-switch {
            margin: 0;
                top: -6px;
        }
        
        .view-toggle-container .toggle-slider {
            margin: 0 !important;
            width: 28px;
            height: 16px;
        }
        
        .view-toggle {
            position: relative;
            display: flex;
            align-items: center;
            cursor: pointer !important;
            z-index: 1000;
            background: rgba(255, 255, 255, 0.9);
            padding: 5px;
            border-radius: 4px;
            background: none;
        }
        
        .view-toggle::before,
        .view-toggle::after {
            display: none !important;
        }
        
        .view-toggle {
            font-size: 0 !important;
        }
        
        .view-toggle * {
            font-size: 14px !important;
        }
        
       
        
        /* Toggle switch styles */
        .toggle-switch {
            position: relative;
            display: inline-flex;
            align-items: center;
            cursor: pointer !important;
            user-select: none;
        }
        
        .toggle-switch::before,
        .toggle-switch::after,
        .toggle-slider::after {
            display: none !important;
        }
        
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .toggle-slider {
            position: relative;
            width: 32px;
            height: 18px;
            background-color: #e0e0e0;
            border-radius: 9px;
            background-image: none !important;
            border: none;
            transition: background-color 0.3s;
            margin: 0 8px 0 -60px;
            cursor: pointer !important;
        }
        
        .toggle-slider.three-way {
            width: 48px; /* Wider for three positions */
            position: relative;
        }
        
        /* Style for dot indicators */
        .toggle-notch {
            position: absolute;
            width: 2px;
            height: 2px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: 50%;
            top: 50%;
            transform: translateY(-50%);
            pointer-events: none;
            z-index: 0;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            width: 14px;
            height: 14px;
            background: white;
            border-radius: 50%;
            top: 1px;
            left: 2px;
            transition: transform 0.3s;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            z-index: 1; /* Ensure knob is above dots */
        }
        
        /* Three-way toggle positions */
        .toggle-slider.three-way[data-position="week"]:before {
            transform: translateX(0);  /* Left position */
        }
        
        .toggle-slider.three-way[data-position="month"]:before {
            transform: translateX(15px);  /* Middle position */
        }
        
        .toggle-slider.three-way[data-position="year"]:before {
            transform: translateX(30px);  /* Right position */
        }
        
        input:checked + .toggle-slider {
            background-color: #d3f1d3;
        }
        
        input:checked + .toggle-slider:before {
            transform: translateX(14px);
        }
        
       
        
        .view-btn {
            background: rgba(139, 105, 20, 0.05);
            border: 0.4px solid rgba(139, 105, 20, 0.2);
            color: var(--text-secondary);
            padding: 5px 12px;
            cursor: pointer !important;
            transition: all 0.2s ease;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 8px;
            border-radius: 1px;
            font-weight: 500;
        }
        
        
        .view-btn:hover {
            background: rgba(139, 105, 20, 0.15);
            border-color: rgba(139, 105, 20, 0.4);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(139, 105, 20, 0.15);
        }
        
        .view-btn.active {
            background: linear-gradient(135deg, rgba(139, 105, 20, 0.8), rgba(139, 105, 20, 0.6));
            color: var(--bg-primary);
            border-color: rgba(139, 105, 20, 0.8);
            box-shadow: 0 2px 10px rgba(139, 105, 20, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
            font-weight: 600;
        }
        
        .year-display {
            color: var(--text-secondary);
            margin: 0 15px; /* Reduced margin */
            font-size: 18px; /* Reduced from 24px */
            font-weight: bold;
             margin-bottom: 15px;
        }
        
        
        
        .year-nav {
            background: rgba(139, 105, 20, 0.05);
            border: 0.4px solid rgba(139, 105, 20, 0.2);
            color: var(--text-primary);
            padding: 4px 8px;
            cursor: pointer !important;
            font-size: 9px;
            border-radius: 1px;
            transition: all 0.2s ease;
            font-weight: 500;
            margin-bottom: 15px;
        }
        
       
        
        .year-nav:hover {
            background: rgba(139, 105, 20, 0.15);
            border-color: rgba(139, 105, 20, 0.4);
            transform: scale(1.05);
            box-shadow: 0 2px 6px rgba(139, 105, 20, 0.15);
        }
        
        .date-picker-close {
            position: fixed;
            right: 10px;
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 28px;
            cursor: pointer !important;
            padding: 0;
            width: 10px;
            height: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1003;
            top: 15px
        }
        
       
        
        .date-picker-close:hover {
            color: var(--text-hover);
        }
        
        .date-picker-body {
            display: grid;
            gap: 0;
            flex: 1;
            overflow-y: auto;
            padding: 0;
        }
        
        
        
        /* Month view should fill full width */
        .date-picker-body.month-view {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: calc(100vh); /* Fixed height to prevent pop-in */
            gap: 0;
            margin-bottom: 0 !important;
            overflow-y: auto; /* Allow scrolling within fixed container */
        }
        
        .month-section {
            border: none;
            border-radius: 0;
            padding: 20px;
            background: transparent;
        }
        
      
        
        /* Add internal grid lines - right border except for rightmost column */
        .month-section:not(:nth-child(4n)) {
            border-right: 0.4px solid rgba(139, 105, 20, 0.2);
        }
        
        /* Add internal grid lines - bottom border except for bottom row */
        .month-section:not(:nth-child(n+9)) {
            border-bottom: 0.4px solid rgba(139, 105, 20, 0.2);
        }
        
        .month-title {
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 8px;
            text-transform: uppercase;
        }
        
       
        .month-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 0px; /* Remove gap to tighten up spacing */
            grid-auto-rows: min-content;
        }
        
        
        
        .day-square {
            width: 100%;
            aspect-ratio: 1;
            border: none;
            background: transparent;
            cursor: pointer !important;
            position: relative;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            color: var(--text-secondary);
            font-weight: 400;
            border-radius: 0;
            margin: 0;
        }
        
       
        
        .day-square.empty {
            cursor: default;
            border: none;
            background: transparent;
            display: none; /* Hide empty squares completely */
        }
        
        .day-square:hover {
            background: rgba(139, 105, 20, 0.1);
            border-color: var(--text-secondary);
            transform: scale(1.05);
        }
        
        .day-square:hover::after {
            content: attr(data-date);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: var(--bg-secondary);
            color: var(--text-primary);
            padding: 3px 6px; /* Reduced padding */
            border-radius: 0; /* Remove border radius */
            font-size: 9px; /* Reduced font size */
            white-space: nowrap;
            z-index: 100;
            border: 1px solid var(--border-primary);
            margin-bottom: 4px;
        }
        
        .day-square.has-entries-low {
            background: rgba(139, 105, 20, 0.2);
            opacity: 1;
        }
        
        .day-square.has-entries-medium {
            background: rgba(139, 105, 20, 0.4);
            opacity: 1;
        }
        
        .day-square.has-entries-high {
            background: rgba(139, 105, 20, 0.6);
            opacity: 1;
            color: rgba(255, 255, 255, 0.9);
        }
        
        .day-square.has-entries-very-high {
            background: rgba(139, 105, 20, 0.8);
            opacity: 1;
            color: rgba(255, 255, 255, 0.9);
        }
        
        .day-square.today {
            background: var(--text-accent);
            color: white;
            border: 0.4px solid var(--text-accent);
            font-weight: 600;
        }
        
        .day-square.selected-date {
            background: rgba(139, 105, 20, 0.2);
            border: 0.4px solid var(--text-secondary);
        }
        
        /* Past date indicator */
        #currentDate.past-date {
            color: #ef4444 !important; /* Red color for past dates */
            position: relative;
        }
        
        #currentDate.past-date::after {
            content: '';
            display: inline-block;
            width: 20px;
            height: 10px;
            margin-left: 6px;
            vertical-align: middle;
            background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 24" fill="%23ef4444"><path d="M11.41 7.41L10 6l-6 6 6 6 1.41-1.41L6.83 12z"/><path d="M23.41 7.41L22 6l-6 6 6 6 1.41-1.41L18.83 12z"/><path d="M35.41 7.41L34 6l-6 6 6 6 1.41-1.41L30.83 12z"/></svg>');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }
        
        /* Future date indicator */
        #currentDate.future-date {
            color: #3b82f6 !important; /* Blue color for future dates */
            position: relative;
        }
        
        #currentDate.future-date::after {
            content: '';
            display: inline-block;
            width: 20px;
            height: 10px;
            margin-left: 6px;
            vertical-align: middle;
            background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 24" fill="%233b82f6"><path d="M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"/><path d="M20.59 16.59L22 18l6-6-6-6-1.41 1.41L25.17 12z"/><path d="M32.59 16.59L34 18l6-6-6-6-1.41 1.41L37.17 12z"/></svg>');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }
        
        .date-picker-legend {
            display: none; /* Hide the legend completely */
            justify-content: center;
            gap: 20px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 0.4px solid rgba(139, 105, 20, 0.2);
        }
        
        
        /* Hide legend in month view and scroll view */
        .date-picker-body.month-view + .date-picker-legend,
        .date-picker-body.scroll-view + .date-picker-legend,
        .month-view .date-picker-legend,
        .scroll-view .date-picker-legend {
            display: none !important;
        }
        
        .legend-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-secondary);
        }
        
       
        
        .legend-box {
            width: 16px;
            height: 16px;
            border: 1px solid rgba(139, 105, 20, 0.3);
            border-radius: 2px;
        }
        
       
        
        /* Month view styles */
        .month-view-container {
            display: flex;
            flex-direction: column;
            height: 100%;
            width: 100%;
            position: relative; /* Needed for absolute positioning of overlay */
        }
        
        .month-view-header {
            background: linear-gradient(to bottom, rgba(139, 105, 20, 0.08), rgba(139, 105, 20, 0.04));
            margin: 0;
            padding: 0;
            width: 100%;
            box-sizing: border-box;
            margin-bottom: 8px;
            padding: 0px;
            border: 1px solid rgba(139, 105, 20, 0.15);
            border-radius: 1px;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }
        
        /* When month-view-header is NOT also a sticky header */
        .month-view-header:not(.scroll-month-title) {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 2px;
            background: var(--bg-primary);
            margin-bottom: 2px;
            padding: 10px 0;
                margin-bottom: 4px;
        }
        
        .month-view-grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            grid-template-rows: repeat(6, 1fr);
            gap: 2px;
            background: rgba(139, 105, 20, 0.1);
            height: auto !important;
            width: 100%;
            padding: 2px;
            box-sizing: border-box;
            border-radius: 1px;
            overflow: hidden;
            position: relative; /* Needed for absolute positioning of overlay */
        }
        
        /* Grid overlay for continuous multi-day items - must match .month-view-grid exactly */
        .month-multi-day-overlay {
            position: absolute;
            top: 88px; /* Position below month header */
            left: 0;
            right: 0;
            bottom: 0;
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            grid-template-rows: repeat(6, 1fr);
            gap: 2px; /* Match month-view-grid */
            padding: 2px; /* Match month-view-grid */
            box-sizing: border-box; /* Match month-view-grid */
            border-radius: 1px; /* Match month-view-grid */
            pointer-events: none; /* Allow clicks to pass through to cells below */
            z-index: 10;
            align-items: end; /* Try to align items to bottom */
        }
        
        /* Continuous multi-day items that span grid columns */
        .multi-day-item-continuous {
            position: relative;
            margin-bottom: 2px;
            border: 1px solid rgba(33, 150, 243, 0.4);
            border-radius: 2px;
            padding: 2px 4px;
            font-size: 10px;
            background: rgba(33, 150, 243, 0.15);
            color: #1976D2;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            z-index: 2;
            cursor: pointer !important;
            pointer-events: auto; /* Re-enable pointer events for the items themselves */
            align-self: end; /* Align to bottom of grid cell */
            height: 14px;
            display: flex
;
    align-items: center;
        }
        
        /* Segments that continue from previous week - flat left border */
        .multi-day-item-continuous[data-segment-type="middle"],
        .multi-day-item-continuous[data-segment-type="end"] {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }
        
        /* Segments that continue to next week - flat right border */
        .multi-day-item-continuous[data-segment-type="start"],
        .multi-day-item-continuous[data-segment-type="middle"] {
            border-top-right-radius: 0;
            border-bottom-right-radius: 0;
        }
        
        /* Type-based colors for continuous multi-day items */
        .multi-day-item-continuous.task {
            background: rgba(156, 39, 176, 0.15);
            border-color: rgba(156, 39, 176, 0.4);
            color: #7B1FA2;
        }
        
        .multi-day-item-continuous.note {
            background: rgba(33, 150, 243, 0.15);
            border-color: rgba(33, 150, 243, 0.4);
            color: #1976D2;
        }
        
        .multi-day-item-continuous.document {
            background: rgba(255, 165, 0, 0.15);
            border-color: rgba(255, 165, 0, 0.4);
            color: var(--text-accent);
        }
        
        .multi-day-item-continuous.header {
            background: rgba(139, 105, 20, 0.2);
            border-color: rgba(139, 105, 20, 0.5);
            font-weight: bold;
        }
        
        /* Completed continuous multi-day items */
        .multi-day-item-continuous.task.completed {
            background: rgba(121, 85, 72, 0.2);
            border-color: rgba(121, 85, 72, 0.4);
            color: #5D4037;
            text-decoration: line-through;
        }
        
        .multi-day-item-continuous.note.completed {
            background: rgba(33, 150, 243, 0.1);
            border-color: rgba(33, 150, 243, 0.3);
            color: #1976D2;
            opacity: 0.7;
            text-decoration: line-through;
        }
        
        /* Items are positioned using transform: translateY() for row stacking */
        
        .month-day-header {
            width: fit-content;
            min-width: 32px;
            max-width: 45px;
            margin: 6px auto;
            padding: 4px 8px;
            text-align: center;
            font-weight: 600;
            color: rgba(82, 82, 82, 0.9);
            font-size: 10px;
            letter-spacing: 0.3px;
            border-radius: 10px;
            box-sizing: border-box;
            display: block;
            text-transform: uppercase;
            
            /* Liquid glass effect */
            background: linear-gradient(
                135deg,
                rgba(255, 255, 255, 0.95) 0%,
                rgba(255, 255, 255, 0.85) 50%,
                rgba(245, 245, 245, 0.9) 100%
            );
            backdrop-filter: blur(10px) saturate(120%);
            -webkit-backdrop-filter: blur(10px) saturate(120%);
            border: 0.5px solid rgba(255, 255, 255, 0.6);
            box-shadow: 
                inset 0 1px 0 rgba(255, 255, 255, 0.9),
                0 1px 2px rgba(0, 0, 0, 0.05),
                0 2px 4px rgba(0, 0, 0, 0.03);
        }
        
        .month-day-header.weekend {
            color: rgba(139, 105, 20, 0.7);
            background: linear-gradient(
                135deg,
                rgba(255, 248, 235, 0.95) 0%,
                rgba(255, 245, 230, 0.85) 50%,
                rgba(250, 240, 225, 0.9) 100%
            );
        }
        
        .month-day-cell {
            background: white;
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 0.5px solid rgba(255, 255, 255, 0.4);
            border-radius: 6px;
            box-shadow: 
                /* Inner highlights for glass reflection */
                inset 0 1px 0 rgba(255, 255, 255, 0.8),
                inset 0 -1px 0 rgba(255, 255, 255, 0.2),
                inset 1px 0 0 rgba(255, 255, 255, 0.3),
                inset -1px 0 0 rgba(255, 255, 255, 0.1),
                /* Outer depth shadows */
                0 1px 3px rgba(0, 0, 0, 0.12),
                0 4px 8px rgba(0, 0, 0, 0.08),
                0 8px 20px rgba(0, 0, 0, 0.04),
                /* Subtle ambient shadow */
                0 0 1px rgba(0, 0, 0, 0.1) !important;
            
            padding: 10px;
            position: relative;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            height: 180px !important;
            max-height: 180px !important;
            min-height: 180px !important;
            box-sizing: border-box;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        }
        
        
        /* Removed hover effect from entire cell - only date number is clickable now */
        
        .month-day-cell.other-month {
        background: rgb(139 105 20 / 0%);
            /* Remove overall opacity - keep borders at full strength */
            color: var(--text-muted);
        }
        
        /* Only fade the date numbers in other-month cells */
        .month-day-cell.other-month .month-day-number {
            opacity: 0.3;
        }
        
        .month-day-cell.today .month-day-number {
            color: #FF6B35; /* Orange color for today's date */
            font-weight: bold;
        }
        
        /* Only add relative positioning on desktop where absolute positioning is used */
        @media (min-width: 769px) {
            .month-day-cell.today .month-day-number {
                position: absolute;
                top: 4px;
                right: 8px;
                z-index: 1;
            }
        }
        
        .month-day-cell.today .month-day-number::before {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            backdrop-filter: blur(0.96px);
            -webkit-backdrop-filter: blur(0.96px);
            filter: blur(0.72px);
            opacity: 0.6;
            color: #FF6B35;
            z-index: -2;
            font-weight: bold;
            text-align: inherit;
            font-size: inherit;
            padding: inherit;
        }
        
        .month-day-cell.today .month-day-number::after {
            content: attr(data-text);
            position: absolute;
            inset: 0;
            filter: blur(0.4px);
            opacity: 0.7;
            color: #FF6B35;
            z-index: -1;
            font-weight: bold;
            text-align: inherit;
            font-size: inherit;
            padding: inherit;
        }
        
        .month-day-cell.selected {
           border: 2px solid rgb(188 215 241);
            position: relative;
            
        }
        
        .month-day-cell.weekend {
            /* Same as weekday cells - no visual difference */
        }
        
        .month-day-cell.weekend.today {
            /* background: rgba(139, 105, 20, 0.18); */
           
        }
        
        /* Time grid indicators for drag operations */
        .month-day-cell .time-grid {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
            z-index: 1;
        }
        
        .month-day-cell.drag-over .time-grid {
            opacity: 1;
        }
        
        .month-day-cell .time-grid .time-line {
            position: absolute;
            left: 8px;
            right: 8px;
            height: 1px;
            background: rgba(139, 105, 20, 0.3);
            border-top: 1px dashed rgba(139, 105, 20, 0.5);
        }
        
        .month-day-cell .time-grid .time-label {
            position: absolute;
            right: 12px;
            font-size: 8px;
            color: rgba(139, 105, 20, 0.8);
            background: var(--bg-primary);
            padding: 0 2px;
            transform: translateY(-50%);
            font-weight: bold;
        }
        
        /* Multi-day item styles for month view */
        .multi-day-item {
            position: relative;
            margin-bottom: 2px;
            /* Default background removed - type-specific styles will set colors */
            background: rgba(128, 128, 128, 0.2); /* Fallback gray for items without type */
            border: 1px solid rgba(128, 128, 128, 0.4);
            border-radius: 2px;
            padding: 2px 4px;
            cursor: pointer !important;
            font-size: 10px;
            color: var(--text-primary);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            z-index: 2;
            cursor: pointer !important;
        }
        
        /* Container for multi-day items */
        .multi-day-container {
            position: absolute;
            bottom: 4px;
            left: 2px;
            right: 2px;
            display: flex;
            flex-direction: column-reverse; /* Stack from bottom up */
        }
        
        /* Desktop: Reduce padding to allow more width for snippet items */
        @media (min-width: 769px) {
            .month-day-snippet {
                padding-right: 25px; /* Reduced from 30px to give more room */
            }
        }
        
        /* Type-based colors for multi-day items */
        .multi-day-item.task {
            background: rgba(156, 39, 176, 0.15);
            border-color: rgba(156, 39, 176, 0.4);
            color: #7B1FA2;
        }
        
        .multi-day-item.note {
            background: rgba(33, 150, 243, 0.15);
            border-color: rgba(33, 150, 243, 0.4);
            color: #1976D2;
        }
        
        .multi-day-item.document {
            background: rgba(255, 165, 0, 0.15);
            border-color: rgba(255, 165, 0, 0.4);
            color: var(--text-accent);
        }
        
        .multi-day-item.header {
            background: rgba(139, 105, 20, 0.2);
            border-color: rgba(139, 105, 20, 0.5);
            font-weight: bold;
        }
        
        .multi-day-container.start {
            left: 2px;
            right: -1px; /* Extend to edge to connect with next cell */
        }
        
        .multi-day-container.end {
            left: -1px; /* Extend from edge to connect with previous cell */
            right: 2px;
        }
        
        .multi-day-container.middle {
            left: -1px; /* Extend from edge */
            right: -1px; /* Extend to edge */
        }
        
        
        
        .multi-day-item.start {
            border-top-left-radius: 6px;
            border-bottom-left-radius: 6px;
            border-right: none;
            margin-right: -2px; /* Extend slightly to connect */
        }
        
        .multi-day-item.end {
            border-top-right-radius: 6px;
            border-bottom-right-radius: 6px;
            border-left: none;
            margin-left: -3.5px; /* Extend slightly to connect */
            margin-right: 3px; /* Add padding from cell border */
        }
        
        .multi-day-item.middle {
            border-radius: 0;
            border-left: none;
            border-right: none;
            margin-left: -3.5px;
            margin-right: -2px;
        }
        
        .multi-day-item.single {
            border-radius: 1px;
            /* Border color will inherit from type-specific classes */
            margin-left: 0; /* Reset any negative margins */
            margin-right: 3px; /* Add padding from cell border */
        }
        
        /* Completed multi-day items */
        .multi-day-item.task.completed {
            background: rgba(121, 85, 72, 0.2);
            border-color: rgba(121, 85, 72, 0.4);
            color: #5D4037;
            text-decoration: line-through;
        }
        
        .multi-day-item.note.completed {
            background: rgba(33, 150, 243, 0.1);
            border-color: rgba(33, 150, 243, 0.3);
            color: #1976D2;
            opacity: 0.7;
            text-decoration: line-through;
        }
        
        /* Read-only item indicators */
        .snippet-item.read-only, .multi-day-item.read-only {
            opacity: 1;
            cursor: default !important;
        }
        
        .snippet-item.repeating::after, .multi-day-item.repeating::after {
            content: '🔁';
            position: absolute;
            top: -2px;
            right: 2px;
            font-size: 8px;
            opacity: 0.7;
        }
        
        .month-day-cell.has-multi-day {
            padding-bottom: 28px; /* Make room for multi-day items - will be adjusted by JavaScript for multiple items */
        }
        
        .month-day-number {
            font-weight: bold;
            color: var(--text-secondary);
            margin-bottom: 8px;
            font-size: 16px;
            text-align: center;
            flex-shrink: 0;
            cursor: pointer !important;
        }
        
        /* Desktop: Move date number to the right */
        @media (min-width: 769px) {
            .month-day-cell {
                position: relative;
            }
            
            .month-day-number {
                position: absolute;
                top: 4px;
                right: 8px;
                margin-bottom: 0;
                text-align: right;
                font-size: 14px;
                cursor: pointer !important;
                padding: 2px 4px;
                border-radius: 3px;
                transition: background-color 0.2s ease;
            }
            
            .month-day-number:hover {
                background: rgba(139, 105, 20, 0.1);
            }
            
            .month-day-snippet .snippet-item:first-child {
                margin-right: 25px; /* Reduce width of first item to avoid date */
            }
            
            .month-day-snippet {
                padding-right: 30px; /* Make room for the date number on the right */
            }
        }
        
        .month-day-snippet {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 0.2;
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            display: flex;
            flex-direction: column;
            gap: 2px;
            padding:0;
            /* Add subtle scrollbar styling */
            scrollbar-width: thin;
            scrollbar-color: rgba(139, 105, 20, 0.3) transparent;
        }
        
        .month-day-snippet::-webkit-scrollbar {
            width: 4px;
        }
        
        .month-day-snippet::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .month-day-snippet::-webkit-scrollbar-thumb {
            background: rgba(139, 105, 20, 0.3);
            border-radius: 2px;
        }
        
        .month-day-snippet::-webkit-scrollbar-thumb:hover {
            background: rgba(139, 105, 20, 0.5);
        }
        
        .month-day-snippet .snippet-item {
            display: flex;
            align-items: center;
            padding: 2px 4px;
            background: rgba(139, 105, 20, 0.1);
            border-radius: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex-shrink: 0;
            font-size: 10px;
            cursor: pointer !important;
            margin-bottom: 2px;
            cursor: pointer !important;
            transition: all 0.2s ease;
            user-select: none;
            position: relative;
            z-index: 1;
        }
        
        /* Drag handles for range extension */
        .month-day-snippet .snippet-item .drag-handle {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 8px;
            background: rgba(0, 0, 0, 0.2);
            cursor: ew-resize;
            opacity: 0;
            transition: opacity 0.2s ease;
            z-index: 2;
        }
        
        /* Mobile-specific improvements */
       
        
        .month-day-snippet .snippet-item .drag-handle.left {
            left: 0;
            border-radius: 2px 0 0 2px;
        }
        
        .month-day-snippet .snippet-item .drag-handle.right {
            right: 0;
            border-radius: 0 2px 2px 0;
        }
        
        .month-day-snippet .snippet-item:hover .drag-handle {
            opacity: 1;
        }
        
        .month-day-snippet .snippet-item .content {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 0 2px;
            z-index: 1;
        }
        
        .month-day-snippet .snippet-item:hover {
            opacity: 0.8;
            transform: scale(1.02);
        }
        
        /* Task styling - purple */
        .month-day-snippet .snippet-item.task {
            background: rgba(156, 39, 176, 0.15);
            color: #7B1FA2;
        }
        
        /* Note styling - blue */
        .month-day-snippet .snippet-item.note {
            background: rgba(33, 150, 243, 0.15);
            color: #1976D2;
        }
        
        /* Comment styling - no background, blue text, indented */
        .month-day-snippet .snippet-item.comment {
            background: transparent !important;
            color: #e91e63 !important;
            margin-left: 8px;
            padding-left: 2px;
            font-style: italic;
            opacity: 0.9;
            border: none !important;
        }
        
        /* Comment arrow styling */
        .month-day-snippet .snippet-item.comment .comment-arrow {
            color: #e91e63;
            font-weight: bold;
            font-style: normal;
            margin-right: 2px;
        }
        
        /* Comment items don't need drag handles */
        .month-day-snippet .snippet-item.comment .drag-handle {
            display: none;
        }
        
        /* Comment items shouldn't show hover effect */
        .month-day-snippet .snippet-item.comment:hover {
            opacity: 0.9;
            transform: none;
        }
        
        /* Document styling - orange */
        .month-day-snippet .snippet-item.document {
            background: rgba(255, 165, 0, 0.15);
            color: var(--text-accent);
        }
        
        /* Header styling - plain black text with black underline */
        .month-day-snippet .snippet-item.header {
            font-weight: normal !important;
            background: transparent !important;
            color: #000000 !important;
            font-size: 10px !important;
            text-decoration: underline !important;
            text-decoration-color: #000000 !important;
            border-bottom: none !important;
            padding: 2px 4px !important; /* Add some horizontal padding to prevent text cutoff */
            margin-top: 0 !important; 
            margin-left: 0 !important; 
            margin-bottom: 2px !important;
            white-space: nowrap !important; /* Keep on single line */
            overflow: hidden !important; /* Hide overflow */
            text-overflow: ellipsis !important; /* Add ellipsis for long text */
            text-align: left !important; /* Ensure text starts from left */
            direction: ltr !important; /* Left-to-right text direction */
            /* Allow margin-right to be set by :first-child rule for date avoidance */
        }
        
        /* Header items don't need drag handles */
        .month-day-snippet .snippet-item.header .drag-handle {
            display: none;
        }
        
        /* Divider styling - no background, no hover effects */
        .month-day-snippet .snippet-item.divider {
            background: transparent !important;
            padding: 0 !important;
            margin: 2px 0 !important;
            border-radius: 0 !important;
        }
        
        .month-day-snippet .snippet-item.divider:hover {
            background: transparent !important;
            transform: none !important;
            opacity: 1 !important;
        }
        
        .month-day-snippet .snippet-item.divider .drag-handle {
            display: none;
        }
        
        .month-day-snippet .snippet-item.header .content {
            padding: 0 !important;
            margin: 0 !important;
            text-align: left !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
            width: 100% !important;
            display: block !important;
        }
        
        /* Completed task styling - same pinkish purple as incomplete tasks */
        .month-day-snippet .snippet-item.task.completed {
            background: rgba(156, 39, 176, 0.15);
            color: #7B1FA2;
            text-decoration: line-through;
        }
        
        /* Completed note styling - muted blue with strikethrough */
        .month-day-snippet .snippet-item.note.completed {
            background: rgba(33, 150, 243, 0.1);
            color: #1976D2;
            opacity: 0.7;
            text-decoration: line-through;
        }
        
        .month-day-count {
            position: absolute;
            bottom: 4px;
            right: 6px;
            font-size: 9px;
            color: var(--text-muted);
            background: rgba(139, 105, 20, 0.2);
            padding: 1px 4px;
            border-radius: 1px;
        }

        #inline-input {
            font-size: 16px !important;
            caret-color: var(--text-primary);
            animation: none !important; /* Disable any cursor animations */
        }
        
        /* Solid non-blinking cursor for all text inputs during rapid creation */
        #inline-input,
        .inline-input-container input,
        .inline-input-container textarea,
        .edit-input,
        .edit-textarea,
        [contenteditable="true"] {
            caret-color: var(--text-primary) !important;
            -webkit-text-fill-color: var(--text-primary);
        }
        
        /* Disable cursor blinking globally for smooth rapid creation */
        * {
            caret-color: var(--text-primary) !important;
        }
        
        /* Completely disable text cursor blinking */
        input, textarea, [contenteditable] {
            caret-color: var(--text-primary) !important;
            animation: none !important;
        }
        
        @supports (caret-shape: block) {
            input, textarea, [contenteditable] {
                caret-shape: block;
            }
        }
        
        /* Visual creation cursor that moves down as items are created */
        .creation-cursor {
            position: fixed;
            left: 50px; /* Match item text indentation */
            width: 3px;
            height: 24px;
            background: var(--text-primary);
            opacity: 0;
            transition: top 0.15s ease-out, opacity 0.1s ease;
            pointer-events: none;
            z-index: 1000;
            border-radius: 1px;
        }
        
        .creation-cursor.active {
            opacity: 1;
        }
        
        /* Hide default cursor during rapid creation */
        .rapid-creation #inline-input,
        .rapid-creation .edit-input,
        .rapid-creation [contenteditable="true"] {
            caret-color: transparent !important;
        }
        
        /* Time display in snippets */
        .snippet-time {
            display: inline-block;
            background: rgba(255, 107, 53, 0.2);
            color: #D84315;
            font-size: 8px;
            font-weight: bold;
            padding: 1px 3px;
            border-radius: 2px;
            margin-right: 3px;
            vertical-align: baseline;
            flex-shrink: 0; /* Prevent time prefix from shrinking in edit mode */
        }
        
        
        .snippet-item.has-time {
            padding-left: 0;
        }
        
        /* Fix time prefix shifting in edit mode for regular list items - ultra specific */
        .item.editing span[style*="color: #FF6B35"],
        .item.editing span[style*="color:#FF6B35"],
        .item.editing span[style*="color: rgb(255, 107, 53)"] {
            display: inline-block !important;
            vertical-align: baseline !important;
            font-size: 0.9em !important;
            font-weight: bold !important;
            color: #FF6B35 !important;
            margin: 0 4px 0 0 !important;
            padding: 0 !important;
            line-height: 1 !important;
            flex-shrink: 0 !important;
            position: static !important;
            transform: none !important;
            box-sizing: content-box !important;
            border: none !important;
            background: none !important;
            text-decoration: none !important;
            font-family: inherit !important;
            letter-spacing: normal !important;
            word-spacing: normal !important;
        }
        
        /* Also lock the parent container to prevent layout shifts */
        .item.editing .content,
        .item.editing .item-text {
            font-size: inherit !important;
            line-height: inherit !important;
        }
        
        /* Prevent any container flex changes that might affect time positioning */
        .item.editing {
            /* Removed font-size override to preserve original item font size */
            line-height: 1.4 !important; /* Lock base line height */
        }
        
        /* Time styling for different item types */
        .snippet-item.task .snippet-time {
            background: rgba(156, 39, 176, 0.2);
            color: #7B1FA2;
        }
        
        .snippet-item.note .snippet-time {
            background: rgba(33, 150, 243, 0.2);
            color: #1976D2;
        }
        
        .snippet-item.header .snippet-time {
            background: rgba(139, 105, 20, 0.3);
            color: #8B6914;
        }
        
        /* Scroll calendar styles */
        .scroll-calendar-container {
            display: block; /* Change from flex to block */
            padding: 20px 0;
            height: 100%;
            overflow-y: auto;
            position: relative;
        }
        
        /* Hide scrollbar for scroll calendar */
        .scroll-calendar-container::-webkit-scrollbar {
            display: none;
        }
        
        .scroll-calendar-container {
            -ms-overflow-style: none;  /* IE and Edge */
            scrollbar-width: none;  /* Firefox */
        }
        
        
        .scroll-month-section {
            display: block;
            margin: 0 0 60px 0; /* Reduced margin since header is more integrated */
            height: auto; /* Let it size naturally */
        }
        
        .scroll-month-title {
            position: sticky;
            top: -20px;
            z-index: 10;
            margin: 0;
            padding: 0;
            background: transparent;
            border: none;
            transition: transform 0.2s ease-out, opacity 0.2s ease-out;
            display: flex;
            flex-direction: column;
            gap: 0;
            padding: 0px;
    border: 0px;
     margin-bottom: 5px;
        }


        #calendar-date {
            display: none;
        }
        
        .month-title-text {
            color: var(--text-secondary);
            font-size: 18px;
            font-weight: bold;
            text-align: left;
            padding: 8px;
            margin-bottom: 4px;
            /* border: solid 1px rgba(139, 105, 20, 0.2); */
            background: transparent;
            border-radius: 5px;
        }
        
        .day-headers {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 3px; /* Match month-view-grid gap */
            width: 100%; /* Match month-view-grid width */
            padding: 4px 0; /* Small vertical padding */
            margin: 0; /* Ensure no margin */
            box-sizing: border-box; /* Match month-view-grid box-sizing */
            border-radius: 5px;
            align-items: center;
            justify-items: center; /* Center the pills within each grid cell */
        }
        
        /* Subtle enhancement when sticky header is active */
        .scroll-month-title.stuck {
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            padding: 0 !important;
            border: 0px;
        }
        
        /* Optimize performance during scrolling */
        .scroll-calendar-container.scrolling .scroll-month-title {
            will-change: transform, opacity;
        }
        
        /* Ensure smooth transitions */
        .scroll-month-section {
            position: relative;
        }
        
        /* Always maintain 3 rows layout - only allow 3 or 4 columns */
        .date-picker-body:not(.month-view) {
            grid-template-columns: repeat(3, 1fr); /* Default: 3 columns (4 rows) */
        }
        
        /* AGGRESSIVE Performance optimizations for month view */
        .month-view {
            /* Reduce visual effects when month view is active */
            contain: strict;
            will-change: auto;
        }
        
        /* Disable backdrop filters ONLY within month view for performance - except headers */
        .month-view *:not(.scroll-month-title):not(.month-day-header) {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        
        /* Remove all box shadows in month view except headers */
        .month-view *:not(.month-day-header) {
            box-shadow: none !important;
        }
        
        /* Keep blur effect for stuck month title headers */
     
        
        /* Remove ALL transitions in month view for maximum performance */
        .month-view *,
        .month-view .month-day-cell,
        .month-view .snippet-item,
        .month-view .multi-day-item {
            transition: none !important;
        }
        
        /* Disable ALL animations in month view */
        .month-view * {
            animation: none !important;
        }
        
        /* Use GPU acceleration for month grid with aggressive optimizations */
        .month-view-grid {
            transform: translateZ(0);
            backface-visibility: hidden;
            perspective: 1000;
            transform-style: flat;
        }
        
        /* Optimize scrolling performance with aggressive settings */
        .scroll-calendar-container {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            scroll-behavior: auto;
            contain: strict;
        }
        
        /* Disable hover effects in month view */
        .month-view .month-day-cell:hover,
        .month-view .snippet-item:hover,
        .month-view .multi-day-item:hover {
            transform: none !important;
        }
       
        
        @media (min-width: 1000px) {
            .date-picker-body:not(.month-view) {
                grid-template-columns: repeat(4, 1fr); /* 4 columns (3 rows) for wider screens */
            }
        }
        

        /* Ocean theme: use text-secondary for header border */
        :root[data-theme="ocean"] .header {
            border-bottom: 1px solid var(--text-secondary);
        }
        
        .header h1 {
            font-size: 15.5px !important;
            font-weight: 400;
            display: inline-flex;
            align-items: center;
            max-width: 60%;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 1.2;
        }

        /* Default title visibility: notepad title visible, page title hidden
           This prevents flashing during mode transitions */
        .header h1.page-title {
            display: none;
        }
        .header h1.notepad-title {
            display: inline-flex;
            font-weight: 510;
        }
        /* Only show page title when explicitly in iframe page context */
        body.in-iframe .header h1.page-title {
            display: inline-flex;
        }
        body.in-iframe .header h1.notepad-title {
            display: none;
        }

        /* Remove blue outline when h1 becomes editable */
        .header h1[contenteditable="true"] {
            outline: none !important;
            border: none !important;
            background: transparent !important;
        }
        
        /* Add text edit cursor on hover for folder name editing */
        .folder-name-display:hover {
            cursor: text;
        }
        
        .countdown-timer {
            color: #22c55e;
            font-size: 13px;
            margin-left: 8px;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            flex-shrink: 0;
        }
        
        
        .header .date {
            color: rgb(82 82 82);
            transition: color 0.3s ease, text-decoration 0.3s ease;
            cursor: pointer !important;
            text-decoration: none;
            font-size: 12px;
            white-space: nowrap;
            flex-shrink: 0;
            margin-right: 0px;
            /* margin-top: -6px; */
                display: flex;
    align-items: center;
    margin-top: 2px;
        }
        
        .header .date:hover {
            color: var(--text-hover);
        }
        
        /* Make calendar icon clickable with pointer cursor */
        .calendar-icon {
            cursor: pointer;
            opacity: 0.4;
            color: currentColor;
            transition: none !important;
        }
        
        /* Hide calendar icon in iframes */
        body.in-iframe .calendar-icon {
            display: none !important;
        }
        
        /* Apply both opacity and color to all SVG elements inside */
        .calendar-icon svg {
            transition: none !important;
            fill: currentColor;
            stroke: currentColor;
        }
        
        /* Force no transitions on all child elements */
        .calendar-icon * {
            transition: none !important;
        }
        
        /* Make calendar icon turn orange and full opacity when date is hovered */
        .header .date:hover ~ .calendar-icon,
        .header .calendar-icon:hover {
            opacity: 1 !important;
            color: #ff8922 !important;
            filter: brightness(1.15) saturate(1.2);
        }

        /* Since the icon comes before the date, we need to target the container */
        .header div:has(.date:hover) .calendar-icon {
            opacity: 1 !important;
            color: #ff8922 !important;
            filter: brightness(1.15) saturate(1.2);
        }
        
        
        /* Remove date underline in shared mode since it's not clickable */
        body.shared-mode .header .date {
            text-decoration: none;
            cursor: default;
            pointer-events: none;

            margin-top: -20px;
    height: 10px;
        }

        
        /* VS Code style search widget */
        .search-widget {
            position: fixed;
            top: 80px;
            right: 30px;
            width: 320px;
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 1px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            z-index: 2000;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            display: none;
            animation: slideInFromRight 0.15s ease-out;
        }
        
        @keyframes slideInFromRight {
            from {
                opacity: 0;
                transform: translateX(20px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }
        
        .search-widget.active {
            display: block;
        }
        
        .search-input-row {
            display: flex;
            align-items: center;
            padding: 8px;
            border-bottom: 1px solid var(--border-secondary);
        }
        
        .search-input {
            flex: 1;
            padding: 6px 8px;
            font-size: 13px;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            background: var(--bg-secondary);
            border: 1px solid var(--border-secondary);
            border-radius: 3px;
            color: var(--text-primary);
            outline: none;
            margin-right: 4px;
        }
        
        .search-input:focus {
            border-color: var(--text-accent);
            box-shadow: 0 0 0 1px var(--text-accent);
        }
        
        .search-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.7;
        }
        
        .search-controls-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 8px;
            font-size: 11px;
            color: var(--text-secondary);
            background: var(--bg-secondary);
        }
        
        .search-results-info {
            font-size: 11px;
        }
        
        .search-nav-buttons {
            display: flex;
            gap: 2px;
        }
        
        .search-nav-btn {
            width: 22px;
            height: 22px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            background: transparent;
            border: 1px solid transparent;
            border-radius: 3px;
            color: var(--text-primary);
            cursor: pointer !important;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            line-height: 0.2;
        }
        
        .search-nav-btn:hover:not(:disabled) {
            background: var(--text-accent);
            color: var(--bg-primary);
        }
        
        .search-nav-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        
        .search-close-btn {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer !important;
            border-radius: 3px;
            font-size: 14px;
            line-height: 0.2;
        }
        
        .search-close-btn:hover {
            background: var(--text-accent);
            color: var(--bg-primary);
        }
        
        .search-highlight {
            background: rgba(210, 240, 210, 1);
            color: #000;
            border-radius: 2px;
        }
        
        .search-highlight.current {
            background: #6a6a6a;
            color: #fff;
        }
        
        
        /* Remove old toggle-calendar styles from header */
        
        .input-line {
            display: none !important;
            background: rgba(139, 105, 20, 0.03);
            z-index: 2000;
            padding: 10px 30px;
            flex-shrink: 0;
            overflow: visible;
            min-width: 100%;
            align-items: center;
            position: relative;
            font-size: 16px !important;
        }
        
        /* Force hide input line in read-only shared mode */
        body.shared-read-only .input-line {
            display: none !important;
        }
        
        /* Additional CSS to hide input-line completely when isSharedReadOnly is true */
        .input-line.force-hidden {
            display: none !important;
            visibility: hidden !important;
            height: 0 !important;
            overflow: hidden !important;
        }
        
        /* Simple rule to hide input line in read-only shared mode */
        body.shared-mode.shared-read-only .input-line {
            display: none !important;
        }
        
        body.shared-mode.shared-read-only .inline-input-container {
            display: none !important;
        }
        
        /* Show input line when in auth mode */
        body.auth-mode .input-line {
            display: flex !important;
            background: var(--input-bg);
            border: 1px solid var(--border-primary);
            border-radius: 1px;
            margin: 20px auto;
            padding: 8px 12px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            max-width: 400px !important;
            width: 400px !important;
            min-width: 400px !important;
            min-height: 36px;
            align-items: center;
        }

        /* Show Daily logo in auth mode */
        .auth-mode .auth-logo {
            display: block !important;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-weight: 400;
            letter-spacing: 12px;
            color: var(--text-secondary);
            text-align: center;
            margin-bottom: 30px;
            text-transform: uppercase;
            font-size: 28px;
            margin-right: -12px;
        }

        /* Show helper text in auth mode */
        .auth-mode .auth-helper-text {
            display: block !important;
            color: var(--text-secondary);
            text-align: center;
            font-size: 12px;
            margin-top: 10px;
            margin-bottom: 15px;
            font-style: italic;
        }
        
        /* Style the main input line like inline-input */
        .input-line .prompt {
            color: var(--text-accent);
            font-weight: bold;
            margin-right: 0px;
            font-size: 14px;
        }
        
        .input-line input {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            padding: 2px 0;
        }
        
        .input-line input::placeholder {
            color: var(--text-secondary);
            opacity: 0.8;
            font-size: 13px;
        }
        
        /* Restore default cursor for auth mode */
        .auth-mode #input {
            caret-color: var(--text-primary) !important;
        }
        
        /* Hide everything except login input and checkbox in auth mode */
        .auth-mode .stats,
        .auth-mode .header,
        .auth-mode .content-area,
        .auth-mode .calendar-container,
        .auth-mode .footer-notepads,
        .auth-mode .footer-stats {
            display: none !important;
        }
        
        .auth-mode .terminal {
            width: 100% !important;
            max-width: 100% !important;
            display: flex !important;
            flex-direction: column !important;
            justify-content: center !important;
            align-items: center !important;
            min-height: 100vh !important;
        }
        
        .auth-mode body {
            margin: 0 !important;
            padding: 0 !important;
        }
        
        .ocr-progress {
            margin: 10px 0;
            padding: 10px;
            background: rgba(139, 105, 20, 0.1);
            border-radius: 1px;
        }
        
        .progress-text {
            color: var(--text-secondary);
            font-size: 12px;
            margin-bottom: 8px;
        }
        
        .progress-bar {
            width: 100%;
            height: 4px;
            background: rgba(139, 105, 20, 0.2);
            border-radius: 2px;
            overflow: hidden;
        }
        
        .progress-fill {
            height: 100%;
            background: var(--text-secondary);
            transition: width 0.3s ease;
            width: 0%;
        }
        
        .prompt {
            color: var(--text-secondary);
            margin-right: 0px;
        }
        
        #input {
            background: transparent !important;
            border: none;
            color: #8b6914 !important;
            font-family: inherit;
            font-size: inherit;
            width: calc(100% - 100px);
            max-width: calc(100vw - 200px);
            outline: none;
                        position: relative;
            -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
            -webkit-text-fill-color: #8b6914 !important;
            overflow: hidden;
            white-space: nowrap;
        }
        
        #input:-webkit-autofill,
        #input:-webkit-autofill:hover,
        #input:-webkit-autofill:focus,
        #input:-webkit-autofill:active {
            -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
            -webkit-text-fill-color: #8b6914 !important;
            background: transparent !important;
            color: #8b6914 !important;
        }

        /* Ocean theme input color overrides */
        :root[data-theme="ocean"] #input {
            color: #1e293b !important;
            -webkit-text-fill-color: #1e293b !important;
        }

        :root[data-theme="ocean"] #input:-webkit-autofill,
        :root[data-theme="ocean"] #input:-webkit-autofill:hover,
        :root[data-theme="ocean"] #input:-webkit-autofill:focus,
        :root[data-theme="ocean"] #input:-webkit-autofill:active {
            -webkit-text-fill-color: #1e293b !important;
            color: #1e293b !important;
        }
        
        
        /* Hide paragraph symbols used as empty line placeholders */
        .app-note-text {
            word-spacing: 0;
        }
        
        /* This will be handled by JavaScript to replace ¶ with invisible content */
        
        .other-mode-indicator {
            position: absolute;
            right: 30px;
            top: 50%;
            transform: translateY(-50%);
            color: #ff8c00;
            font-size: 18px;
            font-weight: bold;
            cursor: pointer !important;
            user-select: none;
            z-index: 100;
        }
        
        .other-mode-indicator:hover {
            color: #6a6a6a;
        }
        
        .system-message-popup {
            position: fixed;
            bottom: -25px;
            left: calc(100% - 320px);
            background: transparent;
            backdrop-filter: blur(5px);
            color: var(--text-secondary);
            padding: 4px 8px;
            border-radius: 3px 3px 0 0;
            font-size: 11px;
            font-weight: 500;
            z-index: 1950;
            max-width: 300px;
            transition: all 0.15s ease-out;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            height: 18px;
            line-height: 10px;
            opacity: 0;
            border: 1px solid rgba(139, 105, 20, 0.3);
            border-bottom: none;
        }
        
        /* Adjust position when calendar is open */
        .terminal.with-calendar ~ .system-message-popup {
            left: calc(78.55% - 320px);
        }
        
        
        .system-message-popup.show {
            opacity: 1;
            bottom: 28px;
        }
        
        
        .system-message-popup.error {
            background: var(--bg-primary);
            color: var(--error);
            border-color: var(--error);
        }
        
        .system-message-popup.success {
            background: var(--bg-primary);
            color: var(--success);
            border-color: var(--success);
        }
        
        .system-message-popup.info {
            background: var(--bg-primary);
            color: var(--info);
            border-color: var(--info);
        }
        
        /* Hide bottom notepads in shared view but keep element for positioning */
        body.shared-mode .bottom-notepads {
            visibility: hidden !important;
            pointer-events: none !important;
        }
        
      
        
        /* Hide trackpad gesture text in shared view */
        body.shared-mode .trackpad-gesture-text {
            display: none !important;
        }
        
        #input::placeholder {
            color: var(--text-secondary);
        }
        
        .content-area {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            /* Hide scrollbar */
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* Internet Explorer 10+ */
            /* Force minimum height to ensure scrolling */
            min-height: 0;
            height: 0; /* Important: forces flexbox to calculate proper height */
            /* Smooth transition for padding changes */
            transition: padding 0.3s ease;
            background-color: #f6f6f663;
            background-image: radial-gradient(circle, #8b69141a 1px, transparent 1px);
            background-size: 20px 20px;
            padding-top: 0 !important;
    padding-bottom: 0 !important;
        }
        
        /* List view specific padding override */
        body:not(.map-mode) .content-area {
            padding-top: 0 !important;
            padding-bottom: 0 !important;
        }
        
        /* I-beam cursor in list view content area */
        body:not(.map-mode) .content-area {
            cursor: text;
        }
        
        /* Apply comfortable padding with good top spacing */
        body:not(.map-mode) .content-area {
            padding: 0 5px 0 5px !important; /* Zero top/bottom padding for list view */
        }
        
        /* Old desktop spacing rules removed - using clean 3-breakpoint system above */
        
        .content-area::-webkit-scrollbar {
            display: none; /* Safari and Chrome */
        }
        
        /* Dynamic padding based on calendar state - nudge up when calendar is open */
        /* Only apply content-area shifting in list view, not map view */
        /* Try multiple selectors to catch the different possible DOM structures */
        body:not(.map-mode) .calendar-container.visible ~ .content-area,
        body:not(.map-mode) .terminal.with-calendar .content-area,
        body:not(.map-mode):has(.calendar-container.visible) .content-area {
            padding-top: 0px !important; /* No top spacing in list view */
        }
        
        /* More specific selectors for different screen sizes when calendar is open */
        @media (min-width: 769px) {
            body:not(.map-mode) .calendar-container.visible ~ .content-area,
            body:not(.map-mode) .terminal.with-calendar .content-area,
            body:not(.map-mode):has(.calendar-container.visible) .content-area {
                padding-top: 0px !important; /* No top spacing in list view */
            }
        }
        
        /* REMOVED: Second overlapping 900-1200px range - conflicts with clean tablet range */
        
        @media (min-width: 1201px) {
            body:not(.map-mode) .calendar-container.visible ~ .content-area,
            body:not(.map-mode) .terminal.with-calendar .content-area,
            body:not(.map-mode):has(.calendar-container.visible) .content-area {
                padding-top: 0px !important; /* No top spacing in list view */
            }
        }
        
        .items {
            margin-bottom: 20px;
            position: relative;
            min-height: 50px;
            font-size: 13px !important;
            width: 700px;
            max-width: 100%;
            margin-left: auto;
            margin-right: auto;
            background: transparent;
            padding: 20px 0;
            height: auto;
        }

        /* A4 Page styling */
        .a4-page {
            background: white;
            padding: 60px 50px; /* 60px top/bottom, 50px left/right */
            height: 1020px; /* Fixed height - 900px content + 120px padding */
            margin-bottom: 10px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
            border: 1px solid rgba(0, 0, 0, 0.08);
            border-radius: 12px;
            box-sizing: border-box;
            overflow: visible; /* Allow drag handles to show - JS handles content overflow */
            position: relative;
        }

        /* A4 Page content area - where lines actually go */
        .a4-page-content {
            height: 900px; /* Content area height */
            overflow: visible; /* Allow drag handles to show - JS handles content overflow */
            position: relative;
        }

        /* List view specific styles */
        body:not(.map-mode) .items {
            /* Ensure text selection works across items - try different approach */
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            cursor: text; /* Text cursor for consistent selection experience */
        }
        
        /* Reset height for items in map mode (page nodes) */
        body.map-mode .items {
            margin: 0 !important;
            height: auto !important;
            min-height: 50px !important;
            max-height: 800px !important;
            user-select: text !important;
            /* Additional properties to help with cross-element selection */
            -webkit-user-drag: none;
            -moz-user-drag: none;
            /* Reset page styling in map mode */
            background: white !important;
            padding: 0 !important;
        }

        /* No page styling in iframes */
        body.in-iframe .items {
            background: white !important;
            padding: 0 !important;
        }

        body.in-iframe .a4-page {
            display: contents; /* Removes the wrapper, keeps children */
        }
        
        /* Force text selection to work across item boundaries */
        .items * {
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            user-select: text !important;
        }
        
        /* Try to make items behave more like continuous text */
        .items .item-text {
            /* Make text elements flow more naturally for selection */
            contain: none !important;
        }
        
        /* Override any elements that specifically disable selection */
        .items .item-checkbox,
        .items .item-drag-handle,
        .items .item-actions,
        .items .btn {
            -webkit-user-select: none !important;
            -moz-user-select: none !important;
            user-select: none !important;
        }
        
        /* Add smooth transitions for item repositioning */
        .items > * {
            transition: transform 0.15s ease-out;
            will-change: auto; /* Changed from transform to auto for better performance */
        }
        
        /* Optimize the items container for frequent DOM changes */
        .items {
            contain: layout style; /* Isolate layout calculations */
        }
        
        
        .move-notepad-list-loading {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 40px 20px;
            color: var(--text-secondary);
        }
        
        .move-notepad-list-loading .loading-spinner {
            margin-right: 10px;
        }
        
        /* Mobile Trackpad Styles */
        .mobile-trackpad {
            display: none; /* Hidden by default - will be shown on mobile only */
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 120px;
            background: transparent;
            border-top: 0.4px solid rgba(139, 105, 20, 0.2);
            z-index: 1000;
            user-select: none;
            touch-action: none; /* Prevent default touch behaviors */
            transition: transform 0.3s ease;
            -webkit-user-select: none;
            -webkit-touch-callout: none;
            -webkit-tap-highlight-color: transparent;
        }
        
        .trackpad-surface {
            width: 100%;
            height: 100%;
            position: relative;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(15px) saturate(180%);
            border-radius: 0;
            border-top: 1px solid rgba(255, 255, 255, 0.3);
            overflow: hidden;
            background-image: radial-gradient(circle at center, rgb(219 172 60) 1.5px, transparent 1.5px);
            background-size: 25px 25px;
            background-position: center 3.5px;
            box-shadow: 
                inset 0 1px 3px rgba(255,255,255,0.3),
                inset 0 -1px 3px rgba(0,0,0,0.2),
                0 4px 12px rgba(0,0,0,0.25),
                0 0 0 0.5px rgba(255,255,255,0.1);
        }
        
        
        .trackpad-gesture-text {
            position: absolute;
            bottom: 8px;
            left: 50%;
            transform: translateX(-50%);
            color: var(--text-secondary);
            font-size: 11px;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            opacity: 0;
            transition: opacity 0.2s ease;
            pointer-events: none;
        }
        
        .trackpad-gesture-text.show {
            opacity: 0.8;
        }
        
       
        
        /* CRITICAL: Hide mobile elements in iframes - must come AFTER mobile media queries */
        @media screen {
            body.in-iframe .mobile-trackpad,
            body.in-iframe #mobileTrackpad,
            body.in-iframe .stats {
                display: none !important;
                visibility: hidden !important;
                opacity: 0 !important;
                height: 0 !important;
                width: 0 !important;
                overflow: hidden !important;
                position: absolute !important;
                left: -9999px !important;
                top: -9999px !important;
                z-index: -1 !important;
            }
        }
        
       
        
        .item {
            padding: 1px 0 1px 5px;
            border-bottom: 1px solid transparent;
            border-top: 1px solid transparent;
            border-left: 3px solid transparent; /* Keep border structure but make invisible */
            border-radius: 3px;
            display: flex;
            align-items: center;
            transition: all 0.2s, transform 0.3s ease-out;
            cursor: text; /* Text cursor for text selection */
            position: relative; /* Ensure proper positioning context */
            line-height: 1.8;
            /* Enable text selection across items */
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
            /* Improve cross-item text selection */
            -webkit-touch-callout: default;
            -webkit-tap-highlight-color: transparent;
            /* Try to make selection span across items */
            isolation: auto;
           
        }
        
        /* Auto-save draft status indicators */
        .item.draft-saving {
            border-left: 3px solid #ffa726; /* Orange for draft saving */
        }
        
        .item.draft-saved {
            border-left: 3px solid #4caf50; /* Green for successfully saved */
        }
        
        .item.draft-error {
            border-left: 3px solid #f44336; /* Red for save error */
        }
        
        .item.draft-saving::after {
            content: "💾";
            position: absolute;
            right: 5px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            opacity: 0.7;
        }
        
        .item.draft-saved::after {
            content: "✓";
            position: absolute;
            right: 5px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            color: #4caf50;
            opacity: 0.8;
        }
        
        .item.draft-error::after {
            content: "⚠";
            position: absolute;
            right: 5px;
            top: 50%;
            transform: translateY(-50%);
            font-size: 12px;
            color: #f44336;
            opacity: 0.8;
        }
        
        /* Zebra pattern disabled */
        /*
        .item:nth-child(even):not(.selected):not(.drag-ready):not(.highlight-found):not(.divider-item):not(.list-group-header) {
            background: rgba(139, 105, 20, 0.03);
        }
        
        .inline-input-container:nth-child(even) {
            background: rgba(139, 105, 20, 0.03);
        }
        */
        
        /* Grey sidebar on hover with fade in and out */
        .item:not(.selected):not(.drag-ready):not(.list-group-header):not(.divider-item) {
            border-left: 3px solid transparent !important; /* Keep border structure but invisible */
            padding-left: calc(var(--item-padding-left, 8px) - 3px);
            /* transition: border-left-color 0.2s ease-in-out; */ /* Removed border transition */
            position: relative;
        }
        
        .item:hover:not(.selected):not(.drag-ready):not(.list-group-header):not(.divider-item):not(.document-item) {
            /* border-left-color: #888; */ /* Temporarily disabled */
        }

        /* Hide empty line placeholders (¶ symbols) */
        .empty-line-placeholder {
            color: transparent;
            background: transparent;
            height: 1.2em; /* Maintain line height */
            display: inline-block;
            line-height: 1.2em;
            min-width: 10px; /* Ensure selectable area */
            cursor: default;
        }

        /* Left drag handle for list view items - Styled to match arrow buttons */
        .item-drag-handle {
            position: absolute;
            left: -14px;
            top: 50%;
            transform: translateY(-50%);
            width: 8px;
            height: 14px;
            background: rgba(0, 255, 0, 0.05);
            border: 0.5px solid rgb(210 240 210 / 55%);
            border-radius: 2px;
            cursor: move;
            opacity: 0.7;
            transition: all 0.2s ease;
            z-index: 15;
            display: none;
            align-items: center;
            justify-content: center;
            font-size: 6px;
            color: rgba(100, 200, 100, 0.9);
            pointer-events: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        .item-drag-handle::before {
            content: '⠿';
            font-size: 8px;
            line-height: 1;
            font-weight: normal;
        }

        /* Create invisible hover zones for controls */
        .item::before {
            content: '';
            position: absolute;
            left: -60px;
            top: 0;
            bottom: 0;
            width: 60px;
            z-index: 5;
            pointer-events: auto;
        }

        /* Show handle on item hover OR when hovering over left margin area */
        .note-item:hover .item-drag-handle,
        .document-item:hover .item-drag-handle,
        .task-item:hover .item-drag-handle,
        .header-item:hover .item-drag-handle {
            display: flex;
            pointer-events: auto;
        }

        /* Generic .item and .list-line hover - for page node items */
        .item:hover .item-drag-handle,
        .list-line:hover .item-drag-handle {
            display: flex;
            pointer-events: auto;
        }


        /* Specific rule for group headers with higher specificity */
        .list-group-header:hover .item-drag-handle {
            display: flex !important;
            pointer-events: auto !important;
        }

        /* Hover effects removed for cleaner appearance */

        /* Significantly extend hover area to make handles easier to reach */
        .item-drag-handle::after {
            content: '';
            position: absolute;
            left: -8px;
            right: -6px;
            top: -8px;
            bottom: -8px;
            z-index: -1;
        }

        /* Active/dragging state */
        .item-drag-handle:active {
            cursor: grabbing !important;
            background: rgba(0, 255, 0, 0.2) !important;
            transform: translateY(-50%) scale(1.2);
        }

        /* Enhanced visual feedback when dragging from drag handle */
        .item.handle-dragging {
            border-left: 4px solid rgb(210 240 210 / 85%) !important;
            transform: translateX(3px) rotate(1deg);
            box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.3);
            opacity: 0.9;
            background: rgba(255, 255, 255, 0.05) !important;
            z-index: 1000;
            position: relative;
        }

        .item.handle-dragging .item-drag-handle {
            opacity: 1 !important;
            background: rgba(0, 255, 0, 0.25) !important;
            transform: translateY(-50%) scale(1.3);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
        }
        
        /* Show a subtle glow when drag handle is ready */
        .item:hover .item-drag-handle::before {
            text-shadow: 0 0 4px rgba(0, 255, 0, 0.3);
        }
        
        /* Visual cue when hovering in the expanded drag area */
        .item.drag-area-hover {
            border-left: 2px solid rgb(210 240 210 / 55%);
            transition: border-left 0.2s ease;
        }
        
        .item.drag-area-hover .item-drag-handle {
            opacity: 0.9 !important;
            pointer-events: auto;
            background: rgba(0, 255, 0, 0.1);
        }
        
        /* Disable dragging when editing to allow text selection */
        .item.editing {
            -webkit-user-drag: none;
            -khtml-user-drag: none;
            -moz-user-drag: none;
            -o-user-drag: none;
            user-drag: none;
            /* Enable text selection in edit mode */
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
            cursor: text !important;
        }
        
        /* Keep drag handles in place but make them invisible/disabled when editing */
        .item.editing:not(.character-selected):not(.text-highlighted) .item-drag-handle,
        .item.editing:not(.character-selected):not(.text-highlighted) .item-arrows {
            visibility: hidden !important; /* Hide but keep space */
            pointer-events: none !important; /* Disable interactions */
        }

        /* Show drag handles for highlighted items */
        .item.character-selected:hover .item-drag-handle,
        .item.text-highlighted:hover .item-drag-handle {
            display: flex !important;
            pointer-events: auto !important;
        }

        /* Disable transitions during highlighting to prevent visual shifts */
        .item.text-highlighted,
        .item.text-highlighted * {
            transition: none !important;
        }
        
        /* Divider items styling - excluded from zebra pattern and with equal top/bottom padding */
        .item.divider-item {
            background: transparent !important; /* Always transparent, no zebra pattern */
            padding: 10px 0; /* Equal top and bottom padding */
        }
        
        /* Disable transition for inline comments when editing to prevent sliding */
        .item.inline-comment.editing {
            transition: none !important;
        }
        
        /* List Group Styles - matching map view appearance */
        .list-group-wrapper {
            /* Wrapper to contain header and container without gaps */
            display: block;
            margin-bottom: 8px;
        }
        
        .list-group-wrapper {
            border-top: 1px solid transparent;
            border-bottom: 1px solid transparent;
        }
        
        .list-group-wrapper.drag-over-top {
            border-top-color: rgba(139, 105, 20, 0.6);
            animation: drag-pulse 1.2s ease-in-out infinite alternate;
        }
        
        .list-group-wrapper.drag-over-bottom {
            border-bottom-color: rgba(139, 105, 20, 0.6);
            animation: drag-pulse 1.2s ease-in-out infinite alternate;
        }
        
        /* Enhanced group container feedback when dragging within the group */
        .list-group-container.drag-within {
            background: rgba(139, 105, 20, 0.1);
            border-radius: 8px;
            box-shadow: inset 0 0 0 3px rgba(139, 105, 20, 0.3);
            min-height: 60px;
        }
        
        .list-group-header {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            padding: 6px 12px;
            background: transparent;
            border: none;
            border-radius: 0;
            margin: 8px 0 0 0;
            cursor: move;
            user-select: none;
            transition: background-color 0.2s ease;
            position: relative;
            height: 30px;
            font-size: 14px;
            font-weight: 500;
            color: #333;
        }
        
        /* Disabled hover effect on group headers */
        /* .list-group-header:hover {
            background: rgba(255, 140, 0, 0.1);
        } */
        
        .list-group-header .group-title {
            font-weight: 500;
            color: rgb(32 32 32 / 97%);
            text-align: center;
            flex: 0 0 auto;
            cursor: text;
        }
        
        .list-group-header .group-collapse-area {
            flex: 1;
            cursor: pointer;
            min-width: 20px;
        }
        
        .list-group-header .group-toggle-arrow {
            font-size: 10px;
            color: rgb(32 32 32 / 97%);
            opacity: 0.4;
            transition: transform 0.2s ease;
            margin-right: 8px;
            cursor: pointer;
            user-select: none;
        }
        
        .list-group-header.collapsed .group-toggle-arrow {
            transform: rotate(0deg);
        }
        
        .list-group-header.collapsed {
        }
        
        .list-group-container {
            border: none;
            background: transparent;
            border-radius: 0 0 6px 6px;
            padding: 8px;
            margin-bottom: 8px;
            min-height: 40px; /* Ensure it's always droppable even when empty */
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: visible;
            position: relative;
            padding-top: 0;
            margin-left: 12px !important;
        }
        
        .list-group-container:empty::after {
            content: 'Drop items here';
            color: #888;
            font-style: italic;
            opacity: 0.7;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 14px;
        }
        
        .list-group-container.drag-within:empty::after {
            content: '↓ Drop items here';
            color: rgba(139, 105, 20, 0.8);
            font-weight: 500;
            opacity: 1;
        }
        
        
        .list-group-container.collapsed {
            max-height: 0;
            opacity: 0;
            margin-bottom: 8px;
            padding: 0;
            min-height: 0;
            border: none;
        }
        
        .list-group-container .grouped-item {
            margin: 3px 0;
            transform: translateY(0);
            transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
            /* Remove special styling - let items look the same as regular list items */
        }
        
        .list-group-container.collapsed .grouped-item {
            transform: translateY(-10px);
            opacity: 0;
        }

        .list-group-container .grouped-item:first-child {
            margin-top: 4px;
        }
        
        .list-group-container .grouped-item:last-child {
            margin-bottom: 4px;
        }
        
        /* Group dragging styles - matching map view */
        .list-group-header.dragging,
        .list-group-container.dragging {
            opacity: 0.6;
            transform: scale(0.98) rotate(1deg);
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        }
        
        .list-group-container.dragging .grouped-item {
            opacity: 0.8;
        }
        
        /* Removed hover effects - items don't change appearance on hover
        .item:hover {
            background: rgba(0, 255, 0, 0.05);
            padding-left: 5px;
        }
        */
        
        /* Preserve hover animation during edit mode */
        /* Removed edit mode styling - items look the same when editing
        .item.editing {
            background: rgba(0, 255, 0, 0.05);
            padding-left: 5px;
        }
        */
        
        .item.dragging {
            opacity: 0.5;
        }
        
        /* Enhanced mobile reorder visual feedback */
        .reorder-mode .item {
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }
        
        .reorder-mode .item.reorder-dragging {
            opacity: 0.8;
            transform: scale(1.02);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            background: var(--bg-primary);
        }
        
        .reorder-drop-indicator {
            height: 4px;
            background: #3498db;
            border-radius: 2px;
            margin: 2px 0;
            animation: pulse 1s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 0.6; }
            50% { opacity: 1; }
        }

        .item.drag-ready {
            background: rgba(255, 0, 0, 0.2) !important;
            border: 2px solid red !important;
            box-shadow: 0 2px 8px rgba(255,0,0,0.4) !important;
        }
        
        .item.drag-over.drag-over-top {
            border-top-color: rgba(139, 105, 20, 0.6);
            animation: drag-pulse 1.2s ease-in-out infinite alternate;
        }
        
        .item.drag-over.drag-over-bottom {
            border-bottom-color: rgba(139, 105, 20, 0.6);
            animation: drag-pulse 1.2s ease-in-out infinite alternate;
        }
        
        @keyframes drag-pulse {
            0% {
                opacity: 0.7;
            }
            100% {
                opacity: 1;
            }
        }
        
        .item.selected {
            background-color: color-mix(in srgb, var(--text-accent) 10%, transparent);
            border-left: 3px solid var(--text-accent);
            padding-left: 2px;
        }

        /* List view selected items */
        .list-line.selected {
            background-color: color-mix(in srgb, var(--text-accent) 15%, transparent);
            border-left: 3px solid var(--text-accent);
            border-radius: 3px;
        }

        /* Prevent comment items from shifting when selected or editing - keep exact same position */
        .item.inline-comment,
        .item.inline-comment.selected,
        .item.inline-comment.editing {
            padding-left: 0 !important;
            margin-left: 5px !important; /* Keep consistent left margin */
            box-sizing: border-box !important;
        }
        
        .selection-count {
            position: fixed;
            bottom: 10px;
            right: 125px;
            background: var(--tooltip-bg);
            color: var(--bg-primary);
            padding: 4px 8px;
            border-radius: 6px;
            border: 1px solid var(--border-primary);
            font-size: 12px;
            z-index: 1000;
            display: none !important; /* Hide the visual count but keep functionality */
        }
        
        .selection-count.visible {
            display: none !important; /* Never show the count message */
        }
        
        /* Mobile reorder mode styles */
        .reorder-mode .item.reorder-enabled {
            border-left: 3px solid var(--text-accent);
            background: color-mix(in srgb, var(--text-accent) 10%, transparent);
            cursor: grab;
            touch-action: none;
        }
        
        .reorder-mode .item.reorder-enabled::before {
            content: "⋮⋮";
            position: absolute;
            left: 8px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-accent);
            font-weight: bold;
            font-size: 16px;
            line-height: 0.8;
        }
        
        .reorder-mode .item.reorder-enabled .item-text {
            padding-left: 35px;
        }
        
        .reorder-mode .item.reorder-dragging {
            opacity: 0.8;
            transform-origin: center;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
            background: color-mix(in srgb, var(--text-accent) 20%, transparent) !important;
            border: 0.4px solid var(--text-accent);
            cursor: grabbing;
            z-index: 1000;
        }
        
        .reorder-drop-indicator {
            height: 4px;
            background: var(--text-accent);
            margin: 4px 0;
            border-radius: 2px;
            opacity: 1;
            pointer-events: none;
            box-shadow: 0 0 10px rgba(255, 107, 53, 0.5);
            animation: pulse 0.5s ease-in-out infinite;
        }
        
        /* Visual feedback for quote-comment pairs */
        .quote-comment-pair {
            position: relative;
        }
        
        .quote-comment-pair::before {
            content: '';
            position: absolute;
            left: -12px;
            top: 0;
            bottom: 0;
            width: 3px;
            background: var(--progress-bar);
            border-radius: 2px;
        }
        
        .quote-comment-pair.quote-part::before {
            border-top-left-radius: 2px;
            border-top-right-radius: 2px;
            border-bottom-left-radius: 0;
            border-bottom-right-radius: 0;
            bottom: -2px; /* Extend more to blend seamlessly */
        }
        
        .quote-comment-pair.comment-part::before {
            border-top-left-radius: 0;
            border-top-right-radius: 0;
            border-bottom-left-radius: 2px;
            border-bottom-right-radius: 2px;
            top: -2px; /* Extend more to blend seamlessly */
        }
        
        
        /* Remove all borders between quote and comment in pairs */
        .quote-comment-pair.quote-part,
        .item.quote-comment-pair.quote-part,
        .note-item.quote-comment-pair.quote-part {
            border-bottom: none !important;
            border-bottom-width: 0 !important;
            border-bottom-style: none !important;
            border-bottom-color: transparent !important;
        }
        
        @keyframes pulse {
            0% { opacity: 1; transform: scaleX(1); }
            50% { opacity: 0.8; transform: scaleX(0.95); }
            100% { opacity: 1; transform: scaleX(1); }
        }
        
        @keyframes drag-pulse {
            0% { opacity: 0.8; transform: scaleX(0.98); }
            100% { opacity: 1; transform: scaleX(1.02); }
        }
        
        /* Confetti animation styles - party popper effect */
        .confetti-container {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 999999;
            overflow: visible;
        }
        
        .confetti {
            position: absolute;
            width: 8px;
            height: 12px;
            border-radius: 2px;
            transform-origin: center bottom;
        }
        
        .confetti.square {
            width: 8px;
            height: 8px;
        }
        
        .confetti.strip {
            width: 4px;
            height: 16px;
        }
        
        .confetti.color-1 { background: #ffb3d9; } /* Light pink */
        .confetti.color-2 { background: #dbb3ff; } /* Light purple */
        .confetti.color-3 { background: #b3ffb3; } /* Light green */
        .confetti.color-4 { background: #ffd4a3; } /* Light orange */
        .confetti.color-5 { background: #ffc0e5; } /* Pale pink */
        .confetti.color-6 { background: #e6ccff; } /* Pale purple */
        .confetti.color-7 { background: #ccffcc; } /* Pale green */
        .confetti.color-8 { background: #ffe0b3; } /* Pale orange */
        
        @keyframes confetti-pop {
            0% {
                transform: translate(0, 0) scale(0) rotate(0deg);
                opacity: 0;
            }
            10% {
                transform: translate(0, 0) scale(1) rotate(0deg);
                opacity: 1;
            }
            100% {
                transform: translate(var(--end-x), var(--end-y)) scale(0.5) rotate(720deg);
                opacity: 0;
            }
        }
        
        /* Enhanced dragging styles */
        .item.dragging {
            opacity: 0.6;
            transform: rotate(2deg) scale(1.02);
            transition: transform 0.1s ease-out;
            z-index: 1000;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
        }
        
        .reorder-mode #input {
            background: color-mix(in srgb, var(--text-accent) 10%, transparent);
            color: var(--text-accent);
            border-color: var(--text-accent);
        }
        
        .reorder-mode .terminal {
            border-color: var(--text-accent);
        }
        
        /* Keep mobile trackpad visible in reorder mode with special styling */
        .reorder-mode .mobile-trackpad {
            background: color-mix(in srgb, var(--text-accent) 15%, transparent);
            border-top: 0.4px solid var(--text-accent);
        }
        
        /* Auto-scroll zones visual feedback */
        .reorder-mode::before,
        .reorder-mode::after {
            content: '';
            position: fixed;
            left: 0;
            right: 0;
            height: 120px;
            pointer-events: none;
            z-index: 999;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        .reorder-mode::before {
            top: 0;
            background: linear-gradient(to bottom, 
                rgba(255, 107, 53, 0.3) 0%, 
                rgba(255, 107, 53, 0) 100%);
        }
        
        .reorder-mode::after {
            bottom: 0;
            background: linear-gradient(to top, 
                rgba(255, 107, 53, 0.3) 0%, 
                rgba(255, 107, 53, 0) 100%);
        }
        
        .reorder-mode.scrolling-up::before {
            opacity: 1;
        }
        
        .reorder-mode.scrolling-down::after {
            opacity: 1;
        }
        
        
        
        
        body.shift-select-mode .item {
            cursor: pointer !important;
        }

        body.shift-select-mode .item.task-item {
            cursor: pointer !important;
        }
        
        .completed-text {
            color: #9a9a9a; /* Light grey for completed tasks */
            text-decoration: line-through;
            text-decoration-thickness: 1px;
            opacity: 0.7;
        }
        
        .item-text {
            flex: 1;
            cursor: text !important; /* Changed from pointer to text for selection */
            word-break: break-word;
            text-align: justify;
            /* Enable text selection */
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
        }
        
        /* Bullet point hanging indent for proper text alignment */
        .item-text span[data-bullet="true"] {
            text-indent: -1.2em;
            padding-left: 1.2em;
            display: block;
        }
        
        /* Preserve bullet alignment when contenteditable */
        .item-text span[data-bullet="true"].edit-input[contenteditable="true"] {
            text-indent: -1.2em !important;
            padding-left: 1.2em !important;
            display: block !important;
        }
        
        
        
        
        /* Ensure empty items have proper height */
        .item-text:empty {
            min-height: 1.4em; /* Match the line-height of text items */
            display: block;
        }
        
        /* Header items need normal line height */
        .header-item .item-text {
            line-height: 1.2;
        }
        
        /* Text spans for better line height control */
        .app-comment-text {
            line-height: 1.8;
            display: inline;
            padding-left: 12px !important; /* Even closer to arrow */
        }
        
        /* Apply same padding to app-note-text when it's in a comment item */
        .item.inline-comment .app-note-text {
            padding-left: 12px !important; /* Even closer to arrow */
        }
        
        /* Force comment text spacing - maintain exact same position in all states */
        .item.inline-comment .app-comment-text,
        .item.inline-comment .app-note-text, /* Comments use app-note-text class */
        .item.inline-comment .item-text,
        .item.inline-comment.selected .app-comment-text,
        .item.inline-comment.selected .app-note-text, /* Comments use app-note-text class */
        .item.inline-comment.selected .item-text,
        .item.inline-comment.editing .app-comment-text,
        .item.inline-comment.editing .app-note-text, /* Comments use app-note-text class */
        .item.inline-comment.editing .item-text,
        .item.inline-comment.editing .edit-input,
        .item.inline-comment.editing .edit-textarea,
        .inline-comment .comment-text {
            padding-left: 12px !important; /* Even closer to arrow */
            margin-left: 0 !important;
        }
        
        .app-task-text {
            line-height: 1.8;
            display: inline;
        }
        
        .app-note-text {
            line-height: 1.8;
            display: inline;
        }
        
        .app-doc-text {
            line-height: 1.8;
            display: inline;
        }
        
        .item-actions {
            display: flex;
            gap: 10px;
            opacity: 0.3;
            transition: opacity 0.2s;
        }
        
        .item:hover .item-actions {
            opacity: 1;
        }
        
        /* Preserve item-actions visibility during edit mode */
        .item.editing .item-actions {
            opacity: 1;
        }
        
        
        
        /* Reset desktop item actions to default positioning */
        @media (min-width: 601px) {
            .item:not(.read-only) .item-actions {
                position: static !important;
                right: auto !important;
                top: auto !important;
                transform: none !important;
                width: auto !important;
                height: auto !important;
                justify-content: flex-start;
                gap: 10px;
                padding-right: 0;
                opacity: 0.3;
                transition: opacity 0.2s;
            }
            
            .item:hover:not(.read-only) .item-actions {
                opacity: 1;
            }
            
            /* Preserve mobile item-actions visibility during edit mode */
            .item.editing:not(.read-only) .item-actions {
                opacity: 1;
            }
            
            .item:not(.read-only) .item-actions .btn {
                background: none;
                border: none;
                color: var(--text-secondary);
                font-size: 11px;
                padding: 12px 0;
                overflow: hidden;
                cursor: pointer !important;
                font-family: inherit;
                transition: all 0.2s ease;
            }
            
            .item:not(.read-only) .item-actions .btn:hover {
                color: #8b4513;
                text-decoration: underline;
            }
        }
        
        .item.read-only {
            opacity: 0.7;
            cursor: default;
        }
        
        .item.read-only:hover {
            background: rgba(0, 255, 0, 0.02);
            padding-left: 0;
        }
        
        .item.read-only .item-text {
            cursor: default;
        }
        
        .remember-me-container {
            display: none;
            margin-top: 8px;
            margin-left: 20px;
            font-size: 12px;
            color: var(--text-hover);
        }
        
        .remember-me-container.visible {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .remember-checkbox {
            width: 16px;
            height: 16px;
            background: transparent;
            border: 1px solid var(--border-primary);
            cursor: pointer !important;
            position: relative;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            flex-shrink: 0;
            margin: 0;
            vertical-align: middle;
        }
        
        .remember-checkbox:checked::after {
            content: '✓';
            position: absolute;
            top: -2px;
            left: 2px;
            color: var(--text-secondary);
            font-size: 12px;
        }
        
        .remember-checkbox:hover {
            background: rgba(0, 255, 0, 0.1);
        }
        
        .remember-label {
            cursor: pointer !important;
            user-select: none;
        }
        
        
        .btn {
            background: none;
            border: none;
            color: var(--text-secondary);
            cursor: pointer !important;
            font-family: inherit;
            font-size: 12px;
            padding: 2px 5px;
            transition: all 0.2s;
        }
        
        .btn:hover {
            background: var(--text-secondary);
            color: var(--text-dark);
        }
        
        .move-btn {
            color: var(--warning) !important;
            border: 1px solid var(--text-accent);
            padding: 2px 8px;
        }
        
        .move-btn:hover {
            background: #ff6b35 !important;
            color: #2f1b14 !important;
        }
        
        .move-actions {
            text-decoration: none !important;
        }
        
        .bottom-stats {
            position: fixed;
            bottom: 0;
            left: 0;
            font-size: 13px !important;
            right: 0;
            height: 28px; /* Reduced from 35px */
            color: var(--text-dark);
            padding: 0 5px;
            
            /* Liquid Glass Effect */
            background: linear-gradient(
                135deg,
                rgba(255, 255, 255, 0.1) 0%,
                rgba(255, 255, 255, 0.05) 40%,
                rgba(255, 255, 255, 0.02) 100%
            );
            backdrop-filter: blur(10px) saturate(150%);
            -webkit-backdrop-filter: blur(10px) saturate(150%);
            /* filter: url(#liquid-glass-filter); Disabled for performance */
            
            /* Glass-like border and shadows */
            border: 0.5px solid rgba(255, 255, 255, 0.18);
            box-shadow: 
                inset 0 1px 2px rgba(255, 255, 255, 0.3),
                inset 0 -1px 2px rgba(0, 0, 0, 0.1),
                0 -2px 10px rgba(0, 0, 0, 0.05),
                0 -1px 3px rgba(255, 255, 255, 0.2);
            
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 2000;
            transition: right 0.3s ease, background 0.3s ease;
            line-height: 1.2;
            outline: none;
            user-select: none;
            margin-right: 0.5px;
        }

        /* Border-top only for warm theme */
        :root:not([data-theme="ocean"]) .bottom-stats {
            /* border-top: 1px solid #605c5c45; */
        }
        
        .terminal.with-calendar .bottom-stats {
            left: 0;
            right: 21.45%; /* Slide with calendar - match calendar width */
        }

        /* Desktop only: Enhanced liquid glass effect */
        @media (min-width: 769px) {
            .bottom-stats {
                /* Enhanced glass effect for desktop */
                background: linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.12) 0%,
                    rgba(255, 255, 255, 0.07) 30%,
                    rgba(255, 255, 255, 0.03) 60%,
                    rgba(255, 255, 255, 0.01) 100%
                );
           
                -webkit-backdrop-filter: blur(12px) saturate(180%) brightness(1.05);
                border-top: 0.5px solid rgba(255, 255, 255, 0.25);
            }
            
            /* .input-line {
                background: transparent;
                backdrop-filter: blur(5px);
            } */
        }
        
        .footer-stats {
            display: flex;
            gap: 15px;
            border-left: 0.5px solid rgb(210 240 210 / 55%);
            padding-left: 15px;
            padding-right: 5px;
            align-items: center;
        }
        
        .zoom-slider-container {
            display: flex;
            align-items: center;
            gap: 8px;
            border-left: 0.5px solid rgb(210 240 210 / 55%);
            padding-left: 15px;
            opacity: 0.7;
            transition: opacity 0.2s ease;
        }
        
        .zoom-slider-container:hover {
            opacity: 1;
        }
        
        .zoom-label {
            font-size: 11px;
            color: #a5d9a3;
            min-width: 35px;
            text-align: right;
            font-weight: bold;
        }
        
        .zoom-slider-wrapper {
            position: relative;
            width: 80px;
            height: 12px;
            display: flex;
            align-items: center;
        }
        
        .zoom-slider {
            width: 100%;
            height: 3px;
            -webkit-appearance: none;
            appearance: none;
            background: rgba(165, 217, 163, 0.2);
            outline: none;
            border-radius: 2px;
            cursor: pointer;
            position: relative;
            z-index: 2;
        }
        
        .zoom-notches {
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 8px;
            transform: translateY(-50%);
            display: flex;
            justify-content: space-between;
            pointer-events: none;
            z-index: 1;
        }
        
        .zoom-notch {
            width: 1px;
            height: 8px;
            background: rgba(165, 217, 163, 0.4);
            position: relative;
        }
        
        .zoom-notch.major {
            height: 10px;
            background: rgba(165, 217, 163, 0.6);
        }
        
        .zoom-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #a5d9a3;
            cursor: pointer;
            transition: transform 0.2s ease;
        }
        
        .zoom-slider::-moz-range-thumb {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: #a5d9a3;
            cursor: pointer;
            border: none;
            transition: transform 0.2s ease;
        }
        
        .zoom-slider:hover::-webkit-slider-thumb {
            transform: scale(1.3);
        }
        
        .zoom-slider:hover::-moz-range-thumb {
            transform: scale(1.3);
        }
        
        .footer-notepads {
            flex: 1;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE and Edge */
            margin-right: 15px;
        }
        
        .footer-notepads::-webkit-scrollbar {
            display: none; /* Chrome, Safari and Opera */
        }
        
        #footerNotepads {
            display: flex;
            white-space: nowrap;
            align-items: center;
            padding-right: 20px;
          
            
        }

        .footer-notepad {
            cursor: pointer !important;
            padding: 2px 6px;
            border-radius: 3px;
            transition: opacity 0.3s ease;
            opacity: 0.7;
            color: var(--text-dark);
        }

        .footer-notepad.active {
            opacity: 1;
            font-weight: bold;
        }

        .footer-notepad:hover {
            opacity: 0.9;
        }
        
        .bottom-notepads {
            position: fixed;
            bottom: 0;
            left: 30px;
            height: 35px;
            font-size: 12px;
            color: var(--text-hover);
            display: flex;
            gap: 15px;
            align-items: center;
            transition: left 0.3s ease;
            z-index: 2;
            display: none;
        }
        
        .terminal.with-calendar .bottom-notepads {
            left: 30px;
        }
        
        .notepad-indicator {
            cursor: pointer !important;
            transition: color 0.8s ease-in-out;
        }
        
        .notepad-indicator:hover {
            color: var(--text-secondary);
        }
        
        .notepad-indicator.active {
            color: var(--text-secondary);
        }

        .bottom-footer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 35px;
            /* background: #ffffff; */
            z-index: 1;
        }
        
        .commands {
            position: fixed;
            top: 50px;
            right: 20px;
            backdrop-filter: blur(5px);
            -webkit-backdrop-filter: blur(5px);
            background: rgb(250, 255, 248);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 8px;
            padding: 15px;
            max-width: 400px;
            max-height: calc(100vh - 100px);
            overflow-y: auto;
            z-index: 1000;
            font-size: 12px;
            transition: right 0.3s ease;
        }
        
        /* Adjust position when calendar is visible */
        body.calendar-visible .commands {
            right: calc(21.45% + 20px);
        }
        
        /* Mobile: Adjust commands for smaller screens */
        @media screen and (max-width: 768px) {
            .commands {
                top: 10px !important;
                right: 10px !important;
                left: 10px !important;
                max-width: none !important;
                width: auto !important;
                max-height: 60vh !important;
                position: fixed !important;
            }
            
            body.calendar-visible .commands {
                right: 10px !important;
                left: 10px !important;
            }

            /* Webkit scrollbar styling for mobile */
            .commands::-webkit-scrollbar {
                width: 6px;
            }
            
            .commands::-webkit-scrollbar-track {
                background: transparent;
            }
            
            .commands::-webkit-scrollbar-thumb {
                background-color: rgba(139, 105, 20, 0.3);
                border-radius: 3px;
            }
            
            .commands-grid {
                padding-bottom: 20px; /* Add padding at bottom for better scrolling */
            }
            
            /* Add a fade indicator at bottom when scrollable */
            .commands::after {
                content: '';
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                height: 30px;
                background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
                pointer-events: none;
                opacity: 0;
                transition: opacity 0.3s;
            }
            
            .commands.has-overflow::after {
                opacity: 1;
            }
        }
        
        .commands h3 {
            font-size: 12px;
            margin-bottom: 10px;
            font-weight: 400;
        }
        
        .commands-header {
            cursor: pointer !important;
            user-select: none;
        }
        
        .commands-header:hover {
            color: var(--text-secondary);
        }
        
        .commands-arrow {
            display: inline-block;
            transition: transform 0.2s ease;
            transform: rotate(90deg); /* Default: pointing down when expanded */
        }
        
        .commands.collapsed .commands-arrow {
            transform: rotate(0deg); /* Collapsed: pointing right */
        }
        
        .commands-grid {
            transition: max-height 0.3s ease, opacity 0.2s ease;
            overflow: hidden;
            max-height: 500px; /* Set initial max-height for animation */
        }
        
        .commands.collapsed .commands-grid {
            max-height: 0;
            opacity: 0;
            pointer-events: none;
        }
        
        .cmd {
            margin: 2px 0;
            cursor: pointer !important;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            transition: background-color 0.2s ease;
            padding: 4px 8px;
            border-radius: 1px;
            line-height: 1.4;
        }
        
        .cmd:hover {
            background-color: rgba(139, 105, 20, 0.1);
        }
        
        .cmd:active {
            background-color: rgba(139, 105, 20, 0.2);
        }
        
        .cmd-key {
            color: var(--text-secondary);
            font-weight: 700;
        }
        
        .commands-grid {
            display: grid;
            grid-template-columns: auto auto;
            gap: 10px;
            margin-top: 10px;
            justify-content: start;
        }
        
        .stats {
            position: absolute;
            top: 30px;
            right: 30px;
            font-size: 12px;
            color: var(--text-hover);
            text-align: right;
            display:none;
        }
        
        
        .prompt.note-mode, #inline-prompt.note-mode {
            color: rgba(0, 150, 136, 0.9) !important;
            font-weight: normal !important;
        }
        
        .prompt.task-mode, #inline-prompt.task-mode {
            color: rgba(156, 39, 176, 0.9) !important;
            font-weight: normal !important;
        }
        
        .note-mode {
            color: var(--text-accent);
        }
        
        .task-mode {
            color: rgba(120, 60, 180, 0.9);
        }
        
        .note-item {
            color: rgb(32 32 32 / 97%);
        }
        
        .note-item .completed-text {
            color: #9a9a9a; /* Light grey for completed notes */
        }
        
        /* Locked/encrypted items styling */
        .item.encryption-transition {
            transition: color 0.8s ease-in-out !important;
        }
        
        .item.encryption-transition .item-text {
            transition: color 0.8s ease-in-out;
        }
        
        /* Prevent visual indicators from flashing during encryption transitions */
        .daily-indicator,
        .pin-indicator,
        .pixel-indicator,
        .share-indicator,
        .import-indicator,
        .lock-indicator,
        .notification-badge {
            transition: none !important;
            opacity: 0.8 !important; /* Force constant opacity */
        }
        
        /* Ensure daily indicators never inherit color changes from locked parents */
        .locked .daily-indicator,
        .encryption-transition .daily-indicator {
            opacity: 0.8 !important;
            filter: none !important;
        }
        
        /* Prevent flashing during DOM updates/re-renders */
        .folder-list {
            contain: layout style;
        }
        
        .daily-indicator {
            contain: layout style paint;
            will-change: auto; /* Prevent unnecessary composite layers */
            display: inline-block;
            margin-right: 6px;
            margin-bottom: 3px;
        }

        .daily-indicator.active svg {
            stroke: #FF6B35;
        }

        .daily-indicator.inactive svg {
            stroke: #9ca3af;
        }

        .daily-indicator.inactive:hover svg {
            stroke: #FF6B35;
        }

        .daily-indicator.active {
            filter: brightness(1.15) saturate(1.2);
        }

        .daily-indicator.inactive:hover,
        .daily-indicator.active:hover {
            filter: brightness(1.25) saturate(1.3);
        }

        .item.locked {
            opacity: 1;
            pointer-events: none;
            cursor: not-allowed;
        }
        
        .item.locked .item-text {
            color: #dc2626; /* Ensure text is reddish red */
        }
        
        .task-item {
            /* color: rgb(121 46 173 / 97%); */
            color: rgb(32 32 32 / 97%);
        }

        .header-item {
            color: rgb(32 32 32 / 97%);
            border-bottom: none;
            padding: 8px 0 8px 5px;
            font-weight: bold; /* Make headers bold in the sidebar */
            cursor: pointer !important;
            transition: background-color 0.2s;
            border-radius: 1px;
        }
        
        .header-item:hover {
            opacity: 0.8;
        }
        
        .header-item.insertion-selected {
            background: none !important;
            border: none !important;
        }

        .header-item.insertion-selected::before {
            content: '▶';
            color: var(--text-primary);
            font-size: 10px;
            margin-right: 8px;
            opacity: 0.8;
        }

        .header-item:first-child {
            margin-top: 0px;
            padding-top: 0px;
        }

        .header-item.selected {
            background-color: color-mix(in srgb, var(--text-accent) 20%, transparent);
            border-left: 3px solid var(--text-accent);
            padding-left: 5px;
        }

        .note-item.header-item em,
        .note-item .header-item em,
        .header-item em {
            color: rgba(75, 0, 130, 0.4) !important;
        }
        
        .task-item .completed-text {
            color: #9a9a9a; /* Light grey for completed tasks */
        }
        
        .item {
            position: relative;
        }
        
        /* Task checkbox styling */
        .task-checkbox {
            width: 14px;  /* Clickable area */
            height: 14px;
            background: transparent !important;
            cursor: pointer !important;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-right: 0;
            user-select: none;
            transition: all 0.2s ease;
            opacity: 0.3;
            align-self: flex-start;
            margin-top: 1.2px !important;
            position: relative;
            z-index: 1;
            border: none !important;
        }
        
        /* Create small circle with ::before */
        .task-checkbox::before {
            content: '';
            position: absolute;
            width: 7px;
            height: 7px;
            border: 1px solid rgb(32 32 32 / 97%);
            border-radius: 50%;
            background: transparent;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        
        .task-checkbox.completed {
            opacity: 1;
        }
        
        .task-checkbox.completed::before {
            border-color: #9a9a9a;
            opacity: 0.2;
        }
        
        /* Checkmark using inline SVG */
        .task-checkbox.completed::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(calc(-50% + 1px), calc(-50% - 2px));  /* Right 1px, Up 2px */
            width: 10px;  /* Slightly bigger */
            height: 10px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 127.11 189.08'%3E%3Cpolyline points='11 108.09 40.3 164.7 116.11 11' fill='none' stroke='%2370b870' stroke-linecap='round' stroke-miterlimit='10' stroke-width='22'/%3E%3C/svg%3E");
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            z-index: 2;
        }
        
        /* Green strikethrough for completed tasks */
        .task-line.completed .line-text,
        .task-item.completed .line-text,
        .list-line.task-line.completed .line-text {
            text-decoration: line-through !important;
            text-decoration-color: #70b870 !important;
            text-decoration-thickness: 1.5px !important;
        }
        
        /* List line alignment */
        .list-line {
            display: flex;
            align-items: flex-start;
            gap: 0;
            height: auto;
        }
        
        .list-line .line-text {
            flex: 1;
            line-height: 1.4;
            padding-top: 1px;
            text-wrap: auto;
            min-height: 100%;
            cursor: text;
        }

        /* Header line styling */
        .list-line.header-line {
            height: auto !important;
            min-height: 28px !important;
            margin: 16px 0 8px 0 !important;
            padding-top: 4px !important;
        }

        .list-line.header-line .line-text,
        .list-line.header-line .header-text {
            font-size: 15px !important;
            font-weight: 600 !important;
            color: var(--text-primary) !important;
            line-height: 1.3 !important;
            letter-spacing: 0.02em;
        }

        /* Divider line styling */
        .list-line.divider-line {
            min-height: 20px !important;
            margin: 4px 0 !important;
            padding: 0 !important;
            align-items: center !important;
        }

        .list-line.divider-line .list-divider-line {
            border: none;
            border-top: 0.5px solid rgba(0, 0, 0, 0.08);
            margin: 0;
            width: 100%;
            flex: 1;
        }

        .list-line.divider-line .item-drag-handle {
            top: 50%;
        }

        /* Text alignment classes */
        .list-line.align-left .line-text {
            text-align: left !important;
        }
        .list-line.align-center .line-text {
            text-align: center !important;
        }
        .list-line.align-right .line-text {
            text-align: right !important;
        }
        .list-line.align-justify .line-text {
            text-align: justify !important;
        }

        /* Preserve comment structure when editing */
        .list-line.inline-comment {
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: nowrap !important;
            align-items: flex-start !important;
        }

        .list-line.inline-comment .comment-arrow {
            flex-shrink: 0 !important;
            visibility: visible !important;
        }

        .list-line.inline-comment .line-text {
            flex: 1 !important;
            color: #e91e63 !important;
            -webkit-text-fill-color: #e91e63 !important;
        }

        .list-line.inline-comment .line-text:focus {
            outline: none !important;
        }
        
        /* Enable text selection in list view */
        .list-line .line-text {
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
            /* Smooth caret animations */
            caret-color: var(--text-primary);
        }

        /* Text formatting styles for list view */
        .list-line .line-text b,
        .list-line .line-text strong {
            font-weight: bold;
        }
        .list-line .line-text i,
        .list-line .line-text em {
            font-style: italic;
        }
        .list-line .line-text s,
        .list-line .line-text strike {
            text-decoration: line-through;
        }
        .list-line .line-text code {
            background: rgba(0, 0, 0, 0.1);
            padding: 2px 4px;
            border-radius: 3px;
            font-family: monospace;
        }
        .list-line .line-text a:not(.inline-link) {
            color: #2196F3;
            text-decoration: underline;
            cursor: pointer;
        }
        /* Highlight spans with background color */
        .list-line .line-text span[style*="background"] {
            padding: 1px 0;
            border-radius: 2px;
        }

        /* Inline clickable links in list view */
        .inline-link {
            color: #2196F3 !important;
            text-decoration: underline;
            cursor: pointer !important;
            word-break: break-all;
        }

        .inline-link:hover {
            color: #1976D2 !important;
            text-decoration: underline;
        }
        
        /* Map node task styling for inline layout */
        .map-node.task-node {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .map-node.task-node .task-checkbox {
            margin-right: 0;
            flex-shrink: 0; /* Prevent checkbox from shrinking */
        }
        
        /* Ensure task text respects node boundaries */
        .map-node.task-node span {
            word-wrap: break-word;
            word-break: break-word;
            overflow-wrap: break-word;
            hyphens: auto;
            min-width: 0; /* Allow flex item to shrink below content size */
            flex: 1; /* Take remaining space */
            max-width: 100%; /* Don't exceed container */
        }

        /* Drawing node specific styles */
        .map-node.drawing-node {
            position: relative;
            display: block;
            cursor: pointer;
            overflow: hidden;
            padding: 0;
            border: 2px solid #ddd;
            border-radius: 6px;
            background: white;
            min-width: unset !important;
            max-width: unset !important;
            width: auto !important;
            height: auto !important;
        }
        
        .map-node.drawing-node:hover {
            border-color: #007acc;
            box-shadow: none;
        }
        
        
        .task-checkbox:hover {
            border-color: rgb(32 32 32 / 97%);
            transform: scale(1.05);
            opacity: 1;
        }
        
        /* IMPROVED: Align checkboxes with first line of text */
        .item.task-item {
            display: flex;
            align-items: flex-start; /* Align to top instead of center */
            gap: 9px;
        }
        
        .item.task-item .task-checkbox {
            margin-top: 0.6em; /* Fine-tuned positioning for better center alignment */
            flex-shrink: 0;
        }
        
        /* SPECIAL: Adjust for newly created items with proper alignment for both mobile and desktop */
        .item.task-item.temp-item-positioning .task-checkbox {
            margin-top: 0.6em; /* Match regular items for consistent alignment */
        }
        
        /* Mobile: temp items in swipe wrapper - same alignment as regular items */
        .item.temp-item-positioning .item-swipe-wrapper .task-checkbox {
            margin-top: 0.6em; /* Center with first line of text - same as regular items */
            flex-shrink: 0;
        }
        
        /* Ensure temp items use same flex layout as regular items */
        .item.temp-item-positioning.task-item {
            display: flex;
            align-items: flex-start; /* Align to top instead of center */
            gap: 8px;
            margin-bottom: 5px; /* Add spacing to match normal tasks */
        }
        
        .item.temp-item-positioning.note-item {
            margin-bottom: 1px; /* Tighter spacing for notes */
        }
        
        /* Mobile swipe wrapper for temp items should match regular item structure */
        .item.temp-item-positioning .item-swipe-wrapper {
            display: flex;
            align-items: flex-start; /* Align to top instead of center */
            gap: 8px;
        }
        
      
        
        .item.task-item .item-text {
            flex: 1;
            line-height: 1.4; /* Ensure consistent line height */
        }
        
        /* Maintain backward compatibility for any remaining .text spans */
        .item.task-item .text {
            flex: 1;
            line-height: 1.4; /* Ensure consistent line height */
        }
        
        /* Fix checkbox alignment in mobile swipe wrapper */
        .item-swipe-wrapper {
            display: flex;
            align-items: flex-start; /* Align to top instead of center */
            gap: 8px;
        }
        
        .item-swipe-wrapper .task-checkbox {
            margin-top: 0.6em; /* Center with first line of text */
            margin-right: 0;
            flex-shrink: 0;
        }
        
        /* Inline input styling */
        .inline-input-container {
            margin: 0;
            padding: 1px 5px 1px 5px; /* Match .item padding exactly */
            background: transparent; /* Default transparent background */
            border-left: 3px solid transparent !important; /* Keep border structure but invisible */
            border-radius: 3px 0 0 3px; /* Remove right side border radius */
            margin-right: 0;
            line-height: 1.8; /* Match .item container line-height */
            transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth position sliding only, no border transition */
            position: relative; /* Enable transforms */
        }
        
        .inline-input-container input,
        .inline-input-container textarea {
            line-height: 1.8; /* Default line-height for notes and most items */
            font-family: inherit; /* Use same font as items */
            font-size: 12.8px; /* Match body font size exactly */
            font-weight: inherit; /* Use same font weight as items */
            margin: 0; /* Remove default browser margins */
            padding: 0; /* Remove default browser padding */
            border: none; /* Remove default border */
            background: transparent; /* Transparent background */
            outline: none; /* Remove focus outline */
            resize: none; /* Prevent manual resizing */
            vertical-align: top; /* Align to top to prevent baseline shifts */
        }

        /* Inline input container zebra pattern now handled above with items */
        
        .inline-input-container.task-mode {
            /* border-left-color: transparent !important; */ /* Removed since no border exists */
        }
        
        /* Hide color sidebar when not focused - more specific to override mode styles */
        /* Unified system - no separate inline input container styles needed */
        
        /* Use unified list-line structure for all task inputs - no separate inline input styles needed */
        .list-line.task-line.item,
        .item.task-item {
            gap: 9px !important;
            padding: 1px 0 1px 5px !important; /* Match .item class padding exactly */
            margin-left: 0 !important;
            display: flex !important;
            align-items: flex-start !important;
        }
        
        /* Styles specifically for pasted task items */
        .list-line.task-line.pasted-item {
            gap: 0px !important;
        }
        
        .list-line.task-line.pasted-item .task-checkbox {
            width: 14px !important;
            height: 14px !important;
            margin-left: 0;
            margin-right: 8px;
            margin-top: 0.6em; /* Match saved tasks exactly */
            flex-shrink: 0;
            border: 1px solid rgb(32 32 32 / 97%) !important;
            border-radius: 3px !important;
            opacity: 1 !important;
        }
        
        .list-line.task-line.pasted-item .task-checkbox.completed {
            opacity: 1 !important;
        }
        
        .inline-input-container.task-mode .textarea-wrapper {
            flex: 1;
            display: flex;
        }
        
        .inline-input-container.task-mode textarea {
            margin-top: 0; /* Remove extra margin to align with checkbox */
            flex: 1; /* Ensure textarea takes up remaining space */
            min-width: 0; /* Allow shrinking */
            width: 100%; /* Force full width */
        }
        
        .inline-input-container.note-mode {
            /* border-left-color: transparent !important; */ /* Removed since no border exists */
        }
        
        .inline-input-container.note-mode textarea {
            margin-left: -3.5px; /* Move text right by 3px from previous position */
            margin-top: 0; /* Remove any extra margin that causes text shift */
            line-height: 1.8; /* Match saved note items exactly */
        }
        
        .inline-input-container.comment-mode {
            /* border-left-color: transparent !important; */ /* Removed since no border exists */
        }
        
        .inline-input-container.comment-mode #inline-prompt {
            margin-top: -2px; /* Raise the comment arrow by 3px from previous position */
        }
        
        /* Match saved item styling exactly */
        .inline-input-container {
            padding: 1px 5px 1px 5px; /* Match .item padding exactly */
            line-height: 1.8; /* Match .item container line-height */
            margin: 0; /* Match .item vertical margin */
            margin-right: 0; /* Keep original right margin */
            border-left: 3px solid transparent !important; /* Keep border structure but invisible */
            border-radius: 3px; /* Same border-radius as .item */
            display: flex;
            align-items: center;
            min-height: 31px; /* Match exact saved item height of 31px */
            width: 100%; /* Ensure full width like saved items */
            box-sizing: border-box; /* Include padding in width calculation */
        }
        
        .inline-input-container .inline-input-line {
            align-items: flex-start;
            height: 100%; /* Fill container */
            width: 100%; /* Ensure inner line takes full width */
        }
        
        .inline-input-container textarea {
            line-height: 1.8; /* Match saved note items line-height */
            padding: 0; /* Remove extra padding */
            margin: 0; /* Ensure no margin shifts */
            height: auto; /* Let it auto-size with content */
            min-height: 1.8em; /* Minimum height matches one line with proper line-height */
            resize: none; /* Prevent resizing that could change height */
            box-sizing: border-box; /* Include borders in height calculation */
            vertical-align: top; /* Consistent top alignment */
            font-size: 12.8px !important; /* Match body font size exactly */
            font-family: inherit !important; /* Inherit font family from parent */
            letter-spacing: inherit !important; /* Inherit letter spacing */
            word-spacing: inherit !important; /* Inherit word spacing */
            overflow: hidden; /* Hide scrollbars during single-line state */
        }
        
        /* More specific rule to override any browser defaults */
        .inline-input-container #inline-input {
            font-size: 13px !important; /* Match items font size */
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace !important;
            letter-spacing: 0.3px !important;
        }
        
        .inline-input-container.cmd-mode {
            /* border-left-color: var(--text-secondary) !important; */ /* Removed since no border exists */
        }
        
        .inline-input-container.comment-mode {
            /* border-left-color: transparent !important; */ /* Removed since no border exists */
            margin-left: 20px;
            padding-left: 5px;
        }
        
        .prompt.cmd-mode {
            color: var(--text-secondary) !important;
        }
        
        .prompt.comment-mode {
            color: #e91e63 !important;
            font-weight: bold;
        }
        
        .inline-input-container.comment-mode input,
        .inline-input-container.comment-mode textarea {
            padding-left: 10px;
        }
        
        .inline-input-container.cmd-mode input {
            color: var(--text-secondary) !important;
        }
        
        /* Left sidebar for list items in edit mode */
        .item.editing {
            transition: none !important; /* Remove animation wobble */
            min-height: auto; /* Allow height to grow */
        }
        
        /* For task items in edit mode, keep horizontal layout */
        .task-item.editing {
            display: flex;
            flex-direction: row;
            align-items: flex-start;
            min-height: 100%;
            box-sizing: border-box;
        }
        
        /* Keep task checkbox positioned at top when item grows */
        .task-item.editing .task-checkbox {
            position: sticky;
            top: 0;
            align-self: flex-start;
        }
        
        /* For non-task items in edit mode, use column layout */
        .item.editing:not(.task-item) {
            display: flex;
            flex-direction: column;
            align-items: flex-start; /* Ensure left alignment, not center */
        }
        
        /* Critical fix: Make contentEditable spans expand vertically while preserving layout */
        .item.editing [contenteditable="true"] {
            display: inline !important; /* Use inline to preserve text flow and not break time prefixes */
            min-height: 1.4em !important;
            height: auto !important;
            white-space: pre-wrap !important; /* Preserve line breaks */
            word-wrap: break-word !important;
            overflow-wrap: break-word !important;
            outline: none !important;
            vertical-align: top !important; /* Ensure proper alignment */
            max-width: 100% !important; /* Prevent overflow but allow proper text flow */
        }
        
        /* Ensure edit input/textarea grows with content and border follows */
        .item.editing .edit-input,
        .item.editing .edit-textarea {
            min-height: auto;
            height: auto;
            resize: vertical;
            box-sizing: border-box;
        }
        
        /* Make sure task edit fields don't take full width in horizontal layout */
        .task-item.editing .edit-input,
        .task-item.editing .edit-textarea {
            flex: 1;
            overflow: visible;
            word-wrap: break-word;
        }
        
        /* Force the item container to wrap around the edit field content */
        .item.editing {
            overflow: visible;
            height: auto;
        }
        
        
        .task-item.editing {
            /* border-left-color: rgba(156, 39, 176, 0.9) !important; */
            /* border-left-width: 3px !important; */
            /* border-left-style: solid !important; */
            /* Removed 3px left border styling */
        }
        
        .note-item.editing {
            /* border-left-color: rgba(0, 150, 136, 0.9) !important; */ /* Removed since no border exists */
        }
        
        
        .document-item.editing {
            /* Removed border-left-color to return to normal styling */
        }
        
        .header-item.editing {
            /* border-left-color: transparent !important; */ /* Removed since no border exists */
        }
        
        .image-item.editing {
            /* border-left-color: #9b59b6 !important; */ /* Removed since no border exists */
        }
        
        .item.inline-comment.editing {
            /* border-left-color: #e91e63 !important; */ /* Removed since no border exists */
        }
        
        /* Ensure text positioning doesn't shift by adding matching padding */
        .item.editing .item-text {
            /* Border is added to the item itself, so no padding adjustment needed */
        }
        
        /* Styling for inline comment notes */
        .item.inline-comment {
            margin-left: 5px !important;
            padding-left: 40px; /* Increased to 40px for clear separation from arrow */
            background: transparent;
            border-radius: 1px;
            font-style: italic;
            opacity: 0.9;
            position: relative;
            color: #e91e63;
        }
        
        /* Ensure proper layout when editing inline comments */
        .item.inline-comment.editing {
            margin-left: 5px !important;
            padding-left: 40px; /* Increased to match non-editing state */
            background: transparent;
            border-radius: 1px;
            font-style: italic;
            opacity: 0.9;
            position: relative;
            color: #e91e63;
        }
        
        /* Arrow for comments is now added as a DOM element, not CSS pseudo-element 
           Removed ::before pseudo-element to prevent double arrows */
        
        .inline-input-line {
            display: flex;
            align-items: center;
            position: relative;
        }
        
        .inline-input-line .prompt {
            color: rgba(0, 150, 136, 0.9);
            font-weight: bold;
            margin-right: 0px;
            font-size: 14px;
        }
        
        .inline-input-line input,
        .inline-input-line textarea {
            flex: 1;
            background: transparent;
            border: none;
            outline: none;
            color: var(--text-primary);
            font-size: 14px;
            font-family: inherit;
            resize: none;
            overflow: hidden;
            min-height: 20px;
            line-height: 1.4;
        }
        
        .inline-input-line input::placeholder,
        .inline-input-line textarea::placeholder {
            color: var(--text-secondary);
            opacity: 0.4;
            font-weight: 300;
        }
        
        /* Mode-specific placeholder colors with blinking cursor animation */
        .inline-input-container.task-mode textarea::placeholder {
            color: var(--text-primary);
            opacity: 1;
            animation: blink 1s infinite;
            font-size: inherit;
            line-height: inherit;
            font-family: inherit;
        }
        
        .inline-input-container.note-mode textarea::placeholder {
            color: var(--text-primary);
            opacity: 1;
            animation: blink 1s infinite;
            font-size: inherit;
            line-height: inherit;
            font-family: inherit;
        }
        
        .inline-input-container.comment-mode textarea::placeholder {
            color: var(--text-primary);
            opacity: 1;
            animation: blink 1s infinite;
            font-size: inherit;
            line-height: inherit;
            font-family: inherit;
        }
        
        /* Blinking cursor animation */
        @keyframes blink {
            0%, 49% { opacity: 1; }
            50%, 100% { opacity: 0; }
        }
        
        /* Textarea wrapper for positioning fake cursor */
        .textarea-wrapper {
            position: relative;
            display: flex;
            flex: 1;
            width: 100%;
        }
        
        /* Fake blinking cursor */
        .fake-cursor {
            position: absolute;
            left: -3px;
            top: 5px;
            height: calc(1.2em - 1px);
            width: 1px;
            background-color: var(--text-primary);
            pointer-events: none;
            display: none;
        }
        
        /* Adjust fake cursor position for task mode */
        .inline-input-container.task-mode .fake-cursor {
            left: 0px;
            top: 4px;
        }
        
        /* Adjust fake cursor position for comment mode */
        .inline-input-container.comment-mode .fake-cursor {
            left: 10px; /* Account for the 10px padding-left on textarea */
            top: 2px; /* Move up 3px from default 5px */
        }
        
        /* Hide fake cursor when textarea has content or is focused */
        .textarea-wrapper textarea:not(:placeholder-shown) + .fake-cursor,
        .textarea-wrapper textarea:focus + .fake-cursor {
            display: none;
        }
        
        /* Help overlay for inline input */
        .inline-input-help {
            position: absolute;
            top: 120%; /* Position further below the inline-input */
            left: -3px; /* Move further left, beyond the color bar */
            transform: none; /* Remove center transforms */
            pointer-events: none;
            color: #999999 !important; /* Updated to light grey color */
            opacity: 0.6; /* More visible */
            font-size: 9px; /* Smaller font */
            display: flex;
            align-items: center;
            gap: 2px; /* Minimal spacing between elements */
            z-index: 1;
            transition: opacity 0.2s ease, transform 0.2s ease; /* Smooth transition for appearance and movement */
            white-space: nowrap; /* Prevent text wrapping */
            flex-wrap: nowrap; /* Prevent flex items from wrapping */
            border-top: 1px solid rgba(153, 153, 153, 0.2); /* Grey border to match text */
            padding-top: 2px; /* Small padding */
            margin-top: 4px; /* Add top margin to separate from inline-input */
            width: 75% !important;
            border: none;
            
        }
        
        /* Ensure all text inside inline-input-help is grey and same font size */
        .inline-input-help span,
        .inline-input-help kbd,
        .inline-input-help * {
            color: #999999 !important;
            font-size: 9px !important;
            line-height: 1.2;
        }
        
        /* Make key labels bold with spacing */
        .inline-input-help kbd,
        .inline-input-help .help-key span[style*="font-size"] {
            font-weight: 600 !important; /* Semi-bold to override inline styles */
            margin-right: 2px; /* Small space after key labels */
        }
        
        /* Style help dividers (commas) */
        .inline-input-help .help-divider {
            margin-left: -1px; /* Reduce left spacing */
            margin-right: 2px; /* Small space after comma */
        }
        
        /* Account for comment arrow shift */
        .inline-input-container.comment-mode .inline-input-help {
            right: 140px; /* Adjust for arrow shifting content right */
            left: auto; /* Reset left positioning */
        }
        
        .inline-input-container.has-content .inline-input-help,
        .input-line.has-content .inline-input-help,
        .inline-input-container.focused .inline-input-help,
        .input-line.focused .inline-input-help,
        .inline-input-container.saving .inline-input-help,
        .inline-input-container.continuous-entry .inline-input-help {
            opacity: 0 !important;
            visibility: hidden !important;
        }
        
        .key-icon {
            width: 10px;
            height: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: #89b48b; /* Green color for SVG currentColor */
        }
        
        .key-icon img {
            transition: none !important; /* Remove any image transitions */
            opacity: 1 !important; /* Force immediate visibility */
        }
        
        .key-icon svg {
            width: 100%;
            height: 100%;
            color: inherit; /* Inherit green from parent */
        }
        
        .help-divider {
            margin: 0 4px;
            opacity: 0.6;
            font-size: 18px;
            vertical-align: middle;
        }
        
        
        /* Highlight animation for found tasks */
        .item.highlight-found {
            background-color: rgba(34, 197, 94, 0.3);
            border-left: 4px solid #22c55e;
            transition: background-color 0.3s ease, border-left 0.3s ease;
        }
        
        .item.highlight-found.fade-out {
            background-color: transparent;
            border-left: 4px solid transparent;
            transition: background-color 1.5s ease, border-left 1.5s ease;
        }

        
        /* Removed edit mode styling - items look the same when editing
        .item.editing {
            background: rgba(139, 126, 200, 0.02);
            padding: 0;
            margin: 0;
            margin-left: 5px;

        }
        */

        
        .edit-input {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            color: inherit !important; /* Inherit color from parent item */
            font-family: inherit !important;
            font-size: inherit !important;
            line-height: inherit !important;
            width: 100%;
            padding: inherit !important;
            margin: inherit !important;
            outline: none !important;
            caret-color: var(--text-primary);
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            appearance: none !important;
            /* Enable text selection */
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
            text-decoration: inherit !important; /* Inherit text decorations like strikethrough */
            opacity: inherit !important; /* Inherit opacity for completed items */
            vertical-align: baseline !important; /* Match original text alignment */
            font-weight: inherit !important; /* Inherit font weight */
            font-style: inherit !important; /* Inherit font style */
            word-break: inherit !important; /* Inherit word breaking */
            white-space: inherit !important; /* Inherit whitespace handling */
            display: inline !important; /* Force inline display */
            position: static !important; /* Prevent any positioning changes */
            min-height: 0 !important; /* Remove any minimum height */
            max-height: none !important; /* Remove any maximum height */
            height: auto !important; /* Auto height to match content */
            box-sizing: content-box !important; /* Match original box model */
        }
        
        /* Override line-height for edit inputs in headers */
        .header-item .edit-input {
            line-height: 1.2 !important; /* Match .header-item .item-text line-height */
            font-weight: inherit !important;
            font-size: inherit !important;
            font-family: inherit !important;
            margin: 0 !important;
            padding: 0 !important;
            vertical-align: baseline !important;
        }
        
        /* Override line-height for edit inputs in different item types to match their text spans */
        .task-item .edit-input,
        .note-item .edit-input {
            line-height: 1.8 !important; /* Match .app-task-text, .app-note-text line-height */
            display: inline !important; /* Match app-text classes */
        }
        
        .document-item .edit-input {
            line-height: 1.8 !important; /* Match .app-doc-text line-height */
            display: inline !important; /* Match app-text classes */
        }
        
        .edit-textarea {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            color: inherit !important; /* Inherit color from parent item */
            font-family: inherit !important;
            font-size: 14px !important; /* Match line-text */
            line-height: 1.2 !important; /* Match line-text */
            width: 100% !important;
            padding: 0 !important;
            margin: 0 !important;
            outline: none !important;
            caret-color: var(--text-primary);
            resize: none !important; /* Disable manual resize since we have auto-resize */
            overflow: hidden !important; /* Hide scrollbars since we auto-resize */
            text-wrap: wrap !important;
            white-space: pre-wrap !important;
            word-wrap: break-word !important;
            word-break: break-word !important;
            tab-size: 4 !important;
            height: auto !important;
            min-height: 16px !important; /* Match line-text */
            display: block !important;
            box-sizing: border-box !important;
            /* Enable text selection */
            -webkit-user-select: text !important;
            -moz-user-select: text !important;
            -ms-user-select: text !important;
            user-select: text !important;
            min-height: 1em !important;
            max-height: 1em !important;
            vertical-align: middle !important;
            display: inline-block !important;
            line-height: 1em !important;
            word-wrap: break-word;
            -webkit-appearance: none !important;
            -moz-appearance: none !important;
            appearance: none !important;
            vertical-align: baseline !important;
            text-decoration: inherit !important; /* Inherit text decorations like strikethrough */
            opacity: inherit !important; /* Inherit opacity for completed items */
        }
        
        /* Removed edit mode styling - items look the same when editing
        .editing {
            background: rgba(139, 126, 200, 0.02);
        }
        */
        
        /* Force remove all browser default styling for edit inputs */
        .edit-input, .edit-textarea {
            -webkit-box-shadow: none !important;
            -moz-box-shadow: none !important;
            border-radius: 0 !important;
            -webkit-border-radius: 0 !important;
            -moz-border-radius: 0 !important;
        }
        
        /* Override any potential form input styling */
        input[type="text"].edit-input,
        textarea.edit-textarea {
            background-color: transparent !important;
            border: 0 !important;
            border-color: transparent !important;
            border-style: none !important;
            border-width: 0 !important;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-top: 0 !important;
            margin-bottom: 0 !important;
            margin-left: 0 !important;
            margin-right: 0 !important;
        }
        
        /* Ensure parent containers don't add padding during edit mode */
        .editing .item-text {
            padding: 0 !important;
            margin: 0 !important;
        
        }
        
        /* Remove any default browser textarea padding */
        textarea.edit-textarea {
            -webkit-padding-start: 0 !important;
            -webkit-padding-end: 0 !important;
            padding-inline-start: 0 !important;
            padding-inline-end: 0 !important;
            padding-block-start: 0 !important;
            padding-block-end: 0 !important;
        }
        
        
        /* Adjust edit input for inline comments to not overlap arrow */
        .item.inline-comment.editing .edit-input,
        .item.inline-comment.editing .edit-textarea {
            width: 100%;
            margin: 0 !important;
            padding: 0 !important;
            padding-left: 12px !important; /* Even closer to arrow */
            border: none !important;
            outline: none !important;
            font-style: italic;
            line-height: inherit !important; /* Use comment's line-height, not note-item's 1.8 */
            display: inline !important;
            box-sizing: border-box !important;
        }
        
        .edit-actions {
            display: flex;
            gap: 10px;
        }
        
        /* Scrollbar styling */
        .terminal::-webkit-scrollbar {
            width: 10px;
        }
        
        .terminal::-webkit-scrollbar-track {
            background: var(--bg-primary);
        }
        
        
        .terminal::-webkit-scrollbar-thumb {
            background: var(--text-secondary);
            border-radius: 0;
        }
        
        .terminal::-webkit-scrollbar-thumb:hover {
            background: var(--scrollbar-thumb-hover);
        }
        
        /* Calendar styles */
        .calendar-container {
            position: fixed;
            right: 0;
            top: 0;
            width: 21.45%;
            height: 100vh;
            background: #ffffff; /* Pure white */
            padding: 20px 5px 10px 5px;
            overflow-y: auto;
            overflow-x: hidden;
            -webkit-overflow-scrolling: touch;
            /* box-shadow: -1px 0 8px rgba(0, 0, 0, 0.12); */
            opacity: 1;
            line-height: 1.2 !important; /* Reset line-height for calendar */
        }
        
        /* Ensure all calendar elements have normal line-height */
        .calendar-container * {
            line-height: inherit !important;
        }
        
        /* Specific fixes for calendar modal content */
        #calendarModal {
            line-height: 1.4 !important;
        }
        
        #calendarModal * {
            line-height: normal !important;
        }
        
        #calendarModal .calendar-item,
        #calendarModal .calendar-event,
        #calendarModal .day-content,
        #calendarModal td {
            line-height: 1.4 !important;
        }
        
        /* Fix for the modal table cells */
        #calendarModal table td {
            line-height: 1.2 !important;
            padding: 8px 4px !important;
        }
        
        #calendarModal table td div {
            line-height: 1.2 !important;
        }

        
        
        /* Specific calendar date picker fixes */
        .date-picker-content {
            line-height: 1.5 !important;
        }
        
        .month-day-snippet {
            line-height: 1 !important;
        }
        
        /* Hide scrollbar in calendar */
        .calendar-container::-webkit-scrollbar {
            display: none;
        }
        
        .calendar-container {
            -ms-overflow-style: none;  /* IE and Edge */
            scrollbar-width: none;  /* Firefox */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            z-index: 1; /* Low z-index so revealed portion can be clicked, but terminal covers it */
            /* Remove all sliding transforms - calendar stays stationary */
        }

        /* Border-left only for warm theme (default) */
        /* :root:not([data-theme="ocean"]) .calendar-container {
            border-left: 1px solid rgb(121 46 173 / 40%);
        } */
        
   
        
        :root[data-theme="ocean"] .calendar-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            backdrop-filter: blur(8px) saturate(1.5) hue-rotate(15deg);
            background: rgba(255, 255, 255, 0.9);
            z-index: 1;
            pointer-events: none;
        }
        
        /* Desktop: height based on folder count */
        @media (min-width: 769px) {
            :root[data-theme="ocean"] .calendar-container::before {
                height: var(--calendar-content-height);
            }
        }
        
       
        
        .calendar-container.minimized {
            /* No transform - calendar always visible at right: 0 */
        }
        
        .calendar-container.visible {
            /* No transform - calendar always visible at right: 0 */
        }
        
        /* Calendar close cross - appears on cursor movement */
        .calendar-close-btn {
            position: fixed;
            top: 10px;
            right: 10px;
            width: 16px;
            height: 16px;
            color: rgba(128, 128, 128, 0.8);
            background: none;
            border: none;
            cursor: pointer !important;
            font-size: 16px;
            font-weight: normal;
            line-height: 0.2;
            opacity: 1;
            transition: opacity 0.2s ease;
            z-index: 1002;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .calendar-container.cursor-moving .calendar-close-btn {
            opacity: 1;
        }
        
        .calendar-close-btn:hover {
            color: rgba(128, 128, 128, 1);
            transform: scale(1.2);
        }
        
        /* Calendar peek preview when hovering near right edge - calendar stays stationary */
        .calendar-container.peeking {
            /* Calendar always stationary - no transforms needed */
            opacity: 0.85; /* More transparent for subtle preview */
        }
        
        /* Expand clickable area during peek - reduced to avoid interfering with dates */
        .calendar-container.peeking::before {
            content: '';
            position: absolute;
            left: -10%; /* Reduced extension to avoid date clicks */
            top: 0;
            width: 110%; /* 100% + 10% extension */
            height: 100%;
            z-index: 10;
            pointer-events: auto;
            cursor: pointer !important; /* Show pointer cursor in expanded clickable area */
        }
        
        /* Calendar footer - hidden during peek, fade in when revealed */
        .calendar-footer {
            transition: opacity 0.3s ease 0.2s; /* 0.2s delay, 0.3s fade */
        }
        
        .calendar-container.peeking ~ .calendar-footer {
            opacity: 0;
            transition: opacity 0.1s ease; /* Quick fade out during peek */
        }
        
        /* All element adjustments during peek - terminal resizes like with-calendar */
        body:has(.calendar-container.peeking) .terminal {
            width: 97.855%; /* Resize to make room for calendar peek (100% - 2.145%) */
            transition: width 0.4s ease;
            box-shadow: 1px 0 2px rgba(0, 0, 0, 0.06); /* Ensure box shadow is visible during peek */
            z-index: 1002; /* Above calendar footer to ensure box shadow is visible */
        }
        
        body:has(.calendar-container.peeking) .bottom-stats {
            right: 2.145%; /* Move to match terminal adjustment */
            transition: right 0.4s ease;
        }
        
        
        .calendar-header {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 35px;
            text-align: center;
            height: 25px;
        }
        
        .calendar-container .close-calendar-btn {
            position: absolute !important;
            top: 40px !important;
            right: 10px !important;
            background: none;
            border: none;
            color: var(--text-secondary);
            padding: 8px 12px;
            cursor: pointer !important;
            font-family: inherit;
            font-size: 14px;
            border-radius: 1px;
            z-index: 10000 !important;
            display: none;
            pointer-events: auto;
        }
        
        .close-calendar-btn:hover {
            color: var(--text-hover);
            background: rgba(139, 105, 20, 0.1);
        }
        
        /* Ensure close button is clickable in mid-range window sizes (769px-1200px) */
        @media (min-width: 769px) and (max-width: 1200px) {
            .calendar-container .close-calendar-btn {
                z-index: 10001 !important;
                top: 65px !important;
                right: 5px !important;
                padding: 10px 14px;
                font-size: 15px;
                background: rgba(139, 105, 20, 0.1);
                border: 0.4px solid rgba(139, 105, 20, 0.2);
            }
        }
        
        .calendar-info {
            text-align: center;
            margin: -30px 0 15px 0;
            transition: height 0.3s ease, opacity 0.2s ease;
        }
        
        .selected-date-display {
            color: var(--text-secondary);
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 5px;
        }
        
        .calendar-subtitle {
            color: var(--text-secondary);
            font-size: 10px;
            opacity: 0.8;
        }
        
        .calendar-days-container {
            position: relative;
            margin-bottom: 20px;
            height: 180px;
            min-height: 180px;
            flex-shrink: 0;
            width: 100%;
        }

        .calendar-sticky-month {
            position: absolute;
            left: 20px;
            bottom: 4.5px;
            font-size: 8px;
            color: var(--text-primary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-weight: bold;
            text-align: left;
            line-height: 10px;
            white-space: nowrap;
            z-index: 100;
            pointer-events: none;
            transition: opacity 0.15s ease;
            text-transform: uppercase;
        }

        .sticky-month-blur,
        .sticky-month-sharp {
            position: absolute;
            left: 0;
            top: 0;
            white-space: nowrap;
        }

        .sticky-month-blur {
            filter: blur(1px);
            opacity: 0.5;
        }

        .sticky-month-sharp {
            position: relative;
            z-index: 1;
            opacity: 0.85;
            color: #646464;
        }

        .calendar-days {
            display: flex;
            justify-content: flex-start;
            align-items: end;
            gap: 1px;
            transition: height 0.3s ease, opacity 0.2s ease;
            padding: 20px;
            height: 180px;
            min-height: 180px; /* Prevent shrinking when space is limited */
            flex-shrink: 0; /* Don't shrink this element in flex container */
            background: none;
            overflow-x: hidden;
            scroll-behavior: smooth;
            width: 100%;
            position: absolute;
            top: 0;
            left: 0;
            /* Removed transition to prevent graph shifting when calendar opens */
        }
        
        .calendar-days-base {
            z-index: 1;
            opacity: 0; /* Hidden - used only for structure */
            pointer-events: none;
        }
        
        .calendar-days-blur {
            z-index: 2;
            filter: blur(1.3px);
            opacity: 0.6;
            pointer-events: none;
            /* Remove transform - layers must align perfectly */
        }
        
        /* Ensure blur layer elements don't interfere with clicks */
        .calendar-days-blur * {
            pointer-events: none;
        }
        
        .calendar-days-sharp {
            z-index: 3;
            pointer-events: auto; /* This layer handles all interactions */
        }
        
        /* Make the sharp layer bars semi-transparent so blur shows through */
        .calendar-days-sharp .calendar-day-bar {
            opacity: 0.9;
            background-color: transparent !important;
            background: transparent !important;
            /* Ensure click events work on transparent bars */
            position: relative;
            pointer-events: auto;
        }
        
        /* Ensure the entire sharp layer column captures clicks */
        .calendar-days-sharp .calendar-day-column {
            pointer-events: auto !important;
            position: relative;
            z-index: 1;
        }
        
        /* Make sure all interactive elements in sharp layer can be clicked */
        .calendar-days-sharp * {
            pointer-events: auto;
        }
        
        
        /* Gradient overlays positioned over the calendar graph - always present */
        .calendar-container::before,
        .calendar-container::after {
            content: '';
            position: absolute;
            top: 100px; /* Position at start of graph area */
            height: 160px; /* Height of just the graph bars area */
            width: 15px;
            pointer-events: none;
            z-index: 100;
        }
        
        .calendar-container::before {
            left: 5px;
            background: linear-gradient(to right, 
                #ffffff 0%,
                #ffffff 20%,
                rgba(255, 255, 255, 0.9) 50%,
                rgba(255, 255, 255, 0.5) 75%,
                transparent 100%);
        }
        
        .calendar-container::after {
            right: 5px;
            background: linear-gradient(to left, 
                #ffffff 0%,
                #ffffff 20%,
                rgba(255, 255, 255, 0.9) 50%,
                rgba(255, 255, 255, 0.5) 75%,
                transparent 100%);
        }
        
        /* Dark/Ocean theme gradient adjustments */
        [data-theme="ocean"] .calendar-container::before {
            background: linear-gradient(to right, 
                #001428 0%,
                #001428 20%,
                rgba(0, 20, 40, 0.9) 50%,
                rgba(0, 20, 40, 0.5) 75%,
                transparent 100%);
        }
        
        [data-theme="ocean"] .calendar-container::after {
            background: linear-gradient(to left, 
                #001428 0%,
                #001428 20%,
                rgba(0, 20, 40, 0.9) 50%,
                rgba(0, 20, 40, 0.5) 75%,
                transparent 100%);
        }
        
        
        
        .calendar-days.animating .calendar-day-column {
            transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        
        .calendar-day-bar {
            transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .calendar-day-label {
            transition: opacity 0.3s ease;
        }
        
        /* Animation states */
        .calendar-day-bar.animating {
            transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        
        .calendar-day-label.fading {
            opacity: 0.3;
        }
        
        .calendar-day-column {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            cursor: pointer !important;
            transition: all 0.2s ease;
            min-width: 14px;
            position: relative;
            opacity: 0.5;
        }
        
        .calendar-day-column.selected {
            opacity: 1;
        }

        .calendar-days-sharp .calendar-day-column:has(.calendar-month-label),
        .calendar-days-blur .calendar-day-column:has(.calendar-month-label) {
            opacity: 1;
        }

        /* Keep bar and date label at 50% opacity on first-of-month columns to match other days */
        .calendar-day-column:has(.calendar-month-label) .calendar-day-bar,
        .calendar-day-column:has(.calendar-month-label) .calendar-day-label,
        .calendar-day-column:has(.calendar-month-label) .calendar-day-letter {
            opacity: 0.5;
        }

        .calendar-day-column:hover {
            transform: translateY(-2px);
            z-index: 10;
        }
        
        /* Prevent month label from moving on hover */
        .calendar-day-column:hover .calendar-month-label {
            transform: translateY(2px);
        }
        
        .calendar-day-bar {
            width: 12px;
            min-height: 1px; /* Allow empty days to show as just a line */
            border-radius: 4px 4px 0 0;
            transition: all 0.2s ease;
            border: 1px solid rgb(219 219 219 / 40%);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        }
        
        /* Remove rigid level system - heights will be set dynamically via inline styles */
        .calendar-day-bar { 
            background: linear-gradient(135deg, rgba(180, 180, 180, 0.12) 0%, rgba(120, 120, 120, 0.18) 100%);
            min-height: 1px; /* Allow empty days to show as just a line */
            max-height: 110px;
        }
        
        /* Today bar override - must come after general bar styles */
        .calendar-day-column.today .calendar-day-bar {
            background: linear-gradient(to top, rgba(210, 240, 210, 0.6) 0%, rgba(210, 240, 210, 0.15) 100%) !important;
            border: 0.8px solid rgba(210, 240, 210, 0.7) !important;
        }
        
        .calendar-day-column.selected .calendar-day-bar {
            border-width: 1px !important;
            Opacity: 1 !important;
        }
        
        .calendar-day-column.today .calendar-day-bar {
            background: linear-gradient(to top, rgba(210, 240, 210, 0.55) 0%, rgba(210, 240, 210, 0.1) 100%) !important;
            border: 0.8px solid rgba(210, 240, 210, 0.65) !important;
        }
        
        /* Today bars that are also selected should have 1px border like other selected bars - must come after all today rules */
        .calendar-day-column.today.selected .calendar-day-bar {
            border-width: 1px !important;
        }
        
        .calendar-day-label {
            font-size: 10px;
            color: var(--text-secondary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            text-align: center;
            min-height: 14px;
            line-height: 14px;
            transition: color 0.2s;
        }
        
        .calendar-day-letter {
            font-size: 8px;
            color: var(--text-secondary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            text-align: center;
            min-height: 10px;
            line-height: 10px;
            opacity: 0.7;
            transition: color 0.2s, opacity 0.2s;
        }
        
        
        .calendar-day-column:hover .calendar-day-label {
            color: #8b4513;
            font-weight: bold;
            opacity: 1;
        }
        
        .calendar-day-column:hover .calendar-day-letter {
            color: #8b4513;
            opacity: 1;
        }
        
        .calendar-month-label {
            position: absolute;
            bottom: -15px;
            left: 0;
            font-size: 8px;
            color: var(--text-primary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-weight: bold;
            text-align: left;
            opacity: 0.8;
            line-height: 10px;
            transition: transform 0.2s ease;
            white-space: nowrap;
            z-index: 10;
            padding-left: 5px;
        }
        
        .calendar-tooltip {
            position: absolute;
            top: 0;
            left: 100%;
            transform: translateY(0%);
            background: var(--text-secondary);
            color: #f4f2e8;
            padding: 6px 10px;
            border-radius: 1px;
            font-size: 11px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
            z-index: 20;
            margin-left: 8px;
        }
        
        .calendar-day-column:hover .calendar-tooltip {
            opacity: 1 !important;
        }
        
        .calendar-tooltip::after {
            content: '';
            position: absolute;
            top: 50%;
            left: -8px;
            transform: translateY(-50%);
            border: 4px solid transparent;
            border-right-color: var(--text-secondary);
        }
        
        .calendar-grid {
            display: none;
        }
        
        .calendar-day {
            width: 12px;
            height: 12px;
            background: var(--input-bg);
            border: 1px solid #8b4513;
            cursor: pointer !important;
            transition: all 0.2s;
        }
        
        .calendar-day:hover {
            border-color: rgba(75, 0, 130, 0.4);
        }
        
        
        .calendar-day.selected {
            border: 0.4px solid var(--border-primary);
            
        }
        
        .calendar-day.today {
            border: 0.4px solid var(--text-accent);
            box-shadow: 0 0 15px rgba(210, 240, 210, 1);
            position: relative;
        }
        
        .calendar-day.today::after {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            right: -2px;
            bottom: -2px;
            border: 1px solid var(--text-accent);
            border-radius: 2px;
            animation: pulse 2s infinite;
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.3; }
        }

        /* Warm theme: Use brown for today instead of orange */
        :root:not([data-theme="ocean"]) .calendar-day.today {
            border: 0.4px solid #8b6914;
            box-shadow: 0 0 15px rgba(139, 105, 20, 0.7);
            
        }

        :root:not([data-theme="ocean"]) .calendar-day.today::after {
            border: 1px solid #8b6914;
        }

        :root:not([data-theme="ocean"]) .calendar-day-column.today .calendar-day-bar {
            background: linear-gradient(to top, rgba(210, 240, 210, 1) 0%, rgba(210, 240, 210, 0.1) 100%) !important;
            border: 0.9px solid rgba(210, 240, 210, 0.65) !important;
 
        }

        :root:not([data-theme="ocean"]) .calendar-day-column.today .calendar-day-bar .selected {
            border-width: 1px !important;
        }
        
        /* Ensure selected today bars have 1px border in warm theme */
        :root:not([data-theme="ocean"]) .calendar-day-column.today.selected .calendar-day-bar {
            border-width: 1px !important;
        }
        
        .calendar-legend {
            display: flex;
            align-items: end;
            gap: 5px;
            font-size: 12px;
            color: #8b4513;
        }
        
        
        /* Calendar Footer - matches bottom-stats style */
        .calendar-footer {
            position: fixed;
            bottom: 0;
            left: 78.55%; /* Position at start of calendar (21.45% width from right) */
            right: 0;
            height: 28px; /* Reduced from 35px */
            color: var(--text-dark);
            padding: 0 15px; /* Reduced from 0 20px */
            
            /* Liquid Glass Effect - matching bottom-stats */
            background: linear-gradient(
                135deg,
                rgba(255, 255, 255, 0.1) 0%,
                rgba(255, 255, 255, 0.05) 40%,
                rgba(255, 255, 255, 0.02) 100%
            );
            backdrop-filter: blur(12px) saturate(150%);
            -webkit-backdrop-filter: blur(12px) saturate(150%);
            /* filter: url(#liquid-glass-filter); Disabled for performance */
            
            /* Glass-like border and shadows - matching bottom-stats */
            border: 0.5px solid rgba(255, 255, 255, 0.18);
            box-shadow: 
                inset 0 1px 2px rgba(255, 255, 255, 0.3),
                inset 0 -1px 2px rgba(0, 0, 0, 0.1),
                0 1px 5px rgba(0, 0, 0, 0.05);
            
            display: flex; /* Always positioned, use opacity for visibility */
            opacity: 0; /* Hidden by default with opacity for smooth transitions */
            justify-content: space-between;
            align-items: center;
            z-index: 1001; /* Higher z-index to appear above other elements */
            transition: opacity 0.3s ease; /* Smooth transition for visibility changes */
            /* Distortion for liquid effect */
            transform: translateZ(0);
            will-change: transform;
            user-select: none;
            pointer-events: auto; /* Keep pointer events for footer interaction */
        }
        
        /* Show calendar footer when calendar is visible */
        body .terminal.with-calendar ~ .calendar-footer {
            opacity: 1; /* Show footer when calendar is open */
        }
        
        /* Alternative selector for when calendar container has visible class */
        .calendar-container.visible ~ .calendar-footer {
            opacity: 1; /* Show footer when calendar is visible */
        }
        
        /* Calendar footer moves with calendar in ALL states */
        
        /* Desktop only: Enhanced liquid glass effect for calendar-footer */
        @media (min-width: 769px) {
            .calendar-footer {
                /* Enhanced glass effect for desktop - matching bottom-stats */
                background: linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.12) 0%,
                    rgba(255, 255, 255, 0.07) 30%,
                    rgba(255, 255, 255, 0.03) 60%,
                    rgba(255, 255, 255, 0.01) 100%
                );
                backdrop-filter: blur(12px) saturate(180%) brightness(1.05);
                -webkit-backdrop-filter: blur(12px) saturate(180%) brightness(1.05);
                border-top: 0.5px solid rgba(255, 255, 255, 0.25);
            }
        }
        
        /* Border-top only for warm theme - matches bottom-stats */
        :root:not([data-theme="ocean"]) .calendar-footer {
            /* border-top: 1px solid #605c5c45; */
        }
        
        .calendar-footer-left {
            flex: 1;
            overflow: visible;
            white-space: nowrap;
        }
        
        .calendar-footer-right {
            flex-shrink: 0;
            margin-left: 20px;
        }
        
        .calendar-welcome .symbol {
            font-size: 21px;
            vertical-align: text-bottom;
            line-height: 0.2;
            margin-left: 2px;
            position: relative;
            top: 2px;
        }
        
        #calendar-username img {
            margin: 0 !important;
        }

        #calendar-username:hover {
            filter: brightness(1.15) saturate(1.2);
        }

        .folder-section {
                    /* border-top: solid 1px rgb(176 176 176 / 30%); */
            width: 100%;
            font-size: 14px !important;
            flex: 1 1 auto;
            display: flex;
            flex-direction: column;
            min-height: 0;
            max-height: 60%; /* Prevent folder section from taking more than 60% of available space */
            padding-top: 5px;
            padding-bottom: 0px;
            transition: height 0.3s ease, opacity 0.2s ease, transform 0.3s ease;
            overflow: hidden; /* Ensure content doesn't overflow */
            
            /* Show immediately with proper structure */
            visibility: visible;
            opacity: 1;
        }
        
        /* Loading state for folder list */
        #folderList {
            transition: opacity 0.2s ease-in-out;
            /* Prevent layout shifts during rebuilds */
            min-height: 100px;
            contain: layout style;
        }
        
        #folderList.loading {
            opacity: 0.6;
            position: relative;
        }
        
        #folderList.loading::before {
            content: '';
        }
        
        .folder-header {
            color: var(--text-secondary);
            font-size: 15.5px !important;
            margin-bottom: 15px;
            text-align: center;
            border: none;
            padding: 0;
            padding-top: 15px;
            background: none;
            display: none;
        }
        
        
        .folder-list {
            display: flex;
            flex-direction: column;
            gap: 3px; /* Reduced from 5px */
            flex: 1;
            overflow-y: auto;
            margin-top: 8px; /* Reduced from 10px */
            margin-bottom: 0px;
            padding-bottom: 0px;
            transition: max-height 0.3s ease, height 0.3s ease;
                gap: 1px !important;
        }
        
        
        /* Hide scrollbar for folder list completely */
        .folder-list::-webkit-scrollbar {
            display: none;
        }
        
        .folder-list {
            -ms-overflow-style: none;  /* Internet Explorer 10+ */
            scrollbar-width: none;  /* Firefox */
        }
        
        .folder-item {
            display: flex;
            align-items: center;
            justify-content: space-between; /* Changed to space-between to push toggle button to right */
            gap: 0 !important; /* Explicitly set gap to 0 */
            padding: 0 10px; /* Further reduced - very compact */
            font-size: 12px !important;
            height: 18px; /* Fixed height for all folders */
            min-height: 18px; /* Ensure consistent height for all folders */
            margin-bottom: 5px;
            background: #ffffff;
            border: none;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
            border-radius: 6px;
            cursor: pointer !important;
            transition: all 0.2s;
            line-height: 0.2;
            position: relative;
            overflow: hidden;
            font-size: 12px;
        }
        
        /* Swipe wrapper for mobile folder items */
        .folder-swipe-wrapper {
            display: flex;
            align-items: center;
            position: relative;
            width: 100%;
            transition: transform 0.3s ease;
        }
        
        .folder-item.swiped .folder-swipe-wrapper {
            transform: translateX(-100px);
        }
        
        
        
        .folder-item:hover {
            background: rgb(246 253 243); /* Brighter hover */
            border-color: rgb(210 240 210 / 70%); /* Slightly stronger on hover */
        }
        
        .folder-list .folder-item.active,
        .shelf-folders .folder-item.active,
        .folder-item.active {
            position: relative !important;
            background: transparent !important;
            color: var(--text-secondary) !important;
            overflow: visible !important;
            box-shadow: none !important;
            border: none !important;
            isolation: isolate;
            z-index: 10;
        }

        .folder-item.active::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -0.5px;
            bottom: -1px;
            background: #fff0fa;
            border-radius: 8px 7px 9px 7px;
            z-index: 0;
            transform: rotate(0.1deg);
            filter: blur(1px) saturate(2);
        }

        .folder-item.active::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgb(252 240 250);
            border-radius: 6px;
            z-index: 1;
        }

        .folder-item.active .folder-content,
        .folder-item.active .folder-name,
        .folder-item.active .folder-indicators,
        .folder-item.active .folder-delete-icon,
        .folder-item.active > * {
            position: relative;
            z-index: 2;
        }

        .folder-item.active:hover {
            filter: brightness(1.02) saturate(1.1);
        }

        .folder-item.dragging {
            opacity: 0.5;
            transform: rotate(2deg);
        }
        
        .drag-handle {
            cursor: move;
            color: var(--text-secondary);
            margin-right: 6px;
            font-weight: bold;
            user-select: none;
            font-size: 10px; /* Make drag handle smaller */
            line-height: 0.2;
            display: inline-flex;
            align-items: center;
        }
        
        .drag-handle:active {
            cursor: grabbing;
        }
        
        .drag-handle-placeholder {
            display: inline-block;
            width: 28px; /* Match the width of ⋮⋮ plus margin */
            margin-right: 6px;
        }
        
        .drop-indicator {
            height: 1px;
            background: rgba(139, 105, 20, 0.4);
            margin: 1px 0;
            border-radius: 1px;
            box-shadow: 0 0 3px rgba(139, 105, 20, 0.2);
            animation: dropPulse 1.5s ease-in-out infinite alternate;
            width: 80%;
            margin-left: 10%;
            position: relative;
            z-index: 20;
        }
        
        @keyframes dropPulse {
            0% {
                opacity: 0.6;
                transform: scaleY(1);
            }
            100% {
                opacity: 1;
                transform: scaleY(1.2);
                box-shadow: 0 0 12px rgba(139, 105, 20, 0.6);
            }
        }
        
        .folder-item.drop-target {
            background: rgba(0, 255, 0, 0.1);
            border-color: var(--text-secondary);
        }
        
        @keyframes pulse {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }
        
        /* Upload indicator styles */
        .upload-indicator {
            animation: uploadPulse 1.5s infinite !important;
        }
        
        @keyframes uploadPulse {
            0%, 100% { 
                opacity: 0.8; 
                transform: scale(1); 
            }
            50% { 
                opacity: 1; 
                transform: scale(1.1); 
            }
        }
        
        /* Map node hover fade effect - faster fade out, instant fade in */
        .map-node:not(.picture-node):not(.video-node):not(.spotify-node):not(.table-node):not(.doc-node):not(.page-node) {
            transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
        }
        
        /* Instant appearance on hover */
        .map-node:not(.picture-node):not(.video-node):not(.spotify-node):not(.table-node):not(.doc-node):not(.page-node):hover {
            transition: background-color 0s ease, border-color 0s ease, box-shadow 0s ease, opacity 0s ease;
        }
        
        /* Fade out node styling when not hovered, editing, or dragging, but only for ungrouped nodes */
        .map-node:not(.picture-node):not(.video-node):not(.spotify-node):not(.table-node):not(.doc-node):not(.page-node):not(:hover):not(.editing):not(.dragging):not(.selected):not([data-group-id]) {
            background-color: transparent !important;
            border-color: transparent !important;
            box-shadow: none !important;
        }
        
        /* Ensure header nodes also fade out when ungrouped - higher specificity override */
        .map-node.header-node:not(:hover):not(.editing):not(.dragging):not(.selected):not([data-group-id]) {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
        }
        
        /* Always show full node styling when dragging (except page nodes) */
        .map-node.dragging:not(.page-node) {
            background-color: var(--bg-primary) !important;
            border: 1px solid rgba(0,0,0,0.2) !important;
            box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
            transition: none !important; /* Remove transitions during drag for immediate feedback */
        }
        
        /* Force fade out after drag ends, even if mouse is still over node */
        .map-node.just-dropped:not(.picture-node):not(.video-node):not(.spotify-node):not(.table-node):not(.doc-node):not(.page-node):not([data-group-id]) {
            background-color: transparent !important;
            border-color: transparent !important;
            box-shadow: none !important;
            transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease !important;
        }
        
        /* Also show styling when selected (multi-select) - except page nodes */
        .map-node.selected:not(.page-node),
        .map-node.multi-selected:not(.page-node) {
            background-color: var(--bg-primary) !important;
            border-color: rgba(0,0,0,0.2) !important;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2) !important;
        }
        
        /* Ensure text remains visible when node fades */
        .map-node:not(:hover):not(.editing):not(.dragging) {
            color: #2c2c2c !important;
        }
        
        .folder-indicators {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            flex-shrink: 0;
            gap: 4px;
            height: 1.2em;
            border-left: 0.5px solid rgb(231 246 231);
            padding-left: 8px;
            margin-left: 8px;
            position: relative;
        }
           
        
        .folder-item .folder-indicators > * {
            font-size: 12px;
            line-height: 1.2;
        }
        
        .folder-item .pixel-indicator {
            font-size: 8.64px;
        }
        
        /* Visual indicator active/inactive states */
        .folder-indicators .pin-indicator.active,
        .folder-indicators .share-indicator.active,
        .folder-indicators .import-indicator.active,
        .folder-indicators .daily-indicator.active,
        .folder-indicators .lock-indicator.active {
            opacity: 1 !important;
            filter: saturate(1) !important;
        }

        .folder-indicators .lock-indicator.active svg {
            stroke: #3b82f6 !important;
        }
        
        .folder-indicators .pin-indicator.inactive,
        .folder-indicators .import-indicator.inactive,
        .folder-indicators .daily-indicator.inactive,
        .folder-indicators .lock-indicator.inactive,
        .folder-indicators .share-indicator.inactive {
            opacity: 0.3 !important;
            filter: none !important;
        }
        
        .folder-indicators .pin-indicator.disabled {
            opacity: 0.15 !important;
            filter: saturate(0) grayscale(1) !important;
        }
        
        .folder-indicators .pin-indicator.disabled:hover {
            opacity: 0.15 !important;
            filter: saturate(0) grayscale(1) !important;
        }
        
        /* Active state - brighten and saturate */
        .folder-indicators .pin-indicator.active,
        .folder-indicators .share-indicator.active,
        .folder-indicators .daily-indicator.active,
        .folder-indicators .lock-indicator.active {
            filter: brightness(1.15) saturate(1.2) !important;
        }

        /* Hover effects - only apply to inactive indicators (except import indicator) */
        .folder-indicators .pin-indicator.inactive:hover,
        .folder-indicators .share-indicator.inactive:hover,
        .folder-indicators .daily-indicator.inactive:hover,
        .folder-indicators .lock-indicator.inactive:hover {
            opacity: 1 !important;
            filter: brightness(1.25) saturate(1.3) !important;
            transition: opacity 0.2s ease, filter 0.2s ease;
        }

        /* Hover effects for active indicators */
        .folder-indicators .pin-indicator.active:hover,
        .folder-indicators .share-indicator.active:hover,
        .folder-indicators .daily-indicator.active:hover,
        .folder-indicators .lock-indicator.active:hover {
            filter: brightness(1.25) saturate(1.3) !important;
            transition: filter 0.2s ease;
        }
        
        /* Header Section Styles - matches folder section */
        .header-section {
            padding-top: 0px;
            padding-bottom: 0px;
            font-size: 15.5px !important;
                
            display: flex;
            flex-direction: column;
            width: 100%;
          
            flex: 0 0 auto; /* Don't grow, don't shrink, stay at natural size */
            min-height: 0;
            max-height: 40%; /* Limit header section to 40% of available space */
            overflow: hidden; /* Prevent overflow from pushing other content */
            transition: height 0.3s ease, max-height 0.3s ease, position 0.3s ease, margin 0.3s ease, opacity 0.2s ease, transform 0.3s ease;
        }
        
        /* Hide top border when header section is expanded */
        .header-section:has(.expand-arrow.expanded) {
            border-top: none;
        }
        
        .header-section .section-title {
            font-size: 12px;
            font-weight: normal;
            color: var(--text-secondary);
            margin-bottom: 10px;
            text-align: center;
            letter-spacing: 1px;
        }
        
        .header-list {
            display: flex;
            flex-direction: column;
            gap: 3px;
            overflow-y: auto; 
            max-height: 200px;
            width: 100%;
            margin-top: 8px;
            margin-bottom: 10px;
            padding-bottom: 10px;
            transition: max-height 0.3s ease, height 0.3s ease;
        }
        
        /* Hide scrollbar for header list completely */
        .header-list::-webkit-scrollbar {
            display: none;
        }
        
        .header-list {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        
        .header-list .header-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0 !important;
            padding: 2px 10px;
            font-size: 11px;
            height: 22px;
            min-height: 22px;
            max-height: 22px;
            flex-shrink: 0;
            background: rgba(0, 0, 0, 0.05);
            border: none;
            box-sizing: border-box;
            cursor: pointer !important;
            transition: all 0.2s;
            line-height: 1.2;
            position: relative;
            color: var(--text-secondary);

        }
        
        .header-list .header-item:hover {
            background: rgba(128, 128, 128, 0.15) !important;
            color: var(--text-primary);
        }
        
        .header-list .header-item-text {
            flex: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            padding-right: 5px;
            text-align: center;
        }
        
        .header-list .header-item-folder {
            font-size: 9px;
            color: #999;
            margin-left: 5px;
        }

        /* Page node headers (from map view) styled with app green */
        .header-list .header-item[data-view="map"] .header-item-text {
            color: rgb(154, 206, 154);
        }

        /* Group item styling in header list - with deformed layer effect */
        .header-list .group-item {
            --group-bg-color: rgba(128, 128, 128, 0.05);
            --group-underlay-color: rgba(128, 128, 128, 0.1);
            --group-text-color: rgb(32 32 32 / 50%);
            position: relative !important;
            background: transparent !important;
            border: none;
            color: var(--group-text-color);
            font-weight: normal;
            overflow: visible !important;
        }

        .header-list .group-item::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -0.5px;
            bottom: -1px;
            background: var(--group-underlay-color);
            border-radius: 8px 7px 9px 7px;
            z-index: -2;
            transform: rotate(0.1deg);
            filter: blur(1px) saturate(2);
            pointer-events: none;
        }

        .header-list .group-item::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--group-bg-color);
            border-radius: 6px;
            z-index: -1;
            pointer-events: none;
        }

        .header-list .group-item .header-item-text {
            position: relative;
            z-index: 1;
        }

        .header-list .group-item:hover {
            --group-bg-color: rgba(170, 150, 120, 0.2);
            --group-underlay-color: rgba(170, 150, 120, 0.3);
            --group-text-color: rgb(170, 150, 120);
        }
        
        .header-shelf {
            margin: 8px 0 5px 0;
            position: relative;
        }
        
        .header-shelf-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px 8px;
            background: rgba(121, 46, 173, 0.1);
            border: 0.4px solid rgba(121, 46, 173, 0.3);
            border-radius: 1px;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 3px;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
            height: 22px;
            min-height: 22px;
        }
        
        .header-shelf-header:hover {
            background: rgba(121, 46, 173, 0.15);
            border-color: rgba(121, 46, 173, 0.5);
        }
        
        .header-shelf-name {
            font-size: 10px;
            font-weight: bold;
            color: rgb(121, 46, 173);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .header-shelf-toggle {
            font-size: 10px;
            color: rgba(121, 46, 173, 0.2);
            transition: transform 0.2s;
        }
        
        .header-shelf.closed .header-shelf-toggle {
            transform: rotate(-90deg);
        }
        
        .header-shelf-items {
            margin-left: 10px;
            border-left: 0.4px solid rgba(121, 46, 173, 0.2);
            padding-left: 8px;
            margin-top: 3px;
        }
        
        .header-shelf.closed .header-shelf-items {
            display: none;
        }
        
        .header-list .header-shelf-items .header-item {
            background: rgba(121, 46, 173, 0.02);
        }
        
        .header-list .header-shelf-items .header-item:hover {
            background: rgba(34, 197, 94, 0.12);
        }
        
        
        /* Folder-list-specific alignment adjustments */
        .folder-item .pin-indicator {
            margin-bottom: 2px;
        }
        
        .folder-item .pixel-indicator {
            margin-bottom: 1.5px;
        }
        
        .folder-item {
            padding: 9px 12px 7px 12px;
        }
        
        .folder-delete-icon {
            opacity: 0;
            margin-left: 6px;
            margin-right: 2px;
            cursor: pointer;
            transition: opacity 0.2s ease, transform 0.2s ease;
            display: inline-block;
            user-select: none;
        }
        
        .folder-delete-icon:hover {
            opacity: 1;
            transform: scale(1.1);
            filter: brightness(1.15) saturate(1.2);
        }
        
        .folder-item:hover .folder-delete-icon {
            opacity: 1;
        }

        /* Shelf delete icon */
        .shelf-delete-icon {
            opacity: 0;
            margin-left: 6px;
            cursor: pointer;
            transition: opacity 0.2s ease, transform 0.2s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            user-select: none;
            flex-shrink: 0;
        }

        .shelf-delete-icon:hover {
            opacity: 1 !important;
            transform: scale(1.1);
            filter: brightness(1.15) saturate(1.2);
        }

        .shelf-header:hover .shelf-delete-icon {
            opacity: 1;
        }

        /* Character-specific vertical alignment fixes */
        .share-indicator:contains('⚭'),
        .share-indicator {
            vertical-align: baseline;
            transform: translateY(-1px);
        }
        
        .import-indicator:contains('⤓'),
        .import-indicator {
            vertical-align: baseline;
            transform: translateY(-0.5px);
        }
        
        .pixel-indicator:contains('■'),
        .pixel-indicator {
            vertical-align: baseline;
            transform: translateY(-1px);
        }
        
        .folder-name {
            flex: 1;
            transition: color 0.8s ease-in-out;
            font-size: 12px !important;
            position: relative;
            line-height: 1.2;
            display: flex;
            align-items: center;
            padding: 0; /* Remove any default padding */
        }
        
        .notification-badge {
            position: absolute;
            top: -8px;
            right: -8px;
            background: #ff4444;
            color: white;
            border-radius: 50%;
            min-width: 16px;
            height: 16px;
            font-size: 10px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            z-index: 10;
        }
        
        .folder-name-display {
            transition: color 0.8s ease-in-out;
            margin-left: 15px;
            font-weight: 510;
        }
        
        .folder-name-display span {
            transition: color 0.8s ease-in-out;
        }
        
        .pin-indicator {
            display: inline-block;
            margin-right: 6px;
            margin-bottom: 2px;
            flex-shrink: 0;
        }

        .pin-indicator.active svg {
            stroke: #8b4c96;
        }

        .pin-indicator.inactive svg {
            stroke: #9ca3af;
        }

        .pin-indicator.inactive:hover svg {
            stroke: #8b4c96;
        }

        .pin-indicator.active {
            filter: brightness(1.15) saturate(1.2);
        }

        .pin-indicator.inactive:hover,
        .pin-indicator.active:hover {
            filter: brightness(1.25) saturate(1.3);
        }

        .lock-indicator {
            display: inline-block;
            margin-right: 8px;
            margin-bottom: 2px;
            flex-shrink: 0;
        }

        .lock-indicator.active svg {
            stroke: #3b82f6;
        }

        .lock-indicator.inactive svg {
            stroke: #9ca3af;
        }

        .lock-indicator.inactive:hover svg {
            stroke: #3b82f6;
        }

        .lock-indicator.active {
            filter: brightness(1.15) saturate(1.2);
        }

        .lock-indicator.inactive:hover,
        .lock-indicator.active:hover {
            filter: brightness(1.25) saturate(1.3);
        }

        .share-indicator {
            display: inline-block;
            margin-right: 8px;
            margin-bottom: 2px;
            cursor: pointer !important;
            transition: opacity 0.2s ease;
        }

        .share-indicator.active svg {
            stroke: #16a34a;
        }

        .share-indicator.inactive svg {
            stroke: #9ca3af;
        }

        .share-indicator.inactive:hover svg {
            stroke: #16a34a;
        }

        .share-indicator.active {
            filter: brightness(1.15) saturate(1.2);
        }

        .share-indicator.inactive:hover,
        .share-indicator.active:hover {
            filter: brightness(1.25) saturate(1.3);
        }

        .import-indicator {
            display: inline-block;
            margin-right: 8px;
            margin-bottom: 2px;
            transition: opacity 0.2s ease;
        }

        .import-indicator.active svg {
            stroke: #3b82f6;
        }

        .import-indicator.inactive svg {
            stroke: #9ca3af;
        }

        .import-indicator.inactive:hover svg {
            stroke: #9ca3af;
        }
        
        .pixel-indicator {
            display: inline-block;
            margin-right: 8px;
            font-size: 10.08px;
            color: #000000;
            opacity: 0.8;
            font-weight: bold;
            transition: opacity 0.2s ease;
            line-height: 0.2;
        }
        
        .pixel-indicator:hover {
            opacity: 1;
        }
        
        .pin-placeholder {
            display: inline-block;
            margin-right: 8px;
            vertical-align: middle;
            flex-shrink: 0;
            font-size: 12px;
            color: rgba(139, 76, 150, 0.5);
        }
        
        .pin-placeholder:before {
            content: '☆';
            vertical-align: baseline;
            transform: translateY(-0.5px);
        }
        
        .folder-name {
            flex: 1;
        }
        
        /* Folder buttons removed - using context menu only */
        
        .folder-controls {
            margin-bottom: 5px;
        }
        
        .folder-search-input {
            width: 100%;
            background: transparent;
            border: none;
            border-bottom: 0.5px solid rgb(210 240 210 / 55%);
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12px;
            padding: 2px 10px;
            height: 28px;
            box-sizing: border-box;
            margin-bottom: 0;
            border-radius: 0;
            font-size: 12px !important;
        }
        
        .folder-search-input:focus {
            outline: none;
            box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
        }
        
        .folder-search-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.5;
        }
        
        .retrieve-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 10px;
            font-weight: 400;
            padding: 5px 10px;
            cursor: pointer !important;
            border-radius: 6px;
            transition: all 0.2s;
            min-height: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }
        
        .retrieve-btn:hover {
            background: rgba(106, 106, 106, 0.15);
            /* Even spread hover shadow */
            box-shadow: 0 0 6px rgba(106, 106, 106, 0.3), 0 0 3px rgba(106, 106, 106, 0.15);
        }
        
        .retrieve-btn:active {
            transform: scale(0.98);
        }
        
        .new-folder-input {
            display: none;
            width: 100%;
            background: color-mix(in srgb, var(--text-secondary) 8%, transparent);
            border: none;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 12px;
            padding: 5px 10px;
            border-radius: 6px;
            margin-top: 5px;
            min-height: 26px;
            height: 26px;
            box-sizing: border-box;
        }
        
        .new-folder-input:focus {
            outline: none;
            box-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
        }
        
        .folder-name-edit-input {
            background: transparent;
            border: 1px solid var(--border-primary);
            color: var(--text-secondary);
            font-family: inherit;
            font-size: inherit;
            padding: 2px 5px;
            outline: none;
            caret-color: var(--text-primary);
        }
        
        .character-progress-bar {
            position: fixed;
            top: 0;
            right: 0;
            width: 8px;
            height: 100vh;
            background: rgba(139, 105, 20, 0.2);
            z-index: 1000;
            display: none;
            border-radius: 4px 0 0 4px;
        }
        
        .character-progress-fill {
            width: 100%;
            background: var(--progress-bar);
            transition: height 0.2s ease-out, background-color 0.2s ease-out;
            height: 100%;
            position: absolute;
            bottom: 0;
            border-radius: 4px 0 0 0;
        }
        
        .character-progress-fill.warning {
            background: var(--warning);
        }
        
        .character-progress-fill.danger {
            background: var(--error);
        }
        
        /* Event Modal styles */
        .event-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }
        
        .event-modal-content {
            background: var(--bg-primary);
            border: 2px solid rgba(139, 105, 20, 0.3);
            border-radius: 6px;
            width: 90%;
            max-width: 450px;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 8px 32px rgba(139, 105, 20, 0.2);
        }
        
        .event-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 25px 15px;
            border-bottom: 0.4px solid rgba(139, 105, 20, 0.2);
        }
        
        .event-modal-header h3 {
            margin: 0;
            color: var(--text-primary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 16px;
            font-weight: 600;
        }
        
        .event-modal-close {
            background: none;
            border: none;
            color: var(--text-secondary);
            font-size: 24px;
            cursor: pointer !important;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 1px;
            transition: all 0.2s ease;
        }
        
        .event-modal-close:hover {
            background: rgba(139, 105, 20, 0.1);
            color: var(--text-primary);
        }
        
        .event-modal-body {
            padding: 25px;
        }
        
        .event-form-group {
            margin-bottom: 20px;
        }
        
        .event-form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-secondary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 12px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .event-form-group input {
            width: 100%;
            padding: 12px;
            border: 1px solid rgba(139, 105, 20, 0.3);
            border-radius: 1px;
            background: rgba(139, 105, 20, 0.05);
            color: var(--text-primary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 13px;
            transition: all 0.2s ease;
            box-sizing: border-box;
        }
        
        .event-form-group input:focus {
            outline: none;
            border-color: rgba(139, 105, 20, 0.6);
            background: rgba(139, 105, 20, 0.1);
            box-shadow: 0 0 0 2px rgba(139, 105, 20, 0.1);
        }
        
        .event-form-row {
            display: flex;
            gap: 15px;
        }
        
        .event-form-row .event-form-group {
            flex: 1;
        }
        
        .event-type-selector {
            display: flex;
            gap: 12px;
            margin-top: 8px;
        }
        
        .event-type-option {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer !important;
            padding: 14px 20px;
            border-radius: 1px;
            border: 2px solid rgba(139, 105, 20, 0.2);
            background: var(--bg-primary);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            flex: 1;
            min-height: 50px;
            box-shadow: 0 2px 4px rgba(139, 105, 20, 0.08);
        }
        
        .event-type-option:hover {
            background: rgba(139, 105, 20, 0.08);
            border-color: rgba(139, 105, 20, 0.4);
            box-shadow: 0 4px 8px rgba(139, 105, 20, 0.12);
            transform: translateY(-1px);
        }
        
        .event-type-option:has(input[type="radio"]:checked) {
            background: rgba(139, 105, 20, 0.12);
            border-color: rgba(139, 105, 20, 0.6);
            box-shadow: 0 4px 12px rgba(139, 105, 20, 0.15);
        }
        
        .event-type-option input[type="radio"] {
            margin: 0 10px 0 0;
            accent-color: rgba(139, 105, 20, 0.8);
            width: 16px;
            height: 16px;
            cursor: pointer !important;
        }
        
        .event-type-label {
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 13px;
            color: var(--text-primary);
            font-weight: 500;
            cursor: pointer !important;
            user-select: none;
        }
        
        .event-type-option input[type="radio"]:checked + .event-type-label {
            color: rgba(139, 105, 20, 0.9);
            font-weight: 600;
        }
        
        
        .event-form-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 30px;
        }
        
        .event-btn {
            padding: 12px 24px;
            border: none;
            border-radius: 1px;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer !important;
            transition: all 0.2s ease;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .event-btn-cancel {
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid rgba(139, 105, 20, 0.3);
        }
        
        .event-btn-cancel:hover {
            background: rgba(139, 105, 20, 0.1);
            border-color: rgba(139, 105, 20, 0.5);
            color: var(--text-primary);
        }
        
        .event-btn-save {
            background: linear-gradient(135deg, rgba(139, 105, 20, 0.8), rgba(139, 105, 20, 0.6));
            color: var(--bg-primary);
            border: 1px solid rgba(139, 105, 20, 0.8);
        }
        
        .event-btn-save:hover {
            background: linear-gradient(135deg, rgba(139, 105, 20, 0.9), rgba(139, 105, 20, 0.7));
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(139, 105, 20, 0.3);
        }
        
      

        /* Context menu styles */
        .context-menu {
            position: fixed;
            background: var(--bg-primary);
            border: 0.4px solid var(--border-primary);
            border-radius: 24px;
            padding: 12px 0;
            z-index: 10001;
            display: none;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            overflow: hidden;
        }
        
        .context-menu-item {
            padding: 8px 20px;
            cursor: pointer !important;
            color: var(--text-dark);
            font-size: 14px;
            white-space: nowrap;
            line-height: 1.2;
        }
        
        .context-menu-item:hover {
            background: color-mix(in srgb, var(--text-secondary) 20%, transparent);
        }
        
        .context-menu-separator {
            height: 1px;
            background: var(--border-primary);
            margin: 4px 0;
        }
        
        .context-menu-item.has-submenu {
            position: relative;
        }
        
        .context-menu-item.has-submenu::after {
            content: '►';
            float: right;
            margin-left: 10px;
            font-size: 12px;
        }
        
        .repeat-submenu {
            position: absolute;
            left: calc(100% - 2px);
            top: -5px;
            background: var(--bg-primary);
            border: 0.4px solid var(--border-primary);
            border-radius: 24px;
            padding: 12px 0;
            z-index: 1001;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
            display: none;
            min-width: 120px;
            overflow: hidden;
        }
        
        .context-menu-item.has-submenu:hover .repeat-submenu,
        .repeat-submenu:hover {
            display: block;
        }
        
        /* Cancel button in context menu - always visible */
        .context-menu-cancel {
            display: block;
            border-top: 1px solid var(--border-primary);
            margin-top: 5px;
            padding-top: 12px;
            color: var(--text-secondary);
            font-weight: bold;
            text-align: center;
        }
        
        .context-menu-cancel:hover {
            background: color-mix(in srgb, var(--text-error) 20%, transparent);
        }

        /* Text selection bubble menu */
        /* Liquid Glass Format Bubble - Apple WWDC 2025 style */
        .text-format-bubble {
            position: fixed;
            display: none;
            background: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border-radius: 14px;
            padding: 5px 6px;
            z-index: 10002;
            border: 1px solid rgba(255, 255, 255, 0.6);
            box-shadow:
                0 6px 26px rgba(31, 38, 135, 0.15),
                inset 0 2px 12px rgba(255, 255, 255, 0.25);
            gap: 1px;
            align-items: center;
            transform: translateX(-50%);
            animation: bubbleAppear 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        .text-format-bubble.visible {
            display: flex;
        }

        @keyframes bubbleAppear {
            from {
                opacity: 0;
                transform: translateX(-50%) translateY(6px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateX(-50%) translateY(0) scale(1);
            }
        }

        /* Inner shine layer */
        .text-format-bubble::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.08);
            backdrop-filter: blur(1px);
            box-shadow:
                inset -6px -5px 10px -6px rgba(255, 255, 255, 0.8),
                inset 3px 3px 6px -3px rgba(255, 255, 255, 0.4);
            opacity: 0.7;
            pointer-events: none;
            z-index: -1;
        }

        /* Arrow pointer */
        .text-format-bubble::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 11px;
            height: 6px;
            background: rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            clip-path: polygon(0 0, 100% 0, 50% 100%);
            border: none;
        }

        .text-format-bubble.above::after {
            bottom: auto;
            top: -6px;
            clip-path: polygon(50% 0, 100% 100%, 0 100%);
        }

        .format-btn {
            background: transparent;
            border: none;
            color: rgba(30, 30, 40, 0.75);
            width: 26px;
            height: 26px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-family: inherit;
            transition: all 0.15s ease;
            position: relative;
        }

        .format-btn:hover {
            background: rgba(255, 255, 255, 0.35);
            color: rgba(20, 20, 30, 0.9);
            box-shadow:
                0 2px 8px rgba(0, 0, 0, 0.08),
                inset 0 1px 2px rgba(255, 255, 255, 0.5);
        }

        .format-btn:active {
            transform: scale(0.94);
            background: rgba(255, 255, 255, 0.45);
        }

        .format-btn.active {
            background: rgba(139, 126, 200, 0.3);
            color: #5a4a8a;
            box-shadow:
                inset 0 1px 3px rgba(139, 126, 200, 0.3),
                inset 0 -1px 2px rgba(255, 255, 255, 0.3);
        }

        .format-btn svg {
            width: 14px;
            height: 14px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
        }

        .format-btn.bold-btn {
            font-weight: bold;
            font-size: 14px;
        }

        .format-btn.italic-btn {
            font-style: italic;
            font-size: 14px;
        }

        .format-btn.strike-btn {
            font-size: 14px;
        }

        .format-btn.highlight-btn svg {
            fill: currentColor;
            stroke: none;
        }

        .format-btn.align-btn svg {
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
        }

        .format-separator {
            width: 1px;
            height: 16px;
            background: rgba(0, 0, 0, 0.1);
            margin: 0 3px;
        }

        .button-row {
            display: flex;
            justify-content: space-evenly;
            margin-bottom: 8px;
            margin-right: 7px;
            margin-left: 7px;
            margin-top: 5px;
        }

        .add-folder-btn, .add-shelf-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 10px;
            font-weight: 400;
            padding: 5px 10px;
            cursor: pointer !important;
            border-radius: 6px;
            transition: all 0.2s;
            min-height: 26px;
            height: 26px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }
        
        .add-folder-btn:hover, .add-shelf-btn:hover {
            border-color: rgba(75, 0, 130, 0.4);
            background: color-mix(in srgb, var(--text-secondary) 15%, transparent);
            /* Even spread hover shadow */
            box-shadow: 0 0 6px rgba(0, 0, 0, 0.12), 0 0 3px rgba(0, 0, 0, 0.06);
        }

        .add-folder-btn:hover .btn-icon-glass,
        .add-shelf-btn:hover .btn-icon-glass,
        .retrieve-btn:hover .btn-icon-glass,
        .add-folder-btn:hover .btn-text-glass,
        .add-shelf-btn:hover .btn-text-glass,
        .retrieve-btn:hover .btn-text-glass {
            filter: brightness(1.25) saturate(1.3);
        }

        .new-shelf-input {
            width: 100%;
            background: color-mix(in srgb, var(--text-secondary) 8%, transparent);
            border: none;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 12px;
            padding: 5px 10px;
            border-radius: 6px;
            margin-top: 5px;
            min-height: 26px;
            height: 26px;
            box-sizing: border-box;
            display: none;
        }
        
        .new-shelf-input:focus {
            outline: none;
            border-color: rgba(75, 0, 130, 0.4);
            background: color-mix(in srgb, var(--text-secondary) 15%, transparent);
        }
        
        /* Shelf hierarchy styles */
        .shelf-container {
            margin-bottom: 0;
        }
        
        /* Thin pink border separating unorganized folders from shelves */
        #folderList .folder-item:not(.shelf-folder) + .shelf-container::before {
            content: '';
            display: block;
            border-top: 0.5px solid rgb(210 240 210 / 55%);
            margin: 6px 0 8px 0;
        }
        
        /* Alternative: add border below the last unorganized folder */
        #folderList .folder-item:not(.shelf-folder):last-of-type {
            border-bottom: 0.5px solid rgb(210 240 210 / 55%);
            margin-bottom: 6px;
            padding-bottom: 8px;
        }
        
        .shelf-header {
            background: transparent;
            border: none;
            font-size: 12px !important;
            border-radius: 6px;
            padding: 0 10px;
            cursor: pointer;
            transition: all 0.2s;
            margin-bottom: 5px;
            display: flex;
            align-items: center;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
            font-size: 11px;
            color: var(--text-secondary);
            height: 18px;
            min-height: 18px;
            box-sizing: border-box;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
            margin-top: 2px;
        }
        
        .shelf-header:hover {
            background: rgb(246 253 243); /* Brighter hover */
             /* Darker green hover border */
        }
        
        .shelf-header.open {
            /* No special background when just expanded */
        }
        
        .shelf-header.has-active-notepad {
            position: relative !important;
            background: transparent !important;
            border-color: transparent !important;
            overflow: visible !important;
            box-shadow: none !important;
            isolation: isolate;
            z-index: 10;
        }

        .shelf-header.has-active-notepad::before {
            content: '';
            position: absolute;
            top: -1px;
            left: -1px;
            right: -0.5px;
            bottom: -1px;
            background: #fff0fa;
            border-radius: 8px 7px 9px 7px;
            z-index: 0;
            transform: rotate(0.1deg);
            filter: blur(1px) saturate(2);
        }

        .shelf-header.has-active-notepad::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgb(252 240 250);
            border-radius: 6px;
            z-index: 1;
        }

        .shelf-header.has-active-notepad .shelf-name,
        .shelf-header.has-active-notepad .shelf-toggle,
        .shelf-header.has-active-notepad .shelf-notepad-count,
        .shelf-header.has-active-notepad > * {
            position: relative;
            z-index: 2;
        }
        
        .shelf-content {
            display: flex;
            align-items: center;
            flex: 1;
            width: 100%;
        }
        
        .shelf-expand-icon {
            margin-right: 8px;
            font-size: 10px;
            transition: transform 0.2s;
            color: #707e65;
        }
        
        .shelf-name {
            flex: 1;
            font-weight: 500;
            font-size: 12px !important;
            color: var(--text-primary);
        }
        
        .shelf-count {
            font-size: 11px;
            opacity: 0.7;
            margin-left: 6px;
            margin-right: 4px;
            text-align: center;
            min-width: 20px;
            display: inline-block;
        }
        
        .shelf-expand-icon {
            font-size: 10px;
            width: 10px;
            height: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-right: 8px;
            transform: scale(0.8);
            
        }
        
        .shelf-folders {
            margin-left: 8px;
            padding-left: 0px;
            padding-top: 3px;
            overflow: hidden;
            transition: max-height 0.15s ease-out, 
                       opacity 0.1s ease-out,
                       padding 0.15s ease-out;
        }
        
        .shelf-folders.collapsed {
            max-height: 0;
            opacity: 0;
            pointer-events: none;
            padding-top: 0;
        }
        
        .shelf-folders.expanded {
            opacity: 1;
            pointer-events: auto;
        }
        
        /* Folder hierarchy styles (similar to shelf styles) */
        .folder-container {
            margin-bottom: 0;
        }
        
        .folder-header {
            display: none;
        }
        
        .folder-header:hover {
            background: none;
            border-color: transparent;
        }
        
        .folder-header.active {
            background: none;
            border-color: transparent;
            color: var(--text-secondary);
        }
        
        .folder-expand-icon {
            margin-right: 6px;
            font-size: 10px;
            transition: transform 0.2s;
            color: var(--text-secondary);
        }
        
        .folder-pages {
            margin-left: 12px;
            padding-left: 8px;
            border-left: 1px solid var(--border-color);
            padding-top: 2px;
            overflow: hidden;
            transition: max-height 0.15s ease-out, 
                       opacity 0.1s ease-out,
                       padding 0.15s ease-out;
        }
        
        .folder-pages.collapsed {
            max-height: 0;
            opacity: 0;
            pointer-events: none;
            padding-top: 0;
        }
        
        .folder-pages.expanded {
            opacity: 1;
            pointer-events: auto;
        }
        
        .page-item,
        .header-list .page-item,
        .header-list .header-item.page-item {
            padding: 2px 10px;
            margin: 0;
            margin-bottom: -0.5px !important;
            font-size: 12px !important;
            height: 22px;
            min-height: 22px;
            color: var(--text-primary);
            cursor: pointer;
            background: transparent !important;
            border-radius: 6px !important;
            transition: background-color 0.15s ease;
            border: 0.5px solid #70b870 !important;
            opacity: 0.6;
            display: flex;
            align-items: center;
        }
        
        .page-item:hover {
            background-color: var(--bg-secondary);
            border-color: var(--border-color);
        }
        
        .shelf-folder {
            margin-bottom: 5px;
        }
        
        .shelf-folder .folder-content {
            padding-left: 0px;
        }
        
        /* Visual hierarchy for folders in shelves */
        .shelf-folder {
            opacity: 0.95;
            background: transparent !important;
        }
        
        .shelf-folder:hover {
            background: rgb(246 253 243) !important;
            border-color: rgb(210 240 210 / 70%) !important;
        }
        
        
        /* Drag-and-drop visual feedback */
        .shelf-drop-target {
            background: rgba(200, 50, 200, 0.22) !important;
            border-color: rgba(200, 50, 200, 0.7) !important;
            transform: scale(1.02);
            transition: all 0.2s;
        }
        
        .unorganized-drop-target {
            background: color-mix(in srgb, rgba(0, 130, 75, 0.1) 80%, transparent) !important;
            border: 2px dashed rgba(0, 130, 75, 0.4);
            border-radius: 1px;
        }
        
        .drop-indicator {
            height: 1px;
            background: rgba(75, 0, 130, 0.4);
            margin: 1px 0;
            border-radius: 1px;
            pointer-events: none;
        }
        
        .folder-item.dragging {
            opacity: 0.5;
            transform: rotate(2deg);
        }
        
        .map-toggle-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            cursor: pointer !important;
            padding: 4px 6px;
            margin-bottom: 2px;
            border-radius: 3px;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0.7;
            transition: all 0.1s ease;
            flex-shrink: 0;
        }
        
        .map-toggle-btn:hover {
            opacity: 1;
            color: #20b2aa;
            transform: scale(1.1);
        }
        
        .header-map-toggle-btn:hover {
            opacity: 1;
            color: #20b2aa;
            transform: scale(1.1);
        }
        
        /* Hide header map toggle button by default to prevent flashing */
        .header-map-toggle-btn {
            display: none;
        }
        
        /* Show header map toggle button only when explicitly shown via JS */
        .header-map-toggle-btn.show {
            display: flex;
            margin-top: 2px;
        }
        
        /* Hide header map toggle button in map view since folder toggle buttons handle this */
        body.map-mode .header-map-toggle-btn {
            display: none !important;
        }
        
        /* Prevent browser back/forward swipe gestures in map mode */
        body.map-mode {
            overscroll-behavior-x: none;
            -webkit-overscroll-behavior-x: none;
        }

        /* In map mode, always show notepad title and hide page title */
        body.map-mode .page-title {
            display: none !important;
        }
        body.map-mode .notepad-title {
            display: block !important;
        }
        
        .folder-content {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex: 1;
            gap: 0;
            overflow: hidden;
        }
        
        .confirm-dialog {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: transparent;
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }

        .confirm-box {
            background: var(--bg-primary);
            border: 0.4px solid var(--border-primary);
            border-radius: 24px;
            padding: 30px;
            max-width: 400px;
            width: 80%;
            text-align: center;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            box-shadow: 0 0 60px 20px rgba(0, 0, 0, 0.4) !important;
        }

        .confirm-title {
            position: relative;
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 15px;
        }

        .confirm-title-text {
            position: relative;
            display: inline-block;
        }

        .confirm-title-text::before {
            content: attr(data-text);
            position: absolute;
            left: 0;
            top: 0;
            color: #c0392b;
            filter: blur(0.64px);
            opacity: 0.5;
            z-index: 0;
        }

        .confirm-title-text::after {
            content: attr(data-text);
            position: absolute;
            left: 0;
            top: 0;
            color: #c0392b;
            filter: blur(0.32px);
            opacity: 0.6;
            z-index: 1;
        }

        .confirm-title-text span {
            position: relative;
            z-index: 2;
            color: #c0392b;
        }

        .confirm-message {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 25px;
            line-height: 1.5;
        }

        .confirm-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
        }

        .confirm-btn {
            background: none;
            border: 1px solid #8b4513;
            border-radius: 24px;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12px;
            padding: 8px 16px;
            cursor: pointer !important;
            transition: all 0.2s;
            min-width: 80px;
        }

        .confirm-btn.danger {
            position: relative;
            border-color: transparent;
            background: transparent;
            overflow: visible;
        }

        .confirm-btn.danger::before {
            content: '';
            position: absolute;
            top: 0px;
            left: -1px;
            right: 0px;
            bottom: -1px;
            background: #ff3333;
            border-radius: 25px 24px 26px 24px;
            z-index: 0;
            transform: rotate(0.5deg);
            filter: blur(1px);
        }

        .confirm-btn.danger::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #c0392b;
            border-radius: 24px;
            z-index: 1;
        }

        .confirm-btn.danger span {
            position: relative;
            z-index: 2;
            color: #fff;
        }
        
        .confirm-btn.danger:hover {
            filter: brightness(1.15) saturate(1.2);
        }
        
        .confirm-btn.safe {
            border-color: #888;
        }
        
        .confirm-btn.safe:hover {
            background: var(--text-secondary);
            color: var(--text-dark);
        }

        /* Analyze Dialog Styles */
        .analyze-dialog {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }

        .analyze-box {
            background: var(--bg-primary);
            border: 1px solid rgba(121, 46, 173, 0.4);
            border-radius: 1px;
            padding: 30px;
            max-width: 700px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
        }

        .analyze-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--text-secondary);
            text-align: center;
            padding-bottom: 10px;
            border-bottom: 1px solid rgba(121, 46, 173, 0.2);
        }

        .analyze-instructions {
            font-size: 14px;
            margin-bottom: 20px;
            color: var(--text-hover);
            line-height: 0.2;
        }

        /* Date Range Dialog Styles */
        .date-range-section {
            margin: 20px 0;
        }
        
        .date-range-row {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            gap: 10px;
        }
        
        .date-range-label {
            min-width: 100px;
            color: var(--text-secondary);
            font-size: 14px;
            line-height: 1.2;
        }
        
        .date-range-input {
            flex: 1;
            padding: 8px;
            background: var(--input-bg);
            border: 1px solid var(--border-primary);
            color: var(--text-primary);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 13px;
            line-height: 1.2;
        }
        
        .date-range-input[type="time"] {
            max-width: 150px;
        }
        
        .date-range-input:focus {
            outline: none;
            border-color: var(--text-hover);
        }

        .item-date-range,
        .item-time {
            color: var(--text-hover);
            font-size: 0.85em;
            margin-right: 8px;
            font-weight: normal;
            background: rgb(250 255 248);
            padding: 4px 6px;
            border-radius: 1px;
            border: 0.5px solid rgb(210 240 210 / 55%);
            display: inline;
            vertical-align: baseline;
            cursor: pointer;
            line-height: 1.2;
        }
        
        .analyze-textarea {
            width: 100%;
            height: 300px;
            background: var(--textarea-bg);
            border: 0.4px solid var(--border-primary);
            padding: 15px;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 13px;
            color: var(--text-hover);
            resize: vertical;
            margin-bottom: 20px;
            line-height: 0.2;
        }

        .analyze-textarea:focus {
            outline: none;
            border-color: var(--text-accent);
            background: var(--input-focus-bg);
        }

        /* Mind Map Styles */
        .items.map-mode {
            height: 100%;
            overflow: auto;
            position: relative;
            padding: 0;
            margin-bottom: 0;
        }

        .map-container {
            position: relative;
            width: 100vw;
            height: 100vh;
            min-width: 3000px;
            min-height: 2000px;
            background-color: #f6f6f663;
            background-image: radial-gradient(circle, #8b69141a 1px, transparent 1px);
            background-size: 20px 20px;
            background-position: 0 0;
            opacity: 0;
            overscroll-behavior: none;
            -webkit-overscroll-behavior: none;
            transition: opacity 0.3s ease;
            overflow: visible;
            /* Performance optimizations for smooth panning */
            contain: layout style paint;
            transform: translateZ(0); /* Force hardware acceleration */
        }
        .map-container.ready {
            opacity: 1;
        }
        
        /* Mini-map styles - only show in map mode */
        .mini-map {
            position: fixed;
            bottom: 50px;
            right: 20px;
            width: 200px;
            height: 150px;
            
            /* Liquid Glass Effect - matching header/bottom-stats */
            background: linear-gradient(
                135deg,
                rgba(255, 255, 255, 0.1) 0%,
                rgba(255, 255, 255, 0.05) 40%,
                rgba(255, 255, 255, 0.02) 100%
            );
            backdrop-filter: blur(12px) saturate(150%);
            -webkit-backdrop-filter: blur(12px) saturate(150%);
            /* filter: url(#liquid-glass-filter); Disabled for performance */
            
            /* Glass-like border and shadows - matching other elements */
            border: 0.5px solid rgba(255, 255, 255, 0.18);
            box-shadow: 
                inset 0 1px 2px rgba(255, 255, 255, 0.3),
                inset 0 -1px 2px rgba(0, 0, 0, 0.1),
                0 2px 10px rgba(0, 0, 0, 0.05),
                0 1px 3px rgba(255, 255, 255, 0.2);
            
            border-radius: 6px;
            z-index: 999998;
            overflow: hidden;
            display: none; /* Hidden by default */
            transition: opacity 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
        }
        
        /* Show mini-map only in map mode during interactions */
        body.map-mode .mini-map {
            display: block;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        
        body.map-mode .mini-map.show {
            opacity: 1;
        }
        
        /* Move minimap left when calendar is open */
        .terminal.with-calendar ~ .mini-map,
        body:has(.terminal.with-calendar) .mini-map {
            right: calc(21.45vw + 20px); /* Move left by calendar width */
        }
        
        
        .mini-map-content {
            position: relative;
            width: 100%;
            height: 100%;
            background: transparent;
            pointer-events: auto; /* Allow clicks through glass */
        }
        
        .mini-map-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        
        .mini-map-viewport {
            position: absolute;
            border: none; /* Remove border */
            background: linear-gradient(
                135deg,
                rgba(236, 72, 153, 0.15),
                rgba(236, 72, 153, 0.08)
            );
            box-shadow: 
                inset 0 0 2px rgba(255, 255, 255, 0.3),
                0 0 4px rgba(236, 72, 153, 0.2);
            pointer-events: none;
            min-width: 4px;
            min-height: 4px;
            opacity: 0.6;
            transition: opacity 0.3s ease, box-shadow 0.3s ease;
            border-radius: 1px;
        }
        
        /* Mini-map nodes */
        .mini-map-node {
            position: absolute;
            width: 4px;
            height: 4px;
            border-radius: 2px;
            background: rgba(255, 255, 255, 0.7);
        }
        
        .mini-map-node.header-node {
            background: rgba(255, 255, 255, 0.9);
            width: 6px;
            height: 6px;
        }
        
        /* Map mode fixes for all screen sizes */
        body.map-mode .content-area {
            padding: 0 !important; /* Remove all padding in map mode */
            background-image: none !important; /* Remove dot background - map-container has its own */
            background-color: transparent !important;
        }
        
        body.map-mode #items {
            display: block !important; /* Ensure items div is visible */
            height: 100vh;
            min-height: 100vh;
            overflow: visible;
        }
        
        /* Hide map controls completely */
        .map-controls {
            display: none !important;
        }
        
      
        .map-nodes {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 100;
            pointer-events: none;
            --border-alpha: 1; /* Default border opacity, will fade at high zoom levels */
            /* Performance optimizations for smooth panning */
            will-change: transform;
            contain: layout style;
            transform: translateZ(0); /* Force hardware acceleration */
        }

        .map-page-nodes {
            /* Performance optimizations for smooth panning with iframes */
            will-change: transform;
            contain: layout style;
            transform: translateZ(0); /* Force hardware acceleration */
        }

        .map-node {
            position: absolute;
            min-width: 150px;
            max-width: 300px;
            padding: 8px 12px;
            background: var(--bg-primary);
            border-width: 0.5px;
            border-style: solid;
            border-color: rgba(200, 200, 200, 0.5);
            border-radius: 24px;
            cursor: move;
            pointer-events: auto; /* Ensure nodes are interactive */
            box-shadow: 0 0 4px rgba(0, 0, 0, 0.08);
            z-index: 200;
            font-size: 15.5px !important;
            line-height: 1.4;
            word-wrap: break-word;
            user-select: none;
            transition: box-shadow 0.2s ease;
            display: block; /* Changed from flex to block for consistent sizing */
            pointer-events: auto;
            box-sizing: border-box; /* Ensure consistent box model */
        }

        .map-node:hover {
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
        }
        
        /* Composite node styles */
        .map-node.composite-node {
            border: 0.5px solid rgba(41, 128, 185, calc(0.5 * var(--border-alpha, 1))) !important;
            color: var(--text-primary);
            padding: 12px;
        }
        
        .composite-content {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        
        .composite-item {
            display: flex;
            align-items: flex-start;
            gap: 0px !important;
            min-height: 20px;
            align-items: center !important;
        }
        

        .map-node.dragging {
            z-index: 1000;
            box-shadow: 0 8px 20px rgba(0,0,0,0.3);
            transform: rotate(2deg);
        }

        .map-node.header-node {
            background: transparent;
            font-weight: bold;
            border: none;
            font-size: 11px; /* Default fallback */
            border-radius: 0;
            z-index: 250;
            text-align: left;
            display: block;
            width: fit-content;
            max-width: 300px;
            min-width: 80px;
            padding: 2px 4px !important;
            margin: 0 !important;
            line-height: 1 !important;
            white-space: nowrap;
            overflow: visible;
            text-overflow: ellipsis;
            box-shadow: none;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3),
                         0 1px 2px rgba(0, 0, 0, 0.2);
            min-width: 0px !important;
        }

        .map-node.task-node {
            border: var(--node-border-width, 0.5px) solid rgba(121, 46, 173, calc(0.5 * var(--border-alpha, 1))) !important;
            color: rgb(121 46 173 / 97%);
        }

        .map-node.note-node {
            border: var(--node-border-width, 0.5px) solid rgba(41, 128, 185, calc(0.5 * var(--border-alpha, 1))) !important;
            color: #2980b9;
        }

        .map-node.table-node {
            border: var(--node-border-width, 0.5px) solid rgba(41, 128, 185, calc(0.5 * var(--border-alpha, 1))) !important;
            color: #2980b9;
            max-width: none !important; /* Tables have no max-width limit */
            position: relative;
            overflow: visible !important; /* Allow add buttons to show beyond bounds */
            border-radius: 6px;
        }
        
        .map-table {
            border-collapse: collapse;
            width: 100%;
            font-size: 13px;
            background: transparent;
        }
        
        .map-table td {
            border: 1px solid #e0e0e0;
            padding: 8px 12px;
            min-width: 80px;
            position: relative;
            background: transparent;
            outline: none;
            color: #333;
        }
        
        .map-table td:focus {
            background: rgba(0, 0, 0, 0.05);
            box-shadow: inset 0 0 0 2px #2980b9;
        }
        
        .map-table td:hover {
            background: rgba(0, 0, 0, 0.03);
        }
        
        .table-controls {
            position: absolute;
            display: none;
            gap: 4px;
        }
        
        .map-node.table-node:hover .table-controls {
            display: flex;
        }
        
        .table-btn {
            width: 24px;
            height: 24px;
            border: 1px solid rgba(0, 255, 0, 0.3);
            background: rgba(0, 255, 0, 0.05);
            border-radius: 1px;
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0.7;
            transition: all 0.2s;
            color: rgb(0, 200, 0);
        }
        
        .table-btn:hover {
            opacity: 1;
            background: rgba(0, 255, 0, 0.15);
            border-color: rgb(0, 255, 0);
            box-shadow: 0 0 4px rgba(0, 255, 0, 0.3);
        }
        
        .table-btn.add-row {
            position: absolute;
            bottom: -28px;
            left: 50%;
            transform: translateX(-50%);
        }
        
        .table-btn.add-col {
            position: absolute;
            right: -28px;
            top: 50%;
            transform: translateY(-50%);
        }

        .map-node.document-node {
            border: 1px solid #9333ea;
        }
        .map-node.doc-node {
            border: 1px solid #605c5c45;
            flex-direction: column;
            align-items: flex-start;
            min-width: 200px;
            position: relative;
            padding: 10px 14px !important;
            margin: 0 !important;
            height: auto !important;
            min-height: auto !important;
            max-height: none !important;
            box-sizing: border-box;
        }
        .map-node.doc-node .doc-label {
            position: absolute;
            top: -8px;
            left: 10px;
            background: var(--bg-primary);
            padding: 2px 6px;
            font-size: 10px;
            color: var(--text-accent);
            font-weight: bold;
            border-radius: 3px;
            border: 1px solid #605c5c45;
            line-height: 1.3;
            z-index: 1;
        }
        .map-node.doc-node .doc-content {
            font-size: 13.3px;
            line-height: 1.4;
            word-wrap: break-word;
            max-height: none !important;
            height: auto !important;
            overflow: visible !important;
            display: block !important;
            -webkit-line-clamp: none !important;
            -webkit-box-orient: unset !important;
            white-space: normal !important;
            text-overflow: unset !important;
            /* Force these properties to override any competing rules */
            min-height: unset !important;
            flex-basis: auto !important;
            flex-shrink: 0 !important;
        }
        .map-node.doc-node .doc-content * {
            max-width: 100%;
        }
        
        /* Picture node styles */
        .map-node.picture-node {
            border: none !important;
            background: transparent !important;
            padding: 0 !important;
            border-radius: 6px;
            max-width: none !important; /* Remove size constraints for resizing */
            max-height: none !important; /* Remove size constraints for resizing */
            min-width: 120px; /* Better default size */
            min-height: 120px; /* Better default size */
            width: 120px; /* Initial placeholder size */
            height: 120px; /* Initial placeholder size */
            overflow: visible !important;
            /* Inherit box-shadow from regular .map-node */
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            /* Smooth transitions for size and opacity changes */
            transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
        }
        
        .map-node.picture-node.loading:not(.resizing) {
            opacity: 0.6;
            background: linear-gradient(135deg, #f0f0f0 25%, transparent 25%, transparent 50%, #f0f0f0 50%, #f0f0f0 75%, transparent 75%);
            background-size: 20px 20px;
            animation: loading-stripes 1s linear infinite;
        }
        
        @keyframes loading-stripes {
            0% { background-position: 0 0; }
            100% { background-position: 20px 20px; }
        }
        
        .map-node.picture-node:hover {
            box-shadow: none;
        }
        
        .map-node.picture-node.dragging {
            box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
        }
        
        .map-node.picture-node img {
            width: 100%;
            height: 100%; 
            object-fit: contain;
            border-radius: 6px;
            display: block;
            transition: opacity 0.3s ease; /* Smooth fade-in for images */
        }
        
        .map-node.picture-node .picture-filename {
            font-size: 11px;
            color: #22c55e;
            margin-top: 4px;
            text-align: center;
            word-break: break-all;
        }

        /* Video node styles */
        .map-node.video-node {
            background: transparent !important;
            border-radius: 6px;
            max-width: none !important;
            max-height: none !important;
            min-width: 280px;
            min-height: 157px;
            width: 560px;
            height: 315px;
            overflow: hidden;
            position: relative;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
        }

        .map-node.video-node:hover {
            box-shadow: none;
        }

        .map-node.video-node.dragging {
            box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
        }

        .map-node.video-node iframe {
            width: 100%;
            height: 100%;
            border: none;
            border-radius: 6px;
            pointer-events: none;
        }
        
        /* Allow pointer events only when hovering and not zooming */
        .map-node.video-node:hover iframe {
            pointer-events: auto;
        }
        
        /* Disable pointer events when holding ctrl (zooming) */
        body.ctrl-held .map-node.video-node iframe {
            pointer-events: none !important;
        }

        /* Disable iframe interaction during drag to allow container dragging */
        body.dragging .map-node.video-node iframe,
        .map-node.video-node.dragging iframe {
            pointer-events: none !important;
        }

        /* Add border around video for drag area */
        .map-node.video-node {
            border: 6px solid rgba(0,0,0,0.1);
            padding: 0;
            box-sizing: border-box;
        }

        /* Video iframe fills the inner area without being cut off */
        .map-node.video-node iframe {
            width: 100%;
            height: 100%;
            display: block;
        }

        /* Visual cue for draggable video */
        .map-node.video-node:hover {
            cursor: move;
        }

        /* Override cursor when hovering over iframe for video controls */
        .map-node.video-node iframe:hover {
            cursor: auto;
        }

        /* Show drag hint on hover */
        .map-node.video-node:hover::after {
            content: 'Click border to drag';
            position: absolute;
            bottom: -20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 2px 8px;
            border-radius: 1px;
            font-size: 10px;
            white-space: nowrap;
            z-index: 100;
            pointer-events: none;
        }
        
        /* Spotify node styles */
        .map-node.spotify-node {
            background: transparent !important;
            border-radius: 12px;
            max-width: none !important;
            max-height: none !important;
            overflow: hidden;
            position: relative;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
            transition: width 0.3s ease, height 0.3s ease, box-shadow 0.3s ease;
            border: none;
            padding: 0;
            box-sizing: content-box;
        }

        .map-node.spotify-node.spotify-track {
            min-width: 300px;
            min-height: 80px;
            width: 300px;
            height: 80px;
        }

        .map-node.spotify-node.spotify-album,
        .map-node.spotify-node.spotify-playlist,
        .map-node.spotify-node.spotify-episode,
        .map-node.spotify-node.spotify-show {
            min-width: 300px;
            min-height: 152px;
            width: 300px;
            height: 152px;
        }

        .map-node.spotify-node:hover {
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
            cursor: move;
        }

        .map-node.spotify-node.dragging {
            box-shadow: 0 8px 20px rgba(0,0,0,0.4) !important;
            border: none !important;
            background: transparent !important;
        }

        .map-node.spotify-node iframe {
            width: 100%;
            height: 100%;
            border: none;
            border-radius: 12px;
            pointer-events: auto;
        }
        
        /* Ensure drag overlay stays positioned correctly */
        .spotify-drag-overlay {
            box-sizing: border-box;
            /* Remove any transforms that might affect positioning */
            transform: none !important;
        }

        /* Disable iframe when actively dragging */
        .map-node.spotify-node.dragging iframe,
        body.dragging .map-node.spotify-node iframe {
            pointer-events: none !important;
        }

        /* Disable during zoom (ctrl held) */
        body.ctrl-held .map-node.spotify-node iframe {
            pointer-events: none !important;
        }


        /* Page node styles - override default map-node constraints */
        .map-node.page-node {
            position: relative; /* Positioning context for skeleton */
            max-width: none !important;
            min-width: 664px !important; /* Adjusted for A4-like content width (~600px) */
            /* width: 600px; - Removed hardcoded width to preserve resized dimensions */
            min-height: 1000px;
            height: 1000px; /* Fixed A4-like height - matches list view's 900px content + title/padding */
            padding: 12px;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            overflow: hidden !important; /* Clip content - overflow goes to next page */
            border: 0.5px solid rgb(210 240 210 / 55%) !important;
            border-radius: 24px !important;
            /* Light box-shadow for page nodes - matches other map nodes */
            box-shadow: 0 0 4px rgba(0, 0, 0, 0.08) !important;
            /* Performance optimizations for pan/zoom */
            contain: layout style;
            will-change: transform;
            transform: translateZ(0); /* Force GPU layer */
            cursor: default !important; /* Default cursor - iframe content will show text cursor */
        }
        
        /* Show pale green highlight on page node hover */
        .map-node.page-node:hover {
            background-color: rgba(154, 206, 154, 0.25) !important;  /* More visible pale green background */
            cursor: move;  /* Show move cursor to indicate draggable */
        }

        /* Keep green highlight when page node is focused/selected */
        .map-node.page-node.focused {
            background-color: rgba(154, 206, 154, 0.25) !important;  /* Same green as hover */
            border-color: rgba(154, 206, 154, 0.6) !important;  /* Slightly more visible border */
        }

        /* Disable hover effects while loading */
        .map-node.page-node.loading:hover {
            background-color: transparent !important;
            cursor: default !important;
        }
        
        /* Override the general dragging styles for page nodes - needs to be after .map-node.dragging rule */
        .map-node.page-node.dragging {
            background-color: rgba(154, 206, 154, 0.15) !important;  /* Slightly stronger green while dragging */
            border: 0.5px solid rgb(210 240 210 / 55%) !important;  /* Keep original border */
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;  /* Keep consistent light shadow */
            cursor: grabbing !important;  /* Grabbing cursor while dragging */
        }
        
        /* Container for iframe to clip overflow while allowing resize handles outside */
        .map-node.page-node .iframe-container {
            width: 100% !important;
            height: 100% !important;
            overflow: hidden !important;
            border-radius: 24px !important;
            position: relative !important;
            pointer-events: auto; /* Allow pointer events to reach iframe */
            cursor: text !important;
        }

        /* Override page-node move cursor when over iframe content */
        .map-node.page-node:hover .iframe-container,
        .map-node.page-node:hover .iframe-container iframe {
            cursor: text !important;
        }
        
        /* Make iframe fill the entire page node */
        .map-node.page-node iframe {
            width: 100% !important;
            height: 100% !important;
            border: none !important;
            display: block !important;
            overflow: hidden !important;
            cursor: text !important;  /* Text cursor for editing content */
            border-radius: 18px !important;
            pointer-events: auto; /* Enable pointer events - panning handled via message passing */
        }

        /* Page node editor container */
        .map-node.page-node .page-node-editor {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .map-node.page-node .page-node-lines-container {
            min-height: 100px;
            max-height: 900px; /* Match list view's PAGE_CONTENT_HEIGHT */
            overflow: hidden !important;
        }

        /* Force grabbing cursor during map panning - avoid universal selector for performance */
        body.map-panning {
            cursor: grabbing !important;
        }

        body.map-panning .map-container,
        body.map-panning .map-nodes,
        body.map-panning .map-page-nodes,
        body.map-panning .map-node {
            cursor: grabbing !important;
        }

        /* Disable iframe interactions during panning but keep text cursor */
        body.map-panning .map-node.page-node {
            cursor: text !important;
        }
        body.map-panning .map-node.page-node iframe {
            pointer-events: none !important;
            cursor: text !important;
        }

        /* Force iframe onto its own compositor layer for smoother transforms */
        .map-node.page-node iframe {
            transform: translateZ(0);
            will-change: transform;
            backface-visibility: hidden;
        }

        /* Use contain: strict on page nodes during zoom for maximum isolation */
        body.map-zooming .map-node.page-node {
            contain: strict;
        }

        /* Page node loading state - hide iframe until ready */
        .map-node.page-node.loading {
            /* Disable ALL transitions during loading for instant positioning */
            transition: none !important;
            z-index: 10000 !important; /* Above bottom-stats (z-index: 2000) during loading */
        }

        .map-node.page-node.loading iframe {
            opacity: 0 !important;
            visibility: hidden !important;
            display: none !important;
            pointer-events: none !important;
            z-index: 1 !important;
        }

        .map-node.page-node iframe {
            position: relative;
            z-index: 1;
        }

        .map-node.page-node:not(.loading) iframe {
            opacity: 1;
            visibility: visible;
        }

        /* Loading overlay for page nodes - styles defined inline in JS */
        .map-node.page-node:not(.loading) .page-node-overlay {
            display: none;
        }

        .page-node-overlay .skeleton-line {
            height: 12px;
            background: linear-gradient(90deg, rgb(200, 230, 200) 25%, rgb(170, 220, 170) 50%, rgb(200, 230, 200) 75%);
            background-size: 200% 100%;
            animation: skeleton-shimmer 1.5s infinite;
            border-radius: 3px;
        }

        .page-node-overlay .skeleton-line:nth-child(1) { width: 70%; }
        .page-node-overlay .skeleton-line:nth-child(2) { width: 100%; }
        .page-node-overlay .skeleton-line:nth-child(3) { width: 85%; }
        .page-node-overlay .skeleton-line:nth-child(4) { width: 60%; height: 16px; margin-top: 14px; }
        .page-node-overlay .skeleton-line:nth-child(5) { width: 95%; }
        .page-node-overlay .skeleton-line:nth-child(6) { width: 75%; }
        .page-node-overlay .skeleton-line:nth-child(7) { width: 100%; }
        .page-node-overlay .skeleton-line:nth-child(8) { width: 45%; }

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

        /* Smooth reveal when loaded */
        .map-node.page-node iframe {
            transition: opacity 0.15s ease-out !important;
        }

        .map-node.page-node:not(.loading) iframe {
            opacity: 1 !important;
        }

        /* ============================================================================
           PAGE NODE INLINE EDITOR STYLES
           ============================================================================ */

        /* Editor container */
        .page-node-editor {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: white;
            border-radius: 18px;
        }

        /* Title bar */
        .page-node-title-bar {
            padding: 12px 20px;
            flex-shrink: 0;
            background: white;
        }

        /* Editable title */
        .page-node-title {
            font-size: 18px;
            font-weight: 600;
            outline: none;
            cursor: text;
            color: #333;
        }

        .page-node-title:empty::before {
            content: 'Untitled';
            color: #999;
        }

        .page-node-title:focus {
            outline: none;
        }

        /* Lines container */
        .page-node-lines-container {
            flex: 1;
            overflow: visible;
            padding: 16px 20px 50px 35px;
            background: white;
            min-height: 200px;
        }

        .page-node-lines-container.items {
            margin-top: 20px !important;
            overflow: visible !important;
            width: 700px;
            max-width: 100%;
        }

        /* Inherit list-line styles in page nodes */
        .page-node-lines-container .list-line {
            position: relative;
        }

        /* Show drag handles on hover in page nodes */
        .page-node-lines-container .list-line:hover .item-drag-handle {
            opacity: 0.5;
        }

        /* Override cursor in page node content area */
        .map-node.page-node:hover .page-node-editor {
            cursor: text;
        }

        .map-node.page-node .page-node-lines-container {
            cursor: text;
        }

        /* Disable panning interactions during editing */
        body.map-panning .page-node-editor {
            pointer-events: none;
        }

        .page-title-bar {
            background: rgba(16, 185, 129, 0.1);
            border-bottom: 1px solid rgba(16, 185, 129, 0.3);
            padding: 8px 12px;
            font-weight: bold;
            font-size: 12px;
            color: #22c55e;
            flex-shrink: 0;
        }
        
        /* Make content-area work inside page node */
        .map-node.page-node .content-area {
            flex: 1;
            overflow: auto;
        }
        
        /* Remove sidebar spacing in page nodes */
        .map-node.page-node .terminal,
        .map-node.page-node .terminal.with-calendar {
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
            position: relative !important;
            height: 100% !important;
            border-right: none !important;
            box-shadow: none !important;
        }
        
        /* Hide sidebar, calendar, toolbars, commands, and system messages in page nodes */
        .map-node.page-node .side-window-indicator,
        .map-node.page-node .calendar-container,
        .map-node.page-node .drawing-toolbar,
        .map-node.page-node .document-toolbar,
        .map-node.page-node .commands,
        .map-node.page-node #commandsSection,
        .map-node.page-node #command-wrapper,
        .map-node.page-node .system-message-popup,
        .map-node.page-node #systemMessagePopup {
            display: none !important;
        }
        
        /* Also hide these elements in iframe context */
        body.in-iframe .commands,
        body.in-iframe #commandsSection,
        body.in-iframe #command-wrapper,
        body.in-iframe #command-list-input,
        body.in-iframe #command-blur-overlay,
        body.in-iframe [id*="command"],
        body.in-iframe [class*="command"],
        body.in-iframe .system-message-popup,
        body.in-iframe #systemMessagePopup {
            display: none !important;
        }
        
        /* Ensure terminal has no border in iframe */
        body.in-iframe .terminal {
            border-right: none !important;
            border: none !important;
            box-shadow: none !important;
        }

        /* Hide date in iframes */
        body.in-iframe .date,
        body.in-iframe #currentDate {
            display: none !important;
        }

        /* Round top corners of header in iframe to match page node border-radius */
        body.in-iframe .header {
            border-top-left-radius: 24px !important;
            border-top-right-radius: 24px !important;
        }

        /* Add generous fixed margins to content area in page nodes */
        .map-node.page-node .content-area {
            margin: 20px 30px !important;
            padding: 0 !important;
            width: calc(100% - 60px) !important;
            box-sizing: border-box !important;
        }
        
        /* Force override any JavaScript-applied padding/margin */
        .map-node.page-node .content-area {
            padding-left: 0 !important;
            padding-right: 0 !important;
            margin-left: 30px !important;
            margin-right: 30px !important;
        }
        
        /* Force items container to have margin too */
        .map-node.page-node .items {
            margin: 0 15px !important;
            padding: 0 !important;
            width: calc(100% - 30px) !important;
            box-sizing: border-box !important;
            max-width: none !important;
        }
        
        /* Hide item navigation arrows in page nodes */
        .map-node.page-node .item-arrows {
            display: none !important;
        }

        /* Show drag handles in page node inline editors on hover */
        .map-node.page-node .page-node-lines-container .list-line,
        .map-node.page-node .page-node-lines-container .list-line.note-line,
        .map-node.page-node .page-node-lines-container .list-line.item,
        .map-node.page-node .page-node-lines-container .item {
            position: relative !important;
            overflow: visible !important;
        }

        .map-node.page-node .page-node-lines-container .list-line:hover .item-drag-handle,
        .map-node.page-node .page-node-lines-container .item:hover .item-drag-handle {
            display: flex !important;
            pointer-events: auto !important;
            opacity: 1 !important;
            visibility: visible !important;
            left: -12px !important;
        }
        
        /* Aggressively prevent mobile styling in page nodes */
        .map-node.page-node * {
            /* Override any width-based mobile styles */
            font-size: inherit !important;
        }
        
        /* Force desktop layout in page nodes - override mobile media queries */
        .map-node.page-node .content-area {
            padding: 60px 5px 120px 5px !important; /* Force desktop padding */
            margin-top: 0 !important;
        }
        
        .map-node.page-node .terminal,
        .map-node.page-node .terminal.with-calendar {
            margin: 0 !important;
            padding: 0 !important;
            width: 100% !important;
        }
        
        /* Override mobile item styles */
        .map-node.page-node .item {
            font-size: 14px !important;
            padding: 1px 0 1px 5px !important;
            line-height: normal !important;
        }
        
        /* Override mobile input styles */
        .map-node.page-node input,
        .map-node.page-node textarea {
            font-size: 14px !important;
            padding: 5px !important;
        }
        
        /* Comprehensive override of all mobile media queries for page nodes */
        .map-node.page-node .content-area {
            padding: 60px 5px 120px 5px !important; /* Force desktop padding */
            margin-top: 0 !important;
        }
        
        .map-node.page-node .header {
            padding: 15px 15px 10px 15px !important; /* Desktop header padding */
        }
        
        .map-node.page-node .items {
            margin-top: 0 !important;
            padding-top: 0 !important;
            margin-bottom: 25px !important; /* Desktop bottom margin, not mobile 140px */
        }
        
        .map-node.page-node .item {
            font-size: 14px !important; /* Desktop font size */
            padding: 1px 0 1px 5px !important; /* Desktop padding */
            line-height: normal !important;
        }
        
        .map-node.page-node .item-actions {
            opacity: 1 !important; /* Show actions on desktop */
            pointer-events: auto !important;
            position: static !important;
            right: auto !important;
            top: auto !important;
            transform: none !important;
            width: auto !important;
        }
        
        /* Force desktop view picker styles */
        .map-node.page-node .view-btn {
            padding: 4px 12px !important; /* Desktop button padding */
            font-size: 14px !important; /* Desktop font size */
            min-height: auto !important;
            min-width: auto !important;
        }
        
        /* Force desktop year navigation */
        .map-node.page-node .year-nav {
            padding: 4px 8px !important; /* Desktop padding */
            font-size: 9px !important; /* Desktop font size */
            min-height: auto !important;
            min-width: auto !important;
        }
        
        /* Force desktop date picker */
        .map-node.page-node .day-square {
            font-size: 11px !important; /* Desktop font size */
            min-height: 30px !important; /* Desktop height */
            border: 1px solid rgba(139, 105, 20, 0.1) !important;
        }
        
        
        
        /* Force all content to fit within page node width */
        .map-node.page-node * {
            max-width: none !important;
            box-sizing: border-box !important;
        }
        
        /* Ensure body and html inside iframe adapt to container */
        .map-node.page-node body,
        .map-node.page-node html {
            width: 100% !important;
            max-width: none !important;
            overflow-x: hidden !important;
        }
        
        /* Remove spacing from header in page nodes */
        .map-node.page-node .header {
            margin: 0 !important;
            padding: 10px !important;
            width: 100% !important;
            max-width: none !important;
        }
        
        /* Ensure inline inputs and other elements adapt to narrow width */
        .map-node.page-node .inline-input-container,
        .map-node.page-node #inline-input,
        .map-node.page-node .edit-input,
        .map-node.page-node .item {
            max-width: none !important;
            width: 100% !important;
            box-sizing: border-box !important;
        }
        
        /* Force text wrapping and prevent overflow in page nodes */
        .map-node.page-node .item,
        .map-node.page-node .item-text,
        .map-node.page-node .app-task-text,
        .map-node.page-node span,
        .map-node.page-node div,
        .map-node.page-node p {
            word-wrap: break-word !important;
            word-break: break-word !important;
            overflow-wrap: break-word !important;
            white-space: pre-wrap !important;
            max-width: 100% !important;
            overflow: hidden !important;
        }
        
        /* Ensure content containers don't exceed page node width */
        .map-node.page-node .terminal,
        .map-node.page-node .content-area {
            overflow-x: hidden !important;
            word-wrap: break-word !important;
        }

        .map-node.page-node .items {
            overflow: visible !important;
            word-wrap: break-word !important;
        }
        
        /* Page mode - show sidebar only in fullscreen, not in iframes */
        body.page-mode:not(.in-iframe) .side-window-indicator {
            display: block !important;
        }
        
        body.page-mode:not(.in-iframe) .calendar-container {
            display: block !important;
        }
        
        /* In fullscreen page mode (not iframe), adjust widths for sidebar */
        body.page-mode:not(.in-iframe) .terminal {
            width: calc(100% - 0px) !important; /* Space for closed sidebar */
        }
        
        body.page-mode:not(.in-iframe) .terminal.with-calendar {
            width: calc(100% - 21.45vw) !important; /* Space for open sidebar */
        }
        
        body.page-mode:not(.in-iframe) .header {
            width: calc(100% - 0px) !important; /* Match terminal */
        }
        
        body.page-mode:not(.in-iframe) .terminal.with-calendar .header {
            width: calc(100% - 21.45vw) !important; /* Match terminal when calendar open */
        }
        
        body.page-mode:not(.in-iframe) .bottom-stats {
            width: calc(100% - 0px) !important;
        }
        
        body.page-mode:not(.in-iframe) .terminal.with-calendar .bottom-stats {
            width: calc(100% - 21.45vw) !important;
        }
        
        /* Show footer elements in fullscreen page mode - override with highest specificity */
        body.page-mode.show-fullscreen-elements .footer-notepads,
        body.page-mode.show-fullscreen-elements .bottom-footer,
        body.show-fullscreen-elements.page-mode .footer-notepads,
        body.show-fullscreen-elements.page-mode .bottom-footer {
            display: block !important;
            visibility: visible !important;
        }
        
        /* Calendar footer needs flex display - comes after block rule to override */
        body.page-mode.show-fullscreen-elements .calendar-footer,
        body.show-fullscreen-elements.page-mode .calendar-footer {
            display: flex !important;
            visibility: visible !important;
        }
        
        /* Show date in header for fullscreen page mode - override with highest specificity */
        body.page-mode.show-fullscreen-elements .header .date,
        body.show-fullscreen-elements.page-mode .header .date {
            display: block !important;
            visibility: visible !important;
            position: absolute !important;
            right: 50px !important; /* Position from right edge, making space for button */
            top: 50% !important;
            transform: translateY(-50%) !important;
        }
        
        /* Show page title instead of daily notepad in page mode */
        /* Page mode header styling - let JS handle the title */
        @media (max-width: 1200px) {
            body.page-mode .header {
                padding: 5px 20px 5px 5px !important; /* Keep normal padding, not the media query padding */
            }
        }
        
        body.page-mode .header .date {
            display: none;
        }
        
        body.page-mode .side-window-indicator {
            display: none;
        }
        
        body.page-mode .calendar-container {
            display: none;
        }
        
        body.page-mode .footer-notepads,
        body.page-mode .bottom-footer,
        body.page-mode .calendar-footer {
            display: none;
        }
        
        /* OVERRIDE: Keep footer visible in map mode even if page-mode class is added */
        body.map-mode .footer-notepads,
        body.map-mode .bottom-footer {
            display: block !important;
        }
        
        body.map-mode .calendar-footer {
            display: flex !important;
        }
        
        body.page-mode .stats {
            bottom: 30px;
            top: auto;
            left: 30px;
            right: auto;
            text-align: left;
            display: flex !important;
            align-items: center;
            justify-content: flex-end;
        }
        
        body.page-mode .header h1 {
            /* Don't hide - let JS set the title */
        }
        
        body.page-mode .terminal,
        body.page-mode .terminal.with-calendar {
            width: 100% !important; /* Full width since sidebar is hidden */
            max-width: none !important;
        }
        
        body.page-mode .header,
        body.page-mode .terminal.with-calendar .header {
            width: 100% !important; /* Full width since sidebar is hidden */
            max-width: none !important;
        }
        
        /* Page fullscreen mode */
        body.page-fullscreen-active .map-nodes > *:not(.page-fullscreen) {
            display: none !important;
        }
        
        body.page-fullscreen-active .map-background,
        body.page-fullscreen-active .map-container > *:not(.map-nodes) {
            display: none !important;
        }
        
        /* Iframe fullscreen mode - make content scale properly */
        body.iframe-fullscreen .terminal {
            width: 100% !important;
            height: 100vh !important;
            max-width: none !important;
            max-height: none !important;
            overflow-y: auto !important;
        }
        
        body.iframe-fullscreen .header {
            width: 100% !important;
            max-width: none !important;
        }

        body.page-mode .header,
        body.page-mode .terminal.with-calendar .header {
            width: 100% !important;
            border-right: none !important;
        }
        
        body.page-mode .content-area {
            width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
        }
        
        body.page-mode .bottom-stats,
        body.page-mode .terminal.with-calendar .bottom-stats {
            width: 100% !important; /* Full width since sidebar is hidden */
            left: 0 !important;
            right: auto !important;
            justify-content: flex-end !important; /* Keep footer-stats on right when footer-notepads is hidden */
        }
        
        /* Table node styles */
        .map-node.table-node {
            padding: 0;
        }
        .map-node.table-node table {
            border-radius: 1px;
            overflow: hidden;
        }
        
        /* Table row selection styles */
        .table-row-selected {
            background-color: rgba(41, 128, 185, 0.15) !important;
        }
        
        .table-row-selected td {
            background-color: rgba(41, 128, 185, 0.15) !important;
        }
        
        /* Map Context Menu */
        .map-context-menu {
            position: absolute;
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 24px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            z-index: 10000;
            min-width: 120px;
            padding: 12px 0;
            overflow: hidden;
        }
        
        .context-menu-item {
            padding: 8px 12px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            color: var(--text-primary);
            transition: background-color 0.15s ease;
        }
        
        .context-menu-item:hover {
            background: var(--bg-secondary);
        }
        
        .context-menu-item.delete-item:hover {
            background: rgba(239, 68, 68, 0.1);
            color: #ef4444;
        }
        
        .context-menu-item span {
            font-size: 14px;
        }

        .map-controls {
            position: absolute;
            top: 10px;
            right: 10px;
            z-index: 100;
            display: flex;
            gap: 8px;
            display:none;
        }

        .map-control-btn {
            padding: 8px 12px;
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 1px;
            cursor: pointer;
            font-size: 12px;
            color: var(--text-secondary);
            transition: all 0.2s ease;
        }

        .map-control-btn:hover {
            background: var(--bg-secondary);
            color: var(--text-hover);
        }

        .map-connections {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 50;
            overflow: visible;
        }
        
        /* Divider animation */
        @keyframes pulse {
            0% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.7; }
            100% { transform: scale(1); opacity: 1; }
        }
        
        .divider-start-indicator {
            animation: pulse 1s infinite;
        }
        
        /* Divider line styling */
        .divider-group {
            pointer-events: none;
        }
        
        .divider-line {
            pointer-events: none;
        }

        .map-connection-line {
            stroke: #00ff00;
            stroke-width: 2;
            fill: none;
            opacity: 0.4;
            pointer-events: auto;
            cursor: pointer;
        }
        
        .connection-group {
            pointer-events: auto;
        }
        
        .temp-connection-line {
            pointer-events: none;
            z-index: 1000;
        }

        .map-indicator {
            font-size: 12px;
            line-height: 1.2;
            margin-right: 4px;
            color: #20b2aa;
        }

        .map-inline-input {
            position: absolute;
            z-index: 1500;
            width: auto;
            min-width: 150px;
            max-width: 300px;
            background: var(--bg-primary);
            border: 1px solid var(--border-primary);
            border-radius: 24px; /* Match .map-node border-radius */
            padding: 8px 12px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 15.5px !important; /* Match .map-node exactly */
            line-height: 1.4;
            word-wrap: break-word; /* Match .map-node text wrapping */
        }

        .map-inline-input textarea {
            width: 100%;
            min-width: 140px;
            max-width: 290px;
            background: transparent;
            border: none;
            outline: none;
            color: #2c2c2c;
            font-family: inherit;
            font-size: inherit;
            line-height: 1.4;
            resize: none;
            overflow: hidden;
            padding: 0;
            margin: 0;
            display: block;
            white-space: pre-wrap;
            word-wrap: break-word;
            vertical-align: top;
        }
        /* Override mode colors for map input contenteditable divs */
        .map-inline-input div[contenteditable],
        .map-inline-input.note-mode div[contenteditable],
        .map-inline-input.task-mode div[contenteditable] {
            color: #2c2c2c !important;
        }

        .map-inline-input textarea::placeholder {
            color: var(--text-secondary);
            opacity: 0.7;
        }


        /* Node edit mode styling */
        .map-inline-input.node-edit-mode {
            min-width: 200px;
            max-width: 400px;
            padding: 0;
            border: none;
            background: var(--bg-primary);
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        }

        .map-inline-input.node-edit-mode textarea {
            background: var(--bg-primary);
            color: #2c2c2c;
            border: none;
            outline: none;
            font-family: inherit;
            font-size: 14px;
            line-height: 1.4;
            padding: 12px;
            resize: both;
        }

        .map-inline-input.node-edit-mode textarea:focus {
            outline: none;
        }

        /* Selection box for shift+drag grouping */
        .selection-box {
            position: absolute;
            background: transparent;
            border-radius: 8px;
            pointer-events: none;
            z-index: 1000;
            display: none;
        }
        
        /* Option+drag selection box (grey) */
        .multi-selection-box {
            position: absolute;
            border: 2px dashed #666;
            background: rgba(128, 128, 128, 0.2);
            pointer-events: none;
            z-index: 1000;
        }

        /* Select mode cursor and visual feedback */
        body.select-mode .map-container {
            cursor: crosshair !important;
        }

        body.select-mode .map-container .map-node {
            cursor: crosshair !important;
        }

        /* Alt key held - crosshair cursor for selection */
        body.alt-key-held .map-container {
            cursor: crosshair !important;
        }

        body.alt-key-held .map-container .map-node {
            cursor: crosshair !important;
        }

        /* Highlight the select icon when in select mode */
        body.select-mode .desktop-command-item[data-command="/select"] svg {
            stroke: #8cb48c !important;
            filter: drop-shadow(0 0 3px rgba(140, 180, 140, 0.5));
        }

        body.select-mode .desktop-command-item[data-command="/select"] svg rect,
        body.select-mode .desktop-command-item[data-command="/select"] svg line {
            stroke: #8cb48c !important;
        }

        /* Alt key held - highlight select icon */
        body.alt-key-held .desktop-command-item[data-command="/select"] svg {
            stroke: #8cb48c !important;
            filter: drop-shadow(0 0 3px rgba(140, 180, 140, 0.5));
        }

        body.alt-key-held .desktop-command-item[data-command="/select"] svg rect,
        body.alt-key-held .desktop-command-item[data-command="/select"] svg line {
            stroke: #8cb48c !important;
        }

        /* Shift key held - highlight group icon */
        body.shift-key-held .desktop-command-item[data-command="/group"] svg {
            stroke: #8cb48c !important;
            filter: drop-shadow(0 0 3px rgba(140, 180, 140, 0.5));
        }

        body.shift-key-held .desktop-command-item[data-command="/group"] svg rect,
        body.shift-key-held .desktop-command-item[data-command="/group"] svg line,
        body.shift-key-held .desktop-command-item[data-command="/group"] svg circle {
            stroke: #8cb48c !important;
        }

        /* Multi-selected items visual indicator */
        .map-node.multi-selected {
            outline: 3px solid #007acc !important;
            outline-offset: 0px;
        }
        
        /* Multi-selected groups visual indicator */
        .node-group.multi-selected {
            outline: 3px solid #007acc !important;
            outline-offset: 0px;
        }
        
        /* Multi-selected dividers visual indicator */
        .divider-group.multi-selected {
            filter: drop-shadow(0px 0px 6px #007acc) !important;
        }

        /* Group container and title icon styles */
        .node-group {
            position: absolute;
            border-width: 0;
            border-style: none;
            border-color: transparent;
            border-radius: 24px !important;
            will-change: width, height, left, top;
            transform: translateZ(0);
            backface-visibility: hidden;
            /* Box shadow is dynamically applied based on group color */
        }
        
        /* Slate styling - exactly like groups but without grouping */
        .map-slate {
            position: absolute;
            border-width: 1.5px;
            border-style: solid;
            border-color: rgba(155, 155, 155, 0.3);
            border-radius: 24px !important;
            pointer-events: auto; /* Make slates themselves interactive */
            will-change: width, height, left, top;
            transform: translateZ(0);
            backface-visibility: hidden;
            /* Ensure slate can receive pointer events */
            pointer-events: auto;
            cursor: default;
            overflow: visible; /* Changed from hidden to allow color picker to show */
            /* Ensure slates have a subtle shadow */
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.08), 0 0 5px rgba(0, 0, 0, 0.04) !important;
        }
        
        /* Dot pattern overlay for slates - matches map background */
        .map-slate::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image: radial-gradient(circle, #8b69141a 1px, transparent 1px);
            background-size: 20px 20px;
            background-position: 0 0;
            pointer-events: none;
            border-radius: 24px;
            z-index: 0; /* Lower z-index so it doesn't cover content */
        }
        
        .map-slate .group-title-bar {
            pointer-events: auto;
            position: relative;
            z-index: 2;
        }
        
        /* Ensure color picker is above dots */
        .map-slate .group-color-picker {
            position: relative;
            z-index: 3;
        }
        
        .node-group.resizing {
            pointer-events: none;
        }
        
        .node-group.resizing .map-node {
            pointer-events: none;
            background: linear-gradient(
                135deg,
                rgba(255, 255, 255, 0.08),
                rgba(255, 255, 255, 0.02)
            );
            backdrop-filter: blur(8px) saturate(130%);
            -webkit-backdrop-filter: blur(8px) saturate(130%);
            box-shadow: 
                inset 0 1px 2px rgba(255, 255, 255, 0.15),
                inset 0 -1px 2px rgba(0, 0, 0, 0.08),
                0 2px 10px rgba(0, 0, 0, 0.05);
            z-index: 5;
        }
        
        /* Remove borders from nodes that are within groups */
        .map-node[data-group-id] {
            border: none !important;
            border-width: 0 !important;
            border-color: transparent !important;
            border-style: none !important;
            box-shadow: none !important;
        }
        
        /* Also remove borders from group containers themselves */
        .node-group {
            border: none !important;
            border-width: 0 !important;
            border-color: transparent !important;
            border-style: none !important;
            border-radius: 24px !important;
        }
        
        /* List view group container */
        .list-group {
            position: absolute;
            border-width: 0.5px;
            border-style: solid;
            border-color: #888;
            border-radius: 1px !important;
            background: rgba(0, 0, 0, 0.05);
            z-index: 1; /* Behind items but above background */
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        
        .list-group:hover {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }
        
        /* List view selection box for shift+drag */
        .list-selection-box {
            position: absolute;
            background: transparent;
            border-radius: 1px;
            pointer-events: none;
            z-index: 1000;
            display: none;
        }

        .group-title-icon {
            position: absolute !important;
            width: 20px !important;
            height: 20px !important;
            cursor: pointer !important;
            z-index: 1000 !important;
            opacity: 0 !important;
            transition: opacity 0.2s ease !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }

        /* Show title icon when hovering over the group container */
        .node-group:hover .group-title-icon {
            opacity: 1 !important;
        }

        /* Color picker row */
        .group-color-picker {
            position: absolute !important;
            bottom: -25px !important;
            left: 50% !important;
            transform: translateX(-50%) !important;
            display: flex !important;
            gap: 3px !important;
            opacity: 0 !important;
            transition: opacity 0.2s ease !important;
            z-index: 1000 !important;
        }

        .color-picker-square {
            width: 16px !important;
            height: 16px !important;
            border-radius: 2px !important;
            border: 1px solid rgba(0, 0, 0, 0.3) !important;
            cursor: pointer !important;
            transition: transform 0.1s ease !important;
        }

        .color-picker-square:hover {
            transform: scale(1.2) !important;
        }
        
        .custom-color-square {
            background-size: cover !important;
            overflow: hidden !important;
        }
        
        .custom-color-square::after {
            content: '' !important;
        }

        /* Show color picker when hovering over the group container */
        .node-group:hover .group-color-picker {
            opacity: 1 !important;
        }
        
        /* Show color picker when hovering over slate containers */
        .map-slate:hover .group-color-picker {
            opacity: 1 !important;
        }

        /* Table divider lines */
        .table-divider {
            z-index: 10;
            transition: background-color 0.2s ease;
            pointer-events: none;
        }

        .node-group:hover .table-divider {
            pointer-events: auto;
        }

        .table-divider:hover {
            background: var(--text-secondary) !important;
        }

        /* Table draggable bottom border */
        .table-bottom-border {
            position: absolute;
            bottom: -2px;
            left: 0;
            right: 0;
            height: 4px;
            background: transparent;
            cursor: ns-resize;
            z-index: 11;
            transition: background 0.2s ease;
        }

        .table-bottom-border:hover {
            background: rgba(255, 140, 0, 0.5);
        }

        .table-bottom-border.dragging {
            background: rgba(255, 140, 0, 0.8);
        }

        /* Table draggable right border */
        .table-right-border {
            position: absolute;
            right: -2px;
            top: 0;
            bottom: 0;
            width: 4px;
            background: transparent;
            cursor: ew-resize;
            z-index: 11;
            transition: background 0.2s ease;
        }

        .table-right-border:hover {
            background: rgba(255, 140, 0, 0.5);
        }

        .table-right-border.dragging {
            background: rgba(255, 140, 0, 0.8);
        }

        /* Table divider context menu */
        .table-divider-context-menu {
            position: fixed;
            background: var(--background-primary);
            border: 1px solid var(--border-primary);
            border-radius: 24px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            z-index: 1000;
            min-width: 120px;
            padding: 12px 0;
            overflow: hidden;
        }

        .table-divider-context-menu-item {
            padding: 6px 12px;
            cursor: pointer;
            font-size: 13px;
            transition: background 0.2s ease;
        }

        .table-divider-context-menu-item:hover {
            background: var(--background-hover);
        }

        .table-divider-context-menu-item.delete {
            color: #e74c3c;
        }

        .table-divider-context-menu-item.delete:hover {
            background: rgba(231, 76, 60, 0.1);
        }


        .analyze-buttons {
            display: flex;
            gap: 15px;
            justify-content: center;
            margin-bottom: 15px;
        }

        .analyze-btn {
            padding: 10px 20px;
            border: 2px solid;
            background: transparent;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer !important;
            transition: background-color 0.2s;
        }

        .analyze-btn.primary {
            border-color: var(--text-secondary);
            color: var(--text-secondary);
        }

        .analyze-btn.primary:hover {
            background: rgba(139, 105, 20, 0.1);
        }

        .analyze-btn.secondary {
            border-color: #666;
            color: #666;
        }

        .analyze-btn.secondary:hover {
            background: rgba(102, 102, 102, 0.1);
        }

        .analyze-status {
            text-align: center;
            font-size: 12px;
            color: var(--text-secondary);
            font-style: italic;
            min-height: 20px;
        }
        
        /* Move Dialog Specific Styles */
        .move-notepad-list {
            margin: 20px 0;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        
        .move-notepad-btn {
            background: rgba(139, 105, 20, 0.1);
            border: 1px solid var(--border-primary);
            color: var(--text-secondary);
            padding: 12px 16px;
            cursor: pointer !important;
            font-family: 'agenda', 'Courier New', monospace;
            font-size: 14px;
            font-weight: bold;
            text-transform: uppercase;
            transition: all 0.2s ease;
            border-radius: 3px;
            text-align: center;
        }
        
        .move-notepad-btn:hover {
            background: rgba(139, 105, 20, 0.2);
            border-color: #a67c00;
            box-shadow: 0 0 8px rgba(139, 105, 20, 0.3);
        }
        
        .move-date-section {
            margin: 20px 0;
            padding: 15px;
            background: rgba(139, 105, 20, 0.05);
            border: 0.4px solid rgba(139, 105, 20, 0.2);
            border-radius: 1px;
        }
        
        .move-date-input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid var(--border-primary);
            border-radius: 1px;
            font-family: 'agenda', 'Courier New', monospace;
            font-size: 14px;
            background-color: var(--code-bg);
            color: var(--text-dark);
            margin-top: 8px;
            cursor: pointer !important;
        }
        
        .move-date-input {
            position: relative;
        }
        
        .move-date-input::-webkit-calendar-picker-indicator {
            cursor: pointer !important;
            opacity: 1;
            width: 40px;
            height: 100%;
            position: absolute;
            right: 0;
            top: 0;
            background: transparent;
        }
        
        .move-date-input:focus {
            outline: none;
            border-color: var(--text-secondary);
            box-shadow: 0 0 0 2px rgba(139, 105, 20, 0.2);
        }
        
        .move-notepad-btn:active {
            transform: translateY(1px);
        }
        
        .retrieve-search-container {
            margin: 15px 0;
        }
        
        .retrieve-search-input {
            width: 100%;
            padding: 10px 15px;
            border: 1px solid rgba(121, 46, 173, 0.3);
            border-radius: 1px;
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 14px;
            background-color: rgba(255, 255, 255, 0.05);
            color: var(--text-hover);
            transition: all 0.2s;
        }
        
        .retrieve-search-input:focus {
            outline: none;
            border-color: rgba(121, 46, 173, 0.6);
            background-color: rgba(255, 255, 255, 0.08);
            box-shadow: 0 0 0 3px rgba(121, 46, 173, 0.1);
        }
        
        .retrieve-search-input::placeholder {
            color: var(--text-muted);
            opacity: 0.6;
        }
        
        .retrieve-notepad-list {
            max-height: 350px;
            overflow-y: auto;
            margin: 20px 0;
            border: 1px solid rgba(121, 46, 173, 0.2);
            border-radius: 1px;
            background: rgba(255, 255, 255, 0.02);
        }
        
        .retrieve-date-group {
            border-bottom: 1px solid rgba(121, 46, 173, 0.15);
        }
        
        .retrieve-date-header {
            background: linear-gradient(90deg, rgba(121, 46, 173, 0.1) 0%, rgba(121, 46, 173, 0.05) 100%);
            padding: 10px 15px;
            font-weight: 600;
            color: var(--text-secondary);
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            position: sticky;
            top: 0;
            z-index: 1;
            backdrop-filter: blur(4px);
        }
        
        .retrieve-notepad-btn {
            display: block;
            width: 100%;
            background: transparent;
            border: none;
            border-bottom: 1px solid rgba(121, 46, 173, 0.08);
            color: var(--text-hover);
            font-family: 'agenda', 'agenda', 'JetBrains Mono', monospace;
            font-size: 12px;
            padding: 12px 20px;
            cursor: pointer !important;
            transition: all 0.15s ease;
            text-align: left;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        }
        
        .retrieve-notepad-btn:hover {
            background: rgba(121, 46, 173, 0.08);
            color: var(--text-secondary);
            transform: translateX(2px);
        }
        
        .retrieve-notepad-btn:active {
            transform: translateY(1px);
        }
        
        .retrieve-notepad-name {
            font-weight: bold;
            color: var(--text-secondary);
            margin-bottom: 4px;
        }
        
        .retrieve-notepad-info {
            font-size: 11px;
            color: var(--text-muted);
            opacity: 0.7;
        }
        
        .notepad-list {
            margin: 20px 0;
            max-height: 200px;
            overflow-y: auto;
        }
        
        .notepad-option {
            display: block;
            width: 100%;
            background: none;
            border: 1px solid #8b4513;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 12px;
            padding: 8px 12px;
            margin: 5px 0;
            cursor: pointer !important;
            transition: all 0.2s;
            text-align: left;
        }
        
        .notepad-option:hover {
            border-color: rgba(75, 0, 130, 0.4);
            background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
        }
        
        
        /* Apply mobile header styling when desktop width is narrow or when content might overlap */
        @media (max-width: 1200px) {
            /* .header {
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                text-align: left;
                padding-bottom: 10px;
                margin-bottom: 10px;
                position: relative;
            }
            
            .header h1 {
                font-size: 15.5px;
                margin-bottom: 0;
                order: 2;
                max-width: 100%;
                overflow: visible;
                text-overflow: clip;
                white-space: normal;
            }
            
            .header .date {
                float: right;
                display: block;
                order: 1;
                margin-bottom: 8px;
                font-size: 14px;
            } */
            
            
            /* Mobile styles for toggle button handled in main CSS */
        }
        
        @media (max-width: 768px) {
            .terminal {
                width: 100%;
                border-right: none;
                padding: 0;
                height: 100vh;
                height: 100dvh; /* Use dynamic viewport height for mobile */
                overflow: visible;
                display: flex;
                flex-direction: column;
                position: relative;
               
            }
            
            .header {
                padding: 15px 0 10px 0;
                margin-right: 10px;
                position: sticky;
                top: 0;
                
                /* Mobile liquid glass effect */
                background: linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.08) 0%,
                    rgba(255, 255, 255, 0.04) 50%,
                    rgba(255, 255, 255, 0.01) 100%
                );
                backdrop-filter: blur(8px) saturate(150%);
                -webkit-backdrop-filter: blur(8px) saturate(150%);
                border-bottom: 0.5px solid rgba(255, 255, 255, 0.15);
                box-shadow: 
                    inset 0 -1px 1px rgba(255, 255, 255, 0.2),
                    0 1px 5px rgba(0, 0, 0, 0.03);
                
                z-index: 100;
            }
            
            .input-line {
                padding: 10px 15px;
                position: sticky;
                top: calc(60px);
                background: rgba(139, 105, 20, 0.03);
                z-index: 2000;
            }
            
            .content-area {
                padding: 50px 15px 5px 15px; /* Remove bottom padding, keep top padding for fixed header */
                flex: 1;
                overflow-y: auto;
                background: var(--bg-primary); /* Ensure background covers full area */
                -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS */
                min-height: 0; /* Important for flexbox children */
            }
            
            .items {
                padding-bottom: 0; /* Remove extra bottom space */
            }
        }
        
        /* ⚠️  WARNING: The following @media (max-width: 600px) block conflicts with our clean 3-breakpoint system above.
           This should be reviewed and potentially merged into the main @media (max-width: 768px) rule. */
        
        /* Additional support for narrow desktop windows */
        @media (max-width: 600px) and (min-width: 0px) {
            .terminal {
                height: 100vh;
                height: 100dvh;
                overflow: hidden;
                display: flex;
                flex-direction: column;
                padding: 0;
            }
            
            .header {
                padding: 15px 0 10px 0;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                
                /* Enhanced liquid glass for this viewport */
                background: linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.1) 0%,
                    rgba(255, 255, 255, 0.05) 40%,
                    rgba(255, 255, 255, 0.02) 100%
                );
                backdrop-filter: blur(10px) saturate(150%);
                -webkit-backdrop-filter: blur(10px) saturate(150%);
                /* filter: url(#liquid-glass-filter); Disabled for performance */
                border-bottom: 0.5px solid rgba(255, 255, 255, 0.18);
                box-shadow: 
                    inset 0 -1px 2px rgba(255, 255, 255, 0.25),
                    0 2px 8px rgba(0, 0, 0, 0.04);
                    
                z-index: 1100;
            }
            
            .input-line {
                padding: 5px 15px; /* Reduce padding to minimize space */
                position: sticky;
                top: calc(50px); /* Reduce from 60px to match actual header height */
                background: rgba(139, 105, 20, 0.03);
                z-index: 2000;
            }
            
            .content-area {
                padding: 5px 15px 5px 15px !important; /* Remove bottom padding */
                flex: 1;
                overflow-y: auto;
                overflow-x: hidden;
                min-height: 0;
                background: var(--bg-primary); /* Ensure background covers full area */
                scroll-behavior: smooth;
                -webkit-overflow-scrolling: touch;
            }
            
            .items {
                margin-top: 0 !important; /* Remove any top margin */
                padding-top: 0 !important; /* Remove any top padding */
                padding-bottom: 0 !important; /* Remove extra bottom space */
                /* Hide scrollbar */
                scrollbar-width: none; /* Firefox */
                -ms-overflow-style: none; /* Internet Explorer 10+ */
            }
            
            .content-area::-webkit-scrollbar {
                display: none; /* Safari and Chrome */
            }
            
            /* Ensure lock styles work in mobile */
            .item.locked {
                opacity: 1 !important;
                pointer-events: none !important;
                cursor: not-allowed !important;
            }
            
            .item.locked .item-text {
                color: #dc2626 !important;
            }
            
            .lock-indicator {
                display: inline-block !important;
                margin-right: 8px !important;
                color: #dc2626 !important;
                line-height: 1.2 !important;
                vertical-align: baseline !important;
                transform: translateY(-1px) !important;
            }
            
            .folder-item {
                position: relative;
                overflow: hidden;
                transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            }
            
            /* Mobile folder buttons removed - using context menu only */
            
            .folder-item .folder-btn:hover {
                background: color-mix(in srgb, var(--text-secondary) 90%, transparent);
            }
            
            /* Mobile-specific item styles */
            .item {
                position: relative;
                overflow: hidden;
            }
            
            .item-swipe-wrapper {
                display: flex;
                align-items: center;
                position: relative;
                width: 100%;
                transition: transform 0.3s ease;
            }
            
            .item-content {
                flex: 1;
                display: flex;
                align-items: center;
                width: 100%;
                min-width: 100%;
            }
            
            /* Mobile item actions positioning */
            .item:not(.read-only) .item-actions {
                position: absolute;
                right: -10px;
                top: 50%;
                transform: translateY(-50%) translateX(20px);
                width: 100px;
                height: auto;
                display: flex;
                align-items: center;
                justify-content: flex-end;
                gap: 5px;
                padding-right: 10px;
                opacity: 0;
                transition: opacity 0.3s ease, transform 0.3s ease;
            }
            
            .item.swiped:not(.read-only) .item-actions {
                opacity: 1;
                pointer-events: auto;
                transform: translateY(-50%) translateX(0);
            }
            
            .item:not(.read-only) .item-actions .btn {
                background: none;
                border: none;
                color: var(--text-secondary);
                font-size: 11px;
                padding: 4px 6px;
                cursor: pointer !important;
                font-family: inherit;
                transition: all 0.2s ease;
            }
            
            .item:not(.read-only) .item-actions .btn:hover {
                color: #8b4513;
                text-decoration: underline;
            }
            
            .item.swiped .item-swipe-wrapper {
                transform: translateX(-100px);
            }
            
            /* Context menu indicator */
            .item-context-indicator {
                position: absolute;
                left: -30px;
                top: 50%;
                transform: translateY(-50%);
                opacity: 0;
                transition: opacity 0.2s ease;
                pointer-events: none;
                font-size: 16px;
                color: var(--text-secondary);
            }
            
            .item.context-selected .item-context-indicator {
                opacity: 1;
            }
            
            .item.context-selected .item-swipe-wrapper {
                transform: translateX(25px);
            }
            
            .terminal.with-calendar {
                width: 100%;
                height: 75vh;
                overflow-y: auto;
            }
            
            .stats {
                position: static;
                text-align: left;
                margin-bottom: 20px;
            }
            
            .header {
                display: flex;
                flex-direction: row;
                align-items: center;
                justify-content: space-between;
                text-align: left;
                padding-bottom: 15px;
                margin-bottom: 25px;
                position: relative;
            }
            
            .header h1 {
                font-size: 15.5px;
                margin-bottom: 0;
                order: 1;
                flex-shrink: 0;
                padding-left: 15px;
            }
            
            .header .date {
                position: static;
                order: 2;
                font-size: 12px;
                margin-top: -6px;
                margin-left: auto;
                color: var(--text-secondary);
            }
            
            /* Tablet styles for toggle button handled in main CSS */
            
            .commands-grid {
                grid-template-columns: 1fr;
                gap: 8px;
            }
            
            .cmd {
                padding: 10px 12px;
                margin: 4px 0;
                background-color: rgba(139, 105, 20, 0.05);
                border: 0.4px solid rgba(139, 105, 20, 0.2);
                border-radius: 1px;
                font-size: 9px; /* Smaller font for mobile */
                min-height: 40px; /* Ensure good touch target size */
                display: flex;
                align-items: center;
                text-align: left;
                line-height: 0.2;
                word-wrap: break-word;
                flex-wrap: wrap;
            }
            
            .cmd:hover {
                background-color: rgba(139, 105, 20, 0.15);
                border-color: rgba(139, 105, 20, 0.4);
            }
            
            .cmd:active {
                background-color: rgba(139, 105, 20, 0.25);
                transform: scale(0.98);
            }
            
            .cmd .cmd-key {
                white-space: nowrap;
                margin-right: 8px;
                flex-shrink: 0;
            }
            
            .calendar-container {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                width: 100%;
                height: 100vh;
                background: #ffffff; /* Pure white */
                z-index: 1000; /* Higher than terminal on mobile - calendar slides over terminal */
                padding: 20px 20px 200px 20px;
                box-sizing: border-box;
                overflow-y: auto;
                overflow-x: hidden;
                transform: translateY(100%);
                transition: transform 0.3s ease-in-out;
                opacity: 1;
                -webkit-overflow-scrolling: touch;
            }
            
            .calendar-container.visible {
                transform: translateY(0);
            }
            
            .calendar-container.minimized {
                transform: translateY(100%);
            }
            
            .calendar-header {
                margin-bottom: 35px;
                text-align: center;
            }
            
            .calendar-header h2 {
                font-size: 20px;
                margin-bottom: 5px;
            }
            
            .calendar-container .close-calendar-btn {
                top: 20px !important;
                right: 15px !important;
                font-size: 10px;
                padding: 6px 8px;
                min-height: 26px;
                min-width: 44px;
            }
            
            .calendar-days {
                height: 160px;
                min-height: 160px; /* Prevent shrinking when space is limited */
                flex-shrink: 0; /* Don't shrink this element in flex container */
                margin-top: 20px; /* Add space between logo and graph */
                padding: 8px;
                padding-bottom: 25px; /* Extra space for month labels */
                gap: 1px;
                width: 100%;
                overflow-x: hidden;
                box-sizing: border-box;
                background: none;
                justify-content: flex-start;
                scroll-behavior: smooth;
            }
            
            /* Maintain gradient overlays on mobile */
            .calendar-days::before,
            .calendar-days::after {
                width: 30px; /* Smaller width for mobile */
            }
            
            .calendar-day-column {
                flex: 0 0 auto;
                min-width: 16px;
                max-width: 20px;
                width: 18px;
            }
            
            .calendar-day-bar {
                width: 12px;
                max-width: 12px;
                margin: 0 auto;
            }
            
            .calendar-day-label {
                font-size: 7px;
                min-height: 10px;
                line-height: 0.2;
                word-break: break-all;
            }
            
            .calendar-day-letter {
                font-size: 6px;
                min-height: 8px;
                line-height: 0.2;
            }
            
            .calendar-month-indicator {
                font-size: 7px;
                padding: 1px 0;
                margin-top: 2px;
            }
            
            .calendar-month {
                margin: 0 0 25px 0;
                width: 100%;
                max-width: 300px;
            }
            
            .calendar-month h3 {
                font-size: 16px;
                margin-bottom: 10px;
                text-align: center;
            }
            
            .calendar-grid {
                gap: 3px;
                justify-content: center;
            }
            
            .calendar-day {
                width: 16px;
                height: 16px;
                border-radius: 3px;
            }
            
            .calendar-legend {
                justify-content: center;
                margin: 20px 0 80px 0;
                font-size: 12px;
            }
            
            .selected-date-display {
                text-align: center;
                font-size: 16px;
                margin-bottom: 20px;
            }
            
            .calendar-container .notepad-list {
                margin-bottom: 40px;
            }
            
            /* Mobile calendar footer - full width at bottom */
            .calendar-footer {
                left: 0 !important; /* Full width on mobile */
                width: 100% !important;
                z-index: 1001 !important; /* Above mobile calendar */
            }
            
            .folder-section {
                margin: 10px 0 20px 0;
                padding: 0;
                background: none;
                border: none;
                /* border-top: solid 1px #8b69143e; */
                border-radius: 0;
                flex: 1;
                display: flex;
                flex-direction: column;
            }
            
            .folder-header {
                font-size: 15.5px;
                font-weight: bold;
                margin-bottom: 15px;
                text-align: center;
                color: var(--text-secondary);
                border: none;
                padding: 0;
                padding-top: 20px;
                background: none;
             
            }
            
            .add-folder-btn {
                font-size: 14px;
                padding: 12px 16px;
                min-height: 44px;
                margin-bottom: 15px;
            }
            
            .folder-controls {
                display: flex;
                gap: 10px;
                margin-bottom: 5px;
            }
            
            .folder-search-input {
                font-size: 14px;
                padding: 12px;
                min-height: 44px;
                box-sizing: border-box;
                flex: 1;
            }
            
            .retrieve-btn {
                font-size: 28px;
                padding: 12px 16px;
                min-height: 44px;
                line-height: 0.2;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            .new-folder-input {
                font-size: 14px;
                padding: 12px;
                margin-bottom: 15px;
                min-height: 44px;
                box-sizing: border-box;
            }
            
            .folder-list {
                margin-top: 5px;
                margin-bottom: 60px;
                padding-bottom: 30px;
                flex: 1;
                overflow-y: auto;
                overflow: visible;
            }
            
            .folder-item {
                margin-bottom: 5px;
                padding: 8px 10px;
                background: color-mix(in srgb, var(--text-secondary) 5%, transparent);
                border: 0.4px solid color-mix(in srgb, var(--text-secondary) 20%, transparent);
                border-radius: 1px;
                min-height: 36px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                color: var(--text-secondary);
                font-weight: bold;
                cursor: pointer !important;
            }
            
            .folder-item:hover {
                background: color-mix(in srgb, var(--text-secondary) 15%, transparent);
                border-color: color-mix(in srgb, var(--text-secondary) 40%, transparent);
            }
            
            .folder-item.active {
                background: color-mix(in srgb, var(--text-secondary) 20%, transparent);
                border-color: color-mix(in srgb, var(--text-secondary) 50%, transparent);
            }
            
            .folder-name {
                color: var(--text-secondary);
                font-weight: bold;
                transition: color 0.8s ease-in-out;
            }
            
            .folder-stats {
                font-size: 12px;
                color: var(--text-secondary);
                opacity: 0.8;
            }
            
            .bottom-stats {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 8px 15px;
                font-size: 10px;
                color: var(--text-dark);
                z-index: 2000;
                
                
                /* Mobile liquid glass effect */
                background: linear-gradient(
                    135deg,
                    rgba(255, 255, 255, 0.08) 0%,
                    rgba(255, 255, 255, 0.04) 50%,
                    rgba(255, 255, 255, 0.01) 100%
                );
                backdrop-filter: blur(8px) saturate(150%);
                -webkit-backdrop-filter: blur(8px) saturate(150%);
                border-top: 0.5px solid rgba(255, 255, 255, 0.15);
                box-shadow: 
                    inset 0 1px 1px rgba(255, 255, 255, 0.2),
                    0 -1px 5px rgba(0, 0, 0, 0.03);
                
                line-height: 1.2;
                  background: #ffffff42;
            }
            
            .bottom-notepads {
                display: none !important;
            }
            
            .notepad-indicator {
                background: color-mix(in srgb, var(--text-secondary) 20%, transparent);
                padding: 8px 12px;
                border: 1px solid color-mix(in srgb, var(--text-secondary) 40%, transparent);
                border-radius: 1px;
                color: var(--text-secondary) !important;
                font-size: 12px;
                min-height: 32px;
                display: flex !important;
                align-items: center;
                justify-content: center;
                font-weight: bold;
                visibility: visible !important;
            }
            
            .notepad-indicator:hover {
                background: color-mix(in srgb, var(--text-secondary) 30%, transparent);
                border-color: color-mix(in srgb, var(--text-secondary) 60%, transparent);
            }
            
            .notepad-indicator.active {
                background: color-mix(in srgb, var(--text-secondary) 40%, transparent);
                border-color: color-mix(in srgb, var(--text-secondary) 80%, transparent);
            }
            
            .mobile-notepads {
                display: block;
                margin: 0 0 15px 0;
                padding: 0;
                background: none;
            }
            
            .mobile-notepads .folder-item {
                background: transparent;
                border: 0.4px solid var(--border-primary);
                color: var(--text-secondary);
                margin: 8px 0;
                padding: 12px 6px;
                border-radius: 0 !important;
                font-size: 14px;
                font-family: 'agenda', 'Courier New', monospace;
                transition: all 0.2s ease;
                position: relative;
                display: flex;
                justify-content: space-between;
                align-items: center;
                min-height: 44px;
            }
            
            .mobile-notepads .folder-item:hover {
                background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
                border-color: color-mix(in srgb, var(--text-secondary) 40%, transparent);
            }
            
            .mobile-notepads .folder-item.active {
                background: var(--text-secondary);
                color: var(--text-dark);
                border-color: var(--text-secondary);
            }
            
            .mobile-notepads .folder-item.active .folder-name {
                color: var(--text-dark);
                font-weight: bold;
            }
            
            .mobile-notepads .folder-name {
                flex: 1;
                text-transform: uppercase;
                letter-spacing: 0.5px;
                white-space: nowrap;
                overflow: hidden;
                text-overflow: ellipsis;
                margin-right: 8px;
                transition: color 0.8s ease-in-out;
            }
            
            .mobile-notepads .folder-actions {
                display: flex;
                gap: 8px;
                opacity: 1;
                flex-shrink: 0;
            }
            
            .mobile-notepads .folder-btn {
                background: transparent;
                border: 1px solid currentColor;
                color: inherit;
                padding: 4px 8px;
                font-size: 11px;
                cursor: pointer !important;
                font-family: inherit;
                transition: all 0.2s ease;
                white-space: nowrap;
                border-radius: 1px;
            }
            
            .mobile-notepads .folder-btn:hover {
                background: currentColor;
                color: var(--text-dark);
            }
            
            
            /* Hide mobile notepads on desktop */
            @media (min-width: 769px) {
                .bottom-notepads.mobile-notepads {
                    display: none !important;
                }
            }
        }


        @media (max-width: 768px) {
    .date-picker-content {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height for mobile */
        border-radius: 0;
        border: none;
        padding: 5px;
        padding-top: 10px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: fixed;
        top: 0;
        left: 0;
    }

    /* Prevent body scrolling when modal is open */
    body.date-picker-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
        height: 100%;
    }


/* Clean mobile range: ≤768px */

body:not(.map-mode) .content-area {
    padding: 60px 15px 120px 15px !important;
    margin-top: 0 !important;

}

body {
    padding-bottom: 0 !important;
}

.header {
    padding: 15px 15px 10px 15px !important;
}

.items {
    margin-top: 0 !important;
    padding-top: 0 !important;
}



.date-picker-header {
    flex-direction: row;
    gap: 10px;
    margin-bottom: 5px;
    padding: 5px 0;
    justify-content: center;
}

/* Create a separate row for year navigation on mobile */
.year-nav,
.year-display {
    order: 1;
}

/* Group year navigation together */
.date-picker-header::after {
    content: '';
    display: flex;
    align-items: center;
    justify-content: center;
    order: 1;
    gap: 10px;
    width: 100%;
}



.view-toggle {
    position: static;
    left: 0;
    order: -1;
    justify-content: center;
    margin-left: -60px;
}

.toggle-slider {
    width: 28px;
    height: 16px;
    margin: 0 8px 0 -60px !important;
}

.toggle-slider:before {
    width: 12px;
    height: 12px;
    top: 1px;
    left: 2px;
}

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

.view-btn {
    padding: 8px 15px;
    font-size: 12px;
    min-height: 32px;
    min-width: 60px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.view-btn:first-child {
    border-right: none;
}



.year-display {
    font-size: 16px;
    margin: 0 10px;
    text-align: center;
    flex: 1;
}


.year-nav {
    padding: 8px 10px;
    font-size: 14px;
    min-height: 32px;
    min-width: 32px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}



.date-picker-close {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 20px;
    min-height: 30px;
    min-width: 30px;
    width: 30px;
    height: 30px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 10;
}



.date-picker-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
}

.date-picker-body.month-view {
    padding: 0;
}



.month-section {
    padding: 0;
    margin-bottom: 0;
}



.month-title {
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
    padding: 8px 0;
}



.month-grid {
    gap: 0;
    margin-bottom: 0;
}

/* Minimal padding around month view grid on mobile */
.month-view-grid {
    padding: 2px !important;
    gap: 1px;
    border-radius: 1px;
}

.month-view-container {
    padding: 0;
}

/* Make cells use full width on mobile */
.month-day-cell {
    padding: 2px !important;
    border-radius: 0;
}

/* Make snippet items span full width of cell */
.month-day-snippet {
    padding: 0;
    margin: 0;
}

.month-day-snippet .snippet-item {
    margin: 1px 0;
    padding: 2px 3px;
    font-size: 10px;
}

.day-square {
    font-size: 12px;
    min-height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    border: 1px solid rgba(139, 105, 20, 0.1);
    font-weight: 500;
}

.day-square:not(.empty) {
    background: rgba(139, 105, 20, 0.03);
}

.day-square:hover {
    transform: scale(1.02);
}


.date-picker-legend {
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    margin-top: 15px;
    justify-content: space-around;
}


.legend-item {
    font-size: 11px;
    gap: 4px;
    flex: 0 0 auto;
    white-space: nowrap;
}


.legend-box {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}



.month-day-snippet .snippet-item .drag-handle {
    width: 12px;
    /* Bigger drag handles for touch */
    background: rgba(0, 0, 0, 0.3);
    /* More visible on mobile */
}

.month-day-snippet .snippet-item:hover .drag-handle {
    opacity: 1;
    /* Always show on mobile when hovered */
}

/* Make snippet items slightly larger for better touch targets */
.month-day-snippet .snippet-item {
    padding: 3px 6px;
    font-size: 11px;
    margin-bottom: 3px;
}

/* Override mobile padding for headers to prevent text cutoff */
.month-day-snippet .snippet-item.header {
    padding: 2px 4px !important;
}

.month-day-snippet .snippet-item.header .content {
    padding: 0 !important;
}

/* Larger time grid labels for mobile */
.month-day-cell .time-grid .time-label {
    font-size: 9px;
    right: 8px;
}

/* More visible time lines on mobile */
.month-day-cell .time-grid .time-line {
    border-top: 2px dashed rgba(139, 105, 20, 0.7);
}



.date-picker-body:not(.month-view) {
    grid-template-columns: 1fr;
    /* Single column on mobile */
    gap: 0;
    padding: 0 10px;
}




.search-widget {
    display: none !important;
}



body.shared-mode .commands.collapsed {
    pointer-events: none !important;
}

body.shared-mode .commands.collapsed .commands-header {
    pointer-events: none !important;
}



.mobile-trackpad {
    display: block;
    /* Show trackpad on mobile */
}

/* Hide mobile trackpad in iframe page nodes */
body.in-iframe .mobile-trackpad,
body.in-iframe #mobileTrackpad {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

.items {
    margin-bottom: 140px;
    /* Extra space for trackpad */
}

/* Fix scrolling on mobile */
body {
    position: relative;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection and drag behavior on mobile items */
.item {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.items {
    margin-bottom: 25px;
    /* Enable text selection across the entire list */
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

.reorder-mode::before {
    background: linear-gradient(to bottom,
            rgba(255, 107, 53, 0.3) 0%,
            rgba(255, 255, 255, 0) 100%);
}

.reorder-mode::after {
    background: linear-gradient(to top,
            rgba(255, 107, 53, 0.3) 0%,
            rgba(255, 255, 255, 0) 100%);
}


.item:not(.read-only) .item-actions {
    opacity: 0;
    pointer-events: none;
}



.terminal.with-calendar .bottom-stats {
    left: 0;
    right: 0;
    /* Stay full width on mobile */
}

:root[data-theme="ocean"] .calendar-container::before {
    height: var(--calendar-content-height);
}



.calendar-container::before {
    background: linear-gradient(to right,
            #ffffff 0%,
            #ffffff 20%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0.5) 75%,
            transparent 100%);
}

.calendar-container::after {
    background: linear-gradient(to left,
            #ffffff 0%,
            #ffffff 20%,
            rgba(255, 255, 255, 0.9) 50%,
            rgba(255, 255, 255, 0.5) 75%,
            transparent 100%);
}


/* Hide folder actions by default on mobile, reveal on swipe */

.folder-item .folder-actions {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    display: flex;
    gap: 10px;
    padding-right: 10px;
    opacity: 0 !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.folder-item.swiped .folder-actions {
    opacity: 1 !important;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}



    .event-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .event-modal-header,
    .event-modal-body {
        padding: 20px;
    }

    .event-form-row {
        flex-direction: column;
        gap: 20px;
    }

    .event-form-actions {
        flex-direction: column;
    }


/* Mobile-specific map container fixes */

    body.map-mode .content-area {
        height: 100vh !important;
        height: 100dvh !important;
        /* Use dynamic viewport height on mobile */
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 0 !important;
        /* Remove all padding in map mode */
        margin: 0 !important;
        /* Remove all margins */
        position: fixed !important;
        /* Fix to viewport */
        top: 0 !important;
        /* Start from very top */
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 1 !important;
        /* Below header */
    }

    body.map-mode #items {
        padding-top: 50px !important;
        /* Add space for header */
    }

    .map-container {
        min-height: 100vh !important;
        min-height: 100dvh !important;
        width: 100vw !important;
        /* Full viewport width on mobile */
        touch-action: pan-x pan-y !important;
        /* Enable panning on mobile */
    }

    /* Fix header transparency on mobile */
    body.map-mode .header {
        background: rgba(255, 255, 255, 0.03) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    /* In map mode, always show notepad title and hide page title */
    body.map-mode .page-title {
        display: none !important;
    }
    body.map-mode .notepad-title {
        display: block !important;
    }

    /* Fix node width auto-adjustment on mobile only */
    .map-node {
        width: 300px !important;
        /* Fixed width to prevent mobile resize */
        min-width: 300px !important;
        max-width: 300px !important;
    }


/* Override ALL @media (max-width: 768px) rules for page nodes */


    

    /* Force hide mobile trackpad in ALL page nodes - target iframe content */
    body.in-iframe .mobile-trackpad,
    body.in-iframe .trackpad-surface,
    body.in-iframe .trackpad-gesture-text,
    body.in-iframe #mobileTrackpad,
    body.in-iframe #trackpadSurface,
    body.in-iframe #trackpadGestureText {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
    }

    .map-node.page-node body {
        position: static !important;
        height: auto !important;
        overflow-y: visible !important;
    }

    .map-node.page-node .item {
        font-size: 14px !important;
        padding: 1px 0 1px 5px !important;
        line-height: normal !important;
        -webkit-user-select: auto !important;
        -moz-user-select: auto !important;
        -ms-user-select: auto !important;
        user-select: auto !important;
        -webkit-touch-callout: default !important;
        -webkit-tap-highlight-color: initial !important;
    }

    .map-node.page-node .reorder-mode::before,
    .map-node.page-node .reorder-mode::after {
        background: linear-gradient(to bottom, rgba(255, 107, 53, 0.1) 0%, rgba(255, 255, 255, 0) 100%) !important;
    }

    .map-node.page-node .item:not(.read-only) .item-actions {
        opacity: 1 !important;
        pointer-events: auto !important;
        position: static !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        width: auto !important;
    }
    
    /* Override ALL mobile @media queries for page nodes - force desktop layout */
    @media (max-width: 768px) {
        /* Completely disable mobile styling for iframe content */
        body.in-iframe .item {
            padding: 1px 0 1px 5px !important; /* Force desktop padding, not mobile padding-left: 0 */
            font-size: 14px !important; /* Force desktop font size */
        }
        
        body.in-iframe .quote-comment-pair::before,
        body.in-iframe .note-indicator {
            left: 5px !important; /* Keep desktop positioning, not mobile left: 0px */
        }
        
        body.in-iframe .daily-logo {
            font-size: 24px !important; /* Keep desktop size */
            letter-spacing: 10px !important;
            padding: 10px 20px !important;
        }
        
        /* Force all content-area styles to remain desktop */
        body.in-iframe .content-area {
            padding: 0px !important;
        }

        /* Ensure text and drag handles are not clipped in page nodes */
        body.in-iframe .list-line,
        body.in-iframe .line-text,
        body.in-iframe .item,
        body.in-iframe .list-line.item,
        body.in-iframe .list-line.note-line,
        body.in-iframe .list-line.note-line.item,
        body.in-iframe .list-line.task-line.item {
            overflow: visible !important;
        }
        
        /* Remove margins from .items in page nodes - AGGRESSIVE OVERRIDE */
        body.in-iframe .items,
        body.in-iframe .content-area .items,
        body.in-iframe #items,
        .map-node.page-node iframe .items,
        .map-node.page-node .items {
            width: 100% !important;
            overflow: visible !important;
            margin: 0px !important;
            margin-top: 0px !important;
            margin-bottom: 0px !important;
            margin-left: 0px !important;
            margin-right: 0px !important;
            padding-left: 20px !important; /* Use simple padding instead */
            padding-right: 20px !important;
        }
        
        /* Prevent any width-based mobile transformations */
        body.in-iframe * {
            /* Disable mobile-specific styles */
            box-sizing: border-box !important;
        }
    }
    
    /* Disable page node resize handles */
    .page-resize-handle {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
    
    .map-node.page-node {
        /* Disable resize cursor */
        resize: none !important;
    }
    
    .map-node.page-node:hover .page-resize-handle {
        display: none !important;
        opacity: 0 !important;
    }
    
    /* ULTRA HIGH SPECIFICITY OVERRIDE for page node .items */
    body.in-iframe.in-iframe.in-iframe .items {
        margin: 0px !important;
        margin-top: 0px !important;
        margin-bottom: 0px !important;
        margin-left: 0px !important;
        margin-right: 0px !important;
        padding: 20px !important;
        padding-top: 0px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Force text wrapping in list view items */
    .item, .list-line, .note-line, .item-text {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Specifically target elements with class="list-line note-line item" */
    .list-line.note-line.item {
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }

    /* Comments must stay flex row for arrow + text layout */
    .list-line.note-line.item.inline-comment {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
    }
    
    /* Force wrapping for .line-text elements (the actual content containers) */
    .line-text,
    div.line-text,
    .list-line .line-text {
        text-wrap: auto !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        caret-color: var(--text-primary, #000) !important; /* Always show caret - let browser handle naturally */
    }

    /* Prevent focus styles from changing layout */
    .line-text:focus {
        outline: none !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
    }
    
    /* Override .item.editing styles that cause shifts for list-line items */
    .list-line.item.editing {
        display: flex !important; /* Keep flex display */
        align-items: center !important; /* Keep center alignment */
        flex-direction: row !important; /* Keep row, not column */
        gap: 0 !important; /* Remove gap to match non-editing state */
        line-height: inherit !important; /* Don't force 1.4 */
        transition: none !important;
        padding: 1px 0 1px 5px !important; /* KEEP the same padding as normal .item */
        margin: 0 !important;
        background: transparent !important;
    }
    
    /* Make edit textarea styling match normal line-text exactly */
    textarea[id^="edit-input-"],
    textarea.edit-textarea {
        text-wrap: auto !important;
        white-space: pre !important;
        font-family: inherit !important;
        font-size: inherit !important;
        line-height: 1.2 !important;
        color: inherit !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        resize: none !important;
        overflow: hidden !important;
        tab-size: 4 !important;
    }
}
