/* ============================================================
   EL CHAT DE MB (ronda 25) — el panel (#chat) y el botón flotante que lo
   llama (.fab--chat, en el lugar del de WhatsApp). La mecánica viene del
   chat de Hormigones Esperanza; la piel es la de la página: la noche, el
   vidrio, el azul de los paneles LED, el rojo de la línea del logo, Archivo
   y Barlow, todo redondeado.
   La firma: arriba del panel, la tira de LED del salón. Se prende desde el
   centro al abrir y, encendida más fuerte, marca cuánto falta.
   Se anima sólo transform y opacity. El panel no lleva desenfoque propio
   (anima); el velo de atrás sí, como el de la ficha, y en los peldaños bajos
   (html.vidrio-solido) tampoco.
   Capas: el botón en 70 (el de siempre), el panel en 90, arriba del nav (80).
   ============================================================ */
.chat, .fab--chat {
  --c-vidrio: linear-gradient(180deg, rgba(24, 28, 35, .965), rgba(11, 14, 18, .975));
  --c-filo: rgba(205, 214, 226, .16);
  --c-filo-2: rgba(205, 214, 226, .28);
  --c-canto: inset 0 1px 0 rgba(255, 255, 255, .16), inset 1px 0 0 rgba(255, 255, 255, .07), inset -1px 0 0 rgba(255, 255, 255, .07);
  --c-sombra: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 12px 32px -16px rgba(0, 0, 0, .7);
  --c-globo: rgba(255, 255, 255, .065);
  --c-error: #FF9C8F;
  --c-resorte: cubic-bezier(.22, 1, .36, 1);
}
.chat__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.chat__ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ─────────── el botón flotante: toma el lugar y las reglas del de WhatsApp (.fab, estilos.css) ─────────── */
.fab.fab--chat {
  width: 60px; height: 60px; display: block; border-radius: 0; background: none; box-shadow: none; color: var(--texto);
  pointer-events: none;
  /* esquivar() lo sube sobre un lugar libre: con translate, así no pisa el transform con el que la página lo esconde */
  translate: 0 calc(var(--sube, 0px) * -1);
  transition: transform .5s cubic-bezier(.3, 1.45, .55, 1), opacity .3s, translate .65s var(--c-resorte);
}
.fab.fab--chat:active { transform: none; }
.fab.fab--chat:hover svg { transform: none; }
.fab__b {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%;
  background: none; color: inherit; cursor: pointer; pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  scale: var(--achica, 1); transition: transform .45s var(--c-resorte), scale .65s var(--c-resorte);
}
/* el disco: el azul LED de los botones, con el «mb» en blanco y su raya roja (Jcoder eligió la B el 2/12) */
.fab__disco {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(120% 90% at 30% 8%, rgba(255, 255, 255, .35), transparent 55%), linear-gradient(180deg, #1C8BFF, #0057B8);
  box-shadow: 0 0 0 1.5px #A9D3FF, 0 0 26px 0 rgba(40, 140, 255, .85), 0 14px 30px -12px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.fab--chat .fab__disco svg { width: 38px; height: auto; margin-top: 4px; }
.fab--chat .fab__disco svg g { fill: #fff; }
/* el aro de luz que se abre cada tanto es el de siempre (.fab__aro, estilos.css) */
.fab__n {
  position: absolute; top: -3px; right: -3px; z-index: 2; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 10px; background: var(--rojo); color: #fff; font: 700 11px/1 var(--f-display); font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--noche), 0 0 12px rgba(228, 0, 0, .55); transition: opacity .3s ease, transform .45s var(--c-resorte);
}
.fab--chat.visto .fab__n { opacity: 0; transform: scale(.3); }
@media (hover: hover) and (pointer: fine) {
  .fab__b:hover { transform: scale(1.07); }
  .fab__b:hover .fab__disco { box-shadow: 0 0 0 1.5px #D4EAFF, 0 0 34px 2px rgba(60, 155, 255, .95), 0 14px 30px -12px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .45); }
}
.fab__b:active { transform: scale(.93); }
.fab__b:focus-visible { outline: 2px solid var(--azul-hi); outline-offset: 5px; }

/* el globo: vidrio al costado del botón (arriba en el celular) */
.fab__globo {
  position: absolute; right: calc(100% + 14px); top: 50%; display: flex; align-items: flex-start; gap: 4px;
  width: max-content; max-width: 290px; padding: 12px 6px 12px 16px; border-radius: 18px 18px 6px 18px;
  background: var(--c-vidrio); box-shadow: var(--c-canto), 0 0 0 1px var(--c-filo), var(--c-sombra);
  pointer-events: auto; cursor: pointer; opacity: 0; visibility: hidden;
  transform: translate3d(12px, -50%, 0) scale(.94); transform-origin: right center;
  transition: opacity .2s ease, transform .3s var(--c-resorte), visibility 0s .3s;
}
.fab--globo .fab__globo { opacity: 1; visibility: visible; transform: translate3d(0, -50%, 0); transition: opacity .3s ease, transform .55s var(--c-resorte), visibility 0s; }
.fab__t { line-height: 1.3; }
.fab__t strong { display: block; font: 650 15px/1.25 var(--f-display); font-stretch: 108%; letter-spacing: -.005em; color: #fff; }
.fab__t span { display: block; margin-top: 3px; font-size: 14px; color: var(--texto-2); }
.fab__x { position: relative; flex: none; display: grid; place-items: center; width: 28px; height: 28px; margin-top: -4px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--texto-2); cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.fab__x::before { content: ""; position: absolute; inset: -8px; }
.fab__x .chat__ic { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) { .fab__x:hover { background: rgba(255, 255, 255, .08); color: #fff; } }
.fab__x:focus-visible { outline: 2px solid var(--azul-hi); outline-offset: 1px; }

/* escondido (las reglas de la página, o el chat abierto): nada de adentro se toca ni queda a la vista */
html.chat-abierto .fab--chat { transform: scale(.6); opacity: 0; visibility: hidden; transition: transform .3s var(--ease), opacity .2s, visibility 0s .3s; }
html.con-3d .fab--chat.guardado :is(.fab__b, .fab__globo),
.fab--chat.fab--autos :is(.fab__b, .fab__globo),
html.chat-abierto .fab--chat :is(.fab__b, .fab__globo) { visibility: inherit; pointer-events: none; }

@media (max-width: 620px) {
  .fab.fab--chat { width: 56px; height: 56px; }
  .fab--chat .fab__disco svg { width: 35px; }
  .fab__globo { right: 0; top: auto; bottom: calc(100% + 12px); max-width: min(250px, calc(100vw - 32px)); padding: 10px 4px 10px 14px; transform: translate3d(0, 8px, 0) scale(.94); transform-origin: right bottom; }
  .fab--globo .fab__globo { transform: none; }
}

/* ─────────── el panel ─────────── */
.chat { position: fixed; inset: 0; z-index: 90; }
.chat[hidden] { display: none; }
/* la página no se mueve abajo del chat; el lugar de la barra queda, así nada cambia de ancho */
html.chat-abierto { overflow: hidden; scrollbar-gutter: stable; }
.chat__velo { position: absolute; inset: 0; background: rgba(4, 5, 7, .56); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); opacity: 0; transition: opacity .22s ease-in; }
html.vidrio-solido .chat__velo { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(4, 5, 7, .66); }
.chat.abierto .chat__velo { opacity: 1; transition: opacity .32s ease-out; }
.chat__panel {
  position: absolute; top: 16px; right: 16px; bottom: 16px; display: flex; flex-direction: column;
  width: min(440px, calc(100vw - 32px)); overflow: hidden; border-radius: 26px;
  background: var(--c-vidrio); box-shadow: var(--c-canto), 0 0 0 1px var(--c-filo), var(--c-sombra);
  color: var(--texto); font-family: var(--f-cuerpo);
  /* nace del botón, abajo a la derecha; se va más rápido de lo que llega */
  opacity: 0; transform: translate3d(18px, 26px, 0) scale(.94); transform-origin: 100% 100%;
  transition: opacity .2s ease-in, transform .26s cubic-bezier(.4, 0, .9, .5);
}
.chat.abierto .chat__panel { opacity: 1; transform: none; transition: opacity .3s ease-out, transform .48s var(--c-resorte); }
.chat :focus-visible { outline: 2px solid var(--azul-hi); outline-offset: 2px; }
.chat button, .chat a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.chat .chat__entrada:focus-visible, .chat .chat__campo input:focus-visible { outline: 0; }

.chat__cab { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 14px 14px 13px 16px; }
.chat__marca { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #0D1015; box-shadow: inset 0 0 0 1px var(--c-filo-2), 0 0 18px -6px rgba(40, 140, 255, .6); }
.chat__marca svg { width: 30px; height: auto; margin-top: 2px; }
.chat__tit h2 { margin: 0; font: 700 17px/1.15 var(--f-display); font-stretch: 115%; letter-spacing: .005em; color: #fff; }
.chat__sub { margin-top: 3px; font-size: 13.5px; line-height: 1.3; color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__avance { font: 600 11.5px/1 var(--f-display); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: var(--texto-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chat__avance b { font-weight: 700; color: #fff; }
.chat__x { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--c-filo); color: var(--texto); cursor: pointer; transition: background-color .2s ease, transform .4s var(--c-resorte); }
@media (hover: hover) and (pointer: fine) { .chat__x:hover { background: rgba(255, 255, 255, .1); transform: rotate(90deg); } }
.chat__x:active { transform: scale(.92); }

/* la tira de LED: el riel se prende desde el centro al abrir; adentro, la luz fuerte marca cuánto se contestó */
.chat__barra { position: relative; height: 2px; margin: 0 18px; border-radius: 2px; background: linear-gradient(90deg, rgba(95, 176, 255, 0), rgba(95, 176, 255, .28) 20%, rgba(95, 176, 255, .28) 80%, rgba(95, 176, 255, 0)); transform: scaleX(0); transition: transform .2s ease-in; }
.chat.abierto .chat__barra { transform: none; transition: transform .7s var(--c-resorte) .08s; }
.chat__barra i { position: absolute; inset: 0; display: block; border-radius: inherit; background: var(--led); box-shadow: 0 0 6px 1px rgba(95, 176, 255, .9), 0 0 16px 2px rgba(0, 120, 240, .55); transform: scaleX(0); transition: transform .8s var(--c-resorte); }

/* la conversación */
.chat__cuerpo { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px 10px; outline: none; scrollbar-width: thin; scrollbar-color: rgba(205, 214, 226, .2) transparent; }
.chat__log { display: flex; flex-direction: column; gap: 6px; }
.msg { position: relative; max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; text-wrap: pretty; }
.msg--of { align-self: flex-start; margin-left: 38px; border-top-left-radius: 6px; background: var(--c-globo); box-shadow: inset 0 0 0 1px rgba(205, 214, 226, .1), inset 0 1px 0 rgba(255, 255, 255, .06); color: var(--texto); }
/* la primera de cada tanda lleva el «mb» */
.msg--cabeza { margin-top: 10px; }
.chat__log > .msg--cabeza:first-child { margin-top: 0; }
.msg--cabeza::before { content: ""; position: absolute; left: -38px; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #0D1015 url(../assets/img/icono.svg) center / 30px no-repeat; box-shadow: inset 0 0 0 1px var(--c-filo-2); }
/* lo del visitante: la luz azul de los botones de la página */
.msg--yo {
  align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; padding: 10px 15px; border: 0; border-bottom-right-radius: 6px;
  background: linear-gradient(180deg, #1273E6, #0057B8); color: #fff; font: 500 16px/1.4 var(--f-cuerpo); text-align: left;
  box-shadow: 0 0 0 1px rgba(140, 195, 255, .45), 0 8px 22px -12px rgba(0, 87, 184, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
}
button.msg--yo { cursor: pointer; transition: transform .3s var(--c-resorte), box-shadow .25s ease; }
.msg__cambiar { display: grid; place-items: center; width: 0; overflow: hidden; opacity: 0; transition: width .3s var(--c-resorte), opacity .2s ease; }
.msg__lapiz { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) {
  button.msg--yo:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px #A9D3FF, 0 0 20px -2px rgba(60, 155, 255, .8), inset 0 1px 0 rgba(255, 255, 255, .34); }
  button.msg--yo:hover .msg__cambiar, button.msg--yo:focus-visible .msg__cambiar { width: 15px; opacity: .85; }
}
button.msg--yo:active { transform: scale(.97); }
.msg--viejo { opacity: .4; }
.msg__enl { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(95, 176, 255, .8); text-underline-offset: 3px; }

/* las unidades que coinciden: hasta tres tarjetitas que abren su ficha */
.msg--unidades { max-width: 100%; width: calc(100% - 38px); padding: 12px; }
.msg--unidades .msg__t { display: block; padding: 0 2px; }
.chat__unidades { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.unidad { display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 14px; background: #0D1015; box-shadow: inset 0 0 0 1px var(--c-filo); color: var(--texto); text-decoration: none; transition: transform .3s var(--c-resorte), box-shadow .25s ease; animation: chat-entra .45s var(--c-resorte) both; animation-delay: calc(var(--i, 0) * 60ms + 80ms); }
.unidad img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.unidad__t { display: flex; flex-direction: column; gap: 2px; padding: 8px 9px 10px; }
.unidad__t b { font: 650 13.5px/1.2 var(--f-display); font-stretch: 105%; color: #fff; }
.unidad__t small { font-size: 13px; line-height: 1.25; color: var(--texto-2); font-variant-numeric: tabular-nums; }
.unidad__t small span { white-space: nowrap; }
@media (hover: hover) and (pointer: fine) { .unidad:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(95, 176, 255, .8), 0 0 22px -6px rgba(40, 140, 255, .7); } }
.unidad:active { transform: scale(.97); }

.msg--nuevo { animation: chat-entra .42s var(--c-resorte) both; }
.msg--of.msg--nuevo { transform-origin: 0 100%; }
.msg--yo.msg--nuevo { transform-origin: 100% 100%; }
@keyframes chat-entra { from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.96); } }

/* «escribiendo» */
.chat__tipeo { display: inline-flex; align-items: center; gap: 5px; width: max-content; margin-top: 6px; padding: 14px 16px; animation: chat-entra .3s var(--c-resorte) both; }
.chat__tipeo[hidden] { display: none; }
.chat__tipeo i { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--azul-hi); animation: chat-punto 1s ease-in-out infinite; }
.chat__tipeo i:nth-child(2) { animation-delay: .15s; }
.chat__tipeo i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-punto { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* el turno del visitante: pastillas, casillas y volver */
.chat__turno { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin: 12px 0 4px 38px; }
.chat__turno:empty { display: none; }
.chat__pastillas { display: flex; flex-wrap: wrap; gap: 8px; }
.chat__pastilla {
  min-height: 44px; padding: 0 17px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--c-filo-2);
  color: var(--texto); font: 500 15.5px/1.2 var(--f-cuerpo); text-align: left; cursor: pointer;
  transition: background-color .2s ease, box-shadow .2s ease, transform .3s var(--c-resorte);
  animation: chat-entra .45s var(--c-resorte) both; animation-delay: calc(var(--i, 0) * 35ms);
}
@media (hover: hover) and (pointer: fine) { .chat__pastilla:hover { background: rgba(0, 120, 240, .16); box-shadow: inset 0 0 0 1px var(--azul-hi), 0 0 16px -6px rgba(40, 140, 255, .8); transform: translateY(-2px); } }
.chat__pastilla:active { background: rgba(0, 120, 240, .24); transform: scale(.96); }
.chat__pastilla--antes { box-shadow: inset 0 0 0 1px rgba(95, 176, 255, .65); }
.chat__pastilla--antes::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: var(--azul-hi); vertical-align: middle; }
.chat__atras { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px 0 2px; border: 0; background: none; color: var(--texto-2); font: 500 14.5px var(--f-cuerpo); cursor: pointer; transition: color .2s ease; animation: chat-entra .45s var(--c-resorte) .12s both; }
.chat__atras .chat__ic { width: 18px; height: 18px; transition: transform .3s var(--c-resorte); }
@media (hover: hover) and (pointer: fine) { .chat__atras:hover { color: #fff; } .chat__atras:hover .chat__ic { transform: translateX(-3px); } }
.chat__atras:active { color: #fff; }

/* las casillas del auto que se vende */
.chat__casillas { width: 100%; padding: 14px; border-radius: 18px; border-top-left-radius: 6px; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px var(--c-filo); animation: chat-entra .45s var(--c-resorte) both; }
.chat__campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chat__campo label { display: block; margin-bottom: 6px; font: 600 11px/1.2 var(--f-display); font-stretch: 110%; letter-spacing: .12em; text-transform: uppercase; color: var(--texto-2); }
.chat__opc { font-weight: 500; letter-spacing: .04em; text-transform: none; color: var(--texto-3); }
.chat__campo input { display: block; width: 100%; height: 46px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--c-filo-2); color: #fff; font: 500 16px/1 var(--f-cuerpo); outline: 0; transition: box-shadow .2s ease, background-color .2s ease; }
.chat__campo input::placeholder { color: #737A83; }
.chat__campo input:focus { background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 1.5px var(--azul-hi); }
.chat__campo input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--c-error); }
.chat__err { margin-top: 5px; font-size: 13px; line-height: 1.3; font-weight: 500; color: var(--c-error); }
.chat__err:empty { display: none; }
.chat__seguir { margin-top: 12px; }

/* el final */
.chat__pedido { width: 100%; padding: 16px; border-radius: 18px; border-top-left-radius: 6px; background: var(--c-globo); box-shadow: inset 0 0 0 1px rgba(205, 214, 226, .1), inset 0 1px 0 rgba(255, 255, 255, .06); animation: chat-entra .5s var(--c-resorte) both; }
.chat__pedido-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chat__rot { margin: 0; font: 600 11.5px/1.2 var(--f-display); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; color: #fff; }
.chat__rot--tenue { color: var(--texto-2); }
.chat__rot--msj { margin-top: 14px; }
.chat__resumen { display: grid; gap: 0; margin: 10px 0 0; }
.chat__resumen > div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid rgba(205, 214, 226, .09); font-size: 14.5px; line-height: 1.35; }
.chat__resumen dt { color: var(--texto-2); }
.chat__resumen dd { margin: 0; color: #fff; overflow-wrap: anywhere; }
.chat__msj { margin: 8px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .3); box-shadow: inset 2px 0 0 var(--azul-hi); font: 400 15px/1.55 var(--f-cuerpo); color: var(--texto); overflow-wrap: anywhere; }
.chat__acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }

.chat__nuevo { position: sticky; bottom: 6px; z-index: 2; display: flex; align-items: center; min-height: 44px; margin: 8px auto 0; padding: 0 16px; border: 0; border-radius: 999px; background: var(--blanco); color: var(--chapa); font: 600 14px var(--f-cuerpo); cursor: pointer; box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .7); animation: chat-entra .35s var(--c-resorte) both; }
.chat__nuevo[hidden] { display: none; }

/* escribir: el campo en pastilla y el botón redondo */
.chat__escribir { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 12px 14px 4px; border-top: 1px solid var(--c-filo); }
.chat__escribir[hidden] { display: none; }
.chat__marco { position: relative; display: block; min-width: 0; }
.chat__entrada { display: block; width: 100%; height: 48px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(0, 0, 0, .3); box-shadow: inset 0 0 0 1px var(--c-filo-2); color: #fff; font: 400 16px/1 var(--f-cuerpo); outline: 0; transition: box-shadow .2s ease, background-color .2s ease; }
.chat__entrada::placeholder { color: #808790; }
.chat__entrada:focus { background: rgba(0, 0, 0, .38); box-shadow: inset 0 0 0 1.5px var(--azul-hi); }
.chat__entrada[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--c-error); }
/* una pregunta sin pastillas (el nombre, la localidad, el usado): el campo es la manera de contestar.
   Aparece el rótulo y el canto se enciende como un panel LED, y queda tenue mientras dura la pregunta */
.chat__rotulo { grid-column: 1 / -1; display: none; align-items: center; gap: 3px; margin: 0 0 -2px 18px; font: 600 11px/16px var(--f-display); font-stretch: 112%; letter-spacing: .13em; text-transform: uppercase; color: var(--azul-hi); }
.chat__rotulo .chat__ic { width: 15px; height: 15px; stroke-width: 2; animation: chat-asoma 1.1s ease-in-out .45s 2 both; }
.chat__escribir--solo .chat__rotulo { display: flex; animation: chat-entra .45s var(--c-resorte) both; }
.chat__marco::after { content: ""; position: absolute; inset: -4px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(95, 176, 255, .45), 0 0 24px -4px rgba(40, 140, 255, .6); opacity: 0; pointer-events: none; }
.chat__escribir--solo .chat__marco::after { animation: chat-enciende 1.5s var(--c-resorte) both; }
.chat__escribir--solo .chat__entrada:not(:focus):not([aria-invalid="true"]) { box-shadow: inset 0 0 0 1.5px rgba(95, 176, 255, .8); }
.chat__escribir--solo .chat__marco:has([aria-invalid="true"])::after { animation: none; opacity: 0; }
@keyframes chat-enciende { 0% { opacity: 0; transform: scale(1.06); } 35% { opacity: 1; transform: none; } 100% { opacity: .5; transform: none; } }
@keyframes chat-asoma { 50% { transform: translate3d(0, 3px, 0); } }
.chat__mandar { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: linear-gradient(180deg, #1273E6, #0057B8); color: #fff; cursor: pointer; box-shadow: 0 0 0 1px rgba(140, 195, 255, .5), 0 0 16px -4px rgba(40, 140, 255, .8); transition: transform .3s var(--c-resorte), box-shadow .2s ease; }
.chat__mandar .chat__ic { stroke-width: 2; transition: transform .3s var(--c-resorte); }
@media (hover: hover) and (pointer: fine) { .chat__mandar:hover { box-shadow: 0 0 0 1px #A9D3FF, 0 0 24px -2px rgba(60, 155, 255, .9); } .chat__mandar:hover .chat__ic { transform: translateX(2px); } }
.chat__mandar:active { transform: scale(.94); }
.chat__error { grid-column: 1 / -1; font-size: 13.5px; font-weight: 500; color: var(--c-error); }
.chat__error:empty { display: none; }
.chat__pie { padding: 0 10px calc(4px + env(safe-area-inset-bottom)); }
.chat__pie-a, .chat__pie-b { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; }
.chat__pie-b { justify-content: flex-start; font-size: 14px; color: var(--texto); }
.chat__pie-b span { padding: 0 4px; }
.chat__pie [hidden] { display: none; }
.chat__enl { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--texto-2); font: 500 14px var(--f-cuerpo); cursor: pointer; text-decoration: underline; text-decoration-color: rgba(183, 189, 197, .45); text-underline-offset: 3px; transition: color .2s ease, text-decoration-color .2s ease; }
@media (hover: hover) and (pointer: fine) { .chat__enl:hover { color: #fff; text-decoration-color: var(--azul-hi); } }
.chat__enl:active { color: #fff; }
.chat__enl--fuerte { color: #fff; text-decoration-color: var(--azul-hi); }

/* celular: pantalla completa, sigue a la pantalla visible cuando sale el teclado */
@media (max-width: 620px) {
  .chat__panel { top: var(--chat-y, 0px); right: 0; bottom: auto; left: 0; width: 100%; height: 100vh; height: var(--chat-alto, 100dvh); border-radius: 0; box-shadow: none; transform: translate3d(0, 36px, 0); transform-origin: center bottom; }
  .chat__cab { gap: 10px; padding: 10px 10px 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .chat__marca { width: 42px; height: 42px; }
  .chat__marca svg { width: 27px; }
  .chat__cuerpo { padding: 16px 12px 8px; }
  .msg { max-width: 88%; }
  .msg--of { margin-left: 34px; }
  .msg--unidades { width: calc(100% - 34px); padding: 10px; }
  .chat__unidades { gap: 6px; }
  .unidad__t { padding: 7px 7px 9px; }
  .unidad__t b { font-size: 13px; }
  .unidad__t small { font-size: 12.5px; }
  .msg--cabeza::before { left: -34px; width: 26px; height: 26px; background-size: 28px; }
  .chat__turno { margin-left: 34px; }
  .chat__resumen > div { grid-template-columns: 7.2em minmax(0, 1fr); }
  .chat__escribir { padding: 10px 10px 2px; }
  .chat__pie { padding: 0 4px calc(2px + env(safe-area-inset-bottom)); }
}
