/* --------------------------------------------------
Core Tocbot element styling (unchanged)
-------------------------------------------------- */
.toc {
  overflow-y: auto;
}

.toc>.toc-list {
  overflow: hidden;
  position: relative;
}

.toc>.toc-list li {
  list-style: none;
}

.toc-list {
  margin: 0;
  padding-left: 10px;
}

a.toc-link {
  color: currentColor;
  height: 100%;
}

.is-collapsible {
  max-height: 1000px;
  overflow: hidden;
  transition: all 300ms ease-in-out;
}

.is-collapsed {
  max-height: 0;
}

.is-collapsed:has(:focus) {
  max-height: 1000px;
}

.is-position-fixed {
  position: fixed !important;
  top: 0;
}

.is-active-link {
  font-weight: 700;
}

.toc-link::before {
  background-color: #eee;
  content: " ";
  display: inline-block;
  height: inherit;
  left: 0;
  margin-top: -1px;
  position: absolute;
  width: 2px;
}

.is-active-link::before {
  background-color: #1C355E;
}

/* --------------------------------------------------
CUSTOM  ODOT  TOC CONTAINER  (RIGHT-SIDE FLOAT)
-------------------------------------------------- */
:root {
  --toc-top: 300px;
  /* updated by JS on scroll */
  --toc-left: 0px;
  /* updated by JS when docked */
}

/* Default = slide-out mode (not enough room beside the content) */
#toc-toggle {
  display: block;
  position: fixed;
  top: var(--toc-top);
  right: 20px;
  z-index: 10000;
}

#toc-container {
  box-sizing: border-box;
  position: fixed;
  top: calc(var(--toc-top) + 50px);
  right: 20px;
  width: max-content;
  /* as wide as the text needs... */
  max-width: 360px;
  /* ...up to this limit, then headings wrap */
  max-height: calc(100vh - var(--toc-top) - 70px);
  overflow-y: auto;
  padding: 15px;
  background: #f8f8f8;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  z-index: 9999;

  /* closed state (slide-out mode) */
  transform: translateX(calc(100% + 40px));
  visibility: hidden;
  transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

#toc-container.open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s ease, visibility 0s;
}

/* Docked mode = enough room to the right of the content */
.toc-docked #toc-toggle {
  display: none;
}

.toc-docked #toc-container {
  top: var(--toc-top);
  left: var(--toc-left);
  right: auto;
  max-height: calc(100vh - var(--toc-top) - 20px);
  transform: none;
  visibility: visible;
  transition: none;
}

#toc-container .toc {
  font-size: 14px;
}

#toc-container .toc ul {
  list-style-type: none;
  padding-left: 10px;
}

#toc-container .toc li {
  margin: 4px 0;
}

#toc-container .toc a {
  text-decoration: none;
  color: #1C355E;
}

#toc-container .toc a:hover {
  text-decoration: underline;
}

.chapter-nav {
  padding: 10px 0;
  border-bottom: none;
  margin-bottom: 10px;
}
.chapter-prev {
  border-top: none;
  border-bottom: 1px solid #ddd;
  margin-top: 0px;
  padding-top: 0px;
  
}
.chapter-next {
  border-top: 1px solid #ddd;
  border-bottom: none;
  margin-top: 20px;
  padding-top: 10px;
  
}

.chapter-nav a {
  display: block;
  color: #1C355E;
 font-weight: 600;
  text-decoration: none;
}

.chapter-nav a:hover {
  text-decoration: underline;
}

/* Expand a collapsed group when hovering over it (or tabbing into it) */
@media (hover: hover) {
  #toc-container .toc-list-item:hover>.is-collapsed {
    max-height: 1000px;
  }
}

#toc-container .toc-list-item:focus-within>.is-collapsed {
  max-height: 1000px;
}
/* Pin Full Manual (top) and Back to Top (bottom); only the TOC list scrolls */
#toc-container {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#toc-container .toc {
  flex: 1 1 auto;
  min-height: 0;
  /* lets the middle section shrink and scroll */
  overflow-y: auto;
}

#toc-container .chapter-nav {
  flex: 0 0 auto;
  /* top and bottom links never get squeezed out */
}
