.toc-toggle {
    width: 100%;               /* растягивается на весь экран */
    display: flex;
    align-items: center;
    justify-content: space-between;  /* иконка справа */
    padding: 12px 8px;
    background: var(--color-background-secondary);
    border: none;
    border-bottom: 0.5px solid var(--color-border-tertiary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.toc-toggle .toc-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toc-bar {
    position: sticky;
    top: var(--header-height);
    z-index: 10;
    background: #fff;
    box-shadow: inset 0 -1px 0 #0000001a;
    
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.toc-bar.visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.toc-menu {
    overflow: hidden;
    max-height: 0;              
    transition: max-height 0.25s ease; 
}

.toc-menu.open {
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow: auto;
}

.toc-chevron {
  transition: transform 0.2s;
}

.toc-chevron.open {
  transform: rotate(180deg);
}

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

.toc-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}

.toc-list a:hover {
  color: var(--bs-primary);
}

