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

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

.ms {
  box-sizing: border-box;
  width: min(300px, 92vw);
  border: 1px solid rgb(21.7568627451%, 20.3058823529%, 21.3960784314%);
  border-radius: 16px;
  background: #17141a;
  overflow: hidden;
  color: #fff7e6;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 12px;
  line-height: 26px;
}

.ms__head {
  display: grid;
  grid-template-columns: 1fr 72px 72px;
  height: 26px;
  border-bottom: 1px solid rgb(21.7568627451%, 20.3058823529%, 21.3960784314%);
  background: rgb(15.3882352941%, 14.0745098039%, 15.7960784314%);
}

.ms__h {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.58);
  font-family: inherit;
  font-size: 11px;
  line-height: 26px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.ms__h--text {
  cursor: default;
}

.ms__h.is-on {
  color: #5b8cf8;
}

.ms__h:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: -2px;
}

.ms__caret {
  display: inline-flex;
  width: 10px;
  height: 10px;
  opacity: 0.28;
  transform: rotate(180deg);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ms__h.is-on .ms__caret {
  opacity: 1;
}

.ms__h[aria-sort=ascending] .ms__caret {
  transform: rotate(0deg);
}

.ms__ord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #2f6df6;
  color: #fff7e6;
  font-size: 9px;
  line-height: 12px;
  font-weight: 700;
}

.ms__ord[hidden] {
  display: none;
}

.ms__row {
  display: grid;
  grid-template-columns: 1fr 72px 72px;
  height: 26px;
  background: #17141a;
  will-change: transform;
}

.ms__row + .ms__row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ms__row > * {
  padding: 0 8px;
  font-size: 12px;
  line-height: 26px;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
}

.ms__row b {
  color: #4cd4a6;
  font-weight: 700;
}

.ms__row > :last-child {
  color: rgba(255, 255, 255, 0.5);
}

.ms.is-demo .ms__ord {
  display: inline-flex;
  animation-name: ms-ord;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ms.is-demo #ms-date {
  animation-name: ms-date-on;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ms.is-demo #ms-date .ms__caret {
  transition: none;
  animation-name: ms-date-caret;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
}

.ms.is-demo .ms__row {
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ms.is-demo .ms__row:nth-child(1) {
  animation-name: ms-down-a;
}

.ms.is-demo .ms__row:nth-child(2) {
  animation-name: ms-up-a;
  z-index: 2;
  position: relative;
}

.ms.is-demo .ms__row:nth-child(3) {
  animation-name: ms-down-b;
}

.ms.is-demo .ms__row:nth-child(4) {
  animation-name: ms-up-b;
  z-index: 2;
  position: relative;
}

@keyframes ms-down-a {
  0% {
    transform: translateY(0);
  }
  14% {
    transform: translateY(0);
  }
  32% {
    transform: translateY(26px);
  }
  62% {
    transform: translateY(26px);
  }
  78% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes ms-up-a {
  0% {
    transform: translateY(0);
    box-shadow: none;
  }
  14% {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  32% {
    transform: translateY(-26px);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  36% {
    transform: translateY(-26px);
    box-shadow: none;
  }
  62% {
    transform: translateY(-26px);
    box-shadow: none;
  }
  78% {
    transform: translateY(0);
    box-shadow: none;
  }
  100% {
    transform: translateY(0);
    box-shadow: none;
  }
}
@keyframes ms-down-b {
  0% {
    transform: translateY(0);
  }
  34% {
    transform: translateY(0);
  }
  52% {
    transform: translateY(26px);
  }
  66% {
    transform: translateY(26px);
  }
  82% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(0);
  }
}
@keyframes ms-up-b {
  0% {
    transform: translateY(0);
    box-shadow: none;
  }
  34% {
    transform: translateY(0);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  52% {
    transform: translateY(-26px);
    box-shadow: 0 6px 12px rgba(23, 20, 26, 0.32);
  }
  56% {
    transform: translateY(-26px);
    box-shadow: none;
  }
  66% {
    transform: translateY(-26px);
    box-shadow: none;
  }
  82% {
    transform: translateY(0);
    box-shadow: none;
  }
  100% {
    transform: translateY(0);
    box-shadow: none;
  }
}
@keyframes ms-ord {
  0% {
    opacity: 0;
  }
  14% {
    opacity: 1;
  }
  60% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ms-date-on {
  0% {
    color: rgba(255, 255, 255, 0.58);
  }
  14% {
    color: #2f6df6;
  }
  60% {
    color: rgba(255, 255, 255, 0.58);
  }
  100% {
    color: rgba(255, 255, 255, 0.58);
  }
}
@keyframes ms-date-caret {
  0% {
    opacity: 0.28;
    transform: rotate(180deg);
  }
  14% {
    opacity: 1;
    transform: rotate(180deg);
  }
  30% {
    opacity: 1;
    transform: rotate(0deg);
  }
  60% {
    opacity: 1;
    transform: rotate(0deg);
  }
  70% {
    opacity: 0.28;
    transform: rotate(180deg);
  }
  100% {
    opacity: 0.28;
    transform: rotate(180deg);
  }
}
@media (max-width: 340px) {
  .ms__head, .ms__row {
    grid-template-columns: 1fr 56px 60px;
  }
  .ms__h, .ms__row > * {
    padding: 0 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ms.is-demo .ms__row,
  .ms.is-demo .ms__ord,
  .ms.is-demo #ms-date,
  .ms.is-demo #ms-date .ms__caret {
    animation: none !important;
  }
  .ms.is-demo .ms__ord {
    opacity: 1;
  }
  .ms.is-demo #ms-date {
    color: #2f6df6;
  }
  .ms.is-demo #ms-date .ms__caret {
    opacity: 1;
    transform: rotate(0deg);
  }
  .ms__caret {
    transition: none;
  }
}
