.site-popup-notice-slot {
  display: contents;
}

.site-popup-notice-root {
  display: contents;
  --spn-width: 460px;
  --spn-height: 340px;
  --spn-button-width: 84px;
  --spn-button-height: 30px;
}

.site-popup-notice {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  opacity: 0;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  pointer-events: none;
  position: fixed;
  transition: opacity 160ms ease;
  z-index: 2147483000;
}

.site-popup-notice.is-open {
  opacity: 1;
  pointer-events: auto;
}

.site-popup-notice__backdrop {
  -webkit-backdrop-filter: blur(8px) saturate(1.06);
  backdrop-filter: blur(8px) saturate(1.06);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.42), rgba(15, 23, 42, 0.24)),
    rgba(15, 23, 42, 0.30);
  inset: 0;
  position: absolute;
}

.site-popup-notice__dialog {
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
  backdrop-filter: blur(22px) saturate(1.18);
  background:
    linear-gradient(180deg, hsl(var(--card, 0 0% 100%) / 0.90), hsl(var(--background, 0 0% 100%) / 0.72)),
    hsl(var(--card, 0 0% 100%) / 0.62);
  border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.58);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 24px 60px rgba(15, 23, 42, 0.22),
    0 6px 18px rgba(15, 23, 42, 0.10);
  color: hsl(var(--foreground, 222.2 84% 4.9%));
  display: flex;
  flex-direction: column;
  height: min(var(--spn-height), calc(100dvh - 32px));
  max-height: min(var(--spn-height), calc(100dvh - 32px));
  max-width: min(var(--spn-width), calc(100vw - 28px));
  min-height: min(180px, calc(100dvh - 32px));
  outline: none;
  overflow: hidden;
  position: relative;
  transform: translateY(10px) scale(0.98);
  transition: transform 180ms ease;
  width: min(var(--spn-width), calc(100vw - 28px));
}

.site-popup-notice__dialog::before {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  content: "";
  height: 1px;
  inset: 0 0 auto;
  pointer-events: none;
  position: absolute;
}

.site-popup-notice.is-open .site-popup-notice__dialog {
  transform: translateY(0) scale(1);
}

.site-popup-notice__header {
  border-bottom: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.54);
  flex: 0 0 auto;
  padding: 18px 22px;
}

.site-popup-notice__title {
  color: hsl(var(--foreground, 222.2 84% 4.9%));
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.site-popup-notice__content {
  flex: 1 1 auto;
  font-size: 15px;
  line-height: 1.8;
  overflow: auto;
  padding: 22px;
}

.site-popup-notice__content :where(p, ul, ol, blockquote, table) {
  margin-bottom: 12px;
}

.site-popup-notice__content :where(h1, h2, h3, h4) {
  font-weight: 700;
  line-height: 1.4;
  margin: 14px 0 10px;
}

.site-popup-notice__content a {
  color: hsl(var(--primary, 221.2 83.2% 53.3%));
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-popup-notice__content img,
.site-popup-notice__content video {
  border-radius: 6px;
  height: auto;
  max-width: 100%;
}

.site-popup-notice__footer {
  align-items: center;
  border-top: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.50);
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  padding: 14px 22px;
}

.site-popup-notice__confirm {
  align-items: center;
  background:
    linear-gradient(180deg, hsl(var(--primary, 221.2 83.2% 53.3%) / 0.96), hsl(var(--primary, 221.2 83.2% 53.3%) / 0.88));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 22px hsl(var(--foreground, 222.2 84% 4.9%) / 0.16);
  color: hsl(var(--primary-foreground, 210 40% 98%));
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  height: var(--spn-button-height);
  justify-content: center;
  min-height: 30px;
  min-width: 72px;
  padding: 0 12px;
  transition: filter 160ms ease, transform 160ms ease, box-shadow 160ms ease;
  width: min(var(--spn-button-width), 100%);
}

.site-popup-notice__confirm:hover {
  filter: brightness(0.96);
  box-shadow: 0 12px 24px hsl(var(--foreground, 222.2 84% 4.9%) / 0.20);
  transform: translateY(-1px);
}

.site-popup-notice-lock {
  overflow: hidden;
}

.site-popup-notice-admin-preview {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.36), rgba(71, 85, 105, 0.18)),
    hsl(var(--muted, 210 40% 96.1%));
  border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.68);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 440px;
  overflow: auto;
  padding: 24px;
}

.site-popup-notice-admin-preview__dialog {
  -webkit-backdrop-filter: blur(18px) saturate(1.16);
  backdrop-filter: blur(18px) saturate(1.16);
  background:
    linear-gradient(180deg, hsl(var(--card, 0 0% 100%) / 0.90), hsl(var(--background, 0 0% 100%) / 0.70)),
    hsl(var(--card, 0 0% 100%) / 0.58);
  border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.62);
  border-radius: 8px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 18px 50px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow: hidden;
}

.site-popup-notice-admin-preview__header,
.site-popup-notice-admin-preview__footer {
  flex: 0 0 auto;
  padding: 14px 18px;
}

.site-popup-notice-admin-preview__header {
  border-bottom: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.54);
}

.site-popup-notice-admin-preview__content {
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.7;
  overflow: auto;
  padding: 18px;
}

.site-popup-notice-admin-preview__footer {
  border-top: 1px solid hsl(var(--border, 214.3 31.8% 91.4%) / 0.50);
  display: flex;
  justify-content: flex-end;
}

.site-popup-notice-admin-preview__footer button {
  background:
    linear-gradient(180deg, hsl(var(--primary, 221.2 83.2% 53.3%) / 0.96), hsl(var(--primary, 221.2 83.2% 53.3%) / 0.88));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 24px hsl(var(--foreground, 222.2 84% 4.9%) / 0.18);
  color: hsl(var(--primary-foreground, 210 40% 98%));
  font-size: 14px;
  font-weight: 700;
  padding: 0 16px;
}

@media (max-width: 640px) {
  .site-popup-notice {
    align-items: center;
    padding: 12px;
  }

  .site-popup-notice__dialog {
    max-height: calc(100dvh - 24px);
    width: 100%;
  }

  .site-popup-notice__header {
    padding: 18px 18px;
  }

  .site-popup-notice__content {
    font-size: 15px;
    padding: 18px;
  }

  .site-popup-notice__footer {
    padding: 14px 18px;
  }

  .site-popup-notice__confirm {
    max-width: 100%;
  }

  .site-popup-notice-admin-preview {
    min-height: 360px;
    padding: 14px;
  }
}
