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

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

.sf {
  box-sizing: border-box;
  width: min(300px, 88vw);
  border-radius: 16px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
}

.sf__title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: #17141a;
}

.sf__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(23, 20, 26, 0.72);
  border-bottom: 1px solid rgba(23, 20, 26, 0.06);
}

.sf__switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.15);
  cursor: pointer;
  transition: background 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
  flex: 0 0 auto;
}

.sf__switch[aria-checked=true] {
  background: #2f6df6;
}

.sf__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 20, 26, 0.3);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sf__switch[aria-checked=true] .sf__knob {
  transform: translateX(16px);
}

.sf__save {
  margin-top: 16px;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 8px 16px;
  background: #17141a;
  color: #fff7e6;
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.sf__save::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: none;
}

.sf__save.is-busy::before {
  display: block;
  border-color: rgba(255, 247, 230, 0.3);
  border-top-color: #fff7e6;
  animation: sf-spin 0.6s linear infinite;
}

.sf__save.is-done {
  background: #47905f;
}

@keyframes sf-spin {
  to {
    transform: rotate(360deg);
  }
}
.sf__switch.is-demo .sf__knob {
  animation: sf-glow 2s ease-in-out infinite;
}

@keyframes sf-glow {
  0%, 100% {
    box-shadow: 0 1px 3px rgba(23, 20, 26, 0.3), 0 0 0 0 rgba(47, 109, 246, 0);
  }
  50% {
    box-shadow: 0 1px 3px rgba(23, 20, 26, 0.3), 0 0 0 6px rgba(47, 109, 246, 0.18);
  }
}
@media (max-width: 340px) {
  .sf {
    padding: 12px;
  }
  .sf__row {
    font-size: 11px;
  }
}
@media (max-height: 220px) {
  .sf {
    padding: 8px 12px;
  }
  .sf__title {
    margin-bottom: 4px;
  }
  .sf__row {
    padding: 4px 0;
  }
  .sf__save {
    margin-top: 8px;
    padding: 4px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sf__switch.is-demo .sf__knob {
    animation: none !important;
  }
  .sf__save.is-busy::before {
    animation: none !important;
  }
  .sf__switch, .sf__knob {
    transition: none;
  }
}
