/* Codexa — los cuatro capítulos de servicio. Mismo esqueleto para los cuatro: ninguno pesa más que otro.
   Cada demo avanza con el scroll: el motor pone .on en [data-on] y --t en [data-prog]. */

.chapter { position: relative; height: 270vh; }
.chapter .sticky { align-items: stretch; grid-template-rows: auto 1fr; }
.ch-rail { position: relative; z-index: 2; display: flex; gap: 22px; width: 100%; max-width: calc(var(--maxw) + var(--gut) + var(--gut-r)); margin: 0 auto;
  padding: 92px var(--gut-r) 0 var(--gut); font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #4b4b63; }
.ch-rail span { position: relative; padding-bottom: 12px; }
.ch-rail .cur { color: var(--ink); }
.ch-rail .cur::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 8px var(--lamp); vertical-align: 1px; }
.ch-bar { position: absolute; left: var(--gut); right: var(--gut-r); bottom: 0; height: 1px; background: var(--line); }
.ch-bar::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--t, 0)); background: linear-gradient(90deg, var(--indigo), var(--lamp)); }

.ch-grid { width: 100%; max-width: calc(var(--maxw) + var(--gut) + var(--gut-r)); margin: 0 auto; padding: 0 var(--gut-r) 0 var(--gut);
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.chapter.flip .ch-copy { order: 2; }
.ch-copy { display: grid; gap: 18px; align-content: center; }
.ch-copy .lamp { font-size: clamp(44px, 6vw, 92px); }
.ch-lead { max-width: 44ch; color: var(--mute); font-size: clamp(15.5px, 1.25vw, 17.5px); }
.ch-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; max-width: 520px; }
.ch-points li { position: relative; padding-left: 20px; font-size: 14.5px; color: #c9c9da; }
.ch-points li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 1px; background: var(--lamp); }
.ch-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

.ch-stage { position: relative; display: grid; place-items: center; height: min(640px, 74svh); }
.float-chip { position: absolute; left: 0; bottom: 4%; z-index: 3; max-width: 260px; padding: 14px 16px; border-radius: 16px; background: rgba(20, 20, 32, .86); border: 1px solid rgba(255, 196, 107, .3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 13.5px; line-height: 1.45; color: var(--mute); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8);
  opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .6s var(--ease); }
.float-chip b { color: var(--lamp); font-weight: 600; }
.float-chip.on { opacity: 1; transform: none; }
#automatizaciones .float-chip { left: auto; right: 0; }
#apps .float-chip { left: auto; right: -8px; top: 2%; bottom: auto; }

/* ---------- Demo 1: chat ---------- */
.chat-phone { height: min(620px, 72svh); display: flex; flex-direction: column; }
.cp-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.cp-head .av { width: 38px; height: 38px; font-size: 15px; }
.cp-head b { display: block; font: 600 14.5px/1.2 var(--sans); }
.cp-head small { font: 400 11px/1 var(--mono); color: var(--wa); }
.cp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 14px 10px; overflow: hidden;
  background: radial-gradient(circle at 20% 10%, rgba(99, 102, 241, .07), transparent 50%), #0e0e17; border-radius: 26px; margin-top: 8px; }
.bub { display: none; max-width: 82%; padding: 9px 12px 7px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.bub.on { display: block; animation: pop .45s var(--ease) both; }
.bub time { display: block; margin-top: 3px; text-align: right; font: 400 9.5px/1 var(--mono); opacity: .55; }
.bub.me { align-self: flex-end; background: #144d3f; border-bottom-right-radius: 5px; }
.bub.bot { align-self: flex-start; background: #1d1e2c; border-bottom-left-radius: 5px; }
.typing { display: none; align-self: flex-start; gap: 4px; padding: 12px 14px; border-radius: 16px; background: #1d1e2c; }
.typing.on { display: inline-flex; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #9da3d8; animation: dots 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
.booked { display: none; align-self: stretch; margin-top: 6px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(160deg, rgba(255, 186, 90, .16), rgba(255, 186, 90, .04)); border: 1px solid rgba(255, 196, 107, .4); }
.booked.on { display: grid; gap: 3px; animation: pop .5s var(--ease) both; }
.booked b { font: 700 15px/1.2 var(--sans); color: var(--lamp); }
.booked b::before { content: "✓ "; }
.booked span { font-size: 13.5px; }
.booked small { font: 400 11px/1.4 var(--mono); color: var(--mute); }
.cp-input { margin-top: 10px; padding: 12px 16px; border-radius: 999px; background: #161622; font-size: 13px; color: #5f5f78; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dots { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---------- Demo 2: flujo de automatización ---------- */
.flow { width: min(470px, 100%); display: flex; flex-direction: column; }
.fl-node { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 18px; background: var(--night-2); border: 1px solid var(--line);
  opacity: .32; transition: opacity .5s, border-color .5s, box-shadow .6s, background .5s; }
.fl-node.on { opacity: 1; border-color: rgba(255, 196, 107, .35); background: linear-gradient(90deg, rgba(255, 186, 90, .07), var(--night-2) 60%); box-shadow: 0 16px 40px -24px rgba(255, 170, 60, .5); }
.fl-ic { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--night-3); border: 1px solid var(--line-2); font: 600 12px/1 var(--mono); color: var(--mute); transition: all .5s; }
.fl-node.on .fl-ic { background: var(--lamp); border-color: var(--lamp); color: #1d1405; }
.fl-node b { display: block; font: 600 15px/1.3 var(--sans); }
.fl-node small { font-size: 12.5px; color: var(--mute); }
.fl-node em { font: 500 10px/1 var(--mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--wa); opacity: 0; transition: opacity .4s .2s; }
.fl-node.on em { opacity: 1; }
.fl-wire { position: relative; display: block; width: 2px; height: clamp(14px, 3svh, 26px); margin-left: 43px; background: var(--line-2); }
.fl-wire::after { content: ""; position: absolute; inset: 0; transform-origin: top; transform: scaleY(var(--t, 0)); background: var(--lamp); box-shadow: 0 0 10px var(--lamp); }

/* ---------- Demo 3: página web ---------- */
.browser { width: min(580px, 100%); border-radius: 18px; overflow: hidden; background: #15151f; border: 1px solid var(--line-2); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .9); }
.br-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: #1b1b27; }
.br-bar i { width: 10px; height: 10px; border-radius: 50%; background: #34344a; }
.br-url { margin-left: 12px; flex: 1; padding: 6px 12px; border-radius: 8px; background: #0f0f18; font: 400 11.5px/1 var(--mono); color: var(--mute); }
.br-page { --pg: #1a1a26; --pk: #232333; padding: 16px 20px 22px; background: var(--pg); transition: background .7s; }
.br-page.on { --pg: #fbf4e8; }
.wp-nav { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.wp-nav b { font: 800 16px/1 var(--display); font-variation-settings: "wght" 800, "wdth" 85; text-transform: uppercase; }
.wp-l { width: 38px; height: 8px; border-radius: 4px; }
.wp-nav .wp-l:first-of-type { margin-left: auto; }
.wp-btn { padding: 7px 12px; border-radius: 999px; font: 600 11px/1 var(--sans); }
.wp-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: center; margin-bottom: 18px; }
.wp-txt { display: grid; gap: 10px; justify-items: start; }
.wp-k { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.wp-h1 { font: 800 clamp(20px, 2.1vw, 28px)/1 var(--display); font-variation-settings: "wght" 800, "wdth" 80; text-transform: uppercase; }
.wp-cta { padding: 9px 14px; border-radius: 999px; font: 600 11.5px/1 var(--sans); }
.wp-img { aspect-ratio: 1; border-radius: 50%; }
.wp-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wp-cards div { display: grid; gap: 4px; padding: 8px; border-radius: 12px; }
.wp-cards i { display: block; aspect-ratio: 16 / 10; border-radius: 8px; }
.wp-cards b { font: 600 11.5px/1.2 var(--sans); } .wp-cards small { font: 500 10px/1 var(--mono); }
/* esqueleto (apagado) */
.br-page :is(.wp-nav b, .wp-k, .wp-h1, .wp-cta, .wp-btn, .wp-cards b, .wp-cards small) { color: transparent; background: var(--pk); border-radius: 6px; transition: color .6s .15s, background .6s; }
.br-page .wp-l, .br-page .wp-img, .br-page .wp-cards i { background: var(--pk); transition: background .7s; }
.br-page .wp-cards div { background: transparent; transition: background .6s; }
/* diseñado (encendido) */
.br-page.on .wp-nav b { color: #2b1408; background: transparent; }
.br-page.on .wp-l { background: #e7d8c1; }
.br-page.on .wp-btn, .br-page.on .wp-cta { color: #fff; background: #d6361b; }
.br-page.on .wp-k { color: #b2541a; background: transparent; }
.br-page.on .wp-h1 { color: #2b1408; background: transparent; }
.br-page.on .wp-cards div { background: #fff; box-shadow: 0 6px 16px -10px rgba(80, 40, 10, .4); }
.br-page.on .wp-cards b { color: #2b1408; background: transparent; }
.br-page.on .wp-cards small { color: #b2541a; background: transparent; }
.br-page.on .wp-img.on { background:
  radial-gradient(circle at 36% 36%, #b8321c 0 6.5%, transparent 7%), radial-gradient(circle at 63% 31%, #b8321c 0 6%, transparent 6.5%),
  radial-gradient(circle at 58% 62%, #b8321c 0 6.5%, transparent 7%), radial-gradient(circle at 33% 63%, #b8321c 0 5.5%, transparent 6%),
  radial-gradient(circle at 47% 48%, #6f9a3a 0 2.5%, transparent 3%), radial-gradient(circle at 70% 48%, #6f9a3a 0 2.5%, transparent 3%),
  radial-gradient(circle at 50% 50%, #f7d36a 0 36%, #eaa640 39%, #d17d2c 42%, #a85a22 45.5%, #7b3d17 47.5%, transparent 48%),
  radial-gradient(circle at 50% 50%, #ead6b6 0 49%, transparent 49.5%); }
.br-page.on .wp-cards.on div:nth-child(1) i { background: linear-gradient(135deg, #f7d57a, #e46a2e); }
.br-page.on .wp-cards.on div:nth-child(2) i { background: linear-gradient(135deg, #e46a2e, #a3241a); }
.br-page.on .wp-cards.on div:nth-child(3) i { background: linear-gradient(135deg, #f9e08a, #7cc36b); }
.mini-phone { position: absolute; right: 2%; bottom: 6%; width: 150px; padding: 8px; border-radius: 26px; background: #15151f; border: 1px solid var(--line-2); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .9);
  opacity: 0; transform: translateY(30px) rotate(4deg); transition: opacity .6s, transform .8s var(--ease); }
.mini-phone.on { opacity: 1; transform: rotate(3deg); }
.mp-page { display: grid; gap: 8px; justify-items: start; padding: 12px 10px 14px; border-radius: 19px; background: #fbf4e8; color: #2b1408; }
.mp-page b { font: 800 12px/1 var(--display); font-variation-settings: "wght" 800, "wdth" 85; text-transform: uppercase; }
.mp-img { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(135deg, #f2c25c, #d6361b); }
.mp-page p { font: 800 12.5px/1.05 var(--display); font-variation-settings: "wght" 800, "wdth" 80; text-transform: uppercase; }
.mp-page .wp-cta { color: #fff; background: #d6361b; padding: 6px 10px; font-size: 10px; }
.score { position: absolute; right: 0; top: 4%; display: grid; grid-template-columns: 54px auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px 18px 12px 12px; border-radius: 18px;
  background: rgba(20, 20, 32, .9); border: 1px solid var(--line-2); opacity: 0; transform: translateY(-12px); transition: opacity .5s, transform .6s var(--ease); }
.score.on { opacity: 1; transform: none; }
.score svg { grid-row: 1 / 3; width: 54px; height: 54px; transform: rotate(-90deg); }
.score circle { fill: none; stroke: #26263a; stroke-width: 4; }
.score .sc-arc { stroke: var(--wa); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.2s var(--ease) .2s; }
.score.on .sc-arc { stroke-dashoffset: 2; }
.score b { font: 800 26px/1 var(--display); color: var(--wa); }
.score small { font: 400 11px/1 var(--mono); color: var(--mute); }

/* ---------- Demo 4: app / dashboard ---------- */
.dash { position: relative; width: min(600px, 100%); display: grid; grid-template-columns: 128px minmax(0, 1fr); border-radius: 18px; overflow: visible; background: #11111b; border: 1px solid var(--line-2); box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .9); }
.ds-side { display: grid; align-content: start; gap: 4px; padding: 18px 12px; border-right: 1px solid var(--line); font-size: 12.5px; color: var(--mute); }
.ds-side b { margin: 0 8px 12px; font: 600 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: #5f5f78; }
.ds-side span { padding: 8px; border-radius: 8px; }
.ds-side .cur { background: rgba(255, 186, 90, .1); color: var(--lamp); }
.ds-main { display: grid; gap: 14px; padding: 16px; }
.ds-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ds-kpis div { padding: 12px; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); }
.ds-kpis small { display: block; font-size: 11px; color: var(--mute); margin-bottom: 6px; }
.ds-kpis b { font: 800 clamp(20px, 2vw, 28px)/1 var(--display); font-variation-settings: "wght" 800, "wdth" 80; font-variant-numeric: tabular-nums; }
.ds-chart { padding: 12px; border-radius: 12px; background: var(--night-2); border: 1px solid var(--line); }
.ds-chart small { font-size: 11px; color: var(--mute); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: clamp(70px, 14svh, 120px); margin-top: 10px; }
.bars i { flex: 1; height: calc(var(--h) * 100% * var(--t, 0)); border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--indigo-hi), var(--indigo)); }
.bars i:nth-child(6) { background: linear-gradient(180deg, var(--lamp-hot), var(--lamp)); box-shadow: 0 0 20px rgba(255, 170, 60, .4); }
.days { display: flex; gap: 8px; margin-top: 6px; } .days span { flex: 1; text-align: center; font: 400 10px/1 var(--mono); color: #5f5f78; }
.ds-rows { display: grid; gap: 6px; }
.ds-rows div { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--night-2); font-size: 12.5px;
  opacity: 0; transform: translateX(-10px); transition: opacity .45s, transform .5s var(--ease); }
.ds-rows div.on { opacity: 1; transform: none; }
.ds-rows span { font: 400 11px/1 var(--mono); color: var(--mute); }
.ds-rows em { font: 500 10px/1 var(--mono); font-style: normal; padding: 5px 8px; border-radius: 999px; }
.st-ok { color: var(--wa); background: rgba(37, 211, 102, .1); } .st-go { color: var(--indigo-hi); background: rgba(99, 102, 241, .14); } .st-new { color: var(--lamp); background: rgba(255, 186, 90, .12); }
.ds-phone { position: absolute; right: -18px; bottom: -26px; width: 230px; display: grid; gap: 3px; padding: 14px 16px; border-radius: 18px; background: rgba(28, 28, 42, .95); border: 1px solid rgba(255, 196, 107, .35);
  box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .9); opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .7s var(--ease); }
.ds-phone.on { opacity: 1; transform: none; }
.ds-phone small { font: 400 10px/1 var(--mono); color: var(--mute); }
.ds-phone b { font: 600 14px/1.3 var(--sans); color: var(--lamp); }
.ds-phone span { font-size: 12.5px; color: #c9c9da; }

/* ---------- Celular y pantallas bajas ---------- */
@media (max-width: 900px) {
  .chapter { height: 300vh; }
  .ch-rail { padding-top: 78px; gap: 14px; font-size: 9.5px; letter-spacing: .08em; overflow: hidden; }
  .ch-rail span:not(.cur) { display: none; }
  .ch-grid { grid-template-columns: 1fr; gap: 14px; align-content: start; padding-top: 14px; }
  .chapter.flip .ch-copy { order: 0; }
  .ch-copy { gap: 10px; }
  .ch-copy .eyebrow { display: none; }
  .ch-copy .lamp { font-size: clamp(34px, 10vw, 54px); }
  .ch-lead { font-size: 14.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .ch-points, .ch-ctas .btn-ghost { display: none; }
  .ch-ctas .btn { min-height: 42px; font-size: 13.5px; }
  .ch-stage { height: 50svh; }
  .chat-phone { height: 50svh; width: min(320px, 100%); }
  .float-chip { display: none; }
  .flow { transform: scale(.82); transform-origin: top center; }
  .fl-node { padding: 10px 12px; } .fl-node small { display: none; }
  .dash { grid-template-columns: minmax(0, 1fr); } .ds-side { display: none; }
  .ds-phone { right: 4px; bottom: -14px; width: 200px; }
  .mini-phone { width: 118px; }
  .score { transform: scale(.85); }
}
@media (max-height: 760px) and (min-width: 901px) {
  .ch-points { display: none; }
  .ch-rail { padding-top: 80px; }
}

/* ================= iPhone (lo usan "la noche" y el capítulo de chatbots) ================= */
.iphone { --iph-sh: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 0 2px 3px rgba(0, 0, 0, .55), 0 70px 120px -40px rgba(0, 0, 0, .95), 0 0 0 1px rgba(0, 0, 0, .7);
  position: relative; height: min(640px, 76svh); width: auto; max-width: 100%; aspect-ratio: .49; margin: 0 auto; padding: 10px; border-radius: 58px;
  background: linear-gradient(150deg, #64646f 0%, #2c2c34 20%, #18181d 50%, #33333c 80%, #55555f 100%); box-shadow: var(--iph-sh); transition: box-shadow 1s; }
.iphone::before { content: ""; position: absolute; left: -3px; top: 25%; width: 3px; height: 17%; border-radius: 2px 0 0 2px;
  background: linear-gradient(#3d3d47 0 44%, transparent 44% 56%, #3d3d47 56%); }
.iphone::after { content: ""; position: absolute; right: -3px; top: 29%; width: 3px; height: 11%; border-radius: 0 2px 2px 0; background: #3d3d47; }
.iphone .screen { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden; border-radius: 48px; background: #0b141a; box-shadow: 0 0 0 2px #050507; color: #e9edef; }
.island { position: absolute; z-index: 4; top: 10px; left: 50%; width: 31%; height: 27px; margin-left: -15.5%; border-radius: 20px; background: #000; }
.sbar { position: relative; z-index: 3; flex: none; display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 6px 24px 0 30px; color: #fff; }
.sbar b { font: 600 14.5px/1 var(--sans); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.sbar span { display: flex; align-items: center; gap: 5px; }
.home-ind { position: absolute; z-index: 4; left: 50%; bottom: 7px; width: 36%; height: 5px; margin-left: -18%; border-radius: 3px; background: rgba(255, 255, 255, .85); }

/* Lista de chats (la noche) */
.iphone.night-phone { height: min(640px, 76svh); }
.night.answered .iphone.night-phone { box-shadow: var(--iph-sh), 0 0 110px -10px rgba(255, 170, 60, .42); }
.wa-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 18px 0; font-size: 14px; }
.wa-edit { color: #00a884; }
.night-phone .ph-top { padding: 4px 18px 8px; }
.night-phone .ph-top b { font: 700 30px/1 var(--sans); letter-spacing: -.025em; }
.wa-search { display: flex; align-items: center; gap: 7px; margin: 0 14px 6px; padding: 8px 10px; border-radius: 10px; background: #1f2c34; color: #8696a0; font-size: 14px; }
.night-phone .inbox { border-radius: 0; background: transparent; padding-bottom: 24px; }
.night-phone .inbox li { border-bottom-color: rgba(134, 150, 160, .14); }
.night-phone .inbox time { color: #00a884; }
.night-phone .inbox .badge { background: #00a884; color: #0b141a; }
.night-phone .inbox p { color: #8696a0; }

/* Conversación (chatbots) */
.iphone.chat-phone { height: min(640px, 76svh); }
.chat-phone .sbar { background: #1f2c34; }
.chat-phone .cp-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 4px 14px 10px; border-bottom: 0; background: #1f2c34; color: #e9edef; }
.chat-phone .cp-head > div { flex: 1; min-width: 0; }
.chat-phone .cp-head b { font: 600 15px/1.2 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-phone .cp-head small { font: 400 12px/1.2 var(--sans); color: #8696a0; }
.chat-phone .cp-head .av { width: 34px; height: 34px; font-size: 14px; }
.chat-phone .cp-head svg { flex: none; color: #e9edef; }
.chat-phone .cp-body { margin: 0; border-radius: 0; padding: 12px 10px 10px; gap: 6px;
  background: #0b141a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.045' stroke-width='1.4' stroke-linecap='round'%3E%3Ccircle cx='15' cy='17' r='6'/%3E%3Cpath d='M52 10l8 8m0-8-8 8'/%3E%3Crect x='38' y='50' width='15' height='11' rx='3'/%3E%3Cpath d='M8 63c6-6 12 6 18 0'/%3E%3Cpath d='M70 55l7 11H63z'/%3E%3Cpath d='M75 22a6 6 0 1 1-6 6'/%3E%3C/g%3E%3C/svg%3E"); }
.chat-phone .bub { max-width: 80%; padding: 7px 10px 5px; border-radius: 10px; font-size: 14px; color: #e9edef; }
.chat-phone .bub.me { background: #005c4b; border-bottom-right-radius: 3px; }
.chat-phone .bub.bot { background: #202c33; border-bottom-left-radius: 3px; }
.chat-phone .bub time { color: rgba(233, 237, 239, .6); opacity: 1; font: 400 10px/1 var(--sans); }
.chat-phone .bub.me time::after { content: " ✓✓"; color: #53bdeb; letter-spacing: -3px; }
.chat-phone .typing { background: #202c33; border-radius: 10px; }
.chat-phone .cp-input { flex: none; display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 12px 26px; border-radius: 0; background: #1f2c34; color: #8696a0; font-size: 14px; }
.cp-field { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px 7px 14px; border-radius: 20px; background: #2a3942; color: #8696a0; }
.cp-mic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #00a884; color: #fff; }
#chatbots .ch-stage { justify-items: end; }
#chatbots .iphone { margin: 0 0 0 auto; }
#chatbots .float-chip { left: auto; right: calc(min(800px, 84svh) * .5 + 26px); bottom: 18%; max-width: 220px; }

@media (max-width: 900px) {
  .iphone { padding: 8px; border-radius: 44px; }
  .iphone .screen { border-radius: 36px; }
  .iphone.chat-phone { height: 50svh; width: min(320px, 100%); }
  #chatbots .ch-stage { justify-items: center; }
  #chatbots .iphone { margin: 0 auto; }
}
@media (max-width: 860px) {
  .iphone.night-phone { height: 42svh; width: min(360px, 100%); }
  .night-phone .ph-top b { font-size: 22px; }
  .wa-search, .wa-top .wa-edit { display: none; }
}

/* ================= iPhone más grande y legible ================= */
.iphone, .iphone.night-phone, .iphone.chat-phone { height: min(800px, 84svh); aspect-ratio: .5; }
.chapter .ch-stage { height: min(800px, 82svh); }
.island { width: 27%; margin-left: -13.5%; height: 29px; }
.sbar { padding: 6px 26px 0 34px; }
.sbar b { font-size: 15.5px; }

/* Lista de chats: los nuevos entran arriba, vista previa en 2 líneas */
.iphone.night-phone .inbox { flex-direction: column-reverse; justify-content: flex-end; }
.iphone.night-phone .inbox li { display: none; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 0 12px; padding: 12px 16px 12px 14px; align-items: start; }
.iphone.night-phone .inbox li.on { display: grid; opacity: 1; transform: none; animation: chatIn .55s var(--ease) both; }
@keyframes chatIn { from { opacity: 0; transform: translateY(-14px); background: rgba(0, 168, 132, .14); } to { opacity: 1; transform: none; } }
.iphone.night-phone .av { width: 50px; height: 50px; font-size: 19px; grid-row: 1 / 3; }
.iphone.night-phone .inbox b { font-size: 16.5px; line-height: 1.3; margin-top: 2px; }
.iphone.night-phone .inbox p { font-size: 15px; line-height: 1.32; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; grid-column: 2; padding-right: 22px; }
.iphone.night-phone .inbox time { grid-column: 3; grid-row: 1; margin-top: 4px; font: 400 12px/1 var(--sans); }
.iphone.night-phone .inbox .badge { right: 16px; bottom: 16px; min-width: 21px; height: 21px; font-size: 12px; }
.iphone.night-phone .inbox .tick { right: 16px; bottom: 18px; font-size: 13px; }
.iphone.night-phone .ph-top b { font-size: 34px; }
.iphone.night-phone .wa-top { font-size: 15.5px; }
.iphone.night-phone .wa-search { font-size: 15.5px; padding: 9px 12px; }

/* Conversación: texto un poco más grande */
.iphone.chat-phone .bub { font-size: 15px; }
.iphone.chat-phone .cp-head b { font-size: 16.5px; }
.iphone.chat-phone .booked span { font-size: 14.5px; }

/* ---------- Celular ---------- */
@media (max-width: 900px) {
  .iphone.chat-phone { height: 52svh; width: min(340px, 100%); aspect-ratio: auto; }
  .chapter .ch-stage { height: 52svh; }
}
@media (max-width: 860px) {
  .iphone.night-phone { height: 50svh; width: min(380px, 100%); aspect-ratio: auto; }
  .iphone.night-phone .ph-top b { font-size: 24px; }
  .iphone.night-phone .av { width: 42px; height: 42px; font-size: 16px; }
  .iphone.night-phone .inbox li { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 10px 14px 10px 12px; }
  .iphone.night-phone .inbox b { font-size: 15px; }
  .iphone.night-phone .inbox p { font-size: 13.5px; }
  .sbar { height: 42px; padding: 4px 22px 0 28px; }
  .island { height: 24px; top: 9px; }
}
/* Pregunta del cliente mientras no hay respuesta; respuesta de Codexa cuando ya contestó */
.iphone.night-phone .inbox .a, .iphone.night-phone .inbox li.ok .q { display: none; }
.iphone.night-phone .inbox li.ok .a { display: -webkit-box; color: #d1d7db; }

/* ================= Interior del iPhone en proporción (cqw = % del ancho de la pantalla) =================
   Así se ve como un iPhone real sin importar el tamaño de la ventana o el zoom del navegador. */
.iphone .screen { container-type: inline-size; }
.iphone .screen .island { top: 2.6cqw; height: 7.6cqw; width: 28%; margin-left: -14%; }
.iphone .screen .sbar { height: 12.5cqw; padding: 1.2cqw 7cqw 0 8.6cqw; }
.iphone .screen .sbar b { font-size: 4.1cqw; }
.iphone .screen .sbar span { gap: 1.3cqw; }
.iphone .screen .sbar svg { width: 4.6cqw; height: auto; }
.iphone .screen .sbar svg:last-child { width: 6.8cqw; }
.iphone .screen .home-ind { bottom: 2cqw; height: 1.4cqw; }

.iphone.night-phone .screen .wa-top { padding: .6cqw 4.8cqw 0; font-size: 4.1cqw; }
.iphone.night-phone .screen .ph-pend { font-size: 2.9cqw; }
.iphone.night-phone .screen .ph-top { padding: 1cqw 4.8cqw 2.2cqw; }
.iphone.night-phone .screen .ph-top b { font-size: 8.6cqw; }
.iphone.night-phone .screen .wa-search { display: flex; margin: 0 3.8cqw 2cqw; padding: 2.2cqw 3cqw; gap: 1.8cqw; border-radius: 2.8cqw; font-size: 4.1cqw; }
.iphone.night-phone .screen .wa-search svg { width: 4.2cqw; height: auto; }
.iphone.night-phone .screen .inbox { padding-bottom: 7cqw; }
.iphone.night-phone .screen .inbox li { grid-template-columns: 13.2cqw minmax(0, 1fr) auto; gap: 0 3.2cqw; padding: 3.1cqw 4.2cqw 3.1cqw 3.8cqw; }
.iphone.night-phone .screen .av { width: 13.2cqw; height: 13.2cqw; font-size: 5cqw; }
.iphone.night-phone .screen .inbox b { margin-top: .4cqw; font-size: 4.3cqw; }
.iphone.night-phone .screen .inbox p { padding-right: 6cqw; font-size: 3.8cqw; }
.iphone.night-phone .screen .inbox time { margin-top: 1cqw; font-size: 3.2cqw; }
.iphone.night-phone .screen .inbox .badge { right: 4.2cqw; bottom: 3.8cqw; min-width: 5.4cqw; height: 5.4cqw; padding: 0 1.4cqw; border-radius: 3cqw; font-size: 3cqw; }
.iphone.night-phone .screen .inbox .tick { right: 4.2cqw; bottom: 4.2cqw; font-size: 3.4cqw; }

.iphone.chat-phone .screen .cp-head { gap: 2.8cqw; padding: .8cqw 3.8cqw 2.8cqw; }
.iphone.chat-phone .screen .cp-head .av { width: 9.4cqw; height: 9.4cqw; font-size: 3.9cqw; }
.iphone.chat-phone .screen .cp-head b { font-size: 4.3cqw; }
.iphone.chat-phone .screen .cp-head small { font-size: 3.2cqw; }
.iphone.chat-phone .screen .cp-head svg { width: 5.8cqw; height: auto; }
.iphone.chat-phone .screen .cp-head .cp-back { width: 3cqw; }
.iphone.chat-phone .screen .cp-body { gap: 1.7cqw; padding: 3.2cqw 2.8cqw 2.8cqw; background-size: 24cqw; }
.iphone.chat-phone .screen .bub { padding: 1.9cqw 2.8cqw 1.4cqw; border-radius: 2.8cqw; font-size: 3.9cqw; }
.iphone.chat-phone .screen .bub.me { border-bottom-right-radius: .8cqw; }
.iphone.chat-phone .screen .bub.bot { border-bottom-left-radius: .8cqw; }
.iphone.chat-phone .screen .bub time { margin-top: .8cqw; font-size: 2.7cqw; }
.iphone.chat-phone .screen .typing { gap: 1.1cqw; padding: 3.2cqw 3.8cqw; border-radius: 2.8cqw; }
.iphone.chat-phone .screen .typing i { width: 1.7cqw; height: 1.7cqw; }
.iphone.chat-phone .screen .booked { margin-top: 1.6cqw; padding: 3.6cqw 4.2cqw; border-radius: 3.8cqw; }
.iphone.chat-phone .screen .booked b { font-size: 4cqw; }
.iphone.chat-phone .screen .booked span { font-size: 3.7cqw; }
.iphone.chat-phone .screen .booked small { font-size: 2.9cqw; }
.iphone.chat-phone .screen .cp-input { gap: 2.8cqw; padding: 2.2cqw 3.2cqw 7cqw; font-size: 3.8cqw; }
.iphone.chat-phone .screen .cp-input svg { width: 5.8cqw; height: auto; }
.iphone.chat-phone .screen .cp-field { padding: 1.9cqw 2.8cqw 1.9cqw 3.8cqw; border-radius: 5.4cqw; }
.iphone.chat-phone .screen .cp-field svg { width: 5cqw; }
.iphone.chat-phone .screen .cp-mic { width: 9cqw; height: 9cqw; }
.iphone.chat-phone .screen .cp-mic svg { width: 4.6cqw; }
@media (max-width: 860px) {
  .iphone.night-phone .screen .wa-search { display: none; }
}

/* ================= Marco tipo iPhone 15 Pro: bisel negro fino + borde de titanio ================= */
.iphone { --iph-sh: 0 0 0 1.5px #9a9aa2, 0 0 0 3px #4a4a52, 0 0 0 3.6px rgba(0, 0, 0, .8), 0 50px 90px -30px rgba(0, 0, 0, .9), 0 30px 60px -40px rgba(99, 102, 241, .25);
  padding: 8px; border-radius: 54px; background: #050506; box-shadow: var(--iph-sh); }
.iphone::before { left: -6px; top: 22%; width: 3px; height: 21%; border-radius: 2px 0 0 2px;
  background: linear-gradient(90deg, #6d6d75, #a3a3ab) top / 100% 18% no-repeat, linear-gradient(90deg, #6d6d75, #a3a3ab) 0 42% / 100% 28% no-repeat, linear-gradient(90deg, #6d6d75, #a3a3ab) bottom / 100% 28% no-repeat; }
.iphone::after { right: -6px; top: 31%; width: 3px; height: 12%; border-radius: 0 2px 2px 0; background: linear-gradient(90deg, #a3a3ab, #6d6d75); }
.iphone .screen { border-radius: 46px; box-shadow: none; }
.iphone .screen::after { content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none; border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, .02) 22%, transparent 38%); }
.night.answered .iphone.night-phone { box-shadow: var(--iph-sh), 0 0 120px -10px rgba(255, 170, 60, .4); }
@media (max-width: 900px) {
  .iphone { padding: 7px; border-radius: 44px; }
  .iphone .screen { border-radius: 37px; }
}

/* ================= Celular: iPhone con proporción real y completo en pantalla ================= */
@media (max-width: 900px) {
  .chapter .ch-stage { height: auto; }
  .iphone.chat-phone { height: min(64svh, 620px); width: auto; aspect-ratio: .5; }
  #chatbots .ch-lead { display: none; }
}
@media (max-width: 860px) {
  .iphone.night-phone { height: min(54svh, 560px); width: auto; aspect-ratio: .5; }
}
@media (max-width: 860px) {
  .iphone.night-phone { height: min(60svh, 580px); }
  .night-copy .clock-note { display: none; }
  .night-copy .clock { font-size: clamp(40px, 12vw, 52px); }
  .night-copy .litp { font-size: 15px; line-height: 1.38; }
  /* En pantalla chica el texto del iPhone sube un poco para que se pueda leer */
  .iphone.night-phone .screen .inbox b { font-size: 5cqw; }
  .iphone.night-phone .screen .inbox p { font-size: 4.5cqw; }
  .iphone.night-phone .screen .inbox time { font-size: 3.7cqw; }
  .iphone.night-phone .screen .av { width: 14cqw; height: 14cqw; }
  .iphone.night-phone .screen .inbox li { grid-template-columns: 14cqw minmax(0, 1fr) auto; }
  .iphone.night-phone .screen .ph-pend { font-size: 3.6cqw; }
}
@media (max-width: 900px) {
  .iphone.chat-phone .screen .bub { font-size: 4.5cqw; }
  .iphone.chat-phone .screen .booked span { font-size: 4.2cqw; }
  .iphone.chat-phone .screen .booked b { font-size: 4.6cqw; }
  /* El botón flotante de WhatsApp se esconde mientras una escena está fija para no tapar el iPhone */
  .wa-fab { transition: opacity .3s, transform .3s var(--ease); }
  body.in-stage .wa-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
}

/* ================= Celular: el iPhone ocupa justo el espacio libre bajo el texto (nunca se corta) ================= */
@media (max-width: 900px) {
  .chapter .sticky { display: flex; flex-direction: column; }
  .chapter .ch-grid { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); }
  .chapter .ch-stage { height: 100%; min-height: 0; }
  .iphone.chat-phone { height: 100%; max-height: 640px; }
}
@media (max-width: 860px) {
  .night .sticky { display: flex; flex-direction: column; }
  .night-grid { flex: 1; min-height: 0; grid-template-rows: auto minmax(0, 1fr); padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); }
  .iphone.night-phone { height: 100%; max-height: 600px; }
}
@media (max-width: 900px) {
  .chapter .ch-lead { display: none; }
  .chapter .ch-stage { place-items: start center; }
  #chatbots .ch-stage { place-items: center; }
  .flow { transform: none; }
}

/* ================= Marco fotorrealista (imagen del iPhone 15 Pro con la pantalla recortada) =================
   La interfaz va por debajo, en el hueco exacto de la pantalla (medido sobre la imagen). */
.iphone, .iphone.night-phone, .iphone.chat-phone { aspect-ratio: 798 / 1611; padding: 0; border-radius: 0; background: none; box-shadow: none;
  filter: drop-shadow(0 40px 50px rgba(0, 0, 0, .75)) drop-shadow(0 10px 40px rgba(99, 102, 241, .12)); }
.iphone::before, .iphone::after { display: none; }
.iphone .iph-frame { position: absolute; inset: 0; z-index: 6; width: 100%; height: 100%; pointer-events: none; }
.iphone .screen { position: absolute; left: 5.514%; top: 2.235%; width: 89.223%; height: 95.655%; border-radius: 13.8% / 6.36%; box-shadow: none; }
.iphone .screen .island { display: none; }
.night.answered .iphone.night-phone { box-shadow: none; filter: drop-shadow(0 0 50px rgba(255, 170, 60, .4)) drop-shadow(0 40px 50px rgba(0, 0, 0, .75)); }
/* El botón flotante también se aparta en computador mientras una escena está fija */
.wa-fab { transition: opacity .3s, transform .3s var(--ease); }
body.in-stage .wa-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
/* Páginas web y Apps: escenas más cortas, el demo avanza más rápido con el scroll */
#paginas-web, #apps { height: 175vh; }
@media (max-width: 900px) { #paginas-web, #apps { height: 190vh; } }
