.homepage-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}

.homepage-popup[hidden] {
  display: none !important;
}

.homepage-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
}

.homepage-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 750px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow: hidden;
  padding: 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  box-sizing: border-box;
  color: #222;
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

.homepage-popup__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 32px 40px 16px;
  background: #fff;
}

.homepage-popup__title {
  margin: 0;
  padding-right: 8px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}

.homepage-popup__title--empty {
  flex: 1;
}

.homepage-popup__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -8px -12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #222;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.homepage-popup__close:hover,
.homepage-popup__close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

.homepage-popup__content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 40px 40px;
  font-size: 1rem;
  line-height: 1.55;
  color: #333;
}

.homepage-popup__content > *:first-child {
  margin-top: 0;
}

.homepage-popup__content > *:last-child {
  margin-bottom: 0;
}

.homepage-popup__content p {
  margin: 0 0 1em;
}

.homepage-popup__content ul,
.homepage-popup__content ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.homepage-popup__content li {
  margin-bottom: 0.35em;
}

.homepage-popup__content li::marker {
  color: #888;
}

.homepage-popup__content a {
  color: inherit;
  text-decoration: underline;
}

body.homepage-popup-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

@media (max-width: 640px) {
  .homepage-popup {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    align-items: center;
  }

  .homepage-popup__dialog {
    max-height: 75vh;
    max-height: 75dvh;
    border-radius: 16px;
  }

  .homepage-popup__header {
    padding: 20px 16px 12px 20px;
  }

  .homepage-popup__title {
    font-size: 1.2rem;
  }

  .homepage-popup__close {
    width: 48px;
    height: 48px;
    margin: -6px -8px 0 0;
  }

  .homepage-popup__content {
    padding: 0 20px 24px;
  }
}
