
/* ==========================================================================
   22. GUEST ASSISTANT (chatbot)
   Matches the site: teal panel, gold accents, serif headings, the same
   easing curve and reveal language as the rest of the page.
   ========================================================================== */

/* ---- Launcher ---- */
.kbot__launcher{
  position:fixed;right:22px;bottom:22px;z-index:860;
  width:58px;height:58px;border-radius:50%;
  background:var(--teal);color:var(--sand);
  display:grid;place-items:center;
  box-shadow:0 18px 40px -14px rgba(9,32,29,.6),0 0 0 1px rgba(201,162,39,.35) inset;
  transition:transform .5s var(--ease),opacity .4s var(--ease),box-shadow .5s;
  will-change:transform;
}
.kbot__launcher:hover{transform:translateY(-3px) scale(1.05);box-shadow:0 24px 50px -16px rgba(9,32,29,.7),0 0 0 1px rgba(201,162,39,.6) inset}
.kbot__launcher svg{width:24px;height:24px;position:relative;z-index:2}
.kbot__launcher.is-hidden{opacity:0;pointer-events:none;transform:scale(.7)}

/* the slow gold pulse ring */
.kbot__pulse{
  position:absolute;inset:0;border-radius:50%;
  border:1px solid var(--gold);opacity:0;
  animation:kbotPulse 3.4s var(--ease-io) infinite;
}
@keyframes kbotPulse{
  0%{transform:scale(1);opacity:.55}
  70%{transform:scale(1.55);opacity:0}
  100%{transform:scale(1.55);opacity:0}
}

/* ---- Panel ---- */
.kbot{
  position:fixed;right:22px;bottom:22px;z-index:870;
  width:min(392px,calc(100vw - 32px));
  height:min(620px,calc(100vh - 44px));
  display:flex;flex-direction:column;
  background:var(--surface);color:var(--text);
  border:1px solid var(--line);
  border-radius:18px;overflow:hidden;
  box-shadow:0 40px 90px -30px rgba(9,32,29,.55),0 0 0 1px rgba(201,162,39,.14);
  transform:translateY(24px) scale(.96);opacity:0;pointer-events:none;
  transform-origin:100% 100%;
  transition:transform .55s var(--ease),opacity .4s var(--ease);
  will-change:transform,opacity;
}
.kbot.is-open{transform:none;opacity:1;pointer-events:auto}

/* ---- Head ---- */
.kbot__head{
  display:flex;align-items:center;gap:12px;
  padding:16px 16px 15px;
  background:var(--teal);color:var(--sand);
  border-bottom:1px solid rgba(201,162,39,.22);
  flex:none;
}
.kbot__avatar{
  width:40px;height:40px;border-radius:50%;flex:none;
  background:rgba(246,240,230,.08);
  display:grid;place-items:center;overflow:hidden;
  box-shadow:0 0 0 1px rgba(201,162,39,.4);
}
.kbot__avatar img{width:34px;height:34px;object-fit:contain}
.kbot__who{flex:1;min-width:0}
.kbot__name{
  font-family:var(--font-display);font-size:1.06rem;letter-spacing:.06em;
  line-height:1.2;
}
.kbot__status{
  font-size:12px;letter-spacing:.22em;text-transform:uppercase;
  color:rgba(246,240,230,.55);margin-top:3px;
  display:flex;align-items:center;gap:6px;
}
.kbot__status::before{
  content:"";width:5px;height:5px;border-radius:50%;
  background:var(--gold-soft);box-shadow:0 0 0 3px rgba(227,200,120,.18);
}
.kbot__close{
  width:32px;height:32px;border-radius:50%;flex:none;
  display:grid;place-items:center;color:rgba(246,240,230,.7);
  transition:background .3s,color .3s,transform .4s var(--ease);
}
.kbot__close:hover{background:rgba(246,240,230,.1);color:var(--sand);transform:rotate(90deg)}
.kbot__close svg{width:15px;height:15px}

/* ---- Log ---- */
.kbot__log{
  flex:1;overflow-y:auto;overscroll-behavior:contain;
  padding:18px 16px 8px;
  display:flex;flex-direction:column;gap:10px;
  scrollbar-width:thin;
  scrollbar-color:var(--line) transparent;
  background:
    radial-gradient(120% 60% at 50% 0%,rgba(201,162,39,.05),transparent 70%),
    var(--surface);
}
.kbot__log::-webkit-scrollbar{width:6px}
.kbot__log::-webkit-scrollbar-thumb{background:var(--line);border-radius:6px}

.kbot__msg{display:flex;max-width:100%}
.kbot__msg--bot{justify-content:flex-start}
.kbot__msg--user{justify-content:flex-end}

.kbot__bubble{
  max-width:86%;
  padding:11px 14px;
  font-size:.875rem;line-height:1.62;
  border-radius:14px;
  animation:kbotIn .5s var(--ease) both;
}
.kbot__msg--bot .kbot__bubble{
  background:var(--bg-alt);color:var(--text);
  border:1px solid var(--line-soft);
  border-bottom-left-radius:5px;
}
.kbot__msg--user .kbot__bubble{
  background:var(--teal);color:var(--sand);
  border-bottom-right-radius:5px;
}
@keyframes kbotIn{
  from{opacity:0;transform:translateY(8px) scale(.98)}
  to{opacity:1;transform:none}
}

/* typing dots */
.kbot__typing .kbot__bubble{display:flex;gap:5px;align-items:center;padding:14px}
.kbot__typing i{
  width:5px;height:5px;border-radius:50%;background:var(--text-dim);
  animation:kbotDot 1.2s var(--ease-io) infinite;
}
.kbot__typing i:nth-child(2){animation-delay:.15s}
.kbot__typing i:nth-child(3){animation-delay:.3s}
@keyframes kbotDot{
  0%,60%,100%{opacity:.3;transform:translateY(0)}
  30%{opacity:1;transform:translateY(-3px)}
}

/* inline link card */
.kbot__link{
  display:inline-flex;align-items:center;gap:8px;
  margin-top:2px;padding:9px 15px;
  border:1px solid var(--clay);border-radius:100px;
  font-size:12px;letter-spacing:.18em;text-transform:uppercase;
  color:var(--clay);
  transition:background .4s var(--ease),color .4s var(--ease);
  animation:kbotIn .5s var(--ease) both;
}
.kbot__link::after{content:"→";font-size:12px;letter-spacing:0}
.kbot__link:hover{background:var(--clay);color:#fff}

/* ---- Suggestion chips ---- */
.kbot__chips{
  display:flex;flex-wrap:wrap;gap:7px;
  padding:4px 16px 12px;flex:none;
}
.kbot__chips:empty{display:none}
.kbot__chip{
  padding:7px 13px;border-radius:100px;
  border:1px solid var(--line);
  font-size:12px;letter-spacing:.1em;
  color:var(--text-dim);background:transparent;
  transition:border-color .35s,color .35s,background .35s,transform .35s var(--ease);
}
.kbot__chip:hover{
  border-color:var(--clay);color:var(--clay);
  transform:translateY(-1px);
}

/* ---- Composer ---- */
.kbot__form{
  display:flex;align-items:center;gap:8px;
  padding:12px 14px 14px;flex:none;
  border-top:1px solid var(--line-soft);
  background:var(--surface);
}
.kbot__input{
  flex:1;min-width:0;
  border:1px solid var(--line);border-radius:100px;
  background:var(--bg);color:var(--text);
  padding:11px 16px;font-family:var(--font-ui);font-size:.875rem;
  outline:none;transition:border-color .35s,box-shadow .35s;
}
.kbot__input::placeholder{color:var(--text-dim);opacity:.95}
.kbot__input:focus{
  border-color:var(--clay);
  box-shadow:0 0 0 3px rgba(180,85,47,.1);
}
.kbot__send{
  width:40px;height:40px;border-radius:50%;flex:none;
  background:var(--clay);color:#fff;
  display:grid;place-items:center;
  transition:background .35s,transform .4s var(--ease);
}
.kbot__send:hover{background:var(--teal);transform:scale(1.06)}
.kbot__send svg{width:16px;height:16px}

/* ---- Small screens ---- */
@media(max-width:560px){
  .kbot{
    right:0;bottom:0;left:0;
    width:100%;height:min(78vh,600px);
    border-radius:18px 18px 0 0;
    border-bottom:0;
  }
  .kbot__launcher{right:16px;bottom:16px;width:54px;height:54px}
  /* keep the back-to-top button clear of the launcher */
  .totop{bottom:88px}
}

/* ---- Dark theme ---- */
html[data-theme="dark"] .kbot__msg--bot .kbot__bubble{
  background:rgba(246,240,230,.055);
  border-color:rgba(246,240,230,.09);
}
html[data-theme="dark"] .kbot__input{background:rgba(246,240,230,.04)}

/* ---- Reduced motion ---- */
@media(prefers-reduced-motion:reduce){
  .kbot__pulse{animation:none;opacity:0}
  .kbot__bubble,.kbot__link{animation:none}
  .kbot__typing i{animation:none;opacity:.85}
}
