/* No copied settings or relocated global controls. Only original controls are active. */
html[data-mx-global-dialog] .site-head{z-index:2147483601!important}
html[data-mx-global-dialog] .layout{isolation:auto}
html[data-mx-global-dialog] #mx-a11y-panel{z-index:2147483602!important}
html[data-mx-global-dialog] .mx-a11y-launch{z-index:2147483603!important}
html[data-mx-global-dialog] #mxFullscreenHistory{z-index:2147483602!important}
[data-mx-global-settings]{z-index:2147483600!important}
dialog[data-mx-global-settings][open]{position:fixed;inset:var(--mx-dialog-head,80px) 0 8px;margin:auto;max-height:calc(100dvh - var(--mx-dialog-head,80px) - 16px);box-shadow:0 0 0 100vmax rgb(0 0 0 / .55)}
[data-mx-global-settings]:not([data-mx-dialog-active]){z-index:2147483599!important}
/* Keep fixed global header outside the form's visual panel, including narrow screens. */
html[data-mx-global-dialog] :is(.mf-shade,.inquiry-shade){padding-top:max(var(--mx-dialog-head,80px),env(safe-area-inset-top));box-sizing:border-box}

html[data-mx-global-dialog] :is(.mf-modal,.inquiry-panel){max-height:calc(100dvh - var(--mx-dialog-head,80px) - 24px);overflow:auto}

/* Fit the entire viewer below the retained global header. Padding must be
   inside its viewport box; cap the panel by the remaining height, not 100dvh. */
html[data-mx-global-dialog] .design-viewer{padding-top:var(--mx-dialog-head,80px);box-sizing:border-box;height:100dvh;max-height:100dvh;min-height:0}
html[data-mx-global-dialog] .design-viewer .design-viewer-panel{min-height:0;max-height:max(0px,calc(100dvh - var(--mx-dialog-head,80px) - 12px))}
/* Original accessibility launcher keeps its fixed corner; reserve room in the expanded viewer actions. */
@media(min-width:1024px){html[data-mx-global-dialog] .design-viewer-expanded .design-viewer-actions{padding-left:64px;padding-right:64px}}

/* Dim only inert header branches; original allowed settings never inherit this opacity. */
html[data-mx-global-dialog] .site-head [inert]{opacity:.55}
