/* Leave space below the card for both the desktop launcher and mobile contact bar. */
body #tfusa-funding-popup,
body #tfusa-funding-open {
    top: auto;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    right: max(16px, env(safe-area-inset-right, 0px));
}

body #tfusa-funding-popup {
    max-height: 38vh;
    max-height: min(38dvh, max(72px, calc(100dvh - 315px)));
}

/* Keep the full artwork visible when vertical space is tight. */
body #tfusa-funding-popup .funding-art {
    max-height: inherit;
    object-fit: contain;
}
body #tfusa-funding-popup .funding-link {
    max-height: inherit;
}

@media (max-width: 560px) and (max-height: 420px) {
    body #tfusa-funding-popup,
    body #tfusa-funding-open {
        position: relative;
        inset: auto;
        margin: 16px auto 84px;
    }
    body #tfusa-funding-popup { max-height: none; }
}
