.chat-launcher {
  align-items: center;
  background: var(--gold-light);
  border: 0;
  bottom: 1.5rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font-size: 0.62rem;
  font-weight: 700;
  gap: 0.7rem;
  letter-spacing: 0.14em;
  min-height: 52px;
  padding: 0 1.2rem;
  position: fixed;
  right: 1.5rem;
  text-transform: uppercase;
  z-index: 90;
}

.chat-pulse {
  background: #173f2a;
  border-radius: 50%;
  height: 8px;
  position: relative;
  width: 8px;
}

.chat-pulse::after {
  animation: chat-pulse 2s ease-out infinite;
  border: 1px solid #173f2a;
  border-radius: 50%;
  content: "";
  inset: -4px;
  position: absolute;
}

.chatbot {
  background: #11110e;
  border: 1px solid rgba(212, 180, 122, 0.28);
  bottom: 1.5rem;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  color: var(--white);
  display: flex;
  flex-direction: column;
  height: min(680px, calc(100vh - 3rem));
  max-height: calc(100vh - 3rem);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  right: 1.5rem;
  transform: translateY(18px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity 240ms ease, transform 240ms ease;
  width: min(390px, calc(100vw - 3rem));
  z-index: 95;
}

.chatbot.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-header {
  align-items: center;
  border-bottom: 1px solid rgba(255, 253, 248, 0.1);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.1rem;
}

.chat-identity {
  align-items: center;
  display: flex;
  gap: 0.85rem;
}

.chat-avatar {
  align-items: center;
  background: linear-gradient(145deg, var(--gold-light), #8d5d29);
  border-radius: 50%;
  color: var(--ink);
  display: flex;
  font-family: var(--serif);
  height: 38px;
  justify-content: center;
  width: 38px;
}

.chat-identity strong {
  display: block;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
}

.chat-identity div > span {
  align-items: center;
  color: rgba(255, 253, 248, 0.5);
  display: flex;
  font-size: 0.56rem;
  gap: 0.4rem;
  letter-spacing: 0.12em;
  margin-top: 0.25rem;
  text-transform: uppercase;
}

.chat-identity i {
  background: #77b994;
  border-radius: 50%;
  height: 6px;
  width: 6px;
}

.chat-close {
  background: transparent;
  border: 1px solid rgba(255, 253, 248, 0.14);
  border-radius: 50%;
  color: rgba(255, 253, 248, 0.65);
  cursor: pointer;
  font-size: 1.25rem;
  height: 34px;
  line-height: 1;
  width: 34px;
}

.chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.8rem;
  min-height: 130px;
  overflow-y: auto;
  padding: 1.1rem;
  scrollbar-color: rgba(212, 180, 122, 0.35) transparent;
}

.chat-bubble {
  border-radius: 14px;
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 88%;
  padding: 0.8rem 0.9rem;
}

.bot-bubble {
  align-self: flex-start;
  background: #22211c;
  color: rgba(255, 253, 248, 0.78);
}

.user-bubble {
  align-self: flex-end;
  background: var(--gold-light);
  color: var(--ink);
}

.chat-bubble a {
  border-bottom: 1px solid var(--gold-light);
  color: var(--gold-light);
  display: inline-block;
  margin: 0.45rem 0.8rem 0 0;
}

.chat-quick {
  border-top: 1px solid rgba(255, 253, 248, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1.1rem;
}

.chat-quick button {
  background: transparent;
  border: 1px solid rgba(212, 180, 122, 0.28);
  color: rgba(255, 253, 248, 0.66);
  cursor: pointer;
  font-size: 0.55rem;
  letter-spacing: 0.09em;
  padding: 0.55rem 0.7rem;
  text-transform: uppercase;
}

.chat-quick button:hover,
.chat-quick button:focus-visible {
  background: rgba(212, 180, 122, 0.12);
  color: var(--white);
}

.chat-lead {
  background: #181814;
  border-top: 1px solid rgba(212, 180, 122, 0.25);
  display: none;
  max-height: 430px;
  overflow-y: auto;
  padding: 1rem 1.1rem;
}

.chat-lead.is-visible {
  display: block;
}

.chat-lead p {
  color: rgba(255, 253, 248, 0.72);
  font-family: var(--serif);
  margin: 0 0 0.9rem;
}

.chat-lead label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.7rem;
}

.chat-lead label span {
  color: rgba(255, 253, 248, 0.42);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-lead input,
.chat-lead textarea,
.chat-composer input {
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 253, 248, 0.16);
  border-radius: 0;
  color: var(--white);
  font-family: var(--serif);
  outline: 0;
  padding: 0.55rem 0;
  width: 100%;
}

.chat-lead input:focus,
.chat-lead textarea:focus,
.chat-composer input:focus {
  border-color: var(--gold-light);
}

.chat-lead textarea {
  resize: vertical;
}

.chat-lead-submit {
  background: var(--gold-light);
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-top: 0.2rem;
  min-height: 44px;
  text-transform: uppercase;
  width: 100%;
}

.chat-lead small {
  color: rgba(255, 253, 248, 0.35);
  display: block;
  font-size: 0.55rem;
  margin-top: 0.55rem;
  text-align: center;
}

.chat-composer {
  align-items: center;
  border-top: 1px solid rgba(255, 253, 248, 0.1);
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 1fr 40px;
  padding: 0.85rem 1.1rem 1rem;
}

.chat-composer button {
  background: var(--gold-light);
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  height: 38px;
  width: 38px;
}

.chat-sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@keyframes chat-pulse {
  0% { opacity: 0.8; transform: scale(0.7); }
  70%, 100% { opacity: 0; transform: scale(1.8); }
}

@media (max-width: 580px) {
  .chat-launcher {
    bottom: 1rem;
    right: 1rem;
  }

  .chatbot {
    bottom: 0;
    height: min(700px, 92svh);
    max-height: 92svh;
    right: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-pulse::after {
    animation: none;
  }
}
