/* Shared preferences UI and accessible dark surfaces for the public reading pages. */
html[data-site-preferences]{--pref-paper:#fffefa;--pref-ink:#17364a;--pref-muted:#526b7b;--pref-line:#d1dfda;--pref-soft:#eaf3ee;--pref-accent:#087b80;background:#f7f3eb}
html[data-site-preferences] body{padding-bottom:90px}
html[data-site-preferences][data-theme="dark"]{color-scheme:dark;background:#101e2b;--pref-paper:#192f3c;--pref-ink:#eef5ef;--pref-muted:#b6cbd3;--pref-line:#36515b;--pref-soft:#253e46;--pref-accent:#86d5c2;--bg:#101e2b;--paper:#192f3c;--white:#192f3c;--surface:#192f3c;--surface-soft:#203540;--ink:#eef5ef;--text:#eef5ef;--muted:#b6cbd3;--line:#36515b;--border:#36515b;--teal:#86d5c2;--green:#86d5c2;--soft:#203d3b}
html[data-site-preferences][data-theme="dark"] body{background:#101e2b;color:#eef5ef}
.gq-preferences-dock{position:fixed;z-index:100;bottom:max(16px,env(safe-area-inset-bottom));left:max(18px,env(safe-area-inset-left));display:flex;gap:5px;padding:6px;background:var(--pref-paper);color:var(--pref-ink);border:1px solid var(--pref-line);border-radius:17px;box-shadow:0 6px 25px #0e2b3219;direction:rtl}
.gq-pref-button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;min-width:42px;padding:9px;color:var(--pref-ink);background:transparent;border:0;border-radius:11px;cursor:pointer;font:inherit}
.gq-pref-button svg{display:block;width:23px;height:23px}
.gq-pref-button:hover,.gq-pref-button[aria-pressed="true"]{background:var(--pref-soft);color:var(--pref-accent)}
.gq-preferences-dock button:focus-visible,.gq-preferences-dialog :is(button,input):focus-visible{outline:3px solid var(--pref-accent);outline-offset:3px}
.gq-preferences-dialog{inset:0;width:min(510px,calc(100% - 28px));max-width:none;max-height:calc(100dvh - 32px);margin:auto;padding:0;overflow:auto;overscroll-behavior:contain;background:var(--pref-paper);color:var(--pref-ink);border:1px solid var(--pref-line);border-radius:25px;box-shadow:0 24px 85px #08172550;direction:rtl;font-family:'Thmanyah Sans',sans-serif;line-height:1.65;text-align:right}
.gq-preferences-dialog::backdrop{background:#071b29a3;backdrop-filter:blur(5px)}
.gq-pref-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:23px 25px;border-bottom:1px solid var(--pref-line)}
.gq-pref-heading p{font-size:14px;color:var(--pref-muted);margin:0 0 4px}
.gq-pref-heading h2{font-size:26px;line-height:1.5;color:var(--pref-ink);margin:0}
.gq-pref-content{padding:0 25px 24px}
.gq-pref-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:19px 0;border-bottom:1px solid var(--pref-line)}
.gq-pref-row h3{font-size:18px;color:var(--pref-ink);margin:0 0 3px;line-height:1.6}
.gq-pref-row p{font-size:14px;line-height:1.7;color:var(--pref-muted);margin:0}
.gq-pref-switch{display:flex;align-items:center;flex:0 0 50px;width:50px;height:30px;padding:4px;background:#849d9c;border:0;border-radius:30px;cursor:pointer;direction:ltr}
.gq-pref-switch span{width:22px;height:22px;border-radius:50%;background:white;box-shadow:0 1px 4px #0002;transition:transform .15s}
.gq-pref-switch[aria-checked="true"]{background:#087b80}
.gq-pref-switch[aria-checked="true"] span{transform:translateX(20px)}
.gq-pref-text-button{font:inherit;font-size:15px;font-weight:700;background:var(--pref-soft);color:var(--pref-accent);border:1px solid var(--pref-line);border-radius:11px;min-height:44px;min-width:79px;padding:8px 14px;cursor:pointer}
.gq-pref-tracks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:23px 0;padding:0;border:0;min-width:0}
.gq-pref-tracks legend{font-size:16px;font-weight:700;margin-bottom:12px;color:var(--pref-ink)}
.gq-pref-track{min-height:56px;padding:10px 8px;border:1px solid var(--pref-line);border-radius:12px;background:var(--pref-paper);color:var(--pref-ink);font:inherit;font-size:14px;cursor:pointer}
.gq-pref-track[aria-pressed="true"]{background:var(--pref-soft);border:2px solid var(--pref-accent);color:var(--pref-accent);font-weight:700}
.gq-pref-volume{display:block;margin-top:22px;color:var(--pref-ink);font-size:16px;font-weight:700}
.gq-pref-volume>span{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.gq-pref-volume output{font-size:15px;color:var(--pref-accent)}
.gq-pref-volume input{display:block;width:100%;height:34px;cursor:pointer;accent-color:#087b80}
.gq-pref-status{margin:15px 0 0!important;color:var(--pref-muted)!important;background:var(--pref-soft);border-radius:12px;padding:12px 15px;font-size:14px!important;line-height:1.8!important}
/* Override the secondary pages' previous hard-coded light palette. */
html[data-site-preferences][data-theme="dark"] :is(.navbar,.hero-facts,.donation-panel,.custom-amount-wrap,.level-step,.article-nav a){background:#192f3c;border-color:#36515b;color:#eef5ef}
html[data-site-preferences][data-theme="dark"] :is(.navbar-brand,.support-hero h1,.about-hero,.about-hero h1,.donation-intro h1,.donation-panel h2,.hero h1,.hero h2,.article-section strong,.article-section .lead-paragraph,.primary h3,.custom-amount-wrap input){color:#eef5ef}
html[data-site-preferences][data-theme="dark"] :is(.brand-caption,.navbar-links a,.about-hero p,.hero p,.hero-lead,.donation-intro>p,.article-section p,.article-nav p,.hero-fact span,.about-support p,.custom-amount-label,.donation-subtitle,.donation-limits,.donation-safe,.help-note,.primary p,.support-card.primary .note,.age-panel .age-range,.level-step span){color:#b6cbd3}
html[data-site-preferences][data-theme="dark"] :is(.navbar .logo,.navbar-brand .logo,.btn-outline,.art-label,.way-icon,.mode-no,.quick-links .quick-icon,.contact-card .icon,.provider-mark,.primary .provider-mark,.support-card .btn,.donation-currency,.amount-button,.fields-line span,.help-steps li::before){background:#253e46;color:#9adfcc;border-color:#365f59}
html[data-site-preferences][data-theme="dark"] :is(.hero-wrap,.hero,.support-card.primary,.about-support,.page-cta){background:radial-gradient(ellipse at 18% 45%,#1a423b,transparent 65%),#142a35;border-color:#36515b;color:#eef5ef}
html[data-site-preferences][data-theme="dark"] :is(.about-hero h1 span,.support-hero h1 span,.hero h1 em,.hero h2 em,.art-label strong,.navbar-links a:first-child,.about-article a,.inline-link,.article-nav a:hover,.help-note a,.level-step strong){color:#86d5c2}
html[data-site-preferences][data-theme="dark"] :is(.hero .eyebrow,.eyebrow){color:#efbd59}
html[data-site-preferences][data-theme="dark"] :is(.navbar-links a:hover,.navbar-links a.active,.article-nav a:hover,.quick-links a:hover,.social-link:hover){background:#253e46;color:#b0e4d5}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact,.age-panel,.impact-card,.feature-card){background:#203c36;border-color:#3b5d51}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact:nth-child(2),.age-panel:nth-child(2),.impact-card:nth-child(2),.feature-card:nth-child(3n+2)){background:#20384d;border-color:#3c526c}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact:nth-child(3),.age-panel:nth-child(3),.impact-card:nth-child(3),.feature-card:nth-child(3n)){background:#413a2b;border-color:#68583d}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact:nth-child(4),.age-panel:nth-child(4)){background:#3c2c40;border-color:#5f4962}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact strong,.impact-number,.stat-item .num){color:#94dac0}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact:nth-child(2) strong,.impact-card:nth-child(2) .impact-number,.stat-item:nth-child(2) .num){color:#a4c8f4}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact:nth-child(3) strong,.impact-card:nth-child(3) .impact-number,.stat-item:nth-child(3) .num){color:#f2d295}
html[data-site-preferences][data-theme="dark"] :is(.hero-fact:nth-child(4) strong,.stat-item:nth-child(4) .num){color:#e4b6d1}
html[data-site-preferences][data-theme="dark"] :is(.article-section,.mode-editorial,.about-contact,.footer,.hero-fact:nth-child(odd),.hero-fact:nth-child(-n+2)){border-color:#36515b}
html[data-site-preferences][data-theme="dark"] :is(.article-section .quote-note,.help-note,.play-callout,.correct-answer){background:#203d3b;border-color:#3f695b;color:#c4e5d7}
html[data-site-preferences][data-theme="dark"] .art-disc{background:radial-gradient(circle at 35% 30%,#32574e,#183c36);border-color:#46745e}
html[data-site-preferences][data-theme="dark"] .amount-button[aria-pressed="true"]{background:#0b777b;border-color:#94d5c2;color:#fff}
html[data-site-preferences][data-theme="dark"] .provider-meta span{background:#253e46;border-color:#467267;color:#c3e8d8}
html[data-site-preferences][data-theme="dark"] :is(.primary .btn,.about-support .btn){background:#087b80;color:#fff}
html[data-site-preferences][data-theme="dark"] :is(.page-end .btn,.btn-gold,.support-btn.primary){background:#efbd59;color:#17364a}
html[data-site-preferences][data-theme="dark"] .support-btn.secondary{background:#253e46;color:#eef5ef}
html[data-site-preferences][data-theme="dark"] .donation-error:not(:empty){background:#452d35;border-color:#82515b;color:#ffb3ba}
html[data-site-preferences][data-theme="dark"] .hero-illustration::before{background:#203d3b;border-color:#36584b}
html[data-site-preferences][data-theme="dark"] .book-shape{background:#196a58}
html[data-site-preferences][data-theme="dark"] .button:not(.button-gold){background:#176f61;border-color:#468b79;color:#fff}
html[data-site-preferences][data-theme="dark"] .answer-options li{background:#203c36;border-color:#3b5d51;color:#d5ecdf}
html[data-site-preferences][data-theme="dark"] .answer-options li:nth-child(2){background:#20384d;border-color:#3c526c;color:#d1e3f7}
html[data-site-preferences][data-theme="dark"] .answer-options li:nth-child(3){background:#413a2b;border-color:#68583d;color:#f5e3bd}
html[data-site-preferences][data-theme="dark"] .answer-options li:nth-child(4){background:#3c2c40;border-color:#5f4962;color:#ecd6e8}
html[data-site-preferences][data-theme="dark"] .correct-answer>span{color:#bbd8c7}
html[data-site-preferences][data-theme="dark"] .correct-answer>strong{color:#a5e3bc}
@media(max-width:600px){.gq-preferences-dock{left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));padding:5px;gap:3px}.gq-pref-button{width:42px;height:42px;flex-basis:42px}.gq-pref-heading{padding:19px 20px}.gq-pref-content{padding:0 20px 20px}.gq-pref-heading h2{font-size:24px}.gq-pref-track{font-size:13px}.gq-pref-row{gap:12px}.gq-pref-row p{font-size:13px}}
@media(prefers-reduced-motion:reduce){.gq-pref-switch span{transition:none}}
@media print{.gq-preferences-dock,.gq-preferences-dialog{display:none!important}html[data-site-preferences] body{padding-bottom:0;background:white;color:#111}}
