:root {
  --crema_fondo: #f5ebdc;
  --crema_tarjeta: #fff8ef;
  --marron_texto: #502314;
  --rojo_bk: #d62300;
  --naranja_bk: #ff8732;
  --sombra: rgba(80, 35, 20, 0.12);
  /* Barra inferior: emoji + campo + botón circular + safe area. */
  --altura-barra-chat: calc(4.85rem + max(0.75rem, env(safe-area-inset-bottom)));
  /* Hueco bajo la lista para que el scroll no quede tapado por la barra fija + picker emojis. */
  --padding-inferior-lista-chat: calc(var(--altura-barra-chat) + 0.55rem);
  /* +10% alto picker stickers */
  --padding-inferior-lista-chat-con-emoji: calc(var(--altura-barra-chat) + 3.9rem + 0.55rem);
  --naranja_burbuja_usuario: #ff8732;
  --cabecera_chat: rgba(255, 248, 239, 0.92);
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--crema_fondo);
  color: var(--marron_texto);
  position: relative;
}

/* Sin scroll del documento; la altura la marca visualViewport (--vv-height). */
body.app_shell_chat_fijo {
  overflow: hidden;
  min-height: 0;
  height: var(--vv-height, 100svh);
  max-height: var(--vv-height, 100svh);
}

.capa_fondo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--crema_fondo);
  background-image: url("/img/fondo_gordon.png");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

@media (min-width: 480px) {
  .capa_fondo {
    background-size: min(100%, 28rem) auto;
  }
}

/* Pantalla de bienvenida: fondo_gordon; al entrar en chat o cuestionario (shell fijo): fondo_chat. */
body.app_shell_chat_fijo .capa_fondo {
  background-image: url("/img/fondo_chat.png");
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 4.5rem));
  transform: translateX(-50%);
  z-index: 20;
  max-width: min(92vw, 22rem);
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  background: var(--marron_texto);
  color: #fff;
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 0.35rem 1rem var(--sombra);
}

.vista {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(0.75rem, env(safe-area-inset-top)) 1rem max(0.75rem, env(safe-area-inset-bottom));
}

.vista_bienvenida {
  justify-content: flex-start;
  min-height: 100dvh;
  min-height: var(--vv-height, 100dvh);
  /* Tarjeta al pie; la pregunta va posicionada aparte (absolute) para que no “flote” en el centro del flex. */
  position: relative;
}

.pregunta_dia_wrap {
  position: absolute;
  left: max(1rem, env(safe-area-inset-left));
  right: max(1rem, env(safe-area-inset-right));
  /* Bajar respecto al centro: anclar desde arriba ~mitad inferior del viewport, sin solapar la tarjeta en móviles bajos. */
  top: min(clamp(5.75rem, 48vh, 56dvh), calc(100svh - 19.5rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  z-index: 2;
  pointer-events: none;
}

.pregunta_dia_wrap .pregunta_dia {
  pointer-events: auto;
}

@media (max-width: 42rem) {
  .pregunta_dia_wrap {
    /* Móvil: subida neta ~1,5 cm (se bajó 0,5 cm más: mitad del último bajón de 1 cm). */
    top: max(
      0.5rem,
      calc(min(clamp(5.75rem, 48vh, 56dvh), calc(100svh - 19.5rem)) - 2.7cm)
    );
  }
}

.pregunta_dia {
  margin: 0;
  max-width: 22rem;
  font-size: calc(1.05rem + 2pt);
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: var(--marron_texto);
  text-wrap: balance;
}

.tarjeta_entrada {
  flex-shrink: 0;
  width: 100%;
  max-width: 22rem;
  /* Aire respecto al borde inferior (el padding de .vista ya incluye safe-area). */
  margin: auto 0 1rem;
  padding: 1.1rem 1rem 1.35rem;
  border-radius: 1rem;
  background: rgba(255, 248, 239, 0.94);
  box-shadow: 0 0.4rem 1.25rem var(--sombra);
  backdrop-filter: blur(6px);
  scrollbar-width: none;
}

.tarjeta_entrada::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.entrada_titulo {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--marron_texto);
}

.entrada_sub {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  line-height: 1.4;
  opacity: 0.92;
}

.nota_campo {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  opacity: 0.85;
}

.etiqueta {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* Separar el bloque teléfono del campo nombre (evita sensación “pegada”). */
.tarjeta_entrada .campo + .etiqueta {
  margin-top: 0.65rem;
}

.campo {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(80, 35, 20, 0.2);
  font-size: 1rem;
  background: #fff;
  color: var(--marron_texto);
}

.check_terminos {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.85rem 0 1rem;
  font-size: 0.78rem;
  line-height: 1.4;
  cursor: pointer;
}

.check_terminos input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.btn_primario {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--rojo_bk);
  color: #fff;
  box-shadow: 0 0.2rem 0 rgba(0, 0, 0, 0.12);
}

.btn_primario:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mensaje_error {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--rojo_bk);
  font-weight: 600;
}

/* —— Chat: capa fija fondo_gordon detrás (transparente aquí). —— */
/* `display:flex` gana al [hidden] por orden de hoja; forzar oculto cuando no toca el chat. */
#vista_chat[hidden],
#vista_cuestionario[hidden],
#vista_bienvenida[hidden] {
  display: none !important;
}

.vista_chat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: var(--vv-height, 100svh);
  max-height: var(--vv-height, 100svh);
  overflow: hidden;
  background: transparent;
}

.chat_cabecera {
  order: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem max(0.35rem, env(safe-area-inset-top));
  padding-left: max(0.35rem, env(safe-area-inset-left));
  padding-right: max(0.35rem, env(safe-area-inset-right));
  background: var(--cabecera_chat);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(80, 35, 20, 0.08);
}

.chat_btn_icono {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--marron_texto);
  cursor: pointer;
  font-size: 1.48rem;
  line-height: 1;
}

.chat_btn_icono:active {
  background: rgba(80, 35, 20, 0.08);
}

.chat_btn_menu {
  font-weight: 900;
  letter-spacing: 0.05em;
}

.chat_cabecera_centro {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.25rem;
}

.chat_marca_bk {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-sizing: border-box;
  padding: 0.12rem;
  box-shadow: 0 0.1rem 0.25rem rgba(0, 0, 0, 0.12);
  display: block;
}

.chat_cabecera_textos {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat_titulo_nombre {
  font-size: calc(1.1rem + 2pt);
  font-weight: 800;
  color: var(--marron_texto);
  line-height: 1.15;
}

.chat_estado_linea {
  font-size: calc(0.82rem + 2pt);
  color: rgba(80, 35, 20, 0.65);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chat_punto_online {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #2ecc71;
  flex-shrink: 0;
}

.chat_area_scroll {
  order: 1;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}

.lista_mensajes {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scroll-padding-bottom: 0.75rem;
  padding: 0.65rem 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: transparent;
}

.chat_sep_fecha_wrap {
  display: flex;
  justify-content: center;
  margin: 0.35rem 0 0.5rem;
  flex-shrink: 0;
}

.chat_sep_fecha {
  padding: 0.28rem 0.85rem;
  border-radius: 999px;
  font-size: calc(0.82rem + 2pt);
  font-weight: 700;
  color: rgba(80, 35, 20, 0.75);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0.05rem 0.2rem rgba(0, 0, 0, 0.06);
}

.msg {
  display: flex;
  width: 100%;
  align-items: flex-end;
  gap: 0.35rem;
  max-width: 100%;
}

.msg_user {
  justify-content: flex-end;
}

.msg_gordon {
  justify-content: flex-start;
  align-items: flex-start;
}

.msg_avatar {
  width: calc(2.6rem * 1.1 * 1.1 * 1.1);
  height: calc(2.6rem * 1.1 * 1.1 * 1.1);
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.2rem;
  border: none;
  box-shadow: none;
  background: transparent;
}

.msg_column {
  display: flex;
  flex-direction: column;
  max-width: min(62vw, 14.5rem);
  min-width: 0;
}

.msg_user .msg_column {
  align-items: flex-end;
}

.msg_burbuja {
  position: relative;
  width: fit-content;
  max-width: 100%;
  padding: 0.5rem 0.65rem 0.4rem;
  border-radius: 1.05rem;
  font-size: calc(1.02rem + 2pt);
  line-height: 1.42;
  word-break: break-word;
}

.msg_texto {
  margin: 0;
  white-space: pre-wrap;
}

.msg_link_resena {
  display: inline-block;
  margin-top: 0.32rem;
  color: #e54916;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.msg_meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  margin-top: 0.2rem;
  font-size: calc(0.78rem + 2pt);
  line-height: 1;
}

.msg_user .msg_meta {
  color: rgba(255, 255, 255, 0.92);
}

.msg_gordon .msg_meta {
  color: rgba(80, 35, 20, 0.45);
  justify-content: flex-end;
}

.msg_hora {
  font-variant-numeric: tabular-nums;
}

.msg_checks {
  font-size: calc(0.72rem + 2pt);
  letter-spacing: -0.12em;
  opacity: 0.95;
}

.msg_user .msg_burbuja {
  /* Por defecto, los stickers del usuario van "sin burbuja" (transparente). */
  background: transparent;
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}

/* Texto del usuario: burbuja naranja (solo cuando hay <p.msg_texto>). */
.msg_user .msg_burbuja:has(.msg_texto) {
  background: var(--naranja_burbuja_usuario);
}

.msg_gordon .msg_burbuja {
  background: #fff;
  color: var(--marron_texto);
  border: 1px solid rgba(80, 35, 20, 0.08);
  border-bottom-left-radius: 0.2rem;
  box-shadow: 0 0.06rem 0.2rem rgba(0, 0, 0, 0.06);
}

.msg_burbuja_escribiendo {
  padding: 0.55rem 0.85rem 0.5rem;
  min-width: 3.25rem;
}

.msg_escribiendo_dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-height: 1.15em;
}

.msg_escribiendo_dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: rgba(80, 35, 20, 0.42);
  animation: msg_escribiendo_dot 1.15s ease-in-out infinite;
}

.msg_escribiendo_dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.msg_escribiendo_dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes msg_escribiendo_dot {
  0%,
  70%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  35% {
    transform: translateY(-0.22rem);
    opacity: 1;
  }
}

.msg_user .msg_avatar {
  display: none;
}

.barra_envio {
  order: 3;
  flex-shrink: 0;
  position: relative;
  z-index: 15;
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  padding: 0.55rem 0.65rem max(0.55rem, env(safe-area-inset-bottom));
  padding-left: max(0.65rem, env(safe-area-inset-left));
  padding-right: max(0.65rem, env(safe-area-inset-right));
  background: var(--cabecera_chat);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(80, 35, 20, 0.08);
  box-shadow: 0 -0.12rem 0.5rem rgba(0, 0, 0, 0.05);
}

.btn_chat_emoji {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(80, 35, 20, 0.06);
  color: rgba(80, 35, 20, 0.55);
  font-size: 1.38rem;
  line-height: 1;
  cursor: pointer;
}

.btn_chat_emoji:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#emoji_picker_wrap[hidden] {
  display: none !important;
}

.emoji_picker_wrap {
  order: 2;
  flex-shrink: 0;
  position: relative;
  z-index: 16;
  display: flex;
  justify-content: stretch;
  padding: 0 max(0.35rem, env(safe-area-inset-left)) 0 max(0.35rem, env(safe-area-inset-right));
  background: rgba(255, 248, 239, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(80, 35, 20, 0.1);
  box-shadow: 0 -0.08rem 0.45rem rgba(0, 0, 0, 0.06);
}

.emoji_rapido_fila {
  display: flex;
  flex-direction: row;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 0.15rem;
  padding: 0.44rem 0.45rem;
  min-height: 2.92rem;
}

.emoji_rapido_btn {
  flex: 1 1 0;
  min-width: 0;
  max-width: 2.75rem;
  margin: 0 auto;
  padding: 0.25rem 0.1rem;
  border: none;
  border-radius: 0.45rem;
  background: transparent;
  font-size: 1.48rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.emoji_rapido_btn:active {
  background: rgba(80, 35, 20, 0.08);
  transform: scale(0.96);
}

.emoji_rapido_btn .emoji_rapido_img {
  display: block;
  width: 1.9rem;
  height: 1.9rem;
  margin: 0 auto;
  object-fit: contain;
}

.msg_sticker_bk {
  display: block;
  /* La mitad aprox. del tamaño anterior */
  max-height: 3.25rem;
  max-width: min(120px, 60vw);
  width: auto;
  height: auto;
  object-fit: contain;
}

.msg_sticker_bk_inline {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  margin: 0 0.08em;
  vertical-align: -0.22em;
  object-fit: contain;
}

.msg_texto_sticker_fallback {
  font-size: 1.375rem;
  line-height: 1.1;
  text-align: center;
}

.campo_mensaje {
  flex: 1;
  min-height: 2.5rem;
  max-height: 7.5rem;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 0.55rem 0.85rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(80, 35, 20, 0.12);
  font-size: calc(1.06rem + 2pt);
  font-family: inherit;
  background: #fff;
  color: var(--marron_texto);
}

.campo_mensaje:empty::before {
  content: attr(data-placeholder);
  color: rgba(80, 35, 20, 0.38);
  pointer-events: none;
}

.campo_mensaje[contenteditable="false"] {
  opacity: 0.62;
  pointer-events: none;
}

.emoji_compositor_bk {
  display: inline-block;
  width: 1.35em;
  height: 1.35em;
  margin: 0 0.08em;
  vertical-align: -0.3em;
  object-fit: contain;
  user-select: none;
}

.btn_enviar {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--naranja_burbuja_usuario);
  color: #fff;
  box-shadow: 0 0.12rem 0.25rem rgba(214, 35, 0, 0.25);
}

.chat_svg_enviar {
  margin-left: 0.1rem;
  margin-top: 0.05rem;
}

.btn_enviar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vista_cuestionario {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  height: var(--vv-height, 100svh);
  max-height: var(--vv-height, 100svh);
  padding: env(safe-area-inset-top) 0.75rem 0;
  overflow: hidden;
}

.cuestionario_contenedor {
  width: 100%;
  max-width: 24rem;
  max-height: 100%;
  margin: 0 auto;
  padding: 1rem 1.1rem max(1rem, env(safe-area-inset-bottom));
  border-radius: 1rem 1rem 0 0;
  background: rgba(255, 248, 239, 0.97);
  box-shadow: 0 -0.25rem 1rem var(--sombra);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cuestionario_intro {
  flex-shrink: 0;
  margin: 0 0 0.85rem;
  width: 100%;
}

.cuestionario_intro .msg_column {
  max-width: min(72vw, 16.5rem);
}

.cuestionario_cuerpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: 0.15rem;
}

.burbuja_gordon {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  background: #fff;
  border: 1px solid rgba(80, 35, 20, 0.1);
  font-size: calc(1rem + 2pt);
  line-height: 1.45;
}

.burbuja_gordon_ancho {
  max-width: none;
}

.form_cuestionario {
  margin: 0;
  padding: 0;
  border: 0;
}

.bloque_metrica {
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}

.bloque_metrica legend {
  font-weight: 800;
  font-size: calc(0.96rem + 2pt);
  margin-bottom: 0.45rem;
  padding: 0;
}

.opcion_chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.35rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(80, 35, 20, 0.15);
  background: #fff;
  cursor: pointer;
  font-size: calc(0.95rem + 2pt);
}

.opcion_chip:has(input:checked) {
  border-color: var(--rojo_bk);
  background: rgba(214, 35, 0, 0.06);
}

.opcion_chip input {
  accent-color: var(--rojo_bk);
}

#btn_enviar_cuestionario {
  margin-top: 0.25rem;
}

.vista_cuestionario .btn_primario {
  font-size: 1.06rem;
}

.vista_cuestionario .mensaje_error {
  font-size: 0.92rem;
}

.webchat_desktop_phone {
  display: contents;
}

.webchat_desktop_phone_bg,
.webchat_desktop_phone_frame {
  display: none;
}

.demo_contexto_desktop,
.demo_tour_accion {
  display: none;
}

@media (min-width: 760px) {
  body:not(.app_shell_chat_fijo) .demo_contexto_desktop {
    display: block;
    position: fixed;
    z-index: 2;
    top: calc(25vh - 135px);
    left: max(1.5rem, calc(50% - 43rem - 30px));
    width: min(22rem, calc(50vw - 16rem));
    box-sizing: border-box;
    padding: 1.55rem 1.65rem 1.65rem;
    border: 1px solid transparent;
    border-radius: 1.3rem;
    background: transparent;
    color: #fff;
  }

  .demo_contexto_kicker {
    margin: 0 0 1.25rem;
    color: #ff8732;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
  }

  .demo_contexto_destacado,
  .demo_contexto_cierre {
    margin: 0;
    color: #fff;
    font-size: clamp(1.45rem, 2.05vw, 2rem);
    font-weight: 800;
    line-height: 1.08;
  }

  .demo_contexto_texto {
    margin: 1.05rem 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    line-height: 1.52;
  }

  .demo_contexto_cierre {
    position: fixed;
    z-index: 2;
    top: calc(min(38vh, 22rem) + 0.8rem);
    left: max(3.15rem, calc(50% - 43rem - 3.5px));
    width: min(18.7rem, calc(50vw - 19.3rem));
    color: #ff8732;
    font-size: 1.22rem;
  }

  .demo_nombre_input {
    box-sizing: border-box;
    width: 10.5ch;
    min-height: 2.45rem;
    margin: 0;
    padding: 0.35rem 0;
    border: 0;
    border-bottom: 1px solid var(--marron_texto);
    border-radius: 0;
    outline: none;
    background: transparent;
    color: var(--marron_texto);
    font: inherit;
  }

  .demo_accion_desktop {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    position: fixed;
    z-index: 2;
    top: calc(min(38vh, 22rem) + 5rem);
    left: max(3.15rem, calc(50% - 43rem - 3.5px));
  }

  .demo_nombre_input::placeholder {
    color: rgba(80, 35, 20, 0.68);
  }

  .demo_nombre_input:focus {
    border-bottom-color: #ff8732;
    box-shadow: 0 0.25rem 0.5rem -0.45rem rgba(255, 135, 50, 0.9);
  }

  .btn_demo_desktop {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.68rem 0.95rem;
    border: 1px solid #f3aa9b;
    border-radius: 999px;
    background: #ed826e;
    color: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
  }

  .btn_demo_desktop:hover {
    border-color: #ffe0d9;
    background: #e87560;
    transform: translateY(-0.1rem);
  }

  .btn_demo_desktop:disabled {
    cursor: not-allowed;
    border-color: #f3aa9b;
    background: #ed826e;
    color: rgba(255, 247, 240, 0.82);
  }

  .demo_tour_accion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    z-index: 40;
    left: max(3.15rem, calc(50% - 43rem - 3.5px));
    bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  }

  .btn_demo_continuar {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0.72rem 1.1rem;
    border: 1px solid rgba(80, 35, 20, 0.18);
    border-radius: 999px;
    background: rgba(80, 35, 20, 0.28);
    color: rgba(255, 255, 255, 0.55);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
  }

  .btn_demo_continuar.is-ready {
    border-color: rgba(255, 255, 255, 0.28);
    background: #502314;
    color: #fff;
  }

  .btn_demo_continuar.is-ready:hover {
    background: #3d1a0e;
    transform: translateY(-0.08rem);
  }

  .demo_tour_modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 1.25rem;
  }

  .demo_tour_modal[hidden] {
    display: none;
  }

  .demo_tour_modal_backdrop {
    position: absolute;
    inset: 0;
    background: rgba(32, 14, 8, 0.55);
  }

  .demo_tour_modal_card {
    position: relative;
    z-index: 1;
    width: min(22rem, 100%);
    padding: 1.35rem 1.3rem 1.2rem;
    border-radius: 1rem;
    background: #fff8f3;
    box-shadow: 0 1.2rem 2.4rem rgba(32, 14, 8, 0.28);
    text-align: center;
  }

  .demo_tour_modal_titulo {
    margin: 0 0 1rem;
    color: #502314;
    font-size: 1.05rem;
    font-weight: 750;
    line-height: 1.35;
  }

  body:not(.app_shell_chat_fijo) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
      radial-gradient(circle at top, rgba(255, 255, 255, 0.78) 0%, rgba(244, 240, 234, 0.96) 40%, #e9e2d9 100%);
  }

  body:not(.app_shell_chat_fijo)::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    z-index: 0;
    height: min(38vh, 22rem);
    pointer-events: none;
    background:
      repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 0.08rem, transparent 0.08rem 1.25rem),
      linear-gradient(180deg, #502314 0%, #431c10 100%);
    border-bottom: 0.35rem solid #d62300;
  }

  body:not(.app_shell_chat_fijo) .capa_fondo {
    display: none;
  }

  body:not(.app_shell_chat_fijo) .vista_bienvenida {
    z-index: 1;
    width: min(25rem, calc(100vw - 3rem));
    height: min(51rem, calc(100vh - 3rem));
    min-height: 0;
    padding: 0.95rem 0.85rem 1rem;
    overflow: visible;
    background: transparent;
    filter: drop-shadow(0 1.35rem 2.6rem rgba(80, 35, 20, 0.22));
  }

  body:not(.app_shell_chat_fijo) .vista_bienvenida::before,
  body:not(.app_shell_chat_fijo) .vista_bienvenida::after {
    content: "";
    position: absolute;
    pointer-events: none;
  }

  body:not(.app_shell_chat_fijo) .vista_bienvenida::before {
    inset: 0.95rem 0.85rem 1rem;
    z-index: 1;
    border-radius: 2.6rem;
    background:
      var(--crema_fondo) url("/img/fondo_gordon.png") center top / cover no-repeat;
    box-shadow: inset 0 0 0 1px rgba(80, 35, 20, 0.08);
  }

  body:not(.app_shell_chat_fijo) .vista_bienvenida::after {
    inset: 0;
    z-index: 30;
    background: url("/img/movil_template.png") center / 100% 100% no-repeat;
  }

  body:not(.app_shell_chat_fijo) .pregunta_dia_wrap {
    top: 14.65rem;
    left: 1.95rem;
    right: 1.95rem;
  }

  body:not(.app_shell_chat_fijo) .pregunta_dia {
    max-width: 16rem;
    font-size: 1.05rem;
  }

  body:not(.app_shell_chat_fijo) .tarjeta_entrada {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 45%;
    transform: translateX(-50%);
    width: min(20.5rem, calc(100% - 4rem));
    max-width: none;
    max-height: calc(58% - 2.5rem);
    margin: 0;
    padding: 0.75rem 0.8rem 0.85rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 0.35rem 1rem rgba(80, 35, 20, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  body.app_webchat_chat_activo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background:
      radial-gradient(circle at top, rgba(255, 255, 255, 0.78) 0%, rgba(244, 240, 234, 0.96) 40%, #e9e2d9 100%);
  }

  body.app_webchat_chat_activo::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    z-index: 0;
    height: min(38vh, 22rem);
    pointer-events: none;
    background:
      repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 0.08rem, transparent 0.08rem 1.25rem),
      linear-gradient(180deg, #502314 0%, #431c10 100%);
    border-bottom: 0.35rem solid #d62300;
  }

  body.app_webchat_chat_activo .capa_fondo {
    display: none;
  }

  body.app_webchat_chat_activo .chat_cabecera {
    padding-top: 2.65rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 2.6rem 2.6rem 0 0;
  }

  body.app_webchat_chat_activo .chat_area_scroll {
    background: transparent;
  }

  body.app_webchat_chat_activo .barra_envio {
    padding-bottom: 0.8rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    border-radius: 0 0 2.6rem 2.6rem;
  }

  body.app_webchat_chat_activo .emoji_picker_wrap {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

@media (min-width: 760px) {
  body.app_webchat_chat_activo .webchat_desktop_phone {
    position: relative;
    z-index: 1;
    display: block;
    width: min(25rem, calc(100vw - 3rem));
    height: min(51rem, calc(100vh - 3rem));
    padding: 0.95rem 0.85rem 1rem;
    filter: drop-shadow(0 1.35rem 2.6rem rgba(80, 35, 20, 0.22));
  }

  body.app_webchat_chat_activo .webchat_desktop_phone_bg {
    position: absolute;
    inset: 0.95rem 0.85rem 1rem;
    z-index: 0;
    display: block;
    overflow: hidden;
    border-radius: 2.6rem;
    background-color: var(--crema_fondo);
    background-image: url("/img/fondo_chat.png");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: cover;
    box-shadow:
      inset 0 0 0 1px rgba(80, 35, 20, 0.08),
      0 0.6rem 1.4rem rgba(80, 35, 20, 0.12);
  }

  body.app_webchat_chat_activo .vista_chat {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    filter: none;
  }

  body.app_webchat_chat_activo .vista_chat::before {
    content: none;
  }

  body.app_webchat_chat_activo .webchat_desktop_phone_frame {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: block;
    pointer-events: none;
    background: url("/img/movil_template.png") center / 100% 100% no-repeat;
  }

  body.app_webchat_chat_activo .vista_cuestionario {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    max-height: none;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    justify-content: stretch;
    border-radius: 2.6rem;
  }

  body.app_webchat_chat_activo .cuestionario_contenedor {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    box-sizing: border-box;
    padding: 2.65rem 1.15rem 0.8rem;
    border-radius: 2.6rem;
    box-shadow: none;
    background: transparent;
    overflow: hidden;
  }

  body.app_webchat_chat_activo .cuestionario_intro .msg_column {
    max-width: min(78%, 16.5rem);
  }
}
