/* All rules stay inside this enhancement; inline and desktop TOCs are untouched. */
#ctst-floating-toc { display:none; }
@media (max-width:767px) {
  #ctst-floating-toc:not([hidden]) { display:block; position:fixed; left:max(16px, env(safe-area-inset-left)); bottom:calc(16px + env(safe-area-inset-bottom)); z-index:9990; font-family:inherit; }
  #ctst-floating-toc [hidden] { display:none !important; }
  #ctst-floating-toc .ctst-toc-toggle { display:block; min-height:44px; max-width:calc(100vw - 100px); padding:11px 18px; border:1px solid #fff; border-radius:24px; background:#0e7e88; color:#fff; font-size:15px; font-weight:700; line-height:1.4; box-shadow:0 3px 14px #10263030; cursor:pointer; }
  #ctst-toc-panel { position:absolute; bottom:calc(100% + 10px); left:0; width:min(360px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right))); max-height:min(60vh, calc(100dvh - var(--ctst-toc-top, 160px) - 90px - env(safe-area-inset-bottom))); overflow:auto; overscroll-behavior:contain; background:#fff; border:1px solid #d5e5e8; border-radius:14px; box-shadow:0 4px 24px #10263030; color:#122630; }
  #ctst-floating-toc .ctst-toc-top { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 12px 8px 18px; border-bottom:1px solid #d5e5e8; }
  #ctst-floating-toc .ctst-toc-top button { padding:0; width:44px; height:44px; flex:0 0 44px; border:0; border-radius:8px; background:#edf7f8; color:#086e78; font-size:28px; cursor:pointer; }
  #ctst-floating-toc ul { margin:0; padding:8px; list-style:none; }
  #ctst-floating-toc li { margin:0; padding:0; list-style:none; }
  #ctst-floating-toc a { display:block; padding:12px 10px; min-height:44px; box-sizing:border-box; color:#005d6c; font-size:15px; line-height:1.45; text-decoration:none; border-radius:6px; overflow-wrap:anywhere; }
  #ctst-floating-toc a:hover, #ctst-floating-toc a[aria-current] { background:#e7f4f5; color:#064a52; }
  #ctst-floating-toc a[aria-current] { font-weight:700; }
  #ctst-floating-toc :focus-visible { outline:3px solid #097f8c; outline-offset:2px; }
}
