.edw-dialog[hidden] { display: none !important; }
.edw-dialog { position:fixed; inset:0; z-index:999999; display:flex; align-items:center; justify-content:center; padding:1rem; background:rgba(0,0,0,.6); }
.edw-panel { box-sizing:border-box; background:#fff; color:#222; border-radius:6px; padding:1.5rem; max-width:38rem; width:100%; max-height:90vh; overflow:auto; box-shadow:0 6px 30px rgba(0,0,0,.3); }
.edw-panel h2 { margin-top:0; color:#222; } .edw-panel a { color:#075b9e; }
.edw-option { display:block; margin:1rem 0; } .edw-actions { display:flex; flex-wrap:wrap; gap:.6rem; }
.edw-actions button, .edw-open, .edw-inline-open { background:#075b9e; color:white; border:2px solid #075b9e; padding:.65rem .9rem; cursor:pointer; font:inherit; }
.edw-actions button:focus-visible,.edw-open:focus-visible,.edw-inline-open:focus-visible { outline:3px solid #f2a600; outline-offset:2px; }
.edw-open { position:fixed; bottom:.5rem; right:.5rem; z-index:999998; font-size:.85rem; }

.edw-dialog[data-position="bottom-left"] { align-items:flex-end; justify-content:flex-start; }
.edw-dialog[data-position="bottom-right"] { align-items:flex-end; justify-content:flex-end; }
.edw-dialog { box-sizing:border-box; }
.edw-dialog .edw-panel { max-height:100%; }
.edw-dialog .edw-required { margin-bottom:.6rem; padding-bottom:0; }
.edw-dialog .edw-required + .edw-option { margin-top:.6rem; }
.edw-dialog .edw-actions { margin-top:1rem; }
.edw-dialog .edw-actions button { flex:1 1 9rem; }
@media (max-width: 34rem) {
    .edw-dialog { padding:.65rem; }
    .edw-dialog .edw-panel { padding:1rem; }
    .edw-dialog .edw-actions { flex-direction:column; }
    .edw-dialog .edw-actions button { flex:none; width:100%; }
}

.edw-dialog[data-position="bottom-bar"] {
    align-items: flex-end;
    padding: 0;
}
.edw-dialog[data-position="bottom-bar"] .edw-panel {
    width: 100%;
    max-width: none;
    max-height: 85%;
    border-radius: 0;
    padding-inline: max(1rem, calc((100% - 72rem) / 2), env(safe-area-inset-left), env(safe-area-inset-right));
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
@media (min-width: 50rem) {
    .edw-dialog[data-position="bottom-bar"] .edw-option {
        display: inline-block;
        vertical-align: top;
        max-width: 34rem;
        margin: .5rem 1rem .5rem 0;
    }
    .edw-dialog[data-position="bottom-bar"] .edw-actions {
        width: fit-content;
        max-width: 100%;
    }
    .edw-dialog[data-position="bottom-bar"] .edw-actions button {
        flex: 1 1 auto;
    }
}
