/* chat.css — the "Ask us" chat on dlpsl.com: floating button, the chat sheet, quick answers, and the leave-your-details form.
   Uses the page's tokens (--blue, --ink, --muted, --line, --ease). Server: meanbrian/swim-booking src/chat.js + src/leads.js. */
.ch-fab {
  position: fixed; z-index: 45; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; gap: 9px; padding: 13px 18px 13px 15px; border-radius: 999px;
  font: 600 15px/1 "Inter", system-ui, sans-serif; color: #fff; cursor: pointer;
  background: rgba(30, 143, 255, .82); border: 1px solid rgba(255, 255, 255, .22);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 10px 34px rgba(30, 143, 255, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.ch-fab:hover { transform: translateY(-2px); }
.ch-fab:active { transform: scale(.96); }
.ch-fab svg { width: 20px; height: 20px; }
.ch-fab[hidden] { display: none; }

.ch-panel {
  position: fixed; z-index: 46; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100svh - 32px));
  display: flex; flex-direction: column; overflow: hidden; border-radius: 26px;
  background: rgba(16, 18, 22, .9); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-family: "Inter", system-ui, sans-serif; color: var(--ink);
  opacity: 0; transform: translateY(16px) scale(.98); pointer-events: none; visibility: hidden;
  transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s linear .35s;
}
.ch-panel.open { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .3s var(--ease), transform .35s var(--ease), visibility 0s; }
@media (max-width: 560px) {
  .ch-panel { right: 0; left: 0; bottom: 0; width: 100%; height: min(88svh, 720px); border-radius: 26px 26px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
}

.ch-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 12px 16px; border-bottom: 1px solid var(--line); }
.ch-head img { width: 36px; height: 36px; border-radius: 50%; background: #000; }
.ch-title { flex: 1; min-width: 0; }
.ch-title b { display: block; font-size: 15px; }
.ch-title span { font-size: 12.5px; color: var(--muted); }
.ch-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); color: var(--ink); font-size: 18px; cursor: pointer; }

.ch-log { flex: 1; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 9px; overscroll-behavior: contain; }
.ch-msg { max-width: 86%; padding: 10px 13px; border-radius: 18px; font-size: 15px; line-height: 1.45; white-space: pre-line; word-break: break-word; }
.ch-msg.bot { align-self: flex-start; background: rgba(255, 255, 255, .07); border-bottom-left-radius: 6px; }
.ch-msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.ch-msg.typing { color: var(--muted); }
.ch-msg a { color: var(--blue-hi); }

.ch-quick { display: flex; gap: 7px; overflow-x: auto; padding: 4px 14px 10px; scrollbar-width: none; }
.ch-quick::-webkit-scrollbar { display: none; }
.ch-chip {
  flex: none; padding: 8px 12px; border-radius: 999px; font: 600 13.5px "Inter", system-ui, sans-serif; cursor: pointer;
  color: var(--ink); background: rgba(255, 255, 255, .06); border: 1px solid var(--line); white-space: nowrap;
}
.ch-chip:active { transform: scale(.96); }
.ch-chip.lead { background: rgba(30, 143, 255, .16); border-color: rgba(30, 143, 255, .5); }

.ch-in { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.ch-in input {
  flex: 1; min-width: 0; padding: 12px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); color: var(--ink); font: 16px "Inter", system-ui, sans-serif; outline: none;
}
.ch-in input:focus { border-color: rgba(30, 143, 255, .6); }
.ch-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; cursor: pointer; display: grid; place-items: center; }
.ch-send:disabled { opacity: .45; }
.ch-send svg { width: 18px; height: 18px; }

/* leave-your-details form, shown inside the chat */
.ch-form { align-self: stretch; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.ch-form h4 { margin: 0; font-size: 15px; }
.ch-form label.f { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.ch-form input[type=text], .ch-form input[type=tel], .ch-form textarea {
  padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .35);
  color: var(--ink); font: 16px "Inter", system-ui, sans-serif; outline: none; resize: none;
}
.ch-form input:focus, .ch-form textarea:focus { border-color: rgba(30, 143, 255, .6); }
.ch-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-seg button { padding: 7px 11px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--ink); font: 600 13px "Inter", system-ui, sans-serif; cursor: pointer; }
.ch-seg button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ch-ok { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.ch-ok input { margin-top: 2px; width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.ch-ok a { color: var(--blue-hi); }
.ch-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ch-err { color: #ff6b6b; font-size: 13px; min-height: 0; }
.ch-submit { padding: 12px; border-radius: 14px; border: 0; background: var(--blue); color: #fff; font: 600 15px "Inter", system-ui, sans-serif; cursor: pointer; }
.ch-submit:disabled { opacity: .5; }

@media (prefers-reduced-motion: reduce) { .ch-panel, .ch-fab { transition: none; } }
