@import url("/assets/labs-ui/theme-toggle.css?v=20261026-1");

/* Theme tokens shared by the site's several generations of reading layouts. */
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --site-canvas: #12191f;
  --site-paper: #1b252e;
  --site-raised: #24323d;
  --site-ink: #e2e8ed;
  --site-muted: #abb9c4;
  --site-line: #40515f;
  --site-link: #9ac9f0;
  --site-gold: #e4bc80;
  --ink: var(--site-ink); --muted: var(--site-muted);
  --paper: var(--site-paper); --canvas: var(--site-canvas);
  --surface: var(--site-paper); --surface-soft: var(--site-raised);
  --card: var(--site-paper); --line: var(--site-line);
  --green: var(--site-link); --blue: var(--site-link);
  --forest: var(--site-link); --forest-dark: #234d70;
  --green-dark: #234d70; --green-soft: #223c4d; --blue-soft: #223c4d;
  --gold: var(--site-gold); --visited: #93a4b2;
  --research: var(--site-link); --book: #ddb28d; --jii: #dbbd8a;
  --tly: #d5b98e; --toj: #d7aa86; --additional: #b7c9eb;
  --reader-ink: var(--site-ink); --reader-muted: var(--site-muted);
  --reader-paper: var(--site-canvas); --reader-surface: var(--site-paper);
  --reader-line: var(--site-line); --reader-green: var(--site-link); --reader-gold: var(--site-gold);
  --editorial-ink: var(--site-ink); --editorial-muted: var(--site-muted);
  --editorial-paper: var(--site-canvas); --editorial-surface: var(--site-paper);
  --editorial-line: var(--site-line); --editorial-green: var(--site-link);
  --editorial-green-dark: #234d70; --editorial-gold: var(--site-gold); --editorial-rust: #e0ad97;
  --compare-ink: var(--site-ink); --compare-muted: var(--site-muted);
  --compare-paper: var(--site-canvas); --compare-surface: var(--site-paper);
  --compare-line: var(--site-line); --compare-green: var(--site-link);
  --compare-blue: #9abdf6; --compare-german: #b8bdc3; --compare-gold: var(--site-gold);
  --assess-ink: var(--site-ink); --assess-muted: var(--site-muted);
  --assess-green: var(--site-link); --assess-green-soft: #223c4d;
  --assess-gold: var(--site-gold); --assess-gold-soft: #3d3425;
  --assess-red: #f1a79d; --assess-paper: var(--site-canvas);
  --assess-surface: var(--site-paper); --assess-line: var(--site-line);
  --mk-ink: var(--site-ink); --mk-muted: var(--site-muted); --mk-paper: var(--site-canvas);
  --mk-surface: var(--site-paper); --mk-line: var(--site-line); --mk-green: var(--site-link); --mk-gold: var(--site-gold);
  --ufo-ink: var(--site-ink); --ufo-muted: var(--site-muted); --ufo-green: var(--site-link);
  --ufo-green-deep: #234d70; --ufo-gold: var(--site-gold); --ufo-paper: var(--site-paper);
  --ufo-surface: var(--site-raised); --ufo-line: var(--site-line);
  --preserved-ink: var(--site-ink); --preserved-green: var(--site-link); --preserved-gold: var(--site-gold);
  --preserved-muted: var(--site-muted); --preserved-line: var(--site-line);
  --preserved-paper: var(--site-canvas); --preserved-card: var(--site-paper);
  --top20-deep: var(--site-link); --top20-green: #285878; --top20-blue: #9abdf6;
  --top20-gold: var(--site-gold); --top20-warm: #f0c985; --top20-paper: var(--site-canvas);
  --top20-surface: var(--site-paper); --top20-line: var(--site-line);
  background: var(--site-canvas);
}
html[data-theme="dark"] body {
  color: var(--site-ink); background: var(--site-canvas);
}
html[data-theme="dark"] .parallel-reader-page {
  --parallel-rule: var(--site-line); --parallel-mt-tint: #202c32;
  --parallel-tj-tint: #213044; --parallel-gap: #1b252b;
}

/* The original pill geometry is retained even inside older button toolbars. */
.site-theme-control { display: inline-flex; align-items: center; flex: 0 0 auto; line-height: 1; }
.site-theme-control .plx-theme-toggle { box-sizing: border-box; width: 84px; height: 28px; }
html[data-theme] .site-theme-control .plx-theme-toggle-option {
  box-sizing: border-box; min-width: 0; min-height: 0; width: 24px; height: 20px;
  padding: 0; margin: 0; border: 0; border-radius: 999px; line-height: 0;
  background: transparent; color: var(--plx-text-2);
}
html[data-theme] .site-theme-control .plx-theme-toggle-option[aria-checked="true"] {
  background: var(--plx-bg-1); color: var(--plx-text-1);
}
html[data-theme] .site-theme-control .plx-theme-toggle-option:hover { color: var(--plx-text-1); }
.site-theme-floating {
  position: fixed; right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom)); z-index: 2147482999;
  padding: 6px; border: 1px solid var(--plx-border); border-radius: 999px;
  background: var(--plx-bg-1); box-shadow: 0 4px 20px #0003;
}
.font-controls, .book-nav-utility-controls, .document-reader .reader-actions { flex-wrap: wrap; }
.book-page-nav.is-collapsed .book-nav-utility-controls > .site-theme-control { display: inline-flex; }
body:has(.site-theme-floating) { padding-bottom: 76px; }
body:has(.site-theme-floating) .article-quicknav { bottom: 76px; }

/* Hard-coded surfaces in preserved articles, dialogs, and newer feature cards. */
html[data-theme="dark"] :is(
  .container, .markdown-document, .reader-sidebar, .article-context, .method-note,
  .typography-dialog, .typography-dialog-header, .typography-dialog-footer, .typography-preview,
  .verse-dialog, .verse-dialog-header, .tj-reference-dialog, .tj-reference-text,
  .article-reference-entry, .reference-context, .reference-source-note,
  .parallel-reader-controls, .parallel-column-heads, .parallel-row-meta, .primary-reading,
  .parallel-start-card, .coverage-notice, .article-toc, .article-toc-grid > a, .article-notes,
  .comparison-source-editions, .comparison-source-grid article, .source-edition-provenance,
  .comparison-item[open] > summary, .comparison-close-button,
  .phoax-badge, .phoax-explainer, .fingerprint-feature, .fingerprint-chain article,
  .proof-text-matthew, .proof-text-tj, .proof-facts article, .proof-transformation,
  .proof-transformation div, .proof-asymmetry p, .proof-editorial-note, .preserved-note,
  .preservation-note, .search-result, .topic-chips button, .comparison-sources,
  .comparison-sources > a, .phoax-feature, .phoax-feature-mark, .parallel-reader-card,
  .parallel-reader-icon, .text-history-feature, .text-history-feature dl div,
  .scholarly-library, .filter-tabs, .discover-group[data-category="new-research"],
  .divbox, .divbox2, .site-inline-background
) { background: var(--site-paper) !important; color: var(--site-ink); border-color: var(--site-line); }
html[data-theme="dark"] :is(
  .choice figure, .additional-strip, .ufo-hero-note, .ufo-preservation, .sighting-figure,
  .interpretation-note, .missing-archive-image, .preserved-contents, .top20-toolbar button,
  .top20-item[open] > summary, .top20-attribution-chip, .top20-explanation article,
  .top20-verse-status, .top20-verse-part, .top20-provenance, .top20-phoax-explanation,
  .top20-item-actions a, .top20-item-actions button, .history-thesis, .history-numbers article,
  .plain-callout, .variant-grid article, .count-grid article, .change-types article,
  .evidence-list li, .version-timeline .scofield-row > div, .gnostic-caution, .label-key li,
  .gospel-cards article, .gospel-cards dl div, .apocrypha-table strong,
  .apocrypha-table div:not(.table-head) span, .future-study, .catalog-thesis,
  .catalog-scope > div, .catalog-legend li, .source-card, .source-card dl div,
  .catalog-empty, .review-queue, .plain-summary, .history-context-link, .stakes-list li,
  .response-context, .reference-warning, .featured-response-page .markdown-document > p:nth-of-type(4),
  .probability-scale .leans-no-hoax, .probability-scale .neutral, .probability-scale .leans-hoax
) { background: var(--site-paper); color: var(--site-ink); border-color: var(--site-line); }
html[data-theme="dark"] :is(
  .mk-lede, .ufo-hero .lede, .interpretation-note p, .source-quote p, .preserved-deck,
  .top20-intro-note p, .top20-section-heading > p, .top20-feature-grid strong,
  .top20-summary-copy strong, .top20-status, .top20-explanation p, .top20-verses-label p,
  .top20-provenance strong, .history-lede, .section-intro, .variant-grid p, .count-grid p,
  .change-types p, .version-timeline p, .gospel-cards > article > p, .gospel-cards dd,
  .catalog-search, .source-claim, .source-card dd, .plain-hero-lede,
  .reference-warning-copy > p:last-child
) { color: var(--site-muted); }
html[data-theme="dark"] :is(
  .ufo-preservation strong, .ufo-contents a span, .sighting-kicker, .interpretation-note strong,
  .preserved-note strong, .top20-feature-grid span, .top20-summary-copy small,
  .top20-provenance span, .history-numbers span, .count-grid span, .version-timeline time,
  .history-next span, .gospel-cards dt, .catalog-scope span, .source-card dt,
  .conclusion-grid span, .comparison-label
) { color: var(--site-gold); }
html[data-theme="dark"] :is(.evidence-label, .strong-tag, .debated-tag, .fragment-tag, .other-tag) {
  background: var(--site-raised); color: var(--site-ink);
}
/* Only the legacy research stylesheet paints every paragraph white. Do not
   erase intentional card/list backgrounds in newer layouts. */
html[data-theme="dark"]:has(link[href*="styles.css"]) p { background-color: transparent; }
html[data-theme="dark"] :is(h1, h2, h3, h4, h5, h6) { color: var(--site-ink); }
html[data-theme="dark"] a { color: var(--site-link); }
html[data-theme="dark"] a:hover { color: #d0e7fa; }
html[data-theme="dark"] :is(input, textarea)::placeholder { color: #b7c6d2; opacity: 1; }
html[data-theme="dark"] :is(input, select, textarea):focus-visible {
  outline: 2px solid #a9d7ff;
  outline-offset: 2px;
}
html[data-theme="dark"] :is(
  .lede, .standfirst, .feature-hero .lede, .memorial-copy .standfirst,
  .archive-article-body, .archive-article-body blockquote, .comment-body, .comment-body blockquote,
  .scholarly-article > p:first-of-type, .markdown-document blockquote,
  .assessment-hero-lede, .evidence-card p, .proof-verdict p, .proof-conclusion p,
  .proof-facts span, .proof-chain span, .proof-transformation span, .return-thesis p,
  .comparison-source-grid p, .comparison-source-heading p, .reference-context > strong,
  .phoax-interpretation, .phoax-scale-labels, .phoax-badge-labels, .phoax-feature .phoax-source-note,
  .search-result p:last-child, .text-history-feature > div > p:not(.eyebrow), .research-directory a,
  .typography-color-value, .parallel-column-heads > div, .gap-message,
  .article-byline, .comparison-source-grid small, .tj-reference-unavailable
) { color: var(--site-muted); }
html[data-theme="dark"] :is(
  .article-kicker, .article-offpage small, .comparison-source-heading span,
  .comparison-source-editions .source-role, .parallel-start-card span,
  .parallel-reader-copy small, .phoax-explainer-heading p, .fingerprint-feature .label,
  .tj-reference-kicker
) { color: var(--site-gold); }
html[data-theme="dark"] :is(
  .typography-dialog-close, .typography-dialog-footer button, .verse-dialog-close,
  .tj-reference-x, .tj-reference-trigger, .segmented-control a, .segmented-control button,
  .chapter-tools button, .chapter-tools select, input:not([type=color]), select, textarea
) { background-color: var(--site-raised); color: var(--site-ink); border-color: var(--site-line); }
html[data-theme="dark"] :is(
  .button-primary, .search-row button, .button-link, .compact-search button,
  .next-page-button, .chapter-links a:hover, .assessment-actions a,
  .direction-band, .evidence-card .number, .proof-chain li::before, .accent-card,
  .view-full-button, .read-tj-link, .typography-dialog-footer .typography-done,
  .analysis-tabs button[aria-selected=true], .segmented-control :is(a,button).is-active,
  .filter-tabs button[aria-pressed=true], .search-filters button[aria-pressed=true],
  .comparison-link-row .summary-links a, .tj-reference-actions .primary,
  .discover-link, .primary-action, .catalog-filters button.is-active,
  .catalog-section-heading > span, .calculator button, .preserved-next a:first-child,
  .article-return a:first-child, .transmission-chain li > span, .event-chain li::before
) { color: #eef6fc; background-color: #285878; border-color: #5185a9; }
html[data-theme="dark"] :is(th, .markdown-document th) { background: var(--site-raised); }
html[data-theme="dark"] :is(.markdown-document code, mark, .reader-verse:target, .mt-verse:target, .tj-verse:target) {
  color: var(--site-ink); background: #3b3c30;
}
html[data-theme="dark"] :is(.markdown-document pre, .markdown-document pre code) { background: #0e171e; color: #e2e8ed; }
html[data-theme="dark"] :is(.citation-badge-mt, .citation-badge-tj, .citation-badge-german,
  .alignment-badge, .provenance-badge) { color: var(--site-ink) !important; background: var(--site-raised); border-color: var(--site-line); }
html[data-theme="dark"] :is(.tj-verse-number, .verse-number, .reader-verse .verse-number,
  .source-copy .verse-number, .german-excerpt .verse-number, .tj-reference-text.tj sup) { color: var(--site-link); }
html[data-theme="dark"] :is(.phoax-badge-value b, .phoax-badge-labels b, .phoax-scale-labels b) { color: var(--site-ink); }
html[data-theme="dark"] .research-label-problem { color: #f1a79d; }
html[data-theme="dark"] :is(footer, footer p) { color: var(--site-muted); background-color: transparent; }
html[data-theme="dark"] .site-inline-color {
  color: oklch(from var(--site-original-color) max(l, .78) c h) !important;
}
/* Keep custom text hues legible without changing the saved appearance settings. */
html[data-theme="dark"] :is(.source-verse-mt, .reader-verse-mt, .chapter-source-mt,
  .parallel-flow-mt .parallel-flow-copy, .source-panel-mt .source-copy, .primary-reading-mt .primary-reading-copy) {
  color: oklch(from var(--mt-font-color) max(l, .8) c h) !important;
}
html[data-theme="dark"] :is(.source-verse-tj, .reader-verse-tj, .chapter-source-tj,
  .parallel-flow-tj .parallel-flow-copy, .source-panel-tj .source-copy, .primary-reading-tj .primary-reading-copy) {
  color: oklch(from var(--tj-font-color) max(l, .8) c h) !important;
}
html[data-theme="dark"] :is(.source-verse-german, .chapter-source-german, .german-excerpt, .german-excerpt p) {
  color: oklch(from var(--german-font-color) max(l, .75) c h) !important;
}
html[data-theme="dark"] :is(.analysis-font-preview, .comparison-chapter-shell, .analysis-panel) {
  color: oklch(from var(--analysis-font-color) max(l, .8) c h) !important;
}

/* Explicit light-surface pairs: a global link color must never turn their
   dark labels pale. Retain these light call-to-action backgrounds. */
html[data-theme="dark"] :is(.primary-button, .top20-home-action, .featured-herod-action),
html[data-theme="dark"] :is(.primary-button, .top20-home-action, .featured-herod-action):hover {
  color: #102b42;
}
html[data-theme="dark"] :is(.primary-button, .top20-home-action, .featured-herod-action) * { color: inherit; }

/* These section backgrounds formerly reused a token also used for links. */
html[data-theme="dark"] :is(.argument-path-question, .gnostic-bridge, .plain-conclusion, .apocrypha-table .table-head) {
  background: #20415a; color: #edf4f9;
}
html[data-theme="dark"] .gnostic-bridge dl { background: #294b63; }
html[data-theme="dark"] .gnostic-bridge dl div { background: #20415a; }
html[data-theme="dark"] :is(.comparison-sources span, .gnostic-caution span) { color: var(--site-gold); }
html[data-theme="dark"] :is(.top20-feature-grid b, .top20-feature-grid i, .top20-explanation article:last-child span) {
  color: var(--site-link);
}
html[data-theme="dark"] .top20-explanation span { color: #f1a79d; }
html[data-theme="dark"] :is(.footnote-ref, .number-superscript) { color: var(--site-link) !important; }

/* These older layouts declare their palette on the body, not :root. */
html[data-theme="dark"] .preserved-article-page {
  --preserved-ink: var(--site-ink); --preserved-green: var(--site-link);
  --preserved-gold: var(--site-gold); --preserved-muted: var(--site-muted);
  --preserved-line: var(--site-line); --preserved-paper: var(--site-canvas); --preserved-card: var(--site-paper);
}
html[data-theme="dark"] .ufo-page {
  --ufo-ink: var(--site-ink); --ufo-muted: var(--site-muted); --ufo-green: var(--site-link);
  --ufo-green-deep: var(--site-ink); --ufo-gold: var(--site-gold);
  --ufo-paper: var(--site-paper); --ufo-surface: var(--site-raised); --ufo-line: var(--site-line);
}
html[data-theme="dark"] :is(.audit-result-grid article.audit-result-focus, .source-method-flow article,
  .source-method-note, .audit-result-note) {
  background: var(--site-paper); color: var(--site-ink);
}
html[data-theme="dark"] :is(.one-sentence-answer p, .source-method-section .section-copy > p:last-child,
  .source-method-note, .reported-result > p, .audit-result .section-copy > p:last-child,
  .audit-result-note) { color: var(--site-muted); }
html[data-theme="dark"] .source-method-flow strong { color: var(--site-ink); }

html[data-theme="dark"] :is(
  .comparison-chapter-pager a, .comparison-actions a, .comparison-actions button,
  .comparison-close-button, .original-context-link, .verse-dialog-close,
  .segmented-control a, .segmented-control button, .parallel-index-grid a,
  .tj-reference-trigger, .mk-jump-nav a, .parallel-reader-card,
  .essential-links a, .scholarly-library nav a, .article-toc-grid > a,
  .history-next a, .plain-further-reading a, .top20-item-actions a,
  .top20-item-actions button, .gnostic-bridge .primary-action
):is(:hover, :focus-visible) {
  color: #eef6fc; background: #2b455a; border-color: #8fb5d2;
}

/* Switch both halves of a color pair together; otherwise transitions briefly
   show the new pale text over the old white background on a theme change. */
html.site-theme-switching *, html.site-theme-switching *::before,
html.site-theme-switching *::after { transition: none !important; }
@media (max-width: 600px) {
  .chapter-tools { flex-wrap: wrap; gap: .5rem; }
  .font-controls { gap: .35rem; }
  .site-theme-floating { right: 10px; bottom: 10px; }
}
@media print {
  .site-theme-control { display: none !important; }
  html[data-theme] { color-scheme: light; }
  html[data-theme="dark"], html[data-theme="dark"] body,
  html[data-theme="dark"] body * { background-color: white !important; color: black !important; box-shadow: none !important; }
}
