/* ============================================================
   Terminal simulada — look & feel de SSH y consola serial
   ============================================================ */
.term-lab {
  margin: var(--sp-4) 0;
}

.term-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.term-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #0d1424;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--rad-sm);
  cursor: pointer;
  font-weight: 700;
  font-size: var(--fs-base);
  font-family: inherit;
}
.term-mode.active {
  background: var(--efc-green);
  color: var(--efc-black);
  border-color: var(--efc-green);
}
.term-mode .ic {
  font-size: 18px;
}

.term-window {
  background: #050810;
  border: 1px solid #2a3b58;
  border-radius: var(--rad-md);
  overflow: hidden;
  box-shadow: 0 0 0 1px #000, 0 30px 60px rgba(0,0,0,0.5);
}

.term-titlebar {
  background: linear-gradient(180deg, #1a2236 0%, #0d1424 100%);
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  padding: 8px 14px;
  gap: 8px;
  font-size: 13px;
  color: #9ca7c1;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.term-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.term-dot.red    { background: #ff5f57; }
.term-dot.yellow { background: #febc2e; }
.term-dot.green  { background: #28c840; }
.term-titlebar .title {
  margin-left: 12px;
  flex: 1;
  text-align: center;
}

.term-body {
  background: #050810;
  color: #d4f59a;
  padding: 16px 18px;
  font-family: "SF Mono", Menlo, "DejaVu Sans Mono", Consolas, monospace;
  font-size: 14px;
  line-height: 1.55;
  min-height: 320px;
  max-height: 480px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.term-body.serial {
  background: #0c0c0c;
  color: #c0c0c0;
}
.term-body.serial .term-prompt-line { color: #c0c0c0; }
.term-body.serial .ok { color: #afc7a5; }

.term-output { white-space: pre-wrap; }
.term-output .ok { color: #8AC42F; }
.term-output .warn { color: #ffb84d; }
.term-output .err { color: #ff6b6b; }
.term-output .dim { color: #6a7d9a; }
.term-output .hl { color: #fff; font-weight: 700; }

.term-prompt-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 0;
  color: #8AC42F;
}
.term-prompt-line .ps1 { color: #8AC42F; flex-shrink: 0; user-select: none; }
.term-prompt-line .input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font: inherit;
  caret-color: #8AC42F;
  padding: 0;
  min-width: 100px;
}

.term-body::-webkit-scrollbar { width: 10px; }
.term-body::-webkit-scrollbar-track { background: #0a0f1a; }
.term-body::-webkit-scrollbar-thumb { background: #2a3b58; border-radius: 4px; }

.term-hint {
  margin-top: 10px;
  padding: 12px 14px;
  background: rgba(138,196,47,0.08);
  border-left: 3px solid var(--efc-green);
  font-size: var(--fs-sm);
  color: var(--text-2);
  border-radius: 0 6px 6px 0;
}
.term-hint strong { color: var(--efc-green); }

/* Sistema de lecciones guiadas */
.term-lessons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.term-lesson {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: var(--rad-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-2);
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
}
.term-lesson:hover { border-color: var(--efc-green); color: var(--text-1); }
.term-lesson.active { border-color: var(--efc-green); background: #142339; color: var(--text-1); }
.term-lesson.done { color: var(--efc-green); }
.term-lesson .lnum {
  width: 26px; height: 26px;
  background: rgba(138,196,47,0.18);
  color: var(--efc-green);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  flex-shrink: 0;
}
.term-lesson.done .lnum { background: var(--efc-green); color: var(--efc-black); }

/* Diagrama de red */
.term-net-diagram {
  background: linear-gradient(180deg, #0c1424 0%, #08111f 100%);
  border: 1px solid var(--border);
  border-radius: var(--rad-md);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
}
