/* Demo: en el celular, la app a pantalla completa; en escritorio, como la propuesta de Indian: el texto a la
   izquierda y el chat en un marco de celular a la derecha, sobre el fondo de mensajes. */
body {
  height: 100dvh;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Escena ------------------------------------------------------------------------------------------------- */
.escena {
  height: 100dvh;
}
.intro > :not(.tour):not(.replay) {
  display: none;
}
.telefono,
.pantalla {
  height: 100%;
}
.pantalla {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Dentro del chat el fondo de mensajes va muy atenuado: no se confunde con la conversación real. */
  background:
    linear-gradient(rgb(247 242 234 / 0.7), rgb(247 242 234 / 0.7)),
    url("../assets/fondo-mensajes.svg") 0 0 / 960px repeat,
    var(--paper);
}

@media (min-width: 900px) {
  .escena {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(40px, 6vw, 96px);
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px clamp(24px, 4vw, 56px);
  }
  .intro > :not(.tour):not(.replay) {
    display: block;
  }
  .telefono {
    height: min(860px, calc(100dvh - 48px));
    aspect-ratio: 390 / 844;
    padding: 11px;
    border-radius: 52px;
    background: #15110d;
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 0.06) inset,
      0 60px 100px -50px rgb(60 45 30 / 0.6);
  }
  .pantalla {
    border-radius: 42px;
  }
}

/* --- Texto de la izquierda (escritorio) ---------------------------------------------------------------------- */
.volver {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
}
.volver:hover {
  color: var(--ink);
}
.kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-texto);
  margin: 0 0 14px;
}
.intro h1 {
  font-size: clamp(2.8rem, 5.4vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  max-width: 11em;
  text-wrap: balance;
}
.intro h1 .l {
  font-weight: 300;
  letter-spacing: -0.03em;
}
.intro .lead {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  max-width: 34em;
  margin: 0 0 28px;
}
.intro .nota {
  margin-top: 22px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* --- App: barra, conversación, composer ------------------------------------------------------------------------ */
.bar {
  flex: none;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--line);
}
.back {
  display: grid;
  place-items: center;
  width: 28px;
  height: 44px;
  font-size: 1.8rem;
  line-height: 1;
  text-decoration: none;
}
@media (min-width: 900px) {
  .bar {
    padding-top: 18px;
  }
  .back {
    visibility: hidden;
  }
}
.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  font-weight: 800;
  font-size: 0.8rem;
  flex: none;
}
.who {
  flex: 1;
  min-width: 0;
  line-height: 1.2;
}
.who b,
.who small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.who b {
  font-size: 1.02rem;
}
.who small {
  color: var(--muted);
  font-size: 0.78rem;
}
.btn.small {
  min-height: 44px;
  padding: 0 0.9em;
  font-size: 0.82rem;
}

/* El chat scrollea por dentro y la barra de scroll no se ve nunca, aunque la conversación sea larga. */
.chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  width: 100%;
  padding: 12px 12px 16px;
}
.chat::-webkit-scrollbar {
  display: none;
}
.chat.con-recorrido {
  padding-bottom: 200px;
}
@media (min-width: 900px) {
  .chat.con-recorrido {
    padding-bottom: 16px;
  }
}
.aviso {
  margin: 4px auto 14px;
  max-width: 34ch;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in oklch, var(--accent-soft) 92%, transparent);
  font-size: 0.8rem;
  text-align: center;
}
.mensajes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.msg {
  max-width: 84%;
  padding: 7px 10px 5px;
  border-radius: 12px;
  box-shadow: 0 1px 1px rgb(60 45 30 / 0.16);
  animation: entra 0.22s var(--ease);
}
.msg p {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.msg.in {
  align-self: flex-start;
  background: var(--surface);
  border-top-left-radius: 4px;
}
.msg.out {
  align-self: flex-end;
  background: var(--accent-soft);
  border-top-right-radius: 4px;
}
.meta {
  display: block;
  text-align: right;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}
.pago {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 700;
  text-decoration: none;
}
.sistema,
.escribiendo {
  align-self: center;
  margin: 6px 0;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 92%, transparent);
  font-size: 0.78rem;
  color: var(--muted);
}
.escribiendo {
  align-self: flex-start;
  font-style: italic;
}
@keyframes entra {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.composer {
  flex: none;
  z-index: 6;
  width: 100%;
  padding: 4px 12px calc(10px + env(safe-area-inset-bottom));
}
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 6px 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
@media (hover: hover) {
  .chip:not(.spot):hover {
    background: var(--accent-soft);
  }
}
.chip.spot {
  background: var(--accent);
  color: var(--surface);
  outline: 3px solid color-mix(in oklch, var(--accent) 35%, transparent);
  outline-offset: 2px;
}
.entrada {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.entrada input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.btn.enviar {
  width: 44px;
  padding: 0;
}
.btn.enviar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Recorrido guiado: hoja inferior en el celular, tarjeta en la columna de texto en escritorio ------------ */
.tour {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(126px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: 536px;
  margin: 0 auto;
  padding: 16px 18px;
  border-radius: 20px;
}
.tour h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25em;
}
.tour p {
  margin: 0 0 0.35em;
  font-size: 0.92rem;
}
.tour .pista {
  font-weight: 700;
}
.tour-pie {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.puntos {
  display: flex;
  gap: 6px;
}
.puntos i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}
.puntos i.on {
  background: var(--accent);
}
.replay {
  position: fixed;
  right: 12px;
  top: calc(72px + env(safe-area-inset-top));
  z-index: 4;
}
@media (min-width: 900px) {
  .tour {
    position: static;
    max-width: 30em;
    margin: 0;
    padding: 24px 26px;
    border-radius: 24px;
  }
  .tour h2 {
    font-size: 1.4rem;
  }
  .tour p {
    font-size: 1rem;
  }
  .replay {
    position: static;
  }
}

/* Escenas para capturas: sin composer ni recorrido */
.captura .composer,
.captura .tour {
  display: none;
}
.captura .chat {
  padding-bottom: 24px;
}
