img {
    width: 40rem;
    position: relative;
    display: flex;
}

/* --- Docs Sidebar (tree) --- */
.docs-sidebar {
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    background: var(--bs-body-bg);
    padding: 0.75rem;
    z-index: 99;
}

@media (min-width: 992px) {
    .docs-sidebar {
        position: sticky;
        top: 1rem;
        max-height: calc(100vh - 2rem);
        overflow: auto;
    }
}

.docs-sidebar-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0.25rem 0.25rem 0.75rem;
    letter-spacing: 0.02em;
}

/* reset lists */
.docs-nav,
.docs-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-nav > li + li {
    margin-top: 0.25rem;
}

/* link styling */
.docs-nav a {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--bs-body-color);
    line-height: 1.25;
}

.docs-nav a:hover {
    background: rgba(var(--bs-body-color-rgb), 0.06);
}

.docs-nav a.active {
    background: rgba(var(--bs-primary-rgb), 0.15);
    color: var(--bs-primary);
    font-weight: 700;
}

/* folders/groups */
.docs-group details {
    border-radius: 0.5rem;
}

.docs-group summary {
    cursor: pointer;
    user-select: none;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--bs-body-color);
}

.docs-group summary:hover {
    background: rgba(var(--bs-body-color-rgb), 0.06);
}

/* hide default marker + draw chevron */
.docs-group summary::-webkit-details-marker {
    display: none;
}

.docs-group summary::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 0.55rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    opacity: 0.65;
    transition: transform 120ms ease, opacity 120ms ease;
}

.docs-group details[open] > summary::before {
    transform: rotate(45deg);
    opacity: 0.9;
}

/* nested container */
.docs-group > details > ul {
    margin: 0.15rem 0 0.35rem 0.95rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--bs-border-color);
}

.docs-group > details > ul > li {
    margin: 0.15rem 0;
}

/* tighten nested links a bit */
.docs-group > details > ul a {
    padding: 0.3rem 0.5rem;
}

/* deeper nesting: keep a consistent indent/rail */
.docs-group ul ul {
    margin-left: 0.75rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--bs-border-color);
}