body {
    --contact-edge: calc(30px + env(safe-area-inset-right, 0px));
    --contact-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    --contact-size: 70px;
    --getcall-lift: 0px;
    --contact-screen-width: min(100%, 100dvw);
}

body:has(#sc_fixed_contact_button) {
    --getcall-lift: calc(var(--contact-size) + 34px);
}

@media (min-width: 992px) {
    body:has(#fixed_contact_button) {
        --getcall-lift: calc(var(--contact-size) + 34px);
    }
}

@media (max-width: 991.98px) {
    body:has(.pr-mobile-bottom-nav) {
        --contact-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    body:has(.pr-mobile-bottom-nav.is-lifted) {
        --contact-bottom: calc(96px + 3rem + env(safe-area-inset-bottom, 0px));
    }

    body:has(.pr-mobile-bottom-nav) #bingc-phone-button,
    body:has(.pr-mobile-bottom-nav) #getcall-preview {
        transition: top .3s ease;
    }
}

@media (max-width: 767.98px) {
    body {
        --contact-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    }

    html.body-product body:has(#sc_fixed_contact_button) {
        --contact-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 419.98px) {
    body {
        --contact-edge: calc(15px + env(safe-area-inset-right, 0px));
        --contact-size: 50px;
    }
}

#bingc-phone-button.bingc-phone-button {
    inset: auto !important;
    left: calc(var(--contact-screen-width) - var(--contact-edge) - var(--contact-size) / 2 - 49.5px) !important;
    top: calc(100dvh - var(--contact-bottom) - var(--getcall-lift) - var(--contact-size) / 2 - 49.5px) !important;
}

#getcall-preview {
    position: fixed;
    left: calc(var(--contact-screen-width) - var(--contact-edge) - var(--contact-size));
    top: calc(100dvh - var(--contact-bottom) - var(--getcall-lift) - var(--contact-size));
    z-index: 1030;
    text-align: right;
}

#getcall-preview summary {
    width: var(--contact-size);
    height: var(--contact-size);
}

body:has(#bingc-phone-button, #getcall-preview) #sc_fixed_contact_button {
    inset: auto;
    left: calc(var(--contact-screen-width) - var(--contact-edge) - var(--contact-size));
    top: calc(100dvh - var(--contact-bottom) - var(--contact-size));
}

@media (min-width: 992px) {
    body:has(#bingc-phone-button, #getcall-preview) #fixed_contact_button {
        inset: auto;
        left: calc(var(--contact-screen-width) - var(--contact-edge) - var(--contact-size));
        top: calc(100dvh - var(--contact-bottom) - var(--contact-size));
    }

    body:has(#bingc-phone-button, #getcall-preview) #fixed_contact_button .fixed-contact-dropdown {
        right: calc(var(--contact-size) + 18px);
    }
}

body:has(#bingc-phone-button, #getcall-preview) #sc_fixed_contact_button .sc-fixed-contact-dropdown {
    right: calc(var(--contact-size) + 18px);
    min-width: 0;
    width: min(250px, calc(100dvw - var(--contact-edge) - var(--contact-size) - 30px));
    max-height: calc(100dvh - var(--contact-bottom) - 84px);
    overflow-y: auto;
}

body:has(#bingc-phone-button, #getcall-preview) #back-top {
    inset: auto;
    left: calc(var(--contact-screen-width) - var(--contact-edge) - var(--contact-size) - 48px);
    top: calc(100dvh - var(--contact-bottom) - var(--contact-size) / 2 - 18px);
    width: 36px;
    height: 36px;
}

@media (max-width: 991.98px) {
    body:has(#bingc-phone-button, #getcall-preview) .pr-mobile-bottom-nav #back-top {
        inset: auto;
    }
}
