/* faq-bot.css — 網站自動答問（左下角；WhatsApp FAB 喺右下角） */
.faqbot {
  position: fixed;
  left: max(18px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 61;
  font-family: var(--font-body, "Nunito", "PingFang HK", sans-serif);
  color: var(--ink, #2b2118);
}
.faqbot__launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.62rem 1rem 0.62rem 0.72rem;
  border-radius: 999px;
  border: 2px solid var(--ink, #2b2118);
  background: var(--yellow, #ffc42e);
  color: var(--ink, #2b2118);
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(43, 33, 24, 0.18);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease;
}
.faqbot__launcher:hover { transform: translateY(-2px); }
.faqbot__launcher svg { width: 20px; height: 20px; display: block; }

.faqbot__panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  width: 360px;
  max-width: calc(100vw - 36px);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--cream, #fffaf0);
  border: 1.5px solid rgba(43, 33, 24, 0.14);
  border-radius: 22px 22px 34px 22px;
  box-shadow: 0 22px 50px rgba(43, 33, 24, 0.22);
  overflow: hidden;
}
.faqbot__panel[hidden] { display: none; }

.faqbot__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.8rem 0.95rem;
  background: var(--ink, #2b2118);
  color: var(--cream, #fffaf0);
}
.faqbot__title { margin: 0; font-weight: 800; font-size: 0.98rem; }
.faqbot__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.35rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}

.faqbot__log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 120px;
}
.faqbot__msg { display: flex; }
.faqbot__msg--user { justify-content: flex-end; }
.faqbot__msg--bot { justify-content: flex-start; }
.faqbot__bubble {
  max-width: 84%;
  padding: 0.62rem 0.8rem;
  border-radius: 16px 16px 20px 16px;
  background: #fff;
  font-size: 0.92rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(43, 33, 24, 0.08);
}
.faqbot__msg--user .faqbot__bubble {
  background: var(--yellow, #ffc42e);
  border-color: rgba(43, 33, 24, 0.18);
  border-radius: 16px 16px 16px 20px;
  font-weight: 700;
}
.faqbot__bubble--typing { color: rgba(43, 33, 24, 0.5); letter-spacing: 0.12em; }
.faqbot__link {
  display: inline-block;
  margin-top: 0.45rem;
  font-weight: 800;
  color: var(--ink, #2b2118);
  text-decoration: underline;
  text-decoration-color: var(--yellow-deep, #f5a800);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.faqbot__suggest-wrap { padding: 0 0.9rem 0.2rem; }
.faqbot__suggest-title { margin: 0 0 0.4rem; font-size: 0.78rem; font-weight: 800; color: rgba(43, 33, 24, 0.6); }
.faqbot__suggest { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.faqbot__chip {
  border: 1px solid rgba(43, 33, 24, 0.18);
  background: #fff;
  color: var(--ink, #2b2118);
  border-radius: 999px;
  padding: 0.36rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}
.faqbot__chip:hover { border-color: var(--ink, #2b2118); }
.faqbot__log .faqbot__chip { align-self: flex-start; }

.faqbot__form {
  display: flex;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem 0.35rem;
  border-top: 1px solid rgba(43, 33, 24, 0.08);
}
.faqbot__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1.5px solid rgba(43, 33, 24, 0.18);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  color: var(--ink, #2b2118);
}
.faqbot__input:focus-visible { outline: 3px solid var(--yellow, #ffc42e); outline-offset: 1px; }
.faqbot__send {
  border: 2px solid var(--ink, #2b2118);
  background: var(--yellow, #ffc42e);
  color: var(--ink, #2b2118);
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
}
.faqbot__note {
  margin: 0;
  padding: 0.15rem 0.9rem 0.7rem;
  font-size: 0.68rem;
  line-height: 1.5;
  color: rgba(43, 33, 24, 0.55);
}
.faqbot__note a { color: inherit; font-weight: 800; }

@media (max-width: 480px) {
  .faqbot { left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); right: 12px; }
  .faqbot__panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    max-height: 82vh;
    border-radius: 22px 22px 0 0;
  }
  .faqbot__launcher { font-size: 0.88rem; padding: 0.58rem 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .faqbot__launcher, .faqbot__launcher:hover { transition: none; transform: none; }
}
