/* Modal, ConfirmDialog, TypedConfirmDialog — C11. Dialogue blanc, rayon 8 px,
   ombre réservée aux superpositions. */
body.modal-open { overflow: hidden; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: var(--space-4);
  background: var(--backdrop);
  animation: backdrop-enter var(--enter) ease-out;
}
.modal {
  display: flex; flex-direction: column;
  width: 100%; max-width: min(640px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-overlay);
  animation: overlay-enter var(--enter) ease-out;
}
.modal:focus { outline: none; }
.modal-small { max-width: min(480px, calc(100vw - 32px)); }
.modal-large { max-width: min(800px, calc(100vw - 32px)); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: var(--text-section); line-height: 26px; }
.modal-body { display: grid; gap: var(--space-4); padding: var(--space-6); overflow-y: auto; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
@keyframes backdrop-enter { from { opacity: 0; } }

@media (max-width: 600px) {
  .modal-backdrop { place-items: end stretch; padding: 0; }
  .modal { max-width: none; max-height: 92dvh; border-radius: 12px 12px 0 0; }
  .modal-body { padding: var(--space-4) var(--space-4) max(var(--space-4), env(safe-area-inset-bottom)); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .button { width: 100%; }
}
