.bh-assistant {
  --bh-a-accent: #00ffff;
  --bh-a-bg: rgba(4, 10, 18, 0.96);
  --bh-a-border: rgba(255, 255, 255, 0.16);
  font-family: Rajdhani, system-ui, sans-serif;
}

.bh-assistant__toggle {
  position: fixed;
  right: 1.1rem;
  bottom: calc(var(--footer-height, 44px) + 0.85rem);
  z-index: 1200;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid var(--bh-a-border);
  border-radius: 999px;
  background: var(--bh-a-bg);
  color: var(--bh-a-accent);
  box-shadow: 0 0 18px rgba(0, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.bh-assistant__toggle:hover,
.bh-assistant__toggle:focus-visible {
  color: #fff;
  outline: 2px solid var(--bh-a-accent);
  outline-offset: 2px;
}

.bh-assistant__toggle-close {
  display: none;
}

.bh-assistant.is-open .bh-assistant__toggle-open {
  display: none;
}

.bh-assistant.is-open .bh-assistant__toggle-close {
  display: inline;
}

.bh-assistant__panel {
  position: fixed;
  right: 1.1rem;
  bottom: calc(var(--footer-height, 44px) + 4.4rem);
  z-index: 1200;
  width: min(92vw, 380px);
  height: min(70vh, 520px);
  display: none;
  flex-direction: column;
  background: var(--bh-a-bg);
  border: 1px solid var(--bh-a-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.bh-assistant.is-open .bh-assistant__panel {
  display: flex;
}

.bh-assistant__head {
  padding: 0.85rem 1rem 0.7rem;
  border-bottom: 1px solid var(--bh-a-border);
}

.bh-assistant__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.bh-assistant__subtitle {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

.bh-assistant__log {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.bh-assistant__msg {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.bh-assistant__msg--bot {
  align-self: flex-start;
  background: rgba(0, 255, 255, 0.08);
  color: #e8f6ff;
}

.bh-assistant__msg--user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.bh-assistant__msg--error {
  align-self: flex-start;
  background: rgba(255, 80, 80, 0.12);
  color: #ffd4d4;
}

.bh-assistant__msg.is-typing {
  opacity: 0.75;
  font-style: italic;
}

.bh-assistant__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.7rem;
  border-top: 1px solid var(--bh-a-border);
}

.bh-assistant__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--bh-a-border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 0.5rem 0.7rem;
  font: inherit;
}

.bh-assistant__input:focus {
  outline: 1px solid var(--bh-a-accent);
}

.bh-assistant__send {
  border: 0;
  border-radius: 10px;
  background: #0aa;
  color: #041018;
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.bh-assistant__send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bh-assistant .visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .bh-assistant__toggle {
    right: 0.75rem;
    width: 3rem;
    height: 3rem;
  }

  .bh-assistant__panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    height: min(62vh, 480px);
  }
}
