.alert-dialog {
  width: max-content;
  max-width: min(500px, 100vw);
  max-height: calc(100vh - var(--theme-dialog-viewport-gap, 84px));
  margin: auto;
  overflow-y: auto;
  border: 0;
  border-radius: 4px;
  padding: 30px;
  background: #fff;
  color: var(--theme-alert-copy, var(--ink));
  font-family: var(--theme-alert-font, var(--font-family-ui));
  font-size: var(--theme-alert-size, var(--body-font-size, 14px));
  font-weight: var(--theme-alert-weight, 400);
  line-height: var(--theme-alert-line-height, 14px);
}

.alert-dialog::backdrop {
  background: rgb(0 0 0 / .6);
}

.alert-dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-dialog > header h2 {
  margin: 0;
  color: var(--theme-alert-heading-copy, var(--theme-dialog-heading, #000));
  font-family: var(--theme-alert-heading-font, var(--font-family-heading));
  font-size: 24px;
  font-weight: var(--theme-dialog-heading-weight, 300);
  line-height: var(--theme-alert-heading-line-height, 32px);
  text-transform: var(--theme-dialog-heading-transform, none);
}

.alert-dialog > header button {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: var(--theme-alert-close-radius, 0);
  padding: 1px 6px;
  background: transparent;
  color: #000;
  font: var(--theme-alert-close-font, 13.3333px Arial);
  vertical-align: var(--theme-alert-control-align, baseline);
  cursor: pointer;
}

.alert-dialog > header button::before {
  content: "\002715";
}

.alert-dialog__content {
  margin-block: var(--theme-dialog-content-margin, 2rem);
  color: rgb(0 0 0 / .8);
  line-height: 1.5;
}

.alert-dialog__content p {
  margin: 0 0 20px;
  color: var(--theme-alert-paragraph-copy, inherit);
  font-size: var(--theme-alert-paragraph-size, inherit);
  line-height: var(--theme-alert-paragraph-line-height, inherit);
}

.alert-dialog__content b {
  font-family: var(--theme-alert-bold-font, inherit);
  font-size: var(--theme-alert-bold-size, inherit);
  font-weight: 700;
}

.alert-dialog > footer {
  margin-top: var(--theme-alert-footer-margin, 0);
}

.alert-dialog > footer button {
  float: right;
  min-height: 40px;
  height: var(--theme-alert-button-height, auto);
  margin: 0;
  border: var(--theme-alert-button-border, 0);
  border-radius: var(--theme-alert-button-radius, 0);
  padding: var(--theme-alert-button-padding, 20px);
  background: var(--primaryBtn, var(--brand));
  color: var(--theme-button-copy, #fff);
  font-family: var(--theme-alert-button-font, var(--font-family-heading));
  font-size: var(--theme-alert-button-size, 15px);
  font-weight: var(--theme-alert-button-weight, 400);
  line-height: var(--theme-alert-button-line-height, var(--theme-alert-button-size, 15px));
  letter-spacing: var(--theme-alert-button-letter-spacing, normal);
  text-transform: var(--theme-alert-button-transform, none);
  vertical-align: var(--theme-alert-control-align, baseline);
  box-shadow: var(--theme-alert-button-shadow, none);
  cursor: pointer;
  transition: background .2s linear, color .2s linear;
}

.alert-dialog > footer button:hover {
  background: var(--primaryBtn-hover, var(--brand-hover));
  color: #fff;
}

.alert-dialog button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@supports (height: 100dvh) {
  .alert-dialog {
    max-height: calc(100dvh - var(--theme-dialog-viewport-gap, 84px));
  }
}

@media (max-width: 1020px) {
  .alert-dialog {
    line-height: var(--theme-alert-mobile-line-height, 23px);
  }

  .alert-dialog > header h2 {
    line-height: var(--theme-alert-heading-mobile-line-height, var(--theme-alert-heading-line-height, 26px));
  }

  .alert-dialog > header button::before {
    font-size: var(--theme-alert-close-mobile-size, 1.5rem);
  }

  .alert-dialog > footer {
    margin-top: var(--theme-alert-footer-margin, 2.143em);
    border-top: var(--theme-alert-footer-border, 1px solid #ddd);
    padding-top: var(--theme-alert-footer-padding, 2.143em);
    color: #aaa;
    font-size: var(--theme-alert-footer-size, .875em);
  }

  .alert-dialog > footer button {
    padding: var(--theme-alert-button-mobile-padding, 0 15px);
    height: var(--theme-alert-button-mobile-height, 40px);
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  .alert-dialog > footer button {
    width: 100%;
    margin-top: 5px;
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .alert-dialog__content p {
    font-size: var(--theme-alert-paragraph-mobile-size, inherit);
    line-height: var(--theme-alert-paragraph-mobile-line-height, inherit);
  }
}
