
/* Native <dialog> modal. .showModal() draws the ::backdrop. Click on
   the dialog element itself (the backdrop area) closes; click inside
   the panel doesn't. ESC closes natively. */
.modal {
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  width: min(28rem, calc(100vw - 2rem));
  max-height: calc(100vh - 4rem);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.modal--wide { width: min(44rem, calc(100vw - 2rem)); }
.modal--wide .modal__body {
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}
.modal::backdrop {
  background: rgba(28, 27, 24, 0.55);
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--gap-3) var(--gap-4) var(--gap-3) var(--gap-5);
  border-bottom: 1px solid var(--rule);
}
.modal__header h2 { margin: 0; font-size: 1.05rem; }
.modal__close {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}
.modal__close:hover {
  background: rgba(28, 27, 24, 0.06);
  color: var(--ink);
  border: 0;
}
.modal__close:active { transform: none; }
.modal__body {
  padding: var(--gap-5);
}
