:root{font-family:Inter,system-ui,sans-serif;color-scheme:dark;background:#111214;color:#e6e7e9;--amber:#e8b669;--border:#2d3035;--muted:#9499a3}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a.primary{cursor:pointer;background:#25282d;color:#e6e7e9;border:1px solid var(--border);border-radius:8px;padding:9px 12px;text-decoration:none}button:hover{background:#343840}button:disabled{opacity:.5;cursor:default}.primary,button.primary{background:var(--amber);color:#18191b;border-color:var(--amber)}input,textarea,select{background:#16181c;color:inherit;border:1px solid var(--border);border-radius:8px;padding:10px;min-width:0}a{color:var(--amber)}#workspace{display:grid;grid-template-columns:225px 290px minmax(0,1fr);min-height:100dvh}aside,#library{border-right:1px solid var(--border);padding:20px 16px;min-width:0}aside{background:#181a1e;display:flex;flex-direction:column;gap:16px}.brand{display:flex;align-items:center;gap:7px;font-size:15px;color:inherit;text-decoration:none}.brand b{color:var(--amber)}#folders{flex:1;overflow-wrap:anywhere}#folders button{width:100%;border:0;background:transparent;text-align:left;padding:10px 8px;overflow-wrap:anywhere}#folders button.active{background:#302b23;color:var(--amber)}.aside-bottom{display:flex;flex-direction:column;gap:12px;font-size:13px}small{color:var(--muted)}header{display:flex;align-items:center;gap:10px}h1{font-size:19px;font-weight:600}#search{width:100%;margin:10px 0}.library-actions{display:flex;gap:7px;margin:8px 0 20px}#notes{display:flex;flex-direction:column;gap:8px}.note-card{padding:14px;text-align:left;display:flex;flex-direction:column;gap:7px;width:100%;overflow-wrap:anywhere;background:#1a1d22}.note-card.active{border-color:var(--amber)}.note-card small{font-size:12px}#document{padding:24px 32px;min-width:0;max-width:1200px;width:100%}#empty{margin:20vh auto;max-width:350px;color:var(--muted)}#empty h2{color:#ddd}.document-top{font-size:12px;justify-content:flex-end}#save-status{margin-right:auto;color:var(--muted)}#title{font-size:30px;font-weight:650;width:100%;border:0;background:transparent;padding:22px 0}.document-tools{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:18px;font-size:12px}.modes{display:flex}.modes button[aria-pressed=true]{background:#3b3022;color:var(--amber)}#markdown{width:100%;min-height:65vh;font:14px/1.7 Consolas,monospace;resize:vertical}#editor{min-height:65vh}.vditor{border-color:var(--border);--panel-background-color:#1a1c20;--textarea-background-color:#111214;--toolbar-background-color:#1d2025;--text-color:#e6e7e9;--border-color:#343840;--second-color:#aaa;--hover-background-color:#343840}.vditor-reset{font-size:16px!important;line-height:1.8!important;color:#e6e7e9}.vditor-toolbar{flex-wrap:wrap!important;border-color:var(--border)}.vditor-wysiwyg{padding:20px!important;background:#111214!important}.vditor-reset table{display:table!important;max-width:100%;overflow:auto}.vditor-reset td,.vditor-reset th{background:#1b1d22;border-color:#454850}.vditor-reset img{max-width:100%}#welcome{min-height:100dvh;display:grid;place-items:center;padding:20px}.welcome-card{max-width:520px;padding:48px;border:1px solid var(--border);border-radius:24px;background:#191b20}.welcome-card h1{font-size:30px}.welcome-card p{color:var(--muted);line-height:1.8;margin-bottom:30px}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);max-width:min(90vw,600px);background:#393025;color:#ffe2b4;padding:14px 20px;border-radius:12px;z-index:50;overflow-wrap:anywhere}dialog{background:#1d2025;color:inherit;border:1px solid #444;border-radius:18px;width:min(92vw,600px);max-height:85dvh}dialog::backdrop{background:#0009}dialog h2{font-size:20px}dialog input,dialog textarea,dialog select{width:100%;margin:8px 0 16px}dialog textarea{min-height:150px}dialog p{line-height:1.6;color:#b9bec7}.dialog-actions{display:flex;justify-content:flex-end;gap:10px}#dialog-body button{margin:5px}#conflict{border:1px solid var(--amber);padding:16px;border-radius:10px;margin-top:16px}#diagram-preview{overflow:auto}#diagram-preview svg{max-width:100%;height:auto}#menu,#back{display:none}[hidden]{display:none!important}@media(max-width:1100px){#workspace{grid-template-columns:190px 240px minmax(0,1fr)}#document{padding:20px}}@media(max-width:760px){#workspace{display:block}aside{display:none;position:fixed;inset:0 20% 0 0;z-index:30;border-right:1px solid #555;box-shadow:0 0 0 100vw #0008;overflow:auto}aside.open{display:flex}#library{border:0;padding:16px}#document{display:none;padding:16px}.document-open #library{display:none}.document-open #document{display:block}#menu,#back{display:block}#title{font-size:26px}#save-status{font-size:11px}#editor{min-height:65dvh}.vditor-toolbar{padding:5px!important}.vditor-wysiwyg{padding:12px!important}.welcome-card{padding:30px}#markdown{min-height:60dvh}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;animation:none!important}}
.embedded #workspace{grid-template-columns:240px minmax(0,1fr)}.embedded #document{padding:16px;max-width:none}.embedded .brand,.embedded .aside-bottom{display:none}.embedded #menu{display:block}.embedded aside{display:none;position:fixed;inset:0 20% 0 0;z-index:30;border-right:1px solid #555;box-shadow:0 0 0 100vw #0008;overflow:auto}.embedded aside.open{display:flex}.embedded #title{font-size:24px}.embedded #markdown{min-height:55dvh}.embedded .vditor-toolbar{position:sticky;top:0;z-index:2}@media(max-width:760px){.embedded #workspace{display:block}.embedded #document{padding:12px}.embedded .document-tools{gap:5px}.embedded .document-tools button{padding:8px}.embedded #title{font-size:22px}.embedded #editor{min-height:55dvh}}
.text-field{padding:12px;min-width:0;background:#171b20}.text-field .document-tools{flex-wrap:wrap;margin:0 0 10px}.text-field #markdown{width:100%;min-height:320px;box-sizing:border-box}.text-field .vditor{min-width:0}.text-field #editor{min-width:0}.text-field .vditor-toolbar{position:sticky;top:0}.text-field #status:empty{display:none}
.note-properties{display:flex;flex-wrap:wrap;gap:12px;margin-bottom:14px}.note-properties label{flex:1;min-width:140px}.note-properties input,.note-properties select{width:100%;box-sizing:border-box}
.tag-picker{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.tag-picker input:not([hidden]){flex:1;min-width:120px}.tag-picker>button{flex:none}.tag-suggestions,.tag-chips{display:flex;flex-wrap:wrap;gap:7px;width:100%}.tag-suggestions:empty,.tag-chips:empty{display:none}.tag-picker small:empty{display:none}.tag-picker button{font-size:13px}.text-field{height:100dvh;display:flex;flex-direction:column;overflow:hidden;padding:10px}.text-field .document-tools{flex:none;margin:0 0 8px;background:#171b20;z-index:4}.text-field #editor{flex:1;min-height:0!important;overflow:hidden}.text-field #markdown{flex:1;min-height:0!important;height:auto;resize:none;overflow:auto}.text-field .vditor{height:100%!important;min-height:0!important;display:flex;flex-direction:column}.text-field .vditor-toolbar{position:relative!important;top:auto!important;flex:none;z-index:3;background:#1d2025}.text-field .vditor-content{flex:1;min-height:0;overflow:hidden}.text-field .vditor-wysiwyg{height:100%;overflow:auto!important}.text-field .vditor-wysiwyg>.vditor-reset{min-height:100%}.text-field #diagram-preview{max-height:90px;flex:none;overflow:auto}.text-field #status{flex:none;margin:4px 0}.text-field [hidden]{display:none!important}.vditor-toolbar svg{width:14px;height:14px;fill:currentColor}.vditor-toolbar button{cursor:pointer}
.note-filter-row{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.note-filter-chip{font-size:13px;padding:9px 13px;border:1px solid #363e48;background:#1a2027;color:#cbd2dc}.note-filter-chip[aria-pressed=true]{background:#3a3021;border-color:#e5b263;color:#f6cc83}.note-card-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto;padding-top:16px;border-top:1px solid #333b45}.note-card-actions button{font-size:13px;padding:9px 12px}.note-markdown{line-height:1.75;overflow-wrap:anywhere}.note-markdown img{max-width:100%;height:auto}.note-markdown table{display:block;overflow:auto;border-collapse:collapse}.note-markdown td,.note-markdown th{border:1px solid #414854;padding:8px}.note-markdown pre{overflow:auto;background:#11161c;padding:14px;border-radius:10px}.note-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden;color:#c5ccd5;font-size:15px;max-height:10.5em}.note-excerpt>:first-child{margin-top:0}.note-excerpt h1,.note-excerpt h2,.note-excerpt h3{font-size:17px}.note-reader{width:min(92vw,860px);padding:28px}.note-reader h2{font-size:28px}.note-reader .note-card-actions{position:sticky;bottom:0;background:#1d2025;padding-bottom:8px}
#workspace{grid-template-columns:200px minmax(0,1fr)}#document{display:none}.editing-note #workspace{grid-template-columns:200px 300px minmax(0,1fr)}.editing-note #document{display:block}#library{padding:32px clamp(18px,4vw,64px);overflow:auto}#folder-title{font-size:30px}#notes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:28px}.note-card{border-radius:18px;padding:24px;gap:16px;background:linear-gradient(140deg,#252c35,#1b2129);border:1px solid #343e4b;cursor:pointer;min-height:250px}.note-card:hover,.note-card:focus-visible{border-color:#a88145;outline:none}.note-card strong{font-size:22px;line-height:1.35}.note-card small{color:#aab4c2}.editing-note #library{padding:18px}.editing-note #notes{grid-template-columns:1fr}.editing-note .note-card{padding:16px;min-height:0}.editing-note .note-card strong{font-size:17px}#back{display:block}.library-actions{margin-top:20px}#search{background:#1c232c;border-color:#3e4a5a;padding:14px}
@media(max-width:1100px){.editing-note #workspace{grid-template-columns:180px 230px minmax(0,1fr)}}@media(max-width:760px){#workspace,.editing-note #workspace{display:block}#notes{grid-template-columns:1fr;gap:14px}#library{padding:20px 16px}.editing-note #library{display:none}.note-card{padding:20px}.note-reader{padding:20px}.note-reader h2{font-size:24px}#folder-title{font-size:26px}}

.note-card .note-excerpt strong{font-size:inherit}.note-card>small:first-child::before{content:'';display:inline-block;width:8px;height:8px;margin-right:8px;border-radius:50%;background:#e7be55}.note-card>small[data-priority=high]::before{background:#eb737b}.note-card>small[data-priority=low]::before{background:#67c99c}

.editing-note #workspace{grid-template-columns:200px minmax(0,1fr)!important}.editing-note #library{display:none!important}.editing-note #document{display:block;max-width:1200px;width:100%;justify-self:center}.note-icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.icon-button{display:inline-flex;justify-content:center;align-items:center;width:44px;height:42px;padding:10px}#new-folder{width:44px}#folders button{display:flex;align-items:center;gap:9px}#folders button span{min-width:0;overflow-wrap:anywhere}.service-folder .note-icon{color:var(--amber)}.dragging{opacity:.5}.drop-target{outline:2px solid var(--amber);background:#3a3021!important}@media(max-width:760px){.editing-note #workspace{display:block!important}}

#sidebar{min-width:0;overflow-x:hidden}#folders{min-width:0;overflow-x:hidden}.folder-toolbar{display:flex;gap:8px;align-items:center}.folder-row{display:flex;min-width:0;max-width:100%;align-items:center}#folders .folder-row .folder-toggle{width:22px;min-width:22px;flex:none;padding:3px;background:transparent;border:0;font-size:20px;line-height:1;align-self:stretch;justify-content:center}.folder-toggle-empty{visibility:hidden}#folders .folder-row [data-folder-id]{flex:1;min-width:0;max-width:calc(100% - 22px);padding-right:8px;gap:6px;overflow:hidden}#folders .folder-row [data-folder-id] span{display:block;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal}.folder-row .note-icon{width:18px;height:18px}.drag-ghost{position:fixed;top:0;left:-10000px;width:220px;max-height:80px;padding:12px 16px;border:1px solid #bb904e;border-radius:12px;background:#252d37;color:#e6e7e9;box-shadow:0 8px 24px #0006;pointer-events:none;z-index:9999}.drag-ghost strong,.drag-ghost small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.drag-ghost strong{font-size:14px}.drag-ghost small{margin-top:5px;font-size:11px;color:#aeb8c5}

#trash{width:44px;height:44px;flex:none;align-self:flex-start}#folders .folder-row .folder-toggle{display:flex;align-items:center;justify-content:center;width:24px;min-width:24px;height:36px;align-self:center;padding:3px}#folders .folder-toggle:disabled{opacity:1;cursor:default}#folders .folder-row [data-folder-id]{max-width:calc(100% - 24px)}#folders .folder-row[aria-selected=true] .folder-toggle{color:var(--amber)}

#sidebar{position:sticky;top:0;height:100dvh}#folders{min-height:0;overflow-y:auto;flex:1}#folders .folder-row{flex:none}@media(max-width:760px){#sidebar{position:fixed}}

/* Archive navigation and wider folder explorer. */
#workspace{grid-template-columns:240px minmax(0,1fr)}.editing-note #workspace{grid-template-columns:240px minmax(0,1fr)!important}.sidebar-sections{display:flex;justify-content:center;align-items:center;gap:12px;flex-shrink:0;width:100%}.sidebar-sections button{width:44px;height:44px;margin:0}.sidebar-sections button[aria-pressed=true]{border-color:#d7a64e;background:#352d1f}@media(max-width:760px){#sidebar{width:240px}}
.folder-row .service-folder-lock{width:13px;height:13px;flex:none;color:var(--amber);opacity:.8}
#folders .tree-note-row [data-tree-note-id]{display:flex;flex:1;min-width:0;gap:8px;align-items:center;padding:8px;background:transparent;text-align:left}#folders .tree-note-row [data-tree-note-id] span{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#folders .tree-note-row .note-icon{flex:none;width:16px;height:16px;color:#9499a3}#folders .tree-note-menu{flex:none;width:28px;padding:4px;background:transparent}#folders .tree-note-row{min-height:36px}
@media(min-width:761px){#workspace,.editing-note #workspace{grid-template-columns:var(--sidebar-width,240px) minmax(0,1fr)!important}.sidebar-resize{position:absolute;right:0;top:0;bottom:0;width:7px;cursor:col-resize;touch-action:none;z-index:5}.sidebar-resize:hover,.sidebar-resize:focus-visible,.resizing-sidebar .sidebar-resize{background:#e8b66955;outline:none}.resizing-sidebar,.resizing-sidebar *{cursor:col-resize!important;user-select:none!important}}@media(max-width:760px){.sidebar-resize{display:none}}
