/* Shared Windows/macOS palette, readable guidance and manuscript typography. */
:root,body[data-theme="light"]{
 color-scheme:light;--paper:#fffefb;--base:#f6f4ee;--ink:#29342d;--muted:#586653;--line:#d8dfd1;
 --green:#315448;--green-soft:#e7eee2;--surface:#f7f9f2;--surface-raised:#fffefb;--surface-subtle:#edf1e7;
 --library:#eceee4;--writing-bg:#faf9f4;--hover:#e5ecdd;--active-line:#8ea67e;--secondary:#53684b;
 --button-bg:#315448;--button-hover:#25463a;--button-text:#fff;--notice:#edf3e7;--error-bg:#fbebe6;--error-text:#94452f;
}
:root{--writing-font:var(--sans);--writing-size:19px}
body[data-theme="dark"]{
 color-scheme:dark;--paper:#242c26;--base:#1b221e;--ink:#e2e8de;--muted:#b6c3af;--line:#43513f;
 --green:#b1d5b6;--green-soft:#304235;--surface:#28332b;--surface-raised:#2b372e;--surface-subtle:#2b382e;
 --library:#1e2821;--writing-bg:#1b231e;--hover:#374937;--active-line:#7e9e73;--secondary:#b8d1ad;
 --button-bg:#95c19e;--button-hover:#acd4b3;--button-text:#17291c;--notice:#2c3d2f;--error-bg:#472e28;--error-text:#ffbea5;
}
body{font-size:14px;background:var(--base);color:var(--ink)}
button:hover{background:var(--hover)}button:focus-visible{outline-color:var(--active-line)}
input,textarea,select{color:var(--ink);border-color:var(--line);background:var(--paper)}
input:focus,textarea:focus,select:focus{border-color:var(--active-line);box-shadow:0 0 0 2px color-mix(in srgb,var(--green) 15%,transparent)}
input::placeholder,textarea::placeholder,.block-editor::placeholder{color:var(--muted);opacity:.85}
.library{background:var(--library);border-color:var(--line)}.brand-mark{background:var(--surface);border-color:var(--line);color:var(--green)}
.writing{background:var(--writing-bg)}.toolbox{background:var(--surface);border-color:var(--line)}
.writing-top,.toolbox-heading,.paper-meta,.library-bottom,.search-wrap,.tabs,.source-actions,.saved-structures-head,.logos-section,.editor-footer{border-color:var(--line)}
.doc-item.active,.source-card,.writing-block,.saved-structure,.outline-item,dialog{background:var(--paper);border-color:var(--line)}
.doc-item.active{box-shadow:none}.doc-title{background:transparent;color:var(--ink)}
.writing-block.is-active,.outline-item.active{border-color:var(--active-line)}.outline-item.active{background:var(--green-soft)}
.block-header,.writing-block.collapsed .block-footer,.writing-overview,.source-reader-head,.source-reader-footer{background:var(--surface-subtle);border-color:var(--line)}
.block-footer{border-color:var(--line)}.block-title{background:transparent;color:var(--ink)}
.block-editor,#font-preview{font-family:var(--writing-font);font-size:var(--writing-size);line-height:1.95;letter-spacing:0}
.block-editor{background:transparent}.block-editor::placeholder{font-size:inherit}
.count-control select,.block-target,.source-preview,.export-choice,.tool-note,.add-block-bottom{background:var(--surface);border-color:var(--line)}
.tool-note{background:var(--notice)}.tool-note strong{color:var(--green)}.add-block-bottom:hover{background:var(--hover)}
.source-divider{background:var(--line)}.source-reader{background:var(--paper);border-color:var(--line)}
.source-reader-title,.source-reader .source-rich{color:var(--ink)}.source-reader-head,.source-reader-footer{color:var(--secondary)}
#source-reader-body{color:var(--ink)}#source-reader-citation{color:var(--muted);font-size:12px;border-color:var(--line)}
.source-reader-actions{background:var(--surface-subtle);border-color:var(--line)}
.source-card.is-reading{background:var(--green-soft);border-color:var(--active-line)}.source-card.is-reading [data-action=read]{color:var(--green)}
#total-count{color:var(--green)}
.source-divider:after{background:var(--active-line)}.source-divider:hover,.source-divider:focus-visible,.resizing-reference .source-divider{background:var(--hover)}
.source-rich a{color:var(--green)}.source-rich a:hover{color:var(--ink);background:var(--hover)}
.primary,.new-button{background:var(--button-bg);color:var(--button-text)}.primary:hover,.new-button:hover{background:var(--button-hover);color:var(--button-text)}
.secondary{background:var(--surface-raised);color:var(--green);border-color:var(--line)}.secondary:hover{background:var(--hover)}
.tabs span,#selection-tools button,.panel-symbol{background:var(--green-soft);color:var(--green)}

.quiet,.icon-button,.format-tools button,.block-controls button,.drag-handle,.outline-drag,.outline-controls button,.text-button,.source-actions button,.saved-structure button,.saved-structure>strong,.empty-blocks strong{color:var(--secondary)}
.tool-panel input.outline-title{color:var(--ink)}.tool-panel input.outline-title:hover,.tool-panel input.outline-title:focus{border-color:var(--active-line)}
.tool-panel input.outline-title:focus{background:var(--paper)}
.tabs button{color:var(--muted)}.tabs button[aria-selected=true]{color:var(--green);border-color:var(--green)}
.muted,.field-help,.count-help,.tool-note p,.panel-intro p,.library-bottom p,.version-note,.platform-badge{
 font-size:12.5px;line-height:1.8;color:var(--muted);
}
.status,.paper-meta,.editor-footer,.toolbox-heading,.section-label,.doc-item small,.doc-item .excerpt,.brand small,.eyebrow,.overview-label,.total-detail,.count-control label,.block-section-bar,.block-mode,.block-target-status,.target-label,.block-number,.outline-number,.outline-count,.outline-content small,.saved-structures-head span,.empty-structures,.saved-structure>p,.source-citation,.source-card blockquote,.source-reader-position,.checkbox-label,.optional,.export-choice small,.export-summary,.empty-blocks,.empty-sources{color:var(--muted)}
.source-card blockquote,.source-citation,.saved-structure>p,.empty-structures,.export-choice small{font-size:12px;line-height:1.8}
.source-card blockquote{font-size:13px;color:var(--ink)}
.block-mode,.block-target-status,.target-label,.outline-count,.doc-item small,.block-number,.outline-number{font-size:11px}
.paper-meta,.library-bottom button,.text-button,.structure-actions .text-button,.block-section-bar .text-button,.source-actions button,.saved-structure button,.tool-panel .field-help,.quiet,.count-control select{font-size:12px}
.library-bottom button{color:var(--secondary)}.block-count{color:var(--green)}.saved-structures-head h3{color:var(--secondary)}
.block-progress,.block-progress::-webkit-progress-bar{background:var(--line)}.block-progress::-webkit-progress-value{background:var(--active-line)}
.inline-result{background:var(--notice);color:var(--ink)}.inline-result.error,.warning{background:var(--error-bg);color:var(--error-text)}
.status.error{color:var(--error-text)}#confirm-message{color:var(--muted)}
dialog{max-height:90vh;overflow:auto;box-shadow:0 25px 100px #0004}dialog::backdrop{background:#10181075}
#toast{background:var(--button-bg);color:var(--button-text)}
.source-reader-close{color:var(--secondary)}.source-reader-close:hover{background:var(--hover)}
.top-actions{gap:2px}.quiet{padding:7px 7px;white-space:nowrap}#theme-toggle[aria-pressed=true]{background:var(--green-soft);color:var(--green)}
#appearance-dialog{width:570px}#appearance-dialog label{font-size:13px}
.font-picker-row{display:flex;align-items:stretch;gap:8px}.font-picker-row select{min-width:0;flex:1;width:0}
.font-picker-row button{flex:none;padding:9px 11px;font-size:12px}#font-search{margin-top:10px}
.font-size-row{display:flex;align-items:center;gap:12px;color:var(--muted)}
#font-size{flex:1;width:0;padding:0;accent-color:var(--green);box-shadow:none;border:0}
#font-size-number{width:72px;flex:none}
#font-preview{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:17px;margin-top:20px;max-height:190px;overflow:auto;color:var(--ink)}
@media(max-width:1150px){.writing-top{padding-left:12px;padding-right:12px;gap:5px}.quiet{padding:7px 5px}.status{font-size:10px}}
