#toc-pane {
    display: flex;
    flex-direction: column;
    height: fit-content;
    position: sticky;
    top: 0;
    order: 3;
    transition: width 0.3s ease, margin-right 0.3s ease;
    width: 250px;
    flex-shrink: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding-top: 20px;
    z-index: 1;
    background: var(--background-primary);
}

.toc-pane-collapsed #toc-pane {
    width: 0;
    overflow: hidden;
}

.toc-pane-collapsed #toc-pane h3,
.toc-pane-collapsed #toc-pane #toc {
    display: none;
}

#toc-pane h3 {
    text-transform: uppercase;
}

#toc {
    position: relative;
    height: fit-content;
    margin: 0;
    border-radius: 6px;
    padding: 0 0 0 16px;
    max-width: 100%;
}

#toc, #toc ul {
    list-style: none;
}

#toc ul {
    padding-left: 16px;
}

#toc span {
    text-overflow: ellipsis;
    overflow: hidden;
    display: inline-block;
}

#toc li a {
/*         position: relative; */
    display: flex;
    align-items: center;
    color: var(--text-heading);
    transition: color 200ms ease;
    white-space: nowrap;
}

#toc li a:hover,
#toc li a.active {
    color: var(--text-link);
    text-decoration: none;
}

#toc li a::before {
    content: "";
    display: flex;
    position: absolute;
    width: 2px;
    height: 16px;
    background: transparent;
    left: 0;
    transition: background-color 200ms ease;
}

#toc li a.active::before {
    background: var(--text-link);
}

#toc::before {
    content: "";
    display: block;
    position: absolute;
    left: 0px;
    top: 4px;
    width: 2px;
    height: calc(100% - 8px);
    background: var(--background-highlight);
}

#content h1 a.toc-anchor,
#content h2 a.toc-anchor,
#content h3 a.toc-anchor,
#content h4 a.toc-anchor,
#content h5 a.toc-anchor,
#content h6 a.toc-anchor {
    margin-left: 10px;
}
