/* Application and desk colors are separate from paper pixels and document colors. */
:root{
  color-scheme:light;
  --theme-bg:#f5f4ef;--theme-panel:#fffefa;--theme-panel-soft:#f2f4ed;--theme-sidebar:#eceee6;
  --theme-ink:#2c342e;--theme-muted:#6c7867;--theme-muted-soft:#798473;--theme-line:#dce2d4;
  --theme-accent:#3d5946;--theme-accent-ink:#fff;--theme-active:#dce6d5;--theme-active-ink:#34502f;
  --theme-field:#fafbf6;--theme-hover:#e8ece2;--theme-floating:#fcfdf7ed;--theme-header:#f9faf5f2;
  --theme-danger-bg:#f9eae5;--theme-danger-ink:#ac4d39;--theme-scrim:#1c2a2466;
  --theme-sage:#e7ecdf;--theme-sand:#efe9df;--theme-blue:#e0e8eb;--theme-lavender:#e5e2e9;--theme-rose:#ede2dc;
  --theme-note-shadow:0 4px 22px #18281d0c;--theme-elevation:0 8px 30px #15211918;
  --theme-desk:#eaede6;--workspace-bg:var(--theme-desk);
  --bg:var(--theme-bg);--panel:var(--theme-panel);--ink:var(--theme-ink);--muted:var(--theme-muted);
  --line:var(--theme-line);--green:var(--theme-accent);--shadow:var(--theme-note-shadow);
}
:root[data-theme=dark]{
  color-scheme:dark;
  --theme-bg:#151a17;--theme-panel:#232b25;--theme-panel-soft:#29332c;--theme-sidebar:#1b211d;
  --theme-ink:#e5e9e2;--theme-muted:#b2bdad;--theme-muted-soft:#a1ae9c;--theme-line:#3b493e;
  --theme-accent:#aac59e;--theme-accent-ink:#172315;--theme-active:#3a4e36;--theme-active-ink:#d6e9ce;
  --theme-field:#1d251f;--theme-hover:#344130;--theme-floating:#263027f2;--theme-header:#1e271ff5;
  --theme-danger-bg:#492b28;--theme-danger-ink:#f3b3a2;--theme-scrim:#060b08b3;
  --theme-sage:#2c3c2f;--theme-sand:#3d382c;--theme-blue:#2b3a41;--theme-lavender:#383141;--theme-rose:#42322e;
  --theme-note-shadow:0 4px 22px #0004;--theme-elevation:0 8px 30px #0005;--theme-desk:#151917;
}
@media(prefers-color-scheme:dark){
  :root:not([data-theme]){
    color-scheme:dark;
    --theme-bg:#151a17;--theme-panel:#232b25;--theme-panel-soft:#29332c;--theme-sidebar:#1b211d;
    --theme-ink:#e5e9e2;--theme-muted:#b2bdad;--theme-muted-soft:#a1ae9c;--theme-line:#3b493e;
    --theme-accent:#aac59e;--theme-accent-ink:#172315;--theme-active:#3a4e36;--theme-active-ink:#d6e9ce;
    --theme-field:#1d251f;--theme-hover:#344130;--theme-floating:#263027f2;--theme-header:#1e271ff5;
    --theme-danger-bg:#492b28;--theme-danger-ink:#f3b3a2;--theme-scrim:#060b08b3;
    --theme-sage:#2c3c2f;--theme-sand:#3d382c;--theme-blue:#2b3a41;--theme-lavender:#383141;--theme-rose:#42322e;
    --theme-note-shadow:0 4px 22px #0004;--theme-elevation:0 8px 30px #0005;--theme-desk:#151917;
  }
}
body,.app-layout,.library-main,.auth-shell{background:var(--theme-bg);color:var(--theme-ink)}
.sidebar{background:var(--theme-sidebar);border-color:var(--theme-line)}
.workspace-label,.local-card,.view-toggle,.keyboard-hint,.card-tag,.account-user{border-color:var(--theme-line)}
.icon-btn,.nav-item,.folder-label,.local-card,.breadcrumb,.sort-select,.view-toggle button,.tool,.page-indicator,#zoom-label,.layer,.range-label,.color-label{color:var(--theme-muted)}
.icon-btn:hover,.icon-btn.active,.menu-list button:hover{background:var(--theme-hover);color:var(--theme-ink)}
.nav-item.active,.view-toggle button.active,.layer.active{background:var(--theme-active);color:var(--theme-active-ink)}
.nav-item .count{background:var(--theme-panel);color:var(--theme-active-ink)}
.btn.primary,.inline-text-format .text-done{background:var(--theme-accent);color:var(--theme-accent-ink)}
.btn.secondary{background:var(--theme-panel);border-color:var(--theme-line)}
.btn.soft{background:var(--theme-active);color:var(--theme-active-ink)}
.btn.danger{background:var(--theme-danger-bg);color:var(--theme-danger-ink)}
.menu-list .danger,.auth-error[role=alert],.save-status.error{color:var(--theme-danger-ink)}
.eyebrow,.brand small,.workspace-label small,.local-card small,.side-footer span,.keyboard-hint,.welcome-head p,.quick-card p,.quick-card.import p,.card-meta,.card-tag,.library-foot,.empty-state,.boot,.modal-body p,.modal-body label,.export-option small,.page-thumb>span,.save-status,.pen-preview span,.property-help,.range-label output,.link-button,.property-note,.auth-card p,.auth-foot,.editor-v2 .page-continuation{color:var(--theme-muted)}
.search-box,.field{background:var(--theme-field);border-color:var(--theme-line);color:var(--theme-ink)}
.field::placeholder,.search-box input::placeholder{color:var(--theme-muted-soft);opacity:1}
.quick-card,.note-cover,.note-cover.sage{background:var(--theme-sage);border-color:var(--theme-line)}
.quick-card.import,.note-cover.sand{background:var(--theme-sand);border-color:var(--theme-line)}
.note-cover.blue{background:var(--theme-blue)}.note-cover.lavender{background:var(--theme-lavender)}.note-cover.rose{background:var(--theme-rose)}
.quick-card .circle-button,.cover-type,.total,.badge{background:var(--theme-panel-soft);color:var(--theme-muted)}
.card-star{color:var(--theme-accent)}
.new-note-card{background:var(--theme-panel-soft);border-color:var(--theme-line);color:var(--theme-muted)}
.new-note-card .plus-ring{background:var(--theme-active)}
/* Thumbnails are document previews: preserve actual paper and ink colors. */
.note-paper,.page-thumb-paper{box-shadow:var(--theme-note-shadow)}
#toast{background:var(--theme-accent);color:var(--theme-accent-ink)}
#toast.error{background:var(--theme-danger-bg);color:var(--theme-danger-ink)}
dialog,.auth-card{background:var(--theme-panel);color:var(--theme-ink);border-color:var(--theme-line);box-shadow:var(--theme-elevation)}
dialog::backdrop{background:var(--theme-scrim)}
.auth-message{background:var(--theme-panel-soft)}
.auth-card .auth-error{color:var(--theme-danger-ink)}
.export-option:has(input:checked){background:var(--theme-active);border-color:var(--theme-accent)}
.editor.editor-v2,.editor-v2 .drawing-area,.editor-v2 .canvas-viewport{background:var(--workspace-bg)}
.editor-v2 .editor-header{background:var(--theme-header);border-color:var(--theme-line)}
.document-title .icon{color:var(--theme-muted)}
.editor-v2 .pages-panel,.editor-v2 .properties-panel{background:var(--theme-panel);color:var(--theme-ink);border-color:var(--theme-line);box-shadow:var(--theme-elevation)}
.add-page,.property-section{border-color:var(--theme-line)}.add-page{color:var(--theme-muted)}
.profile-options{background:var(--theme-panel-soft);border-color:var(--theme-line)}
.pen-preview{border-color:var(--theme-line)}.pen-preview span{color:#718266}
.profile-options button{color:var(--theme-muted)}
.profile-options button.active{background:var(--theme-active);color:var(--theme-active-ink)}
.switch{background:var(--theme-line)}.switch-row input:checked+.switch{background:var(--theme-accent)}
.editor-v2 .floating-toolbar,.editor-v2 .floating-palette,.editor-v2 .selection-bar,.inline-text-format{background:var(--theme-floating);border-color:var(--theme-line);color:var(--theme-ink);box-shadow:var(--theme-elevation)}
.editor-v2 .floating-toolbar .tool,.editor-v2 [data-toolbar-toggle],.editor-v2 [data-toolbar-handle],.editor-v2 .floating-palette label,.editor-v2 .input-mode-control{color:var(--theme-muted)}
.editor-v2 .floating-toolbar .tool.active,.editor-v2 .floating-toolbar.is-minimized [data-toolbar-toggle]{background:var(--theme-active);color:var(--theme-active-ink)}
.tool.active:after{background:var(--theme-accent)}
.editor-v2 .floating-toolbar .color-dot{border-color:var(--theme-panel)}
.tool-divider{background:var(--theme-line)}
.editor-v2 .canvas-footer>*{background:var(--theme-floating);border-color:var(--theme-line);color:var(--theme-muted);box-shadow:var(--theme-elevation)}
.editor-v2 .floating-palette input[type=color],.editor-v2 .input-mode-control select{background:var(--theme-field);border-color:var(--theme-line);color:var(--theme-ink)}
.editor-v2 .canvas-viewport{scrollbar-color:var(--theme-line) transparent}
.editor-v2 .paper-holder{outline-color:var(--theme-line);box-shadow:var(--theme-note-shadow)}
.inline-text-format button,.inline-text-format select,.inline-text-format input{background:var(--theme-panel-soft);color:var(--theme-ink)}
.inline-text-format button[aria-pressed=true]{background:var(--theme-active);color:var(--theme-active-ink);box-shadow:inset 0 0 0 1px var(--theme-accent)}
.inline-text-format .text-done{box-shadow:-4px 0 8px var(--theme-panel)}
.inline-text-move,.inline-text-resize{background:var(--theme-panel);color:var(--theme-ink);border-color:var(--theme-accent)}
/* Settings controls used by the app integration. */
.appearance-settings{display:grid;gap:16px;margin:20px 0}.appearance-settings label{display:grid;gap:7px}.appearance-settings .appearance-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.appearance-settings small{color:var(--theme-muted);font-size:12px;line-height:1.5}.appearance-settings input[type=color]{width:100%;height:40px;padding:3px;border:1px solid var(--theme-line);border-radius:8px;background:var(--theme-field)}
@media(max-width:440px){.appearance-settings .appearance-row{grid-template-columns:1fr}}
/* Full-page dock panels and paper swatches retain the same app theme. */
.editor-fullpage .floating-toolbar-content{background:var(--theme-floating);border-color:var(--theme-line);color:var(--theme-ink);box-shadow:var(--theme-elevation)}
.editor-fullpage .toolbar-triad>button+button{border-left-color:var(--theme-line)}
.editor-fullpage .toolbar-triad>button[aria-expanded=true]{background:var(--theme-active);color:var(--theme-active-ink)}
.paper-preset-card{color:var(--theme-muted)}.paper-preset-card.active{color:var(--theme-ink)}
.paper-preset-card.active>span{outline-color:var(--theme-accent)}
.editor-v2.editor-fullpage .paper-holder{outline:0;box-shadow:0 3px 5px #0000001a,0 1px 1px #00000015}
