/* The booking assistant: the floating "Bee'ye sor" button and the chat
   panel. Shared by the booking page (/randevu/{slug}, book/book.js) and
   the home page (site/concierge.js). Loaded by book/assistant.js when it
   mounts, and statically by index.html for the placeholder button.
   Colours fall back to the Rezbee palette where a page defines no vars. */

.ai-fab { position: fixed; right: 16px; bottom: calc(var(--ai-fab-bottom, 84px) + env(safe-area-inset-bottom)); z-index: 21; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; border: 0; border-radius: 999px; background: var(--secondary, #1A1A2E); color: #fff; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; box-shadow: 0 10px 24px rgba(10,30,35,.25); transition: transform .2s ease, box-shadow .2s ease; }
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(10,30,35,.3); }
.ai-fab:disabled { opacity: .7; cursor: progress; }
.ai-fab img { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.ai-fab.hidden { display: none; }

.ai-panel[hidden] { display: none; }
.ai-panel { position: fixed; right: 16px; bottom: 16px; z-index: 1300; width: 380px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--card, #fff); border-radius: 20px; box-shadow: 0 20px 60px rgba(10,30,35,.28); overflow: hidden; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text, #333); }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--secondary, #1A1A2E); color: #fff; }
.ai-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.ai-head-text strong { font-size: 15px; }
.ai-head-text span { font-size: 12px; color: rgba(255,255,255,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 8px; background: var(--bg, #F4F8F9); }
.ai-msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.assistant { align-self: flex-start; background: #fff; color: var(--text, #333); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(10,30,35,.06); }
.ai-msg.user { align-self: flex-end; background: var(--primary, #00BCD4); color: #fff; border-bottom-right-radius: 6px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; }
.ai-chip { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--primary-light, #B2EBF2); background: #fff; color: var(--primary-ink, #00747F); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.ai-chip:hover { background: #ECFBFD; }
.ai-typing { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; color: var(--muted, #6B7A7E); }
.ai-dots { display: inline-flex; align-items: center; gap: 4px; height: 14px; }
.ai-dots i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary, #00BCD4); animation: ai-bounce 1.1s ease-in-out infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; }
.ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
.ai-msg .ai-link { color: var(--primary-ink, #00747F); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(0,188,212,.5); text-underline-offset: 2px; }
.ai-msg button.ai-link { background: none; border: 0; padding: 0; margin: 0; font: inherit; font-weight: 700; cursor: pointer; white-space: inherit; text-align: left; }
.ai-msg .ai-link:hover { color: var(--primary, #00BCD4); }
.ai-error { align-self: stretch; padding: 9px 12px; border-radius: 12px; background: #FDECEC; color: #8B1D1D; font-size: 13px; }
.ai-card { align-self: stretch; background: #fff; border: 1.5px solid var(--primary-light, #B2EBF2); border-radius: 16px; padding: 12px 14px; margin: 2px 0 4px; }
.ai-card-title { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--primary-ink, #00747F); margin-bottom: 8px; }
.ai-card-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 3px 0; }
.ai-card-row span { color: var(--text-light, #666); flex: none; }
.ai-card-row strong { text-align: right; overflow-wrap: anywhere; }
.ai-card-btn { display: block; width: 100%; margin-top: 10px; padding: 12px; border: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary, #00BCD4), var(--primary-dark, #0097A7)); color: #fff; font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.ai-card-sub { margin-top: 8px; font-size: 12px; color: var(--muted, #6B7A7E); text-align: center; }
.ai-card.done { border-color: #BFE8CF; background: #F3FBF6; }
.ai-card.done .ai-card-title { color: var(--ok, #1E8E3E); }
.ai-card-btn.link { text-decoration: none; text-align: center; margin-top: 10px; }
/* The concierge's hand-off: the business the visitor chose */
.ai-card.handoff { border-color: var(--secondary, #1A1A2E); }
.ai-card.handoff .ai-card-title { color: var(--secondary, #1A1A2E); }
.ai-card.handoff .ai-card-name { font-size: 16px; font-weight: 800; color: var(--secondary, #1A1A2E); margin-bottom: 4px; }
.ai-card.handoff .ai-card-body { font-size: 13px; color: var(--text-light, #666); line-height: 1.4; }
.ai-card.handoff .ai-card-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; font-weight: 700; }
.ai-card.handoff .ai-card-links a, .ai-card.handoff .ai-card-links button { color: var(--primary-ink, #00747F); background: none; border: 0; padding: 0; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.ai-card.handoff .ai-card-links a:hover, .ai-card.handoff .ai-card-links button:hover { text-decoration: underline; }
.ai-verify { align-self: stretch; background: #fff; border: 1.5px solid var(--line, #E3EBED); border-radius: 16px; padding: 12px 14px; margin: 2px 0 4px; }
.ai-verify .rw-title { font-size: 15px; margin: 0 0 4px; }
.ai-verify-cancel { display: block; margin: 6px auto 0; }
.ai-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line, #E3EBED); background: #fff; }
.ai-form textarea { flex: 1; min-width: 0; resize: none; border: 1.5px solid var(--line, #E3EBED); border-radius: 18px; padding: 10px 14px; font-family: inherit; font-size: 15px; line-height: 1.35; max-height: 120px; background: var(--bg, #F4F8F9); color: inherit; }
.ai-form textarea:focus { outline: none; border-color: var(--primary, #00BCD4); background: #fff; }
.ai-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--primary, #00BCD4); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ai-send:disabled { opacity: .5; cursor: default; }
.ai-foot { margin: 0; padding: 0 14px calc(10px + env(safe-area-inset-bottom)); font-size: 11px; color: var(--muted, #6B7A7E); background: #fff; text-align: center; }
@media (max-width: 720px) {
  .ai-panel { right: 0; bottom: 0; left: 0; width: auto; max-width: none; height: 92vh; height: 92dvh; max-height: none; border-radius: 20px 20px 0 0; }
  body.ai-open { overflow: hidden; }
  body.ai-open .bar { display: none; }
}
