/* V15 shared colour contract. Explicit user choice only; no automatic OS-theme override.
   Theme colours never override all p/h*/
:root{
 color-scheme:light;
 --eq-theme-bg:#f8faf7;--eq-theme-surface:#fff;--eq-theme-surface-2:#f1f5f0;
 --eq-theme-text:#1d332c;--eq-theme-muted:#607169;--eq-theme-border:#d9e2da;
 --eq-theme-accent:#8a6a2c;--eq-theme-link:#2f6e39;--eq-theme-danger:#a42e28;
 --eq-theme-input:#fff;--eq-theme-shadow:0 8px 24px rgba(23,63,53,.06);
 --eq-legacy-heading:#3f553d;--eq-legacy-on-green:#e4f3df;
 --eq-legacy-green:#365833;--eq-legacy-soft:#83a67f;--eq-legacy-mid:#466b49;
 --eq-legacy-deep:#1f2e1e;--eq-legacy-hover:#3f7047;--eq-legacy-stripe:#e5ebe2;
 --eq-legacy-border:#a9b8a8;--eq-on-soft:#183126;
}
html[data-theme="dark"]{
 color-scheme:dark;
 --eq-theme-bg:#0b1714;--eq-theme-surface:#10231e;--eq-theme-surface-2:#152d26;
 --eq-theme-text:#e8f0eb;--eq-theme-muted:#aabbb2;--eq-theme-border:#314b41;
 --eq-theme-accent:#d6b86f;--eq-theme-link:#b8d8aa;--eq-theme-danger:#ffaaa0;
 --eq-theme-input:#112821;--eq-theme-shadow:0 10px 30px rgba(0,0,0,.22);
 --eq-legacy-heading:#c1dec7;--eq-legacy-on-green:#e4f3df;
 --eq-legacy-green:#234c3e;--eq-legacy-soft:#244d3e;--eq-legacy-mid:#315c47;
 --eq-legacy-deep:#18392e;--eq-legacy-hover:#356549;--eq-legacy-stripe:#1b342b;
 --eq-legacy-border:#456050;--eq-on-soft:#e8f0eb;
}
/* Legacy page canvas only. Shared header/footer and home own their palettes. */
:where(body:not(.eq-home)){
 background-color:var(--eq-theme-bg);color:var(--eq-theme-text);
 background-image:linear-gradient(45deg,rgba(128,99,38,.018) 25%,transparent 25%,transparent 75%,rgba(128,99,38,.018) 75%),linear-gradient(-45deg,rgba(23,76,58,.014) 25%,transparent 25%,transparent 75%,rgba(23,76,58,.014) 75%);
 background-size:64px 64px;background-position:0 0,32px 32px;
}
html[data-theme="dark"] :where(body:not(.eq-home)){
 background-image:linear-gradient(45deg,rgba(214,184,111,.018) 25%,transparent 25%,transparent 75%,rgba(214,184,111,.018) 75%),linear-gradient(-45deg,rgba(255,255,255,.012) 25%,transparent 25%,transparent 75%,rgba(255,255,255,.012) 75%);
}
/* Zero-specificity defaults permit each component to choose its own text colour. */
:where(body:not(.eq-home) #content) :where(a){color:var(--eq-theme-link)}
:where(body:not(.eq-home) #content) :where(input,select,textarea){background-color:var(--eq-theme-input);color:var(--eq-theme-text);border-color:var(--eq-theme-border);color-scheme:inherit}
:where(body:not(.eq-home) #content) :where(input,textarea)::placeholder{color:var(--eq-theme-muted);opacity:1}
:where(body:not(.eq-home) #content) :where(hr){border-color:var(--eq-theme-border)}
:where(body:not(.eq-home) #content) :where(button,input,select,textarea,a,summary):focus-visible{outline:3px solid var(--eq-theme-accent);outline-offset:3px}
:where(body:not(.eq-home) #content) :where(audio,video){max-width:100%;color-scheme:inherit}
:where(body:not(.eq-home) #content) ::selection{background:var(--eq-theme-accent);color:var(--eq-theme-surface)}
/* A hidden result must stay hidden even when its card uses display:flex/grid. */
:where(#header,#footer,#content,body.eq-home) [hidden]{display:none!important}

/* Preserve the explicitly scoped words-page bridge for its inline stylesheet. */
html[data-theme="dark"] .words-page{--ink:#e8f0eb!important;--muted:#aabbb2!important;--gold:#d6b86f!important;--line:#314b41!important;background:#0b1714!important;color:#e8f0eb!important}
html[data-theme="dark"] .words-page .words-breadcrumb{color:#aabbb2!important}
html[data-theme="dark"] .words-page .words-breadcrumb a{color:#d6b86f!important}
html[data-theme="dark"] .words-page .words-links{border-color:#314b41!important}
html[data-theme="dark"] .words-page .words-links a{color:#e8f0eb!important}
html[data-theme="dark"] .words-page .words-search-box{background:#10231e!important;border-color:#314b41!important;box-shadow:0 8px 30px #0002!important}
html[data-theme="dark"] .words-page .words-search{background:#112821!important;color:#e8f0eb!important;border-color:#3b5a4e!important}
html[data-theme="dark"] .words-page .words-search::placeholder{color:#8fa197!important}
html[data-theme="dark"] .words-page .words-clear{background:#172f28!important;color:#e8f0eb!important;border-color:#3b5a4e!important}
html[data-theme="dark"] .words-page .words-surah-link{background:#10231e!important;color:#e8f0eb!important;border-color:#314b41!important}
html[data-theme="dark"] .words-page .words-surah-link:hover{background:#173128!important;border-color:#587467!important}
html[data-theme="dark"] .words-page .words-surah-name{color:#e8f0eb!important}
html[data-theme="dark"] .words-page .words-surah-number{background:#172f28!important;color:#d6b86f!important;border-color:#3b5a4e!important}
html[data-theme="dark"] .words-page .words-no-results{background:#10231e!important;color:#aabbb2!important;border-color:#466257!important}
html[data-theme="dark"] .words-page .words-info{background:#142a24!important;border-color:#3c5148!important;border-inline-start-color:#d6b86f!important}
html[data-theme="dark"] .words-page .words-info :is(h2,p){color:#dce8e1!important}

/* Older layout names with literal white backgrounds, scoped to legacy content. */
html[data-theme="dark"] :where(body:not(.eq-home)) :is(#wrapper,.aside){background-color:var(--eq-theme-surface);background-image:none}
html[data-theme="dark"] :where(body:not(.eq-home)) :is(.ws h2,.ws16 h2,.row1 h3){color:var(--eq-theme-accent)}
