.dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  margin: auto;
}

.dialog::backdrop {
  background: rgb(0 0 0 / 45%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dialog-sheet {
  position: relative;
  width: min(520px, calc(100vw - 40px));
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sheet);
  outline: none;
}

.dialog[open] .dialog-sheet {
  animation: sheet-in 0.45s var(--ease-out) both;
}

.dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@media (width <= 600px) {
  .dialog {
    margin: auto 0 0;
    width: 100vw;
  }

  .dialog-sheet {
    width: 100vw;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .dialog[open] .dialog-sheet {
    animation: sheet-up 0.4s var(--ease-out) both;
  }

  @keyframes sheet-up {
    from {
      transform: translateY(100%);
    }

    to {
      transform: none;
    }
  }
}
