/* Demo independiente; misma cabecera compacta que el Panel de Sensores. */
:root { --demo-alto-cabecera: 60px; --demo-ancho-telefono: clamp(280px, calc((100svh - 184px) / 2), 360px); }
.demo-cabecera { min-height: var(--demo-alto-cabecera); display: flex; align-items: center; gap: 20px; padding: 7px max(28px, calc((100vw - 1320px) / 2)); background: #111b18; color: #f0f5f2; border-bottom: 1px solid #37463f; }
.demo-cabecera .marca { gap: 6px; }
.demo-cabecera .marca__simbolo { width: 32px; height: 32px; }
.demo-cabecera .marca__texto { gap: 4px; }
.demo-cabecera .marca__nombre { font-size: 1.5rem; }
.demo-cabecera .marca__descriptor { font-size: .35rem; }
.demo-cabecera__titulo { display: flex; align-items: center; min-height: 36px; padding-left: 20px; border-left: 1px solid #37463f; font-size: 1rem; font-weight: 700; letter-spacing: -.025em; }
.demo-cabecera__volver { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; margin-left: auto; color: #b7c6bd; text-decoration: none; font-size: .8125rem; }
.demo-cabecera__volver svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.demo-cabecera :focus-visible { outline-color: #79cfa0; }
.demo-bot__layout { width: min(80rem, calc(100% - 3.5rem)); min-height: calc(100svh - var(--demo-alto-cabecera)); padding-block: 1rem; display: grid; grid-template-columns: minmax(0, 1fr) var(--demo-ancho-telefono) minmax(0, 1fr); grid-template-areas: "intro prueba guia"; align-items: center; gap: clamp(1.5rem, 4vw, 4rem); }
.demo-bot__intro { grid-area: intro; max-width: 20rem; }
.demo-bot__guia { grid-area: guia; max-width: 20rem; }
.demo-bot h1 { font-size: clamp(1.75rem, 2.6vw, 2.5rem); font-weight: 680; line-height: 1.15; letter-spacing: -.035em; }
.demo-bot__descripcion { margin-top: 1.25rem; font-size: .95rem; color: var(--tinta-suave); max-width: 39ch; }
.demo-bot__aviso { margin-top: .8rem; color: var(--tinta-suave); font-size: .8rem; }
.demo-bot__pasos { margin: 0; padding-left: 1.3rem; display: grid; gap: 1.1rem; }
.demo-bot__pasos li { padding-left: .4rem; }
.demo-bot__pasos li::marker { color: var(--acento-oscuro); font-weight: 650; }
.demo-bot__pasos strong, .demo-bot__pasos span { display: block; }
.demo-bot__pasos strong { font-size: .94rem; font-weight: 650; }
.demo-bot__pasos span { color: var(--tinta-suave); font-size: .85rem; margin-top: .15rem; }
.demo-bot__contacto { margin-top: 2.3rem; padding-top: 1.25rem; border-top: 1px solid var(--borde); font-size: .92rem; }
.demo-bot__contacto .enlace-accion { font-size: .86rem; }
.demo-bot__prueba { grid-area: prueba; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.demo-telefono { position: relative; width: min(100%, var(--demo-ancho-telefono)); aspect-ratio: 1 / 2; flex: none; filter: drop-shadow(0 18px 20px #10291a20); }
.demo-telefono__marco { position: absolute; width: 100%; height: 100%; inset: 0; z-index: 4; pointer-events: none; }
.demo-pantalla { position: absolute; inset: 1.5% 4%; display: flex; flex-direction: column; overflow: hidden; border-radius: 38px; background: #e7eee8; color: #203429; color-scheme: light; }
.demo-statusbar { height: 32px; flex: none; padding: 7px 18px 0; display: flex; justify-content: space-between; align-items: center; background: #1e3027; color: #f0f5f2; font-size: 11px; font-weight: 650; }
.demo-chat__cabecera { flex: none; display: flex; gap: 9px; align-items: center; background: #1e3027; color: #f0f5f2; padding: 10px 14px 12px; }
.demo-chat__cabecera img { border-radius: 10px; flex: none; }
.demo-chat__cabecera h2 { font: 650 14px/1.4 var(--fuente); letter-spacing: -.01em; }
.demo-chat__cabecera p { color: #c0d1c6; font-size: 11px; line-height: 1.4; }
.demo-chat__historial { flex: 1; min-height: 0; padding: 15px 10px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #8ea294 #e7eee8; }
.demo-chat__historial:focus-visible { outline-offset: -3px; }
.demo-mensaje { width: fit-content; max-width: 94%; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px 12px 12px 3px; background: #fff; color: #233b2c; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; animation: demo-llegada 160ms cubic-bezier(.22, 1, .36, 1); }
.demo-mensaje--usuario { margin-left: auto; background: #c5e7ce; border-radius: 12px 12px 3px 12px; }
.demo-mensaje--sistema { margin-inline: auto; text-align: center; font-size: 11px; background: #dce5df; color: #3b5546; border-radius: 7px; padding: 5px 9px; }
.demo-mensaje__acciones { display: grid; gap: 5px; margin-top: 10px; white-space: normal; min-width: 180px; }
.demo-mensaje__acciones :is(button, a) { display: block; text-align: left; width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #c9d9ce; border-radius: 7px; background: #f0f6f2; color: #1b6037; font: 600 12px/1.4 var(--fuente); overflow-wrap: anywhere; text-decoration: none; }
.demo-mensaje__acciones button:disabled { color: #52675b; background: #eef0ee; border-color: #dde4df; cursor: default; }
.demo-mensaje__acciones button:disabled::after { content: ' · anterior'; font-weight: 400; font-size: 10px; }
.demo-mensaje img { display: block; max-height: 160px; width: 100%; object-fit: contain; margin-top: 8px; border-radius: 6px; }
.demo-mensaje__pie-foto { margin-top: 5px; font-size: 11px; color: #435c4d; }
.demo-chat__entrada { flex: none; display: flex; gap: 5px; padding: 8px; align-items: center; background: #fff; border-top: 1px solid #d6e0d9; }
.demo-chat__entrada input { width: 0; min-width: 0; flex: 1; font: 400 16px/1.4 var(--fuente); padding: 8px 4px; border: 0; background: transparent; color: #203429; caret-color: #087f36; border-radius: 4px; }
.demo-chat__entrada input::placeholder { color: #5d7064; opacity: 1; font-size: 13px; }
.demo-chat__entrada button { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 7px; }
.demo-chat__entrada .demo-chat__menu-boton { width: auto; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding-inline: 9px; background: #087f36; color: #fff; font-size: 12px; font-weight: 650; }
.demo-chat__enviar { background: #087f36; color: #fff; }
.demo-chat__entrada svg, .demo-bot__reinicio svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.demo-chat__entrada button:disabled { opacity: .5; cursor: default; }
.demo-homebar { height: 17px; background: #fff; flex: none; display: grid; place-items: center; }
.demo-homebar::before { content: ''; display: block; width: 100px; height: 4px; border-radius: 3px; background: #1e3027; }
.demo-chat__menu { position: absolute; inset: auto 9px 78px; max-height: calc(100% - 84px); overflow-y: auto; padding: 5px; border-radius: 12px; background: #fff; box-shadow: 0 8px 25px #17342435; z-index: 5; }
.demo-chat__menu button { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 44px; text-align: left; padding: 9px; background: none; color: #203429; border: 0; border-radius: 6px; }
.demo-chat__menu strong { width: 66px; font-size: 13px; color: #087f36; }
.demo-chat__menu span { font-size: 12px; }
.demo-pantalla :focus-visible { outline: 2px solid #087f36; outline-offset: 1px; }
.demo-bot__reinicio { text-align: center; max-width: 330px; margin-top: .65rem; }
.demo-bot__reinicio button { background: none; border: 0; padding: .5rem .75rem; font-size: .82rem; }
.demo-bot__reinicio p { font-size: .75rem; line-height: 1.5; color: var(--tinta-suave); }
.demo-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (hover: hover) and (pointer: fine) {
  .demo-mensaje__acciones :is(button:not(:disabled), a):hover, .demo-chat__menu button:hover { background: #dceee2; }
  .demo-chat__enviar:not(:disabled):hover { background: #06652b; }
  .demo-chat__entrada .demo-chat__menu-boton:not(:disabled):hover { background: #06652b; }
  .demo-cabecera__volver:hover { color: #79cfa0; }
}
.demo-chat__entrada .demo-chat__menu-boton[aria-expanded="true"] { background: #1e3027; }
.demo-chat__menu-boton:active { transform: translateY(1px); }
@keyframes demo-llegada { from { opacity: .5; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .demo-mensaje { animation: none; } }
@media (max-width: 960px) {
  .demo-bot__layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "prueba" "intro" "guia"; gap: 1.5rem; max-width: 38rem; padding-bottom: 2rem; }
  .demo-bot__prueba { min-height: calc(100svh - var(--demo-alto-cabecera) - 2rem); }
  .demo-bot__intro, .demo-bot__guia { width: 100%; max-width: 26rem; margin-inline: auto; }
  .demo-bot h1 { font-size: 1.65rem; }
  .demo-bot h1 br { display: none; }
  .demo-bot__descripcion { font-size: .94rem; margin-top: .75rem; }
  .demo-bot__aviso { font-size: .75rem; margin-top: .5rem; }
  .demo-bot__pasos { display: none; }
  .demo-bot__contacto { margin-top: 1.5rem; }
}
@media (max-width: 620px) {
  :root { --demo-alto-cabecera: 56px; }
  .demo-cabecera { padding: 5px 16px; gap: 10px; }
  .demo-cabecera .marca { gap: 3px; }
  .demo-cabecera .marca__simbolo { width: 26px; height: 26px; }
  .demo-cabecera .marca__nombre { font-size: 1.15rem; }
  .demo-cabecera .marca__descriptor { font-size: .27rem; }
  .demo-cabecera__titulo { padding-left: 10px; font-size: .875rem; }
  .demo-cabecera__volver span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .demo-bot .contenedor { width: calc(100% - 2.5rem); }
  .demo-telefono { width: min(100%, var(--demo-ancho-telefono), 320px); }
  .demo-pantalla { border-radius: 32px; }
  .demo-mensaje { font-size: 13px; max-width: 96%; }
}
@media (max-width: 350px) {
  .demo-chat__cabecera { padding-inline: 10px; }
  .demo-chat__historial { padding: 10px 7px; }
  .demo-mensaje__acciones { min-width: 165px; }
}
