.editor-codigo-contenedor {
  position: relative;
  display: flex;
  height: 100%;
  min-height: 0;
  font-family: var(--fuente-mono);
  font-size: 0.95rem;
  line-height: 1.5;
  background: #100d0c;
  border: 1px solid var(--negro-borde);
  border-radius: var(--radio-borde);
  overflow: hidden;
}

.editor-numeros-linea {
  flex-shrink: 0;
  width: var(--ancho-numeros-linea);
  height: 100%;
  padding: 1rem 0;
  overflow: hidden;
  text-align: right;
  color: var(--hueso-tenue);
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid var(--negro-borde);
  user-select: none;
}

.editor-numeros-linea span {
  display: block;
  padding-right: 0.4rem;
}

.editor-codigo-area {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.editor-codigo-resaltado,
.editor-codigo-textarea {
  margin: 0;
  padding: 1rem;
  font: inherit;
  line-height: inherit;
  white-space: pre;
  tab-size: 4;
}

.editor-codigo-resaltado {
  position: absolute;
  inset: 0;
  overflow: auto;
  color: var(--hueso);
  pointer-events: none;
}

.editor-codigo-resaltado::-webkit-scrollbar {
  display: none; /* el scroll real lo maneja el textarea; esta capa solo lo refleja */
}

.editor-codigo-textarea {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: var(--hueso);
  overflow: auto;
}

.editor-codigo-textarea::selection {
  background: rgba(200, 40, 63, 0.4);
}

/* Colores de sintaxis */
.tok-clave      { color: #ff7fb0; font-weight: 600; }
.tok-booleano   { color: #ff4d4d; font-weight: 600; }
.tok-numero     { color: #61bd61; }
.tok-cadena     { color: #974107; }
.tok-comentario { color: var(--hueso-tenue); font-style: italic; }
.tok-simbolo    { color: #be9c03; }
.tok-funcion    { color: #eff8a0; }
.tok-fstring       { color: #3d84f5; font-weight: 700; }
.tok-clave-especial { color: #8ec7ff; }