::backdrop {
  background: hsl(210deg 5% 15% / 70%);
}

dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 6px;
  box-shadow: 4px 4px 0 0 #00000073;
  border: 1px solid var(--border-color-dialog);
  padding: 0;
  width: min(100vw, 36rem);
  background: var(--background);
}

dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 64px);
}

dialog header {
  border-bottom: 1px solid var(--border-color);
  height: unset;
  line-height: 1.5;
  padding: 16px 30px;
  border-radius: 5px 5px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

dialog header h1 {
  font-family: var(--font-family);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color);
  padding: 0;
  margin: 0;
  border: none;
}

dialog header button.icon-close {
  color: var(--color-dimmed);
  cursor: pointer;
}

dialog header button.icon-close:hover {
  color: var(--color);
}

dialog main {
  font-family: var(--font-family);
  padding: 30px 30px 45px;
  border-radius: 0 0 5px 5px;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: auto;
  height: auto;
  max-height: 100vh;
  background: var(--background);
}

dialog main h2 {
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  border: none;
  padding: 0;
  color: var(--color-dimmed);
}

dialog main button.primary {
  width: min(800px, 100%);
  margin-top: 30px;
}

dialog main p {
  color: var(--color-dimmed);
}

dialog main button {
  outline: none;
  color: var(--color);
  border: none;
  cursor: pointer;
}

dialog .evy-e {
  height: min(50vw, 12rem);
  margin: 32px auto 48px;
  color-scheme: normal;
}

/* --- Large Dialog ----------------------------------------------------- */
dialog.large {
  width: min(100vw, 50rem);
}

dialog.large p {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

dialog.large main button.primary {
  margin-top: 0;
}

@media (max-width: 900px) {
  dialog.large {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;

    /* override browser defaults that offset dialog from main screen edges: */
    max-width: 100vw;
    max-height: 100vh;
  }

  dialog.large form {
    height: 100%;
    max-height: 100%;
  }

  dialog.large header {
    border-radius: 0;
  }

  dialog.large main button.primary {
    margin-top: 32px;
  }
}
