/* Central theme tokens are opt-in; the unmodified active theme remains the default. */
html[data-eonil-color-mode="light"] { color-scheme: light; --eonil-page: #f5f3ec; --eonil-surface: #fffdf7; --eonil-text: #202b3a; --eonil-link: #254a80; --eonil-border: #66778b; --eonil-nav: #dce4ef; --eonil-toc: #e2eafa; }
html[data-eonil-color-mode="dark"] { color-scheme: dark; --eonil-page: #172137; --eonil-surface: #202d47; --eonil-text: #f3f2e8; --eonil-link: #eedb88; --eonil-border: #a3b3cc; --eonil-nav: #2c4168; --eonil-toc: #233b60; }
html[data-eonil-color-mode] body,
html[data-eonil-color-mode] body #main,
html[data-eonil-color-mode] body #page-wrapper,
html[data-eonil-color-mode] body #colophon { background: var(--eonil-page) !important; color: var(--eonil-text) !important; }
html[data-eonil-color-mode] body #masthead,
html[data-eonil-color-mode] body #masthead .hgroup,
html[data-eonil-color-mode] body .entry-content,
html[data-eonil-color-mode] body .widget { background-color: var(--eonil-page) !important; color: var(--eonil-text) !important; }
html[data-eonil-color-mode] body #masthead .hgroup .support-text { color: var(--eonil-text) !important; }
html[data-eonil-color-mode] body .main-navigation,
html[data-eonil-color-mode] body .main-navigation ul ul { background: var(--eonil-nav) !important; }
html[data-eonil-color-mode] body .main-navigation a,
html[data-eonil-color-mode] body a,
html[data-eonil-color-mode] body .entry-title,
html[data-eonil-color-mode] body .entry-content :is(h1,h2,h3,h4,h5,h6) { color: var(--eonil-link) !important; }
html[data-eonil-color-mode] body :is(p,li,td,th,label,blockquote,figcaption,.site-description,.site-info) { color: var(--eonil-text) !important; }
html[data-eonil-color-mode] body li::marker { color: var(--eonil-text) !important; }
html[data-eonil-color-mode] body :is(input,textarea,select,button),
html[data-eonil-color-mode] body .eonil-appearance { color: var(--eonil-text) !important; background: var(--eonil-surface) !important; border-color: var(--eonil-border) !important; text-shadow: none; box-shadow: none; }
html[data-eonil-color-mode] body :is(td,th,table,hr,blockquote) { border-color: var(--eonil-border) !important; }
html[data-eonil-color-mode] body .main-navigation a:hover,
html[data-eonil-color-mode] body .main-navigation a:focus-visible { background: var(--eonil-surface) !important; }
html[data-eonil-color-mode] body a:focus-visible,
html[data-eonil-color-mode] body :is(button,input,select,textarea):focus-visible { outline: 3px solid var(--eonil-link) !important; outline-offset: 3px; }
.eonil-appearance { display: flex; justify-content: flex-end; padding: .5rem 1rem; background: transparent; color: inherit; font: inherit; font-size: 14px; }
.eonil-appearance label { display: flex; align-items: center; gap: .65rem; font: inherit; color: var(--eonil-text, #f3f2e8); background: var(--eonil-page, #19233a); padding: .25em .4em .25em .65em; border-radius: .4em; }
.eonil-appearance select { min-height: 44px; padding: .3em .6em; background: var(--eonil-surface, #202d47); color: var(--eonil-text, #f3f2e8); border: 1px solid currentColor; border-radius: .3em; font: inherit; font-size: 14px; color-scheme: light; }
/* Native popup menus may use the operating system's light surface even when the closed control is dark. */
.eonil-appearance select option { color: #202b3a !important; background: #fffdf7 !important; }
.eonil-appearance-editor { display: inline-block; margin-block: 1rem; background: transparent; color: inherit; padding: 0; }
.eonil-editor-preview { min-height: 16rem; padding: 1rem; }
@media (max-width: 480px) { .eonil-appearance { padding: .5rem; } }

/* The active site's focus rules must not turn typed search text black on a dark surface. */
body :is(form[role="search"], form.searchform) :is(input[type="search"], input[name="s"], button, input[type="submit"]) {
    min-height: 44px; border: 1px solid var(--eonil-border, #a3b3cc) !important; border-radius: .4em; font: inherit; line-height: 1.25;
    color: var(--eonil-text, #f3f2e8) !important; background: var(--eonil-surface, #202d47) !important; text-shadow: none !important; box-shadow: none !important;
}
body :is(form[role="search"], form.searchform) :is(input[type="search"], input[name="s"]) {
    min-width: 0; padding: .65rem .85rem; caret-color: var(--eonil-link, #eedb88); -webkit-text-fill-color: var(--eonil-text, #f3f2e8);
}
body :is(form[role="search"], form.searchform) input::placeholder { color: var(--eonil-text, #f3f2e8); opacity: .7; }
body :is(form[role="search"], form.searchform) :is(button, input[type="submit"]) { padding: .65rem 1.1rem; cursor: pointer; }
body :is(form[role="search"], form.searchform) :is(button, input):focus-visible { outline: 3px solid var(--eonil-link, #eedb88) !important; outline-offset: 3px; }
body :is(form[role="search"], form.searchform) :is(button, input[type="submit"]):hover { border-color: var(--eonil-link, #eedb88) !important; }
body :is(form[role="search"], form.searchform) input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none; width: 1em; height: 1em; margin-inline-start: .5em; cursor: pointer; background: var(--eonil-link, #eedb88);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 5 10 10m0-10L5 15' stroke='black' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
body .wp-block-search__inside-wrapper { gap: .65em; align-items: stretch; padding: 0; border: 0; }
body .wp-block-search__inside-wrapper .wp-block-search__button { margin: 0; }
body .wp-block-search__label { display: block; margin-bottom: .5em; font-weight: 600; }
/* Explicit suggestion colors also cover the unchanged default site theme. */
body .eonil-codex-search [data-codex-results] { color: var(--eonil-text, #f3f2e8); background: var(--eonil-surface, #202d47); }
body .eonil-codex-search [data-codex-results] a { color: var(--eonil-link, #eedb88) !important; }
body .eonil-codex-search [data-codex-results] a:is(:hover, :focus-visible) { background: var(--eonil-toc, #233b60); }
