/* No dialog geometry overrides until the first move/resize/maximize. */
.modal.mw-window { pointer-events: none; overflow: visible; z-index: var(--mw-order, 1100) !important; }
.modal.mw-window > .modal-dialog { pointer-events: none; }
.modal.mw-window .modal-content { pointer-events: auto; }
.modal.mw-window > :is(.mah-select__panel,.mah-select__backdrop) { pointer-events: auto; }
.modal.mw-window.mw-minimized { display: none !important; }
.mw-header { position: relative; cursor: move; touch-action: none; }
.mw-header .block-title, .mw-header .modal-title { min-width: 0; }
.mw-heading { position: relative; }
.mw-heading[data-mw-truncated]::after { content: '…'; position: absolute; inset-inline-end: var(--mw-title-cut); bottom: 0; padding-inline-start: .15em; background: var(--mw-heading-background); }
.mw-controls { position: absolute; top: 50%; inset-inline-end: var(--mw-controls-inset, 36px); transform: translateY(-50%); display: inline-flex; align-items: center; gap: 2px; height: 24px; }
.mw-button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 0; border-radius: .25rem; background: transparent; color: inherit; font: inherit; font-size: 1rem; line-height: 1; min-width: 28px; min-height: 24px; height: 24px; padding: 0 6px; cursor: pointer; touch-action: manipulation; }
.mw-button:hover { background: var(--amin-color-surface-raised); color: var(--amin-color-text); }
.mw-button:focus-visible, .mw-header:focus-visible, .mw-edge:focus-visible { outline: 2px solid var(--amin-color-focus-ring); outline-offset: 2px; box-shadow: 0 0 0 2px var(--amin-color-surface); }
.mw-floating-header { position: absolute; inset-block-start: 0; inset-inline-end: 0; z-index: 2; min-width: 144px; min-height: 32px; background: var(--amin-color-surface); color: var(--amin-color-text); }
.modal.mw-window .modal-dialog.mw-positioned { position: fixed !important; left: var(--mw-left) !important; top: var(--mw-top) !important; width: var(--mw-width) !important; height: var(--mw-height) !important; right: auto !important; bottom: auto !important; margin: 0 !important; max-width: none !important; max-height: none !important; min-height: 0 !important; transform: none !important; transition: none !important; }
.modal.mw-window .mw-positioned > .modal-content { width: 100% !important; height: 100% !important; max-height: none !important; min-height: 0 !important; }
.mw-positioned .mw-flex-shell { display: flex !important; flex-direction: column; flex: 1 1 auto; min-height: 0 !important; max-height: none !important; overflow: visible; }
.mw-positioned .mw-scroll-region { flex: 1 1 auto; min-height: 0 !important; overflow: auto !important; overscroll-behavior: contain; }
.mw-positioned .mw-fixed-region { flex: 0 0 auto !important; }
.mw-positioned .mw-footer-region { height: auto !important; min-height: 0 !important; }
.mw-edge { position: absolute; z-index: 5; touch-action: none; }
.mw-edge-n, .mw-edge-s { height: 8px; left: 10px; right: 10px; cursor: ns-resize; }
.mw-edge-n { top: -4px; } .mw-edge-s { bottom: -4px; }
.mw-edge-e, .mw-edge-w { width: 8px; top: 10px; bottom: 10px; cursor: ew-resize; }
.mw-edge-e { right: -4px; } .mw-edge-w { left: -4px; }
.mw-edge-ne, .mw-edge-nw, .mw-edge-se, .mw-edge-sw { width: 14px; height: 14px; }
.mw-edge-ne { top: -4px; right: -4px; cursor: nesw-resize; }
.mw-edge-nw { top: -4px; left: -4px; cursor: nwse-resize; }
.mw-edge-se { bottom: -4px; right: -4px; cursor: nwse-resize; }
.mw-edge-sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.mw-dock { position: fixed; z-index: 20000; bottom: calc(var(--mw-dock-bottom, 0px) + env(safe-area-inset-bottom, 0px)); right: 8px; left: auto; width: max-content; display: flex; gap: 6px; padding: 4px; max-width: calc(100vw - 16px); overflow-x: auto; background: transparent; color: var(--amin-color-text); }
.mw-dock[hidden] { display: none; }
.mw-dock-item { display: flex; align-items: center; flex: 0 0 auto; min-height: 36px; max-width: min(240px, 75vw); border: 1px solid var(--amin-color-primary); border-top-width: 3px; border-radius: .4rem .4rem 0 0; background: var(--amin-color-surface-raised); background: color-mix(in srgb, var(--amin-color-primary) 14%, var(--amin-color-surface)); animation: mw-dock-reminder 7s ease-in-out infinite; transform-origin: bottom center; }
.mw-dock-restore { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; line-height: 1.4; min-width: 0; flex-shrink: 1; }
@keyframes mw-dock-reminder {
    0%, 8%, 16%, 100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 transparent; }
    4% { transform: translateY(-2px) scale(1.025); box-shadow: 0 0 0 5px color-mix(in srgb, var(--amin-color-primary) 18%, transparent); }
    12% { transform: translateY(-1px) scale(1.012); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amin-color-primary) 10%, transparent); }
}
.mw-window .modal-resize-btn { display: none !important; }
.mw-has-windows .swal2-container { z-index: 20002 !important; }
:is(.mw-has-windows, body:has(.ubd-inline-editor)) :is(.tox-tinymce-aux,.tox-dialog-wrap,.mah-select__panel,.mah-select-dropdown,.jdp-container,jdp-container,.select2-container--open) { z-index: var(--mw-popup-order, 1200) !important; }
.modal.mw-window .mw-positioned .mw-header { cursor: move; }
@media (pointer: coarse) { .mw-controls .mw-button { position: relative; min-width: 36px; } .mw-controls .mw-button::before { content: ""; position: absolute; inset: -6px 0; } .mw-dock .mw-button { min-height: 36px; } .mw-edge { touch-action: none; } }
@media (prefers-reduced-motion: reduce) { .mw-window, .mw-window .modal-dialog, .mw-dock-item { transition: none !important; animation: none !important; } }

.mw-controls { direction: ltr; }
.mw-header .mw-original-close { visibility: hidden; pointer-events: none; }
