/* StarReach AI chat widget — floating assistant, bottom-right.
 * Direction B restyle (2026-11-12): sky blue + white lead, gold accent,
 * deep slate text. No navy. Header title colour is set explicitly —
 * the global h1-h4 rule in styles.css otherwise overrides the inherited
 * header colour and renders the title dark-on-dark. */
.sr-chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  width: 60px; height: 60px; border: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 32px rgba(15, 90, 163, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.sr-chat-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(15, 90, 163, 0.45); }
.sr-chat-fab:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; }
.sr-chat-fab svg { width: 28px; height: 28px; }
.sr-chat-fab .sr-chat-close-icon { display: none; }
.sr-chat-fab.open .sr-chat-open-icon { display: none; }
.sr-chat-fab.open .sr-chat-close-icon { display: block; }
.sr-chat-fab .sr-chat-dot {
  position: absolute; top: 2px; right: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #2fbf71; border: 3px solid #fff;
}
.sr-chat-panel {
  position: fixed; right: 22px; bottom: 94px; z-index: 900;
  width: 400px; max-width: calc(100vw - 32px); height: 560px; max-height: calc(100dvh - 140px);
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(23, 39, 63, 0.22);
  display: none; flex-direction: column; overflow: hidden;
}
.sr-chat-panel.open { display: flex; animation: sr-chat-in 0.18s ease-out; }
@keyframes sr-chat-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.sr-chat-head {
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
}
.sr-chat-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-hi) 100%);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: var(--ink);
}
.sr-chat-head h2 { font-size: 16px; margin: 0; line-height: 1.25; color: var(--ink); }
.sr-chat-head p { margin: 2px 0 0; font-size: 12px; color: var(--blue-dark); display: flex; align-items: center; gap: 6px; }
.sr-chat-online { width: 8px; height: 8px; border-radius: 50%; background: #2fbf71; display: inline-block; }
.sr-chat-msgs {
  flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px;
  background: #f3f8fd;
}
.sr-chat-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5; }
.sr-chat-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line-soft); border-bottom-left-radius: 4px; color: var(--ink); }
.sr-chat-msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.sr-chat-msg.bot a { color: var(--blue-dark); }
.sr-chat-typing { align-self: flex-start; background: #fff; border: 1px solid var(--line-soft); border-radius: 16px; border-bottom-left-radius: 4px; padding: 12px 16px; display: flex; gap: 5px; }
.sr-chat-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: sr-typing 1.2s infinite; }
.sr-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.sr-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sr-typing { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
.sr-chat-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 10px; background: #f3f8fd; }
.sr-chat-chip {
  border: 1px solid var(--blue); color: var(--blue-dark); background: #fff;
  border-radius: 999px; padding: 7px 13px; font-size: 13px; cursor: pointer;
  transition: background 0.15s ease;
}
.sr-chat-chip:hover { background: var(--blue-soft); }
.sr-chat-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-soft); background: #fff; }
.sr-chat-form input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; font-size: 14px;
  background: var(--bg0); color: var(--ink);
}
.sr-chat-form input:focus { outline: 2px solid var(--blue); border-color: var(--blue); }
.sr-chat-form button {
  flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center;
}
.sr-chat-form button:hover { background: var(--blue-dark); }
.sr-chat-form button svg { width: 18px; height: 18px; }
.sr-chat-note { font-size: 11px; color: var(--faint); text-align: center; padding: 6px 0 10px; background: #fff; }
@media (max-width: 480px) {
  .sr-chat-fab { right: 16px; bottom: 16px; }
  .sr-chat-panel {
    left: 12px; right: 12px; bottom: 86px; width: auto; max-width: none;
    height: calc(100dvh - 102px); max-height: calc(100dvh - 102px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sr-chat-fab { transition: none; }
  .sr-chat-fab:hover { transform: none; }
  .sr-chat-panel.open { animation: none; }
  .sr-chat-chip { transition: none; }
  .sr-chat-typing span { animation: none; opacity: 0.55; }
}
