/* Shared by the app and static guides; native form controls follow the palette. */
:root{color-scheme:light}
:root[data-theme=dark]{color-scheme:dark;color:#dce5ef;background:#10161f;--green:#65d5a6;--border:#344252;--muted:#a0afc1;--surface:#1a2431;--dark-panel:#141d28;--dark-hover:#213043;--dark-add:#14392c;--dark-remove:#40252e;--dark-replace:#3c321c}
:root[data-theme=dark] body{background:#10161f;color:#dce5ef}
:root[data-theme=dark] :is(.editor-panel,.comparison-workspace,.change-item,.search,.change-search,.json-search-field,.node-actions,.repair-dialog,.snippet-dialog,.tool-card,.wish-icon,.button,.view-tabs button,.diff-filter-group button,.mobile-side-switch button){background:var(--dark-panel);color:#dce5ef;border-color:var(--border)}
:root[data-theme=dark] :is(input:not([type=checkbox]),textarea,select){background:var(--dark-panel);color:#dce5ef;border-color:var(--border)}
:root[data-theme=dark] :is(.input-lines,.line-number,.comparison-number,.comparison-pane-title,.change-sidebar,.result-tools,.tool-table th,.cron-guide>div,.tree-search-gap,.code-search-gap,.repair-preview-columns h3,.context-gap){background:var(--surface);color:#a0afc1;border-color:var(--border)}
:root[data-theme=dark] :is(.comparison-pane,.tree-toolbar,.panel-tools,.diff-editors .panel-tools,.parser-workspace .panel-tools,.tool-table td,.tool-table th,.timestamp-result dl>div,.repair-preview-columns>section){border-color:var(--border)}
:root[data-theme=dark] :is(.button:hover:not(:disabled),.tree-row:hover,.tree-row:hover .node-actions,.change-item:hover,.diff-filter-group button:hover,.favorite-button:hover){background:var(--dark-hover);color:#e4edf6}
:root[data-theme=dark] :is(.button.primary,.button.primary:hover){background:#228b65;border-color:#228b65;color:#fff}
:root[data-theme=dark] :is(.view-tabs button.active,.filter-tabs .active,.tool-tabs button[aria-pressed=true],.wish-filters button[aria-pressed=true],.mobile-side-switch button[aria-pressed=true],.clock-strip,.cron-badge,.match-jump,.wish-primary,.wish-status.shipped){background:var(--dark-add);color:var(--green);border-color:#2c6652}
:root[data-theme=dark] :is(.line-add,.change-label.add,.diff-filter-group button.add.is-active,.comparison-equal,.repair-feedback.repaired,.repair-added){background:var(--dark-add);color:#78dfac;border-color:#2c6652}
:root[data-theme=dark] :is(.line-remove,.change-label.remove,.diff-filter-group button.remove.is-active,.repair-removed,.tool-error,.editor-error){background:var(--dark-remove);color:#ffacb4;border-color:#814654}
:root[data-theme=dark] :is(.line-replace,.change-label.replace,.diff-filter-group button.replace.is-active,.repair-feedback,.repair-specials,.repair-preview-warning){background:var(--dark-replace);color:#f2d08a;border-color:#796339}
:root[data-theme=dark] .line-blank{background:repeating-linear-gradient(135deg,#18222e,#18222e 4px,#1b2938 4px,#1b2938 5px)}
:root[data-theme=dark] .line-selected{box-shadow:inset 3px 0 #8bbbea,inset 0 1px #537696,inset 0 -1px #537696}
:root[data-theme=dark] .change-item.is-selected{background:#1a2c40;border-color:#7b9fbe}
:root[data-theme=dark] :is(.token-key,.parser-workspace .token-key){color:#d5a3ed}
:root[data-theme=dark] :is(.token-string,.parser-workspace .token-string,.new-value,.add,.line-add .comparison-marker){color:#81dca4}
:root[data-theme=dark] :is(.token-number,.parser-workspace .token-number,.token-url,.parser-workspace .token-url){color:#7fcaff}
:root[data-theme=dark] :is(.token-literal,.parser-workspace .token-literal,.old-value,.remove,.line-remove .comparison-marker,.repair-before-key,.repair-problem,.repair-failure,.local-storage-error){color:#f7a5b2}
:root[data-theme=dark] :is(.replace,.line-replace .comparison-marker){color:#e8c879}
:root[data-theme=dark] :is(.change-path,.checkbox,.tool-controls label,.tool-content .tool-controls label,.expression-label,.tool-details summary,.empty-state h3,.parser-workspace .tree-punctuation,.parser-workspace .code-view,.tree-meta,.parser-workspace .editor-input textarea,.input-highlight){color:#bbc9da}
:root[data-theme=dark] :is(.hint,.toolbar-note,.preview-mode-note,.preview-footnote,.comparison-pane-title>span:last-child,.change-sidebar-footer>span,.change-ordinal,.tool-help,.tool-content .tool-help,.tool-card p,.cron-guide p,.tool-content .editor-status,.clock-strip span,.clock-strip small,footer,.privacy,.snippet-meta,.theme-control,.tool-tabs button,.preview-count,.empty-state p,nav a,.repair-dialog-footer>span){color:#a0afc1}
:root[data-theme=dark] :is(.repair-button,.repair-comparison pre,.toast,kbd,.tree-more,.json-search,.repair-specials select){background:var(--surface);color:#dce5ef;border-color:var(--border)}
:root[data-theme=dark] .parser-workspace .tree-toggle{background:var(--dark-panel);border-color:#f7a5b2;color:#f7a5b2}
:root[data-theme=dark] .parser-workspace .tree-row:hover{background:var(--dark-hover)}
:root[data-theme=dark] .parser-workspace .editor-input textarea{caret-color:#dce5ef}
:root[data-theme=dark] :is(.search-result-line,.regex-preview mark,.regex-preview .selected-match){background:#3b5031!important;color:#e4f6dc}
:root[data-theme=dark] .regex-preview{background:var(--dark-panel);color:#dce5ef}
:root[data-theme=dark] .diff-filter-group button.is-active{background:var(--dark-hover);border-color:#607690;color:#dce5ef}
:root[data-theme=dark] .comparison-equal span{color:#acd8bf}
:root[data-theme=dark] .search-case[aria-pressed=true]{background:var(--dark-add);color:var(--green)}
:root[data-theme=dark] .wish-notes li:before{background:var(--surface)}
:root[data-theme=dark] .favorite-button.saved svg{fill:#285f4b}
:root[data-theme=dark] .match-row pre{color:#d5a3ed}
:root[data-theme=dark] .snippet-item pre{background:var(--surface)}
/* Guides retain their static content while using the saved/system appearance. */
:root[data-theme=dark] :is(header,footer,td,th,.guide-list li){border-color:var(--border)}
:root[data-theme=dark] header>a:first-child{color:#dce5ef}
:root[data-theme=dark] a{color:var(--green)}
:root[data-theme=dark] :is(.brand,nav a){color:inherit}
:root[data-theme=dark] nav a.selected{color:var(--green)}
:root[data-theme=dark] :is(.table-wrap pre,main>section pre,main>pre,thead){background:var(--surface);border-color:var(--border)}
:root[data-theme=dark] :is(caption,.guide-list p){color:var(--muted)}
:root[data-theme=dark] .comparison-pane .comparison-code .comparison-line.line-blank{background:repeating-linear-gradient(135deg,#18222e,#18222e 4px,#1b2938 4px,#1b2938 5px)}
:root[data-theme=dark] nav.json-quick-nav a{color:var(--muted)}
:root[data-theme=dark] nav.json-quick-nav a.active,:root[data-theme=dark] nav.json-quick-nav a:hover{color:var(--green)}
