body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(17 24 39 / 0.54);
  padding: 24px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgb(17 24 39 / 0.32);
  padding: 22px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted-foreground);
  font-size: 14px;
}

.modal-close {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 8px;
  background: var(--muted);
  color: var(--foreground);
}

.modal-close:hover {
  background: var(--primary);
  color: #fff;
}

.modal-close::before,
.modal-close::after {
  position: absolute;
  top: 17px;
  left: 10px;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.modal-close::before {
  transform: rotate(45deg);
}

.modal-close::after {
  transform: rotate(-45deg);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.confirmation-panel {
  width: min(440px, 100%);
}

.confirmation-copy {
  margin: -4px 0 22px;
  color: var(--foreground);
  font-size: 15px;
  line-height: 1.45;
}

@media (max-height: 560px) and (min-width: 641px) {
  .modal-backdrop {
    padding: 8px 12px;
  }

  .modal-panel {
    max-height: calc(100vh - 16px);
    padding: 18px 22px;
  }

  .modal-head {
    margin-bottom: 12px;
  }

  .modal-head h2 {
    font-size: 21px;
  }

  .modal-head p {
    margin-top: 2px;
    font-size: 13px;
  }

  .modal-panel .stack {
    gap: 10px;
  }

  .modal-panel .grid {
    gap: 10px 14px;
  }

  .modal-panel label {
    gap: 5px;
    font-size: 12px;
  }

  .modal-panel input,
  .modal-panel textarea,
  .modal-panel .custom-select-button {
    min-height: 40px;
    padding: 8px 10px;
  }

  .modal-actions .button {
    min-height: 40px;
    padding: 8px 14px;
  }
}
