.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hs-assistant {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 9500;
  font-family: "DM Sans", system-ui, sans-serif;
}

.hs-assistant-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.75rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a1f2e 0%, #0f1219 100%);
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hs-assistant-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.4);
}

.hs-assistant-toggle-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.hs-assistant-toggle-icon {
  color: var(--hs-gold, #f5a623);
}

.hs-assistant-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(100vw - 2rem, 380px);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 18, 25, 0.25);
  border: 1px solid rgba(15, 18, 25, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  overflow: hidden;
}

.hs-assistant-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.hs-assistant-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 1rem 1rem 0.75rem;
  background: #0f1219;
  color: #fff;
}

.hs-assistant-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hs-gold, #f5a623);
}

.hs-assistant-head h2 {
  margin: 0.15rem 0 0;
  font-family: Syne, system-ui, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.hs-assistant-close {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.hs-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.75rem 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}

.hs-assistant-msg {
  display: flex;
}

.hs-assistant-msg.is-user {
  justify-content: flex-end;
}

.hs-assistant-bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hs-assistant-msg.is-assistant .hs-assistant-bubble {
  background: #f3f4f6;
  color: #1a1f2e;
  border-bottom-left-radius: 4px;
}

.hs-assistant-bubble.hs-assistant-md {
  white-space: normal;
}

.hs-assistant-md p {
  margin: 0 0 0.65rem;
}

.hs-assistant-md p:last-child {
  margin-bottom: 0;
}

.hs-assistant-md ul {
  margin: 0.35rem 0 0.75rem;
  padding-left: 1.15rem;
  list-style: disc;
}

.hs-assistant-md ul:last-child {
  margin-bottom: 0;
}

.hs-assistant-md li {
  margin: 0.35rem 0;
  padding-left: 0.15rem;
}

.hs-assistant-md li::marker {
  color: var(--hs-gold, #f5a623);
}

.hs-assistant-md strong {
  font-weight: 600;
  color: #0f1219;
}

.hs-assistant-md a {
  color: #b45309;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hs-assistant-md a:hover {
  color: #92400e;
}

.hs-assistant-msg.is-user .hs-assistant-bubble {
  background: #1a1f2e;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.hs-assistant-dots::after {
  content: "…";
  animation: hs-assistant-pulse 1s ease infinite;
}

@keyframes hs-assistant-pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

.hs-assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.75rem 0.5rem;
}

.hs-assistant-chip {
  border: 1px solid rgba(15, 18, 25, 0.12);
  background: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  cursor: pointer;
  color: #1a1f2e;
}

.hs-assistant-chip:hover {
  border-color: var(--hs-gold, #f5a623);
}

.hs-assistant-disclaimer {
  margin: 0;
  padding: 0 0.75rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #6b7280;
}

.hs-assistant-form {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem 0.65rem;
  border-top: 1px solid rgba(15, 18, 25, 0.08);
}

.hs-assistant-form textarea {
  flex: 1;
  resize: none;
  border: 1px solid rgba(15, 18, 25, 0.15);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  font-size: 0.88rem;
  min-height: 2.5rem;
  max-height: 6rem;
}

.hs-assistant-send {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 10px;
  background: var(--hs-gold, #f5a623);
  color: #1a1f2e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-assistant-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hs-assistant-links {
  display: flex;
  gap: 0.75rem;
  padding: 0 0.75rem 0.75rem;
  font-size: 0.75rem;
}

.hs-assistant-links a {
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 480px) {
  .hs-assistant-toggle-label {
    display: none;
  }

  .hs-assistant-panel {
    width: calc(100vw - 1.5rem);
    right: -0.25rem;
  }
}
