/* OneWorld School of Thought — light/dark reading mode for chapter pages (school-chapter-4.html … school-chapter-20.html).
   assets/reader-theme.js sets html[data-theme="light|dark"] (device setting by default, or the reader's choice).
   The header, footer, chapter banner and the green/gold panels keep their colours; the reading surfaces turn dark. */
html[data-theme="light"]{color-scheme:light}

/* Theme switch in the reading tools */
.reader-tools .tools-sep{width:1px;height:28px;background:var(--line);margin:0 4px}
.reader-tools .theme-switch{display:inline-flex;gap:6px}
.reader-tools [data-theme-set]{padding:0 12px;font-weight:700;white-space:nowrap}
.reader-tools [data-theme-set][aria-pressed="true"]{background:var(--forest);border-color:var(--gold);color:var(--gold-2)}
@media(max-width:420px){.reader-tools .tools-sep{display:none}.reader-tools{row-gap:10px}}

html[data-theme="dark"]{color-scheme:dark;
  --cream:#0c211a;--cream-2:#10291f;--paper:#122b22;--ink:#e4dfd0;--muted:#a9b8ae;--line:#2c4b3d;--gold-deep:#d8b45e;
  --heading:#f1e5c4}
html[data-theme="dark"] .reader-top{color:#f7f1e3}

/* Headings and text that use the forest green on light pages */
html[data-theme="dark"] .reader-toc h2,
html[data-theme="dark"] .toc-list a,
html.js[data-theme="dark"] .toc-toggle,
html[data-theme="dark"] .reader-tools button,
html[data-theme="dark"] .reader-panel h2,
html[data-theme="dark"] .chapter-pager a,
html[data-theme="dark"] .section-nav a,
html[data-theme="dark"] .ms-section h3,
html[data-theme="dark"] .chapter-body h4,
html[data-theme="dark"] .ms-notes h3,
html[data-theme="dark"] .ms-table caption,
html[data-theme="dark"] .ms-table tbody th,
html[data-theme="dark"] .ms-refs td:first-child,
html[data-theme="dark"] .exercise .checklist .ct strong,
html[data-theme="dark"] .check-status,
html[data-theme="dark"] .epigraph,
html[data-theme="dark"] .chapter-body .big-questions li,
html[data-theme="dark"] .reflection label,
html[data-theme="dark"] .diagram .dia-lead,
html[data-theme="dark"] .coming-next .cn-title,
html[data-theme="dark"] .placeholder strong,
html[data-theme="dark"] .note strong,
html[data-theme="dark"] .scripture,
html[data-theme="dark"] .chapter-body .scripture-line{color:var(--heading)}
html[data-theme="dark"] .toc-list .toc-sections a{color:#d6dfd9}

/* Contents list and pager */
html[data-theme="dark"] .toc-list a[aria-current]{background:#1d4f3d;color:#f7f1e3}
html[data-theme="dark"] .chapter-pager a:hover{background:#183a2d}
html[data-theme="dark"] .section-nav li{border-top-color:#24443a}
html[data-theme="dark"] .reader-tools [data-theme-set][aria-pressed="true"]{background:#1d4f3d;color:var(--gold-2)}
html[data-theme="dark"] .pill.draft{background:#3a3016;color:#f0d68e;border-color:#8a6a22}
html[data-theme="dark"] .pill.soon{background:#1b3329;color:#c7d3cb;border-color:#35574a}

/* Tables */
html[data-theme="dark"] .ms-table thead th{background:#1d4f3d;color:#f7f1e3}
html[data-theme="dark"] .ms-table tbody th{background:#163327}
html[data-theme="dark"] .ms-table tbody tr:nth-child(even) td{background:#153026}
html[data-theme="dark"] .ms-table th,html[data-theme="dark"] .ms-table td{border-bottom-color:#24443a}
html[data-theme="dark"] .ms-pairs td:first-child{color:#eaa08c}
html[data-theme="dark"] .ms-pairs td:last-child{color:#8fd0a9}

/* Quotations, key lines and the closing motto */
html[data-theme="dark"] .scripture,html[data-theme="dark"] .chapter-body .scripture-line{background:linear-gradient(90deg,#c9a24a26,#c9a24a0a)}
html[data-theme="dark"] .key-line,html[data-theme="dark"] .principle{color:#f7f1e3;background:linear-gradient(140deg,#174535,#1d4f3d)}
html[data-theme="dark"] .draft-banner{background:#2a2616;color:#f0d68e;border-color:#8a6a22}

/* Seven-day checklist */
html[data-theme="dark"] .exercise{background:#1a2f22;border-color:#6d5a2a;border-top-color:var(--gold)}
html[data-theme="dark"] .exercise .checklist label{border-color:#3d5a46}
html[data-theme="dark"] .exercise .checklist label:hover{border-color:var(--gold)}
html[data-theme="dark"] .exercise .checklist li.is-done label{background:#173d2e;border-color:#2f6b52}
html[data-theme="dark"] .exercise .checklist li.is-done .day,html[data-theme="dark"] .check-status.is-complete{color:#8fd0a9}
html[data-theme="dark"] .check-meter{background:#2b3a2a}
html[data-theme="dark"] .check-count{border:1px solid #c9a24a88}
html[data-theme="dark"] .check-count.is-complete{background:#2f6b52}

/* Reflection answers */
html[data-theme="dark"] .reflection textarea{background:#0c211a;color:var(--ink);border-color:#3d5a46}
html[data-theme="dark"] .reflection textarea::placeholder{color:#8fa096}
html[data-theme="dark"] .reflect-copy{background:#1d4f3d;border:1px solid #c9a24a88}
html[data-theme="dark"] .reflect-copy:hover{background:#245c47}
html[data-theme="dark"] .reflect-status{color:#8fd0a9}
html[data-theme="dark"] .reflect-status.is-error{color:#f0907a}

/* Diagrams keep their own light boxes; only the frame darkens */
html[data-theme="dark"] .diagram{background:#0f261d}

@media print{html[data-theme="dark"]{--cream:#fff;--paper:#fff;--ink:#000;--muted:#333;--heading:#000;color-scheme:light}}

/* Chapter 5 tables (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-compare td:last-child{color:var(--heading)}
html[data-theme="dark"] .ms-contrast td:first-child{color:#8fd0a9}
html[data-theme="dark"] .ms-contrast td:last-child{color:#eaa08c}

/* Chapter 6 tables (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-dims td:last-child,html[data-theme="dark"] .ms-duty td:last-child{color:#8fd0a9}
html[data-theme="dark"] .ms-duty td:first-child{color:var(--heading)}

/* Chapter 8 tables (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-three td:first-child{color:#c9bfae}
html[data-theme="dark"] .ms-three td:nth-child(2){color:#8fd0a9}
html[data-theme="dark"] .ms-three td:last-child{color:#eaa08c}
html[data-theme="dark"] .tr-roots{border-top-color:#c9a24a88}

/* Chapter 9 tables and question cards (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-mindheart td:nth-of-type(1),html[data-theme="dark"] .ms-feelings td:last-child{color:#8fd0a9}
html[data-theme="dark"] .ms-mindheart td:nth-of-type(2){color:#e2c47e}
html[data-theme="dark"] .chapter-body .ask-list li{color:var(--heading)}
html[data-theme="dark"] .chapter-body .ask-list li::before{background:#1d4f3d;border:1px solid #c9a24a88}

/* Chapter 10 tables, growth list and note (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-kinds td:nth-of-type(1){color:#c9bfae}
html[data-theme="dark"] .ms-kinds td:nth-of-type(2){color:#8fd0a9}
html[data-theme="dark"] .chapter-body .grow-list li{color:var(--heading)}
html[data-theme="dark"] .chapter-body .care-note{background:#173d2e;color:var(--heading);border-left-color:#8fd0a9}
@media(max-width:400px){html[data-theme="dark"] .ms-kinds tr{border-bottom-color:#24443a}html[data-theme="dark"] .ms-kinds tbody tr:nth-child(even){background:#153026}}

/* Chapter 11 (diagrams keep their own light boxes) */
html[data-theme="dark"] .reflect-clear{border-color:#c98a78;color:#f0a58f}
html[data-theme="dark"] .reflect-clear:hover{background:#2a1d18}

/* Chapter 12 (diagrams keep their own light boxes) */
html[data-theme="dark"] .hs-pillars{border-color:#6d5a2a}

/* Chapter 13 (diagrams keep their own light boxes) */
html[data-theme="dark"] .twopaths{background-image:linear-gradient(#6d5a2a,#6d5a2a)}

/* Chapter 14 (diagrams keep their own light boxes) */
html[data-theme="dark"] .chapter-body .father .big-questions li{background:#163327}

/* Chapter 15 (diagrams keep their own light boxes) */
html[data-theme="dark"] .rbr-deck{box-shadow:0 0 0 1px #c9a24a55}

/* Chapter 16 (diagrams keep their own light boxes) */
html[data-theme="dark"] .tri-paths{--fork:#a88330}

/* Chapter 17 (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-inout17 td:first-child{color:#8fd0a9}

/* Chapter 18 (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-found18 td{color:#8fd0a9}
html[data-theme="dark"] .father .peace-def{border-color:#3d5a46}
html[data-theme="dark"] .father .peace-def strong,
html[data-theme="dark"] .chapter-body .future-list li,
html[data-theme="dark"] .chapter-body .roles-list li{color:var(--heading)}
html[data-theme="dark"] .chapter-body .future-list li{border-color:#a88330}

/* Chapter 19 (diagrams keep their own light boxes) */
html[data-theme="dark"] .ms-vision19 td{color:#8fd0a9}
html[data-theme="dark"] .father .vref{background:#3a3016;border-color:#8a6a22;color:#f0d68e}
html[data-theme="dark"] .chapter-body h4.ms-subhead{color:var(--heading)}
html[data-theme="dark"] .chapter-body .fathers-note{border-color:#8a6a22}

/* Personal reading progress (every chapter page from Chapter 4 on) */
html[data-theme="dark"] .mark-read{background:#1a2f22;border-color:#6d5a2a}
html[data-theme="dark"] .mark-read.is-read{background:#173d2e;border-color:#2f6b52}
html[data-theme="dark"] .mr-btn{background:#0c211a;color:var(--heading);border-color:#8fd0a9}
html[data-theme="dark"] .mr-btn:hover{background:#2f6b52;color:#fff}
html[data-theme="dark"] .mark-read.is-read .mr-btn{background:transparent;color:#f0d68e;border-color:#8a6a22}
html[data-theme="dark"] .mr-state{color:var(--heading)}
html[data-theme="dark"] .mark-read.is-read .mr-state{color:#8fd0a9}
html[data-theme="dark"] .mr-overall{background:#0c211a;border-color:#2c4b3d}
html[data-theme="dark"] .mr-ov-l{color:var(--heading)}
html[data-theme="dark"] .mr-ov-n{color:#8fd0a9}
html[data-theme="dark"] .mr-ov-n.is-complete{color:#f0d68e}
html[data-theme="dark"] .rp-meter{background:#2b3a2a}
html[data-theme="dark"] .mr-done{color:#8fd0a9}
html[data-theme="dark"] .mr-done a{color:#f0d68e}
html[data-theme="dark"] .rd-i{border-color:#7d8f84}
html[data-theme="dark"] .rd.is-read{color:#8fd0a9}
html[data-theme="dark"] .rd.is-read .rd-i{border-color:#8fd0a9;background:#2f6b52}

/* Chapter 20 (diagrams, the declaration panel, the completion panel and the certificate keep their own colours) */
html[data-theme="dark"] .ms-legacy20 td{color:#8fd0a9}
html[data-theme="dark"] .chapter-body .inherit-list li{background:#3a3016;border-color:#8a6a22;color:#f0d68e}
html[data-theme="dark"] .teach-pairs p{color:#eaa08c}
html[data-theme="dark"] .teach-pairs p.tp-yes{color:#8fd0a9}
html[data-theme="dark"] .teach-pairs.teach-both p{color:var(--heading)}
html[data-theme="dark"] .teach-pairs.teach-both p.tp-yes{color:#8fd0a9}
html[data-theme="dark"] .decl-tools{border-color:#8a6a22}
html[data-theme="dark"] .decl-accept{border-color:#3d5a46;color:var(--heading)}
html[data-theme="dark"] .decl-field label{color:var(--heading)}
html[data-theme="dark"] .decl-field input{background:#0c211a;color:var(--ink);border-color:#3d5a46;color-scheme:dark}
html[data-theme="dark"] .cert-locked{border-color:#8a6a22}
