/* Website chat (Oct 27): the AI chat window (chat.js). Bottom right; on phones it sits above the "Call" bar and opens
   full screen. */
.cchat-launch, .cchat {
  --cc-blue: #1B75BB; --cc-navy: #0B2340; --cc-ink: #15253A; --cc-body: #3B4A5E; --cc-muted: #556578; --cc-line: #DCE4EC;
  --cc-ground: #F3F6F9; --cc-surface: #FFFFFF; --cc-me: #1B75BB; --cc-me-ink: #FFFFFF; --cc-them: #FFFFFF; --cc-staff: #E8F3EC; --cc-staff-line: #B9DEC7;
}
html[data-theme="dark"] .cchat-launch, html[data-theme="dark"] .cchat {
  --cc-ink: #E6EDF5; --cc-body: #BAC8D8; --cc-muted: #93A6BC; --cc-line: #243A55; --cc-ground: #0D1A2B; --cc-surface: #121C28;
  --cc-them: #16263A; --cc-staff: #13302A; --cc-staff-line: #23584A;
}
.cchat-launch { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--cc-blue); color: #fff; font: 700 15px/1 var(--sans, system-ui, sans-serif); padding: 13px 18px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(11,35,64,.28); transition: transform .15s ease, box-shadow .15s ease; }
.cchat-launch:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(11,35,64,.34); }
.cchat-launch:focus-visible { outline: 3px solid #00ADEE; outline-offset: 3px; }
.cchat-launch.is-open { display: none; }
.cchat-badge { position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; border-radius: 10px; background: #E34948; color: #fff; font: 700 12px/20px var(--sans, sans-serif); text-align: center; padding: 0 5px; }

.cchat { position: fixed; right: 20px; bottom: 20px; z-index: 901; width: 384px; height: min(600px, calc(100vh - 40px)); display: flex; flex-direction: column;
  background: var(--cc-ground); color: var(--cc-ink); border: 1px solid var(--cc-line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 18px 48px rgba(11,35,64,.32); font: 15px/1.5 var(--sans, system-ui, sans-serif); }
.cchat[hidden] { display: none; }
.cchat__head { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; background: var(--cc-navy); color: #fff; }
.cchat__logo { width: 34px; height: 34px; border-radius: 10px; background: var(--cc-blue); display: grid; place-items: center; flex: none; }
.cchat__title { flex: 1; min-width: 0; display: grid; }
.cchat__title b { font: 800 16px/1.2 var(--display, sans-serif); }
.cchat__title span { font-size: 12.5px; color: #9FB4CB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cchat__icon { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #D3DEEA; display: grid; place-items: center; cursor: pointer; }
.cchat__icon:hover { background: rgba(255,255,255,.1); color: #fff; }
.cchat__menu { position: absolute; right: 10px; top: 54px; z-index: 2; background: var(--cc-surface); border: 1px solid var(--cc-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(11,35,64,.2); padding: 6px; display: grid; min-width: 190px; }
.cchat__menu[hidden] { display: none; }
.cchat__menu button { text-align: left; border: 0; background: none; color: var(--cc-ink); font: 600 14px var(--sans, sans-serif); padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.cchat__menu button:hover { background: var(--cc-ground); }
.cchat__banner { background: #FFF6E6; color: #5B3A07; font-size: 13.5px; padding: 8px 14px; border-bottom: 1px solid #F3D19C; }
html[data-theme="dark"] .cchat__banner { background: #3A2A0E; color: #F5D9A6; border-color: #5C4313; }
.cchat__log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.cchat__msg { display: flex; flex-direction: column; max-width: 86%; }
.cchat__msg--visitor { align-self: flex-end; align-items: flex-end; }
.cchat__who { font-size: 11.5px; font-weight: 700; color: var(--cc-muted); margin: 0 0 3px 4px; text-transform: uppercase; letter-spacing: .04em; }
.cchat__bubble { padding: 9px 13px; border-radius: 14px; background: var(--cc-them); color: var(--cc-ink); border: 1px solid var(--cc-line); overflow-wrap: anywhere; }
.cchat__bubble p { margin: 0 0 6px; } .cchat__bubble p:last-child { margin: 0; }
.cchat__bubble ul { margin: 4px 0 6px; padding-left: 20px; } .cchat__bubble li { margin: 2px 0; }
.cchat__bubble a { color: var(--cc-blue); font-weight: 600; }
html[data-theme="dark"] .cchat__bubble a { color: #7CC3F2; }
.cchat__msg--ai .cchat__bubble { border-top-left-radius: 4px; }
.cchat__msg--staff .cchat__bubble { background: var(--cc-staff); border-color: var(--cc-staff-line); border-top-left-radius: 4px; }
.cchat__msg--visitor .cchat__bubble { background: var(--cc-me); color: var(--cc-me-ink); border-color: var(--cc-me); border-top-right-radius: 4px; }
.cchat__msg--visitor .cchat__bubble a { color: #fff; }
.cchat__msg.is-pending { opacity: .7; }
.cchat__sys { align-self: center; text-align: center; font-size: 13px; color: var(--cc-muted); max-width: 92%; }
.cchat__sys p { margin: 0; } .cchat__sys a { color: var(--cc-blue); }
.cchat__typing { flex-direction: row; gap: 4px; padding: 12px 14px; background: var(--cc-them); border: 1px solid var(--cc-line); border-radius: 14px; border-top-left-radius: 4px; width: max-content; }
.cchat__typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--cc-muted); animation: ccDot 1.2s infinite ease-in-out; }
.cchat__typing span:nth-child(2) { animation-delay: .15s; } .cchat__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ccDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .cchat__typing span { animation: none; } .cchat-launch { transition: none; } }
.cchat__quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cchat__quick button { border: 1px solid var(--cc-blue); color: var(--cc-blue); background: var(--cc-surface); border-radius: 999px; padding: 6px 12px; font: 600 13.5px var(--sans, sans-serif); cursor: pointer; }
html[data-theme="dark"] .cchat__quick button { color: #7CC3F2; border-color: #3A6E9E; }
.cchat__quick button:hover { background: var(--cc-blue); color: #fff; }
.cchat__card { background: var(--cc-surface); border: 1px solid var(--cc-line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; font-size: 14px; }
.cchat__card p { margin: 0; color: var(--cc-body); }
.cchat__card label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; color: var(--cc-ink); }
.cchat__card input, .cchat__card textarea { font: 15px var(--sans, sans-serif); padding: 8px 10px; border: 1px solid var(--cc-line); border-radius: 8px; background: var(--cc-ground); color: var(--cc-ink); width: 100%; box-sizing: border-box; }
.cchat__card button { justify-self: start; border: 0; background: var(--cc-blue); color: #fff; font: 700 14px var(--sans, sans-serif); padding: 9px 16px; border-radius: 8px; cursor: pointer; }
.cchat__err { color: #B4232A !important; font-size: 13px; }
.cchat__form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--cc-line); background: var(--cc-surface); }
.cchat__form textarea { flex: 1; resize: none; font: 15px/1.4 var(--sans, sans-serif); padding: 9px 12px; border: 1px solid var(--cc-line); border-radius: 12px; background: var(--cc-ground); color: var(--cc-ink); max-height: 120px; }
.cchat__form textarea:focus { outline: 2px solid var(--cc-blue); outline-offset: 0; border-color: transparent; }
.cchat__send { width: 42px; height: 42px; border-radius: 12px; border: 0; background: var(--cc-blue); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.cchat__foot { margin: 0; padding: 0 12px 9px; font-size: 11.5px; color: var(--cc-muted); background: var(--cc-surface); }
.cchat__foot a { color: inherit; }
.cchat__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 640px) {
  .cchat-launch { bottom: 76px; right: 12px; padding: 12px 15px; }
  .cchat { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; }
  html.cchat-on, html.cchat-on body { overflow: hidden; }
}
@media print { .cchat-launch, .cchat { display: none !important; } }
/* QA mode: the QA toolbar sits along the bottom by default, so the chat sits above it. */
html.fbx-on .cchat-launch { bottom: 100px; }
html.fbx-on .cchat { bottom: 100px; height: min(600px, calc(100vh - 120px)); }
html.fbx-on.fbx-pos-top .cchat-launch, html.fbx-on.fbx-pos-left .cchat-launch, html.fbx-on.fbx-pos-right .cchat-launch { bottom: 20px; }
html.fbx-on.fbx-pos-top .cchat, html.fbx-on.fbx-pos-left .cchat, html.fbx-on.fbx-pos-right .cchat { bottom: 20px; height: min(600px, calc(100vh - 40px)); }
html.fbx-on.fbx-pos-right .cchat-launch, html.fbx-on.fbx-pos-right .cchat { right: 110px; }
@media (max-width: 640px) { html.fbx-on .cchat-launch { bottom: 150px; } html.fbx-on .cchat { bottom: 150px; height: auto; } }
