/* Radar · asistente animado. Vidrio oscuro, esquinas rectas, rojo NSG. Solo se animan transform/opacity. */
.mani { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; --mx: 0px; --my: 0px; }

/* ---------- Robot ---------- */
.mani-robot { width: 46px; height: 46px; overflow: visible; }
.mani-robot.mini { width: 26px; height: 26px; flex: none; }
.mani-robot.grande { width: 72px; height: 72px; }
.mani-disco { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.mani-anillo { fill: none; stroke: rgba(243, 242, 242, .28); stroke-width: 1; }
.mani-ret { stroke: rgba(243, 242, 242, .16); stroke-width: 1; }
.mani-barrido { transform-origin: 32px 32px; animation: mani-gira 4s linear infinite; }
.mani-cuna { fill: var(--red); opacity: .38; }
.mani-filo { stroke: var(--red); stroke-width: 2; }
.mani-ojo { fill: var(--red); transform-box: fill-box; transform-origin: center; animation: mani-blip 4s ease-out infinite; }
.mani-ant { fill: var(--paper); }
@keyframes mani-gira { to { rotate: 360deg; } }
@keyframes mani-blip { 0%, 30% { opacity: .25; scale: 1; } 34% { opacity: 1; scale: 1.5; } 70%, 100% { opacity: .25; scale: 1; } }

/* Pensando: el barrido acelera */
.mani.pensando .mani-barrido { animation-duration: .9s; }
.mani.pensando .mani-ant { fill: var(--warn); }
/* Hablando: el blip late */
.mani.hablando .mani-ojo { animation: mani-habla .28s ease-in-out 6 alternate; }
@keyframes mani-habla { to { scale: 1.8; opacity: 1; } }

/* ---------- Botón flotante ---------- */
.mani-boton { position: relative; width: 64px; height: 64px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(243, 242, 242, .18); border-top: 2px solid var(--red); background: rgba(32, 30, 29, .82); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .65); cursor: pointer; animation: mani-flota 3.6s ease-in-out infinite; transition: transform .2s var(--suave, ease); }
.mani-boton:hover { transform: translateY(-3px) rotate(-3deg); }
.mani-boton:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.mani-boton[aria-expanded="true"] { animation: none; }
@keyframes mani-flota { 50% { translate: 0 -5px; } }

.mani-globo { position: relative; max-width: 220px; padding: 10px 14px; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--red); font: 600 13px var(--f-body); box-shadow: 0 14px 30px -18px rgba(0, 0, 0, .5); cursor: pointer; animation: mani-globo .5s var(--suave, ease) backwards; }
.mani-globo::after { content: ''; position: absolute; right: 24px; bottom: -7px; width: 12px; height: 12px; background: var(--white); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); rotate: 45deg; }
@keyframes mani-globo { from { opacity: 0; translate: 0 10px; } }

/* ---------- Panel ---------- */
.mani-panel { width: min(380px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: rgba(250, 249, 249, .9); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); border: 1px solid var(--borde-v, rgba(32, 30, 29, .16)); border-top: 3px solid var(--red); box-shadow: 0 30px 70px -28px rgba(0, 0, 0, .55); opacity: 0; translate: 0 14px; scale: .98; transform-origin: 100% 100%; transition: opacity .25s, translate .3s var(--suave, ease), scale .3s var(--suave, ease); }
.mani-panel.on { opacity: 1; translate: 0 0; scale: 1; }
.mani-panel[hidden] { display: none; }
.mani-cab { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--ink); color: var(--paper); }
.mani-cab b { flex: 1; font: 750 16px var(--f-head); font-stretch: 85%; letter-spacing: .01em; }
.mani-x { width: 32px; height: 32px; border: 1px solid rgba(243, 242, 242, .25); background: transparent; color: var(--paper); font-size: 20px; line-height: 1; cursor: pointer; }
.mani-x:hover { border-color: var(--red); }
.mani-cuerpo { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: auto; }
.mani-log { flex: 1; min-height: 160px; overflow-y: auto; padding: 14px 12px 6px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.mani-msg { max-width: 88%; padding: 9px 12px; font-size: 14px; line-height: 1.45; animation: mani-msg .35s var(--suave, ease) backwards; }
.mani-msg p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mani-msg.el { align-self: flex-start; background: var(--white); border: 1px solid var(--line); border-left: 3px solid var(--ink); }
.mani-msg.yo { align-self: flex-end; background: var(--ink); color: var(--paper); }
.mani-msg .btn { margin-top: 8px; }
.mani-enlaces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mani-enlaces .btn { margin: 0; }
@keyframes mani-msg { from { opacity: 0; translate: 0 8px; } }
.mani-msg.escribe { display: flex; gap: 5px; padding: 12px 14px; }
.mani-msg.escribe i { width: 6px; height: 6px; background: var(--muted); animation: mani-punto 1s ease-in-out infinite; }
.mani-msg.escribe i:nth-child(2) { animation-delay: .15s; }
.mani-msg.escribe i:nth-child(3) { animation-delay: .3s; }
@keyframes mani-punto { 50% { translate: 0 -4px; background: var(--red); } }

.mani-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px; }
.mani-chip { border: 1px solid var(--ink); background: var(--white); color: var(--ink); padding: 5px 10px; font: 600 12.5px var(--f-body); cursor: pointer; transition: background .15s, color .15s; }
.mani-chip:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.mani-chip:disabled { border-color: var(--ok); color: var(--ok); cursor: default; }
.mani-form { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line); }
.mani-form[hidden] { display: none; }
.mani-form textarea { min-height: 42px; max-height: 120px; resize: none; font-size: 14px; }
.mani-form .btn { min-width: 46px; font-size: 18px; }
.mani-pie { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--muted); }
.mani-link { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

.mani-ticket { display: grid; gap: 10px; padding: 12px; }
.mani-nota { margin: 0; padding: 8px 10px; border-left: 3px solid var(--red); background: var(--white); font-size: 13px; }
.mani-ticket textarea { min-height: 90px; }
.mani-acciones { display: flex; justify-content: space-between; gap: 8px; }
.mani-listo { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 26px 18px; }
.mani-listo h3 { margin: 0; font-size: 22px; }

/* ---------- Revisión de la lista (Publicar) ---------- */
.mani-aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-left-color: var(--red); margin: 0 0 10px; }
.mani-aviso small { color: var(--muted); }
.mani-cargando { display: inline-flex; align-items: center; gap: 8px; }
.mani-cargando .mani-ojo { animation: mani-barrido .9s ease-in-out infinite alternate; }
.item-row .mani-rev { grid-column: 1 / -1; display: grid; gap: 6px; padding: 10px 12px; margin: 2px 0 10px; background: rgba(255, 255, 255, .8); border: 1px dashed #B9B4B2; border-left: 3px solid var(--red); animation: mani-msg .4s var(--suave, ease) backwards; }
.item-row .mani-rev.ok { border-left-color: var(--ok); }
.mani-fila { display: grid; grid-template-columns: 96px 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.mani-fila .etiqueta { margin: 0; }
.mani-fila small { color: var(--muted); }
.mani-sug { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 2 / -1; }
.mani-fila.preg { grid-template-columns: 96px 1fr minmax(180px, 1fr); }
.mani-resp { display: flex; gap: 6px; }
.mani-resp input { min-height: 32px; padding: 4px 8px; font-size: 13.5px; }
.btn-mani { gap: 8px; }
.btn-mani .mani-robot { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .mani-fila, .mani-fila.preg { grid-template-columns: 1fr; gap: 4px; }
  .mani-sug { grid-column: auto; }
  .mani-boton { width: 56px; height: 56px; }
}
@media print { .mani { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .mani-ojo, .mani-barrido, .mani-boton, .mani.hablando .mani-boca, .mani.pensando .mani-ojo, .mani-msg, .mani-globo, .item-row .mani-rev, .mani-msg.escribe i, .mani-cargando .mani-ojo { animation: none; }
  .mani-panel { transition: none; }
  .mani-ojo { translate: none; }
}
.ticket-msg { margin: 0; max-width: 46ch; white-space: pre-wrap; }
.ticket-conv { max-height: 220px; overflow: auto; white-space: pre-wrap; font: 12px var(--f-mono); background: var(--white); padding: 8px; border: 1px solid var(--line); }
