        :root {
            --base: #1e1e2e;
            --mantle: #181825;
            --crust: #11111b;
            --text: #cdd6f4;
            --green: #a6e3a1;
            --red: #f38ba8;
            --blue: #89b4fa;
            --mauve: #cba6f7;
            --surface0: #303446;
            --subtext0: #a6adc8;
            --peach: #fab387;
            --sky: #89dceb;
            --gap: 20px;
            --logo-color: var(--red);
            --logo-glow: #f05656b3;
            --rounding: 0;
            --border-radius: calc(var(--rounding) * 2px);
            --shadow-intensity: 5;
            --accent: var(--mauve);
            --bg-pattern: linear-gradient(rgba(30, 30, 46, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
            --bg-pattern-size: 100% 4px, 3px 100%;
        }

        ::selection {
            background-color: var(--text);
            color: var(--base);
        }

        ::-moz-selection {
            background-color: var(--text);
            color: var(--base);
        }

        body {
            background-color: var(--mantle);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            font-family: 'JetBrains Mono Nerd Font', 'JetBrains Mono', monospace;
            color: var(--text);
            overflow: hidden;
        }

    #loading-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: var(--mantle);
        z-index: 999999;
        display: flex;
        justify-content: center;
        align-items: center;
        transition: opacity 0.5s ease, visibility 0.5s ease;
    }

    #loading-overlay.hidden {
        opacity: 0;
        visibility: hidden;
    }

    #loading-logo {
        width: 200px;
        height: 200px;
        animation: fade-in-logo 0.4s ease-out forwards, loading-pulse 1.5s ease-in-out infinite;
    }

    #loading-logo::before {
        content: '';
        display: block;
        width: 100%;
        height: 100%;
        background-color: var(--logo-color);
        -webkit-mask: url('assets/nblogo.svg') no-repeat center / contain;
        mask: url('assets/nblogo.svg') no-repeat center / contain;
    }

    @keyframes loading-pulse {
        0% { filter: drop-shadow(0 0 0px var(--logo-glow)); }
        50% { filter: drop-shadow(0 0 40px var(--logo-glow)); }
        100% { filter: drop-shadow(0 0 0px var(--logo-glow)); }
    }

    @keyframes fade-in-logo {
        0% { opacity: 0; transform: scale(0.7); }
        100% { opacity: 1; transform: scale(1); }
    }

        #dashboard-wrapper {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100vw;
            height: 100vh;
        }

        #dashboard-container {
            display: grid;
            grid-template-columns: 500px 300px;
            grid-template-rows: auto 60px 150px 225px auto;
            gap: var(--gap);
        width: 820px;
            height: auto;
        transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
            transform-origin: center;
            position: relative;
        }
        
        #dashboard-container.show-quick-panel,
        #dashboard-container.show-documents-panel,
        #dashboard-container.show-timeclock-panel {
            grid-template-columns: 500px 300px 320px;
            width: 1160px;
        }

        .box {
            background-color: var(--base);
            border: 2px solid var(--surface0);
            padding: 15px;
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
            display: flex; 
            flex-direction: column;
            box-shadow: 0 10px 30px rgba(0, 0, 0, calc(var(--shadow-intensity) * 0.1));
            transition: all 0.85s cubic-bezier(0.22, 1, 0.36, 1);
            border-radius: var(--border-radius);
        }


        #dashboard-container.disable-transitions,
        #dashboard-container.disable-transitions .box,
        #dashboard-container.disable-transitions * {
        transition: none !important;
        }

        .box { --hover-border-color: var(--accent); }

        .box:hover {
            border-left-color: var(--hover-border-color);
        }
        .box::before {
            content: " ";
            position: absolute;
            top: 0; left: 0; bottom: 0; right: 0;
            background: var(--bg-pattern);
            background-size: var(--bg-pattern-size);
            pointer-events: none;
            z-index: 5;
        }

        #left-sidebar {
        display: contents;
        }
        #left-sidebar .scratchpad-box, 
        #right-sidebar .task-manager-box { 
            opacity: 0;
            visibility: hidden;
            position: absolute;
            min-height: 0; height: 0; padding: 0; margin: 0; border-width: 0;
            transform: scale(0.95);
            pointer-events: none;

        }
        .fullscreen-mode #left-sidebar {
            display: flex;
            height: 100%;
            flex-direction: column;
            gap: var(--gap);
            grid-column: 1;
            grid-row: 1 / -1;
        }

        #right-sidebar {
            display: flex;
            flex-direction: column;
            gap: var(--gap);
            grid-column: 2;
            grid-row: 3 / span 2;
            min-height: 0;
        }
        .fullscreen-mode #right-sidebar {
            display: flex;
            height: 100%;
            flex-direction: column;
            gap: var(--gap);
            grid-column: 3;
            grid-row: 1 / -1;
        }
        .fullscreen-mode #left-sidebar .scratchpad-box, 
        .fullscreen-mode #right-sidebar .task-manager-box { 
            opacity: 1;
            visibility: visible;
            position: relative;
            padding: 15px;
            border-width: 2px;
            transform: scale(1);
            pointer-events: auto;
        }

        .min-btn {
            display: none;
            cursor: pointer;
            margin-left: 10px;
            font-family: inherit;
            font-size: 14px;
            color: var(--subtext0);
            transition: color 0.2s;
            user-select: none;
        }
        .fullscreen-mode .min-btn { display: inline-block; }
        .min-btn:hover { color: var(--green); }

        .min-info {
            display: none;
            color: var(--accent);
            font-weight: bold;
            margin-left: 10px;
        }
        .box.minimized .min-info { display: inline; }
        .box.minimized > *:not(.header) { display: none !important; }
        .box.minimized { 
            height: auto !important; 
            min-height: 0 !important; 
            padding: 6px 12px !important; 
            align-self: start !important;
        }
        .box.minimized .header { 
            margin-bottom: 0 !important; 
            border-bottom: none !important; 
            padding-bottom: 0 !important;
        }
        
        .all-minimized-left.fullscreen-mode {
            grid-template-columns: 60px 1fr minmax(150px, 300px) !important;
        }
        .all-minimized-right.fullscreen-mode {
            grid-template-columns: minmax(150px, 500px) 1fr 60px !important;
        }
        .all-minimized-left.all-minimized-right.fullscreen-mode {
            grid-template-columns: 60px 1fr 60px !important;
        }
        
        .all-minimized-right.fullscreen-mode.show-quick-panel,
        .all-minimized-right.fullscreen-mode.show-documents-panel,
        .all-minimized-right.fullscreen-mode.show-timeclock-panel {
            grid-template-columns: minmax(150px, 500px) 1fr 320px 60px !important;
        }
        .all-minimized-left.fullscreen-mode.show-quick-panel,
        .all-minimized-left.fullscreen-mode.show-documents-panel,
        .all-minimized-left.fullscreen-mode.show-timeclock-panel {
            grid-template-columns: 60px 1fr 320px minmax(150px, 300px) !important;
        }
        .all-minimized-left.all-minimized-right.fullscreen-mode.show-quick-panel,
        .all-minimized-left.all-minimized-right.fullscreen-mode.show-documents-panel,
        .all-minimized-left.all-minimized-right.fullscreen-mode.show-timeclock-panel {
            grid-template-columns: 60px 1fr 320px 60px !important;
        }

        .all-minimized-left #left-sidebar, 
        .all-minimized-right #right-sidebar {
            gap: 5px;
        }

        .all-minimized-left #left-sidebar .box.minimized,
        .all-minimized-right #right-sidebar .box.minimized {
            flex: 0 0 auto;
            padding: 15px 0 !important;
        }

        .all-minimized-left #left-sidebar .scratchpad-box.minimized,
        .all-minimized-right #right-sidebar .task-manager-box.minimized {
            flex: 1 !important;
        }

        #dashboard-container.locked .box:not(.auth-box) {
            filter: blur(15px);
            pointer-events: none;
            opacity: 0.6;
        }

    .fullscreen-mode .auth-box {
        opacity: 0;
        visibility: hidden;
        height: 0;
        padding: 0;
        margin: 0;
        border-width: 0;
        pointer-events: none;
    }

        .auth-box { 
            grid-column: 1 / span 2; 
            grid-row: 1; 
            padding: 10px;
            justify-content: center;
        }

        #dashboard-container.locked .auth-box {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 350px;
            padding: 30px 25px;
            z-index: 1000;
        }
        
        .command-box {
            grid-column: 1 / span 2;
            grid-row: 2;
            padding: 10px;
            justify-content: center;
        }
        .clock-box { grid-column: 1; grid-row: 3; }
        .timer-box { grid-column: 1; grid-row: 4; }

        #quick-panel,
        #documents-panel,
        #timeclock-panel {
            grid-column: 3;
            grid-row: 2 / -1;
        }

        .all-minimized-left #left-sidebar .box.minimized .header, 
        .all-minimized-right #right-sidebar .box.minimized .header {
            writing-mode: vertical-rl;
            display: flex;
        flex-direction: row;
            justify-content: center;
            align-items: center;
            height: auto;
            width: 100%;
            cursor: pointer;
            white-space: nowrap;
            gap: 15px;
            border: none !important;
        }

        .all-minimized-left #left-sidebar .box.minimized .header { transform: rotate(180deg); }
        .all-minimized-right #right-sidebar .box.minimized .header { transform: rotate(0deg); }

        .all-minimized-left #left-sidebar .box.minimized .header div,
        .all-minimized-right #right-sidebar .box.minimized .header div { 
            flex-direction: row; 
            gap: 8px; 
            justify-content: center;
        }
        .all-minimized-left #left-sidebar .box.minimized .min-info,
        .all-minimized-left #left-sidebar .box.minimized .min-btn,
        .all-minimized-right #right-sidebar .box.minimized .min-info,
        .all-minimized-right #right-sidebar .box.minimized .min-btn { 
            margin-left: 0 !important; 
        }
        .all-minimized-left #left-sidebar .box.minimized .header div:nth-child(2) .decipher-text,
        .all-minimized-right #right-sidebar .box.minimized .header div:nth-child(2) .decipher-text { 
            display: none; 
        }

        .fullscreen-mode .clock-box, 
        .fullscreen-mode .timer-box, 
        .fullscreen-mode .scratchpad-box,
        .fullscreen-mode .links-box,
        .fullscreen-mode .upcoming-box,
        .fullscreen-mode .task-manager-box {
            grid-column: auto !important;
            grid-row: auto !important;
            width: 100% !important;
        }

        .notes-box { 
            grid-column: 1 / span 2; 
            grid-row: 5; 
            resize: vertical;
            overflow: hidden;
            min-height: 225px;
            height: 225px;
            max-height: 600px;
            display: flex; 
            flex-direction: column;
            padding: 8px;
        }

        .fullscreen-mode .scratchpad-box {
            display: flex;
        flex: 1;
            background-color: var(--crust);
            min-height: 0;
        }
        .fullscreen-mode .scratchpad-box.minimized { flex: 0 0 auto; }

        .fullscreen-mode .task-manager-box {
            display: flex;
            flex: 3;
            min-height: 0;
        }
        .fullscreen-mode .task-manager-box.minimized { flex: 0 0 auto; }

        #dashboard-container:not(.fullscreen-mode) .links-box,
        .fullscreen-mode .links-box {
            flex: 2.25;
            min-height: 0;
        }
        .fullscreen-mode .links-box.minimized { flex: 0 0 auto; }

        #dashboard-container:not(.fullscreen-mode) .upcoming-box {
            flex: 1;
            min-height: 0;
        }
        .fullscreen-mode .upcoming-box {
            flex: 2.5;
            min-height: 0;
        }
        .fullscreen-mode .upcoming-box.minimized { flex: 0 0 auto; }

        .scratchpad-box.scratchpad-hidden {
            display: none !important;
        }

        #scratchpad-area {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--subtext0);
            font-family: 'JetBrains Mono', monospace;
            font-size: 13px;
            line-height: 1.4;
            resize: none;
            outline: none;
            padding: 5px;
            scrollbar-width: none;
        }
        #scratchpad-area::-webkit-scrollbar { display: none; }

        #highlight-layer {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 10px !important;
            font-family: 'JetBrains Mono', monospace;
            font-size: 14px;
            line-height: 21px;
            white-space: pre-wrap;
            word-wrap: break-word;
            pointer-events: none;
            color: var(--text);
            z-index: 2;
            display: none;
            box-sizing: border-box;
        }

        .hl-tag    { color: var(--mauve); }
        .hl-attr   { color: var(--blue); }
        .hl-str    { color: var(--green); }
        .hl-comm   { color: var(--subtext0); font-style: italic; }
        .hl-bracket { color: var(--subtext0); }
        .hl-key    { color: var(--mauve); }
        .hl-func   { color: var(--blue); }
        .hl-num    { color: var(--peach); }
        .hl-op     { color: var(--sky); }
        .hl-bool   { color: var(--peach); font-weight: bold; }
        .hl-ts     { color: #ffffff; font-weight: bold; }

        #dashboard-container.fullscreen-mode {
            width: 100vw !important;
            height: 100vh !important;
            max-width: none !important;
            grid-template-columns: minmax(150px, 500px) minmax(0, 1fr) minmax(150px, 300px);
            grid-template-rows: auto minmax(0, 1fr);
            padding: var(--gap);
            box-sizing: border-box;
            transform: none !important;
        }
        
        #dashboard-container.fullscreen-mode.show-quick-panel,
        #dashboard-container.fullscreen-mode.show-documents-panel,
        #dashboard-container.fullscreen-mode.show-timeclock-panel {
            grid-template-columns: minmax(150px, 400px) minmax(0, 1fr) 320px minmax(150px, 300px);
        }
        .fullscreen-mode.show-quick-panel #right-sidebar,
        .fullscreen-mode.show-documents-panel #right-sidebar,
        .fullscreen-mode.show-timeclock-panel #right-sidebar {
            grid-column: 4;
        }
        .fullscreen-mode.show-quick-panel #quick-panel,
        .fullscreen-mode.show-documents-panel #documents-panel,
        .fullscreen-mode.show-timeclock-panel #timeclock-panel {
            grid-column: 3;
            grid-row: 1 / -1;
        }

        #dashboard-container.fullscreen-mode.search-active {
            grid-template-rows: auto auto minmax(0, 1fr);
        }
        
        .fullscreen-mode .notes-box { 
            grid-column: 2; 
            grid-row: 2; 
            width: 100%; 
            height: 100% !important; 
            max-height: none !important;
            min-height: 0 !important;
            overflow: hidden;
            resize: none;
        }
        .fullscreen-mode.search-active .notes-box {
            grid-row: 3;
        }

        .auth-input, .command-input {
            width: 100%;
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--surface0);
            color: var(--mauve);
            font-family: inherit;
            font-size: 20px;
            text-align: left;
            outline: none;
            letter-spacing: 5px;
        }

    .command-input {
        color: var(--text);
        letter-spacing: 2px;
    }

    .command-input::placeholder {
        color: var(--mauve);
    }

    #search-logo {
        width: 32px;
        height: 32px;
        position: absolute;
        left: 5px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 10;
        transition: filter 0.3s ease, width 0.3s ease, height 0.3s ease, transform 0.3s ease;
        filter: drop-shadow(0 0 4px var(--logo-glow));
    }

    #search-logo::before {
        content: '';
        display: block;
        width: 100%;
        height: 100%;
        background-color: var(--logo-color);
        -webkit-mask: url('assets/nblogo.svg') no-repeat center / contain;
        mask: url('assets/nblogo.svg') no-repeat center / contain;
        transition: background-color 0.3s ease;
    }

    @keyframes pulse-theme-glow {
        0% { filter: drop-shadow(0 0 2px var(--logo-glow)); }
        50% { filter: drop-shadow(0 0 8px var(--logo-glow)); }
        100% { filter: drop-shadow(0 0 2px var(--logo-glow)); }
    }

    #search-logo.save-pending {
        animation: pulse-theme-glow 1s infinite;
    }

        .cmd-btn {
            border: none;
            padding: 4px;
            color: var(--subtext0);
            background: transparent;
            transition: color 0.2s, transform 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }
.cmd-btn svg {
    width: 18px;
    height: 18px;
}
        .cmd-btn:hover {
            background-color: transparent;
            border-color: transparent;
            color: var(--mauve);
            transform: scale(1.1);
        }

.cmd-btn.disabled {
    opacity: 0.3 !important;
    cursor: not-allowed !important;
}
.cmd-btn.disabled:hover {
    transform: none;
    color: var(--subtext0);
}

.notes-toolbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 8px;
    margin-left: 8px;
    border-left: 1px solid var(--surface0);
    justify-content: flex-start;
    align-items: center;
    z-index: 10;
}

.color-picker-container { position: relative; }
.color-picker-menu {
    display: flex;
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 10px;
    background: var(--mantle);
    border: 1px solid var(--surface0);
    padding: 6px;
    border-radius: var(--border-radius);
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}
.color-picker-menu::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    right: -12px;
    width: 12px;
}
.color-picker-container:hover .color-picker-menu { opacity: 1; pointer-events: auto; }
.color-swatch { width: 16px; height: 16px; border-radius: 50%; cursor: pointer; transition: transform 0.2s; }
.color-swatch:hover { transform: scale(1.3); }

.tooltip-text {
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
    font-weight: bold;
    pointer-events: none !important;
}

.toolbar-top-group {
    display: none;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
}
.notes-box.expanded .toolbar-top-group,
.fullscreen-mode .toolbar-top-group {
    display: flex;
}

.toolbar-bottom-group {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    width: 100%;
    position: sticky;
    bottom: 0;
    background-color: var(--base);
    padding-top: 4px;
    z-index: 20;
}
.toolbar-divider {
    width: 10px;
    height: 1px;
    background: var(--surface0);
    margin: 4px auto;
}

        .notes-content-wrapper::-webkit-scrollbar {
            display: none;
        }

        .notes-content-wrapper {
            display: flex;
            flex: 1;
            position: relative;
            min-height: 0;
            overflow-y: auto;
            scrollbar-width: none;
        }
        
        #notes-area.html-mode {
            color: transparent !important;
            caret-color: var(--green);
            position: relative;
            z-index: 2;
        }

        #notes-area.html-mode::placeholder {
            color: var(--surface0) !important;
            -webkit-text-fill-color: var(--surface0);
        }


        #search-results-container {
            display: none;
            background-color: var(--base);
            border: 2px solid var(--surface0);
            z-index: 100;
            overflow-y: auto;
            box-shadow: 0 10px 30px rgba(0, 0, 0, calc(var(--shadow-intensity) * 0.1));
            box-sizing: border-box;
            scrollbar-width: none;
    border-radius: var(--border-radius);
        }
        #search-results-container::-webkit-scrollbar { display: none; }

        #dashboard-container:not(.fullscreen-mode) #search-results-container {
            position: absolute;
            top: 80px;
            left: 0;
            width: 100%;
            height: 415px; 
        }


        .fullscreen-mode .command-box {
            grid-column: 2;
            grid-row: 1;
        }
        .fullscreen-mode #search-results-container {
            grid-column: 2;
            grid-row: 2;
            position: static !important;
            height: auto !important;
            max-height: 300px;
            width: 100%;
        }

        .search-result-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--surface0); font-size: 13px; line-height: 1.5; transition: background-color 0.2s; }
        .search-result-item:hover { background-color: var(--surface0); }
        .search-result-item .cat-name { color: var(--mauve); font-weight: bold; }
        .search-result-item .tab-name { color: var(--blue); }
        .search-result-item .snippet { color: var(--subtext0); display: block; margin-top: 4px; }
        .search-result-item .snippet strong { color: var(--green); background-color: var(--surface0); font-weight: normal; }
        .search-no-results { padding: 20px; text-align: center; color: var(--subtext0); font-style: italic; }

        .line-numbers {
            width: 5ch;
            padding: 10px 5px 0 0;
            text-align: right;
            color: var(--subtext0);
            font-size: 14px;
            line-height: 1.5;
            font-family: 'JetBrains Mono', monospace;
            flex-shrink: 0;
            user-select: none;
            pointer-events: none;
            background-color: var(--base);
        }

        .notes-box .header {
            position: sticky;
            display: flex;
            justify-content: space-between;
            gap: 6px;
            flex-wrap: nowrap;
            align-items: center;
            border-bottom: 1px solid var(--surface0);
            padding-bottom: 8px;
            margin-bottom: 10px;
        }

        #notes-tabs-container {
            display: flex;
            gap: 8px;
            overflow: hidden;
            white-space: nowrap;
            flex-grow: 1;
            flex-shrink: 1;
            min-width: 0;
            align-items: center;
        }

        .note-tab {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            padding: 4px 10px 4px 4px;
            background-color: var(--mantle);
            border-radius: var(--border-radius);
            border: 1px solid var(--surface0);
            border-left: 3px solid var(--tab-color, var(--green));
            transition: opacity 0.2s ease, background-color 0.2s ease, border-left-width 0.2s ease;
            opacity: 0.6;
        }

        .drag-handle {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            width: 12px;
            height: 22px;
            cursor: grab;
            margin-right: 4px;
            flex-shrink: 0;
            border-radius: 3px;
            transition: background-color 0.2s;
        }
        .note-tab:hover .drag-handle {
            background-color: var(--surface0);
        }
        .drag-handle span {
            width: 3px;
            height: 3px;
            background-color: var(--subtext0);
            border-radius: 50%;
        }
        .drag-handle:active {
            cursor: grabbing;
        }
        .note-tab.dragging {
            opacity: 0.4;
            background: var(--crust);
            border-color: var(--mauve);
        }

        .note-tab:hover {
            opacity: 1;
        }

        .note-tab.active {
            background-color: var(--base);
            border-color: var(--subtext0);
            border-left: 6px solid var(--tab-color, var(--green));
            opacity: 1;
        }

        .category-count-badge {
            background-color: var(--surface0);
            color: var(--subtext0);
            font-size: 10px;
            padding: 1px 5px;
            border-radius: calc(var(--border-radius) + 2px);
            font-weight: bold;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 12px;
        }
        .note-tab.active .category-count-badge {
            background-color: var(--mantle);
            color: var(--text);
        }

        .tab-name-input {
            background: transparent;
            border: none;
            color: var(--text);
            font-family: inherit;
            font-size: 11px;
            font-weight: 500;
            width: 80px;
            outline: none;
            transition: background-color 0.2s ease;
            text-transform: uppercase;
            text-align: center;
            cursor: inherit;
            padding: 0;
        }

        .note-tab.active .tab-name-input {
            font-weight: bold;
        }

        .tab-name-input:not([readonly]) {
            cursor: text; 
            background-color: rgba(0, 0, 0, 0.3);
            border-radius: max(3px, calc(var(--border-radius) / 2));
        }

        .tab-nav-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background-color: var(--mantle);
            border-radius: var(--border-radius);
            border: 1px solid var(--surface0);
            border-left: 3px solid var(--surface0);
            color: var(--text);
            font-family: inherit;
            font-size: 14px;
            font-weight: bold;
            cursor: pointer;
            padding: 4px 10px;
            transition: opacity 0.2s ease, background-color 0.2s ease;
            opacity: 0.6;
            user-select: none;
            flex-shrink: 0;
            box-sizing: border-box;
            text-decoration: none;
        }
        
        .tab-nav-btn:hover {
            opacity: 1;
            background-color: var(--surface0);
        }

        .tab-nav-btn:disabled {
            opacity: 0.2;
            cursor: default;
            background-color: var(--mantle);
        }

        .add-tab-wrapper {
            display: flex;
            padding-left: 8px;
            margin-left: 8px;
            border-left: 1px solid var(--surface0);
            align-items: center;
            justify-content: center;
        }

        #category-display {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background-color: var(--mantle);
            color: var(--text) !important;
            padding: 4px 10px;
            border-radius: var(--border-radius);
            font-size: 11px;
            font-weight: bold;
            cursor: pointer;
            transition: opacity 0.2s ease;
            border: 1px solid var(--surface0);
            margin-right: 6px;
            opacity: 0.6;
            white-space: nowrap;
        }
        #category-display:hover { opacity: 1; }
        #category-display::before { content: "❮"; font-size: 10px; opacity: 0.7; }

        .notes-box .header .decipher-text {
        flex-shrink: 0;
        }

        .header {
            font-size: 11px;
            border-bottom: 1px solid var(--surface0);
            padding-bottom: 4px;
            display: flex;
            justify-content: space-between;
            color: var(--subtext0);
            margin-bottom: 10px;
            z-index: 6;
        }

        .decipher-text {
            display: inline-block;
            white-space: nowrap;
        }

        .clock-display {
            font-size: 50px;
            text-align: left;
            margin: auto 0;
            letter-spacing: 2px;
            color: var(--mauve);
        }

        .timer-display {
            font-size: 60px;
            text-align: center;
            margin: 5px 0;
            letter-spacing: 3px;
        }

        .progress-container {
            width: 100%;
            height: 10px;
            border: 1px solid var(--surface0);
            background-color: var(--mantle);
            margin-bottom: 15px;
            cursor: pointer;
            position: relative;
        }

        #progress-bar {
            width: 0%;
            height: 100%;
            background-color: var(--green);
            transition: width 0.1s linear;
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 10px;
        }

        button {
            background: transparent;
            border: 1px solid var(--surface0);
            color: var(--text);
            padding: 5px 10px;
            font-family: inherit;
            font-size: 10px;
            cursor: pointer;
            text-transform: uppercase;
            transition: all 0.2s;
        }

        button:hover {
            background-color: var(--surface0);
            color: var(--green);
            border-color: var(--green);
        }

        .links-grid {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin-top: 10px;
            overflow-y: auto;
            scrollbar-width: none;
            flex: 1;
            min-height: 0;
        }
        .links-grid::-webkit-scrollbar { display: none; }

        .link-item {
            color: var(--blue);
            text-decoration: none;
            font-size: 14px;
            padding: 5px;
            border-left: 2px solid transparent;
            transition: all 0.3s;
        }

        .link-item:hover {
            border-left: 2px solid var(--blue);
            background-color: var(--surface0);
            padding-left: 10px;
        }

        .link-editor-container {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .link-edit-input {
            background: var(--surface0);
            border: none;
            border-bottom: 1px solid transparent;
            color: var(--blue);
            font-family: inherit;
            font-size: 11px;
            padding: 2px 5px;
            outline: none;
            transition: border-color 0.2s;
        }

        .link-edit-input:focus {
            border-bottom-color: var(--mauve);
            background: var(--base);
        }

        .links-grid.edit-mode {
        gap: 7px;
        margin-top: 0px;
        }

        .links-grid.edit-mode .link-editor-container {
        gap: 0px;
        }

        #notes-area {
            flex: 1;
            background: transparent;
            border: none !important;
            margin: 0 !important;
            padding: 10px !important;
            color: var(--green);
            font-family: 'JetBrains Mono', monospace;
            font-size: 14px;
        line-height: 21px;
            resize: none;
            outline: none;
            width: 100%;
        overflow: hidden;
            box-sizing: border-box;
            display: block;
        }

        #notes-area.todo-cmd-input {
            flex: none;
            height: 35px !important;
            min-height: 35px !important;
            border-bottom: 1px dashed var(--surface0) !important;
            margin-bottom: 10px !important;
            overflow: hidden;
        }

        #notes-area::-webkit-scrollbar {
        display: none;
        }


        .status-text {
            font-size: 10px;
            color: var(--subtext0);
            margin-top: auto;
        }

        .timezone-input {
            position: absolute;
            bottom: 15px;
            right: 15px;
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--surface0);
            color: var(--subtext0);
            font-family: inherit;
            font-size: 10px;
            text-align: center;
            width: 120px;
            outline: none;
            opacity: 0;
            transition: opacity 0.3s ease, border-bottom 0.3s ease;
        }

        .clock-box:hover .timezone-input {
            opacity: 1;
        }

        .timezone-input:focus {
            border-bottom-color: var(--green);
            color: var(--text);
        }

        .timer-settings {
            position: absolute;
            bottom: 15px;
            right: 15px;
        display: flex;
        gap: 10px;
            opacity: 0;
            transition: opacity 0.3s ease, right 0.3s ease;
        z-index: 10;
        }

        .timer-box:hover .timer-settings {
            opacity: 1;
        }

        .timer-input {
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--surface0);
            color: var(--subtext0);
            font-family: inherit;
        font-size: 11px;
            text-align: center;
        width: 2ch;
            outline: none;
        padding: 2px 0;
        }
        .timer-input:focus {
            border-bottom-color: var(--green);
            color: var(--text);
        }

        .timer-content-wrapper {
            display: flex;
            flex: 1;
            width: 100%;
            overflow: hidden;
            gap: 0;
            transition: gap 0.3s ease;
        }
        .timer-main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
        }
        .timer-side-panel {
            width: 0;
            opacity: 0;
            overflow: hidden;
            transition: all 0.3s ease;
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            position: relative;
            gap: 10px;
            border-left: 1px dashed transparent;
            margin-left: 0;
        }
        .timer-box.show-side .timer-content-wrapper {
            gap: 15px;
        }
        .timer-box.show-side .timer-side-panel {
            width: 80px;
            opacity: 1;
            padding-left: 10px;
            border-left-color: var(--surface0);
        }
        .focus-core-container {
            display: flex; 
            flex-direction: column-reverse;
            gap: 1px;
            width: 16px;
            height: 110px;
            padding: 2px;
            background-color: var(--mantle);
            border: 1px solid var(--surface0);
            border-radius: max(3px, calc(var(--border-radius) / 2));
            box-sizing: border-box;
        }
        .focus-core-segment {
            flex: 1; 
            background-color: var(--surface0);
            transition: all 0.5s ease;
        }
        .focus-core-segment.charged {
            background-color: var(--blue);
            box-shadow: 0 0 8px var(--blue);
        }
        .focus-core-label {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            letter-spacing: 2px;
            font-size: 11px;
            font-weight: bold;
            color: var(--subtext0);
        }
        .focus-core-settings {
            position: absolute;
            bottom: 1px;
            left: 10px;
            right: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
            padding-top: 5px;
        }
        .timer-side-panel:hover .focus-core-settings {
            opacity: 1;
            pointer-events: auto;
        }
        #fcore-interval-input {
            width: 3ch;
            padding: 1px 0;
        }
        .fcore-util-btn {
            background: transparent;
            border: none;
            color: var(--subtext0);
            cursor: pointer;
            font-size: 16px;
            padding: 0 2px;
            line-height: 1;
            transition: color 0.2s ease;
        }
        .fcore-util-btn:hover {
            color: var(--red);
        }
        .timer-slide-btn {
            position: absolute;
            right: 10px;
            top: 38px;
            cursor: pointer; 
            opacity: 0;
            color: var(--mauve);
            font-size: 16px;
            font-weight: bold;
            transition: transform 0.3s ease, color 0.2s ease, opacity 0.3s ease;
            user-select: none;
            z-index: 10;
            padding: 5px;
            line-height: 1;
        }
        .timer-box:hover .timer-slide-btn { opacity: 1; }
        .timer-box.show-side .timer-slide-btn {
            transform: rotate(180deg);
        }
        .box.minimized .timer-slide-btn {
            display: none !important;
        }
        .timer-box.show-side .timer-settings {
            right: 106px;
        }

        #todo-list-container {
            display: none;
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            flex-direction: column;
            gap: 8px;
            scrollbar-width: none;
        }
        #todo-list-container::-webkit-scrollbar { display: none; }
        
        .todo-item {
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--mantle);
            padding: 8px 12px;
            border: 1px solid var(--surface0);
            transition: border-color 0.2s;
        }
        .todo-item:hover { border-color: var(--accent); }
        
        .todo-checkbox {
            width: 18px;
            height: 18px;
            border: 2px solid var(--surface0);
            background: transparent;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .todo-checkbox.checked { background: var(--green); border-color: var(--green); }
        .todo-checkbox.checked::after { content: '✓'; color: var(--base); font-size: 14px; font-weight: bold; }
        
        .todo-text {
            flex: 1;
            background: transparent;
            border: none;
            color: var(--text);
            font-family: inherit;
            font-size: 14px;
            outline: none;
        }
        .todo-text.completed { text-decoration: line-through; color: var(--subtext0); }
        
        .todo-delete {
            color: var(--red);
            cursor: pointer;
            font-size: 16px;
            opacity: 0.4;
            transition: opacity 0.2s;
        }
        .todo-delete:hover { opacity: 1; }
        
        .todo-drag-handle {
            cursor: grab;
            color: var(--surface0);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s;
        }
        .todo-drag-handle:hover {
            color: var(--subtext0);
        }
        .todo-drag-handle:active {
            cursor: grabbing;
        }
        .todo-item.dragging {
            opacity: 0.5;
        }

        .add-todo-btn {
            margin-top: 10px;
            border-style: dashed;
            opacity: 0.6;
        }
        .add-todo-btn:hover { opacity: 1; border-style: solid; }

        #help-view-container {
            display: none;
            flex: 1;
            overflow-y: auto;
            padding: 12px;
            flex-direction: column;
            gap: 10px;
            scrollbar-width: none;
            font-size: 13px;
        }
        #help-view-container::-webkit-scrollbar { display: none; }
        .help-section { margin-bottom: 10px; }
        .help-title { 
            color: var(--mauve); 
            font-weight: bold; 
            margin-bottom: 8px; 
            border-bottom: 1px solid var(--surface0);
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        .help-item { display: flex; gap: 15px; margin-bottom: 5px; line-height: 1.4; }
        .help-key { color: var(--green); min-width: 140px; font-weight: bold; font-family: 'JetBrains Mono', monospace; }
        .help-desc { color: var(--subtext0); }
        .help-cmd { color: var(--blue); font-weight: bold; }
        
        #calendar-view-container {
            display: none;
            flex: 1;
            overflow-y: auto;
            padding: 10px;
            flex-direction: column;
            gap: 8px;
            scrollbar-width: none;
            box-sizing: border-box;
            height: 100%;
            min-height: 460px;
        }
        #calendar-view-container::-webkit-scrollbar { display: none; }
        .calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
        .calendar-header button { font-size: 16px; padding: 2px 10px; border: 1px solid var(--surface0); background: transparent; color: var(--subtext0); cursor: pointer; transition: all 0.2s; }
        .calendar-header button:hover { color: var(--green); border-color: var(--green); }
        .calendar-grid { 
            display: grid; 
            grid-template-columns: repeat(7, 1fr); 
            grid-template-rows: max-content;
            grid-auto-rows: 1fr;
            gap: 5px; 
            flex: 1; 
            min-height: 420px;
        }
        .calendar-day-header { text-align: center; font-weight: bold; color: var(--mauve); font-size: 11px; padding-bottom: 5px; border-bottom: 1px solid var(--surface0); }
        .calendar-cell { border: 1px solid var(--surface0); padding: 4px; display: flex; flex-direction: column; background: var(--mantle); transition: border-color 0.2s; border-radius: 4px; min-height: 0; cursor: pointer; }
        .calendar-cell:hover { border-color: var(--accent); }
        .calendar-cell.today { border-color: var(--green); background: rgba(166, 227, 161, 0.05); }
        .calendar-date { font-size: 10px; color: var(--subtext0); margin-bottom: 4px; text-align: right; font-weight: bold; }
        .calendar-cell-indicators { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; padding: 2px; }
        .cal-indicator { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
        .cal-indicator.done { background: var(--surface0); }
        .cal-indicator.bday { background: transparent; width: auto; height: auto; font-size: 10px; border-radius: 0; line-height: 1; }
        .bday-btn { cursor: pointer; opacity: 0.4; transition: opacity 0.2s; font-size: 14px; user-select: none; }
        .bday-btn:hover { opacity: 0.8; }
        .bday-btn.active { opacity: 1; filter: drop-shadow(0 0 4px var(--peach)); }

        .fullscreen-mode .task-manager-box {
            display: flex;
            grid-column: 3;
            grid-row: 1 / span 3;
        }
        
        .task-list {
            flex: 1;
            overflow-y: auto;
            scrollbar-width: none;
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding-top: 5px;
        }
        .task-list::-webkit-scrollbar { display: none; }

        .task-item {
            padding: 10px 12px;
            background: var(--mantle);
            border: 1px solid var(--surface0);
            border-left: 4px solid var(--accent);
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            text-transform: uppercase;
            font-weight: 500;
        }
        .task-item:hover { background: var(--surface0); padding-left: 18px; }
        .task-item.active { 
            background: var(--surface0); 
            border-color: var(--text);
        }

        .todo-reminder-wrapper {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .todo-datetime {
            background: var(--surface0);
            border: 1px solid transparent;
            color: var(--subtext0);
            font-family: inherit;
            font-size: 11px;
            padding: 3px 5px;
            outline: none;
            border-radius: max(3px, calc(var(--border-radius) / 2));
            transition: border-color 0.2s, color 0.2s;
        }
        .todo-datetime:focus {
            border-color: var(--mauve);
            color: var(--text);
        }
        .todo-datetime::-webkit-calendar-picker-indicator {
            filter: invert(0.8);
            cursor: pointer;
        }
        .todo-reminder-btn {
            padding: 3px 8px;
            font-size: 10px;
            border-radius: max(3px, calc(var(--border-radius) / 2));
            font-weight: bold;
        }
        .todo-reminder-status {
            font-size: 10px;
            color: var(--subtext0);
            width: 45px;
            text-align: left;
            font-weight: bold;
        }

        #tablet-overlay-toggle {
            position: fixed;
            bottom: 20px;
            left: 20px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: var(--surface0);
            color: var(--text);
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            z-index: 1000;
            transition: background-color 0.3s, opacity 0.3s;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
            opacity: 0;
        }
        #tablet-overlay-toggle::before {
            content: '';
            position: absolute;
            bottom: -20px;
            left: -20px;
            width: 100px;
            height: 100px;
            border-radius: 50%;
        }
        #tablet-overlay-toggle:hover, #tablet-overlay-toggle.active {
            background-color: var(--subtext0);
            color: var(--base);
            opacity: 1 !important;
        }
        #tablet-overlay-toggle.typing-fade {
            opacity: 0 !important;
        }
        #tablet-overlay-buttons {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            display: flex;
            gap: 15px;
            z-index: 1000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s, transform 0.3s;
        }
        #tablet-overlay-buttons.active {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(-50%) translateY(0);
        }
        .tablet-btn {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: var(--surface0);
            color: var(--text);
            border: none;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: background-color 0.3s;
            box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        }
        .tablet-btn:hover {
            background-color: var(--subtext0);
            color: var(--base);
        }
        .tablet-btn svg, #tablet-overlay-toggle svg {
            width: 24px;
            height: 24px;
            fill: none;
            stroke: currentColor;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        #theme-selector-overlay, #admin-overlay {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(5px);
            z-index: 9999;
            display: flex;
            justify-content: center;
            align-items: center;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
        }
        #theme-selector-overlay.active, #admin-overlay.active { opacity: 1; pointer-events: auto; }
        .theme-modal {
            background: var(--base);
            border: 2px solid var(--surface0);
            border-radius: var(--border-radius);
            padding: 20px;
            width: 400px;
            max-width: 90vw;
            box-shadow: 0 20px 40px rgba(0, 0, 0, calc(var(--shadow-intensity) * 0.1));
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .theme-option {
            background: var(--mantle); border: 1px solid var(--surface0);
            padding: 15px; border-radius: var(--border-radius); cursor: pointer;
            transition: border-color 0.2s; display: flex; justify-content: space-between; align-items: center;
        }
        .theme-option:hover { border-color: var(--accent); }
        .theme-option.active-theme { border-left: 4px solid var(--green); background: var(--surface0); }
        .theme-color-preview { display: flex; gap: 5px; }
        .theme-color-dot { width: 12px; height: 12px; border-radius: 50%; }
        
        #theme-edit-container {
            scrollbar-width: none;
        }
        #theme-edit-container::-webkit-scrollbar { display: none; }
        .theme-edit-row {
            display: flex; justify-content: space-between; align-items: center; 
            padding: 6px 10px; border-bottom: 1px dashed var(--surface0);
            background: var(--mantle); border-radius: max(3px, calc(var(--border-radius) / 2));
        }
        .theme-edit-label { color: var(--mauve); font-size: 12px; font-weight: bold; }
        .theme-edit-input {
            background: var(--base); border: 1px solid var(--surface0); color: var(--text);
            padding: 4px 8px; font-family: inherit; font-size: 11px;
            border-radius: max(3px, calc(var(--border-radius) / 2)); width: 140px;
            outline: none; transition: border-color 0.2s;
        }
        .theme-edit-input:focus { border-color: var(--green); }

        /* Quick Panel Styling */
        .quick-tab { transition: color 0.2s; }
        .quick-tab.active { border-bottom: 2px solid var(--mauve); padding-bottom: 2px; }
        .quick-item-card {
            background: var(--mantle);
            border: 1px solid var(--surface0);
            border-radius: var(--border-radius);
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            transition: border-color 0.2s;
        }
        .quick-item-card:hover { border-color: var(--accent); }
        .quick-item-date { font-size: 9px; color: var(--subtext0); }
        .quick-item-text { font-size: 13px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; color: var(--text); }

        /* Document Panel (File Manager) */
        .file-item-card {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
            position: relative;
            overflow: hidden;
        }
        .file-item-info {
            display: flex;
            flex-direction: column;
            min-width: 0;
            flex: 1;
            overflow: hidden;
            mask-image: linear-gradient(to right, black 85%, transparent 100%);
            -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
            transition: mask-image 0.2s, -webkit-mask-image 0.2s;
        }
        .file-item-card:hover .file-item-info {
            mask-image: none;
            -webkit-mask-image: none;
        }
        .file-name-text {
            color: var(--text);
            font-size: 12px;
            font-weight: bold;
            white-space: nowrap;
            display: inline-block;
        }
        .file-meta-text {
            color: var(--subtext0);
            font-size: 10px;
            margin-top: 2px;
        }
        .file-actions {
            position: absolute;
            right: 0; top: 0; bottom: 0;
            display: flex; align-items: center; gap: 8px;
            background: linear-gradient(to right, transparent 0%, var(--mantle) 15%, var(--mantle) 100%);
            padding-left: 20px; padding-right: 10px;
            opacity: 0; pointer-events: none;
            transition: opacity 0.2s ease;
        }
        .file-item-card:hover .file-actions {
            opacity: 1; pointer-events: auto;
        }