/* ==========================================================================
   autoclinicas.ai · sistema de diseño del sitio
   Marca: navy + cyan, Outfit (títulos) / DM Sans (texto) / DM Mono (datos).
   Un solo acento (cyan), un solo sistema de radios, un solo tema (claro).
   Referencia de estructura: clinera.io. La estética es de Autoclínicas.
   ========================================================================== */

:root {
  --navy: #0D2246;
  --navy-2: #1A3665;
  --navy-3: #2A4A80;
  --cyan: #00B4D8;
  --cyan-2: #22CCF0;
  --cyan-dark: #0090B0;
  --cyan-ink: #00708E;
  --sky: #E8F7FB;
  --sky-2: #D2EEF6;
  --ink: #0A0F1A;
  --mid: #3A4560;
  --muted: #566080;
  --line: #E2E8F0;
  --line-2: #CFD8E3;
  --white: #FFFFFF;
  --paper: #F6F9FB;

  --ok: #0B7A5A;
  --ok-bg: #E4F5EE;
  --wait: #8A5A00;
  --wait-bg: #FFF3D6;
  --off-bg: #EDF1F5;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --pill: 999px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow-sm: 0 1px 2px rgba(13, 34, 70, .06), 0 4px 14px -6px rgba(13, 34, 70, .12);
  --shadow-md: 0 1px 2px rgba(13, 34, 70, .05), 0 18px 40px -16px rgba(13, 34, 70, .22);
  --shadow-lg: 0 2px 4px rgba(13, 34, 70, .05), 0 36px 70px -24px rgba(13, 34, 70, .34);

  --z-float: 40;
  --z-nav: 50;
  --z-menu: 60;

  --f-head: 'Outfit', system-ui, sans-serif;
  --f-body: 'DM Sans', system-ui, sans-serif;
  --f-mono: 'DM Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }
:focus-visible { outline: 2px solid var(--cyan-dark); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--cyan); color: var(--navy); }

.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--navy); color: #fff; padding: 10px 16px; border-radius: var(--pill);
  font: 600 .9rem var(--f-head); transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.ic { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

/* ---------- Tipografía ---------- */
.h1, .h2, .h3 { font-family: var(--f-head); color: var(--navy); text-wrap: balance; }
.h1 { font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; }
.h2 { font-size: clamp(1.85rem, 3.3vw, 2.85rem); line-height: 1.1; letter-spacing: -.028em; font-weight: 700; }
.h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
.h1 em, .h2 em { font-style: normal; color: var(--cyan-dark); }
.lead { font-size: 1.125rem; color: var(--mid); max-width: 58ch; text-wrap: pretty; }
.sub { color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.mono { font-family: var(--f-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow {
  display: inline-block; font: 500 .75rem var(--f-mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--cyan-ink); margin-bottom: 14px;
}
.on-dark .eyebrow { color: var(--cyan-2); }

/* ---------- Botones (pill, un solo sistema) ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px; justify-content: center;
  min-height: 48px; padding: 0 8px 0 24px; border-radius: var(--pill);
  font: 600 .95rem var(--f-head); letter-spacing: -.005em; white-space: nowrap;
  transition: transform .25s var(--ease), background-color .2s, color .2s, box-shadow .25s var(--ease), border-color .2s;
}
.btn:active { transform: scale(.98); }
.btn .bubble {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  transition: transform .3s var(--ease);
}
.btn:hover .bubble { transform: translate(2px, -1px) scale(1.05); }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 10px 24px -10px rgba(13, 34, 70, .55); }
.btn-primary .bubble { background: var(--cyan); color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); box-shadow: 0 16px 30px -12px rgba(13, 34, 70, .6); }
.btn-ghost { background: var(--white); color: var(--navy); border: 1px solid var(--line-2); padding: 0 24px 0 18px; }
.btn-ghost:hover { border-color: var(--navy); background: var(--paper); }
.btn-ghost .ic { color: var(--cyan-ink); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light .bubble { background: var(--navy); color: #fff; }
.btn-light:hover { background: var(--sky); }
.btn-outline-light { color: #fff; border: 1px solid rgba(255, 255, 255, .35); padding: 0 24px; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }
.btn-block { width: 100%; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font: 600 .95rem var(--f-head); color: var(--cyan-ink); }
.link-arrow .ic { transition: transform .3s var(--ease); }
.link-arrow:hover .ic { transform: translateX(4px); }
.on-dark .link-arrow { color: var(--cyan-2); }

/* ---------- Chips y estados ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--pill);
  font: 500 .6875rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  background: var(--off-bg); color: var(--muted);
}
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-wait { background: var(--wait-bg); color: var(--wait); }
.chip-info { background: var(--sky); color: var(--cyan-ink); }

/* ---------- Revelado al hacer scroll (motivado: jerarquía y secuencia) ---------- */
.rv { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.rv.in { opacity: 1; transform: none; }
html:not(.js) .rv { opacity: 1; transform: none; }

/* ==========================================================================
   Barra superior + navegación
   ========================================================================== */
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 38px; gap: 16px; }
.topbar .links { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.topbar a { display: inline-flex; align-items: center; gap: 6px; transition: color .2s; min-height: 38px; }
.topbar a:hover { color: var(--navy); }
.topbar .demo { color: var(--cyan-ink); font-weight: 500; }
.topbar .login { color: var(--navy); font-weight: 500; }

.nav-wrap { position: sticky; top: 10px; z-index: var(--z-nav); padding: 10px clamp(12px, 3vw, 24px) 0; pointer-events: none; }
.nav {
  pointer-events: auto; max-width: 1200px; margin-inline: auto; height: 64px; padding: 0 10px 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--line); border-radius: var(--pill); box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease), background-color .3s;
}
.nav.is-stuck { box-shadow: var(--shadow-md); background: rgba(255, 255, 255, .94); }
.nav-logo img { height: 30px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 9px 16px; border-radius: var(--pill); font: 500 .95rem var(--f-head); color: var(--mid); transition: color .2s, background-color .2s; }
.nav-links a:hover { color: var(--navy); background: var(--paper); }
.nav-links a[aria-current="page"] { color: var(--cyan-ink); background: var(--sky); }
.nav .btn { min-height: 44px; padding: 0 6px 0 20px; font-size: .9rem; }
.nav .btn .bubble { width: 32px; height: 32px; }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 50%; align-items: center; justify-content: center; }
.nav-toggle .bars { position: relative; width: 20px; height: 14px; }
.nav-toggle .bars i { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: var(--navy); transition: transform .35s var(--ease), opacity .2s, top .35s var(--ease); }
.nav-toggle .bars i:nth-child(1) { top: 0; }
.nav-toggle .bars i:nth-child(2) { top: 6px; }
.nav-toggle .bars i:nth-child(3) { top: 12px; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(1) { top: 6px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars i:nth-child(3) { top: 6px; transform: rotate(-45deg); }

.menu {
  pointer-events: auto; display: none; max-width: 1200px; margin: 8px auto 0; padding: 12px;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.menu a { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: var(--r-md); font: 500 1.05rem var(--f-head); color: var(--navy); }
.menu a:hover { background: var(--paper); }
.menu .btn { margin-top: 8px; width: 100%; justify-content: space-between; padding-left: 22px; }
.menu.open { display: block; animation: menuIn .4s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .nav-links, .nav > .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav { padding-left: 18px; }
  .topbar .where { display: none; }
  .topbar .links { margin-left: 0; width: 100%; justify-content: space-between; }
}

/* ==========================================================================
   Secciones
   ========================================================================== */
.section { padding-block: clamp(60px, 7.5vw, 104px); }
.section.tight { padding-block: clamp(40px, 5vw, 72px); }
.section-head { display: grid; gap: 14px; margin-bottom: clamp(36px, 5vw, 60px); max-width: 780px; }
.section-head.center { margin-inline: auto; text-align: center; justify-items: center; }
.bg-paper { background: var(--paper); }
.bg-sky { background: linear-gradient(180deg, var(--sky) 0%, #F2FAFC 100%); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(24px, 3.5vw, 48px) clamp(64px, 8vw, 104px); position: relative; }
.hero::before {
  content: ''; position: absolute; inset: -80px 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 60% at 82% 20%, rgba(0, 180, 216, .16), transparent 70%),
    radial-gradient(ellipse 40% 50% at 8% 0%, rgba(13, 34, 70, .06), transparent 70%);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; margin-bottom: 22px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--pill);
  font: 500 .75rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--navy); box-shadow: var(--shadow-sm);
}
.hero-badge .ico { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: var(--cyan-2); }
.hero-badge .ic { width: 13px; height: 13px; }
.hero .lead { margin: 22px 0 32px; max-width: 46ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual { position: relative; }
.bezel { padding: 8px; border-radius: 36px; background: rgba(13, 34, 70, .045); box-shadow: inset 0 0 0 1px rgba(13, 34, 70, .08); }
.bezel > .core { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .5); background: var(--sky); }
.hero-photo { width: 100%; height: clamp(440px, calc(100dvh - 230px), 620px); object-fit: cover; object-position: 50% 6%; }

.float-card {
  position: absolute; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.chat-card { left: -64px; bottom: -34px; width: min(330px, 86%); padding: 14px 14px 12px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.chat-head .av { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #E3F8EB; color: #128C4A; }
.chat-head b { display: block; font: 600 .84rem var(--f-head); color: var(--navy); line-height: 1.2; }
.chat-head small { font: 400 .72rem var(--f-body); color: var(--muted); }
.msgs { display: grid; gap: 7px; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: .8125rem; line-height: 1.45; }
.msg.in { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 4px; justify-self: start; color: var(--mid); }
.msg.out { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; justify-self: end; }
.msg.out b { color: var(--cyan-2); font-weight: 600; }
.sample { display: block; margin-top: 8px; font: 400 .6875rem var(--f-mono); color: var(--muted); letter-spacing: .02em; }
.booked-card { right: -20px; top: 44px; padding: 12px 16px 12px 12px; display: flex; align-items: center; gap: 12px; }
.booked-card .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sky); color: var(--cyan-ink); }
.booked-card .ico .ic { width: 22px; height: 22px; }
.booked-card b { display: block; font: 600 .875rem var(--f-head); color: var(--navy); line-height: 1.25; }
.booked-card small { font-size: .75rem; color: var(--muted); }

/* La conversación aparece en secuencia al cargar (cuenta la historia, una sola vez) */
@media (prefers-reduced-motion: no-preference) {
  .chat-card .msg, .booked-card { opacity: 0; transform: translateY(8px); animation: pop .7s var(--ease) forwards; }
  .chat-card .msg:nth-child(1) { animation-delay: .5s; }
  .chat-card .msg:nth-child(2) { animation-delay: 1.3s; }
  .chat-card .msg:nth-child(3) { animation-delay: 2.1s; }
  .chat-card .msg:nth-child(4) { animation-delay: 2.9s; }
  .booked-card { animation-delay: 3.5s; }
  .hero .rise { opacity: 0; transform: translateY(16px); animation: pop .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 110ms + 100ms); }
}
@keyframes pop { to { opacity: 1; transform: none; } }

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { height: clamp(360px, 62vw, 520px); }
  .chat-card { left: 12px; bottom: 16px; }
  .booked-card { right: 12px; top: 16px; }
}
@media (max-width: 520px) {
  .chat-card { width: calc(100% - 32px); left: 16px; }
  .chat-card .msg:nth-child(1) { display: none; }
  .booked-card { display: none; }
  .hero-ctas .btn { width: 100%; }
}

/* ---------- Franja de hechos ---------- */
.facts { border-block: 1px solid var(--line); background: var(--white); }
.facts-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 36px 28px; border-left: 1px solid var(--line); }
.fact:first-child { border-left: 0; padding-left: 0; }
.fact b { display: block; font: 700 clamp(1.7rem, 3vw, 2.4rem) var(--f-head); letter-spacing: -.03em; color: var(--navy); line-height: 1.05; margin-bottom: 8px; }
.fact p { font-size: .9375rem; color: var(--muted); max-width: 26ch; }
@media (max-width: 900px) {
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .fact { padding: 26px 18px; }
  .fact:nth-child(odd) { border-left: 0; padding-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Para quién (bento de fotos) ---------- */
.seg-grid {
  display: grid; gap: 16px; grid-template-columns: 1.05fr 1.3fr 1fr; grid-template-rows: minmax(260px, 1fr) minmax(260px, 1fr);
}
.seg {
  display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s;
}
.seg:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.seg .ph { position: relative; flex: 1; min-height: 160px; overflow: hidden; }
.seg .ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.seg:hover .ph img { transform: scale(1.04); }
.seg .tx { padding: 18px 20px 20px; }
.seg h3 { font: 600 1.05rem var(--f-head); color: var(--navy); margin-bottom: 4px; letter-spacing: -.01em; }
.seg p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
.seg-a { grid-row: 1 / span 2; }
.seg-b { grid-column: 2 / span 2; }
@media (max-width: 900px) {
  .seg-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .seg-a { grid-row: auto; grid-column: 1 / -1; }
  .seg-a .ph { aspect-ratio: 16 / 10; flex: none; }
  .seg-b { grid-column: 1 / -1; }
  .seg .ph { aspect-ratio: 4 / 3; flex: none; }
}
@media (max-width: 560px) { .seg-grid { grid-template-columns: 1fr; } }

/* ---------- Sistema (diagrama) ---------- */
.sys { display: grid; grid-template-columns: 1fr minmax(220px, 280px) 1fr; gap: clamp(20px, 3vw, 44px); align-items: stretch; }
.sys-col h3 { font: 500 .75rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.sys-list { display: grid; gap: 10px; }
.sys-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .25s; }
.sys-item:hover { transform: translateX(3px); border-color: var(--cyan); }
.sys-item .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sky); color: var(--cyan-ink); flex: none; }
.sys-item .ico .ic { width: 22px; height: 22px; }
.sys-item b { display: block; font: 600 .95rem var(--f-head); color: var(--navy); line-height: 1.25; }
.sys-item small { font-size: .8125rem; color: var(--muted); line-height: 1.35; display: block; }
.sys-out .sys-item { background: var(--navy); border-color: var(--navy); }
.sys-out .sys-item:hover { border-color: var(--cyan); transform: translateX(-3px); }
.sys-out .sys-item .ico { background: rgba(255, 255, 255, .1); color: var(--cyan-2); }
.sys-out .sys-item b { color: #fff; }
.sys-out .sys-item small { color: rgba(255, 255, 255, .66); }
.sys-core { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding-block: 20px; }
.rings { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.rings::before, .rings::after { content: ''; position: absolute; border-radius: 50%; border: 1px solid var(--sky-2); }
.rings::before { inset: 0; }
.rings::after { inset: 24px; border-color: rgba(0, 180, 216, .35); }
.rings .disc { position: relative; z-index: 1; width: 104px; height: 104px; border-radius: 50%; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-md); display: grid; place-items: center; }
.rings .disc img { width: 58px; height: 58px; object-fit: contain; }
.sys-core b { font: 700 1.2rem var(--f-head); color: var(--navy); letter-spacing: -.02em; }
.sys-core small { display: block; color: var(--muted); font-size: .875rem; max-width: 22ch; }
@media (max-width: 960px) {
  .sys { grid-template-columns: 1fr; }
  .sys-core { order: -1; flex-direction: row; text-align: left; justify-content: flex-start; padding-block: 0; }
  .rings { width: 110px; height: 110px; }
  .rings::after { inset: 14px; }
  .rings .disc { width: 66px; height: 66px; }
  .rings .disc img { width: 36px; height: 36px; }
}

/* ---------- Pestañas de funciones ---------- */
.tabs { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
.tablist { display: inline-flex; gap: 6px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--pill); width: max-content; max-width: 100%; overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: var(--pill); font: 500 .95rem var(--f-head); color: var(--mid); transition: background-color .25s, color .25s; white-space: nowrap; }
.tab:hover { color: var(--navy); }
.tab[aria-selected="true"] { background: var(--navy); color: #fff; }
.tab[aria-selected="true"] .ic { color: var(--cyan-2); }
.tabpanel { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.tabpanel.active { display: grid; animation: panelIn .6s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.tabpanel h3 { margin-bottom: 18px; }
.checks { display: grid; gap: 12px; margin: 22px 0 8px; }
.checks li { display: flex; align-items: flex-start; gap: 12px; color: var(--mid); font-size: 1rem; line-height: 1.5; }
.checks .ic { color: var(--cyan-ink); margin-top: 2px; width: 1.15em; height: 1.15em; }
.on-dark .checks li { color: rgba(255, 255, 255, .82); }
.on-dark .checks .ic { color: var(--cyan-2); }
.note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: var(--r-md); background: var(--sky); color: var(--navy-2); font-size: .875rem; line-height: 1.5; }
.note .ic { color: var(--cyan-ink); margin-top: 2px; }
@media (max-width: 900px) { .tabpanel.active { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .tablist { width: 100%; } .tab { flex: 1; justify-content: center; padding: 0 10px; gap: 6px; font-size: .88rem; } .tab .ic { display: none; } }

/* ---------- Componentes de interfaz de ejemplo ---------- */
.ui { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md); padding: 18px; }
.ui-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font: 500 .75rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ui-head .live { color: var(--ok); }
.ui-foot { margin-top: 12px; font: 400 .6875rem var(--f-mono); color: var(--muted); }
.rows { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); background: var(--paper); font-size: .9rem; color: var(--navy); }
.row .t { font: 500 .78rem var(--f-mono); color: var(--muted); }
.row small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.row.hl { background: var(--sky); box-shadow: inset 0 0 0 1px rgba(0, 180, 216, .35); }
.row.dash { background: transparent; border: 1px dashed var(--line-2); }
.ledger { display: grid; gap: 0; }
.ledger .l { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--mid); }
.ledger .l:last-child { border-bottom: 0; }
.ledger .l b { font-family: var(--f-mono); font-weight: 500; color: var(--navy); }
.ledger .l.total { color: var(--navy); font-weight: 600; }
.timer { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--wait-bg); color: var(--wait); font-size: .84rem; }
.fu { display: grid; gap: 10px; }
.fu .it { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: var(--r-sm); background: var(--paper); }
.fu .it .ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--white); color: var(--cyan-ink); border: 1px solid var(--line); }
.fu .it b { display: block; font: 600 .9rem var(--f-head); color: var(--navy); line-height: 1.25; }
.fu .it small { font-size: .78rem; color: var(--muted); }
@media (max-width: 520px) { .row { grid-template-columns: 46px 1fr; } .row .chip { grid-column: 2; justify-self: start; } .fu .it { grid-template-columns: 38px 1fr; } .fu .it .chip { grid-column: 2; justify-self: start; } }

/* ---------- Modo agéntico (split con sticky) ---------- */
.stick { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.stick-l { position: sticky; top: 120px; display: grid; gap: 18px; }
.steps { display: grid; gap: 18px; position: relative; }
.step { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 24px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step .ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--sky); color: var(--cyan-ink); }
.step .ico .ic { width: 26px; height: 26px; }
.step h3 { font: 600 1.2rem var(--f-head); color: var(--navy); margin-bottom: 6px; letter-spacing: -.015em; }
.step p { color: var(--muted); font-size: .98rem; }
.step.core { background: var(--navy); border-color: var(--navy); padding-block: 34px; }
.step.core .ico { background: rgba(255, 255, 255, .1); color: var(--cyan-2); }
.step.core h3 { color: #fff; }
.step.core p { color: rgba(255, 255, 255, .76); }
.step .tagrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
@media (max-width: 900px) { .stick { grid-template-columns: 1fr; } .stick-l { position: static; } }

/* ---------- Bloque oscuro (asistente ejecutivo y CTA) ---------- */
.dark-block {
  position: relative; overflow: hidden; border-radius: var(--r-xl); background: var(--navy); color: #fff;
  padding: clamp(32px, 6vw, 80px);
}
.dark-block::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 88% 12%, rgba(0, 180, 216, .26), transparent 65%), radial-gradient(ellipse 40% 50% at 0% 100%, rgba(42, 74, 128, .6), transparent 70%);
}
.dark-block > * { position: relative; }
.dark-block .h2, .dark-block .h3 { color: #fff; }
.dark-block .h2 em { color: var(--cyan-2); }
.dark-block .sub, .dark-block .lead { color: rgba(255, 255, 255, .74); }
.exec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.exec-copy { display: grid; gap: 18px; justify-items: start; }
.exec-copy .btn { margin-top: 10px; }
.phone-chat { background: rgba(255, 255, 255, .97); border-radius: var(--r-lg); padding: 16px; color: var(--ink); box-shadow: var(--shadow-lg); }
.phone-chat .chat-head { border-color: var(--line); }
.phone-chat .msgs { gap: 9px; }
.phone-chat .msg { font-size: .875rem; max-width: 92%; }
.phone-chat .msg.out { background: var(--navy); }
.phone-chat .msg ul { display: grid; gap: 3px; margin-top: 6px; font-size: .8125rem; }
.phone-chat .msg ul li { display: flex; gap: 8px; }
.phone-chat .msg ul li span { font-family: var(--f-mono); color: var(--cyan-2); }
@media (max-width: 900px) { .exec { grid-template-columns: 1fr; } }

/* ---------- Integraciones ---------- */
.int-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.int-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.int { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; padding: 18px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .25s; }
.int:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.int .logo { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); }
.int .logo img, .int .logo .ic { width: 24px; height: 24px; }
.int .logo .ic { color: var(--navy); }
.int b { display: block; font: 600 1rem var(--f-head); color: var(--navy); line-height: 1.25; margin-bottom: 4px; }
.int p { font-size: .875rem; color: var(--muted); line-height: 1.45; margin-bottom: 10px; }
.int.soon { background: var(--paper); border-style: dashed; }
.int.soon .logo img { filter: grayscale(1); opacity: .7; }
@media (max-width: 960px) { .int-wrap { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .int-grid { grid-template-columns: 1fr; } }

/* ---------- Calculadora ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(24px, 4vw, 56px); padding: clamp(24px, 4vw, 52px); border-radius: var(--r-xl); background: var(--sky); border: 1px solid var(--sky-2); }
.calc-fields { display: grid; gap: 26px; align-content: center; }
.calc-field label { display: flex; justify-content: space-between; gap: 12px; font: 500 .95rem var(--f-head); color: var(--navy); margin-bottom: 12px; }
.calc-field label output { font-family: var(--f-mono); color: var(--cyan-ink); font-weight: 500; }
.calc-field input[type=range] { width: 100%; height: 6px; border-radius: 6px; background: var(--sky-2); -webkit-appearance: none; appearance: none; outline-offset: 8px; }
.calc-field input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(13, 34, 70, .35); cursor: grab; }
.calc-field input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--navy); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(13, 34, 70, .35); cursor: grab; }
.range-row { display: flex; justify-content: space-between; margin-top: 6px; font: 400 .72rem var(--f-mono); color: var(--muted); }
.calc-result { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: clamp(24px, 3vw, 36px); display: grid; gap: 18px; align-content: start; box-shadow: var(--shadow-lg); }
.calc-result .lab { font: 500 .75rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan-2); }
.calc-amount { font: 700 clamp(2.3rem, 4.6vw, 3.4rem) var(--f-head); letter-spacing: -.035em; line-height: 1; }
.calc-amount small { display: block; margin-top: 8px; font: 400 .9rem var(--f-body); letter-spacing: 0; color: rgba(255, 255, 255, .7); }
.calc-rows { display: grid; gap: 0; border-top: 1px solid rgba(255, 255, 255, .14); }
.calc-rows div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); font-size: .9rem; color: rgba(255, 255, 255, .8); }
.calc-rows b { font: 500 .9rem var(--f-mono); color: #fff; }
.calc-disc { font-size: .78rem; color: rgba(255, 255, 255, .6); line-height: 1.5; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }

/* ---------- Planes ---------- */
.plan-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: -34px auto 28px; }
.seg-control { display: inline-flex; gap: 4px; min-height: 48px; padding: 4px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--paper); }
.seg-control button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: var(--pill); font: 600 .9rem var(--f-head); color: var(--mid); transition: background-color .2s, color .2s, box-shadow .2s; }
.seg-control button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
.seg-control .flag { width: 24px; height: 18px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(13, 34, 70, .12); object-fit: cover; flex: none; display: block; }
.seg-control button[aria-pressed="true"] .flag { box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }
.discount-chip { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: var(--pill); background: var(--cyan); color: var(--navy); font: 600 .68rem var(--f-mono); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 30px 28px 28px; border-radius: var(--r-xl); background: var(--white); border: 1px solid var(--line); transition: transform .45s var(--ease), box-shadow .45s var(--ease); min-width: 0; }
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.plan .top { min-height: 184px; }
.plan .top .reco { display: inline-block; margin-bottom: 8px; }
.plan h3 { font: 700 1.5rem var(--f-head); letter-spacing: -.02em; color: var(--navy); }
.plan .who { font-size: .92rem; color: var(--muted); margin-top: 4px; }
.price-variants { display: grid; min-height: 138px; align-items: start; }
.price-view { display: none; grid-area: 1 / 1; }
.price-view[data-price-view="monthly-usd"] { display: block; }
.js #planes[data-period][data-cur] .price-view { display: none; }
.js #planes[data-period="monthly"][data-cur="usd"] .price-view[data-price-view="monthly-usd"],
.js #planes[data-period="monthly"][data-cur="mxn"] .price-view[data-price-view="monthly-mxn"],
.js #planes[data-period="annual"][data-cur="usd"] .price-view[data-price-view="annual-usd"],
.js #planes[data-period="annual"][data-cur="mxn"] .price-view[data-price-view="annual-mxn"] { display: block; }
.plan .price { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; font: 700 clamp(2.3rem, 3.6vw, 3rem) var(--f-head); letter-spacing: -.04em; color: var(--navy); line-height: 1; }
.plan .price small { font: 400 .9rem var(--f-body); color: var(--muted); letter-spacing: 0; }
.plan .impl { margin-top: 10px; font-size: .9rem; color: var(--mid); }
.plan .impl b { font-family: var(--f-mono); font-weight: 500; color: var(--navy); }
.plan .price-label { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.plan .price-label + .price { margin-top: 2px; }
.plan .then { margin-top: 10px; font-size: 1rem; color: var(--mid); }
.plan .then b { font: 700 1.15rem var(--f-head); color: var(--navy); letter-spacing: -.01em; }
.plan.feat .price-label, .plan.feat .then { color: rgba(255, 255, 255, .72); }
.plan.feat .then b { color: #fff; }
.plan .save { margin-top: 6px; font: 500 .86rem var(--f-mono); color: var(--cyan-ink); }
.plan .save s { color: var(--muted); margin-right: 6px; }
.plan .annual-note { margin-top: 5px; font-size: .78rem; color: var(--muted); line-height: 1.45; }
.plan hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.spec { display: grid; gap: 0; }
.spec li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .95rem; color: var(--mid); }
.spec li:last-child { border-bottom: 0; }
.spec li b { font: 500 .95rem var(--f-mono); color: var(--navy); text-align: right; }
.spec li.credits span, .spec li.credits b { font-weight: 700; }
.plan .extra { margin-top: 14px; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.plan .btn { margin-top: auto; }
.plan .cta { margin-top: auto; padding-top: 24px; }
.plan.feat { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: var(--shadow-lg); }
.plan.feat h3, .plan.feat .price { color: #fff; }
.plan.feat .who, .plan.feat .price small, .plan.feat .impl, .plan.feat .extra, .plan.feat .annual-note { color: rgba(255, 255, 255, .72); }
.plan.feat .impl b, .plan.feat .spec li b { color: #fff; }
.plan.feat .save { color: var(--cyan-2); }
.plan.feat .save s { color: rgba(255, 255, 255, .56); }
.plan.feat hr, .plan.feat .spec li { border-color: rgba(255, 255, 255, .14); }
.plan.feat .spec li { color: rgba(255, 255, 255, .8); }
.plan.feat .chip { background: rgba(34, 204, 240, .16); color: var(--cyan-2); }
.included { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(24px, 4vw, 56px); margin-top: 28px; padding: clamp(24px, 4vw, 44px); border-radius: var(--r-xl); background: var(--paper); border: 1px solid var(--line); }
.included .checks { grid-template-columns: 1fr 1fr; margin: 0; gap: 12px 28px; }
.terms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.term { padding: 22px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line); }
.term .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sky); color: var(--cyan-ink); margin-bottom: 14px; }
.term b { display: block; font: 600 1.02rem var(--f-head); color: var(--navy); margin-bottom: 4px; }
.term p { font-size: .9rem; color: var(--muted); line-height: 1.5; }
@media (max-width: 1000px) { .plans { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } .plan .top { min-height: 0; } .plan .price-label { margin-top: 18px; } .included { grid-template-columns: 1fr; } .terms { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .plan-controls { margin-top: -22px; } .seg-control { width: min(100%, 360px); } .seg-control button { flex: 1; padding-inline: 10px; } .plan { padding-inline: 22px; } .plan .price { flex-wrap: wrap; row-gap: 2px; } .included .checks { grid-template-columns: 1fr; } }

/* ---------- Piloto fundador ---------- */
.pilot { display: grid; grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); gap: clamp(28px, 6vw, 88px); align-items: center; }
.pilot-photo { max-width: 340px; width: 100%; }
.pilot-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 14%; }
.pilot-copy { display: grid; gap: 18px; justify-items: start; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; margin: 8px 0; width: 100%; }
.metrics li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--navy); font: 500 1rem var(--f-head); }
.metrics .ic { color: var(--cyan-ink); }
@media (max-width: 900px) { .pilot { grid-template-columns: 1fr; } .pilot-photo { max-width: 340px; } }
@media (max-width: 520px) { .metrics { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.faq-l { position: sticky; top: 120px; display: grid; gap: 18px; justify-items: start; }
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 4px; cursor: pointer; font: 600 1.08rem var(--f-head); color: var(--navy); letter-spacing: -.01em; min-height: 56px; transition: color .2s; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary:hover { color: var(--cyan-ink); }
.qa summary .pm { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); flex: none; transition: transform .4s var(--ease), background-color .2s, color .2s; }
.qa[open] summary .pm { transform: rotate(45deg); background: var(--navy); color: #fff; border-color: var(--navy); }
.qa .ans { padding: 0 48px 24px 4px; color: var(--mid); font-size: 1rem; line-height: 1.7; }
.qa .ans b { color: var(--navy); font-weight: 600; }
@media (max-width: 900px) { .faq { grid-template-columns: 1fr; } .faq-l { position: static; } .qa .ans { padding-right: 4px; } }

/* ---------- CTA final ---------- */
.cta { display: grid; gap: 22px; justify-items: center; text-align: center; }
.cta .h2 { max-width: 20ch; }
.cta .sub { color: rgba(255, 255, 255, .74); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 6px; }
.cta-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; max-width: 860px; margin-top: 18px; text-align: left; }
.cta-steps li { padding: 18px 20px; border-radius: var(--r-md); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: .92rem; color: rgba(255, 255, 255, .84); line-height: 1.45; }
.cta-steps li b { display: block; font: 600 1rem var(--f-head); color: #fff; margin-bottom: 4px; }
.cta-trust { margin-top: 8px; font-size: .84rem; color: rgba(255, 255, 255, .6); }
@media (max-width: 760px) { .cta-steps { grid-template-columns: 1fr; } .cta-actions .btn { width: 100%; } }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: rgba(255, 255, 255, .72); padding: 72px 0 36px; margin-top: clamp(24px, 4vw, 48px); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding-bottom: 48px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer img { height: 30px; width: auto; margin-bottom: 18px; }
.footer p { font-size: .92rem; max-width: 34ch; line-height: 1.6; }
.footer h4 { font: 500 .75rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--cyan-2); margin-bottom: 16px; }
.footer li a { display: inline-block; padding: 6px 0; font-size: .95rem; transition: color .2s; }
.footer li a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; font-size: .84rem; color: rgba(255, 255, 255, .5); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Barra móvil (acciones rápidas) ---------- */
.mbar { display: none; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: var(--z-float); gap: 8px; padding: 8px; border-radius: var(--pill); background: rgba(255, 255, 255, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateY(140%); transition: transform .5s var(--ease); }
.mbar.show { transform: none; }
.mbar .btn { flex: 1; min-height: 46px; font-size: .9rem; }
.mbar .btn-ghost { flex: 0 0 52px; padding: 0; }
.mbar .btn-ghost .ic { width: 1.5em; height: 1.5em; color: #128C4A; }
@media (max-width: 900px) { .mbar { display: flex; } body { padding-bottom: 76px; } }

/* ==========================================================================
   Página de funciones
   ========================================================================== */
.page-hero { padding-block: clamp(36px, 6vw, 84px) clamp(40px, 5vw, 72px); position: relative; }
.page-hero::before { content: ''; position: absolute; inset: -60px 0 auto 0; height: 460px; z-index: -1; pointer-events: none; background: radial-gradient(ellipse 50% 70% at 80% 10%, rgba(0, 180, 216, .15), transparent 70%); }
.ph-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.ph-grid .lead { margin: 20px 0 28px; }
.layers { display: grid; gap: 8px; }
.layer { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line); transition: transform .35s var(--ease), border-color .25s, box-shadow .35s var(--ease); }
.layer:hover { transform: translateX(4px); border-color: var(--cyan); box-shadow: var(--shadow-sm); }
.layer .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sky); color: var(--cyan-ink); }
.layer b { font: 600 .98rem var(--f-head); color: var(--navy); }
.layer .ic.go { color: var(--muted); }
@media (max-width: 900px) { .ph-grid { grid-template-columns: 1fr; } }

.feat-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 6vw, 88px); align-items: center; padding-block: clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); }
.feat-row.flip > :first-child { order: 2; }
.feat-row h2 { margin-bottom: 16px; }
@media (max-width: 900px) { .feat-row, .feat-row.flip { grid-template-columns: 1fr; } .feat-row.flip > :first-child { order: 0; } }

.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; margin-top: 36px; }
.tl { position: relative; padding: 0 22px 0 0; }
.tl::before { content: ''; position: absolute; left: 0; right: 0; top: 24px; height: 1px; background: var(--line-2); }
.tl:last-child::before { right: 50%; }
.tl .dot { position: relative; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--white); border: 1px solid var(--line-2); color: var(--cyan-ink); margin-bottom: 18px; }
.tl.on .dot { background: var(--navy); color: var(--cyan-2); border-color: var(--navy); }
.tl b { display: block; font: 600 1.05rem var(--f-head); color: var(--navy); margin-bottom: 6px; }
.tl p { font-size: .92rem; color: var(--muted); line-height: 1.5; }
.tl .btns { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 900px) { .timeline { grid-template-columns: 1fr; gap: 24px; } .tl { padding: 0 0 0 64px; } .tl::before { left: 24px; right: auto; top: 0; bottom: -24px; width: 1px; height: auto; } .tl:last-child::before { display: none; } .tl .dot { position: absolute; left: 0; top: 0; margin: 0; } }

.stages { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 8px; }
.stage-box { padding: 26px; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line); }
.stage-box h3 { font: 600 1.1rem var(--f-head); color: var(--navy); margin-bottom: 4px; }
.stage-box > p { font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.stage-box ol { display: grid; gap: 8px; counter-reset: s; }
.stage-box li { counter-increment: s; display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); font-size: .92rem; color: var(--navy); }
.stage-box li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--white); border: 1px solid var(--line-2); font: 500 .75rem var(--f-mono); color: var(--cyan-ink); }
.guards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.guard { padding: 18px; border-radius: var(--r-md); background: var(--sky); font-size: .9rem; color: var(--navy-2); line-height: 1.45; }
.guard .ic { color: var(--cyan-ink); margin-bottom: 8px; width: 1.4em; height: 1.4em; }
@media (max-width: 900px) { .stages { grid-template-columns: 1fr; } .guards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .guards { grid-template-columns: 1fr; } }

.modules { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 22px; }
.module { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line); font: 500 .92rem var(--f-head); color: var(--navy); }
.module .ic { color: var(--cyan-ink); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { padding: 14px; border-radius: var(--r-sm); background: var(--paper); }
.kpi small { display: block; font: 500 .66rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kpi b { display: block; font: 700 1.5rem var(--f-head); color: var(--navy); letter-spacing: -.03em; line-height: 1.2; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 74px; padding: 6px 0 0; }
.bars i { flex: 1; border-radius: 6px 6px 2px 2px; background: var(--sky-2); }
.bars i.hi { background: var(--cyan); }
@media (max-width: 900px) { .modules { grid-template-columns: 1fr 1fr; } }

.photo-feat { position: relative; max-width: 400px; width: 100%; justify-self: center; }
.photo-feat .bezel img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; }
.photo-feat .float-card { right: -18px; bottom: 28px; padding: 14px 16px; max-width: 250px; }
@media (max-width: 900px) { .photo-feat { max-width: 380px; } .photo-feat .float-card { right: 8px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .rv { opacity: 1; transform: none; }
}


/* ---------- Recursos: páginas de documentación (seguridad, normativa, ayuda) ---------- */
.footer-grid { grid-template-columns: 1.3fr repeat(4, 1fr); }
.footer-ai { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 18px; font: 500 .72rem var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .42); }
.footer-ai a { color: rgba(255, 255, 255, .62); padding: 4px 0; transition: color .2s; }
.footer-ai a:hover { color: #fff; }
@media (max-width: 1040px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

.chip-off { background: var(--off-bg); color: var(--muted); }
.chip .ic { width: 1.05em; height: 1.05em; }
code { font: 500 .84em var(--f-mono); background: var(--paper); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; color: var(--navy); word-break: break-word; }

.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; padding-bottom: clamp(24px, 4vw, 48px); }
.toc { position: sticky; top: 112px; }
.toc-h { font: 500 .72rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 0 7px 14px; border-left: 2px solid var(--line); font-size: .9rem; line-height: 1.35; color: var(--muted); transition: color .2s, border-color .2s; }
.toc a:hover { color: var(--navy); }
.toc a.on { color: var(--navy); border-left-color: var(--cyan); font-weight: 500; }
.doc-body { min-width: 0; }
.doc-sec { padding-block: clamp(36px, 4.6vw, 60px); border-top: 1px solid var(--line); scroll-margin-top: 96px; }
.doc-sec:first-child { border-top: 0; padding-top: 8px; }
.doc-sec > .h2 { font-size: clamp(1.55rem, 2.5vw, 2.15rem); line-height: 1.14; margin-bottom: 14px; }
.doc-sec > .sub { margin-bottom: 28px; font-size: 1.02rem; }
.doc-sec p + p { margin-top: 14px; }
.doc-sec .lead-p { color: var(--mid); max-width: 66ch; }
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toc { position: static; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .toc ol { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .toc a { white-space: nowrap; border: 1px solid var(--line-2); border-radius: var(--pill); padding: 7px 14px; border-left-width: 1px; }
  .toc a.on { background: var(--navy); color: #fff; border-color: var(--navy); }
}

.sum-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sum-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sum-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sum { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); display: grid; align-content: start; gap: 8px; }
.sum .ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--sky); color: var(--cyan-ink); margin-bottom: 6px; }
.sum small { font: 500 .7rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan-ink); }
.sum h3 { font: 600 1.18rem/1.25 var(--f-head); letter-spacing: -.015em; color: var(--navy); }
.sum p { font-size: .96rem; line-height: 1.6; color: var(--mid); }
.sum a.link-arrow { margin-top: 6px; font-size: .9rem; }
@media (max-width: 1100px) { .sum-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sum-grid, .sum-grid.three, .sum-grid.four { grid-template-columns: minmax(0, 1fr); } }

.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.role { position: relative; padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--white); display: grid; align-content: start; gap: 6px; }
.role small { font: 500 .7rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan-ink); }
.role h3 { font: 600 1.15rem var(--f-head); color: var(--navy); letter-spacing: -.015em; }
.role p { font-size: .92rem; line-height: 1.55; color: var(--mid); }
.role:not(:last-child)::after { content: ''; position: absolute; right: -15px; top: 50%; width: 9px; height: 9px; border-top: 2px solid var(--line-2); border-right: 2px solid var(--line-2); transform: translateY(-50%) rotate(45deg); }
.role.me { background: var(--navy); border-color: var(--navy); }
.role.me small { color: var(--cyan-2); }
.role.me h3 { color: #fff; }
.role.me p { color: rgba(255, 255, 255, .78); }
@media (max-width: 1100px) { .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .role::after { display: none; } }
@media (max-width: 560px) { .roles { grid-template-columns: minmax(0, 1fr); } }

.legend { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 20px; font-size: .88rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; }
.tbl th { text-align: left; padding: 14px 18px; background: var(--paper); font: 500 .7rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 16px 18px; vertical-align: top; color: var(--mid); border-bottom: 1px solid var(--line); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td:first-child { color: var(--navy); font: 600 .96rem/1.35 var(--f-head); min-width: 150px; }
.tbl td.st { white-space: nowrap; }
.tbl td small { display: block; margin-top: 4px; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.tbl tr.dim td { background: var(--paper); }
@media (max-width: 760px) {
  .tbl-wrap { border: 0; background: transparent; overflow: visible; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .tbl tr { padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--white); }
  .tbl td { padding: 6px 0; border: 0; }
  .tbl td::before { content: attr(data-label); display: block; font: 500 .66rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
  .tbl td:first-child { min-width: 0; font-size: 1.05rem; padding-top: 0; }
  .tbl td:first-child::before { display: none; }
  .tbl td.st { white-space: normal; }
  .tbl tr.dim td { background: transparent; }
}

.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pair-box { padding: 24px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--white); }
.pair-box h3 { font: 600 1.1rem var(--f-head); color: var(--navy); margin-bottom: 12px; }
.pair-box.no { background: var(--paper); }
.pair-box .checks { margin: 0; }
.pair-box.no .checks .ic { color: var(--muted); }
@media (max-width: 760px) { .pair { grid-template-columns: minmax(0, 1fr); } }

.rel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rel .layer b { line-height: 1.3; }
@media (max-width: 900px) { .rel { grid-template-columns: minmax(0, 1fr); } }

.gloss { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.gloss div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.gloss dt { font: 600 1rem var(--f-head); color: var(--navy); }
.gloss dd { font-size: .92rem; line-height: 1.55; color: var(--mid); margin-top: 2px; }
@media (max-width: 760px) { .gloss { grid-template-columns: minmax(0, 1fr); } }

.sources { display: grid; gap: 4px; margin-top: 8px; }
.sources a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--cyan-ink); font-weight: 500; text-decoration: underline; text-decoration-color: rgba(0, 112, 142, .3); text-underline-offset: 3px; }
.sources a:hover { text-decoration-color: currentColor; }
.disclaimer { margin-top: 28px; padding: 16px 18px; border-radius: var(--r-md); background: var(--paper); border: 1px solid var(--line); font-size: .88rem; line-height: 1.6; color: var(--muted); }
.doc-foot { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font: 500 .74rem var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.doc-foot b { color: var(--navy); font-weight: 500; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.doc-sec .note b { color: var(--navy); }
.doc-sec .note.soft { background: var(--paper); border: 1px solid var(--line); }
.doc-sec .qa-list .qa:first-child { border-top: 1px solid var(--line); }
.mini-list { display: grid; gap: 10px; margin-top: 18px; }
.mini-list li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--mid); font-size: .96rem; line-height: 1.55; }
.mini-list .ic { color: var(--cyan-ink); margin-top: 3px; }
.mini-list b { color: var(--navy); font-weight: 600; }

.hc-tools { display: grid; gap: 16px; margin-bottom: 8px; }
.hc-search { position: relative; display: block; max-width: 640px; }
.hc-search .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 1.3em; height: 1.3em; }
.hc-search input { width: 100%; min-height: 54px; padding: 0 20px 0 50px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--white); font: 400 1rem var(--f-body); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.hc-search input:focus { outline: 0; border-color: var(--cyan-dark); box-shadow: 0 0 0 4px rgba(0, 180, 216, .15); }
.hc-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.hc-cat { min-height: 40px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--white); font: 500 .88rem var(--f-head); color: var(--navy); transition: background-color .2s, color .2s, border-color .2s; }
.hc-cat:hover { border-color: var(--navy); }
.hc-cat[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.hc-count { font: 500 .78rem var(--f-mono); letter-spacing: .06em; color: var(--muted); min-height: 1.4em; margin: 6px 0 14px; }
.hc-empty { padding: 28px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); color: var(--muted); text-align: center; }
.hc-empty[hidden], .qa[hidden] { display: none; }
.qa .cat { display: inline-block; margin-right: 10px; font: 500 .66rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-ink); vertical-align: middle; }
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } }

.tbl code.blk { display: block; margin-top: 6px; width: fit-content; max-width: 100%; overflow-wrap: anywhere; font-size: .72em; line-height: 1.5; padding: 5px 7px; }
.tbl.ctl th:nth-child(1) { width: 16%; } .tbl.ctl th:nth-child(2) { width: 42%; } .tbl.ctl th:nth-child(3) { width: 12%; } .tbl.ctl th:nth-child(4) { width: 30%; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 80; max-width: min(92vw, 440px); padding: 14px 20px; border-radius: var(--r-md); background: var(--navy); color: #fff; font-size: .92rem; line-height: 1.45; box-shadow: var(--shadow-lg); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 900px) { .toast { bottom: 96px; } }

/* ==========================================================================
   Página de demo (/demo): escenario guiado y tarjetas de funciones
   El escenario sustituye al video mientras no exista uno grabado.
   ========================================================================== */
.demo-hero { padding-bottom: clamp(40px, 5vw, 64px); }
.demo-head { display: grid; justify-items: center; text-align: center; max-width: 860px; margin-inline: auto; padding-top: clamp(16px, 3vw, 40px); }
.demo-head .lead { margin: 22px auto 30px; max-width: 54ch; }
.demo-head .hero-ctas { justify-content: center; }
.demo-seo { max-width: 780px; margin: clamp(32px, 4vw, 48px) auto 0; text-align: center; color: var(--muted); font-size: 1rem; line-height: 1.7; text-wrap: pretty; }

.dstage { margin-top: clamp(36px, 5vw, 56px); border-radius: var(--r-xl); background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: hidden; }
.dstage-bar { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.dstage-bar .dots { display: flex; gap: 6px; }
.dstage-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.dstage-title { font: 500 .72rem var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dplay { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border-radius: var(--pill); background: var(--navy); color: #fff; font: 600 .84rem var(--f-head); transition: background-color .2s; }
.dplay:hover { background: var(--navy-2); }
.dplay .ic { width: 16px; height: 16px; color: var(--cyan-2); }
.dplay .i-pause { display: none; gap: 3px; width: 16px; height: 16px; align-items: center; justify-content: center; }
.dplay .i-pause i { width: 4px; height: 12px; border-radius: 1px; background: var(--cyan-2); }
.dplay[aria-pressed="true"] .i-play { display: none; }
.dplay[aria-pressed="true"] .i-pause { display: inline-flex; }

.dscreen { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); min-height: 468px; }
.dphone { display: flex; flex-direction: column; padding: 18px 20px; background: linear-gradient(180deg, var(--paper), #EEF3F7); border-right: 1px solid var(--line); min-width: 0; }
.dphone .chat-head { margin-bottom: 0; }
.dmsgs { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; padding-top: 14px; }
.dchap { display: none; flex-direction: column; gap: 8px; }
.dchap.on { display: flex; }
.dmsgs .msg { max-width: 84%; font-size: .875rem; }
.dmsgs .msg.in { align-self: flex-start; background: var(--white); }
.dmsgs .msg.out { align-self: flex-end; }
.dmsgs .msg.file { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: .8rem; color: var(--navy); }
.dmsgs .msg.file .ic { color: var(--cyan-ink); }
.typing { align-self: flex-end; display: inline-flex; gap: 4px; padding: 11px 14px; border-radius: 14px; border-bottom-right-radius: 4px; background: var(--navy); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .7); animation: dtype 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dtype { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
.tpl { align-self: flex-end; display: grid; gap: 4px; max-width: 86%; }
.tpl .msg.out { max-width: 100%; border-bottom-right-radius: 14px; }
.qr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.qr span { display: grid; place-items: center; text-align: center; min-height: 36px; padding: 6px 10px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); font: 600 .8rem var(--f-head); color: var(--cyan-ink); transition: background-color .25s, border-color .25s, color .25s, transform .25s var(--ease); }
.qr span.tap, .qr span.tapped { background: var(--sky); border-color: var(--cyan); color: var(--navy); transform: scale(.97); }

.dside { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; min-width: 0; }
.dside-h { font: 500 .72rem var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dui { flex: 1; box-shadow: none; }
.dpanel { display: none; }
.dpanel.on { display: block; animation: panelIn .5s var(--ease); }
.dpanel .ui-head { flex-wrap: wrap; }
.dnote { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sky); color: var(--navy-2); font-size: .84rem; line-height: 1.45; }
.dnote .ic { color: var(--cyan-ink); margin-top: 1px; }
.dnote.ok { background: var(--ok-bg); color: var(--ok); }
.dnote.ok .ic { color: var(--ok); }
.fu .it.alert { background: var(--wait-bg); box-shadow: inset 0 0 0 1px rgba(138, 90, 0, .25); }
.fu .it.alert .ico { color: var(--wait); }

/* Secuencia: antes de que corra el JS se ve el estado final del paso (sin lo que se reemplaza). */
.dstage:not(.is-live) .seq[data-x] { display: none; }
.dstage.is-live .seq:not(.on) { display: none; }
.dstage.is-live .seq.on { animation: dseq .5s var(--ease) both; }
.dstage.is-live .seq.on.static { animation: none; }
@keyframes dseq { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.dsteps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.dstep { position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 16px; text-align: left; font: 600 .92rem/1.25 var(--f-head); color: var(--mid); border-left: 1px solid var(--line); overflow: hidden; transition: background-color .2s, color .2s; }
.dstep:first-child { border-left: 0; }
.dstep:hover { background: var(--paper); color: var(--navy); }
.dstep .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--paper); color: var(--cyan-ink); flex: none; transition: background-color .2s, color .2s; }
.dstep .ico .ic { width: 18px; height: 18px; }
.dstep[aria-selected="true"] { color: var(--navy); background: var(--white); }
.dstep[aria-selected="true"] .ico { background: var(--navy); color: var(--cyan-2); }
.dstep .fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--cyan); }
.dstep.done .fill { width: 100%; background: var(--sky-2); }
.dstep.run .fill { animation: dfill var(--ms, 8000ms) linear forwards; }
.dstage[data-playing="false"] .dstep.run .fill { animation-play-state: paused; }
@keyframes dfill { to { width: 100%; } }

@media (max-width: 900px) {
  /* Apilado: los pasos van arriba para que se puedan tocar sin perder de vista la conversación */
  .dstage { display: flex; flex-direction: column; }
  .dsteps { order: 1; border-top: 0; border-bottom: 1px solid var(--line); }
  .dscreen { order: 2; grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .dphone { border-right: 0; border-bottom: 1px solid var(--line); height: 360px; }
  .dside { min-height: 300px; }
  .dsteps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dstep:nth-child(3) { border-left: 0; }
  .dstep:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 520px) {
  .dstage { border-radius: var(--r-lg); margin-inline: -4px; }
  .dstage-bar .dots { display: none; }
  .dstage-bar { padding-left: 14px; }
  .dphone, .dside { padding: 14px; }
  .dstep { gap: 8px; padding: 10px 12px; font-size: .84rem; }
  .dstep .ico { width: 30px; height: 30px; }
  /* En pantallas chicas el panel muestra solo lo que cambia en cada paso */
  .dstage .ctx { display: none; }
  .dside-h { display: none; }
  .dside { min-height: 0; }
  .dstage .row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .dstage .row .chip { grid-column: auto; justify-self: end; }
}

/* Tarjetas de lo distinto (bento 2 + 1 / 1 + 2) */
.dbento { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.dbento > .dcard { grid-column: span 2; }
.dcard { display: flex; flex-direction: column; justify-content: space-between; gap: 24px; padding: clamp(22px, 2.6vw, 32px); border-radius: var(--r-xl); background: var(--white); border: 1px solid var(--line); min-width: 0; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.dcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dbento > .dcard.wide { grid-column: span 3; }
.dcard.wide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: clamp(20px, 3vw, 40px); }
.dcard-tx { display: grid; gap: 10px; align-content: start; }
.dcard .ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--sky); color: var(--cyan-ink); margin-bottom: 6px; }
.dcard .ico .ic { width: 24px; height: 24px; }
.dcard h3 { font: 600 clamp(1.2rem, 1.7vw, 1.4rem)/1.2 var(--f-head); letter-spacing: -.02em; color: var(--navy); }
.dcard p { color: var(--muted); font-size: .97rem; line-height: 1.6; }
.dcard.dark { background: var(--navy); border-color: var(--navy); }
.dcard.dark .ico { background: rgba(255, 255, 255, .1); color: var(--cyan-2); }
.dcard.dark h3 { color: #fff; }
.dcard.dark p { color: rgba(255, 255, 255, .74); }
.dwidget { padding: 16px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.dcard.dark .dwidget { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
.dcard .wfoot { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; font-size: .84rem; line-height: 1.45; color: var(--muted); }
.dcard .wfoot .ic { flex: none; margin-top: 1px; color: var(--cyan-ink); }
.dcard.dark .wfoot { color: rgba(255, 255, 255, .7); }
.dcard.dark .wfoot .ic { color: var(--cyan-2); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slots span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--pill); font: 500 .88rem var(--f-mono); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .2); color: #fff; }
.slots span.on { background: var(--cyan); border-color: var(--cyan); color: var(--navy); font-weight: 500; }
.slots .ic { width: 16px; height: 16px; }
.voice { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: var(--pill); background: var(--white); border: 1px solid var(--line); }
.voice .pl { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--cyan-2); flex: none; }
.voice .pl .ic { width: 15px; height: 15px; }
.voice .wave { flex: 1; display: flex; align-items: center; gap: 3px; height: 28px; min-width: 0; overflow: hidden; }
.voice .wave i { flex: none; width: 3px; border-radius: 2px; background: var(--cyan-dark); height: 40%; }
.voice .wave i:nth-child(3n) { height: 85%; }
.voice .wave i:nth-child(3n+1) { height: 55%; }
.voice .wave i:nth-child(4n) { height: 30%; }
.voice .wave i:nth-child(5n) { height: 100%; }
.voice small { font: 500 .78rem var(--f-mono); color: var(--muted); }
.qr.solo span { min-height: 42px; font-size: .86rem; }
.dcard .msgs .msg { max-width: 92%; font-size: .875rem; }
@media (max-width: 960px) {
  .dbento { grid-template-columns: minmax(0, 1fr); }
  .dbento > .dcard, .dbento > .dcard.wide { grid-column: auto; }
  .dcard.wide { grid-template-columns: minmax(0, 1fr); }
}
