/* Agentes de IA: editor de flujo con pestañas (/servicios/agentes-ia/, sección 04).
   Propuesta aprobada por Marcos el 01/12: se aparta de la regla de esquinas de 2 px
   y suma superficies blancas, para que se lea como la pantalla de un producto. */
.tla { --tla-blanco: #fff; --tla-gris-suave: color-mix(in srgb, var(--tk-gris) 70%, var(--tk-piedra)); --tla-borde-suave: color-mix(in srgb, var(--tk-linea) 55%, #fff); margin-top: 40px; }
.tla *, .tla *::before, .tla *::after { box-sizing: border-box; }

/* Pestañas */
.tla-tabs { display: flex; gap: 8px; margin: 0 0 20px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tla-tabs::-webkit-scrollbar { display: none; }
.tla-tab { flex: none; font: inherit; font-size: 15px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--tk-linea); background: transparent; color: var(--tk-tinta); cursor: pointer; transition: background .2s, color .2s, border-color .2s; }
.tla-tab:hover { border-color: var(--tk-tinta); }
.tla-tab[aria-selected="true"] { background: var(--tk-tinta); border-color: var(--tk-tinta); color: var(--tk-papel); }
.tla-tab:focus-visible, .tla-canvas:focus-visible { outline: 2px solid var(--tk-verde); outline-offset: 2px; }

/* Tarjeta */
.tla-card { position: relative; background: var(--tk-papel); border-radius: 16px; overflow: hidden; padding: 28px 0 0 28px; display: flex; flex-direction: column; gap: 32px; }
.tla-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-right: 28px; }
.tla-card-title { margin: 0 0 8px; font-weight: 400; font-size: 20px; letter-spacing: -.01em; }
.tla-card-desc { margin: 0; max-width: 560px; font-size: 16px; line-height: 1.45; color: var(--tk-gris); }
.tla-tag { flex: none; font-size: 13px; color: var(--tk-gris); border: 1px solid var(--tk-linea); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }

/* Ventana de la app */
.tla-win { margin-left: auto; width: min(100%, 960px); display: flex; background: var(--tla-blanco); border: 1px solid var(--tk-linea); border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; overflow: hidden; }
.tla-side { flex: none; width: 228px; border-right: 1px solid var(--tk-linea); padding: 20px 14px; font-size: 14px; }
.tla-side .wordmark { display: block; margin: 4px 8px 22px; }
.tla-select { display: flex; align-items: center; gap: 8px; border: 1px solid var(--tk-linea); border-radius: 8px; padding: 7px 8px; margin-bottom: 20px; }
.tla-select > span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tla-ta { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--tk-tinta); color: var(--tk-piedra); font-size: 10px; font-weight: 600; }
.tla-side-label { margin: 0 0 6px 8px; font-size: 13px; color: var(--tla-gris-suave); }
.tla-nav { list-style: none; margin: 0; padding: 0; }
.tla-nav li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; color: var(--tk-gris); }
.tla-nav li.is-on { background: var(--tk-papel); color: var(--tk-tinta); }
.tla .tl-icon { width: 16px; height: 16px; }

.tla-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tla-bar { height: 52px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--tk-linea); font-size: 15px; }
.tla-crumb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tla-crumb b { font-weight: 400; }
.tla-sep { color: var(--tla-gris-suave); margin: 0 10px; }

/* Lienzo */
.tla-canvas { position: relative; overflow: hidden; background-color: var(--tla-blanco); background-image: radial-gradient(circle, color-mix(in srgb, var(--tk-linea) 80%, #fff) 1px, transparent 1.2px); background-size: 20px 20px; background-position: 10px 10px; }
.tla-tools { position: absolute; top: 14px; right: 14px; z-index: 3; display: flex; gap: 2px; background: var(--tla-blanco); border: 1px solid var(--tk-linea); border-radius: 8px; padding: 3px; }
.tla-tool { display: grid; place-items: center; width: 26px; height: 26px; color: var(--tk-gris); font-size: 16px; line-height: 1; }
.tla-stage { position: relative; margin: 0 auto; transition: height .25s var(--ease-out, ease-out); }
.tla-hint { display: none; position: sticky; left: 0; margin: 0; padding: 14px 0 0 16px; font-size: 12px; color: var(--tk-gris); }
.tla-hint[hidden] { display: none !important; }

/* Un flujo */
.tla-flow { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .2s; }
.tla-flow.is-on { opacity: 1; visibility: visible; }
.tla-flow:not(.is-on) { width: 0 !important; overflow: hidden; }
.tla-edges { position: absolute; inset: 0; overflow: visible; }
.tla-edges path { fill: none; stroke: color-mix(in srgb, var(--tk-gris) 50%, #fff); stroke-width: 1.2; }
.tla-edges .tla-arrow { fill: color-mix(in srgb, var(--tk-gris) 50%, #fff); stroke: none; }
.tla-start { position: absolute; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; background: var(--tk-papel); border: 1px solid var(--tk-linea); font-size: 14px; white-space: nowrap; }
.tla-node { position: absolute; width: 212px; background: var(--tk-papel); border: 1px solid var(--tk-linea); border-radius: 12px; padding: 4px; }
.tla-node-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; font-size: 14px; line-height: 1.2; }
.tla-node-b { background: var(--tla-blanco); border: 1px solid var(--tla-borde-suave); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.4; color: var(--tk-gris); }
.tla-node.is-vos { border-color: var(--tk-tinta); }
.tla-btn { display: inline-block; margin-top: 10px; font-size: 12px; padding: 6px 12px; border-radius: 6px; background: var(--tk-verde); color: var(--tk-papel); }
.tla-pill { position: absolute; transform: translate(-50%, -50%); font-size: 12px; color: var(--tk-gris); white-space: nowrap; background: var(--tk-papel); border: 1px solid var(--tk-linea); border-radius: 999px; padding: 4px 11px; z-index: 2; }

.tla-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 16px; }
.tla-note { margin: 0; font-size: 13px; color: var(--tk-gris); }

/* Los pasos aparecen al cambiar de pestaña (no al desplazar) */
@media (prefers-reduced-motion: no-preference) {
  .tla-flow.is-on .tla-start, .tla-flow.is-on .tla-node { animation: tla-in .24s both var(--ease-out, cubic-bezier(.23,1,.32,1)); animation-delay: calc(var(--d, 0) * 60ms); }
  .tla-flow.is-on .tla-pill, .tla-flow.is-on .tla-arrow { animation: tla-fade .2s both; animation-delay: calc(var(--d, 0) * 60ms + 160ms); }
  .tla-flow.is-on .tla-edges path:not(.tla-arrow) { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: tla-draw .28s forwards var(--ease-out, ease-out); animation-delay: calc(var(--d, 0) * 60ms + 40ms); }
}
@keyframes tla-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes tla-draw { to { stroke-dashoffset: 0; } }
@keyframes tla-fade { from { opacity: 0; } to { opacity: 1; } }

/* Celular: sin barra lateral, ramas en dos columnas angostas */
@media (max-width: 760px) {
  .tla { margin-top: 28px; }
  .tla-tabs { margin: 0 calc(var(--gutter, 16px) * -1) 16px; padding: 0 var(--gutter, 16px) 2px; }
  .tla-card { padding: 20px 0 0 20px; gap: 24px; border-radius: 14px; }
  .tla-card-top { flex-direction: column; gap: 12px; padding-right: 20px; }
  .tla-card-title { font-size: 19px; }
  .tla-card-desc { font-size: 15px; }
  .tla-side, .tla-tools { display: none; }
  .tla-bar { height: 46px; padding: 0 16px; font-size: 14px; }
  .tla-canvas { overflow-x: auto; scrollbar-width: none; }
  .tla-canvas::-webkit-scrollbar { display: none; }
  .tla-node { width: 152px; }
  .tla-node-h { font-size: 13px; padding: 5px 6px 7px; }
  .tla-node-b { font-size: 12.5px; padding: 8px 10px; }
  .tla-start { font-size: 13px; height: 34px; padding: 0 12px; }
  .tla .tla-hint { display: block; }
}
