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

.ac {
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-sizing: border-box;
  width: min(100%, 400px);
  padding: 12px;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}

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

.ac__ico {
  display: grid;
  place-items: center;
  color: #2f6df6;
  font-size: 15px;
}

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

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

.ac__field {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  height: 38px;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 8px;
  background: #fff7e6;
}

.ac__hl, .ac__ta {
  grid-area: 1/1;
}

.ac__ta, .ac__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: hidden;
}

.ac__hl {
  color: #17141a;
  pointer-events: none;
}

.ac__ta {
  background: transparent;
  color: transparent;
  caret-color: #17141a;
  resize: none;
  -webkit-text-fill-color: transparent;
}

.ac__ta::selection {
  background: rgba(47, 109, 246, 0.24);
}

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

.ac__mirror {
  position: absolute;
  top: 0;
  left: 0;
  visibility: hidden;
  white-space: pre;
  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;
}

.ac__line {
  position: relative;
  display: block;
}

.ac__base {
  color: #17141a;
}

.ac__frag {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: pre;
  color: #17141a;
}

.ac__word, .ac__u {
  text-decoration: underline;
  text-decoration-color: #2f6df6;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.ac__caret {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #17141a;
  vertical-align: -2px;
}

.ac__pop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 3;
  min-width: 120px;
  box-sizing: border-box;
  padding: 4px;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 12px;
  background: #fff7e6;
  box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1), visibility 220ms;
}

.ac.is-open .ac__pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.ac__opt {
  padding: 4px 8px;
  border-radius: 8px;
  color: #17141a;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

.ac__opt[aria-selected=true] {
  background: #0a4fe8;
  color: #fff7e6;
}

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

.ac__klabel {
  color: rgba(23, 20, 26, 0.72);
  font-weight: 700;
  font-size: 10px;
  line-height: 1.4;
}

.ac__k {
  padding: 4px 8px;
  border: 1px solid rgba(23, 20, 26, 0.16);
  border-radius: 999px;
  background: #ffffff;
  color: #17141a;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
  font-weight: 500;
  font-size: 10px;
  line-height: 1.4;
}

.ac__note {
  margin: 0;
  color: rgba(23, 20, 26, 0.72);
  font-weight: 500;
  font-size: 11px;
  line-height: 1.4;
}

.ac.is-demo .ac__base {
  color: transparent;
}

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

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

.ac.is-demo .ac__pop {
  animation-name: acPopVis, acPopIn;
  animation-duration: 2s, 2s;
  animation-timing-function: steps(1, end), cubic-bezier(0.2, 1.4, 0.4, 1);
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.ac.is-demo #ac-opt0 {
  animation-name: acSel0;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

.ac.is-demo #ac-opt1 {
  animation-name: acSel1;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
  animation-fill-mode: backwards;
}

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

@keyframes acFragA {
  0%, 5% {
    visibility: visible;
  }
  6%, 100% {
    visibility: hidden;
  }
}
@keyframes acFragB {
  0%, 5% {
    visibility: hidden;
  }
  6%, 100% {
    visibility: visible;
  }
}
@keyframes acPopVis {
  0%, 7% {
    opacity: 0;
    visibility: hidden;
  }
  8%, 100% {
    opacity: 1;
    visibility: visible;
  }
}
@keyframes acPopIn {
  0%, 7% {
    transform: translateY(6px);
  }
  18%, 100% {
    transform: translateY(0);
  }
}
@keyframes acSel0 {
  0%, 38% {
    background: #0a4fe8;
    color: #fff7e6;
  }
  42%, 100% {
    background: transparent;
    color: #17141a;
  }
}
@keyframes acSel1 {
  0%, 38% {
    background: transparent;
    color: #17141a;
  }
  42%, 100% {
    background: #0a4fe8;
    color: #fff7e6;
  }
}
@keyframes acBlink {
  0%, 7% {
    opacity: 1;
  }
  8%, 15% {
    opacity: 0;
  }
  16%, 23% {
    opacity: 1;
  }
  24%, 31% {
    opacity: 0;
  }
  32%, 39% {
    opacity: 1;
  }
  40%, 47% {
    opacity: 0;
  }
  48%, 55% {
    opacity: 1;
  }
  56%, 63% {
    opacity: 0;
  }
  64%, 71% {
    opacity: 1;
  }
  72%, 79% {
    opacity: 0;
  }
  80%, 87% {
    opacity: 1;
  }
  88%, 95% {
    opacity: 0;
  }
  96%, 100% {
    opacity: 1;
  }
}
@media (max-width: 340px) {
  .ac {
    gap: 4px;
    padding: 8px;
  }
  .ac__keys > :nth-child(n+6) {
    display: none;
  }
  .ac__field {
    height: 26px;
  }
  .ac__hl, .ac__ta {
    font-size: 11px;
    line-height: 16px;
    padding: 4px;
  }
  .ac__mirror {
    font-size: 11px;
    line-height: 16px;
  }
  .ac__caret {
    height: 12px;
    vertical-align: -2px;
  }
  .ac__opt {
    font-size: 11px;
    padding: 4px;
  }
  .ac__k, .ac__klabel {
    font-size: 10px;
  }
  .ac__name {
    font-size: 11px;
  }
  .ac__note {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ac.is-demo .ac__frag--a,
  .ac.is-demo .ac__frag--b,
  .ac.is-demo .ac__pop,
  .ac.is-demo .ac__caret,
  .ac.is-demo #ac-opt0,
  .ac.is-demo #ac-opt1 {
    animation: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }
  .ac.is-demo .ac__frag--a {
    visibility: hidden !important;
  }
  .ac.is-demo .ac__caret {
    opacity: 1 !important;
  }
}
