.aopt-toc {
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(41, 64, 78, 0.14);
    border-radius: 12px;
    background: rgba(247, 248, 245, 0.88);
}

.aopt-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    color: var(--theme-headings-color, #22313a);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.aopt-toc summary::-webkit-details-marker {
    display: none;
}

.aopt-toc__icon {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, 2px);
    transition: transform 160ms ease;
}

.aopt-toc[open] .aopt-toc__icon {
    transform: rotate(225deg) translate(-2px, 2px);
}

.aopt-toc nav {
    padding: 0 22px 18px 38px;
    border-top: 1px solid rgba(41, 64, 78, 0.1);
}

.aopt-toc ol {
    margin: 16px 0 0;
    padding-left: 20px;
}

.aopt-toc li + li {
    margin-top: 8px;
}

.aopt-toc a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

/*
 * WordPress flow layouts reset every direct child's block-end margin and put
 * spacing on the following child's block-start instead. Own that one boundary
 * so TOC + promotion, TOC + hero and TOC + authored content behave alike.
 */
.entry-content > .aopt-toc + * {
    margin-block-start: clamp(20px, 3vw, 28px);
}
