/* ─── HTR Table of Contents ─────────────────────────────────────────────── */

.htr-toc {
    background: #f0f7f4;
    border: 1px solid #c8e6c9;
    border-left: 4px solid #388e3c;
    border-radius: 6px;
    padding: 14px 18px 16px;
    margin: 0 0 28px;
    max-width: 660px;
    font-size: 0.94em;
    line-height: 1.55;
    box-sizing: border-box;
}

/* Header row */
.htr-toc__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.htr-toc__title {
    font-weight: 700;
    font-size: 1em;
    color: #1b5e20;
    margin: 0;
}

/* Toggle button */
.htr-toc__toggle {
    background: transparent;
    border: 1px solid #81c784;
    color: #388e3c;
    font-size: 0.8em;
    cursor: pointer;
    padding: 2px 9px;
    border-radius: 3px;
    line-height: 1.7;
    flex-shrink: 0;
    transition: background 0.15s;
}

.htr-toc__toggle:hover {
    background: #c8e6c9;
    border-color: #388e3c;
}

/* Nav area */
.htr-toc__nav {
    transition: none;
}

.htr-toc__nav.htr-toc--hidden {
    display: none;
}

/* Lists */
.htr-toc__list,
.htr-toc__sublist {
    margin: 0;
    padding-left: 22px;
}

.htr-toc__list {
    margin-top: 2px;
    padding-left: 18px;
}

/* Items */
.htr-toc__item {
    margin: 3px 0;
}

/* Links */
.htr-toc__link {
    color: #2e7d32;
    text-decoration: none;
    transition: color 0.15s;
}

.htr-toc__link:hover {
    color: #1b5e20;
    text-decoration: underline;
}

/* Nested depth styling */
.htr-toc__depth-1 > .htr-toc__link {
    font-weight: 500;
}

.htr-toc__depth-2 > .htr-toc__link {
    color: #388e3c;
    font-size: 0.93em;
}

.htr-toc__depth-3 > .htr-toc__link,
.htr-toc__depth-4 > .htr-toc__link {
    color: #4caf50;
    font-size: 0.9em;
}

/* Sub-lists inherit left-padding for visual indentation */
.htr-toc__sublist .htr-toc__sublist {
    padding-left: 18px;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .htr-toc {
        max-width: 100%;
        font-size: 0.92em;
        padding: 12px 14px 14px;
    }
}
