/* Guest chatbot: the button sits in .gch-cta--float (above Zalo/WhatsApp); the panel opens beside it. */
.gch-cta--float .gch-cta-chat {
  background: var(--bgr-gra2, linear-gradient(91deg, #AA8B5E, #513A28)); color: #fff !important; border: 0;
  cursor: pointer; animation-delay: -.45s;
}
.gch-cta--float .gch-cta-chat::after { animation-delay: -.45s; }
.gch-cta--float .gch-cta-chat[aria-expanded="true"] { animation: none; }
.gch-cta--float .gch-cta-chat[aria-expanded="true"]::after { animation: none; opacity: 0; }

.gch-chat {
  position: fixed; right: 88px; bottom: 90px; z-index: 1045;
  width: 370px; max-width: calc(100vw - 108px); height: min(580px, calc(100vh - 120px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; color: #3b2b1e; border-radius: 18px; border: 1px solid #E0D1C0;
  box-shadow: 0 16px 44px rgba(81, 58, 40, .28); font-size: 15px; line-height: 1.5;
}
.gch-chat[hidden] { display: none; }
.gch-chat-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 14px 16px; color: #fff; background: var(--bgr-gra2, linear-gradient(91deg, #AA8B5E, #513A28));
}
.gch-chat-title { font-size: 16px; font-weight: 700; margin: 0; color: #fff; line-height: 1.3; }
.gch-chat-sub { margin: 2px 0 0; font-size: 12.5px; opacity: .9; }
.gch-chat-close {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: 16px;
}
.gch-chat-close:focus-visible, .gch-chat-send:focus-visible, .gch-chat-chips button:focus-visible {
  outline: 2px solid #855F39; outline-offset: 2px;
}
.gch-chat-log { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #faf7f3; }
.gch-chat-msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; white-space: normal; overflow-wrap: anywhere; }
.gch-chat-msg--bot { align-self: flex-start; background: #fff; border: 1px solid #EDE3D7; border-bottom-left-radius: 4px; }
.gch-chat-msg--user { align-self: flex-end; background: #855F39; color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.gch-chat-msg--error { align-self: flex-start; background: #fff4f0; border: 1px solid #f1c9bb; color: #8a3b22; }
.gch-chat-msg a { color: #855F39; font-weight: 600; text-decoration: underline; }
.gch-chat-msg ul { margin: 4px 0; padding-left: 18px; }
.gch-chat-msg p { margin: 0 0 6px; }
.gch-chat-msg p:last-child { margin-bottom: 0; }
.gch-chat-typing { display: inline-flex; gap: 4px; }
.gch-chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: #AA8B5E; animation: gch-chat-dot 1s infinite ease-in-out; }
.gch-chat-typing span:nth-child(2) { animation-delay: .15s; }
.gch-chat-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes gch-chat-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.gch-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; background: #fff; }
.gch-chat-chips[hidden] { display: none; }
.gch-chat-chips button {
  border: 1px solid #E0D1C0; background: #fff; color: #513A28; border-radius: 999px;
  padding: 4px 11px; font-size: 13px; cursor: pointer;
}
.gch-chat-chips button:hover { border-color: #855F39; }
.gch-chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 4px; background: #fff; }
.gch-chat-form textarea {
  flex: 1 1 auto; resize: none; max-height: 110px; min-height: 42px; padding: 10px 12px;
  border: 1px solid #E0D1C0; border-radius: 12px; font: inherit; font-size: 16px; color: inherit;
}
.gch-chat-form textarea:focus { outline: none; border-color: #855F39; box-shadow: 0 0 0 2px rgba(133, 95, 57, .15); }
.gch-chat-send {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--bgr-gra2, linear-gradient(91deg, #AA8B5E, #513A28)); color: #fff; font-size: 16px;
}
.gch-chat-send:disabled { opacity: .55; cursor: default; }
.gch-chat-note { margin: 0; padding: 2px 14px 10px; font-size: 11.5px; color: #8b7b6c; background: #fff; text-align: center; }

@media (max-width: 767px) {
  .gch-chat {
    right: 8px; left: 8px; width: auto; max-width: none;
    top: calc(8px + env(safe-area-inset-top, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); height: auto;
    z-index: 1060;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gch-chat-typing span { animation: none; opacity: .7; }
}
