.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  z-index: var(--default-modal-overlay-z-index);
}

.dialog {
  width: min(80dvw, 960px);
  border-radius: var(--Corner-radius-lg);
  background-color: var(--Base-Surface-Primary-light-Normal);
  box-shadow: 0px 4px 24px 0px rgba(38, 32, 30, 0.08);
  overflow: hidden;
}

.header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: var(--Spacing-x2) var(--Spacing-x3);
  border-bottom: 1px solid var(--Base-Border-Subtle);
}

.buttonWrapper {
  display: flex;
  gap: var(--Spacing-x1);
  align-items: center;
}

.badge {
  background-color: var(--Base-Text-Accent);
  border-radius: var(--Corner-radius-xl);
  width: 20px;
  height: 20px;
  color: var(--Base-Surface-Primary-light-Normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.content {
  display: grid;
  gap: var(--Spacing-x4);
  align-content: start;
  padding: var(--Spacing-x4) var(--Spacing-x3);
  overflow-y: auto;
  height: min(calc(80dvh - 180px), 500px);
}

.alertWrapper:not(:empty) {
  padding: var(--Spacing-x2) var(--Spacing-x4) 0;
  border-top: 1px solid var(--Base-Border-Subtle);
}

.alertWrapper:not(:empty) + .footer {
  border-top: none;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: var(--Spacing-x2) var(--Spacing-x4);
  border-top: 1px solid var(--Base-Border-Subtle);
}

.close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

@media screen and (max-width: 767px) {
  .overlay {
    height: var(--visual-viewport-height);
  }

  .dialog {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    width: 100vw;
    border-radius: 0;
  }

  .header {
    display: flex;
    justify-content: flex-end;
    border-bottom: none;
    padding: var(--Spacing-x3) var(--Spacing-x2);
  }

  .title,
  .divider {
    display: none;
  }

  .content {
    height: 100%;
    padding: 0 var(--Spacing-x2) var(--Spacing-x3);
    overflow-y: scroll;
  }

  .alertWrapper:not(:empty) {
    padding: var(--Spacing-x3) var(--Spacing-x2) 0;
  }

  .footer {
    flex-direction: column-reverse;
    gap: var(--Spacing-x3);
    padding: var(--Spacing-x3) var(--Spacing-x2);
    margin-top: auto;
  }
}
