/* ==========================================================================
   Nocturne — dialogs (spec §3.9): native <dialog> + .dlg kit, and Bootstrap
   .modal mapped onto the same look (surface-2, 22 px radius, shadow-4,
   blurred scrim). Modal ids/data-* contracts are untouched — this is CSS only.
   ========================================================================== */

dialog { border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface-2); color: var(--text); padding: 26px; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-4); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.dlg { display: flex; flex-direction: column; gap: 16px; }
.dlg-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dlg-h h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.dlg-f { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }

/* Bootstrap modal */
.modal {
    --bs-modal-bg: var(--surface-2);
    --bs-modal-color: var(--text);
    --bs-modal-border-color: var(--line-2);
    --bs-modal-border-width: 1px;
    --bs-modal-border-radius: 22px;
    --bs-modal-inner-border-radius: 21px;
    --bs-modal-box-shadow: var(--shadow-4);
    --bs-modal-padding: 20px 26px;
    --bs-modal-header-padding: 22px 26px 6px;
    --bs-modal-header-border-width: 0;
    --bs-modal-footer-border-width: 0;
    --bs-modal-footer-gap: 8px;
    --bs-modal-title-line-height: 1.3;
    --bs-modal-width: 520px;
}
.modal-content { box-shadow: var(--shadow-4); }
.modal-header { align-items: center; gap: 12px; }
.modal-header .btn-close { margin: -4px -8px -4px auto; }
.modal-title { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.modal-footer { padding: 12px 26px 22px; }
.modal-footer > * { margin: 0; }
.modal-backdrop.show { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-backdrop { --bs-backdrop-bg: #050407; --bs-backdrop-opacity: .66; }
:root[data-theme="light"] .modal-backdrop { --bs-backdrop-bg: #17151B; --bs-backdrop-opacity: .4; }
@media (max-width: 575.98px) {
    .modal-dialog { margin: 12px; }
}

/* Offcanvas (rare) */
.offcanvas { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--text); --bs-offcanvas-border-color: var(--line-2); --bs-offcanvas-box-shadow: var(--shadow-4); }
