html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffd23f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.demo {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.opener {
  border: 0;
  background: transparent;
  color: #17141a;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 4px;
  cursor: pointer;
}

.toast[popover] {
  position: fixed;
  inset: unset;
  top: 16px;
  right: 16px;
  margin: 0;
  border: 0;
  overflow: visible;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(260px, 78vw);
  padding: 16px 40px 16px 16px;
  border-radius: 16px;
  background: #17141a;
  color: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.toast__dot {
  align-self: center;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #2f6df6;
  flex: none;
}

.toast__title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  font-family: inherit;
}

.toast__text {
  margin: 0;
  font-weight: 400;
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
  opacity: 0.78;
}

.toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff7e6;
  opacity: 0.6;
  cursor: pointer;
}
.toast__close:hover, .toast__close:focus-visible {
  opacity: 1;
}

.toast.is-demo {
  animation: pop-loop 2s ease-out infinite;
}

@keyframes pop-loop {
  0% {
    transform: translateY(-14px) scale(0.92);
    opacity: 0;
  }
  16% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  72% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  92% {
    transform: translateY(-6px) scale(0.97);
    opacity: 0;
  }
  100% {
    transform: translateY(-14px) scale(0.92);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast.is-demo {
    animation: none;
    transform: none;
    opacity: 1;
  }
}
