.study-upsell-overlay[hidden] {
    display: none !important;
}

.study-upsell-overlay {
    display: none;
}

@media (max-width: 768px) {
    .study-upsell-overlay {
        position: fixed;
        inset: 0;
        z-index: 3000;
        display: flex;
        align-items: flex-end;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.65));
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        animation: study-overlay-in 360ms ease-out both;
    }

    .study-upsell-sheet {
        position: relative;
        width: 100%;
        height: auto;
        max-height: calc(100dvh - 16px);
        padding: clamp(16px, 3.8vw, 24px) clamp(16px, 4vw, 22px) max(clamp(16px, 3.8vw, 24px), env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
        background: #ffffff;
        box-shadow: 0 -16px 50px rgba(15, 23, 42, 0.16);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: clamp(8px, 2.2vh, 14px);
        overflow: hidden;
        box-sizing: border-box;
        animation: study-sheet-up 450ms cubic-bezier(0.22, 1, 0.36, 1) both;
    }

    .study-upsell-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 28px;
        height: 28px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
        z-index: 2;
        transition: opacity 0.15s ease, transform 0.15s ease;
    }

    .study-upsell-close:active {
        opacity: 0.75;
        transform: scale(0.92);
    }

    .study-upsell-close img {
        display: block;
        width: 28px;
        height: 28px;
    }

    .study-upsell-copy {
        width: 100%;
        padding-right: 32px;
        box-sizing: border-box;
    }

    .study-upsell-copy h2 {
        margin: 0;
        color: #000000;
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Outfit", Inter, sans-serif;
        font-weight: 700;
        font-size: clamp(17px, 4.8vw, 21px);
        line-height: 1.2;
        letter-spacing: -0.025em;
        word-break: break-word;
    }

    .study-upsell-copy p {
        width: 100%;
        margin: clamp(3px, 1vh, 6px) 0 0;
        color: #8e8e93;
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", Inter, sans-serif;
        font-weight: 500;
        font-size: clamp(11.5px, 3.2vw, 13.5px);
        line-height: 1.32;
        letter-spacing: -0.01em;
    }

    .study-upsell-preview {
        width: 100%;
        aspect-ratio: 680 / 420;
        max-height: clamp(130px, 28vh, 220px);
        flex: 0 1 auto;
        min-height: 0;
        border: 1.5px solid #ebe0ff;
        border-radius: 14px;
        overflow: hidden;
        background: #ffffff;
        box-shadow: 0 2px 12px 0 rgba(85, 38, 136, 0.1);
        box-sizing: border-box;
    }

    .study-upsell-preview > img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: top center;
    }

    .study-upsell-benefits {
        width: 100%;
        min-height: clamp(28px, 5vh, 34px);
        padding: 0 4px;
        border-radius: 8px;
        background: #f8f2ff;
        color: #4a4454;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", Inter, sans-serif;
        font-weight: 600;
        font-size: clamp(8.5px, 2.5vw, 11px);
        line-height: 1;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .study-upsell-benefits span {
        flex: 1 1 0;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 0 2px;
        text-align: center;
    }

    .study-upsell-benefits span img {
        display: block;
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

    .study-upsell-benefits i {
        width: 1px;
        height: 14px;
        background: #e5dbff;
        flex-shrink: 0;
    }

    .study-upsell-cta {
        width: 100%;
        min-height: clamp(42px, 7.5vh, 50px);
        height: clamp(42px, 7.5vh, 50px);
        border-radius: 14px;
        background: #8c55f2;
        color: #ffffff;
        text-decoration: none;
        font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "SF Pro", Inter, sans-serif;
        font-weight: 600;
        font-size: clamp(14px, 3.8vw, 16px);
        letter-spacing: -0.01em;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        cursor: pointer;
        transition: background-color 0.15s ease, transform 0.15s ease;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .study-upsell-cta:hover {
        background: #7d44e5;
    }

    .study-upsell-cta:active {
        background: #723bdc;
        transform: scale(0.99);
    }
}

@keyframes study-overlay-in {
    from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
}

@keyframes study-sheet-up {
    0% { transform: translate3d(0, 100%, 0); opacity: 0; }
    50% { opacity: 0.9; }
    100% { transform: translate3d(0, 0, 0); opacity: 1; }
}
