/* ============================================================
   SIMULADOR CINEMATOGRÁFICO DE DISTRIBUIÇÃO — Home
   Arquitetura Modular: public/dashboard/modules/home.css
   O palco é sempre escuro (como uma tela de cinema); cabeçalho,
   console e HUD seguem o tema claro/escuro do dashboard.
   ============================================================ */

.hx {
  --hx-ink: #E8EEF7;
  --hx-ink-dim: rgba(232, 238, 247, 0.62);
  --hx-ink-faint: rgba(232, 238, 247, 0.38);
  --hx-glass: rgba(255, 255, 255, 0.045);
  --hx-glass-hi: rgba(255, 255, 255, 0.085);
  --hx-line: rgba(255, 255, 255, 0.09);
  --hx-accent: #25D366;
  --hx-warn: #F5A524;
  --hx-off: #64748B;
  --hx-ease: cubic-bezier(0.22, 1, 0.36, 1);

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(2, 8, 23, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.hx .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Cabeçalho ---------- */
.hx-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.hx-head-text { max-width: 640px; }

.hx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

[data-theme="dark"] .hx-eyebrow { color: var(--hx-accent); }

.hx-rec {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #EF4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: hx-rec 1.6s infinite;
}

@keyframes hx-rec {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.hx-title {
  margin: 8px 0 6px;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.hx-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-muted);
}

.hx-head-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hx-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.hx-seg-btn,
.hx-ghost-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.hx-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.hx-ghost-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 12px;
  border-radius: 12px;
}

.hx-ghost-btn:hover,
.hx-seg-btn:hover { color: var(--text); }

.hx-ghost-btn.active { color: var(--primary); border-color: rgba(15, 110, 86, 0.35); }
[data-theme="dark"] .hx-ghost-btn.active { color: var(--hx-accent); border-color: rgba(37, 211, 102, 0.35); }

/* ---------- Palco ---------- */
.hx-stage {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  min-height: 520px;
  color: var(--hx-ink);
  background:
    radial-gradient(120% 90% at 50% 0%, #0E1B33 0%, #070B16 55%, #04060C 100%);
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hx-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hx-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px);
}

.hx-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(260px, 1.25fr) minmax(210px, 1fr);
  gap: clamp(24px, 5vw, 72px);
  padding: 28px 28px 84px;
  min-height: 520px;
  align-items: center;
}

.hx-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hx-col-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hx-ink-faint);
  margin-bottom: 2px;
}

.hx-col-label small {
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 500;
  margin-left: 6px;
  opacity: 0.8;
}

.hx-hint {
  font-size: 11.5px;
  color: var(--hx-ink-faint);
  margin-top: 2px;
}

/* ---------- Fontes (canais) ---------- */
.hx-source {
  --c: #25D366;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid var(--hx-line);
  background: var(--hx-glass);
  backdrop-filter: blur(6px);
  color: var(--hx-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s var(--hx-ease), border-color 0.3s, background 0.3s, box-shadow 0.3s;
}

.hx-source:hover {
  transform: translateX(4px);
  background: var(--hx-glass-hi);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
}

.hx-source.fire {
  box-shadow: 0 0 0 1px var(--c), 0 0 32px -4px var(--c);
  animation: hx-fire 0.6s var(--hx-ease);
}

@keyframes hx-fire {
  0% { transform: scale(1); }
  35% { transform: scale(1.045); }
  100% { transform: scale(1); }
}

.hx-source-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 19px;
  color: #fff;
  background: var(--c);
  box-shadow: 0 6px 18px -6px var(--c);
}

.hx-source-meta { display: flex; flex-direction: column; line-height: 1.25; }
.hx-source-meta b { font-size: 13.5px; font-weight: 700; }
.hx-source-meta small { font-size: 11.5px; color: var(--hx-ink-dim); font-variant-numeric: tabular-nums; }

/* ---------- Núcleo ---------- */
.hx-core-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.hx-core {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  transition: transform 0.5s var(--hx-ease);
}

.hx-core.absorb { transform: scale(1.08); }

.hx-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hx-ring.r1 {
  border-color: transparent;
  border-top-color: var(--hx-core, #25D366);
  border-right-color: color-mix(in srgb, var(--hx-core, #25D366) 40%, transparent);
  animation: hx-spin 3.2s linear infinite;
  filter: drop-shadow(0 0 6px var(--hx-core, #25D366));
}

.hx-ring.r2 {
  inset: 14px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
  animation: hx-spin 14s linear infinite reverse;
}

.hx-ring.r3 {
  inset: 28px;
  border-color: rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle, color-mix(in srgb, var(--hx-core, #25D366) 22%, transparent), transparent 70%);
}

.hx-core.busy .hx-ring.r1 { animation-duration: 0.9s; }

.hx-core-heart {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #04110B;
  background: radial-gradient(circle at 35% 30%, #fff, var(--hx-core, #25D366) 70%);
  box-shadow: 0 0 40px -2px var(--hx-core, #25D366), 0 0 90px -10px var(--hx-core, #25D366);
  transition: background 0.5s, box-shadow 0.5s;
}

@keyframes hx-spin { to { transform: rotate(360deg); } }

.hx-pipeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.hx-pipeline li {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--hx-ink-faint);
  border: 1px solid var(--hx-line);
  transition: color 0.3s, background 0.3s, border-color 0.3s;
  white-space: nowrap;
}

.hx-pipeline li.on {
  color: #04110B;
  background: var(--hx-core, #25D366);
  border-color: transparent;
}

.hx-pipeline li.done {
  color: var(--hx-ink);
  border-color: color-mix(in srgb, var(--hx-core, #25D366) 45%, transparent);
}

/* Painel de decisão — altura fixa para o palco não crescer enquanto o conteúdo aparece */
.hx-decision {
  box-sizing: border-box;
  width: 100%;
  max-width: 340px;
  height: 268px;
  overflow: hidden;
  border-radius: 14px;
  padding: 14px;
  background: rgba(8, 14, 28, 0.72);
  border: 1px solid var(--hx-line);
  backdrop-filter: blur(10px);
  font-size: 12.5px;
}

.hx-decision-idle {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--hx-ink-faint);
  font-style: italic;
}

.hx-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.hx-msg i { color: var(--c); font-size: 15px; margin-top: 1px; }

.hx-msg p {
  margin: 0;
  color: var(--hx-ink);
  line-height: 1.4;
  height: 4.2em; /* reserva 3 linhas desde o início da digitação */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hx-msg p mark {
  background: color-mix(in srgb, var(--c) 30%, transparent);
  color: #fff;
  border-radius: 3px;
  padding: 0 2px;
}

.hx-caret {
  display: inline-block;
  width: 6px;
  height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--hx-ink);
  animation: hx-blink 0.8s steps(2) infinite;
}

@keyframes hx-blink { 50% { opacity: 0; } }

.hx-intent {
  display: flex;
  height: 22px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--hx-ink-dim);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s, transform 0.35s var(--hx-ease);
}

.hx-intent.show { opacity: 1; transform: none; }

.hx-intent b {
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--d, #334155);
  font-size: 11.5px;
}

.hx-intent small { margin-left: auto; font-variant-numeric: tabular-nums; }

.hx-scores { display: flex; flex-direction: column; gap: 5px; }

.hx-score {
  display: grid;
  grid-template-columns: 62px 1fr 34px;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--hx-ink-dim);
  transition: color 0.3s;
}

.hx-score-bar {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.hx-score-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.6s var(--hx-ease), background 0.3s;
}

.hx-score em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.hx-score.blocked { opacity: 0.4; }
.hx-score.win { color: #fff; font-weight: 700; }
.hx-score.win .hx-score-bar span { background: var(--hx-core, #25D366); box-shadow: 0 0 10px var(--hx-core, #25D366); }

.hx-verdict {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--hx-line);
  color: var(--hx-ink-dim);
  opacity: 0;
  transition: opacity 0.3s;
}

.hx-verdict.show { opacity: 1; }
.hx-verdict b { color: #fff; }

/* ---------- Atendentes ---------- */
.hx-agent {
  --d: #334155;
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--hx-line);
  background: var(--hx-glass);
  backdrop-filter: blur(6px);
  color: var(--hx-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.35s var(--hx-ease), border-color 0.3s, background 0.3s, opacity 0.3s, filter 0.3s;
}

.hx-agent:hover { transform: translateX(-4px); background: var(--hx-glass-hi); }

.hx-agent.status-paused { opacity: 0.72; }
.hx-agent.status-offline { opacity: 0.42; filter: grayscale(0.9); }

.hx-agent.hit {
  border-color: var(--hit, #25D366);
  box-shadow: 0 0 0 1px var(--hit, #25D366), 0 0 36px -6px var(--hit, #25D366);
  animation: hx-hit 0.7s var(--hx-ease);
}

@keyframes hx-hit {
  0% { transform: scale(1); }
  30% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.hx-agent.done-flash { border-color: rgba(255, 255, 255, 0.35); }

.hx-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--d), color-mix(in srgb, var(--d) 55%, #000));
}

.hx-avatar::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #0B1222;
  background: #22C55E;
}

.status-paused .hx-avatar::after { background: var(--hx-warn); }
.status-offline .hx-avatar::after { background: var(--hx-off); }

.hx-agent-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.hx-agent-meta b { font-size: 13px; font-weight: 700; }

.hx-agent-meta small {
  font-size: 11px;
  color: var(--hx-ink-dim);
  display: flex;
  gap: 6px;
  align-items: center;
}

.hx-dept-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--d); }

.hx-load {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.hx-load-cells { display: flex; gap: 3px; }

.hx-load-cells span {
  width: 7px;
  height: 14px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.35s, box-shadow 0.35s;
}

.hx-load-cells span.on { background: var(--d); box-shadow: 0 0 8px -1px var(--d); }
.hx-agent.full .hx-load-cells span.on { background: #F87171; box-shadow: 0 0 8px -1px #F87171; }

.hx-load small {
  font-size: 10px;
  color: var(--hx-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hx-agent-bubble {
  position: absolute;
  right: 12px;
  bottom: calc(100% - 8px);
  max-width: min(240px, 90%);
  width: max-content;
  padding: 8px 11px;
  border-radius: 12px 12px 2px 12px;
  background: #F8FAFC;
  color: #0F172A;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.3s, transform 0.4s var(--hx-ease);
  z-index: 5;
}

.hx-agent-bubble.show { opacity: 1; transform: none; }

/* ---------- Fila ---------- */
.hx-queue {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(8, 14, 28, 0.75);
  border: 1px solid var(--hx-line);
  backdrop-filter: blur(10px);
  font-size: 12px;
  max-width: calc(100% - 32px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.hx-queue.has-items {
  border-color: rgba(245, 165, 36, 0.55);
  box-shadow: 0 0 30px -8px rgba(245, 165, 36, 0.6);
}

.hx-queue-label { color: var(--hx-ink-dim); white-space: nowrap; }
.hx-queue.has-items .hx-queue-label { color: var(--hx-warn); }

.hx-queue-items { display: flex; gap: 6px; overflow: hidden; }
.hx-queue-empty { color: var(--hx-ink-faint); font-style: italic; }

.hx-qchip {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #fff;
  background: var(--c);
  flex-shrink: 0;
  animation: hx-pop 0.4s var(--hx-ease);
}

@keyframes hx-pop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Abertura ---------- */
.hx-intro {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  place-items: center;
  background: #020308;
  transition: background 1.1s ease;
}

.hx-stage.intro-armed .hx-intro,
.hx-stage.intro-play .hx-intro { display: grid; }

.hx-stage.intro-armed .hx-grid,
.hx-stage.intro-armed .hx-queue { opacity: 0; }

.hx-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 13%;
  background: #000;
  transition: transform 1s var(--hx-ease);
}

.hx-bar.top { top: 0; }
.hx-bar.bottom { bottom: 0; }

.hx-intro-lines { text-align: center; padding: 0 24px; }

.hx-line {
  margin: 10px 0;
  font-size: clamp(18px, 2.5vw, 28px);
  font-weight: 300;
  letter-spacing: 0.01em;
  color: #F1F5F9;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(10px);
  transition: opacity 1s ease, filter 1s ease, transform 1.2s var(--hx-ease);
}

.hx-line.l3 { font-weight: 700; }
.hx-line.show { opacity: 1; filter: blur(0); transform: none; }
.hx-line.leave { opacity: 0; filter: blur(6px); transform: translateY(-8px); }

.hx-skip {
  position: absolute;
  right: 16px;
  bottom: calc(13% + 12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.75);
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.hx-skip:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

/* Revelação do palco após a abertura */
.hx-stage.intro-reveal .hx-intro {
  background: transparent;
  pointer-events: none;
}

.hx-stage.intro-reveal .hx-bar.top { transform: translateY(-100%); }
.hx-stage.intro-reveal .hx-bar.bottom { transform: translateY(100%); }
.hx-stage.intro-reveal .hx-intro-lines,
.hx-stage.intro-reveal .hx-skip { opacity: 0; transition: opacity 0.5s; }

.hx-grid,
.hx-queue { transition: opacity 1.2s ease; }

.hx-stage.intro-reveal .hx-source,
.hx-stage.intro-reveal .hx-agent,
.hx-stage.intro-reveal .hx-core-col > * {
  animation: hx-rise 0.9s var(--hx-ease) both;
  animation-delay: calc(var(--i, 0) * 90ms + 200ms);
}

@keyframes hx-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Console ---------- */
.hx-console {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.hx-channel-pick {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.hx-pick {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.hx-pick[data-hx-pick="whatsapp"].active { background: #25D366; color: #fff; }
.hx-pick[data-hx-pick="instagram"].active { background: #E1306C; color: #fff; }
.hx-pick[data-hx-pick="messenger"].active { background: #0084FF; color: #fff; }

.hx-input-wrap { display: block; min-width: 0; }

.hx-input-wrap input {
  width: 100%;
  box-sizing: border-box;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hx-input-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 110, 86, 0.18);
}

.hx-send,
.hx-burst {
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.2s, filter 0.2s, opacity 0.2s;
}

.hx-send { background: var(--primary); color: #fff; }
.hx-send:hover { filter: brightness(1.1); }
.hx-send:active,
.hx-burst:active { transform: scale(0.97); }

.hx-burst {
  background: linear-gradient(135deg, #7C3AED, #DB2777);
  color: #fff;
  box-shadow: 0 8px 22px -10px #DB2777;
}

.hx-burst:disabled { opacity: 0.55; cursor: progress; }

.hx-examples {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hx-chip {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.hx-chip:hover { color: var(--text); border-color: var(--text-muted); border-style: solid; }

/* ---------- HUD ---------- */
.hx-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(240px, 1.6fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.hx-stat,
.hx-log {
  background: var(--surface);
  padding: 12px 14px;
}

.hx-stat { display: flex; flex-direction: column; gap: 2px; }

.hx-stat-val {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.hx-stat-label { font-size: 11.5px; color: var(--text-muted); }

.hx-log {
  list-style: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 16px;
  color: var(--text-muted);
  box-sizing: border-box;
  height: calc(4 * 16px + 3 * 3px + 24px); /* 4 linhas fixas */
  overflow: hidden;
}

.hx-log li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: hx-logline 0.4s var(--hx-ease);
}

.hx-log li:first-child { color: var(--text); }
.hx-log li i { width: 14px; text-align: center; margin-right: 4px; }

@keyframes hx-logline {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .hx-hud { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hx-log { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hx { padding: 16px; }
  .hx-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 22px 16px 84px;
  }
  .hx-sources {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hx-sources .hx-col-label,
  .hx-sources .hx-hint { flex-basis: 100%; }
  .hx-source { flex: 1 1 140px; width: auto; }
  .hx-agents {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  .hx-agents .hx-col-label { grid-column: 1 / -1; }
  .hx-console { grid-template-columns: 1fr 1fr; }
  .hx-channel-pick { grid-column: 1 / -1; justify-self: start; }
  .hx-input-wrap { grid-column: 1 / -1; }
  .hx-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .hx *,
  .hx *::before,
  .hx *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
