/* Remgee Assistant chat bubble */
#rga-root {
  --rga-accent: #f28c00;
  --rga-accent-ink: #1a1a1a;
  --rga-bg: #ffffff;
  --rga-surface: #f4f5f7;
  --rga-ink: #1d2733;
  --rga-muted: #5d6b7a;
  --rga-line: #dde2e8;
  --rga-user: #1d2733;
  --rga-user-ink: #ffffff;
  position: fixed;
  right: 16px;
  /* Sits above the sites' WhatsApp "Need Help?" button (bottom right, ~70px tall). */
  bottom: 96px;
  z-index: 99990;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--rga-ink);
}
@media (prefers-color-scheme: dark) {
  #rga-root {
    --rga-bg: #161b22;
    --rga-surface: #202833;
    --rga-ink: #e8edf2;
    --rga-muted: #9aa7b4;
    --rga-line: #2e3946;
    --rga-user: #f28c00;
    --rga-user-ink: #1a1a1a;
  }
}
#rga-root *, #rga-root *::before, #rga-root *::after { box-sizing: border-box; }
#rga-root .rga-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#rga-root .rga-fab {
  display: flex; align-items: center; gap: 8px;
  margin-left: auto;
  padding: 12px 18px 12px 14px;
  border: 0; border-radius: 999px;
  background: var(--rga-accent); color: var(--rga-accent-ink);
  font-family: inherit; font-weight: 600; font-size: 15px; line-height: 1;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  cursor: pointer;
}
#rga-root .rga-fab:focus-visible, #rga-root button:focus-visible, #rga-root textarea:focus-visible {
  outline: 3px solid #2563eb; outline-offset: 2px;
}
#rga-root.rga-open .rga-fab { display: none; }

#rga-root .rga-panel {
  display: flex; flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 120px));
  background: var(--rga-bg);
  border: 1px solid var(--rga-line); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  overflow: hidden;
}
#rga-root .rga-panel[hidden] { display: none; }

#rga-root .rga-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 12px 12px 16px;
  background: var(--rga-accent); color: var(--rga-accent-ink);
}
#rga-root .rga-head div { flex: 1; display: flex; flex-direction: column; }
#rga-root .rga-head span { font-size: 12px; opacity: .8; }
#rga-root .rga-head button {
  border: 0; background: rgba(0, 0, 0, .12); color: inherit;
  border-radius: 8px; padding: 6px 10px; font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1; cursor: pointer;
}
#rga-root .rga-close { font-size: 20px !important; padding: 2px 10px !important; }

#rga-root .rga-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
#rga-root .rga-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; overflow-wrap: anywhere; }
#rga-root .rga-msg p { margin: 0 0 6px; }
#rga-root .rga-msg p:last-child { margin-bottom: 0; }
#rga-root .rga-msg ul { margin: 4px 0 6px; padding-left: 18px; }
#rga-root .rga-msg a { color: inherit; text-decoration: underline; }
#rga-root .rga-assistant { align-self: flex-start; background: var(--rga-surface); border-bottom-left-radius: 4px; }
#rga-root .rga-user { align-self: flex-end; background: var(--rga-user); color: var(--rga-user-ink); border-bottom-right-radius: 4px; }
#rga-root .rga-err { border: 1px solid #d14343; }
#rga-root .rga-src { margin-top: 8px; font-size: 12px; color: var(--rga-muted); }

#rga-root .rga-typing { color: var(--rga-muted); }
#rga-root .rga-typing span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
  background: currentColor; animation: rga-blink 1.2s infinite both;
}
#rga-root .rga-typing span:nth-child(2) { animation-delay: .2s; }
#rga-root .rga-typing span:nth-child(3) { animation-delay: .4s; margin-right: 6px; }
@keyframes rga-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #rga-root .rga-typing span { animation: none; } }

#rga-root .rga-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--rga-line); }
#rga-root .rga-form textarea {
  flex: 1; resize: none; min-height: 40px; max-height: 120px;
  padding: 9px 12px; border: 1px solid var(--rga-line); border-radius: 10px;
  background: var(--rga-bg); color: var(--rga-ink); font: inherit;
}
#rga-root .rga-form button {
  width: 44px; border: 0; border-radius: 10px;
  background: var(--rga-accent); color: var(--rga-accent-ink); font-size: 18px; cursor: pointer;
}
#rga-root .rga-form button:disabled { opacity: .5; cursor: wait; }
#rga-root .rga-note { margin: 0; padding: 0 12px 10px; font-size: 11.5px; color: var(--rga-muted); }
#rga-root .rga-note a { color: inherit; }

@media (max-width: 480px) {
  #rga-root { right: 12px; bottom: 88px; }
  /* Full-screen panel on phones covers the WhatsApp button while open. */
  #rga-root.rga-open { left: 0; top: 0; right: 0; bottom: 0; z-index: 2147483000; }
  #rga-root.rga-open .rga-panel { border-radius: 0; }
  #rga-root .rga-panel { width: 100%; height: 100%; }
  #rga-root .rga-fab-label { display: none; }
  #rga-root .rga-fab { padding: 14px; }
}
