.bg-popup {
  width: min(calc(100vw - 32px), var(--bg-popup-width, 640px));
  max-width: none;
  max-height: min(calc(100vh - 32px), var(--bg-popup-max-height, 900px));
  padding: 0;
  border: 0;
  border-radius: var(--bg-popup-radius, 12px);
  background: var(--bg-popup-background, #fff);
  color: #1f2937;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .25);
  overflow: auto;
}

.bg-popup::backdrop {
  background: rgba(15, 23, 42, .65);
}

.bg-popup--top {
  margin: 24px auto auto;
}

.bg-popup--bottom {
  margin: auto auto 24px;
}

.bg-popup-is-open {
  overflow: hidden;
}

.bg-popup__content {
  min-width: 0;
}

.bg-popup > button.bg-popup__close {
  all: unset;
  box-sizing: border-box !important;
  position: absolute !important;
  z-index: 20;
  top: var(--bg-popup-close-top, 8px) !important;
  right: var(--bg-popup-close-right, 8px) !important;
  bottom: auto !important;
  left: auto !important;
  display: grid !important;
  place-items: center;
  width: var(--bg-popup-close-size, 36px) !important;
  min-width: 0 !important;
  max-width: none !important;
  height: var(--bg-popup-close-size, 36px) !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--bg-popup-close-radius, 50%) !important;
  background-color: rgba(255, 255, 255, .9) !important;
  background-color: color-mix(in srgb, var(--bg-popup-close-background, #fff) var(--bg-popup-close-background-opacity, 90%), transparent) !important;
  background-image: none !important;
  color: var(--bg-popup-close-color, #111827) !important;
  box-shadow: none !important;
  line-height: 1 !important;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.bg-popup > button.bg-popup__close:hover,
.bg-popup > button.bg-popup__close:focus-visible {
  background-color: var(--bg-popup-close-hover-background, #f3f4f6) !important;
  color: var(--bg-popup-close-hover-color, #111827) !important;
}

.bg-popup > button.bg-popup__close:focus-visible {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px;
}

.bg-popup > button.bg-popup__close svg {
  display: block !important;
  width: var(--bg-popup-close-icon-size, 20px) !important;
  height: var(--bg-popup-close-icon-size, 20px) !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
  stroke-linecap: round;
}

.bg-popup > button.bg-popup__close svg path {
  fill: none !important;
}

.bg-popup > button.bg-popup__close::before,
.bg-popup > button.bg-popup__close::after {
  content: none !important;
}

@media (max-width: 600px) {
  .bg-popup {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}
