/* ==========================================================================
   Demo del asistente de WhatsApp (se carga solo en /demo-bot)
   ========================================================================== */
.bot {
  max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto;
  padding: 0 var(--gutter) clamp(3rem, 6vw, 5rem);
  display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); align-items: start;
}
@media (min-width: 980px) { .bot { grid-template-columns: minmax(20rem, 26rem) 1fr; } }
.bot__izq { position: relative; }
@media (min-width: 980px) { .bot__izq { position: sticky; top: 5.5rem; } }

.tel {
  display: grid; grid-template-rows: auto 1fr auto;
  height: min(44rem, calc(100svh - 7rem)); min-height: 32rem;
  border-radius: 28px; overflow: hidden;
  background: #e8edf9;
  box-shadow: 0 0 0 10px var(--azul-noche), 0 0 0 11px rgb(255 255 255 / 0.12), 0 30px 70px -20px rgb(0 0 0 / 0.6);
  color: var(--tinta);
}
.tel__cab { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; background: var(--azul-hondo); color: #fff; }
.tel__avatar {
  width: 2.5rem; height: 2.5rem; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--luz); color: var(--tinta);
  font-family: var(--f-opt); font-variation-settings: "wdth" 125; font-weight: 850; font-size: 1.2rem;
}
.tel__quien { display: grid; line-height: 1.2; margin-right: auto; }
.tel__quien small { color: var(--sobre-azul-2); font-size: 0.8rem; }
.tel__reset { background: none; border: 0; color: #fff; padding: 0.5rem; border-radius: 6px; cursor: pointer; }
.tel__reset:hover { background: rgb(255 255 255 / 0.1); }

.tel__chat {
  overflow-y: auto; padding: 1rem 0.85rem 1.25rem; display: flex; flex-direction: column; gap: 0.4rem;
  background:
    radial-gradient(circle at 1px 1px, rgb(21 52 168 / 0.07) 1px, transparent 0) 0 0 / 18px 18px,
    #e8edf9;
  overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: #b8c4e6 transparent;
}
.tel__fecha {
  align-self: center; margin: 0 0 0.5rem; font-size: 0.75rem; color: var(--tinta-2);
  background: #fff; padding: 0.2rem 0.65rem; border-radius: 6px;
}
.tel__error { margin: auto; text-align: center; color: var(--rojo); font-weight: 700; padding: 1rem; }

.msg {
  position: relative; max-width: 86%; padding: 0.5rem 0.7rem 1.15rem; border-radius: 10px;
  font-size: 0.95rem; line-height: 1.42; box-shadow: 0 1px 1px rgb(10 18 51 / 0.12);
  animation: msg-in 0.35s var(--ease) both;
}
@keyframes msg-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .msg, .pasos__i, .ticket { animation: none; } }
.msg--bot { align-self: flex-start; background: #fff; border-top-left-radius: 3px; }
.msg--yo { align-self: flex-end; background: #d4f4df; border-top-right-radius: 3px; }
.msg__hora { position: absolute; right: 0.55rem; bottom: 0.25rem; font-size: 0.68rem; color: var(--tinta-2); font-family: var(--f-num); }
.msg--yo .msg__hora { color: #2f6b49; }
.msg--ficha { font-size: 0.9rem; }
.msg .pendiente { font-size: 0.78em; }
.msg--escribiendo { display: flex; gap: 4px; padding: 0.75rem 0.85rem; }
.msg--escribiendo span:not(.sr) { width: 7px; height: 7px; border-radius: 50%; background: #9aa6c9; animation: punto 1s infinite ease-in-out; }
.msg--escribiendo span:nth-child(2) { animation-delay: 0.15s; }
.msg--escribiendo span:nth-child(3) { animation-delay: 0.3s; }
@keyframes punto { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }

.msg--foto { padding: 0.35rem 0.35rem 1.15rem; }
.receta-mini {
  display: grid; gap: 5px; width: 9.5rem; padding: 0.7rem; border-radius: 6px; background: #fff;
  font-family: var(--f-num); font-size: 0.62rem; color: var(--tinta-2);
  box-shadow: inset 0 0 0 1px var(--linea-luz);
}
.receta-mini span { font-weight: 600; color: var(--azul); letter-spacing: 0.15em; }
.receta-mini i { height: 4px; border-radius: 2px; background: #cfd7ee; }
.receta-mini i:nth-of-type(2) { width: 70%; }
.receta-mini b { justify-self: end; font-weight: 600; color: var(--tinta); }

.opciones { align-self: flex-start; display: grid; gap: 0.3rem; width: 86%; margin: 0.1rem 0 0.35rem; }
.opcion {
  padding: 0.6rem 0.8rem; border-radius: 8px; border: 0; background: #fff; color: var(--azul);
  font: inherit; font-size: 0.92rem; font-weight: 700; text-align: center; cursor: pointer;
  box-shadow: 0 1px 1px rgb(10 18 51 / 0.12);
  transition: background-color 0.2s, transform 0.2s var(--ease);
}
.opcion:hover:not(:disabled) { background: #f0f4ff; transform: translateY(-1px); }
.opcion:disabled { cursor: default; color: #5f6a8f; background: rgb(255 255 255 / 0.55); box-shadow: none; }
.opcion.elegida { color: var(--verde); background: #fff; box-shadow: inset 0 0 0 2px var(--verde); }

.tel__input { display: flex; gap: 0.4rem; align-items: center; padding: 0.55rem; background: #f4f6fc; border-top: 1px solid var(--linea-luz); }
.tel__input input {
  flex: 1; min-width: 0; min-height: 2.75rem; padding: 0 0.95rem; border-radius: 999px;
  border: 1px solid var(--linea-luz); background: #fff; font: inherit; font-size: 0.95rem; color: var(--tinta);
  caret-color: var(--verde);
}
.tel__input input::placeholder { color: #5f6a8f; }
.tel__foto, .tel__enviar {
  width: 2.75rem; height: 2.75rem; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
}
.tel__foto { background: transparent; color: var(--tinta-2); }
.tel__foto.pide { background: var(--pendiente); color: var(--tinta); animation: pide 1.4s infinite var(--ease); }
@keyframes pide { 50% { box-shadow: 0 0 0 6px rgb(255 225 77 / 0.35); } }
@media (prefers-reduced-motion: reduce) { .tel__foto.pide { animation: none; } }
.tel__enviar { background: var(--verde); color: #fff; }

.bot__der { display: grid; gap: 1.25rem; min-width: 0; }
.panel {
  background: var(--azul-hondo); border-radius: var(--radio); padding: clamp(1.1rem, 2.5vw, 1.6rem);
  box-shadow: inset 0 0 0 1px var(--linea-azul);
}
.panel__t {
  font-family: var(--f-opt); font-variation-settings: "wdth" 112; font-weight: 750; font-size: 1.25rem; margin-bottom: 1rem;
  display: flex; align-items: baseline; gap: 0.6rem;
}
.panel__t small { font-family: var(--f-num); font-weight: 400; font-size: 0.75rem; color: var(--sobre-azul-2); }
.panel__t--osc { color: var(--tinta); }

.recorridos { display: grid; gap: 0.5rem; }
@media (min-width: 640px) { .recorridos { grid-template-columns: 1fr 1fr; } }
.recorrido-btn {
  display: grid; gap: 0.2rem; text-align: left; padding: 0.8rem 0.95rem; border-radius: 8px;
  border: 2px solid var(--linea-azul); background: transparent; color: #fff; font: inherit; cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}
.recorrido-btn:hover { border-color: var(--sobre-azul-2); }
.recorrido-btn[aria-pressed="true"] { border-color: var(--luz); background: var(--luz); color: var(--tinta); }
.recorrido-btn__t { font-weight: 700; }
.recorrido-btn__r { font-size: 0.88rem; color: var(--sobre-azul-2); line-height: 1.35; }
.recorrido-btn[aria-pressed="true"] .recorrido-btn__r { color: var(--tinta-2); }

.narrador { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 8px; background: var(--verde-hondo); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.15); }
.narrador__paso { font-family: var(--f-num); font-size: 0.8rem; color: var(--verde-claro); margin-bottom: 0.35rem; }
.narrador__nota { font-size: 1.05rem; margin-bottom: 0.9rem; }
.narrador__acc { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.narrador .btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.hora { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; margin-top: 1rem; font-size: 0.95rem; }
.hora select {
  min-height: 2.6rem; padding: 0 2rem 0 0.75rem; border-radius: 6px; border: 1px solid var(--linea-azul);
  background: var(--azul) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 0.5rem center / 1.1rem;
  color: #fff; font: inherit; appearance: none; cursor: pointer;
}

.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; max-height: 22rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--sobre-azul-2) transparent; }
.pasos__vacio, .tickets__vacio { color: var(--sobre-azul-2); font-size: 0.95rem; }
.pasos__i { display: grid; grid-template-columns: 1.9rem 1fr; gap: 0.7rem; align-items: start; font-size: 0.93rem; animation: msg-in 0.35s var(--ease) both; }
.pasos__i p { margin: 0.15rem 0 0; color: var(--sobre-azul-2); }
.pasos__n {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--f-num); font-size: 0.78rem; background: var(--azul); box-shadow: inset 0 0 0 1px var(--linea-azul);
}
.pasos__i--cliente .pasos__n { background: #d4f4df; color: var(--verde-hondo); }
.pasos__i--derivar .pasos__n { background: var(--pendiente); color: var(--tinta); }
.pasos code, .arbol code { font-family: var(--f-num); font-size: 0.85em; background: rgb(255 255 255 / 0.1); padding: 0.05em 0.35em; border-radius: 3px; }
.clave { background: var(--verde-test); color: var(--tinta); padding: 0 0.25em; border-radius: 3px; }

.tickets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.ticket { background: var(--luz); color: var(--tinta); border-radius: 8px; padding: 0.9rem 1rem; animation: msg-in 0.4s var(--ease) both; }
.ticket p { margin: 0.3rem 0 0; font-size: 0.92rem; }
.ticket__cab { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.ticket__suc { font-weight: 700; }
.ticket__estado { margin-left: auto; font-size: 0.82rem; font-weight: 700; }
.ticket--nuevo .ticket__estado { color: var(--verde); }
.ticket--espera .ticket__estado { color: var(--rojo); }
.ticket__cliente, .ticket__op { color: var(--tinta-2); }
.ticket__res { font-style: italic; }
.ticket__adj { color: var(--azul); font-weight: 700; }

.sector-chip {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 4px;
  background: var(--azul); color: #fff; font-size: 0.8rem; font-weight: 700; line-height: 1.4;
}
.sector-chip--mini { font-size: 0.7rem; padding: 0.05rem 0.4rem; vertical-align: 0.1em; }

.flujo { padding: clamp(1.25rem, 3.5vw, 2.5rem); overflow-x: auto; }
.arbol, .arbol ul { list-style: none; margin: 0; padding: 0; }
.arbol ul { padding-left: 1.4rem; border-left: 1px solid rgb(10 18 51 / 0.22); margin-left: 0.6rem; }
.arbol li { margin: 0.35rem 0; }
.arbol__n {
  display: inline-flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0.6rem; border-radius: 6px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--linea-luz); transition: background-color 0.3s, box-shadow 0.3s;
}
.arbol__n code { background: none; padding: 0; color: var(--azul); font-weight: 600; }
.arbol__n small { color: var(--tinta-2); font-size: 0.8rem; }
.arbol__n.visitado { background: #d4f4df; box-shadow: inset 0 0 0 1px var(--verde); }
.arbol__n.actual { background: var(--pendiente); box-shadow: inset 0 0 0 2px var(--tinta); }
.arbol__op { display: inline-block; font-size: 0.9rem; color: var(--tinta); margin-right: 0.5rem; }
.arbol__vuelta { font-family: var(--f-num); font-size: 0.78rem; color: var(--tinta-2); }

.flujo-grid { display: grid; gap: 2rem; }
@media (min-width: 900px) { .flujo-grid { grid-template-columns: 1fr 1fr; } }
.flujo-sec { padding: clamp(1.4rem, 3.5vw, 2.25rem); }
.sectores { margin: 0; display: grid; gap: 0.9rem; }
.sectores dd { margin: 0.3rem 0 0; color: var(--tinta-2); font-size: 0.95rem; }
.decisiones { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.7rem; }
.decisiones li::marker { color: var(--rojo); }
.flujo-sec__pie { margin-top: 1.5rem; font-size: 0.9rem; color: var(--tinta-2); }

.bot-cab .titulo { font-size: clamp(2rem, 1.2rem + 3vw, 3.5rem); max-width: 22ch; }
.bot-cab { padding-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.pag-bot .barra-movil { display: none; }
@media (max-width: 760px) { body.pag-bot { padding-bottom: 0; } }
