/* CPAC website chat box. Navy and gold, light and dark, phone friendly. Everything is scoped under .cpac-chat. */
.cpac-chat { --cc-navy: #0d1e30; --cc-navy-2: #17315f; --cc-gold: #f5c200; --cc-bg: #ffffff; --cc-ink: #1b2430; --cc-soft: #eef2f7; --cc-line: #d6deea; --cc-muted: #5b6b80;
  position: fixed; right: 20px; bottom: 84px; z-index: 2147483000; font: 15px/1.45 "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--cc-ink); }
:root[data-theme="dark"] .cpac-chat { --cc-bg: #112036; --cc-ink: #e8eefb; --cc-soft: #1a2d47; --cc-line: #2a4062; --cc-muted: #9db0cc; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cpac-chat { --cc-bg: #112036; --cc-ink: #e8eefb; --cc-soft: #1a2d47; --cc-line: #2a4062; --cc-muted: #9db0cc; } }
.cpac-chat *, .cpac-chat *::before, .cpac-chat *::after { box-sizing: border-box; }
.cpac-chat [hidden] { display: none !important; }

.cc-launch { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px 0 14px; border: 0; border-radius: 999px; background: var(--cc-navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 22px rgba(7, 17, 30, .35); border-bottom: 3px solid var(--cc-gold); }
.cc-launch:hover { background: var(--cc-navy-2); }
.cc-launch:focus-visible, .cc-close:focus-visible, .cc-chip:focus-visible, .cc-send:focus-visible, .cc-input:focus-visible, .cc-note a:focus-visible { outline: 3px solid var(--cc-gold); outline-offset: 2px; }
.cc-open .cc-launch { display: none; }

.cc-panel { position: absolute; right: 0; bottom: 0; width: min(380px, calc(100vw - 24px)); height: min(600px, calc(100vh - 112px)); display: flex; flex-direction: column; background: var(--cc-bg);
  border: 1px solid var(--cc-line); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 50px rgba(7, 17, 30, .4); }
/* laptops and desktops: taller message area; phones keep full-screen rules below */
@media (min-width: 521px) and (min-height: 640px) {
  .cc-panel { height: min(720px, calc(100vh - 120px)); }
}
@media (min-width: 1024px) and (min-height: 720px) {
  .cc-panel { height: min(780px, calc(100vh - 140px)); width: min(400px, calc(100vw - 32px)); }
}
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; background: var(--cc-navy); color: #fff; border-bottom: 3px solid var(--cc-gold); }
.cc-title { display: flex; align-items: center; min-height: 38px; line-height: 1.25; }
.cc-title strong { font-size: 1.02rem; line-height: 1.2; }
.cc-title span { font-size: .82rem; opacity: .8; }
.cc-close { width: 44px; height: 44px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.cc-close:hover { background: rgba(255, 255, 255, .22); }

.cc-list { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--cc-bg); overscroll-behavior: contain; }
.cc-row { display: flex; }
.cc-me { justify-content: flex-end; }
.cc-bubble { max-width: 86%; padding: 9px 13px; border-radius: 16px; overflow-wrap: anywhere; word-break: break-word; }
.cc-bot .cc-bubble { background: var(--cc-soft); color: var(--cc-ink); border-bottom-left-radius: 5px; }
.cc-me .cc-bubble { background: var(--cc-navy); color: #fff; border-bottom-right-radius: 5px; }
.cc-bubble a { color: inherit; text-decoration: underline; font-weight: 600; }
.cc-me .cc-bubble a { color: var(--cc-gold); }
.cc-typing .cc-bubble { display: inline-flex; gap: 4px; padding: 12px 14px; }
.cc-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cc-muted); animation: cc-bounce 1s infinite ease-in-out; }
.cc-dot:nth-child(2) { animation-delay: .15s; } .cc-dot:nth-child(3) { animation-delay: .3s; }
@keyframes cc-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cc-dot { animation: none; } }

.cc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 10px; background: var(--cc-bg); }
.cc-chip { min-height: 40px; border: 1px solid var(--cc-line); background: var(--cc-bg); color: var(--cc-ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: .9rem; cursor: pointer; }
.cc-chip:hover { border-color: var(--cc-gold); background: var(--cc-soft); }

.cc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cc-line); background: var(--cc-bg); }
.cc-input { flex: 1; min-width: 0; min-height: 44px; padding: 8px 14px; border: 1px solid var(--cc-line); border-radius: 999px; background: var(--cc-bg); color: var(--cc-ink); font: inherit; font-size: 16px; }
.cc-send { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--cc-gold); color: var(--cc-navy); cursor: pointer; display: grid; place-items: center; }
.cc-send:disabled { opacity: .5; cursor: progress; }
.cc-note { margin: 0; padding: 0 14px 12px; font-size: .78rem; color: var(--cc-muted); background: var(--cc-bg); }
.cc-note a { color: inherit; font-weight: 700; }

@media (max-width: 520px) {
  .cpac-chat { right: 12px; bottom: 76px; }
  .cc-panel { position: fixed; inset: 8px; width: auto; height: auto; max-height: none; }
  .cc-launch-t { display: none; }
  .cc-launch { padding: 0 14px; }
}

/* on phones the chat window follows the visible screen, so the on-screen keyboard does not hide the input box */
@supports (height: 100dvh) {
  @media (max-width: 520px) { .cc-panel { bottom: auto; height: calc(100dvh - 16px); } }
}

/* while the chat covers a phone screen, the page behind it does not scroll */
html.cc-lock, html.cc-lock body { overflow: hidden; overscroll-behavior: none; }
