
:root[data-night] {color-scheme:dark;--paper:#1c1e20;--ink:#dedbd3;--muted:#b0afa7;--line:#3d4141;--accent:#c8b786;--button-bg:#292d2d;--button-border:#505449;--button-ink:#d6c89e;--button-hover-bg:#383d37;--button-hover-border:#8c896e;--button-hover-ink:#eee1b6;}
:root[data-night] body {background:var(--paper);color:var(--ink);--person-heading-bg:#292e2b;--person-quote-bg:#25292a;--person-note-bg:#262b29;}
:root[data-night] :is(.catalogue-group>h2,.bible-group h3,.continuous-chapter h2,.scripture-source-note,.continuous-notes,.person-reading,.narrative-unit,.research-guide,.source-note,blockquote) {background:#25292a;color:var(--ink);border-color:var(--line);}
:root[data-night] :is(.entry-number,.verse-number) {color:#b9aa82;}
:root[data-night] .site-logo {filter:brightness(1.8) saturate(.55);}
:root[data-night] ::selection {background:#5a533d;color:#fff7df;}
:root nav {align-items:center;}
.night-toggle {display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;padding:10px;flex-shrink:0;border:1px solid var(--button-border);border-radius:50%;background:var(--button-bg);color:var(--button-ink);cursor:pointer;}
.night-toggle svg {width:22px;height:22px;}
.night-toggle:hover {background:var(--button-hover-bg);border-color:var(--button-hover-border);color:var(--button-hover-ink);}
.night-toggle:focus-visible {outline:2px solid var(--accent);outline-offset:4px;}
:root[data-night] body :is(.page,.site-shell) :is(a.transition-link,a.research-navigation,.home-blessing,.home-prayer p) {background:#282c2b;color:var(--ink);border-color:var(--line);}
:root[data-night] body :is(.page,.site-shell) :is(a.transition-link,a.research-navigation):hover {background:#383d37;color:var(--accent);}
:root[data-night] body {--essay-heading-bg:#292e2b;--essay-note-bg:#262b29;--essay-quote-bg:#25292a;}
:root[data-night] .scripture-quote {background:#25292a;color:var(--ink);}
/* Refined night preview: headings remain on the page; controls share a dark palette. */
:root[data-night] .chatgpt-logo {mix-blend-mode:screen;filter:grayscale(1) invert(1);}
:root[data-night] body.home-page .page :is(.research-title-link,.home-library a.read-action) {
 background:var(--button-bg);color:var(--ink);border-color:var(--button-border);
}
:root[data-night] body.home-page .page :is(.research-title-link,.home-library a.read-action):hover {
 background:var(--button-hover-bg);color:var(--button-hover-ink);border-color:var(--button-hover-border);
}
:root[data-night] body :is(.page,.site-shell) :is(.research-intro,.reader-heading,.source-note,.research-guide,.continuous-notes,.narrative-unit) {background:transparent;}
:root[data-night] .literature-page :is(.catalogue-contents a,.catalogue-group-heading) {background:#292e2b;color:var(--ink);border-color:var(--line);}
:root[data-night] .literature-page .catalogue-contents a:hover,
:root[data-night] .verse-jump button:hover,
:root[data-night] .related-persons a:hover {background:var(--button-hover-bg);color:var(--button-hover-ink);}
:root[data-night] .related-persons a {background:var(--button-bg);color:var(--button-ink);}
:root[data-night] .verse-jump :is(select,input) {color:var(--ink);background:var(--paper);}

:root[data-night] {--panel:#292e2b;--text:#dedbd3;}
:root[data-night] body :is(.people-contents a,.prophet-books,.interpretation-note,.toc-expanded,.study-table thead th,.genesis-chapter h2) {background:#292e2b;color:var(--ink);border-color:var(--line);}
:root[data-night] body .study-toc a:hover {background:var(--button-hover-bg);}
:root[data-night] .book-page :is(.eyebrow,.edition,.caption),:root[data-night] .xml-position {color:var(--muted);}
:root[data-night] .book-page blockquote {background:#25292a;border-color:var(--accent);}
:root[data-night] .xml-position button {border-color:var(--line);}
:root[data-night] body button:not(.night-toggle) {background:var(--button-bg);color:var(--button-ink);border-color:var(--button-border);}
:root[data-night] body button:not(.night-toggle):hover {background:var(--button-hover-bg);}
.night-toggle {font:inherit;}
@media print {
 :root[data-night] {color-scheme:light;--paper:#fff;--ink:#222;--muted:#555;--accent:#444;--line:#ccc;--panel:#fff;}
 :root[data-night] body {background:#fff;color:#222;}
 :root[data-night] body * {background-color:transparent!important;color:inherit!important;}
 .night-toggle {display:none;}
}

:root[data-night] body header nav a.research-navigation {background:var(--button-bg);color:var(--button-ink);border-color:var(--button-border);}
:root[data-night] body header nav a.research-navigation:hover {background:var(--button-hover-bg);color:var(--button-hover-ink);}
:root[data-night] .reader-library .read-action {background:var(--button-bg);color:var(--button-ink);}

/* Header controls share the standard button palette in the night theme. */
:root[data-night] body header nav a.transition-link.research-navigation{background:var(--button-bg);color:var(--button-ink);border-color:var(--button-border);}
:root[data-night] body header nav a.transition-link.research-navigation:hover{background:var(--button-hover-bg);color:var(--button-hover-ink);border-color:var(--button-hover-border);}

/* Sources in person cards sit directly on the page in both themes. */
:root[data-night] body .person-section.person-reading {background:transparent;}
