#table-of-contents {
    display: block;
    height: fit-content;
    width: fit-content;
}

#toc-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* max-height: 42vh;
    max-width: 30vw; */
}

/* Add some padding to prevent scroll bar from overlapping content */
#toc-body > .nested {
    display: block;
    padding-right: 10px;
}
/* Add some padding to prevent scroll bar from overlapping content */
#table-of-contents > .nested {
    display: block;
    padding-right: 10px;
}

.toc-container {
    display: flex;
    flex-direction: column;
}

.toc-header {
    padding: 0px 4px 4px 2em;
    border-bottom: 1px solid #ddd;
    margin-bottom: 4px;
    margin-top: -2em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
    text-wrap: nowrap;
    overflow: hidden;
}

.nested {
    display: none;
    margin-left: 20px;
    list-style-type: none;
    padding-inline-start: 10px;
}

.nested.active {
    display: block;
}

/* Optional: Style the scrollbar for webkit browsers */
#table-of-contents::-webkit-scrollbar {
    width: 8px;
}

#toc-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}
#toc-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}
#toc-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.caret {
    cursor: pointer;
    user-select: none;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.caret::before {
    content: "\25B6";
    display: inline-block;
    margin-right: 6px;
}

.caret-down::before {
    transform: rotate(90deg);
}

.caret.unlabeled::before {
    content: "\25b7";
}

.bullet {
    cursor: pointer;
    user-select: none;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.bullet::before {
    content: "\25CF";
    display: inline-block;
    margin-right: 6px;
}

.bullet.unlabeled::before {
    content: "\25CB";
}

li {
    list-style-type: none;
    margin: 5px 0;
}

/* table of contents buttons */
.toc-btn {
    border: none; /* Remove borders */
    color: white; /* White text */
    padding: 2px 4px;
    border-radius: 5px;
    cursor: pointer; /* Mouse pointer on hover */
    margin-right:5px;
}

/* Darker background on mouse-over */
.toc-btn:hover {
    background-color: RoyalBlue;
}

/* table of contents labels */
.toc-label {
    border: none; /* Remove borders */
    cursor: pointer; /* Mouse pointer on hover */
}

/* Darker background on mouse-over */
.toc-label:hover {
    text-decoration: underline;
}

.expand-all-btn {
    padding: 4px 8px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background: #3ba5e7;
    color: white;
}

.expand-all-btn:hover {
    text-decoration: underline;
}

/* Highlight styling */
.highlighted {
    opacity: 1.0;
    transition: opacity 0.3s ease;
}

.toc-close-btn {
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    padding: 0px 02px;
    cursor: pointer;
    transform: rotate(270deg);
    transition: transform 0.25s ease-in-out;
    margin: -2px;
    background: none;
    color: inherit;
}

.toc-close-btn.closed {
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    padding: 0px 0px;
    cursor: pointer;
    transition: transform 0.25s ease-in-out;
    transform: rotate(90deg);
    margin: -2px;
    background: none;
    color: inherit;
}