/* ============================================================
   PolishedSites — Smart Booking Assistant  (assistant.css)
   Self-contained, scoped under .psa-* so it never collides with
   your site's styles. Colours come from --psa-accent (set in the
   <script> config) so it auto-matches your brand.
   ============================================================ */
:root{
  --psa-accent:#1f2937;          /* overridden by config.accent */
  --psa-accent-ink:#ffffff;      /* text on the accent colour   */
  --psa-bg:#ffffff;
  --psa-panel:#ffffff;
  --psa-text:#1c1c1e;
  --psa-muted:#6b7280;
  --psa-bot:#f1f1f4;             /* bot bubble background        */
  --psa-line:rgba(0,0,0,.10);
  --psa-shadow:0 18px 50px -12px rgba(0,0,0,.34);
  --psa-radius:20px;
  --psa-font:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

/* ---- launcher bubble ---- */
.psa-launcher{
  position:fixed;right:22px;bottom:22px;z-index:2147483000;
  display:inline-flex;align-items:center;gap:.55em;
  background:var(--psa-accent);color:var(--psa-accent-ink);
  border:none;cursor:pointer;font-family:var(--psa-font);
  font-size:15px;font-weight:600;line-height:1;
  padding:14px 20px 14px 16px;border-radius:100px;
  box-shadow:var(--psa-shadow);
  transition:transform .3s cubic-bezier(.2,.8,.2,1),box-shadow .3s,opacity .25s;
}
.psa-launcher:hover{transform:translateY(-2px) scale(1.02)}
.psa-launcher svg{width:22px;height:22px;flex:none}
.psa-launcher .psa-dot{
  position:absolute;top:-3px;right:-3px;width:13px;height:13px;border-radius:50%;
  background:#22c55e;border:2px solid var(--psa-accent);
}
.psa-launcher--pulse{animation:psa-pulse 2.6s ease-in-out infinite}
@keyframes psa-pulse{0%,100%{box-shadow:var(--psa-shadow)}50%{box-shadow:var(--psa-shadow),0 0 0 12px rgba(0,0,0,0)}}
.psa-hidden{opacity:0;pointer-events:none;visibility:hidden}

/* ---- panel ---- */
.psa-panel{
  position:fixed;right:22px;bottom:22px;z-index:2147483001;
  width:380px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 40px);
  display:flex;flex-direction:column;
  background:var(--psa-panel);color:var(--psa-text);
  font-family:var(--psa-font);border-radius:var(--psa-radius);
  box-shadow:var(--psa-shadow);overflow:hidden;
  transform:translateY(14px) scale(.98);opacity:0;pointer-events:none;
  transition:transform .34s cubic-bezier(.2,.8,.2,1),opacity .26s;
}
.psa-panel.psa-open{transform:none;opacity:1;pointer-events:auto}

.psa-head{
  display:flex;align-items:center;gap:12px;padding:16px 18px;
  background:var(--psa-accent);color:var(--psa-accent-ink);
}
.psa-avatar{
  width:40px;height:40px;border-radius:50%;flex:none;
  display:grid;place-items:center;font-weight:700;font-size:16px;
  background:rgba(255,255,255,.22);
}
.psa-head-meta{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.psa-head-name{font-weight:700;font-size:15px}
.psa-head-sub{font-size:12px;opacity:.85;display:flex;align-items:center;gap:6px}
.psa-head-sub::before{content:"";width:7px;height:7px;border-radius:50%;background:#22c55e;flex:none}
.psa-close{
  margin-left:auto;background:transparent;border:none;cursor:pointer;
  color:var(--psa-accent-ink);opacity:.85;padding:6px;border-radius:8px;line-height:0;
}
.psa-close:hover{opacity:1;background:rgba(255,255,255,.15)}
.psa-close svg{width:20px;height:20px}

/* ---- message stream ---- */
.psa-stream{
  flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:10px;
  background:linear-gradient(180deg,#fafafa,var(--psa-panel));scroll-behavior:smooth;
}
.psa-row{display:flex;max-width:100%}
.psa-row--bot{justify-content:flex-start}
.psa-row--user{justify-content:flex-end}
.psa-bubble{
  max-width:80%;padding:11px 14px;border-radius:16px;font-size:14.5px;line-height:1.5;
  animation:psa-in .28s cubic-bezier(.2,.8,.2,1) both;word-wrap:break-word;
}
.psa-row--bot .psa-bubble{background:var(--psa-bot);color:var(--psa-text);border-bottom-left-radius:5px}
.psa-row--user .psa-bubble{background:var(--psa-accent);color:var(--psa-accent-ink);border-bottom-right-radius:5px}
@keyframes psa-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}

.psa-typing{display:inline-flex;gap:4px;padding:14px 16px}
.psa-typing span{width:7px;height:7px;border-radius:50%;background:var(--psa-muted);opacity:.5;animation:psa-bounce 1.1s infinite}
.psa-typing span:nth-child(2){animation-delay:.15s}
.psa-typing span:nth-child(3){animation-delay:.3s}
@keyframes psa-bounce{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-5px);opacity:.9}}

/* ---- choice chips ---- */
.psa-choices{display:flex;flex-wrap:wrap;gap:8px;padding:2px 2px 4px;justify-content:flex-end}
.psa-chip{
  background:var(--psa-bg);color:var(--psa-accent);border:1.5px solid var(--psa-accent);
  border-radius:100px;padding:9px 15px;font-size:13.5px;font-weight:600;cursor:pointer;
  font-family:inherit;transition:background .2s,color .2s,transform .2s;
}
.psa-chip:hover{background:var(--psa-accent);color:var(--psa-accent-ink);transform:translateY(-1px)}

/* ---- input dock ---- */
.psa-dock{display:flex;gap:8px;padding:12px;border-top:1px solid var(--psa-line);background:var(--psa-panel)}
.psa-input{
  flex:1;border:1.5px solid var(--psa-line);border-radius:100px;padding:11px 16px;
  font-size:14.5px;font-family:inherit;color:var(--psa-text);outline:none;background:var(--psa-bg);
  transition:border-color .2s;
}
.psa-input:focus{border-color:var(--psa-accent)}
.psa-send{
  flex:none;width:44px;height:44px;border-radius:50%;border:none;cursor:pointer;
  background:var(--psa-accent);color:var(--psa-accent-ink);display:grid;place-items:center;
  transition:transform .2s,opacity .2s;
}
.psa-send:hover{transform:scale(1.06)}
.psa-send:disabled{opacity:.4;cursor:default;transform:none}
.psa-send svg{width:19px;height:19px}
.psa-skip{
  background:none;border:none;color:var(--psa-muted);font-size:12.5px;font-family:inherit;
  cursor:pointer;text-decoration:underline;padding:4px 8px;align-self:center;
}
.psa-skip:hover{color:var(--psa-text)}

/* ---- booking CTA ---- */
.psa-book{
  display:inline-flex;align-items:center;gap:.5em;align-self:flex-start;margin-top:2px;
  background:var(--psa-accent);color:var(--psa-accent-ink);text-decoration:none;
  border-radius:100px;padding:11px 20px;font-size:14px;font-weight:700;
  box-shadow:0 8px 22px -8px rgba(0,0,0,.4);transition:transform .25s;
}
.psa-book:hover{transform:translateY(-2px)}
.psa-foot{font-size:11px;color:var(--psa-muted);text-align:center;padding:7px 12px}
.psa-foot a{color:var(--psa-muted)}

/* ---- mobile: full-screen sheet ---- */
@media (max-width:480px){
  .psa-panel{right:0;bottom:0;width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;border-radius:0}
  .psa-launcher{right:16px;bottom:16px}
}

@media (prefers-reduced-motion:reduce){
  .psa-launcher,.psa-panel,.psa-bubble,.psa-send,.psa-book,.psa-chip{transition:none;animation:none}
  .psa-launcher--pulse{animation:none}
  .psa-typing span{animation-duration:0s}
}
