  /* ── Reset ─────────────────────────────────────────── */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { font-size: 16px; scroll-behavior: smooth; }

  /* Shared accessibility utility: keep helper text available to assistive
     technology without allowing it to enter the visual layout. */
  .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  /* ── Design Tokens ──────────────────────────────────── */
  :root {
    /* ── Ancient Parchment palette ─────────────────────── */
    --navy:       #102517;
    --navy-2:     #1A3A25;
    --navy-3:     #2F5A40;
    --navy-4:     #5D7F6A;
    --sand:       #E2D1B3;
    --sand-2:     #D4BC94;
    --sienna:     #A0522D;
    --sienna-lt:  #C4733E;
    --sienna-wash:#F5EDE4;
    --gold:       #D4AF37;
    --cream:      #F1EEE6;
    --cream-2:    #E9E5DA;
    --cream-3:    #DED9CC;
    --rule:       rgba(16,37,23,0.14);

    /* Shared Keryg accent family. Green carries action and selection; warm
       gold remains a secondary editorial/evidence accent. */
    --green-700:  #2F6B45;
    --green-800:  #245537;
    --green-100:  #E5F1E6;

    /* Semantic theme foundation. Dark candidates are documented separately
       and are intentionally not activated in this light-mode preparation pass. */
    --color-page:                var(--cream);
    --color-surface:             var(--cream-2);
    --color-surface-raised:      #F7F4ED;
    --color-surface-muted:       var(--cream-3);
    --color-surface-inverse:     var(--navy);
    --color-text:                #1A2C20;
    --color-text-heading:        var(--navy);
    --color-text-secondary:      #365A45;
    --color-text-muted:          var(--navy-4);
    --color-text-inverse:        var(--sand);
    --color-border:              var(--rule);
    --color-border-strong:       rgba(16, 37, 23, 0.24);
    --color-brand:               var(--green-700);
    --color-brand-hover:         var(--green-800);
    --color-accent:              var(--gold);
    --color-link:                var(--green-700);
    --color-link-hover:          var(--green-800);
    --color-focus:               rgba(47, 107, 69, 0.52);
    --color-success:             var(--green-700);
    --color-warning:             var(--gold);
    --color-danger:              var(--sienna);
    --color-overlay:             rgba(16, 37, 23, 0.30);
    --color-shadow:              rgba(16, 37, 23, 0.11);
    --color-study-surface:       var(--color-surface-raised);
    --color-study-surface-border: var(--color-border);
    --color-study-tab-surface:   var(--color-surface);
    --color-study-tab-active:    var(--color-surface-inverse);
    --color-dialog-surface:      var(--color-surface-raised);
    --color-dialog-backdrop:     var(--color-overlay);
    --color-dialog-action-surface: var(--color-surface-raised);
    --color-nav-surface:         rgba(245, 241, 234, 0.92);
    --color-scripture-highlight-surface: rgba(212, 175, 55, 0.14);
    --color-scripture-highlight-marker: #9A7525;
    --color-scripture-selected:  rgba(160, 82, 45, 0.15);
    --color-scripture-current:   rgba(160, 82, 45, 0.14);
    --color-scripture-search-surface: rgba(212, 175, 55, 0.15);
    --color-scripture-search-marker: #9A7525;
    --color-scripture-search-active-marker: #A0522D;
    --color-scripture-highlight: var(--color-scripture-highlight-surface);
    --color-search-match: var(--color-scripture-search-surface);
    --color-interlinear-surface: var(--cream-2);
    --color-interlinear-raised: var(--color-surface-raised);
    --color-interlinear-token: var(--color-surface-raised);
    --color-interlinear-original: var(--color-text-heading);
    --color-interlinear-transliteration: var(--color-text-secondary);
    --color-interlinear-gloss: var(--color-text-secondary);
    --color-interlinear-morphology: var(--color-text-muted);
    --color-interlinear-muted: var(--color-text-muted);
    --color-interlinear-strongs: var(--color-link);
    --color-interlinear-divider: var(--color-border);
    --color-interlinear-selected: var(--color-scripture-selection-surface);
    --color-interlinear-focused: var(--color-focus);
    --color-interlinear-hover: var(--color-scripture-hover-surface);
    --color-lexical-surface: var(--color-surface-raised);
    --color-lexical-raised: var(--color-surface);
    --color-lexical-secondary: var(--color-text-muted);
    --color-commentary-surface: var(--sienna-wash);
    --color-commentary-raised: color-mix(in srgb, var(--color-surface-raised) 78%, var(--color-surface) 22%);
    --color-cross-reference-row: color-mix(in srgb, var(--color-surface-raised) 82%, var(--color-surface) 18%);
    --color-cross-reference-active: color-mix(in srgb, var(--color-brand) 10%, var(--color-surface-raised));
    --color-study-panel-divider: var(--color-border);
    --color-study-panel-link: var(--color-link);
    --color-scripture-text:      var(--color-text);
    --color-scripture-number:    var(--color-text-muted);
    --color-scripture-heading:   var(--color-text-heading);
    --color-scripture-footnote:  var(--color-link);
    --color-scripture-selection: rgba(160, 82, 45, 0.22);
    --color-scripture-selection-text: var(--color-text-heading);
    --color-scripture-focus-ring:      #A0522D;
    --color-scripture-selection-surface: rgba(160, 82, 45, 0.12);
    --color-scripture-selection-marker:  #A0522D;
    --color-scripture-current-surface:   rgba(212, 175, 55, 0.12);
    --color-scripture-current-marker:    #9A7525;
    --color-scripture-hover-surface:     rgba(54, 90, 69, 0.08);
    --color-scripture-commentary-linked-marker: #365A45;
    --color-scripture-interlinear-linked-marker: #9A7525;

    /* ── Aliases ───────────────────────────────────────── */
    --ink:        var(--color-text);
    --ink-2:      var(--color-text-secondary);
    --ink-3:      var(--color-text-secondary);
    --ink-4:      var(--color-text-muted);
    --parchment:  var(--color-page);
    --parchment-2:var(--color-surface);
    --parchment-3:var(--color-surface-muted);
    --paper:       var(--color-surface-raised);
    --olive:      var(--color-brand);
    --olive-light:var(--color-brand-hover);
    --olive-wash: var(--color-commentary-surface);
    --brand:      var(--color-brand);

    --serif:      'Lora', Georgia, serif;
    --sans:       'DM Sans', system-ui, sans-serif;
    --max:        1120px;
    --col:        700px;
    --radius-sm:  6px;
    --radius-md:  12px;
    --radius-lg:  18px;
    --elev-1:     0 6px 22px rgba(16, 37, 23, 0.08);
    --elev-2:     0 14px 36px var(--color-shadow);
    --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Final cascade for the Scripture-first Bible Study shell. */
  #page-teachings .teachings-layout { grid-template-columns: 252px minmax(0, 1fr); width: min(1680px, calc(100vw - 2rem)); transition: grid-template-columns 220ms ease; }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar { overflow: hidden; }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar > *:not(.teach-sidebar-head) { visibility: hidden; }
  #page-teachings .teach-sidebar { padding: 0.7rem 0.35rem; }
  #page-teachings .teach-sidebar-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 0.72rem; color: var(--ink-2); font-size: 0.82rem; font-weight: 600; }
  #page-teachings .teach-sidebar-close { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink-3); font-size: 1.35rem; cursor: pointer; }
  #page-teachings .sidebar-book { min-height: 44px; margin-left: 0.25rem; padding: 0.35rem 0.5rem; gap: 0.35rem; }
  #page-teachings .sidebar-book-toggle, #page-teachings .sidebar-book-name { min-height: 40px; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
  #page-teachings .sidebar-book-toggle { width: 32px; flex: 0 0 32px; font-size: 1.1rem; color: var(--ink-4); }
  #page-teachings .sidebar-book-name { flex: 1; text-align: left; font-size: 0.94rem; }
  #page-teachings .sidebar-book-ch { font-size: 0.76rem; }
  #page-teachings .sidebar-chap { min-height: 44px; display: flex; align-items: center; font-size: 0.88rem; padding-left: 2.2rem; }
  #page-teachings .teach-main { padding: 0 2.4rem 4rem; min-width: 0; }
  #page-teachings .study-page-header { position: sticky; top: 60px; z-index: 80; padding: 0.7rem 0 0.75rem; background: color-mix(in srgb, var(--parchment) 94%, transparent); backdrop-filter: blur(10px); transition: transform 180ms ease, opacity 180ms ease; }
  #page-teachings .study-page-header.is-toolbar-hidden { transform: translateY(calc(-100% + 8px)); opacity: 0.18; }
  #page-teachings .reader-toolbar-main { display: flex; align-items: center; gap: 0.65rem; min-height: 48px; }
  #page-teachings .reader-toolbar-menu { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid var(--parchment-3); border-radius: 999px; background: rgba(255,255,255,0.55); color: var(--ink-2); cursor: pointer; font: 600 0.78rem var(--sans); }
  #page-teachings .reader-toolbar-reference { margin: 0; min-width: 8.5rem; font: 500 1.28rem/1.15 var(--serif); color: var(--ink); }
  #page-teachings .compact-version-control { min-width: 108px; max-width: 130px; }
  #page-teachings .compact-version-control .teach-version-select { min-width: 0; width: 100%; height: 44px; padding: 0 0.7rem; border-radius: 999px; font-size: 0.82rem; }
  #page-teachings .teach-reading-modes { min-height: 44px; margin-left: auto; }
  #page-teachings .teach-mode-btn { min-height: 38px; padding: 0 0.75rem; font-size: 0.76rem; letter-spacing: 0.02em; text-transform: none; }
  #page-teachings .reader-toolbar-chapter-controls { display: inline-flex; gap: 0.35rem; }
  #page-teachings .reader-toolbar-chapter-controls .teach-chap-btn { width: 44px; height: 44px; padding: 0; font-size: 1.3rem; text-transform: none; letter-spacing: 0; }
  #page-teachings .reader-toolbar-subrow { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.35rem 0 0 0.2rem; }
  #page-teachings .reader-toolbar-subrow .chapter-breadcrumb { margin: 0; font-size: 0.72rem; }
  #page-teachings .reader-toolbar-subrow .verse-chapter-sub { margin: 0; font-size: 0.82rem; color: var(--ink-4); }
  #page-teachings .study-content-layout { max-width: 1180px; padding-top: 1.55rem; gap: 2rem; }
  #page-teachings .study-content-layout.is-study, #page-teachings .study-content-layout.is-study-experience { grid-template-columns: minmax(0, 1fr); gap: 0; }
  #page-teachings .study-content-layout.is-interlinear { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 1.5rem; align-items: stretch; }
  #page-teachings .study-content-layout.is-interlinear.is-interlinear-split-view .interlinear-split { grid-template-columns: minmax(0, 0.56fr) minmax(0, 1fr); }
  #page-teachings .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-split { grid-template-columns: minmax(0, 1fr); }
  #page-teachings .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-pane--translation { display: none; }
  #page-teachings.is-interlinear-mode .study-content-layout.is-interlinear {
    max-width: none;
    width: 100%;
  }
  #page-teachings.is-interlinear-mode .study-content-layout.is-interlinear .scripture-column,
  #page-teachings.is-interlinear-mode .study-content-layout.is-interlinear .chapter-reader {
    max-width: none;
    width: 100%;
  }
  #page-teachings.is-interlinear-mode .study-content-layout.is-interlinear .interlinear-inspector {
    max-width: none;
    width: 100%;
  }
  #page-teachings .scripture-column, #page-teachings .chapter-reader { max-width: 820px; }
  #page-teachings .reader-verse { font-size: 1.22rem; line-height: 1.82; margin-bottom: 0.65rem; }
  #page-teachings .reader-verse-num { font-size: 0.7rem; }
  #page-teachings .study-mode-panel, #page-teachings .interlinear-inspector { position: sticky; top: 126px; max-height: calc(100vh - 146px); overflow: auto; padding: 1.2rem; }
  #page-teachings .study-panel-block h3 { font-size: 0.78rem; text-transform: none; letter-spacing: 0.02em; }
  #page-teachings .study-surface-loading { min-height: 120px; display: grid; place-items: center; gap: 0.35rem; color: var(--ink-3); font-size: 0.92rem; }
  #page-teachings .study-surface-loading p { margin: 0; }
  #page-teachings .study-loading-spinner { width: 20px; height: 20px; border: 2px solid var(--parchment-3); border-top-color: var(--sienna); border-radius: 50%; animation: keryg-spin 700ms linear infinite; }
  #page-teachings .study-surface-close { min-width: 44px; min-height: 44px; }
  @media (max-width: 1279px) {
    #page-teachings .teachings-layout, #page-teachings .teachings-layout:not(.is-library-open) { grid-template-columns: 1fr; width: min(100%, calc(100vw - 2rem)); }
    #page-teachings .teach-sidebar { position: fixed; left: 0; top: 60px; bottom: 0; z-index: 190; width: min(300px, 86vw); height: auto; transform: translateX(-105%); background: var(--parchment); box-shadow: 12px 0 28px rgba(16,37,23,0.12); transition: transform 220ms ease; }
    #page-teachings .teach-sidebar.is-drawer-open { transform: translateX(0); }
    #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar > * { visibility: visible; }
    #page-teachings .teach-main { padding: 0 1.5rem 3.5rem; }
    #page-teachings .study-content-layout.is-study, #page-teachings .study-content-layout.is-study-experience, #page-teachings .study-content-layout.is-interlinear { grid-template-columns: 1fr; }
    #page-teachings .study-content-layout.is-interlinear.is-interlinear-split-view .interlinear-split,
    #page-teachings .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-split { grid-template-columns: 1fr; }
    #page-teachings .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-pane--translation { display: none; }
    #page-teachings .study-mode-panel, #page-teachings .interlinear-inspector { position: static; max-height: none; }
  }
  @media (max-width: 680px) {
    #page-teachings .teachings-layout { width: 100%; }
    #page-teachings .teach-main { padding: 0 1rem 2.5rem; }
    #page-teachings .study-page-header { padding: 0.55rem 0 0.65rem; }
    #page-teachings .reader-toolbar-main { flex-wrap: wrap; }
    #page-teachings .reader-toolbar-menu { order: 1; flex: 0 0 auto; }
    #page-teachings .reader-toolbar-menu span { display: none; }
    #page-teachings .reader-toolbar-reference { order: 2; min-width: 0; flex: 1; font-size: 1.15rem; }
    #page-teachings .compact-version-control { order: 3; flex: 0 0 82px; }
    #page-teachings .teach-reading-modes { order: 4; width: 100%; margin-left: 0; }
    #page-teachings .teach-reading-modes .teach-mode-btn { flex: 1; }
    #page-teachings .reader-toolbar-chapter-controls { order: 5; margin-left: auto; }
    #page-teachings .reader-toolbar-subrow { display: none; }
    #page-teachings .study-content-layout { padding-top: 1rem; }
    #page-teachings .reader-verse { font-size: 1.1rem; line-height: 1.76; }
    #page-teachings .interlinear-token-grid { grid-template-columns: 1fr; }
    #page-teachings .study-word-table { min-width: 0; }
    #page-teachings .study-word-table-wrap { overflow-x: visible; }
    #page-teachings .study-word-table, #page-teachings .study-word-table thead, #page-teachings .study-word-table tbody, #page-teachings .study-word-table tr, #page-teachings .study-word-table td { display: block; width: 100%; }
    #page-teachings .study-word-table thead { display: none; }
    #page-teachings .study-word-table tr { padding: 0.7rem; border-bottom: 1px solid var(--rule); }
    #page-teachings .study-word-table td { border: 0; padding: 0.18rem 0; }
  }
  @media (prefers-reduced-motion: reduce) { #page-teachings .study-page-header, #page-teachings .teach-sidebar, #page-teachings .teachings-layout { transition: none; } #page-teachings .study-loading-spinner { animation: none; } }

  /* Bible study reader refresh: Scripture-first shell */
  .teachings-layout {
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 0;
    width: min(1680px, calc(100vw - 2rem));
    transition: grid-template-columns 220ms ease;
  }
  .teachings-layout:not(.is-library-open) .teach-sidebar { overflow: hidden; }
  .teachings-layout:not(.is-library-open) .teach-sidebar > *:not(.teach-sidebar-head) { visibility: hidden; }
  .teach-sidebar { padding: 0.7rem 0.35rem; top: 60px; }
  .teach-sidebar-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 0.72rem; color: var(--ink-2); font-size: 0.82rem; font-weight: 600; }
  .teach-sidebar-close { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink-3); font-size: 1.35rem; cursor: pointer; }
  .sidebar-book { min-height: 44px; margin-left: 0.25rem; padding: 0.35rem 0.5rem; gap: 0.35rem; }
  .sidebar-book-toggle, .sidebar-book-name { min-height: 40px; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
  .sidebar-book-toggle { width: 32px; flex: 0 0 32px; font-size: 1.1rem; color: var(--ink-4); }
  .sidebar-book-name { flex: 1; text-align: left; font-size: 0.94rem; }
  .sidebar-book-ch { font-size: 0.76rem; }
  .sidebar-chap { min-height: 44px; display: flex; align-items: center; font-size: 0.88rem; padding-left: 2.2rem; }
  .teach-main { padding: 0 2.4rem 4rem; min-width: 0; }
  .study-page-header { position: sticky; top: 60px; z-index: 80; padding: 0.7rem 0 0.75rem; background: color-mix(in srgb, var(--parchment) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule); transition: transform 180ms ease, opacity 180ms ease; }
  .study-page-header.is-toolbar-hidden { transform: translateY(calc(-100% + 8px)); opacity: 0.18; }
  .reader-toolbar-main { display: flex; align-items: center; gap: 0.65rem; min-height: 48px; }
  .reader-toolbar-menu { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem; border: 1px solid var(--parchment-3); border-radius: 999px; background: rgba(255,255,255,0.55); color: var(--ink-2); cursor: pointer; font: 600 0.78rem var(--sans); }
  .reader-toolbar-reference { margin: 0; min-width: 8.5rem; font: 500 1.28rem/1.15 var(--serif); color: var(--ink); }
  .compact-version-control { min-width: 108px; max-width: 130px; }
  .compact-version-control .teach-version-select { min-width: 0; width: 100%; height: 44px; padding: 0 0.7rem; border-radius: 999px; font-size: 0.82rem; }
  .teach-reading-modes { min-height: 44px; margin-left: auto; }
  .teach-mode-btn { min-height: 38px; padding: 0 0.75rem; font-size: 0.76rem; letter-spacing: 0.02em; text-transform: none; }
  .reader-toolbar-chapter-controls { display: inline-flex; gap: 0.35rem; }
  .reader-toolbar-chapter-controls .teach-chap-btn { width: 44px; height: 44px; padding: 0; font-size: 1.3rem; text-transform: none; letter-spacing: 0; }
  .reader-toolbar-subrow { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.35rem 0 0 0.2rem; }
  .reader-toolbar-subrow .chapter-breadcrumb { margin: 0; font-size: 0.72rem; }
  .reader-toolbar-subrow .verse-chapter-sub { margin: 0; font-size: 0.82rem; color: var(--ink-4); }
  .study-content-layout { max-width: 1180px; padding-top: 1.55rem; gap: 2rem; }
  .study-content-layout.is-study { grid-template-columns: minmax(0, 1fr) minmax(340px, 360px); gap: 2rem; }
  .study-content-layout.is-study-experience { grid-template-columns: minmax(0, 1fr) minmax(440px, 520px); gap: 2rem; }
  .study-content-layout.is-interlinear { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 1.5rem; max-width: none; width: 100%; align-items: stretch; }
  .study-content-layout.is-interlinear.is-interlinear-split-view .interlinear-split { grid-template-columns: minmax(0, 0.56fr) minmax(0, 1fr); }
  .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-split { grid-template-columns: minmax(0, 1fr); }
  .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-pane--translation { display: none; }
  .scripture-column, .chapter-reader { max-width: 820px; }
  .reader-verse { font-size: 1.22rem; line-height: 1.82; margin-bottom: 0.65rem; }
  .reader-verse-num { font-size: 0.7rem; }
  .study-mode-panel, .interlinear-inspector { position: sticky; top: 126px; max-height: calc(100vh - 146px); overflow: auto; padding: 1.2rem; }
  .study-content-layout.is-interlinear .scripture-column,
  .study-content-layout.is-interlinear .chapter-reader,
  .study-content-layout.is-interlinear .interlinear-inspector { max-width: none; width: 100%; }
  .study-panel-block h3 { font-size: 0.78rem; text-transform: none; letter-spacing: 0.02em; }
  .study-panel-empty, .study-panel-list, .study-surface-copy { font-size: 0.9rem; }
  .teach-library-backdrop { position: fixed; inset: 60px 0 0; z-index: 170; background: rgba(16,37,23,0.3); }
  .study-surface-loading { min-height: 120px; display: grid; place-items: center; gap: 0.35rem; color: var(--ink-3); font-size: 0.92rem; }
  .study-surface-loading p { margin: 0; }
  .study-loading-spinner { width: 20px; height: 20px; border: 2px solid var(--parchment-3); border-top-color: var(--sienna); border-radius: 50%; animation: keryg-spin 700ms linear infinite; }
  @keyframes keryg-spin { to { transform: rotate(360deg); } }
  .study-surface-close { min-width: 44px; min-height: 44px; }
  @media (max-width: 1279px) {
    .teachings-layout { grid-template-columns: 1fr; width: min(100%, calc(100vw - 2rem)); }
    .teachings-layout:not(.is-library-open) { grid-template-columns: 1fr; }
    .teach-sidebar { position: fixed; left: 0; top: 60px; bottom: 0; z-index: 190; width: min(300px, 86vw); height: auto; transform: translateX(-105%); background: var(--parchment); box-shadow: 12px 0 28px rgba(16,37,23,0.12); transition: transform 220ms ease; }
    .teach-sidebar.is-drawer-open { transform: translateX(0); }
    .teachings-layout:not(.is-library-open) .teach-sidebar > * { visibility: visible; }
    .teach-main { padding: 0 1.5rem 3.5rem; }
    .study-content-layout.is-study, .study-content-layout.is-study-experience, .study-content-layout.is-interlinear { grid-template-columns: 1fr; }
    .study-mode-panel, .interlinear-inspector { position: static; max-height: none; }
  }
  @media (min-width: 1024px) {
    .study-experience-grid {
      grid-template-columns: minmax(0, 2.4fr) minmax(320px, 1fr);
      gap: 1rem;
    }
    .study-experience-grid.is-results-only {
      grid-template-columns: minmax(0, 1fr);
    }
    .study-experience-rail {
      display: grid;
    }
    .study-mode-panel {
      position: sticky;
      top: 126px;
      max-height: calc(100vh - 146px);
      overflow: auto;
    }
    .study-navigation-trigger {
      display: none;
    }
    .study-navigation-fab {
      display: none;
    }
    .study-navigation-mobile-callup {
      display: none;
    }
  }
  @media (max-width: 767px) {
    .study-experience-grid {
      grid-template-columns: 1fr;
      gap: 0;
    }
    .study-experience-grid.is-results-only {
      grid-template-columns: 1fr;
    }
    .study-experience-rail {
      display: none;
    }
    .study-experience-topbar {
      flex-wrap: wrap;
    }
    .study-navigation-trigger {
      display: none;
    }
    .study-navigation-mobile-callup {
      display: flex;
      position: fixed;
      left: 0;
      right: 0;
      bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
      justify-content: center;
      padding: 0 0.75rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
      z-index: 48;
      pointer-events: none;
    }
    .study-navigation-fab {
      display: inline-flex;
      width: min(100%, 20rem);
      pointer-events: auto;
    }
    .study-experience-main,
    .study-current-stage,
    .study-current-stack,
    .study-workspace-card,
    .study-current-overview-card,
    .study-current-outline-card,
    .study-current-themes-card,
    .study-current-people-card,
    .study-current-theme-articles-card,
    .study-current-highlights-card,
    .study-current-related-card {
      width: 100%;
      max-width: none;
    }
    .study-current-title,
    .study-book-overview-copy {
      max-width: none;
    }
    .study-current-stage {
      justify-self: stretch;
    }
    .study-search-query-row {
      align-items: stretch;
    }
    .study-search-filters-bar {
      grid-template-columns: 1fr;
    }
    .study-search-ambiguity-choices {
      flex-direction: column;
    }
    .study-search-ambiguity-choice {
      min-width: 0;
      width: 100%;
    }
    .study-lexical-summary-grid,
    .study-selected-lexical-meta {
      grid-template-columns: 1fr;
    }
    .study-selected-translation-grid {
      grid-template-columns: 1fr;
    }
    .study-lexical-actions,
    .study-selected-actions,
    .study-lexical-occurrence-actions {
      flex-direction: column;
    }
    .study-lexical-occurrence-browser-head {
      align-items: start;
      flex-direction: column;
      gap: 0.35rem;
    }
  }
  @media (max-width: 680px) {
    .teachings-layout { width: 100%; }
    .teach-main { padding: 0 1rem 2.5rem; }
    .study-page-header { top: 60px; padding: 0.55rem 0 0.65rem; }
    .reader-toolbar-main { flex-wrap: wrap; }
    .reader-toolbar-menu { order: 1; flex: 0 0 auto; }
    .reader-toolbar-menu span { display: none; }
    .reader-toolbar-reference { order: 2; min-width: 0; flex: 1; font-size: 1.15rem; }
    .compact-version-control { order: 3; flex: 0 0 82px; }
    .teach-reading-modes { order: 4; width: 100%; margin-left: 0; justify-content: stretch; overflow: visible; }
    .teach-reading-modes .teach-mode-btn { flex: 1; }
    .reader-toolbar-chapter-controls { order: 5; margin-left: auto; }
    .reader-toolbar-subrow { display: none; }
    .study-content-layout { padding-top: 1rem; }
    .reader-verse { font-size: 1.1rem; line-height: 1.76; }
    .interlinear-token-grid { grid-template-columns: 1fr; }
    .study-word-table { min-width: 0; }
    .study-word-table-wrap { overflow-x: visible; }
    .study-word-table, .study-word-table thead, .study-word-table tbody, .study-word-table tr, .study-word-table td { display: block; width: 100%; }
    .study-word-table thead { display: none; }
    .study-word-table tr { padding: 0.7rem; border-bottom: 1px solid var(--rule); }
    .study-word-table td { border: 0; padding: 0.18rem 0; }
    .study-navigation-layer.is-mobile-sheet {
      padding: 0;
      align-items: end;
    }
    .study-navigation-layer.is-mobile-sheet .study-navigation-sheet {
      max-height: 88vh;
      border-radius: 1.15rem 1.15rem 0 0;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .study-page-header, .teach-sidebar, .teachings-layout { transition: none; }
    .study-loading-spinner { animation: none; }
  }

  /* ── Base ───────────────────────────────────────────── */
  body {
    font-family: var(--sans);
    background: var(--color-page);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  /* ── Grain overlay ──────────────────────────────────── */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
  }

  /* ── Pages ──────────────────────────────────────────── */
  .page { display: none; }
  .page.active { display: block; animation: fadein 0.3s ease; }
  @keyframes fadein { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

  /* ══════════════════════════════════════════════════════
     NAVIGATION
  ══════════════════════════════════════════════════════ */
  .nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--color-nav-surface);
    backdrop-filter: blur(12px);
    box-shadow: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
  }
  .nav.is-scrolled {
    box-shadow: 0 4px 18px color-mix(in srgb, var(--color-shadow) 34%, transparent);
  }
  .nav-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 0;
  }
  .nav-brand {
    border: none;
    background: none;
    padding: 0;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    margin-right: 3rem;
    text-decoration: none;
    width: 92px;
    flex: 0 0 92px;
  }
  .nav-brand img {
    display: block;
    width: 100%;
    height: auto;
  }
  .nav-links {
    display: flex;
    --nav-item-gap: 1.75rem;
    gap: var(--nav-item-gap);
    align-items: center;
    flex: 1;
    margin-left: 2.5rem;
    justify-content: flex-end;
  }
  .nav-link {
    border: none;
    background: transparent;
    font-family: var(--sans);
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--ink-3);
    cursor: pointer;
    text-decoration: none;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    transition: color 0.15s;
    letter-spacing: 0.01em;
  }
  .nav-link:hover { color: var(--ink); }
  .nav-link.active { color: var(--ink); }
  .nav-new-indicator { display: inline-flex; align-items: center; min-height: 1.35rem; padding: 0.08rem 0.42rem; border: 1px solid rgba(160, 82, 45, 0.42); border-radius: 999px; color: var(--sienna); font-size: 0.62rem; font-weight: 500; letter-spacing: 0.06em; line-height: 1; text-transform: uppercase; }
  .nav-new-indicator[hidden] { display: none; }
  .nav-link:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: -2px;
  }
  .theme-switch {
    display: inline-flex;
    align-items: center;
    align-self: center;
    margin-left: 0;
    flex: 0 0 auto;
  }
  .theme-toggle {
    --theme-toggle-hit-width: 4.375rem;
    --theme-toggle-hit-height: 2.75rem;
    --theme-toggle-track-width: 4.375rem;
    --theme-toggle-track-height: 2.125rem;
    --theme-toggle-pad: 0.125rem;
    --theme-toggle-thumb-size: 1.875rem;
    --theme-toggle-border: 1px;
    --theme-toggle-icon-size: 1rem;
    --theme-toggle-duration: 250ms;
    --theme-toggle-ease: var(--ease-premium);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: var(--theme-toggle-hit-width);
    height: var(--theme-toggle-hit-height);
    min-width: var(--theme-toggle-hit-width);
    min-height: var(--theme-toggle-hit-height);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    overflow: visible;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition:
      opacity var(--theme-toggle-duration) var(--theme-toggle-ease),
      transform 160ms var(--theme-toggle-ease);
  }
  .theme-toggle:hover {
    transform: translateY(-0.5px);
  }
  .theme-toggle:active {
    transform: translateY(0);
  }
  .theme-toggle:disabled {
    opacity: 0.54;
    cursor: default;
    pointer-events: none;
  }
  .theme-toggle:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 4px;
  }
  .theme-toggle-track {
    position: relative;
    display: block;
    width: var(--theme-toggle-track-width);
    height: var(--theme-toggle-track-height);
    min-width: var(--theme-toggle-track-width);
    min-height: var(--theme-toggle-track-height);
    margin: 0 auto;
    box-sizing: border-box;
    border: var(--theme-toggle-border) solid var(--color-border);
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--color-surface-raised) 95%, var(--color-brand) 5%);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.02));
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.65),
      0 4px 10px rgba(16, 37, 23, 0.08);
    transition:
      background-color var(--theme-toggle-duration) var(--theme-toggle-ease),
      border-color var(--theme-toggle-duration) var(--theme-toggle-ease),
      box-shadow var(--theme-toggle-duration) var(--theme-toggle-ease);
  }
  .theme-toggle:hover .theme-toggle-track {
    border-color: color-mix(in srgb, var(--color-border-strong) 72%, var(--color-brand) 28%);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.72),
      0 5px 12px rgba(16, 37, 23, 0.11);
  }
  .theme-toggle:active .theme-toggle-track {
    box-shadow:
      inset 0 1px 2px rgba(16, 37, 23, 0.12),
      0 2px 8px rgba(16, 37, 23, 0.08);
  }
  .theme-toggle[data-theme-state="dark"] .theme-toggle-track {
    border-color: color-mix(in srgb, var(--color-border-strong) 76%, black 24%);
    background-color: color-mix(in srgb, var(--color-surface-inverse) 90%, var(--color-text) 10%);
    background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.05),
      0 4px 10px rgba(0, 0, 0, 0.24);
  }
  .theme-toggle[data-theme-state="dark"]:hover .theme-toggle-track {
    border-color: color-mix(in srgb, var(--color-border-strong) 56%, var(--color-brand-hover) 44%);
    box-shadow:
      inset 0 1px 1px rgba(255, 255, 255, 0.08),
      0 5px 12px rgba(0, 0, 0, 0.28);
  }
  .theme-toggle-thumb {
    position: absolute;
    top: var(--theme-toggle-pad);
    left: var(--theme-toggle-pad);
    width: var(--theme-toggle-thumb-size);
    height: var(--theme-toggle-thumb-size);
    border-radius: 50%;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--color-border) 66%, white 34%);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 247, 243, 0.98));
    box-shadow:
      0 1px 2px rgba(16, 37, 23, 0.14),
      0 5px 10px rgba(16, 37, 23, 0.10),
      inset 0 1px 1px rgba(255, 255, 255, 0.9);
    transform: translate3d(0, 0, 0);
    transition:
      transform var(--theme-toggle-duration) var(--theme-toggle-ease),
      box-shadow var(--theme-toggle-duration) var(--theme-toggle-ease),
      background-color var(--theme-toggle-duration) var(--theme-toggle-ease),
      border-color var(--theme-toggle-duration) var(--theme-toggle-ease);
    will-change: transform;
  }
  .theme-toggle[data-theme-state="dark"] .theme-toggle-thumb {
    transform: translate3d(calc(var(--theme-toggle-track-width) - (var(--theme-toggle-border) * 2) - var(--theme-toggle-thumb-size) - (var(--theme-toggle-pad) * 2)), 0, 0);
    border-color: color-mix(in srgb, var(--color-border-strong) 55%, white 45%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--color-surface-raised) 92%, white 8%), color-mix(in srgb, var(--color-surface-raised) 82%, var(--color-brand) 18%));
    box-shadow:
      0 1px 2px rgba(16, 37, 23, 0.18),
      0 6px 12px rgba(0, 0, 0, 0.18),
      inset 0 1px 1px rgba(255, 255, 255, 0.9);
  }
  .theme-toggle:hover .theme-toggle-thumb {
    box-shadow:
      0 2px 4px rgba(16, 37, 23, 0.16),
      0 7px 14px rgba(16, 37, 23, 0.11),
      inset 0 1px 1px rgba(255, 255, 255, 0.92);
  }
  .theme-toggle:active .theme-toggle-thumb {
    box-shadow:
      0 1px 2px rgba(16, 37, 23, 0.14),
      0 4px 8px rgba(16, 37, 23, 0.08),
      inset 0 1px 1px rgba(255, 255, 255, 0.88);
  }
  .theme-toggle-icon {
    position: absolute;
    width: var(--theme-toggle-icon-size);
    height: var(--theme-toggle-icon-size);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
    transition:
      opacity var(--theme-toggle-duration) var(--theme-toggle-ease),
      transform var(--theme-toggle-duration) var(--theme-toggle-ease);
  }
  .theme-toggle-icon-sun {
    color: var(--color-accent);
    filter: drop-shadow(0 0 0.1px rgba(160, 82, 45, 0.1));
  }
  .theme-toggle-icon-moon {
    color: var(--color-text-heading);
    fill: currentColor;
    stroke: none;
  }
  .theme-toggle[data-theme-state="light"] .theme-toggle-icon-sun {
    opacity: 1;
    transform: scale(1);
  }
  .theme-toggle[data-theme-state="light"] .theme-toggle-icon-moon {
    opacity: 0;
    transform: scale(0.68);
  }
  .theme-toggle[data-theme-state="dark"] .theme-toggle-icon-sun {
    opacity: 0;
    transform: scale(0.68);
  }
  .theme-toggle[data-theme-state="dark"] .theme-toggle-icon-moon {
    opacity: 1;
    transform: scale(1);
  }
  @media (max-width: 1279px) {
    .nav-links {
      --nav-item-gap: 1.375rem;
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .theme-toggle,
    .theme-toggle-track,
    .theme-toggle-thumb,
    .theme-toggle-icon {
      transition: none !important;
    }
    .theme-toggle:hover,
    .theme-toggle:active {
      transform: none;
    }
  }
  .nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    color: var(--ink);
    border: 0;
    border-radius: 2px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
  }

  /* ══════════════════════════════════════════════════════
     HOME PAGE
  ══════════════════════════════════════════════════════ */
  .home-hero {
    position: relative;
    max-width: 1240px;
    margin: 0 auto;
    padding: 6.4rem 2rem 5.6rem;
    min-height: 560px;
    display: block;
    overflow: hidden;
  }
  .home-hero-copy {
    position: relative;
    z-index: 1;
    width: min(54ch, 52%);
  }
  .home-eyebrow {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
    margin-bottom: 1.25rem;
  }
  .home-title {
    font-family: var(--serif);
    font-size: clamp(2.8rem, 5.6vw, 4.3rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 1.6rem;
    max-width: 12ch;
  }
  .home-title-accent {
    border-bottom: 3px solid var(--gold);
    padding-bottom: 0.52rem;
    display: inline-block;
  }
  .home-sub {
    font-size: 1.04rem;
    color: var(--ink-3);
    line-height: 1.74;
    max-width: 50ch;
    margin-bottom: 2.75rem;
  }
  .home-actions { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
  .home-hero-image {
    position: absolute;
    top: 0.8rem;
    right: -6.8rem;
    bottom: 0.6rem;
    left: 33%;
    overflow: hidden;
    background: var(--color-surface) url('../assets/home/home-hero-light.webp') center / cover no-repeat;
    border: none;
    border-radius: 0;
    box-shadow: none;
    z-index: 0;
  }
  .home-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(252, 251, 247, 0.94) 0%, rgba(252, 251, 247, 0.64) 20%, rgba(252, 251, 247, 0.14) 46%, rgba(252, 251, 247, 0) 70%);
    pointer-events: none;
  }
  .home-hero-image { background-position: 68% center; }
  .btn-primary {
    background: var(--color-surface-inverse);
    color: var(--color-text-inverse);
    text-decoration: none;
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 13px 28px;
    border: 1px solid rgba(16, 37, 23, 0.18);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: var(--elev-1);
    transition: transform 0.3s var(--ease-premium), background 0.2s ease, box-shadow 0.3s var(--ease-premium);
  }
  .btn-primary:hover {
    background: var(--color-brand-hover);
    border-color: var(--color-brand-hover);
    color: var(--color-brand-foreground);
    transform: translateY(-2px);
    box-shadow: var(--elev-2);
  }
  .btn-primary:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
  }
  .btn-secondary {
    font-size: 0.77rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.28s var(--ease-premium);
    background: none;
    border: none;
    font-family: var(--sans);
  }
  .btn-secondary:hover { color: var(--ink); transform: translateX(2px); }
  .btn-secondary::after { content: '→'; font-size: 0.9rem; }

  /* Entry cards */
  .home-entries {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.75rem 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.15rem;
  }
  .entry-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.44), rgba(255,255,255,0.12));
    padding: 2.25rem 2rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s var(--ease-premium), border-color 0.25s ease, box-shadow 0.3s var(--ease-premium);
    border: 1px solid rgba(16, 37, 23, 0.12);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 0 rgba(16, 37, 23, 0.03);
  }
  .entry-card:hover {
    transform: translateY(-4px);
    border-color: rgba(160, 82, 45, 0.38);
    box-shadow: var(--elev-1);
  }
  .entry-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: -2px;
  }
  .entry-tag {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sienna);
    margin-bottom: 0.75rem;
  }
  .entry-title {
    font-family: var(--serif);
    font-size: 1.62rem;
    font-weight: 500;
    line-height: 1.18;
    margin-bottom: 0.82rem;
    letter-spacing: -0.015em;
  }
  .entry-desc { font-size: 0.875rem; color: var(--ink-3); line-height: 1.65; margin-bottom: 1.5rem; }
  .entry-arrow {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.15s, gap 0.15s;
  }
  .entry-card:hover .entry-arrow { color: var(--sienna); gap: 12px; }
  .entry-arrow::after { content: '→'; }

  /* Apologetics */
  .home-apologetics {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.75rem 2rem;
    border-bottom: 1px solid var(--rule);
  }
  .home-apologetics-layout {
    display: grid;
    grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
    gap: 2.25rem;
    align-items: stretch;
  }
  .home-apologetics-copy {
    display: grid;
    align-content: start;
    gap: 0.75rem;
    max-width: 360px;
  }
  .home-apologetics-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .home-apologetics-title {
    font-family: var(--serif);
    font-size: clamp(1.4rem, 2.5vw, 1.95rem);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.22;
    color: var(--ink);
  }
  .home-apologetics-sub {
    color: var(--ink-3);
    font-size: 0.95rem;
    line-height: 1.72;
    margin: 0 0 0.65rem;
  }
  .home-apologetics-cta {
    justify-self: start;
  }
  .home-apologetics-stack-wrap {
    min-width: 0;
  }
  .home-apologetics-stack {
    min-height: 360px;
    display: flex;
    gap: 0.6rem;
  }
  .home-apo-card {
    flex: 0 0 64px;
    border: 1px solid rgba(212, 188, 148, 0.2);
    border-radius: 3px;
    background: linear-gradient(180deg, #214a33 0%, #163725 100%);
    text-align: left;
    font-family: var(--sans);
    cursor: pointer;
    padding: 0.65rem;
    color: #f5f0e4;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    position: relative;
    text-decoration: none;
    transition: flex-basis 0.4s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .home-apo-card:hover {
    border-color: rgba(212, 175, 55, 0.52);
  }
  .home-apo-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .home-apo-card.is-active {
    flex: 1 1 auto;
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.2);
  }
  .home-apo-tab-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(245, 240, 228, 0.9);
    font-weight: 500;
    align-self: center;
    white-space: nowrap;
  }
  .home-apo-card.is-active .home-apo-tab-title {
    display: none;
  }
  .home-apo-card-body {
    display: none;
    width: 100%;
    align-self: stretch;
  }
  .home-apo-card.is-active .home-apo-card-body {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.7rem;
    padding: 1.1rem 1.15rem 1rem;
  }
  .home-apo-card-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    line-height: 1.25;
    color: #f7f2e7;
    font-weight: 500;
  }
  .home-apo-card-preview {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(247, 242, 231, 0.9);
  }
  .home-apo-card-link {
    border: none;
    background: transparent;
    padding: 0;
    font-family: var(--sans);
    font-size: 0.72rem;
    color: rgba(245, 240, 228, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    justify-self: start;
    cursor: pointer;
  }
  .home-apo-card-link:hover {
    color: #fff4d6;
  }
  .home-apo-card-link:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.45);
    outline-offset: 2px;
  }
  .home-apo-card-link::after {
    content: ' →';
  }

  /* Featured grid */
  .home-featured {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3rem 2rem;
    border-bottom: 1px solid var(--rule);
  }
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
  }
  .section-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .section-link {
    border: none;
    background: transparent;
    font-family: var(--sans);
    padding: 0;
    font-size: 0.75rem;
    color: var(--ink-3);
    cursor: pointer;
    transition: color 0.15s;
  }
  .section-link:hover { color: var(--sienna); }
  .section-link:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
  .feat-card {
    width: 100%;
    text-align: left;
    font-family: var(--sans);
    appearance: none;
    cursor: pointer;
    padding: 1.25rem;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--parchment);
    display: grid;
    gap: 0.42rem;
    transition: border-color 0.15s, background 0.15s;
  }
  .feat-card:hover { border-color: var(--sienna-lt); background: var(--parchment-2); }
  .feat-card:hover .feat-action { color: var(--sienna); }
  .feat-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .feat-ref { font-size: 0.6875rem; color: var(--ink-4); letter-spacing: 0.04em; margin-bottom: 2px; }
  .feat-title {
    font-family: var(--serif);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
    margin-bottom: 0.12rem;
  }
  .feat-meta {
    font-size: 0.7rem;
    color: var(--ink-4);
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
  }
  .feat-preview {
    font-size: 0.79rem;
    color: var(--ink-3);
    line-height: 1.58;
    margin-bottom: 0.42rem;
  }
  .feat-action {
    margin-top: auto;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--ink-4);
    transition: color 0.15s;
  }

  /* How Keryg Works */
  .home-how {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.6rem 2rem 4rem;
  }
  .home-how-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
  .home-how-step {
    padding-top: 1.05rem;
  }
  .home-how-num {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    color: var(--sienna);
    font-weight: 500;
    margin-bottom: 0.52rem;
  }
  .home-how-title {
    font-family: var(--serif);
    font-size: 1.02rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 0.45rem;
  }
  .home-how-copy {
    color: var(--ink-3);
    font-size: 0.86rem;
    line-height: 1.66;
  }

  /* ══════════════════════════════════════════════════════
     TEACHINGS PAGE
  ══════════════════════════════════════════════════════ */
  .teachings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: calc(100vh - 60px);
    width: min(1600px, calc(100vw - 4rem));
    margin: 0 auto;
  }
  .teach-sidebar {
    border-right: 1px solid var(--rule);
    background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0.06));
    padding: 1.2rem 0.6rem 1.2rem 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
  }
  .teach-sidebar::-webkit-scrollbar { width: 8px; }
  .teach-sidebar::-webkit-scrollbar-track { background: transparent; }
  .teach-sidebar::-webkit-scrollbar-thumb {
    background: rgba(16, 37, 23, 0.2);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  .sidebar-testament {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-4);
    padding: 0.9rem 1.1rem 0.45rem;
    margin-top: 0.55rem;
  }
  .sidebar-book {
    font-size: 0.79rem;
    color: var(--ink-3);
    padding: 0.48rem 0.9rem;
    margin: 0.08rem 0.4rem 0.08rem 0.85rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.22s var(--ease-premium), color 0.2s ease, transform 0.22s var(--ease-premium), box-shadow 0.22s var(--ease-premium);
  }
  .sidebar-book:hover {
    background: rgba(160, 82, 45, 0.12);
    color: var(--ink);
    transform: translateX(2px);
  }
  .sidebar-book.active {
    background: rgba(16, 37, 23, 0.1);
    color: var(--ink);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--sienna);
  }
  .sidebar-book:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.35);
    outline-offset: 1px;
  }
  .sidebar-book-ch { font-size: 0.66rem; color: var(--ink-4); letter-spacing: 0.03em; }
  .sidebar-chapters { }
  .sidebar-chap {
    font-size: 0.72rem;
    color: var(--ink-3);
    padding: 0.34rem 0.9rem 0.34rem 2rem;
    margin: 0.05rem 0.4rem 0.05rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.22s var(--ease-premium), color 0.2s ease, transform 0.22s var(--ease-premium);
  }
  .sidebar-chap:hover {
    background: rgba(212, 175, 55, 0.13);
    color: var(--ink);
    transform: translateX(1px);
  }
  .sidebar-chap.active {
    color: var(--sienna);
    font-weight: 600;
    background: rgba(212, 175, 55, 0.16);
  }
  .sidebar-overview-link {
    font-style: italic;
    color: var(--ink-2);
    border-bottom: 1px dashed var(--rule);
    margin-bottom: 0.4rem;
    padding-bottom: 0.6rem;
  }
  .sidebar-chap:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.3);
    outline-offset: 1px;
  }

  /* Verse panel */
  .teach-main {
    padding: 0 3rem 4.5rem 3.25rem;
    width: 100%;
    max-width: none;
  }
  .teach-version-bar {
    width: 100%;
  }
  .study-page-header {
    padding-top: 5rem;
    padding-bottom: 4.2rem;
    border-bottom: 1px solid var(--rule);
    background: linear-gradient(180deg, rgba(255,255,255,0.24) 0%, rgba(255,255,255,0) 100%);
  }
  .study-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2.5rem;
    margin-bottom: 3.25rem;
  }
  .version-control {
    min-width: 240px;
    max-width: 360px;
    flex: 0 1 340px;
  }
  .teach-version-label {
    display: block;
    margin-bottom: 0.7rem;
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .teach-version-select {
    width: 100%;
    min-width: 240px;
    height: 54px;
    padding: 0 1.1rem;
    background: rgba(255,255,255,0.68);
    border: 1px solid rgba(16, 37, 23, 0.16);
    border-radius: 999px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.86rem;
    line-height: 1;
    outline: none;
    appearance: none;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.25s var(--ease-premium), background 0.2s ease;
  }
  .teach-version-select:hover {
    border-color: rgba(160, 82, 45, 0.34);
    background: rgba(255,255,255,0.8);
  }
  .teach-version-select:focus {
    border-color: rgba(160, 82, 45, 0.55);
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.14);
  }
  .teach-reading-modes {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid rgba(16, 37, 23, 0.16);
    border-radius: 999px;
    padding: 3px;
    background: rgba(255,255,255,0.64);
    min-height: 54px;
    margin: 0;
  }
  .teach-mode-btn {
    border: none;
    background: transparent;
    color: var(--ink-3);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    min-height: 46px;
    padding: 0 1.25rem;
    cursor: pointer;
    transition: background 0.24s var(--ease-premium), color 0.2s ease, transform 0.24s var(--ease-premium);
  }
  .teach-mode-btn:hover {
    color: var(--ink);
    background: rgba(160, 82, 45, 0.09);
  }
  .teach-mode-btn.active {
    background: var(--ink-2);
    color: var(--sand);
    box-shadow: 0 4px 14px rgba(16, 37, 23, 0.2);
  }
  .chapter-navigation {
    display: grid;
    grid-template-columns: 170px 1fr 170px;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3.1rem;
  }
  .teach-tools-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    margin-top: 0.45rem;
    margin-bottom: 1.6rem;
    max-width: 620px;
    align-items: center;
  }
  .teach-tools-row + .teach-tools-row {
    margin-top: 0.4rem;
  }
  .teach-tool-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    padding: 10px 12px;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.8125rem;
    outline: none;
  }
  .teach-tool-input-underline {
    border: none;
    border-bottom: 1px solid #c9c9c9;
    border-radius: 0;
    padding: 8px 0 10px;
  }
  .teach-tool-input:focus {
    border-color: var(--sienna);
  }
  .teach-tool-input-underline:focus {
    border-bottom-color: var(--ink-4);
    border-color: transparent;
  }
  .teach-tool-btn {
    background: var(--navy);
    color: var(--sand);
    border: none;
    border-radius: 2px;
    min-width: 92px;
    height: 38px;
    padding: 0 10px;
    font-family: var(--sans);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
  }
  .teach-tool-btn:hover {
    background: var(--navy-2);
  }
  .teach-tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .teach-chapter-nav {
    display: contents;
  }
  .teach-chap-btn {
    height: 48px;
    width: 100%;
    min-width: 0;
    padding: 0 1rem;
    border: 1px solid rgba(16, 37, 23, 0.15);
    border-radius: 999px;
    background: rgba(255,255,255,0.58);
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    cursor: pointer;
    transition: transform 0.24s var(--ease-premium), border-color 0.2s ease, background 0.2s ease;
  }
  .teach-chap-btn:hover {
    border-color: rgba(160, 82, 45, 0.42);
    background: rgba(255,255,255,0.82);
    color: var(--ink);
    transform: translateY(-1px);
  }
  .teach-chap-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  .teach-chap-label {
    margin: 0;
    text-align: center;
    font-size: 0.91rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0.18em;
    text-transform: uppercase;
  }
  .chapter-intro {
    max-width: 760px;
  }
  .chapter-breadcrumb {
    margin: 0 0 1.25rem;
    font-size: 0.69rem;
    line-height: 1.2;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--sienna);
  }
  .teach-resources-note {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--ink-4);
    line-height: 1.55;
    max-width: 620px;
  }
  .teach-version-alert {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--sienna);
  }
  .teach-version-status {
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--ink-4);
  }
  .verse-book-label {
    display: none;
  }
  .verse-chapter-title {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 4.3vw, 3.6rem);
    font-weight: 500;
    letter-spacing: -0.024em;
    color: var(--ink);
    line-height: 1.04;
    margin-bottom: 0.9rem;
  }
  .verse-chapter-sub {
    font-size: 0.97rem;
    color: var(--ink-3);
    line-height: 1.72;
    margin: 0;
    max-width: 62ch;
  }
  .study-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0;
    padding-top: 4.5rem;
  }
  .study-content-layout.is-study {
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 4rem;
  }
  .study-content-layout.is-study-experience {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .study-content-layout.is-interlinear {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    max-width: none;
    width: 100%;
  }
  .study-content-layout.is-interlinear-parallel-view {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 1.2rem;
  }
  .scripture-column {
    min-width: 0;
    max-width: 940px;
  }
  .study-content-layout.is-interlinear .scripture-column,
  .study-content-layout.is-interlinear .chapter-reader {
    max-width: none;
    width: 100%;
  }
  .interlinear-main-column {
    max-width: none;
    width: 100%;
  }
  .interlinear-shell {
    display: grid;
    gap: 1.15rem;
  }
  .interlinear-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-interlinear-raised);
    padding: 0.62rem 0.7rem;
    border-radius: 2px;
  }
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, auto);
    align-items: center;
    gap: 1rem 1.25rem;
    padding: 0.85rem;
    border-radius: 8px;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--color-shadow) 62%, transparent);
  }
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar > .interlinear-toolbar-group {
    min-width: 0;
    gap: 0.55rem;
  }
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar > .interlinear-toolbar-group:last-child {
    justify-content: flex-end;
    gap: 0.45rem;
  }
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar-label {
    color: var(--color-text-muted);
    font-weight: 700;
  }
  .interlinear-parallel-toolbar {
    position: sticky;
    top: 0.75rem;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem 0.75rem;
    flex-wrap: wrap;
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-interlinear-raised);
    border-radius: 2px;
    padding: 0.48rem 0.58rem;
    margin-bottom: 0.65rem;
  }
  .interlinear-parallel-toolbar .interlinear-toolbar-group {
    gap: 0.35rem;
    align-items: center;
  }
  .interlinear-parallel-toolbar .teach-chap-btn,
  .interlinear-parallel-toolbar .teach-tool-btn,
  .interlinear-parallel-toolbar .step-study-select {
    height: 34px;
  }
  .interlinear-parallel-toolbar .teach-mode-btn {
    height: 34px;
    padding: 0 0.62rem;
  }
  .interlinear-parallel-toolbar .teach-tool-btn,
  .interlinear-parallel-toolbar .teach-chap-btn {
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .interlinear-toolbar .teach-tool-btn,
  .interlinear-toolbar .teach-chap-btn {
    height: 34px;
    min-width: 0;
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-interlinear-divider);
    box-shadow: none;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
  }
  .interlinear-toolbar .teach-tool-btn:hover,
  .interlinear-toolbar .teach-chap-btn:hover {
    background: var(--color-interlinear-hover);
    color: var(--color-text);
    border-color: var(--color-border-strong);
  }
  .interlinear-sync-chip {
    background: transparent;
    color: var(--color-text-secondary);
    border-color: var(--color-interlinear-divider);
    border-radius: 999px;
    padding: 0 0.68rem;
  }
  .interlinear-sync-chip[aria-pressed="true"] {
    border-color: var(--color-border-strong);
    color: var(--color-text);
    background: var(--color-interlinear-selected);
  }
  .js-il-split-toggle[aria-pressed="true"] {
    border-color: var(--color-border-strong);
    color: var(--color-text);
    background: var(--color-interlinear-selected);
  }
  .js-il-split-toggle[aria-pressed="true"]:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
    background: var(--color-interlinear-selected);
  }
  .interlinear-exit-btn {
    opacity: 0.72;
  }
  .interlinear-guidance {
    width: 100%;
    margin: 0.1rem 0 0;
    font-size: 0.69rem;
    line-height: 1.45;
    color: var(--ink-4);
    letter-spacing: 0.01em;
  }
  .interlinear-nav-group {
    flex: 1 1 auto;
  }
  .interlinear-utility-group {
    margin-left: auto;
  }
  .interlinear-dual-panes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    align-items: start;
  }
  .interlinear-parallel-pane {
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-interlinear-raised);
    border-radius: 2px;
    padding: 0.56rem;
  }
  .interlinear-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.1rem 0.16rem 0.4rem;
    border-bottom: 1px solid var(--color-interlinear-divider);
    margin-bottom: 0.28rem;
  }
  .interlinear-pane-head .study-gloss-toggle {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-pane-head .study-gloss-toggle {
    background: var(--color-interlinear-raised);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-interlinear-divider);
    box-shadow: none;
  }
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-pane-head .study-gloss-toggle:hover,
  .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-pane-head .study-gloss-toggle:focus-visible {
    background: var(--color-interlinear-hover);
    color: var(--color-text);
    border-color: var(--color-border-strong);
  }
  .interlinear-parallel-pane .chapter-reader {
    max-width: none;
    max-height: calc(100vh - 242px);
    overflow: auto;
    padding-right: 0.35rem;
    margin-top: 0.15rem;
  }
  .interlinear-parallel-pane .step-study-select {
    width: auto;
    min-width: 154px;
    max-width: 62%;
    height: 32px;
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    background: var(--color-interlinear-raised);
    border-color: var(--color-interlinear-divider);
  }
  .interlinear-token-inline {
    display: inline;
    cursor: pointer;
    color: var(--color-interlinear-original);
    border-radius: 2px;
    padding: 0 0.05rem;
  }
  .interlinear-token-inline:hover {
    color: var(--color-interlinear-strongs);
    background: var(--color-interlinear-hover);
  }
  .interlinear-missing {
    color: var(--color-interlinear-morphology);
    font-style: italic;
  }
  .interlinear-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
  }
  .interlinear-toolbar-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
    font-weight: 600;
  }
  .interlinear-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    align-items: stretch;
    min-height: 0;
  }
  .interlinear-pane {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: auto;
    min-height: 0;
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-interlinear-raised);
    border-radius: 2px;
    padding: 0.95rem;
    max-height: none;
    overflow: auto;
    min-width: 0;
  }
  .interlinear-pane--original {
    width: 100%;
  }
  .interlinear-pane-label {
    margin: 0;
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-secondary);
    font-weight: 600;
    line-height: 1.3;
  }
  .interlinear-pane-label span {
    display: block;
    margin-top: 0.16rem;
    font-size: 0.62rem;
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--color-interlinear-transliteration);
    font-weight: 400;
  }
  .interlinear-pane-copy {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--color-interlinear-gloss);
    white-space: normal;
  }
  .interlinear-pane-foot {
    margin-top: 0.7rem;
    border-top: 1px dashed var(--color-interlinear-divider);
    padding-top: 0.7rem;
  }
  .interlinear-pane-foot .study-gloss-phrase {
    margin: 0;
    border: 0;
    background: transparent;
    padding: 0;
  }
  .interlinear-pane-foot .study-surface-copy {
    font-size: 0.83rem;
    line-height: 1.58;
    color: var(--color-interlinear-gloss);
  }
  .interlinear-reader {
    margin-top: 0.25rem;
  }
  .study-content-layout.is-interlinear-parallel-view .reader-verse {
    font-size: 1.12rem;
    line-height: 1.96;
    margin: 0 0 0.72rem;
    padding: 0.24rem 0.4rem;
    border-left: 2px solid transparent;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  }
  .study-content-layout.is-interlinear-parallel-view .reader-verse:hover {
    background: var(--color-interlinear-hover);
    border-left-color: var(--color-border-strong);
  }
  .study-content-layout.is-interlinear-parallel-view .reader-verse.is-selected {
    background: var(--color-interlinear-selected);
    border-left-color: var(--color-interlinear-strongs);
    box-shadow: inset 0 0 0 1px var(--color-interlinear-divider);
    padding-left: 0.42rem;
  }
  .study-content-layout.is-interlinear-parallel-view .reader-verse.is-aligned-hover {
    background: var(--color-interlinear-hover);
    border-left-color: var(--color-border-strong);
  }
  .study-content-layout.is-interlinear-parallel-view .reader-verse.is-token-hover {
    box-shadow: inset 0 0 0 1px var(--color-interlinear-divider);
  }
  .study-content-layout.is-interlinear-parallel-view .reader-verse-num {
    margin-right: 0.34rem;
  }
  .study-content-layout.is-interlinear-parallel-view .interlinear-token-inline {
    line-height: 2.1;
    letter-spacing: 0.005em;
  }
  .study-content-layout.is-interlinear-parallel-view .interlinear-missing {
    display: inline-block;
    padding: 0.2rem 0;
  }
  .study-content-layout.is-interlinear-parallel-view.depth-simple .interlinear-guidance {
    color: var(--ink-4);
  }
  .study-content-layout.is-interlinear-parallel-view.depth-simple .interlinear-token-inline {
    opacity: 0.94;
  }
  .study-content-layout.is-interlinear-parallel-view.depth-simple .interlinear-pane-foot {
    display: none;
  }
  .study-content-layout.is-interlinear.depth-simple .interlinear-pane-foot {
    display: none;
  }
  .study-content-layout.is-interlinear-parallel-view.depth-simple .reader-verse {
    line-height: 2.02;
    margin-bottom: 0.76rem;
  }
  .study-content-layout.is-interlinear-parallel-view.depth-simple .interlinear-guidance,
  .study-content-layout.is-interlinear.depth-simple .interlinear-guidance {
    color: var(--ink-4);
  }
  .study-content-layout.is-interlinear-parallel-view.depth-study .reader-verse,
  .study-content-layout.is-interlinear.depth-study .reader-verse {
    line-height: 1.92;
  }
  .study-content-layout.is-interlinear-parallel-view.depth-advanced .interlinear-guidance {
    color: var(--ink-3);
  }
  .study-content-layout.is-interlinear-parallel-view.depth-advanced .reader-verse {
    line-height: 1.98;
  }
  .study-content-layout.is-interlinear-parallel-view.depth-advanced .interlinear-pane-foot .study-surface-copy,
  .study-content-layout.is-interlinear.depth-advanced .interlinear-pane-foot .study-surface-copy {
    font-size: 0.8rem;
    color: var(--ink-2);
  }
  .study-content-layout.is-interlinear.depth-simple .interlinear-inspector .study-panel-block:nth-child(3),
  .study-content-layout.is-interlinear.depth-simple .interlinear-inspector .study-panel-block:nth-child(4),
  .study-content-layout.is-interlinear.depth-simple .interlinear-inspector .study-panel-block:nth-child(5),
  .study-content-layout.is-interlinear.depth-simple .interlinear-inspector details.study-panel-block {
    display: none;
  }
  .interlinear-toolbar .teach-mode-btn {
    min-height: 34px;
    padding: 0 0.62rem;
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: none;
    border-radius: 999px;
    color: var(--ink-3);
  }
  .interlinear-toolbar .teach-mode-btn.active {
    background: var(--color-interlinear-selected);
    color: var(--color-text);
  }
  .interlinear-toolbar .study-tabs {
    border-color: var(--color-interlinear-divider);
    background: var(--color-interlinear-raised);
    min-height: 36px;
    padding: 1px;
  }
  .interlinear-inspector {
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-interlinear-surface);
    border-radius: 2px;
    padding: 1.5rem;
    display: grid;
    gap: 1.35rem;
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 7.5rem);
    overflow: auto;
  }
  .study-surface.is-interlinear-surface {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
    margin-top: 1.4rem;
    box-shadow: 0 14px 32px var(--color-shadow);
  }
  .interlinear-floating-inspector {
    padding-top: 0.6rem;
  }
  .interlinear-floating-inspector-shell .study-panel-block h3 {
    color: var(--ink-3);
  }
  .interlinear-token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
  }
  .interlinear-token-chip {
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-interlinear-token);
    border-radius: 2px;
    padding: 0.45rem 0.55rem;
    text-align: left;
    display: grid;
    gap: 0.2rem;
    cursor: default;
  }
  .interlinear-token-chip strong,
  .interlinear-token-chip .study-original-language-surface {
    font-size: 0.9rem;
    color: var(--color-interlinear-original);
    line-height: 1.2;
  }
  .interlinear-token-chip span,
  .interlinear-token-chip em {
    font-size: 0.72rem;
    color: var(--color-interlinear-transliteration);
    font-style: normal;
    line-height: 1.45;
  }
  .interlinear-token-chip.study-original-language--hebrew,
  .interlinear-token-chip.study-original-language--aramaic {
    align-items: flex-end;
  }
  .interlinear-token-chip.study-original-language-token--interactive {
    cursor: pointer;
  }
  .interlinear-token-chip.is-token-hover,
  .interlinear-token-chip:focus-visible {
    background: var(--color-interlinear-hover);
  }
  .interlinear-token-chip:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }
  .chapter-reader {
    margin-bottom: 0;
    max-width: 940px;
  }
  .chapter-reader.interlinear-reader > .interlinear-split {
    margin-bottom: 1.15rem;
  }
  .study-mode-panel {
    border: 1px solid var(--parchment-3);
    background: var(--parchment-2);
    border-radius: 2px;
    padding: 2rem;
    display: grid;
    gap: 2rem;
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 7.5rem);
    overflow: auto;
    width: 100%;
    min-width: 0;
  }
  .study-panel-block {
    display: grid;
    gap: 0.8rem;
  }
  .study-search-preview-shell {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .study-experience-shell {
    gap: 0;
  }
  .study-content-layout.is-study-experience {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .study-experience-stage {
    min-width: 0;
    width: 100%;
  }
  .study-experience-root {
    min-width: 0;
    width: 100%;
  }
  .study-experience {
    display: grid;
    gap: 1rem;
    min-width: 0;
  }
  .study-experience [data-study-resource] {
    scroll-margin-top: 128px;
  }
  .study-experience-header {
    display: grid;
    gap: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 0;
  }
  .study-experience-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .study-experience-topbar .study-workspace-tabs {
    flex: 1 1 auto;
  }
  .study-version-control {
    flex: 0 0 auto;
    min-width: 150px;
    margin-left: auto;
  }
  .study-version-control .study-version-select,
  .study-version-select {
    width: 100%;
    min-height: 44px;
  }
  .study-current-stage,
  .study-search-stage,
  .study-selected-stage {
    display: grid;
    gap: 1rem;
    min-width: 0;
  }
  .study-theme-article-stage {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
  }
  .study-current-heading,
  .study-search-heading {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
  }
  .study-current-title,
  .study-search-title {
    margin: 0;
    color: var(--ink);
    line-height: 1.08;
    font-size: clamp(1.9rem, 2.9vw, 3rem);
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.02em;
    max-width: 18ch;
  }
  .study-current-chapter {
    margin: 0;
    color: var(--ink-3);
    font-size: 1rem;
    line-height: 1.5;
  }
  .study-theme-article-list {
    list-style: none;
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
  }
  .study-theme-article-list-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0 0.75rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-theme-article-list-item:first-child {
    border-top: 0;
    padding-top: 0;
  }
  .study-theme-article-list-copy {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
  }
  .study-theme-article-list-title {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.4;
    color: var(--ink);
  }
  .study-theme-article-list-ref {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .study-theme-article-list-reason {
    margin: 0;
    color: var(--ink-3);
    font-size: 0.76rem;
    line-height: 1.45;
  }
  .study-theme-article-open {
    flex: 0 0 auto;
    align-self: center;
  }
  .study-theme-article-summary {
    display: grid;
    gap: 0.8rem;
  }
  .study-theme-article-summary-action {
    margin: 0;
  }
  .study-theme-article-topbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
  }
  .study-theme-article-card {
    display: grid;
    gap: 0.95rem;
  }
  .study-theme-article-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.95rem;
    flex-wrap: wrap;
  }
  .study-theme-article-title {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 600;
    font-size: clamp(1.6rem, 2.4vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    max-width: 18ch;
  }
  .study-theme-article-meta {
    display: grid;
    gap: 0.25rem;
    justify-items: end;
    min-width: 0;
    text-align: right;
  }
  .study-theme-article-reference {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .study-theme-article-source {
    margin: 0;
    color: var(--ink-4);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-theme-article-body-shell {
    display: grid;
    gap: 0.75rem;
  }
  .study-theme-article-body {
    display: grid;
    gap: 0.8rem;
    min-width: 0;
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.84;
  }
  .study-theme-article-paragraph {
    margin: 0;
  }
  .study-theme-article-paragraph.is-lead {
    font-size: 1.02rem;
  }
  .study-theme-article-paragraph.is-spaced {
    margin-top: 0.2rem;
  }
  .study-theme-article-heading {
    margin: 0.45rem 0 0;
    color: var(--ink);
    font-size: 1.12rem;
    line-height: 1.35;
    font-weight: 700;
  }
  .study-theme-article-refs-title,
  .study-theme-article-refs {
    margin: 0;
    color: var(--ink-3);
    font-size: 0.74rem;
    line-height: 1.6;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .study-theme-article-list,
  .study-theme-article-body .study-theme-article-list {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
  }
  .study-theme-article-list-item {
    margin: 0;
  }
  .study-theme-article-footer {
    display: grid;
    gap: 0.25rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-theme-article-provenance {
    margin: 0;
    color: var(--ink-4);
    font-size: 0.76rem;
    line-height: 1.6;
  }
  @media (max-width: 900px) {
  }
  @media (max-width: 680px) {
    .study-theme-article-header {
      flex-direction: column;
    }
    .study-theme-article-meta {
      justify-items: start;
      text-align: left;
    }
    .study-theme-article-list-item {
      flex-direction: column;
      align-items: flex-start;
    }
    .study-theme-article-open {
      align-self: flex-start;
    }
  }
  .study-theme-link {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
  }
  .study-theme-link:hover {
    color: var(--olive-light);
  }
  .study-theme-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 0.15rem;
  }
  .study-theme-link-unavailable {
    color: var(--ink-4);
    text-decoration: none;
    cursor: default;
  }
  .study-theme-hebrew,
  .study-theme-greek {
    font-family: var(--serif);
    font-size: 1.03em;
  }
  .study-original-language {
    font-family: var(--serif);
    font-size: 1.03em;
    line-height: 1.82;
    letter-spacing: 0.01em;
    word-spacing: 0.08em;
    unicode-bidi: isolate;
    text-rendering: optimizeLegibility;
  }
  .study-original-language--line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.22rem 0.5rem;
    align-items: baseline;
    width: 100%;
  }
  .study-original-language--hebrew,
  .study-original-language--aramaic {
    direction: rtl;
    text-align: right;
  }
  .study-original-language--greek {
    direction: ltr;
    text-align: left;
  }
  .study-original-language-token {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    min-width: 0;
    margin: 0;
    color: inherit;
  }
  .study-original-language-token--static {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .study-original-language-token--interactive {
    padding: 0.14rem 0.16rem;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 0.2rem;
    font: inherit;
  }
  .study-original-language-token--interactive:hover,
  .study-original-language-token.is-token-hover {
    background: var(--color-interlinear-hover);
  }
  .study-original-language-token--interactive:focus-visible {
    background: var(--color-interlinear-hover);
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }
  .study-original-language-token.is-selected {
    background: var(--color-interlinear-selected);
    box-shadow: inset 0 0 0 1px var(--color-interlinear-divider);
  }
  .study-original-language-token--hebrew,
  .study-original-language-token--aramaic {
    align-items: flex-end;
  }
  .study-original-language-surface {
    display: block;
    font-size: 1.04em;
    line-height: 1.24;
    color: var(--color-interlinear-original);
  }
  .study-original-language-gloss,
  .study-original-language-transliteration,
  .study-original-language-lemma,
  .study-original-language-strongs,
  .study-original-language-morphology {
    display: block;
    font-size: 0.76rem;
    line-height: 1.32;
    color: var(--color-interlinear-transliteration);
  }
  .study-original-language-strongs {
    color: var(--color-interlinear-strongs);
  }
  .study-original-language-morphology {
    color: var(--color-interlinear-morphology);
  }
  .study-original-language-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
  }
  .study-original-language-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.35rem 0.55rem;
    padding: 0.05rem 0;
  }
  .study-original-language-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.45rem;
    align-items: baseline;
    color: var(--color-interlinear-morphology);
    font-size: 0.75rem;
    line-height: 1.3;
  }
  .study-theme-divine-name {
    font-variant: small-caps;
    letter-spacing: 0.02em;
  }
  .study-experience-titleblock {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
  }
  .study-experience-kicker,
  .study-workspace-kicker {
    margin: 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-experience-titleblock h3,
  .study-workspace-title,
  .study-result-title,
  .study-rail-card-head h5 {
    margin: 0;
    color: var(--ink);
    line-height: 1.25;
  }
  .study-experience-titleblock h3,
  .study-workspace-title {
    font-size: 1.35rem;
  }
  .study-result-title {
    font-size: 1rem;
  }
  .study-experience-subtitle,
  .study-experience-context,
  .study-workspace-copy,
  .study-search-help,
  .study-search-status,
  .study-search-empty,
  .study-search-range,
  .study-rail-empty,
  .study-rail-copy,
  .study-rail-meta {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--ink-2);
  }
  .study-experience-context {
    color: var(--ink-3);
  }
  .study-workspace-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .study-workspace-tab {
    min-height: 44px;
    padding: 0.52rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--parchment-3);
    background: var(--parchment);
    color: var(--ink-2);
    font: 600 0.78rem var(--sans);
    letter-spacing: 0.02em;
    cursor: pointer;
  }
  .study-workspace-tab.active {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--parchment);
  }
  .study-workspace-tab[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
  }
  .study-navigation-trigger,
  .study-navigation-mobile-callup {
    display: none;
  }
  .study-navigation-fab {
    display: none;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.48rem 0.85rem;
    border: 1px solid var(--parchment-3);
    border-radius: 999px;
    background: var(--parchment);
    color: var(--ink-2);
    font: 600 0.78rem var(--sans);
    cursor: pointer;
    box-shadow: none;
  }
  .study-navigation-fab {
    min-width: 128px;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(15, 13, 10, 0.16);
  }
  .study-navigation-fab-arrow {
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 700;
  }
  .study-navigation-trigger svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .study-experience-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(320px, 1fr);
    gap: 1rem;
    min-width: 0;
    align-items: start;
  }
  .study-experience-grid.is-results-only {
    grid-template-columns: minmax(0, 1fr);
  }
  .study-experience-main,
  .study-experience-rail {
    min-width: 0;
    display: grid;
    gap: 1rem;
  }
  .study-current-stack {
    display: grid;
    gap: 1rem;
  }
  .study-workspace-card,
  .study-rail-card {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: var(--parchment);
  }
  .study-workspace-card-head,
  .study-rail-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .study-workspace-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
.study-current-overview-card {
  gap: 0.85rem;
  padding-top: 1rem;
}

/* Bible Appearance Phase 1. Reading-only typography and shared controls. */
#page-teachings.active .reading-passage {
  --keryg-reading-text-scale: 1;
}

#page-teachings.active .reading-passage.paragraph .reader-paragraph {
  font-size: calc(1.2rem * var(--keryg-reading-text-scale, 1));
}

#page-teachings.active .reading-passage.verse .reader-verse {
  font-size: calc(1.22rem * var(--keryg-reading-text-scale, 1));
}

#page-teachings.active .bible-appearance-trigger {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.55rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 10px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  cursor: pointer;
  font: 700 0.82rem/1 var(--sans);
  letter-spacing: -0.04em;
}

#page-teachings.active .bible-appearance-trigger:hover,
#page-teachings.active .bible-appearance-trigger:focus-visible {
  border-color: var(--color-brand);
  background: var(--color-surface-muted);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

#page-teachings.active .bible-appearance-backdrop[hidden],
#page-teachings.active .bible-appearance-panel[hidden],
#page-teachings.active .bible-appearance-floating[hidden] { display: none !important; }

#page-teachings.active .bible-appearance-backdrop {
  position: fixed;
  inset: 0;
  z-index: 370;
  border: 0;
  background: var(--color-overlay);
}

#page-teachings.active .bible-appearance-panel {
  position: fixed;
  z-index: 380;
  width: min(280px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid var(--color-border-strong);
  border-radius: 12px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  box-shadow: 0 14px 34px var(--color-shadow);
}

#page-teachings.active .bible-appearance-panel.is-mobile-sheet {
  top: auto !important;
  right: 0;
  bottom: 0;
  left: 0 !important;
  width: 100%;
  max-width: 100vw;
  max-height: min(55dvh, 430px);
  overflow: auto;
  padding-bottom: env(safe-area-inset-bottom);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 14px 14px 0 0;
}

#page-teachings.active .bible-appearance-sheet-handle {
  display: none;
  justify-content: center;
  padding: 0.55rem 0 0.2rem;
}

#page-teachings.active .bible-appearance-sheet-handle span {
  width: 2.5rem;
  height: 0.22rem;
  border-radius: 999px;
  background: var(--color-border-strong);
}

#page-teachings.active .bible-appearance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
}

#page-teachings.active .bible-appearance-head h2 {
  margin: 0;
  color: var(--color-text-heading);
  font: 700 1rem/1.25 var(--serif);
}

#page-teachings.active .bible-appearance-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: 400 1.45rem/1 var(--sans);
}

#page-teachings.active .bible-appearance-close:hover,
#page-teachings.active .bible-appearance-close:focus-visible {
  background: var(--color-surface-muted);
  color: var(--color-text);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

#page-teachings.active .bible-appearance-body { display: grid; gap: 1rem; padding: 1rem; }
#page-teachings.active .bible-appearance-field { display: grid; gap: 0.55rem; }
#page-teachings.active .bible-appearance-label {
  margin: 0;
  color: var(--color-text-secondary);
  font: 700 0.68rem/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.active .bible-appearance-size-options {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 0.35rem;
}

#page-teachings.active .bible-appearance-size-option,
#page-teachings.active .bible-appearance-reset {
  min-height: 42px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  cursor: pointer;
  font: 700 0.78rem/1 var(--sans);
}

#page-teachings.active .bible-appearance-size-option:hover,
#page-teachings.active .bible-appearance-size-option:focus-visible,
#page-teachings.active .bible-appearance-reset:hover,
#page-teachings.active .bible-appearance-reset:focus-visible {
  border-color: var(--color-brand);
  color: var(--color-text);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

#page-teachings.active .bible-appearance-size-option.is-active {
  border-color: var(--color-brand);
  background: color-mix(in srgb, var(--color-brand) 12%, var(--color-surface-raised));
  color: var(--color-text-heading);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-brand) 25%, transparent);
}

#page-teachings.active .bible-appearance-reset { width: 100%; background: transparent; font-weight: 600; }
#page-teachings.active .bible-appearance-reset:disabled {
  border-color: var(--color-border);
  color: var(--color-text-muted);
  cursor: default;
  opacity: 0.66;
}

#page-teachings.active .bible-appearance-floating {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 300;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--color-text);
  box-shadow: 0 8px 22px var(--color-shadow);
  cursor: pointer;
  font: 700 0.84rem/1 var(--sans);
  letter-spacing: -0.04em;
}

#page-teachings.active .bible-appearance-floating:hover,
#page-teachings.active .bible-appearance-floating:focus-visible {
  border-color: var(--color-brand);
  background: var(--color-surface-muted);
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

@media (max-width: 1099px) {
  #page-teachings.active .bible-appearance-trigger { display: none; }
  #page-teachings.active .bible-appearance-sheet-handle { display: flex; }
}

/* Reading presentation controls and the compact Paragraph layout. The
   existing separated verse renderer and all Study/Interlinear readers stay
   outside these selectors. */
#page-teachings.active .reader-layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: min(100%, 860px);
  max-width: 860px;
  margin: 0 auto 0.85rem;
  padding-inline: clamp(20px, 4vw, 56px);
  box-sizing: border-box;
}

#page-teachings.active .reader-layout-label {
  color: var(--ink-4);
  font: 700 0.68rem/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.active .reader-layout-selector {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface-muted);
}

#page-teachings.active .reader-layout-option {
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text-secondary);
  font: 700 0.74rem/1 var(--sans);
  cursor: pointer;
}

#page-teachings.active .reader-layout-option:hover,
#page-teachings.active .reader-layout-option:focus-visible {
  color: var(--color-text);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

#page-teachings.active .reader-layout-option.is-active {
  background: var(--color-brand);
  color: var(--color-surface-inverse);
  box-shadow: 0 4px 12px var(--color-shadow);
}

#page-teachings.active .reading-passage.paragraph .reader-paragraph {
  max-width: 72ch;
  margin-inline: auto;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.82;
  letter-spacing: 0.002em;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline {
  display: inline;
  margin: 0;
  padding: 0.04rem 0.08rem;
  border-radius: 0.28rem;
  cursor: default;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline:hover {
  background: transparent;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  background: var(--color-scripture-highlight);
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline.is-selected {
  padding-left: 0.16rem;
  padding-right: 0.16rem;
  background: var(--color-scripture-current);
  box-shadow: inset 0 0 0 1px rgba(160, 82, 45, 0.14);
}

#page-teachings.active .reader-verse-number-target {
  display: inline;
  margin: 0 0.22rem 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font: 700 0.68rem/1 var(--sans);
  letter-spacing: 0.08em;
  vertical-align: super;
  cursor: pointer;
  user-select: none;
}

#page-teachings.active .reader-verse-number-target:hover,
#page-teachings.active .reader-verse-number-target:focus-visible {
  color: var(--color-brand);
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

#page-teachings.active .reader-verse-text {
  user-select: text;
}

#page-teachings.active .reading-selected-reference-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

#page-teachings.active .reading-selected-reference-actions .teach-tool-btn,
#page-teachings.active .reading-selected-reference-back .teach-tool-btn {
  min-height: 38px;
}

#page-teachings.active .reading-selected-reference-status {
  min-height: 1.25rem;
  margin: 0.65rem 0 0;
  color: var(--ink-4);
  font-size: 0.76rem;
}

@media (max-width: 767px) {
  #page-teachings.active .reader-layout-toolbar {
    width: 100%;
    max-width: none;
    margin-bottom: 0.65rem;
    padding-inline: clamp(20px, 5vw, 28px);
  }

  #page-teachings.active .reading-passage.paragraph .reader-paragraph {
    font-size: 1.08rem;
    line-height: 1.78;
  }
}

/* Conditional Reader provenance row. It is omitted from the DOM for direct
   Reader entry, so ordinary Reading and Interlinear layouts do not gain a
   placeholder or additional header height. */
#page-teachings .reader-context-nav {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  min-height: 44px;
  margin: .2rem 0 .1rem;
  padding: .1rem .2rem 0;
  color: var(--ink-3);
  font-size: .75rem;
  line-height: 1.3;
}

#page-teachings .reader-context-back {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  gap: .3rem;
  border: 1px solid var(--parchment-3);
  border-radius: 999px;
  padding: 0 .7rem;
  background: var(--parchment);
  color: var(--ink-2);
  cursor: pointer;
  font: 600 .74rem/1 var(--sans);
  white-space: nowrap;
}

#page-teachings .reader-context-back:hover,
#page-teachings .reader-context-back:focus-visible {
  border-color: rgba(160, 82, 45, .35);
  background: var(--parchment-2);
  color: var(--ink);
}

#page-teachings .reader-context-back:focus-visible {
  outline: 2px solid rgba(160, 82, 45, .5);
  outline-offset: 2px;
}

#page-teachings .reader-context-trail {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1023px) {
  #page-teachings .reader-context-nav {
    margin-inline: 0;
    padding-inline: .1rem;
  }
}

/* Phase 9B: the Interlinear inspector is one continuous learning surface.
   Its content is grouped by hierarchy rather than repeated in separate cards. */
.interlinear-floating-inspector-shell {
  gap: 0;
}
.interlinear-inspector-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--color-interlinear-divider);
}
.interlinear-inspector-context .study-inspector-kicker {
  color: var(--ink-2);
  font-size: 0.72rem;
}
.interlinear-inspector-selection-type,
.interlinear-inspector-help,
.interlinear-inspector-note {
  margin: 0.2rem 0 0;
  color: var(--ink-4);
  font-size: 0.78rem;
  line-height: 1.55;
}
.interlinear-inspector-language {
  flex: 0 0 auto;
  padding-top: 0.06rem;
  color: var(--color-interlinear-original);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.interlinear-inspector-primary,
.interlinear-inspector-reading,
.interlinear-inspector-phrase {
  display: grid;
  gap: 0.3rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-interlinear-divider);
}
.interlinear-inspector-eyebrow,
.interlinear-inspector-field-label {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.interlinear-inspector-primary h2,
.interlinear-inspector-reading h2,
.interlinear-inspector-phrase h2 {
  margin: 0;
  color: var(--color-interlinear-original);
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.interlinear-inspector-reading h2 {
  color: var(--ink);
  font-size: 1.05rem;
  font-family: inherit;
  letter-spacing: 0.02em;
  text-transform: none;
}
.interlinear-inspector-transliteration,
.interlinear-inspector-phrase-original {
  margin: 0;
  color: var(--color-interlinear-transliteration);
  font-size: 0.85rem;
  line-height: 1.45;
}
.interlinear-inspector-facts {
  display: grid;
  gap: 0.52rem;
  margin: 0.55rem 0 0;
}
.interlinear-inspector-facts > div {
  display: grid;
  grid-template-columns: minmax(5.5rem, 0.38fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: baseline;
}
.interlinear-inspector-facts dt {
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 700;
}
.interlinear-inspector-facts dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.interlinear-inspector-facts .interlinear-inspector-fact--secondary dd,
.interlinear-inspector-fact--secondary dd {
  color: var(--ink-3);
  font-size: 0.76rem;
}
.interlinear-inspector-secondary {
  display: block;
  color: var(--color-interlinear-transliteration);
  font-size: 0.76rem;
  font-weight: 400;
}
.interlinear-inspector-section {
  display: grid;
  gap: 0.62rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--color-interlinear-divider);
}
.interlinear-inspector-section h3 {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.interlinear-inspector-context-section .study-surface-copy {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.88rem;
  line-height: 1.7;
}
.interlinear-inspector-navigation .interlinear-token-grid {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 0.38rem;
}
.interlinear-inspector-navigation .interlinear-token-chip {
  min-width: 0;
  min-height: 3rem;
  padding: 0.42rem 0.48rem;
  gap: 0.12rem;
  background: transparent;
  cursor: pointer;
}
.interlinear-inspector-navigation .interlinear-token-chip strong {
  font-size: 0.92rem;
}
.interlinear-inspector-navigation .interlinear-token-chip span {
  overflow: hidden;
  color: var(--ink-4);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.interlinear-inspector-navigation .interlinear-token-chip.is-selected,
.interlinear-inspector-navigation .interlinear-token-chip[aria-pressed="true"] {
  border-color: var(--color-interlinear-strongs);
  background: var(--color-interlinear-selected);
  box-shadow: inset 0 0 0 1px var(--color-interlinear-strongs);
}
.interlinear-inspector-navigation .interlinear-token-chip:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}
.interlinear-inspector-phrase h2 {
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
}
.interlinear-inspector-definition {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.interlinear-inspector-disclosure {
  border-top: 1px solid var(--color-interlinear-divider);
  padding-top: 0.62rem;
}
.interlinear-inspector-disclosure summary {
  color: var(--ink-2);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}
.interlinear-inspector-disclosure summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
.interlinear-inspector-lexicon-more p {
  margin: 0.65rem 0 0;
  color: var(--ink-3);
  font-size: 0.8rem;
  line-height: 1.62;
  max-width: 42rem;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.interlinear-inspector-lexicon-more[open] {
  margin-top: 0.1rem;
}
.interlinear-inspector-disclosure-hint {
  margin: 0.65rem 0 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.5;
}
.interlinear-inspector-comparison {
  border-bottom: 0;
}
.interlinear-inspector-comparison .study-compare-grid {
  margin-top: 0.7rem;
  gap: 0.65rem;
}
.interlinear-inspector-comparison .study-compare-card {
  border-radius: 10px;
  padding: 0.72rem 0.8rem 0.8rem;
  box-shadow: none;
}
.interlinear-inspector-sources {
  border-bottom: 0;
}
.interlinear-inspector-source-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
}
.interlinear-inspector-source-list > div {
  display: grid;
  grid-template-columns: minmax(7rem, 0.75fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: baseline;
}
.interlinear-inspector-source-list dt,
.interlinear-inspector-source-list dd {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.interlinear-inspector-source-list dt {
  color: var(--ink-4);
}
.interlinear-inspector-source-list dd {
  color: var(--ink-3);
}

@media (min-width: 1280px) {
  #page-teachings .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) {
    grid-template-columns: minmax(0, 1fr) clamp(320px, 28vw, 420px);
  }
}

@media (max-width: 1023px) {
  #page-teachings.active .interlinear-inspector-mobile-sheet-body .interlinear-floating-inspector-shell {
    gap: 0;
  }
  #page-teachings.active .interlinear-inspector-mobile-sheet-body .interlinear-inspector-primary,
  #page-teachings.active .interlinear-inspector-mobile-sheet-body .interlinear-inspector-reading,
  #page-teachings.active .interlinear-inspector-mobile-sheet-body .interlinear-inspector-phrase {
    padding-top: 0.7rem;
  }
  #page-teachings.active .interlinear-inspector-mobile-sheet-body .interlinear-inspector-primary h2 {
    font-size: clamp(1.85rem, 10vw, 2.5rem);
  }
}

@media (max-width: 680px) {
  .interlinear-inspector-facts > div,
  .interlinear-inspector-source-list > div {
    grid-template-columns: minmax(5.4rem, 0.5fr) minmax(0, 1fr);
  }
  .interlinear-inspector-navigation .interlinear-token-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #page-teachings .reader-context-nav {
    margin: .15rem 0 .05rem;
    padding-inline: .15rem;
  }

  #page-teachings .reader-context-back {
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #page-teachings .reader-context-back span {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.study-book-overview-copy-wrap {
  display: grid;
  gap: 0.7rem;
}
.study-book-overview-copy {
  margin: 0;
  max-width: 64ch;
  font-size: 0.95rem;
  line-height: 1.78;
  color: var(--ink-2);
  text-wrap: pretty;
}
.study-book-overview-copy.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.study-book-overview-copy.is-expanded {
  display: block;
}
.study-book-overview-toggle {
  justify-self: start;
}
.study-current-overview-card .study-overview-meta {
  margin: 0;
  font-size: 0.84rem;
  color: var(--ink-3);
}
  .study-outline-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.7rem;
    color: var(--ink-2);
    line-height: 1.65;
    font-size: 0.92rem;
  }
  .study-outline-index {
    margin-right: 0.35rem;
    color: var(--ink-4);
  }
  .study-chip-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
  }
  .study-chip-list li {
    display: inline-flex;
  }
  .study-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.2rem 0.68rem;
    border: 1px solid var(--parchment-3);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
    color: var(--ink-2);
    font-size: 0.8rem;
  }
  .study-selected-card {
    gap: 0.95rem;
    padding: 1.1rem;
    border-color: color-mix(in srgb, var(--ink) 14%, var(--parchment-3) 86%);
    background: linear-gradient(180deg, color-mix(in srgb, var(--parchment) 98%, var(--ink) 2%), color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%));
  }
  .study-selected-heading {
    display: grid;
    gap: 0.85rem;
    align-items: start;
  }
  .study-selected-heading-side {
    display: grid;
    gap: 0.7rem;
  }
  .study-selected-lexical-meta {
    margin-top: 0.25rem;
  }
  .study-selected-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
  }
  .study-selected-back-passage {
    margin-left: auto;
  }
  .study-selected-hero {
    display: grid;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--parchment) 86%, var(--ink) 14%);
  }
  .study-selected-translation-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .study-selected-translation-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.95rem 1rem 1rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: var(--parchment);
  }
  .study-selected-translation-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
  }
  .study-selected-translation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.1rem 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid var(--parchment-3);
    background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
    color: var(--ink-2);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .study-selected-translation-type {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-4);
  }
  .study-selected-verse {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.8;
    color: var(--ink);
  }
  .study-selected-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
  }
  .study-selected-reference {
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink);
  }
  .study-selected-availability {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--parchment-3);
    background: var(--parchment);
    color: var(--ink-3);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .study-selected-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.1rem;
  }
  .study-session-summary {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .study-session-summary div {
    display: grid;
    gap: 0.2rem;
    padding: 0.7rem 0.8rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--parchment) 78%, var(--ink) 22%);
    border: 1px solid var(--parchment-3);
  }
  .study-session-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-workspace-note {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem 0.9rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--parchment) 80%, var(--ink) 20%);
    border: 1px solid var(--parchment-3);
  }
  .study-workspace-note strong {
    color: var(--ink);
    line-height: 1.35;
  }
  .study-search-form {
    display: grid;
    gap: 0.7rem;
  }
  .study-search-topbar {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.75rem;
  }
  .study-search-topbar .study-search-view-switcher,
  .study-selected-topbar .study-search-view-switcher {
    flex: 1 1 auto;
    min-width: 0;
  }
  .study-search-topbar .study-search-back {
    margin-left: auto;
  }
  .study-search-heading {
    gap: 0.1rem;
  }
  .study-search-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-search-query-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  .study-search-query-shell {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1 1 320px;
    min-height: 44px;
    padding: 0 0.85rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: var(--parchment);
  }
  .study-search-query-shell:focus-within {
    border-color: color-mix(in srgb, var(--ink) 20%, var(--parchment-3) 80%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent);
  }
  .study-search-query-icon {
    color: var(--ink-3);
    font-size: 1rem;
    line-height: 1;
    flex: 0 0 auto;
  }
  .study-search-query {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    border: 0;
    background: transparent;
    padding-inline: 0;
  }
  .study-search-submit,
  .study-search-clear,
  .study-search-save,
  .study-workspace-back,
  .study-result-open {
    min-height: 44px;
  }
  .study-search-toolbar {
    display: grid;
    gap: 0.75rem;
  }
  .study-search-translation-control {
    flex: 0 0 160px;
    min-width: 160px;
  }
  .study-search-filters-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 0.7rem;
    align-items: end;
  }
  .study-search-clear-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 44px;
  }
  .study-search-control {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
  }
  .study-search-control > span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-search-filters-bar .study-search-mode-control,
  .study-search-filters-bar .study-search-translation-control {
    min-width: 0;
    flex: none;
  }
  .study-search-filters-bar .study-search-mode-control-wrap,
  .study-search-filters-bar .step-study-select {
    width: 100%;
  }
  .study-search-filters {
    border: 1px solid var(--parchment-3);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
    padding: 0.6rem 0.7rem;
  }
  .study-search-filters-summary {
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-2);
  }
  .study-search-filters-grid {
    display: grid;
    gap: 0.7rem;
    margin-top: 0.65rem;
  }
  .study-search-summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
  }
  .study-search-summary-count {
    margin: 0;
    color: var(--ink);
    font-size: 1.3rem;
    line-height: 1.2;
    font-weight: 700;
  }
  .study-search-summary-range {
    margin: 0.25rem 0 0;
    color: var(--ink-2);
    font-size: 0.9rem;
    line-height: 1.5;
  }
  .study-search-recent {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--parchment-3);
    border-bottom: 1px solid var(--parchment-3);
    background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
  }
  .study-search-recent-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
  }
  .study-search-recent-summary::-webkit-details-marker {
    display: none;
  }
  .study-search-recent-title {
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .study-search-recent-count,
  .study-search-recent-meta {
    color: var(--ink-3);
    font-size: 0.78rem;
  }
  .study-search-recent-body {
    display: grid;
    gap: 0.65rem;
  }
  .study-search-recent-list {
    display: grid;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-search-recent-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.35rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 72%, transparent);
  }
  .study-search-recent-item:last-child {
    border-bottom: 0;
  }
  .study-search-recent-query,
  .study-search-recent-remove,
  .study-search-recent-clear {
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font: 600 0.86rem var(--sans);
    cursor: pointer;
  }
  .study-search-recent-query {
    min-width: 0;
    padding: 0.35rem 0;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .study-search-recent-query:hover,
  .study-search-recent-query:focus-visible {
    color: var(--ink);
    text-decoration: underline;
  }
  .study-search-recent-remove,
  .study-search-recent-clear {
    color: var(--ink-3);
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
  }
  .study-search-recent-remove:hover,
  .study-search-recent-remove:focus-visible,
  .study-search-recent-clear:hover,
  .study-search-recent-clear:focus-visible {
    color: var(--ink);
    text-decoration: underline;
  }
  .study-search-recent-clear {
    justify-self: start;
    padding: 0.2rem 0;
  }
  .study-search-save {
    white-space: nowrap;
  }
  .study-search-save[disabled] {
    cursor: default;
    opacity: 0.72;
  }
  .study-search-saved {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--parchment-3);
    border-bottom: 1px solid var(--parchment-3);
    background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
  }
  .study-search-saved-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
  }
  .study-search-saved-summary::-webkit-details-marker {
    display: none;
  }
  .study-search-saved-title {
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .study-search-saved-count,
  .study-search-saved-meta {
    color: var(--ink-3);
    font-size: 0.78rem;
  }
  .study-search-saved-body {
    display: grid;
    gap: 0.65rem;
  }
  .study-search-saved-notice {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.82rem;
    line-height: 1.45;
  }
  .study-search-saved-list {
    display: grid;
    gap: 0.15rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-search-saved-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.35rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 72%, transparent);
  }
  .study-search-saved-item:last-child {
    border-bottom: 0;
  }
  .study-search-saved-query,
  .study-search-saved-remove {
    border: 0;
    background: transparent;
    color: var(--ink-2);
    font: 600 0.86rem var(--sans);
    cursor: pointer;
  }
  .study-search-saved-query {
    min-width: 0;
    padding: 0.35rem 0;
    overflow-wrap: anywhere;
    text-align: left;
  }
  .study-search-saved-query:hover,
  .study-search-saved-query:focus-visible,
  .study-search-saved-remove:hover,
  .study-search-saved-remove:focus-visible {
    color: var(--ink);
    text-decoration: underline;
  }
  .study-search-saved-remove {
    color: var(--ink-3);
    font-size: 0.75rem;
    font-weight: 650;
    white-space: nowrap;
  }
  .study-search-insights {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.9rem;
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--parchment-3);
    border-bottom: 1px solid var(--parchment-3);
    background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
  }
  .study-search-insights-summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
  }
  .study-search-insights-summary::-webkit-details-marker {
    display: none;
  }
  .study-search-insights-title {
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .study-search-insights-summary-meta {
    color: var(--ink-3);
    font-size: 0.78rem;
  }
  .study-search-insights-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem 0.75rem;
    margin: 0;
  }
  .study-search-insight {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
  }
  .study-search-insight dt {
    color: var(--ink-3);
    font-size: 0.72rem;
    line-height: 1.35;
  }
  .study-search-insight dd {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.25;
  }
  .study-search-results {
    display: grid;
    gap: 0.8rem;
  }
  .study-result-card {
    display: grid;
    gap: 0.7rem;
    padding: 0.9rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
  }
  .study-result-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.65rem;
  }
  .study-result-meta {
    margin: 0.2rem 0 0;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-4);
  }
  .study-translation-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .study-translation-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0.1rem 0.52rem;
    border-radius: 0.55rem;
    border: 1px solid var(--parchment-3);
    background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
    color: var(--ink-2);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
  }
  .study-result-matches {
    display: grid;
    gap: 0.7rem;
  }
  .study-result-match {
    display: grid;
    gap: 0.35rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-result-match-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.72rem;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .study-result-verse {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--ink);
  }
  .study-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    padding-top: 0.65rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-result-action {
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
  }
  .study-result-related {
    display: grid;
    gap: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-result-related-toggle,
  .study-result-related-more {
    justify-self: start;
    min-height: 34px;
    padding: 0.4rem 0.65rem;
    font-size: 0.76rem;
  }
  .study-result-related-body {
    display: grid;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-left: 2px solid var(--parchment-3);
    background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
  }
  .study-result-related-list {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-result-related-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
  }
  .study-result-related-reference {
    min-width: 0;
    color: var(--ink-2);
    font-size: 0.82rem;
    line-height: 1.45;
  }
  .study-result-related-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .study-result-related-action {
    min-height: 32px;
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
  }
  .study-result-related-status,
  .study-result-related-source {
    margin: 0;
    color: var(--ink-3);
    font-size: 0.78rem;
    line-height: 1.5;
  }
  .study-result-context {
    display: grid;
    gap: 0.65rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-result-context-heading,
  .study-result-context-status {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.78rem;
    line-height: 1.5;
  }
  .study-result-context-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-result-context-item {
    display: grid;
    gap: 0.18rem;
    padding: 0.55rem 0.65rem;
    border-left: 2px solid var(--parchment-3);
  }
  .study-result-context-item.is-selected {
    border-left-color: var(--accent);
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-result-context-reference {
    color: var(--ink-2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .study-result-context-text {
    color: var(--ink);
    font-size: 0.9rem;
    line-height: 1.65;
  }
  .study-result-context-reading {
    justify-self: start;
    color: var(--ink-2);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16em;
  }
  .study-result-comparison {
    display: grid;
    gap: 0.65rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-result-comparison-heading,
  .study-result-comparison-status {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.78rem;
    line-height: 1.5;
  }
  .study-result-comparison-list {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-result-comparison-row {
    display: grid;
    gap: 0.25rem;
    padding: 0.6rem 0.7rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.65rem;
    background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
  }
  .study-result-comparison-row.is-unavailable {
    background: transparent;
  }
  .study-result-comparison-row-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
  }
  .study-result-comparison-label {
    color: var(--ink-2);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
  }
  .study-result-comparison-source {
    color: var(--ink-4);
    font-size: 0.68rem;
  }
  .study-result-comparison-text,
  .study-result-comparison-note {
    margin: 0;
    color: var(--ink);
    font-size: 0.88rem;
    line-height: 1.6;
  }
  .study-result-comparison-note {
    color: var(--ink-3);
  }
  .study-result-comparison-more {
    justify-self: start;
    min-height: 34px;
    padding: 0.4rem 0.65rem;
    font-size: 0.76rem;
  }
  .study-reference-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.34fr);
    gap: 1rem;
    align-items: start;
    min-width: 0;
  }
  .study-reference-main,
  .study-reference-rail {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
  }
  .study-reference-identity,
  .study-reference-section,
  .study-reference-rail-section {
    display: grid;
    gap: 0.85rem;
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
  }
  .study-reference-identity {
    gap: 0;
    overflow: hidden;
  }
  .study-reference-identity-head,
  .study-reference-section-head,
  .study-reference-rail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    min-width: 0;
  }
  .study-reference-title,
  .study-reference-section-head h4,
  .study-reference-rail-head h4 {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.015em;
  }
  .study-reference-title {
    font-size: clamp(1.65rem, 2.5vw, 2.35rem);
    line-height: 1.05;
  }
  .study-reference-section-head h4,
  .study-reference-rail-head h4 {
    font-family: var(--sans);
    font-size: 1rem;
    letter-spacing: 0;
  }
  .study-reference-subtitle,
  .study-reference-section-note,
  .study-reference-rail-note {
    margin: 0.35rem 0 0;
    color: var(--ink-3);
    font-size: 0.82rem;
    line-height: 1.5;
  }
  .study-reference-quick-label {
    flex: 0 0 auto;
    color: var(--ink-4);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-reference-scripture {
    display: grid;
    gap: 0.55rem;
    margin-top: 1rem;
    padding: 0.9rem 0;
    border-top: 1px solid var(--parchment-3);
  }
  .study-reference-scripture-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--ink-3);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .study-reference-verse {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: 0.65rem;
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(1.2rem, 2vw, 1.65rem);
    line-height: 1.55;
    text-wrap: pretty;
  }
  .study-reference-verse-number {
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: 0.82rem;
    line-height: 2;
  }
  .study-reference-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    padding-top: 0.85rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-reference-action,
  .study-reference-section-toggle,
  .study-reference-full-chapter,
  .study-reference-rail-action {
    min-height: 34px;
    padding: 0.42rem 0.68rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.45rem;
    background: transparent;
    color: var(--ink-2);
    font-size: 0.76rem;
  }
  .study-reference-action:hover,
  .study-reference-action:focus-visible,
  .study-reference-section-toggle:hover,
  .study-reference-section-toggle:focus-visible,
  .study-reference-full-chapter:hover,
  .study-reference-full-chapter:focus-visible,
  .study-reference-rail-action:hover,
  .study-reference-rail-action:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--parchment-3) 58%);
    background: color-mix(in srgb, var(--parchment) 88%, var(--accent) 12%);
    color: var(--ink);
  }
  .study-reference-action.is-primary {
    border-color: color-mix(in srgb, var(--accent) 46%, var(--parchment-3) 54%);
    color: var(--ink);
  }
  .study-reference-section {
    background: transparent;
  }
  .study-reference-section > .study-result-context,
  .study-reference-section > .study-result-comparison,
  .study-reference-section > .study-result-related {
    border-top: 1px solid var(--parchment-3);
    padding-top: 0.8rem;
  }
  .study-reference-section .study-result-comparison,
  .study-reference-section .study-result-related {
    border-top: 0;
    padding-top: 0;
  }
  .study-reference-section .study-result-comparison-heading {
    display: none;
  }
  .study-reference-section .study-result-related {
    gap: 0.7rem;
  }
  .study-reference-section .study-result-related-toggle {
    display: none;
  }
  .study-reference-section .study-result-related-body {
    padding: 0;
    border-left: 0;
    background: transparent;
  }
  .study-reference-overview {
    gap: 0.9rem;
  }
  .study-reference-overview-list {
    display: grid;
    gap: 0.75rem;
    margin: 0;
  }
  .study-reference-overview-list div {
    display: grid;
    gap: 0.18rem;
  }
  .study-reference-overview-list dt {
    color: var(--ink-3);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .study-reference-overview-list dd {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.84rem;
    line-height: 1.45;
  }
  .study-reference-overview-list dd span {
    padding-inline: 0.18rem;
    color: var(--ink-4);
  }
  .study-reference-chapter-list {
    display: grid;
    gap: 0.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-reference-chapter-item {
    border-left: 2px solid transparent;
  }
  .study-reference-chapter-item.is-selected {
    border-left-color: var(--accent);
    background: color-mix(in srgb, var(--parchment) 88%, var(--accent) 12%);
  }
  .study-reference-chapter-link {
    display: grid;
    width: 100%;
    gap: 0.12rem;
    padding: 0.42rem 0.55rem;
    border: 0;
    background: transparent;
    color: var(--ink-2);
    text-align: left;
    cursor: pointer;
  }
  .study-reference-chapter-link:hover,
  .study-reference-chapter-link:focus-visible {
    background: color-mix(in srgb, var(--parchment) 84%, var(--accent) 16%);
    color: var(--ink);
  }
  .study-reference-chapter-label {
    font-size: 0.78rem;
    font-weight: 700;
  }
  .study-reference-chapter-text {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink-3);
    font-size: 0.76rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .study-reference-full-chapter {
    justify-self: stretch;
    margin-top: 0.25rem;
  }
  .study-reference-rail-actions {
    gap: 0.45rem;
  }
  .study-reference-rail-action {
    width: 100%;
    text-align: left;
  }
  .study-result-open {
    display: inline-grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--parchment-3);
    background: transparent;
    color: var(--ink-2);
    font-size: 1.55rem;
    line-height: 1;
  }
  .study-search-highlight {
    background: var(--color-scripture-highlight);
    color: inherit;
    padding: 0 0.08em;
    border-radius: 0.12rem;
  }
  @media (max-width: 767px) {
    .study-search-insights-list {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .study-search-recent-item {
      grid-template-columns: minmax(0, 1fr) auto;
    }
    .study-search-recent-meta {
      grid-column: 1 / -1;
      grid-row: 2;
    }
    .study-search-recent-remove {
      grid-column: 2;
      grid-row: 1;
    }
    .study-search-saved-item {
      grid-template-columns: minmax(0, 1fr) auto;
    }
    .study-search-saved-meta {
      grid-column: 1 / -1;
      grid-row: 2;
    }
    .study-search-saved-remove {
      grid-column: 2;
      grid-row: 1;
    }
    .study-result-related-row {
      grid-template-columns: minmax(0, 1fr);
      align-items: start;
    }
    .study-result-related-actions {
      justify-content: flex-start;
    }
  }
  @media (max-width: 1023px) {
    .study-reference-layout {
      grid-template-columns: minmax(0, 1fr);
    }
    .study-reference-rail {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .study-reference-rail-actions {
      grid-column: 1 / -1;
    }
  }
  @media (max-width: 767px) {
    .study-reference-mode .study-search-filters-bar {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .study-reference-mode .study-search-clear-wrap {
      grid-column: 1 / -1;
      justify-content: stretch;
    }
    .study-reference-mode .study-search-clear-wrap > * {
      flex: 1 1 auto;
    }
    .study-reference-identity,
    .study-reference-section,
    .study-reference-rail-section {
      padding: 0.85rem;
    }
    .study-reference-identity-head,
    .study-reference-section-head,
    .study-reference-rail-head {
      display: grid;
      gap: 0.45rem;
    }
    .study-reference-quick-label {
      order: -1;
    }
    .study-reference-scripture-meta {
      align-items: flex-start;
      flex-direction: column;
      gap: 0.18rem;
    }
    .study-reference-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .study-reference-action,
    .study-reference-section-toggle {
      width: 100%;
    }
    .study-reference-rail {
      grid-template-columns: minmax(0, 1fr);
    }
    .study-reference-rail-actions {
      grid-column: auto;
    }
  }
  .study-search-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
  }
  .study-rail {
    display: grid;
    gap: 0.9rem;
  }
  .study-rail-card {
    gap: 0.65rem;
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
  }
  .study-rail-card.is-compact {
    padding: 0.85rem;
  }
  .study-rail-card-head h5 {
    font-size: 0.92rem;
  }
  .study-rail-card-body {
    display: grid;
    gap: 0.6rem;
  }
  .study-rail-action-list {
    display: grid;
    gap: 0.35rem;
  }
  .study-rail-action {
    display: grid;
    grid-template-columns: 1.6rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    min-height: 44px;
    width: 100%;
    padding: 0.6rem 0;
    border: 0;
    border-bottom: 1px solid var(--parchment-3);
    background: transparent;
    color: var(--ink-2);
    text-align: left;
    font: 600 0.86rem var(--sans);
    cursor: pointer;
  }
  .study-rail-action:last-child {
    border-bottom: 0;
  }
  .study-rail-action svg,
  .study-rail-search-card svg,
  .study-card-icon svg {
    width: 1.15rem;
    height: 1.15rem;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .study-rail-action span:first-of-type {
    color: var(--ink);
  }
  .study-rail-action span:last-child {
    color: var(--ink-3);
    font-size: 1rem;
    justify-self: end;
  }
  .study-rail-search-card {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
  }
  .study-rail-search-button {
    width: 100%;
  }
  .study-rail-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.6rem;
    color: var(--ink-2);
    line-height: 1.65;
    font-size: 0.84rem;
  }
  .study-rail-list li strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--ink);
    line-height: 1.35;
  }
  .study-rail-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
  }
  .study-rail-tags li {
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
    border: 1px solid var(--parchment-3);
    background: var(--parchment);
    color: var(--ink-2);
    font-size: 0.72rem;
  }
  .study-rail-empty {
    color: var(--ink-3);
  }
  body.study-navigation-open {
    overflow: hidden;
  }
  .study-navigation-layer {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: grid;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
  }
  .study-navigation-layer[data-open="true"] {
    pointer-events: auto;
    opacity: 1;
  }
  .study-navigation-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: var(--color-dialog-backdrop);
    opacity: 0;
    transition: opacity 220ms ease;
  }
  .study-navigation-layer[data-open="true"] .study-navigation-backdrop {
    opacity: 1;
  }
  .study-navigation-sheet {
    position: fixed;
    display: grid;
    gap: 0.9rem;
    background: var(--color-study-surface);
    border: 1px solid var(--color-study-surface-border);
    box-shadow: 0 22px 54px var(--color-shadow);
    overflow: hidden;
    transition: transform 220ms ease, opacity 220ms ease;
    opacity: 1;
    overscroll-behavior: contain;
  }
  .study-navigation-layer.is-mobile-sheet {
    align-items: end;
  }
  .study-navigation-layer.is-mobile-sheet .study-navigation-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: calc(90vh - env(safe-area-inset-bottom, 0px));
    border-radius: 1.15rem 1.15rem 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    transform: translateY(100%);
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  .study-navigation-layer.is-mobile-sheet[data-open="true"] .study-navigation-sheet {
    transform: translateY(0);
  }
  .study-navigation-layer.is-tablet-drawer {
    justify-items: end;
    padding: 0.75rem;
  }
  .study-navigation-layer.is-tablet-drawer .study-navigation-sheet {
    top: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: min(640px, calc(100vw - 1.5rem));
    max-height: calc(100vh - 1.5rem);
    border-radius: 1.15rem;
    transform: translateX(102%);
  }
  .study-navigation-layer.is-tablet-drawer[data-open="true"] .study-navigation-sheet {
    transform: translateX(0);
  }
  .study-navigation-sheet-handle {
    display: grid;
    place-items: center;
    padding: 0.8rem 0.9rem 0;
    touch-action: none;
    cursor: grab;
  }
  .study-navigation-sheet-handle span {
    width: 3rem;
    height: 0.28rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink-3) 34%, transparent);
  }
  .study-navigation-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 1rem 0.2rem;
  }
  .study-navigation-sheet-head h3 {
    margin: 0;
    font: 700 1.02rem var(--sans);
    color: var(--ink);
  }
  .study-navigation-close {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    border: 1px solid var(--parchment-3);
    border-radius: 999px;
    background: var(--parchment);
    color: var(--ink-2);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
  }
  .study-navigation-sheet-body {
    display: grid;
    gap: 1rem;
    padding: 0 1rem 1rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .study-navigation-search-card {
    gap: 0.7rem;
  }
  .study-navigation-search-input {
    width: 100%;
    min-height: 44px;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
    color: var(--ink);
    font: 500 0.92rem var(--sans);
  }
  .study-navigation-search-input::placeholder {
    color: var(--ink-4);
  }
  .study-search-preview {
    display: grid;
    gap: 0.9rem;
  }
  .study-search-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.9rem;
  }
  .study-search-preview-head h3 {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-search-preview-intro,
  .study-search-preview-summary,
  .study-search-preview-help,
  .study-search-preview-status,
  .study-search-preview-note,
  .study-search-preview-range {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: var(--ink-2);
  }
  .study-search-preview-route {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--parchment-3);
    background: var(--parchment);
    color: var(--ink-3);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .study-search-preview-form {
    display: grid;
    gap: 0.7rem;
  }
  .study-search-preview-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-search-preview-query-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  .study-search-preview-query {
    flex: 1 1 260px;
    min-width: 0;
    min-height: 44px;
  }
  .study-search-preview-submit,
  .study-search-preview-clear {
    min-width: 84px;
  }
  .study-search-preview-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }
  .study-search-preview-control {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
  }
  .study-search-mode-control {
    flex: 0 0 150px;
    min-width: 150px;
  }
  .study-search-preview-control .step-study-select {
    width: 100%;
  }
  .study-search-preview-control span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  @media (min-width: 768px) and (max-width: 1023px) {
    .study-search-filters-bar {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .study-search-clear-wrap {
      justify-content: flex-start;
    }
  }
  .study-search-preview-results {
    display: grid;
    gap: 0.8rem;
  }
  .study-search-empty-state {
    display: grid;
    gap: 0.75rem;
    justify-items: start;
  }
  .study-search-ambiguity {
    display: grid;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-search-ambiguity-title {
    margin: 0;
    font: 700 0.86rem var(--sans);
    color: var(--ink);
  }
  .study-search-ambiguity-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .study-search-ambiguity-choice {
    display: grid;
    gap: 0.2rem;
    justify-items: start;
    min-width: min(100%, 220px);
    text-align: left;
    cursor: pointer;
    min-height: 56px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
    color: var(--ink);
    box-shadow: none;
    text-transform: none;
  }
  .study-search-ambiguity-choice-note {
    font: 500 0.74rem var(--sans);
    color: var(--ink-3);
    letter-spacing: 0;
    text-transform: none;
  }
  .study-search-ambiguity-choice:hover,
  .study-search-ambiguity-choice:focus-visible {
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
    border-color: color-mix(in srgb, var(--ink) 18%, var(--parchment-3) 82%);
    outline: 2px solid color-mix(in srgb, var(--ink) 18%, transparent);
    outline-offset: 2px;
  }
  .study-search-ambiguity-choice:active {
    transform: translateY(1px);
    background: color-mix(in srgb, var(--parchment) 88%, var(--ink) 12%);
  }
  .study-search-preview-card {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 1.05rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: var(--parchment);
  }
  .study-lexical-summary-card {
    gap: 0.9rem;
  }
  .study-lexical-occurrence-browser {
    display: grid;
    gap: 0.8rem;
  }
  .study-lexical-occurrence-browser:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 0.35rem;
  }
  .study-lexical-occurrence-browser-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0 0.15rem;
    border-bottom: 1px solid var(--parchment-3);
  }
  .study-lexical-occurrence-browser-head .study-lexical-kicker {
    margin-bottom: 0.15rem;
  }
  .study-lexical-occurrence-browser-title,
  .study-lexical-occurrence-browser-range {
    margin: 0;
  }
  .study-lexical-occurrence-browser-title {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--ink);
  }
  .study-lexical-occurrence-browser-range {
    flex: 0 0 auto;
    font-size: 0.78rem;
    color: var(--ink-3);
  }
  .study-lexical-book-distribution {
    display: grid;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--parchment-3);
    border-bottom: 1px solid var(--parchment-3);
  }
  .study-lexical-book-distribution-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
  }
  .study-lexical-book-distribution-title,
  .study-lexical-book-distribution-total {
    margin: 0;
  }
  .study-lexical-book-distribution-title {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--ink);
  }
  .study-lexical-book-distribution-total {
    flex: 0 0 auto;
    font-size: 0.78rem;
    color: var(--ink-3);
  }
  .study-lexical-book-distribution-list {
    display: grid;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .study-lexical-book-distribution-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: baseline;
    padding: 0.22rem 0;
  }
  .study-lexical-book-distribution-name {
    color: var(--ink-2);
  }
  .study-lexical-book-distribution-count {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
  }
  .study-lexical-book-distribution-toggle {
    justify-self: start;
  }
  @media (max-width: 767px) {
    .study-lexical-book-distribution-head {
      align-items: start;
      flex-direction: column;
      gap: 0.25rem;
    }
  }
  .study-lexical-occurrence-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--parchment-3);
  }
  .study-lexical-occurrence-scripture {
    overflow-wrap: anywhere;
  }
  .study-selected-translation-unavailable {
    margin: 0;
    color: var(--ink-3);
    font-size: 0.86rem;
    line-height: 1.6;
  }
  .study-lexical-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-4);
  }
  .study-lexical-original {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    line-height: 1.35;
    font-weight: 650;
    color: var(--ink);
  }
  .study-lexical-lemma {
    margin: 0.25rem 0 0;
    font-size: 0.94rem;
    line-height: 1.5;
    color: var(--ink-2);
  }
  .study-lexical-lemma span[dir="rtl"],
  .study-lexical-original[dir="rtl"] {
    unicode-bidi: isolate;
  }
  .study-lexical-definition-block,
  .study-lexical-detail-block {
    grid-column: 1 / -1;
  }
  .study-lexical-definition,
  .study-lexical-detail {
    margin: 0;
    color: var(--ink-2);
    line-height: 1.65;
  }
  .study-lexical-source {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.76rem;
    color: var(--ink-4);
  }
  .study-lexical-occurrence-count {
    font-weight: 650;
  }
  .study-lexical-summary-grid,
  .study-selected-lexical-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }
  .study-lexical-actions,
  .study-selected-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .study-search-preview-summary-label {
    margin: 0 0 0.2rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-search-preview-summary-value {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink);
  }
  .study-lexical-verse-stack {
    display: grid;
    gap: 0.35rem;
  }
  .study-search-preview-card.is-selected {
    border-color: color-mix(in srgb, var(--ink) 18%, var(--parchment-3) 82%);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 7%, transparent), 0 0 0 0.35rem color-mix(in srgb, var(--ink) 4%, transparent);
  }
  .study-search-preview-card-head {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .study-search-preview-card-title {
    margin: 0;
    font-size: 1rem;
    color: var(--ink);
    line-height: 1.35;
  }
  .study-search-preview-card-meta {
    margin: 0.2rem 0 0;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-4);
  }
  .study-search-preview-verse {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.8;
    color: var(--ink);
  }
  .study-search-preview-card .study-translation-badges {
    justify-content: flex-end;
  }
  .study-search-preview-highlight {
    background: var(--color-scripture-highlight);
    color: inherit;
    padding: 0 0.08em;
    border-radius: 0.12rem;
  }
  .study-search-preview-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
  }
  .study-selected-card .study-search-form-card {
    margin-top: 0.25rem;
  }
  .study-search-preview-empty {
    margin: 0;
    padding: 0.25rem 0;
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--ink-3);
  }
  .study-search-results .study-search-preview-empty {
    padding: 0.9rem 0.1rem;
  }
  .study-panel-cluster {
    display: grid;
    gap: 1.1rem;
  }
  .study-panel-subblock {
    display: grid;
    gap: 0.6rem;
  }
  .study-panel-subblock h4 {
    margin: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
  }
  .study-panel-block h3 {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-4);
  }
  .study-panel-list {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.84rem;
    color: var(--ink-2);
    line-height: 1.72;
  }
  .study-panel-list li + li {
    margin-top: 0.95rem;
  }
  .study-panel-list li strong {
    display: block;
    margin-bottom: 0.38rem;
    color: var(--ink);
    line-height: 1.5;
  }
  .study-panel-list p {
    margin: 0.35rem 0 0;
    font-size: 0.84rem;
    line-height: 1.72;
    text-wrap: pretty;
  }
  .study-panel-list span,
  .study-panel-meta {
    display: block;
    margin-top: 0.36rem;
    font-size: 0.77rem;
    line-height: 1.62;
    color: var(--ink-4);
    text-wrap: pretty;
  }
  .study-panel-more {
    margin-top: 0.45rem;
  }
  .study-panel-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
  }
  .study-panel-tags li {
    font-size: 0.72rem;
    color: var(--ink-3);
    border: 1px solid var(--parchment-3);
    background: var(--parchment);
    border-radius: 999px;
    padding: 0.22rem 0.62rem;
  }
  .study-panel-empty {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--ink-4);
    line-height: 1.6;
    text-wrap: pretty;
  }
.study-panel-more summary {
  font-size: 0.75rem;
  color: var(--ink-3);
  cursor: pointer;
  margin: 0.25rem 0 0;
}
.study-commentary-wrap {
  display: grid;
  gap: 0.85rem;
}
.study-commentary-block {
  border: 1px solid var(--color-study-panel-divider);
  background: var(--color-commentary-raised);
  border-radius: 3px;
  padding: 0.8rem 0.9rem;
  display: grid;
  gap: 0.45rem;
}
.study-commentary-block + .study-commentary-block {
  margin-top: 0.25rem;
}
.study-commentary-badge-row {
  margin: 0;
}
  .study-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  padding: 0.14rem 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
    color: var(--color-text-secondary);
    background: var(--color-surface);
  }
  .study-person-chip-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 0;
  }
  .study-person-chip-button {
    width: auto;
    min-width: 0;
    min-height: 2.6rem;
    padding: 0.62rem 1rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 70%, var(--ink) 30%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 82%, var(--ink) 18%);
    color: var(--ink-2);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--parchment) 70%, transparent);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: 0.01em;
    text-align: center;
    white-space: normal;
    transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease, color 120ms ease;
  }
  .study-person-chip-button:hover {
    border-color: color-mix(in srgb, var(--sienna-lt) 45%, var(--parchment-3) 55%);
    background: color-mix(in srgb, var(--parchment-2) 72%, var(--ink) 28%);
    color: var(--ink);
    transform: translateY(-1px);
  }
  .study-person-chip-button.is-secondary {
    opacity: 0.88;
  }
  .study-person-chip-button:focus-visible {
    outline-offset: 3px;
  }
  .study-person-chip-name {
    display: block;
    min-width: 0;
  }
  .study-person-chip-relevance {
    display: none;
  }
  .study-person-more {
    display: grid;
    gap: 0.8rem;
    margin: 0;
  }
  .study-person-more-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
    color: var(--ink-2);
    cursor: pointer;
    list-style: none;
    font-size: 0.9rem;
    font-weight: 600;
  }
  .study-person-more-summary > span:first-child {
    min-width: 0;
  }
  .study-person-more-summary::-webkit-details-marker {
    display: none;
  }
  .study-person-more-summary::after {
    content: '▾';
    color: var(--ink-4);
    font-size: 0.9rem;
    justify-self: end;
  }
  .study-person-more[open] .study-person-more-summary::after {
    content: '▴';
  }
  .study-person-more-count {
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.08rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment) 84%, var(--ink) 16%);
    color: var(--ink-3);
    font-size: 0.75rem;
    font-weight: 600;
  }
  .study-person-more-body {
    display: grid;
    gap: 0.8rem;
  }
  .study-person-group {
    display: grid;
    gap: 0.55rem;
    padding: 0.1rem 0 0;
  }
  .study-person-group-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
  }
  .study-person-group-head h4 {
    margin: 0;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    color: var(--ink-2);
  }
  .study-person-group-head span {
    justify-self: end;
    min-width: 2.1rem;
    text-align: center;
    line-height: 1;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment) 86%, var(--ink) 14%);
    color: var(--ink-4);
    font-size: 0.75rem;
    font-weight: 600;
  }
  .study-person-reference-groups {
    display: grid;
    gap: 1rem;
  }
  .study-person-reference-group {
    display: grid;
    gap: 0.55rem;
  }
  .study-person-reference-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .study-person-reference-group-head h4 {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .study-person-reference-group-head span {
    flex: 0 0 auto;
    color: var(--ink-4);
    font-size: 0.72rem;
  }
  .study-person-reference-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .study-person-reference-list > li {
    margin: 0;
    padding: 0;
  }
  .study-person-reference-chip {
    display: inline-flex;
    width: auto;
    min-width: 0;
    min-height: 2.2rem;
    height: auto;
    align-items: center;
    justify-content: center;
    padding: 0.48rem 0.72rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.65rem;
    background: var(--parchment);
    color: var(--ink-2);
    box-shadow: none;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.1;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
  }
  .study-person-reference-chip:hover {
    border-color: color-mix(in srgb, var(--color-brand) 48%, var(--parchment-3) 52%);
    background: color-mix(in srgb, var(--parchment) 88%, var(--color-brand) 12%);
    color: var(--ink);
  }
  .study-person-reference-chip:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }
  .study-person-reference-chip.is-static {
    cursor: default;
    opacity: 0.78;
  }
  .study-person-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 320;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }
  .study-person-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--color-overlay);
    cursor: pointer;
  }
  .study-person-modal {
    position: relative;
    z-index: 1;
    width: min(42rem, calc(100vw - 2rem));
    max-height: min(86vh, 56rem);
    overflow: auto;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 78%, var(--ink) 22%);
    border-radius: 1.2rem;
    background: color-mix(in srgb, var(--parchment-2) 92%, var(--ink) 8%);
    box-shadow: 0 28px 72px var(--color-shadow);
  }
  .study-person-modal .study-person-stage {
    margin: 0;
  }
  .study-person-modal .study-person-stage > .study-theme-article-topbar {
    padding-inline: 1rem;
    padding-top: 1rem;
  }
  .study-person-modal .study-workspace-card {
    margin-inline: 1rem 1rem;
  }
  .study-person-modal .study-person-card {
    margin-bottom: 1rem;
  }
  .study-person-card {
    gap: 1rem;
    padding: 1.15rem;
  }
  .study-person-card .study-card-head-title {
    align-items: flex-start;
  }
  .study-card-head-title {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
  }
  .study-card-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 72%, var(--ink) 28%);
    border-radius: 0.82rem;
    background: color-mix(in srgb, var(--parchment-2) 76%, var(--ink) 24%);
    color: var(--olive);
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--parchment) 72%, transparent);
  }
  .study-card-icon svg {
    width: 1rem;
    height: 1rem;
  }
  .study-card-kicker {
    margin: 0 0 0.12rem;
    color: var(--ink-3);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-card-title {
    margin: 0;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.38;
    font-weight: 700;
  }
  .study-person-header {
    display: grid;
    gap: 0.9rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-study-panel-divider);
  }
  .study-person-meta {
    display: grid;
    gap: 0.55rem;
  }
  .study-person-relevance {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 1.7rem;
    margin: 0;
    padding: 0.1rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 72%, var(--ink) 28%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 88%, var(--ink) 12%);
    color: var(--ink-3);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .study-person-chapter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .study-person-chapter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.16rem 0.6rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 78%, var(--ink) 22%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
    color: var(--ink-2);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  .study-person-chapter-chip.is-more {
    background: color-mix(in srgb, var(--parchment-2) 84%, var(--ink) 16%);
  }
  .study-person-chapter-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.16rem 0.65rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 72%, var(--ink) 28%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 84%, var(--ink) 16%);
    color: var(--ink-2);
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
  }
  .study-person-chapter-toggle:hover,
  .study-person-chapter-toggle[aria-expanded="true"] {
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-person-chapter-toggle:focus-visible,
  .study-person-relationship-pill-button:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
  }
  .study-person-chapter-empty,
  .study-person-appearance-note {
    margin: 0;
    color: var(--ink-4);
    font-size: 0.78rem;
    line-height: 1.45;
  }
  .study-person-section {
    display: grid;
    gap: 0.7rem;
    padding-top: 0.1rem;
  }
  .study-person-section + .study-person-section {
    padding-top: 0.95rem;
    border-top: 1px solid var(--color-study-panel-divider);
  }
  .study-person-biography-body {
    display: grid;
    gap: 0.55rem;
  }
  .study-person-biography-summary,
  .study-person-biography-remainder,
  .study-person-biography-more-body {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.92rem;
    line-height: 1.72;
    text-wrap: pretty;
  }
  .study-person-biography-more {
    display: grid;
    gap: 0.45rem;
  }
  .study-person-biography-more > summary {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 2.25rem;
    padding: 0.12rem 0.78rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 72%, var(--ink) 28%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 84%, var(--ink) 16%);
    color: var(--ink-2);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    list-style: none;
  }
  .study-person-biography-more > summary::-webkit-details-marker {
    display: none;
  }
  .study-person-biography-more[open] > summary {
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-person-biography-more-body {
    max-width: 72ch;
    margin: 0;
    padding: 0.9rem 1rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 68%, var(--ink) 32%);
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--parchment-2) 72%, var(--ink) 28%);
    color: var(--ink-3);
    font-size: 0.86rem;
    line-height: 1.75;
  }
  .study-person-biography-more-body p,
  .study-person-source-details-excerpt p {
    max-width: 72ch;
    margin: 0;
  }
  .study-person-biography-more-body p + p,
  .study-person-source-details-excerpt p + p {
    margin-top: 1rem;
  }
  .study-person-relationship-groups {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr));
    align-items: start;
  }
  .study-person-relationship-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    align-items: start;
  }
  .study-person-relationship-panel {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-person-relationship-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .study-person-relationship-panel-head h4 {
    margin: 0;
    color: var(--ink-3);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-person-relationship-panel-head span {
    flex: 0 0 auto;
    min-width: 2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 82%, var(--ink) 18%);
    color: var(--ink-4);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
  }
  .study-person-relationship-block {
    display: grid;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 80%, var(--ink) 20%);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--parchment-2) 92%, var(--ink) 8%);
  }
  .study-person-relationship-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .study-person-relationship-head h4 {
    margin: 0;
    color: var(--ink-3);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-person-relationship-head span {
    flex: 0 0 auto;
    min-width: 2rem;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 82%, var(--ink) 18%);
    color: var(--ink-4);
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
  }
  .study-person-relationship-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .study-person-relationship-pill {
    display: inline-flex;
    align-items: center;
    min-height: 2.15rem;
    padding: 0.16rem 0.72rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 76%, var(--ink) 24%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 86%, var(--ink) 14%);
    color: var(--ink-2);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.15;
  }
  .study-person-relationship-pill-button {
    appearance: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
  }
  .study-person-relationship-pill-button:hover {
    border-color: var(--color-link);
    background: color-mix(in srgb, var(--parchment) 82%, var(--color-link) 18%);
  }
  .study-person-relationship-pill.is-static {
    cursor: default;
  }
  .study-person-reference-group {
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--parchment) 91%, var(--ink) 9%);
  }
  .study-person-source-details {
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--parchment-3);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-person-source-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    list-style: none;
  }
  .study-person-source-details > summary::-webkit-details-marker {
    display: none;
  }
  .study-person-source-details-summary-label {
    color: var(--ink-2);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-person-source-details-summary-meta {
    flex: 0 0 auto;
    color: var(--ink-4);
    font-size: 0.72rem;
    font-weight: 700;
  }
  .study-person-source-details-body {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.8rem;
  }
  .study-person-source-details-more {
    display: grid;
    gap: 0.4rem;
  }
  .study-person-source-details-more > summary {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 2.1rem;
    padding: 0.1rem 0.72rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 72%, var(--ink) 28%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--parchment-2) 84%, var(--ink) 16%);
    color: var(--ink-2);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    list-style: none;
  }
  .study-person-source-details-more > summary::-webkit-details-marker {
    display: none;
  }
  .study-person-source-details-more[open] > summary {
    background: color-mix(in srgb, var(--parchment) 90%, var(--ink) 10%);
  }
  .study-person-source-details-excerpt {
    max-width: 72ch;
    margin: 0;
    padding: 0.8rem 0.95rem;
    border: 1px solid color-mix(in srgb, var(--parchment-3) 68%, var(--ink) 32%);
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--parchment-2) 72%, var(--ink) 28%);
    color: var(--ink-2);
    font-size: 0.88rem;
    line-height: 1.65;
    text-wrap: pretty;
  }
  .study-person-source-list {
    display: grid;
    gap: 0.6rem;
    margin: 0;
  }
  .study-person-source-row {
    display: grid;
    gap: 0.24rem;
    padding: 0.65rem 0.7rem;
    border: 1px solid var(--parchment-3);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--parchment-2) 94%, var(--ink) 6%);
  }
  .study-person-source-row dt {
    color: var(--ink-3);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-person-source-row dd {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.84rem;
    line-height: 1.58;
    text-wrap: pretty;
  }
  .study-commentary-scope {
    margin: 0;
    font-size: 0.76rem;
  line-height: 1.5;
  color: var(--ink-4);
}
.study-commentary-body {
  margin: 0.1rem 0 0;
  font-size: 0.9rem;
  line-height: 1.78;
  color: var(--ink-2);
  text-wrap: pretty;
}
.study-commentary-copy {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}
.study-commentary-preview {
  max-width: 66ch;
}
.study-current-overview-card .study-commentary-preview,
.study-current-highlights-card .study-commentary-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.study-current-overview-card .study-commentary-preview {
  -webkit-line-clamp: 4;
  max-height: 3.2rem;
}
.study-current-highlights-card .study-commentary-preview {
  -webkit-line-clamp: 3;
  max-height: 2.9rem;
}
.study-commentary-more {
  display: grid;
  gap: 0.35rem;
  width: fit-content;
  margin: 0 0 0.1rem 0;
  order: -1;
}
.study-commentary-more summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--parchment-3);
  border-radius: 999px;
  background: var(--parchment);
  color: var(--ink-2);
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  list-style: none;
}
.study-commentary-more summary::-webkit-details-marker {
  display: none;
}
.study-commentary-more summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
.study-commentary-more[open] {
  margin-bottom: 0.2rem;
}
.study-commentary-more[open] summary {
  background: var(--parchment-2);
  border-color: var(--parchment-3);
}
.study-commentary-more-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.78;
  color: var(--ink-2);
  text-wrap: pretty;
}
.study-current-people-card {
  gap: 0.9rem;
}
.study-current-people-card .study-rail-empty {
  margin: 0;
}
.study-person-card .study-card-head-title {
  align-items: center;
}
.commentary-debug {
  margin-top: 0.35rem;
  border-top: 1px dashed var(--color-study-panel-divider);
  padding-top: 0.35rem;
}
.commentary-debug summary {
  cursor: pointer;
  color: var(--ink-4);
  font-size: 0.72rem;
}
.study-panel-block + .study-panel-block {
  padding-top: 0.2rem;
  border-top: 1px solid var(--color-study-panel-divider);
}
  .study-panel-subsection + .study-panel-subsection {
    margin-top: 1rem;
  }
  .study-panel-subsection h4 {
    margin: 0 0 0.45rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-3);
  }
  .study-inspector {
    display: grid;
    gap: 1rem;
  }
  .study-inspector-shell {
    display: grid;
    gap: 0.95rem;
  }
  .study-inspector-header {
    display: grid;
    gap: 0.35rem;
  }
  .study-inspector-kicker {
    margin: 0;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sienna);
  }
  .study-inspector-header h4 {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.3rem;
    line-height: 1.15;
    color: var(--ink);
  }
  .study-inspector-selection,
  .study-inspector-note {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--ink-4);
    text-wrap: pretty;
  }
  .study-focus-card {
    border: 1px solid var(--color-interlinear-divider);
    border-radius: 2px;
    background: var(--color-lexical-raised);
    padding: 0.9rem;
    display: grid;
    gap: 0.65rem;
  }
  .study-focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem 1rem;
  }
  .study-focus-grid--phrase {
    grid-template-columns: minmax(0, 1fr);
  }
  .study-focus-grid p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .study-focus-grid strong {
    display: inline-block;
    margin-right: 0.35rem;
    color: var(--ink);
  }
  .study-token-breakdown {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.45rem;
  }
  .study-token-breakdown-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.55rem;
    align-items: center;
  }
  .study-token-breakdown-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.08rem;
    min-width: 0;
    padding: 0.26rem 0.42rem;
    border: 1px solid var(--color-interlinear-divider);
    border-radius: 0.3rem;
    background: var(--color-interlinear-token);
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  }
  .study-token-breakdown-chip:hover,
  .study-token-breakdown-chip.is-token-hover,
  .study-token-breakdown-chip:focus-visible {
    background: var(--color-interlinear-hover);
  }
  .study-token-breakdown-chip.is-selected {
    background: var(--color-interlinear-selected);
    box-shadow: inset 0 0 0 1px var(--color-interlinear-divider);
  }
  .study-token-breakdown-chip.study-original-language--hebrew,
  .study-token-breakdown-chip.study-original-language--aramaic {
    align-items: flex-end;
  }
  .study-token-breakdown-meta {
    font-size: 0.72rem;
    color: var(--color-interlinear-transliteration);
    line-height: 1.45;
  }
  .study-inspector-line {
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--color-interlinear-divider);
    background: var(--color-lexical-raised);
    border-radius: 2px;
  }
  .study-gloss-phrase {
    display: grid;
    gap: 0.42rem;
    padding: 0.1rem 0 0;
    border: 0;
    background: transparent;
    border-radius: 0;
  }
  .study-gloss-reading-row {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--color-interlinear-gloss);
    text-align: left;
    direction: ltr;
    unicode-bidi: plaintext;
    text-wrap: pretty;
  }
  .study-gloss-phrase-chip,
  .study-gloss-phrase-punctuation {
    font: inherit;
    line-height: inherit;
    color: inherit;
  }
  .study-gloss-phrase-chip {
    display: inline;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: inherit;
    text-decoration-line: underline;
    text-decoration-style: solid;
    text-decoration-thickness: 1px;
    text-decoration-color: transparent;
    text-underline-offset: 0.14em;
    cursor: pointer;
    transition: text-decoration-color 120ms ease, opacity 120ms ease, color 120ms ease;
  }
  .study-gloss-phrase-chip:hover,
  .study-gloss-phrase-chip:focus-visible,
  .study-gloss-phrase-chip.is-selected {
    background: transparent;
    border-color: transparent;
    text-decoration-color: color-mix(in srgb, var(--color-interlinear-focused) 70%, transparent);
  }
  .study-gloss-phrase-chip.is-selected {
    opacity: 0.98;
  }
  .study-gloss-phrase-chip:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
  }
  .study-gloss-phrase-text {
    position: relative;
    z-index: 1;
  }
  .study-gloss-phrase-count {
    display: none;
  }
  .study-gloss-phrase-punctuation {
    pointer-events: none;
  }
  .study-gloss-toggle {
    justify-self: start;
  }
  .study-gloss-word-by-word-help {
    margin: 0;
    color: var(--color-interlinear-morphology);
    font-size: 0.76rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
  }
  .study-gloss-word-by-word-wrap {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.25rem;
  }
  .study-gloss-word-by-word {
    display: block;
    margin: 0;
  }
  .study-word-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-interlinear-divider);
    border-radius: 2px;
    background: var(--color-lexical-surface);
  }
  .study-word-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
  }
  .study-word-table th,
  .study-word-table td {
    padding: 0.7rem 0.75rem;
    border-bottom: 1px solid var(--color-interlinear-divider);
    text-align: left;
    vertical-align: top;
    font-size: 0.76rem;
    line-height: 1.55;
    color: var(--color-interlinear-gloss);
    text-wrap: pretty;
  }
  .study-word-table th {
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-interlinear-morphology);
    background: var(--color-lexical-raised);
  }
  .study-word-table tbody tr:last-child td {
    border-bottom: none;
  }
  .study-word-original {
    font-family: var(--serif);
    font-size: 0.95rem;
    color: var(--color-interlinear-original);
  }
  .study-word-secondary {
    display: block;
    margin-top: 0.22rem;
    font-size: 0.68rem;
    line-height: 1.45;
    color: var(--color-lexical-secondary);
  }
  .study-word-placeholder {
    color: var(--color-lexical-secondary);
    opacity: 0.65;
  }
  .study-inspector-related {
    display: grid;
    gap: 0.7rem;
  }
  .study-inspector-fold {
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-cross-reference-row);
    overflow: hidden;
  }
  .study-inspector-fold summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.9rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-secondary);
    background: var(--color-cross-reference-active);
  }
  .study-inspector-fold summary::-webkit-details-marker {
    display: none;
  }
  .study-inspector-fold-body {
    padding: 0.85rem 0.9rem 0.95rem;
  }
  .study-inspector-fold .study-panel-list,
  .study-inspector-fold .study-panel-tags {
    margin-top: 0;
  }
  .reader-verse {
    font-family: var(--serif);
    font-size: 1.18rem;
    line-height: 2.04;
    color: var(--ink);
    margin: 0 0 0.88rem;
    cursor: pointer;
    border-radius: 8px;
    padding: 0.18rem 0.3rem;
    white-space: pre-line;
    transition: background-color 140ms var(--ease-premium), box-shadow 160ms var(--ease-premium);
  }
  .reader-verse:focus {
    outline: none;
    background: var(--color-scripture-highlight);
    box-shadow: inset 0 0 0 1px rgba(160, 82, 45, 0.24);
  }
  .reader-verse:hover {
    background: var(--color-scripture-highlight);
  }
  .reader-verse-num {
    font-family: var(--sans);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    vertical-align: super;
    color: var(--ink-4);
    margin-right: 0.28rem;
  }
  .reader-verse.is-selected {
    background: var(--color-scripture-current);
    box-shadow: inset 2px 0 0 var(--sienna), inset 0 0 0 1px rgba(160, 82, 45, 0.14);
    padding-left: 0.5rem;
  }
  .reader-verse-missing {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.78rem;
    row-gap: 0.42rem;
    align-items: start;
    background: linear-gradient(180deg, rgba(255,255,255,0.62), rgba(244,240,230,0.94));
    border: 1px solid rgba(160, 82, 45, 0.14);
    border-left: 3px solid rgba(212, 175, 55, 0.9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.76), 0 10px 24px rgba(16, 37, 23, 0.04);
    padding: 0.78rem 0.82rem 0.82rem;
    cursor: pointer;
    overflow: clip;
  }
  .reader-verse-missing:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(248,243,234,0.96));
  }
  .reader-verse-missing.is-selected {
    background: linear-gradient(180deg, rgba(255,250,233,0.98), rgba(246,236,211,0.94));
    box-shadow: inset 0 0 0 1px rgba(160, 82, 45, 0.14), inset 2px 0 0 var(--sienna);
  }
  .reader-verse-missing .reader-verse-num {
    align-self: start;
    justify-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.9rem;
    min-height: 1.5rem;
    margin-right: 0;
    padding: 0.08rem 0.42rem;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.14);
    color: var(--sienna);
    letter-spacing: 0.08em;
  }
  .missing-content-body {
    min-width: 0;
    display: grid;
    gap: 0.46rem;
    align-content: start;
  }
  .missing-content-note-title {
    display: block;
    margin: 0;
    font-family: var(--sans);
    font-size: 0.92rem;
    line-height: 1.48;
    font-weight: 600;
    color: var(--ink);
  }
  .missing-content-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
  }
  .missing-content-compare {
    margin: 0;
    font-size: 0.67rem;
    line-height: 1.5;
    color: var(--ink-4);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .missing-content-details {
    margin-top: 0;
    border-top: 1px solid rgba(16, 37, 23, 0.08);
    padding-top: 0.32rem;
  }
  .missing-content-details summary {
    cursor: pointer;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--sans);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--sienna);
    text-transform: uppercase;
  }
  .missing-content-details summary::-webkit-details-marker {
    display: none;
  }
  .missing-content-details summary::after {
    content: '▾';
    font-size: 0.7rem;
    line-height: 1;
  }
  .missing-content-details[open] summary::after {
    content: '▴';
  }
  .missing-content-details p {
    margin: 0.32rem 0 0;
    font-size: 0.82rem;
    line-height: 1.62;
    color: var(--ink-2);
  }
  .missing-book-note {
    border: 1px solid rgba(160, 82, 45, 0.16);
    border-left: 4px solid rgba(212, 175, 55, 0.95);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(244,240,230,0.94));
    box-shadow: 0 8px 24px rgba(16, 37, 23, 0.06);
    padding: 0.95rem 1rem 1rem;
    margin: 0.4rem 0 0.2rem;
    max-width: 42rem;
  }
  .missing-book-note-title {
    margin: 0;
    font-family: var(--sans);
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 600;
    color: var(--ink);
  }
  .missing-content-subtitle {
    margin: 0.22rem 0 0;
    font-size: 0.76rem;
    line-height: 1.5;
    color: var(--ink-4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .missing-content-page {
    padding: 0.3rem 0 0.4rem;
  }
  .study-context-panel {
    margin-top: 1.5rem;
  }
  .study-surface-backdrop {
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: 240;
  }
  .study-surface {
    background: var(--color-study-surface);
    border: 1px solid var(--color-study-surface-border);
    border-radius: 3px;
    box-shadow: 0 14px 32px var(--color-shadow);
    z-index: 260;
  }
  .study-surface.is-desktop-popover {
    position: fixed;
    right: 2rem;
    top: 6.2rem;
    max-height: calc(100vh - 8rem);
    overflow: auto;
  }
  .study-surface.is-reading-popover {
    width: min(520px, calc(100vw - 3rem));
  }
  .study-surface.is-study-popover {
    width: min(740px, calc(100vw - 4rem));
    right: 1.5rem;
  }
  .study-surface.is-mobile-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    max-height: 70vh;
    overflow: auto;
    overflow-x: hidden;
    border-radius: 10px 10px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
  .study-surface-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem 0.6rem;
    border-bottom: 1px solid var(--rule);
  }
  .study-surface-ref {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .study-surface-close {
    border: none;
    background: transparent;
    color: var(--ink-3);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
  }
  .study-surface-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.85rem 0.9rem 0.7rem;
    border-bottom: 1px solid var(--color-study-panel-divider);
    background: var(--color-cross-reference-row);
  }
  .study-surface-tab {
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-study-tab-surface);
    color: var(--color-text-secondary);
    font-size: 0.675rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 0.82rem;
    cursor: pointer;
    box-shadow: inset 0 1px 0 var(--color-study-panel-divider);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-premium);
  }
  .study-surface-tab.active {
    background: var(--color-study-tab-active);
    border-color: var(--color-border-strong);
    color: var(--color-text-inverse);
    box-shadow: 0 8px 18px var(--color-shadow);
    transform: translateY(-1px);
  }
  .study-surface-tab:hover {
    border-color: var(--color-border-strong);
    color: var(--color-text);
  }
  .study-surface-body {
    padding: 1rem 1rem 1.05rem;
  }
  .study-surface-body-study {
    padding-top: 1rem;
  }
  .study-surface-copy {
    margin: 0 0 0.72rem;
    font-size: 0.88rem;
    line-height: 1.78;
    color: var(--ink-2);
  }
  .study-surface-list {
    margin: 0;
    padding-left: 1.05rem;
    font-size: 0.8125rem;
    color: var(--ink-2);
    line-height: 1.62;
  }
  .study-surface-link {
    color: var(--color-study-panel-link);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--color-study-panel-link) 42%, transparent);
  }
  .study-compare-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: start;
  }
  .study-surface.is-reading-compare {
    display: flex;
    flex-direction: column;
  }
  .study-surface.is-reading-compare .reading-chapter-comparison {
    min-width: 0;
  }
  .reading-chapter-comparison-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem 0.7rem;
    border-bottom: 1px solid var(--rule);
    background: var(--color-study-surface);
  }
  .reading-chapter-comparison-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    gap: 0.3rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0 0.75rem;
    background: var(--color-study-tab-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    font: 600 0.72rem/1 var(--sans);
  }
  .reading-chapter-comparison-back:hover,
  .reading-chapter-comparison-back:focus-visible {
    border-color: var(--color-border-strong);
    color: var(--color-text);
  }
  .reading-chapter-comparison-back:focus-visible,
  .reading-chapter-comparison-close:focus-visible,
  .reading-chapter-comparison-select-label select:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
  }
  .reading-chapter-comparison-heading {
    min-width: 0;
  }
  .reading-chapter-comparison-heading h2 {
    margin: 0;
    color: var(--color-text);
    font: 700 clamp(1.05rem, 2vw, 1.35rem)/1.2 var(--serif);
    overflow-wrap: anywhere;
  }
  .reading-chapter-comparison-heading .study-compare-label {
    margin-bottom: 0.22rem;
  }
  .reading-chapter-comparison-close {
    flex: 0 0 auto;
  }
  .reading-chapter-comparison-controls {
    position: sticky;
    top: 4.35rem;
    z-index: 1;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-study-panel-divider);
    background: var(--color-cross-reference-row);
  }
  .reading-chapter-comparison-primary,
  .reading-chapter-comparison-select-label {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
    color: var(--color-text);
    font-size: 0.82rem;
  }
  .reading-chapter-comparison-control-label {
    color: var(--color-text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .reading-chapter-comparison-select-label {
    grid-template-columns: auto minmax(130px, 190px);
    align-items: center;
    gap: 0.45rem;
    color: var(--color-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
  }
  .reading-chapter-comparison-select-label select {
    min-height: 40px;
    min-width: 0;
    border: 1px solid var(--color-border);
    border-radius: 0.45rem;
    padding: 0.45rem 0.55rem;
    background: var(--color-study-tab-surface);
    color: var(--color-text);
    font: 600 0.78rem/1.2 var(--sans);
  }
  .reading-chapter-comparison-status {
    margin: 0;
    padding: 0.55rem 1rem;
    color: var(--color-text-secondary);
    font-size: 0.72rem;
  }
  .reading-chapter-comparison-rows {
    display: grid;
    gap: 0.7rem;
    padding: 0.15rem 1rem 1rem;
  }
  .reading-chapter-comparison-row {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    min-width: 0;
    border: 1px solid var(--color-study-panel-divider);
    border-radius: 0.7rem;
    background: var(--color-study-tab-surface);
    overflow: hidden;
  }
  .reading-chapter-comparison-row.is-selected {
    border-color: color-mix(in srgb, var(--color-brand) 54%, var(--color-border));
    background: color-mix(in srgb, var(--color-brand) 10%, var(--color-study-tab-surface));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--color-brand) 20%, transparent);
  }
  .reading-chapter-comparison-verse {
    display: grid;
    place-items: start center;
    padding: 0.9rem 0.25rem;
    background: var(--color-cross-reference-row);
    color: var(--color-text-secondary);
    font: 700 0.78rem/1 var(--sans);
  }
  .reading-chapter-comparison-side {
    min-width: 0;
    padding: 0.85rem 0.95rem 0.95rem;
  }
  .reading-chapter-comparison-side + .reading-chapter-comparison-side {
    border-left: 1px solid var(--color-study-panel-divider);
  }
  .reading-chapter-comparison-side-label {
    margin: 0 0 0.45rem;
    color: var(--color-text-secondary);
    font: 700 0.64rem/1.2 var(--sans);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .reading-chapter-comparison-text {
    margin: 0;
    color: var(--color-text);
    font: 1rem/1.72 var(--serif);
    overflow-wrap: anywhere;
    text-wrap: pretty;
  }
  .reading-chapter-comparison-missing {
    border: 1px dashed var(--color-border);
    border-radius: 0.45rem;
    padding: 0.65rem 0.7rem;
    background: color-mix(in srgb, var(--color-cross-reference-row) 68%, transparent);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    line-height: 1.55;
  }
  .reading-chapter-comparison-missing p,
  .reading-chapter-comparison-empty p,
  .reading-chapter-comparison-loading p {
    margin: 0;
  }
  .reading-chapter-comparison-side--provider-unavailable .reading-chapter-comparison-missing,
  .reading-chapter-comparison-side--error .reading-chapter-comparison-missing {
    border-color: color-mix(in srgb, var(--color-brand) 45%, var(--color-border));
  }
  .reading-chapter-comparison-loading,
  .reading-chapter-comparison-empty {
    display: grid;
    min-height: 12rem;
    place-items: center;
    gap: 0.55rem;
    padding: 2rem 1rem;
    color: var(--color-text-secondary);
    text-align: center;
  }

  @media (min-width: 1024px) {
    .study-surface.is-desktop-popover.is-reading-compare {
      right: 1.5rem;
      width: min(1120px, calc(100vw - 3rem));
      max-height: calc(100vh - 4rem);
    }
  }

  @media (max-width: 1023px) {
    .study-surface.is-mobile-sheet.is-reading-compare {
      height: min(92dvh, 100%);
      max-height: 92dvh;
      border-radius: 10px 10px 0 0;
    }
    .reading-chapter-comparison-head {
      position: sticky;
      top: 0;
      z-index: 2;
      background: var(--color-study-surface);
    }
    .reading-chapter-comparison-row {
      grid-template-columns: minmax(0, 1fr);
    }
    .reading-chapter-comparison-verse {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      min-height: 2rem;
      padding: 0.55rem 0.8rem;
    }
    .reading-chapter-comparison-side {
      padding: 0.8rem 0.9rem 0.9rem;
    }
    .reading-chapter-comparison-side + .reading-chapter-comparison-side {
      border-top: 1px solid var(--color-study-panel-divider);
      border-left: 0;
    }
  }

  @media (max-width: 680px) {
    .reading-chapter-comparison-head {
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 0.45rem;
      padding-inline: 0.75rem;
    }
    .reading-chapter-comparison-back {
      padding-inline: 0.55rem;
    }
    .reading-chapter-comparison-back span {
      display: none;
    }
    .reading-chapter-comparison-controls {
      align-items: stretch;
      flex-direction: column;
      gap: 0.7rem;
      padding-inline: 0.75rem;
    }
    .reading-chapter-comparison-select-label {
      grid-template-columns: minmax(0, 1fr) minmax(130px, 1fr);
    }
    .reading-chapter-comparison-rows {
      padding-inline: 0.75rem;
    }
  }
  .study-compare-card {
    align-self: start;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(16, 37, 23, 0.08);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 241, 232, 0.96));
    padding: 0.95rem 1rem 1rem;
    box-shadow: 0 10px 24px rgba(16, 37, 23, 0.06);
    display: grid;
    gap: 0.8rem;
  }
  .study-compare-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, rgba(93, 127, 106, 0.9), rgba(47, 90, 64, 0.58));
  }
  .study-compare-card--missing::before {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.98), rgba(196, 115, 62, 0.52));
  }
  .study-compare-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .study-compare-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.6rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(16, 37, 23, 0.06);
    color: var(--ink-4);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .study-compare-card--available .study-compare-status {
    background: rgba(47, 90, 64, 0.1);
    color: var(--navy-2);
  }
  .study-compare-card--missing .study-compare-status {
    background: rgba(212, 175, 55, 0.14);
    color: var(--sienna);
  }
  .study-compare-card-body {
    display: grid;
    gap: 0.52rem;
  }
  .study-compare-verse {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.72;
    color: var(--ink);
    text-wrap: pretty;
  }
  .study-compare-verse.is-symbol {
    font-family: var(--sans);
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: 0.18em;
    color: var(--ink-4);
  }
  .study-compare-helper {
    margin: 0;
    font-size: 0.62rem;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .study-compare-card .missing-content-note-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.45;
  }
  .study-compare-card .missing-content-compare {
    margin: 0.05rem 0 0;
  }
  .study-compare-card .missing-content-details {
    margin-top: 0;
  }
  .study-compare-card .missing-content-details summary {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }
  .study-compare-card .missing-content-details p {
    font-size: 0.84rem;
  }
  .missing-content-compare {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    padding: 0.3rem 0.62rem;
    border-radius: 999px;
    background: rgba(16, 37, 23, 0.05);
    border: 1px solid rgba(16, 37, 23, 0.08);
    color: var(--ink-4);
    letter-spacing: 0.05em;
  }
  .missing-content-details {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
  }
  .missing-content-actions .missing-content-compare,
  .missing-content-actions .missing-content-details {
    margin-top: 0;
  }
  .missing-content-details summary {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(160, 82, 45, 0.18);
    background: rgba(160, 82, 45, 0.07);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }
  .missing-content-details summary:hover {
    background: rgba(160, 82, 45, 0.11);
    border-color: rgba(160, 82, 45, 0.24);
  }
  .missing-content-details[open] summary {
    background: rgba(160, 82, 45, 0.13);
    border-color: rgba(160, 82, 45, 0.3);
  }
  .missing-content-details p {
    margin-top: 0.38rem;
  }
  .study-compare-label {
    margin: 0 0 0.2rem;
    font-size: 0.625rem;
    color: var(--ink-4);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .study-notes-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--ink-3);
    margin-bottom: 0.3rem;
  }
  .study-note-input {
    width: 100%;
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 0.55rem 0.6rem;
    resize: vertical;
    margin-bottom: 0.45rem;
  }
  .study-notes-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
  }
  .study-note-status {
    margin: 0;
    font-size: 0.75rem;
    color: var(--ink-4);
  }
  .study-highlights-wrap {
    border-top: 1px solid var(--rule);
    margin-top: 0.4rem;
    padding-top: 0.45rem;
  }
  .study-highlights-list {
    list-style: none;
    margin: 0.3rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
  }
  .study-highlights-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    padding: 0.35rem 0.45rem;
    background: var(--parchment-2);
    font-size: 0.75rem;
    color: var(--ink-2);
  }
  .study-highlight-remove {
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    background: var(--parchment);
    color: var(--ink-3);
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.35rem;
    cursor: pointer;
  }
  .step-study-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
    margin-bottom: 0.45rem;
  }
  .step-study-select {
    width: 92px;
    border: 1px solid var(--color-interlinear-divider);
    border-radius: 2px;
    background: var(--color-lexical-surface);
    color: var(--color-text);
    font-family: var(--sans);
    font-size: 0.75rem;
    padding: 8px 10px;
    outline: none;
  }
  .step-study-input {
    width: 100%;
    border: 1px solid var(--color-interlinear-divider);
    border-radius: 2px;
    background: var(--color-lexical-surface);
    color: var(--color-text);
    font-family: var(--sans);
    font-size: 0.75rem;
    padding: 8px 10px;
    outline: none;
  }
  .step-study-input:focus, .step-study-select:focus {
    border-color: var(--color-interlinear-strongs);
  }
  .step-study-btn {
    border: none;
    border-radius: 2px;
    background: var(--navy);
    color: var(--sand);
    font-family: var(--sans);
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 10px;
    cursor: pointer;
    min-width: 82px;
  }
  .step-study-btn:hover {
    background: var(--navy-2);
  }
  .step-study-helper {
    font-size: 0.75rem;
    color: var(--ink-3);
    margin-bottom: 0.4rem;
  }
  .step-study-status {
    font-size: 0.6875rem;
    color: var(--color-lexical-secondary);
    margin-bottom: 0.45rem;
  }
  .step-study-result {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-interlinear-gloss);
    background: var(--color-lexical-surface);
    border: 1px solid var(--color-interlinear-divider);
    border-radius: 2px;
    padding: 0.6rem 0.65rem;
    line-height: 1.55;
  }
  .step-study-attribution {
    font-size: 0.6875rem;
    color: var(--ink-4);
    line-height: 1.5;
    margin-top: 0.2rem;
  }
  .step-study-list {
    margin: 0.35rem 0 0.45rem 1rem;
    color: var(--ink-2);
    font-size: 0.75rem;
    line-height: 1.6;
  }
  .step-advanced {
    margin-top: 0.5rem;
    border-top: 1px dashed var(--rule);
    padding-top: 0.45rem;
  }
  .step-advanced summary {
    font-size: 0.6875rem;
    color: var(--ink-4);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.45rem;
  }
  .verse-block {
    padding: 2rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .verse-block.is-selected {
    background: rgba(212, 175, 55, 0.08);
    border-left: 2px solid var(--sienna);
    padding-left: 0.8rem;
    margin-left: -0.8rem;
    border-radius: 2px;
  }
  .verse-block:last-child { border-bottom: none; }
  .verse-ref {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 0.75rem;
    text-decoration: none;
    display: inline-block;
  }
  .verse-text {
    font-family: var(--serif);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--ink);
    margin-bottom: 1.25rem;
    font-style: italic;
    white-space: pre-line;
  }
  .verse-exp-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 0.5rem;
  }
  .verse-exp {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: var(--ink-2);
    padding-left: 1rem;
    border-left: 2px solid var(--sienna-lt);
  }
  .verse-context {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background: var(--sienna-wash);
    border-radius: 3px;
    font-size: 0.8125rem;
    color: var(--ink-2);
    line-height: 1.65;
  }
  .verse-context-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--sienna);
    margin-bottom: 0.35rem;
  }
  .step-placeholder {
    margin-top: 1rem;
    padding: 0.8rem 0.9rem 0.9rem;
    border: 1px dashed var(--rule);
    border-radius: 3px;
    background: var(--parchment-2);
  }
  .step-placeholder-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 0.25rem;
  }
  .step-placeholder-ref {
    font-size: 0.75rem;
    color: var(--ink-2);
    margin-bottom: 0.5rem;
  }
  .step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
  }
  .step-btn {
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: var(--parchment);
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
  }
  .step-btn:hover {
    border-color: var(--sienna-lt);
    color: var(--ink);
  }
  .step-btn-lang {
    background: rgba(93, 127, 106, 0.1);
    border-color: rgba(93, 127, 106, 0.45);
  }
  .step-btn-lex {
    background: rgba(160, 82, 45, 0.08);
    border-color: rgba(160, 82, 45, 0.45);
  }
  .step-btn-strong {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.5);
  }
  .step-btn-morph {
    background: rgba(47, 90, 64, 0.12);
    border-color: rgba(47, 90, 64, 0.45);
  }
  .step-btn.active {
    color: var(--sand);
    border-color: var(--ink);
    background: var(--ink-2);
  }
  .step-result {
    font-size: 0.75rem;
    color: var(--ink-2);
    line-height: 1.6;
    border-top: 1px solid var(--rule);
    padding-top: 0.45rem;
  }
  .step-result p strong {
    color: var(--ink);
  }

  /* ══════════════════════════════════════════════════════
     BOOKS PAGE
  ══════════════════════════════════════════════════════ */
  .page-header {
    border-bottom: 1px solid var(--rule);
    padding: 3rem 2rem 2.5rem;
    max-width: var(--max);
    margin: 0 auto;
  }
  .page-eyebrow {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
    margin-bottom: 0.6rem;
  }
  .page-title {
    font-family: var(--serif);
    font-size: 2.25rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 0.6rem;
  }
  .page-desc { font-size: 0.9375rem; color: var(--ink-3); line-height: 1.65; max-width: 520px; }

  .books-coming-soon {
    min-height: min(58vh, 640px);
    display: flex;
    flex-direction: column;
  }
  .books-coming-soon .page-header {
    width: 100%;
    border-bottom: 0;
    padding-top: clamp(6rem, 15vw, 10rem);
    padding-bottom: clamp(6rem, 15vw, 10rem);
  }
  .books-coming-soon .page-title { max-width: 650px; }
  .books-coming-soon .page-desc { max-width: 560px; }

  /* ══════════════════════════════════════════════════════
     STUDY GUIDES PAGE
  ══════════════════════════════════════════════════════ */
  .guides-layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.75rem 2rem 3rem;
    display: grid;
    gap: 2rem;
  }
  .guides-intro {
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1.25rem;
  }
  .guides-intro-text {
    max-width: 780px;
    font-size: 0.9375rem;
    color: var(--ink-3);
    line-height: 1.75;
  }
  .guides-toolbar {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 220px 220px;
    gap: 1rem;
    align-items: end;
    padding: 1.1rem;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
  }
  .guides-search-wrap,
  .guides-select-wrap {
    display: grid;
    gap: 0.4rem;
  }
  .guides-toolbar-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guides-search-input,
  .guides-select-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    background: var(--parchment);
    color: var(--ink);
    padding: 0 0.85rem;
    font-family: var(--sans);
    font-size: 0.875rem;
    outline: none;
  }
  .guides-search-input:focus,
  .guides-select-input:focus {
    border-color: var(--sienna);
  }
  .guides-toolbar-note {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    color: var(--ink-4);
    line-height: 1.5;
  }
  .guides-toolbar-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
  }
  .guides-toolbar-actions .btn-secondary::after {
    content: '';
  }
  .guide-author-layout {
    width: min(1120px, 94vw);
    margin: 0 auto;
    display: grid;
    gap: 1.3rem;
  }
  .guide-author-block {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 1.05rem 0 1.2rem;
    display: grid;
    gap: 0.95rem;
  }
  .guide-author-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .guide-author-field {
    display: grid;
    gap: 0.35rem;
  }
  .guide-author-field span {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-author-field input,
  .guide-author-field select,
  .guide-author-field textarea {
    width: 100%;
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    background: var(--parchment);
    color: var(--ink);
    padding: 0.55rem 0.65rem;
    font-family: var(--sans);
    font-size: 0.89rem;
    line-height: 1.55;
  }
  .guide-author-field textarea {
    resize: vertical;
  }
  .guide-author-field-wide {
    grid-column: 1 / -1;
  }
  .guide-author-inline-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
  }
  .guide-author-inline-actions .btn-secondary::after {
    content: '';
  }
  .guide-author-warnings {
    border-left: 2px solid rgba(162, 101, 82, 0.55);
    padding: 0.5rem 0.72rem;
    display: grid;
    gap: 0.28rem;
    background: rgba(248, 238, 229, 0.6);
    color: #6e4a38;
    font-size: 0.84rem;
    line-height: 1.45;
  }
  .guide-author-preview-shell {
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--parchment);
    padding: 1rem;
    display: grid;
    gap: 1rem;
  }
  .guide-author-preview-head {
    display: grid;
    gap: 0.2rem;
  }
  .guide-author-preview-head .page-desc {
    margin: 0;
  }
  .guides-library {
    display: grid;
    gap: 1rem;
  }
  .guides-library-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.85rem;
  }
  .study-guides-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
  .study-guide-card {
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--parchment);
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
    cursor: pointer;
  }
  .study-guide-card:hover {
    border-color: var(--sienna-lt);
    transform: translateY(-2px);
    background: #fffdf8;
  }
  .study-guide-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.55);
    outline-offset: 2px;
  }
  .study-guide-media {
    aspect-ratio: 16 / 9;
    border-bottom: 1px solid var(--rule);
    background: var(--parchment-2);
    position: relative;
    overflow: hidden;
  }
  .study-guide-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .study-guide-media-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(150deg, rgba(234,228,214,0.92), rgba(245,237,228,0.64));
    color: var(--ink-3);
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.3;
  }
  .study-guide-media-fallback.is-hidden {
    display: none;
  }
  .study-guide-thumb,
  .legacy-study-guide-thumb {
    border-bottom: 1px solid var(--rule);
    padding: 1rem 1rem 0.95rem;
    background: linear-gradient(150deg, rgba(234,228,214,0.92), rgba(245,237,228,0.64));
    display: grid;
    align-content: end;
    gap: 0.4rem;
  }
  .study-guide-body {
    padding: 1rem;
    display: grid;
    gap: 0.85rem;
    align-content: start;
  }
  .study-guide-meta {
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-3);
    line-height: 1.2;
    font-weight: 500;
  }
  .study-guide-title {
    font-family: var(--serif);
    font-size: 1.16rem;
    line-height: 1.18;
    font-weight: 500;
    color: var(--ink);
  }
  .study-guide-desc {
    font-size: 0.84rem;
    line-height: 1.68;
    color: var(--ink-3);
  }
  .study-guide-actions {
    margin-top: auto;
  }
  .study-guide-cta {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.6875rem;
  }
  .study-guide-cta:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.55);
    outline-offset: 2px;
  }
  .study-guide-card-placeholder {
    cursor: default;
    opacity: 0.7;
  }
  .study-guide-card-placeholder:hover {
    transform: none;
    border-color: var(--rule);
    background: var(--parchment);
  }
  .study-guide-card-placeholder .study-guide-cta {
    opacity: 0.65;
    cursor: default;
  }
  .guides-empty-state {
    border: 1px dashed var(--parchment-3);
    background: var(--parchment-2);
    border-radius: 3px;
    padding: 1rem;
  }
  .guides-empty-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
  }
  .guides-empty-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--ink-3);
  }

  .guide-series-layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.25rem 2rem 3rem;
    display: grid;
    gap: 1.2rem;
  }
  .guide-series-back {
    justify-self: start;
  }
  .guide-series-back::after {
    content: '';
  }
  .guide-series-banner {
    position: relative;
    aspect-ratio: 21 / 7;
    border: 1px solid var(--rule);
    border-radius: 3px;
    overflow: hidden;
    background: var(--parchment-2);
  }
  .guide-series-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .guide-series-banner-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    font-family: var(--serif);
    color: var(--ink-3);
    background: linear-gradient(150deg, rgba(234,228,214,0.92), rgba(245,237,228,0.64));
  }
  .guide-series-banner-fallback.is-hidden {
    display: none;
  }
  .guide-series-header {
    display: grid;
    gap: 0.6rem;
    padding-bottom: 0.45rem;
  }
  .guide-series-intro {
    margin: 0;
    font-size: 0.875rem;
    color: var(--ink-3);
    line-height: 1.72;
  }
  .guide-series-copy {
    display: grid;
    gap: 0.85rem;
  }
  .guide-copy-details {
    border-radius: 3px;
    background: var(--parchment);
    overflow: hidden;
  }
  .guide-copy-summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--serif);
    font-size: 1.08rem;
    line-height: 1.25;
    color: var(--ink);
  }
  .guide-copy-summary::-webkit-details-marker {
    display: none;
  }
  .guide-copy-summary::after {
    content: '＋';
    font-family: var(--sans);
    color: var(--ink-4);
    font-size: 0.9rem;
    flex-shrink: 0;
  }
  .guide-copy-details[open] .guide-copy-summary::after {
    content: '−';
  }
  .guide-copy-summary:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: -2px;
  }
  .guide-copy-details-body {
    padding: 0 1.05rem 1rem;
    display: grid;
    gap: 0.85rem;
  }
  .guide-editorial-read {
    width: min(100%, 76ch);
    display: grid;
    gap: 0;
  }
  .guide-editorial-lead {
    margin: 0 0 1.05rem;
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.95;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-editorial-h2 {
    margin: 2.05rem 0 0.8rem;
    font-family: var(--serif);
    font-size: 1.34rem;
    line-height: 1.28;
    color: var(--ink);
    font-weight: 600;
    text-wrap: balance;
  }
  .guide-editorial-heading-stack {
    display: grid;
    gap: 0.35rem;
    margin: 1.65rem 0 0.95rem;
  }
  .guide-editorial-heading-stack .guide-editorial-h2 {
    margin: 0;
  }
  .guide-editorial-kicker {
    margin: 0;
    font-family: var(--serif);
    font-size: 0.96rem;
    line-height: 1.55;
    color: var(--ink-3);
    font-style: italic;
    text-wrap: pretty;
  }
  .guide-editorial-h3 {
    margin: 1.45rem 0 0.55rem;
    font-family: var(--sans);
    font-size: 0.82rem;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
    font-weight: 600;
  }
  .guide-editorial-p {
    margin: 0 0 1.05rem;
    font-size: 0.95rem;
    line-height: 1.92;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-editorial-list {
    margin: 0.6rem 0 1.25rem;
    padding-left: 1.35rem;
    display: grid;
    gap: 0.72rem;
    list-style: disc;
  }
  .guide-editorial-list li {
    font-size: 0.93rem;
    line-height: 1.84;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-editorial-pull {
    margin: 1rem 0 1.5rem;
    padding: 0.65rem 0 0.65rem 0.95rem;
    border-left: 2px solid var(--parchment-3);
    font-style: italic;
    color: var(--ink-2);
    font-size: 0.94rem;
    line-height: 1.86;
  }
  .guide-copy-section {
    display: grid;
    gap: 0.55rem;
    padding-top: 0.05rem;
  }
  .guide-copy-section h2 {
    font-family: var(--serif);
    font-size: 1.12rem;
    line-height: 1.25;
    color: var(--ink);
    margin: 0;
  }
  .guide-copy-section p,
  .guide-copy-section li {
    font-size: 0.875rem;
    line-height: 1.82;
    color: var(--ink-2);
  }
  .guide-copy-section ul {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.55rem;
  }
  .guide-copy-section li {
    text-wrap: pretty;
  }
  .guide-copy-subsection {
    display: grid;
    gap: 0.45rem;
    padding-top: 0.15rem;
    margin-top: 0.1rem;
  }
  .guide-copy-subsection h3 {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-series-messages {
    display: grid;
    gap: 0.7rem;
    padding-top: 0.35rem;
  }
  .guide-series-message-list {
    display: grid;
    gap: 0.55rem;
  }
  .guide-message-row {
    width: 100%;
    border: none;
    border-radius: 3px;
    background: var(--parchment);
    color: var(--ink);
    font-family: var(--sans);
    padding: 0.95rem 1rem;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  }
  summary.guide-message-row {
    list-style: none;
  }
  summary.guide-message-row::-webkit-details-marker {
    display: none;
  }
  .guide-message-row:hover {
    background: var(--parchment-2);
    transform: translateY(-1px);
  }
  .guide-message-row-parent {
    cursor: pointer;
  }
  .guide-series-accordion {
    display: grid;
    gap: 0.55rem;
  }
  .guide-series-accordion[open] > .guide-message-row-parent {
    background: var(--parchment-2);
  }
  .guide-series-accordion[open] > .guide-message-row-parent .guide-message-arrow-parent {
    transform: rotate(90deg);
  }
  .guide-series-children {
    display: grid;
    gap: 0.55rem;
    padding-left: 1.1rem;
    margin-left: 0.55rem;
    border-left: 1px solid var(--rule);
  }
  .guide-message-row.is-nested {
    background: var(--parchment-2);
  }
  .guide-message-row.is-nested .guide-message-title {
    font-size: 0.955rem;
  }
  .guide-message-row:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .guide-message-main {
    display: grid;
    gap: 0.26rem;
    min-width: 0;
  }
  .guide-message-title {
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.3;
    color: var(--ink);
    text-wrap: pretty;
  }
  .guide-message-passage {
    font-size: 0.68rem;
    color: var(--ink-4);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.25;
  }
  .guide-message-passage.is-subtitle {
    font-size: 0.84rem;
    letter-spacing: 0.01em;
    text-transform: none;
    line-height: 1.45;
    color: var(--ink-3);
    font-style: italic;
  }
  .guide-message-arrow {
    font-size: 0.95rem;
    color: var(--ink-4);
    flex-shrink: 0;
  }
  .guide-message-arrow-parent {
    display: inline-block;
    transition: transform 0.16s ease;
    transform-origin: center;
  }
  .guide-series-empty {
    border: 1px dashed var(--parchment-3);
    border-radius: 3px;
    background: var(--parchment-2);
    padding: 0.85rem 0.9rem;
    font-size: 0.8125rem;
    color: var(--ink-3);
    line-height: 1.6;
  }
  .guide-chapter-layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.25rem 2rem 3rem;
    display: grid;
    gap: 1.35rem;
  }
  .guide-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    line-height: 1.4;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-breadcrumb-link {
    border: none;
    background: none;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    cursor: pointer;
    transition: color 0.16s ease;
  }
  .guide-breadcrumb-link:hover {
    color: var(--ink-2);
  }
  .guide-breadcrumb-link:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.45);
    outline-offset: 3px;
  }
  .guide-breadcrumb-separator {
    color: var(--parchment-3);
  }
  .guide-breadcrumb-current {
    color: var(--ink-3);
  }
  .guide-chapter-back {
    justify-self: start;
  }
  .guide-chapter-back::after {
    content: '';
  }
  .guide-chapter-hero {
    position: relative;
    aspect-ratio: 21 / 8;
    border: 1px solid var(--rule);
    border-radius: 3px;
    overflow: hidden;
    background: var(--parchment-2);
  }
  .guide-chapter-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .guide-chapter-hero-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    font-family: var(--serif);
    color: var(--ink-3);
    background: linear-gradient(150deg, rgba(234,228,214,0.92), rgba(245,237,228,0.64));
  }
  .guide-chapter-hero-fallback.is-hidden {
    display: none;
  }
  .guide-chapter-header {
    display: grid;
    gap: 0.45rem;
  }
  .guide-chapter-book-label {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.2;
    color: var(--ink-2);
  }
  .guide-chapter-scripture-range {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  #guide-chapter-subtitle {
    margin-top: 0.2rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink-3);
  }
  .guide-sermon-section {
    display: grid;
    gap: 1.25rem;
    padding-top: 0.9rem;
  }
  .guide-sermon-body {
    max-width: 760px;
    display: grid;
    gap: 1.2rem;
  }
  .guide-sermon-body p {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.96;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-sermon-heading,
  .guide-sermon-subheading,
  .guide-sermon-scripture,
  .guide-sermon-editorial-label,
  .guide-sermon-label,
  .guide-sermon-callout-label,
  .guide-sermon-context-label,
  .guide-sermon-section-label,
  .guide-sermon-historical-label {
    margin: 0;
  }
  .guide-sermon-heading {
    font-family: var(--serif);
    font-size: 1.42rem;
    line-height: 1.34;
    color: var(--ink);
    margin-top: 0.85rem;
  }
  .guide-sermon-subheading {
    font-family: var(--serif);
    font-size: 1.12rem;
    line-height: 1.48;
    color: var(--ink-2);
    margin-top: 0.5rem;
  }
  .guide-sermon-scripture {
    margin-top: 0.75rem;
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--ink-2);
  }
  .guide-sermon-scripture-block {
    margin: 0.8rem 0 0.35rem;
    padding-left: 0.85rem;
    border-left: 2px solid rgba(116, 136, 121, 0.34);
    display: grid;
    gap: 0.2rem;
    cursor: pointer;
  }
  .guide-sermon-scripture-label {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--ink-2);
  }
  .guide-sermon-body p.guide-sermon-scripture-text {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.88;
    color: var(--ink-2);
  }
  .guide-sermon-scripture-block:focus-visible {
    outline: 1px solid rgba(116, 136, 121, 0.45);
    outline-offset: 3px;
  }
  .guide-sermon-body p.guide-sermon-editorial-label {
    margin-top: 0.9rem;
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: 0.015em;
    text-transform: none;
    color: var(--ink-3);
  }
  .guide-sermon-body p.guide-sermon-editorial-label.is-explanation {
    margin-top: 1rem;
    margin-bottom: 0.28rem;
    font-size: 0.95rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--ink-2);
  }
  .guide-sermon-teaching-marker {
    margin: 0.4rem 0 0.05rem;
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 600;
    color: var(--ink);
    text-wrap: balance;
  }
  .guide-sermon-label {
    font-size: 0.74rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-sermon-callout-label {
    margin-top: 0.3rem;
    padding-left: 0.8rem;
    border-left: 2px solid rgba(116, 136, 121, 0.32);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .guide-sermon-context-label {
    margin-top: 0.35rem;
    padding-left: 0.8rem;
    border-left: 2px solid rgba(116, 136, 121, 0.32);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-sermon-section-label {
    margin-top: 0.25rem;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-sermon-historical-context {
    margin: 0.5rem 0 0.35rem;
    padding: 0.8rem 0.95rem;
    border-left: 2px solid rgba(116, 136, 121, 0.32);
    background: linear-gradient(180deg, rgba(233, 228, 216, 0.38), rgba(245, 237, 228, 0.2));
  }
  .guide-sermon-historical-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 0.3rem;
  }
  .guide-sermon-historical-context p {
    margin: 0;
    font-size: 1.01rem;
    line-height: 1.82;
    color: var(--ink-2);
  }
  .guide-sermon-emphasis {
    margin: 0.45rem 0 0.2rem;
    padding: 0.45rem 0.62rem;
    background: rgba(233, 228, 216, 0.22);
    border-left: 2px solid rgba(116, 136, 121, 0.24);
    font-weight: 600;
    color: var(--ink-2);
  }
  .guide-sermon-explanation {
    margin: 0.25rem 0 0.1rem;
    padding-left: 0.72rem;
    border-left: 2px solid rgba(116, 136, 121, 0.2);
    color: var(--ink-2);
  }
  .guide-sermon-list {
    margin: 0.15rem 0 0.1rem;
    padding-left: 1.3rem;
    display: grid;
    gap: 0.65rem;
    max-width: 760px;
  }
  .guide-sermon-list li {
    font-size: 1rem;
    line-height: 1.82;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-sermon-quote {
    margin: 0.35rem 0 0.2rem;
    padding: 0.68rem 0 0.68rem 1rem;
    border-left: 2px solid rgba(116, 136, 121, 0.35);
    color: var(--ink-2);
  }
  .guide-sermon-quote p {
    font-style: italic;
  }
  .guide-inline-trigger {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    text-decoration-color: rgba(116, 136, 121, 0.6);
  }
  .guide-inline-trigger:hover,
  .guide-inline-trigger:focus-visible {
    text-decoration-color: rgba(116, 136, 121, 0.95);
    outline: none;
  }
  .guide-inline-layer {
    position: fixed;
    inset: 0;
    z-index: 60;
  }
  .guide-inline-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 20, 17, 0.2);
  }
  .guide-inline-dialog {
    position: absolute;
    width: min(640px, 90vw);
    min-width: 420px;
    max-width: 640px;
    max-height: 82vh;
    overflow: auto;
    background: linear-gradient(180deg, rgba(251, 248, 241, 0.98) 0%, rgba(246, 240, 229, 0.98) 100%);
    border: 1px solid rgba(209, 198, 177, 0.88);
    border-radius: 22px;
    box-shadow: 0 18px 44px rgba(19, 34, 30, 0.16);
    padding: 1.2rem 1.2rem 1.1rem;
    display: grid;
    gap: 0.9rem;
  }
  .guide-inline-dialog.is-centered {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  .guide-inline-dialog.is-mobile {
    left: 0 !important;
    right: 0;
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
    top: auto !important;
    bottom: 0;
    max-height: 75vh;
    overflow: auto;
    border-radius: 16px 16px 0 0;
    padding: 1rem 1rem 1.15rem;
  }
  .guide-inline-close {
    position: absolute;
    top: 0.85rem;
    right: 0.95rem;
    z-index: 1;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--ink-3);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.1rem 0.15rem;
  }
  .guide-inline-content {
    display: grid;
    gap: 0.9rem;
    padding-top: 0.15rem;
  }
  .guide-inline-head {
    display: grid;
    gap: 0.22rem;
  }
  .guide-inline-head--original-language {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    padding-right: 1.5rem;
  }
  .guide-inline-hero-copy {
    display: grid;
    gap: 0.38rem;
    min-width: 0;
  }
  .guide-inline-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.42rem;
    align-content: start;
  }
  .guide-inline-version {
    display: grid;
    gap: 0.3rem;
    margin-top: 0.1rem;
  }
  .guide-inline-version-label {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-inline-version-select {
    width: fit-content;
    min-width: 8rem;
    border: 1px solid rgba(209, 198, 177, 0.92);
    background: rgba(250, 246, 238, 0.95);
    color: var(--ink-2);
    font-size: 0.86rem;
    line-height: 1.2;
    padding: 0.35rem 0.6rem;
  }
  .guide-inline-version-select:focus-visible {
    outline: 1px solid rgba(116, 136, 121, 0.5);
    outline-offset: 2px;
  }
  .guide-inline-eyebrow {
    margin: 0;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-inline-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.5rem;
    line-height: 1.18;
    color: var(--ink);
    word-break: break-word;
  }
  .guide-inline-form {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.4;
    color: var(--ink);
  }
  .guide-inline-body {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.68;
    color: var(--ink-2);
  }
  .guide-inline-body--lead {
    max-width: 42ch;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--ink);
  }
  .guide-inline-meta {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ink-4);
  }
  .guide-inline-section {
    padding-top: 0.25rem;
    border-top: 1px solid rgba(209, 198, 177, 0.55);
    display: grid;
    gap: 0.62rem;
  }
  .guide-inline-subhead {
    margin: 0;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-inline-details p,
  .guide-inline-interlinear p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.58;
    color: var(--ink-2);
  }
  .guide-inline-details,
  .guide-inline-interlinear {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
  .guide-inline-card {
    display: grid;
    gap: 0.26rem;
    padding: 0.76rem 0.82rem;
    border: 1px solid rgba(209, 198, 177, 0.56);
    border-radius: 16px;
    background: rgba(251, 248, 241, 0.76);
  }
  .guide-inline-card-label {
    margin: 0;
    font-size: 0.67rem;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-inline-card-value {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.58;
    color: var(--ink-2);
    word-break: break-word;
  }
  .guide-inline-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(209, 198, 177, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    font-size: 0.72rem;
    line-height: 1.2;
    color: var(--ink-3);
    white-space: nowrap;
  }
  .guide-inline-pill[dir="rtl"] {
    direction: rtl;
  }
  .guide-inline-muted {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.58;
    color: var(--ink-3);
  }
  .guide-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.1rem;
  }
  @media (max-width: 700px) {
    .guide-inline-dialog {
      min-width: 0;
      padding: 1rem;
    }
    .guide-inline-head--original-language {
      grid-template-columns: 1fr;
      gap: 0.7rem;
      padding-right: 0;
    }
    .guide-inline-badges {
      justify-content: flex-start;
    }
    .guide-inline-details,
    .guide-inline-interlinear {
      grid-template-columns: 1fr;
    }
    .guide-inline-actions {
      justify-content: stretch;
    }
    .guide-inline-actions .btn-primary {
      width: 100%;
      text-align: center;
    }
  }
  .guide-sermon-placeholder {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.72;
    color: var(--ink-3);
    font-style: italic;
  }
  .guide-chapter-block {
    display: grid;
    gap: 0.95rem;
    padding-top: 1.9rem;
    border-top: 1px solid var(--rule);
  }
  .guide-chapter-prose {
    max-width: 760px;
    display: grid;
    gap: 0.9rem;
  }
  .guide-chapter-prose p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.78;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-theme-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem 1rem;
  }
  .guide-theme-item {
    display: grid;
    gap: 0.22rem;
    padding: 0.8rem 0.9rem;
    background: linear-gradient(180deg, rgba(245, 237, 228, 0.82), rgba(245, 237, 228, 0.35));
    flex: 1 1 320px;
    max-width: 100%;
  }
  .guide-theme-item.is-compact {
    display: block;
    padding: 0;
    background: none;
    flex: 0 0 auto;
  }
  .guide-theme-chip {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    min-height: 32px;
    padding: 0.45rem 0.78rem;
    border-radius: 999px;
    background: rgba(234, 228, 214, 0.9);
    color: var(--ink);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .guide-theme-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.65;
    color: var(--ink-3);
  }
  .guide-study-guide,
  .guide-chapter-movement,
  .guide-chapter-reflection,
  .guide-chapter-application {
    display: grid;
    gap: 1.1rem;
  }
  .guide-study-band {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, rgba(245, 237, 228, 0.9), rgba(245, 237, 228, 0.45));
  }
  .guide-study-band-label {
    margin: 0 0 0.18rem;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-study-band-copy {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.08rem;
    line-height: 1.5;
    color: var(--ink);
    text-wrap: pretty;
  }
  .guide-study-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
    align-items: start;
  }
  .guide-study-block {
    display: grid;
    gap: 0.55rem;
    align-content: start;
    align-self: start;
  }
  .guide-study-block h3,
  .guide-reflection-item h3,
  .guide-application-item h3,
  .guide-keyword-term {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.06rem;
    line-height: 1.28;
    color: var(--ink);
  }
  .guide-study-block p,
  .guide-reflection-item p,
  .guide-application-item p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.72;
    color: var(--ink-2);
    text-wrap: pretty;
  }
  .guide-study-list,
  .guide-application-list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.52rem;
  }
  .guide-study-list li,
  .guide-application-list li {
    font-size: 0.84rem;
    line-height: 1.66;
    color: var(--ink-2);
  }
  .guide-movement-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.9rem;
    counter-reset: guide-movement;
  }
  .guide-movement-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
  }
  .guide-movement-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(234, 228, 214, 0.92);
    color: var(--ink);
    font-size: 0.78rem;
    font-weight: 600;
    flex-shrink: 0;
  }
  .guide-movement-copy {
    display: grid;
    gap: 0.2rem;
  }
  .guide-movement-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.35;
    color: var(--ink);
  }
  .guide-movement-note {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.68;
    color: var(--ink-3);
  }
  .guide-reflection-grid,
  .guide-application-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.5rem;
  }
  .guide-reflection-item,
  .guide-application-item {
    display: grid;
    gap: 0.55rem;
  }
  .guide-keyword-list {
    display: grid;
    gap: 1rem;
  }
  .guide-keyword-item {
    display: grid;
    gap: 0.42rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(209, 198, 177, 0.7);
  }
  .guide-keyword-item:first-child {
    padding-top: 0;
    border-top: none;
  }
  .guide-keyword-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    align-items: center;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--ink-4);
  }
  .guide-keyword-reference,
  .guide-keyword-greek {
    display: inline-flex;
    align-items: center;
  }
  .guide-scripture-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, rgba(245, 237, 228, 0.9), rgba(245, 237, 228, 0.45));
  }
  .guide-scripture-copy {
    margin: 0;
    max-width: 620px;
    font-size: 0.875rem;
    line-height: 1.72;
    color: var(--ink-3);
  }
  .guide-scripture-cta {
    flex-shrink: 0;
  }
  #guide-chapter-related.guide-related-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem 1.65rem;
    align-items: start;
  }
  .guide-related-group {
    display: grid;
    gap: 0.78rem;
    align-content: start;
  }
  .guide-related-group + .guide-related-group {
    margin-top: 0;
  }
  .guide-related-group-title {
    margin: 0;
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.4;
    color: var(--ink);
  }
  .guide-related-group .guide-related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.72rem;
  }
  .guide-discussion-details {
    max-width: 820px;
  }
  .guide-discussion-summary {
    cursor: pointer;
    list-style: none;
    user-select: none;
  }
  .guide-discussion-summary::-webkit-details-marker {
    display: none;
  }
  .guide-discussion-summary .guides-col-label::after {
    content: ' (optional)';
    color: var(--ink-4);
    letter-spacing: 0.06em;
    font-size: 0.66rem;
  }
  .guide-discussion-list {
    margin-top: 1rem;
  }
  .guide-discussion-questions {
    margin: 0;
    padding-left: 1.1rem;
    max-width: 820px;
    display: grid;
    gap: 0.62rem;
  }
  .guide-discussion-questions li {
    font-size: 0.89rem;
    line-height: 1.74;
    color: var(--ink-3);
  }
  .guide-related-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.42rem 0.68rem;
    border: none;
    border-radius: 999px;
    background: rgba(234, 228, 214, 0.76);
    color: var(--ink-3);
    font-size: 0.74rem;
    line-height: 1.3;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
  }
  .guide-related-link:hover {
    background: rgba(223, 211, 188, 0.86);
    color: var(--ink);
  }
  .guide-related-link:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.45);
    outline-offset: 2px;
  }
  .guide-related-controls {
    grid-column: 1 / -1;
    margin-top: 0.35rem;
    display: flex;
    justify-content: flex-start;
  }
  #guide-chapter-related-wrap {
    padding-bottom: 0.65rem;
  }
  #guide-chapter-discussion-wrap {
    padding-top: 2rem;
  }
  #guide-chapter-scripture-copy {
    margin-bottom: 0.15rem;
  }
  .guide-chapter-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding-top: 0.9rem;
    padding-bottom: 1rem;
  }
  .guide-chapter-nav-link,
  .guide-chapter-nav-empty {
    min-height: 92px;
    border: none;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(245, 237, 228, 0.9), rgba(245, 237, 228, 0.45));
    padding: 0.95rem 1rem;
    display: grid;
    gap: 0.32rem;
    align-content: center;
  }
  .guide-chapter-nav-link {
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  }
  .guide-chapter-nav-link:hover {
    background: rgba(234, 228, 214, 0.92);
    transform: translateY(-1px);
  }
  .guide-chapter-nav-link:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .guide-chapter-nav-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .guide-chapter-nav-title {
    font-family: var(--serif);
    font-size: 1rem;
    line-height: 1.3;
    color: var(--ink);
  }
  .guide-chapter-nav-meta {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--ink-3);
    font-style: italic;
  }
  .guide-chapter-nav-empty {
    opacity: 0.55;
  }
  .guides-col-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rule);
    margin-bottom: 1.25rem;
  }
  .guide-row {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font-family: var(--sans);
    padding: 1rem 0;
    border-bottom: 1px solid var(--rule);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: padding-left 0.15s;
  }
  .guide-row:hover { padding-left: 4px; }
  .guide-row:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .guide-row:hover .guide-arrow { color: var(--sienna); }
  .guide-meta { font-size: 0.6875rem; color: var(--ink-4); margin-bottom: 3px; }
  .guide-name { font-family: var(--serif); font-size: 1rem; font-weight: 500; color: var(--ink); }
  .guide-arrow { font-size: 0.875rem; color: var(--ink-4); transition: color 0.15s; }

  /* ══════════════════════════════════════════════════════
     APOLOGETICS PAGE
  ══════════════════════════════════════════════════════ */
  .apologetics-page-shell {
    width: min(1240px, calc(100vw - 4rem));
    overflow-x: clip;
    margin: 0 auto;
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .apologetics-hero-surface {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(130, 103, 73, 0.14);
    border-radius: 24px;
    background-color: #fbf6ec;
    background-image:
      linear-gradient(90deg, rgba(252, 248, 241, 0.985) 0%, rgba(252, 248, 241, 0.965) 26%, rgba(251, 244, 235, 0.87) 49%, rgba(250, 241, 229, 0.67) 73%, rgba(250, 241, 229, 0.4) 100%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.12) 52%, rgba(251, 246, 236, 0.62) 100%),
      url('/assets/images/apologetics-hero-background.webp');
    background-position: 0 0, 0 0, center right;
    background-repeat: no-repeat, no-repeat, no-repeat;
    background-size: cover, cover, cover;
    box-shadow: 0 24px 56px rgba(72, 50, 28, 0.09);
  }
  .apologetics-hero-surface::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 84px;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(251, 246, 236, 0) 0%, rgba(251, 246, 236, 0.22) 42%, rgba(251, 246, 236, 0.84) 100%);
  }
  .apologetics-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
  }
  .apologetics-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 2rem;
    align-items: start;
    padding: 2.8rem 2.5rem 2.5rem;
    position: relative;
    z-index: 1;
  }
  .apologetics-hero-copy {
    max-width: 44rem;
  }
  .apologetics-search-form {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  .apologetics-search-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .apologetics-search-field {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .apologetics-search-input {
    flex: 1 1 320px;
    min-width: 0;
    padding: 0.92rem 1.15rem;
    background: var(--parchment);
    border: 1px solid var(--rule);
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.95rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  }
  .apologetics-search-input::placeholder { color: var(--ink-4); }
  .apologetics-search-input:focus-visible {
    border-color: rgba(160, 82, 45, 0.55);
    box-shadow: 0 0 0 3px rgba(160, 82, 45, 0.09);
  }
  .apologetics-autocomplete {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.45rem);
    left: 0;
    width: min(100%, 36rem);
    max-height: min(22rem, calc(100vh - 2rem));
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid var(--rule);
    border-radius: 1rem;
    background: var(--parchment);
    box-shadow: var(--elev-2);
  }
  .apologetics-autocomplete-list {
    display: grid;
    gap: 0.15rem;
  }
  .apologetics-autocomplete-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.72rem 0.8rem;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    text-align: left;
    cursor: pointer;
  }
  .apologetics-autocomplete-option:hover,
  .apologetics-autocomplete-option.is-active {
    background: var(--parchment-2);
    color: var(--ink);
  }
  .apologetics-autocomplete-question {
    font-size: 0.84rem;
    line-height: 1.35;
  }
  .apologetics-autocomplete-category {
    flex: 0 0 auto;
    color: var(--ink-4);
    font-size: 0.67rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .apologetics-search-reset {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.88rem 1.05rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--parchment-2);
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  }
  .apologetics-search-reset:hover {
    border-color: var(--sienna-lt);
    color: var(--ink);
    background: var(--parchment);
    transform: translateY(-1px);
  }
  .apologetics-search-reset:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
  }
  .apologetics-search-reset:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-search-hint {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--ink-3);
  }
  .apologetics-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.1rem;
  }
  .apologetics-hero-browse-button {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.84rem 1.05rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 37, 23, 0.18);
    background: var(--navy);
    color: var(--sand);
    font-family: var(--sans);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--elev-1);
    transition: transform 0.3s var(--ease-premium), background 0.2s ease, box-shadow 0.3s var(--ease-premium);
  }
  .apologetics-hero-browse-button:hover {
    background: var(--navy-2);
    transform: translateY(-2px);
    box-shadow: var(--elev-2);
  }
  .apologetics-hero-browse-button:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.56);
    outline-offset: 2px;
  }
  .apologetics-search-examples,
  .apologetics-summary-chips,
  .apologetics-answer-meta,
  .apologetics-answer-features,
  .apologetics-question-tags,
  .apologetics-related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .apologetics-example-chip,
  .apologetics-summary-chip,
  .apologetics-answer-chip,
  .apologetics-answer-feature,
  .apologetics-tag-pill,
  .apologetics-related-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(130, 103, 73, 0.18);
    background: rgba(255, 255, 255, 0.5);
    color: var(--ink-2);
    font-size: 0.72rem;
    line-height: 1;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  }
  .apologetics-example-chip,
  .apologetics-summary-chip,
  .apologetics-answer-chip,
  .apologetics-answer-feature,
  .apologetics-tag-pill {
    padding: 0.48rem 0.72rem;
  }
  .apologetics-example-chip,
  .apologetics-summary-chip,
  .apologetics-answer-chip {
    border-color: rgba(130, 103, 73, 0.14);
    background: var(--parchment-2);
    color: var(--ink-3);
    font-weight: 600;
  }
  .apologetics-example-chip,
  .apologetics-category-card,
  .apologetics-carousel-button,
  .apologetics-search-reset {
    cursor: pointer;
  }
  .apologetics-example-chip {
    border-radius: 999px;
  }
  .apologetics-example-chip:hover,
  .apologetics-related-link:hover {
    border-color: var(--sienna-lt);
    color: var(--ink);
    background: rgba(255, 255, 255, 0.75);
    transform: translateY(-1px);
  }
  .apologetics-example-chip:focus-visible,
  .apologetics-related-link:focus-visible,
  .apologetics-category-card:focus-visible,
  .apologetics-carousel-button:focus-visible,
  .apologetics-category-spotlight-link:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-filter-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.35rem;
  }
  .apologetics-summary-copy {
    font-size: 0.83rem;
    color: var(--ink-3);
    line-height: 1.6;
  }
  .apologetics-hero-panel {
    position: sticky;
    top: 82px;
    align-self: start;
  }
  .apologetics-value-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
  .apologetics-value-card {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.1rem 1.1rem 1rem;
    border: 1px solid rgba(130, 103, 73, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(252, 248, 241, 0.9), rgba(255, 255, 255, 0.84));
    box-shadow: 0 12px 30px rgba(72, 50, 28, 0.05);
  }
  .apologetics-value-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.16), rgba(16, 37, 23, 0.07));
    border: 1px solid rgba(217, 119, 6, 0.16);
  }
  .apologetics-value-icon svg {
    width: 1.3rem;
    height: 1.3rem;
  }
  .apologetics-value-copy {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-width: 0;
  }
  .apologetics-value-title {
    font-family: var(--serif);
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.25;
  }
  .apologetics-value-text {
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--ink-3);
  }
  .apologetics-panel-label,
  .apologetics-section-kicker,
  .apologetics-answer-kicker,
  .apologetics-answer-section-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .apologetics-panel-label {
    margin-bottom: 0.65rem;
  }
  .apologetics-answer-card {
    background: linear-gradient(180deg, rgba(252, 248, 240, 0.97) 0%, rgba(255, 255, 255, 0.94) 100%);
    border: 1px solid rgba(130, 103, 73, 0.16);
    border-radius: 4px;
    box-shadow: 0 18px 42px rgba(76, 54, 32, 0.08), var(--elev-1);
    overflow: hidden;
  }
  .apologetics-answer-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-answer-panel-inner {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.05rem 0.95rem;
  }
  .apologetics-answer-panel-inner--detail {
    gap: 1rem;
    padding: 1.15rem 1.2rem 1.1rem;
  }
  .apologetics-answer-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.92fr);
    gap: 1.1rem;
    align-items: start;
  }
  .apologetics-answer-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .apologetics-answer-aside {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(130, 103, 73, 0.13);
    min-width: 0;
  }
  .apologetics-answer-aside-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  .apologetics-answer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.7rem;
  }
  .apologetics-answer-title {
    font-family: var(--serif);
    font-size: 1.14rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-top: 0.14rem;
    line-height: 1.2;
  }
  .apologetics-answer-meta {
    justify-content: flex-end;
  }
  .apologetics-answer-short {
    margin: 0;
    color: var(--ink-2);
    line-height: 1.58;
    font-size: 0.9rem;
  }
  .apologetics-answer-panel-inner--detail .apologetics-answer-short {
    font-size: 0.96rem;
    line-height: 1.72;
  }
  .apologetics-answer-short-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    border: 1px solid rgba(217, 119, 6, 0.26);
    border-left: 4px solid rgba(217, 119, 6, 0.88);
    background: linear-gradient(180deg, rgba(252, 246, 236, 0.98), rgba(255, 255, 255, 0.94));
    box-shadow: 0 10px 26px rgba(72, 50, 28, 0.05);
  }
  .apologetics-answer-short-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }
  .apologetics-answer-short-icon {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sienna);
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.18);
    flex-shrink: 0;
  }
  .apologetics-answer-short-icon svg {
    width: 0.88rem;
    height: 0.88rem;
  }
  .apologetics-answer-short-label {
    font-family: var(--sans);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--sienna);
  }
  .apologetics-answer-features {
    gap: 0.38rem;
  }
  .apologetics-answer-section {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  .apologetics-answer-section + .apologetics-answer-section {
    margin-top: 0.1rem;
  }
  .apologetics-answer-section-label {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .apologetics-answer-paragraph {
    font-size: 0.94rem;
    line-height: 1.78;
    color: var(--ink-2);
  }
  .apologetics-answer-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-left: 1.15rem;
    color: var(--ink-2);
    line-height: 1.72;
  }
  .apologetics-answer-list li {
    font-size: 0.92rem;
  }
  .apologetics-answer-feature {
    padding: 0.36rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(130, 103, 73, 0.14);
    background: rgba(255, 255, 255, 0.56);
    color: var(--ink-3);
    font-size: 0.61rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .apologetics-answer-actions {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    flex-wrap: wrap;
  }
  .apologetics-answer-link {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.76rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 37, 23, 0.18);
    background: var(--navy);
    color: var(--sand);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--elev-1);
    transition: transform 0.3s var(--ease-premium), background 0.2s ease, box-shadow 0.3s var(--ease-premium);
  }
  .apologetics-answer-link:hover {
    background: var(--navy-2);
    color: var(--sand);
    transform: translateY(-2px);
    box-shadow: var(--elev-2);
  }
  .apologetics-answer-link:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    box-shadow: var(--elev-1);
  }
  .apologetics-answer-link:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.56);
    outline-offset: 2px;
  }
  .apologetics-answer-actions--detail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
    padding-top: 1rem;
    margin-top: 0.15rem;
    border-top: 1px solid rgba(130, 103, 73, 0.12);
  }
  .apologetics-answer-link--nav {
    width: 100%;
    min-height: 5.95rem;
    justify-content: space-between;
    align-items: center;
    padding: 1.04rem 1rem;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 245, 237, 0.96) 100%);
    border-color: rgba(130, 103, 73, 0.14);
    color: var(--ink);
    text-align: left;
    box-shadow: 0 14px 30px rgba(42, 30, 18, 0.08);
  }
  .apologetics-answer-link--nav:hover {
    background: rgba(255, 255, 255, 1);
    color: var(--ink);
    border-color: rgba(217, 119, 6, 0.22);
    box-shadow: 0 18px 36px rgba(42, 30, 18, 0.11);
  }
  .apologetics-answer-link--nav .apologetics-answer-link-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.34rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .apologetics-answer-link-label {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    text-transform: none;
  }
  .apologetics-answer-link-subtitle {
    font-size: 0.74rem;
    line-height: 1.35;
    font-weight: 500;
    color: var(--ink-3);
    text-transform: none;
    letter-spacing: 0;
  }
  .apologetics-answer-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: var(--sienna);
    background: rgba(217, 119, 6, 0.1);
    border: 1px solid rgba(217, 119, 6, 0.18);
    flex-shrink: 0;
    font-size: 1.05rem;
    line-height: 1;
  }
  .apologetics-answer-link--primary {
    background: linear-gradient(180deg, #1b3220 0%, #0f2115 100%);
    color: var(--sand);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 16px 36px rgba(10, 18, 12, 0.32);
  }
  .apologetics-answer-link--primary:hover {
    background: linear-gradient(180deg, #223c28 0%, #132719 100%);
    color: var(--sand);
  }
  .apologetics-answer-link--primary .apologetics-answer-link-copy {
    padding-right: 0.15rem;
  }
  .apologetics-answer-link--primary .apologetics-answer-link-label {
    color: #f4ead6;
  }
  .apologetics-answer-link--primary .apologetics-answer-link-subtitle {
    color: rgba(255, 255, 255, 0.82);
  }
  .apologetics-answer-link--primary .apologetics-answer-link-icon {
    color: var(--sand);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.11);
  }
  .apologetics-answer-link--nav[disabled] {
    opacity: 0.45;
  }
  .apologetics-answer-link--nav[disabled]:hover {
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    transform: none;
  }
  .apologetics-answer-aside .apologetics-related-links {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  .apologetics-related-link {
    width: 100%;
    justify-content: space-between;
    align-items: center;
    padding: 0.83rem 0.88rem 0.83rem 0.95rem;
    border-radius: 14px;
    border: 1px solid rgba(130, 103, 73, 0.16);
    background: rgba(255, 255, 255, 0.85);
    color: var(--ink);
    font-size: 0.86rem;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 8px 20px rgba(42, 30, 18, 0.05);
  }
  .apologetics-related-link-copy {
    min-width: 0;
  }
  .apologetics-related-link-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    color: var(--ink);
    font-size: 1.15rem;
    flex-shrink: 0;
  }
  .apologetics-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 80;
  }
  .apologetics-modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: default;
    background: var(--color-dialog-backdrop);
    backdrop-filter: blur(3px) saturate(0.92);
    -webkit-backdrop-filter: blur(3px) saturate(0.92);
  }
  .apologetics-modal {
    position: absolute;
    inset: 50% auto auto 50%;
    width: min(960px, calc(100vw - 2.5rem));
    max-height: 85vh;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-dialog-surface);
    border: 1px solid var(--color-border);
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(28, 34, 30, 0.24);
  }
  .apologetics-modal:focus-visible {
    outline: none;
  }
  .apologetics-modal-body {
    overflow: auto;
    padding: 1.15rem 1.15rem 1.25rem;
    scrollbar-width: thin;
  }
  .apologetics-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.9rem;
    z-index: 2;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(36, 31, 22, 0.08);
  }
  .apologetics-modal-close:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-muted);
  }
  .apologetics-modal-close:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-modal .apologetics-answer-panel-inner--detail {
    padding-top: 0.15rem;
  }
  .apologetics-modal .apologetics-answer-actions--detail {
    padding-top: 0.95rem;
  }
  .apologetics-answer-empty,
  .apologetics-empty-state {
    padding: 1.35rem;
    background: var(--parchment);
    border: 1px solid var(--rule);
    border-radius: 4px;
    box-shadow: var(--elev-1);
  }
  .apologetics-answer-empty-title,
  .apologetics-empty-state-title {
    font-family: var(--serif);
    font-size: 1.05rem;
    color: var(--ink);
    margin-bottom: 0.45rem;
  }
  .apologetics-answer-empty-copy,
  .apologetics-empty-state-copy {
    font-size: 0.86rem;
    line-height: 1.65;
    color: var(--ink-3);
  }
  .apologetics-answer-empty--not-found {
    background: linear-gradient(180deg, rgba(246, 238, 227, 0.96), rgba(255, 255, 255, 0.94));
  }
  .apologetics-state {
    padding: 1.1rem;
    border: 1px solid var(--color-border, var(--rule));
    border-radius: 0.5rem;
    background: var(--color-surface-muted, var(--parchment));
    color: var(--color-text-secondary, var(--ink-3));
  }
  .apologetics-state--compact { padding: 0.9rem 1rem; }
  .apologetics-state-title,
  .apologetics-state-label { margin: 0 0 0.45rem; color: var(--color-text-heading, var(--ink)); font-family: var(--serif); font-size: 1.05rem; }
  .apologetics-state-copy { margin: 0 0 0.8rem; line-height: 1.55; }
  .apologetics-state-action,
  .apologetics-background-refresh-failure button { border: 1px solid var(--color-border-strong, var(--rule)); border-radius: 999px; background: var(--color-surface-raised, var(--paper)); color: var(--color-text, var(--ink)); padding: 0.5rem 0.8rem; cursor: pointer; }
  .apologetics-state--loading { display: grid; gap: 0.65rem; }
  .apologetics-state--loading .keryg-skeleton-text { display: grid; gap: 0.42rem; }
  .apologetics-state--loading .keryg-skeleton { display: block; height: 0.75rem; border-radius: 0.25rem; background: color-mix(in srgb, var(--color-border) 55%, transparent); }
  .apologetics-state--loading .keryg-skeleton:nth-child(3) { width: 72%; }
  .apologetics-bootstrap-status { min-height: 1.45rem; margin-top: 0.65rem; }
  .apologetics-refresh-status,
  .apologetics-background-refresh-failure { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.8rem; color: var(--color-text-secondary, var(--ink-3)); }
  .apologetics-background-refresh-failure { flex-wrap: wrap; padding: 0.5rem 0.7rem; border: 1px solid var(--color-border, var(--rule)); border-radius: 0.45rem; }
  .apologetics-question-detail-loading { min-height: 22rem; }
  @media (max-width: 600px) {
    .apologetics-state { padding: 0.9rem; }
    .apologetics-background-refresh-failure { align-items: flex-start; }
  }
  .apologetics-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .apologetics-catalog-section {
    padding-top: 0.4rem;
  }
  .apologetics-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
  }
  .apologetics-catalog-head {
    align-items: flex-start;
  }
  .apologetics-catalog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
  }
  .apologetics-section-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin-top: 0.35rem;
  }
  .apologetics-section-copy {
    max-width: 56ch;
    margin-top: 0.55rem;
    font-size: 0.92rem;
    line-height: 1.68;
    color: var(--ink-3);
  }
  #apologetics-catalog-shell,
  #apologetics-catalog-heading,
  #apologetics-carousel-heading,
  #apologetics-category-heading,
  #apologetics-quick-heading,
  #apologetics-perspective-heading,
  #apologetics-trending-heading {
    scroll-margin-top: 96px;
  }
  .apologetics-carousel-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
  }
  .apologetics-carousel-button {
    padding: 0.74rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--parchment-2);
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s, opacity 0.15s;
  }
  .apologetics-carousel-button:hover:not(:disabled) {
    border-color: var(--sienna-lt);
    background: var(--parchment);
    color: var(--ink);
    transform: translateY(-1px);
  }
  .apologetics-carousel-button:disabled {
    opacity: 0.45;
    cursor: default;
  }
  .apologetics-carousel {
    position: relative;
  }
  .apologetics-carousel-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 340px);
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.35rem;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 0.2rem;
    scrollbar-width: none;
    outline: none;
  }
  .apologetics-carousel-track::-webkit-scrollbar { display: none; }
  .apologetics-question-card {
    appearance: none;
    -webkit-appearance: none;
    background: var(--parchment);
    border: 1px solid var(--rule);
    border-radius: 4px;
    box-shadow: var(--elev-1);
  }
  .apologetics-question-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.1rem 1.15rem 1rem;
    min-height: 100%;
    scroll-snap-align: start;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    width: 100%;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
    background-clip: padding-box;
  }
  .apologetics-question-card:hover,
  .apologetics-question-card.is-active {
    border-color: rgba(160, 82, 45, 0.3);
    box-shadow: var(--elev-2);
    transform: translateY(-1px);
  }
  .apologetics-question-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-question-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .apologetics-question-category,
  .apologetics-category-count {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-4);
  }
  .apologetics-question-difficulty {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.58rem;
    border-radius: 999px;
    background: rgba(160, 82, 45, 0.08);
    color: var(--sienna);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .apologetics-question-title {
    font-family: var(--serif);
    font-size: 1.07rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    line-height: 1.34;
  }
  .apologetics-question-answer {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink-2);
  }
  .apologetics-question-tags {
    margin-top: auto;
  }
  .apologetics-tag-pill {
    background: rgba(160, 82, 45, 0.05);
    color: var(--ink-3);
  }
  .apologetics-question-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.1rem;
    color: var(--sienna);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.15s, transform 0.15s;
  }
  .apologetics-question-link::after {
    content: '→';
    font-size: 0.9rem;
  }
  .apologetics-question-link:hover { color: var(--ink); transform: translateX(2px); }
  .apologetics-question-link:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-category-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
    gap: 1.2rem;
    align-items: start;
  }
  .apologetics-category-spotlight {
    position: sticky;
    top: 82px;
    align-self: start;
  }
  .apologetics-category-spotlight-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.35rem;
    border: 1px solid var(--rule);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(251, 247, 239, 0.98), rgba(255, 255, 255, 0.9));
    box-shadow: var(--elev-1);
  }
  .apologetics-category-spotlight-card.is-active {
    border-color: rgba(160, 82, 45, 0.32);
    background: linear-gradient(180deg, rgba(245, 236, 223, 0.96), rgba(255, 255, 255, 0.92));
  }
  .apologetics-category-spotlight-back {
    align-self: flex-start;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.15rem 0;
    border: 0;
    background: transparent;
    color: var(--sienna);
    font: 600 0.72rem/1.3 var(--sans);
    letter-spacing: 0.05em;
    cursor: pointer;
  }
  .apologetics-category-spotlight-back:hover {
    color: var(--ink);
  }
  .apologetics-category-spotlight-back:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 3px;
    border-radius: 2px;
  }
  .apologetics-category-spotlight-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }
  .apologetics-category-spotlight-kicker {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .apologetics-category-spotlight-title {
    margin-top: 0.35rem;
    font-family: var(--serif);
    font-size: 1.55rem;
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: var(--ink);
  }
  .apologetics-category-spotlight-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.5rem 0.72rem;
    border-radius: 999px;
    background: var(--navy);
    color: var(--sand);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .apologetics-category-spotlight-copy {
    font-size: 0.92rem;
    line-height: 1.72;
    color: var(--ink-2);
  }
  .apologetics-category-spotlight-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .apologetics-category-spotlight-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .apologetics-category-spotlight-link {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    border-color: rgba(160, 82, 45, 0.18);
    background: rgba(255, 255, 255, 0.72);
    color: var(--sienna);
    box-shadow: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
  }
  .apologetics-category-spotlight-link:hover {
    border-color: rgba(160, 82, 45, 0.3);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
  }
  .apologetics-category-spotlight-cta {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(16, 37, 23, 0.18);
    background: var(--navy);
    color: var(--sand);
    font-family: var(--sans);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    box-shadow: var(--elev-1);
    transition: transform 0.3s var(--ease-premium), background 0.2s ease, box-shadow 0.3s var(--ease-premium);
  }
  .apologetics-category-spotlight-cta:hover {
    background: var(--navy-2);
    transform: translateY(-2px);
    box-shadow: var(--elev-2);
  }
  .apologetics-category-spotlight-cta:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.56);
    outline-offset: 2px;
  }
  .apologetics-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .apologetics-category-card {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    border: 1px solid var(--rule);
    background: var(--parchment);
    border-radius: 4px;
    padding: 1rem;
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    text-align: left;
    cursor: pointer;
    background-clip: padding-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
    box-shadow: var(--elev-1);
  }
  .apologetics-category-card:hover {
    border-color: rgba(160, 82, 45, 0.24);
    box-shadow: var(--elev-2);
  }
  .apologetics-category-card:active {
    transform: none;
  }
  .apologetics-category-card.is-active {
    border-color: rgba(160, 82, 45, 0.24);
    background: linear-gradient(180deg, rgba(247, 241, 232, 0.98), rgba(255, 255, 255, 0.92));
    box-shadow: var(--elev-2), inset 0 0 0 1px rgba(160, 82, 45, 0.08);
  }
  .apologetics-category-marker {
    width: 2.65rem;
    height: 2.65rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(160, 82, 45, 0.12), rgba(160, 82, 45, 0.06));
    color: var(--sienna);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
  }
  .apologetics-category-body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .apologetics-category-explorer-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
  }
  .apologetics-category-explorer-layer[hidden] {
    display: none !important;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
  }
  .apologetics-category-explorer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: default;
    background: var(--color-dialog-backdrop);
    backdrop-filter: blur(3px) saturate(0.92);
    -webkit-backdrop-filter: blur(3px) saturate(0.92);
  }
  .apologetics-category-explorer {
    position: relative;
    width: min(960px, calc(100vw - 2.5rem));
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-dialog-surface);
    border: 1px solid var(--color-border);
    border-radius: 26px;
    box-shadow: 0 30px 70px rgba(28, 34, 30, 0.24);
  }
  .apologetics-category-explorer:focus-visible {
    outline: none;
  }
  .apologetics-category-explorer-body {
    overflow: auto;
    padding: 1.15rem 1.15rem 1.25rem;
    scrollbar-width: thin;
  }
  .apologetics-category-explorer-close {
    position: absolute;
    top: 0.85rem;
    right: 0.9rem;
    z-index: 2;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(36, 31, 22, 0.08);
  }
  .apologetics-category-explorer-close:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-muted);
  }
  .apologetics-category-explorer-close:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-category-explorer-shell {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
  }
  .apologetics-category-explorer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-right: 2.4rem;
  }
  .apologetics-category-explorer-kicker {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .apologetics-category-explorer-title {
    margin-top: 0.35rem;
    font-family: var(--serif);
    font-size: 1.55rem;
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: var(--ink);
  }
  .apologetics-category-explorer-copy {
    margin-top: 0.4rem;
    font-size: 0.92rem;
    line-height: 1.72;
    color: var(--ink-2);
    max-width: 44rem;
  }
  .apologetics-category-explorer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
  }
  .apologetics-category-explorer-search {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }
  .apologetics-category-explorer-search-label {
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-3);
  }
  .apologetics-category-explorer-search-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
  }
  .apologetics-category-explorer-search-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.92rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--parchment-2);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 0.92rem;
    line-height: 1.4;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
  }
  .apologetics-category-explorer-search-input::placeholder {
    color: var(--ink-4);
  }
  .apologetics-category-explorer-clear,
  .apologetics-category-explorer-load-more,
  .apologetics-category-explorer-question {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .apologetics-category-explorer-clear,
  .apologetics-category-explorer-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.88rem 1.02rem;
    border-radius: 999px;
    border: 1px solid var(--rule);
    background: var(--parchment-2);
    color: var(--ink-3);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s, opacity 0.15s;
  }
  .apologetics-category-explorer-clear:hover:not(:disabled),
  .apologetics-category-explorer-load-more:hover:not(:disabled) {
    border-color: var(--sienna-lt);
    background: var(--parchment);
    color: var(--ink);
    transform: translateY(-1px);
  }
  .apologetics-category-explorer-clear:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
  }
  .apologetics-category-explorer-results {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }
  .apologetics-category-explorer-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .apologetics-category-explorer-results-copy {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--ink-3);
  }
  .apologetics-category-explorer-list {
    display: grid;
    gap: 0.7rem;
  }
  .apologetics-category-explorer-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 4px;
    border: 1px solid var(--rule);
    background: var(--parchment);
    color: var(--ink);
    text-align: left;
    box-shadow: var(--elev-1);
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s, background 0.15s;
  }
  .apologetics-category-explorer-question:hover {
    border-color: rgba(160, 82, 45, 0.24);
    box-shadow: var(--elev-2);
    transform: translateY(-1px);
  }
  .apologetics-category-explorer-perspective {
    display: grid;
    gap: 0.55rem;
  }
  .apologetics-category-explorer-perspective-content {
    padding: 0 0.95rem 0.65rem;
    color: var(--ink-2);
    font-size: 0.86rem;
    line-height: 1.62;
  }
  .apologetics-category-explorer-perspective-content .apologetics-answer-paragraph {
    margin: 0;
  }
  .apologetics-category-explorer-perspective-content .apologetics-answer-paragraph + .apologetics-answer-paragraph {
    margin-top: 0.55rem;
  }
  .apologetics-category-explorer-perspective-content .apologetics-answer-list {
    margin: 0.2rem 0 0;
    padding-left: 1.35rem;
  }
  .apologetics-category-explorer-question-title {
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
  }
  .apologetics-category-explorer-question-arrow {
    flex-shrink: 0;
    color: var(--sienna);
    font-size: 1.15rem;
    line-height: 1;
  }
  .apologetics-category-explorer-empty,
  .apologetics-category-explorer-loading {
    margin-top: 0.15rem;
  }
  .apologetics-category-headline {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
  }
  .apologetics-category-title {
    font-family: var(--serif);
    font-size: 1.08rem;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.22;
  }
  .apologetics-category-description {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--ink-3);
    max-width: 26ch;
  }
  .apologetics-category-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.28rem 0.54rem;
    border-radius: 999px;
    border: 1px solid rgba(160, 82, 45, 0.09);
    background: rgba(160, 82, 45, 0.04);
    color: var(--sienna);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-transform: none;
    font-variant-numeric: tabular-nums;
  }
  .apologetics-category-action {
    font-size: 0.61rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--ink-4);
    opacity: 0.76;
  }
  .apologetics-category-selection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    width: fit-content;
    color: var(--sienna);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .apologetics-question-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .apologetics-catalog-grid {
    margin-top: 0.15rem;
  }
  .apologetics-perspective-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .apologetics-perspective-card {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    padding: 1.15rem 1.15rem 1.1rem;
    border: 1px solid rgba(130, 103, 73, 0.14);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(249, 246, 240, 0.98), rgba(255, 255, 255, 0.92));
    box-shadow: var(--elev-1);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.15s ease, color 0.15s ease;
  }
  .apologetics-perspective-card:hover {
    border-color: rgba(160, 82, 45, 0.18);
    box-shadow: var(--elev-2);
    transform: translateY(-1px);
  }
  .apologetics-perspective-card.is-active {
    border-color: rgba(160, 82, 45, 0.22);
    background: linear-gradient(180deg, rgba(246, 242, 234, 0.98), rgba(255, 255, 255, 0.96));
    box-shadow: var(--elev-2), inset 0 0 0 1px rgba(160, 82, 45, 0.06);
  }
  .apologetics-perspective-card:focus-visible {
    outline: 2px solid rgba(160, 82, 45, 0.5);
    outline-offset: 2px;
  }
  .apologetics-perspective-head {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }
  .apologetics-perspective-title {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.24;
    letter-spacing: -0.01em;
    color: var(--ink);
  }
  .apologetics-perspective-description {
    font-size: 0.86rem;
    line-height: 1.68;
    color: var(--ink-2);
  }
  .apologetics-perspective-tags,
  .apologetics-perspective-overview-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .apologetics-perspective-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.64rem;
    border-radius: 999px;
    border: 1px solid rgba(130, 103, 73, 0.16);
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink-3);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.03em;
  }
  .apologetics-perspective-action {
    margin-top: auto;
    align-self: flex-start;
    color: var(--sienna);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color 0.15s ease;
  }
  .apologetics-perspective-card:hover .apologetics-perspective-action,
  .apologetics-perspective-card.is-active .apologetics-perspective-action {
    color: var(--ink);
  }
  .apologetics-perspective-show-more {
    grid-column: 1 / -1;
    justify-self: start;
    cursor: pointer;
  }
  .apologetics-perspective-overview {
    margin-top: 0.15rem;
  }
  .apologetics-perspective-overview-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.15rem 1.2rem 1.1rem;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(247, 243, 236, 0.98), rgba(255, 255, 255, 0.94));
    box-shadow: var(--elev-1);
  }
  .apologetics-perspective-overview-card.is-active {
    border-color: rgba(160, 82, 45, 0.18);
    background: linear-gradient(180deg, rgba(246, 240, 231, 0.98), rgba(255, 255, 255, 0.96));
    box-shadow: var(--elev-2);
  }
  .apologetics-perspective-overview-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
  }
  .apologetics-perspective-overview-kicker {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
  }
  .apologetics-perspective-overview-title {
    font-family: var(--serif);
    margin-top: 0.35rem;
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1.24;
    color: var(--ink);
  }
  .apologetics-perspective-overview-copy {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--ink-2);
  }
  .apologetics-perspective-overview-note {
    font-size: 0.81rem;
    line-height: 1.58;
    color: var(--ink-3);
  }
  .apologetics-perspective-overview-link {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.46rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(130, 103, 73, 0.16);
    background: var(--parchment-2);
    color: var(--sienna);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.15s;
  }
  .apologetics-perspective-overview-link:hover {
    border-color: rgba(160, 82, 45, 0.24);
    background: var(--parchment);
    color: var(--ink);
    transform: translateY(-1px);
  }
  .apologetics-related-link {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font: inherit;
  }

  @media (min-width: 1120px) {
    .apologetics-question-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .apologetics-carousel-track {
      grid-auto-columns: minmax(300px, 360px);
    }
  }

  /* ══════════════════════════════════════════════════════
     ABOUT PAGE
  ══════════════════════════════════════════════════════ */
  .about-layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: var(--col) 1fr;
    gap: 5rem;
  }
  .about-main { padding: 3rem 0; }
  .about-main h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-bottom: 1rem;
    margin-top: 2.5rem;
  }
  .about-main h2:first-child { margin-top: 0; }
  .about-main p {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--ink-2);
    margin-bottom: 1rem;
  }
  .about-rule { border: none; border-top: 1px solid var(--rule); margin: 2rem 0; }
  .not-list { list-style: none; margin-top: 0.5rem; }
  .not-list li {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
    font-size: 0.875rem;
    color: var(--ink-2);
    line-height: 1.55;
  }
  .not-list li::before {
    content: '—';
    color: var(--ink-4);
    flex-shrink: 0;
    font-family: var(--serif);
    margin-top: 1px;
  }
  .about-aside {
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
    position: sticky;
    top: 80px;
  }
  .about-aside-block {
    padding: 1.5rem;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: var(--parchment-2);
  }
  .aside-label {
    font-size: 0.625rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sienna);
    margin-bottom: 0.6rem;
  }
  .aside-text { font-size: 0.8125rem; color: var(--ink-2); line-height: 1.65; }
  .aside-greek {
    font-family: var(--serif);
    font-size: 2.25rem;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    font-style: italic;
  }

  /* ══════════════════════════════════════════════════════
     CONTACT PAGE
  ══════════════════════════════════════════════════════ */
  .contact-layout {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: var(--col) 1fr;
    gap: 5rem;
  }
  .contact-main { padding: 3rem 0; }
  .form-group { margin-bottom: 1.5rem; }
  .form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 0.5rem;
  }
  .form-input, .form-textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--parchment);
    border: 1px solid var(--parchment-3);
    border-radius: 2px;
    font-family: var(--sans);
    font-size: 0.9375rem;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
  }
  .form-input::placeholder, .form-textarea::placeholder { color: var(--ink-4); }
  .form-input:focus, .form-textarea:focus { border-color: var(--sienna); }
  .form-textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
  .form-submit {
    background: var(--navy);
    color: var(--sand);
    font-family: var(--sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 13px 28px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .form-submit:hover { background: var(--navy-2); }
  .contact-aside {
    padding: 3rem 0;
    position: sticky;
    top: 80px;
    align-self: start;
  }
  .contact-aside p { font-size: 0.875rem; color: var(--ink-3); line-height: 1.7; margin-bottom: 1rem; }
  .contact-aside strong { color: var(--ink); font-weight: 500; }

  /* ══════════════════════════════════════════════════════
     FOOTER
  ══════════════════════════════════════════════════════ */
  .footer {
    max-width: var(--max);
    margin: 0 auto;
    padding: 4rem 2rem 1.25rem;
  }
  .footer-cta {
    display: block;
    padding: 4.5rem 4rem 4.75rem;
    border-radius: 28px;
    background: var(--navy);
    color: var(--cream);
    text-align: center;
  }
  .footer-cta-copy { max-width: 680px; margin: 0 auto; }
  .footer-cta-eyebrow, .updates-index-label, .updates-month-label {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .footer-cta-eyebrow { color: var(--sand-2); }
  .footer-cta-title {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(2.2rem, 4vw, 3.25rem);
    line-height: 1.08;
    font-weight: 400;
    letter-spacing: -0.03em;
  }
  .footer-cta-note { max-width: 52ch; margin: 1.2rem auto 0; color: rgba(252,251,247,0.72); font-size: 0.95rem; line-height: 1.7; }
  .footer-cta-actions { display: flex; justify-content: center; align-items: center; gap: 1.2rem; margin-top: 2rem; }
  .footer-cta-link { border: 0; border-bottom: 1px solid rgba(252,251,247,0.42); background: transparent; padding: 0 0 0.3rem; color: rgba(252,251,247,0.82); font: 500 0.82rem var(--sans); cursor: pointer; }
  .footer-cta-link:hover { color: var(--cream); border-color: var(--cream); }
  .footer-cta-link-primary { color: var(--cream); border-color: var(--sand-2); }
  .footer-panel { margin-top: 1rem; padding: 3.75rem 3.75rem 1.35rem; border: 1px solid var(--rule); border-radius: 28px; background: rgba(255,255,255,0.46); box-shadow: 0 18px 42px rgba(16, 37, 23, 0.07); }
  .footer-content { display: grid; grid-template-columns: 1.35fr repeat(3, 1fr); gap: 3rem; padding: 0 0 3.5rem; }
  .footer-main { max-width: 280px; }
  .footer-logo { display: inline-block; width: 92px; border: 0; padding: 0; background: transparent; cursor: pointer; text-align: left; }
  .footer-logo img { display: block; width: 100%; height: auto; }
  .footer-note { margin-top: 1.3rem; font-size: 0.86rem; line-height: 1.7; color: var(--ink-3); }
  .footer-socials { display: flex; gap: 0.8rem; margin-top: 1.4rem; }
  .footer-social { color: var(--ink-4); font-size: 0.9rem; text-decoration: none; }
  .footer-social:hover { color: var(--ink); }
  .footer-column { display: flex; flex-direction: column; align-items: flex-start; gap: 0.65rem; }
  .footer-column h2 { margin: 0 0 0.65rem; font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
  .footer-link { border: none; background: transparent; padding: 0; font: 400 0.82rem/1.5 var(--sans); text-align: left; color: var(--ink-4); cursor: pointer; text-decoration: none; transition: color 0.15s, border-color 0.15s; }
  .footer-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
  .footer-updates-link { display: inline-flex; align-items: center; gap: 0.45rem; }
  .footer-link:focus-visible { outline: 2px solid rgba(160, 82, 45, 0.5); outline-offset: 3px; }
  .footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--rule); padding-top: 1.25rem; color: var(--ink-4); font-size: 0.76rem; }

  /* ══════════════════════════════════════════════════════
     UPDATES
  ══════════════════════════════════════════════════════ */
  .updates-shell { width: min(100% - 3rem, 1375px); margin: 0 auto; padding: 0 0 2rem; }
  .updates-layout { display: block; }
  .updates-index { display: flex; align-items: center; flex-wrap: wrap; gap: 0.55rem 1rem; margin-bottom: 5rem; border-block: 1px solid var(--rule); padding: 1rem 0; }
  .updates-index-label { margin: 0 1rem 0 0; color: var(--ink-3); }
  .updates-index a { color: var(--ink-4); font-size: 0.82rem; text-decoration: none; }
  .updates-index a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
  .updates-release + .updates-release { margin-top: 8rem; }
  .updates-release { scroll-margin-top: 96px; }
  .updates-release-meta { display: flex; align-items: center; gap: 0.9rem; color: var(--ink-4); font-size: clamp(1.5rem, 2.7vw, 3.15rem); line-height: 1.1; }
  .updates-release-meta time { white-space: nowrap; }
  .updates-anchor { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 2.1rem; height: 2.1rem; color: var(--ink-2); font-size: 1.75rem; line-height: 1; text-decoration: none; }
  .updates-anchor:hover { color: var(--sienna); }
  .updates-anchor:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }
  .updates-release-chips, .update-change-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
  .update-release-chip, .update-category { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; font-size: 0.64rem; font-weight: 500; letter-spacing: 0.06em; line-height: 1; text-transform: uppercase; }
  .update-release-chip { min-height: 1.8rem; padding: 0.35rem 0.62rem; background: var(--sienna); color: var(--cream); }
  .update-category { padding: 0.28rem 0.52rem; border: 1px solid rgba(16, 37, 23, 0.22); color: var(--ink-3); }
  .update-category-subtle { color: var(--sienna); border-color: rgba(160, 82, 45, 0.28); }
  .updates-release-title { max-width: 28ch; margin-top: 1.25rem; font-family: var(--sans); font-size: clamp(2.35rem, 5.1vw, 4.2rem); line-height: 1.1; font-weight: 600; letter-spacing: -0.045em; }
  .updates-release-summary { max-width: 70ch; margin-top: 1.3rem; color: var(--ink-2); font-size: clamp(1.1rem, 1.55vw, 1.45rem); line-height: 1.65; }
  .updates-changes { margin-top: 4rem; border-top: 1px solid var(--rule); }
  .update-change { padding: 2.5rem 0 2.8rem; border-bottom: 1px solid var(--rule); }
  .update-change h3 { font-family: var(--sans); font-size: clamp(1.65rem, 2.7vw, 2.35rem); font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; }
  .update-change p { max-width: 70ch; margin-top: 0.85rem; color: var(--ink-2); font-size: clamp(1.05rem, 1.4vw, 1.35rem); line-height: 1.7; }
  .update-media { margin: 2rem 0 3.25rem; }
  .update-media img, .update-media video { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; border: 0; border-radius: 0; background: rgba(16, 37, 23, 0.045); box-shadow: none; }
  .update-media video { object-fit: cover; }
  .update-media figcaption { margin-top: 0.55rem; color: var(--ink-4); font-size: 0.76rem; line-height: 1.5; }
  .update-media-reduced-motion p { padding: 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--color-surface); color: var(--ink-3); font-size: 0.82rem; line-height: 1.6; }
  .update-media video[controls] { background: var(--navy); }
  .updates-empty-state { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 2.2rem 0 2.5rem; }
  .updates-empty-state h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
  .updates-empty-state p { max-width: 58ch; margin-top: 0.75rem; color: var(--ink-3); font-size: 0.92rem; line-height: 1.75; }
  @media (prefers-reduced-motion: reduce) {
    .update-media video[autoplay] { display: none; }
    .update-media video[controls] { display: block; }
  }
  .footer-reference-copy { max-width: 62ch; }
  .footer-reference-copy h2 { margin: 2.2rem 0 0.45rem; font-family: var(--serif); font-size: 1.45rem; font-weight: 400; }
  .footer-reference-copy h3 { margin: 1.55rem 0 0.35rem; font-family: var(--serif); font-size: 1.15rem; font-weight: 400; }
  .footer-reference-copy ul { margin: 0.7rem 0 1.1rem 1.15rem; color: var(--ink-3); }
  .footer-reference-copy li { margin: 0.35rem 0; padding-left: 0.25rem; }
  .inline-page-link { border: 0; border-bottom: 1px solid var(--sienna); background: transparent; padding: 0; color: var(--sienna); font: inherit; cursor: pointer; }
  .inline-page-link:hover { color: var(--ink); }
  .editorial-inline-link { color: var(--sienna); text-decoration: underline; text-decoration-color: rgba(160, 82, 45, 0.35); text-underline-offset: 3px; }
  .editorial-inline-link:hover { color: var(--ink); text-decoration-color: currentColor; }
  .editorial-inline-link:focus-visible { outline: 2px solid rgba(160, 82, 45, 0.5); outline-offset: 3px; }
  .privacy-settings-panel { max-width: 62ch; }
  .privacy-setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; border-top: 1px solid var(--rule); padding: 1.25rem 0; }
  .privacy-setting-row h2 { margin: 0; font-family: var(--sans); font-size: 0.95rem; font-weight: 500; }
  .privacy-setting-row p { margin-top: 0.25rem; color: var(--ink-3); font-size: 0.82rem; }
  .privacy-setting-status { color: var(--ink-4); font-size: 0.8rem; white-space: nowrap; }
  .privacy-toggle { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--ink-3); font-size: 0.8rem; white-space: nowrap; }

  .privacy-dialog-open { overflow: hidden; }
  .privacy-settings-layer { position: fixed; inset: 0; z-index: 10000; display: flex; justify-content: flex-end; background: var(--color-dialog-backdrop); }
  .privacy-settings-layer[hidden] { display: none; }
  .privacy-settings-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: default; }
  .privacy-settings-dialog { position: relative; width: min(620px, 100%); height: 100%; overflow-y: auto; padding: 2.2rem 2.4rem 3rem; background: var(--color-dialog-surface); box-shadow: -18px 0 45px var(--color-shadow); outline: none; }
  .privacy-settings-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--rule); padding-bottom: 1.25rem; }
  .privacy-settings-header h2 { margin: 0.25rem 0 0; font-family: var(--serif); font-size: 2rem; font-weight: 400; }
  .privacy-settings-close, .privacy-banner-close { border: 0; background: transparent; color: var(--ink-3); font-size: 1.8rem; line-height: 1; cursor: pointer; padding: 0.35rem; }
  .privacy-settings-close:focus-visible, .privacy-banner-close:focus-visible, .privacy-button:focus-visible, .privacy-clear-button:focus-visible { outline: 2px solid var(--sienna); outline-offset: 3px; }
  .privacy-settings-lead { margin: 1.25rem 0; color: var(--ink-3); font-size: 0.92rem; line-height: 1.7; }
  .privacy-status-summary { display: grid; gap: 0.7rem; border-block: 1px solid var(--rule); padding: 1.1rem 0; }
  .privacy-status-summary div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.83rem; }
  .privacy-status-summary span { color: var(--ink-3); }
  .privacy-status-summary strong { color: var(--ink); font-weight: 500; text-align: right; }
  .privacy-choice { margin: 1.35rem 0; border: 0; padding: 0; }
  .privacy-choice legend { margin-bottom: 0.7rem; font-size: 0.72rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
  .privacy-choice-option { display: flex; align-items: flex-start; gap: 0.8rem; border: 1px solid var(--rule); padding: 1rem; cursor: pointer; }
  .privacy-choice-option input { width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--sienna); }
  .privacy-choice-option strong, .privacy-choice-option small { display: block; }
  .privacy-choice-option strong { font-size: 0.9rem; font-weight: 500; }
  .privacy-choice-option small { margin-top: 0.3rem; color: var(--ink-3); font-size: 0.8rem; line-height: 1.55; }
  .privacy-dialog-actions, .privacy-banner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; margin-top: 1rem; background: var(--color-dialog-action-surface); }
  .privacy-button { min-height: 2.75rem; border: 1px solid var(--sienna); padding: 0.7rem 1rem; font: 500 0.78rem var(--sans); cursor: pointer; }
  .privacy-button:disabled { cursor: wait; opacity: 0.55; }
  .privacy-button-primary { background: var(--sienna); color: var(--cream); }
  .privacy-button-secondary { background: transparent; color: var(--sienna); }
  .privacy-button-danger { border-color: var(--sienna); background: rgba(160, 82, 45, 0.09); color: var(--sienna); }
  .privacy-clear-button { margin-top: 1.4rem; border: 1px solid var(--rule); background: transparent; padding: 0.7rem 0.9rem; color: var(--ink-2); font: 500 0.78rem var(--sans); cursor: pointer; }
  .privacy-clear-button:hover, .privacy-button-danger:hover { border-color: var(--sienna); color: var(--ink); }
  .privacy-clear-confirmation { margin-top: 1rem; border: 1px solid var(--sienna); padding: 1rem; background: rgba(160, 82, 45, 0.06); }
  .privacy-clear-confirmation[hidden] { display: none; }
  .privacy-clear-confirmation h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; font-weight: 400; }
  .privacy-clear-confirmation p { margin: 0.5rem 0 0; color: var(--ink-3); font-size: 0.84rem; line-height: 1.6; }
  .privacy-clear-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 0.9rem; }
  .privacy-settings-live { min-height: 1.4rem; margin: 0.9rem 0 0; color: var(--ink-2); font-size: 0.82rem; line-height: 1.5; }
  .privacy-settings-live:empty { min-height: 0; margin: 0; }
  .privacy-information { margin-top: 2rem; border-top: 1px solid var(--rule); }
  .privacy-information details { border-bottom: 1px solid var(--rule); }
  .privacy-information summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.05rem 0; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; cursor: pointer; list-style: none; }
  .privacy-information summary::-webkit-details-marker { display: none; }
  .privacy-information summary::after { content: '+'; flex: 0 0 auto; color: var(--sienna); font: 400 1.35rem/1 var(--sans); }
  .privacy-information details[open] summary::after { content: '−'; }
  .privacy-information summary:focus-visible { outline: 2px solid var(--sienna); outline-offset: 3px; }
  .privacy-information details p { margin: 0 0 1.15rem; color: var(--ink-3); font-size: 0.84rem; line-height: 1.7; }
  .privacy-banner { position: fixed; right: 1rem; bottom: 1rem; z-index: 10001; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; width: min(920px, calc(100% - 2rem)); padding: 1.15rem 1.25rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--cream); box-shadow: 0 15px 40px rgba(16, 37, 23, 0.17); }
  .privacy-banner h2 { margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 400; }
  .privacy-banner p { max-width: 70ch; margin: 0.35rem 0 0; color: var(--ink-3); font-size: 0.8rem; line-height: 1.55; }
  .privacy-banner-actions { justify-content: flex-end; }
  .privacy-banner-close { align-self: flex-start; }
  .privacy-toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 10002; transform: translateX(-50%); max-width: calc(100% - 2rem); padding: 0.75rem 1rem; border-radius: 8px; background: var(--navy); color: var(--cream); font-size: 0.8rem; box-shadow: 0 8px 22px rgba(16, 37, 23, 0.2); }
  @media (prefers-reduced-motion: reduce) { .privacy-settings-layer *, .privacy-banner *, .privacy-toast { transition: none !important; animation: none !important; } }

  .updates-dialog-open { overflow: hidden; }
  .updates-overlay-layer { position: fixed; inset: 0; z-index: 10000; display: flex; justify-content: flex-end; background: var(--color-dialog-backdrop); opacity: 0; visibility: hidden; transition: opacity 240ms ease, visibility 0s linear 240ms; }
  .updates-overlay-layer[hidden] { display: none; }
  .updates-overlay-layer.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
  .updates-overlay-backdrop { position: absolute; inset: 0; border: 0; background: transparent; cursor: default; }
  .updates-overlay-dialog { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(44vw, 680px); min-width: min(360px, 88vw); height: 100%; max-height: 100%; overflow: hidden; transform: translateX(100%); background: var(--color-dialog-surface); color: var(--color-text); box-shadow: -18px 0 45px var(--color-shadow); outline: none; transition: transform 240ms var(--ease-premium); }
  .updates-overlay-layer.is-open .updates-overlay-dialog { transform: translateX(0); }
  .updates-overlay-toolbar { display: flex; justify-content: flex-end; flex: 0 0 auto; padding: max(0.8rem, env(safe-area-inset-top)) 1.25rem 0; }
  .updates-overlay-close { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--ink-2); font: 400 1.7rem/1 var(--sans); cursor: pointer; }
  .updates-overlay-close:hover { border-color: var(--sienna); color: var(--sienna); }
  .updates-overlay-close:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
  .updates-overlay-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
  .updates-overlay-dialog .updates-shell { width: 100%; padding: 0 0 2rem; }
  .updates-overlay-dialog .page-header { width: 100%; padding: 2rem 1.75rem 2.25rem; text-align: left; }
  .updates-overlay-dialog .page-header .page-title { margin-inline: 0; }
  .updates-overlay-dialog .page-header .page-desc { margin-inline: 0; }
  .updates-overlay-dialog .updates-index { margin: 0 1.75rem 3.5rem; }
  .updates-overlay-dialog .updates-timeline { padding: 0 1.75rem; }
  .updates-overlay-dialog .updates-release-title { max-width: none; font-size: clamp(2rem, 4.5vw, 3rem); }
  .updates-overlay-dialog .updates-release-summary, .updates-overlay-dialog .update-change p { font-size: 1rem; }
  .updates-overlay-dialog .update-media { max-width: 100%; overflow: hidden; }
  .updates-overlay-dialog .update-media img, .updates-overlay-dialog .update-media video { max-width: 100%; }
  html[data-theme="dark"] .updates-overlay-dialog,
  html[data-theme-preview="dark"] .updates-overlay-dialog { background: var(--color-dialog-surface); color: var(--color-text); }
  html[data-theme="dark"] .updates-overlay-dialog .update-category,
  html[data-theme-preview="dark"] .updates-overlay-dialog .update-category { border-color: var(--color-border-strong); color: var(--color-text-secondary); }
  @media (prefers-reduced-motion: reduce) {
    .updates-overlay-layer, .updates-overlay-dialog { transition: none !important; }
    .updates-overlay-dialog { transform: none; }
  }

  /* ══════════════════════════════════════════════════════
     SHARED EDITORIAL PAGE SHELL
  ══════════════════════════════════════════════════════ */
  .editorial-page .page-header {
    width: min(100%, var(--max));
    margin: 0 auto;
    padding: 5.2rem 2rem 3.2rem;
    text-align: center;
  }
  .editorial-page .page-header .page-title {
    max-width: none;
    margin-inline: auto;
    margin-top: 0.35rem;
  }
  .editorial-page .page-header .page-desc {
    max-width: 54ch;
    margin: 1rem auto 0;
    font-size: 1rem;
    line-height: 1.75;
  }
  .editorial-page .guide-copy-section {
    width: min(100%, 840px);
    margin: 0 auto;
    padding: clamp(2.25rem, 4vw, 3.25rem) 2rem 4.5rem;
  }
  /* Keep the first content heading clear of the page-header rule. */
  .editorial-page .about-layout,
  .editorial-page .faq-shell {
    padding-top: clamp(2.25rem, 4vw, 3.25rem);
  }
  .editorial-page .footer-reference-copy {
    max-width: 840px;
  }
  .editorial-page .footer-reference-copy h2 {
    margin-top: 3.35rem;
    padding-top: 1.35rem;
    border-top: 1px solid var(--rule);
    font-size: 1.62rem;
    line-height: 1.25;
  }
  .editorial-page .footer-reference-copy h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
  .editorial-page .footer-reference-copy h3 { margin-top: 2rem; font-size: 1.2rem; }
  .editorial-page .footer-reference-copy .guide-editorial-p,
  .editorial-page .footer-reference-copy li { max-width: 72ch; }
  .editorial-page .footer-reference-copy > ul { margin-bottom: 1.5rem; }
  .editorial-page .footer { padding-top: 2rem; }
  .editorial-page .about-layout { grid-template-columns: minmax(0, 760px) minmax(240px, 1fr); gap: 3rem; }
  .editorial-page .about-main, .editorial-page .about-aside { padding-top: 0; }
  .editorial-page .contact-layout { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .editorial-page .contact-main { padding-top: 0; }
  .editorial-page .contact-aside { display: none; }

  /* ══════════════════════════════════════════════════════
     FAQ ACCORDION
  ══════════════════════════════════════════════════════ */
  .faq-shell { width: min(100%, 1040px); margin: 0 auto; padding: clamp(2rem, 4vw, 3.5rem) 2rem 5.5rem; }
  .faq-categories { display: flex; justify-content: center; gap: 0.35rem; width: fit-content; max-width: 100%; margin: 0 auto 1.75rem; padding: 0.35rem; overflow-x: auto; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); scrollbar-width: none; }
  .faq-categories::-webkit-scrollbar { display: none; }
  .faq-category { flex: 0 0 auto; padding: 0.58rem 0.95rem; border: 0; border-radius: 999px; background: transparent; color: var(--color-text-secondary); font: 600 0.78rem/1 var(--sans); letter-spacing: 0.01em; cursor: pointer; transition: background 0.2s var(--ease-premium), color 0.2s var(--ease-premium), box-shadow 0.2s var(--ease-premium); }
  .faq-category:hover { color: var(--color-text); }
  .faq-category.is-active { background: var(--color-surface-raised); color: var(--color-text-heading); box-shadow: 0 1px 4px var(--color-shadow); }
  .faq-category:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
  .faq-groups { margin-top: 0.5rem; padding: clamp(1rem, 2.5vw, 2rem); border: 1px solid var(--color-border); border-radius: 2rem; background: var(--color-surface); box-shadow: 0 1rem 2.5rem var(--color-shadow); }
  .faq-group[hidden] { display: none; }
  .faq-group + .faq-group { margin-top: 2rem; }
  .faq-group-title { margin: 0 0 0.85rem; color: var(--color-text-muted); font: 700 0.72rem/1.2 var(--sans); letter-spacing: 0.13em; text-transform: uppercase; }
  .faq-item { overflow: clip; border: 1px solid var(--color-border-subtle); border-radius: 1.2rem; background: var(--color-surface-raised); transition: border-color 0.2s var(--ease-premium), box-shadow 0.2s var(--ease-premium), background 0.2s var(--ease-premium); }
  .faq-item + .faq-item { margin-top: 0.65rem; }
  .faq-item.is-open { border-color: var(--color-border-strong); box-shadow: 0 0.45rem 1.25rem var(--color-shadow); }
  .faq-question { display: flex; align-items: center; gap: 1rem; width: 100%; min-height: 4.6rem; padding: 1.1rem 1.25rem; border: 0; background: transparent; color: var(--color-text); font: 600 1rem/1.45 var(--sans); text-align: left; cursor: pointer; }
  .faq-question::before { content: attr(data-faq-number); flex: 0 0 2rem; color: var(--color-text-muted); font: 600 0.76rem/1 var(--sans); letter-spacing: 0.06em; }
  .faq-question:hover { color: var(--color-text-heading); background: color-mix(in srgb, var(--color-text) 3%, transparent); }
  .faq-question:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--color-focus); outline-offset: -3px; }
  .faq-icon { display: inline-grid; place-items: center; flex: 0 0 2rem; width: 2rem; height: 2rem; margin-left: auto; border: 1px solid var(--color-border); border-radius: 50%; color: var(--color-text-secondary); font: 400 1.2rem/1 var(--sans); transition: background 0.2s var(--ease-premium), border-color 0.2s var(--ease-premium), color 0.2s var(--ease-premium), transform 0.2s var(--ease-premium); }
  .faq-question[aria-expanded="true"] .faq-icon { border-color: var(--color-brand); background: var(--color-brand); color: var(--color-text-inverse); transform: rotate(0deg); }
  .faq-answer { display: grid; grid-template-rows: 0fr; padding: 0 1.25rem 0 4.25rem; opacity: 0; visibility: hidden; pointer-events: none; transition: grid-template-rows 0.28s var(--ease-premium), padding 0.28s var(--ease-premium), opacity 0.2s var(--ease-premium); }
  .faq-answer.is-open { grid-template-rows: 1fr; padding-bottom: 1.35rem; opacity: 1; visibility: visible; pointer-events: auto; }
  .faq-answer[hidden] { display: grid !important; }
  .faq-answer p { min-height: 0; margin: 0; overflow: hidden; color: var(--color-text-secondary); font-size: 0.95rem; line-height: 1.78; }
  .faq-contact-cta { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-top: 1.35rem; padding: 1.25rem 1.4rem 1.25rem 1.5rem; border: 1px solid var(--color-border); border-radius: 1.35rem; background: var(--color-surface); }
  .faq-contact-cta-eyebrow { margin: 0 0 0.25rem; color: var(--color-text-muted); font: 700 0.7rem/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; }
  .faq-contact-cta h2 { margin: 0; color: var(--color-text-heading); font: 400 clamp(1.25rem, 2vw, 1.55rem)/1.2 var(--serif); }
  .faq-contact-cta-link { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.75rem 1rem; border: 1px solid var(--color-border-strong); border-radius: 999px; background: transparent; color: var(--color-link); font: 700 0.82rem/1 var(--sans); cursor: pointer; }
  .faq-contact-cta-link:hover { background: var(--color-surface-raised); }
  .faq-contact-cta-link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
  #page-faq .footer-bottom { border-top: 0; }
  @media (prefers-reduced-motion: reduce) {
    .faq-category, .faq-item, .faq-icon, .faq-answer { transition: none; }
  }

  /* ══════════════════════════════════════════════════════
     RESPONSIVE
  ══════════════════════════════════════════════════════ */
  @media (max-width: 900px) {
    .home-hero {
      padding: 4.8rem 1.5rem 4rem;
      min-height: 520px;
    }
    .home-hero-copy {
      width: min(60ch, 74%);
    }
    .home-hero-image {
      top: 1.1rem;
      right: -7.5rem;
      bottom: 1.3rem;
      left: 20%;
    }
    .home-hero-image::after {
      background: linear-gradient(90deg, rgba(252, 251, 247, 0.95) 0%, rgba(252, 251, 247, 0.66) 20%, rgba(252, 251, 247, 0.2) 44%, rgba(252, 251, 247, 0) 70%);
    }
    .home-hero-image { background-position: 64% center; }
    .home-apologetics-layout {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }
    .home-apologetics-copy {
      max-width: 100%;
    }
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .home-how-grid { grid-template-columns: 1fr; gap: 1.35rem; }
    .footer { padding-inline: 1.5rem; }
    .footer-cta { padding: 3.5rem 2.5rem; }
    .footer-panel { padding: 3rem 2.5rem 1.2rem; }
    .footer-content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; }
    .footer-main { grid-column: 1 / -1; max-width: 520px; }
    .editorial-page .page-header { padding-top: 4.25rem; }
    .updates-index { margin-bottom: 3.5rem; }
    .about-layout, .contact-layout { grid-template-columns: 1fr; }
    .about-aside, .contact-aside { position: static; }
    .guides-toolbar {
      grid-template-columns: 1fr 1fr;
    }
    .guide-author-grid {
      grid-template-columns: 1fr;
    }
    .guide-series-banner {
      aspect-ratio: 16 / 7;
    }
    .guide-chapter-hero {
      aspect-ratio: 16 / 8;
    }
    .guide-theme-list,
    .guide-principles-list,
    .guide-study-grid,
    .guide-reflection-grid,
    .guide-application-grid {
      grid-template-columns: 1fr;
    }
    .guide-copy-section {
      padding-top: 0;
    }
    .study-guides-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .apologetics-page-shell {
      width: min(1240px, calc(100vw - 3rem));
    }
    .apologetics-hero {
      grid-template-columns: 1fr;
      gap: 1.35rem;
      padding: 2.2rem 2rem 2rem;
    }
    .apologetics-hero-panel {
      position: static;
    }
    .apologetics-value-row {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .apologetics-answer-header {
      flex-direction: column;
    }
    .apologetics-answer-meta {
      justify-content: flex-start;
    }
    .apologetics-category-layout {
      grid-template-columns: 1fr;
    }
    .apologetics-category-spotlight {
      position: static;
    }
    .apologetics-category-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .apologetics-answer-grid {
      grid-template-columns: 1fr;
    }
    .apologetics-carousel-track {
      grid-auto-columns: minmax(250px, 68%);
    }
    .apologetics-section-head {
      align-items: flex-start;
    }
    .teachings-layout { width: min(100%, calc(100vw - 2.5rem)); }
    .teach-main { padding: 0 1.75rem 3.5rem 2rem; }
    .study-page-header {
      padding-top: 3.8rem;
      padding-bottom: 3.1rem;
    }
    .study-toolbar {
      align-items: stretch;
      flex-direction: column;
      gap: 1.2rem;
      margin-bottom: 2.35rem;
    }
    .version-control {
      max-width: 100%;
      flex-basis: auto;
    }
    .chapter-navigation {
      grid-template-columns: 1fr 1fr;
      gap: 0.85rem;
      margin-bottom: 2.25rem;
    }
    .chapter-navigation .teach-chap-label {
      grid-column: 1 / -1;
      grid-row: 1;
      margin-bottom: 0.25rem;
    }
    .study-content-layout.is-study,
    .study-content-layout.is-study-experience {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }
    .study-content-layout.is-interlinear {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
      max-width: none;
      width: 100%;
    }
    .study-content-layout.is-interlinear-parallel-view {
      padding-top: 0.9rem;
    }
    .scripture-column,
    .chapter-reader {
      max-width: 100%;
    }
    .study-mode-panel {
      padding: 1.5rem;
      gap: 1.4rem;
    }
    .interlinear-inspector {
      padding: 1.1rem;
    }
    .study-surface.is-study-popover {
      width: min(660px, calc(100vw - 3rem));
    }
    .study-word-table {
      min-width: 700px;
    }
  }
  @media (max-width: 680px) {
    .study-person-modal-layer {
      align-items: flex-end;
      padding: 0;
    }
    .study-person-modal {
      width: 100%;
      max-height: 86vh;
      border-radius: 1rem 1rem 0 0;
    }
    .study-person-modal .study-person-stage > .study-theme-article-topbar {
      padding-inline: 0.9rem;
      padding-top: 0.9rem;
    }
    .study-person-modal .study-workspace-card {
      margin-inline: 0.9rem;
    }
    .study-person-chip-grid {
      gap: 0.5rem;
    }
    .study-person-chip-button {
      min-height: 2.4rem;
      padding-inline: 0.88rem;
      font-size: 0.86rem;
    }
    .study-person-relationship-grid {
      grid-template-columns: 1fr;
    }
    .study-person-relationship-groups {
      grid-template-columns: 1fr;
    }
    .study-person-relationship-panel,
    .study-person-relationship-block {
      padding-inline: 0.8rem;
    }
    .nav-inner {
      position: relative;
    }
    .apologetics-page-shell {
      width: min(100vw - 1.25rem, 100%);
      padding-top: 1rem;
      gap: 0.9rem;
    }
    .apologetics-hero {
      padding-bottom: 1.8rem;
      padding: 1.55rem 1rem 1.35rem;
    }
    .apologetics-hero-surface {
      border-radius: 18px;
    }
    .apologetics-value-row {
      grid-template-columns: 1fr;
    }
    .apologetics-value-card {
      padding: 1rem;
    }
    .apologetics-layout {
      gap: 1.5rem;
    }
    .apologetics-search-field {
      flex-direction: column;
    }
    .apologetics-search-input,
    .apologetics-search-reset {
      width: 100%;
      flex-basis: 100%;
    }
    .apologetics-search-actions,
    .apologetics-catalog-actions {
      width: 100%;
    }
    .apologetics-hero-browse-button,
    .apologetics-catalog-back {
      width: 100%;
    }
    .apologetics-search-reset {
      justify-content: center;
    }
  .apologetics-modal {
    inset: auto 0 0;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 0.75rem);
      transform: none;
      border-radius: 20px 20px 0 0;
      border-left: 0;
      border-right: 0;
      border-bottom: 0;
    }
    .apologetics-modal-body {
      padding: 1rem 1rem 1.1rem;
      max-height: calc(100vh - 4rem);
    }
  .apologetics-modal-close {
    top: 0.7rem;
    right: 0.7rem;
  }
  .apologetics-category-explorer-layer {
    align-items: stretch;
    padding: 0;
  }
  .apologetics-category-explorer {
    width: 100%;
    max-height: none;
    border-radius: 20px 20px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .apologetics-category-explorer-body {
    padding: 1rem 1rem 1.1rem;
    max-height: calc(100vh - 4rem);
  }
  .apologetics-category-explorer-close {
    top: 0.7rem;
    right: 0.7rem;
  }
  .apologetics-category-explorer-head {
    flex-direction: column;
    padding-right: 0;
  }
  .apologetics-category-explorer-meta {
    justify-content: flex-start;
  }
  .apologetics-category-explorer-search-row {
    flex-direction: column;
    align-items: stretch;
  }
  .apologetics-category-explorer-clear,
  .apologetics-category-explorer-load-more {
    width: 100%;
  }
  .apologetics-category-explorer-results-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .apologetics-category-grid,
  .apologetics-question-grid,
  .apologetics-perspective-grid,
  .apologetics-answer-grid {
    grid-template-columns: 1fr;
    }
    .apologetics-category-spotlight-card {
      padding: 1.1rem;
    }
    .apologetics-category-spotlight-title {
      font-size: 1.3rem;
    }
    .apologetics-category-grid {
      grid-template-columns: 1fr;
    }
    .apologetics-question-card,
    .apologetics-perspective-card,
    .apologetics-category-card,
    .apologetics-answer-panel-inner {
      padding-left: 1rem;
      padding-right: 1rem;
    }
    .apologetics-answer-actions--detail {
      grid-template-columns: 1fr;
      gap: 0.65rem;
    }
    .apologetics-answer-layout {
      grid-template-columns: 1fr;
    }
    .apologetics-answer-aside {
      padding-left: 0;
      border-left: 0;
    }
    .apologetics-carousel-track {
      grid-auto-columns: minmax(240px, 86%);
    }
    .apologetics-section-head {
      flex-direction: column;
      align-items: flex-start;
    }
    .apologetics-carousel-controls {
      width: 100%;
      flex-wrap: wrap;
    }
    .apologetics-answer-header {
      gap: 0.8rem;
    }
    .apologetics-answer-title {
      font-size: 1.14rem;
    }
    .apologetics-answer-panel-inner {
      gap: 0.7rem;
    }
    .apologetics-answer-short-card {
      padding: 0.9rem 0.95rem;
      border-radius: 16px;
    }
    .apologetics-answer-short {
      padding: 0;
    }
    .apologetics-answer-feature {
      font-size: 0.61rem;
      letter-spacing: 0.07em;
    }
    .apologetics-answer-link {
      width: 100%;
      justify-content: center;
    }
    .apologetics-answer-link--nav {
      justify-content: space-between;
    }
    .apologetics-answer-link-label {
      font-size: 0.92rem;
    }
    .apologetics-answer-link-subtitle {
      font-size: 0.69rem;
    }
    .apologetics-section-copy {
      font-size: 0.88rem;
      line-height: 1.62;
    }
    .apologetics-category-card {
      padding: 0.95rem;
      gap: 0.8rem;
    }
    .apologetics-category-marker {
      width: 2.4rem;
      height: 2.4rem;
    }
    .apologetics-category-title {
      font-size: 1rem;
    }
    .apologetics-category-description {
      max-width: none;
    }
    .apologetics-perspective-overview-card,
    .apologetics-perspective-card {
      padding: 1rem;
    }
    .apologetics-perspective-title,
    .apologetics-perspective-overview-title {
      font-size: 1rem;
    }
    .apologetics-perspective-description,
    .apologetics-perspective-overview-copy {
      font-size: 0.85rem;
      line-height: 1.62;
    }
    .home-entries { grid-template-columns: 1fr; }
    .featured-grid { grid-template-columns: 1fr; }
    .home-apologetics-stack {
      min-height: 0;
      display: grid;
      grid-template-columns: 1fr;
      gap: 0.7rem;
    }
    .home-apo-card,
    .home-apo-card.is-active {
      flex: 1 1 auto;
      min-height: auto;
      padding: 0;
    }
    .home-apo-tab-title {
      display: none;
    }
    .home-apo-card-body,
    .home-apo-card.is-active .home-apo-card-body {
      display: grid;
      padding: 0.9rem 0.95rem;
      gap: 0.55rem;
    }
    .home-apo-card:not(.is-active) .home-apo-card-body {
      grid-template-rows: auto;
    }
    .home-apo-card:not(.is-active) .home-apo-card-preview,
    .home-apo-card:not(.is-active) .home-apo-card-link {
      display: none;
    }
    .home-apo-card-title {
      font-size: 1.08rem;
    }
    .home-apo-card-preview {
      font-size: 0.86rem;
      line-height: 1.65;
    }
    .guides-toolbar {
      grid-template-columns: 1fr;
      padding: 1rem;
    }
    .guide-author-layout {
      width: min(100%, calc(100vw - 2rem));
    }
    .study-guides-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    .guide-series-layout {
      padding-top: 2rem;
      gap: 1rem;
    }
    .guide-chapter-layout {
      padding-top: 2rem;
      gap: 1rem;
    }
    .guide-series-banner {
      aspect-ratio: 15 / 8;
    }
    .guide-chapter-hero {
      aspect-ratio: 15 / 9;
    }
    .guide-copy-summary {
      font-size: 1rem;
      padding: 0.9rem 0.9rem;
    }
    .guide-copy-details-body {
      padding: 0 0.9rem 0.9rem;
    }
    .guide-editorial-read {
      width: min(100%, 62ch);
    }
    .guide-editorial-h2 {
      font-size: 1.14rem;
      margin-top: 1.55rem;
      margin-bottom: 0.65rem;
    }
    .guide-editorial-heading-stack {
      margin-top: 1.25rem;
      margin-bottom: 0.8rem;
      gap: 0.22rem;
    }
    .guide-editorial-kicker {
      font-size: 0.86rem;
      line-height: 1.48;
    }
    .guide-editorial-h3 {
      font-size: 0.76rem;
      margin-top: 1.15rem;
      margin-bottom: 0.45rem;
    }
    .guide-editorial-lead,
    .guide-editorial-p {
      font-size: 0.9rem;
      line-height: 1.82;
      margin-bottom: 0.9rem;
    }
    .guide-editorial-list {
      padding-left: 1.1rem;
      gap: 0.56rem;
      margin-bottom: 1.05rem;
    }
    .guide-editorial-list li {
      font-size: 0.88rem;
      line-height: 1.76;
    }
    .guide-editorial-pull {
      padding-left: 0.75rem;
      margin-bottom: 1.15rem;
      font-size: 0.88rem;
      line-height: 1.75;
    }
    .guide-copy-section h2 {
      font-size: 1.02rem;
    }
    .guide-message-row {
      padding: 0.86rem 0.82rem;
    }
    .guide-message-title {
      font-size: 0.95rem;
    }
    .guide-theme-list {
      gap: 0.55rem;
    }
    .guide-related-group + .guide-related-group {
      margin-top: 0;
    }
    #guide-chapter-related.guide-related-list {
      grid-template-columns: 1fr;
      gap: 1.1rem;
    }
    .guide-related-group .guide-related-list {
      gap: 0.55rem 0.6rem;
    }
    .guide-related-link {
      min-height: 31px;
      padding: 0.4rem 0.64rem;
      font-size: 0.72rem;
    }
    .guide-sermon-body p {
      font-size: 0.96rem;
      line-height: 1.86;
    }
    .guide-sermon-body p.guide-sermon-editorial-label {
      font-size: 0.92rem;
      line-height: 1.35;
    }
    .guide-sermon-body p.guide-sermon-editorial-label.is-explanation {
      font-size: 0.95rem;
      line-height: 1.35;
    }
    .guide-theme-item,
    .guide-study-band {
      padding: 0.92rem 0.9rem;
    }
    .guide-scripture-band {
      align-items: flex-start;
      flex-direction: column;
    }
    .guide-scripture-cta {
      width: 100%;
    }
    .guide-keyword-item {
      gap: 0.35rem;
    }
    .guide-chapter-block {
      padding-top: 1.65rem;
    }
    .guide-related-controls {
      margin-top: 0.85rem;
    }
    .guide-chapter-pagination {
      grid-template-columns: 1fr;
      gap: 0.85rem;
      padding-top: 0.75rem;
    }
    .guides-library-head {
      align-items: flex-start;
      flex-direction: column;
      gap: 0.25rem;
    }
    .teachings-layout { grid-template-columns: 1fr; }
    .teach-sidebar {
      position: static;
      height: auto;
      border-right: none;
      border-bottom: 1px solid var(--rule);
      padding: 0.7rem 0.25rem 0.75rem 0;
      background: rgba(255,255,255,0.26);
    }
    .teach-main { padding: 0 1.25rem 2.5rem; }
    .teach-version-select { max-width: 100%; }
    .teach-reading-modes {
      display: flex;
      width: 100%;
      overflow-x: auto;
    }
    .teach-mode-btn {
      flex: 1;
      text-align: center;
    }
    .study-page-header {
      padding-top: 2.8rem;
      padding-bottom: 2.5rem;
    }
    .study-toolbar {
      gap: 1rem;
      margin-bottom: 1.7rem;
    }
    .chapter-navigation {
      gap: 0.75rem;
      margin-bottom: 1.6rem;
    }
    .chapter-navigation .teach-chap-label {
      margin-bottom: 0.4rem;
      text-align: left;
      font-size: 0.95rem;
    }
    .teach-chap-btn {
      width: 100%;
    }
    .chapter-breadcrumb {
      margin-bottom: 1rem;
      line-height: 1.4;
    }
    .verse-chapter-sub {
      font-size: 1rem;
    }
    .reader-verse {
      font-size: 1rem;
      line-height: 1.9;
      padding: 0.2rem 0.3rem;
    }
    .study-content-layout {
      padding-top: 2.5rem;
    }
    .study-content-layout.is-study,
    .study-content-layout.is-study-experience {
      grid-template-columns: 1fr;
      gap: 1.25rem;
    }
    .study-content-layout.is-interlinear {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
    .study-content-layout.is-interlinear-parallel-view {
      grid-template-columns: 1fr;
      gap: 0.8rem;
      padding-top: 0.6rem;
    }
    .study-mode-panel {
      position: static;
      max-height: none;
      width: 100%;
      padding: 1.15rem;
    }
    .interlinear-inspector {
      position: static;
      max-height: none;
      width: 100%;
      padding: 1rem;
    }
    .interlinear-toolbar {
      padding: 0.65rem;
    }
    .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar {
      grid-template-columns: 1fr;
    }
    .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar > .interlinear-toolbar-group:last-child {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
      width: 100%;
      justify-content: stretch;
    }
    .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar > .interlinear-toolbar-group:last-child .step-study-select {
      width: 100%;
      min-width: 0;
    }
    .interlinear-split.is-interlinear-split-view,
    .interlinear-split.is-interlinear-focus-view {
      grid-template-columns: 1fr;
    }
    .interlinear-dual-panes {
      grid-template-columns: 1fr;
      gap: 0.8rem;
    }
    .interlinear-parallel-toolbar {
      top: 0;
      padding: 0.5rem;
    }
    .interlinear-parallel-toolbar .interlinear-toolbar-group {
      width: 100%;
      justify-content: flex-start;
    }
    .interlinear-parallel-pane .step-study-select {
      max-width: 100%;
      width: 100%;
      min-width: 0;
    }
    .interlinear-pane-head {
      align-items: flex-start;
      flex-wrap: wrap;
    }
    .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar {
      gap: 0.8rem;
      padding: 0.7rem;
    }
    .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar > .interlinear-toolbar-group:last-child {
      grid-template-columns: 1fr;
      gap: 0.35rem;
    }
    .study-content-layout.is-interlinear:not(.is-interlinear-parallel-view) .interlinear-toolbar > .interlinear-toolbar-group:last-child .interlinear-toolbar-label:not(:first-child) {
      margin-top: 0.25rem;
    }
    .interlinear-pane-head .study-gloss-toggle {
      margin-left: auto;
    }
    .study-focus-grid {
      grid-template-columns: 1fr;
    }
    .study-inspector-header h4 {
      font-size: 1.12rem;
    }
    .study-word-table {
      min-width: 640px;
    }
    .study-surface.is-mobile-sheet {
      max-height: 78vh;
      overflow-x: hidden;
    }
    .step-study-input-row { grid-template-columns: 1fr; }
    .step-study-select { width: 100%; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-links {
      display: none;
      position: absolute;
      top: 60px;
      left: 0;
      right: 0;
      margin-left: 0;
      gap: 0;
      background-color: var(--parchment-2);
      flex-direction: column;
      z-index: 120;
    }
    .nav-links.open { display: flex; }
    .nav-link {
      height: auto;
      padding: 0.8rem 2rem;
    }
    .theme-switch {
      width: auto;
      margin: 0.55rem 1rem 0.7rem;
      align-self: flex-end;
      justify-content: flex-end;
    }
    .nav-links {
      --nav-item-gap: 0;
    }
    .theme-toggle {
      --theme-toggle-hit-width: 4.25rem;
      --theme-toggle-hit-height: 2.75rem;
      --theme-toggle-track-width: 4.25rem;
      --theme-toggle-track-height: 2.125rem;
      --theme-toggle-thumb-size: 1.875rem;
      --theme-toggle-icon-size: 0.98rem;
      flex: 0 0 auto;
    }
    .theme-toggle[data-theme-state="dark"] .theme-toggle-thumb {
      transform: translate3d(calc(var(--theme-toggle-track-width) - (var(--theme-toggle-border) * 2) - var(--theme-toggle-thumb-size) - (var(--theme-toggle-pad) * 2)), 0, 0);
    }
    .home-title { font-size: 2.35rem; }
    .home-sub { font-size: 0.97rem; line-height: 1.72; }
    .home-hero {
      padding: 4.1rem 1rem 2.7rem;
      min-height: 0;
      display: grid;
      gap: 1.55rem;
    }
    .home-hero-copy {
      width: 100%;
    }
    .home-hero-image {
      position: relative;
      top: auto;
      right: auto;
      bottom: auto;
      left: auto;
      height: 280px;
      border: 1px solid rgba(15, 23, 42, 0.08);
      border-radius: 10px;
      background-color: var(--parchment-2);
    }
    .home-hero-image::after {
      background: linear-gradient(180deg, rgba(252, 251, 247, 0.22) 0%, rgba(252, 251, 247, 0.02) 45%, rgba(252, 251, 247, 0) 100%);
    }
    .home-hero-image { background-position: 60% center; }
    .entry-card { padding: 1.5rem 1.2rem; }
    .footer { padding: 2.5rem 1rem 1rem; }
    .footer-cta { display: block; padding: 2.75rem 1.5rem 3rem; border-radius: 20px; }
    .footer-cta-title { font-size: 2.15rem; }
    .footer-cta-actions { flex-direction: column; margin-top: 2rem; }
    .footer-panel { margin-top: 0.75rem; padding: 2.5rem 1.25rem 1rem; border-radius: 20px; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 2.25rem 1.2rem; padding: 0 0 2.5rem; }
    .footer-main { grid-column: 1 / -1; }
    .editorial-page .page-header { padding: 3.5rem 1rem 2.25rem; }
    .editorial-page .guide-copy-section, .faq-shell { padding-inline: 1rem; }
    .editorial-page .guide-copy-section { padding-top: 2rem; }
    .editorial-page .about-layout, .editorial-page .faq-shell { padding-top: 2rem; }
    .editorial-page .footer-reference-copy h2 { margin-top: 2.6rem; }
    .faq-group + .faq-group { margin-top: 1.5rem; }
    .faq-categories { justify-content: flex-start; width: 100%; margin-bottom: 1.25rem; }
    .faq-groups { border-radius: 1.5rem; padding: 0.85rem; }
    .faq-question { min-height: 4.25rem; font-size: 0.95rem; }
    .faq-contact-cta { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .faq-contact-cta-link { align-self: flex-start; }
    .footer-bottom { align-items: flex-start; flex-direction: column; gap: 0.65rem; }
    .privacy-settings-dialog { width: 100%; padding: 1.4rem 1rem 2rem; }
    .privacy-settings-layer { align-items: flex-end; }
    .privacy-dialog-actions { position: sticky; bottom: 0; z-index: 2; margin-inline: -1rem; padding: 0.75rem 1rem; background: var(--color-dialog-action-surface); box-shadow: 0 -8px 18px var(--color-shadow); }
    .privacy-dialog-actions .privacy-button { flex: 1 1 10rem; }
    .privacy-banner { right: 0.6rem; bottom: 0.6rem; width: calc(100% - 1.2rem); grid-template-columns: 1fr; gap: 0.85rem; }
    .privacy-banner-actions { justify-content: flex-start; }
    .privacy-banner-actions .privacy-button { flex: 1 1 auto; }
    .updates-overlay-layer { inset: 0; align-items: stretch; padding: max(0.6rem, env(safe-area-inset-top)) max(0.6rem, env(safe-area-inset-right)) max(0.6rem, env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-left)); }
    .updates-overlay-dialog { width: 100%; min-width: 0; height: 100%; max-height: none; border-radius: var(--radius-lg); transform: translateY(1rem); box-shadow: 0 18px 45px var(--color-shadow); }
    .updates-overlay-toolbar { padding: 0.7rem 0.8rem 0; }
    .updates-overlay-dialog .page-header { padding: 1.25rem 1rem 1.75rem; }
    .updates-overlay-dialog .updates-index { margin-inline: 1rem; margin-bottom: 3rem; }
    .updates-overlay-dialog .updates-timeline { padding-inline: 1rem; }
    .updates-overlay-dialog .updates-release-title { font-size: clamp(2rem, 10vw, 3rem); }
    .updates-overlay-dialog .updates-release-summary, .updates-overlay-dialog .update-change p { font-size: 1.05rem; }
    .updates-shell { width: min(100% - 2rem, 1375px); padding: 0 0 1rem; }
    .updates-index { flex-wrap: wrap; }
    .updates-release + .updates-release { margin-top: 5.5rem; }
    .updates-release-meta { align-items: flex-start; flex-wrap: wrap; gap: 0.55rem 0.7rem; font-size: 1.65rem; }
    .updates-release-meta time { white-space: normal; }
    .updates-anchor { width: 1.65rem; height: 1.65rem; font-size: 1.35rem; }
    .updates-release-title { max-width: none; margin-top: 1rem; font-size: clamp(2.1rem, 10vw, 3rem); }
    .updates-release-summary { margin-top: 1rem; font-size: 1.08rem; }
    .updates-changes { margin-top: 2.8rem; }
    .update-change { padding: 2rem 0 2.2rem; }
    .update-change h3 { font-size: 1.75rem; }
    .update-change p { font-size: 1.05rem; }
  }
    }
    .footer-links { gap: 0.45rem 1.25rem; }
  }

/* Bible Study final cascade: keep Scripture dominant after the legacy rules. */
#page-teachings #teach-library-backdrop[hidden] { display: none !important; }
#page-teachings .teach-sidebar { min-width: 0; }
#page-teachings .teach-sidebar-head { min-width: 0; width: 100%; overflow: hidden; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head { padding: 0; justify-content: center; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head .teach-sidebar-title,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head .teach-sidebar-close { display: none; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar { overflow: visible; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head { overflow: visible; position: relative; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger { display: flex; position: absolute; top: 0; left: 4px; z-index: 3; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar.is-rail-preview .teach-sidebar-rail-trigger,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger:hover,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger:focus-visible { width: 184px; border-color: var(--parchment-3); background: var(--cream); }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar.is-rail-preview .teach-sidebar-rail-label,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger:hover .teach-sidebar-rail-label,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger:focus-visible .teach-sidebar-rail-label { display: inline; }
#page-teachings .teachings-layout { grid-template-columns: 252px minmax(0, 1fr); width: min(1680px, calc(100vw - 2rem)); transition: grid-template-columns 220ms ease; }
#page-teachings .teach-sidebar { padding: .7rem .35rem; }
#page-teachings .teach-sidebar { min-width: 0; }
#page-teachings .teach-sidebar-head { min-height: 44px; display:flex; align-items:center; justify-content:space-between; padding:0 .72rem; font-size:.82rem; font-weight:600; }
#page-teachings .teach-sidebar-title { white-space: nowrap; }
#page-teachings .teach-sidebar-close { min-width:44px; min-height:44px; border:0; background:transparent; font-size:1.35rem; cursor:pointer; }
#page-teachings .teach-sidebar-rail-trigger { display:none; align-items:center; justify-content:flex-start; gap:.55rem; min-width:44px; min-height:44px; width:44px; padding:0 .7rem; border:1px solid transparent; border-radius:999px; background:var(--parchment); color:var(--ink-2); cursor:pointer; font:600 .78rem var(--sans); white-space:nowrap; box-shadow:0 6px 18px rgba(16,37,23,.12); }
#page-teachings .teach-sidebar-rail-icon { display:inline-grid; place-items:center; flex:0 0 28px; font-size:1rem; line-height:1; }
#page-teachings .teach-sidebar-rail-label { display:none; }
#page-teachings .teach-sidebar-rail-trigger:focus-visible { outline:3px solid color-mix(in srgb, var(--sienna) 60%, white); outline-offset:3px; }
#page-teachings .sidebar-book { min-height:44px; margin-left:.25rem; padding:.35rem .5rem; gap:.35rem; }
#page-teachings .sidebar-book-toggle, #page-teachings .sidebar-book-name { min-height:40px; border:0; background:transparent; color:inherit; cursor:pointer; font:inherit; }
#page-teachings .sidebar-book-toggle { width:32px; flex:0 0 32px; font-size:1.1rem; }
#page-teachings .sidebar-book-name { flex:1; text-align:left; font-size:.94rem; }
#page-teachings .sidebar-chap { min-height:44px; display:flex; align-items:center; font-size:.88rem; padding-left:2.2rem; }
#page-teachings .teach-main { padding:0 2.4rem 4rem; min-width:0; }
#page-teachings .study-page-header { position:sticky; top:60px; z-index:80; padding:.7rem 0 .75rem; background:rgba(252,251,247,.94); backdrop-filter:blur(10px); transition:transform 180ms ease, opacity 180ms ease; }
#page-teachings .study-page-header.is-toolbar-hidden { transform:translateY(calc(-100% + 8px)); opacity:.18; }
#page-teachings .reader-toolbar-main { display:flex; align-items:center; gap:.65rem; min-height:48px; }
#page-teachings .reader-toolbar-menu { display:inline-flex; align-items:center; gap:.4rem; min-height:44px; padding:0 .75rem; border:1px solid var(--parchment-3); border-radius:999px; background:rgba(255,255,255,.55); cursor:pointer; font:600 .78rem var(--sans); }
#page-teachings .reader-toolbar-reference { margin:0; min-width:8.5rem; font:500 1.28rem/1.15 var(--serif); }
#page-teachings .compact-version-control { min-width:108px; max-width:130px; }
#page-teachings .compact-version-control .teach-version-select { min-width:0; width:100%; height:44px; padding:0 .7rem; font-size:.82rem; }
#page-teachings .teach-reading-modes { min-height:44px; margin-left:auto; }
#page-teachings .teach-mode-btn { min-height:38px; padding:0 .75rem; font-size:.76rem; letter-spacing:.02em; text-transform:none; }
#page-teachings .reader-toolbar-chapter-controls { display:inline-flex; gap:.35rem; }
#page-teachings .reader-toolbar-chapter-controls .teach-chap-btn { width:44px; height:44px; padding:0; font-size:1.3rem; text-transform:none; letter-spacing:0; }
#page-teachings .reader-toolbar-subrow { display:flex; align-items:baseline; gap:.75rem; padding:.35rem 0 0 .2rem; }
#page-teachings .reader-toolbar-subrow .chapter-breadcrumb, #page-teachings .reader-toolbar-subrow .verse-chapter-sub { margin:0; font-size:.82rem; }
#page-teachings .study-content-layout { max-width:1180px; padding-top:1.55rem; gap:2rem; }
#page-teachings .study-content-layout.is-study, #page-teachings .study-content-layout.is-study-experience { grid-template-columns:minmax(0,1fr); gap:0; }
#page-teachings .study-content-layout.is-interlinear { grid-template-columns:minmax(0,1fr) minmax(260px,340px); gap:1.5rem; align-items:stretch; }
#page-teachings .scripture-column, #page-teachings .chapter-reader { max-width:820px; }

/* Reading owns the full workspace; only the passage keeps a comfortable measure. */
#page-teachings.active .study-content-layout.is-reading-mode {
  display: block;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding-top: 1.55rem;
}

#page-teachings.active .study-content-layout.is-reading-mode .reading-workspace {
  width: 100%;
  max-width: none;
  min-width: 0;
}

#page-teachings.active .study-content-layout.is-reading-mode .reading-passage {
  width: min(100%, 860px);
  max-width: 860px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 56px);
  box-sizing: border-box;
}

@media (max-width: 767px) {
  #page-teachings.active .study-content-layout.is-reading-mode {
    padding-top: 0.75rem;
  }

  #page-teachings.active .study-content-layout.is-reading-mode .reading-passage {
    width: 100%;
    max-width: none;
    padding-inline: clamp(20px, 5vw, 28px);
  }
}

/* Search Scripture V3 Word/Lexical richness pass: source-backed orientation. */
.study-word-identity[data-word-family="lexical"] .study-word-original {
  unicode-bidi: isolate;
  text-align: start;
}

.study-word-identity-meaning {
  min-width: 0;
}

.study-word-identity-qualifier {
  max-width: 42rem;
  margin: 0.45rem 0 0;
  color: var(--ink-4);
  font-size: 0.76rem;
  line-height: 1.5;
}

.study-word-insights {
  min-width: 0;
  padding: 0.9rem 1rem 1rem;
  border-top: 1px solid var(--parchment-3);
  border-bottom: 1px solid var(--parchment-3);
  background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
}

.study-word-insights-summary {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.5rem;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
}

.study-word-insights-summary::-webkit-details-marker {
  display: none;
}

.study-word-insights-summary::after {
  content: "＋";
  flex: 0 0 auto;
  color: var(--ink-4);
  font-size: 1rem;
  line-height: 1;
}

.study-word-insights[open] .study-word-insights-summary::after {
  content: "−";
}

.study-word-insights-summary > span:first-child {
  display: grid;
  gap: 0.15rem;
}

.study-word-insights-summary strong {
  color: var(--ink);
  font: 600 1rem/1.3 var(--sans);
}

.study-word-insights-summary > span:last-of-type {
  flex: 0 1 auto;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.study-word-insights-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.9rem 0 0;
}

.study-word-insights-list > div {
  min-width: 0;
  padding-top: 0.55rem;
  border-top: 1px solid var(--parchment-3);
}

.study-word-insights-list dt {
  color: var(--ink-4);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-transform: uppercase;
}

.study-word-insights-list dd {
  margin: 0.25rem 0 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.study-word-book-filter {
  display: grid;
  width: 100%;
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.study-word-book-filter:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.study-word-book-card.is-active {
  border-color: color-mix(in srgb, var(--study-ref-green) 58%, var(--study-ref-border-strong) 42%);
  background: var(--study-ref-green-soft);
}

.study-word-book-card.is-active .study-word-book-card-head {
  color: var(--study-ref-green);
}

.study-word-book-clear {
  justify-self: start;
  min-height: 36px;
  padding-inline: 0.7rem;
}

@media (max-width: 767px) {
  .study-word-insights-summary {
    align-items: start;
  }

  .study-word-insights-summary > span:last-of-type {
    max-width: 9rem;
    text-align: left;
  }

  .study-word-insights-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Understand the Text language detail stays a compact evidence surface. It
   intentionally uses the existing Study typography and semantic colors rather
   than reproducing the full Interlinear workspace. */
#page-teachings.active .study-understand-language {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line, rgba(190, 208, 191, 0.2));
}

#page-teachings.active .study-understand-language-head,
#page-teachings.active .study-understand-language-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

#page-teachings.active .study-understand-language-kicker,
#page-teachings.active .study-understand-language-scope,
#page-teachings.active .study-understand-language-source,
#page-teachings.active .study-understand-language-meta,
#page-teachings.active .study-understand-language-transliteration {
  color: var(--ink-3);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

#page-teachings.active .study-understand-language-kicker {
  margin: 0 0 0.25rem;
  color: var(--color-accent, #9dcc8e);
  font-weight: 700;
  text-transform: uppercase;
}

#page-teachings.active .study-understand-language-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}

#page-teachings.active .study-understand-language-scope {
  padding-top: 1.15rem;
  text-align: right;
}

#page-teachings.active .study-understand-language-intro {
  max-width: 44rem;
  margin: 0;
  color: var(--ink-2);
  font-size: 0.92rem;
  line-height: 1.55;
}

#page-teachings.active .study-understand-language-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-understand-language-token {
  display: grid;
  grid-template-columns: minmax(7rem, 0.45fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
  padding: 0.8rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line, #718070) 45%, transparent);
}

#page-teachings.active .study-understand-language-original,
#page-teachings.active .study-understand-language-detail {
  min-width: 0;
}

#page-teachings.active .study-understand-language-original {
  display: grid;
  gap: 0.25rem;
}

#page-teachings.active .study-understand-language-surface {
  color: var(--ink);
  font-family: var(--serif, Georgia, serif);
  font-size: 1.1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#page-teachings.active .study-understand-language-transliteration {
  overflow-wrap: anywhere;
}

#page-teachings.active .study-understand-language-detail {
  display: grid;
  gap: 0.28rem;
}

#page-teachings.active .study-understand-language-gloss {
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.45;
}

#page-teachings.active .study-understand-language-meta {
  overflow-wrap: anywhere;
}

#page-teachings.active .study-understand-language-grammar {
  color: var(--ink-2);
  font-size: 0.82rem;
}

#page-teachings.active .study-understand-language-grammar summary {
  cursor: pointer;
  color: var(--color-accent, #9dcc8e);
}

#page-teachings.active .study-understand-language-grammar p {
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

#page-teachings.active .study-understand-language-foot {
  align-items: center;
  flex-wrap: wrap;
}

#page-teachings.active .study-understand-language-source {
  margin: 0;
}

#page-teachings.active .study-understand-language-action {
  white-space: nowrap;
}

@media (max-width: 767px) {
  #page-teachings.active .study-understand-language-head,
  #page-teachings.active .study-understand-language-foot {
    gap: 0.65rem;
  }

  #page-teachings.active .study-understand-language-scope {
    padding-top: 0.25rem;
  }

  #page-teachings.active .study-understand-language-token {
    grid-template-columns: minmax(5.5rem, 0.42fr) minmax(0, 1fr);
    gap: 0.65rem;
  }
}

/* Study reference design shell: a dark, evidence-led workspace around the
   existing Study renderer. Data and interactions remain owned by Study. */
body:has(#page-teachings.active) {
  --study-ref-bg: #121411;
  --study-ref-surface: #1b1d18;
  --study-ref-surface-raised: #23251f;
  --study-ref-surface-soft: #20221c;
  --study-ref-border: rgba(235, 233, 219, 0.12);
  --study-ref-border-strong: rgba(235, 233, 219, 0.2);
  --study-ref-text: #f2f0e7;
  --study-ref-text-soft: #d5d4c9;
  --study-ref-muted: #9d9f91;
  --study-ref-green: #9ccf8b;
  --study-ref-green-soft: rgba(156, 207, 139, 0.12);
  --study-ref-gold: #d8b875;
  background: var(--study-ref-bg);
  color: var(--study-ref-text);
}

body:has(#page-teachings.active) .nav {
  background: #11130f;
  color: var(--study-ref-text-soft);
}

body:has(#page-teachings.active) .nav-brand,
body:has(#page-teachings.active) .nav-link {
  color: var(--study-ref-text-soft);
}

body:has(#page-teachings.active) .nav-link:hover,
body:has(#page-teachings.active) .nav-link.active {
  color: var(--study-ref-text);
}

#page-teachings.active {
  --parchment: var(--study-ref-bg);
  --parchment-2: var(--study-ref-surface);
  --parchment-3: var(--study-ref-border);
  --ink: var(--study-ref-text);
  --ink-2: var(--study-ref-text-soft);
  --ink-3: var(--study-ref-muted);
  --ink-4: #777b70;
  --color-brand: var(--study-ref-green);
  --color-brand-hover: #b3dfa3;
  --color-accent: var(--study-ref-gold);
  --color-link: #c9e5bb;
  --color-link-hover: #e0f3d5;
  background: var(--study-ref-bg);
  color: var(--study-ref-text);
}

#page-teachings.active .teachings-layout,
#page-teachings.active .teach-main,
#page-teachings.active .study-content-layout,
#page-teachings.active .study-experience,
#page-teachings.active .study-experience-main,
#page-teachings.active .study-experience-rail {
  background: var(--study-ref-bg);
}

#page-teachings.active .teach-main {
  padding-inline: clamp(1rem, 3.2vw, 3.5rem);
}

#page-teachings.active .study-page-header {
  background: color-mix(in srgb, var(--study-ref-bg) 92%, transparent);
  border-bottom-color: var(--study-ref-border);
}

#page-teachings.active .reader-toolbar-menu,
#page-teachings.active .compact-version-control .teach-version-select,
#page-teachings.active .teach-mode-btn,
#page-teachings.active .reader-toolbar-chapter-controls .teach-chap-btn {
  border-color: var(--study-ref-border-strong);
  background: var(--study-ref-surface);
  color: var(--study-ref-text-soft);
}

#page-teachings.active .teach-mode-btn.active {
  background: var(--study-ref-green);
  border-color: var(--study-ref-green);
  color: #142014;
}

#page-teachings.active .study-experience-header {
  display: none;
}

#page-teachings.active .study-experience-grid.is-reference-design {
  grid-template-columns: minmax(208px, 0.86fr) minmax(0, 2.8fr) minmax(252px, 1.08fr);
  gap: clamp(1rem, 2.2vw, 2rem);
  align-items: start;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-reference-rail,
#page-teachings.active .study-experience-grid.is-reference-design .study-experience-rail {
  min-width: 0;
  position: sticky;
  top: 5.5rem;
  max-height: calc(100vh - 6.5rem);
  overflow: auto;
  scrollbar-width: thin;
}

#page-teachings.active .study-reference-rail {
  display: grid;
  align-content: start;
  gap: 1.1rem;
  min-height: calc(100vh - 7rem);
  padding: 0.7rem 1.2rem 2.5rem 0;
  border-right: 1px solid var(--study-ref-border);
}

/* The right context rail is secondary to readable Scripture. Once the
   reference-design container can no longer give the main study pane roughly
   520px while retaining both rails, keep the left passage rail and return
   Wider Book Context to its inline Study disclosure below the passage. */
@media (min-width: 1024px) and (max-width: 1100px) {
  #page-teachings.active .study-experience-grid.is-reference-design {
    grid-template-columns: minmax(208px, 240px) minmax(0, 1fr);
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-experience-rail {
    display: none;
  }
}

#page-teachings.active .study-reference-rail-back,
#page-teachings.active .study-reference-rail-search,
#page-teachings.active .study-reference-rail-choose,
#page-teachings.active .study-reference-rail-actions button {
  border: 0;
  background: transparent;
  color: var(--study-ref-green);
  font: 700 0.72rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

#page-teachings.active .study-reference-rail-view-switch {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-reference-rail-view-switch button {
  min-height: 2.15rem;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--study-ref-muted);
  font: 700 0.72rem/1.2 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-reference-rail-view-switch button:hover,
#page-teachings.active .study-reference-rail-view-switch button:focus-visible {
  color: var(--study-ref-text);
}

#page-teachings.active .study-reference-rail-view-switch button.active {
  border-bottom-color: var(--study-ref-green);
  color: var(--study-ref-text);
}

#page-teachings.active .study-reference-rail-back {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--study-ref-gold);
}

#page-teachings.active .study-reference-rail-passage {
  display: grid;
  gap: 0.55rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-reference-rail-passage h2 {
  color: var(--study-ref-green);
  font: 700 1.2rem/1.2 var(--sans);
}

#page-teachings.active .study-reference-rail-version,
#page-teachings.active .study-reference-rail-kicker {
  color: var(--study-ref-gold);
  font: 700 0.66rem/1.2 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#page-teachings.active .study-reference-rail-passage p {
  color: var(--study-ref-text-soft);
  font: 0.86rem/1.72 var(--serif);
}

#page-teachings.active .study-reference-rail-empty {
  color: var(--study-ref-muted) !important;
  font-family: var(--sans) !important;
}

#page-teachings.active .study-reference-rail-choose {
  justify-self: start;
  min-height: 2.3rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--study-ref-border-strong);
  border-radius: 0.42rem;
  background: var(--study-ref-surface-raised);
}

#page-teachings.active .study-reference-rail-preview {
  display: grid;
  gap: 0.65rem;
}

#page-teachings.active .study-reference-rail-preview h3 {
  color: var(--study-ref-text);
  font: 700 0.98rem/1.3 var(--sans);
}

#page-teachings.active .study-reference-rail-numbers {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

#page-teachings.active .study-reference-rail-numbers button {
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--study-ref-border-strong);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--study-ref-text-soft);
  font: 700 0.72rem/1 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-reference-rail-numbers button.is-selected {
  border-color: var(--study-ref-green);
  background: var(--study-ref-green);
  color: #142014;
}

#page-teachings.active .study-reference-rail-scripture-preview {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.25rem 0 0;
}

#page-teachings.active .study-reference-rail-scripture-preview-head {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-reference-rail-scripture-preview-head h4 {
  min-width: 0;
  overflow: hidden;
  color: var(--study-ref-text);
  font: 700 0.82rem/1.25 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

#page-teachings.active .study-reference-rail-scripture-preview-head span {
  flex: 0 0 auto;
  color: var(--study-ref-muted);
  font: 600 0.64rem/1.2 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* In verse focus, the chapter row remains a navigation aid while the verse
   row carries the active reading emphasis. This prevents “Genesis 6” from
   competing with the selected “verse 1” in Genesis 6:1. */
#page-teachings.active .study-reference-rail.is-verse-focus .study-reference-rail-numbers button.is-selected {
  border-color: var(--study-ref-border-strong);
  background: transparent;
  color: var(--study-ref-text-soft);
  box-shadow: none;
}

#page-teachings.active .study-reference-rail.is-verse-focus .study-reference-rail-verse-row.is-selected {
  padding-inline: 0.42rem 0.35rem;
  border-radius: 0.2rem;
  background: color-mix(in srgb, var(--study-ref-green) 12%, var(--study-ref-surface-raised) 88%);
  box-shadow: inset 3px 0 0 var(--study-ref-green);
}

#page-teachings.active .study-reference-rail.is-verse-focus .study-reference-rail-verse-row.is-selected button {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  min-height: 1.45rem;
  border-radius: 0.28rem;
  background: var(--study-ref-green);
  color: #142014;
  text-decoration: none;
}

#page-teachings.active .study-passage-context-preview {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.35rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-passage-context-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

#page-teachings.active .study-passage-context-preview-head h4 {
  color: var(--study-ref-text);
  font: 700 0.86rem/1.3 var(--sans);
}

#page-teachings.active .study-passage-context-preview-head span {
  color: var(--study-ref-muted);
  font: 0.72rem/1.3 var(--sans);
}

#page-teachings.active .study-passage-context-preview-list {
  display: grid;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-passage-context-preview-row {
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  padding: 0.48rem 0.15rem;
  border-bottom: 1px solid var(--study-ref-border);
  color: var(--study-ref-text-soft);
  font: 0.86rem/1.5 var(--serif);
}

#page-teachings.active .study-passage-context-preview-row:not(.is-selected) {
  opacity: 0.7;
}

#page-teachings.active .study-passage-context-preview-row.is-selected {
  padding-inline: 0.4rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--study-ref-green) 10%, var(--study-ref-surface-raised) 90%);
  box-shadow: inset 3px 0 0 var(--study-ref-green);
  color: var(--study-ref-text);
  font-weight: 600;
}

#page-teachings.active .study-passage-context-preview-verse {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  min-height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: 0.28rem;
  background: transparent;
  color: var(--study-ref-green);
  font: 700 0.74rem/1 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-passage-context-preview-verse.is-selected {
  background: var(--study-ref-green);
  color: #142014;
}

#page-teachings.active .study-reference-rail-verse-list {
  display: grid;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-reference-rail-verse-row {
  display: grid;
  grid-template-columns: 1.15rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--study-ref-border);
  color: var(--study-ref-text-soft);
  font: 0.76rem/1.45 var(--serif);
}

#page-teachings.active .study-reference-rail-verse-row button {
  border: 0;
  background: transparent;
  color: var(--study-ref-green);
  font: 700 0.72rem/1.45 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-reference-rail-verse-row button.is-selected {
  color: var(--study-ref-text);
  text-decoration: underline;
  text-decoration-color: var(--study-ref-green);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-reference-rail-verse-row:not(.is-selected) {
  opacity: 0.82;
}

#page-teachings.active .study-reference-rail-verse-row.is-selected {
  color: var(--study-ref-text);
  font-weight: 600;
  background: color-mix(in srgb, var(--study-ref-green) 7%, transparent);
  box-shadow: inset 2px 0 0 var(--study-ref-green);
}

#page-teachings.active .study-reference-rail-verse-row.is-selected > span {
  color: inherit;
}

#page-teachings.active .study-reference-rail-scripture-preview .study-reference-rail-verse-row > span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

#page-teachings.active .study-reference-rail-verse-row.is-selected button {
  color: var(--study-ref-green);
  font-weight: 800;
}

#page-teachings.active .study-reference-rail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
}

#page-teachings.active .study-reference-rail-scripture-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  padding-top: 0.1rem;
}

#page-teachings.active .study-reference-rail-scripture-preview-actions button {
  border: 0;
  background: transparent;
  color: var(--study-ref-green);
  font: 700 0.7rem/1.3 var(--sans);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

#page-teachings.active .study-reference-rail-scripture-preview-actions button:hover,
#page-teachings.active .study-reference-rail-scripture-preview-actions button:focus-visible {
  color: var(--study-ref-text);
}

#page-teachings.active .study-reference-rail-actions button:first-child,
#page-teachings.active .study-reference-rail-search {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-reference-rail-search {
  align-self: end;
  padding-top: 0.8rem;
  border-top: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-reference-main-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0 1.2rem;
  border-bottom: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-reference-breadcrumb {
  margin-bottom: 0.55rem;
  color: var(--study-ref-muted);
  font: 0.76rem/1.2 var(--sans);
}

#page-teachings.active .study-reference-main-heading h2 {
  color: var(--study-ref-text);
  font: 700 clamp(1.6rem, 2.5vw, 2.25rem)/1.1 var(--sans);
}

#page-teachings.active .study-reference-main-choose {
  min-height: 2.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--study-ref-border-strong);
  border-radius: 0.45rem;
  background: var(--study-ref-surface);
  color: var(--study-ref-text-soft);
  font: 600 0.76rem/1.2 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-current-stage {
  gap: 0;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-evidence-group {
  border-color: var(--study-ref-border);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-evidence-summary {
  min-height: 3.35rem;
  padding: 0.85rem 0;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-evidence-summary-title {
  color: var(--study-ref-text);
  font-size: 1rem;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-evidence-summary-meta {
  color: var(--study-ref-green);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-evidence-body {
  padding: 0.55rem 0 1.5rem;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-resource + .study-setting-resource {
  border-top-color: var(--study-ref-border);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry {
  border-bottom-color: var(--study-ref-border);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry strong,
#page-teachings.active .study-experience-grid.is-reference-design .study-setting-domain-title,
#page-teachings.active .study-experience-grid.is-reference-design .study-outline-list li strong {
  color: var(--study-ref-text);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-scope,
#page-teachings.active .study-experience-grid.is-reference-design .study-setting-meta,
#page-teachings.active .study-experience-grid.is-reference-design .study-setting-evidence,
#page-teachings.active .study-experience-grid.is-reference-design .study-setting-event-context {
  color: var(--study-ref-muted);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry {
  padding: 0.75rem 1rem 0.75rem 0;
  border-right: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry + .study-setting-entry {
  padding-left: 1rem;
}

#page-teachings.active .study-experience-grid.is-reference-design #study-resource-events .study-setting-entry-list,
#page-teachings.active .study-experience-grid.is-reference-design #study-resource-timelines .study-setting-entry-list {
  grid-template-columns: minmax(0, 1fr);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

#page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-list li {
  min-height: 5rem;
  padding: 0.8rem;
  border: 1px solid var(--study-ref-border);
  border-radius: 0.5rem;
  background: var(--study-ref-surface);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-link,
#page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-label {
  color: var(--study-ref-text);
}

#page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-type {
  color: var(--study-ref-green);
}

@media (max-width: 1350px) {
  #page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Shared contextual Help: one quiet, keyboard-accessible visual language. */
.keryg-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--color-surface-raised);
  color: var(--ink-2);
  font: 600 0.82rem/1 var(--sans);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}
.keryg-help-trigger:hover { border-color: var(--ink-3); color: var(--ink); background: var(--parchment-2); transform: translateY(-1px); }
.keryg-help-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent); outline-offset: 2px; }
.keryg-help-trigger--heading { margin-left: 0.35rem; vertical-align: 0.12em; }
.keryg-help-trigger--inline { margin-left: 0.4rem; }
.keryg-help-popover {
  position: fixed;
  z-index: 260;
  box-sizing: border-box;
  width: min(336px, calc(100vw - 24px));
  max-height: min(420px, calc(100vh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem 1rem 1.05rem;
  border: 1px solid var(--rule-strong);
  border-radius: 0.85rem;
  background: var(--color-dialog-surface);
  color: var(--ink);
  box-shadow: 0 16px 36px var(--color-shadow);
}
.keryg-help-popover[hidden] { display: none; }
.keryg-help-popover__head { display: flex; align-items: flex-start; gap: 0.75rem; justify-content: space-between; }
.keryg-help-popover__title { margin: 0; font: 600 1rem/1.3 var(--serif); color: var(--ink); }
.keryg-help-popover__body { margin: 0.65rem 0 0; color: var(--ink-2); font: 400 0.86rem/1.55 var(--sans); }
.keryg-help-popover__close { width: 30px; height: 30px; flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--ink-3); font-size: 1.35rem; line-height: 1; cursor: pointer; }
.keryg-help-popover__close:hover { color: var(--ink); }
.keryg-help-popover__close:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent); outline-offset: 2px; border-radius: 0.25rem; }
.reader-mode-help-group { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.study-search-mode-control-wrap { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; }
.study-search-mode-control-wrap .step-study-select { min-width: 0; }
.reader-more-help-slot { display: flex; align-items: center; gap: 0.45rem; padding: 0.3rem 0.45rem; border-top: 1px solid var(--rule); }
.reader-more-help-slot::after { content: 'Help'; color: var(--ink-2); font: 500 0.82rem/1 var(--sans); }
@media (max-width: 767px) {
  .keryg-help-trigger { width: 36px; height: 36px; }
  .keryg-help-trigger--inline { margin-left: 0.25rem; }
  .reader-mode-help-group > .keryg-help-trigger { display: none; }
  #page-teachings .reader-more-help-slot .keryg-help-trigger { display: inline-flex; }
  .keryg-help-popover { max-height: min(420px, calc(100vh - 24px)); }
}
@media (prefers-reduced-motion: reduce) {
  .keryg-help-trigger { transition: none; }
}

@media (max-width: 1023px) {
  html:has(#page-teachings.active) {
    overflow-x: clip;
  }
}

#page-teachings.active .study-reference-context-rail {
  display: grid;
  gap: 1rem;
}

#page-teachings.active .study-reference-context-card {
  display: grid;
  gap: 0.9rem;
  padding: 1.1rem;
  border: 1px solid var(--study-ref-border);
  border-radius: 0.9rem;
  background: var(--study-ref-surface);
}

#page-teachings.active .study-reference-context-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

#page-teachings.active .study-reference-context-card header h3 {
  color: var(--study-ref-text);
  font: 700 1rem/1.25 var(--sans);
}

#page-teachings.active .study-reference-context-card header button {
  border: 0;
  background: transparent;
  color: var(--study-ref-green);
  font: 600 0.72rem/1.2 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-reference-context-card h4 {
  color: var(--study-ref-text);
  font: 700 0.95rem/1.25 var(--sans);
}

#page-teachings.active .study-reference-context-meta,
#page-teachings.active .study-reference-context-label {
  color: var(--study-ref-green);
  font: 700 0.64rem/1.2 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.active .study-reference-context-copy,
#page-teachings.active .study-reference-context-themes {
  color: var(--study-ref-text-soft);
  font: 0.82rem/1.7 var(--sans);
}

#page-teachings.active .study-reference-context-copy.is-clamped {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

#page-teachings.active .study-reference-context-card .study-commentary-more summary {
  color: var(--study-ref-green);
}

@media (max-width: 1023px) {
  #page-teachings.active .study-experience-header {
    display: grid;
  }

  #page-teachings.active .study-experience-grid.is-reference-design {
    grid-template-columns: minmax(0, 1fr);
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-reference-rail,
  #page-teachings.active .study-experience-grid.is-reference-design .study-experience-rail {
    display: none;
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-passage-focus-card {
    display: grid;
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry-list {
    grid-template-columns: minmax(0, 1fr);
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry,
  #page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry + .study-setting-entry {
    padding-inline: 0;
    border-right: 0;
  }
}

@media (max-width: 767px) {
  #page-teachings.active .study-search-topbar,
  #page-teachings.active .study-selected-topbar {
    align-items: stretch;
  }

  #page-teachings.active .study-search-topbar .study-search-view-switcher,
  #page-teachings.active .study-selected-topbar .study-search-view-switcher {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  #page-teachings.active .study-navigation-view-switcher {
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--parchment-3);
  }

  #page-teachings.active .study-search-view-switcher .study-workspace-tab {
    flex: 1 1 0;
    text-align: center;
  }

  #page-teachings.active .study-search-topbar .study-search-back {
    width: 100%;
    margin-left: 0;
  }

  #page-teachings.active .study-experience-header {
    display: grid;
  }

  #page-teachings.active .study-reference-main-heading {
    padding-top: 0;
  }

  #page-teachings.active .study-reference-main-heading h2 {
    font-size: 1.45rem;
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry-list,
  #page-teachings.active .study-experience-grid.is-reference-design .study-related-passage-list {
    grid-template-columns: minmax(0, 1fr);
  }

  #page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry,
  #page-teachings.active .study-experience-grid.is-reference-design .study-setting-entry + .study-setting-entry {
    padding-inline: 0;
    border-right: 0;
  }
}

#page-teachings .reader-verse { font-size:1.22rem; line-height:1.82; margin-bottom:.65rem; }
#page-teachings .reader-verse-num { font-size:.7rem; }
#page-teachings .study-mode-panel, #page-teachings .interlinear-inspector { position:sticky; top:126px; max-height:calc(100vh - 146px); overflow:auto; padding:1.2rem; }
#page-teachings.is-interlinear-mode .study-content-layout.is-interlinear .scripture-column,
#page-teachings.is-interlinear-mode .study-content-layout.is-interlinear .chapter-reader,
#page-teachings.is-interlinear-mode .study-content-layout.is-interlinear .interlinear-inspector { max-width:none; width:100%; }
#page-teachings .study-surface-loading { min-height:120px; display:grid; place-items:center; gap:.35rem; font-size:.92rem; }
#page-teachings .study-surface-close { min-width:44px; min-height:44px; }
@media (min-width:1280px) {
  #page-teachings .teachings-layout { display:grid; grid-template-columns:252px minmax(0,1fr); }
  #page-teachings .teachings-layout:not(.is-library-open) { grid-template-columns:0 minmax(0,1fr) !important; }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar {
    width:0 !important;
    max-width:0 !important;
    min-width:0 !important;
    padding:0 !important;
    border:0 !important;
    border-inline-end:0 !important;
    overflow:hidden;
    visibility:hidden;
  }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar > * { visibility:hidden; }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head,
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger { display:none; }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-main { grid-column:2; width:auto; min-width:0; }
}
@media (max-width:1279px) {
  #page-teachings .teachings-layout, #page-teachings .teachings-layout:not(.is-library-open) { grid-template-columns:1fr; width:min(100%,calc(100vw - 2rem)); }
  #page-teachings .teach-sidebar { position:fixed; left:0; top:60px; bottom:0; z-index:190; width:min(300px,86vw); height:auto; transform:translateX(-105%); background:var(--parchment); box-shadow:12px 0 28px rgba(16,37,23,.12); transition:transform 220ms ease; }
  #page-teachings .teach-sidebar.is-drawer-open { transform:translateX(0); }
  #page-teachings .teach-sidebar-rail-trigger { display:none !important; }
  #page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar > * { visibility:visible; }
  #page-teachings .teach-main { padding:0 1.5rem 3.5rem; }
  #page-teachings .study-content-layout.is-study, #page-teachings .study-content-layout.is-study-experience, #page-teachings .study-content-layout.is-interlinear { grid-template-columns:1fr; }
  #page-teachings .study-content-layout.is-interlinear.is-interlinear-split-view .interlinear-split,
  #page-teachings .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-split { grid-template-columns:1fr; }
  #page-teachings .study-content-layout.is-interlinear.is-interlinear-focus-view .interlinear-pane--translation { display:none; }
  #page-teachings .study-mode-panel, #page-teachings .interlinear-inspector { position:static; max-height:none; }
}
@media (max-width:680px) {
  #page-teachings .teachings-layout { width:100%; }
  #page-teachings .teach-main { padding:0 1rem 2.5rem; }
  #page-teachings .reader-toolbar-main { flex-wrap:wrap; }
  #page-teachings .reader-toolbar-menu { order:1; flex:0 0 auto; }
  #page-teachings .reader-toolbar-menu span { display:none; }
  #page-teachings .reader-toolbar-reference { order:2; min-width:0; flex:1; font-size:1.15rem; }
  #page-teachings .compact-version-control { order:3; flex:0 0 82px; }
  #page-teachings .teach-reading-modes { order:4; width:100%; margin-left:0; }
  #page-teachings .teach-reading-modes .teach-mode-btn { flex:1; }
  #page-teachings .reader-toolbar-chapter-controls { order:5; margin-left:auto; }
  #page-teachings .reader-toolbar-subrow { display:none; }
  #page-teachings .study-content-layout { padding-top:1rem; }
  #page-teachings .reader-verse { font-size:1.1rem; line-height:1.76; }
  #page-teachings .study-word-table { min-width:0; }
  #page-teachings .study-word-table-wrap { overflow-x:visible; }
}

#page-teachings.is-interlinear-mode .study-content-layout.is-interlinear-parallel-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-width: none;
  width: 100%;
  min-height: calc(100dvh - 11rem);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion {
  min-width: 0;
  border: 1px solid var(--color-interlinear-divider);
  border-radius: 2px;
  background: var(--color-interlinear-surface);
  color: var(--color-text);
  overflow: auto;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-kicker {
  margin: 0 0 0.2rem;
  color: var(--color-interlinear-muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-head h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-status {
  flex: 0 0 auto;
  color: var(--color-interlinear-muted);
  font-size: 0.66rem;
  line-height: 1.35;
  text-align: right;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-body {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.9rem;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-language {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion-token-line {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.8;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion .study-gloss-phrase {
  padding: 0;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion .study-gloss-reading-row {
  font-size: 0.9rem;
  line-height: 1.55;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-companion .study-gloss-word-by-word-wrap {
  overflow-x: auto;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-cell.is-reading-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-interlinear-focused) 58%, transparent);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-row.is-reading-active .reader-verse-num {
  color: var(--color-interlinear-focused);
}

@media (min-width:1280px) {
  #page-teachings.is-interlinear-mode .study-content-layout.is-interlinear-parallel-view {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 1.25rem;
    align-items: start;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-main-column {
    grid-column: 1;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion {
    position: sticky;
    top: 6.2rem;
    grid-column: 2;
    grid-row: 1;
    max-height: min(400px, calc(100vh - 8rem));
  }
}

#page-teachings.is-interlinear-mode .study-content-layout.is-interlinear-parallel-view .interlinear-main-column {
  min-width: 0;
  width: 100%;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-shell {
  min-height: calc(100dvh - 11rem);
  align-content: start;
  grid-template-rows: auto minmax(0, 1fr);
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-parallel-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  flex-wrap: nowrap;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-parallel-toolbar .interlinear-toolbar-group {
  display: flex;
  width: auto;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-nav-group {
  overflow: hidden;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-nav-group .teach-chap-btn {
  width: auto;
  min-width: 54px;
  flex: 0 0 auto;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-nav-group .step-study-select {
  width: auto;
  min-width: 120px;
  max-width: 220px;
  flex: 0 1 220px;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-utility-group {
  justify-content: flex-end;
  overflow: hidden;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-utility-group .study-tabs {
  display: inline-flex;
  flex: 0 0 auto;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
  column-gap: 0;
  align-items: stretch;
  min-width: 0;
  min-height: calc(100dvh - 15rem);
  overflow: hidden;
  border: 1px solid var(--color-interlinear-divider);
  border-radius: 2px;
  background: var(--color-interlinear-raised);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-column-header {
  min-width: 0;
  width: 100%;
  max-width: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-interlinear-divider);
  border-radius: 0;
  padding: 0.72rem 0.9rem;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-column-header:first-child {
  border-right: 1px solid var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-column-header .interlinear-pane-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-rows {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  min-width: 0;
  width: 100%;
  max-width: none;
  overflow: visible;
  align-content: start;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  min-width: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-cell {
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 1rem 1.2rem;
  overflow-wrap: anywhere;
  border-left: 1px solid var(--color-interlinear-divider);
  border-radius: 0;
  background: transparent;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-cell:first-child {
  border-left: 0;
  border-right: 1px solid var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-cell:hover,
#page-teachings.is-interlinear-mode .interlinear-parallel-row.is-aligned-hover .interlinear-parallel-cell {
  background: var(--color-interlinear-hover);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-cell.is-selected {
  background: var(--color-interlinear-selected);
  box-shadow: inset 2px 0 0 var(--color-interlinear-strongs);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-cell--original {
  direction: ltr;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-original-text {
  display: inline;
  min-width: 0;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-translation-text {
  display: inline;
  direction: ltr;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-row-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-details-toggle,
#page-teachings.is-interlinear-mode .interlinear-parallel-details-close {
  flex: 0 0 auto;
  white-space: nowrap;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-row {
  grid-column: 1 / -1;
  min-width: 0;
  overflow: visible;
  border-bottom: 1px solid var(--color-interlinear-divider);
  background: color-mix(in srgb, var(--color-interlinear-raised) 92%, var(--color-interlinear-hover));
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-head strong {
  min-width: 0;
  margin-right: auto;
  overflow-wrap: anywhere;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-depth {
  color: var(--color-interlinear-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-content {
  min-width: 0;
  padding: 0.9rem 1.2rem 1.15rem;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-content .study-gloss-phrase {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-detail-content > .study-gloss-toggle {
  margin-top: 0.85rem;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .reader-verse {
  min-width: 0;
  overflow-wrap: anywhere;
}

#page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-token-inline {
  line-height: 2.1;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-study-drawer {
  position: fixed;
  top: 6.2rem;
  right: 1.5rem;
  z-index: 260;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 3rem));
  max-height: calc(100vh - 8rem);
  overflow: hidden;
  background: var(--color-study-surface);
  border: 1px solid var(--color-study-surface-border);
  border-radius: 3px;
  box-shadow: 0 14px 32px var(--color-shadow);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-study-drawer[hidden] {
  display: none;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--color-interlinear-divider);
}

#page-teachings.is-interlinear-mode .interlinear-parallel-drawer-head h2 {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-drawer-body {
  min-width: 0;
  overflow: auto;
  padding: 0.85rem;
}

#page-teachings.is-interlinear-mode .interlinear-parallel-drawer-body > .interlinear-inspector {
  position: static;
  width: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width:1279px) {
  #page-teachings.is-interlinear-mode .study-content-layout.is-interlinear-parallel-view {
    grid-template-columns: 1fr;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion {
    grid-row: 1;
    margin-bottom: 0.85rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-main-column {
    grid-row: 2;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-workspace-grid {
    grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  }
}

@media (max-width:900px) {
  #page-teachings.is-interlinear-mode .interlinear-parallel-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-cell {
    border-left: 0;
    border-top: 1px solid var(--color-interlinear-divider);
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-cell:first-child {
    border-top: 0;
    border-right: 0;
  }
}

@media (max-width:680px) {
  #page-teachings.is-interlinear-parallel-view .teach-main {
    overflow-x: clip;
  }
  #page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-parallel-toolbar {
    display: flex;
    flex-wrap: wrap;
  }

  #page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-parallel-toolbar .interlinear-toolbar-group {
    width: 100%;
    flex-wrap: wrap;
    overflow: visible;
  }

  #page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-nav-group .teach-chap-btn,
  #page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-nav-group .step-study-select {
    flex: 1 1 72px;
    min-width: 0;
    max-width: none;
  }

  #page-teachings.is-interlinear-mode .is-interlinear-parallel-view .interlinear-utility-group {
    justify-content: flex-start;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion {
    max-height: 42vh;
    overflow: auto;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion-head {
    padding: 0.7rem 0.75rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion-status {
    max-width: 9rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion-body {
    padding: 0.75rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-companion-token-line {
    font-size: 0.98rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-study-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100vw;
    max-height: 72vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px 10px 0 0;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-detail-head {
    flex-wrap: wrap;
    padding: 0.75rem 0.9rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-detail-head strong {
    flex: 1 1 100%;
    margin-right: 0;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-detail-content {
    padding: 0.85rem 0.9rem 1rem;
  }

  #page-teachings.is-interlinear-mode .interlinear-parallel-details-toggle,
  #page-teachings.is-interlinear-mode .interlinear-parallel-details-close {
    min-height: 2.75rem;
  }
}
@media (prefers-reduced-motion:reduce) { #page-teachings .study-page-header, #page-teachings .teach-sidebar, #page-teachings .teachings-layout { transition:none; } }

/* Integrated Bible library rail control. */
#page-teachings .teach-sidebar-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 48px;
  padding: 0 .5rem;
  border-bottom: 1px solid var(--rule);
}
#page-teachings .teach-sidebar-rail-trigger {
  display: inline-flex;
  order: -1;
  position: static;
  align-items: center;
  justify-content: flex-start;
  gap: .45rem;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0 .65rem;
  overflow: hidden;
  border: 1px solid var(--parchment-3);
  border-radius: 10px;
  background: var(--parchment);
  color: var(--ink-2);
  box-shadow: none;
  font: 600 .78rem var(--sans);
  transition: width 180ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
#page-teachings .teach-sidebar-rail-trigger:hover,
#page-teachings .teach-sidebar-rail-trigger:focus-visible {
  width: 44px;
  border-color: rgba(160, 82, 45, .35);
  background: var(--parchment-2);
  color: var(--ink);
}
#page-teachings .teach-sidebar-rail-trigger.is-expanded {
  width: 44px;
  border-radius: 10px;
}
#page-teachings .teach-sidebar-rail-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 1.55rem;
  font-weight: 400;
  line-height: 1;
}
#page-teachings .teach-sidebar-rail-label {
  display: none;
  white-space: nowrap;
}
#page-teachings .teach-sidebar-rail-trigger:focus-visible {
  outline: 2px solid rgba(160, 82, 45, .5);
  outline-offset: 2px;
}
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head {
  justify-content: center;
  padding: 0;
  border-bottom-color: transparent;
}
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head .teach-sidebar-title,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-head .teach-sidebar-close {
  display: none;
}
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger {
  position: relative;
  left: auto;
  top: auto;
}
#page-teachings .teach-sidebar-rail-trigger:hover .teach-sidebar-rail-label,
#page-teachings .teach-sidebar-rail-trigger:focus-visible .teach-sidebar-rail-label { display: none; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar.is-rail-preview .teach-sidebar-rail-trigger {
  width: 44px;
  position: relative;
  left: auto;
}
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar.is-rail-preview .teach-sidebar-rail-label { display: none; }
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger:hover,
#page-teachings .teachings-layout:not(.is-library-open) .teach-sidebar-rail-trigger:focus-visible {
  position: absolute;
  left: 4px;
  z-index: 3;
}
@media (max-width: 1279px) {
  #page-teachings .teach-sidebar-rail-trigger { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #page-teachings .teach-sidebar-rail-trigger { transition: none; }
}

/* Scripture-bound reader toolbar and persistent top reveal chip. */
#page-teachings #teach-version-bar {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  display: contents;
}
#page-teachings .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
#page-teachings .reader-toolbar-shell {
  position: relative;
  width: 100%;
  display: contents;
}
#page-teachings .study-page-header {
  position: sticky;
  top: 60px;
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  z-index: 80;
  padding: .5rem .65rem .55rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: rgba(252, 251, 247, .985);
  box-shadow: 0 5px 16px rgba(16, 37, 23, .07);
  backdrop-filter: none;
  transition: transform 180ms ease, opacity 180ms ease;
}
#page-teachings .study-page-header.is-toolbar-hidden {
  transform: translateY(calc(-100% - 8px));
  opacity: 0;
  pointer-events: none;
}
#page-teachings .reader-toolbar-main {
  min-height: 48px;
  flex-wrap: nowrap;
}
#page-teachings .reader-toolbar-menu,
#page-teachings .reader-more-toggle {
  min-height: 44px;
  border: 1px solid var(--parchment-3);
  border-radius: 10px;
  background: var(--parchment);
  color: var(--ink-2);
  box-shadow: none;
  font: 600 .78rem var(--sans);
}
#page-teachings .reader-toolbar-menu:hover,
#page-teachings .reader-toolbar-menu:focus-visible,
#page-teachings .reader-more-toggle:hover,
#page-teachings .reader-more-toggle:focus-visible {
  border-color: rgba(160, 82, 45, .35);
  background: var(--parchment-2);
  color: var(--ink);
}
#page-teachings .reader-toolbar-menu:focus-visible,
#page-teachings .reader-more-toggle:focus-visible,
#page-teachings #teach-prev-chap:focus-visible,
#page-teachings #teach-next-chap:focus-visible,
#page-teachings #teach-version-select:focus-visible {
  outline: 2px solid rgba(160, 82, 45, .5);
  outline-offset: 2px;
}
#page-teachings .reader-toolbar-reference {
  flex: 1 1 auto;
  min-width: 7rem;
  white-space: nowrap;
  font-size: 1.2rem;
}
#page-teachings .compact-version-control {
  flex: 0 0 116px;
  min-width: 0;
}
#page-teachings .compact-version-control .teach-version-select {
  min-width: 0;
  height: 44px;
  border-radius: 10px;
  background: var(--parchment);
}
#page-teachings .teach-reading-modes {
  display: none !important;
}
#page-teachings .reader-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 .75rem;
  cursor: pointer;
}
#page-teachings .reader-more-menu {
  position: absolute;
  top: calc(100% + .45rem);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  z-index: 95;
  display: grid;
  gap: .25rem;
  width: min(220px, calc(100vw - 32px));
  min-width: 0;
  padding: .6rem;
  border: 1px solid var(--parchment-3);
  border-radius: 10px;
  background: var(--parchment);
  box-shadow: 0 12px 24px rgba(16, 37, 23, .12);
}
#page-teachings .reader-more-menu[hidden] { display: none !important; }
#page-teachings .reader-more-label {
  padding: .25rem .55rem .35rem;
  color: var(--ink-4);
  font-size: .72rem;
}
#page-teachings .reader-more-mode-btn {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  padding: 0 .55rem;
  cursor: pointer;
  font: 500 .82rem var(--sans);
}
#page-teachings .reader-more-mode-btn:hover,
#page-teachings .reader-more-mode-btn:focus-visible { background: var(--parchment-2); outline: none; }
#page-teachings .reader-more-mode-btn.is-active {
  background: var(--parchment-2);
  color: var(--ink);
  font-weight: 700;
}
#page-teachings .reader-more-mode-btn.is-active::after {
  content: '✓';
  margin-left: auto;
  color: var(--sienna);
  font-weight: 700;
}
#page-teachings .reader-toolbar-reveal {
  position: fixed;
  top: 68px;
  left: 50%;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .75rem;
  transform: translateX(-50%);
  border: 1px solid var(--parchment-3);
  border-radius: 999px;
  background: rgba(252, 251, 247, .985);
  color: var(--ink-2);
  box-shadow: 0 5px 16px rgba(16, 37, 23, .1);
  cursor: pointer;
  font: 600 .76rem var(--sans);
}
#page-teachings .reader-toolbar-reveal[hidden] { display: none !important; }
#page-teachings .reader-toolbar-reveal:hover,
#page-teachings .reader-toolbar-reveal:focus-visible {
  border-color: rgba(160, 82, 45, .35);
  background: var(--parchment-2);
  outline: 2px solid rgba(160, 82, 45, .35);
  outline-offset: 2px;
}
#page-teachings .reader-toolbar-reveal-label { white-space: nowrap; }
#page-teachings .reader-verse { scroll-margin-top: 128px; }
@media (max-width: 1279px) {
  #page-teachings .teach-sidebar {
    right: auto;
    left: 0;
    transform: translateX(-105%);
  }
}
  @media (max-width: 680px) {
  #page-teachings .reader-toolbar-shell {
    display: grid;
    gap: 0.4rem;
  }
  #page-teachings .reader-toolbar-reveal {
    position: sticky;
    top: 68px;
    left: auto;
    right: auto;
    transform: none;
    margin: 0.35rem auto 0;
    width: fit-content;
    max-width: calc(100% - 1rem);
    font-size: .72rem;
  }
  #page-teachings .reader-toolbar-reveal-label { white-space: normal; }
  #page-teachings .study-page-header { top: 60px; padding: .45rem; border-radius: 10px; }
  #page-teachings .reader-toolbar-main { gap: .3rem; }
  #page-teachings .reader-toolbar-menu { width: 44px; min-width: 44px; padding: 0; justify-content: center; }
  #page-teachings .reader-toolbar-menu span { display: none; }
  #page-teachings .reader-toolbar-reference { min-width: 0; font-size: 1.05rem; }
  #page-teachings .compact-version-control { flex: 0 0 72px; }
  #page-teachings .compact-version-control .teach-version-select { padding-inline: .45rem; font-size: .74rem; }
  #page-teachings .teach-reading-modes { display: none; }
  #page-teachings .reader-toolbar-menu { order: 1; }
  #page-teachings .reader-toolbar-reference { order: 2; }
  #page-teachings .compact-version-control { order: 3; }
  #page-teachings .reader-toolbar-chapter-controls { order: 4; }
  #page-teachings .reader-more-toggle { order: 5; width: 44px; min-width: 44px; padding: 0; font-size: 0; }
  #page-teachings .reader-more-toggle::before { content: '⋯'; font-size: 1.35rem; line-height: 1; }
  #page-teachings .reader-toolbar-chapter-controls { gap: .25rem; }
  #page-teachings .reader-toolbar-chapter-controls .teach-chap-btn { width: 44px; min-width: 44px; }
  #page-teachings .reader-toolbar-subrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #page-teachings .study-page-header { transition: opacity 1ms linear; }
  #page-teachings .reader-toolbar-reveal { transition: none; }
}

/* Responsive Reading / Study / Interlinear selector. */
#page-teachings .reader-mode-selector {
  display: none;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
  gap: 0.15rem;
  padding: 3px;
  border: 1px solid var(--parchment-3);
  border-radius: 10px;
  background: var(--parchment-2);
}
#page-teachings .reader-mode-option {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 38px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  font: 600 0.76rem var(--sans);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
#page-teachings .reader-mode-option:hover,
#page-teachings .reader-mode-option:focus-visible {
  background: color-mix(in srgb, var(--parchment) 78%, var(--sienna) 22%);
  color: var(--ink);
}
#page-teachings .reader-mode-option:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--sienna) 58%, transparent);
  outline-offset: 2px;
}
#page-teachings .reader-mode-option.is-active {
  background: var(--ink-2);
  color: var(--sand);
  box-shadow: 0 3px 10px rgba(16, 37, 23, 0.16);
}
#page-teachings .reader-mode-selector[aria-hidden="true"],
#page-teachings .reader-more-toggle[aria-hidden="true"] {
  pointer-events: none;
}

#page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-mode-selector {
  display: none !important;
}
#page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-more-toggle {
  display: inline-flex;
}

@media (min-width: 1100px) {
  #page-teachings .reader-mode-selector {
    display: inline-flex;
  }
  #page-teachings .reader-toolbar-main:not(.is-mode-selector-compact) .reader-more-toggle,
  #page-teachings .reader-toolbar-main:not(.is-mode-selector-compact) ~ .reader-more-menu,
  #page-teachings .reader-toolbar-main:not(.is-mode-selector-compact) .reader-more-menu {
    display: none !important;
  }
  #page-teachings .reader-toolbar-chapter-controls {
    order: 3;
  }
  #page-teachings .reader-mode-selector {
    order: 4;
  }
  #page-teachings .compact-version-control {
    order: 5;
  }
}

@media (min-width: 768px) and (max-width: 1099px) {
  #page-teachings .reader-mode-selector {
    display: none;
  }
  #page-teachings .reader-more-toggle {
    display: inline-flex;
    order: 4;
  }
  #page-teachings .compact-version-control {
    order: 5;
  }
}

/* Reuse the approved compact mobile language for medium widths. The H1 stays
   in the DOM for semantics, while the toolbar prioritizes the passage and
   navigation controls and exposes modes through More. */
@media (min-width: 768px) {
  #page-teachings .reader-toolbar-main.is-mode-selector-compact {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 72px repeat(3, 44px);
    grid-template-rows: 44px;
    align-items: center;
    gap: .35rem;
    min-height: 44px;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-toolbar-page-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-toolbar-reference-full,
  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-mode-help-group {
    display: none;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-toolbar-reference-mobile {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-items: baseline;
    min-width: 0;
    gap: .35rem;
    overflow: visible;
    color: var(--study-ref-text);
    font: 700 .86rem/1 var(--sans);
    letter-spacing: .035em;
    white-space: nowrap;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-toolbar-menu {
    grid-column: 1;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    justify-content: center;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .compact-version-control {
    grid-column: 3;
    grid-row: 1;
    width: 72px;
    min-width: 0;
    height: 44px;
    flex: none;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .compact-version-control .teach-version-select {
    width: 72px;
    height: 44px;
    min-height: 44px;
    padding-inline: .45rem;
    font-size: .76rem;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-toolbar-chapter-controls {
    display: contents;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-toolbar-chapter-controls .teach-chap-btn {
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact #teach-prev-chap { grid-column: 4; }
  #page-teachings .reader-toolbar-main.is-mode-selector-compact #teach-next-chap { grid-column: 5; }

  #page-teachings .reader-toolbar-main.is-mode-selector-compact .reader-more-toggle {
    grid-column: 6;
    grid-row: 1;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
  }
}

@media (max-width: 767px) {
  #page-teachings .reader-mode-selector {
    display: none !important;
  }
  #page-teachings .reader-more-toggle {
    display: inline-flex;
    order: 6;
  }
  #page-teachings .reader-more-menu {
    display: grid;
  }
}

/* Search Scripture V2 Word Mode: scoped inner workspace polish. */
.study-word-mode {
  display: grid;
  gap: 1rem;
}

.study-word-mode .study-search-heading {
  margin-bottom: 0;
}

.study-word-heading-note {
  margin: 0.35rem 0 0;
  color: var(--ink-3);
  font-size: 0.88rem;
  line-height: 1.55;
}

.study-word-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
  gap: 1rem;
  align-items: start;
}

.study-word-main,
.study-word-rail {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.study-word-rail {
  position: sticky;
  top: 1rem;
}

.study-word-rail .study-search-recent {
  margin-top: 0;
}

.study-word-rail-card,
.study-word-identity,
.study-word-book-distribution,
.study-word-evidence,
.study-word-empty-state {
  min-width: 0;
  border: 1px solid var(--parchment-3);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
}

.study-word-rail-card,
.study-word-identity,
.study-word-empty-state {
  padding: 1rem;
}

.study-word-identity {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(9rem, 0.65fr);
  gap: 1rem;
}

.study-word-identity-main,
.study-word-identity-stats,
.study-word-translation-stats,
.study-word-identity-details {
  min-width: 0;
}

.study-word-title,
.study-word-original {
  margin: 0;
  color: var(--ink);
  line-height: 1.25;
}

.study-word-title {
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  font-weight: 650;
}

.study-word-original {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 650;
}

.study-word-lemma {
  margin: 0.35rem 0 0;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.5;
}

.study-word-meta {
  margin: 0.3rem 0 0;
  color: var(--ink-4);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.study-word-identity-stats,
.study-word-translation-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  align-content: start;
}

.study-word-identity-stats div,
.study-word-translation-stats div {
  min-width: 0;
  padding-left: 0.75rem;
  border-left: 1px solid var(--parchment-3);
}

.study-word-identity-stats dt,
.study-word-translation-stats dt,
.study-word-identity-details dt,
.study-word-facts dt {
  color: var(--ink-4);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.study-word-identity-stats dd,
.study-word-translation-stats dd {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.2;
}

.study-word-identity-details,
.study-word-translation-stats,
.study-word-actions {
  grid-column: 1 / -1;
}

.study-word-identity-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--parchment-3);
}

.study-word-identity-details dd {
  margin: 0.25rem 0 0;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.55;
}

.study-word-translation-stats {
  padding-top: 0.8rem;
  border-top: 1px solid var(--parchment-3);
}

.study-word-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--parchment-3);
}

.study-word-action.is-primary {
  border-color: color-mix(in srgb, var(--ink) 24%, var(--parchment-3) 76%);
  background: color-mix(in srgb, var(--parchment) 88%, var(--ink) 12%);
}

.study-word-facts h4,
.study-word-section-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.study-word-facts dl {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}

.study-word-facts dl div {
  min-width: 0;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
}

.study-word-facts dd {
  margin: 0.2rem 0 0;
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.study-word-book-distribution,
.study-word-evidence {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.study-word-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--parchment-3);
}

.study-word-section-head > p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: right;
}

.study-word-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.study-word-book-card {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--parchment-3) 82%, transparent);
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--parchment) 92%, var(--ink) 8%);
}

.study-word-book-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  color: var(--ink-2);
  font-size: 0.74rem;
  line-height: 1.3;
}

.study-word-book-card-head span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.study-word-book-card-head strong {
  color: var(--study-ref-green);
  font-variant-numeric: tabular-nums;
}

.study-word-book-bar {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.14rem;
  height: 0.36rem;
}

.study-word-book-bar span {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 0.08rem;
  background: color-mix(in srgb, var(--study-ref-green) 14%, var(--study-ref-surface-soft) 86%);
}

.study-word-book-bar span.is-filled {
  background: var(--study-ref-green);
  opacity: 0.78;
}

.study-word-book-card.is-active .study-word-book-bar span {
  background: color-mix(in srgb, var(--study-ref-green) 26%, var(--study-ref-surface-soft) 74%);
}

.study-word-book-card.is-active .study-word-book-bar span.is-filled {
  background: var(--study-ref-green);
  opacity: 1;
}

.study-word-section-toggle {
  justify-self: start;
}

.study-word-book-clear,
.study-word-section-toggle {
  min-height: 2.15rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--study-ref-border-strong);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--study-ref-green);
  box-shadow: none;
  font-weight: 650;
}

.study-word-book-clear:hover,
.study-word-section-toggle:hover {
  border-color: var(--study-ref-green);
  background: var(--study-ref-green-soft);
  color: var(--study-ref-green);
}

.study-word-book-clear:focus-visible,
.study-word-section-toggle:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--study-ref-green) 34%, transparent);
  outline-offset: 2px;
}

.study-word-evidence-list {
  display: grid;
  gap: 0;
}

.study-word-evidence-row {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--parchment-3);
}

.study-word-evidence-row.study-result-card {
  padding: 0.95rem 0;
  border: 0;
  border-bottom: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.study-word-evidence-row:first-child {
  padding-top: 0.15rem;
}

.study-word-evidence-row:last-child {
  border-bottom: 0;
}

.study-word-evidence-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.study-word-evidence-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.study-word-evidence-head p {
  margin: 0.2rem 0 0;
  color: var(--ink-4);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.study-word-evidence-verse {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.75;
}

.study-word-evidence-row .study-result-actions {
  border-top: 0;
  padding-top: 0.1rem;
}

.study-word-occurrence-browser .study-lexical-card {
  border: 0;
  border-bottom: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.study-word-occurrence-browser .study-lexical-card:last-child {
  border-bottom: 0;
}

.study-word-empty-state {
  display: grid;
  gap: 0.75rem;
}

.study-word-empty-state p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.65;
}

@media (max-width: 1023px) {
  .study-word-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-word-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .study-word-identity {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-word-identity-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-word-identity-details,
  .study-word-translation-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-word-rail,
  .study-word-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-word-section-head,
  .study-word-evidence-head {
    align-items: start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .study-word-section-head > p {
    text-align: left;
  }

  .study-word-mode .study-search-filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-word-mode .study-search-clear-wrap {
    grid-column: 1 / -1;
  }
}

/* Search Scripture V2 Phrase Mode: exact-text research workspace. */
.study-phrase-mode {
  display: grid;
  gap: 1rem;
}

.study-phrase-mode .study-search-heading {
  margin-bottom: 0;
}

.study-phrase-heading-note {
  margin: 0.35rem 0 0;
  color: var(--ink-3);
  font-size: 0.88rem;
  line-height: 1.55;
}

.study-phrase-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
  gap: 1rem;
  align-items: start;
}

.study-phrase-main,
.study-phrase-rail {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.study-phrase-rail {
  position: sticky;
  top: 1rem;
}

.study-phrase-rail .study-search-recent {
  margin-top: 0;
}

.study-phrase-identity,
.study-phrase-facts,
.study-phrase-evidence,
.study-phrase-empty-state {
  min-width: 0;
  border: 1px solid var(--parchment-3);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--parchment) 96%, var(--ink) 4%);
}

.study-phrase-identity,
.study-phrase-facts,
.study-phrase-empty-state {
  padding: 1rem;
}

.study-phrase-identity {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(13rem, 0.65fr);
  gap: 1rem;
}

.study-phrase-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.study-phrase-meta {
  margin: 0.35rem 0 0;
  color: var(--ink-4);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
}

.study-phrase-identity-stats,
.study-phrase-translation-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
  align-content: start;
}

.study-phrase-translation-stats {
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 0.8rem;
  border-top: 1px solid var(--parchment-3);
}

.study-phrase-identity-stats div,
.study-phrase-translation-stats div {
  min-width: 0;
  padding-left: 0.75rem;
  border-left: 1px solid var(--parchment-3);
}

.study-phrase-identity-stats dt,
.study-phrase-translation-stats dt,
.study-phrase-facts dt {
  color: var(--ink-4);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.study-phrase-identity-stats dd,
.study-phrase-translation-stats dd {
  margin: 0.2rem 0 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.study-phrase-facts h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.study-phrase-facts-copy {
  margin: 0.75rem 0 0;
  color: var(--ink-2);
  font-size: 0.86rem;
  line-height: 1.6;
}

.study-phrase-facts dl {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 0;
}

.study-phrase-facts dl div {
  min-width: 0;
  padding-top: 0.6rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
}

.study-phrase-facts dd {
  margin: 0.2rem 0 0;
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.study-phrase-evidence {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.study-phrase-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--parchment-3);
}

.study-phrase-section-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.study-phrase-section-head > p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: right;
}

.study-phrase-evidence-list {
  display: grid;
  gap: 0;
}

.study-phrase-evidence-row {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--parchment-3);
}

.study-phrase-evidence-row.study-result-card {
  padding: 0.95rem 0;
  border: 0;
  border-bottom: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.study-phrase-evidence-row:first-child {
  padding-top: 0.15rem;
}

.study-phrase-evidence-row:last-child {
  border-bottom: 0;
}

.study-phrase-evidence-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.study-phrase-evidence-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.study-phrase-evidence-head p {
  margin: 0.2rem 0 0;
  color: var(--ink-4);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.study-phrase-evidence-verse {
  margin: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.75;
}

.study-phrase-evidence-row .study-result-actions {
  padding-top: 0.1rem;
  border-top: 0;
}

.study-phrase-empty-state {
  display: grid;
  gap: 0.75rem;
}

.study-phrase-empty-state p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.65;
}

.study-phrase-loading {
  color: var(--ink-3) !important;
}

@media (max-width: 1023px) {
  .study-phrase-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-phrase-rail {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .study-phrase-identity {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-phrase-identity-stats,
  .study-phrase-translation-stats,
  .study-phrase-rail {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-phrase-section-head,
  .study-phrase-evidence-head {
    align-items: start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .study-phrase-section-head > p {
    text-align: left;
  }

  .study-phrase-mode .study-search-filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-phrase-mode .study-search-clear-wrap {
    grid-column: 1 / -1;
  }
}

/* ══════════════════════════════════════════════════════
   DARK-THEME DESIGN SPIKE — query-scoped and intentionally incomplete
   Activate only with ?theme-preview=softer-light or ?theme-preview=dark.
   This block is limited to the homepage, Bible reader, Apologetics answer,
   and their shared navigation/footer surfaces. It is not a public theme.
══════════════════════════════════════════════════════ */
html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) {
  --color-page: #F1EEE6;
  --color-surface: #E9E5DA;
  --color-surface-raised: #F7F4ED;
  --color-surface-muted: #DED9CC;
  --color-text: #1A2C20;
  --color-text-heading: #102517;
  --color-text-secondary: #365A45;
  --color-text-muted: #5D7F6A;
  --color-border: rgba(16, 37, 23, 0.14);
  --color-border-strong: rgba(16, 37, 23, 0.24);
  --color-focus: rgba(160, 82, 45, 0.62);
  --color-scripture-highlight-surface: rgba(212, 175, 55, 0.18);
  --color-scripture-highlight-marker: #9A7525;
  --color-scripture-selected: rgba(160, 82, 45, 0.15);
  --color-scripture-search-surface: rgba(212, 175, 55, 0.18);
  --color-scripture-search-marker: #9A7525;
  --color-scripture-search-active-marker: #A0522D;
  --color-scripture-highlight: var(--color-scripture-highlight-surface);
  --color-search-match: var(--color-scripture-search-surface);
  --color-scripture-focus-ring: #A0522D;
  --color-scripture-selection-surface: rgba(160, 82, 45, 0.12);
  --color-scripture-selection-marker: #A0522D;
  --color-scripture-current-surface: rgba(212, 175, 55, 0.12);
  --color-scripture-current-marker: #9A7525;
  --color-scripture-hover-surface: rgba(54, 90, 69, 0.08);
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) {
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-surface-inverse: #171A17;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-text-inverse: #F0E7D8;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-link: #A6C8AD;
  --color-link-hover: #C2DEC5;
  --color-focus: #E4BD5C;
  --color-overlay: rgba(10, 12, 10, 0.68);
  --color-shadow: rgba(0, 0, 0, 0.34);
  --color-study-surface: #35322B;
  --color-study-surface-border: #514B42;
  --color-study-tab-surface: #2D2B26;
  --color-study-tab-active: #171A17;
  --color-dialog-surface: #35322B;
  --color-dialog-backdrop: rgba(10, 12, 10, 0.68);
  --color-dialog-action-surface: #35322B;
  --color-scripture-highlight-surface: rgba(215, 180, 92, 0.28);
  --color-scripture-highlight-marker: #E4BD5C;
  --color-scripture-selected: rgba(155, 194, 161, 0.30);
  --color-scripture-current: rgba(155, 194, 161, 0.24);
  --color-scripture-search-surface: rgba(232, 189, 104, 0.32);
  --color-scripture-search-marker: #E4BD5C;
  --color-scripture-search-active-marker: #F5EEE3;
  --color-scripture-highlight: var(--color-scripture-highlight-surface);
  --color-search-match: var(--color-scripture-search-surface);
  --color-interlinear-surface: #302E29;
  --color-interlinear-raised: #35322B;
  --color-interlinear-token: #3D3931;
  --color-interlinear-original: #F5EEE3;
  --color-interlinear-transliteration: #C9C0B3;
  --color-interlinear-gloss: #C9C0B3;
  --color-interlinear-morphology: #A79E92;
  --color-interlinear-strongs: #A6C8AD;
  --color-interlinear-divider: #514B42;
  --color-interlinear-selected: rgba(155, 194, 161, 0.20);
  --color-interlinear-focused: #E4BD5C;
  --color-interlinear-hover: rgba(233, 226, 215, 0.08);
  --color-lexical-surface: #35322B;
  --color-lexical-raised: #2D2B26;
  --color-lexical-secondary: #A79E92;
  --color-commentary-surface: #353029;
  --color-scripture-commentary-linked-marker: #A6C8AD;
  --color-scripture-interlinear-linked-marker: #E4BD5C;
  --color-scripture-text: var(--color-text);
  --color-scripture-number: var(--color-text-muted);
  --color-scripture-heading: var(--color-text-heading);
  --color-scripture-footnote: var(--color-link);
  --color-scripture-selection: rgba(215, 180, 92, 0.42);
  --color-scripture-selection-text: #24231F;
  --color-scripture-focus-ring: #E4BD5C;
  --color-scripture-selection-surface: rgba(155, 194, 161, 0.20);
  --color-scripture-selection-marker: #A6C8AD;
  --color-scripture-current-surface: rgba(228, 189, 92, 0.12);
  --color-scripture-current-marker: #E4BD5C;
  --color-scripture-hover-surface: rgba(233, 226, 215, 0.08);
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme-preview="softer-light"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)),
html[data-theme-preview="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) {
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme-preview="softer-light"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .nav,
html[data-theme-preview="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .nav {
  background: var(--color-surface);
  color: var(--color-text);
}

html[data-theme-preview="softer-light"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .footer,
html[data-theme-preview="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .footer {
  color: var(--color-text);
}

html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(.entry-card, .apologetics-question-card, .apologetics-answer-card, .apologetics-answer-panel, .apologetics-search-input, .study-mode-panel, .interlinear-inspector),
html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(.entry-card, .apologetics-question-card, .apologetics-answer-card, .apologetics-answer-panel, .apologetics-search-input, .study-mode-panel, .interlinear-inspector) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme-preview="softer-light"] #page-teachings.active :is(.teachings-layout, .teach-sidebar, .study-page-header, .study-content-layout, .chapter-reader),
html[data-theme-preview="dark"] #page-teachings.active :is(.teachings-layout, .teach-sidebar, .study-page-header, .study-content-layout, .chapter-reader) {
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme-preview="dark"] #page-teachings.active .teach-sidebar,
html[data-theme-preview="dark"] #page-teachings.active .reader-toolbar-menu,
html[data-theme-preview="dark"] #page-teachings.active .reader-toolbar-reveal,
html[data-theme-preview="dark"] #page-teachings.active .teach-version-select,
html[data-theme-preview="dark"] #page-teachings.active .study-surface-backdrop,
html[data-theme-preview="dark"] #page-teachings.active .study-surface {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
}

html[data-theme-preview="dark"] #page-teachings.active :is(.reader-verse, .reader-verse-num, .study-surface-copy, .study-surface-ref) {
  color: var(--color-text);
}

html[data-theme-preview="dark"] #page-teachings.active .reader-verse-num {
  color: var(--color-text-secondary);
}

html[data-theme-preview="dark"] #page-teachings.active .study-surface-backdrop,
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-modal-backdrop {
  background: var(--color-overlay);
}

html[data-theme-preview="dark"] #page-teachings.active .reader-verse.is-selected,
html[data-theme-preview="dark"] #page-teachings.active .reader-verse.is-current,
html[data-theme-preview="dark"] #page-teachings.active .reader-verse:hover {
  background: var(--color-scripture-selected);
  border-color: var(--color-border-strong);
}

html[data-theme-preview="dark"] #page-apologetics.active .apologetics-hero-surface {
  background-color: #302D27;
  background-image: linear-gradient(90deg, rgba(36, 35, 31, 0.96), rgba(36, 35, 31, 0.82) 48%, rgba(36, 35, 31, 0.46)), url('/assets/images/apologetics-hero-background.webp');
  border-color: var(--color-border);
  box-shadow: 0 24px 56px var(--color-shadow);
}

html[data-theme-preview="dark"] #page-apologetics.active .apologetics-hero-surface::after {
  background: linear-gradient(180deg, rgba(48, 45, 39, 0), rgba(48, 45, 39, 0.78));
}

html[data-theme-preview="dark"] #page-home.active .home-hero-image::after {
  background: linear-gradient(90deg, rgba(36, 35, 31, 0.94), rgba(36, 35, 31, 0.66) 34%, rgba(36, 35, 31, 0.12) 72%, rgba(36, 35, 31, 0));
}

html[data-theme-preview="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .footer-panel {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 18px 42px var(--color-shadow);
}

html[data-theme-preview="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .footer-cta {
  background: #171A17;
  color: var(--color-text-heading);
}

/* Keep the primary footer action readable against the warm-dark CTA panel. */
html[data-theme="dark"] .footer-cta-link-primary,
html[data-theme-preview="dark"] .footer-cta-link-primary {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
  text-shadow: 0 1px 12px rgba(228, 189, 92, 0.12);
}

html[data-theme="dark"] .footer-cta-link-primary:hover,
html[data-theme-preview="dark"] .footer-cta-link-primary:hover,
html[data-theme="dark"] .footer-cta-link-primary:focus-visible,
html[data-theme-preview="dark"] .footer-cta-link-primary:focus-visible {
  color: var(--color-text-heading);
  border-bottom-color: var(--color-text-heading);
}

html[data-theme-preview="softer-light"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .footer-panel {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
}

html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(a, button, input, select):focus-visible,
html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(a, button, input, select):focus-visible {
  outline-color: var(--color-focus);
}

/* Final validation coverage for shared controls used by the prototype routes. */
html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(input, select, textarea, .privacy-button, .privacy-clear-button, .teach-tool-btn, .teach-mode-btn, .teach-chap-btn, .study-surface-tab, .study-surface-close, .apologetics-modal-close),
html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(input, select, textarea, .privacy-button, .privacy-clear-button, .teach-tool-btn, .teach-mode-btn, .teach-chap-btn, .study-surface-tab, .study-surface-close, .apologetics-modal-close) {
  background-color: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(input, select, textarea)::placeholder,
html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(input, select, textarea)::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(button, input, select, textarea):disabled,
html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(button, input, select, textarea):disabled {
  background-color: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  opacity: .72;
}

html[data-theme-preview="softer-light"] #page-teachings.active :is(.reader-toolbar, .reader-toolbar-menu, .reader-toolbar-reveal, .teach-sidebar, .study-surface, .study-mode-panel, .interlinear-inspector, .study-panel-empty),
html[data-theme-preview="dark"] #page-teachings.active :is(.reader-toolbar, .reader-toolbar-menu, .reader-toolbar-reveal, .teach-sidebar, .study-surface, .study-mode-panel, .interlinear-inspector, .study-panel-empty),
html[data-theme-preview="softer-light"] #page-apologetics.active :is(.apologetics-modal, .apologetics-modal-body, .apologetics-empty-state, .apologetics-loading, .apologetics-error),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-modal, .apologetics-modal-body, .apologetics-empty-state, .apologetics-loading, .apologetics-error),
html[data-theme-preview="softer-light"] body:has(#page-home.active) :is(.privacy-banner, .privacy-settings-dialog, .privacy-toast, .privacy-clear-confirmation),
html[data-theme-preview="dark"] body:has(#page-home.active) :is(.privacy-banner, .privacy-settings-dialog, .privacy-toast, .privacy-clear-confirmation) {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
}

html[data-theme-preview="softer-light"] body:has(#page-home.active) .privacy-settings-layer,
html[data-theme-preview="dark"] body:has(#page-home.active) .privacy-settings-layer {
  background: var(--color-overlay);
}

html[data-theme-preview="softer-light"] #page-teachings.active .study-surface-backdrop,
html[data-theme-preview="dark"] #page-teachings.active .study-surface-backdrop,
html[data-theme-preview="softer-light"] #page-apologetics.active .apologetics-modal-backdrop,
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-modal-backdrop {
  background: var(--color-overlay);
}

/* Stored-theme compatibility for the routes that have passed the rollout gate. */
html[data-theme="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) {
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-surface-inverse: #171A17;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-text-inverse: #F0E7D8;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-link: #A6C8AD;
  --color-link-hover: #C2DEC5;
  --color-focus: #E4BD5C;
  --color-overlay: rgba(10, 12, 10, 0.68);
  --color-shadow: rgba(0, 0, 0, 0.34);
  --color-scripture-highlight-surface: rgba(215, 180, 92, 0.28);
  --color-scripture-highlight-marker: #E4BD5C;
  --color-scripture-selected: rgba(155, 194, 161, 0.30);
  --color-scripture-current: rgba(155, 194, 161, 0.24);
  --color-scripture-focus-ring: #E4BD5C;
  --color-scripture-selection-surface: rgba(155, 194, 161, 0.20);
  --color-scripture-selection-marker: #A6C8AD;
  --color-scripture-current-surface: rgba(228, 189, 92, 0.12);
  --color-scripture-current-marker: #E4BD5C;
  --color-scripture-hover-surface: rgba(233, 226, 215, 0.08);
  --color-scripture-search-surface: rgba(232, 189, 104, 0.32);
  --color-scripture-search-marker: #E4BD5C;
  --color-scripture-search-active-marker: #F5EEE3;
  --color-scripture-highlight: var(--color-scripture-highlight-surface);
  --color-search-match: var(--color-scripture-search-surface);
  --color-interlinear-surface: #302E29;
  --color-interlinear-raised: #35322B;
  --color-interlinear-token: #3D3931;
  --color-interlinear-original: #F5EEE3;
  --color-interlinear-transliteration: #C9C0B3;
  --color-interlinear-gloss: #C9C0B3;
  --color-interlinear-morphology: #A79E92;
  --color-interlinear-strongs: #A6C8AD;
  --color-interlinear-divider: #514B42;
  --color-interlinear-selected: rgba(155, 194, 161, 0.20);
  --color-interlinear-focused: #E4BD5C;
  --color-interlinear-hover: rgba(233, 226, 215, 0.08);
  --color-lexical-surface: #35322B;
  --color-lexical-raised: #2D2B26;
  --color-lexical-secondary: #A79E92;
  --color-commentary-surface: #353029;
  --color-study-surface: #35322B;
  --color-study-surface-border: #514B42;
  --color-study-tab-surface: #2D2B26;
  --color-study-tab-active: #171A17;
  --color-dialog-surface: #35322B;
  --color-dialog-backdrop: rgba(10, 12, 10, 0.68);
  --color-dialog-action-surface: #35322B;
  --color-scripture-commentary-linked-marker: #A6C8AD;
  --color-scripture-interlinear-linked-marker: #E4BD5C;
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="dark"] #page-teachings.active :is(.study-workspace-card, .study-rail-card, .study-search-preview-card) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 12px 28px var(--color-shadow);
}

html[data-theme="dark"] #page-teachings.active .study-current-overview-card {
  background: var(--color-surface);
}

html[data-theme="dark"] #page-teachings.active :is(.study-workspace-copy, .study-rail-copy, .study-search-preview-verse, .study-search-preview-card-meta, .study-search-preview-range, .study-overview-meta, .study-rail-empty, .study-rail-meta, .study-book-overview-copy) {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-teachings.active .study-commentary-more summary {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-brand-hover);
}

html[data-theme="dark"] #page-teachings.active .study-commentary-more summary:hover {
  background: var(--color-surface-muted);
  color: var(--color-text-heading);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active :is(
  .teach-tool-btn,
  .study-search-submit,
  .study-search-clear,
  .study-search-preview-submit,
  .study-search-preview-clear,
  .study-workspace-back,
  .study-theme-article-open,
  .study-rail-search-button,
  .study-result-open
) {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-brand-hover);
  box-shadow: 0 8px 22px var(--color-shadow);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active :is(
  .teach-tool-btn:hover,
  .study-search-submit:hover,
  .study-search-clear:hover,
  .study-search-preview-submit:hover,
  .study-search-preview-clear:hover,
  .study-workspace-back:hover,
  .study-theme-article-open:hover,
  .study-rail-search-button:hover,
  .study-result-open:hover
) {
  background: var(--color-surface-muted);
  border-color: var(--color-brand-hover);
  color: var(--color-text-heading);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active :is(
  .teach-mode-btn.active,
  .study-workspace-tab.active
) {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--color-brand) 34%, var(--color-surface-raised) 66%),
    color-mix(in srgb, var(--color-brand) 22%, var(--color-surface-raised) 78%)
  );
  border-color: color-mix(in srgb, var(--color-brand-hover) 42%, var(--color-border-strong) 58%);
  color: var(--color-text-heading);
  box-shadow: 0 8px 22px var(--color-shadow);
}

html[data-theme="dark"] #page-teachings.active .study-commentary-more-body,
html[data-theme="dark"] #page-teachings.active .study-commentary-preview {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-teachings.active .study-book-overview-copy {
  color: var(--color-text-secondary);
}

@media (max-width: 767px) {
  .study-book-overview-copy.is-collapsed {
    -webkit-line-clamp: 5;
  }
}

html[data-theme="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)),
html[data-theme="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .nav,
html[data-theme="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .footer {
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="dark"] body:has(:is(#page-home.active, #page-teachings.active, #page-apologetics.active)) .nav {
  background: var(--color-surface);
}

html[data-theme="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(.entry-card, .apologetics-question-card, .apologetics-answer-card, .apologetics-answer-panel, .apologetics-search-input, .study-mode-panel, .interlinear-inspector, .reader-toolbar, .reader-toolbar-menu, .reader-toolbar-reveal, .teach-sidebar, .study-surface, .apologetics-modal, .privacy-banner, .privacy-settings-dialog) {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) :is(input, select, textarea, button):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

html[data-theme="dark"] #page-teachings.active .study-surface-close {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
html[data-theme="dark"] #page-teachings.active :is(.study-navigation-trigger, .study-navigation-close) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 12px 28px var(--color-shadow);
}
html[data-theme="dark"] #page-teachings.active .study-navigation-sheet {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  box-shadow: 0 20px 48px var(--color-shadow);
}
html[data-theme="dark"] #page-teachings.active .study-navigation-search-input {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
html[data-theme="dark"] #page-teachings.active .study-navigation-search-input::placeholder {
  color: var(--color-text-muted);
}
html[data-theme="dark"] #page-teachings.active .study-navigation-sheet-handle span {
  background: color-mix(in srgb, var(--color-text-muted) 35%, transparent);
}

html[data-theme="dark"] #page-apologetics.active .apologetics-hero-surface {
  background-color: #302D27;
  background-image: linear-gradient(90deg, rgba(36, 35, 31, 0.96), rgba(36, 35, 31, 0.82) 48%, rgba(36, 35, 31, 0.46)), url('/assets/images/apologetics-hero-background.webp');
  border-color: var(--color-border);
}

html[data-theme="dark"] #page-home.active .home-hero-image::after {
  background: linear-gradient(90deg, rgba(36, 35, 31, 0.94), rgba(36, 35, 31, 0.66) 34%, rgba(36, 35, 31, 0.12) 72%, rgba(36, 35, 31, 0));
}

/* Primary home action: use the visible brand accent in dark mode so the
   conversion action does not disappear into the charcoal page canvas. */
html[data-theme="dark"] #page-home.active .btn-primary,
html[data-theme-preview="dark"] #page-home.active .btn-primary {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-surface-inverse);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] #page-home.active .btn-primary:hover,
html[data-theme-preview="dark"] #page-home.active .btn-primary:hover {
  background: #214A33;
  border-color: #6F9F7C;
  color: var(--color-text-inverse);
}

html[data-theme="dark"] #page-home.active .btn-primary:active,
html[data-theme-preview="dark"] #page-home.active .btn-primary:active {
  background: #173725;
  border-color: var(--color-brand);
  color: var(--color-text-inverse);
}

/* Keep the Apologetics primary actions on the same dark-theme interaction
   scale as the homepage CTA: visible at rest, deeper on hover, and darkest
   while pressed without losing text contrast. */
html[data-theme="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta) {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-surface-inverse);
}

html[data-theme="dark"] #page-apologetics.active .apologetics-hero :is(.apologetics-search-reset, .apologetics-example-chip),
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-hero :is(.apologetics-search-reset, .apologetics-example-chip) {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-apologetics.active .apologetics-hero :is(.apologetics-search-reset, .apologetics-example-chip):hover,
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-hero :is(.apologetics-search-reset, .apologetics-example-chip):hover {
  background: var(--color-surface);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta):hover,
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta):hover {
  background: #214A33;
  border-color: #6F9F7C;
  color: var(--color-text-inverse);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta):active,
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta):active {
  background: #173725;
  border-color: var(--color-brand);
  color: var(--color-text-inverse);
}

/* Keep both theme images on the same desktop bounds so the alternate asset
   does not use a different background scale or crop. */
@media (min-width: 769px) {
  html[data-theme="light"] #page-home.active .home-hero-image,
  html[data-theme-preview="softer-light"] #page-home.active .home-hero-image,
  html[data-theme="dark"] #page-home.active .home-hero-image,
  html[data-theme-preview="dark"] #page-home.active .home-hero-image {
    left: 0;
  }

  html[data-theme="light"] #page-home.active .home-hero-image::after,
  html[data-theme-preview="softer-light"] #page-home.active .home-hero-image::after {
    background: linear-gradient(
      90deg,
      rgba(252, 251, 247, 0.99) 0%,
      rgba(252, 251, 247, 0.98) 24%,
      rgba(252, 251, 247, 0.88) 38%,
      rgba(252, 251, 247, 0.58) 54%,
      rgba(252, 251, 247, 0.18) 72%,
      rgba(252, 251, 247, 0) 90%
    );
  }
}

/* Route-scoped legacy aliases keep existing selectors on the semantic palette. */
html[data-theme-preview="softer-light"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active),
html[data-theme-preview="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active),
html[data-theme="dark"] :is(#page-home.active, #page-teachings.active, #page-apologetics.active) {
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --olive: var(--color-brand);
  --olive-light: var(--color-brand-hover);
  --olive-wash: var(--color-commentary-surface);
  --brand: var(--color-brand);
  --navy: var(--color-text-heading);
  --navy-2: var(--color-success);
  --navy-3: var(--color-brand);
  --navy-4: var(--color-text-muted);
  --cream: var(--color-page);
  --cream-2: var(--color-surface);
  --cream-3: var(--color-surface-muted);
  --rule: var(--color-border);
  --sand: var(--color-text-inverse);
  --sienna-wash: var(--color-commentary-surface);
}

/* Group 1 shared shell: dark canvas and aliases are global. Route content
   that has not passed its own gate is explicitly reset below. */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-surface-inverse: #171A17;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-text-inverse: #F0E7D8;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-accent: #E4BD5C;
  --color-link: #A6C8AD;
  --color-link-hover: #C2DEC5;
  --color-focus: #E4BD5C;
  --color-success: #6F9F7C;
  --color-warning: #E4BD5C;
  --color-danger: #E08B72;
  --color-overlay: rgba(10, 12, 10, 0.68);
  --color-shadow: rgba(0, 0, 0, 0.34);
  --color-nav-surface: #2D2B26;
  --color-scripture-highlight-surface: rgba(215, 180, 92, 0.28);
  --color-scripture-highlight-marker: #E4BD5C;
  --color-scripture-selected: rgba(155, 194, 161, 0.30);
  --color-scripture-current: rgba(155, 194, 161, 0.24);
  --color-scripture-search-surface: rgba(232, 189, 104, 0.32);
  --color-scripture-search-marker: #E4BD5C;
  --color-scripture-search-active-marker: #F5EEE3;
  --color-scripture-highlight: var(--color-scripture-highlight-surface);
  --color-search-match: var(--color-scripture-search-surface);
  --color-interlinear-surface: #302E29;
  --color-commentary-surface: #353029;

  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --olive: var(--color-brand);
  --olive-light: var(--color-brand-hover);
  --olive-wash: var(--color-commentary-surface);
  --brand: var(--color-brand);
  --navy: var(--color-surface-inverse);
  --navy-2: var(--color-success);
  --navy-3: var(--color-brand);
  --navy-4: var(--color-text-muted);
  --sand: var(--color-text-inverse);
  --sand-2: #D6B86A;
  --sienna: var(--color-brand);
  --sienna-lt: var(--color-brand-hover);
  --sienna-wash: var(--color-commentary-surface);
  --cream: var(--color-page);
  --cream-2: var(--color-surface);
  --cream-3: var(--color-surface-muted);
  --rule: var(--color-border);
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="dark"] .nav {
  background: var(--color-nav-surface);
  color: var(--color-text);
}

html[data-theme="dark"] .home-hero-image {
  background-image: url('../assets/home/home-hero-dark.webp');
}

html[data-theme-preview="dark"] .home-hero-image {
  background-image: url('../assets/home/home-hero-dark.webp');
}

html[data-theme="dark"] .footer {
  background: var(--color-page);
  color: var(--color-text);
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-surface-inverse: #171A17;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-text-inverse: #F0E7D8;
  --color-border: #514B42;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-focus: #E4BD5C;
  --color-shadow: rgba(0, 0, 0, 0.34);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --navy: var(--color-surface-inverse);
  --sand: var(--color-text-inverse);
  --sand-2: #D6B86A;
  --sienna: var(--color-brand);
  --sienna-lt: var(--color-brand-hover);
  --cream: var(--color-page);
  --rule: var(--color-border);
}

html[data-theme="dark"] .footer-panel {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 18px 42px var(--color-shadow);
}

html[data-theme="dark"] .footer-cta {
  background: var(--color-surface-inverse);
  color: var(--color-text-heading);
}

/* The shared SVG logo is authored in dark green. On the charcoal footer,
   recolour it to warm cream so the brand mark remains legible without
   changing the source asset used by the light theme. */
html[data-theme="dark"] .footer-logo img,
html[data-theme-preview="dark"] .footer-logo img {
  filter: brightness(0) saturate(100%) invert(91%) sepia(8%) saturate(520%) hue-rotate(350deg) brightness(106%) contrast(94%);
}

html[data-theme="dark"] .nav-brand img,
html[data-theme-preview="dark"] .nav-brand img {
  filter: brightness(0) saturate(100%) invert(91%) sepia(8%) saturate(520%) hue-rotate(350deg) brightness(106%) contrast(94%);
}

html[data-theme="dark"] :is(.nav-link, .nav-toggle, .footer-link, .footer-social):focus-visible,
html[data-theme="dark"] body :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Explicit light-only content boundary for route families not yet converted.
   Remove each route from this list only after its own Group 2+ gate passes. */
html[data-theme="dark"] body > :is(
  #page-books,
  #page-guides,
  #page-guide-authoring,
  #page-guide-series,
  #page-guide-chapter,
  #page-about,
  #page-updates,
  #page-statement-of-faith,
  #page-interpretation,
  #page-editorial-standards,
  #page-languages,
  #page-credits,
  #page-attribution,
  #page-faq,
  #page-services,
  #page-contact,
  #page-privacy,
  #page-terms
).page.active {
  color-scheme: light;
  --color-page: #F1EEE6;
  --color-surface: #E9E5DA;
  --color-surface-raised: #F7F4ED;
  --color-surface-muted: #DED9CC;
  --color-surface-inverse: #102517;
  --color-text: #1A2C20;
  --color-text-heading: #102517;
  --color-text-secondary: #365A45;
  --color-text-muted: #5D7F6A;
  --color-text-inverse: #E2D1B3;
  --color-border: rgba(16, 37, 23, 0.14);
  --color-border-strong: rgba(16, 37, 23, 0.24);
  --color-brand: #A0522D;
  --color-brand-hover: #C4733E;
  --color-accent: #D4AF37;
  --color-link: #A0522D;
  --color-link-hover: #C4733E;
  --color-focus: rgba(160, 82, 45, 0.50);
  --color-success: #1A3A25;
  --color-warning: #D4AF37;
  --color-danger: #A0522D;
  --color-overlay: rgba(16, 37, 23, 0.30);
  --color-shadow: rgba(16, 37, 23, 0.11);
  --color-nav-surface: rgba(245, 241, 234, 0.92);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --olive: var(--color-brand);
  --olive-light: var(--color-brand-hover);
  --olive-wash: #F5EDE4;
  --brand: var(--color-brand);
  --navy: #102517;
  --navy-2: #1A3A25;
  --navy-3: #2F5A40;
  --navy-4: #5D7F6A;
  --sand: #E2D1B3;
  --sand-2: #D4BC94;
  --sienna: #A0522D;
  --sienna-lt: #C4733E;
  --sienna-wash: #F5EDE4;
  --cream: var(--color-page);
  --cream-2: var(--color-surface);
  --cream-3: var(--color-surface-muted);
  --rule: var(--color-border);
  background: var(--color-page);
  color: var(--color-text);
}

/* The footer remains shared shell even when its route content is light-only. */
html[data-theme="dark"] body > :is(
  #page-books,
  #page-guides,
  #page-guide-authoring,
  #page-guide-series,
  #page-guide-chapter,
  #page-about,
  #page-updates,
  #page-statement-of-faith,
  #page-interpretation,
  #page-editorial-standards,
  #page-languages,
  #page-credits,
  #page-attribution,
  #page-faq,
  #page-services,
  #page-contact,
  #page-privacy,
  #page-terms
).page.active .footer {
  color-scheme: dark;
}

/* Group 1B shared controls use the nearest route's semantic palette. */
html[data-theme="dark"] body :is(input, select, textarea) {
  background-color: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

html[data-theme="dark"] body :is(input, select, textarea)::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme="dark"] body :is(button, input, select, textarea):disabled {
  background-color: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  opacity: .72;
}

html[data-theme="dark"] body :is(.apologetics-modal, .apologetics-modal-body, .privacy-banner, .privacy-settings-dialog, .privacy-toast, .privacy-clear-confirmation, .study-surface) {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
}

html[data-theme="dark"] body :is(.apologetics-modal-backdrop, .privacy-settings-layer, .study-surface-backdrop, .teach-library-backdrop) {
  background: var(--color-overlay);
}

html[data-theme="dark"] body .privacy-dialog-actions,
html[data-theme="light"] body .privacy-dialog-actions {
  background: var(--color-surface-raised);
  box-shadow: 0 -8px 18px var(--color-shadow);
}

html[data-theme="dark"] body :is(.privacy-button-danger, .btn-danger) {
  border-color: var(--color-danger);
  background: rgba(224, 139, 114, 0.14);
  color: var(--color-danger);
}

html[data-theme="dark"] body :is(.privacy-button-danger, .btn-danger):hover,
html[data-theme="dark"] body :is(.privacy-button-danger, .btn-danger):focus-visible {
  border-color: var(--color-danger);
  color: var(--color-text-heading);
}

html[data-theme="dark"] body :is(.teach-version-alert, .guide-author-warnings, [role="alert"]) {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

html[data-theme="dark"] body :is(.study-note-status, .step-study-status, [role="status"]) {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] body :is(.apologetics-empty-state, .apologetics-loading, .apologetics-error, .guides-empty-state, .guide-series-empty) {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

/* Apologetics dark surfaces: keep route-specific cards on the shared semantic
   palette. The legacy cards retain their light-theme treatment; this scoped
   layer prevents pale cards with pale text in warm dark mode. */
html[data-theme="dark"] #page-apologetics.active,
html[data-theme-preview="dark"] #page-apologetics.active {
  --apologetics-card-surface: var(--color-surface-raised);
  --apologetics-card-surface-active: var(--color-surface-muted);
  --apologetics-card-border: var(--color-border);
  --apologetics-card-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme="dark"] #page-apologetics.active .apologetics-hero-surface,
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-hero-surface {
  background-color: var(--color-surface-inverse);
  background-image:
    linear-gradient(90deg, rgba(23, 26, 23, 0.96) 0%, rgba(23, 26, 23, 0.86) 30%, rgba(36, 35, 31, 0.68) 58%, rgba(36, 35, 31, 0.28) 100%),
    url('/assets/images/apologetics-hero-background.webp');
  border-color: var(--color-border);
  box-shadow: 0 24px 56px var(--color-shadow);
}

html[data-theme="dark"] #page-apologetics.active .apologetics-hero-surface::after,
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-hero-surface::after {
  background: linear-gradient(180deg, rgba(23, 26, 23, 0) 0%, rgba(23, 26, 23, 0.18) 42%, rgba(23, 26, 23, 0.86) 100%);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-value-card,
  .apologetics-question-card,
  .apologetics-category-spotlight-card,
  .apologetics-category-card,
  .apologetics-perspective-card,
  .apologetics-perspective-overview-card,
  .apologetics-answer-card,
  .apologetics-answer-panel
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-value-card,
  .apologetics-question-card,
  .apologetics-category-spotlight-card,
  .apologetics-category-card,
  .apologetics-perspective-card,
  .apologetics-perspective-overview-card,
  .apologetics-answer-card,
  .apologetics-answer-panel
) {
  background: var(--apologetics-card-surface);
  border-color: var(--apologetics-card-border);
  box-shadow: var(--apologetics-card-shadow);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-category-card.is-active,
  .apologetics-perspective-card.is-active,
  .apologetics-perspective-overview-card.is-active,
  .apologetics-category-spotlight-card.is-active
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-category-card.is-active,
  .apologetics-perspective-card.is-active,
  .apologetics-perspective-overview-card.is-active,
  .apologetics-category-spotlight-card.is-active
) {
  background: var(--apologetics-card-surface-active);
  border-color: var(--color-border-strong);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-value-title,
  .apologetics-question-title,
  .apologetics-category-spotlight-title,
  .apologetics-category-title,
  .apologetics-perspective-title,
  .apologetics-perspective-overview-title,
  .apologetics-section-title
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-value-title,
  .apologetics-question-title,
  .apologetics-category-spotlight-title,
  .apologetics-category-title,
  .apologetics-perspective-title,
  .apologetics-perspective-overview-title,
  .apologetics-section-title
) {
  color: var(--color-text-heading);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-value-text,
  .apologetics-question-answer,
  .apologetics-category-spotlight-copy,
  .apologetics-category-description,
  .apologetics-perspective-description,
  .apologetics-perspective-overview-copy,
  .apologetics-perspective-overview-note,
  .apologetics-category-explorer-perspective-content,
  .apologetics-section-copy
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-value-text,
  .apologetics-question-answer,
  .apologetics-category-spotlight-copy,
  .apologetics-category-description,
  .apologetics-perspective-description,
  .apologetics-perspective-overview-copy,
  .apologetics-perspective-overview-note,
  .apologetics-category-explorer-perspective-content,
  .apologetics-section-copy
) {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-question-category, .apologetics-category-count, .apologetics-category-action, .apologetics-search-label),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-question-category, .apologetics-category-count, .apologetics-category-action, .apologetics-search-label) {
  color: var(--color-text-muted);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-example-chip, .apologetics-summary-chip, .apologetics-answer-chip, .apologetics-answer-feature, .apologetics-tag-pill, .apologetics-perspective-chip, .apologetics-related-link),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-example-chip, .apologetics-summary-chip, .apologetics-answer-chip, .apologetics-answer-feature, .apologetics-tag-pill, .apologetics-perspective-chip, .apologetics-related-link) {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-search-input, .apologetics-autocomplete, .apologetics-search-reset, .apologetics-carousel-button, .apologetics-perspective-overview-link, .apologetics-category-spotlight-link),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-search-input, .apologetics-autocomplete, .apologetics-search-reset, .apologetics-carousel-button, .apologetics-perspective-overview-link, .apologetics-category-spotlight-link) {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-hero-browse-button, .apologetics-category-spotlight-cta) {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-surface-inverse);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-category-explorer, .apologetics-category-explorer-body, .apologetics-category-explorer-loading, .apologetics-category-explorer-empty),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-category-explorer, .apologetics-category-explorer-body, .apologetics-category-explorer-loading, .apologetics-category-explorer-empty) {
  background: var(--color-dialog-surface);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-category-explorer-backdrop),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-category-explorer-backdrop) {
  background: var(--color-dialog-backdrop);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-category-explorer-search-input, .apologetics-category-explorer-clear, .apologetics-category-explorer-load-more, .apologetics-category-explorer-question, .apologetics-category-explorer-close),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-category-explorer-search-input, .apologetics-category-explorer-clear, .apologetics-category-explorer-load-more, .apologetics-category-explorer-question, .apologetics-category-explorer-close) {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-category-explorer-clear:hover, .apologetics-category-explorer-load-more:hover, .apologetics-category-explorer-question:hover, .apologetics-category-explorer-close:hover),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-category-explorer-clear:hover, .apologetics-category-explorer-load-more:hover, .apologetics-category-explorer-question:hover, .apologetics-category-explorer-close:hover) {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-question-link, .apologetics-perspective-action, .apologetics-perspective-overview-kicker, .apologetics-category-spotlight-kicker, .apologetics-section-kicker),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-question-link, .apologetics-perspective-action, .apologetics-perspective-overview-kicker, .apologetics-category-spotlight-kicker, .apologetics-section-kicker) {
  color: var(--color-link);
}

html[data-theme="dark"] #page-apologetics.active :is(.apologetics-value-icon, .apologetics-category-marker),
html[data-theme-preview="dark"] #page-apologetics.active :is(.apologetics-value-icon, .apologetics-category-marker) {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
  color: var(--color-accent);
}

/* Keep the whole Apologetics reading surface on one dark-mode hierarchy:
   page -> section -> card -> selected/interactive state. */
html[data-theme="dark"] #page-apologetics.active,
html[data-theme-preview="dark"] #page-apologetics.active {
  --apologetics-page-surface: var(--color-surface);
  --apologetics-section-surface: var(--color-surface-raised);
  --apologetics-card-surface: var(--color-surface-raised);
  --apologetics-card-surface-active: var(--color-surface-muted);
  --apologetics-card-border: var(--color-border);
  --apologetics-card-shadow: 0 16px 36px rgba(0, 0, 0, 0.24);
  background: var(--apologetics-page-surface);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-answer-section,
  .apologetics-answer-short-card,
  .apologetics-answer-aside,
  .apologetics-answer-stat,
  .apologetics-related-link,
  .apologetics-background-refresh-failure,
  .apologetics-search-error,
  .apologetics-empty-state,
  .apologetics-error,
  .apologetics-loading
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-answer-section,
  .apologetics-answer-short-card,
  .apologetics-answer-aside,
  .apologetics-answer-stat,
  .apologetics-related-link,
  .apologetics-background-refresh-failure,
  .apologetics-search-error,
  .apologetics-empty-state,
  .apologetics-error,
  .apologetics-loading
) {
  background: var(--apologetics-card-surface);
  border-color: var(--apologetics-card-border);
  color: var(--color-text);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-answer-title,
  .apologetics-answer-section-label,
  .apologetics-answer-short,
  .apologetics-answer-stat-text,
  .apologetics-related-link-title,
  .apologetics-loading-title,
  .apologetics-empty-state-title,
  .apologetics-error-title
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-answer-title,
  .apologetics-answer-section-label,
  .apologetics-answer-short,
  .apologetics-answer-stat-text,
  .apologetics-related-link-title,
  .apologetics-loading-title,
  .apologetics-empty-state-title,
  .apologetics-error-title
) {
  color: var(--color-text-heading);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-answer-kicker,
  .apologetics-answer-meta,
  .apologetics-answer-section p,
  .apologetics-answer-section li,
  .apologetics-answer-short-card-head,
  .apologetics-answer-aside,
  .apologetics-related-link-copy,
  .apologetics-search-error
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-answer-kicker,
  .apologetics-answer-meta,
  .apologetics-answer-section p,
  .apologetics-answer-section li,
  .apologetics-answer-short-card-head,
  .apologetics-answer-aside,
  .apologetics-related-link-copy,
  .apologetics-search-error
) {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-apologetics.active :is(
  .apologetics-question-card:hover,
  .apologetics-category-card:hover,
  .apologetics-related-link:hover,
  .apologetics-answer-link:hover,
  .apologetics-example-chip:hover
),
html[data-theme-preview="dark"] #page-apologetics.active :is(
  .apologetics-question-card:hover,
  .apologetics-category-card:hover,
  .apologetics-related-link:hover,
  .apologetics-answer-link:hover,
  .apologetics-example-chip:hover
) {
  background: var(--apologetics-card-surface-active);
  border-color: var(--color-border-strong);
  color: var(--color-text-heading);
}

/* The same shared interaction contract applies to revised softer light. */
html[data-theme="light"] body :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

html[data-theme="light"] body :is(input, select, textarea) {
  background-color: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border-strong);
}

html[data-theme="light"] body :is(input, select, textarea)::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme="light"] body :is(button, input, select, textarea):disabled {
  background-color: var(--color-surface-muted);
  color: var(--color-text-muted);
  border-color: var(--color-border);
  opacity: .72;
}

html[data-theme="light"] body :is(.apologetics-modal, .apologetics-modal-body, .privacy-banner, .privacy-settings-dialog, .privacy-toast, .privacy-clear-confirmation, .study-surface) {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-color: var(--color-border);
}

html[data-theme="light"] body :is(.apologetics-modal-backdrop, .privacy-settings-layer, .study-surface-backdrop, .teach-library-backdrop) {
  background: var(--color-overlay);
}

html[data-theme="light"] body :is(.privacy-button-danger, .btn-danger) {
  border-color: var(--color-danger);
  background: rgba(160, 82, 45, 0.09);
  color: var(--color-danger);
}

html[data-theme="light"] body :is(.teach-version-alert, .guide-author-warnings, [role="alert"]) {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

html[data-theme="light"] body :is(.study-note-status, .step-study-status, [role="status"]) {
  color: var(--color-text-secondary);
}

html[data-theme="light"] body :is(.apologetics-empty-state, .apologetics-loading, .apologetics-error, .guides-empty-state, .guide-series-empty) {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

/* Group 2A — production Bible-reader shell only.
   This block deliberately excludes verse-row state styling and all
   study/interlinear surfaces. Those belong to Groups 2B and 2C. */
html[data-theme="light"] #page-teachings.active,
html[data-theme="dark"] #page-teachings.active {
  color-scheme: inherit;
}

html[data-theme="light"] #page-teachings.active :is(.teachings-layout, .teach-main, .study-content-layout, .chapter-reader),
html[data-theme="dark"] #page-teachings.active :is(.teachings-layout, .teach-main, .study-content-layout, .chapter-reader) {
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="light"] #page-teachings.active .teach-sidebar,
html[data-theme="dark"] #page-teachings.active .teach-sidebar {
  background: var(--color-surface-raised);
  color: var(--color-text);
  border-inline-end: 1px solid var(--color-border);
  box-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme="light"] #page-teachings.active .teach-sidebar-head,
html[data-theme="dark"] #page-teachings.active .teach-sidebar-head {
  color: var(--color-text-heading);
  border-bottom: 1px solid var(--color-border);
}

html[data-theme="light"] #page-teachings.active :is(.sidebar-testament, .sidebar-book-ch, .sidebar-book-toggle, .teach-sidebar-close),
html[data-theme="dark"] #page-teachings.active :is(.sidebar-testament, .sidebar-book-ch, .sidebar-book-toggle, .teach-sidebar-close) {
  color: var(--color-text-muted);
}

html[data-theme="light"] #page-teachings.active :is(.sidebar-book:hover, .sidebar-chap:hover),
html[data-theme="dark"] #page-teachings.active :is(.sidebar-book:hover, .sidebar-chap:hover) {
  background: var(--color-surface-muted);
  color: var(--color-text-heading);
}

html[data-theme="light"] #page-teachings.active .sidebar-book.active,
html[data-theme="dark"] #page-teachings.active .sidebar-book.active {
  background: var(--color-surface-muted);
  color: var(--color-text-heading);
  box-shadow: inset 3px 0 0 var(--color-brand);
}

html[data-theme="light"] #page-teachings.active .sidebar-chap.active,
html[data-theme="dark"] #page-teachings.active .sidebar-chap.active {
  background: var(--color-surface-muted);
  color: var(--color-brand);
  font-weight: 700;
}

html[data-theme="light"] #page-teachings.active .study-page-header,
html[data-theme="dark"] #page-teachings.active .study-page-header {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 8px 22px var(--color-shadow);
}

html[data-theme="light"] #page-teachings.active :is(.reader-toolbar-menu, .reader-more-toggle, .teach-chap-btn, .reader-toolbar-reveal, .teach-version-select),
html[data-theme="dark"] #page-teachings.active :is(.reader-toolbar-menu, .reader-more-toggle, .teach-chap-btn, .reader-toolbar-reveal, .teach-version-select) {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme="light"] #page-teachings.active :is(.reader-toolbar-menu:hover, .reader-toolbar-menu:active, .reader-more-toggle:hover, .reader-more-toggle:active, .teach-chap-btn:hover, .reader-toolbar-reveal:hover),
html[data-theme="dark"] #page-teachings.active :is(.reader-toolbar-menu:hover, .reader-toolbar-menu:active, .reader-more-toggle:hover, .reader-more-toggle:active, .teach-chap-btn:hover, .reader-toolbar-reveal:hover) {
  background: var(--color-surface-muted);
  border-color: var(--color-brand);
  color: var(--color-text-heading);
}

html[data-theme="light"] #page-teachings.active :is(.reader-toolbar-reference, .chapter-breadcrumb),
html[data-theme="dark"] #page-teachings.active :is(.reader-toolbar-reference, .chapter-breadcrumb) {
  color: var(--color-text-heading);
}

html[data-theme="light"] #page-teachings.active :is(.verse-chapter-sub, .teach-version-status),
html[data-theme="dark"] #page-teachings.active :is(.verse-chapter-sub, .teach-version-status) {
  color: var(--color-text-secondary);
}

html[data-theme="light"] #page-teachings.active .teach-version-alert,
html[data-theme="dark"] #page-teachings.active .teach-version-alert {
  border-inline-start: 3px solid var(--color-warning);
  color: var(--color-warning);
  padding-inline-start: .65rem;
}

html[data-theme="light"] #page-teachings.active .reader-more-menu,
html[data-theme="dark"] #page-teachings.active .reader-more-menu {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  box-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme="light"] #page-teachings.active :is(.reader-more-mode-btn:hover, .reader-more-mode-btn:focus-visible, .reader-more-mode-btn.is-active),
html[data-theme="dark"] #page-teachings.active :is(.reader-more-mode-btn:hover, .reader-more-mode-btn:focus-visible, .reader-more-mode-btn.is-active) {
  background: var(--color-surface-muted);
  color: var(--color-text-heading);
}

html[data-theme="light"] #page-teachings.active .teach-library-backdrop,
html[data-theme="dark"] #page-teachings.active .teach-library-backdrop {
  background: var(--color-overlay);
}

html[data-theme="light"] #page-teachings.active :is(.reader-toolbar-menu, .reader-more-toggle, .teach-chap-btn, .teach-version-select, .teach-sidebar-close, .sidebar-book-toggle, .sidebar-book-name, .sidebar-chap, .reader-toolbar-reveal):focus-visible,
html[data-theme="dark"] #page-teachings.active :is(.reader-toolbar-menu, .reader-more-toggle, .teach-chap-btn, .teach-version-select, .teach-sidebar-close, .sidebar-book-toggle, .sidebar-book-name, .sidebar-chap, .reader-toolbar-reveal):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

html[data-theme="light"] #page-teachings.active :is(.reader-toolbar-menu, .reader-more-toggle, .teach-chap-btn, .teach-version-select):disabled,
html[data-theme="dark"] #page-teachings.active :is(.reader-toolbar-menu, .reader-more-toggle, .teach-chap-btn, .teach-version-select):disabled {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  opacity: .72;
}

html[data-theme="light"] #page-teachings.active :is(.missing-content-page, #verse-panel > .verse-chapter-sub),
html[data-theme="dark"] #page-teachings.active :is(.missing-content-page, #verse-panel > .verse-chapter-sub) {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  padding: 1rem 1.1rem;
}

@media (max-width: 1279px) {
  html[data-theme="light"] #page-teachings.active .teach-sidebar,
  html[data-theme="dark"] #page-teachings.active .teach-sidebar {
    background: var(--color-surface-raised);
    box-shadow: 12px 0 28px var(--color-shadow);
    padding-bottom: calc(.7rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 680px) {
  html[data-theme="light"] #page-teachings.active .teach-main,
  html[data-theme="dark"] #page-teachings.active .teach-main {
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
  }

  html[data-theme="light"] #page-teachings.active .teach-version-select,
  html[data-theme="dark"] #page-teachings.active .teach-version-select {
    max-width: 100%;
  }
}

/* Study visual flattening polish: let type, spacing, and rules carry the hierarchy. */
#page-teachings.active .study-workspace-tabs {
  gap: 0.9rem;
}

#page-teachings.active .study-workspace-tab {
  min-height: 2.5rem;
  padding: 0.45rem 0.1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
}

#page-teachings.active .study-workspace-tab.active {
  border-color: var(--color-brand);
  background: transparent;
  color: var(--ink);
}

#page-teachings.active .study-passage-reference-bar {
  min-height: 2rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0;
  border: 0;
  border-bottom: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

#page-teachings.active .study-passage-focus-card {
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem 0 1.35rem 1rem;
  border: 0;
  border-left: 3px solid var(--color-accent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-teachings.active .study-passage-focus-reference-row {
  align-items: baseline;
}

#page-teachings.active .study-choose-verse,
#page-teachings.active .study-passage-focus-action,
#page-teachings.active .study-inline-action {
  min-height: 2.35rem;
  padding: 0.35rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--color-link) !important;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-choose-verse {
  margin-left: auto;
}

#page-teachings.active .study-passage-focus-action:hover,
#page-teachings.active .study-passage-focus-action:focus-visible,
#page-teachings.active .study-choose-verse:hover,
#page-teachings.active .study-choose-verse:focus-visible,
#page-teachings.active .study-inline-action:hover,
#page-teachings.active .study-inline-action:focus-visible {
  color: var(--color-link-hover) !important;
}

#page-teachings.active .study-chapter-preview-list {
  gap: 0;
}

#page-teachings.active .study-chapter-preview-row {
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.45rem 0;
}

#page-teachings.active .study-chapter-preview-verse {
  width: 1.7rem;
  min-height: 2.35rem;
  padding: 0.35rem 0;
  border: 0;
  border-radius: 0.2rem;
  background: transparent;
  color: var(--color-link);
}

#page-teachings.active .study-chapter-preview-verse:hover,
#page-teachings.active .study-chapter-preview-verse:focus-visible {
  border: 0;
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  outline: 2px solid color-mix(in srgb, var(--color-accent) 55%, transparent);
  outline-offset: 1px;
}

#page-teachings.active .study-passage-focus-actions {
  gap: 0.7rem 1rem;
}

#page-teachings.active .study-verse-stepper-button {
  border: 0;
  background: transparent;
  padding-inline: 0.2rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-verse-stepper-button:hover:not(:disabled),
#page-teachings.active .study-verse-stepper-button:focus-visible:not(:disabled) {
  border: 0;
  background: transparent;
  color: var(--color-link-hover);
}

#page-teachings.active .study-current-stack {
  gap: 0;
}

#page-teachings.active .study-evidence-group {
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
}

#page-teachings.active .study-evidence-group:last-child {
  border-bottom: 1px solid var(--parchment-3);
}

#page-teachings.active .study-evidence-summary {
  min-height: 3.1rem;
  padding: 0.8rem 0;
}

#page-teachings.active .study-evidence-summary-title svg {
  display: none;
}

#page-teachings.active .study-evidence-summary-title {
  gap: 0;
  font-size: 1rem;
}

#page-teachings.active .study-evidence-summary-meta {
  font-size: 0.72rem;
}

#page-teachings.active .study-evidence-group[open] .study-evidence-summary {
  border-bottom: 0;
}

#page-teachings.active .study-evidence-body {
  gap: 0.8rem;
  padding: 0.2rem 0 1.25rem;
}

#page-teachings.active .study-setting-resource,
#page-teachings.active .study-setting-resource + .study-setting-resource {
  padding-top: 0;
  border-top: 0;
}

#page-teachings.active .study-setting-resource + .study-setting-resource {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
}

#page-teachings.active .study-setting-domain-title {
  margin: 0;
  color: var(--ink);
  font: 700 0.95rem/1.35 var(--sans);
}

#page-teachings.active .study-setting-entry-list {
  gap: 0.2rem;
}

#page-teachings.active .study-setting-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 58%, transparent);
}

#page-teachings.active .study-setting-scope-heading {
  letter-spacing: 0;
  text-transform: none;
}

#page-teachings.active .study-setting-more summary,
#page-teachings.active .study-related-more summary,
#page-teachings.active .study-source-note summary {
  padding-inline: 0;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-outline-list {
  display: grid;
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-outline-list li {
  display: grid;
  gap: 0.2rem;
}

#page-teachings.active .study-outline-list li strong {
  color: var(--ink);
  font: 700 1rem/1.35 var(--sans);
}

#page-teachings.active .study-outline-list li span {
  color: var(--ink-3);
  font: 0.82rem/1.4 var(--sans);
}

#page-teachings.active .study-card-head {
  gap: 0.5rem;
}

#page-teachings.active .study-evidence-body .study-card-head svg {
  display: none;
}

#page-teachings.active .study-related-passage-list li {
  align-items: flex-start;
  padding: 0.15rem 0;
}

#page-teachings.active .study-related-passage-content {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 0.12rem;
}

#page-teachings.active .study-related-passage-preview {
  display: -webkit-box;
  max-width: 52ch;
  margin: 0;
  overflow: hidden;
  color: var(--ink-2);
  font: 0.78rem/1.45 var(--sans);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#page-teachings.active .study-related-passage-type {
  align-self: flex-start;
  margin-top: 0.65rem;
}

#page-teachings.active .study-related-passage-link,
#page-teachings.active .study-related-passage-label {
  min-height: 2.35rem;
  padding-inline: 0;
}

#page-teachings.active .study-compact-empty {
  padding: 0.25rem 0;
}

#page-teachings.active .study-passage-focus-source {
  padding-top: 0.2rem;
  font-size: 0.72rem;
}

@media (max-width: 767px) {
  #page-teachings.active .study-passage-focus-card {
    padding-left: 0.8rem;
  }

  #page-teachings.active .study-choose-verse {
    width: auto;
    margin-left: auto;
  }

  #page-teachings.active .study-passage-focus-action,
  #page-teachings.active .study-chapter-preview-actions .study-passage-focus-action {
    width: auto;
  }

  #page-teachings.active .study-evidence-summary {
    gap: 0.5rem;
  }

  #page-teachings.active .study-evidence-summary-meta {
    max-width: 48%;
  }
}

/* Study V1-A: keep Scripture visible while the supporting evidence remains discoverable. */
#page-teachings.active .study-experience,
#page-teachings.active .study-experience-grid,
#page-teachings.active .study-experience-main,
#page-teachings.active .study-current-stage,
#page-teachings.active .study-current-stack,
#page-teachings.active .study-evidence-group,
#page-teachings.active .study-setting-resource {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#page-teachings.active .study-passage-reference-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.25rem;
  margin: 0 -0.15rem 0.8rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--parchment-3) 82%, transparent);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--parchment) 94%, transparent);
  color: var(--ink-2);
  box-shadow: 0 5px 18px rgba(15, 13, 10, 0.06);
  backdrop-filter: blur(12px);
}

#page-teachings.active .study-passage-reference-label {
  font: 700 0.82rem/1.2 var(--sans);
  color: var(--ink);
}

#page-teachings.active .study-passage-reference-version,
#page-teachings.active .study-passage-reference-mode {
  color: var(--ink-3);
  font: 600 0.7rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.active .study-passage-reference-mode {
  margin-left: auto;
}

#page-teachings.active .study-passage-focus-card {
  gap: 0.85rem;
  margin-bottom: 1rem;
  padding: clamp(1rem, 2vw, 1.5rem);
  border-color: color-mix(in srgb, var(--color-accent) 28%, var(--parchment-3));
  border-left: 4px solid var(--color-accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--parchment) 96%, var(--color-accent) 4%), var(--parchment));
}

#page-teachings.active .study-passage-focus-eyebrow,
#page-teachings.active .study-passage-focus-reference-row,
#page-teachings.active .study-passage-focus-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#page-teachings.active .study-passage-focus-kicker {
  color: var(--color-accent);
  font: 700 0.72rem/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#page-teachings.active .study-passage-focus-badge {
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent) 11%, var(--parchment));
  color: var(--ink-2);
  font: 700 0.68rem/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#page-teachings.active .study-passage-focus-reference {
  margin: 0;
  color: var(--ink);
  font: 700 clamp(1.15rem, 2.1vw, 1.55rem)/1.2 var(--sans);
}

#page-teachings.active .study-passage-focus-version {
  color: var(--ink-3);
  font: 700 0.75rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.active .study-choose-verse {
  margin-left: auto;
  min-height: 2.35rem;
  white-space: nowrap;
}

#page-teachings.active .study-chapter-preview {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

#page-teachings.active .study-chapter-preview-label,
#page-teachings.active .study-chapter-preview-context {
  margin: 0;
  color: var(--ink-3);
  font: 0.78rem/1.4 var(--sans);
}

#page-teachings.active .study-chapter-preview-label {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#page-teachings.active .study-chapter-preview-list {
  display: grid;
  gap: 0.12rem;
  max-width: 58rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-chapter-preview-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  min-width: 0;
  padding: 0.35rem 0;
  color: var(--ink);
  font: 1.02rem/1.65 var(--serif);
}

#page-teachings.active .study-chapter-preview-verse {
  width: 2.15rem;
  min-height: 2.15rem;
  padding: 0.25rem 0.2rem;
  border: 1px solid color-mix(in srgb, var(--color-accent) 34%, var(--parchment-3));
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--color-accent) 7%, var(--parchment));
  color: var(--color-link);
  font: 700 0.76rem/1 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-chapter-preview-verse:hover,
#page-teachings.active .study-chapter-preview-verse:focus-visible {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 14%, var(--parchment));
}

#page-teachings.active .study-chapter-preview-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

#page-teachings.active .study-chapter-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

#page-teachings.active .study-chapter-preview-context {
  padding-top: 0.2rem;
}

#page-teachings.active .study-passage-focus-verse-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.45rem;
  margin-right: 0.25rem;
  color: var(--color-accent);
  font: 700 0.76rem/1 var(--sans);
  vertical-align: 0.12em;
}

#page-teachings.active .study-verse-picker {
  display: grid;
  gap: 0.8rem;
  max-width: 34rem;
  padding: 0.9rem;
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, var(--parchment-3));
  border-radius: 0.75rem;
  background: color-mix(in srgb, var(--parchment) 96%, var(--color-accent) 4%);
  box-shadow: 0 8px 24px rgba(15, 13, 10, 0.08);
}

#page-teachings.active .study-verse-picker-head,
#page-teachings.active .study-verse-jump-form,
#page-teachings.active .study-verse-stepper {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

#page-teachings.active .study-verse-picker-head {
  justify-content: space-between;
}

#page-teachings.active .study-verse-picker-kicker {
  margin: 0 0 0.2rem;
  color: var(--color-accent);
  font: 700 0.7rem/1 var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#page-teachings.active .study-verse-picker-head strong {
  color: var(--ink);
  font: 700 0.95rem/1.2 var(--sans);
}

#page-teachings.active .study-verse-picker-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--ink-2);
  font-size: 1.35rem;
  cursor: pointer;
}

#page-teachings.active .study-verse-jump-form {
  flex-wrap: wrap;
}

#page-teachings.active .study-verse-jump-form label {
  color: var(--ink-2);
  font: 700 0.78rem/1.2 var(--sans);
}

#page-teachings.active .study-verse-jump-form input {
  width: 5rem;
  min-height: 2.45rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--parchment-3);
  border-radius: 0.45rem;
  background: var(--parchment);
  color: var(--ink);
  font: 0.9rem/1 var(--sans);
}

#page-teachings.active .study-verse-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(2.25rem, 1fr));
  gap: 0.4rem;
  max-height: 15rem;
  overflow-y: auto;
  padding: 0.15rem;
}

#page-teachings.active .study-verse-picker-number {
  min-height: 2.45rem;
  padding: 0.3rem;
  border: 1px solid var(--parchment-3);
  border-radius: 0.45rem;
  background: var(--parchment);
  color: var(--ink-2);
  font: 700 0.82rem/1 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-verse-picker-number:hover,
#page-teachings.active .study-verse-picker-number:focus-visible,
#page-teachings.active .study-verse-picker-number.is-selected {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 13%, var(--parchment));
  color: var(--ink);
}

#page-teachings.active .study-verse-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: none;
  padding: 0.45rem 0 0.55rem;
  border-top: 1px solid var(--parchment-3);
  border-bottom: 1px solid var(--parchment-3);
}

#page-teachings.active .study-verse-stepper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 8rem;
  min-height: 2.5rem;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--parchment-3);
  border-radius: 0.5rem;
  background: var(--parchment);
  color: var(--color-link);
  font: 700 0.78rem/1.2 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-verse-stepper-button:first-child {
  justify-self: start;
}

#page-teachings.active .study-verse-stepper-button:last-child {
  justify-self: end;
}

#page-teachings.active .study-verse-stepper-button:disabled {
  color: var(--ink-4);
  cursor: not-allowed;
  opacity: 0.62;
}

#page-teachings.active .study-verse-stepper-current {
  justify-self: center;
  min-width: 5.5rem;
  text-align: center;
  color: var(--ink-3);
  font: 700 0.76rem/1.2 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#page-teachings.active .study-passage-focus-text {
  max-width: 52rem;
  margin: 0;
  color: var(--ink);
  font: 1.15rem/1.65 var(--serif);
}

#page-teachings.active .study-passage-focus-context,
#page-teachings.active .study-passage-focus-source {
  color: var(--ink-3);
  font: 0.78rem/1.4 var(--sans);
}

#page-teachings.active .study-passage-focus-source {
  margin: 0;
  overflow-wrap: anywhere;
}

#page-teachings.active .study-passage-focus-actions .study-passage-focus-context {
  flex: 1 1 100%;
}

#page-teachings.active .study-passage-focus-action {
  min-height: 2.65rem;
}

#page-teachings.active .study-passage-focus-action.is-secondary {
  background: transparent;
  color: var(--ink-2);
}

#page-teachings.active .study-passage-focus-skeleton {
  display: grid;
  gap: 0.45rem;
}

#page-teachings.active .study-passage-focus-skeleton span,
#page-teachings.active .study-evidence-loading span {
  display: block;
  height: 0.85rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--parchment-3) 70%, transparent);
}

#page-teachings.active .study-passage-focus-skeleton span:nth-child(1) { width: 92%; }
#page-teachings.active .study-passage-focus-skeleton span:nth-child(2) { width: 76%; }
#page-teachings.active .study-passage-focus-skeleton span:nth-child(3) { width: 48%; }

#page-teachings.active .study-evidence-stack {
  gap: 0.7rem;
}

#page-teachings.active .study-evidence-group {
  overflow: clip;
  border: 1px solid var(--parchment-3);
  border-radius: 0.9rem;
  background: var(--parchment);
}

#page-teachings.active .study-evidence-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.4rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  list-style: none;
}

#page-teachings.active .study-evidence-summary::-webkit-details-marker { display: none; }
#page-teachings.active .study-evidence-summary-title,
#page-teachings.active .study-evidence-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

#page-teachings.active .study-evidence-summary-title {
  color: var(--ink);
  font: 700 0.98rem/1.25 var(--sans);
}

#page-teachings.active .study-evidence-summary-title svg {
  width: 1rem;
  height: 1rem;
  color: var(--color-accent);
}

#page-teachings.active .study-evidence-summary-meta {
  color: var(--ink-3);
  font: 600 0.73rem/1.2 var(--sans);
  text-align: right;
}

#page-teachings.active .study-evidence-summary-chevron {
  display: inline-block;
  font-size: 1.1rem;
  transition: transform 160ms ease;
}

#page-teachings.active .study-evidence-group[open] .study-evidence-summary {
  border-bottom: 1px solid var(--parchment-3);
}

#page-teachings.active .study-evidence-group[open] .study-evidence-summary-chevron {
  transform: rotate(180deg);
}

#page-teachings.active .study-evidence-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

#page-teachings.active .study-setting-resource {
  display: grid;
  gap: 0.7rem;
}

#page-teachings.active .study-setting-resource .study-card-head {
  padding: 0;
}

#page-teachings.active .study-setting-additional {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--parchment-3);
}

#page-teachings.active .study-setting-resource + .study-setting-resource {
  padding-top: 0.9rem;
  border-top: 1px solid var(--parchment-3);
}

#page-teachings.active .study-setting-entry-list {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-setting-entry {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 65%, transparent);
}

#page-teachings.active .study-setting-entry:last-child {
  border-bottom: 0;
}

#page-teachings.active .study-setting-entry strong {
  color: var(--ink);
  font: 700 0.92rem/1.35 var(--sans);
  overflow-wrap: anywhere;
}

#page-teachings.active .study-setting-person-link {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-link);
  text-align: left;
  cursor: pointer;
}

#page-teachings.active .study-setting-person-link:hover,
#page-teachings.active .study-setting-person-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

#page-teachings.active .study-setting-scope,
#page-teachings.active .study-setting-meta {
  color: var(--ink-3);
  font: 0.77rem/1.4 var(--sans);
  overflow-wrap: anywhere;
}

#page-teachings.active .study-setting-meta {
  color: var(--ink-4);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#page-teachings.active .study-setting-scope-group + .study-setting-scope-group {
  margin-top: 0.7rem;
}

#page-teachings.active .study-setting-scope-heading {
  margin: 0 0 0.2rem;
  color: var(--ink-2);
  font: 700 0.7rem/1.3 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#page-teachings.active .study-setting-more {
  margin-top: 0.45rem;
}

#page-teachings.active .study-setting-more summary {
  min-height: 2.5rem;
  padding: 0.55rem 0;
  color: var(--color-link);
  font: 700 0.8rem/1.3 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-setting-more summary span {
  color: var(--ink-3);
  font-weight: 600;
}

#page-teachings.active .study-place-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-place-entry {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.7rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 70%, transparent);
}

#page-teachings.active .study-place-entry:first-child {
  padding-top: 0.15rem;
}

#page-teachings.active .study-place-entry:last-child {
  padding-bottom: 0.15rem;
  border-bottom: 0;
}

#page-teachings.active .study-place-name {
  color: var(--ink);
  font: 700 0.92rem/1.35 var(--sans);
}

#page-teachings.active .study-place-meta,
#page-teachings.active .study-place-supplement {
  min-width: 0;
  overflow-wrap: anywhere;
  font: 0.78rem/1.45 var(--sans);
}

#page-teachings.active .study-place-meta {
  color: var(--ink-2);
}

#page-teachings.active .study-place-supplement {
  color: var(--ink-3);
}

#page-teachings.active .study-place-disclosure {
  min-width: 0;
}

#page-teachings.active .study-place-summary {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0 1.35rem 0 0;
  position: relative;
  cursor: pointer;
  list-style: none;
}

#page-teachings.active .study-place-summary::-webkit-details-marker {
  display: none;
}

#page-teachings.active .study-place-summary::after {
  position: absolute;
  right: 0;
  color: var(--ink-3);
  content: '›';
  font: 700 1rem/1 var(--sans);
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

#page-teachings.active .study-place-disclosure[open] .study-place-summary::after {
  transform: rotate(90deg);
}

#page-teachings.active .study-place-summary:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 0.2rem;
}

#page-teachings.active .study-place-detail {
  min-width: 0;
  margin: 0.65rem 0 0.1rem;
  padding: 0.65rem 0 0.1rem 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 65%, transparent);
  border-inline-start: 2px solid color-mix(in srgb, var(--color-link) 45%, transparent);
  overflow-wrap: anywhere;
}

#page-teachings.active .study-place-detail-list {
  display: grid;
  gap: 0.42rem;
  margin: 0;
}

#page-teachings.active .study-place-detail-row {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
  gap: 0.45rem;
  min-width: 0;
  font: 0.76rem/1.45 var(--sans);
}

#page-teachings.active .study-place-detail-row dt {
  color: var(--ink-3);
  font-weight: 700;
}

#page-teachings.active .study-place-detail-row dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-2);
}

#page-teachings.active .study-place-candidate-list {
  display: grid;
  gap: 0.18rem;
  margin: 0;
  padding: 0 0 0 1rem;
}

#page-teachings.active .study-place-detail-note {
  display: block;
  margin-top: 0.25rem;
  color: var(--ink-3);
  font-size: 0.72rem;
}

#page-teachings.active .study-place-source-links {
  margin: 0.55rem 0 0;
  font: 600 0.75rem/1.4 var(--sans);
}

#page-teachings.active .study-place-source-links a {
  color: var(--color-link);
}

@media (max-width: 520px) {
  #page-teachings.active .study-place-detail-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

#page-teachings.active .study-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

#page-teachings.active .study-inline-action {
  min-height: 2.5rem;
}

#page-teachings.active .study-related-passage-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-related-passage-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.3rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 65%, transparent);
}

#page-teachings.active .study-related-passage-link,
#page-teachings.active .study-related-passage-label {
  min-height: 2.55rem;
  padding: 0.45rem 0;
  color: var(--color-link);
  font: 700 0.9rem/1.4 var(--sans);
  text-align: left;
  overflow-wrap: anywhere;
}

#page-teachings.active .study-related-passage-link {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-related-passage-type {
  flex: 0 0 auto;
  color: var(--ink-3);
  font: 600 0.68rem/1 var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#page-teachings.active .study-source-note {
  margin-top: 0.35rem;
  color: var(--ink-3);
  font: 0.76rem/1.5 var(--sans);
}

#page-teachings.active .study-source-note summary {
  min-height: 2.5rem;
  padding: 0.55rem 0;
  color: var(--ink-2);
  font-weight: 700;
  cursor: pointer;
}

#page-teachings.active .study-source-note p {
  max-width: 48rem;
  margin: 0 0 0.35rem;
}

#page-teachings.active .study-related-more {
  margin-top: 0.35rem;
}

#page-teachings.active .study-related-more summary {
  min-height: 2.5rem;
  padding: 0.55rem 0;
  color: var(--color-link);
  font: 700 0.8rem/1.3 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-related-more summary span {
  color: var(--ink-3);
  font-weight: 600;
}

#page-teachings.active .study-compact-empty,
#page-teachings.active .study-section-error {
  margin: 0;
  color: var(--ink-3);
  font: 0.86rem/1.55 var(--sans);
}

#page-teachings.active .study-section-error {
  padding: 0.7rem 0.8rem;
  border-radius: 0.6rem;
  background: color-mix(in srgb, var(--color-warning) 9%, var(--parchment));
  color: var(--ink-2);
}

#page-teachings.active .study-context-error-card {
  padding: 0.9rem;
}

@media (max-width: 767px) {
  #page-teachings.active .study-page-header {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    box-sizing: border-box;
  }

  #page-teachings.active .reader-toolbar-main {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  #page-teachings.active .study-experience {
    overflow-x: clip;
    width: 100%;
  }

  #page-teachings.active .study-passage-reference-bar {
    top: 0;
    margin-inline: 0;
    border-radius: 0.6rem;
  }

  #page-teachings.active .study-passage-focus-card {
    padding: 1rem;
  }

  #page-teachings.active .study-passage-focus-actions {
    align-items: stretch;
  }

  #page-teachings.active .study-passage-focus-reference-row {
    align-items: flex-start;
  }

  #page-teachings.active .study-choose-verse {
    width: 100%;
    margin-left: 0;
  }

  #page-teachings.active .study-passage-focus-action {
    width: 100%;
  }

  #page-teachings.active .study-chapter-preview-actions .study-passage-focus-action {
    width: 100%;
  }

  #page-teachings.active .study-verse-picker {
    max-width: 100%;
  }

  #page-teachings.active .study-verse-picker-grid {
    grid-template-columns: repeat(4, minmax(2.5rem, 1fr));
    max-height: 18rem;
  }

  #page-teachings.active .study-verse-stepper-button span {
    display: none;
  }

  #page-teachings.active .study-evidence-summary {
    min-height: 3.5rem;
    padding-inline: 0.85rem;
  }

  #page-teachings.active .study-evidence-summary-meta {
    max-width: 42%;
  }

  #page-teachings.active .study-evidence-body {
    padding: 0.85rem;
  }

  #page-teachings.active .study-navigation-mobile-callup {
    bottom: 0;
    padding: 0.2rem 0.75rem 0.1rem;
  }

  #page-teachings.active .study-navigation-fab {
    min-height: 44px;
  }
}

/* Constrained Study surfaces keep the Scripture column primary while the
   existing Selected Reference/navigation sheet remains available at the
   bottom through tablet portrait and narrow desktop widths. */
@media (max-width: 1023px) {
  #page-teachings.active .study-experience {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  #page-teachings.active .study-navigation-mobile-callup {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    padding: 0 0.75rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    z-index: 348;
    pointer-events: none;
  }

  #page-teachings.active .study-navigation-fab {
    display: inline-flex;
    width: min(100%, 20rem);
    pointer-events: auto;
  }
}

/* Final cascade for Study flattening: keep the existing design language, but
   let evidence flow as editorial content instead of nested dashboard cards. */
#page-teachings.active .study-passage-focus-card {
  gap: 0.75rem;
  padding: 0.25rem 0 1.35rem 1rem;
  border: 0;
  border-left: 3px solid var(--color-accent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-teachings.active .study-passage-focus-eyebrow,
#page-teachings.active .study-passage-focus-kicker,
#page-teachings.active .study-passage-focus-badge,
#page-teachings.active .study-chapter-preview-label {
  display: none;
}

#page-teachings.active .study-passage-focus-reference-row {
  align-items: baseline;
}

#page-teachings.active .study-choose-verse,
#page-teachings.active .study-passage-focus-action,
#page-teachings.active .study-inline-action {
  min-height: 2.35rem;
  padding: 0.35rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  color: var(--color-link) !important;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-chapter-preview-row {
  grid-template-columns: 1.7rem minmax(0, 1fr);
  gap: 0.55rem;
  padding: 0.45rem 0;
}

#page-teachings.active .study-chapter-preview-verse {
  width: 1.7rem;
  min-height: 2.35rem;
  padding: 0.35rem 0;
  border: 0;
  border-radius: 0.2rem;
  background: transparent;
}

#page-teachings.active .study-evidence-group {
  overflow: visible;
  border: 0;
  border-top: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-teachings.active .study-evidence-group:last-child {
  border-bottom: 1px solid var(--parchment-3);
}

#page-teachings.active .study-evidence-summary {
  min-height: 3.1rem;
  padding: 0.8rem 0;
  background: transparent;
}

#page-teachings.active .study-evidence-summary-title {
  gap: 0;
}

#page-teachings.active .study-evidence-summary-title svg,
#page-teachings.active .study-evidence-summary-title .study-card-icon,
#page-teachings.active .study-evidence-body .study-card-head svg {
  display: none;
}

#page-teachings.active .study-evidence-body {
  gap: 0.8rem;
  padding: 0.2rem 0 1.25rem;
  background: transparent;
}

#page-teachings.active .study-setting-resource,
#page-teachings.active .study-setting-resource + .study-setting-resource {
  padding-top: 0;
  border-top: 0;
}

#page-teachings.active .study-setting-resource + .study-setting-resource {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
}

#page-teachings.active .study-setting-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 58%, transparent);
}

#page-teachings.active .study-setting-entry:last-child {
  border-bottom: 0;
}

#page-teachings.active .study-setting-evidence {
  display: -webkit-box;
  max-width: 52ch;
  max-height: calc(1.45em * 2);
  overflow: hidden;
  color: var(--ink-2);
  font: 0.78rem/1.45 var(--sans);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#page-teachings.active .study-setting-event-context {
  color: var(--ink-2);
  font: 0.76rem/1.4 var(--sans);
  overflow-wrap: anywhere;
}

#page-teachings.active .study-setting-event-context-label {
  color: var(--ink-3);
  font-weight: 700;
}

#page-teachings.active .study-event-disclosure {
  min-width: 0;
}

#page-teachings.active .study-event-summary {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0 1.35rem 0 0;
  position: relative;
  cursor: pointer;
  list-style: none;
}

#page-teachings.active .study-event-summary::-webkit-details-marker {
  display: none;
}

#page-teachings.active .study-event-summary::after {
  position: absolute;
  top: 0.05rem;
  right: 0;
  color: var(--ink-3);
  content: '›';
  font: 700 1rem/1 var(--sans);
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

#page-teachings.active .study-event-disclosure[open] .study-event-summary::after {
  transform: rotate(90deg);
}

#page-teachings.active .study-event-summary:focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 0.2rem;
}

#page-teachings.active .study-event-detail {
  min-width: 0;
  margin: 0.65rem 0 0.1rem;
  padding: 0.65rem 0 0.1rem 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 65%, transparent);
  border-inline-start: 2px solid color-mix(in srgb, var(--color-link) 45%, transparent);
  overflow-wrap: anywhere;
}

#page-teachings.active .study-event-detail-list {
  display: grid;
  gap: 0.42rem;
  margin: 0;
}

#page-teachings.active .study-event-detail-row {
  display: grid;
  grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr);
  gap: 0.45rem;
  min-width: 0;
  font: 0.76rem/1.45 var(--sans);
}

#page-teachings.active .study-event-detail-row dt {
  color: var(--ink-3);
  font-weight: 700;
}

#page-teachings.active .study-event-detail-row dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-2);
}

#page-teachings.active .study-event-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-event-reference {
  min-height: 2rem;
  padding: 0.25rem 0;
  border: 0;
  background: transparent;
  color: var(--color-link);
  font: 600 0.76rem/1.35 var(--sans);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.16em;
  cursor: pointer;
}

#page-teachings.active .study-event-reference:hover,
#page-teachings.active .study-event-reference:focus-visible {
  color: var(--color-link-hover);
}

#page-teachings.active .study-event-detail-note {
  display: block;
  margin-top: 0.18rem;
  color: var(--ink-3);
  font-size: 0.7rem;
}

#page-teachings.active .study-outline-list {
  gap: 0.9rem;
}

#page-teachings.active .study-related-passage-list li {
  padding: 0.15rem 0;
}

/* Keep chapter-preview utilities together so Scripture remains the visual
   focus instead of leaving a loose stack of unrelated controls. */
#page-teachings.active .study-chapter-preview-context {
  margin: 0;
  padding-top: 0.2rem;
  color: var(--ink-3);
  font: 0.78rem/1.4 var(--sans);
}

#page-teachings.active .study-chapter-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  padding-top: 0.65rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 72%, transparent);
}

#page-teachings.active .study-chapter-preview-actions .study-passage-focus-action {
  width: auto;
  min-height: 2.25rem;
  padding: 0.3rem 0;
}

@media (max-width: 767px) {
  #page-teachings.active .study-passage-focus-card {
    padding-left: 0.8rem;
  }

  #page-teachings.active .study-choose-verse,
  #page-teachings.active .study-passage-focus-action,
  #page-teachings.active .study-chapter-preview-actions .study-passage-focus-action {
    width: auto;
  }

  #page-teachings.active .study-event-detail-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  #page-teachings.active .study-evidence-summary {
    gap: 0.5rem;
  }

  #page-teachings.active .study-evidence-summary-meta {
    max-width: 48%;
  }
}

/* Study's reader toolbar needs the existing mobile navigation treatment at
   tablet widths too; the full desktop link row is wider than 768px. */
@media (min-width: 768px) and (max-width: 1023px) {
  html:has(#page-teachings.active) .nav-inner {
    min-width: 0;
    padding-inline: 1rem;
  }

  html:has(#page-teachings.active) .nav-brand {
    margin-right: 0;
  }

  html:has(#page-teachings.active) .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  html:has(#page-teachings.active) .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    margin-left: 0;
    gap: 0;
    background-color: var(--parchment-2);
    flex-direction: column;
    z-index: 120;
  }

  html:has(#page-teachings.active) .nav-links.open {
    display: flex;
  }

  html:has(#page-teachings.active) .nav-link {
    height: auto;
    padding: 0.8rem 2rem;
  }

  html:has(#page-teachings.active) .theme-switch {
    width: auto;
    margin: 0.55rem 1rem 0.7rem;
    align-self: flex-end;
    justify-content: flex-end;
  }
}

/* Restored from the latest dark Apologetics UI fix: the compact answer action
   must keep a readable brand fill after the dark token aliases are applied. */
html[data-theme="dark"] #page-apologetics.active .apologetics-answer-link:not(.apologetics-answer-link--nav):not(.apologetics-answer-link--primary),
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-answer-link:not(.apologetics-answer-link--nav):not(.apologetics-answer-link--primary) {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-surface-inverse);
}

html[data-theme="dark"] #page-apologetics.active .apologetics-answer-link:not(.apologetics-answer-link--nav):not(.apologetics-answer-link--primary):hover,
html[data-theme-preview="dark"] #page-apologetics.active .apologetics-answer-link:not(.apologetics-answer-link--nav):not(.apologetics-answer-link--primary):hover {
  background: var(--color-brand-hover);
  border-color: var(--color-brand-hover);
  color: var(--color-surface-inverse);
}

/* The question reader is mounted beside the page container, so page-scoped
   dark-mode rules cannot reach its detail cards. */
html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.42);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal-body {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal :is(
  .apologetics-answer-short-card,
  .apologetics-related-link,
  .apologetics-answer-link--nav
) {
  background: var(--color-surface-muted);
  background-image: none;
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: 0 12px 28px var(--color-shadow);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal .apologetics-answer-short-card {
  border-left-color: var(--color-brand);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal :is(
  .apologetics-answer-short,
  .apologetics-answer-short-label,
  .apologetics-answer-link-label,
  .apologetics-related-link-copy
) {
  color: var(--color-text-heading);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal :is(
  .apologetics-answer-link-subtitle,
  .apologetics-related-link-arrow
) {
  color: var(--color-text-secondary);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal .apologetics-answer-link--nav:hover {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-text-heading);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal .apologetics-answer-link--nav[disabled],
html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal .apologetics-answer-link--nav[disabled]:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-border);
  color: var(--color-text-muted);
  opacity: 0.58;
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal .apologetics-answer-link--primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-brand) 76%, var(--color-surface-inverse) 24%), var(--color-brand));
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--color-brand) 76%, var(--color-surface-inverse) 24%), var(--color-brand));
  border-color: var(--color-brand);
  color: var(--color-surface-inverse);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) .apologetics-modal .apologetics-answer-link--primary:hover {
  background: var(--color-brand-hover);
  background-image: none;
  border-color: var(--color-brand-hover);
  color: var(--color-surface-inverse);
}

/* Restore the latest dark-theme contrast fix for the Bible mode selector too. */
html[data-theme="dark"] #page-teachings.active .reader-mode-option.is-active,
html[data-theme-preview="dark"] #page-teachings.active .reader-mode-option.is-active {
  background: var(--color-brand);
  color: var(--color-surface-inverse);
  box-shadow: 0 4px 14px var(--color-shadow);
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active .reader-mode-option.is-active {
  background: var(--color-brand);
  color: var(--color-surface-inverse);
}

html[data-theme="dark"] #page-teachings.active .reader-mode-option.is-active:hover,
html[data-theme-preview="dark"] #page-teachings.active .reader-mode-option.is-active:hover,
html[data-theme="dark"] #page-teachings.active .reader-mode-option.is-active:focus-visible,
html[data-theme-preview="dark"] #page-teachings.active .reader-mode-option.is-active:focus-visible {
  background: var(--color-brand-hover);
  color: var(--color-surface-inverse);
}

@media (prefers-reduced-motion: reduce) {
  html[data-theme="light"] #page-teachings.active :is(.teach-sidebar, .study-page-header, .teachings-layout),
  html[data-theme="dark"] #page-teachings.active :is(.teach-sidebar, .study-page-header, .teachings-layout) {
    transition: none;
  }
}

/* Group 2B-1 — production base Scripture presentation only.
   This block intentionally excludes current, selected, search-match,
   highlight, focus, hover, commentary, cross-reference, and Interlinear
   state styling. Those remain in their later group boundaries. */
html[data-theme="light"] #page-teachings.active .chapter-reader,
html[data-theme="dark"] #page-teachings.active .chapter-reader {
  color: var(--color-scripture-text);
}

html[data-theme="light"] #page-teachings.active :is(.reader-verse, .reader-verse-num),
html[data-theme="dark"] #page-teachings.active :is(.reader-verse, .reader-verse-num) {
  color: var(--color-scripture-text);
}

html[data-theme="light"] #page-teachings.active .reader-verse-num,
html[data-theme="dark"] #page-teachings.active .reader-verse-num {
  color: var(--color-scripture-number);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

html[data-theme="light"] #page-teachings.active .chapter-reader :is(.scripture-heading, .scripture-section-heading, .scripture-superscription),
html[data-theme="dark"] #page-teachings.active .chapter-reader :is(.scripture-heading, .scripture-section-heading, .scripture-superscription) {
  color: var(--color-scripture-heading);
}

html[data-theme="light"] #page-teachings.active .chapter-reader :is(.scripture-footnote, .footnote-marker, a:not([id])),
html[data-theme="dark"] #page-teachings.active .chapter-reader :is(.scripture-footnote, .footnote-marker, a:not([id])) {
  color: var(--color-scripture-footnote);
}

html[data-theme="light"] #page-teachings.active .reader-verse,
html[data-theme="dark"] #page-teachings.active .reader-verse {
  overflow-wrap: break-word;
}

html[data-theme="light"] #page-teachings.active .chapter-reader ::selection,
html[data-theme="dark"] #page-teachings.active .chapter-reader ::selection {
  background: var(--color-scripture-selection);
  color: var(--color-scripture-selection-text);
}

/* Study Guides library dark treatment. This promotes the public library
   surface only; authoring and deep guide-editorial routes remain contained
   until they receive their own review. */
html[data-theme="dark"] #page-guides.active,
html[data-theme-preview="dark"] #page-guides.active {
  color-scheme: dark;
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-link: #A6C8AD;
  --color-focus: #E4BD5C;
  --color-shadow: rgba(0, 0, 0, 0.34);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --rule: var(--color-border);
  --sienna: var(--color-brand);
  --sienna-lt: var(--color-brand-hover);
  background: var(--color-page);
  color: var(--color-text);
}

/* Higher-specificity route boundary override: the Study Guides library is
   now an approved dark-enabled surface, so it must not inherit the generic
   light-only route containment above. */
html[data-theme="dark"] body > #page-guides.page.active,
html[data-theme-preview="dark"] body > #page-guides.page.active {
  background: #24231F !important;
  color-scheme: dark;
  color: var(--color-text);
}

html[data-theme="dark"] body > #page-guides.page.active :is(.page-header, .guides-layout),
html[data-theme-preview="dark"] body > #page-guides.page.active :is(.page-header, .guides-layout) {
  background: transparent !important;
  color: var(--color-text);
}

html[data-theme="dark"] body > #page-guides.page.active .guides-toolbar,
html[data-theme-preview="dark"] body > #page-guides.page.active .guides-toolbar {
  background: #2D2B26 !important;
}

html[data-theme="dark"] body > #page-guides.page.active .study-guide-card,
html[data-theme-preview="dark"] body > #page-guides.page.active .study-guide-card {
  background: #35322B !important;
}

html[data-theme="dark"] body > #page-guides.page.active :is(.page-title, .study-guide-title),
html[data-theme-preview="dark"] body > #page-guides.page.active :is(.page-title, .study-guide-title) {
  color: #F5EEE3 !important;
}

html[data-theme="dark"] body > #page-guides.page.active .page-desc,
html[data-theme-preview="dark"] body > #page-guides.page.active .page-desc,
html[data-theme="dark"] body > #page-guides.page.active .study-guide-desc,
html[data-theme-preview="dark"] body > #page-guides.page.active .study-guide-desc {
  color: #C9C0B3 !important;
}

html[data-theme="dark"] body > #page-guides.page.active .study-guide-meta,
html[data-theme-preview="dark"] body > #page-guides.page.active .study-guide-meta {
  color: #A79E92 !important;
}

html[data-theme="dark"] body > #page-guides.page.active .study-guide-media-fallback,
html[data-theme-preview="dark"] body > #page-guides.page.active .study-guide-media-fallback {
  background: #3D3931 !important;
  color: #F5EEE3 !important;
}

html[data-theme="dark"] body > #page-guides.page.active :is(.page-title, .page-desc, .page-eyebrow),
html[data-theme-preview="dark"] body > #page-guides.page.active :is(.page-title, .page-desc, .page-eyebrow) {
  color: var(--color-text-heading);
}

html[data-theme="dark"] body > #page-guides.page.active .page-desc,
html[data-theme-preview="dark"] body > #page-guides.page.active .page-desc {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-guides.active :is(.guides-intro, .guides-library-head),
html[data-theme-preview="dark"] #page-guides.active :is(.guides-intro, .guides-library-head) {
  border-color: var(--color-border);
}

html[data-theme="dark"] #page-guides.active .guides-intro-text,
html[data-theme-preview="dark"] #page-guides.active .guides-intro-text {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-guides.active .guides-toolbar,
html[data-theme-preview="dark"] #page-guides.active .guides-toolbar {
  background: var(--color-surface);
  border-color: var(--color-border);
  box-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme="dark"] #page-guides.active :is(.guides-toolbar-label, .guides-toolbar-note, .guides-col-label),
html[data-theme-preview="dark"] #page-guides.active :is(.guides-toolbar-label, .guides-toolbar-note, .guides-col-label) {
  color: var(--color-text-muted);
}

html[data-theme="dark"] #page-guides.active :is(.guides-search-input, .guides-select-input),
html[data-theme-preview="dark"] #page-guides.active :is(.guides-search-input, .guides-select-input) {
  background: var(--color-surface-raised);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

html[data-theme="dark"] #page-guides.active :is(.guides-search-input, .guides-select-input)::placeholder,
html[data-theme-preview="dark"] #page-guides.active :is(.guides-search-input, .guides-select-input)::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}

html[data-theme="dark"] #page-guides.active :is(.guides-search-input, .guides-select-input):focus,
html[data-theme-preview="dark"] #page-guides.active :is(.guides-search-input, .guides-select-input):focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(127, 165, 138, 0.18);
}

html[data-theme="dark"] #page-guides.active .study-guide-card,
html[data-theme-preview="dark"] #page-guides.active .study-guide-card {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  box-shadow: 0 14px 34px var(--color-shadow);
}

html[data-theme="dark"] #page-guides.active .study-guide-card:hover,
html[data-theme-preview="dark"] #page-guides.active .study-guide-card:hover {
  background: var(--color-surface-muted);
  border-color: var(--color-brand);
}

html[data-theme="dark"] #page-guides.active :is(.study-guide-media, .study-guide-thumb, .legacy-study-guide-thumb),
html[data-theme-preview="dark"] #page-guides.active :is(.study-guide-media, .study-guide-thumb, .legacy-study-guide-thumb) {
  background: var(--color-surface);
  border-color: var(--color-border);
}

html[data-theme="dark"] #page-guides.active .study-guide-media-fallback,
html[data-theme-preview="dark"] #page-guides.active .study-guide-media-fallback {
  background: linear-gradient(150deg, var(--color-surface-muted), var(--color-surface));
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-guides.active .study-guide-meta,
html[data-theme-preview="dark"] #page-guides.active .study-guide-meta {
  color: var(--color-text-muted);
}

html[data-theme="dark"] #page-guides.active .study-guide-title,
html[data-theme-preview="dark"] #page-guides.active .study-guide-title {
  color: var(--color-text-heading);
}

html[data-theme="dark"] #page-guides.active .study-guide-desc,
html[data-theme-preview="dark"] #page-guides.active .study-guide-desc {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] #page-guides.active .guides-empty-state,
html[data-theme-preview="dark"] #page-guides.active .guides-empty-state {
  background: var(--color-surface-muted);
  border-color: var(--color-border-strong);
}

html[data-theme="dark"] #page-guides.active .guides-empty-title,
html[data-theme-preview="dark"] #page-guides.active .guides-empty-title {
  color: var(--color-text-heading);
}

html[data-theme="dark"] #page-guides.active .guides-empty-text,
html[data-theme-preview="dark"] #page-guides.active .guides-empty-text {
  color: var(--color-text-secondary);
}

/* Study Guides secondary reading pages. Keep authoring/admin light-only;
   series and chapter pages are public reading surfaces and share the same
   warm dark palette as the library above. */
html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active,
html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active {
  color-scheme: dark;
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-link: #A6C8AD;
  --color-focus: #E4BD5C;
  --color-shadow: rgba(0, 0, 0, 0.34);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --rule: var(--color-border);
  --sienna: var(--color-brand);
  --sienna-lt: var(--color-brand-hover);
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-series-layout, .guide-chapter-layout, .guide-series-header, .guide-chapter-header) {
  background: transparent;
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.page-title, .guide-series-copy, .guide-chapter-book-label, .guide-related-group-title,
      .guide-study-block h3, .guide-reflection-item h3, .guide-application-item h3,
      .guide-keyword-term, .guide-movement-title, .guide-chapter-nav-title) {
  color: var(--color-text-heading);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.page-title, .guide-series-copy, .guide-chapter-book-label, .guide-related-group-title,
      .guide-study-block h3, .guide-reflection-item h3, .guide-application-item h3,
      .guide-keyword-term, .guide-movement-title, .guide-chapter-nav-title) {
  color: var(--color-text-heading);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.page-desc, .guide-series-intro, .guide-sermon-body p, .guide-chapter-prose p,
      .guide-study-block p, .guide-reflection-item p, .guide-application-item p,
      .guide-study-list li, .guide-application-list li, .guide-movement-note,
      .guide-scripture-copy, .guide-discussion-questions li, .guide-chapter-nav-meta) {
  color: var(--color-text-secondary);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.page-desc, .guide-series-intro, .guide-sermon-body p, .guide-chapter-prose p,
      .guide-study-block p, .guide-reflection-item p, .guide-application-item p,
      .guide-study-list li, .guide-application-list li, .guide-movement-note,
      .guide-scripture-copy, .guide-discussion-questions li, .guide-chapter-nav-meta) {
  color: var(--color-text-secondary);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guides-col-label, .guide-chapter-scripture-range, .guide-breadcrumb,
      .guide-chapter-nav-label, .guide-keyword-meta, .guide-study-band-label,
      .guide-discussion-summary .guides-col-label) {
  color: var(--color-text-muted);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guides-col-label, .guide-chapter-scripture-range, .guide-breadcrumb,
      .guide-chapter-nav-label, .guide-keyword-meta, .guide-study-band-label,
      .guide-discussion-summary .guides-col-label) {
  color: var(--color-text-muted);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-series-banner, .guide-chapter-hero, .guide-copy-details, .guide-study-band,
      .guide-theme-item, .guide-scripture-band, .guide-related-link,
      .guide-chapter-nav-link, .guide-chapter-nav-empty, .guide-movement-step) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-series-banner, .guide-chapter-hero, .guide-copy-details, .guide-study-band,
      .guide-theme-item, .guide-scripture-band, .guide-related-link,
      .guide-chapter-nav-link, .guide-chapter-nav-empty, .guide-movement-step) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-series-banner-fallback, .guide-chapter-hero-fallback) {
  background: linear-gradient(150deg, var(--color-surface-muted), var(--color-surface));
  color: var(--color-text-heading);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-series-banner-fallback, .guide-chapter-hero-fallback) {
  background: linear-gradient(150deg, var(--color-surface-muted), var(--color-surface));
  color: var(--color-text-heading);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-copy-summary, .guide-related-link, .guide-chapter-nav-link) {
  color: var(--color-text-heading);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-copy-summary, .guide-related-link, .guide-chapter-nav-link) {
  color: var(--color-text-heading);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-copy-details, .guide-chapter-block, .guide-chapter-pagination) {
  border-color: var(--color-border);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-copy-details, .guide-chapter-block, .guide-chapter-pagination) {
  border-color: var(--color-border);
}

html[data-theme="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-copy-summary:focus-visible, .guide-breadcrumb-link:focus-visible,
      .guide-related-link:focus-visible, .guide-chapter-nav-link:focus-visible) {
  outline-color: var(--color-focus);
}

html[data-theme-preview="dark"] :is(#page-guide-series, #page-guide-chapter).active
  :is(.guide-copy-summary:focus-visible, .guide-breadcrumb-link:focus-visible,
      .guide-related-link:focus-visible, .guide-chapter-nav-link:focus-visible) {
  outline-color: var(--color-focus);
}

/* Override the legacy light-only containment with equal-or-higher
   specificity. Without this boundary, the global shell can be dark while
   the secondary guide content remains on the light palette. */
html[data-theme="dark"] body > :is(#page-guide-series, #page-guide-chapter).page.active,
html[data-theme-preview="dark"] body > :is(#page-guide-series, #page-guide-chapter).page.active {
  background: #24231F !important;
  color: #E9E2D7 !important;
  color-scheme: dark;
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-link: #A6C8AD;
  --color-focus: #E4BD5C;
  --color-shadow: rgba(0, 0, 0, 0.34);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --rule: var(--color-border);
  --sienna: var(--color-brand);
  --sienna-lt: var(--color-brand-hover);
}

/* Public editorial and policy routes. These routes previously remained
   inside the legacy light-only boundary; they now share the same warm dark
   palette as the themed shell and Study Guides reading surfaces. */
html[data-theme="dark"] body > :is(
  #page-about,
  #page-updates,
  #page-statement-of-faith,
  #page-interpretation,
  #page-editorial-standards,
  #page-languages,
  #page-credits,
  #page-attribution,
  #page-services,
  #page-contact,
  #page-privacy,
  #page-terms
).page.active,
html[data-theme-preview="dark"] body > :is(
  #page-about,
  #page-updates,
  #page-statement-of-faith,
  #page-interpretation,
  #page-editorial-standards,
  #page-languages,
  #page-credits,
  #page-attribution,
  #page-services,
  #page-contact,
  #page-privacy,
  #page-terms
).page.active {
  background: #24231F !important;
  color: #E9E2D7 !important;
  color-scheme: dark;
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-surface-muted: #3D3931;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-brand: #7FA58A;
  --color-brand-hover: #A6C8AD;
  --color-link: #A6C8AD;
  --color-focus: #E4BD5C;
  --color-shadow: rgba(0, 0, 0, 0.34);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --rule: var(--color-border);
  --sienna: var(--color-brand);
  --sienna-lt: var(--color-brand-hover);
  --cream: var(--color-page);
  --cream-2: var(--color-surface);
  --cream-3: var(--color-surface-muted);
}

/* Wider Book Context: keep book orientation compact by default, with the
   source structure available through native disclosure. */
#page-teachings.active .study-book-context {
  display: grid;
  min-width: 0;
  gap: 1rem;
}

#page-teachings.active .study-book-context-orientation {
  display: grid;
  gap: 0.45rem;
  padding-left: 0.9rem;
  border-left: 3px solid var(--color-accent);
}

#page-teachings.active .study-book-context-kicker,
#page-teachings.active .study-book-context-source {
  margin: 0;
  color: var(--ink-3);
  font: 0.72rem/1.45 var(--sans);
  letter-spacing: 0.04em;
}

#page-teachings.active .study-book-context-kicker {
  color: var(--color-accent);
  font-weight: 700;
  text-transform: uppercase;
}

#page-teachings.active .study-book-context-orientation h4,
#page-teachings.active .study-book-context-nearby h5 {
  margin: 0;
  color: var(--ink);
  font: 700 0.95rem/1.35 var(--sans);
}

#page-teachings.active .study-book-context-note {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-2);
  font: 0.9rem/1.6 var(--sans);
}

#page-teachings.active .study-book-context-current-list,
#page-teachings.active .study-book-outline-list {
  display: grid;
  min-width: 0;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#page-teachings.active .study-book-outline-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.7rem;
  min-width: 0;
  padding: 0.65rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 62%, transparent);
}

#page-teachings.active .study-book-outline-entry.is-current {
  padding-left: 0.75rem;
  border-left: 2px solid var(--color-brand);
  background: color-mix(in srgb, var(--color-brand) 7%, transparent);
}

#page-teachings.active .study-book-outline-entry-copy {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

#page-teachings.active .study-book-outline-entry-copy strong {
  min-width: 0;
  color: var(--ink);
  font: 700 0.92rem/1.4 var(--sans);
  overflow-wrap: anywhere;
}

#page-teachings.active .study-book-outline-entry-copy span {
  color: var(--ink-3);
  font: 0.78rem/1.4 var(--sans);
}

#page-teachings.active .study-book-outline-action {
  align-self: center;
  white-space: nowrap;
}

#page-teachings.active .study-book-outline-disclosure,
#page-teachings.active .study-derived-context-disclosure {
  min-width: 0;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
}

#page-teachings.active .study-book-outline-disclosure summary,
#page-teachings.active .study-derived-context-disclosure summary {
  display: flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.55rem 0;
  color: var(--color-link);
  font: 700 0.85rem/1.4 var(--sans);
  cursor: pointer;
}

#page-teachings.active .study-book-outline-disclosure summary span,
#page-teachings.active .study-derived-context-disclosure summary span {
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 600;
}

#page-teachings.active .study-book-outline-disclosure summary:focus-visible,
#page-teachings.active .study-derived-context-disclosure summary:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

#page-teachings.active .study-book-outline-list.is-full {
  max-height: 30rem;
  margin-bottom: 0.6rem;
  overflow: auto;
  padding-right: 0.45rem;
}

#page-teachings.active .study-book-context-source {
  letter-spacing: 0;
}

#page-teachings.active .study-derived-context-list {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0.4rem 0 0.7rem 1.1rem;
  color: var(--ink-2);
  font: 0.86rem/1.5 var(--sans);
}

#page-teachings.active .study-derived-context-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
}

#page-teachings.active .study-derived-context-list span {
  color: var(--ink-3);
}

@media (max-width: 767px) {
  #page-teachings.active .study-book-outline-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
  }

  #page-teachings.active .study-book-outline-action {
    justify-self: start;
  }
}

html[data-theme="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-header, .about-layout, .contact-layout, .faq-shell,
  .updates-layout, .updates-shell, .editorial-page, .footer-reference-copy) {
  background: transparent !important;
}

html[data-theme-preview="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-header, .about-layout, .contact-layout, .faq-shell,
  .updates-layout, .updates-shell, .editorial-page, .footer-reference-copy) {
  background: transparent !important;
}

html[data-theme="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-title, .faq-group-title, .about-main h2,
  .footer-reference-copy h2, .footer-reference-copy h3, .updates-index-label) {
  color: var(--color-text-heading) !important;
}

html[data-theme-preview="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-title, .faq-group-title, .about-main h2,
  .footer-reference-copy h2, .footer-reference-copy h3, .updates-index-label) {
  color: var(--color-text-heading) !important;
}

html[data-theme="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-desc, .about-main p, .about-aside p, .contact-main p,
  .contact-aside p, .guide-editorial-p, .footer-reference-copy p,
  .footer-reference-copy li, .faq-answer p, .updates-empty-state) {
  color: var(--color-text-secondary) !important;
}

html[data-theme-preview="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-desc, .about-main p, .about-aside p, .contact-main p,
  .contact-aside p, .guide-editorial-p, .footer-reference-copy p,
  .footer-reference-copy li, .faq-answer p, .updates-empty-state) {
  color: var(--color-text-secondary) !important;
}

html[data-theme="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-eyebrow, .aside-label, .aside-greek, .updates-index,
  .faq-icon, .form-label) {
  color: var(--color-text-muted) !important;
}

html[data-theme-preview="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.page-eyebrow, .aside-label, .aside-greek, .updates-index,
  .faq-icon, .form-label) {
  color: var(--color-text-muted) !important;
}

html[data-theme="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.about-aside-block, .guide-copy-section, .faq-item,
  .form-input, .form-textarea) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme-preview="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(.about-aside-block, .guide-copy-section, .faq-item,
  .form-input, .form-textarea) {
  background: var(--color-surface-raised);
  border-color: var(--color-border);
  color: var(--color-text);
}

html[data-theme="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(a, .editorial-inline-link, .faq-question, .form-submit) {
  color: var(--color-link);
}

/* Books / children's landing page: keep the content gentle and editorial,
   while giving the route the same intentional dark canvas as the rest of the
   public site. There is no catalogue or imagery here yet to recolour. */
html[data-theme="dark"] body > #page-books.page.active,
html[data-theme-preview="dark"] body > #page-books.page.active {
  --color-page: #24231F;
  --color-surface: #2D2B26;
  --color-surface-raised: #35322B;
  --color-text: #E9E2D7;
  --color-text-heading: #F5EEE3;
  --color-text-secondary: #C9C0B3;
  --color-text-muted: #A79E92;
  --color-border: #514B42;
  --color-border-strong: #70675A;
  --color-link: #A6C8AD;
  --color-focus: #E4BD5C;
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-secondary);
  --ink-4: var(--color-text-muted);
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-surface-muted);
  --rule: var(--color-border);
  color-scheme: dark;
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="dark"] body > #page-books.page.active .books-coming-soon,
html[data-theme-preview="dark"] body > #page-books.page.active .books-coming-soon {
  background: var(--color-page);
}

html[data-theme="dark"] body > #page-books.page.active .page-title,
html[data-theme-preview="dark"] body > #page-books.page.active .page-title {
  color: var(--color-text-heading) !important;
}

html[data-theme="dark"] body > #page-books.page.active .page-desc,
html[data-theme-preview="dark"] body > #page-books.page.active .page-desc {
  color: var(--color-text-secondary) !important;
}

/* Mobile About: make the long-form page feel like a deliberate reading flow
   instead of a squeezed desktop grid. */
@media (max-width: 600px) {
  #page-about .page-header {
    padding: 3.25rem 1.25rem 1.5rem;
  }

  #page-about .page-title {
    font-size: clamp(2.35rem, 11vw, 3.4rem);
    line-height: 1.04;
    max-width: 10ch;
  }

  #page-about .page-desc {
    font-size: 1rem;
    line-height: 1.55;
    max-width: 30ch;
  }

  #page-about .about-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 1.25rem 2.5rem;
  }

  #page-about .about-main {
    padding: 1.25rem 0 0;
  }

  #page-about .about-main h2 {
    font-size: 1.45rem;
    line-height: 1.2;
    margin-top: 2.15rem;
  }

  #page-about .about-main p {
    font-size: 1rem;
    line-height: 1.72;
  }

  #page-about .about-rule {
    margin: 1.75rem 0;
  }

  #page-about .about-aside {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.5rem 0 0;
  }

  #page-about .about-aside-block {
    padding: 1.1rem 1.15rem;
    border-radius: 0.75rem;
  }

  #page-about .aside-greek {
    font-size: 2rem;
  }

  #page-about .footer {
    margin-top: 0;
  }
}

html[data-theme-preview="dark"] body > :is(
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active :is(a, .editorial-inline-link, .faq-question, .form-submit) {
  color: var(--color-link);
}

@media (max-width: 767px) {
  #page-teachings.active .study-page-header {
    position: static;
    top: auto;
  }

  #page-teachings.active .study-content-layout {
    width: 100%;
    max-width: none;
    padding-top: 0.75rem;
  }

  #page-teachings.active .study-content-layout.is-study-experience {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  #page-teachings.active .study-experience-rail {
    display: none;
  }

  #page-teachings.active .study-experience {
    width: 100%;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  #page-teachings.active .study-experience-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    width: 100%;
  }

  #page-teachings.active .study-experience-main,
  #page-teachings.active .study-current-stage,
  #page-teachings.active .study-current-stack,
  #page-teachings.active .study-workspace-card,
  #page-teachings.active .study-current-overview-card,
  #page-teachings.active .study-current-outline-card,
  #page-teachings.active .study-current-themes-card,
  #page-teachings.active .study-current-people-card,
  #page-teachings.active .study-current-theme-articles-card,
  #page-teachings.active .study-current-highlights-card,
  #page-teachings.active .study-current-related-card {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  #page-teachings.active .study-current-title,
  #page-teachings.active .study-book-overview-copy {
    max-width: none;
  }

  #page-teachings.active .study-navigation-mobile-callup {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    justify-content: center;
    padding: 0 0.75rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
    z-index: 348;
    pointer-events: none;
  }

  #page-teachings.active .study-navigation-fab {
    display: inline-flex;
    width: min(100%, 20rem);
    pointer-events: auto;
  }
}

/* ══════════════════════════════════════════════════════
   UI BALANCE PASS

   Keep the editorial palette and existing interactions, while
   giving the content-heavy routes a clearer visual rhythm.
══════════════════════════════════════════════════════ */
#page-apologetics.active {
  --apologetics-section-radius: 22px;
  --apologetics-card-radius: 16px;
}

#page-apologetics.active .apologetics-page-shell {
  gap: clamp(1.75rem, 3.5vw, 3.25rem);
  padding-top: clamp(1rem, 2vw, 1.75rem);
}

#page-apologetics.active .apologetics-hero-surface {
  border-radius: 28px;
  box-shadow: 0 20px 48px rgba(72, 50, 28, 0.08);
}

#page-apologetics.active .apologetics-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(1.5rem, 3vw, 2.75rem);
  padding: clamp(2rem, 4vw, 3.5rem) clamp(1.25rem, 4vw, 3.5rem) clamp(1.75rem, 3vw, 2.75rem);
}

#page-apologetics.active .apologetics-hero-copy {
  align-self: center;
  max-width: 48rem;
}

#page-apologetics.active .apologetics-hero-panel {
  padding-top: clamp(0rem, 1.5vw, 1rem);
}

#page-apologetics.active .apologetics-answer-card {
  border-radius: var(--apologetics-card-radius);
  background: var(--color-surface-raised);
  box-shadow: 0 16px 38px rgba(42, 30, 18, 0.08);
}

#page-apologetics.active .apologetics-answer-panel-inner--compact {
  gap: 1.05rem;
  padding: clamp(1.25rem, 2.5vw, 1.7rem);
}

#page-apologetics.active .apologetics-answer-title {
  max-width: 20ch;
  font-size: clamp(1.22rem, 2vw, 1.5rem);
  line-height: 1.16;
}

#page-apologetics.active .apologetics-answer-meta {
  justify-content: flex-start;
}

#page-apologetics.active .apologetics-answer-short {
  max-width: 48ch;
  font-size: 0.95rem;
  line-height: 1.7;
}

#page-apologetics.active .apologetics-answer-features {
  padding-top: 0.85rem;
  border-top: 1px solid var(--color-border);
}

#page-apologetics.active .apologetics-answer-link:not(.apologetics-answer-link--nav) {
  min-height: 2.9rem;
  padding-inline: 1.15rem;
}

#page-apologetics.active .apologetics-section {
  gap: 1.35rem;
  padding: clamp(1.35rem, 3vw, 2.25rem);
  border: 1px solid var(--color-border);
  border-radius: var(--apologetics-section-radius);
  background: color-mix(in srgb, var(--color-surface-raised) 36%, transparent);
}

#page-apologetics.active .apologetics-section-head {
  align-items: flex-start;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--color-border);
}

#page-apologetics.active .apologetics-section-kicker {
  margin-bottom: 0.45rem;
}

#page-apologetics.active .apologetics-section-title {
  font-size: clamp(1.45rem, 2.6vw, 1.9rem);
  line-height: 1.1;
}

#page-apologetics.active .apologetics-question-grid,
#page-apologetics.active .apologetics-perspective-grid {
  grid-auto-rows: 1fr;
}

#page-apologetics.active .apologetics-question-card,
#page-apologetics.active .apologetics-perspective-card {
  min-height: 15rem;
  padding: 1.3rem;
  border-radius: var(--apologetics-card-radius);
  background: var(--color-surface-raised);
  box-shadow: none;
}

#page-apologetics.active .apologetics-question-card:hover,
#page-apologetics.active .apologetics-question-card.is-active,
#page-apologetics.active .apologetics-perspective-card:hover,
#page-apologetics.active .apologetics-perspective-card.is-active {
  box-shadow: 0 12px 28px var(--color-shadow);
}

#page-apologetics.active .apologetics-question-title {
  font-size: 1.16rem;
  line-height: 1.24;
}

#page-apologetics.active .apologetics-question-answer,
#page-apologetics.active .apologetics-perspective-description {
  line-height: 1.62;
}

#page-apologetics.active .apologetics-carousel-track {
  grid-auto-columns: minmax(280px, 1fr);
}

#page-apologetics.active .apologetics-category-layout {
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.35rem;
}

#page-apologetics.active .apologetics-category-spotlight-card {
  min-height: 100%;
  padding: 1.45rem;
  border-radius: var(--apologetics-card-radius);
  background: var(--color-surface-raised);
  box-shadow: none;
}

#page-apologetics.active .apologetics-category-card {
  min-height: 9.4rem;
  padding: 1.15rem;
  border-radius: var(--apologetics-card-radius);
  background: var(--color-surface-raised);
  box-shadow: none;
}

#page-apologetics.active .apologetics-category-card:hover,
#page-apologetics.active .apologetics-category-card.is-active {
  box-shadow: 0 12px 28px var(--color-shadow);
}

#page-apologetics.active .apologetics-perspective-overview-card {
  padding: 1.35rem 1.45rem;
  border-radius: var(--apologetics-card-radius);
  background: var(--color-surface-raised);
  box-shadow: none;
}

/* Other catalogue-style surfaces use the same measured card rhythm. */
#page-home.active .entry-card,
#page-home.active .feat-card,
#page-teachings.active .study-guide-card {
  border-radius: var(--radius-md);
}

#page-home.active .featured-grid,
#page-teachings.active .study-guides-grid {
  align-items: stretch;
}

@media (max-width: 900px) {
  #page-apologetics.active .apologetics-hero {
    gap: 1.35rem;
    padding: 1.85rem 1.5rem 1.75rem;
  }

  #page-apologetics.active .apologetics-hero-panel {
    padding-top: 0;
  }

  #page-apologetics.active .apologetics-answer-card {
    max-width: 48rem;
    margin-inline: auto;
  }

  #page-apologetics.active .apologetics-category-layout {
    grid-template-columns: 1fr;
  }

  #page-apologetics.active .apologetics-category-spotlight {
    width: 100%;
  }

  #page-apologetics.active .apologetics-carousel-track {
    grid-auto-columns: minmax(270px, 74%);
  }
}

/* The shared dark-surface cascade runs later than the selected-result polish;
   keep this state flat in dark mode as well. */
html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active :is(
  .study-selected-card,
  .study-chapter-context-card,
  .study-selected-translation-card
) {
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 680px) {
  #page-apologetics.active .apologetics-page-shell {
    width: min(100% - 1rem, 100%);
    gap: 1.25rem;
  }

  #page-apologetics.active .apologetics-hero {
    padding: 1.5rem 1rem 1.35rem;
  }

  #page-apologetics.active .apologetics-section {
    padding: 1.15rem 1rem 1.25rem;
    border-radius: 18px;
  }

  #page-apologetics.active .apologetics-section-head {
    padding-bottom: 0.9rem;
  }

  #page-apologetics.active .apologetics-question-card,
  #page-apologetics.active .apologetics-perspective-card {
    min-height: 0;
    padding: 1.15rem;
  }

  #page-apologetics.active .apologetics-category-card {
    min-height: 0;
  }

  #page-apologetics.active .apologetics-carousel-track {
    grid-auto-columns: minmax(260px, 88%);
  }
}

@media (max-width: 767px) {
  #page-teachings.active .study-page-header {
    width: 100%;
    max-width: calc(100vw - 32px);
    min-width: 0;
    box-sizing: border-box;
  }
}

/* Final Study reference-shell overrides. Keep these after the legacy reader
   rules so the scoped surface remains visually continuous without changing
   the global Keryg palette. */
body:has(#page-teachings.active) #page-teachings.active,
body:has(#page-teachings.active) #page-teachings.active .teachings-layout,
body:has(#page-teachings.active) #page-teachings.active .teach-main,
body:has(#page-teachings.active) #page-teachings.active .study-page-header,
body:has(#page-teachings.active) #page-teachings.active .study-content-layout,
body:has(#page-teachings.active) #page-teachings.active .study-experience {
  background: var(--study-ref-bg);
  color: var(--study-ref-text);
}

body:has(#page-teachings.active) #page-teachings.active .study-page-header {
  border-color: var(--study-ref-border);
  box-shadow: none;
}

body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-reference,
body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-subrow,
body:has(#page-teachings.active) #page-teachings.active .chapter-breadcrumb,
body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-reference strong {
  color: var(--study-ref-text);
}

body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-subrow,
body:has(#page-teachings.active) #page-teachings.active .chapter-breadcrumb {
  border-color: var(--study-ref-border);
}

body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-menu,
body:has(#page-teachings.active) #page-teachings.active .compact-version-control,
body:has(#page-teachings.active) #page-teachings.active .compact-version-control select,
body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-chapter-controls .teach-chap-btn {
  background: var(--study-ref-surface);
  border-color: var(--study-ref-border-strong);
  color: var(--study-ref-text-soft);
}

body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-menu:hover,
body:has(#page-teachings.active) #page-teachings.active .reader-toolbar-chapter-controls .teach-chap-btn:hover {
  background: var(--study-ref-surface-raised);
  color: var(--study-ref-text);
}

body:has(#page-teachings.active) #page-teachings.active .study-experience-grid.is-reference-design ~ .study-experience-header,
body:has(#page-teachings.active) #page-teachings.active .study-experience-header:has(+ .study-experience-grid.is-reference-design) {
  display: none;
}

/* Theme alignment layer. Study keeps its approved shell and layout, but its
   surfaces now resolve through the same semantic light/dark system as the
   rest of Keryg. */
html[data-theme="light"],
html[data-theme-preview="softer-light"] {
  --color-nav-surface: var(--color-surface);
}

html[data-theme="dark"],
html[data-theme-preview="dark"] {
  --color-page: #171A17;
  --color-surface: #20241F;
  --color-surface-raised: #292E28;
  --color-surface-muted: #30372F;
  --color-surface-inverse: #0E120F;
  --color-text: #E9E8DE;
  --color-text-heading: #F6F5EC;
  --color-text-secondary: #C7CEC0;
  --color-text-muted: #9CA899;
  --color-text-inverse: #F1F3EA;
  --color-border: rgba(218, 229, 211, 0.16);
  --color-border-strong: rgba(218, 229, 211, 0.28);
  --color-brand: #9CCF8B;
  --color-brand-hover: #B5DDA7;
  --color-link: #B5DDA7;
  --color-link-hover: #D1EBC8;
  --color-focus: rgba(156, 207, 139, 0.58);
  --color-nav-surface: var(--color-surface);
}

html[data-theme="dark"] body,
html[data-theme-preview="dark"] body {
  --color-page: #171A17;
  --color-surface: #20241F;
  --color-surface-raised: #292E28;
  --color-surface-muted: #30372F;
  --color-surface-inverse: #0E120F;
  --color-text: #E9E8DE;
  --color-text-heading: #F6F5EC;
  --color-text-secondary: #C7CEC0;
  --color-text-muted: #9CA899;
  --color-text-inverse: #F1F3EA;
  --color-border: rgba(218, 229, 211, 0.16);
  --color-border-strong: rgba(218, 229, 211, 0.28);
  --color-brand: #9CCF8B;
  --color-brand-hover: #B5DDA7;
  --color-link: #B5DDA7;
  --color-link-hover: #D1EBC8;
  --color-focus: rgba(156, 207, 139, 0.58);
  --color-overlay: rgba(7, 10, 8, 0.72);
  --color-shadow: rgba(0, 0, 0, 0.34);
  --color-nav-surface: var(--color-surface);
}

html[data-theme="light"] .nav,
html[data-theme-preview="softer-light"] .nav,
html[data-theme="dark"] .nav,
html[data-theme-preview="dark"] .nav {
  background: var(--color-nav-surface);
  color: var(--color-text);
}

html[data-theme="dark"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active,
html[data-theme-preview="dark"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active {
  --color-page: #171A17;
  --color-surface: #20241F;
  --color-surface-raised: #292E28;
  --color-surface-muted: #30372F;
  --color-surface-inverse: #0E120F;
  --color-text: #E9E8DE;
  --color-text-heading: #F6F5EC;
  --color-text-secondary: #C7CEC0;
  --color-text-muted: #9CA899;
  --color-text-inverse: #F1F3EA;
  --color-border: rgba(218, 229, 211, 0.16);
  --color-border-strong: rgba(218, 229, 211, 0.28);
  --color-brand: #9CCF8B;
  --color-brand-hover: #B5DDA7;
  --color-link: #B5DDA7;
  --color-link-hover: #D1EBC8;
  --color-focus: rgba(156, 207, 139, 0.58);
  --color-overlay: rgba(7, 10, 8, 0.72);
  --color-shadow: rgba(0, 0, 0, 0.34);
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="light"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active {
  --color-page: #F1EEE6;
  --color-surface: #E9E5DA;
  --color-surface-raised: #F7F4ED;
  --color-surface-muted: #DED9CC;
  --color-surface-inverse: #102517;
  --color-text: #1A2C20;
  --color-text-heading: #102517;
  --color-text-secondary: #365A45;
  --color-text-muted: #5D7F6A;
  --color-text-inverse: #E2D1B3;
  --color-border: rgba(16, 37, 23, 0.14);
  --color-border-strong: rgba(16, 37, 23, 0.24);
  --color-brand: #2F6B45;
  --color-brand-hover: #245537;
  --color-link: #2F6B45;
  --color-link-hover: #245537;
  --color-focus: rgba(47, 107, 69, 0.52);
  --color-shadow: rgba(16, 37, 23, 0.11);
  background: var(--color-page);
  color: var(--color-text);
}

html[data-theme="light"] body:has(#page-teachings.active),
html[data-theme-preview="softer-light"] body:has(#page-teachings.active),
html[data-theme="dark"] body:has(#page-teachings.active),
html[data-theme-preview="dark"] body:has(#page-teachings.active) {
  --study-ref-bg: var(--color-page);
  --study-ref-surface: var(--color-surface);
  --study-ref-surface-raised: var(--color-surface-raised);
  --study-ref-surface-soft: var(--color-surface-muted);
  --study-ref-border: var(--color-border);
  --study-ref-border-strong: var(--color-border-strong);
  --study-ref-text: var(--color-text);
  --study-ref-text-soft: var(--color-text-secondary);
  --study-ref-muted: var(--color-text-muted);
  --study-ref-green: var(--color-brand);
  --study-ref-green-soft: color-mix(in srgb, var(--color-brand) 12%, transparent);
  --study-ref-gold: var(--color-accent);
}

html[data-theme="light"] #page-teachings.active,
html[data-theme-preview="softer-light"] #page-teachings.active {
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-border);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-muted);
  --ink-4: color-mix(in srgb, var(--color-text-muted) 78%, var(--color-page));
  --color-brand: var(--green-700);
  --color-brand-hover: var(--green-800);
  --color-link: var(--green-700);
  --color-link-hover: var(--green-800);
  --color-focus: rgba(47, 107, 69, 0.52);
  --color-scripture-text: var(--color-text);
  --color-scripture-number: var(--color-text-muted);
  --color-scripture-heading: var(--color-text-heading);
  --color-scripture-footnote: var(--color-link);
  --color-scripture-focus-ring: var(--color-brand);
  --color-scripture-selection-marker: var(--color-brand);
  --color-scripture-commentary-linked-marker: var(--color-brand);
}

html[data-theme="dark"] #page-teachings.active,
html[data-theme-preview="dark"] #page-teachings.active {
  --parchment: var(--color-page);
  --parchment-2: var(--color-surface);
  --parchment-3: var(--color-border);
  --ink: var(--color-text);
  --ink-2: var(--color-text-secondary);
  --ink-3: var(--color-text-muted);
  --ink-4: color-mix(in srgb, var(--color-text-muted) 78%, var(--color-page));
  --color-brand: #9CCF8B;
  --color-brand-hover: #B5DDA7;
  --color-link: #B5DDA7;
  --color-link-hover: #D1EBC8;
  --color-focus: rgba(156, 207, 139, 0.58);
  --color-scripture-text: var(--color-text);
  --color-scripture-number: var(--color-text-muted);
  --color-scripture-heading: var(--color-text-heading);
  --color-scripture-footnote: var(--color-link);
  --color-scripture-focus-ring: var(--color-brand);
  --color-scripture-selection-marker: var(--color-brand);
  --color-scripture-commentary-linked-marker: var(--color-brand);
}

html[data-theme="light"] body:has(#page-teachings.active) .nav,
html[data-theme-preview="softer-light"] body:has(#page-teachings.active) .nav,
html[data-theme="dark"] body:has(#page-teachings.active) .nav,
html[data-theme-preview="dark"] body:has(#page-teachings.active) .nav {
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

html[data-theme="light"] body:has(#page-teachings.active) :is(.nav-brand, .nav-link),
html[data-theme-preview="softer-light"] body:has(#page-teachings.active) :is(.nav-brand, .nav-link),
html[data-theme="dark"] body:has(#page-teachings.active) :is(.nav-brand, .nav-link),
html[data-theme-preview="dark"] body:has(#page-teachings.active) :is(.nav-brand, .nav-link) {
  color: var(--color-text-secondary);
}

html[data-theme="light"] body:has(#page-teachings.active) .nav-link.active,
html[data-theme-preview="softer-light"] body:has(#page-teachings.active) .nav-link.active,
html[data-theme="dark"] body:has(#page-teachings.active) .nav-link.active,
html[data-theme-preview="dark"] body:has(#page-teachings.active) .nav-link.active {
  color: var(--color-text-heading);
}

html[data-theme="light"] #page-teachings.active :is(.chapter-reader, .teach-sidebar),
html[data-theme-preview="softer-light"] #page-teachings.active :is(.chapter-reader, .teach-sidebar),
html[data-theme="dark"] #page-teachings.active :is(.chapter-reader, .teach-sidebar),
html[data-theme-preview="dark"] #page-teachings.active :is(.chapter-reader, .teach-sidebar) {
  color: var(--color-text);
}

/* Footer owns a legacy local token block; rebind it to the shared palette so
   the global shell and Study do not split into different dark products. */
html[data-theme="light"] .footer,
html[data-theme-preview="softer-light"] .footer {
  --color-page: #F1EEE6;
  --color-surface: #E9E5DA;
  --color-surface-raised: #F7F4ED;
  --color-surface-muted: #DED9CC;
  --color-text: #1A2C20;
  --color-text-heading: #102517;
  --color-text-secondary: #365A45;
  --color-text-muted: #5D7F6A;
  --color-border: rgba(16, 37, 23, 0.14);
  --color-brand: #2F6B45;
  --color-brand-hover: #245537;
  --color-link: #2F6B45;
  --color-link-hover: #245537;
  --color-focus: rgba(47, 107, 69, 0.52);
  --color-shadow: rgba(16, 37, 23, 0.11);
}

html[data-theme="dark"] .footer,
html[data-theme-preview="dark"] .footer {
  --color-page: #171A17;
  --color-surface: #20241F;
  --color-surface-raised: #292E28;
  --color-surface-muted: #30372F;
  --color-surface-inverse: #0E120F;
  --color-text: #E9E8DE;
  --color-text-heading: #F6F5EC;
  --color-text-secondary: #C7CEC0;
  --color-text-muted: #9CA899;
  --color-text-inverse: #F1F3EA;
  --color-border: rgba(218, 229, 211, 0.16);
  --color-border-strong: rgba(218, 229, 211, 0.28);
  --color-brand: #9CCF8B;
  --color-brand-hover: #B5DDA7;
  --color-link: #B5DDA7;
  --color-link-hover: #D1EBC8;
  --color-focus: rgba(156, 207, 139, 0.58);
  --color-shadow: rgba(0, 0, 0, 0.34);
}

/* A few public/editorial routes still carry an older important background
   declaration. Keep the page canvas on the shared semantic token instead of
   letting those routes drift back to the retired warm-charcoal value. */
html[data-theme="light"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active,
html[data-theme-preview="softer-light"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active {
  background: var(--color-page) !important;
  color: var(--color-text) !important;
}

/* Study view switcher: compact shared control, with the approved green state. */
#page-teachings.active .study-view-switcher {
  --study-switcher-pad: 0.2rem;
  --study-switcher-gap: 0.2rem;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 1 auto;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: var(--study-switcher-gap);
  padding: var(--study-switcher-pad);
  border: 1px solid var(--study-ref-border-strong);
  border-radius: 999px;
  background: var(--study-ref-surface);
}

#page-teachings.active .study-view-switcher::before {
  position: absolute;
  z-index: -1;
  top: var(--study-switcher-pad);
  bottom: var(--study-switcher-pad);
  left: var(--study-switcher-pad);
  width: calc((100% - (2 * var(--study-switcher-pad)) - var(--study-switcher-gap)) / 2);
  border: 1px solid color-mix(in srgb, var(--study-ref-green) 52%, var(--study-ref-border-strong));
  border-radius: 999px;
  background: color-mix(in srgb, var(--study-ref-green) 18%, var(--study-ref-surface-raised) 82%);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--study-ref-green) 18%, transparent);
  content: '';
  pointer-events: none;
  transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

#page-teachings.active .study-view-switcher:has([data-study-view="results"].active)::before {
  transform: translateX(calc(100% + var(--study-switcher-gap)));
}

#page-teachings.active .study-experience-topbar .study-view-switcher,
#page-teachings.active .study-search-topbar .study-view-switcher,
#page-teachings.active .study-selected-topbar .study-view-switcher {
  flex: 0 1 auto;
}

#page-teachings.active .study-reference-rail-view-switch {
  width: 100%;
  max-width: 100%;
  gap: 0.15rem;
  padding: 0.18rem;
}

#page-teachings.active .study-view-switcher .study-workspace-tab {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  min-height: 2.15rem;
  padding: 0.42rem 0.78rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--study-ref-muted);
  font: 600 0.72rem/1.2 var(--sans);
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease;
}

#page-teachings.active .study-view-switcher .study-workspace-tab:hover {
  border-color: color-mix(in srgb, var(--study-ref-border-strong) 72%, transparent);
  background: color-mix(in srgb, var(--study-ref-surface-raised) 52%, transparent);
  color: var(--study-ref-text);
}

#page-teachings.active .study-view-switcher .study-workspace-tab.active {
  border-color: transparent;
  background: transparent !important;
  color: var(--study-ref-text);
  box-shadow: none;
}

#page-teachings.active .study-view-switcher .study-workspace-tab:focus-visible {
  outline: 2px solid var(--study-ref-green);
  outline-offset: 2px;
}

#page-teachings.active .study-view-switcher .study-workspace-tab:active {
  transform: translateY(1px);
}

#page-teachings.active .study-reference-rail-view-switch .study-workspace-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.38rem 0.28rem;
  font-size: 0.64rem;
  font-weight: 500;
  text-align: center;
}

#page-teachings.active .study-reference-rail-view-switch .study-workspace-tab.active {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  #page-teachings.active .study-view-switcher::before {
    transition: none;
  }
}

#page-teachings.active .study-search-form-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* Keep Search Scripture visually inside the shared Study workspace. The
   heading carries the identity; the form should read as one calm sequence of
   query, search options, and filters rather than a second nested panel. */
#page-teachings.active .study-search-stage {
  gap: 1.15rem;
}

#page-teachings.active .study-search-heading {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--parchment-3);
}

#page-teachings.active .study-search-form {
  gap: 0.85rem;
}

#page-teachings.active .study-search-query-shell {
  border-radius: 0.72rem;
  background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
}

#page-teachings.active .study-search-filters-bar {
  margin-top: 0.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--parchment-3);
}

/* Search is a distinct Study workspace: keep its switcher and version context
   in a focused header, then give the search controls a single readable column
   instead of carrying the passage rail and evidence rail into this state. */
#page-teachings.active .study-experience.is-search-results .study-experience-header,
#page-teachings.active .study-experience.is-selected-result .study-experience-header {
  display: grid;
  gap: 0.75rem;
  padding: 0.7rem 0 0.8rem;
  border-bottom: 1px solid var(--study-ref-border);
}

#page-teachings.active .study-experience.is-search-results .study-experience-grid.is-results-only,
#page-teachings.active .study-experience.is-selected-result .study-experience-grid.is-results-only {
  width: min(100%, 68rem);
  margin-inline: auto;
  padding-top: clamp(1.2rem, 3vw, 2.25rem);
}

#page-teachings.active .study-experience.is-search-results .study-experience-main,
#page-teachings.active .study-experience.is-selected-result .study-experience-main {
  width: 100%;
  max-width: 68rem;
  margin-inline: auto;
}

@media (max-width: 767px) {
  #page-teachings.active .study-experience.is-search-results .study-experience-topbar,
  #page-teachings.active .study-experience.is-selected-result .study-experience-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
  }

  #page-teachings.active .study-experience.is-search-results .study-view-switcher,
  #page-teachings.active .study-experience.is-selected-result .study-view-switcher,
  #page-teachings.active .study-experience.is-search-results .study-version-control,
  #page-teachings.active .study-experience.is-selected-result .study-version-control {
    width: 100%;
    max-width: none;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body:has(#page-teachings.active) #page-teachings.active .study-experience-header:has(+ .study-experience-grid.is-reference-design) {
    display: grid !important;
  }
}

@media (max-width: 767px) {
  /* Keep the shared Current Passage/Search Scripture switcher visible on
     phones. The wide passage layout hides this header because its rail owns
     the switcher, but that rail is unavailable at mobile widths. */
  body:has(#page-teachings.active) #page-teachings.active .study-experience-header:has(+ .study-experience-grid.is-reference-design) {
    display: grid !important;
  }

  #page-teachings.active .study-navigation-view-switcher,
  #page-teachings.active .study-search-topbar .study-view-switcher,
  #page-teachings.active .study-selected-topbar .study-view-switcher {
    width: 100%;
  }

  #page-teachings.active .study-navigation-view-switcher .study-workspace-tab,
  #page-teachings.active .study-search-topbar .study-view-switcher .study-workspace-tab,
  #page-teachings.active .study-selected-topbar .study-view-switcher .study-workspace-tab {
    flex: 1 1 0;
    text-align: center;
  }
}

/* Keep the selected Search Scripture result in the current Study language.
   The result remains a distinct search state, but its old card-inside-card
   presentation is replaced with the same flat editorial surface used by the
   approved Current Passage view. */
#page-teachings.active .study-selected-card,
#page-teachings.active .study-chapter-context-card {
  gap: 1rem;
  padding: 0.25rem 0 1.35rem;
  border: 0;
  border-top: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-teachings.active .study-selected-hero {
  gap: 0.85rem;
  padding: 0.25rem 0 1.35rem 1rem;
  border: 0;
  border-left: 3px solid var(--color-accent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-teachings.active .study-selected-translation-grid {
  gap: 1rem;
}

#page-teachings.active .study-selected-translation-card {
  padding: 0.75rem 0 0.85rem;
  border: 0;
  border-top: 1px solid var(--parchment-3);
  border-radius: 0;
  background: transparent;
}

#page-teachings.active .study-selected-actions {
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--parchment-3);
}

#page-teachings.active .study-selected-actions .teach-tool-btn {
  min-height: 2.35rem;
  width: auto;
  padding: 0.35rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
  color: var(--color-link) !important;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 32%, transparent);
  text-underline-offset: 0.18em;
}

#page-teachings.active .study-selected-actions .teach-tool-btn:hover,
#page-teachings.active .study-selected-actions .teach-tool-btn:focus-visible {
  color: var(--color-link-hover) !important;
}

html[data-theme="dark"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active,
html[data-theme-preview="dark"] body > :is(
  #page-home, #page-teachings, #page-apologetics, #page-books, #page-guides,
  #page-guide-authoring, #page-guide-series, #page-guide-chapter,
  #page-about, #page-updates, #page-statement-of-faith, #page-interpretation,
  #page-editorial-standards, #page-languages, #page-credits, #page-attribution,
  #page-faq, #page-services, #page-contact, #page-privacy, #page-terms
).page.active {
  background: var(--color-page) !important;
  color: var(--color-text) !important;
}
/* Current develop contextual Help and Beta notice styles. */
.keryg-help-trigger { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; width:28px; height:28px; padding:0; border:1px solid var(--rule-strong); border-radius:999px; background:var(--color-surface-raised); color:var(--ink-2); font:600 .82rem/1 var(--sans); cursor:pointer; transition:background 140ms ease,border-color 140ms ease,color 140ms ease,transform 140ms ease; }
.keryg-help-trigger:hover { border-color:var(--ink-3); color:var(--ink); background:var(--parchment-2); transform:translateY(-1px); }
.keryg-help-trigger:focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 48%,transparent); outline-offset:2px; }
.keryg-help-trigger--heading { margin-left:.35rem; vertical-align:.12em; }
.keryg-help-trigger--inline { margin-left:.4rem; }
.keryg-help-popover { position:fixed; z-index:260; box-sizing:border-box; width:min(336px,calc(100vw - 24px)); max-height:min(420px,calc(100vh - 24px)); overflow-y:auto; overscroll-behavior:contain; padding:1rem 1rem 1.05rem; border:1px solid var(--rule-strong); border-radius:.85rem; background:var(--color-dialog-surface); color:var(--ink); box-shadow:0 16px 36px var(--color-shadow); }
.keryg-help-popover[hidden] { display:none; }
.keryg-help-popover__head { display:flex; align-items:flex-start; gap:.75rem; justify-content:space-between; }
.keryg-help-popover__title { margin:0; font:600 1rem/1.3 var(--serif); color:var(--ink); }
.keryg-help-popover__body { margin:.65rem 0 0; color:var(--ink-2); font:400 .86rem/1.55 var(--sans); }
.keryg-help-popover__close { width:30px; height:30px; flex:0 0 auto; padding:0; border:0; background:transparent; color:var(--ink-3); font-size:1.35rem; line-height:1; cursor:pointer; }
.keryg-help-popover__close:hover { color:var(--ink); }
.keryg-help-popover__close:focus-visible { outline:3px solid color-mix(in srgb,var(--accent) 48%,transparent); outline-offset:2px; border-radius:.25rem; }
.reader-mode-help-group { display:inline-flex; align-items:center; gap:.35rem; min-width:0; }
.study-search-mode-control-wrap { display:inline-flex; align-items:center; gap:.35rem; min-width:0; }
.study-search-mode-control-wrap .step-study-select { min-width:0; }
.reader-more-help-slot { display:flex; align-items:center; gap:.45rem; padding:.3rem .45rem; border-top:1px solid var(--rule); }
.reader-more-help-slot::after { content:'Help'; color:var(--ink-2); font:500 .82rem/1 var(--sans); }
@media (max-width:767px) { .keryg-help-trigger { width:36px; height:36px; } .keryg-help-trigger--inline { margin-left:.25rem; } .reader-mode-help-group > .keryg-help-trigger { display:none; } #page-teachings .reader-more-help-slot .keryg-help-trigger { display:inline-flex; } .keryg-help-popover { max-height:min(420px,calc(100vh - 24px)); } }
@media (min-width:768px) and (max-width:900px) {
  .nav-inner { position:relative; padding-inline:1rem; }
  .nav-brand { margin-right:0; }
  .nav-toggle { display:inline-flex; align-items:center; justify-content:center; }
  .nav-links { display:none; position:absolute; top:60px; left:0; right:0; margin-left:0; gap:0; background-color:var(--parchment-2); flex-direction:column; z-index:120; }
  .nav-links.open { display:flex; }
  .nav-link { width:100%; height:auto; padding:.8rem 2rem; }
  .theme-switch { width:auto; margin:.55rem 1rem .7rem; align-self:flex-end; justify-content:flex-end; }
}
@media (prefers-reduced-motion:reduce) { .keryg-help-trigger { transition:none; } }
.keryg-beta-notice { position:fixed; right:max(1rem,calc((100vw - var(--max))/2 + 1rem)); bottom:max(1rem,calc(1rem + env(safe-area-inset-bottom,0px))); z-index:360; display:grid; gap:.58rem; width:min(24rem,calc(100vw - 2rem)); padding:.95rem 1rem 1rem; border:1px solid var(--color-border-strong); border-radius:var(--radius-md); background:var(--color-dialog-surface); color:var(--color-text); box-shadow:var(--elev-2); opacity:1; visibility:hidden; pointer-events:none; transform:none; }
.keryg-beta-notice.is-visible { visibility:visible; pointer-events:auto; transform:none; animation:keryg-beta-notice-enter 180ms var(--ease-premium) both; }
.keryg-beta-notice.is-dismissing { pointer-events:none; visibility:visible; animation:keryg-beta-notice-exit 180ms ease both; }
@keyframes keryg-beta-notice-enter { from { opacity:0; transform:translateY(.7rem); } to { opacity:1; transform:none; } }
@keyframes keryg-beta-notice-exit { from { opacity:1; transform:none; } to { opacity:0; transform:translateY(.35rem); } }
.keryg-beta-notice__header { display:flex; align-items:center; justify-content:space-between; gap:.75rem; }
.keryg-beta-notice__badge { display:inline-flex; align-items:center; min-height:1.4rem; padding:.1rem .48rem; border:1px solid color-mix(in srgb,var(--color-brand) 48%,transparent); border-radius:999px; color:var(--color-brand); font-size:.62rem; font-weight:600; letter-spacing:.09em; line-height:1; text-transform:uppercase; }
.keryg-beta-notice__close { width:2rem; height:2rem; margin:-.3rem -.35rem 0 0; border:0; border-radius:.35rem; background:transparent; color:var(--color-text-muted); cursor:pointer; font:400 1.45rem/1 var(--sans); }
.keryg-beta-notice__close:hover { color:var(--color-text); }
.keryg-beta-notice__close:focus-visible, .keryg-beta-notice__email:focus-visible { outline:2px solid var(--color-focus); outline-offset:3px; }
.keryg-beta-notice__title { margin:0; color:var(--color-text-heading); font:500 1.05rem/1.3 var(--serif); }
.keryg-beta-notice__body { margin:0; color:var(--color-text-secondary); font:400 .78rem/1.5 var(--sans); }
.keryg-beta-notice__email { color:var(--color-link); font-weight:500; overflow-wrap:anywhere; text-decoration:underline; text-decoration-thickness:.08em; text-underline-offset:.16em; }
@media (max-width:767px) { .keryg-beta-notice { right:1rem; bottom:max(1rem,calc(1rem + env(safe-area-inset-bottom,0px))); width:calc(100vw - 2rem); } body:has(#page-teachings.active) .keryg-beta-notice { bottom:max(4.8rem,calc(4.8rem + env(safe-area-inset-bottom,0px))); } }
@media (prefers-reduced-motion:reduce) { .keryg-beta-notice, .keryg-beta-notice.is-visible, .keryg-beta-notice.is-dismissing { animation:none; transform:none; } }
/* Keep the compact navigation inside the viewport at the tablet breakpoint. */
@media (max-width: 900px) {
  #nav-links.nav-links {
    display: none;
  }

  #nav-links.nav-links.open {
    display: flex;
  }
}

/* Keep the initial Search Scripture form readable on narrow screens too.
   Mode-specific result workspaces already use two columns; the shared form
   needs the same treatment before a mode has been selected. */
@media (max-width: 767px) {
  #page-teachings.active .study-search-filters-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.8rem;
    row-gap: 0.75rem;
  }

  #page-teachings.active .study-search-clear-wrap {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  #page-teachings.active .study-search-clear-wrap > * {
    flex: 1 1 auto;
  }
}

/* Search Scripture entry refinement: make the first action feel like a
   considered research surface without changing the shared shell contract. */
#page-teachings.active .study-search-stage > .study-search-form-card {
  gap: 0.95rem;
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid var(--parchment-3);
  border-radius: 0.95rem;
  background: color-mix(in srgb, var(--parchment) 98%, var(--ink) 2%);
  box-shadow: 0 0.45rem 1.2rem color-mix(in srgb, var(--ink) 4%, transparent);
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-label {
  color: var(--color-brand);
  font-weight: 700;
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-query-row {
  gap: 0.7rem;
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-query-shell {
  min-height: 3.15rem;
  border-radius: 0.62rem;
  background: var(--color-surface-raised);
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-query {
  min-height: 3rem;
  font-size: 1rem;
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit {
  min-width: 7rem;
  min-height: 3.15rem;
  padding-inline: 1.25rem;
  border-radius: 0.62rem;
  border: 1px solid var(--study-ref-green);
  background: var(--study-ref-green);
  color: #fff;
  font-weight: 750;
  letter-spacing: 0.02em;
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit:hover,
#page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit:focus-visible {
  border-color: var(--study-ref-green);
  background: color-mix(in srgb, var(--study-ref-green) 82%, #000 18%);
  color: #fff;
}

html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit,
html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit:hover,
html:is([data-theme="dark"], [data-theme-preview="dark"]) #page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit:focus-visible {
  color: var(--color-surface-inverse);
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-help {
  max-width: 70ch;
  margin: -0.05rem 0 0;
  color: var(--color-text-secondary);
  font-size: 0.82rem;
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-filters-bar {
  margin-top: 0.1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--parchment-3);
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-control > span {
  color: var(--color-text-muted);
  font-weight: 700;
}

#page-teachings.active .study-search-stage > .study-search-form-card .step-study-select {
  min-height: 2.7rem;
  border-radius: 0.55rem;
  background: var(--color-surface-raised);
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-clear-wrap {
  justify-content: flex-start;
}

#page-teachings.active .study-search-stage > .study-search-form-card .study-search-clear-wrap .teach-tool-btn {
  min-height: 2.7rem;
}

@media (max-width: 767px) {
  #page-teachings.active .study-search-stage > .study-search-form-card {
    padding: 0.9rem;
    border-radius: 0.8rem;
  }

  #page-teachings.active .study-search-stage > .study-search-form-card .study-search-query-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
  }

  #page-teachings.active .study-search-stage > .study-search-form-card .study-search-submit {
    min-width: 6.25rem;
    padding-inline: 0.9rem;
  }
}

/* Search Scripture light-mode actions: use the same quiet, token-backed
   control language as the surrounding Study UI instead of the legacy
   navy/sand teaching-tool button defaults. Keep this scoped to Search so
   the rest of Study retains its existing interaction hierarchy. */
html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action,
  .study-word-action,
  .study-search-clear,
  .study-search-save,
  .study-search-pagination .teach-tool-btn,
  .study-result-related-toggle,
  .study-result-related-more,
  .study-result-related-action
) {
  border: 1px solid var(--study-ref-border-strong);
  border-radius: 0.45rem;
  background: var(--study-ref-surface-raised);
  color: var(--study-ref-green);
  box-shadow: none;
  font-weight: 650;
}

html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action,
  .study-word-action,
  .study-search-clear,
  .study-search-save,
  .study-search-pagination .teach-tool-btn,
  .study-result-related-toggle,
  .study-result-related-more,
  .study-result-related-action
):hover {
  border-color: var(--study-ref-green);
  background: var(--study-ref-green-soft);
  color: var(--study-ref-green);
}

html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action,
  .study-word-action,
  .study-search-clear,
  .study-search-save,
  .study-search-pagination .teach-tool-btn,
  .study-result-related-toggle,
  .study-result-related-more,
  .study-result-related-action
):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--study-ref-green) 34%, transparent);
  outline-offset: 2px;
}

html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action[data-study-search-open],
  .study-word-action.is-primary
) {
  border-color: var(--study-ref-green);
  background: var(--study-ref-green);
  color: #fff;
}

html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action[data-study-search-open],
  .study-word-action.is-primary
):hover {
  border-color: var(--study-ref-green);
  background: color-mix(in srgb, var(--study-ref-green) 82%, #000 18%);
  color: #fff;
}

html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action[data-study-search-open],
  .study-word-action.is-primary
):focus-visible {
  outline-color: color-mix(in srgb, var(--study-ref-green) 48%, transparent);
}

html:not([data-theme="dark"]):not([data-theme-preview="dark"]) #page-teachings.active .study-search-stage :is(
  .study-result-action:disabled,
  .study-word-action:disabled,
  .study-search-clear:disabled,
  .study-search-save:disabled,
  .study-search-pagination .teach-tool-btn:disabled
) {
  border-color: var(--study-ref-border);
  background: var(--study-ref-surface-soft);
  color: var(--study-ref-text-soft);
  box-shadow: none;
  cursor: not-allowed;
}

/* Search Scripture V3 Word/Lexical body: evidence-first hierarchy. */
.study-word-mode {
  gap: 1.25rem;
}

.study-word-mode .study-search-heading {
  max-width: 52rem;
}

.study-word-mode .study-search-title {
  letter-spacing: -0.015em;
}

.study-word-main,
.study-word-rail {
  gap: 1.25rem;
}

.study-word-identity {
  padding: 1.25rem 1.3rem;
  border-radius: 0.35rem;
  border-top: 2px solid var(--ink);
  background: var(--parchment);
  box-shadow: none;
}

.study-word-identity[data-word-family="lexical"] {
  border-top-color: color-mix(in srgb, var(--ink) 72%, var(--parchment-3) 28%);
}

.study-word-identity-main {
  display: grid;
  gap: 0.1rem;
}

.study-word-identity-truth {
  max-width: 48rem;
  margin: 0.7rem 0 0;
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.55;
}

.study-word-identity-stats {
  padding-top: 0.9rem;
  border-top: 1px solid var(--parchment-3);
}

.study-word-identity-stats dd {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.study-word-translation-stats {
  gap: 0.9rem;
}

.study-word-book-distribution,
.study-word-evidence {
  padding: 1.1rem 1.3rem;
  border-radius: 0.35rem;
  background: var(--parchment);
  box-shadow: none;
}

.study-word-book-distribution {
  gap: 0.9rem;
}

.study-word-book-grid {
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 0.4rem;
}

.study-word-book-card {
  gap: 0.35rem;
  padding: 0.5rem 0.55rem;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
}

.study-word-book-card-head {
  font-size: 0.74rem;
}

.study-word-book-bar {
  height: 0.36rem;
}

.study-word-section-toggle {
  min-height: 2.15rem;
}

.study-word-evidence {
  gap: 0.95rem;
}

.study-word-evidence-row {
  padding: 1.05rem 0;
}

.study-word-evidence-head h4 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.study-word-evidence-verse {
  max-width: 72ch;
  font-size: 1rem;
  line-height: 1.8;
}

.study-word-continue {
  padding: 1rem;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--parchment) 94%, var(--ink) 6%);
}

.study-word-continue h4 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.study-word-continue-copy {
  margin: 0.6rem 0 0;
  color: var(--ink-2);
  font-size: 0.84rem;
  line-height: 1.6;
}

.study-word-continue-actions {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.study-word-continue-actions .study-word-action {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.study-word-mode .study-result-actions {
  gap: 0.45rem;
}

.study-word-mode .study-result-action {
  min-height: 40px;
}

@media (min-width: 1024px) {
  .study-word-rail {
    top: 1.25rem;
  }
}

@media (max-width: 767px) {
  .study-word-identity,
  .study-word-book-distribution,
  .study-word-evidence {
    padding-inline: 1rem;
  }

  .study-word-book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-word-identity-truth {
    margin-top: 0.55rem;
  }

  .study-word-evidence-row .study-result-actions,
  .study-word-occurrence-browser .study-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .study-word-evidence-row .study-result-action,
  .study-word-occurrence-browser .study-result-action {
    min-width: 0;
  }
}

/* English Word Search enrichment: keep the source boundary visible without
   implying an English-to-lemma mapping that the current index does not have. */
.study-word-original-mapping {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--parchment-3);
}

.study-word-original-mapping p {
  margin: 0;
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.55;
}

.study-word-original-mapping strong {
  color: var(--ink);
  font-weight: 650;
}

.study-word-source-note {
  color: var(--ink-4) !important;
  font-size: 0.74rem !important;
}

.study-word-division-summary {
  margin: 0.75rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid color-mix(in srgb, var(--parchment-3) 75%, transparent);
  color: var(--ink-3);
  font-size: 0.78rem;
  line-height: 1.5;
}

.study-word-division-summary strong {
  color: var(--ink-2);
  font-weight: 650;
}

@media (max-width: 767px) {
  .study-word-original-mapping {
    padding-top: 0.7rem;
  }
}

/* Search Scripture V3 Word/Lexical above-the-fold refinement. Keep the
   shared shell intact, but make the result-page form and identity read as a
   compact lead-in to the evidence below. Reference and Phrase workspaces do
   not receive this class or these layout rules. */
.study-word-mode {
  gap: 0.6rem;
}

.study-word-mode > .study-search-heading {
  padding-bottom: 0.4rem;
}

.study-word-mode .study-word-heading-note {
  margin-top: 0.2rem;
  font-size: 0.78rem;
  line-height: 1.35;
}

.study-word-mode > .study-search-form--compact {
  gap: 0.55rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 0.7rem;
  box-shadow: none;
}

.study-word-mode > .study-search-form--compact .study-search-query-row {
  gap: 0.5rem;
}

.study-word-mode > .study-search-form--compact .study-search-query-shell,
.study-word-mode > .study-search-form--compact .study-search-submit {
  min-height: 2.7rem;
}

.study-word-mode > .study-search-form--compact .study-search-query {
  min-height: 2.55rem;
}

.study-word-mode > .study-search-form--compact .study-search-help,
.study-word-mode > .study-search-form--compact .study-search-route,
.study-word-mode > .study-search-form--compact .study-search-note {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.study-word-mode > .study-search-form--compact .study-search-filters-bar {
  gap: 0.55rem;
  margin-top: 0;
  padding-top: 0.65rem;
}

.study-word-mode > .study-search-form--compact .study-search-control {
  gap: 0.25rem;
}

.study-word-mode > .study-search-form--compact .step-study-select,
.study-word-mode > .study-search-form--compact .study-search-clear-wrap > * {
  min-height: 2.45rem;
}

.study-word-main,
.study-word-rail {
  gap: 0.65rem;
}

.study-word-identity {
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
}

.study-word-identity-main {
  gap: 0.05rem;
}

.study-word-identity-truth {
  margin-top: 0.45rem;
  font-size: 0.74rem;
  line-height: 1.4;
}

.study-word-identity-stats {
  gap: 0.55rem;
  padding-top: 0.5rem;
}

.study-word-identity-stats dd {
  margin-top: 0.15rem;
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
}

.study-word-original-mapping {
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  padding-top: 0.45rem;
}

.study-word-original-mapping > .study-search-preview-summary-label {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: start;
  padding-top: 0.05rem;
}

.study-word-original-mapping > p:not(.study-search-preview-summary-label) {
  grid-column: 2;
}

.study-word-original-mapping p {
  font-size: 0.72rem;
  line-height: 1.3;
}

.study-word-source-note {
  font-size: 0.65rem !important;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.study-word-book-distribution,
.study-word-evidence {
  gap: 0.7rem;
  padding: 0.9rem 1rem;
}

.study-word-book-distribution {
  scroll-margin-top: 1rem;
}

.study-word-section-head {
  gap: 0.75rem;
  padding-bottom: 0.45rem;
}

.study-word-book-grid {
  gap: 0.3rem;
}

.study-word-book-card {
  padding: 0.45rem 0.5rem;
}

.study-word-insights {
  padding: 0.7rem 0.85rem 0.8rem;
}

.study-word-insights-summary {
  min-height: 2.1rem;
}

.study-word-insights-list {
  gap: 0.55rem;
  margin-top: 0.65rem;
}

@media (min-width: 768px) {
  .study-word-identity-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .study-word-mode > .study-search-form--compact {
    padding: 0.7rem;
  }

  .study-word-original-mapping {
    grid-template-columns: minmax(0, 1fr);
  }

  .study-word-original-mapping > .study-search-preview-summary-label {
    grid-column: auto;
    grid-row: auto;
  }

  .study-word-original-mapping > p:not(.study-search-preview-summary-label) {
    grid-column: auto;
  }

  .study-word-book-distribution,
  .study-word-evidence {
    padding-inline: 0.85rem;
  }
}

/* The shared Study shell has a deliberately specific rule for search-form
   surfaces. Match that scope here so the result-page compact treatment is
   applied reliably after the shell cascade, without affecting entry,
   Reference, or Phrase forms. */
#page-teachings.active .study-word-mode > .study-search-form--compact {
  gap: 0.55rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 0.7rem;
  box-shadow: none;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-query-shell,
#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-submit {
  min-height: 2.7rem;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-query {
  min-height: 2.55rem;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-help,
#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-route,
#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-note {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-filters-bar {
  gap: 0.55rem;
  margin-top: 0;
  padding-top: 0.65rem;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-control {
  gap: 0.25rem;
}

#page-teachings.active .study-word-mode > .study-search-form--compact .step-study-select,
#page-teachings.active .study-word-mode > .study-search-form--compact .study-search-clear-wrap > * {
  min-height: 2.45rem;
}

@media (max-width: 767px) {
  #page-teachings.active .study-word-mode > .study-search-form--compact {
    padding: 0.7rem;
  }

  #page-teachings.active .study-word-original-mapping {
    grid-template-columns: minmax(0, 1fr);
  }

  #page-teachings.active .study-word-original-mapping > .study-search-preview-summary-label {
    grid-column: auto;
    grid-row: auto;
  }

  #page-teachings.active .study-word-original-mapping > p:not(.study-search-preview-summary-label) {
    grid-column: auto;
  }
}

@media (min-width: 768px) {
  #page-teachings.active .study-word-mode .study-word-heading-note {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-filters-bar {
    grid-template-rows: minmax(0, auto);
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-control {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-control > span:first-child {
    flex: 0 0 auto;
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-control > .study-search-mode-control-wrap,
  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-control > .step-study-select {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Keep the first evidence section meaningfully visible on short desktop
   viewports. This only tightens existing Word/Lexical lead-in spacing; the
   mobile rhythm and all shared/reference/phrase layouts remain unchanged. */
@media (min-width: 768px) {
  #page-teachings.active .study-word-mode > .study-search-form--compact {
    gap: 0.4rem;
    padding-block: 0.5rem 0.55rem;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-query-shell,
  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-submit {
    min-height: 2.45rem;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-query {
    min-height: 2.3rem;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-filters-bar {
    padding-top: 0.45rem;
  }

  #page-teachings.active .study-word-mode > .study-search-form--compact .step-study-select,
  #page-teachings.active .study-word-mode > .study-search-form--compact .study-search-clear-wrap > * {
    min-height: 2.25rem;
  }

  #page-teachings.active .study-word-identity {
    gap: 0.4rem;
    padding-block: 0.55rem;
  }

  #page-teachings.active .study-word-identity-stats {
    padding-top: 0.35rem;
  }

  #page-teachings.active .study-word-original-mapping {
    padding-top: 0.3rem;
  }

  #page-teachings.active .study-word-original-mapping p {
    font-size: 0.68rem;
    line-height: 1.25;
  }
}

#page-teachings.active .study-word-mode > .study-search-form--compact :is(.study-search-help, .study-search-route, .study-search-note) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Compact mobile Bible reference: keep the page heading semantic, but give
   the reader row one bounded passage slot instead of two competing flex items. */
#page-teachings .reader-toolbar-page-title {
  flex: 0 0 auto;
}
#page-teachings .reader-toolbar-reference-mobile {
  display: none;
}

@media (max-width: 767px) {
  #page-teachings.active .study-page-header {
    width: calc(100% + 32px);
    max-width: none;
    margin-inline: -16px;
  }

  #page-teachings.active .reader-toolbar-main {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 52px repeat(3, 36px);
    grid-template-rows: 40px;
    align-items: center;
    gap: .25rem;
    min-height: 40px;
  }

  #page-teachings.active .reader-toolbar-page-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #page-teachings.active .reader-toolbar-reference-full,
  #page-teachings.active .reader-mode-help-group {
    display: none;
  }

  #page-teachings.active .reader-toolbar-reference-mobile {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-items: baseline;
    min-width: 0;
    gap: .35rem;
    overflow: visible;
    color: var(--study-ref-text);
    font: 700 .8rem/1 var(--sans);
    letter-spacing: .035em;
    white-space: nowrap;
  }

  #page-teachings.active .reader-toolbar-reference-book {
    flex: 0 0 auto;
    letter-spacing: .06em;
  }

  #page-teachings.active .reader-toolbar-reference-chapter,
  #page-teachings.active .reader-toolbar-reference-verse {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
  }

  #page-teachings.active .reader-toolbar-reference-separator {
    flex: 0 0 auto;
    color: var(--study-ref-text-soft);
    font-weight: 500;
    letter-spacing: 0;
  }

  #page-teachings.active .reader-toolbar-menu {
    grid-column: 1;
    grid-row: 1;
    width: 36px;
    min-width: 36px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
  }

  #page-teachings.active .compact-version-control {
    grid-column: 3;
    grid-row: 1;
    width: 52px;
    min-width: 0;
    height: 40px;
    flex: none;
  }

  #page-teachings.active .compact-version-control .teach-version-select {
    width: 52px;
    height: 40px;
    min-height: 40px;
    padding-inline: .35rem;
    font-size: .72rem;
  }

  #page-teachings.active .reader-toolbar-chapter-controls {
    display: contents;
  }

  #page-teachings.active .reader-toolbar-chapter-controls .teach-chap-btn {
    grid-row: 1;
    width: 36px;
    min-width: 36px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  #page-teachings.active #teach-prev-chap { grid-column: 4; }
  #page-teachings.active #teach-next-chap { grid-column: 5; }

  #page-teachings.active .reader-more-toggle {
    grid-column: 6;
    grid-row: 1;
    width: 36px;
    min-width: 36px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }
}

/* Keep contextual Help circular, but make the visible mark quieter than the
   mode selector while retaining a practical keyboard and touch target. */
#page-teachings .reader-mode-help-group > .keryg-help-trigger,
#page-teachings .reader-more-help-slot > .keryg-help-trigger {
  position: relative;
  box-sizing: border-box;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  transform: none;
}
#page-teachings .reader-mode-help-group > .keryg-help-trigger::before,
#page-teachings .reader-more-help-slot > .keryg-help-trigger::before {
  position: absolute;
  inset: 7px;
  content: '';
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--color-surface-raised);
}
#page-teachings .reader-mode-help-group > .keryg-help-trigger > span,
#page-teachings .reader-more-help-slot > .keryg-help-trigger > span {
  position: relative;
  z-index: 1;
  font-size: .72rem;
  line-height: 1;
}
#page-teachings .reader-mode-help-group > .keryg-help-trigger:hover,
#page-teachings .reader-more-help-slot > .keryg-help-trigger:hover {
  background: transparent;
  color: var(--ink);
  transform: none;
}
#page-teachings .reader-mode-help-group > .keryg-help-trigger:hover::before,
#page-teachings .reader-more-help-slot > .keryg-help-trigger:hover::before {
  border-color: var(--ink-3);
  background: var(--parchment-2);
}
#page-teachings .reader-mode-help-group > .keryg-help-trigger:focus-visible,
#page-teachings .reader-more-help-slot > .keryg-help-trigger:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 48%, transparent);
  outline-offset: 1px;
}
/* Standard Interlinear keeps its Selected Reference data in the existing
   inspector, but presents that one inspector as the Study bottom sheet on
   compact phone and tablet viewports. Parallel layouts do not render this
   hook. */
@media (max-width: 1023px) {
  #page-teachings.active .interlinear-inspector-mobile-callup {
    z-index: 349;
  }

  #page-teachings.active .interlinear-inspector-mobile-trigger {
    width: min(100%, 20rem);
    min-height: 2.75rem;
    border-color: var(--color-border-strong);
    background: var(--color-surface-raised);
    color: var(--color-text-secondary);
  }

  #page-teachings.active .interlinear-inspector-mobile-layer {
    z-index: 370;
  }

  #page-teachings.active .interlinear-inspector-mobile-sheet {
    height: calc(90vh - env(safe-area-inset-bottom, 0px));
    max-height: calc(90vh - env(safe-area-inset-bottom, 0px));
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  #page-teachings.active .interlinear-inspector-mobile-sheet-body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  #page-teachings.active .interlinear-inspector-mobile-sheet-body > .interlinear-inspector {
    position: static !important;
    inset: auto;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  #page-teachings.active .interlinear-inspector-mobile-sheet-body .study-inspector-shell {
    min-width: 0;
  }
}

/* Editorial Reading refinement. Keep the approved Reader surface and state
   model, but let Scripture carry the visual hierarchy instead of repeated
   cards and equally weighted controls. */
#page-teachings.active .reader-layout-toolbar {
  width: min(100%, 980px);
  max-width: 980px;
  margin-bottom: 1.15rem;
  padding-inline: clamp(20px, 4vw, 56px);
}

#page-teachings.active .reader-layout-controls {
  width: min(100%, 980px);
  max-width: 980px;
  margin: 0 auto 1.15rem;
}

#page-teachings.active .reader-layout-controls .reader-layout-toolbar {
  width: 100%;
  max-width: none;
  margin: 0;
}

#page-teachings.active .reader-layout-label {
  color: var(--color-text-muted);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
}

#page-teachings.active .reader-layout-selector {
  gap: 0;
  padding: 0.18rem;
  border-color: color-mix(in srgb, var(--color-border) 82%, transparent);
  background: transparent;
}

#page-teachings.active .reader-layout-option {
  min-height: 34px;
  min-width: 5.25rem;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  color: var(--color-text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-transform: none;
}

#page-teachings.active .reader-layout-option.is-active {
  background: color-mix(in srgb, var(--color-brand) 88%, var(--color-surface-raised));
  color: var(--color-text-inverse);
  box-shadow: none;
}

#page-teachings.active .reading-passage.paragraph .reader-paragraph {
  max-width: 68ch;
  font-size: clamp(1.08rem, 1.25vw, 1.2rem);
  line-height: 1.82;
  letter-spacing: 0;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline {
  padding: 0.02rem 0.04rem;
  border-radius: 0.16rem;
  white-space: pre-line;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline.is-selected {
  padding-inline: 0.18rem;
  background: color-mix(in srgb, var(--color-brand) 11%, transparent);
}

#page-teachings.active .reading-passage.paragraph .reader-verse-number-target {
  color: var(--color-text-secondary);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-text {
  white-space: normal;
}

#page-teachings.active .reading-passage.verse {
  max-width: 72ch;
}

#page-teachings.active .reading-passage.verse .reader-verse-anchor {
  display: none;
}

#page-teachings.active .reading-passage.verse .reader-verse:not(.reader-verse-missing) {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  min-width: 0;
  margin: 0;
  padding: 0.68rem 0 0.76rem;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: default;
  line-height: 1.72;
}

#page-teachings.active .reading-passage.verse .reader-verse-number-target {
  display: inline-flex;
  grid-column: 1;
  grid-row: 1;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  min-height: 1.45rem;
  margin: 0;
  padding: 0.16rem 0 0;
  color: var(--color-text-secondary);
  font-size: 0.68rem;
  line-height: 1.2;
  vertical-align: baseline;
}

#page-teachings.active .reading-passage.verse .reader-verse-text {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  white-space: pre-line;
}

#page-teachings.active .reading-passage.verse .reader-verse-num {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.68rem;
}

#page-teachings.active .reading-passage.verse .reader-verse.is-selected {
  margin-inline: -0.6rem;
  padding-inline: 0.6rem;
  border-bottom-color: transparent;
  border-radius: 0.18rem;
  background: color-mix(in srgb, var(--color-brand) 11%, transparent);
  box-shadow: inset 3px 0 0 var(--color-brand);
}

#page-teachings.active .reading-passage.verse .reader-verse-missing {
  margin: 0;
  padding: 0.72rem 0;
  border: 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--color-border) 86%, transparent);
  border-left: 3px solid var(--color-brand);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#page-teachings.active .reading-selected-reference-body {
  padding: 0.15rem 1.1rem 1.15rem;
}

#page-teachings.active .reading-selected-reference {
  display: grid;
  gap: 1rem;
}

#page-teachings.active .reading-selected-reference-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.15rem;
  margin-top: 0.15rem;
}

#page-teachings.active .reading-selected-reference-utilities,
#page-teachings.active .reading-selected-reference-explore {
  min-width: 0;
  width: 100%;
}

#page-teachings.active .reading-selected-reference-text {
  display: grid;
  gap: 1.05rem;
}

#page-teachings.active .reading-selected-reference-selected-text {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--color-text-secondary);
  font: 0.9rem/1.58 var(--serif);
}

#page-teachings.active .reading-selected-reference-selected-text strong,
#page-teachings.active .reading-selected-reference-translation {
  display: block;
  margin-bottom: 0.32rem;
  color: var(--color-text-secondary);
  font: 700 0.64rem/1.2 var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#page-teachings.active .reading-selected-reference-verse {
  display: grid;
  gap: 0.35rem;
}

#page-teachings.active .reading-selected-reference-translation {
  margin: 0;
}

#page-teachings.active .reading-selected-reference-verse-text {
  margin: 0;
  color: var(--color-text);
  font: clamp(1.08rem, 1.5vw, 1.24rem)/1.65 var(--serif);
  white-space: pre-line;
}

#page-teachings.active .reading-selected-reference-utilities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

#page-teachings.active .reading-selected-reference-utilities .teach-tool-btn {
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
  box-shadow: none;
}

#page-teachings.active .reading-selected-reference-utilities .teach-tool-btn:hover,
#page-teachings.active .reading-selected-reference-utilities .teach-tool-btn:focus-visible {
  border-color: var(--color-border-strong);
  background: color-mix(in srgb, var(--color-brand) 7%, transparent);
  color: var(--color-text);
}

#page-teachings.active .reading-selected-reference-explore {
  border-top: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent);
}

#page-teachings.active .reading-selected-reference-explore-label {
  margin: 0;
  padding: 0.9rem 0 0.4rem;
  color: var(--color-text-muted);
  font: 700 0.64rem/1.2 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#page-teachings.active .reading-selected-reference-explore-list {
  display: grid;
}

#page-teachings.active .reading-selected-reference-explore-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 0.55rem 0;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 72%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font: 600 0.9rem/1.35 var(--sans);
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  box-shadow: none;
}

#page-teachings.active .reading-selected-reference-explore-action::after {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  color: var(--color-brand);
  flex: 0 0 auto;
  transform: rotate(45deg);
}

#page-teachings.active .reading-selected-reference-explore-action:hover,
#page-teachings.active .reading-selected-reference-explore-action:focus-visible {
  background: color-mix(in srgb, var(--color-brand) 7%, transparent);
  color: var(--color-text-heading);
}

#page-teachings.active .reading-selected-reference-status:empty {
  display: none;
}

/* Compare reads as one parallel passage: canonical rows remain aligned, but
   the repeated card treatment gives way to typography and quiet dividers. */
#page-teachings.active .study-surface.is-reading-compare {
  border-radius: 0.85rem;
  --reading-comparison-tail-runway: 0px;
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-head {
  padding: 0.9rem 1.25rem 0.8rem;
  border-bottom-color: color-mix(in srgb, var(--color-border) 84%, transparent);
  background: var(--color-study-surface);
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-back {
  min-height: 40px;
  padding-inline: 0.2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 0.76rem;
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-back:hover,
#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-back:focus-visible {
  background: transparent;
  color: var(--color-text-heading);
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-controls {
  padding: 0.7rem 1.25rem;
  border-bottom-color: color-mix(in srgb, var(--color-border) 78%, transparent);
  background: color-mix(in srgb, var(--color-study-surface) 94%, var(--color-brand) 6%);
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-select-label select {
  border-radius: 0.55rem;
  background: transparent;
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-rows {
  gap: 0;
  padding: 0.15rem 1.25rem calc(1.25rem + var(--reading-comparison-tail-runway, 0px));
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-row {
  grid-template-columns: 2.45rem minmax(0, 1fr) minmax(0, 1fr);
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent);
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-row.is-selected {
  border-color: color-mix(in srgb, var(--color-brand) 14%, transparent);
  background: color-mix(in srgb, var(--color-brand) 10%, transparent);
  box-shadow: inset 3px 0 0 var(--color-brand);
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-verse {
  padding: 0.95rem 0.25rem;
  background: transparent;
  color: var(--color-text-muted);
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-side {
  padding: 0.9rem 0.95rem 1rem;
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-side-label {
  margin-bottom: 0.38rem;
  color: var(--color-text-secondary);
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-text {
  font-size: 1.02rem;
  line-height: 1.68;
}

#page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-missing {
  border-radius: 0.2rem;
  background: transparent;
}

@media (max-width: 1023px) {
  #page-teachings.active .reading-selected-reference-body {
    padding-inline: 0.95rem;
  }

  #page-teachings.active .reading-passage.verse .reader-verse:not(.reader-verse-missing) {
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-head,
  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-controls {
    padding-inline: 0.9rem;
  }

  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-rows {
    padding-inline: 0.9rem;
  }

  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-row {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 0.35rem;
  }

  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-verse {
    grid-row: auto;
    align-items: center;
    padding: 0.55rem 0 0.35rem;
  }

  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-side {
    grid-column: auto;
    padding: 0.62rem 0 0.72rem;
  }

  #page-teachings.active .study-surface.is-reading-compare .reading-chapter-comparison-side + .reading-chapter-comparison-side {
    border-top-color: color-mix(in srgb, var(--color-border) 76%, transparent);
  }
}

@media (max-width: 680px) {
  #page-teachings.active .reader-layout-toolbar {
    padding-inline: clamp(20px, 5vw, 28px);
  }

  #page-teachings.active .reader-layout-option {
    min-width: 4.75rem;
  }
}

/* Paragraph mode is one flowing text measure. The verse wrapper must not
   preserve the template whitespace around its inline controls; poetry and
   source line breaks remain preserved inside the text span itself. */
#page-teachings.active .reading-passage.paragraph .reader-verse-inline {
  white-space: normal;
  overflow-wrap: normal;
  vertical-align: baseline;
}

#page-teachings.active .reading-passage.paragraph .reader-verse-inline .reader-verse-text {
  white-space: pre-line;
}

/* On desktop, Selected Reference is a companion column to the Scripture
   measure. Compare intentionally keeps its existing full-surface treatment. */
@media (min-width: 1024px) {
  #page-teachings.active .reader-layout-controls {
    width: 100%;
    max-width: none;
    margin: 0 0 1.15rem;
  }

  #page-teachings.active .reader-layout-controls .reader-layout-toolbar {
    justify-content: flex-end;
    padding-inline: 0;
  }

  #page-teachings.active .reader-layout-controls .reader-layout-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  #page-teachings.active #verse-panel:has(> #study-surface.is-reading-side-panel:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 32.5rem);
    grid-template-rows: auto auto;
    align-items: start;
    column-gap: clamp(1.25rem, 3vw, 3rem);
    row-gap: 1.15rem;
    padding-top: 1.55rem;
  }

  #page-teachings.active #verse-panel:has(> #study-surface.is-reading-side-panel:not([hidden])) > .study-content-layout.is-reading-mode {
    display: contents;
    min-width: 0;
  }

  #page-teachings.active #verse-panel:has(> #study-surface.is-reading-side-panel:not([hidden])) > .study-content-layout.is-reading-mode > .reader-layout-controls {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
  }

  #page-teachings.active #verse-panel:has(> #study-surface.is-reading-side-panel:not([hidden])) > .study-content-layout.is-reading-mode > .reading-workspace {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  #page-teachings.active #verse-panel > #study-surface.is-reading-side-panel {
    position: sticky;
    grid-column: 2;
    grid-row: 2;
    top: 7rem;
    right: auto;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 8.5rem);
    overflow: auto;
    border-radius: 0.85rem;
    box-shadow: 0 12px 30px var(--color-shadow);
  }
}

/* Keep the appearance scale after the existing Reading presentation rules so
   the default value remains identical while small/large can take effect. */
#page-teachings.active .reading-passage.paragraph .reader-paragraph {
  font-size: calc(1.125rem * var(--keryg-reading-text-scale, 1));
}

#page-teachings.active .reading-passage.verse .reader-verse {
  font-size: calc(1.22rem * var(--keryg-reading-text-scale, 1));
}
