/* ============================================================
   TALLER IA · SOLVITU — interactive.css
   Piezas dinámicas añadidas al deck:
   · 16 Pipeline animado (Entrada → Tokenizer → LLM → Logits → Softmax)
   · 18 Base de datos vectorial (tabla embeddings + scatter 3D canvas + cubo CSS)
   · 19 Diagrama de atención animado (SVG animateMotion)
   · 21 Chat simulado con efecto typing + barra de búsqueda falsa
   · 27 Nota clave de conclusión
   · 29 Cinta animada de context window
   · 33 Trío de menús de herramientas
   Mantiene la estética editorial brutalista del deck:
   bordes negros, blanco, lima ácido y JetBrains Mono.
   ============================================================ */

/* ==================== 16 · PIPELINE ANIMADO ==================== */
.pipeline-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  align-items: center;
  width: 100%;
}

.pipeline-flow {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  width: 100%;
}

.pipe-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.pipe-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.28;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.pipe-stage.is-on {
  opacity: 1;
  transform: translateY(0);
}
.pipe-stage.is-on .pipe-box {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.12);
}
.pipe-stage.is-on .pipe-label {
  color: var(--ink);
}

.pipe-box {
  min-width: 120px;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  padding: 0.7rem 1rem;
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-box);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  transition: border-color 0.35s, box-shadow 0.35s, background-color 0.35s;
}
.pipe-box svg {
  width: 34px;
  height: 34px;
}

.pipe-stage[data-step="2"].is-on .pipe-box { background: #F3FBD1; }
.pipe-stage[data-step="4"].is-on .pipe-box { background: #F3FBD1; }

.pipe-arrow {
  font-size: 1.7rem;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.3);
  padding-bottom: 1.4rem;
  transition: color 0.3s, transform 0.3s;
}
.pipe-arrow.is-on {
  color: var(--ink);
  transform: translateX(4px);
}

.pipe-probs {
  width: min(680px, 92%);
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-box);
  padding: 1.1rem 1.4rem;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.pipe-probs-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pipe-replay {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.9rem;
  background: #FFF;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.pipe-replay:hover {
  background: var(--lime);
  transform: translateY(-1px);
}

.prob-track {
  display: grid;
  grid-template-columns: 88px 1fr 64px;
  align-items: center;
  gap: 0.9rem;
}
.prob-word,
.prob-val {
  font-size: 1rem;
  font-weight: 700;
}
.prob-val {
  text-align: right;
  color: var(--ink-muted);
}
.prob-bar {
  display: block;
  height: 18px;
  background: #F1F1F3;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  overflow: hidden;
}
.prob-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--lime);
  border-right: 1.5px solid rgba(0, 0, 0, 0.12);
  transition: width 0.7s cubic-bezier(0.2, 0, 0, 1);
}
.prob-track.is-win .prob-bar i { background: #9BC400; }
.prob-track.is-win .prob-word { text-decoration: underline; text-decoration-thickness: 3px; }
.prob-track.is-win .prob-val { color: var(--ink); }

.pipe-verdict {
  margin-top: 0.5rem;
  font-size: 1.02rem;
  color: #222;
  border-top: 1.5px dashed rgba(0, 0, 0, 0.25);
  padding-top: 0.7rem;
}

/* ==================== 18 · BASE DE DATOS VECTORIAL ==================== */
.vectordb-layout {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr;
  gap: 1.6rem;
  align-items: stretch;
}

.vd-scatter-card {
  background-color: #F8FAFD;
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(220, 245, 36, 0.12) 0%, transparent 70%),
    linear-gradient(to right, rgba(0, 0, 0, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px, 24px 24px;
  background-position: center, center, center;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
#vdCanvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}
#vdCanvas:active { cursor: grabbing; }

.vd-card-title {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  margin-bottom: 0.7rem;
}

.vd-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.86rem;
}
.vd-table th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #444;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  padding: 0.3rem 0.35rem;
  text-align: center;
}
.vd-table th:first-child { text-align: left; }
.vd-table td {
  padding: 0.32rem 0.35rem;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  color: #333;
}
.vd-table td:first-child {
  text-align: left;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.vd-table tbody tr {
  transition: background-color 0.15s;
}
.vd-table tbody tr:hover,
.vd-table tbody tr.is-hot { background: #F6FBD8; }

.vd-hint {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.vd-reduction {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}
.vd-red-tag {
  font-weight: 700;
  font-size: 1rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: #FFF;
  border-radius: 6px;
  padding: 0.15rem 0.6rem;
}
.vd-red-note {
  margin-top: 0.5rem;
  font-size: 0.68rem;
  text-align: center;
  color: var(--ink-muted);
  line-height: 1.4;
}

.vd-scatter-card { overflow: hidden; }
#vdCanvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}
#vdCanvas:active { cursor: grabbing; }
.vd-scene-tag {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #333;
  margin-top: 0.5rem;
}
.vd-scene-tag em {
  font-style: normal;
  font-weight: 400;
  color: #777;
}

/* Cubo isométrico CSS giratorio (almacén de vectores) */
.vd-cube {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 52px;
  height: 52px;
  perspective: 260px;
  pointer-events: none;
}
.vd-cube__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: vdCubeSpin 10s linear infinite;
}
.vd-cube__inner i {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: rgba(220, 245, 36, 0.35);
}
.vd-cube__inner i:nth-child(1) { transform: translateZ(26px); }
.vd-cube__inner i:nth-child(2) { transform: rotateY(180deg) translateZ(26px); }
.vd-cube__inner i:nth-child(3) { transform: rotateY(90deg) translateZ(26px); }
.vd-cube__inner i:nth-child(4) { transform: rotateY(-90deg) translateZ(26px); }
.vd-cube__inner i:nth-child(5) { transform: rotateX(90deg) translateZ(26px); }
.vd-cube__inner i:nth-child(6) { transform: rotateX(-90deg) translateZ(26px); }
@keyframes vdCubeSpin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to   { transform: rotateX(-18deg) rotateY(360deg); }
}
.vd-cube__label {
  position: absolute;
  top: 56px;
  right: -12px;
  white-space: nowrap;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--lime);
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
}

.vd-idea-box {
  margin-top: 1.4rem;
  background: var(--lime);
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-box);
  padding: 1rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 1.12rem;
  line-height: 1.5;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
}

/* ==================== 19 · ATENCIÓN ANIMADA ==================== */
.attn-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  align-items: center;
}

.attn-sentence-card {
  width: min(920px, 100%);
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  padding: 1rem 1.6rem 1.3rem;
}
.attn-arrows {
  width: 100%;
  height: 130px;
  display: block;
}
.attn-arrows path {
  fill: none;
  stroke: rgba(0, 0, 0, 0.2);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-dasharray: 7 7;
  animation: attnDash 1.4s linear infinite;
}
@keyframes attnDash {
  to { stroke-dashoffset: -28; }
}

.attn-words {
  position: relative;
  height: 64px;
  margin-top: -96px;
  z-index: 2;
}
.attn-w {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  background: #FFF;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 0.35rem 0.85rem;
}
.attn-w--hot {
  background: var(--lime);
  border-width: 2.5px;
  font-size: 1.7rem;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
  animation: attnPulse 2s ease-in-out infinite;
}
@keyframes attnPulse {
  0%, 100% { box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 0 0 8px rgba(220, 245, 36, 0.35); }
}

.attn-note {
  text-align: center;
  margin-top: 2.4rem;
  font-size: 1rem;
  color: #444;
}

.attn-compare {
  display: grid;
  grid-template-columns: 1fr 0.65fr 1fr;
  gap: 1.4rem;
  width: min(980px, 100%);
  align-items: stretch;
}
.attn-case {
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-box);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  text-align: center;
  position: relative;
  transition: transform 0.2s;
}
.attn-case:hover { transform: translateY(-4px); }
.attn-case--bad { background: #EEF2FF; }
.attn-case--good { background: #FFF7E0; }
.attn-case p { font-size: 1.08rem; line-height: 1.45; }
.attn-icon { width: 58px; height: 58px; }
.attn-mark {
  position: absolute;
  top: -14px;
  left: -12px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  font-size: 1.1rem;
  font-weight: 900;
}
.attn-case--bad .attn-mark { background: #BAE6FD; color: var(--ink); }
.attn-case--good .attn-mark { background: #FFE58F; color: var(--ink); }
.attn-case-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.attn-mid {
  display: grid;
  place-items: center;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.25;
  border: 2px dashed rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-box);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
}

/* ==================== 21 · CHAT SIMULADO ==================== */
.mente-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 0.55fr;
  gap: 2.2rem;
  align-items: center;
}
.mente-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-size: 1.08rem;
}
.mente-chat-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.mente-robot {
  display: flex;
  justify-content: center;
  align-items: center;
}
.mente-robot img {
  max-height: 42vh;
  object-fit: contain;
}

.fake-search {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
}

.chat-card {
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.chat-card__head {
  background: var(--ink);
  color: var(--lime);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
}
.chat-msg {
  padding: 0.9rem 1.1rem;
  font-size: 1rem;
  line-height: 1.5;
}
.chat-msg + .chat-msg {
  border-top: 1px dashed rgba(0, 0, 0, 0.2);
}
.chat-msg--user {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  background: #F4F4F6;
}
.chat-card.is-live .chat-msg--user {
  opacity: 1;
  transform: translateY(0);
}
.chat-msg--ai {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.chat-ai-label {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 0.15rem 0.4rem;
  background: var(--lime);
  margin-top: 0.15rem;
}
.chat-caret {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  background: var(--ink);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: caretBlink 0.8s steps(1) infinite;
}
@keyframes caretBlink {
  50% { opacity: 0; }
}

/* ==================== 27 · NOTA CLAVE ==================== */
.slide-note-key {
  margin: 1.3rem auto 0;
  max-width: 900px;
  background: #FFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-left: 10px solid var(--lime);
  border-radius: var(--radius-box);
  padding: 0.9rem 1.4rem;
  font-size: 1.08rem;
  line-height: 1.5;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
}

/* ==================== 29 · CINTA CONTEXT WINDOW ==================== */
.cw-ribbon {
  position: relative;
  width: min(920px, 100%);
  margin: 0.4rem auto 0.2rem;
  padding: 2.4rem 1rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.cw-strip {
  position: relative;
  display: flex;
  gap: 4px;
  flex: 1;
  overflow: hidden;
  padding: 6px 0;
}
.cw-cell {
  flex: 1;
  aspect-ratio: 1;
  max-width: 26px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  background: #E7E7EA;
  opacity: 0.3;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.cw-cell--in   { background: #86E01F; }
.cw-cell--ctx  { background: #7FB3FF; }
.cw-cell--resp { background: #C39BF5; }
.cw-cell.is-inside {
  opacity: 1;
  transform: translateY(-2px);
}

.cw-strip { position: relative; }

.cw-frame {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 45%;
  border: 2.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  background: rgba(220, 245, 36, 0.08);
  pointer-events: none;
  transition: transform 1s cubic-bezier(0.3, 0, 0.2, 1);
}
.cw-frame__label {
  position: absolute;
  top: -1.7rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--ink);
  color: var(--lime);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}
.cw-tag--out {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.cw-tag--right { writing-mode: vertical-rl; transform: none; }

.cw-legend {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  margin: 0.6rem auto 1.2rem;
  font-size: 0.88rem;
}
.cw-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.cw-dot {
  width: 14px;
  height: 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  display: inline-block;
}
.cw-dot--in   { background: #86E01F; }
.cw-dot--ctx  { background: #7FB3FF; }
.cw-dot--out2 { background: #C39BF5; }
.cw-dot--off  { background: #E7E7EA; }

/* ==================== 33 · TRÍO DE MENÚS ==================== */
.tool-menu-fig {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}
.tool-menu-fig img {
  width: 100%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #FFF;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}
.tool-menu-fig:hover img {
  transform: translateY(-5px);
}
.tool-menu-fig figcaption {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1100px) {
  .mente-grid {
    grid-template-columns: 1fr 1fr;
  }
  .mente-robot {
    grid-column: 1 / -1;
  }
  .mente-robot img {
    max-height: 26vh;
  }
}

@media (max-width: 900px) {
  .vectordb-layout {
    grid-template-columns: 1fr;
  }
  .vd-reduction {
    flex-direction: row;
    gap: 0.8rem;
  }
  .vd-red-note { display: none; }
  .attn-compare {
    grid-template-columns: 1fr;
  }
  .attn-mid { order: -1; }
  .mente-grid {
    grid-template-columns: 1fr;
  }
  .fake-search { align-self: flex-start; }
}

/* ==================== 12 · JERARQUÍA Y CAPAS ANIDADAS (MATRIOSHKA) ==================== */
.nested-hierarchy-layout {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 2.2rem;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.nested-matrioshka {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.nested-layer-box {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-left: 6px solid var(--layer-color, rgba(0, 0, 0, 0.12));
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.05);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nested-layer-box:hover {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25);
}

.nested-layer-box.is-active {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: var(--shadow-card), 0 0 0 2px var(--layer-color, rgba(0, 0, 0, 0.12));
  background: #FFFFFF;
}

.nested-layer-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  user-select: none;
}

.nested-layer-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--layer-color, rgba(0, 0, 0, 0.12));
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.nested-layer-num--lime {
  background: var(--lime);
  color: #ffffff;
}

.nested-layer-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
  color: #111111;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nested-layer-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: #F2F2F4;
  color: #444444;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.nested-layer-badge--lime {
  background: var(--lime);
  color: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
}

.nested-layer-body {
  padding: 0.45rem 0.6rem 0.55rem 0.6rem;
}

/* Núcleo de Aplicaciones */
.nested-layer-box--core {
  background: #111111;
  border-color: rgba(0, 0, 0, 0.12);
  border-left-color: var(--lime);
}

.nested-layer-box--core .nested-layer-header {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.nested-layer-box--core .nested-layer-title {
  color: #FFFFFF;
}

.nested-layer-core-apps {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding: 0.45rem 0.75rem 0.55rem;
}

.app-pill {
  display: inline-flex;
  align-items: center;
  background: #222222;
  color: var(--lime);
  border: 1px solid #444444;
  border-radius: 4px;
  padding: 0.2rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.nested-layer-box--core.is-active .app-pill {
  border-color: var(--lime);
  background: var(--ink);
}

/* Panel de Información Lateral */
.concentric-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  padding: 1.6rem 1.8rem;
  box-shadow: var(--shadow-float);
}
.concentric-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: var(--lime);
}
.concentric-info-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1.15;
  color: var(--ink);
}
.concentric-info-desc {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  line-height: 1.6;
  color: #222;
}
.concentric-info-examples {
  background: #F4F4F6;
  border: 1.5px dashed rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.98rem;
}
.concentric-pills-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.4rem;
}
.concentric-selector-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  background: #FFF;
  cursor: pointer;
  transition: all 0.15s;
}
.concentric-selector-btn:hover, .concentric-selector-btn.is-active {
  background: var(--ink);
  color: var(--lime);
  transform: translateY(-2px);
}

/* ==================== 15 · SPLIT TOKENS TITLE ==================== */
.tokens-title-split {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.token-chunk {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s;
}
.token-chunk:hover {
  transform: translateY(-3px) rotate(-2deg);
}
.token-c1 { background: #7c3aed; color: #ffffff; }
.token-c2 { background: #7FB3FF; color: var(--ink); }
.token-c3 { background: #FF9EAA; color: var(--ink); }

/* ==================== 16 · MODAL RED NEURONAL & PIPELINE AMIGABLE ==================== */
.pipe-box.pipe-llm {
  cursor: pointer;
  position: relative;
  transition: transform 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.pipe-box.pipe-llm:hover {
  transform: translateY(-4px) scale(1.04);
  background: var(--lime) !important;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.pipe-llm-badge {
  position: absolute;
  top: -12px;
  right: -10px;
  background: var(--ink);
  color: var(--lime);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  animation: bounceBadge 1.5s infinite;
}
@keyframes bounceBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.nn-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
  padding: 1.5rem;
}
.nn-modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}
.nn-modal-card {
  background: #FFFFFF;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}
.nn-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.8rem;
  background: var(--ink);
  color: #FFF;
}
.nn-modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--lime);
}
.nn-modal-close {
  background: #FFF;
  color: var(--ink);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
}
.nn-modal-close:hover {
  background: var(--lime);
  transform: scale(1.05);
}
.nn-modal-body {
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.nn-canvas-container {
  width: 100%;
  height: 280px;
  background: #1a1a1e;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
#nnCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
.nn-explanation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.nn-exp-card {
  background: #F4F4F6;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 1rem;
}
.nn-exp-card h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}
.nn-exp-card p {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.45;
  color: #333;
}

/* ==================== 12 · RED NEURONAL ARTIFICIAL (DIAPOSITIVA) ==================== */
.neural-slide-layout {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.neural-vis-card {
  background: #1a1a1e;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.neural-vis-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1.1rem;
  background: #161A22;
  border-bottom: 1px solid #2B313E;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #C9D1D9;
}

.neural-vis-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.neural-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}

.neural-vis-actions {
  display: flex;
  gap: 0.5rem;
}

.neural-btn {
  background: #21262D;
  color: #F0F6FC;
  border: 1px solid #30363D;
  border-radius: 5px;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.neural-btn:hover {
  background: var(--lime);
  color: #ffffff;
  border-color: var(--lime);
  transform: translateY(-1px);
}

.neural-canvas-wrap {
  width: 100%;
  height: 290px;
  position: relative;
  background: #1a1a1e;
}

#slideNNCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.neural-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  width: 100%;
}

.neural-step-card {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.neural-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.neural-step-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  margin-bottom: 0.35rem;
}

.neural-step-card h4 {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #111111;
}

.neural-step-card p {
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #333333;
  margin: 0;
}

/* ==================== 17 · PREDICCIÓN PROBABILIDADES AMPLIADA ==================== */
.prob-demo-box--wide {
  max-width: 1100px;
  width: min(1100px, 94%);
  padding: 2.4rem 3.2rem;
  gap: 3rem;
}
.prob-robot-img--lg {
  width: 220px;
  max-width: 28vw;
}

/* ==================== 18 · ALMACÉN VECTORIAL 3D CENTRADO ==================== */
.vectordb-layout--centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.vd-scatter-card--full {
  width: 100%;
  padding: 1.4rem 1.6rem;
}
.vd-clusters-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
}
.vd-cluster-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  background: #FFF;
}

/* ==================== 27 · COMPARACIÓN DE MODELOS EN CÓDIGO ==================== */
.models-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 0;
  align-items: stretch;
}
/* ==================== COMPARACIÓN DE MODELOS (TABLA UNIFICADA) ==================== */
.models-table-card {
  width: 100%;
  max-width: 1240px;
  margin: 0.4rem auto 0;
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.models-compare-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-family: var(--font-body);
}

.models-compare-table th,
.models-compare-table td {
  padding: 0.75rem 1.05rem;
  border: 1px solid rgba(0, 0, 0, 0.14);
  vertical-align: middle;
}

.models-compare-table th {
  background: #FAFAFA;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  padding: 0.9rem 1.05rem;
}

.th-criterion {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #555;
  background: #F0F2F5 !important;
}

.th-badge-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.th-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.12);
  width: fit-content;
}

.th-badge--thinking { background: #F3E8FF; color: #6B21A8; }
.th-badge--standard { background: #DBEAFE; color: #1E40AF; }
.th-badge--fast     { background: #DCFCE7; color: #166534; }

.th-thinking { border-top: 6px solid #9333EA !important; }
.th-standard { border-top: 6px solid #2563eb !important; }
.th-fast     { border-top: 6px solid #10b981 !important; }

.th-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ink);
}

.td-row-head {
  background: #F8FAFC;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #111;
  white-space: nowrap;
}

.models-compare-table tbody tr:hover {
  background: #FAFAF4;
}

.models-compare-table td {
  font-size: 0.94rem;
  line-height: 1.45;
  color: #222;
}

.model-pill-mono {
  display: block;
  background: #F4F4F6;
  border: 1px dashed rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #111;
  font-weight: 600;
}

.tr-footer-metrics td {
  background: #FAFCFF;
  border-top: 2px solid rgba(0, 0, 0, 0.12);
}

.metric-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  background: #FFF;
  border: 1.2px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  margin-right: 0.4rem;
}
.metric-tag--cost {
  background: var(--lime);
}

/* ==================== 34 · ESTRUCTURA DE UN PROMPT EN CÓDIGO ==================== */
.prompt-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 2rem;
  max-width: 1240px;
  margin: 1rem auto 0;
  width: 100%;
  align-items: start;
}
.prompt-pillars-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.prompt-pillar-item {
  background: #FFFFFF;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
  transition: transform 0.15s, background-color 0.15s;
  cursor: default;
}
.prompt-pillar-item:hover {
  transform: translateX(4px);
  background: #FAFAEA;
}
.prompt-pillar-num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  background: var(--ink);
  color: var(--lime);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  flex-shrink: 0;
}
.prompt-pillar-content h4 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}
.prompt-pillar-content p {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  line-height: 1.4;
  color: #444;
}

.prompt-live-card {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  padding: 1.4rem 1.6rem;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.prompt-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  padding-bottom: 0.6rem;
}
.prompt-live-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}
.prompt-live-body {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  line-height: 1.6;
  background: #F6F6F8;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.prompt-tag-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
  margin-right: 0.4rem;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.pt-rol { background: #FFE58F; color: var(--ink); }
.pt-task { background: #A7F3D0; color: var(--ink); }
.pt-ctx { background: #BAE6FD; color: var(--ink); }
.pt-tone { background: #FED7AA; color: var(--ink); }
.pt-rules { background: #FECDD3; color: var(--ink); }
.pt-out { background: #E9D5FF; color: var(--ink); }

/* ==================== 36 · FLUJO DE UN RAG EN CÓDIGO ==================== */
.rag-flow-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}
.rag-section-box {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  padding: 1rem 1.4rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.rag-section-header {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.rag-section-header::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--lime);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
}
.rag-chain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}
.rag-node-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 130px;
  background: #F8F8FA;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.65rem 0.55rem;
  transition: transform 0.15s, background-color 0.15s, box-shadow 0.15s;
  cursor: pointer;
  flex-shrink: 0;
}
.rag-node-item:hover, .rag-node-item.is-active {
  background: #FAFAEA;
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}
.rag-node-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--ink);
  color: #FFF;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 0.25rem;
}
.rag-node-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.2rem;
}
.rag-node-sub {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #555;
  line-height: 1.2;
}
.rag-node-icon {
  font-size: 1.4rem;
  margin: 0.25rem 0;
}
.rag-arrow-sep {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--ink);
  opacity: 0.4;
  flex-shrink: 0;
}
.rag-node-highlight {
  background: #FFFBE6;
  border-color: #f59e0b;
}
.rag-node-vector {
  background: #EDF7EE;
  border-color: #10b981;
}
.rag-node-llm {
  background: #F4E8FF;
  border-color: #9333EA;
}
.rag-side-card {
  min-width: 240px;
  background: #FAFAFA;
  border: 1.5px solid #2563eb;
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.45;
  color: #1E3A8A;
  flex-shrink: 0;
}

.rag-benefits-bar {
  display: grid;
  grid-template-columns: 200px repeat(4, 1fr);
  gap: 0.8rem;
  align-items: center;
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 0.8rem 1.4rem;
  box-shadow: var(--shadow-card);
}
.rag-benefits-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.rag-benefit-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
  background: #F4F4F6;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
}
.rag-benefit-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ============================================================
   NUEVAS UTILIDADES PRÁCTICAS SOLVITU
   1. Árbol de Decisión Interactivo ("¿Qué Modelo Usar?")
   2. Comparador de Prompts ("Débil vs. Blindado")
   3. Plantilla Maestra y Clipboard
   ============================================================ */

/* ---------- 1. ÁRBOL DE DECISIÓN ---------- */
.decision-tree-layout {
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
}
.dt-wizard-card {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.8rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.dt-stepper-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-bottom: 0.75rem;
  border-bottom: 1.5px solid #E5E7EB;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}
.dt-step-indicator {
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  background: #F3F4F6;
  color: #64748b;
  transition: all 0.2s;
}
.dt-step-indicator.active {
  background: var(--ink);
  color: var(--lime);
}
.dt-step-sep {
  color: #9CA3AF;
}
.dt-question-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.9rem;
}
.dt-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.dt-options-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}
.dt-opt-btn {
  background: #FAFAFA;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0.95rem 1.05rem;
  display: flex;
  gap: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.06);
}
.dt-opt-btn:hover {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.dt-opt-badge {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}
.dt-opt-info strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 750;
  color: #111827;
  margin-bottom: 0.2rem;
}
.dt-opt-info p {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: #4B5563;
  line-height: 1.4;
  margin: 0;
}
.dt-back-btn, .dt-restart-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: #FFFFFF;
  cursor: pointer;
  margin-top: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s;
}
.dt-back-btn:hover {
  background: var(--ink);
  color: #FFFFFF;
}
.dt-restart-btn {
  background: var(--ink);
  color: var(--lime);
}
.dt-restart-btn:hover {
  background: var(--lime);
  color: #ffffff;
}
.dt-result-card {
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  background: #FAFDFB;
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.dt-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-bottom: 1.5px solid #E5E7EB;
  padding-bottom: 0.75rem;
}
.dt-result-badge-top {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: var(--ink);
  color: var(--lime);
  text-transform: uppercase;
}
.dt-result-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: #111827;
}
.dt-result-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}
.dt-result-col {
  background: #FFFFFF;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
}
.dt-result-col-tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}
.dt-result-col h5 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 800;
  color: #111827;
  margin-bottom: 0.25rem;
}
.dt-result-col p {
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.4;
  color: #4B5563;
  margin: 0;
}

/* ---------- 2. COMPARADOR DE PROMPTS ---------- */
.prompt-comp-layout {
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.prompt-comp-switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.prompt-comp-switch-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4B5563;
}
.prompt-comp-case-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s;
}
.prompt-comp-case-btn.active, .prompt-comp-case-btn:hover {
  background: var(--ink);
  color: var(--lime);
}
.prompt-comp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}
.prompt-comp-card {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  padding: 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-card);
}
.prompt-comp-card--bad {
  border-top: 6px solid #E63946;
}
.prompt-comp-card--good {
  border-top: 6px solid #10b981;
}
.prompt-comp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #E5E7EB;
}
.prompt-comp-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.badge--bad {
  background: #FEE2E2;
  color: #991B1B;
}
.badge--good {
  background: #DCFCE7;
  color: #166534;
}
.prompt-comp-status {
  font-size: 0.75rem;
  color: #64748b;
}
.prompt-comp-bubble {
  background: #F9FAFB;
  border: 1.5px solid #D1D5DB;
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #111827;
  line-height: 1.45;
}
.prompt-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.pt-chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: #FFFFFF;
  color: var(--ink);
}
.pt-chip.pt-rol { background: #FFE58F !important; color: var(--ink) !important; }
.pt-chip.pt-task { background: #A7F3D0 !important; color: var(--ink) !important; }
.pt-chip.pt-ctx { background: #BAE6FD !important; color: var(--ink) !important; }
.pt-chip.pt-tone { background: #FED7AA !important; color: var(--ink) !important; }
.pt-chip.pt-rules { background: #FECDD3 !important; color: var(--ink) !important; }
.pt-chip.pt-out { background: #E9D5FF !important; color: var(--ink) !important; }
.prompt-comp-output-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #4B5563;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}
.prompt-comp-output {
  background: #FFFFFF;
  border: 1.5px dashed rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.5;
  color: #1F2937;
  min-height: 130px;
}
.prompt-comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.76rem;
}
.prompt-comp-table th, .prompt-comp-table td {
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.35rem 0.5rem;
  text-align: left;
}
.prompt-comp-table th {
  background: #F3F4F6;
  font-family: var(--font-mono);
  font-weight: 700;
}
.prompt-comp-diag {
  border-radius: 6px;
  padding: 0.55rem 0.8rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  line-height: 1.4;
}
.diag--bad {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}
.diag--good {
  background: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}

/* ---------- 3. PLANTILLA MAESTRA & CLIPBOARD ---------- */
.prompt-template-layout {
  max-width: 1060px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.prompt-template-tabs {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.pt-tab-btn {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  background: #FFFFFF;
  cursor: pointer;
  transition: all 0.15s;
}
.pt-tab-btn.active, .pt-tab-btn:hover {
  background: var(--ink);
  color: var(--lime);
}
.prompt-template-card {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.prompt-template-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.4rem;
  background: #F9FAFB;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
}
.pt-meta-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: 0.03em;
}
.pt-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ink);
  color: var(--lime);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.pt-copy-btn:hover {
  background: var(--lime);
  color: #ffffff;
  transform: translateY(-1px);
}
.pt-copy-btn.is-copied {
  background: #10b981 !important;
  color: #FFFFFF !important;
  border-color: #10b981 !important;
}
.prompt-template-code {
  padding: 1.2rem 1.4rem;
  margin: 0;
  background: #1a1a1e;
  color: #E6EDF3;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 48vh;
  overflow-y: auto;
}
.prompt-template-footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1.4rem;
  background: #F3F4F6;
  border-top: 1px solid #E5E7EB;
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: #4B5563;
}
.pt-rule-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  background: var(--lime);
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ============================================================
   BENCHMARK TRIPTYCH (ARTIFICIAL ANALYSIS 2026)
   ============================================================ */
.benchmark-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
  max-width: 1300px;
  margin: 1.2rem auto 0;
  align-items: stretch;
}

.benchmark-card {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benchmark-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.bm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.bm-title-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.bm-color-badge {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.bm-color-badge--intel { background: #7C3AED; }
.bm-color-badge--speed { background: #EAB308; }
.bm-color-badge--cost  { background: #EA580C; }

.bm-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.bm-pill-updated {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--ink);
  color: var(--lime);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bm-metric-label {
  font-family: var(--font-body);
  font-size: 0.74rem;
  color: #555555;
  margin-bottom: 0.85rem;
  line-height: 1.3;
}

.bm-bars-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.bm-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.bm-bar-item:hover {
  background: #F8FAFC;
}

.bm-bar-item.is-top {
  background: #FFFBEB;
  border: 1px dashed rgba(234, 179, 8, 0.4);
}

.bm-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.74rem;
}

.bm-model-name {
  font-weight: 700;
  color: #111111;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bm-company-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: #444;
  background: #EFEFEF;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-weight: 600;
}

.bm-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--ink);
}

.bm-bar-track {
  width: 100%;
  height: 7px;
  background: #ECEFF1;
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}

.bm-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-bar-fill--intel { background: linear-gradient(90deg, #A855F7, #7C3AED); }
.bm-bar-fill--speed { background: linear-gradient(90deg, #FACC15, #10b981); }
.bm-bar-fill--cost  { background: linear-gradient(90deg, #22C55E, #EA580C); }

.bm-takeaways-card {
  width: 100%;
  max-width: 1300px;
  margin: 1.2rem auto 0;
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 0.9rem 1.3rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.bm-takeaway-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.bm-takeaway-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 800;
  border: 1px solid rgba(0, 0, 0, 0.12);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
  letter-spacing: 0.03em;
}

.bm-takeaway-item p {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #333333;
  margin: 0;
}

@media (max-width: 1000px) {
  .decision-tree-layout,
  .prompt-comp-layout,
  .prompt-template-layout,
  .benchmark-layout,
  .bm-takeaways-card {
    width: 100%;
    grid-template-columns: 1fr;
  }
  .dt-options-grid,
  .dt-options-grid--2col,
  .dt-result-details,
  .prompt-comp-grid {
    grid-template-columns: 1fr;
  }
  .nested-hierarchy-layout,
  .concentric-layout,
  .models-compare-grid,
  .prompt-builder-layout {
    grid-template-columns: 1fr;
  }
  .rag-benefits-bar {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   MODAL CHATBOT INTERACTIVO (SLIDE 20 · ALUCINACIONES)
   ============================================================ */
.chatbot-modal {
  position: fixed;
  inset: 0;
  z-index: 280;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
  padding: 1.2rem;
}

.chatbot-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.chatbot-modal-card {
  background: #FFFFFF;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 860px;
  height: 84vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 6px 6px 0 rgba(0, 0, 0, 0.12);
  transform: scale(0.96) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chatbot-modal.is-open .chatbot-modal-card {
  transform: scale(1) translateY(0);
}

/* Cabecera del modal */
.chatbot-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.4rem;
  background: var(--ink);
  color: #FFFFFF;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
}

.chatbot-header-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chatbot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1C1D22;
  border: 1.5px solid var(--lime);
  color: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.chatbot-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid rgba(0, 0, 0, 0.12);
  animation: dotPulse 2s infinite ease-in-out;
}

@keyframes dotPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0);
  }
}

.chatbot-modal-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--lime);
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.2;
}

.chatbot-modal-subtitle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #A1A1AA;
  margin-top: 2px;
}

.chatbot-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chatbot-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.1);
  color: #E4E4E7;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chatbot-clear-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.chatbot-modal-close {
  background: #FFFFFF;
  color: var(--ink);
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.35rem 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chatbot-modal-close:hover {
  background: var(--lime);
  transform: scale(1.04);
}

/* Barra de preguntas de acceso rápido (Chips) */
.chatbot-pills-bar {
  background: #F4F4F6;
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
  padding: 0.55rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow-x: auto;
}

.chatbot-pills-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #55555C;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.chatbot-pills-scroll {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.chatbot-pills-scroll::-webkit-scrollbar {
  display: none;
}

.chatbot-pill-chip {
  background: #FFFFFF;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.28rem 0.75rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  transition: all 0.15s ease;
  color: var(--ink);
}

.chatbot-pill-chip:hover {
  background: #EAEAEE;
  transform: translateY(-1px);
}

.chatbot-pill-chip.is-active {
  background: var(--lime);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

/* Contenedor del flujo de mensajes */
.chatbot-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  background: #FAF9F6;
  scroll-behavior: smooth;
}

.chatbot-messages-container:focus {
  outline: none;
}

/* Animaciones de entrada de mensajes */
@keyframes msgFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fila de mensaje del usuario */
.chat-msg-row--user {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 0.6rem;
  animation: msgFadeIn 0.25s ease forwards;
}

.chat-bubble--user {
  background: #111216;
  color: #FFFFFF;
  padding: 0.85rem 1.2rem;
  border-radius: 18px 18px 4px 18px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  max-width: 82%;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 2.5px 2.5px 0 rgba(0, 0, 0, 0.18);
  word-break: break-word;
}

.chat-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 800;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

/* Fila de mensaje de la IA */
.chat-msg-row--ai {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.7rem;
  max-width: 94%;
  animation: msgFadeIn 0.25s ease forwards;
}

.chat-ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.chat-bubble--ai {
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px 18px 18px 18px;
  padding: 1.1rem 1.3rem;
  box-shadow: 3.5px 3.5px 0 rgba(0, 0, 0, 0.12);
  flex: 1;
  min-width: 0;
}

.chat-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

.chat-ai-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-ai-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--lime);
  color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px;
  padding: 0.12rem 0.45rem;
}

.chat-ai-content {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  color: #111111;
  word-break: break-word;
}

/* Cursor parpadeante durante streaming */
.chat-streaming-cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--ink);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: caretBlink 0.8s steps(1) infinite;
}

/* Indicador de escritura (Thinking state) */
.chat-typing-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  animation: msgFadeIn 0.2s ease forwards;
}

.chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: #FFFFFF;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 4px 18px 18px 18px;
  padding: 0.75rem 1.15rem;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.08);
}

.chat-typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
  animation: dotBounce 1.2s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.chat-typing-text {
  font-size: 0.78rem;
  color: #666666;
  font-weight: 600;
}

/* Tarjeta de Diagnóstico Técnico */
@keyframes diagSlideDown {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-diagnostic-card {
  margin-top: 1rem;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  border: 2px solid rgba(0, 0, 0, 0.12);
  animation: diagSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Variantes de color por tipo de fenómeno */
.chat-diagnostic-card.tag--success {
  background: #F4FDE6;
  border-color: #15803D;
  color: #14532D;
}
.chat-diagnostic-card.tag--warning {
  background: #FFFBEB;
  border-color: #f59e0b;
  color: #78350F;
}
.chat-diagnostic-card.tag--danger {
  background: #FEF2F2;
  border-color: #DC2626;
  color: #7F1D1D;
}
.chat-diagnostic-card.tag--critical {
  background: #FFF1F2;
  border-color: #BE123C;
  color: #881337;
}
.chat-diagnostic-card.tag--purple {
  background: #FAF5FF;
  border-color: #9333EA;
  color: #581C87;
}

.chat-diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.chat-diag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid currentColor;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.chat-diag-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.8;
  letter-spacing: 0.05em;
}

.chat-diag-exp {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  margin: 0.4rem 0 0.65rem;
}

.chat-diag-insight {
  background: rgba(0, 0, 0, 0.04);
  border-left: 3px solid currentColor;
  padding: 0.55rem 0.85rem;
  border-radius: 0 8px 8px 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
}

.chat-diag-insight strong {
  font-weight: 700;
}

/* Barra inferior de entrada */
.chatbot-input-bar {
  background: #FFFFFF;
  border-top: 2px solid rgba(0, 0, 0, 0.12);
  padding: 0.8rem 1.2rem;
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.chatbot-input-field {
  flex: 1;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
  background: #FAF9F6;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--ink);
}

.chatbot-input-field:focus {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 0 0 3px rgba(220, 245, 36, 0.7);
}

.chatbot-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--ink);
  color: var(--lime);
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.chatbot-send-btn:hover {
  background: var(--lime);
  color: #ffffff;
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .chatbot-modal-card {
    height: 94vh;
    max-height: none;
  }
  .chatbot-modal-header {
    padding: 0.8rem 1rem;
  }
  .chatbot-messages-container {
    padding: 1rem;
  }
  .chat-bubble--user {
    max-width: 90%;
    font-size: 0.9rem;
  }
  .chat-msg-row--ai {
    max-width: 100%;
  }
}

