
.custom-toc {
    width: 100%;
    max-width: 420px;
    margin: 0;
    background: var(--color-primary-light);
    border-radius: var(--radius-3xl);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.custom-toc-header {
    padding: var(--spacing-4) var(--spacing-10);
    background: var(--color-primary-dark);
    border-radius: var(--radius-3xl) var(--radius-3xl) 0 0;
    margin: 0;
    position: relative;
}

.custom-toc-title {
    margin: 0;
    padding: 0;
    font-family: var(--font-family-header);
    font-size: var(--font-size-h6);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-h6);
    color: var(--color-base-ghost-white);
    text-align: left;
}

.custom-toc-content {
    padding: var(--spacing-6) var(--spacing-10) var(--spacing-10) var(--spacing-10);
}

.custom-toc-list {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    list-style-type: disc;
    list-style-position: outside;
    padding-left: 0;
    text-align: left;
}

.custom-toc-item {
    margin: 0;
    padding: 0;
    display: list-item;
    list-style-type: disc;
    list-style-position: outside;
    margin-left: calc(1.5 * 1em);
    text-align: left;
}

.custom-toc .custom-toc-list .custom-toc-item .custom-toc-link,
.custom-toc .custom-toc-list .custom-toc-item .custom-toc-link-first {
    font-family: var(--font-family-paragraph);
    font-size: var(--font-size-p2-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-p2-base);
    color: var(--color-default-text);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration 0.2s ease, font-weight 0.2s ease;
    text-align: left;
}

.custom-toc .custom-toc-list .custom-toc-item .custom-toc-link:hover,
.custom-toc .custom-toc-list .custom-toc-item .custom-toc-link-first:hover {
    color: var(--color-deep-dark);
    font-weight: var(--font-weight-bold);
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-position: from-font;
}

.custom-toc-message {
    text-align: center;
    padding: var(--spacing-8) var(--spacing-10);
}

.custom-toc-message p {
    margin: 0;
    font-family: var(--font-family-paragraph);
    font-size: var(--font-size-p2-base);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-p2-base);
    color: var(--color-default-text);
    font-style: italic;
}

@media (min-width: 768px) {
    .custom-toc {
        width: 100%;
        max-width: 698px;
        margin: 0;
    }
}

@media (min-width: 1280px) {
    .custom-toc {
        width: 70%;
        max-width: 1018px;
        margin: 0;
    }

    .custom-toc .custom-toc-list .custom-toc-item .custom-toc-link-first:hover {
        color: var(--color-primary-dark);
        font-weight: var(--font-weight-bold);
    }
}

.custom-toc-link:focus-visible,
.custom-toc-link-first:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

@media (pointer: coarse) {
    .custom-toc-link,
    .custom-toc-link-first {
        display: inline-block;
        min-height: 44px;
        padding: var(--spacing-2) 0;
    }
}
