.Caret-textarea {
  position: absolute;
  border: none;
  inset: 0;
  padding: 10px 10px 10px 0px;
  font-family: monospace;
  background: transparent;
  color: transparent;
  caret-color: #fff;
  overflow-x: scroll; /* 👈 ONLY THIS SCROLLS */
  z-index: 1;
  width: auto;
  min-width: max-content;
}

::-webkit-scrollbar {
  display: none;
}

.Caret-caret, .Caret-lineCounter, .Caret-textarea {
  overflow: auto;
  overflow-x: auto;
}

.Caret-textarea:focus {
  outline: none;
}

.Caret-highlighted {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  padding: 10px;
  pointer-events: none;
  overflow: visible; /* 👈 IMPORTANT */
  z-index: 2;
  white-space: pre;
  min-width: max-content;
  width: auto;
}

.Caret-caret {
  position: absolute;
  width: 2px !important;              /* 👈 thickness */
  opacity: 0;
  display: none;
  pointer-events: none;
  z-index: 3;
  top: 12px;
  animation: blink 1s step-end infinite;
}

.Caret-textarea,
.Caret-highlighted,
.Caret-lineCounter {
  font: inherit;
  line-height: inherit;
}

.Caret-textarea::selection {
    color: transparent;
    background-color: rgb(79, 79, 249);
}

.Caret-textarea,
.Caret-highlighted {
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
  padding-left: 50px; /* 👈 space for line numbers */
  tab-size: 2;
}

.Caret-lineCounter {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  padding: 10px 5px;
  font-family: monospace;
  font: 18px;
  line-height: 1.5;
  color: .999;
  text-align: right;
  user-select: none;
  opacity: 0.7;
  letter-spacing: 0.5px;
  pointer-events: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  height: fit-content;
  justify-content: space-around;
  z-index: 10;
}

@keyframes blink {
  50% { opacity: 0; }
}

.Caret-caret.dark {
  background: #fff0; /* caret color */
}
.Caret-highlighted.dark {
  color: #fff;
}
.Caret-lineCounter.dark {
  color: #fff;
}