/* Helix · panel v5 · agente: todo cuelga de html.hx-v5 (plan: docs/plans/panel-v5-fd90).
   Dos piezas:
   1. La mascota por capas (helix-v5-mascota.js), componente que usan todas las pantallas v5: rig, pose
      fija y vídeo con alfa. Port del CSS v14 de prototipo/rig_parts.py con clases hx5-*.
   2. El panel de Helix Agent del prototipo (cabecera «Destacado», bienvenida con 4 sugerencias, turnos
      firmados por la mascota, «Pensando…», tarjeta de cambios y cápsula de escribir). Decora el DOM que
      pintan helix-agent.js y helix-asistente.js (helix-v5-agente.js añade lo que falta) y solo maqueta en
      escritorio: por debajo de 1024 px el agente sigue como hoy (los añadidos van ocultos). */

/* ═══ 1 · Mascota por capas ═══════════════════════════════════════════════════════════════ */
html.hx-v5 .hx5-rig { position: relative; display: inline-block; width: var(--s); height: var(--s); flex-shrink: 0; vertical-align: middle; }
html.hx-v5 .hx5-rig > svg { position: absolute; inset: -18%; width: 136%; height: 136%; overflow: visible;
  animation: hx5-rg-flota var(--fl, 3.6s) ease-in-out var(--fd, 0s) infinite alternate; }
html.hx-v5 .hx5-rig .hx5-mv { transform-box: view-box; transform-origin: 50% 60%; transition: transform .7s cubic-bezier(.34, 1.4, .5, 1);
  transform: translate(var(--mx, 0px), var(--my, 0px)) rotate(var(--mr, 0deg)) scale(var(--ms, 1)); }
html.hx-v5 .hx5-rig .hx5-rn, html.hx-v5 .hx5-rig .hx5-rb { filter: drop-shadow(0 2.5px 3px rgba(0, 0, 0, .35)); }
/* Mismo cuerpo en los dos temas: el oscuro con el tema oscuro, el blanco con el claro */
html.hx-v5 .hx5-rig .hx5-rb { display: none; }
html.hx-v5:not([data-theme="dark"]) .hx5-rig .hx5-rn { display: none; }
html.hx-v5:not([data-theme="dark"]) .hx5-rig .hx5-rb { display: inline; filter: drop-shadow(0 2.5px 3.5px rgba(40, 30, 60, .22)); }
/* aro: la mitad de arriba va detrás del cuerpo y la de abajo delante */
html.hx-v5 .hx5-rig .hx5-aro { transform-box: view-box; transform-origin: 50% 55%;
  transform: rotate(calc(var(--rot) + var(--ar, 0deg))) scaleY(var(--ay, 1)); transition: transform 1.2s cubic-bezier(.45, 0, .2, 1), opacity .6s; }
html.hx-v5 .hx5-rig .hx5-aro ellipse { fill: none; vector-effect: non-scaling-stroke; }
html.hx-v5 .hx5-rig .hx5-tubo { stroke: url(#hx5-rg-aro); stroke-width: calc(var(--s) * .028 + .6px); filter: url(#hx5-rg-neon); }
html.hx-v5 .hx5-rig .hx5-nucleo { stroke: #fff; stroke-width: calc(var(--s) * .008 + .3px); opacity: .75; }
html.hx-v5 .hx5-rig .hx5-destello { stroke: #fff; stroke-width: calc(var(--s) * .03 + .8px); stroke-linecap: round; stroke-dasharray: 7 93;
  filter: url(#hx5-rg-neon); animation: hx5-rg-orbita var(--velb, 3.6s) linear var(--od, 0s) infinite; }
html.hx-v5:not([data-theme="dark"]) .hx5-rig .hx5-nucleo { opacity: .45; }
/* ojos: píldora, arco feliz, línea dormida y círculo de sorpresa */
html.hx-v5 .hx5-rig .hx5-ojo * { fill: #fff; stroke: #fff; transform-box: fill-box; transform-origin: center;
  transition: opacity .16s, transform .22s cubic-bezier(.34, 1.5, .5, 1); }
html.hx-v5 .hx5-rig .hx5-op, html.hx-v5 .hx5-rig .hx5-oc { stroke: none; }
html.hx-v5 .hx5-rig .hx5-oa, html.hx-v5 .hx5-rig .hx5-ol { fill: none; stroke-width: 2.4; stroke-linecap: round; }
html.hx-v5 .hx5-rig .hx5-oa, html.hx-v5 .hx5-rig .hx5-ol, html.hx-v5 .hx5-rig .hx5-oc { opacity: 0; transform: scale(.4); }
html.hx-v5 .hx5-rig .hx5-ojos { transform-box: view-box; transition: transform .45s cubic-bezier(.34, 1.3, .5, 1);
  transform: translate(var(--lx, 0px), var(--ly, 0px)); }
html.hx-v5 .hx5-rig .hx5-ci .hx5-op { transform: scaleY(.08); }
html.hx-v5 .hx5-rig[data-e="feliz"] .hx5-op, html.hx-v5 .hx5-rig .hx5-gu .hx5-op { opacity: 0; transform: scale(.4); }
html.hx-v5 .hx5-rig[data-e="feliz"] .hx5-oa, html.hx-v5 .hx5-rig .hx5-gu .hx5-oa { opacity: 1; transform: none; }
html.hx-v5 .hx5-rig[data-e="dormido"] .hx5-op { opacity: 0; transform: scale(.4); }
html.hx-v5 .hx5-rig[data-e="dormido"] .hx5-ol { opacity: .7; transform: none; }
html.hx-v5 .hx5-rig[data-e="sorpresa"] .hx5-op { opacity: 0; transform: scale(.4); }
html.hx-v5 .hx5-rig[data-e="sorpresa"] .hx5-oc { opacity: 1; transform: none; }
html.hx-v5 .hx5-rig[data-e="dormido"] .hx5-aro { opacity: .35; }
html.hx-v5 .hx5-rig[data-e="dormido"] .hx5-destello { animation-duration: 9s; }
/* reflejo que barre el visor */
html.hx-v5 .hx5-rig .hx5-barrido { fill: #fff; opacity: 0; transform-box: view-box; transform: skewX(-22deg); }
html.hx-v5 .hx5-rig.hx5-barre .hx5-barrido { animation: hx5-rg-barre 1.1s cubic-bezier(.45, 0, .2, 1); }
@keyframes hx5-rg-orbita { to { stroke-dashoffset: -100; } }
@keyframes hx5-rg-barre { 0% { opacity: 0; transform: skewX(-22deg) translateX(0); } 20% { opacity: .16; }
  100% { opacity: 0; transform: skewX(-22deg) translateX(130px); } }
@keyframes hx5-rg-flota { from { transform: translateY(calc(var(--s) * .025)); } to { transform: translateY(calc(var(--s) * -.035)); } }

/* Pose fija (tarjeta «Helix Agent propone»): mira al mensaje con cara de pregunta, flota e inclina la cabeza */
html.hx-v5 .hx5-mpose { position: relative; display: inline-block; width: var(--s); height: var(--s); flex-shrink: 0; }
html.hx-v5 .hx5-mpose .hx5-mp-in { position: absolute; inset: 0; transform-origin: 50% 75%; animation: hx5-mp-lee 7s ease-in-out infinite; will-change: transform; }
html.hx-v5 .hx5-mpose img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35)); }
html.hx-v5 .hx5-mpose .hx5-pb { opacity: 0; }
html.hx-v5:not([data-theme="dark"]) .hx5-mpose .hx5-po { opacity: 0; }
html.hx-v5:not([data-theme="dark"]) .hx5-mpose .hx5-pb { opacity: 1; filter: drop-shadow(0 10px 14px rgba(40, 30, 60, .2)); }
html.hx-v5 .hx5-mpose .hx5-mp-brillo { position: absolute; inset: 0; border-radius: 50%; opacity: 0; mix-blend-mode: screen;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .55), transparent 70%);
  transform: translate(-28%, 18%) scale(.35); animation: hx5-mp-destello 7s ease-in-out infinite; }
@keyframes hx5-mp-lee { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-3px) rotate(2.5deg); }
  55% { transform: translateY(-4px) rotate(3.5deg); } 80% { transform: translateY(-1.5px) rotate(1deg); } }
@keyframes hx5-mp-destello { 0%, 50%, 100% { opacity: 0; transform: translate(-30%, 20%) scale(.3); } 62% { opacity: .45; }
  78% { opacity: 0; transform: translate(34%, 6%) scale(.3); } }

/* Vídeo con alfa: se funde con lo de detrás con una máscara radial; oscuro y blanco van en el mismo instante */
html.hx-v5 .hx5-mvid { position: relative; display: inline-block; width: var(--s); height: var(--s); flex-shrink: 0; }
html.hx-v5 .hx5-mvid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%); mask-image: radial-gradient(closest-side, #000 56%, transparent 100%); }
html.hx-v5 .hx5-mvid .hx5-vb { opacity: 0; }
html.hx-v5:not([data-theme="dark"]) .hx5-mvid .hx5-vo { opacity: 0; }
html.hx-v5:not([data-theme="dark"]) .hx5-mvid .hx5-vb { opacity: 1; }
/* Recién cambiado el tema, el vídeo del tema nuevo aún se descarga (helix-v5-mascota.js): se ven los dos y el
   nuevo, todavía sin imagen, no tapa al anterior. */
html.hx-v5 .hx5-mvid.hx5-espera video { opacity: 1; }

/* «Reducir movimiento»: la mascota se queda quieta (el motor tampoco lanza gestos). El !important es el
   patrón de la casa para apagar animaciones de golpe. */
@media (prefers-reduced-motion: reduce) {
  html.hx-v5 .hx5-rig *, html.hx-v5 .hx5-rig > svg, html.hx-v5 .hx5-mpose * { animation: none !important; transition: none !important; }
}

/* ═══ 2 · Panel de Helix Agent ════════════════════════════════════════════════════════════ */
html.hx-v5[data-theme="dark"] { --hx5ag-lgb: rgba(34, 34, 42, .82); --hx5ag-capa: #221F27; --hx5ag-orb: rgba(255, 255, 255, .14); }
html.hx-v5:not([data-theme="dark"]) { --hx5ag-lgb: rgba(255, 255, 255, .86); --hx5ag-capa: #FFFFFF; --hx5ag-orb: rgba(255, 255, 255, .14); }

/* Lo que añade helix-v5-agente.js solo se ve en escritorio: en móvil el agente sigue como hoy. */
html.hx-v5 .hx5ag-halo, html.hx-v5 .hx5ag-orbita, html.hx-v5 .hx5ag-hvs, html.hx-v5 .hx5ag-est, html.hx-v5 .hx5ag-autor,
html.hx-v5 .hx5ag-pm, html.hx-v5 .hx5ag-pt, html.hx-v5 .hx5ag-bien, html.hx-v5 .hx5ag-sug, html.hx-v5 .hx5ag-corto,
html.hx-v5 .hx5ag-aico { display: none; }
html.hx-v5 .hx5ag-val { display: contents; }

@media (min-width: 1024px) {
  /* ── Lanzador: en escritorio se abre desde «Pregúntale a Helix» (barra lateral) o con ⌘J ── */
  html.hx-v5 .helix-app .hxag-lanzador { display: none; }
  /* helix-agent.css reserva 86 px en la fila de acciones del lead para el botón flotante: sin él, fuera.
     La Bandeja v5 puede ajustar ese hueco con --hx5-ab-pr sin pelear especificidad. */
  html.hx-v5 .helix-app .helix-shell.inbox-active:not(.hxag-abierto):has(~ .hxag-lanzador:not([hidden])) .helix-split-detail .helix-lead-detail-actionbar {
    padding-right: var(--hx5-ab-pr, 12px); }

  /* ── Panel: cristal del prototipo, radio 30, sombra con el color del acento ── */
  html.hx-v5 .helix-app .hxag-panel {
    border: 0; border-radius: 30px; color: var(--v5-t1); background: var(--hx5ag-lgb);
    -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%);
    box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), var(--v5-shg);
    transform: translateX(calc(100% + 30px));
    transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .25s var(--v5-eo), visibility 0s linear .5s; }
  html.hx-v5 .helix-app .hxag-panel.is-abierto { transform: none; transition-delay: 0s; }

  /* ── Cabecera «Destacado»: halo, órbita, UNA mascota, nombre y estado; saldo y cerrar arriba ── */
  html.hx-v5 .helix-app .hxag-cab { position: relative; isolation: isolate; overflow: hidden; flex-direction: column; align-items: center;
    justify-content: flex-start; gap: 4px; min-height: 0; padding: 22px 16px 16px; border-bottom: 0;
    background: radial-gradient(60% 75% at 50% 0%, color-mix(in srgb, var(--v5-acc) 30%, transparent), transparent 100%); }
  html.hx-v5 .helix-app .hxag-cab-mascota { display: none; }
  /* El halo es pequeño y se desvanece antes del borde: grande, el desenfoque se cortaba en recto. */
  html.hx-v5 .helix-app .hx5ag-halo { display: block; position: absolute; top: -70px; left: 50%; z-index: -1; width: 200px; height: 200px;
    margin-left: -100px; border-radius: 50%; opacity: .55; filter: blur(38px); pointer-events: none;
    background: conic-gradient(from 0deg, rgba(0, 122, 255, 0), rgba(0, 122, 255, .45), rgba(184, 75, 255, .45), rgba(255, 107, 53, .5), rgba(255, 59, 48, .35), rgba(0, 122, 255, 0));
    animation: hx5-gira 14s linear infinite; }
  html.hx-v5 .helix-app .hx5ag-orbita { display: block; position: absolute; top: 10px; left: 50%; width: 210px; height: 70px; margin-left: -105px;
    border: 1px solid var(--hx5ag-orb); border-radius: 50%; transform: rotate(-12deg); pointer-events: none; }
  html.hx-v5 .helix-app .hx5ag-orbita i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--v5-acc);
    box-shadow: 0 0 10px var(--v5-acc); offset-path: ellipse(105px 35px at 105px 35px); animation: hx5ag-orbita 6s linear infinite; }
  html.hx-v5 .helix-app .hx5ag-hvs { display: grid; order: -1; position: relative; z-index: 1; flex: none; width: 118px; height: 118px; margin: -6px 0 -4px; }
  html.hx-v5 .helix-app .hx5ag-hvs > * { grid-area: 1 / 1; place-self: center; opacity: 0; transition: opacity .35s; }
  html.hx-v5 .helix-app .hxag-panel:not([data-hx5-modo="video"]) .hx5ag-hvs > .hx5-rig,
  html.hx-v5 .helix-app .hxag-panel[data-hx5-modo="video"] .hx5ag-hvs > .hx5-mvid { opacity: 1; }
  html.hx-v5 .helix-app .hxag-panel.is-abierto .hx5ag-hvs { animation: hx5-asoma .8s var(--v5-eo) .1s both; }
  html.hx-v5 .helix-app .hxag-cab-textos { flex: none; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center;
    max-width: 100%; text-align: center; }
  html.hx-v5 .helix-app .hxag-cab-nombre { margin-top: 2px; font: 700 17px/1.25 var(--v5-font); letter-spacing: -.02em; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hx5ag-est { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 12px; color: var(--v5-t2); white-space: nowrap; }
  html.hx-v5 .helix-app .hx5ag-est i { width: 7px; height: 7px; border-radius: 50%; background: #34C759; box-shadow: 0 0 8px #34C759;
    animation: hx5ag-latido 2s ease-in-out infinite; }
  html.hx-v5 .helix-app .hx5ag-est[data-tono="off"] i { background: var(--v5-t3); box-shadow: none; animation: none; }
  html.hx-v5 .helix-app .hxag-cab-sub { max-width: 300px; margin-top: 3px; font-size: 11.5px; color: var(--v5-t3); }
  /* Saldo (el chip real, con su hoja de recarga) arriba a la izquierda; conversaciones, nueva y
     preferencias arriba a la derecha, junto a cerrar. */
  html.hx-v5 .helix-app .hxag-cab-acciones { position: absolute; top: 12px; left: 12px; right: 48px; z-index: 2; display: flex; align-items: center;
    justify-content: flex-end; gap: 2px; margin: 0; padding: 0; pointer-events: none; }
  html.hx-v5 .helix-app .hxag-cab-acciones > * { pointer-events: auto; }
  html.hx-v5 .helix-app .hxag-cab .hxa-icono { width: 30px; height: 30px; border-radius: 50%; background: transparent; color: var(--v5-t2);
    transition: background .2s var(--v5-eo), color .2s var(--v5-eo), transform .12s var(--v5-eo); }
  html.hx-v5 .helix-app .hxag-cab .hxa-icono:hover { background: var(--v5-card2); color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-cab .hxa-icono svg { width: 16px; height: 16px; }
  html.hx-v5 .helix-app .hxag-cab .hxa-chip-saldo { order: -1; margin-right: auto; height: 26px; gap: 5px; padding: 0 10px; border: 0; border-radius: 999px;
    background: var(--v5-card2); color: var(--v5-t1); font: 600 12px var(--v5-font); font-variant-numeric: tabular-nums; box-shadow: none; }
  html.hx-v5 .helix-app .hxag-cab .hxa-chip-saldo svg { width: 13px; height: 13px; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-cab .hxa-chip-saldo:hover { background: var(--v5-card2); filter: brightness(1.08); }
  html.hx-v5 .helix-app .hxag-cab .hxa-chip-saldo.is-bajo { background: var(--warning-bg); color: var(--warning-text); }
  html.hx-v5 .helix-app .hxag-cab .hxa-chip-saldo.is-cero { background: var(--danger-bg); color: var(--danger-text); }
  html.hx-v5 .helix-app .hxag-cab [data-hxag-cerrar] { position: absolute; top: 12px; right: 12px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
    background: var(--v5-card2); color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-cab [data-hxag-cerrar] svg { width: 15px; height: 15px; }
  html.hx-v5 .helix-app .hxag-cab [data-hxag-cerrar]:hover { background: var(--v5-card2); filter: brightness(1.12); }
  html.hx-v5 .helix-app .hxag-cab .hxa-icono:active, html.hx-v5 .helix-app .hxag-cab [data-hxag-cerrar]:active { transform: scale(.94); }

  /* ── Hilo ── */
  html.hx-v5 .helix-app .hxag-panel .hxa-hilo { padding: 10px 14px 8px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-hilo:has(> .hxa-col) { display: flex; flex-direction: column; }
  /* Pocos mensajes: se pegan abajo, junto a la caja de escribir (como el prototipo y cualquier chat) */
  html.hx-v5 .helix-app .hxag-panel .hxa-col { width: 100%; max-width: none; margin: auto 0 0; gap: 8px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-msg { gap: 6px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-msg.es-user .hxa-burbuja { max-width: 88%; padding: 9px 14px; border-radius: 19px; background: var(--v5-acc); color: #fff;
    font-size: 13.5px; line-height: 1.38; box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--v5-acc) 70%, transparent); }
  /* Cada turno del agente lleva su firma (mini mascota + «Helix Agent»). El hueco lo reserva el CSS y la
     firma va encima en absoluto: meterla no mueve el hilo ni el scroll, aunque el hilo se repinte entero. */
  html.hx-v5 .helix-app .hxag-panel .hxa-msg.es-asistente { position: relative; align-items: flex-start; }
  html.hx-v5 .helix-app .hxag-panel .hxa-msg.es-asistente:not(:has(> .hxa-pensando)) { margin-top: 6px; padding-top: 32px; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-autor { display: flex; position: absolute; top: 0; left: 2px; height: 26px; align-items: center; gap: 7px;
    font-size: 12px; color: var(--v5-t2); white-space: nowrap; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-autor b { font-weight: 600; color: var(--v5-t1); }
  /* El texto del agente: cada párrafo es una burbuja y los datos (listas, tablas) van en tarjeta */
  html.hx-v5 .helix-app .hxag-panel .hxa-msg.es-asistente .hxa-burbuja { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 100%;
    padding: 0; background: none; font-size: 13.5px; line-height: 1.42; }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > p, html.hx-v5 .helix-app .hxag-panel .hxa-md > blockquote { max-width: 88%; margin: 0; padding: 9px 14px;
    border-radius: 19px; background: var(--v5-bin); color: var(--v5-t1); box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .25); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > blockquote { border-left: 0;
    box-shadow: inset 3px 0 0 color-mix(in srgb, var(--v5-acc) 55%, transparent), 0 6px 16px -10px rgba(0, 0, 0, .25); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > blockquote p { margin: 0 0 6px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > ul, html.hx-v5 .helix-app .hxag-panel .hxa-md > ol { max-width: 92%; margin: 0; padding: 10px 14px 10px 30px;
    border-radius: 16px; background: var(--v5-card2); box-shadow: var(--v5-sh1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md li { margin: 2px 0; }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > .hxa-tabla { max-width: 100%; margin: 0; border: 0; border-radius: 16px; background: var(--v5-card2); box-shadow: var(--v5-sh1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md th { background: transparent; color: var(--v5-t2); font-size: 11.5px; font-weight: 600; border-bottom-color: var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md td { border-bottom-color: var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > pre { max-width: 100%; margin: 0; border: 0; border-radius: 14px; background: var(--v5-card2); box-shadow: var(--v5-sh1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md > h4 { margin: 4px 2px 0; font-size: 13px; font-weight: 650; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md code { background: var(--v5-card2); border-color: var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-md a { color: var(--v5-acc); }
  html.hx-v5 .helix-app .hxag-panel .hxa-paso { padding: 3px 10px; background: var(--v5-card2); color: var(--v5-t2); font-size: 11.5px; box-shadow: inset 0 0 0 .5px var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-paso.is-activo::before { background: var(--v5-acc); }
  html.hx-v5 .helix-app .hxag-panel .hxa-evento { font-size: 11.5px; color: var(--v5-t3); }
  /* «Pensando…»: mini mascota pensando y el texto con un brillo que lo recorre */
  html.hx-v5 .helix-app .hxag-panel .hxa-pensando { position: relative; min-height: 26px; margin: 2px 0 0 2px; padding-left: 34px; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hxa-pensando > .hxag-m, html.hx-v5 .helix-app .hxag-panel .hxa-pensando > .hx5ag-orig { display: none; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-pm { display: block; position: absolute; top: 50%; left: 0; width: 26px; height: 26px; margin-top: -13px; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-pt { display: inline-flex; align-items: baseline; font-size: 13px; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-pt b { font-weight: 400; color: transparent; -webkit-text-fill-color: transparent; -webkit-background-clip: text; background-clip: text;
    background-image: linear-gradient(90deg, var(--v5-t2) 0%, var(--v5-t1) 50%, var(--v5-t2) 100%); background-size: 200% 100%;
    animation: hx5ag-brillo-texto 2s linear infinite; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-pt i { display: inline-block; width: 3px; height: 3px; margin-left: 2px; border-radius: 50%; background: var(--v5-t2);
    animation: hx5-punto 1.2s ease-in-out infinite; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-pt i:nth-of-type(2) { animation-delay: .15s; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-pt i:nth-of-type(3) { animation-delay: .3s; }

  /* ── Tarjeta de acción: borde con degradado que orbita mientras está pendiente ── */
  html.hx-v5 .helix-app .hxag-panel .hxa-accion { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
    padding: 13px 14px; border: 0; border-radius: 18px; background: var(--v5-card); box-shadow: var(--v5-sh1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion.is-pendiente { background: transparent; box-shadow: var(--v5-shg); }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion.is-pendiente::before { content: ""; position: absolute; top: 50%; left: 50%; z-index: -2; width: 250%; aspect-ratio: 1;
    background: conic-gradient(from 0deg, transparent 0 55%, #007AFF 65%, #B84BFF 75%, #FF6B35 85%, transparent 95%);
    transform: translate(-50%, -50%); animation: hx5-orbit 3.2s linear infinite; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion.is-pendiente::after { content: ""; position: absolute; inset: 1.5px; z-index: -1; border-radius: 16.5px; background: var(--v5-card); }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-cab { align-items: center; gap: 8px; padding: 0; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-aico { display: inline-flex; flex: none; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-titulo { font-size: 13.5px; font-weight: 600; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-estado { align-self: center; margin-left: auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
  html.hx-v5 .helix-app .hxag-panel .hxa-estado.is-pendiente { background: color-mix(in srgb, var(--v5-acc) 14%, transparent); color: var(--v5-acc); }
  html.hx-v5 .helix-app .hxag-panel .hxa-estado .hx5ag-largo { display: none; }
  html.hx-v5 .helix-app .hxag-panel .hxa-estado .hx5ag-corto { display: inline; }
  /* El cuerpo se aplana para poder llevar la nota de deshacer debajo de los botones, como el prototipo */
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-cuerpo { display: contents; font-size: 12.5px; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-cuerpo > div:has(> .hxa-cambio) { display: flex; flex-direction: column; gap: 6px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-cambio { display: grid; grid-template-columns: fit-content(42%) minmax(0, 1fr); column-gap: 10px; align-items: baseline;
    padding: 0; border: 0; }
  html.hx-v5 .helix-app .hxag-panel .hxa-cambio-campo { margin: 0; font-size: 12.5px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-val { display: block; min-width: 0; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-val > .hxa-antes, html.hx-v5 .helix-app .hxag-panel .hx5ag-val > .hxa-despues { display: inline; }
  html.hx-v5 .helix-app .hxag-panel .hxa-antes { color: var(--v5-t3); text-decoration: line-through; text-decoration-color: currentColor; }
  html.hx-v5 .helix-app .hxag-panel .hxa-antes + .hxa-despues::before { content: "→"; display: inline-block; margin: 0 5px; font-weight: 400; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hxa-despues { font-weight: 600; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-texto-envio { border-radius: 16px 16px 4px 16px; background: color-mix(in srgb, var(--v5-acc) 14%, transparent); color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-muestra span { background: var(--v5-card2); box-shadow: inset 0 0 0 .5px var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-avisos { border-radius: 12px; font-size: 12px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie { order: 1; justify-content: flex-start; gap: 8px; padding: 0; border: 0; background: none; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie [data-op="confirmar"] { order: -1; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-cuerpo > .hxa-nota:last-child { order: 2; font-size: 11.5px; color: var(--v5-t3); }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn { height: 36px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; font: 500 13.5px var(--v5-font);
    text-shadow: none; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn--primary { overflow: hidden; background: var(--v5-acc); color: #fff; font-weight: 600; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn--primary:hover { filter: brightness(1.08);
    box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--v5-acc) 70%, transparent); }
  /* El brillo que barre el botón principal (sustituye al cuerpo de cristal de helix-material.css) */
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn--primary::after { content: ""; position: absolute; inset: 0; z-index: -1; border: 0; border-image: none;
    border-radius: inherit; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%); background-color: transparent;
    box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; transform: translateX(-120%); animation: hx5ag-brillo 3s 1s ease-in-out infinite; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn--secondary { background: var(--v5-card2); color: var(--v5-t1); }
  html.hx-v5:not([data-theme="dark"]) .helix-app .hxag-panel .hxa-accion-pie .helix-btn--secondary { background: #ECECEF; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn--secondary::after { content: none; }
  html.hx-v5 .helix-app .hxag-panel .hxa-accion-pie .helix-btn[disabled] { opacity: .55; filter: none; }

  /* ── Bienvenida: saludo centrado y las 4 sugerencias en rejilla 2×2 (la mascota ya está arriba) ── */
  html.hx-v5 .helix-app .hxag-panel .hxa-hilo:has(> .hxa-vacio) { display: flex; flex-direction: column; padding: 6px 14px 12px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-vacio { flex: 1 0 auto; display: flex; flex-direction: column; width: 100%; max-width: none; margin: 0; padding: 0; }
  html.hx-v5 .helix-app .hxag-panel .hxa-vacio > .hxag-m, html.hx-v5 .helix-app .hxag-panel .hxa-vacio > h2,
  html.hx-v5 .helix-app .hxag-panel .hxa-vacio > p, html.hx-v5 .helix-app .hxag-panel .hxa-vacio > .hxa-sugerencias { display: none; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-bien { display: flex; flex: 1 0 auto; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    padding: 10px 12px 16px; text-align: center; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-bien h2 { margin: 6px 0 0; font: 700 21px/1.2 var(--v5-font); letter-spacing: -.03em; color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-bien p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hxa-vacio > .hxa-recientes { order: 1; margin: 0 0 10px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-recientes-tit { margin: 0 4px 4px; font-size: 11px; color: var(--v5-t3); }
  html.hx-v5 .helix-app .hxag-panel .hxa-reciente { padding: 7px 10px; border-radius: 12px; font-size: 13px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-reciente:hover { background: var(--v5-card2); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug { display: grid; order: 2; grid-template-columns: 1fr 1fr; gap: 8px; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; padding: 11px 12px;
    border: .5px solid var(--v5-line); border-radius: 16px; background: var(--v5-card2); color: var(--v5-t1); font: 500 13px/1.3 var(--v5-font); text-align: left;
    box-shadow: var(--v5-sh1); cursor: pointer; transition: transform .2s var(--v5-eo), box-shadow .2s var(--v5-eo);
    animation: hx5-entra .5s var(--v5-eo) backwards; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button:nth-child(2) { animation-delay: .07s; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button:nth-child(3) { animation-delay: .14s; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button:nth-child(4) { animation-delay: .21s; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button:hover { transform: translateY(-2px); box-shadow: var(--v5-shg); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button:active { transform: scale(.97); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug button span { font-size: 11.5px; font-weight: 400; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hx5ag-sug svg { width: 17px; height: 17px; color: var(--v5-acc); }

  /* ── Aviso de saldo, adjuntos pendientes y cápsula de escribir con borde de degradado animado ── */
  html.hx-v5 .helix-app .hxag-panel .hxa-aviso { margin: 0 14px 8px; border-radius: 14px; font-size: 12.5px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-pendientes { padding: 0 14px 6px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-ficha { border: .5px solid var(--v5-line); background: var(--v5-card2); color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hxa-form { padding: 4px 14px 12px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-caja { position: relative; isolation: isolate; max-width: none; padding: 6px 6px 6px 10px; border: 0; border-radius: 18px;
    background: var(--v5-card2); box-shadow: inset 0 .5px 0 var(--v5-hl), 0 10px 26px -14px rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); }
  html.hx-v5 .helix-app .hxag-panel .hxa-caja::before { content: ""; position: absolute; inset: -1.5px; z-index: -1; padding: 1.5px; border-radius: 19.5px;
    pointer-events: none; background: conic-gradient(from var(--hx5ag-gira, 0deg), #007AFF, #B84BFF, #FF6B35, #FF3B30, #007AFF);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: hx5ag-borde 4s linear infinite; }
  html.hx-v5 .helix-app .hxag-panel .hxa-caja:focus-within { box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 4px color-mix(in srgb, var(--v5-acc) 14%, transparent),
    0 10px 26px -14px rgba(0, 0, 0, .35); }
  html.hx-v5 .helix-app .hxag-panel .hxa-input { padding: 6px 2px 4px; font: 400 14px/1.45 var(--v5-font); color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-input::placeholder { color: var(--v5-t3); }
  html.hx-v5 .helix-app .hxag-panel .hxa-caja-pie { gap: 4px; margin-top: 2px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-adj-btn { width: 30px; height: 30px; border-radius: 50%; color: var(--v5-t2); }
  html.hx-v5 .helix-app .hxag-panel .hxa-sel { height: 28px; padding: 0 10px; border: .5px solid var(--v5-line); border-radius: 999px; background: var(--v5-card2);
    color: var(--v5-t2); font: 500 12px var(--v5-font); }
  html.hx-v5 .helix-app .hxag-panel .hxa-sel:hover { color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-enviar { width: 34px; height: 34px; background: var(--v5-acc); color: #fff;
    transition: filter .2s var(--v5-eo), box-shadow .2s var(--v5-eo), transform .12s var(--v5-eo); }
  html.hx-v5 .helix-app .hxag-panel .hxa-enviar:hover { background: var(--v5-acc); filter: brightness(1.08); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--v5-acc) 70%, transparent); }
  html.hx-v5 .helix-app .hxag-panel .hxa-enviar:active { transform: scale(.94); }
  html.hx-v5 .helix-app .hxag-panel .hxa-enviar.is-parar { background: var(--v5-t1); color: var(--bg-page); }
  html.hx-v5 .helix-app .hxag-panel .hxa-pie { margin-top: 7px; font-size: 11px; color: var(--v5-t3); }
  html.hx-v5 .helix-app .hxag-panel .hxa-menu { left: 14px; right: 14px; border: 0; border-radius: 16px; background: var(--hx5ag-capa);
    box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), 0 18px 44px -16px rgba(0, 0, 0, .55); }
  html.hx-v5 .helix-app .hxag-panel .hxa-menu-op { border-radius: 11px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-menu-op.is-elegida { background: color-mix(in srgb, var(--v5-acc) 12%, transparent); }
  html.hx-v5 .helix-app .hxag-panel .hxa-menu-marca { color: var(--v5-acc); }

  /* ── Capas del panel (conversaciones, saldo, preferencias) ── */
  html.hx-v5 .helix-app .hxag-panel .hxa-capa { background: var(--hx5ag-capa); }
  html.hx-v5 .helix-app .hxag-panel .hxa-capa-cab { padding: 14px 12px 10px 18px; border-bottom: .5px solid var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-capa-cab h3 { font: 700 16px var(--v5-font); letter-spacing: -.02em; }
  html.hx-v5 .helix-app .hxag-panel .hxa-capa-cab .hxa-icono { width: 30px; height: 30px; border-radius: 50%; background: var(--v5-card2); color: var(--v5-t1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-capa-cuerpo { padding: 4px 18px 20px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-saldo-grande { font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
  html.hx-v5 .helix-app .hxag-panel .hxa-recarga { border: .5px solid var(--v5-line); border-radius: 14px; background: var(--v5-card2); box-shadow: var(--v5-sh1); }
  html.hx-v5 .helix-app .hxag-panel .hxa-recarga:hover { border-color: var(--v5-acc); }
  html.hx-v5 .helix-app .hxag-panel .hxa-mov { border-bottom-color: var(--v5-line); }
  html.hx-v5 .helix-app .hxag-panel .hxa-conv-abrir { border-radius: 12px; }
  html.hx-v5 .helix-app .hxag-panel .hxa-conv-abrir:hover { background: var(--v5-card2); }

  /* ── Aviso de estreno: misma familia que el panel ── */
  html.hx-v5 .helix-app .hxag-novedad-hoja { border: 0; border-radius: 30px; background: var(--hx5ag-capa);
    box-shadow: inset 0 .5px 0 var(--v5-hl), 0 0 0 .5px var(--v5-edge), var(--v5-shg); }
  html.hx-v5 .helix-app .hxag-novedad-img { border-radius: 29px 29px 0 0; }
}

@property --hx5ag-gira { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes hx5ag-borde { to { --hx5ag-gira: 360deg; } }
/* El recorrido empieza en el extremo derecho de la órbita, justo detrás de los botones de arriba a la
   derecha (del 92 % al 5,5 %, medido en el navegador): ahí el punto se desvanece para que no parezca un
   aviso encima de un botón. */
@keyframes hx5ag-orbita { 0% { offset-distance: 0%; opacity: 0; } 5.5% { opacity: 0; } 8.5% { opacity: 1; } 89% { opacity: 1; }
  92% { opacity: 0; } 100% { offset-distance: 100%; opacity: 0; } }
@keyframes hx5ag-latido { 50% { transform: scale(1.5); opacity: .6; } }
@keyframes hx5ag-brillo { 40%, 100% { transform: translateX(120%); } }
@keyframes hx5ag-brillo-texto { to { background-position: -200% 0; } }
