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

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

.frame {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: min(420px, 94vw);
  height: min(260px, 84vh);
  border-radius: 16px;
  background: #fff7e6;
  color: #17141a;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 12px;
  line-height: 1.35;
}

.frame, .frame * {
  box-sizing: border-box;
}

.page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

.brand {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.burger, .xbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(23, 20, 26, 0.12);
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.burger:focus-visible, .xbtn:focus-visible {
  outline: 2px solid #ff4d1f;
  outline-offset: 2px;
}

.body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 0 12px 12px;
}

.skeleton {
  height: 10px;
  margin: 0;
  border-radius: 999px;
  background: rgba(23, 20, 26, 0.14);
}

.cards {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid rgba(23, 20, 26, 0.12);
  border-radius: 8px;
  background: #ffffff;
}

.sw {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.sw--a {
  background: rgba(255, 77, 31, 0.25);
}

.sw--b {
  background: rgba(47, 109, 246, 0.22);
}

.sw--c {
  background: rgba(76, 212, 166, 0.28);
}

.nm {
  font-weight: 600;
}

.veil {
  position: absolute;
  inset: 0;
  background: rgba(23, 20, 26, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.frame.is-open .veil {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(240px, 72%);
  padding: 8px 12px;
  border-left: 1px solid rgba(23, 20, 26, 0.12);
  background: #fff7e6;
  box-shadow: -18px 0 32px rgba(23, 20, 26, 0.28);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.frame.is-open .drawer {
  transform: translateX(0);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
}

.title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.menu {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 32px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.menu button:hover {
  background: rgba(23, 20, 26, 0.06);
}

.menu button:focus-visible {
  outline: 2px solid #ff4d1f;
  outline-offset: 2px;
}

.menu li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.frame.is-open .menu li {
  opacity: 1;
  transform: translateY(0);
}

.frame.is-open .menu li:nth-child(2) {
  transition-delay: 40ms, 40ms;
}

.frame.is-open .menu li:nth-child(3) {
  transition-delay: 80ms, 80ms;
}

.frame.is-open .menu li:nth-child(4) {
  transition-delay: 120ms, 120ms;
}

.frame.is-open .menu li:nth-child(5) {
  transition-delay: 160ms, 160ms;
}

@keyframes sdr-press {
  0%, 4% {
    transform: translateY(0);
  }
  6% {
    transform: translateY(2px);
  }
  8%, 100% {
    transform: translateY(0);
  }
}
@keyframes sdr-xpress {
  0%, 76% {
    transform: translateY(0);
  }
  78% {
    transform: translateY(2px);
  }
  80%, 100% {
    transform: translateY(0);
  }
}
@keyframes sdr-drawer {
  0%, 10% {
    transform: translateX(100%);
  }
  22%, 80% {
    transform: translateX(0);
  }
  88%, 100% {
    transform: translateX(100%);
  }
}
@keyframes sdr-veil {
  0%, 10% {
    opacity: 0;
  }
  22%, 80% {
    opacity: 1;
  }
  88%, 100% {
    opacity: 0;
  }
}
@keyframes sdr-item-cut {
  0%, 16% {
    opacity: 0;
  }
  16.1%, 100% {
    opacity: 1;
  }
}
@keyframes sdr-item-rise {
  0%, 16% {
    transform: translateY(8px);
  }
  26%, 100% {
    transform: translateY(0);
  }
}
.frame.is-demo .burger {
  animation-name: sdr-press;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.frame.is-demo .xbtn {
  animation-name: sdr-xpress;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.frame.is-demo .drawer {
  animation-name: sdr-drawer;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.frame.is-demo .veil {
  animation-name: sdr-veil;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}
.frame.is-demo .menu li {
  animation-name: sdr-item-cut, sdr-item-rise;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.frame.is-demo .menu li:nth-child(2) {
  animation-delay: 120ms, 120ms;
}

.frame.is-demo .menu li:nth-child(3) {
  animation-delay: 240ms, 240ms;
}

.frame.is-demo .menu li:nth-child(4) {
  animation-delay: 360ms, 360ms;
}

.frame.is-demo .menu li:nth-child(5) {
  animation-delay: 480ms, 480ms;
}

@media (max-width: 340px) {
  .bar {
    padding: 4px 8px;
  }
  .brand {
    font-size: 13px;
  }
  .burger, .xbtn {
    width: 28px;
    height: 28px;
  }
  .body {
    gap: 4px;
    padding: 0 8px 8px;
  }
  .card {
    height: 32px;
    gap: 4px;
  }
  .drawer {
    padding: 4px 8px;
  }
  .head {
    margin-bottom: 4px;
  }
  .menu {
    gap: 0;
  }
  .menu button {
    height: 24px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .frame.is-demo .burger,
  .frame.is-demo .xbtn,
  .frame.is-demo .drawer,
  .frame.is-demo .veil,
  .frame.is-demo .menu li {
    animation: none !important;
  }
  .frame.is-demo .veil {
    opacity: 1 !important;
  }
  .frame.is-demo .drawer {
    transform: translateX(0) !important;
  }
  .frame.is-demo .menu li {
    opacity: 1 !important;
    transform: none !important;
  }
}
