.hh-hiw {
  --hh-text: #f3f6fb;
  --hh-muted: #9aa3b2;
  --hh-accent: #3d7eff;
  --hh-font: "Vazirmatn", "IRANSans", "Tahoma", sans-serif;
  direction: rtl;
  width: 100%;
  color: var(--hh-text);
  font-family: var(--hh-font);
  background: transparent;
  position: relative;
}

.hh-hiw *,
.hh-hiw *::before,
.hh-hiw *::after { box-sizing: border-box; }

.hh-hiw-inner {
  display: block;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.hh-hiw-col-diagram { position: relative; min-height: 280px; overflow: visible; }

.hh-board {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 88px;
  min-height: 280px;
  padding: 36px 12px 48px;
  direction: rtl;
  overflow: visible;
}

.hh-wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.hh-sources {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  min-width: 168px;
}

.hh-wire-base { fill: none; stroke: rgba(130, 160, 200, 0.22); stroke-width: 1.25; }
.hh-wire-energy {
  fill: none;
  stroke: url(#hhEnergy);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 42 220;
  animation: hhEnergy 2.8s linear infinite;
  filter: drop-shadow(0 0 6px rgba(90, 170, 255, 0.7));
}
@keyframes hhEnergy { to { stroke-dashoffset: -262; } }

.hh-src {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #161922;
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #d5dbe8;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.hh-src svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: #3d7eff;
}
.hh-src {
  border-color: rgba(61, 126, 255, 0.18);
  animation: hhSrcBreath 2.4s ease-in-out infinite;
}
.hh-src[data-src="1"] { animation-delay: 0.8s; }
.hh-src[data-src="2"] { animation-delay: 1.6s; }
@keyframes hhSrcBreath {
  0%, 100% {
    border-color: rgba(61, 126, 255, 0.16);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  }
  45%, 55% {
    border-color: #3d7eff;
    box-shadow: 0 0 0 1px rgba(61, 126, 255, 0.45), 0 0 22px rgba(61, 126, 255, 0.38);
  }
}

.hh-receive {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 118px;
  min-width: 118px;
  min-height: 118px;
}

.hh-receive-label {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 160px;
  z-index: 3;
  color: #d5dbe8;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.hh-halo {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 42% 38%, rgba(90, 180, 255, 0.28), transparent 42%),
    radial-gradient(circle at 58% 62%, rgba(40, 110, 255, 0.22), transparent 48%);
  filter: blur(8px);
  animation: hhHalo 3.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

.hh-core {
  position: relative;
  z-index: 3;
  width: 118px;
  height: 118px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid rgba(15, 20, 30, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(61, 126, 255, 0.12), 0 0 36px rgba(61, 126, 255, 0.45), 0 0 90px rgba(61, 126, 255, 0.18);
}
.hh-core img { width: 72px; height: 72px; object-fit: contain; position: relative; z-index: 2; }
.hh-core-fallback { display: none; font-weight: 800; font-size: 18px; color: #2a4a8a; position: relative; z-index: 2; }

.hh-scan {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #3d7eff, transparent);
  box-shadow: 0 0 10px #3d7eff;
  z-index: 4;
  pointer-events: none;
  animation: hhScan 2.8s ease-in-out infinite;
}
.hh-scan.is-bottom { animation-delay: 1.4s; }

.hh-transcript {
  position: relative;
  z-index: 3;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  height: auto;
  background: #161922;
  border: 1px solid rgba(90, 170, 255, 0.35);
  border-radius: 16px;
  box-shadow: 0 0 18px rgba(61, 126, 255, 0.12);
  overflow: hidden;
  flex: 0 0 360px;
}
.hh-transcript-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}
.hh-chat { height: auto; flex: 1 1 auto; overflow: hidden; }

.hh-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
}
.hh-card-head-start { display: flex; align-items: center; gap: 8px; }
.hh-card-title { font-size: 13px; font-weight: 600; color: #e6ebf5; }
.hh-speakers-count, .hh-status, .hh-mono { font-size: 11px; color: #8b95a8; }
.hh-status {
  padding: 2px 8px;
  border-radius: 999px;
  color: #cfe0ff;
  background: rgba(61, 126, 255, 0.16);
  border: 1px solid rgba(61, 126, 255, 0.28);
}
.hh-chat { height: auto; flex: 1 1 auto; overflow: hidden; }
.hh-chat-feed { display: flex; flex-direction: column; transition: transform 0.4s ease; }
.hh-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: #d5dce8;
}
.hh-msg { min-width: 0; flex: 1 1 auto; }
.hh-msg-meta { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; }
.hh-typed { display: block; min-height: 1.3em; }
.hh-speaker { flex: 0 0 auto; font-size: 11px; color: #9aa3b2; white-space: nowrap; }
.hh-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; margin-top: 5px; }
.hh-dot-sm { width: 6px; height: 6px; margin-top: 7px; }

@keyframes hhHalo {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.12); opacity: 1; }
}
@keyframes hhScan {
  0% { top: 8px; opacity: 0.2; }
  35% { opacity: 1; }
  50% { top: calc(100% - 10px); opacity: 0.25; }
  85% { opacity: 1; }
  100% { top: 8px; opacity: 0.2; }
}

@media (max-width: 900px) {
  .hh-hiw-inner { padding: 0 16px 40px; }
  .hh-board { flex-direction: column-reverse; gap: 28px; min-height: 0; }
  .hh-transcript, .hh-sources { width: 100%; min-width: 0; max-width: none; flex: 1 1 auto; }
}
