/* hårbor booking chat widget — colours/controls come from the theme tokens + components (.hb-btn, .hb-tag, .hb-input). */
.hb-chat-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 26px; background: var(--inverse-bg); color: var(--inverse-fg); font: var(--fw-semibold) var(--fs-small)/1 var(--font-sans); box-shadow: 0 0 0 1px var(--inverse-fg), var(--shadow-overlay); cursor: pointer; transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-2) var(--ease-out); }
.hb-chat-launcher:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
@media (hover: hover) { .hb-chat-launcher:hover { background: var(--inverse-bg-hover); } }
.hb-chat-launcher.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2); }

.hb-chat { position: fixed; right: 20px; bottom: 20px; z-index: 85; width: 380px; max-width: calc(100vw - 32px); height: min(620px, calc(100dvh - 40px)); display: flex; flex-direction: column; background: var(--surface-raised); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--radius-2); box-shadow: var(--shadow-overlay); font-family: var(--font-sans); overflow: hidden; animation: hb-chat-in var(--dur-2) var(--ease-out); }
@keyframes hb-chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hb-chat, .hb-chat-launcher { animation: none; transition: none; } }

.hb-chat__head { display: flex; align-items: center; gap: 4px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--border); }
.hb-chat__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hb-chat__title { font-weight: 700; font-size: 15px; }
.hb-chat__sub { font-size: 12px; color: var(--fg-muted); }

.hb-chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.hb-chat__msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.hb-chat__msg p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.hb-chat__msg--bot { align-self: flex-start; background: var(--bg-sunken); border-bottom-left-radius: 4px; }
.hb-chat__msg--me { align-self: flex-end; background: var(--inverse-bg); color: var(--inverse-fg); border-bottom-right-radius: 4px; }
.hb-chat__msg.is-error { background: var(--danger-soft); color: var(--danger); }
.hb-chat__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hb-chat__links .hb-btn { background: var(--surface-raised); }

.hb-chat__typing { display: inline-flex; gap: 4px; padding: 14px; }
.hb-chat__typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-muted); animation: hb-chat-dot 1s infinite ease-in-out; }
.hb-chat__typing span:nth-child(2) { animation-delay: .15s; }
.hb-chat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hb-chat-dot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.hb-chat__quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border); max-height: 40%; overflow-y: auto; }
.hb-chat__quick .hb-tag { height: auto; min-height: var(--control-sm); padding: 8px 12px; line-height: 1.2; }
.hb-chat__quick .hb-tag[disabled] { opacity: .5; cursor: default; }

.hb-chat__form { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.hb-chat__form .hb-input { flex: 1; min-width: 0; font-size: 16px; } /* 16px stops iOS zooming on focus */

/* Phones: full-screen panel; launcher sits above the sticky "book" bar. */
@media (max-width: 560px) {
  .hb-chat { inset: 0; width: auto; max-width: none; height: 100dvh; border: 0; border-radius: 0; }
  .hb-chat-launcher { right: 12px; bottom: calc(120px + env(safe-area-inset-bottom)); width: 52px; padding: 0; justify-content: center; }
  .hb-chat-launcher__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html:has(.hb-chat) { overflow: hidden; }
}
