.hx-chat-root {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9990;
  font-family: 'Satoshi', 'Inter', system-ui, sans-serif;
}

@media (min-width: 640px) {
  .hx-chat-root {
    right: 1.5rem;
    bottom: 1.5rem;
  }
}

.hx-chat-fab {
  width: 3.5rem;
  height: 3.5rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #351e10 0%, #1a120c 100%);
  color: #e8c382;
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(232, 195, 130, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hx-chat-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(232, 195, 130, 0.45);
}

.hx-chat-fab:focus-visible {
  outline: 2px solid #e8c382;
  outline-offset: 3px;
}

.hx-chat-fab iconify-icon {
  font-size: 1.65rem;
}

.hx-chat-root.is-open .hx-chat-fab {
  display: none;
}

.hx-chat-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(100vw - 2rem, 22rem);
  max-height: min(32rem, calc(100vh - 2rem));
  display: flex;
  flex-direction: column;
  border-radius: 1.25rem;
  overflow: hidden;
  background: #faf7f0;
  border: 1px solid rgba(53, 30, 16, 0.12);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transform-origin: bottom right;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0.22s;
  pointer-events: none;
}

.hx-chat-root.is-open .hx-chat-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hx-chat-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, #351e10 0%, #2a170f 100%);
  color: #f0e8da;
}

.hx-chat-header__logo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid rgba(232, 195, 130, 0.35);
}

.hx-chat-header__text {
  flex: 1;
  min-width: 0;
}

.hx-chat-header__title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

.hx-chat-header__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.15rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #e8c382;
}

.hx-chat-header__badge::before {
  content: '';
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #6ee7a0;
  box-shadow: 0 0 6px rgba(110, 231, 160, 0.8);
}

.hx-chat-close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f0e8da;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.hx-chat-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.hx-chat-messages {
  flex: 1;
  min-height: 11rem;
  max-height: 18rem;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f6f2ea;
}

.hx-chat-msg {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hx-chat-msg--bot {
  align-self: flex-start;
  background: #fff;
  color: #351e10;
  border: 1px solid rgba(53, 30, 16, 0.08);
}

.hx-chat-msg--user {
  align-self: flex-end;
  background: #351e10;
  color: #f5ede0;
}

.hx-chat-msg--typing {
  opacity: 0.75;
  font-style: italic;
}

.hx-chat-footer {
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid rgba(53, 30, 16, 0.08);
  background: #faf7f0;
}

.hx-chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.hx-chat-input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 6rem;
  resize: none;
  border: 1px solid rgba(53, 30, 16, 0.15);
  border-radius: 0.75rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.8125rem;
  font-family: inherit;
  color: #351e10;
  background: #fff;
}

.hx-chat-input:focus {
  outline: 2px solid rgba(232, 195, 130, 0.55);
  border-color: rgba(232, 195, 130, 0.8);
}

.hx-chat-send {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 0.75rem;
  background: #e8c382;
  color: #351e10;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.15s;
}

.hx-chat-send:hover:not(:disabled) {
  filter: brightness(1.05);
}

.hx-chat-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hx-chat-hint {
  margin-top: 0.45rem;
  font-size: 0.65rem;
  line-height: 1.35;
  color: #737373;
  text-align: center;
}

.hx-chat-hint a {
  color: #854d0e;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

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