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

.fr {
  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.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

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

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

.fr__name {
  flex: 1 1 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;
}

.fr__hint {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #beb7ad;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 10px;
  line-height: 1.4;
}

.fr__wrap {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 156px;
}

.fr__hl, .fr__ta {
  grid-area: 1/1;
}

.fr__ta, .fr__hl {
  box-sizing: border-box;
  margin: 0;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: clamp(11px, 3vw, 13px);
  line-height: 20px;
  letter-spacing: 0;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.fr__hl::-webkit-scrollbar, .fr__ta::-webkit-scrollbar {
  display: none;
}

.fr__hl {
  background: rgba(0, 0, 0, 0.28);
  color: #fff7e6;
  pointer-events: none;
}

.fr__ta {
  background: transparent;
  color: transparent;
  caret-color: #ffd23f;
  resize: none;
  -webkit-text-fill-color: transparent;
}

.fr__ta::selection {
  background: rgba(255, 210, 63, 0.32);
}

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

.fr__m {
  background: transparent;
  color: inherit;
  border-radius: 4px;
}

.fr.is-find .fr__m {
  background: #ffd23f;
  color: #17141a;
}

.fr.is-find .fr__m--cur {
  background: #ff4d1f;
  color: #17141a;
}

.fr__find {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: #231f28;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), visibility 220ms;
}

.fr.is-find .fr__find {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.fr__row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fr__fico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffd23f;
  font-size: 14px;
}

.fr__q, .fr__r {
  flex: 1 1 auto;
  min-width: 0;
  box-sizing: border-box;
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff7e6;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 12px;
  line-height: 24px;
}

.fr__q::placeholder, .fr__r::placeholder {
  color: #beb7ad;
  opacity: 1;
}

.fr__q:focus-visible, .fr__r:focus-visible {
  outline: 2px solid #2f6df6;
  outline-offset: 1px;
}

.fr__count {
  position: relative;
  flex: 0 0 auto;
  min-width: 40px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffd23f;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
}

.fr__cnum {
  grid-area: 1/1;
  opacity: 0;
}

.fr__nav {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: transparent;
  color: #fff7e6;
  font-size: 14px;
  cursor: pointer;
}

.fr__nav:hover, .fr__nav:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.fr__go {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #0a4fe8;
  color: #fff7e6;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
}

.fr__go:hover, .fr__go:focus-visible {
  outline: 2px solid #ffd23f;
  outline-offset: 2px;
}

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

.fr.is-demo .fr__find {
  animation-name: frBarVis, frBarPop;
  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;
}

.fr.is-demo .fr__m {
  background: #ffd23f;
  color: #17141a;
}

.fr.is-demo .fr__hl mark:nth-of-type(3) {
  animation-name: frM3;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.fr.is-demo .fr__hl mark:nth-of-type(4) {
  animation-name: frM4;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.fr.is-demo .fr__hl mark:nth-of-type(5) {
  animation-name: frM5;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.fr.is-demo .fr__cnum--a {
  animation-name: frCntA;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.fr.is-demo .fr__cnum--b {
  animation-name: frCntB;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

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

@keyframes frBarVis {
  0% {
    opacity: 0;
    visibility: hidden;
  }
  3%, 100% {
    opacity: 1;
    visibility: visible;
  }
}
@keyframes frBarPop {
  0%, 3% {
    transform: translateY(-12px);
  }
  14%, 100% {
    transform: translateY(0);
  }
}
@keyframes frM3 {
  0%, 57% {
    background: #ff4d1f;
    color: #17141a;
  }
  58%, 100% {
    background: #ffd23f;
    color: #17141a;
  }
}
@keyframes frM4 {
  0%, 100% {
    background: #ffd23f;
    color: #17141a;
  }
}
@keyframes frM5 {
  0%, 57% {
    background: #ffd23f;
    color: #17141a;
  }
  58%, 100% {
    background: #ff4d1f;
    color: #17141a;
  }
}
@keyframes frCntA {
  0%, 57% {
    opacity: 1;
  }
  58%, 100% {
    opacity: 0;
  }
}
@keyframes frCntB {
  0%, 57% {
    opacity: 0;
  }
  58%, 100% {
    opacity: 1;
  }
}
@keyframes frGoPulse {
  0%, 70% {
    transform: scale(1);
  }
  76% {
    transform: scale(1.14);
  }
  84%, 100% {
    transform: scale(1);
  }
}
@media (max-width: 340px) {
  .fr {
    gap: 4px;
    padding: 8px;
  }
  .fr__wrap {
    height: 104px;
  }
  .fr__hl, .fr__ta {
    font-size: 11px;
    line-height: 16px;
    padding: 4px;
  }
  .fr__note {
    font-size: 10px;
  }
  .fr__find {
    gap: 4px;
    padding: 4px;
  }
  .fr__q, .fr__r {
    height: 24px;
    font-size: 11px;
    line-height: 22px;
  }
  .fr__count {
    height: 24px;
    min-width: 36px;
    font-size: 10px;
  }
  .fr__nav {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }
  .fr__go {
    height: 24px;
    padding: 0 8px;
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fr.is-demo .fr__find,
  .fr.is-demo .fr__hl mark,
  .fr.is-demo .fr__cnum,
  .fr.is-demo .fr__go {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .fr.is-demo .fr__cnum--b {
    opacity: 0 !important;
  }
}
