/* Shared appearance control. Native selection supports touch, keyboard and RTL. */
:root { color-scheme:light; }
.site-header .brand-logo-dark { display:none; }
header.site-header { grid-template-columns:88px minmax(0,1fr) auto; }
.site-header .header-tools { gap:10px; }
.theme-toggle { display:grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:10px; border:0; border-radius:50%; background:transparent; color:#886429; cursor:pointer; }
.theme-toggle:focus-visible { outline:2px solid #0f3d2e; outline-offset:3px; }
.theme-icon { display:block; width:24px; height:24px; overflow:visible; }
.theme-disc { transform-origin:12px 12px; transition:r .35s ease; }
.theme-shadow { transition:transform .35s ease; }
.theme-rays { transform-origin:12px 12px; transition:transform .35s ease,opacity .2s ease; }
html[data-theme="dark"] .theme-disc { r:9; }
html[data-theme="dark"] .theme-shadow { transform:translate(-7px,7px); }
html[data-theme="dark"] .theme-rays { transform:rotate(45deg) scale(.5); opacity:0; }
@media(prefers-reduced-motion:reduce) { .theme-disc,.theme-shadow,.theme-rays { transition:none; } }
@media(max-width:850px) {
 header.site-header { grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"brand tools" "navigation navigation"; }
 .site-header .primary-navigation { width:100%; }
}
/* Screen-only palette leaves printed biographies on paper-white backgrounds. */
@media screen {
 html[data-theme="dark"] {
  color-scheme:dark;
  --cream:#101f1b; --navy:#eee9dc; --teal:#96d5c0; --green:#96d5c0; --forest:#eee9dc;
  --muted:#b7c9c0; --border:#486155; --gold:#d9b974;
  --control-surface:#1b3028; --control-hover:#2b463a; --control-border:#8c7b53; --control-text:#eee9dc;
  --pagination-text:#eee9dc; --pagination-background:#1b3028; --pagination-hover:#2b463a;
  background:#101f1b;
 }
 html[data-theme="dark"] .catalogue-pagination { --pagination-text:#eee9dc; --pagination-background:#1b3028; --pagination-hover:#2b463a; }
 html[data-theme="dark"] .pagination-jump { color:#eee9dc; }
 html[data-theme="dark"] body { background:radial-gradient(ellipse at 45% 42%,#1a2b23,#101f1b 75%); color:var(--navy); }
 html[data-theme="dark"] .theme-toggle { color:#e7bd67; }
 html[data-theme="dark"] header.site-header { background:#14271f; border-bottom:1px solid #486155; }
 /* The dark asset owns its colour treatment, including after locale navigation. */
 html[data-theme="dark"] .site-header .brand-artwork { display:none; }
 html[data-theme="dark"] .site-header .brand-logo-dark { display:block; }
 html[data-theme="dark"] :is(.panel,.filters,.page-tabs,.reference-filters,.sources,.commitment,.about-values,.guiding,.guide-overview,.guide-milestones,.timeline-continuation,.contribution-panel,.era-note,.verse,.editorial-note,.profile-reading-row blockquote,#citation-example) { background:#182c24; border-color:#486155; }
 html[data-theme="dark"] body[data-page="profile"] #profile-section { background:#182c24; border-color:#486155; }
 html[data-theme="dark"] .ornate { background:#182c24; box-shadow:inset 0 0 0 4px #182c24,inset 0 0 0 5px #756747; }
 html[data-theme="dark"] :is(.language-menu,.select-menu,.pagination-menu,.profile-date-explanation) { background:#20372d; color:#eee9dc; border-color:#8c7b53; box-shadow:0 10px 28px #0006; }
 html[data-theme="dark"] :is(.site-header .language-trigger,.page-tabs button,.profile-tabs button,.outline-button,.era-periods>button,.era-results-row button,.era-navigation>button,.profile-section-control>button,.active-filter-summary .active-filter-chip,.active-filter-summary>span) { background:#1b3028; color:#eee9dc; border-color:#8c7b53; }
 html[data-theme="dark"] :is(.language-menu button:hover,.language-menu button:focus-visible,.select-option:hover,.select-option:focus-visible,.outline-button:hover,.site-header .primary-navigation a:hover,.site-header .language-trigger:hover,.catalogue-pagination .pagination-menu button:hover) { background:#2b463a; color:#fff4d9; }
 html[data-theme="dark"] :is(.selected,.profile-tabs button.selected,.profile-sidebar nav .selected,.language-menu button[aria-checked="true"],.select-option[aria-selected="true"],.catalogue-pagination .pagination-menu button[aria-current="page"],.site-header .primary-navigation a.active) { background:#315849!important; color:#fff4d9!important; }
 html[data-theme="dark"] :is(.site-header .primary-navigation a,.panel h2,.commitment h2,.source-card h2,.sources-method h2,.about-contact h2,.guide-overview h2,.guide-milestones>h2,.guide-featured>h2,.timeline-chapter-title,.history-timeline h4,.timeline-continuation h3,.profile-timeline b,.profile-date-explanation dt,.sources h2) { color:#eee9dc; }
 html[data-theme="dark"] :is(.intro p,.page-intro h2,.page-intro p,.panel p,.sources p,.source-panel p,.source-panel .subtitle,.resource-links small,.commitment p,.source-card>p,.sources-method p,.about-copy p,.about-values p,.about-mission p,.about-contact-intro p,.era-periods small,.era-content>#era-description,.profile-meta small,.profile-hero .profile-place,.profile-hero .profile-date-explanation p,.contribution-panel li,.madinah-photo figcaption,.section-attribution,.section-panel .profile-source-list small,.profile-facts dt,.profile-image-credits,.name-equivalent,.catalogue-count,.pagination-gap,.history-guide-main .period-guide-note,.timeline-note,.timeline-results p,.guide-featured .featured-intro,.timeline-next-preview,.share-profile-name,.share-link-field,.profile-print-toolbar>p) { color:#b7c9c0; }
 html[data-theme="dark"] :is(.site-header .language-trigger .icon,.site-header .language-chevron,.select-leading-icon,.select-trigger .control-chevron,.pagination-chevron,.eyebrow,.guide-period,.history-timeline .milestone-date,.timeline-next-label) { color:#d9b974; }
 html[data-theme="dark"] :is(.source>.icon,.source a,.source button,.source-panel-heading .icon,.resource-links .icon,.source-secondary>.panel>span,.commitment .icon,.commitment button,.book-actions button,.book-actions a,.about-values .icon,.guiding .icon,.guiding .eyebrow,.era-periods .icon,.era-note .icon,.era-title-row p,.profile-sidebar nav a,.profile-sidebar nav button,.back-link,.profile-meta .icon,.profile-meta blockquote,.profile-content h2 .icon,.profile-timeline .icon,.contribution-panel li>.icon,.section-panel a:not(.filled-button),.catalogue-source-note a,.guide-sources a,.active-filter-summary button,.timeline-reset,.milestone-sources,.milestone-sources a,.milestone-read-toggle,.milestone-actions .milestone-source-toggle,.timeline-previous,.share-status,.language-check,.verse small,.source-commitment h2>span,.profile-date-help>summary,.profile-entry-nav .back-link,.source-return) { color:#96d5c0; }
 html[data-theme="dark"] :is(.resource-links>a:hover,.source-link-list a:hover,.profile-source-heading>a:hover,.section-panel p a:hover,.milestone-source-list a:hover) { color:#c4f0df; background:#2b463a; }
 html[data-theme="dark"] :is(input,textarea,select option,#contact-form input:not([name="website"]),.about-contact textarea,.control-panel option) { background-color:#1b3028; color:#eee9dc; border-color:#718b7e; }
 html[data-theme="dark"] :is(input,textarea)::placeholder { color:#b7c9c0; opacity:1; }
 html[data-theme="dark"] :is(.search,.timeline-controls .timeline-search) { border-color:#718b7e; }
 html[data-theme="dark"] :is(.about-values article>span,.guiding section>span,.contribution-panel li>span,.collection-category-stats>div,.profile-source-heading .source-language) { background:#2b463a; }
 html[data-theme="dark"] .section-attribution .profile-source-heading .source-language { color:#b7c9c0; }
 html[data-theme="dark"] .filter-panel-footer button { background:#315849; color:#fff4d9; }
 html[data-theme="dark"] .card { --card-muted:#d4dfd6; --card-surface:#263e32; color:#eee9dc; }
 html[data-theme="dark"] .card:not(.dark):not(.green):not(.burgundy) { background:linear-gradient(120deg,#263d30ed,#172a22f5),url('assets/pattern.svg'); box-shadow:inset 0 0 0 4px #233a2e,inset 0 0 0 5px #b99b5e; }
 html[data-theme="dark"] .card :is(.badge,.card-life-panel,.card-facts dt,.card-life-note,.card-footer .citations,.card-footer .confidence) { color:#d4dfd6; }
 html[data-theme="dark"] .card .card-footer .person-link { color:#96d5c0; }
 html[data-theme="dark"] .card-flip-hint { background:#203c30; color:#d4dfd6; }
 html[data-theme="dark"] :is(.card-flip-hint .banner-info,.card-flip-hint strong,.card-tip-reopen,.card-tip-dismiss) { color:#96d5c0; }
 html[data-theme="dark"] .about-hero { background:#182c24; }
 html[data-theme="dark"] .about-hero:after { background:linear-gradient(90deg,#182c24 0,#182c24 34%,#182c24f5 39%,#182c2450 50%,transparent 60%); }
 html[data-theme="dark"][dir="rtl"] .about-hero:after { background:linear-gradient(270deg,#182c24 0,#182c24 34%,#182c24f5 39%,#182c2450 50%,transparent 60%); }
 html[data-theme="dark"] .about-hero blockquote { background:#182c24ed; color:#eee9dc; }
 html[data-theme="dark"] .about-hero blockquote small { color:#b7c9c0; }
 html[data-theme="dark"] :focus-visible { outline-color:#e7bd67; }
 @media(max-width:650px) {
  html[data-theme="dark"] .about-hero:after,html[data-theme="dark"][dir="rtl"] .about-hero:after { background:linear-gradient(#182c24,transparent 35%); }
 }
}
@media print { .theme-toggle { display:none; } }
