.modal {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.24);
  max-width: min(920px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  padding: 0;
  width: 920px;
}

.modal > form {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
}

.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.modal header,
.modal footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 1.25rem;
  flex: 0 0 auto;
}

.modal header {
  border-bottom: 1px solid var(--color-line);
}

.modal footer {
  border-top: 1px solid var(--color-line);
}

.modal .form-grid {
  overflow-y: auto;
  padding: 1.25rem;
}

.modal .preventive-detail-body,
.modal > form > .list-stack {
  overflow-y: auto;
}

.modal header button {
  background: transparent;
  border: 0;
  color: var(--color-muted);
  cursor: pointer;
}

@media (max-width: 700px) {
  .modal {
    border-radius: 16px;
    max-height: calc(100dvh - 1rem);
    max-width: calc(100vw - 1rem);
    width: calc(100vw - 1rem);
  }

  .modal > form {
    max-height: calc(100dvh - 1rem);
  }

  .modal header,
  .modal footer {
    gap: 0.75rem;
    padding: 0.9rem;
  }

  .modal header h2 {
    font-size: 1rem;
  }

  .modal .form-grid,
  .preventive-detail-body {
    gap: 0.8rem;
    padding: 0.9rem;
  }

  .modal footer .button {
    flex: 1;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }
}
