/* Section navigation (toc.js): button in the top bar + grouped dropdown. */
.toc-toggle { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 13px; border: 1px solid #a98a484d; background: #0e0c0a66;
  color: #e9d9b5; font: 12px var(--body, inherit); letter-spacing: .06em; cursor: pointer; white-space: nowrap; }
.toc-toggle svg { width: 14px; height: 11px; flex-shrink: 0; color: var(--gold); }
.toc-toggle:hover, .toc-toggle[aria-expanded="true"] { border-color: #c4a35e; color: var(--gold); }
.toc-name { text-transform: uppercase; }
.toc-current:not(:empty)::before { content: '·'; margin-right: 9px; color: #8a7a5c; }
.toc-current { max-width: 170px; overflow: hidden; text-overflow: ellipsis; color: var(--gold); }
.toc-panel { position: absolute; top: calc(100% + 1px); left: 50%; transform: translateX(-50%); width: min(960px, calc(100vw - 24px));
  max-height: calc(100svh - var(--nav-height) - 24px); overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 22px;
  padding: 22px 26px; background: #15110cf7; border: 1px solid #5a4a33aa; border-top: 0; box-shadow: 0 18px 40px #000a; backdrop-filter: blur(14px); }
.toc-panel[hidden] { display: none; }
.toc-group p { margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid #9d784040; font: 500 13px var(--display); color: var(--gold); letter-spacing: .05em; }
.toc-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc-group a { display: block; padding: 5px 8px; color: #d8cbb0; font-size: 13.5px; text-decoration: none; border-left: 2px solid transparent; }
.toc-group a:hover, .toc-group a:focus-visible { color: #f6dc9c; background: #ffffff08; }
.toc-group a[aria-current] { color: var(--gold); border-left-color: var(--gold); background: #c4a35e14; }
@media (max-width: 1100px) { .toc-current { display: none; } }
@media (max-width: 560px) {
  .toc-toggle { padding: 0 10px; }
  .toc-name { display: none; }
  .toc-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px; width: calc(100vw - 16px); }
}

/* floating left card on wide screens (toc.js renderSide); overlays the page edge, content width unchanged */
.toc-rail { display: none; }
@media (min-width: 1100px) {
  .presentation-nav .toc { display: none; }   /* the floating card replaces the top button here */
  .toc-rail { position: fixed; z-index: 80; left: 14px; top: 50%; transform: translateY(-50%); display: grid; gap: 1px; width: 168px; padding: 8px 6px 8px;
    border: 1px solid #8a704688; background: #0f0c09eb; box-shadow: 0 6px 22px #000a; backdrop-filter: blur(8px);
    transition: opacity .3s, transform .3s, visibility .3s; }
  .toc-rail.is-away { opacity: 0; visibility: hidden; transform: translate(-16px, -50%); }
  .toc-rail-fold { position: absolute; top: 6px; right: -13px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid #8a7046;
    border-radius: 50%; background: #1b140d; color: #e2c98d; cursor: pointer; }
  .toc-rail-fold:hover { border-color: #e2c98d; }
  .toc-rail-fold svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .toc-rail a { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .toc-rail-title { padding: 6px 8px; color: #cbbd9f; font: 500 12.5px/1.2 var(--display); letter-spacing: .03em; }
  .toc-rail-title:hover, .toc-rail-title:focus-visible { color: #f6dc9c; background: #ffffff08; }
  .toc-rail-group.is-here .toc-rail-title { color: var(--gold); }
  .toc-rail-dot { flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: #8a7a5c; }
  .toc-rail-group.is-here .toc-rail-dot { background: var(--gold); box-shadow: 0 0 8px #e2c98d99; }
  .toc-rail ul { list-style: none; display: grid; gap: 1px; margin: 0 0 4px 11px; padding: 0 0 0 8px; border-left: 1px solid #5a4a33; }
  .toc-rail li a { padding: 4px 8px; color: #b9a984; font-size: 12px; }
  .toc-rail li a:hover, .toc-rail li a:focus-visible { color: #f6dc9c; background: #ffffff08; }
  .toc-rail li a[aria-current] { color: #f6dc9c; background: #c4a35e1c; }
  .toc-rail.is-folded { width: 22px; padding: 34px 0 8px; }
  .toc-rail.is-folded .toc-rail-title { justify-content: center; padding: 7px 0; }
  .toc-rail.is-folded .toc-rail-title span:last-child, .toc-rail.is-folded ul { display: none; }
  .survivors-badge { left: auto; right: max(24px, env(safe-area-inset-right)); }
}
