body.modal-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

body.modal-open .layout {
  pointer-events: none;
}

body.modal-open #modal-root {
  pointer-events: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.modal {
  align-items: flex-start;
  padding: 14px;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.modal::before {
  content: "";
  display: block;
  min-height: 4px;
}

.modal-card {
  margin: 0 auto;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.modal-card--wide {
  width: min(680px, 96vw);
}

.admin-confirmation-card {
  width: min(440px, 96vw);
}

.admin-confirmation-subject {
  margin-top: 4px;
  color: #526176;
  font-size: 13px;
  font-weight: 700;
}

.admin-confirmation-message {
  margin: 12px 0 0;
  color: #526176;
  line-height: 1.5;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.modal-head h3 {
  margin: 0;
}

.modal-note {
  margin-top: 6px;
}

.modal-section {
  margin-top: 10px;
}

.modal-grid {
  margin-top: 8px;
}

.modal-actions-end {
  margin-top: 10px;
  justify-content: flex-end;
}

.modal-actions-between {
  margin-top: 10px;
  justify-content: space-between;
  align-items: center;
}

.modal-card > .modal-actions-end,
.modal-card > .modal-actions-between {
  position: sticky;
  bottom: -1px;
  z-index: 2;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: 2px;
}

@media (max-width: 960px) {
  .modal-card,
  .modal-card--wide {
    width: min(100%, 760px);
    padding: 14px;
  }

  .modal-head {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions-end,
  .modal-actions-between {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .modal {
    padding: 10px;
  }

  .modal-card,
  .modal-card--wide {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 10px;
    padding: 12px;
  }

  .modal-actions-end > *,
  .modal-actions-between > * {
    width: 100%;
  }
}
