.tb-fathers-side-toc {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  align-items: stretch;
  /* fathers.html has a legacy bare `nav { backdrop-filter: blur(10px) }`
     rule from before tb-bible-nav.js replaced the old navbar — this
     element is a <nav> too, and backdrop-filter silently establishes a
     containing block for fixed-position descendants, trapping the panel
     inside this box instead of the viewport. Must stay neutralized. */
  backdrop-filter: none;
  filter: none;
}
.tb-fathers-side-toc-hidden { display: none; }
.tb-fathers-side-toc-tab {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--cinzel);
  font-size: .62rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold, #C9A24D);
  background: rgba(8, 8, 8, .92);
  border: 1px solid var(--gold-border, rgba(201, 162, 77, .2));
  border-right: 0;
  border-radius: 6px 0 0 6px;
  padding: 1rem .55rem;
  cursor: pointer;
}
.tb-fathers-side-toc-tab:hover { color: #ead184; }
.tb-fathers-side-toc-panel {
  display: none;
  max-height: 70vh;
  overflow-y: auto;
  background: rgba(6, 6, 6, .97);
  border: 1px solid var(--gold-border, rgba(201, 162, 77, .2));
  border-right: 0;
  border-radius: 6px 0 0 6px;
  min-width: 250px;
  box-shadow: -12px 0 32px rgba(0, 0, 0, .45);
}
.tb-fathers-side-toc.open .tb-fathers-side-toc-panel { display: block; }
.tb-fathers-side-toc-panel ul { list-style: none; margin: 0; padding: .5rem 0; }
.tb-fathers-side-toc-panel a {
  display: block;
  padding: .6rem 1.1rem;
  color: var(--text-dim, #aaa18c);
  font-family: var(--crimson), serif;
  font-size: .86rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.tb-fathers-side-toc-panel li:last-child a { border-bottom: 0; }
.tb-fathers-side-toc-panel a:hover,
.tb-fathers-side-toc-panel a.active { color: var(--gold, #C9A24D); background: rgba(201, 162, 77, .08); }
/* Below 640px there's no room for a right-edge flyout without overlapping
   content, and vertical writing-mode text is a poor touch target — instead
   this becomes a small round button pinned above the corner, opening a
   full-width bottom sheet (same nav/tab/panel elements, no JS changes). */
@media (max-width: 640px) {
  .tb-fathers-side-toc {
    top: auto;
    /* Stacks above the page's existing "My Study" FAB (tb-fathers-study.css:
       right 18px, bottom 18px+62px, ~41px tall) rather than overlapping it —
       both use the same safe-area-aware offset convention. */
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(max(18px, env(safe-area-inset-bottom)) + 118px);
    transform: none;
    flex-direction: column-reverse;
    align-items: flex-end;
  }
  .tb-fathers-side-toc-tab {
    writing-mode: horizontal-tb;
    text-orientation: initial;
    border: 1px solid var(--gold-border, rgba(201, 162, 77, .2));
    border-radius: 999px;
    padding: .75rem 1.15rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
  }
  .tb-fathers-side-toc-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    width: 100%;
    max-height: 60vh;
    min-width: 0;
    border: 1px solid var(--gold-border, rgba(201, 162, 77, .2));
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -12px 32px rgba(0, 0, 0, .5);
  }
  .tb-fathers-side-toc-panel a { padding: .9rem 1.2rem; font-size: .95rem; }
}
