/* Flujos de conversación en tienda: tres recorridos de retail que se reproducen solos. */
.flows{margin-top:60px}

/* Cada etapa es una sección propia de la página: su número, su título y su
   animación, separadas entre sí. La del medio va sobre fondo distinto. */
.act-section.alt{background:#f1efea;border-top:1px solid #e6e3dd;border-bottom:1px solid #e6e3dd}
.act-section .section-heading{text-align:center;margin-bottom:52px}
.act-section .section-heading .eyebrow{justify-content:center}
.act-section .section-heading>p{max-width:560px;margin-left:auto;margin-right:auto}
.flow-act{max-width:1120px;margin:0 auto}

/* La escena: el visual al centro, las anotaciones apuntando desde los lados. */
.flow-stage{display:grid;grid-template-columns:1fr minmax(0,404px) 1fr;gap:18px;align-items:stretch}
.flow-center{min-width:0}
.flow-side{list-style:none;margin:0;padding:0;display:grid;grid-template-rows:repeat(3,1fr);gap:10px}
.flow-note{grid-row:var(--slot);align-self:center;display:grid;align-items:center;gap:10px;opacity:.35;transition:opacity .45s ease}
.flow-side.left .flow-note{grid-template-columns:1fr auto;text-align:right}
.flow-side.right .flow-note{grid-template-columns:auto 1fr}
.flow-note.is-active,.flow-note.is-done{opacity:1}
.flow-note-body strong{display:block;font-size:14px;font-weight:450;letter-spacing:-.02em;line-height:1.3;color:#8d8678;transition:color .45s ease}
.flow-note-body small{display:block;font-size:11.5px;color:#a9a294;margin-top:4px;line-height:1.4;transition:color .45s ease}
.flow-note.is-active .flow-note-body strong{color:var(--ink)}
.flow-note.is-done .flow-note-body strong{color:#5c564a}
.flow-note.is-active .flow-note-body small{color:#8b8477}

.flow-arrow{width:74px;height:20px;overflow:visible;flex:none}
.flow-side.right .flow-arrow{transform:scaleX(-1)}
.flow-arrow path{fill:none;stroke:#cfc8ba;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:stroke .45s ease}
.flow-arrow .shaft{stroke-dasharray:4 4}
.flow-note.is-active .flow-arrow path{stroke:var(--gold-deep,#dfb12a)}
.flow-note.is-active .flow-arrow .shaft{animation:flow-dash 1.1s linear infinite}
.flow-note.is-done .flow-arrow path{stroke:#b6ae9c}
@keyframes flow-dash{to{stroke-dashoffset:-8}}

/* Los pasos en texto solo aparecen cuando no caben las anotaciones. */
.flow-steps{display:none;list-style:none;margin:26px auto 0;padding:0;gap:3px;counter-reset:flowstep}
.flow-steps li{display:grid;grid-template-columns:26px 1fr;gap:14px;align-items:start;font-size:14px;color:#a59f91;padding:11px 0;transition:color .3s;line-height:1.45}
.flow-steps li:before{counter-increment:flowstep;content:counter(flowstep);font-size:10px;width:26px;height:26px;border-radius:50%;border:1px solid #ded8cd;display:grid;place-items:center;color:#ada699;transition:background .3s,color .3s,border-color .3s}
.flow-steps li.is-done{color:#514d3f}
.flow-steps li.is-done:before{content:"✓";background:#ebe7de;border-color:#cfc6b3;color:#685e46}
.flow-steps li.is-active{color:var(--ink)}
.flow-steps li.is-active:before{background:var(--yellow);border-color:var(--yellow);color:#33302b}

.flow-replay{display:inline-flex;align-items:center;gap:12px;background:none;border:1px solid #d7d1c4;border-radius:8px;padding:11px 16px;font-size:13px;color:#615a4b;transition:background .2s,border-color .2s,opacity .25s}
.flow-replay:hover{background:#edeae3;border-color:#c3baa7}
.flow-replay[hidden]{display:none}
.flow-actions{display:flex;align-items:center;justify-content:center;gap:14px;margin-top:30px}

/* La conversación */
.flow-chat-wrap{background:#fff;border:1px solid #e6e3dc;border-radius:16px;overflow:hidden;box-shadow:0 14px 34px #34312b0d}
.flow-chat-head{display:flex;align-items:center;gap:13px;padding:16px 20px;border-bottom:1px solid #efede8;background:#fbfaf9}
.flow-avatar{width:38px;height:38px;border-radius:50%;background:#eae6df;color:#6e665224;display:grid;place-items:center;font-size:12px;color:#6e6551;flex:none;letter-spacing:.04em}
.flow-chat-head strong{display:block;font-size:14px;font-weight:500;letter-spacing:-.01em}
.flow-chat-head small{font-size:11px;color:#9a9488}
.flow-channel{margin-left:auto;font-size:10px;letter-spacing:.1em;color:#989182;border:1px solid #e6e1d7;border-radius:20px;padding:5px 11px}

.flow-chat{list-style:none;margin:0;padding:22px 20px;display:flex;flex-direction:column;gap:12px;min-height:430px;max-height:530px;overflow-y:auto;scrollbar-width:thin;background:#fdfcfa}
.flow-chat::-webkit-scrollbar{width:5px}
.flow-chat::-webkit-scrollbar-thumb{background:#e5e1d8;border-radius:4px}

.flow-msg{max-width:82%;display:flex;flex-direction:column;animation:flow-in .34s ease-out both}
.flow-msg.from-agent{align-self:flex-start}
.flow-msg.from-worker{align-self:flex-end;align-items:flex-end}
@keyframes flow-in{from{opacity:0;transform:translateY(9px)}to{opacity:1;transform:none}}

.flow-bubble{border-radius:14px;padding:12px 15px;font-size:14px;line-height:1.5;color:var(--ink);border:1px solid #e9e6e0;background:#fff}
.from-agent .flow-bubble{border-bottom-left-radius:5px}
.from-worker .flow-bubble{background:#f0ece4;border-color:#e5ded1;border-bottom-right-radius:5px}
.flow-time{font-size:10px;color:#a9a295;margin-top:5px;padding:0 4px;display:flex;align-items:center;gap:5px}
.from-worker .flow-time{justify-content:flex-end}
.flow-check{color:#9a9273;font-size:11px}

.flow-typing{display:flex;gap:4px;padding:14px 16px}
.flow-typing span{width:6px;height:6px;border-radius:50%;background:#c1baab;animation:flow-dot 1.1s infinite}
.flow-typing span:nth-child(2){animation-delay:.16s}
.flow-typing span:nth-child(3){animation-delay:.32s}
@keyframes flow-dot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}

/* Foto enviada, con su lectura */
.flow-photo{margin:0;width:260px;max-width:100%;border-radius:14px;overflow:hidden;border:1px solid #e9e6e0;background:#fff}
.from-worker .flow-photo{border-color:#e5ded1}
.flow-photo-frame{position:relative;display:block;line-height:0}
.flow-photo img{width:100%;height:auto;display:block}
.flow-photo figcaption{font-size:11px;color:#989284;padding:9px 12px;display:flex;justify-content:space-between;gap:10px;align-items:center;line-height:1.3}

.flow-scanline{position:absolute;left:0;right:0;top:0;height:22%;background:linear-gradient(180deg,#f8d64b00,#f8d64b26 55%,#f8d64b5e);border-bottom:2px solid #e9c23f;opacity:0;pointer-events:none}
.is-scanning .flow-scanline{opacity:1;animation:flow-scan 1.5s ease-in-out 2 alternate}
@keyframes flow-scan{from{transform:translateY(-22%)}to{transform:translateY(455%)}}

.flow-box{position:absolute;left:var(--x);top:var(--y);width:var(--w);height:var(--h);border:2px solid #d9792f;border-radius:4px;background:#d9792f1f;opacity:0;transform:scale(.92);transition:opacity .3s,transform .3s;pointer-events:none}
.flow-box.is-shown{opacity:1;transform:none}
.flow-box em{position:absolute;left:-1px;top:calc(100% + 3px);font-style:normal;font-size:9px;letter-spacing:.03em;background:#d9792f;color:#fff;padding:2px 6px;border-radius:4px;white-space:nowrap}
.flow-box.label-up em{top:auto;bottom:calc(100% + 3px)}
.flow-box.good{border-color:#877c60;background:#877c601f}
.flow-box.good em{background:#877c60}

.flow-reading{display:flex;align-items:center;gap:10px;font-size:12px;color:#888274;border:1px dashed #dad4c8;border-radius:10px;padding:10px 14px;background:#fbfaf7}
.flow-reading i{width:13px;height:13px;border:2px solid #ded8cd;border-top-color:#a09377;border-radius:50%;animation:flow-spin .8s linear infinite;flex:none}
@keyframes flow-spin{to{transform:rotate(360deg)}}

/* Tarjetas del agente: listas de alertas y resultados */
.flow-card{border:1px solid #e7e3dc;border-radius:14px;background:#fff;padding:14px 16px;font-size:13px;width:280px;max-width:100%}
.flow-card-title{display:flex;align-items:center;gap:9px;font-size:11px;letter-spacing:.07em;color:#8b8476}
.flow-card-title .dot{width:7px;height:7px;border-radius:50%;background:#c39736;flex:none}
.flow-card.ok .flow-card-title .dot{background:#92866b}
.flow-card ul{list-style:none;margin:11px 0 0;padding:0;display:grid;gap:7px}
.flow-card li{display:grid;grid-template-columns:16px 1fr;gap:9px;align-items:start;color:#524c40;line-height:1.45;font-size:13px}
.flow-card li span{color:#a98f3d;font-size:12px;line-height:1.5}
.flow-card.ok li span{color:#7f745a}
.flow-card-foot{margin-top:12px;padding-top:11px;border-top:1px solid #f0eee9;font-size:11px;color:#989284}

/* Bajo 1040px las anotaciones no caben a los lados: vuelven a ser la lista de pasos. */
@media (max-width:1040px){
 .flow-stage{grid-template-columns:1fr;justify-items:center}
 .flow-center{width:100%;max-width:420px}
 .flow-side{display:none}
 .flow-steps{display:grid;max-width:420px;margin-inline:auto}
 .flow-chat{min-height:380px}
}
@media (max-width:760px){
 .flows{margin-top:40px}
 .flow-act{padding:24px 18px;border-radius:14px}
     .flow-chat{padding:18px 14px;min-height:340px;max-height:460px}
 .flow-msg{max-width:90%}
 .flow-photo{width:216px}
}
@media (prefers-reduced-motion:reduce){
 .flow-msg{animation:none}
 .is-scanning .flow-scanline{animation:none;opacity:0}
 .flow-reading i{animation:none}
 .flow-typing span{animation:none;opacity:.55}
 .flow-box{transition:none}
}

/* Paso 1: el scorecard de Perfect Store */
.flow-visual{min-width:0}
.score-card{background:#fff;border:1px solid #e6e3dc;border-radius:16px;overflow:hidden;box-shadow:0 14px 34px #34312b0d}
.score-card[hidden],.flow-chat-wrap[hidden]{display:none}
.score-head{display:flex;align-items:center;gap:14px;padding:18px 22px;border-bottom:1px solid #efede8;background:#fbfaf9}
.score-head strong{display:block;font-size:15px;font-weight:500;letter-spacing:-.015em}
.score-head small{font-size:11px;color:#9a9488}
.score-badge{margin-left:auto;font-size:10px;letter-spacing:.08em;color:#8b7a3a;background:#fdf4d6;border:1px solid #f0e2ab;border-radius:20px;padding:5px 11px;white-space:nowrap}

.score-inputs{padding:18px 22px;border-bottom:1px solid #efede8}
.score-inputs h4{margin:0 0 11px;font-size:10px;font-weight:400;letter-spacing:.09em;color:#a29c90}
.score-chips{display:flex;flex-wrap:wrap;gap:8px}
.score-chip{font-size:12px;padding:8px 12px;border:1px solid #efe6c4;border-radius:6px;color:#6a5c2c;background:#fdf8e6;opacity:0;transform:translateY(5px);transition:opacity .3s,transform .3s}
.score-chip.is-shown{opacity:1;transform:none}

.score-total{display:flex;align-items:center;gap:18px;padding:22px}
.score-dial{position:relative;width:86px;height:86px;border-radius:50%;flex:none;display:grid;place-items:center;background:conic-gradient(var(--yellow) calc(var(--score,0)*1%),#f0eee9 0)}
.score-dial:before{content:"";position:absolute;inset:9px;border-radius:50%;background:#fff}
.score-dial-value{position:relative;font-size:22px;letter-spacing:-.04em;color:var(--ink);font-variant-numeric:tabular-nums}
.score-total strong{display:block;font-size:17px;font-weight:450;letter-spacing:-.025em}
.score-total small{display:block;font-size:12px;color:#989284;margin-top:5px}

.score-metrics{padding:0 22px 8px;display:grid;gap:15px}
.score-row{display:grid;grid-template-columns:1fr 96px 42px;align-items:center;gap:14px;opacity:.4;transition:opacity .35s}
.score-row.is-shown{opacity:1}
.score-label{font-size:13px;color:#5a5549;line-height:1.3}
.score-bar{height:7px;border-radius:5px;background:#f0eee9;overflow:hidden}
.score-bar i{display:block;height:100%;width:0;border-radius:5px;background:var(--yellow);transition:width .75s cubic-bezier(.2,.8,.2,1)}
.score-value{font-size:13px;text-align:right;font-variant-numeric:tabular-nums;color:#403d38}
.score-foot{padding:15px 22px;border-top:1px solid #efede8;font-size:11px;color:#989284;background:#fbfaf9}

/* El algoritmo: de la métrica que no cumple a la tarea, ordenada por plata. */
.score-engine{margin-top:14px;padding:18px 22px 20px;border-top:1px solid #efede8;background:#fbfaf7;opacity:0;transform:translateY(8px);transition:opacity .5s ease,transform .5s ease}
.score-engine.is-shown{opacity:1;transform:none}
.score-engine-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.engine-dot{width:7px;height:7px;border-radius:50%;background:var(--gold-deep,#dfb12a);box-shadow:0 0 0 4px #dfb12a26;flex:none}
.score-engine-head strong{font-size:13px;font-weight:500;letter-spacing:-.015em}
.score-engine-head small{font-size:11px;color:#9a9486;margin-left:auto}
.score-tasks{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:9px}
.score-task{display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border:1px solid #ece8e0;border-left:3px solid var(--gold,#f8d64b);border-radius:9px;padding:12px 14px;opacity:0;transform:translateX(-10px);transition:opacity .4s ease,transform .4s ease}
.score-task.is-shown{opacity:1;transform:none}
.score-task-metric{display:block;font-size:10px;letter-spacing:.04em;color:#a39b8a;text-transform:uppercase}
.score-task strong{display:block;font-size:13.5px;font-weight:450;letter-spacing:-.015em;margin-top:3px}
.score-task-right{text-align:right;flex:none}
.score-task-right b{display:block;font-size:15px;font-weight:500;letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.score-task-right small{display:block;font-size:10.5px;color:#9a9486;margin-top:2px}
.score-engine-foot{margin-top:13px;font-size:11.5px;color:#8d8678}

/* Paso 2: el reparto del día */
.roster-card{background:#fff;border:1px solid #e6e3dc;border-radius:16px;box-shadow:0 14px 34px #34312b0d;padding:20px 22px 18px}
.roster-card[hidden]{display:none}
.roster-label{font-size:9.5px;letter-spacing:.12em;color:#9a9486}
.roster-rows{list-style:none;margin:16px 0 0;padding:0;display:grid;gap:10px}
.roster-row{display:grid;grid-template-columns:38px 1fr auto;gap:13px;align-items:start;border:1px solid #ece8e0;border-radius:11px;padding:13px 14px;opacity:0;transform:translateY(9px);transition:opacity .4s ease,transform .4s ease,border-color .4s ease,background .4s ease}
.roster-row.is-shown{opacity:1;transform:none}
.roster-row.is-sent{background:#fdfcf8;border-color:#e6dfcd}
.roster-avatar{width:38px;height:38px;border-radius:50%;background:#eae6df;color:#6e6551;display:grid;place-items:center;font-size:12px;letter-spacing:.04em}
.roster-top{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap}
.roster-top strong{font-size:14px;font-weight:500;letter-spacing:-.015em}
.roster-store{font-size:11px;color:#9a9486}
.roster-tasks{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:5px}
.roster-task{display:flex;align-items:baseline;gap:8px;font-size:12px;line-height:1.4;flex-wrap:wrap}
.task-tipo{font-size:10px;letter-spacing:.03em;text-transform:uppercase;border-radius:4px;padding:3px 7px;flex:none;background:#f1eee7;color:#7f7869}
.roster-task.money .task-tipo{background:var(--gold-soft,#fdf3cf);color:var(--gold-ink,#7a6316)}
.roster-task.alert .task-tipo{background:#f1eee7;color:#7f7869}
.task-detalle{color:#6f6859;flex:1;min-width:0}
.roster-task b{font-weight:500;font-size:12.5px;font-variant-numeric:tabular-nums;color:var(--ink)}
.roster-meta{display:flex;align-items:center;gap:8px;margin-top:9px;flex-wrap:wrap}
.roster-count{font-size:10.5px;background:var(--gold-soft,#fdf3cf);color:var(--gold-ink,#7a6316);border-radius:5px;padding:4px 8px}
.roster-due{font-size:10.5px;color:#9a9486}
.roster-check{font-size:13px;letter-spacing:-3px;color:#d6d0c3;transition:color .35s ease}
.roster-row.is-read .roster-check{color:var(--gold-deep,#dfb12a)}
.roster-foot{margin-top:15px;padding-top:13px;border-top:1px solid #f0eee9;font-size:11.5px;color:#8d8678}

/* Oportunidad levantada */
.flow-card.chance{border-color:#f0e2ab;background:#fffdf3}
.flow-card.chance .flow-card-title .dot{background:#e0b429}
.flow-card.chance li span{color:#9a7f2e}

@media (max-width:760px){
 .score-total{padding:18px;gap:14px}
 .score-dial{width:72px;height:72px}
 .score-dial-value{font-size:19px}
 .score-metrics{padding:0 18px 6px;gap:13px}
 .score-row{grid-template-columns:1fr 64px 40px;gap:10px}
 .score-label{font-size:12px}
 .score-head,.score-inputs,.score-foot{padding-left:18px;padding-right:18px}
 .score-engine{padding:16px 18px 18px}
 .roster-card{padding:17px 16px 15px}
 .roster-row{grid-template-columns:32px 1fr auto;gap:11px;padding:11px 12px}
 .roster-avatar{width:32px;height:32px;font-size:11px}
 .score-task{padding:11px 12px;gap:12px}
}
@media (prefers-reduced-motion:reduce){
 .score-chip,.score-row,.score-bar i{transition:none}
}

/* Lo que antes vivía en secciones propias ahora es el segundo movimiento del acto:
   el video de la demo en el acto 2 y la lectura de la foto en el acto 3. */
.act-extra{margin-top:48px;padding-top:40px;border-top:1px solid #e0dbd1}
.act-extra>h4{font-size:11px;letter-spacing:.11em;text-transform:uppercase;color:#8d8678;text-align:center;font-weight:450;margin-bottom:28px}
.act-extra .phone-scene{max-width:420px;margin:0 auto}
.act-extra .evidence-grid{display:grid;grid-template-columns:minmax(0,370px) 1fr;gap:44px;align-items:start}
.act-extra .reader-findings{margin-top:0}
.act-extra .evidence-badge{display:block;margin-bottom:16px}

@media (max-width:980px){
 .act-extra .evidence-grid{grid-template-columns:1fr;gap:28px}
 .act-extra .reader-shell{max-width:420px;margin:0 auto}
}
