/* Keep the admin sign-in experience inside one viewport on desktop and mobile.
   The admin page must never create document, panel, or nested scrolling. */
html,
body.portal-role-guest {
    width: 100%;
    height: 100%;
    min-height: 0 !important;
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.portal-role-guest .dispatch-auth--admin {
    width: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
}

/* Keep the genuine top-right radar, but remove every separate lower orb/arc. */
body.portal-role-guest .dispatch-auth--admin .dispatch-auth__backdrop::after,
body.portal-role-guest .dispatch-auth--admin::after {
    display: none !important;
    visibility: hidden !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

body.portal-role-guest .dispatch-auth--admin .dispatch-auth__stage {
    overflow: hidden !important;
}

@media (min-width: 961px) {
    /* The desktop admin page uses 70% CSS zoom. 142.857143vh becomes one
       visible viewport after zoom and therefore produces no page scroll. */
    body.portal-role-guest .dispatch-auth--admin {
        height: 142.857143vh !important;
        min-height: 142.857143vh !important;
        max-height: 142.857143vh !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__stage {
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
    }
}

@media (max-width: 960px) {
    body.portal-role-guest .dispatch-auth--admin {
        height: 100vh !important;
        height: 100dvh !important;
        min-height: 100vh !important;
        min-height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__stage {
        height: 100% !important;
        min-height: 100% !important;
        max-height: 100% !important;
        justify-content: center !important;
        padding-top: 68px !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__intro,
    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__card {
        flex: 0 0 auto;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__help {
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 430px) {
    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__stage {
        padding-top: 62px !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    }
}

/* Compact short phones instead of enabling scroll. */
@media (max-width: 960px) and (max-height: 680px) {
    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__intro {
        display: none !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__stage {
        gap: 0 !important;
        justify-content: center !important;
        padding-top: 56px !important;
        padding-bottom: calc(10px + env(safe-area-inset-bottom)) !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__card {
        margin: 0 auto !important;
        padding-top: 20px !important;
        padding-bottom: 17px !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__card-logo {
        margin-bottom: 8px !important;
    }

    body.portal-role-guest .dispatch-auth--admin .admin-auth__heading {
        margin-bottom: 14px !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__field {
        margin-bottom: 10px !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__form-meta {
        margin-bottom: 12px !important;
    }
}

@media (max-width: 960px) and (max-height: 560px) {
    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__topbar {
        padding-top: 6px !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__stage {
        padding-top: 44px !important;
    }

    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__card-logo,
    body.portal-role-guest .dispatch-auth--admin .admin-auth__heading > span,
    body.portal-role-guest .dispatch-auth--admin .admin-auth__heading > p,
    body.portal-role-guest .dispatch-auth--admin .dispatch-auth__secure {
        display: none !important;
    }

    body.portal-role-guest .dispatch-auth--admin .admin-auth__heading {
        margin-bottom: 10px !important;
    }
}
