/* Visual refinement: warm panels, restrained surfaces, evidence first. */
:root {
  --muted: #596170;
  --line: #dfe2e6;
  --radius: 10px;
  --shadow: 0 2px 8px #17161406, 0 10px 24px #17161405;
}

/* Text navigation remains accessible on small screens. */
.section-nav { gap: 26px; }
.section-nav a {
  display: flex; width: auto; min-height: 44px;
  font-size: 14px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.section-nav a:hover { color: var(--ink); }
.section-nav a[aria-current] { color: var(--accent); border-color: var(--accent); }
.button { border-radius: 8px; }
.scene { padding-bottom: 76px; box-shadow: none; }
.scene > .visual:not(.hero-visual):not(.product-panel) {
  padding: 0; background: transparent; border: 0; border-radius: 0;
}
.eyebrow {
  padding: 0; border: 0; border-radius: 0; box-shadow: none;
  background: transparent; font-size: 14px; font-weight: 500;
  color: var(--muted); margin-bottom: 18px;
}
.eyebrow::before { display: none; }
.section-heading h2 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.1; letter-spacing: -.035em; }
.section-heading p { max-width: 48ch; line-height: 1.6; }
.hero .section-heading p, .comparison .section-heading p { margin-inline: auto; }
.card { box-shadow: none; border-color: var(--line); }
.icon-box { border-radius: 8px; }
.chip { border-radius: 4px; }
.dot-grid { background-image: radial-gradient(#676d7e18 .65px, transparent .8px); background-size: 20px 20px; }
.edge { stroke: #87909c; }
.workflow { border-radius: 12px; border-color: #d9dbde; }
.workflow-node, .workflow-node.dependency { border-radius: 8px; box-shadow: none; }
.workflow-node.active { box-shadow: 0 0 0 1px var(--accent); }

/* Keep the illustrated analyst as a single signature in the opening scene. */
#deteccion { padding-top: 128px; padding-bottom: 88px; }
#deteccion .hero-visual { height: 560px; border-radius: 16px; border-color: #d9e3f3; }
.analyst-face { box-shadow: none; }
.analyst-line { font-size: 14px; }
.detection-counter { top: 24px; right: 22px; width: auto; text-align: right; font-size: 12px; }
.department-control { border-radius: 8px; border-color: #d8e0eb; box-shadow: none; }
.department-control.is-active { box-shadow: 0 0 0 1px var(--accent); }
.department-name { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.department-name small { font-size: 11px; line-height: 1.2; font-weight: 400; color: var(--muted); }
.hero-evidence { margin-top: 10px; }
#hero-visual[data-paused="true"] .typing b { animation: none; opacity: .4; }
#hero-visual[data-complete="true"] .typing { display: none; }

/* Department color is reserved for identification, with progressive detail. */
#cobertura .coverage-box { border-radius: 24px; box-shadow: none; border-color: var(--line); }
.coverage-box h2 { font-size: clamp(26px, 2.7vw, 36px); line-height: 1.2; }
.method-steps { gap: 30px; margin-bottom: 30px; }
.method-num { border-radius: 6px; background: transparent; border: 1px solid #cdd8e8; }
.method-steps strong { font-size: 15px; }
.method-steps div > span { font-size: 13px; }
.coverage-box .coverage-grid { gap: 24px; align-items: start; }
.coverage-department, .coverage-department:not(.starting-point) { opacity: 1; }
.department-symbol {
  display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 8px; background: var(--dept); color: #354252; margin-bottom: 16px;
}
.department-symbol .sprite-icon { width: 22px; height: 22px; }
.coverage-department h3 { font-size: 17px; }
.dept-role { font-size: 12px; min-height: 3em; }
.dept-count { margin-top: 12px; }
.coverage-department ul { display: grid; gap: 9px; }
.coverage-department li { font-size: 13px; line-height: 1.4; }
.coverage-department.starting-point > ul > li:first-child { color: #1552a3; font-weight: 600; }
.coverage-more { margin-top: 12px; }
.coverage-more summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0; }
.coverage-more summary:hover { color: var(--accent); }
.coverage-more summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.coverage-more[open] summary { margin-bottom: 7px; }

/* Purchase lead time anchors a compact group of secondary indicators. */
#analisis { display: flex; flex-direction: column; gap: 32px; }
#analisis .section-heading { max-width: 100%; }
#analisis > .findings-visual { display: block; background: transparent; }
.department-indicators { display: grid; grid-template-columns: minmax(210px, .85fr) minmax(0, 2.5fr); gap: 26px; align-items: stretch; }
.lead-indicator { padding: 24px; background: #edf3ff; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; display: flex; flex-direction: column; justify-content: center; gap: 14px; min-width: 0; }
.lead-indicator h3 { font-size: 17px; line-height: 1.35; font-weight: 600; }
.lead-indicator-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.lead-indicator-value strong { font-size: 60px; letter-spacing: -.045em; line-height: 1; font-weight: 600; color: #1753aa; }
.lead-indicator-value > span, .lead-indicator p { font-size: 13px; color: var(--muted); }
.lead-indicator-route { display: flex; gap: 12px; align-items: center; font-size: 12px; color: #4c6383; padding-top: 12px; }
.lead-indicator-route i { flex: 1; height: 1px; background: #98b9e8; }
.secondary-indicators { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 24px; align-content: center; min-width: 0; }
.indicator {
  --metric-color: #74849a; padding: 0 0 12px; gap: 7px; min-width: 0;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent; box-shadow: none;
}
.indicator-top { min-height: 0; align-items: start; gap: 8px; }
.indicator-label { font-size: 13px; line-height: 1.35; overflow-wrap: normal; color: var(--ink); }
.indicator .icon-box { display: none; }
.indicator-value { flex-wrap: wrap; gap: 6px; }
.indicator-value strong { font-size: 26px; font-weight: 600; }
.indicator-value strong + .indicator-unit { margin: 0; }
.indicator-unit { font-size: 12px; white-space: normal; }
.metric-bar { height: 3px; background: #e9ecf0; }
.metric-steps { font-size: 12px; white-space: normal; }
.metric-dots { flex-wrap: wrap; gap: 3px; }
.metric-dots i { width: 5px; height: 5px; }
.indicator-note { font-size: 12px; }
.analysis-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.analysis-detail .inventory-age { padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.age-heading { font-size: 14px; gap: 12px; }
.age-heading strong { white-space: nowrap; }
.age-bar { height: 40px; border-radius: 4px; }
.age-bar span, .age-legend { font-size: 12px; }
.age-legend { flex-wrap: wrap; justify-content: flex-start; gap: 8px 16px; }
.age-highlight { font-size: 14px; }
.analysis-detail .findings-map { height: 345px; grid-row: auto; background: transparent; }
.finding-cards { left: 18%; gap: 0; }
.finding-card { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; min-height: 106px; background: transparent; }
.finding-card:last-child { border-bottom: 0; }
.finding-card strong { font-size: 23px; }
.finding-card .finding-title { font-size: 14px; }
.finding-card small { font-size: 12px; }
.finding-card.active { box-shadow: none; background: #faf6ed; }
.analysis-note { font-size: 12px; margin-top: 24px; }

/* Diagrams carry the comparison, without imagery behind the evidence. */
.compare-panels { gap: 24px; }
.compare-panel { background: #fafbfc; border: 1px solid #dbe2ec; border-radius: 12px; padding: 24px; }
.compare-panel.after-panel { background: #f4f9f5; border-color: #cddfd2; }
.compare-panel::after { display: none; }
.tool-chip, .buyer-node, .compare-hub { box-shadow: none; border-radius: 7px; }
.decision-card { border-radius: 8px; box-shadow: none; }
.compare-result { border-top: 1px solid #17161415; padding-top: 20px; }
.jump-timeline strong, .jump-timeline small, .decision-caption, .decision-evidence, .decision-outcome { font-size: 12px; }

/* A continuous working surface replaces nested product cards. */
.solution .visual.product-panel { border-radius: 12px; box-shadow: none; border-color: var(--line); }
.product-toolbar { background: #f8f9fa; padding: 18px 24px; }
.product-zones { gap: 0; padding: 0; background: white; }
.product-zones > .agent-card { max-width: none; border: 0; border-radius: 0; padding: 8px; }
.command-zone { gap: 0; padding: 24px; border-left: 1px solid var(--line); }
.command-zone > .card { padding: 0 0 24px; border: 0; border-radius: 0; }
.command-zone > .channels-card { border-top: 1px solid var(--line); padding-top: 24px; }
.panel-kicker { font-size: 13px; }
.reviewer > div > span, .approval-chain small, .approval-rule, .erp-record span { font-size: 12px; }
.approval-chain strong { font-size: 14px; }
.channel-list > span { padding: 4px 0; background: transparent; border: 0; border-radius: 0; font-size: 12px; }
.channel-list { gap: 8px 16px; }
.agent-avatar { display: block; object-fit: cover; background: var(--accent-soft); border-radius: 50%; }
.roi-controls { border: 0; border-radius: 0; background: transparent; padding-left: 0; box-shadow: none; }
.roi-number { color: #197346; }

@media (max-width: 1100px) {
  .department-indicators { grid-template-columns: minmax(190px, .8fr) minmax(0, 2fr); gap: 22px; }
  .secondary-indicators { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
  .analysis-detail { gap: 28px; }
}
@media (max-width: 1150px) {
  .command-zone { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 1023px) {
  .scene { padding-bottom: 52px; }
  #deteccion { padding-top: 110px; }
  .coverage-box .coverage-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
  .dept-role { min-height: 0; }
}
@media (max-width: 767px) {
  .topbar { height: auto; min-height: 98px; display: grid; grid-template-columns: 1fr auto; padding: 10px 18px 0; gap: 4px 12px; }
  .section-nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; gap: 30px; }
  .section-nav a { font-size: 13px; min-height: 40px; }
  .nav-cta { grid-column: 2; grid-row: 1; font-size: 12px; padding: 9px 12px; }
  html { scroll-padding-top: 110px; }
  .scene { scroll-margin-top: 20px; padding-bottom: 40px; }
  #cobertura { scroll-margin-top: 20px; }
  #deteccion { padding-top: 134px; padding-bottom: 58px; }
  #deteccion .hero-visual { height: 600px; padding: 0; border-radius: 12px; }
  #deteccion .hero-evidence { margin-top: 14px; gap: 8px; font-size: 12px; }
  #deteccion .hero-evidence > div { align-items: center; text-align: center; }
  #deteccion .hero-evidence > div > span { white-space: normal; }
  .analyst { max-width: calc(100% - 24px); }
  .analyst-line { font-size: 12px; }
  .detection-counter { display: none; } /* The same totals remain in the evidence strip. */
  .eyebrow { font-size: 13px; }
  .section-heading h2 { font-size: clamp(30px, 7.5vw, 40px); }
  .section-heading p { font-size: 16px; }
  .flow-section .section-heading { width: 100%; }
  #cobertura .coverage-box { border-radius: 18px; }
  .coverage-box .coverage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding: 0; gap: 28px 20px; }
  .coverage-department { padding: 0; border: 0; background: transparent; }
  .coverage-department h3 { font-size: 16px; }
  .department-symbol { margin-bottom: 12px; }
  .department-indicators { grid-template-columns: 1fr; gap: 20px; }
  .lead-indicator { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 20px; }
  .lead-indicator-value { grid-column: 2; grid-row: 1 / 3; flex-direction: column; align-self: center; gap: 4px; }
  .lead-indicator-value strong { font-size: 46px; }
  .lead-indicator-route { grid-column: 1 / -1; padding-top: 8px; }
  .secondary-indicators { gap: 16px 20px; }
  .indicator { padding: 0 0 12px; }
  .indicator-label { font-size: 13px; }
  .indicator-value strong { font-size: 25px; }
  .analysis-detail { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .analysis-detail .findings-map { height: 375px; }
  .finding-card { min-height: 116px; }
  .compare-panel { padding: 20px 14px; }
  .product-toolbar { padding: 16px; }
  .command-zone { padding: 20px 16px; }
  .agent-header { padding: 18px 16px; }
  #case-panel { padding: 20px 16px; }
  .roi-controls { padding: 0; }
}
@media (max-width: 359px) {
  .coverage-box .coverage-grid { grid-template-columns: 1fr; }
  .lead-indicator { padding: 16px; column-gap: 12px; }
  .section-nav { gap: 22px; }
}

/* La entradilla del problema abre la sección del flujo; primera frase con más peso. */
.flow-section .section-heading p strong { color: var(--ink); font-weight: 600; }

/* Antigüedad a ancho completo: retirado el mapa de hallazgos, el espacio se va
   a los porcentajes y al dinero, que es lo que se defiende delante del cliente. */
.analysis-detail { grid-template-columns: minmax(0, 1fr); }
.analysis-detail .inventory-age { max-width: none; }
.age-heading { font-size: 15px; }
.age-bar { height: 54px; }
.age-bar span, .age-legend { font-size: 13px; }
.age-highlight { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 15px; margin-top: 14px; }
.age-highlight b { font-weight: 600; color: var(--ink); white-space: nowrap; }
.age-legend {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 20px; margin-top: 20px;
}
.age-legend span {
  flex-direction: column; align-items: flex-start; gap: 3px;
  padding-top: 11px; border-top: 2px solid var(--line);
}
.age-legend span i { width: 9px; height: 9px; margin-bottom: 2px; }
.age-legend b { font-weight: 700; color: var(--ink); font-size: 19px; letter-spacing: -.02em; }
.age-legend span.age-t0 { border-top-color: #dce3e9; }
.age-legend span.age-t1 { border-top-color: #bbc7d3; }
.age-legend span.age-t2 { border-top-color: var(--flag-soft); }
.age-legend span.age-t3 { border-top-color: var(--stop-soft); }
@media (max-width: 767px) {
  .age-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .age-legend b { font-size: 16px; }
  .age-bar { height: 40px; }
}

/* Séptimo paso (Consumo). El ancho se ajusta para conservar el hueco entre cajas
   que tenía el diagrama de seis: ~47 px, no 24. */
@media (min-width: 768px) {
  .workflow-node:not(.dependency) { width: 10.9%; padding: 12px 8px; }
  .workflow-node:not(.dependency) strong { font-size: 12.5px; }
}
@media (max-width: 767px) {
  .workflow { height: 650px; }
}

/* ── Antes / Después · tres escenarios en pestañas ──────────────────────────
   Procedencia: parche externo del equipo CTO, 21-sep-2026
   (antes-despues-tres-escenarios.patch). El hunk original iba a la línea 258;
   aquí se añade al final porque el fichero ya llevaba bloques posteriores.
   Reglas sin modificar; el rótulo «dos escenarios» de la primera línea es del
   propio parche y quedó desactualizado: los escenarios son tres.             */
/* Antes / Después · dos escenarios (18 sep 2026) */
.scenario-tabs {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 4px;
  max-width: 1200px; margin: 0 auto 20px; border-bottom: 1px solid var(--line);
}
.scenario-tabs button {
  background: transparent; border-bottom: 2px solid transparent; border-radius: 0;
  padding: 10px 16px 12px; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--muted);
}
.scenario-tabs button:hover { color: var(--ink); }
.scenario-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
/* Fundido corto al cambiar de escenario. */
.compare-panel { transition: opacity .28s ease; }
.compare-panels.swap .compare-panel { opacity: .12; transition: none; }

/* Fila de evento: qué entra en cada panel. */
.compare-event {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
  min-height: 44px; margin-top: 10px; font-size: 12px; line-height: 1.35; color: var(--muted);
  opacity: 0; transform: translateX(-14px); transition: opacity .3s ease, transform .3s ease;
}
.compare-event.in { opacity: 1; transform: none; }
.compare-event .chip { font-size: 11px; font-weight: 600; color: var(--ink); flex-shrink: 0; }
.compare-event .chip.tone-stop { background: var(--stop-soft); color: var(--stop); }
.compare-event .chip.tone-flag { background: var(--flag-soft); color: #805015; }
.compare-event .event-text { min-width: 0; }

/* Razonamiento del agente dentro de la tarjeta de propuesta. */
.decision-card { min-height: 268px; }
.decision-evidence { flex-wrap: wrap; gap: 5px 12px; }
.decision-reasoning { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; }
.decision-reasoning li {
  display: flex; align-items: flex-start; gap: 7px; font-size: 12px; line-height: 1.35; color: #3d4653;
  transform: translateY(3px); transition: transform .35s ease;
}
.decision-reasoning li.show { transform: none; }
/* Mientras la línea no ha llegado, deja su hueco como una barra: se lee como razonamiento en curso. */
.decision-reasoning li:not(.show) > span { background: #eceff4; border-radius: 3px; color: transparent; }
.decision-reasoning li:not(.show) .sprite-icon { opacity: .2; }
.decision-reasoning li > span { transition: background-color .35s ease, color .35s ease; }
.decision-reasoning li .sprite-icon { transition: opacity .35s ease; }
.decision-reasoning .sprite-icon { width: 13px; height: 13px; margin-top: 2px; color: #8b95a3; }
.decision-reasoning .reasoning-approval { color: #167849; font-weight: 600; }
.decision-reasoning + .decision-outcome { margin-top: 12px; padding-top: 11px; border-top: 1px solid #e7edea; }
.decision-reasoning + .decision-outcome { opacity: 0; transition: opacity .35s ease; }
.decision-card.complete .decision-reasoning + .decision-outcome { opacity: 1; }
.decision-reasoning .reasoning-approval .sprite-icon { color: var(--after); }

/* Desenlace del panel «Antes», bajo el contador. */
.compare-outcome {
  margin: 9px 0 0; min-height: 32px; text-align: center;
  font-size: 12px; line-height: 1.35; color: var(--muted);
  opacity: 0; transition: opacity .35s ease;
}
.compare-outcome.show { opacity: 1; }
/* El panel «Después» no lleva desenlace bajo el contador: se reserva su hueco para alinear ambos. */
.after-panel .compare-result { padding-bottom: 41px; }
.compare-outcome.tone-stop span {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 4px;
  background: var(--stop-soft); color: var(--stop); font-weight: 600;
}
.compare-outcome .sprite-icon { width: 14px; height: 14px; }

/* Hub «Flow AI»: vigilancia continua y etiqueta de hallazgo. */
.hub-watch[hidden], .hub-flag[hidden] { display: none; }
.hub-watch {
  display: inline-flex; align-items: center; gap: 5px;
  padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line);
  font-size: 11px; color: #167849;
}
.hub-watch em { font-style: normal; }
.hub-watch i { width: 6px; height: 6px; border-radius: 50%; background: var(--after); animation: hub-pulse 1.8s ease-in-out infinite; }
@keyframes hub-pulse { 0%, 100% { opacity: .3; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.1); } }
/* El hallazgo se muestra en el propio hub: encima chocaría con la fila de herramientas. */
.hub-flag {
  display: inline-flex; align-items: center; margin-left: 2px; white-space: nowrap;
  font-size: 11px; font-weight: 600; line-height: 1.3;
  padding: 4px 9px; border-radius: 4px; background: var(--flag-soft); color: #805015;
}
.compare-hub { max-width: 94%; }
.compare-hub strong { white-space: nowrap; }

@media (max-width: 767px) {
  .scenario-tabs { gap: 0; border-bottom: 0; margin-bottom: 14px; }
  .scenario-tabs button { flex: 1 1 100%; padding: 9px 8px 10px; font-size: 12px; border-bottom: 1px solid var(--line); }
  .compare-event { min-height: 40px; margin-top: 8px; font-size: 11.5px; }
  .decision-card { min-height: 262px; }
  .decision-reasoning li { font-size: 11.5px; }
  .compare-outcome { min-height: 46px; font-size: 11.5px; }
  .hub-watch { padding-left: 7px; font-size: 10px; }
  .hub-flag { font-size: 10px; padding: 3px 7px; }
  .after-panel .compare-result { padding-bottom: 55px; }
}

/* Tercer escenario (21 sep 2026) */
/* Con tres pestañas, el móvil las reparte en dos columnas: dos filas como mucho, sin cortar texto. */
@media (max-width: 767px) {
  .scenario-tabs { gap: 0 6px; }
  .scenario-tabs button { flex: 1 1 calc(50% - 3px); padding: 8px 6px 9px; font-size: 11.5px; }
}

/* Los pasos del «Antes»: herramienta + qué hace la persona, revelados uno a uno (21 sep 2026) */
/* `.sr-only` ya está definida en styles.css: aquí solo se usa. */
.jump-timeline { grid-template-columns: 1fr; gap: 6px; margin: 12px 0 8px; min-height: 196px; align-content: start; }
.jump-timeline li { align-items: flex-start; gap: 9px; }
.jump-timeline li > span { margin-top: 1px; }
.jump-timeline li > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 7px; min-width: 0; }
.jump-timeline strong { font-size: 12px; display: inline; flex-shrink: 0; }
.step-acting { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; font-size: 12px; line-height: 1.3; color: #3d4653; }
.step-acting .sprite-icon { width: 12px; height: 12px; flex-shrink: 0; color: #9aa3b0; align-self: flex-start; margin-top: 2px; }
/* Un paso que aún no ha llegado deja su hueco como barra, igual que el razonamiento del agente. */
.jump-timeline li:not(.show) .step-acting > span { background: #eceff4; border-radius: 3px; color: transparent; }
.jump-timeline li:not(.show) strong { color: #b8c0cc; }
.jump-timeline li:not(.show) .sprite-icon { opacity: .2; }
.jump-timeline li .step-acting > span, .jump-timeline li strong { transition: background-color .3s ease, color .3s ease; }
.jump-timeline li.current > span { box-shadow: 0 0 0 3px #146ef522; }

/* Resumen de lo que ha costado el recorrido, al terminar. */
.human-step {
  display: flex; align-items: flex-start; gap: 7px;
  margin: 0; min-height: 34px;
  font-size: 12px; line-height: 1.35; font-style: italic; color: var(--muted);
  opacity: 0; transition: opacity .35s ease;
}
.human-step.show { opacity: 1; }
.human-step .sprite-icon { width: 13px; height: 13px; margin-top: 2px; flex-shrink: 0; }

@media (max-width: 767px) {
  .jump-timeline { min-height: 250px; }
  .step-acting, .jump-timeline strong { font-size: 11.5px; }
  .human-step { min-height: 44px; font-size: 11.5px; }
}

/* ── Control de navegación temporal ──────────────────────────────────────────
   La barra de los cinco actos es además un slider: se puede arrastrar y recibe
   foco. Alto fijo de 5 px para que engordar al :hover no mueva la toolbar (y
   con ella sceneBottom); la zona de pulsación la da un ::before transparente. */
.act-progress { position: relative; height: 3px; align-items: center; cursor: pointer; touch-action: none; } /* 3 px: la barra de herramientas no cambia de alto; la zona de pulsación la da el ::before */
.act-progress::before { content: ''; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }
.act-progress > span { transition: height .12s ease, background .12s ease; }
.act-progress:hover > span, .act-progress:focus-visible > span { height: 5px; }
.act-progress > span.is-hot { background: #c2ccdb; }
.act-progress:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 2px; }

/* ── ¿Por qué NAX? · rediseño del 21 sep 2026 (equipo CTO): dos escenarios enfrentados, cuatro razones
   y el cierre por escrito. Sustituye al bloque .why-nax/.why-head/.why-grid de la entrega del 18 sep.
   Va al final para prevalecer sobre las reglas genéricas de .compare-* del bloque Antes/Después. ── */
/* ===== «Por qué NAX» (21 sep 2026): dos escenarios, cuatro razones y el cierre por escrito.
   Mismo lenguaje que Antes/Después: rejilla de puntos, chips de departamento, logos de
   herramienta y aristas SVG. Izquierda gris y cruzada; derecha, una capa común en azul. ===== */
.why-nax { --panel: #EDF3FF; }
.why-visual { display: flex; flex-direction: column; gap: 26px; }
/* .compare-panels trae margin:auto (para centrar un ancho fijo en Antes/Después); dentro de un
   flex column eso vuelve el grid un ítem con márgenes auto en el eje transversal, así que en vez
   de estirarse (align-items:stretch) se encoge a su contenido y queda centrado. Anulamos el
   margin para que sí se estire al ancho completo, igual que la fila de tarjetas. */
.why-panels { max-width: none; margin: 0; }
.why-panel { padding: 22px 22px 22px; }
.why-panel .panel-label { font-size: 19px; gap: 12px; }
.why-panel .panel-label .chip { font-size: 11px; font-weight: 500; }
.why-chip-muted { background: #ffffffb3; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }

/* El escenario: caja propia con rejilla de puntos y relación de aspecto fija. */
.why-stage {
  height: auto; aspect-ratio: 3 / 2; margin: 15px 0 6px;
  border-radius: 12px; background-color: #ffffff5e; border: 1px solid #17161410;
}
.why-stage .connections { overflow: visible; }

/* Fila superior de departamentos: cinco columnas iguales, el chip y debajo su nodo. */
.why-depts {
  position: absolute; z-index: 2; left: 2%; right: 2%; top: 8px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 5px;
}
.why-dept { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.why-depts .chip { font-size: 11px; padding: 3px 8px; }
.why-dept > small { font-size: 11px; line-height: 1.25; color: var(--muted); }
.why-dept.is-active > .chip { box-shadow: 0 0 0 1.5px var(--accent); }
.why-dept.is-active > small { color: var(--accent); font-weight: 600; }

/* Los cinco asistentes sueltos del panel izquierdo: mismo chip, sin color y en gris. */
.why-ia {
  position: static; transform: none; width: 100%; max-width: 116px;
  padding: 6px 5px; gap: 5px; font-size: 11px; line-height: 1.25;
  white-space: normal; color: #4b5361; background: #fffffff2; border-color: #d9dde3;
}
.why-ia b { font-weight: 500; }
.why-tool { font-size: 12px; padding: 7px 9px; gap: 6px; }
#why-solo-stage .why-tool { background: #f6f6f7f2; border-color: #d9dde3; color: #4b5361; }

/* Anotaciones del caos: el marcador «?» y su nota, al final de una arista gris. Fondo propio
   (--card) con poco relleno para que el texto se lea por encima de las líneas discontinuas y de
   los chips que cruzan detrás; el icono queda como extremo real de la arista (ver why.mjs). */
.why-note {
  position: absolute; z-index: 2; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; line-height: 1.2; color: var(--muted); white-space: nowrap;
  background: var(--card); padding: 3px 7px 3px 3px; border-radius: 6px;
  box-shadow: 0 1px 4px #17161410;
}
/* n3 (IA Financiera) queda a la izquierda de su origen: el icono se invierte al lado derecho
   del rótulo para mirar hacia la arista entrante, en vez de dejarla cruzar sobre el texto. */
.why-note-reverse { flex-direction: row-reverse; padding: 3px 3px 3px 7px; }
.why-note i {
  display: grid; place-items: center; width: 17px; height: 17px; flex-shrink: 0;
  border-radius: 50%; border: 1px dashed #87909c; background: #ffffffdd;
  font: 600 11px/1 'Figtree', sans-serif; font-style: normal; color: #6a727f;
}
.why-compact .why-note { display: none; }

/* El nodo azul: una sola capa con lo que la hace funcionar dentro. Relleno inferior mayor para
   que la fila de píldoras («Modelo por tarea») no quede pegada a la esquina redondeada. */
.why-hub {
  position: absolute; z-index: 3; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; gap: 9px;
  padding: 12px 13px 19px; border-radius: 12px;
  background: var(--accent); color: #fff; box-shadow: var(--shadow);
}
.why-hub-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.why-hub .icon-box { width: 32px; height: 32px; border-radius: 9px; background: #ffffff2e; color: #fff; }
.why-hub .icon-box .sprite-icon { width: 20px; height: 20px; }
.why-hub strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.012em; line-height: 1.2; }
.why-hub small { display: block; margin-top: 2px; font-size: 11px; color: #ffffffc7; }
.why-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.why-pills > span {
  padding: 4px 9px; border-radius: 100vw; background: #fffffff0;
  font-size: 11px; font-weight: 500; color: var(--accent); white-space: nowrap;
}

/* La persona que aprueba, al lado del nodo. */
.why-buyer { flex-direction: column; align-items: center; gap: 5px; padding: 10px 8px; text-align: center; }
.why-buyer .icon-box { width: 29px; height: 29px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.why-buyer .icon-box .sprite-icon { width: 18px; height: 18px; }
.why-buyer strong { font-size: 12px; font-weight: 600; line-height: 1.25; }
.why-buyer small { font-size: 11px; color: var(--muted); }

/* La línea de resultado lleva frase, no una cifra: cuerpo más corto que en Antes/Después. */
.why-result { font-size: 20px; line-height: 1.3; padding-top: 16px; }
.why-result span { font-size: 15px; }

/* Entrada de la escena: primero los chips, luego las aristas; izquierda y después derecha. */
.why-stage .why-fade, .why-stage .edge { opacity: 0; }
.why-stage .edge[data-kind="blue"] {
  stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round;
  stroke-dasharray: var(--len, 400); stroke-dashoffset: var(--len, 400);
}
@keyframes why-in { to { opacity: 1; } }
@keyframes why-draw { to { stroke-dashoffset: 0; } }
.why-stage.why-on .why-fade { animation: why-in .34s ease forwards; animation-delay: calc(var(--t, 0s) + var(--i, 0) * .045s); }
.why-stage.why-on .edge { animation: why-in .38s ease forwards; animation-delay: calc(var(--t, 0s) + .55s + var(--i, 0) * .055s); }
.why-stage.why-on .edge[data-kind="blue"] { animation: why-in .2s ease forwards, why-draw .5s ease forwards; }
.why-stage.why-done .why-fade, .why-stage.why-done .edge { opacity: 1; animation: none; }
.why-stage.why-done .edge[data-kind="blue"] { stroke-dashoffset: 0; }
#why-nax-stage { --t: 1.35s; }
@media (prefers-reduced-motion: reduce) {
  .why-stage .why-fade, .why-stage .edge { opacity: 1; animation: none !important; }
  .why-stage .edge[data-kind="blue"] { stroke-dashoffset: 0; }
}

/* Cuatro razones: tarjeta, glifo en cuadrado de acento suave, título y una frase. */
.why-reasons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.why-reasons > li { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.why-reason-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.why-reason-icon .sprite-icon { width: 20px; height: 20px; }
.why-reasons h3 { font-size: 16px; font-weight: 600; line-height: 1.3; letter-spacing: -.012em; }
.why-reasons p { font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* Cierre: lo que ya hacemos, en una fila, y lo que queda por escrito, en la siguiente. Ambas
   filas alineadas a la izquierda para que los chips no salten de línea sueltos y a la derecha. */
.why-evidence { margin-top: 0; flex-direction: column; align-items: flex-start; gap: 11px; }
.why-evidence strong { font-size: 15px; }
/* La frase muted es más larga que las de otras tiras (hero, flujo): .evidence-strip>div>span
   trae white-space:nowrap para captions cortos, pero aquí desborda en escritorio angosto y en
   móvil (queda cortada por el overflow-x:hidden del body). La dejamos envolver dentro de su
   propia fila. Selector con dos clases para pesar más que esa regla de base. */
.why-nax .why-evidence-lead span { white-space: normal; min-width: 0; flex: 1 1 260px; }
.why-written { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; justify-content: flex-start; }
.why-written-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); flex-shrink: 0; }
.why-docs { margin-left: 0; flex-wrap: wrap; justify-content: flex-start; }
.why-docs .chip { font-size: 11.5px; background: #ffffffc7; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }

@media (max-width: 1023px) {
  .why-visual { gap: 22px; }
  .why-panel { padding: 18px 14px 20px; }
  .why-panel .panel-label { font-size: 17px; }
  .why-reasons { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .why-ia { font-size: 11px; padding: 5px 4px; gap: 4px; max-width: 100%; }
  .why-tool { font-size: 11px; padding: 6px 7px; gap: 5px; }
  .why-depts .chip { font-size: 11px; padding: 2px 6px; }
  .why-hub { padding: 10px 11px; gap: 7px; }
  .why-hub strong { font-size: 14px; }
  .why-result { font-size: 18px; padding-top: 14px; }
  .why-result span { font-size: 14px; }
}
@media (max-width: 767px) {
  .why-visual { gap: 18px; }
  .why-panels { gap: 15px; }
  .why-reasons { grid-template-columns: 1fr; }
  .why-reasons > li { padding: 16px; gap: 8px; }
  .why-evidence { margin-top: 0; }
}
@media (max-width: 480px) {
  .why-stage { aspect-ratio: 1 / 1.15; margin: 12px 0 4px; }
  .why-depts { left: 1%; right: 1%; gap: 2px; }
  .why-depts .chip { font-size: 11px; padding: 2px 4px; letter-spacing: -.02em; }
  .why-dept { gap: 4px; }
  .why-ia { padding: 4px 3px; }
  .why-tool { font-size: 11px; padding: 5px 6px; gap: 4px; }
  .why-tool .sprite-icon { width: 14px; height: 14px; }
  .why-hub { padding: 9px 9px; gap: 6px; }
  .why-buyer { padding: 8px 5px; }
  .why-result { font-size: 17px; }
}

/* Neutraliza dos reglas del bloque Antes/Después que se cuelan por compartir .compare-panel/.after-panel:
   el hueco reservado bajo el contador («padding-bottom: 41px» en .after-panel .compare-result) y el
   margen superior del resultado del panel «Antes». En «¿Por qué NAX?» los paneles ya miden igual. */
.why-panel .why-result, .why-panel.after-panel .why-result { padding-bottom: 0; margin-top: 0; }

/* Sección «Ahorro» (21-sep): al retirar «Operación · USD al año», la fila .roi-numbers de
   styles.css (dos columnas) dejaba «Días laborables» a media anchura con un hueco al lado.
   Con un solo campo, una columna. */
.roi-numbers { grid-template-columns: 1fr; }

/* 21-sep · rótulo «Empresa de ejemplo» en la franja del hero */
/* La franja centra sus hijos (.evidence-strip{align-items:center}); el rótulo se declara
   explícitamente para no depender de esa herencia y quedar a la altura de las cifras. */
#deteccion .hero-evidence > .evidence-tag { align-self: center; }
#deteccion .hero-evidence > .evidence-tag .chip { font-size: 11px; white-space: nowrap; }
@media (max-width: 767px) {
  /* En móvil la franja ya envuelve (.evidence-strip{flex-wrap:wrap}): el rótulo ocupa la
     primera línea entera y las tres cifras se reparten la segunda. El flex:0 0 100% anula
     el flex:1 que styles.css da a todos los hijos de la franja en este ancho. */
  #deteccion .hero-evidence > .evidence-tag { flex: 0 0 100%; justify-content: center; align-items: center; }
}
