.article-sidebar__sticky {
    --article-sticky-top: 28px;
    --article-cta-height: 322px;
    position: sticky;
    top: var(--article-sticky-top);
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-sidebar__sticky.is-cta-triggered {
    --article-sticky-top: 20px;
}

.article-sidebar__sticky .article-toc {
    position: static;
    flex: 0 1 auto;
}

.article-sidebar__sticky.is-cta-triggered .article-toc {
    max-height: min(312px, max(70px, calc(100dvh - var(--article-sticky-top) - var(--article-cta-height) - 30px - 20px)));
}

.article-cta {
    position: relative;
    flex: 0 0 auto;
    padding: 24px;
    border-radius: 12px;
    background: #232968;
    color: #fff;
    font-family: "Hanken Grotesk", sans-serif;
    box-sizing: border-box;
}

.article-cta[hidden] { display: none !important; }
.article-cta__toggle { display: none; }

.article-cta .article-cta__title {
    margin: 0;
    color: #fff;
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    line-height: 20px;
}

.article-cta__title span { display: block; }
.article-cta__title span + span { margin-top: 6px; }

.article-cta .article-cta__description {
    margin: 12px 0 0;
    color: #e3e4ee;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.article-cta__checklist {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
}

.article-cta__checklist li {
    position: relative;
    padding-left: 40px;
}

.article-cta__checklist li + li { margin-top: 12px; }

.article-cta__checklist li::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 5px;
    width: 7px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(40deg);
}

.article-cta__button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin-top: 20px;
    padding: 8px;
    border-radius: 4px;
    background: #2855ff;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
    text-decoration: none;
}

.article-cta__button:hover {
    background: #1745ed;
    color: #fff;
    text-decoration: none;
}

.article-cta__button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.article-cta__toggle:focus,
.article-cta__toggle:focus-visible {
    outline: none !important;
}

/* Shrink only the TOC on short desktop windows; every CTA control stays reachable. */
@media (min-width: 768px) and (max-height: 520px) {
    .article-sidebar__sticky {
        max-height: calc(100dvh - var(--article-sticky-top) - 12px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .article-sidebar__sticky.is-cta-triggered .article-toc { max-height: 90px; }
}

@media (max-width: 767px) {
    .article-sidebar__sticky { position: static; gap: 0; }
    .article-sidebar__sticky.is-cta-triggered .article-toc {
        max-height: min(312px, calc(100dvh - var(--article-sticky-top) - 20px));
    }

    .article-cta {
        display: none;
        position: fixed;
        z-index: 10001;
        right: 0;
        bottom: 0;
        left: 0;
        padding: 49px max(16px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
        border-radius: 12px 12px 0 0;
        max-height: calc(var(--article-visual-height, 100dvh) - 80px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .article-cta__toggle {
        position: absolute;
        top: 2px;
        left: calc(50% - 22px);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #fff;
        cursor: pointer;
        touch-action: manipulation;
    }

    .article-cta__title span { display: inline; }
    .article-cta__title span + span { margin-top: 0; }
    .article-cta .article-cta__description { margin-top: 10px; }
    .article-cta__checklist {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 8px;
        margin-top: 18px;
    }
    .article-cta__checklist li + li { margin-top: 0; }
    .article-cta__button { min-height: 48px; margin-top: 12px; }

    .article-cta.is-collapsed {
        padding-top: 44px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    .article-cta.is-collapsed .article-cta__details { display: none; }
    .article-cta.is-collapsed .article-cta__button { margin-top: 0; }
    .article-cta.is-collapsed .article-cta__toggle svg { transform: rotate(180deg); }
}
