/* IGS 1050: one global notification and operational action-dock contract.
   Loaded from the shell and scoped to action bars selected by the shared controller.
   Do not move submit buttons out of their form: native form validation and delegated
   click/submit events must continue to work unchanged. */
html body #toast,
html body #toast.show,
html body #toast:popover-open {
  position:fixed !important;
  inset:clamp(12px,3dvh,28px) auto auto 50% !important;
  transform:translateX(-50%) !important;
  box-sizing:border-box;
  width:min(760px,calc(100vw - 24px)) !important;
  min-width:0 !important;
  max-width:calc(100vw - 24px) !important;
  max-height:min(58dvh,450px);
  margin:0 !important;
  overflow-y:auto;
  border:1px solid #ffffff35;
  border-radius:17px;
  padding:10px 12px;
  box-shadow:0 18px 60px #15284b55;
  z-index:2147483646 !important;
  direction:rtl;
  line-height:1.9;
  flex-direction:column;
  gap:8px;
}
html body #toast:not(.show):not(:popover-open):not(.is-open){display:none}
html body #toast:is(.show,:popover-open,.is-open){display:flex}
#toast .igs-toast-item{display:flex;align-items:center;gap:11px;width:100%;min-height:44px;padding:7px 8px;border-radius:10px;color:#fff;overflow-wrap:anywhere}
#toast .igs-toast-item:not(:last-child){border-bottom:1px solid #ffffff35}
#toast .global-toast-close{margin-inline-start:auto;flex:none}
#toast .global-toast-message{min-width:0;flex:1;white-space:pre-wrap}
#toast:popover-open::backdrop{background:transparent;pointer-events:none}
/* A modal is a self-contained column: the header and operation bar never scroll off.
   All heavy form fields scroll in .modal-body; alert dock remains above the scroller. */
dialog#modal[open]:has(.igs-action-dock){margin:auto !important;overflow:hidden !important;overscroll-behavior:contain;max-height:calc(100dvh - 20px) !important}
dialog#modal[open]:has(.igs-action-dock) > #dialog-content{
  display:flex;flex-direction:column;max-height:calc(100dvh - 20px);min-height:0;
}
dialog#modal[open]:has(.igs-action-dock) #dialog-content > .modal-head,
dialog#modal[open]:has(.igs-action-dock) #dialog-content > .igs-modal-alert-dock{flex:0 0 auto}
dialog#modal[open]:has(.igs-action-dock) #dialog-content > .modal-body{
  flex:1 1 auto;min-height:0;overflow-x:hidden;overflow-y:auto;
  overscroll-behavior:contain;scrollbar-width:thin;
  padding-bottom:0;
}
dialog#modal[open] .modal-body .igs-action-dock{
  position:sticky !important;bottom:0 !important;z-index:50 !important;
  display:flex !important;align-items:center;flex-wrap:wrap;gap:9px;
  background:rgba(255,255,255,.985) !important;
  border-top:1px solid #dde5f2 !important;
  box-shadow:0 -12px 25px -15px #152c5a45 !important;
  padding:12px 18px max(12px,env(safe-area-inset-bottom)) !important;
  margin:17px -19px 0 !important;
  min-height:62px;
}
/* Page-based editors also retain their own native submit buttons. */
main#main .igs-action-dock,
dialog[open]:not(#modal) .igs-action-dock{
  position:sticky !important;bottom:0 !important;z-index:35 !important;
  background:rgba(255,255,255,.98) !important;
  border-top:1px solid #dae4f3 !important;
  box-shadow:0 -11px 24px -16px #142f5945 !important;
  padding:12px 16px max(12px,env(safe-area-inset-bottom)) !important;
  margin-top:18px !important;
}
#main .igs-action-dock .button,dialog .igs-action-dock .button{min-height:42px}
@media(max-width:760px){
 html body #toast,html body #toast.show,html body #toast:popover-open{
   inset:calc(env(safe-area-inset-top) + 8px) auto auto 50% !important;
   width:calc(100vw - 16px) !important;max-width:calc(100vw - 16px) !important;
   border-radius:13px;padding:8px;
 }
 dialog#modal[open]:has(.igs-action-dock) > #dialog-content{max-height:calc(100dvh - 20px)}
 dialog#modal[open] .modal-body .igs-action-dock{
   margin:12px -13px 0 !important;padding:10px 12px max(12px,env(safe-area-inset-bottom)) !important;
   gap:7px;max-height:min(34dvh,190px);overflow-y:auto;
 }
 .igs-action-dock .button{min-height:44px;flex:1 1 auto;min-width:105px}
}
@media print{
 html body #toast,html body #toast.show{display:none !important}
 dialog#modal[open]:has(.igs-action-dock){max-height:none !important;overflow:visible !important}
 dialog#modal[open]:has(.igs-action-dock) > #dialog-content{max-height:none !important}
 dialog#modal[open]:has(.igs-action-dock) #dialog-content > .modal-body{overflow:visible !important}
 .igs-action-dock{position:static !important;box-shadow:none !important}
}
