.mani-toc-container {
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: table; /* Shrink to fit */
    min-width: 200px;
}

.mani-toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.mani-toc-title {
    font-weight: bold;
    font-size: 1.1em;
}

.mani-toc-toggle-btn {
    text-decoration: none;
    font-size: 0.9em;
    color: #0073aa;
    cursor: pointer;
}

.mani-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mani-toc-item {
    margin-bottom: 5px;
}

.mani-toc-item a {
    text-decoration: none;
    color: #333;
}

.mani-toc-item a:hover {
    color: #0073aa;
    text-decoration: underline;
}

.mani-toc-item a.mani-toc-active {
    color: #0073aa;
    font-weight: bold;
    border-left: 2px solid #0073aa;
    padding-left: 5px;
}

/* Indentation based on levels */
.mani-toc-level-3 { margin-left: 20px; }
.mani-toc-level-4 { margin-left: 40px; }
.mani-toc-level-5 { margin-left: 60px; }
.mani-toc-level-6 { margin-left: 80px; }

/* Sticky Mode */
.mani-toc-container.mani-toc-sticky {
    position: sticky;
    top: 20px; /* Offset from top */
    z-index: 999;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Back to Top Button */
.mani-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background: #0073aa;
    color: #fff;
    text-align: center;
    line-height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: none; /* Hidden by default, JS will show it */
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 20px;
    transition: background 0.3s;
}

.mani-back-to-top:hover {
    background: #005177;
}
