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

.dh {
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: min(100%, 408px);
  padding: 12px;
  border: 1px solid rgba(23, 20, 26, 0.14);
  border-radius: 16px;
  background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

.dh__stat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: rgba(23, 20, 26, 0.72);
  font-weight: 600;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.4;
}

.dh__chip {
  box-sizing: border-box;
  padding: 0 4px;
  border-radius: 4px;
  color: #17141a;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.dh__chip--add {
  background: rgba(43, 157, 116, 0.26);
}

.dh__chip--del {
  background: rgba(194, 54, 26, 0.18);
}

.dh__statTxt {
  flex: 1 1 auto;
  min-width: 0;
}

.dh__hunk {
  border: 1px solid rgba(23, 20, 26, 0.14);
  border-radius: 8px;
  overflow: hidden;
}

.dh__head {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  padding: 4px 8px;
  border: 0;
  border-radius: 0;
  background: rgba(23, 20, 26, 0.05);
  color: rgba(23, 20, 26, 0.72);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 10px);
  line-height: 1.6;
}

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

.dh__caret {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 12px;
  color: #17141a;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dh__head[aria-expanded=true] .dh__caret {
  transform: rotate(90deg);
}

.dh__at {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.dh__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dh__head[aria-expanded=true] + .dh__body {
  grid-template-rows: 1fr;
}

.dh__inner {
  min-height: 0;
  overflow: hidden;
}

.dh__row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  box-sizing: border-box;
  padding: 0 8px;
  color: #17141a;
  font-weight: 600;
  font-size: clamp(9px, 2.6vw, 11px);
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
}

.dh__sign {
  flex: 0 0 auto;
  width: 8px;
  font-weight: 800;
}

.dh__row--add {
  position: relative;
  background: rgba(43, 157, 116, 0.22);
}

.dh__row--add::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #2b9d74;
  transform: scaleY(1);
  transform-origin: center top;
}

.dh__row--del {
  background: rgba(194, 54, 26, 0.14);
}

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

@keyframes dhFold {
  0%, 6% {
    grid-template-rows: 0fr;
  }
  7%, 100% {
    grid-template-rows: 1fr;
  }
}
.dh.is-demo .dh__caret {
  animation-name: dhCaret;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

@keyframes dhCaret {
  0%, 6% {
    transform: rotate(0deg);
  }
  26%, 100% {
    transform: rotate(90deg);
  }
}
.dh.is-demo .dh__row--add:nth-of-type(3)::before {
  animation-name: dhMark1;
}

.dh.is-demo .dh__row--add:nth-of-type(4)::before {
  animation-name: dhMark2;
}

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

@keyframes dhMark1 {
  0%, 34% {
    transform: scaleY(0);
  }
  46%, 100% {
    transform: scaleY(1);
  }
}
@keyframes dhMark2 {
  0%, 48% {
    transform: scaleY(0);
  }
  60%, 100% {
    transform: scaleY(1);
  }
}
.dh.is-demo .dh__chip {
  animation-name: dhChip;
  animation-duration: 2s;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
  animation-delay: 0s;
}

.dh.is-demo .dh__chip--del {
  animation-delay: 100ms;
}

@keyframes dhChip {
  0%, 68% {
    transform: scale(1);
  }
  74% {
    transform: scale(1.22);
  }
  82%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .dh {
    padding: 8px;
    gap: 4px;
  }
  .dh__head, .dh__row {
    padding-left: 4px;
    padding-right: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dh.is-demo .dh__body,
  .dh.is-demo .dh__caret,
  .dh.is-demo .dh__chip,
  .dh.is-demo .dh__row--add::before {
    animation: none !important;
  }
  .dh.is-demo .dh__body {
    grid-template-rows: 1fr !important;
  }
  .dh.is-demo .dh__caret {
    transform: rotate(90deg) !important;
  }
  .dh__body, .dh__caret {
    transition: none !important;
  }
}
