/* ===========================
   Terminal / Modal
   =========================== */

.tm-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.9);
  z-index:1000;
}

.tm-dialog{
  position:fixed;
  z-index:1001;
  top:50%; left:50%;
  transform:translate(-50%,-50%);
  width:min(640px, calc(100% - 32px));
  border:1px solid var(--brand);
  background:transparent;
  box-shadow:0 20px 60px rgba(0,0,0,.4);
}

.tm-header{
  background:var(--brand);
  color:#000;
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 12px;
}
.tm-title{ color:#000; font-family:var(--mono); font-size:14px; font-weight:500; }
.tm-close{ appearance:none; border:0; background:transparent; padding:4px; line-height:0; cursor:pointer; }
.tm-close .tm-close-icon svg{ display:block; }

.tm-body{
  background:#070D0C;
  padding:16px;
  height:500px; max-height:500px;
  overflow:auto;
  overscroll-behavior:contain;
}

/* scroll minimalista (desktop) */
.tm-body{ scrollbar-width:thin; scrollbar-color:#294A44 transparent; }
.tm-body::-webkit-scrollbar{ width:8px; height:6px; }
.tm-body::-webkit-scrollbar-track{ background:transparent; }
.tm-body::-webkit-scrollbar-thumb{ background:#294A44; border-radius:8px; }

/* Terminal */
.tm-terminal{
  font-family:var(--mono);
  font-size:14px;
  color:var(--mono-dim);
  white-space:nowrap;
  line-height:16px !important;  /* separación entre líneas */
}

/* Bloques (entre secciones) */
.tm-block + .tm-block{ margin-top:32px; }

/* Aparición base */
.tm-line,
.tm-leader{ opacity:0; transform:translateY(2px); transition:opacity .18s ease, transform .18s ease; }
.tm-line.show,
.tm-leader.show{ opacity:1; transform:none; }

/* Dot-leader con puntos reales y gap fijo */
.tm-leader{ display:flex; align-items:baseline; }
.tm-leader .k{ white-space:nowrap; }
.tm-leader .v{ white-space:nowrap; }

.tm-leader .dots{
  flex:1 1 auto;
  overflow:hidden; white-space:nowrap;
  margin-left:8px; margin-right:16px; /* GAP fijo antes del valor */
  transform:translateY(-0.12em);
  opacity:0;                         /* aparece al revelar la fila */
  line-height:1;
}
.tm-leader .dots::before{
  content:"................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................";
  display:block;
}
.tm-leader.dots-on .dots{ opacity:.75; transition:opacity .18s ease; }

/* Links */
.tm-link{
  color:var(--brand);
  text-decoration:underline;
  text-underline-offset:2px;
}
.tm-link:hover{ color:#07C790; }

/* Cursor final */
.tm-terminal.cursor-live::after{
  content:"_";
  margin-left:4px;
  animation:tm-blink 1s step-start infinite;
}
@keyframes tm-blink{ 50%{ opacity:0; } }

/* Bloquear scroll de página al abrir modal */
body.modal-open{ overflow:hidden; }

/* Móvil: ocultar barra horizontal (sigue scrolleable) */
@media (max-width:480px){
  .tm-dialog{ width:calc(100% - 16px); }
  .tm-body{ scrollbar-width:none; }
  .tm-body::-webkit-scrollbar{ width:0; height:0; display:none; }
}
