/* CEOBI global layout integrity safeguards */
:root{--ceobi-safe-vh:100dvh}
html,body{max-width:100%;overflow-x:hidden}
main,[data-page-mount],[id$="Mount"],[class$="-mount"],[class*=" page-mount"]{min-width:0;max-width:100%}

/* Full-page application surfaces must never inherit modal sizing. */
.admin-center-panel.enterprise-admin,
.admin-shell,
.auth-shell,
.platform-shell,
.ceobi-page-shell,
[data-ceobi-fullscreen="true"],
[data-page-surface="full"]{
  width:100%!important;
  max-width:none!important;
  min-height:var(--ceobi-safe-vh)!important;
  max-height:none!important;
}

/* Hidden and inactive layers must not intercept interaction. */
[hidden],
[aria-hidden="true"],
.is-hidden,
[data-state="closed"],
[data-open="false"]{pointer-events:none!important}

/* Loading layers are interactive only while explicitly active. */
.page-loading:not(.is-active),
.loading-screen:not(.is-active),
.loading-overlay:not(.is-active),
.page-transition:not(.is-active),
[data-loading-overlay]:not([data-active="true"]){pointer-events:none!important}

/* Keep genuine modal stacks predictable. */
[role="dialog"][aria-modal="true"]{z-index:1001}
.modal-backdrop,.dialog-backdrop,[data-modal-backdrop]{z-index:1000}
.ceobi-account-toast,.toast-container,[role="status"].toast{z-index:1100}

/* Avoid fixed navigation covering the final page content. */
body:has(.ceobi-mobile-bottom-nav){padding-bottom:max(86px,env(safe-area-inset-bottom))}

@media(max-width:760px){
  [role="dialog"][aria-modal="true"]:not(.enterprise-admin):not([data-ceobi-fullscreen="true"]){
    width:calc(100vw - 24px)!important;
    max-width:calc(100vw - 24px)!important;
    max-height:calc(100dvh - 24px)!important;
  }
  .admin-center-panel.enterprise-admin,[data-ceobi-fullscreen="true"]{
    width:100vw!important;max-width:100vw!important;min-height:100dvh!important
  }
}
