/* Portada de Panucadi: historia por scroll de un pedido (ver docs/design-system.md, "Historia de un pedido").
   Colores y tipografía de la marca: docs/marca.md. */

:root {
  /* Primitivos de la marca. */
  --verde: #1E4A3C;        /* verde rótulo: marca, CTA */
  --verde-noche: #143329;  /* fondos oscuros, hover del CTA */
  --verde-medio: #3F6B5A;  /* texto secundario de acento */
  --oro: #E2A33B;          /* oro sello: sellos, acentos sobre oscuro; nunca texto sobre claro */
  --papel: #F3F6F1;        /* papel de libreta: fondo de página */
  --tinta: #17241F;        /* texto */
  --blanco: #FFFFFF;
  --linea: #D5DED7;
  --texto-2: #4B5A53;
  --azul: #3A64A8;         /* foco y controles de la demo */

  /* Negocio de la demo, si datos.js no dice otro. */
  --granja: #8E3B2E;

  /* Estados. */
  --ok: #17663F;
  --ok-fondo: #E2F3E9;
  --pend: #7A4300;
  --pend-fondo: #FFF0D2;
  --error: #B42318;
  --error-fondo: #FDE8E6;
  --piloto: #2D4F86;
  --piloto-fondo: #E4ECF8;
  --previsto: #4B5A53;
  --previsto-fondo: #E8EDE9;

  /* Semánticos. */
  --fondo: var(--papel);
  --texto: var(--tinta);
  --cta: var(--verde);
  --cta-hover: var(--verde-noche);
  --foco: var(--azul);

  --cab: 64px;
  --radio-s: 10px;
  --radio-m: 16px;
  --radio-l: 28px;
  --fuente: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --curva: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--cab) + 12px); }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 6.6vw, 4rem); font-weight: 760; letter-spacing: -0.035em; line-height: 1; }
h2 { font-size: clamp(1.7rem, 3.8vw, 2.5rem); letter-spacing: -0.028em; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }

p { margin: 0; text-wrap: pretty; }

:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; }

.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;
}

.saltar {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--tinta); color: var(--blanco); padding: .6rem 1rem; border-radius: var(--radio-s);
}
.saltar:focus { top: 12px; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 48px; padding: .7rem 1.35rem; border-radius: 999px;
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
  border: 0; cursor: pointer; touch-action: manipulation;
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.boton-cta { background: var(--cta); color: var(--blanco); }
.boton-cta:hover { background: var(--cta-hover); }
.boton-sec { background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 2px var(--tinta); }
.boton-sec:hover { background: var(--tinta); color: var(--blanco); }
.boton-cta-claro { background: var(--oro); color: var(--verde-noche); }
.boton-cta-claro:hover { background: #EDB956; }
.boton-claro { background: transparent; color: var(--blanco); box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.boton-claro:hover { background: rgba(255,255,255,.12); }

.acciones { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* Cabecera */
.cab {
  position: sticky; top: 0; z-index: 50; height: var(--cab);
  background: rgba(243, 246, 241, .94);
  border-bottom: 1px solid var(--linea);
}
@supports (backdrop-filter: blur(8px)) {
  .cab { background: rgba(243, 246, 241, .84); backdrop-filter: saturate(1.2) blur(10px); }
}
.cab-in {
  height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: .75rem;
}
.marca { display: inline-flex; align-items: center; gap: .55rem; font-weight: 760; font-size: 1.1rem; text-decoration: none; letter-spacing: -0.01em; margin-right: auto; }
.marca img { width: auto; height: 30px; }
.boton-cab { min-height: 44px; padding: .5rem 1rem; font-size: .95rem; }

.nav { position: relative; }
.nav-boton {
  min-height: 42px; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--linea);
  background: var(--blanco); color: var(--tinta); font: inherit; font-size: .95rem; font-weight: 600; cursor: pointer;
}
.nav-lista {
  display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px;
  list-style: none; margin: 0; padding: .5rem; background: var(--blanco);
  border: 1px solid var(--linea); border-radius: var(--radio-m); box-shadow: 0 18px 40px -18px rgba(20, 51, 41, .3);
}
.nav-lista.abierta { display: block; }
.nav-lista a { display: block; padding: .7rem .8rem; border-radius: var(--radio-s); text-decoration: none; font-weight: 550; }
.nav-lista a:hover { background: var(--papel); }

@media (min-width: 900px) {
  .cab-in { padding: 0 24px; gap: 1.5rem; }
  .nav-boton { display: none; }
  .nav-lista { display: flex; position: static; padding: 0; gap: .25rem; background: none; border: 0; box-shadow: none; min-width: 0; }
  .nav-lista a { padding: .5rem .75rem; font-size: .95rem; color: var(--texto-2); }
  .nav-lista a:hover { color: var(--tinta); background: rgba(30, 74, 60, .07); }
}

/* Historia */
.historia { position: relative; }

.capitulo { position: relative; padding: 1.75rem 16px 3.5rem; }
.capitulo-in { max-width: 36rem; }
.capitulo h2 { margin-bottom: 1rem; }
.capitulo p + p { margin-top: .85rem; }

.capitulo-inicio { padding-top: 2rem; padding-bottom: 2.25rem; }
.capitulo-inicio h1 { max-width: 17ch; }
.entrada { font-size: 1.125rem; color: var(--texto-2); margin-top: 1.1rem; max-width: 38rem; }
.capitulo-inicio .entrada { font-size: 1.15rem; }
.nota-piloto { margin-top: 1.5rem; font-size: .975rem; color: var(--texto-2); max-width: 32rem; }
.saltar-historia { margin-top: .75rem; font-size: .95rem; }
.saltar-historia a { color: var(--verde-medio); text-underline-offset: 3px; }

.escenario-col { position: sticky; top: var(--cab); z-index: 2; height: 56svh; }
.escenario {
  position: relative; height: 100%; overflow: hidden;
  /* El cielo del pueblo: detrás de la imagen fija (que es transparente fuera de la isla) y del lienzo. */
  background: url("diorama/maqueta/cielo.webp") center / cover, linear-gradient(#7fb0dc 0%, #a9cbe6 38%, #e9dcc6 62%, #f3d9b4 100%);
  border-bottom: 1px solid var(--linea);
  box-shadow: 0 12px 18px -14px rgba(20, 51, 41, .45);
  container-type: size;
}

.capitulos .capitulo { min-height: 82svh; }
.capitulos .capitulo-cierre { min-height: 70svh; }
.indice { display: none; }

.resumen-pedido {
  margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radio-s);
  background: var(--blanco); border: 1px solid var(--linea);
  font-variant-numeric: tabular-nums;
}

.paso-cantidad, .d-paso-cantidad { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.paso-cantidad { margin-top: .9rem; }
.paso-cantidad > span { font-size: .95rem; color: var(--texto-2); margin-right: .25rem; }
.paso-boton {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid currentColor; background: var(--blanco);
  color: var(--tinta); font: inherit; font-size: 1.35rem; font-weight: 600; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.paso-boton:disabled { opacity: .4; cursor: not-allowed; }
.paso-cantidad output, .d-paso-cantidad output { min-width: 2ch; text-align: center; font-weight: 750; font-size: 1.2rem; font-variant-numeric: tabular-nums; }

/* Etiquetas de estado */
.estados { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.estados li {
  display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .3rem .35rem .3rem .75rem; border-radius: 999px; background: var(--blanco); border: 1px solid var(--linea);
  font-size: .875rem; font-weight: 550;
}
.chip {
  display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 650; white-space: nowrap;
  background: var(--previsto-fondo); color: var(--previsto);
}
.chip[data-chip="disponible"] { background: var(--ok-fondo); color: var(--ok); }
.chip[data-chip="piloto"], .chip[data-chip="beta"] { background: var(--piloto-fondo); color: var(--piloto); }
.chip[data-chip="construccion"] { background: var(--pend-fondo); color: var(--pend); }
.chip[data-chip="previsto"], .chip[data-chip="pronto"] { background: var(--previsto-fondo); color: var(--previsto); }
/* La etiqueta dentro de un titular (data-etiqueta-de): a la altura del texto, sin heredar su tamaño. */
.chip-titulo { vertical-align: .2em; letter-spacing: 0; }

/* Móviles de la escena */
.tel {
  position: absolute; left: 0; top: 0; width: 320px; height: 640px; padding: 10px;
  border-radius: 46px; background: #14211C; transform-origin: 0 0;
  box-shadow: 0 40px 70px -30px rgba(20, 33, 28, .5), inset 0 0 0 2px #2E3D36;
}
.tel .pantalla {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 36px;
  background: var(--blanco); color: var(--tinta); font-size: 16px; line-height: 1.4;
}

.pc-arriba { font-size: 14px; color: var(--texto-2); font-weight: 600; }
.pc-boton, .d-boton {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1rem;
  border-radius: 14px; background: var(--color-negocio, var(--granja)); color: var(--blanco); gap: .3em;
  font: inherit; font-weight: 650; font-size: 16px; border: 0; width: 100%; text-align: center;
}
.d-boton { cursor: pointer; touch-action: manipulation; }
.d-boton.d-sec { background: var(--blanco); color: var(--tinta); box-shadow: inset 0 0 0 2px var(--linea); }
.d-boton.d-ok { background: var(--ok); }

.pc-negocio { font-size: 14px; font-weight: 650; color: var(--texto-2); }
.pc-producto { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--linea); }
.pc-producto b { display: block; font-size: 17px; line-height: 1.25; }
.pc-producto small { color: var(--texto-2); font-size: 15px; font-variant-numeric: tabular-nums; }
/* Foto del producto: sale del icono del sector (datos.js, casos.*.tarjeta.icono). */
.foto-producto { flex: none; width: 64px; height: 52px; border-radius: 10px; background: var(--linea); position: relative; }
[data-icono="huevo"] .foto-producto {
  background: #E9D7B9;
  background-image:
    radial-gradient(ellipse 9px 11px at 16px 18px, #F6EEDF 98%, transparent),
    radial-gradient(ellipse 9px 11px at 32px 18px, #F6EEDF 98%, transparent),
    radial-gradient(ellipse 9px 11px at 48px 18px, #E2B98A 98%, transparent),
    radial-gradient(ellipse 9px 11px at 16px 36px, #E2B98A 98%, transparent),
    radial-gradient(ellipse 9px 11px at 32px 36px, #F6EEDF 98%, transparent),
    radial-gradient(ellipse 9px 11px at 48px 36px, #F6EEDF 98%, transparent);
}
[data-icono="taza"] .foto-producto {
  background: #EADFD6;
  background-image: radial-gradient(circle 15px at 30px 26px, #6B3A2E 96%, transparent), radial-gradient(circle 20px at 30px 26px, #FFF 96%, transparent), radial-gradient(ellipse 6px 4px at 52px 26px, #FFF 96%, transparent);
}
.pc-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 15px; }
.pc-fila > span:first-child { color: var(--texto-2); }
.pc-fila b { text-align: right; }
.pc-paso { display: inline-flex; align-items: center; gap: 10px; }
.pc-paso i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--linea); display: inline-grid; place-items: center; font-weight: 700; }
.pc-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; border-top: 1px solid var(--linea); margin-top: 4px; font-variant-numeric: tabular-nums; }
.pc-total b { font-size: 18px; }

.pc-stripe { font-size: 14px; font-weight: 700; color: #4B4F9C; }
.pc-pagar-a { font-size: 15px; color: var(--texto-2); }
.pc-importe { font-size: 40px; font-weight: 780; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.pc-detalle { font-size: 15px; color: var(--texto-2); }
.pc-espera { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--pend-fondo); color: var(--pend); font-weight: 600; font-size: 15px; }
.girando { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.pc-ok { padding: 12px 14px; border-radius: 12px; background: var(--ok-fondo); color: var(--ok); font-weight: 650; font-size: 15px; }

/* Tarjeta de sellos */
.tarjeta-sellos {
  --color-tarjeta: var(--color-negocio, var(--granja));
  background: var(--color-tarjeta); color: var(--blanco); border-radius: 18px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 16px 30px -18px rgba(0,0,0,.6);
}
.ts-cab { display: flex; align-items: center; gap: 10px; }
.ts-cab b { display: block; font-size: 17px; line-height: 1.2; }
.ts-cab small { font-size: 13px; opacity: .85; }
.ts-logo { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--blanco); color: var(--color-tarjeta); display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.ts-sellos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sello { aspect-ratio: 1; border-radius: 50%; border: 2px dashed rgba(255,255,255,.55); }
.sello.puesto { border: 0; background: var(--oro); box-shadow: inset 0 0 0 4px rgba(0,0,0,.08); }
/* El dibujo del sello es el del sector: huevo en la granja, taza en la cafetería. Sin icono, liso. */
[data-icono] .sello.puesto::after {
  content: ""; display: block; width: 58%; height: 58%; margin: 21% auto 0;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
[data-icono="huevo"] .sello.puesto::after { background: rgba(255, 255, 255, .9); -webkit-mask-image: url(sellos/huevo.svg); mask-image: url(sellos/huevo.svg); }
[data-icono="taza"] .sello.puesto::after { background: rgba(58, 31, 20, .78); -webkit-mask-image: url(sellos/taza.svg); mask-image: url(sellos/taza.svg); }
.sello.nuevo { animation: sellar .6s var(--curva) both; }
@keyframes sellar { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ts-cuenta { font-size: 15px; font-variant-numeric: tabular-nums; }
.ts-cuenta b { font-size: 22px; }
.ts-premio { font-size: 14px; opacity: .92; }
.ts-qr { position: relative; width: 84px; height: 84px; margin: 4px auto 0; border-radius: 8px; background: var(--blanco); }
/* QR de muestra: no es un código y no lleva a ningún sitio. */
.ts-qr::after {
  content: ""; position: absolute; inset: 7px; background: var(--tinta);
  -webkit-mask: url(../marca/qr-muestra.svg) center / contain no-repeat;
          mask: url(../marca/qr-muestra.svg) center / contain no-repeat;
}

/* Chat del dueño */
.chat-cab { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; background: #EEF3EE; border-bottom: 1px solid var(--linea); }
.chat-cab b { display: block; font-size: 16px; }
.chat-cab small { font-size: 13px; color: var(--texto-2); }
.chat-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--verde); color: var(--blanco); display: grid; place-items: center; font-weight: 800; }
.chat-cuerpo { padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #DCE6DE; min-height: 100%; }
.burbuja { background: var(--blanco); border-radius: 4px 16px 16px 16px; padding: 10px 12px; font-size: 15px; line-height: 1.45; max-width: 92%; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-variant-numeric: tabular-nums; }
.burbuja-vieja { opacity: .6; }

/* Ticket del pedido: el mismo pedido de vista en vista */
.ticket {
  position: absolute; left: 0; top: 0; width: 220px; padding: 16px 16px 22px; opacity: 0;
  transform-origin: 0 0; background: var(--blanco); color: var(--tinta); border-radius: 8px 8px 0 0;
  font-size: 15px; line-height: 1.35; font-variant-numeric: tabular-nums;
  filter: drop-shadow(0 14px 18px rgba(20, 33, 28, .28));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.ticket-id { font-size: 13px; color: var(--texto-2); }
.ticket-id b { color: var(--tinta); font-size: 15px; }
.ticket-linea { margin-top: 4px; }
.ticket-total { margin-top: 8px; font-size: 24px; font-weight: 780; letter-spacing: -0.02em; }
.ticket-estado { margin-top: 8px; }
.te { display: none; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.te-sin { background: var(--previsto-fondo); color: var(--previsto); }
.te-pend { background: var(--pend-fondo); color: var(--pend); }
.te-ok { background: transparent; color: var(--verde); box-shadow: inset 0 0 0 2.5px var(--verde); border-radius: 8px; transform: rotate(-6deg); font-weight: 800; letter-spacing: .01em; animation: sellar .5s var(--curva) both; }

/* Mundo en miniatura: imagen fija primero, diorama en Three.js encima cuando llega.
   La imagen del pueblo (1:1, transparente fuera de la isla, sobre el cielo del escenario) va centrada y
   mide lo que mide el pueblo en el lienzo: la cámara del pueblo es la misma con la que se sacó la imagen
   y solo cambia su campo de visión, hasta que el pueblo ajusta al ancho del escenario o, si es muy
   apaisado, al alto (1,1334 veces el alto: FIJA_ALTO en diorama.js). Así, al llegar el lienzo, no se
   mueve nada: aparece encima en un momento y la imagen se retira cuando ya no se ve. Los puntos los
   coloca historia.js con la misma cuenta. */
.mundo-fijo { position: absolute; left: 50%; top: 50%; width: 100%; width: min(100cqw, 113.34cqh); height: auto; transform: translate(-50%, -50%); display: block; }
.mundo-lienzo { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; opacity: 0; transition: opacity .35s ease; }
.escenario.con-3d .mundo-lienzo { opacity: 1; }
/* Se deja de pintar con opacity y no con visibility: así sigue contando para los lectores de pantalla,
   que es quien lleva el texto alternativo del escenario (el lienzo va con aria-hidden). */
.escenario.con-3d .mundo-fijo { opacity: 0; transition: opacity 0s .4s; }
/* La imagen de la granja solo se pinta (y se descarga) sin 3D, en los pasos 2 a 6, y llena el escenario. */
.mundo-fijo[data-fijo="granja"] { display: none; left: 0; top: 0; width: 100%; height: 100%; transform: none; object-fit: cover; }
.escenario:not(.con-3d)[data-escena="2"] .mundo-fijo[data-fijo="granja"],
.escenario:not(.con-3d)[data-escena="3"] .mundo-fijo[data-fijo="granja"],
.escenario:not(.con-3d)[data-escena="4"] .mundo-fijo[data-fijo="granja"],
.escenario:not(.con-3d)[data-escena="5"] .mundo-fijo[data-fijo="granja"],
.escenario:not(.con-3d)[data-escena="6"] .mundo-fijo[data-fijo="granja"] { display: block; }

/* Puntos de acción: botón de play (o "+" sin vídeo) con leyenda. En escritorio la leyenda sale al pasar el ratón o
   con el foco; en pantallas táctiles no se enseña (más abajo se dice por qué) y un toque abre la ficha. */
.puntos { position: absolute; inset: 0; pointer-events: none; opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; }
.escenario:not(.con-3d)[data-escena="1"] .puntos,
.escenario:not(.con-3d)[data-escena="7"] .puntos,
.escenario.con-3d.mundo-quieto .puntos { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.punto {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%); transform: translate(-50%, -50%);
  pointer-events: auto; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: var(--tinta);
  display: flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px;
}
/* El disco mide 36 px para no tapar el comercio; la zona que se pulsa sigue siendo de 48. */
.punto-play {
  position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--verde); color: var(--blanco);
  box-shadow: 0 0 0 3px rgba(243, 246, 241, .92), 0 8px 18px -8px rgba(20, 51, 41, .7);
  transition: transform .2s var(--curva), background-color .2s ease;
}
.punto-play svg { margin-left: 2px; width: 14px; height: 14px; }
.punto-play::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--oro); opacity: 0; animation: latido 2.6s ease-out infinite;
}
@keyframes latido { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
.punto:hover .punto-play, .punto:focus-visible .punto-play { transform: scale(1.08); background: var(--verde-noche); }
.punto:focus-visible { outline: none; }
.punto:focus-visible .punto-play { outline: 3px solid var(--foco); outline-offset: 5px; }
.punto-leyenda {
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translate(-6px, -50%);
  display: flex; flex-direction: column; padding: .45rem .75rem; border-radius: 12px;
  background: var(--blanco); box-shadow: 0 12px 26px -12px rgba(20, 51, 41, .55); border: 1px solid var(--linea);
  white-space: nowrap; text-align: left; line-height: 1.2; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s var(--curva);
}
.punto-izq .punto-leyenda { left: auto; right: calc(100% + 10px); transform: translate(6px, -50%); text-align: right; }
.punto-leyenda b { font-size: .95rem; }
.punto-leyenda small { font-size: .8125rem; color: var(--texto-2); font-weight: 600; }
.punto:hover .punto-leyenda, .punto:focus-visible .punto-leyenda { opacity: 1; transform: translate(0, -50%); }
.punto[hidden] { display: none; }
/* Sin hover (táctil) la leyenda no se enseña: tres a la vez se pisan y tapan el pueblo en 343 px.
   Los nombres están en la lista "Mira un día normal en el pueblo" y en el nombre accesible del botón. */

/* Lista de puntos en la portada: siempre a mano, también sin 3D y en móvil. */
.ver-puntos { margin-top: 1.5rem; }
.ver-puntos-titulo { font-weight: 700; font-size: .975rem; }
.ver-puntos-lista { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.ver-punto {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .25rem .9rem .25rem .3rem;
  border-radius: 999px; border: 1px solid var(--linea); background: var(--blanco); color: var(--tinta);
  font: inherit; font-weight: 650; font-size: .9rem; cursor: pointer; white-space: nowrap;
}
.ver-punto:hover { border-color: var(--verde); }
.ver-punto-play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--verde); color: var(--blanco); }
.ver-punto-play svg { width: 16px; height: 16px; margin-left: 2px; }
/* El "+" de las fichas sin vídeo ya está centrado: el triángulo es el que necesita el empujón. */
.punto-play.sin-video svg, .ver-punto-play.sin-video svg, .negocio-play.sin-video svg { margin-left: 0; }
.ver-negocios { margin-top: .75rem; font-size: .925rem; font-weight: 600; }
.ver-negocios a { color: var(--verde); text-underline-offset: 3px; }

/* Sección "Elige un negocio como el tuyo": tarjetas con foto que abren la misma ficha. */
.negocios { padding: clamp(3rem, 7vw, 5.5rem) 16px; max-width: 1180px; margin: 0 auto; }
.negocios-cab { max-width: 46rem; }
.negocios-cab p { margin-top: .6rem; color: var(--texto-2); }
.negocios-lista {
  list-style: none; margin: 1.75rem 0 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.negocio {
  width: 100%; height: 100%; display: grid; grid-template-rows: auto 1fr; text-align: left;
  padding: 0; border: 1px solid var(--linea); border-radius: var(--radio-m); background: var(--blanco);
  color: var(--tinta); font: inherit; cursor: pointer; overflow: hidden;
  transition: border-color .2s ease, transform .2s var(--curva), box-shadow .2s ease;
}
.negocio:hover { border-color: var(--verde); transform: translateY(-2px); box-shadow: 0 14px 28px -18px rgba(20, 51, 41, .6); }
.negocio:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; }
.negocio-foto { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--verde-noche); }
.negocio-foto img { display: block; width: 100%; height: 100%; object-fit: cover; }
.negocio-play {
  position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; background: var(--verde); color: var(--blanco);
  box-shadow: 0 0 0 3px rgba(243, 246, 241, .9);
}
.negocio-play svg { width: 18px; height: 18px; margin-left: 2px; }
.negocio-texto { display: grid; gap: .25rem; align-content: start; padding: .8rem .95rem 1rem; }
.negocio-sector { font-size: .8125rem; font-weight: 700; color: var(--verde); text-transform: uppercase; letter-spacing: .04em; }
.negocio-titulo { font-weight: 700; font-size: 1.02rem; line-height: 1.3; }
.negocio-comercio { font-size: .875rem; color: var(--texto-2); }
.negocio-estado { margin-top: .15rem; font-size: .8125rem; font-weight: 600; color: var(--pend); }
.negocios-sinjs { margin-top: 1.25rem; color: var(--texto-2); }
@media (max-width: 559px) {
  /* En el móvil, dos por fila con la foto arriba: trece tarjetas sin un scroll eterno. */
  .negocios-lista { grid-template-columns: 1fr 1fr; gap: 10px; }
  .negocio-texto { padding: .6rem .7rem .8rem; }
  .negocio-titulo { font-size: .9rem; }
  .negocio-play { width: 34px; height: 34px; right: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { .negocio, .negocio:hover { transition: none; transform: none; } }

/* Ticket del pedido: el dato es HTML, encima del diorama. */
.escenario .ticket {
  left: 12px; bottom: 12px; top: auto; width: 196px; padding: 12px 14px 18px; font-size: 14px;
  transform: translateY(8px) rotate(-2deg); transition: opacity .35s ease, transform .35s var(--curva);
}
.escenario .ticket .ticket-total { font-size: 21px; margin-top: 4px; }
.escenario[data-escena="3"] .ticket, .escenario[data-escena="4"] .ticket,
.escenario[data-escena="5"] .ticket, .escenario[data-escena="6"] .ticket { opacity: 1; transform: rotate(-2deg); }
.ticket-sellos, .ticket-aviso { display: none; font-weight: 600; }
.escenario[data-escena="5"] .ticket-sellos, .escenario[data-escena="6"] .ticket-sellos,
.escenario[data-escena="6"] .ticket-aviso { display: block; }
.escenario[data-escena="3"] .te-sin,
.escenario[data-escena="4"] .te-pend,
.escenario[data-escena="5"] .te-ok,
.escenario[data-escena="6"] .te-ok,
.escenario[data-escena="7"] .te-ok { display: inline-block; }
@media (max-width: 899px) {
  .escenario .ticket { width: 148px; font-size: 12px; line-height: 1.3; padding: 8px 10px 14px; left: 8px; bottom: 8px; }
  .escenario .ticket .ticket-id b { font-size: 13px; }
  .escenario .ticket .ticket-total { font-size: 16px; }
  .escenario .ticket .te { font-size: 12px; padding: 2px 8px; }
}

/* Vídeo del punto de acción */
.video-dialogo {
  width: min(1120px, calc(100vw - 24px)); max-height: calc(100svh - 24px); overflow: auto; overscroll-behavior: contain; padding: 0; border: 0;
  border-radius: var(--radio-l); background: var(--blanco); color: var(--tinta);
  box-shadow: 0 30px 80px -30px rgba(10, 30, 22, .7);
}
.video-dialogo::backdrop { background: rgba(14, 34, 27, .72); }
.con-dialogo { overflow: hidden; }
.vd-caja { padding: 18px 18px 22px; display: grid; gap: .85rem; }
.vd-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.vd-cab h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); margin-top: .35rem; }
.vd-etiquetas { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .9rem; color: var(--texto-2); font-weight: 600; }
.chip-recreacion { background: var(--tinta); color: var(--blanco); }
.vd-cerrar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--linea); background: var(--papel);
  color: var(--tinta); display: grid; place-items: center; cursor: pointer;
}
.vd-cerrar:hover { background: var(--linea); }
.vd-cuerpo { display: grid; gap: 1rem; }
.vd-video, .vd-imagen { width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 58svh; border-radius: var(--radio-m); background: var(--verde-noche); object-fit: contain; }
.vd-video[hidden], .vd-imagen[hidden] { display: none; }
.vd-info { display: grid; gap: .75rem; align-content: start; }
.vd-texto { font-size: 1.02rem; max-width: 62ch; }
.vd-estado-titulo { font-weight: 700; font-size: .95rem; }
/* En la ficha cada paso es una fila, no una píldora: el nombre ocupa lo que haga falta, aunque
   sean dos líneas, y el estado queda a la derecha sin salirse. */
.vd-estados { margin-top: -.35rem; display: grid; gap: 0; border-top: 1px solid var(--linea); }
.vd-estados li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: .75rem;
  padding: .55rem 0; border: 0; border-bottom: 1px solid var(--linea); border-radius: 0; background: none;
  font-size: .9rem; line-height: 1.35;
}
.vd-estados .chip { margin-top: .05rem; }
.vd-nota { font-size: .875rem; color: var(--texto-2); }
.vd-demo { justify-self: start; }
.vd-demo[hidden] { display: none; }
@media (min-width: 900px) {
  .vd-caja { padding: 24px 28px 28px; }
  .vd-cuerpo { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .vd-video, .vd-imagen { max-height: calc(100svh - 170px); }
}

/* Escritorio: texto a la izquierda, escenario fijo a la derecha */
@media (min-width: 900px) {
  .historia {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    max-width: 1440px; margin: 0 auto;
  }
  .capitulo-inicio { grid-column: 1; grid-row: 1; }
  .escenario-col { grid-column: 2; grid-row: 1 / span 2; position: relative; top: auto; height: auto; z-index: 1; }
  .escenario {
    position: sticky; top: calc(var(--cab) + 16px);
    height: calc(100svh - var(--cab) - 32px); margin: 16px 24px 16px 0;
    border: 1px solid var(--linea); border-radius: var(--radio-l);
  }
  .capitulos { grid-column: 1; grid-row: 2; }
  .capitulo, .capitulos .capitulo, .capitulos .capitulo-cierre {
    min-height: calc(100svh - var(--cab)); display: flex; align-items: center;
    padding: 3rem clamp(1.5rem, 4vw, 4.5rem);
  }
  .capitulo-inicio { padding-top: 2rem; padding-bottom: 2rem; }

  .indice {
    display: block; position: sticky; top: var(--cab); z-index: 3;
    padding: 16px clamp(1.5rem, 4vw, 4.5rem) 14px;
    background: linear-gradient(var(--papel) 78%, rgba(243, 246, 241, 0));
  }
  .indice ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
  .indice a {
    display: inline-flex; align-items: center; min-height: 36px; padding: .3rem .8rem; border-radius: 999px;
    font-size: .875rem; font-weight: 600; color: var(--texto-2); text-decoration: none;
    background: rgba(243, 246, 241, .94); border: 1px solid var(--linea);
  }
  .indice a[aria-current="step"] { background: var(--tinta); color: var(--blanco); border-color: var(--tinta); }
  .indice + .capitulo { margin-top: -66px; }
}

/* Secciones */
.seccion-in { max-width: 1120px; margin: 0 auto; padding: 4rem 16px; }
@media (min-width: 900px) { .seccion-in { padding: 6rem 24px; } }

/* Demo */
.prueba { background: var(--blanco); border-top: 1px solid var(--linea); }
.prueba-cab { max-width: 1120px; margin: 0 auto; padding: 4rem 16px 1.5rem; }
.prueba-cab h2 { max-width: 20ch; }
.aviso-demo {
  margin-top: 1rem; display: inline-block; padding: .55rem .85rem; border-radius: var(--radio-s);
  background: var(--pend-fondo); color: var(--pend); font-weight: 600; font-size: .95rem;
}
.casos { border: 0; padding: 0; margin: 1.75rem 0 0; }
.casos legend { font-weight: 700; margin-bottom: .6rem; padding: 0; }
.casos-opciones { display: grid; gap: .6rem; }
.caso { position: relative; display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radio-m); border: 2px solid var(--linea); cursor: pointer; background: var(--papel); }
.caso input { margin-top: .3rem; width: 20px; height: 20px; accent-color: var(--tinta); flex: none; }
.caso b { display: block; }
.caso small { display: block; color: var(--texto-2); font-size: .9rem; margin-top: .1rem; }
.caso:has(input:checked) { border-color: var(--tinta); background: var(--blanco); }
.caso .chip { margin-top: .4rem; }

.prueba-cuerpo { max-width: 1120px; margin: 0 auto; padding: 1rem 16px 4.5rem; display: grid; gap: 2.5rem; }
.lado h3 { margin-bottom: .9rem; }
.progreso { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: .35rem; counter-reset: paso; }
.progreso li {
  counter-increment: paso; flex: 1; font-size: .8125rem; font-weight: 600; color: var(--texto-2);
  padding-top: .45rem; border-top: 4px solid var(--linea);
}
.progreso li::before { content: counter(paso) ". "; }
.progreso li.hecho { border-top-color: var(--verde-medio); color: var(--tinta); }
.progreso li[aria-current="step"] { border-top-color: var(--tinta); color: var(--tinta); }

.tel-demo { position: relative; margin: 0 auto; max-width: 100%; }
.tel-demo .pantalla { overflow-y: auto; }
.d-paso { padding: 26px 18px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.d-paso[hidden] { display: none; }
.d-campo { border: 0; margin: 0; padding: 0; font-size: 15px; }
.d-campo legend, .d-campo label, .d-fila > span:first-child { display: block; color: var(--texto-2); font-weight: 600; margin-bottom: 6px; padding: 0; }
.d-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-fila > span:first-child { margin: 0; }
.d-paso-cantidad .paso-boton { width: 40px; height: 40px; font-size: 1.2rem; border-color: var(--linea); }
.d-opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.d-opcion { position: relative; }
.d-opcion input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.d-opcion span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 6px; border-radius: 10px; border: 2px solid var(--linea); font-size: 14px; font-weight: 600; text-align: center; }
.d-opcion input:checked + span { border-color: var(--color-negocio, var(--granja)); background: color-mix(in srgb, var(--color-negocio, var(--granja)) 10%, white); }
.d-opcion input:focus-visible + span { outline: 3px solid var(--foco); outline-offset: 2px; }
.d-campo input[type="text"] { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--linea); font: inherit; font-size: 16px; color: var(--tinta); }
.d-cuentas { margin: 4px 0 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.d-cuentas div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.d-cuentas dt, .d-cuentas dd { margin: 0; }
.d-cuentas .d-total { border-top: 1px solid var(--linea); margin-top: 4px; padding-top: 8px; font-weight: 750; font-size: 17px; }
.d-acciones { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: auto; }
.d-estado-pago { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.d-estado-pago[hidden] { display: none; }
.d-error p, .d-aviso p { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.d-error p { background: var(--error-fondo); color: var(--error); }
.d-aviso p { background: var(--previsto-fondo); color: var(--tinta); }
.d-nota { font-size: 14px; color: var(--texto-2); }

.simulador {
  margin: 1rem auto 0; max-width: 320px; padding: .9rem; border-radius: var(--radio-m);
  border: 2px dashed var(--azul); background: var(--piloto-fondo);
}
.simulador[hidden] { display: none; }
.simulador-titulo { font-weight: 700; font-size: .95rem; margin-bottom: .6rem; color: var(--piloto); }
.simulador-botones { display: grid; gap: .5rem; }

.chat-demo { border-radius: var(--radio-l); overflow: hidden; border: 1px solid var(--linea); max-width: 420px; }
.chat-demo .chat-cuerpo { min-height: 300px; padding: 16px; }
.chat-sistema { align-self: center; text-align: center; font-size: .9rem; color: var(--texto-2); background: rgba(255,255,255,.7); padding: .5rem .8rem; border-radius: 12px; max-width: 30ch; }
.burbuja-nueva[hidden] { display: none; }
.panel-pronto { margin-top: 1rem; font-size: .95rem; color: var(--texto-2); display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

@media (min-width: 900px) {
  .prueba-cab { padding: 6rem 24px 2rem; }
  .casos-opciones { grid-template-columns: 1fr 1fr; max-width: 760px; }
  .prueba-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 1.5rem 24px 6rem; gap: 3rem; }
  .lado-cliente { display: flex; flex-direction: column; align-items: center; }
  .lado-cliente h3, .lado-cliente .progreso { align-self: stretch; max-width: 320px; margin-left: auto; margin-right: auto; width: 100%; }
}

/* Vuelo del ticket en la demo */
.ticket-vuelo { position: fixed; z-index: 60; left: 0; top: 0; opacity: 1; pointer-events: none; }

/* Estado de cada pieza */
.estado { border-top: 1px solid var(--linea); }
.lista-estado { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--linea); max-width: 860px; }
.lista-estado li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--linea); }
.lista-estado .chip { flex: none; }
.no-hace { margin-top: 1.5rem; color: var(--texto-2); max-width: 46rem; }

/* Precios */
.precios { background: var(--blanco); border-top: 1px solid var(--linea); }
.planes { display: grid; gap: 1rem; margin-top: 2rem; }
.plan { padding: 1.5rem; border-radius: var(--radio-l); border: 1px solid var(--linea); background: var(--papel); }
.plan:nth-child(2) { background: var(--verde); color: var(--blanco); border-color: var(--verde); }
.plan-precio { font-size: 2.6rem; font-weight: 780; letter-spacing: -0.03em; margin-top: .5rem; font-variant-numeric: tabular-nums; }
.plan-precio small { font-size: 1rem; font-weight: 550; letter-spacing: 0; opacity: .8; white-space: nowrap; }
.plan ul { margin: 1rem 0 0; padding-left: 1.1rem; }
.plan li + li { margin-top: .35rem; }
.plan .chip { margin-left: .25rem; vertical-align: .1em; }
.plan:nth-child(2) .chip { background: rgba(255,255,255,.16); color: var(--blanco); }
.plan-detalle { margin-top: .35rem; font-size: .9rem; opacity: .8; }
.plan-contacto { display: inline-block; margin-top: 1rem; font-weight: 650; color: inherit; }
/* El botón de cada plan: lleva al alta con el plan y el periodo elegidos (planes.js). */
.plan { display: flex; flex-direction: column; }
.plan ul { flex: 1; }
.plan-alta { margin-top: 1.25rem; align-self: flex-start; min-height: 44px; background: transparent; color: var(--tinta); box-shadow: inset 0 0 0 2px var(--tinta); }
.plan-alta:hover { background: var(--tinta); color: var(--blanco); }
.plan:nth-child(2) .plan-alta { background: var(--oro); color: var(--verde-noche); box-shadow: none; }
.plan:nth-child(2) .plan-alta:hover { background: #EDB956; }
/* El interruptor "Pago anual": encendido, el precio con pago anual; apagado, mes a mes. */
.planes-periodo { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .75rem; margin-top: 1.5rem; }
.planes-periodo + .planes { margin-top: 1rem; }
/* La casilla "Ver sin IVA" (25-nov-2026): a la derecha del interruptor, con zona de toque de 44 px. */
.planes-iva { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; font-size: .95rem; }
.planes-iva-casilla { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--verde, #1E4A3C); }
.conmutador { display: inline-flex; align-items: center; gap: .65rem; min-height: 44px; padding: .25rem .25rem .25rem 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 650; cursor: pointer; }
.conmutador-pista { position: relative; flex: none; width: 3rem; height: 1.75rem; border-radius: 999px; background: #6B7B73; border: 2px solid transparent; box-sizing: border-box; transition: background .15s ease; }
.conmutador-pista::after { content: ""; position: absolute; top: .0625rem; left: .0625rem; width: 1.375rem; height: 1.375rem; border-radius: 50%; background: var(--blanco); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease; }
.conmutador[aria-checked="true"] .conmutador-pista { background: var(--verde); }
.conmutador[aria-checked="true"] .conmutador-pista::after { transform: translateX(1.25rem); }
/* Con colores forzados (alto contraste) el fondo se pierde: el borde y el botón dicen el estado. */
@media (forced-colors: active) { .conmutador-pista { border-color: ButtonText; } .conmutador-pista::after { background: ButtonText; } .conmutador[aria-checked="true"] .conmutador-pista { background: Highlight; } }
@media (prefers-reduced-motion: reduce) { .conmutador-pista, .conmutador-pista::after { transition: none; } }
.comisiones { margin-top: 2.5rem; max-width: 46rem; }
.comisiones h3 { margin-bottom: .75rem; }
.comisiones p + p { margin-top: .85rem; }
.ejemplo {
  padding: 1rem 1.1rem 1.4rem; background: var(--papel); border-radius: 8px 8px 0 0; font-variant-numeric: tabular-nums;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 14px 100%;
}
.letra { font-size: .9rem; color: var(--texto-2); }
/* La fuente de una cifra (26-nov-2026): una línea pequeña y gris debajo, con el documento original enlazado. */
.fuente { font-size: .8125rem; color: var(--texto-2); margin-top: -.25rem; }
.fuente a { color: inherit; }
.pasos-texto + p { margin-top: 1rem; }
/* El "?" de una ficha con ayuda (26-nov-2026): zona de toque de 44 px y globo al pasar, enfocar o tocar. */
.ayuda { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -12px -10px -12px 0; padding: 0; border: 0; background: none; cursor: help; font: inherit; font-weight: 700; font-size: .8125rem; color: var(--texto-2); }
.ayuda::before { content: ""; position: absolute; width: 1.25rem; height: 1.25rem; border-radius: 50%; border: 1.5px solid currentColor; }
.ayuda-globo { position: absolute; z-index: 10; bottom: calc(100% + 4px); left: 0; width: min(18rem, 80vw); padding: .6rem .75rem; border-radius: 10px; background: var(--tinta, #17241F); color: #fff; font-weight: 400; font-size: .875rem; line-height: 1.4; text-align: left; display: none; pointer-events: none; }
/* Oculto no ocupa sitio (display: none): con visibility: hidden seguía contando para el ancho de la página.
   Lo enseña historia.js con la clase, a la vez que lo coloca; con :hover podía salir sin colocar (dedo apoyado). */
.ayuda-abierta .ayuda-globo { display: block; }
.ayuda-abajo .ayuda-globo { bottom: auto; top: calc(100% + 4px); }
@media (min-width: 640px) { .planes { grid-template-columns: 1fr 1fr; max-width: 860px; } }
@media (min-width: 1100px) { .planes { grid-template-columns: repeat(4, 1fr); max-width: none; } }

/* Plazas del piloto */
.piloto { background: var(--verde-noche); color: var(--blanco); }
.piloto p { max-width: 40rem; margin-top: 1rem; color: #D8E6DD; }
.piloto .piloto-nota { font-size: .95rem; color: #B5CABD; margin-top: 1.5rem; }
.piloto :focus-visible { outline-color: var(--oro); }

/* Pie */
.pie { background: var(--verde-noche); color: #C9D6CE; font-size: .95rem; }
.pie-in { max-width: 1120px; margin: 0 auto; padding: 2.5rem 16px; display: grid; gap: 1.25rem; }
.pie-marca { display: flex; align-items: center; gap: .5rem; color: var(--blanco); font-weight: 760; }
.pie-enlaces { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.pie-enlaces a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 3px; }
.pie-copy { font-size: .875rem; color: #9DB8AA; white-space: nowrap; }
.pie-copy a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-underline-offset: 3px; }
.pie :focus-visible { outline-color: var(--oro); }
@media (min-width: 900px) { .pie-in { grid-template-columns: auto 1fr auto auto; align-items: center; padding: 2.5rem 24px; } }

/* Movimiento reducido: los mismos pasos, sin desplazamientos */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .girando { border-right-color: currentColor; opacity: .6; }
  .punto-play::after { animation: none; }
}

/* Página de plazas del piloto */
.piloto-pagina { max-width: 1120px; margin: 0 auto; padding: 2.5rem 16px 4rem; }
.piloto-cols { display: grid; gap: 2.5rem; }
.piloto-texto h1 { font-size: clamp(2rem, 5vw, 3rem); }
.piloto-h2 { font-size: 1.25rem; margin-top: 2rem; }
.piloto-pasos { margin: .9rem 0 0; padding-left: 1.25rem; }
.piloto-pasos li + li { margin-top: .5rem; }
.piloto-alt { margin-top: 1.75rem; color: var(--texto-2); }
.piloto-alt a { color: var(--tinta); font-weight: 600; text-underline-offset: 3px; }
.piloto-form-caja { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio-l); padding: 1.5rem 1.25rem; }
.form-piloto { display: grid; gap: 1.1rem; }
.form-ayuda { font-size: .9rem; color: var(--texto-2); }
.campo label { display: block; font-weight: 600; margin-bottom: .35rem; }
.opcional { font-weight: 400; color: var(--texto-2); }
.campo input[type="text"], .campo input[type="email"], .campo input[type="tel"], .campo select, .campo textarea {
  width: 100%; min-height: 48px; padding: .65rem .85rem; border-radius: var(--radio-s);
  border: 2px solid var(--linea); background: var(--blanco); color: var(--tinta); font: inherit; font-size: 1rem;
}
.campo textarea { resize: vertical; min-height: 96px; }
.campo [aria-invalid="true"] { border-color: var(--error); }
.campo-error { color: var(--error); font-size: .9rem; margin-top: .35rem; font-weight: 550; }
.campo-casilla { display: grid; grid-template-columns: auto 1fr; gap: .25rem .75rem; align-items: start; }
.campo-casilla input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--tinta); }
.campo-casilla label { font-weight: 400; margin: 0; }
.campo-casilla .campo-error { grid-column: 2; }
.boton-ancho { width: 100%; }
.form-mensaje { padding: .85rem 1rem; border-radius: var(--radio-s); font-weight: 550; }
.form-mensaje[data-tipo="error"] { background: var(--error-fondo); color: var(--error); }
.form-mensaje[data-tipo="aviso"] { background: var(--piloto-fondo); color: var(--piloto); }
/* El botón nace desactivado y piloto.js lo activa: sin script, el formulario no se envía. */
/* Mientras envía no se atenúa: "Enviando…" tiene que leerse. */
.boton:disabled:not([aria-busy="true"]) { opacity: .45; cursor: not-allowed; }
.boton[aria-busy="true"] { cursor: progress; }
.form-sinjs { padding: .85rem 1rem; border-radius: var(--radio-s); font-weight: 550; background: var(--piloto-fondo); color: var(--piloto); }
.form-hecho h2 { margin-bottom: .75rem; }
.form-hecho p + p { margin-top: 1rem; }
@media (min-width: 900px) {
  .piloto-pagina { padding: 4rem 24px 6rem; }
  .piloto-cols { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 4rem; align-items: start; }
  .piloto-form-caja { padding: 2rem; }
}

/* Ajustes de la demo */
#demo-pantalla:focus-visible { outline-offset: -4px; }
a.d-boton { text-decoration: none; }
@media (min-width: 900px) { .solo-estrecho { display: none !important; } }

/* La misma versión sin movimiento, forzada con ?movimiento=reducido */
.movimiento-reducido, .movimiento-reducido *, .movimiento-reducido *::before, .movimiento-reducido *::after {
  scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important;
}

/* Páginas de texto (cómo funciona, precios, clubes, soporte...): mismo estilo que la portada. */
.pagina-texto .seccion-in { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pagina-texto .seccion-in + .seccion-in { border-top: 1px solid var(--linea); }
.pagina-texto h2 { margin-top: .25rem; }
.pagina-texto p { max-width: 42rem; }
.pagina-texto .seccion-in > p + p { margin-top: .8rem; }
.bloques { display: grid; gap: 1rem; margin-top: 1.75rem; }
@media (min-width: 720px) { .bloques { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1020px) { .bloques-3 { grid-template-columns: repeat(3, 1fr); } }
.bloque { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio-m); padding: 1.25rem; }
.bloque h3 { margin-bottom: .5rem; }
.bloque p { color: var(--texto-2); }
.bloque .dolor { color: var(--tinta); font-weight: 600; margin-bottom: .4rem; }
.bloque .estados { margin-top: .9rem; }
.pasos-texto { margin: 1rem 0 0; padding-left: 1.25rem; max-width: 42rem; }
.pasos-texto li + li { margin-top: .6rem; }
.glosario { margin: 1.5rem 0 0; display: grid; gap: 1.1rem; max-width: 46rem; }
.glosario dt { font-weight: 700; font-size: 1.1rem; }
.glosario dd { margin: .25rem 0 0; color: var(--texto-2); }
.preguntas details { border-top: 1px solid var(--linea); padding: .9rem 0; max-width: 46rem; }
.preguntas summary { font-weight: 650; cursor: pointer; }
.preguntas details p { margin-top: .5rem; color: var(--texto-2); }
/* El plan que la persona eligió en el cuadro de precios, encima del formulario de alta (piloto.js). */
.plan-elegido { margin: 0 0 1.25rem; padding: .85rem 1rem; border-radius: var(--radio-m, 12px); background: var(--papel); border: 1px solid var(--linea); font-size: .95rem; }
