/* Dialog dismissal lives with the save actions; compact popups keep their X. */
body dialog[data-modal-controls="dialog"]{max-height:min(90vh,calc(100dvh - 24px));overflow:auto;overscroll-behavior:contain}
body dialog[data-modal-controls="dialog"] [data-modal-footer]{position:sticky;bottom:calc(-1 * var(--modal-padding-bottom,24px));z-index:20;flex-shrink:0;min-height:44px;box-sizing:border-box;padding:14px 0;margin-bottom:0;background:var(--modal-background,#fffdf8);border-top:1px solid #dfe3d7;display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px 12px}
.modal-close-rail{position:sticky;top:8px;z-index:10001;height:0;flex-shrink:0;pointer-events:none}
body .modal-close-rail .modal-close-button{position:absolute;right:0;top:0;display:grid;place-items:center;width:40px;height:40px;min-width:40px;min-height:40px;box-sizing:border-box;padding:9px;margin:0;border:1px solid #d5dccc;border-radius:50%;background:#fff;color:#39482f;box-shadow:0 2px 8px #25301020;font:inherit;cursor:pointer;pointer-events:auto;line-height:1;transition:background .15s,border-color .15s}
body .modal-close-rail .modal-close-button:hover{background:#f2f5ed;border-color:#81946e}
body .modal-close-rail .modal-close-button:focus-visible{outline:2px solid #b64e1e;outline-offset:3px}
body .modal-close-rail .modal-close-button:disabled{opacity:.55;cursor:wait}
.modal-close-button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
[data-modal-original-close]{display:none!important}
[data-modal-controls="popup"] > .modal-close-rail{top:0;height:44px;background:inherit}
body #ws-user-panel > .modal-close-rail .modal-close-button{width:36px;min-width:36px;height:36px;min-height:36px;padding:7px;text-align:center}
@media print{.modal-close-rail{display:none!important}}
