/* Keep the banner in the page flow so its actual height clears the footer. */
.public-shell > .cookie-consent {
    position: sticky;
    left: auto;
    transform: none;
    flex: none;
    margin: 0 auto 22px;
}

/* The separate preferences dialog may extend below short viewports. */
.cookie-preferences .cookie-preferences-card {
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
}

@media (max-width: 760px) {
    .public-shell > .cookie-consent {
        margin-bottom: 12px;
    }

    .cookie-preferences .cookie-preferences-card {
        max-height: calc(100dvh - 30px);
    }
}

@media (width < 600px), (height < 500px) {
    .public-shell > .cookie-consent {
        bottom: max(8px, env(safe-area-inset-bottom));
        margin-bottom: max(8px, env(safe-area-inset-bottom));
        width: min(940px, calc(100% - 16px));
    }

    .cookie-consent .cookie-consent-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px 12px;
        padding: 8px 10px;
        border-radius: 14px;
        max-height: 75dvh;
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }

    .cookie-preferences .cookie-preferences-card {
        max-height: calc(100dvh - 16px);
        margin-block: 8px;
    }

    .cookie-consent .cookie-consent-eyebrow {
        min-height: 18px;
        padding: 0 6px;
        font-size: 10px;
    }

    .cookie-consent .cookie-consent-copy h2 {
        margin-top: 3px;
        font-size: 16px;
        line-height: 1.15;
    }

    .cookie-consent .cookie-consent-copy p {
        margin-top: 4px;
        font-size: 13px;
        line-height: 1.25;
    }

    .cookie-consent .cookie-consent-actions {
        gap: 4px;
    }

    .cookie-consent .cookie-btn {
        flex: 1 0 min(100%, 91px);
        min-width: 0;
        min-height: 44px;
        padding: 4px 6px;
        font-size: 12px;
        line-height: 1.15;
        white-space: normal;
        text-align: center;
    }

    .cookie-consent .cookie-btn:is([data-cookie-action="reject"], [data-cookie-action="accept"]) {
        background: var(--brand);
        border-color: var(--brand);
        color: #fff;
        box-shadow: none;
    }

    .cookie-consent .cookie-btn:is([data-cookie-action="reject"], [data-cookie-action="accept"]):hover {
        filter: brightness(.9);
    }

    .cookie-consent .cookie-consent-link {
        justify-self: start;
        font-size: 12px;
    }
}

@media (width >= 620px) and (height < 500px) {
    .cookie-consent .cookie-consent-card {
        grid-template-columns: minmax(0, 1fr) minmax(0, 285px);
    }
}
