/* ============================================================
   HRZN · ASSISTANT — pantalla completa
   ------------------------------------------------------------
   Misma marca que el chat flotante de Claudio (cockpit/hrzn-chat.js):
   cabecera azul, cuerpo claro, burbujas blancas con borde, pildoras
   azules perfiladas, input redondeado. Aca no flota sobre la pagina:
   ES la pagina, con el sidebar de siempre al costado.

   Carga ULTIMA (despues de hrzn-support.css) para poder pisar el
   overflow de .hz-page sin !important: misma especificidad, orden de
   cascada gana.
   ============================================================ */

.hza-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.hza-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  padding: 20px 24px 24px;
}

.hza-chat {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--hz-surface, #fff);
  border: 1px solid var(--hz-line, #DCE4F5);
  border-radius: var(--hz-r-card, 16px);
  box-shadow: var(--hz-sh-hair, 0 1px 2px rgba(10, 30, 70, .06));
  overflow: hidden;
}

/* ---------- cabecera azul, a sangre ---------- */
.hza-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 16px 20px;
  background: var(--h-action, var(--hz-blue, #2450E4));
}
.hza-avatar {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .5);
}
.hza-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; display: block; }
.hza-heading { min-width: 0; flex: 1; }
.hza-heading strong { display: block; color: #fff; font-size: 17px; font-weight: 700; line-height: 1.25; }
.hza-heading small { display: flex; align-items: center; gap: 6px; color: #3EDC81; font-size: 13px; font-weight: 500; margin-top: 2px; animation: hzaBlink 1.8s ease-in-out infinite; }
.hza-live { width: 8px; height: 8px; border-radius: 50%; background: #3EDC81; flex: none; box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); animation: hzaLivePulse 1.8s ease-in-out infinite; }
@keyframes hzaBlink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@keyframes hzaLivePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 255, 255, .45), 0 0 0 0 rgba(62, 220, 129, .55); }
  50%      { box-shadow: 0 0 0 2px rgba(255, 255, 255, .45), 0 0 0 5px rgba(62, 220, 129, 0); }
}

/* ---------- hilo ---------- */
.hza-thread {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 22px;
  background: var(--hz-canvas, #F1F5FB);
}
.hza-thread::-webkit-scrollbar { width: 8px; }
.hza-thread::-webkit-scrollbar-thumb { background: var(--hz-line, #DCE4F5); border-radius: 99px; }

.hza-m { max-width: min(640px, 78%); font-size: 14.5px; line-height: 1.6; }

/* Claudio: sin caja — texto plano, como el resto de la pagina, con una
   etiqueta chica arriba en vez de repetir el avatar en cada respuesta */
.hza-m.bot {
  align-self: flex-start;
  max-width: min(720px, 88%);
  padding: 0;
  color: var(--h-ink, var(--hz-ink, #0A1E46));
}
.hza-m-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--hz-ink-3, #3A4A66);
  margin-bottom: 5px;
}

/* el usuario: caja azul navy, el mismo azul del sidebar */
.hza-m.me {
  align-self: flex-end;
  padding: 12px 15px;
  border-radius: 14px;
  background: var(--hza-navy, #0B2F63);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.hza-m b { font-weight: 700; }
.hza-m .hza-cites { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.hza-m .hza-cites button {
  font-size: 13px; font-weight: 600; color: #fff;
  background: var(--h-action, var(--hz-blue)); border: none;
  border-radius: 99px; padding: 6px 13px; cursor: pointer; font-family: inherit;
}
.hza-m .hza-cites button:hover { filter: brightness(1.08); }

/* ---------- sugerencias — mismo azul que el boton de enviar ---------- */
.hza-sugs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 22px 0; flex: none; background: var(--hz-surface, #fff); }
.hza-sugs button {
  font-size: 13.5px; font-weight: 600; color: #fff;
  background: var(--h-action, var(--hz-blue)); border: none;
  border-radius: 99px; padding: 8px 14px; cursor: pointer; font-family: inherit;
}
.hza-sugs button:hover { filter: brightness(1.08); }

/* ---------- adjuntos pendientes ---------- */
.hza-pending { display: none; flex-wrap: wrap; gap: 8px; padding: 12px 22px 0; flex: none; background: var(--hz-surface, #fff); border-top: 1px solid var(--hz-line, #DCE4F5); }
.hza-pending.is-on { display: flex; }
.hza-pend-item { position: relative; display: flex; align-items: center; gap: 7px; background: var(--hz-surface, #fff); border: 1px solid var(--hz-line, #DCE4F5); border-radius: 12px; padding: 5px 9px; }
.hza-pend-item.is-img { padding: 0; border-radius: 10px; overflow: hidden; }
.hza-pend-item.is-img img { width: 56px; height: 56px; object-fit: cover; display: block; }
.hza-pend-file-ic { width: 28px; height: 28px; border-radius: 7px; background: var(--hz-sunken, #EAF0FB); flex: none; display: flex; align-items: center; justify-content: center; }
.hza-pend-file-ic svg { width: 15px; height: 15px; stroke: var(--h-action, var(--hz-blue)); fill: none; stroke-width: 2; }
.hza-pend-name { font-size: 12px; font-weight: 600; color: var(--h-ink, var(--hz-ink)); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hza-pend-x { position: absolute; top: -6px; right: -6px; width: 19px; height: 19px; border-radius: 50%; background: var(--h-ink, var(--hz-ink)); border: 2px solid var(--hz-canvas, #F1F5FB); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.hza-pend-x svg { width: 9px; height: 9px; stroke: #fff; fill: none; stroke-width: 3; }

.hza-m-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.hza-m-atts + * { margin-top: 8px; }
.hza-m-att-img { width: 130px; height: 96px; border-radius: 10px; object-fit: cover; display: block; }
.hza-m-att-file { display: flex; align-items: center; gap: 7px; background: rgba(255, 255, 255, .16); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: #fff; }
.hza-m-att-file svg { width: 14px; height: 14px; stroke: #fff; fill: none; stroke-width: 2; flex: none; }
.hza-m-att-audio audio { width: 220px; height: 34px; display: block; }

/* ---------- grabacion de voz ---------- */
.hza-rec-bar { display: none; align-items: center; gap: 9px; padding: 10px 22px; background: #FEECEF; border-top: 1px solid #FBD3D9; font-size: 13px; font-weight: 600; color: var(--h-ink, var(--hz-ink)); flex: none; }
.hza-rec-bar.is-on { display: flex; }
.hza-rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hz-bad, #E5484D); flex: none; animation: hzaRecPulse 1.4s ease-in-out infinite; }
.hza-rec-time { font-variant-numeric: tabular-nums; flex: 1; }
.hza-rec-stop { font-size: 12.5px; font-weight: 700; color: var(--hz-bad-ink, #C4272C); background: #fff; border: 1px solid #FBD3D9; border-radius: 99px; padding: 6px 13px; cursor: pointer; font-family: inherit; }
.hza-rec-stop:hover { background: #FEECEF; }
@keyframes hzaRecPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .35); } 50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); } }

/* ---------- input ---------- */
.hza-inp { display: flex; gap: 10px; align-items: center; padding: 16px 22px; background: var(--hz-surface, #fff); border-top: 1px solid var(--hz-line, #DCE4F5); flex: none; }
.hza-inp input {
  flex: 1; min-width: 0; border: 1px solid var(--hz-line, #DCE4F5); background: var(--hz-canvas, #F1F5FB);
  border-radius: 99px; padding: 0 17px; height: 46px; font: inherit; font-size: 14.5px; color: var(--h-ink, var(--hz-ink));
}
.hza-inp input::placeholder { color: var(--hz-ink-3, #3A4A66); opacity: .7; }
.hza-inp input:focus { outline: none; border-color: var(--h-action, var(--hz-blue)); box-shadow: 0 0 0 3px rgba(36, 80, 228, .16); }
.hza-inp button.hza-round { width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer; flex: none; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.hza-inp button.hza-round svg { width: 18px; height: 18px; stroke-width: 2; fill: none; }
#hzaSend { background: var(--h-action, var(--hz-blue)); }
#hzaSend svg { stroke: #fff; }
#hzaSend:hover { filter: brightness(1.08); }
.hza-attach, .hza-mic { background: var(--hz-surface, #fff) !important; border: 1px solid var(--hz-line, #DCE4F5); }
.hza-attach svg, .hza-mic svg { stroke: var(--h-action, var(--hz-blue)); }
.hza-attach:hover, .hza-mic:hover { background: var(--hz-sunken, #EAF0FB) !important; }
.hza-mic.is-rec { background: var(--hz-bad, #E5484D) !important; border-color: var(--hz-bad, #E5484D); animation: hzaRecPulse 1.4s ease-in-out infinite; }
.hza-mic.is-rec svg { stroke: #fff; }

.hza-disc { font-size: 12.5px; color: var(--hz-ink-3, #3A4A66); text-align: center; padding: 12px 22px 16px; line-height: 1.45; background: var(--hz-surface, #fff); flex: none; }

@media (max-width: 880px) {
  .hza-shell { padding: 14px 14px 16px; }
  .hza-m { max-width: 88%; }
}
