        :root {
            color-scheme: light;
            --page: #ffffff;
            --panel: #fff;
            --panel-muted: #fbfbfa;
            --text: #242522;
            --muted: #8b8d85;
            --line: #e9e9e5;
            --hover: #f2f2ef;
            --selected: #eeeee9;
            --accent: #6d795e;
            --accent-soft: #edf0e9;
            --danger: #b3534b;
            --shadow: 0 16px 42px rgba(34, 36, 30, .08);
        }
        * { box-sizing: border-box; }
        [hidden] { display: none !important; }
        body {
            margin: 0;
            background: var(--page);
            color: var(--text);
            font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            font-size: 14px;
            -webkit-font-smoothing: antialiased;
        }
        button, input, textarea { font: inherit; }
        button { color: inherit; }
        .app { display: flex; width: 100%; height: 100dvh; min-height: 480px; overflow: hidden; }
        .sidebar {
            width: 286px;
            flex: 0 0 286px;
            display: flex;
            flex-direction: column;
            background: var(--panel);
            border-right: 1px solid var(--line);
            transition: width .2s ease, flex-basis .2s ease;
            z-index: 4;
        }
        .brand-row { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 19px; }
        .brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; letter-spacing: -.3px; }
        .brand-mark { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: white; }
        .icon-button, .small-action, .toolbar-button {
            display: inline-grid; place-items: center; border: 0; background: transparent; color: var(--muted);
            cursor: pointer; border-radius: 8px; transition: background .15s, color .15s;
        }
        .icon-button { width: 32px; height: 32px; }
        .small-action { width: 25px; height: 25px; opacity: .48; }
        .icon-button:hover, .small-action:hover, .toolbar-button:hover { background: var(--hover); color: var(--text); }
        .small-action:focus-visible, .tree-row:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #9aa68b; outline-offset: 2px; }
        .sidebar-tools { padding: 5px 14px 14px; }
        .search-box { position: relative; }
        .search-box svg { position: absolute; left: 11px; top: 10px; color: #a0a198; }
        .search-box input {
            width: 100%; height: 35px; border: 1px solid transparent; border-radius: 8px;
            background: var(--page); padding: 0 30px 0 34px; outline: 0; color: var(--text);
            font-size: 12px; transition: border-color .15s, background .15s;
        }
        .search-box input:focus { border-color: #d7d9d1; background: white; }
        .search-box input::placeholder { color: #a0a198; }
        .shortcut { position: absolute; right: 9px; top: 9px; color: #a8a99f; font-size: 10px; }
        .section-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 13px 8px 17px; color: #999b93; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; text-transform: uppercase; }
        .tree { flex: 1; overflow: auto; padding: 2px 9px 16px; }
        .tree-group { margin-bottom: 4px; }
        .tree-row {
            min-width: 0; width: 100%; height: 35px; display: flex; align-items: center; gap: 9px;
            padding: 0 7px; border: 0; border-radius: 7px; background: transparent; text-align: left;
            color: #55574f; cursor: pointer; font-size: 12.5px;
        }
        .tree-row:hover { background: var(--hover); }
        .folder-row { color: #383a34; font-weight: 580; }
        .folder-row .chevron { color: #a0a198; transition: transform .16s; flex: 0 0 auto; }
        .folder-row[aria-expanded="true"] .chevron { transform: rotate(90deg); }
        .tree-row .row-icon { color: #92968a; flex: 0 0 auto; }
        .folder-row .row-icon { color: #a08a5d; }
        .tree-row .row-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
        .tree-row .small-action { flex: 0 0 auto; margin-right: -3px; }
        .tree-row:hover .small-action, .tree-row:focus-within .small-action,
        .folder-entry:hover .small-action, .folder-entry:focus-within .small-action { opacity: 1; }
        .folder-entry { display: flex; align-items: center; gap: 1px; }
        .folder-entry .folder-row { flex: 1; min-width: 0; }
        .folder-entry > .small-action { flex: 0 0 auto; margin-right: 2px; }
        .note-row { padding-left: 31px; color: #777970; }
        .note-row.active { background: var(--selected); color: #30322c; font-weight: 570; }
        .note-row.active .row-icon { color: var(--accent); }
        .note-children { padding-top: 2px; }
        .tree-separator { height: 1px; margin: 11px 8px; background: var(--line); }
        .trash-row { color: #777970; }
        .trash-row.active { background: var(--selected); color: #30322c; font-weight: 570; }
        .trash-row .row-icon { color: #92968a; }
        .trash-count { min-width: 20px; padding: 2px 6px; border-radius: 10px; background: var(--page); color: #888a82; text-align: center; font-size: 10px; }
        .empty-tree { padding: 22px 14px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
        .sidebar-footer { padding: 13px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; }
        .new-note {
            width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center;
            border: 0; border-radius: 8px; background: var(--accent); color: white; cursor: pointer;
            transition: background .15s;
        }
        .new-note:hover { background: #5d694f; }
        .sidebar-hint { color: #a0a198; font-size: 10px; white-space: nowrap; }
        .workspace { min-width: 0; flex: 1; display: flex; flex-direction: column; }
        .topbar { height: 58px; flex: 0 0 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.62); }
        .breadcrumbs { display: flex; align-items: center; gap: 8px; color: #999b93; font-size: 12px; min-width: 0; flex: 0 1 auto; }
        .breadcrumbs .crumb-current { color: #585a53; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .top-actions { display: flex; align-items: center; gap: 10px; }
        .save-state { display: flex; align-items: center; gap: 6px; color: #96988f; font-size: 11px; }
        .save-dot { width: 6px; height: 6px; border-radius: 50%; background: #8e9b7c; }
        .save-state.saving .save-dot { background: #d5a255; }
        .save-state.error .save-dot { background: var(--danger); }
        .top-action { height: 31px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #66685f; cursor: pointer; font-size: 11px; }
        .top-action:hover { background: var(--hover); color: var(--text); }
        .top-action.danger:hover { color: var(--danger); border-color: #ead4d1; background: #fff9f8; }
        .editor-scroll { flex: 1; overflow: auto; }
        .editor { width: min(100% - 56px, 740px); margin: 0 auto; padding: 62px 0 55px; }
        .note-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 23px; color: #9a9b94; font-size: 11px; }
        .meta-folder { display: inline-flex; align-items: center; gap: 6px; color: #77796f; }
        .meta-divider { color: #c4c5be; }
        .title-input { width: 100%; margin: 0 0 12px; padding: 0; border: 0; outline: 0; background: transparent; color: #292a26; font-size: clamp(29px, 4vw, 39px); font-weight: 650; letter-spacing: -1.5px; line-height: 1.2; }
        .title-input::placeholder { color: #c1c2bc; }
        .note-subtitle { margin-bottom: 38px; color: #a0a198; font-size: 12px; }
        .editor-divider { height: 1px; background: var(--line); margin-bottom: 29px; }
        .format-toolbar { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; flex: 1 1 auto; margin: 0 12px; overflow-x: auto; scrollbar-width: none; }
        .format-toolbar::-webkit-scrollbar { display: none; }
        .format-button { min-width: 29px; height: 27px; padding: 0 7px; border: 0; border-radius: 5px; background: transparent; color: #85877e; cursor: pointer; font-size: 10px; }
        .format-button:hover { background: var(--hover); color: #44463f; }
        .format-button.strong { font-weight: 750; }
        .format-button.italic { font-family: Georgia, serif; font-size: 12px; font-style: italic; }
        .format-button.list-format { min-width: auto; font-size: 10px; }
        .format-separator { width: 1px; height: 15px; margin: 0 3px; background: var(--line); }
        .content-input { width: 100%; min-height: 360px; display: block; resize: vertical; border: 0; outline: 0; padding: 0; background: transparent; color: #55574f; font-size: 14px; line-height: 1.9; font-weight: 400; }
        .content-input::placeholder { color: #b4b5ae; }
        .editor-empty { width: min(100% - 56px, 520px); margin: auto; text-align: center; color: var(--muted); }
        .empty-illustration { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 17px; border: 1px solid var(--line); border-radius: 16px; background: white; color: #929a87; }
        .editor-empty h1 { margin: 0 0 9px; color: #383a34; font-size: 20px; letter-spacing: -.45px; }
        .editor-empty p { margin: 0 auto 21px; max-width: 330px; color: #92948b; font-size: 12px; line-height: 1.7; }
        .empty-create { border: 0; border-radius: 7px; background: var(--accent); color: white; padding: 9px 13px; font-size: 12px; font-weight: 600; cursor: pointer; }
        .empty-create:hover { background: #5d694f; }
        .trash-view { width: min(100% - 56px, 740px); margin: 0 auto; padding: 56px 0; }
        .trash-heading { padding-bottom: 25px; border-bottom: 1px solid var(--line); }
        .trash-mark { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; color: #929a87; }
        .trash-heading h1 { margin: 0 0 7px; color: #292a26; font-size: 26px; letter-spacing: -.8px; }
        .trash-heading p { margin: 0; color: #92948b; font-size: 12px; line-height: 1.6; }
        .trash-list { display: grid; gap: 9px; padding-top: 17px; }
        .trash-item { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: white; }
        .trash-copy { min-width: 0; flex: 1; }
        .trash-title { overflow: hidden; color: #44463f; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
        .trash-detail { margin-top: 5px; overflow: hidden; color: #999b93; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
        .trash-item-actions { display: flex; flex: 0 0 auto; gap: 6px; }
        .trash-item-actions button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: white; color: #66685f; cursor: pointer; font-size: 10px; }
        .trash-item-actions button:hover { background: var(--hover); }
        .trash-item-actions .permanent-delete { color: var(--danger); }
        .trash-empty { padding: 42px 12px; color: #999b93; font-size: 12px; text-align: center; }
        .settings-view { width: min(100% - 56px, 740px); margin: 0 auto; padding: 48px 0 56px; }
        .settings-heading { padding-bottom: 22px; }
        .settings-heading > p { margin: 0 0 9px; color: #999b93; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; }
        .settings-heading h1 { margin: 0 0 7px; color: #292a26; font-size: 29px; letter-spacing: -.8px; }
        .settings-heading > span { color: #92948b; font-size: 12px; }
        .settings-card { margin-bottom: 12px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: white; }
        .settings-card-heading h2 { margin: 0 0 6px; color: #44463f; font-size: 13px; font-weight: 650; }
        .settings-card-heading p { max-width: 470px; margin: 0 0 16px; color: #92948b; font-size: 11px; line-height: 1.6; }
        .settings-form { display: grid; gap: 12px; max-width: 420px; }
        .settings-form label { display: grid; gap: 6px; color: #676960; font-size: 11px; font-weight: 600; }
        .settings-form input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: white; color: var(--text); font-size: 12px; font-weight: 400; }
        .settings-form input:focus { border-color: #9aa68b; }
        .settings-form input::placeholder { color: #b0b1aa; }
        .settings-hint { margin: -4px 0 0; color: #9a9c94; font-size: 10px; line-height: 1.5; }
        .settings-status { margin: 0; color: var(--accent); font-size: 11px; }
        .settings-status:empty { display: none; }
        .settings-status.error { color: var(--danger); }
        .settings-submit, .settings-lock { min-height: 34px; width: fit-content; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #66685f; cursor: pointer; font-size: 11px; font-weight: 550; }
        .settings-submit { border-color: var(--accent); background: var(--accent); color: white; }
        .settings-submit:hover { background: #5d694f; }
        .settings-lock:hover { background: var(--hover); }
        .settings-submit:disabled { opacity: .55; cursor: not-allowed; }
        .settings-backup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
        .backup-hint { margin: 7px 0 16px; }
        .backup-restore-form { padding-top: 15px; border-top: 1px solid var(--line); }
        .backup-restore-form input[type="file"] { height: auto; min-height: 36px; padding: 7px; }
        .settings-stats { display: flex; gap: 28px; margin: 3px 0 16px; }
        .settings-stats div { display: grid; gap: 3px; }
        .settings-stats strong { color: #44463f; font-size: 17px; font-weight: 650; }
        .settings-stats span { color: #999b93; font-size: 10px; }
        .toast { position: fixed; bottom: 22px; left: 50%; z-index: 10; transform: translate(-50%, 12px); padding: 10px 15px; border: 1px solid #e8e8e2; border-radius: 9px; background: white; box-shadow: var(--shadow); color: #55574f; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
        .toast.visible { opacity: 1; transform: translate(-50%, 0); }
        .vault-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; overflow-y: auto; padding: 22px; background: #fff; }
        .vault-card { width: min(100%, 410px); max-height: calc(100dvh - 44px); overflow-y: auto; padding: 30px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
        .vault-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 15px; font-weight: 650; letter-spacing: -.3px; }
        .vault-privacy { margin: 0 0 23px; color: #90928a; font-size: 11px; line-height: 1.65; }
        .vault-panel h1 { margin: 0 0 8px; color: #30322c; font-size: 20px; letter-spacing: -.45px; }
        .vault-description { margin: 0 0 20px; color: #85877e; font-size: 12px; line-height: 1.65; }
        .vault-form { display: grid; gap: 13px; }
        .vault-form label { display: grid; gap: 6px; color: #676960; font-size: 11px; font-weight: 600; }
        .vault-form input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: white; color: var(--text); font-size: 12px; font-weight: 400; }
        .vault-form input[type="file"] { height: auto; min-height: 38px; padding: 7px; }
        .vault-form input:focus { border-color: #9aa68b; }
        .vault-form input::placeholder { color: #b0b1aa; }
        .vault-hint { margin: -4px 0 0; color: #9a9c94; font-size: 10px; line-height: 1.5; }
        .vault-status { min-height: 0; margin: 0; color: var(--danger); font-size: 11px; line-height: 1.5; }
        .vault-status:empty { display: none; }
        .vault-submit { width: 100%; height: 38px; margin-top: 2px; border: 0; border-radius: 7px; background: var(--accent); color: white; cursor: pointer; font-size: 12px; font-weight: 600; }
        .vault-submit:hover { background: #5d694f; }
        .vault-link { display: block; margin-top: 15px; padding: 0; border: 0; background: transparent; color: #6d795e; cursor: pointer; font-size: 11px; }
        .vault-question { margin: 0 0 18px; padding: 11px 12px; border-radius: 7px; background: var(--page); color: #55574f; font-size: 12px; line-height: 1.5; }
        .note-modal { width: min(420px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 0; background: white; color: var(--text); box-shadow: var(--shadow); }
        .note-modal::backdrop { background: rgba(34, 36, 30, .28); backdrop-filter: blur(2px); }
        .modal-card { padding: 22px; }
        .modal-card h2 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.3px; }
        .modal-description { margin: 0 0 18px; color: #777970; font-size: 12px; line-height: 1.65; }
        .modal-label { display: block; margin-bottom: 7px; color: #66685f; font-size: 11px; font-weight: 600; }
        .modal-field { display: block; width: 100%; height: 38px; margin-bottom: 19px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: white; color: var(--text); font-size: 12px; }
        .modal-field:focus { border-color: #9aa68b; }
        .modal-error { margin: -10px 0 14px; color: var(--danger); font-size: 11px; }
        .modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
        .modal-button { height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #66685f; cursor: pointer; font-size: 11px; font-weight: 550; }
        .modal-button:hover { background: var(--hover); }
        .modal-button.primary { border-color: var(--accent); background: var(--accent); color: white; }
        .modal-button.primary:hover { background: #5d694f; }
        .modal-button.destructive { border-color: var(--danger); background: var(--danger); color: white; }
        .fatal { position: fixed; inset: 0; z-index: 20; display: none; place-items: center; padding: 25px; background: var(--page); }
        .fatal-card { max-width: 420px; padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: white; text-align: center; box-shadow: var(--shadow); }
        .fatal-card h1 { margin: 0 0 9px; font-size: 18px; }
        .fatal-card p { margin: 0; color: #777970; font-size: 13px; line-height: 1.7; }
        .loading { position: fixed; inset: 0; z-index: 15; display: grid; place-items: center; background: var(--page); color: #777970; font-size: 13px; }
        .loading-inner { display: flex; align-items: center; gap: 10px; }
        .spinner { width: 15px; height: 15px; border: 2px solid #dfe1d9; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
        @keyframes spin { to { transform: rotate(360deg); } }
        .mobile-only { display: none; }
        @media (max-width: 720px) {
            .sidebar { width: 250px; flex-basis: 250px; }
            .topbar { padding: 0 18px; }
            .format-toolbar { justify-content: flex-start; gap: 2px; margin: 0 6px; }
            .format-button { min-width: 25px; padding: 0 5px; }
            .editor { width: calc(100% - 40px); padding-top: 42px; }
            .save-state { display: none; }
        }
        @media (max-width: 560px) {
            .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-100%); box-shadow: var(--shadow); transition: transform .2s ease; }
            .mobile-only { display: inline-grid; }
            .sidebar.mobile-open { transform: translateX(0); }
            .mobile-shade { display: none; position: fixed; inset: 0; z-index: 3; background: rgba(34,36,30,.25); }
            .mobile-shade.visible { display: block; }
            .topbar { height: 54px; flex-basis: 54px; padding: 0 13px; }
            .top-actions { gap: 5px; }
            .top-action { width: 31px; justify-content: center; padding: 0; }
            .top-action span { display: none; }
            .breadcrumbs { gap: 5px; }
            .format-toolbar { margin: 0 3px; }
            .format-button.list-format { min-width: 24px; padding: 0 4px; font-size: 0; }
            .format-button[data-format="ul"]::after { content: "-"; font-size: 14px; }
            .format-button[data-format="ol"]::after { content: "1."; font-size: 10px; }
            .trash-view { width: calc(100% - 40px); padding-top: 40px; }
            .settings-view { width: calc(100% - 40px); padding-top: 36px; }
            .settings-card { padding: 16px; }
            .trash-item { align-items: flex-start; flex-direction: column; gap: 11px; }
            .trash-item-actions { align-self: flex-end; }
        }
    