/*
 * Native <dialog> windows opened by nuzp.dialog (assets/js/ui/core.js) carry
 * the class ui-dialog. The browser's own box (border, padding, background,
 * size limits) is cleared, weakly, so each window draws itself as before;
 * the window above is the top layer, so it needs no z-index. A closed one is
 * hidden even when its own rule sets a display, and the page behind an open
 * one does not scroll.
 */
:where(dialog.ui-dialog) {
    margin: 0;
    padding: 0;
    border: 0;
    max-width: none;
    max-height: none;
    background: none;
    color: inherit;
    overflow: visible;
}

:where(dialog.ui-dialog)::backdrop {
    background: transparent;
}

dialog.ui-dialog:not([open]) {
    display: none;
}

/* The page scrolls on <html>; the gutter is kept so that taking the scrollbar
   away does not slide the page sideways behind the window. */
html:has(dialog.ui-dialog[open]) {
    overflow: hidden;
    scrollbar-gutter: stable;
}
