/* RHG assistant widget. Colours are the site's own tokens, repeated here
   with fallbacks so the widget also renders on a page without momentum.css. */
.rhga-launch, .rhga-panel {
  --a-void: var(--void, #070b18);
  --a-void-2: var(--void-2, #0f1428);
  --a-void-3: var(--void-3, #1c2440);
  --a-chalk: var(--chalk, #eef2f9);
  --a-chalk-2: var(--chalk-2, #93a1b8);
  --a-brand: var(--brand, #50b0e0);
  --a-brand-ink: var(--brand-ink, #04101f);
  --a-deep: var(--brand-deep, #202060);
  --a-ease: var(--ease, cubic-bezier(.16,1,.3,1));
  font-family: "Archivo", ui-sans-serif, system-ui, sans-serif;
  box-sizing: border-box;
}
.rhga-panel *, .rhga-panel *::before, .rhga-panel *::after { box-sizing: inherit; }

/* --- launcher ------------------------------------------------------------ */
.rhga-launch {
  position: fixed; z-index: 70;
  right: clamp(1rem, 2.4vw, 1.75rem); bottom: clamp(1rem, 2.4vw, 1.75rem);
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 48px; padding: .8rem 1.25rem;
  border: 0; border-radius: 999px;
  background: var(--a-brand); color: var(--a-brand-ink);
  font-weight: 650; font-size: .95rem; letter-spacing: .01em;
  box-shadow: 0 10px 30px rgba(4,16,31,.35), 0 0 0 1px rgba(255,255,255,.08) inset;
  cursor: pointer;
  transition: transform 200ms var(--a-ease), box-shadow 200ms var(--a-ease);
}
.rhga-launch:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(4,16,31,.45); }
.rhga-launch:focus-visible { outline: 2px solid var(--a-chalk); outline-offset: 3px; }
.rhga-launch__dot {
  width: .55rem; height: .55rem; border-radius: 50%;
  background: var(--a-deep);
  box-shadow: 0 0 0 3px rgba(32,32,96,.25);
}
.rhga-open .rhga-launch { opacity: 0; pointer-events: none; }

/* --- panel --------------------------------------------------------------- */
.rhga-panel {
  position: fixed; z-index: 71;
  right: clamp(1rem, 2.4vw, 1.75rem); bottom: clamp(1rem, 2.4vw, 1.75rem);
  width: min(26rem, calc(100vw - 2rem));
  height: min(40rem, calc(100vh - 2rem));
  display: flex; flex-direction: column;
  background: var(--a-void-2); color: var(--a-chalk);
  border: 1px solid var(--a-void-3); border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
  overflow: hidden;
  animation: rhga-in 320ms var(--a-ease);
}
.rhga-panel[hidden] { display: none; }
@keyframes rhga-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.rhga-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.1rem .9rem 1.25rem;
  border-bottom: 1px solid var(--a-void-3);
  background: linear-gradient(180deg, rgba(80,176,224,.08), transparent);
}
.rhga-title {
  margin: 0; font-family: "Bricolage", "Archivo", sans-serif;
  font-variation-settings: "wght" 700, "wdth" 92;
  font-size: 1.15rem; line-height: 1.2; color: var(--a-chalk);
}
.rhga-sub { margin: .2rem 0 0; font-size: .8rem; color: var(--a-chalk-2); }
.rhga-close {
  flex: none; width: 44px; height: 44px; margin: -.4rem -.3rem 0 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--a-chalk-2);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.rhga-close:hover { background: var(--a-void-3); color: var(--a-chalk); }
.rhga-close:focus-visible, .rhga-chip:focus-visible, .rhga-send:focus-visible, .rhga-restart:focus-visible,
.rhga-foot a:focus-visible { outline: 2px solid var(--a-brand); outline-offset: 2px; }

.rhga-badge {
  margin: 0; padding: .55rem 1.25rem;
  background: #3a2a05; color: #ffd98a; font-size: .78rem; line-height: 1.4;
}

/* --- messages ------------------------------------------------------------ */
.rhga-log {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .65rem;
  scrollbar-width: thin; scrollbar-color: var(--a-void-3) transparent;
}
.rhga-msg {
  max-width: 88%; padding: .7rem .9rem; border-radius: 14px;
  font-size: .95rem; line-height: 1.5;
}
.rhga-msg p { margin: 0; }
.rhga-msg p + p { margin-top: .55rem; }
.rhga-msg--agent { align-self: flex-start; background: var(--a-void-3); border-bottom-left-radius: 4px; }
.rhga-msg--visitor { align-self: flex-end; background: var(--a-brand); color: var(--a-brand-ink); border-bottom-right-radius: 4px; }
.rhga-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.rhga-typing { display: inline-flex; gap: .3rem; padding: .85rem 1rem; }
.rhga-typing i {
  width: .45rem; height: .45rem; border-radius: 50%; background: var(--a-chalk-2);
  animation: rhga-dot 1.1s infinite ease-in-out;
}
.rhga-typing i:nth-child(2) { animation-delay: .15s; }
.rhga-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rhga-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.rhga-chips { display: flex; flex-wrap: wrap; gap: .45rem; padding: 0 1.1rem; }
.rhga-chips:not(:empty) { padding-bottom: .75rem; }
.rhga-chip {
  min-height: 40px; padding: .5rem .85rem;
  border: 1px solid rgba(80,176,224,.45); border-radius: 999px;
  background: transparent; color: var(--a-chalk); font: inherit; font-size: .85rem;
  cursor: pointer;
}
.rhga-chip:hover { background: rgba(80,176,224,.12); border-color: var(--a-brand); }

/* --- composer ------------------------------------------------------------ */
.rhga-form {
  display: flex; align-items: flex-end; gap: .5rem;
  margin: 0 .9rem; padding: .4rem .4rem .4rem .9rem;
  border: 1px solid var(--a-void-3); border-radius: 14px; background: var(--a-void);
}
.rhga-form:focus-within { border-color: var(--a-brand); }
.rhga-input {
  flex: 1; min-height: 40px; max-height: 140px; padding: .6rem 0;
  border: 0; outline: 0; resize: none; background: transparent;
  color: var(--a-chalk); font: inherit; font-size: 1rem; line-height: 1.4;
}
.rhga-input::placeholder { color: var(--a-chalk-2); }
.rhga-send {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 10px;
  background: var(--a-brand); color: var(--a-brand-ink); cursor: pointer;
  display: grid; place-items: center;
}
.rhga-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rhga-send:disabled { opacity: .5; cursor: progress; }

.rhga-foot { padding: .7rem 1.25rem .9rem; font-size: .74rem; line-height: 1.45; color: var(--a-chalk-2); }
.rhga-foot p { margin: 0; }
.rhga-foot p + p { margin-top: .3rem; }
.rhga-foot a, .rhga-restart { color: var(--a-chalk); text-decoration: underline; text-underline-offset: 2px; }
.rhga-restart { border: 0; padding: 0; background: none; font: inherit; cursor: pointer; }

/* --- phone: a full-height sheet ------------------------------------------ */
@media (max-width: 520px) {
  .rhga-panel {
    inset: 0; width: 100%; height: 100%; height: 100dvh;
    border-radius: 0; border: 0;
  }
  .rhga-open body { overflow: hidden; }
  .rhga-launch { padding: .75rem 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rhga-panel, .rhga-typing i { animation: none; }
  .rhga-launch { transition: none; }
}
