/* Shared by prerendered public pages and the writing application. */
:root{color-scheme:light}
html[data-theme=dark]{color-scheme:dark;background:#14161b;color:#e6e7eb;--brand-blue:#e4eee8;--brand-blue-strong:#b9ddca;--brand-ink:#eceef4;--brand-pink:#b9ddca;--text-strong:#eceef4;--text-body:#d1d5df;--text-muted:#acb1c0;--surface-muted:#262a34;--surface-paper:#1c1f26;--border-soft:#343943;--border-strong:#515868;--selection-blue:#293e34;--selection-pink:#293e34}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:none;width:40px;height:40px;min-height:40px;padding:8px;border:0;border-radius:8px;background:transparent;color:inherit;cursor:pointer;touch-action:manipulation}
.theme-toggle .theme-sun{display:none}
html[data-theme=dark] .theme-toggle .theme-moon{display:none}
html[data-theme=dark] .theme-toggle .theme-sun{display:block}
.theme-toggle:focus-visible{outline:2px solid #527764;outline-offset:3px}
.theme-preference{display:flex;align-items:center;justify-content:space-between;gap:16px;font-size:13px}
.theme-preference select{min-height:40px;padding:8px 10px;border:1px solid var(--border-soft,#dcdce1);border-radius:7px;font:inherit;background:transparent;color:inherit}
.m-header-actions,.library-header-actions{display:flex;align-items:center;gap:12px}
.library-account-menu .theme-preference{padding:14px 0;border-top:1px solid var(--border-soft);margin-top:8px}
html[data-theme=dark] body{background:#14161b;color:var(--text-body)}
html[data-theme=dark] :is(button,select,input,textarea){color:var(--text-body);border-color:var(--border-soft)}
html[data-theme=dark] :is(input,textarea,select){background-color:#1c1f26}
html[data-theme=dark] button{background-color:#252a34}
html[data-theme=dark] :is(a,.settings-feedback a){color:#b9ddca}
html[data-theme=dark] :is(button,input,select,textarea):focus-visible{outline-color:#b9ddca}
html[data-theme=dark] ::selection{background:#3d6551;color:#fff}
html[data-theme=dark] .brand-wordmark{background:#f5f5f2;border-radius:4px}
html[data-theme=dark] :is(.icon,.theme-toggle){background:transparent;color:var(--text-muted)}
html[data-theme=dark] :is(.primary,.mic,.library-primary,.writing-intro-actions .primary){background:#e4eee8;border-color:#e4eee8;color:#19271f}
html[data-theme=dark] :is(.settings-dialog,.modal,.writing-intro,.library-menu,.library-dialog,.library-delete-dialog){background:#1c1f26;border-color:var(--border-soft);color:var(--text-body)}
html[data-theme=dark] :is(.settings-dialog,.writing-intro,.library-dialog,.library-delete-dialog)::backdrop{background:#0009}
html[data-theme=dark] :is(.settings-heading p,.settings-section h3,.setting-row small,.shortcut-setting,.shortcut-setting-row>b,.shortcut-picker+small,.settings-note,.service-status,.model-box p,.modal p,.modal .muted){color:var(--text-muted)}
html[data-theme=dark] :is(.settings-section,.pane-title,.split .source-pane){border-color:var(--border-soft)}
html[data-theme=dark] :is(kbd,.model-box){background:#262a34;color:var(--text-body);border-color:var(--border-soft)}
html[data-theme=dark] :is(.app.minimal-workspace,.minimal-workspace>header,.minimal-workspace .document,.minimal-workspace .document-toolbar){background:#1c1f26;color:var(--text-body);border-color:var(--border-soft)}
html[data-theme=dark] .minimal-workspace .article-surface{background:#14161b}
html[data-theme=dark] .minimal-workspace .prose.article-editor{background:#1c1f26;color:#d8dce5}
html[data-theme=dark] .minimal-workspace .prose :is(h1,h2,h3,h4,h5,h6){color:#eceef4}
html[data-theme=dark] .minimal-workspace .prose blockquote{color:#b3bacb;border-color:#66738e}
html[data-theme=dark] .minimal-workspace .prose :is(pre,th,:not(pre)>code){background:#292e39;color:#e0e5ef}
html[data-theme=dark] .minimal-workspace .prose :is(td,th,hr){border-color:#454c5a}
html[data-theme=dark] .minimal-workspace .prose a{color:#b9ddca}
html[data-theme=dark] .minimal-workspace :is(.source-pane,.source-pane textarea){background:#1c1f26;color:#d8dce5}
html[data-theme=dark] .minimal-workspace :is(.agent-text-target,.prose .selected){background:#293e34!important;box-shadow:none}
html[data-theme=dark] .minimal-workspace .agent-proposed-target{background:#293e34}
html[data-theme=dark] .minimal-workspace .writing-dock .voice{background:#222630f5;border-color:#454c5a;box-shadow:0 4px 24px #0003}
html[data-theme=dark] .minimal-workspace :is(.dock-tools,.dock-agent,.dock-mode,.view-select){background:transparent;color:#b4bdcf}
html[data-theme=dark] .minimal-workspace .dock-agent.active{background:#293e34;color:#b9ddca}
html[data-theme=dark] .minimal-workspace .mic{background:#e4eee8;border-color:#e4eee8;color:#19271f}
html[data-theme=dark] .minimal-workspace .mic.recording{background:#a6424e;border-color:#a6424e}
html[data-theme=dark] :is(.minimal-workspace .floating-agent,.writing-feedback,.writing-popover,.selection-actions,.source-review){background:#222630;color:#d8dce5;border-color:#454c5a;box-shadow:0 12px 40px #0004}
html[data-theme=dark] :is(.floating-agent-heading,.agent-response,.inline-command textarea,.writing-feedback){color:#d1d5df}
html[data-theme=dark] .inline-command textarea{background:transparent}
html[data-theme=dark] .agent-scope{background:#293e34;color:#c2d8cc;border-color:#719b83}
html[data-theme=dark] :is(.agent-history,.agent-scope,.slash-footnote,.slash-options small,.slash-category,.inline-review-heading,.inline-review-explanation){color:#acb5c8}
html[data-theme=dark] :is(.slash-search,.slash-footnote,.inline-review-explanation){border-color:#454c5a}
html[data-theme=dark] :is(.slash-search input,.slash-options>button,.selection-actions button){background:transparent;color:#c7d1e6}
html[data-theme=dark] .slash-options>button[aria-selected=true]{background:#293e34;color:#b9ddca}
html[data-theme=dark] .inline-review{background:#242b27;border-color:#4d6457;color:#dce9e1}
html[data-theme=dark] .inline-review-original{color:#e0aeb0}
html[data-theme=dark] .inline-review-original>div{background:#432c34;color:#f1c1c5}
html[data-theme=dark] .inline-review-result{border-color:#83b89a}
html[data-theme=dark] .inline-review-actions button:not(.primary){background:transparent;color:#b6bfd1}
html[data-theme=dark] .editor-format-bar :is(button,.format-chevron){color:#b0b8c8;background:transparent}
html[data-theme=dark] .editor-format-bar .format-group{border-color:#343943}
html[data-theme=dark] .editor-format-bar .format-menu{background:#222630;border-color:#454c5a}
html[data-theme=dark] .editor-format-bar :is(button[aria-pressed=true],button[data-active=true],button[aria-expanded=true],button[aria-checked=true]){background:#293e34;color:#b9ddca}
html[data-theme=dark] .library-avatar{color:#241c26}
html[data-theme=dark] .library-menu :is(button,a){color:var(--text-body);background:transparent}
html[data-theme=dark] :is(.library-empty,.library-quota,.message.user){background:#262d3b}
html[data-theme=dark] :is(.library-row,.library-tools,.library-menu,.library-dialog input){border-color:var(--border-soft)}
html[data-theme=dark] .writing-intro-copy h2{color:var(--text-strong)}
html[data-theme=dark] .writing-intro-progress li[aria-current=step]{color:#b9ddca}
html[data-theme=dark] .writing-intro-actions .intro-skip{color:var(--text-muted);background:transparent}
html[data-theme=dark] .marketing{--m-ink:#eceef4;--m-paper:#14161b;--m-muted:#b1b7c6;--m-line:#343943;--m-blue:#b9ddca;--m-pink:#b9ddca;background:var(--m-paper);color:var(--m-ink)}
html[data-theme=dark] .marketing :is(.m-brand,.m-header nav a,.m-footer a,.m-post-list h3 a){color:var(--m-ink)}
html[data-theme=dark] .marketing :is(.m-button,.m-nav-start){background:#e4eee8;border-color:#e4eee8;color:#19271f}
html[data-theme=dark] .marketing :is(.m-demo,.m-toc,.m-writing-example,.m-plan,.m-plan-personal,.m-product-capture>a,.m-contact-form input,.m-contact-form textarea,.m-contact-form select,.m-button-outline){background:#222630;color:var(--m-ink);border-color:var(--m-line)}
html[data-theme=dark] .marketing :is(.m-closing,.m-demo-command){background:#322533}
html[data-theme=dark] .marketing :is(.m-demo-result,.m-plan-badge,.m-comparison thead){background:#293e34;color:#b9ddca}
html[data-theme=dark] .marketing .m-error{background:#432c34;color:#f1c1c5}
html[data-theme=dark] .marketing .theme-toggle{color:var(--m-ink);background:transparent}
html[data-theme=dark] .ga-consent{background:#242b27;color:#d8dce5;border-color:#454c5a}
html[data-theme=dark] .ga-consent :is(strong,p){color:#d8dce5}
html[data-theme=dark] .ga-consent button{background:#222630;color:#b9ddca;border-color:#719b83}
html[data-theme=dark] .ga-consent button:last-child{background:#e4eee8;color:#19271f}
html[data-theme=dark] :is(.history-dialog,.admin-metric,.admin-panel){background:#1c1f26;color:var(--text-body);border-color:var(--border-soft)}
html[data-theme=dark] :is(.revision-title,.revision-diff){color:var(--text-body)}
html[data-theme=dark] .revision-diff>ins{background:#203b32;color:#b3dfc0;border-color:#83b89a}
html[data-theme=dark] .revision-diff>del{background:#432c34;color:#f1c1c5;border-color:#cd939a}
html[data-theme=dark] :is(.history-error,.document-save-error){background:#3d3327;color:#ebcda4}
html[data-theme=dark] .admin-range{background:#262a34}
html[data-theme=dark] .admin-range button[aria-pressed=true]{background:#293e34;color:#b9ddca}
html[data-theme=dark] .library-open{background:transparent}
html[data-theme=dark] .cloud-primary{background:#e4eee8;color:#19271f;border-color:#e4eee8}
html[data-theme=dark] .library-dialog input{background:#262a34}
html[data-theme=dark] .library-menu .library-delete-action{color:#f1a7ac}
html[data-theme=dark] .marketing :is(.m-comparison caption,.m-skip,.m-billing-actions button,.m-billing-actions a){background:#222630;color:var(--m-ink)}
html[data-theme=dark] .marketing .m-form-status.success{background:#293e34;color:#b9ddca}
html[data-theme=dark] .marketing :is(.m-form-status.error,.m-pricing-status.is-error){color:#f1a7ac}
@media(hover:hover){
 .theme-toggle:hover{background:#9399a51a}
 html[data-theme=dark] button:hover:not(:disabled){background-color:#343c37;color:#edf1f9}
 html[data-theme=dark] :is(.primary,.mic,.library-primary):hover:not(:disabled){background:#c5ddcf;color:#19271f}
 html[data-theme=dark] .editor-format-bar button:hover:not(:disabled){background:#343c37;color:#edf1f9}
}
@media(max-width:760px){
 .theme-toggle{width:44px;height:44px}
 .m-header .m-header-actions{grid-column:2;grid-row:1;gap:6px}
 .m-header .m-header-actions .m-nav-start{min-height:44px;font-size:12px;padding:10px 12px;gap:5px}
 .library-header-actions{gap:6px}
}
