.overlay {
  background: rgba(0, 0, 0, 0.5);
  height: var(--visual-viewport-height);
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  z-index: var(--default-modal-overlay-z-index);
}

.modal {
  background-color: var(--Base-Surface-Primary-light-Normal);
  border-radius: var(--Corner-radius-md) var(--Corner-radius-md) 0 0;
  box-shadow: var(--modal-box-shadow);
  width: 100%;
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: var(--default-modal-z-index);
}

.dialog {
  display: flex;
  flex-direction: column;

  /* For removing focus outline when modal opens first time */
  outline: 0 none;

  max-height: 100dvh;
}

.header {
  --button-dimension: 32px;

  box-sizing: content-box;
  display: flex;
  align-items: flex-start;
  min-height: var(--button-dimension);
  position: relative;
  padding: var(--Spacing-x3) var(--Spacing-x3) 0;
}

.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--Spacing-x2);
  overflow: auto;
}

.contentWithActions {
  padding: 0;
}

.contentWithoutActions {
  padding: 0 var(--Spacing-x3) var(--Spacing-x4);
}

.close {
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: var(--Spacing-x2);
  width: var(--button-dimension);
  height: var(--button-dimension);
  display: flex;
  align-items: center;
  padding: 0;
  justify-content: center;
}

.verticalCenter {
  align-items: center;
}

@media screen and (min-width: 768px) {
  .overlay {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .modal {
    left: auto;
    bottom: auto;
    width: auto;
    border-radius: var(--Corner-radius-md);
    max-width: var(--max-width-page);
  }

  .dialog {
    max-height: 90dvh;
  }
}
