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);
}

.mm {
  --mm-track-y: -200px;
  --mm-thumb-y: 53px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(100%, 400px);
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: #231f28;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

.mm__bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mm__ico {
  display: grid;
  place-items: center;
  color: #ffd23f;
  font-size: 15px;
}

.mm__name {
  flex: 0 0 auto;
  color: #fff7e6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
}

.mm__status {
  flex: 1 1 auto;
  color: #beb7ad;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 10px;
  line-height: 1.4;
  text-align: right;
}

.mm__count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 210, 63, 0.18);
  color: #ffd23f;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.4;
}

.mm__body {
  display: flex;
  gap: 8px;
}

.mm__view {
  flex: 1 1 auto;
  height: 160px;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  scrollbar-width: thin;
}

.mm__track {
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  color: #fff7e6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 20px;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
}

.mm__ln {
  display: block;
}

.mm__ln--dim {
  color: #beb7ad;
}

.mm__ln--tok {
  color: #6ec8ff;
}

.mm__map {
  position: relative;
  flex: 0 0 48px;
  height: 160px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.mm__map:active {
  cursor: grabbing;
}

.mm__cv {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.mm__box {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  box-sizing: border-box;
  border: 2px solid #ffd23f;
  border-radius: 4px;
  background: rgba(255, 210, 63, 0.12);
}

.mm__note {
  margin: 0;
  color: #beb7ad;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.mm__status {
  display: inline-grid;
}

.mm__stTop, .mm__stMid {
  grid-area: 1/1;
}

.mm__stMid {
  visibility: hidden;
}

.mm.is-demo .mm__stTop {
  animation-name: mmStTop;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.mm.is-demo .mm__stMid {
  animation-name: mmStMid;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes mmStTop {
  0%, 100% {
    visibility: hidden;
  }
}
@keyframes mmStMid {
  0%, 100% {
    visibility: visible;
  }
}
.mm.is-demo .mm__view {
  overflow: hidden;
}

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

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

@keyframes mmScroll {
  0%, 10% {
    transform: translateY(0);
  }
  50%, 60% {
    transform: translateY(var(--mm-track-y));
  }
  88%, 100% {
    transform: translateY(0);
  }
}
@keyframes mmThumb {
  0%, 10% {
    transform: translateY(0);
  }
  50%, 60% {
    transform: translateY(var(--mm-thumb-y));
  }
  88%, 100% {
    transform: translateY(0);
  }
}
@media (max-width: 340px) {
  .mm {
    gap: 4px;
    padding: 8px;
  }
  .mm__view, .mm__map {
    height: 104px;
  }
  .mm__map {
    flex-basis: 40px;
  }
  .mm__track {
    font-size: 10px;
    line-height: 16px;
    padding: 4px;
  }
  .mm__name {
    font-size: 11px;
  }
  .mm__ico {
    font-size: 13px;
  }
  .mm__status, .mm__count, .mm__note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .mm.is-demo .mm__stTop,
  .mm.is-demo .mm__stMid,
  .mm.is-demo .mm__track,
  .mm.is-demo .mm__box {
    animation: none !important;
    transform: none !important;
  }
}
