/* AfghanZone pre-production mobile UX stabilization v1.0.1 */
@media (max-width:1024px){
    html{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;max-width:100%!important;overflow-x:hidden!important}
    body{max-width:100vw!important;overflow-x:hidden!important}
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    select,textarea{font-size:16px!important;max-width:100%!important}
    input,select,textarea{scroll-margin-top:96px!important}
    main,.portal-main,.content,.main-content{min-width:0!important;max-width:100%!important}

    /* Customer portal overlay remains below its own drawer. */
    #portal-sidebar.portal-sidebar{z-index:2147482100!important}
    #portal-overlay.portal-overlay{z-index:2147482000!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;background:rgba(8,15,28,.48)!important}
    #portal-overlay.portal-overlay.active{display:block!important}

    /* iPhone/Android sale wizard: fit the live visual viewport and keep footer visible. */
    #sale-wizard-modal{
        width:100vw!important;max-width:100vw!important;
        height:var(--az-mobile-visual-height,100dvh)!important;
        max-height:var(--az-mobile-visual-height,100dvh)!important;
        min-height:0!important;align-items:stretch!important;justify-content:center!important;
        overflow:hidden!important;padding:max(6px,env(safe-area-inset-top)) 8px max(6px,env(safe-area-inset-bottom))!important
    }
    #sale-wizard-modal .sale-wizard-card{
        width:min(100%,760px)!important;max-width:760px!important;
        height:100%!important;max-height:none!important;min-height:0!important;
        margin:0 auto!important;overflow:hidden!important;display:flex!important;flex-direction:column!important
    }
    #sale-wizard-modal .wizard-step-panel:not(.hidden){
        flex:1 1 auto!important;min-height:0!important;overflow-y:auto!important;overflow-x:hidden!important;
        -webkit-overflow-scrolling:touch!important;overscroll-behavior:contain!important;padding-bottom:12px!important
    }
    #sale-wizard-modal .sale-wizard-footer{
        position:relative!important;bottom:auto!important;flex:0 0 auto!important;visibility:visible!important;opacity:1!important;
        z-index:60!important;background:#fff!important;margin-top:4px!important;padding:9px 2px calc(4px + env(safe-area-inset-bottom))!important;
        border-top:1px solid #e2e8f0!important;box-shadow:0 -8px 18px rgba(15,23,42,.06)!important
    }
    #sale-wizard-modal #w-btn-next,
    #sale-wizard-modal #w-btn-prev,
    #sale-wizard-modal #w-btn-finish{min-height:42px!important;padding-inline:14px!important}

    /* Keep floating utilities away from the form and from one another. */
    #az-global-language{left:max(12px,env(safe-area-inset-left))!important;right:auto!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;top:auto!important;z-index:2147481500!important}
    #az-auto-invoice-launcher{right:max(12px,env(safe-area-inset-right))!important;left:auto!important;bottom:calc(12px + env(safe-area-inset-bottom))!important;z-index:2147481450!important;min-width:48px!important;max-width:150px!important}
    #phase43-mysql-sales-badge{left:50%!important;right:auto!important;bottom:calc(76px + env(safe-area-inset-bottom))!important;top:auto!important;z-index:2147481400!important;max-width:calc(100vw - 116px)!important;padding:7px 11px!important;border-radius:999px!important;font-size:12px!important;line-height:1.25!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;pointer-events:none!important;transform:translateX(-50%)!important;transition:opacity .2s ease,visibility .2s ease!important}
    #phase43-mysql-sales-badge.az-mobile-status-hidden{opacity:0!important;visibility:hidden!important}

    body.az-mobile-form-focus #az-global-language,
    body.az-mobile-form-focus #az-auto-invoice-launcher,
    body.az-mobile-form-focus #phase43-mysql-sales-badge{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
}

/* __KZ_CP_NOTIFICATION_OVERLAY_LIGHT_MOBILE_V100__
   Override only the shared overlay while Notifications is open. */
@media (max-width:1024px){
    .notification-panel.open + #portal-overlay.portal-overlay{
        background:rgba(8,15,28,.16)!important;
    }
}
