/* cz-modal — painel central com contorno discreto
   Usa o <dialog> nativo: Esc fecha, o foco fica preso dentro e volta ao botão de origem.
   Estrutura: dialog.cz-modal > .cz-modal__header (h2 + button.cz-modal__close) + .cz-modal__body + .cz-modal__footer
   Comportamento: cz-modal.js (abrir com data-cz-modal-open="id", fechar com data-cz-modal-close) */

.cz-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: var(--cz-stroke) solid var(--cz-border-strong);
  border-radius: var(--cz-radius-md);
  background: linear-gradient(180deg, var(--cz-surface-raised), var(--cz-surface) 40%);
  color: var(--cz-text);
  box-shadow: var(--cz-glow-strong), var(--cz-shadow-deep);
  overflow: auto;
}
.cz-modal::backdrop {
  background: color-mix(in srgb, var(--cz-surface-sunken) 72%, transparent);
  backdrop-filter: blur(4px);
}
.cz-modal[open] { animation: cz-modal-in var(--cz-duration-base) var(--cz-ease-out) both; }
@keyframes cz-modal-in {
  from { opacity: 0.001; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.cz-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cz-space-4);
  padding: var(--cz-space-4) var(--cz-space-6);
  border-bottom: var(--cz-stroke) solid var(--cz-border-faint);
}
.cz-modal__header h2 { font-size: var(--cz-text-lg); }

.cz-modal__close {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: var(--cz-stroke) solid var(--cz-border);
  border-radius: var(--cz-radius-sm);
  background: transparent;
  color: var(--cz-cyan);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: box-shadow var(--cz-duration-fast) var(--cz-ease);
}
.cz-modal__close:hover { box-shadow: var(--cz-glow); }

.cz-modal__body { display: flex; flex-direction: column; gap: var(--cz-space-4); padding: var(--cz-space-6); color: var(--cz-muted); }
.cz-modal__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--cz-space-3);
  padding: var(--cz-space-4) var(--cz-space-6) var(--cz-space-6);
}
