.toc-sentinel {
    height: 1px;
}
.toc-block {
    --toc-color-primary: #E30F69;
    --toc-color-text: #000000;
    --toc-color-bg: #fff;
    --toc-border-color: #e0e0e0;
    
    width: 100%;
    margin: 2rem 0;
    border-radius: 8px;
    background: var(--toc-color-bg);
    transition: all 0.3s ease;
    &.is-sticky {
        position: sticky;
        top: 90px;
        z-index: 9;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    &.is-collapsed {
        .toc-content {
            max-height: 0;
            opacity: 0;
            overflow: hidden;
        }
        
        .toggle-icon {
            transform: rotate(0);
        }
    }

    .toc-container {
        padding: 1.5rem;
        @media all and (max-width: 767px) {
            padding: 0;
        }
    }

    .toc-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        margin-bottom: 0;
        
        &:focus {
            outline: 2px solid var(--toc-color-primary);
            outline-offset: 2px;
        }
    }

    .toc-title {
        margin: 0 !important;
        font-size: 1.25rem;
        font-weight: 700;
        color: var(--toc-color-text);
    }

    .toc-toggle {
        background: none;
        border: none;
        padding: 0.5rem;
        cursor: pointer;
        width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s ease;
        background-color: #8cc6ec;
        
        &:hover {
            background-color: rgba(0, 0, 0, 0.05);
        }
        
        &:focus {
            outline: 2px solid #8cc6ec;
        }
    }

    .toggle-icon {
        font-size: 1.5rem;
        line-height: 1;
        transition: transform 0.3s ease;
        transform: rotate(180deg);
    }

    .toc-content {
        max-height: 1000px;
        opacity: 1;
        transition: all 0.3s ease;
        margin-top: 1rem;
    }

    .toc-list {
        list-style: none;
        padding: 0;
        margin: 0;
        
        .toc-item {
            margin-bottom: 0.5rem;
            margin-left: 0;
            list-style: none;
            position: relative;
            padding-left: 0;
            line-height: 1.4;
            border-top: 1px solid var(--toc-border-color);
            cursor: pointer;
            span {
                text-decoration: none;
                color: var(--toc-color-text);
                transition: color 0.2s ease;
                display: block;
                padding: 14px 0;
                position: relative;
                font-size: 14px;
                font-family: 'Source Sans Pro', sans-serif;
                font-weight: 400;
                
                &:hover {
                    color: var(--toc-color-primary);
                }
            }
            
            &[class*="toc-level-"] span {
                padding-left: 1rem;
                
                &::before {
                    left: 0.5rem;
                }
            }
            
            &.toc-level-3 span { padding-left: 1.5rem; }
            &.toc-level-4 span { padding-left: 2rem; }
            &.toc-level-5 span { padding-left: 2.5rem; }
            &.toc-level-6 span { padding-left: 3rem; }
        }
    }

    .toc-highlight {
        animation: toc-highlight 2s ease;
    }

    @keyframes toc-highlight {
        0% { background-color: rgba(227, 15, 105, 0.1); }
        100% { background-color: transparent; }
    }
    @media screen and (max-width: 767px) {
        min-height: auto !important;
        padding-top: 10px;
        padding-left: 20px;
        padding-right: 20px;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--toc-border-color);
    }
}

body.no-headings {
    .toc-block {
        display: none;
    }
}