/* FlareGrid virtual assistant. Uses the site theme tokens from styles.css. */
.fgc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.fgc-launch {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 0 16px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 14px/1 var(--font-sans); cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 26, 34, .16);
}
.fgc-launch svg { color: var(--amber); }
.fgc-launch:hover { border-color: var(--steel); }
.fgc-launch:focus-visible, .fgc-panel button:focus-visible, .fgc-panel a:focus-visible, .fgc-input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.fgc-hide { display: none; }

.fgc-panel {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  width: min(380px, calc(100vw - 36px)); height: min(600px, calc(100vh - 36px));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(15, 26, 34, .22);
  font-family: var(--font-sans);
}
.fgc-panel[hidden] { display: none; }

.fgc-head { display: flex; align-items: center; gap: 8px; padding: 12px 10px 12px 16px; background: var(--band); color: var(--on-band); }
.fgc-titles { flex: 1; min-width: 0; }
.fgc-title { margin: 0; font-size: 15px; line-height: 1.25; font-weight: 600; color: var(--on-band); }
.fgc-sub { margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--on-band-muted); }
.fgc-person { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--amber); background: transparent; color: var(--on-band); font: 600 13px/1 var(--font-sans); cursor: pointer; }
.fgc-person:hover { background: var(--amber); color: #1F3A4D; }
.fgc-close { flex: none; width: 40px; height: 40px; border: 0; background: transparent; color: var(--on-band); cursor: pointer; border-radius: 4px; display: grid; place-items: center; }

.fgc-body { flex: 1; overflow-y: auto; padding: 14px 14px 6px; background: var(--bg); overscroll-behavior: contain; }
.fgc-msg { display: flex; flex-direction: column; margin-bottom: 10px; }
.fgc-bot { align-items: flex-start; }
.fgc-user { align-items: flex-end; }
.fgc-bubble { max-width: 88%; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.fgc-bot .fgc-bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 3px; }
.fgc-user .fgc-bubble { background: var(--btn-bg); color: var(--btn-fg); border-top-right-radius: 3px; }
.fgc-summary { font-size: 13.5px; border-left: 3px solid var(--amber) !important; }
.fgc-link { margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.fgc-btn { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 14px; border-radius: 4px; background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; font-size: 14px; text-decoration: none; }

.fgc-chips { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; background: var(--bg); border-top: 1px solid var(--line); scrollbar-width: thin; }
.fgc-chips:empty { display: none; }
.fgc-chip { flex: none; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--steel); background: var(--surface); color: var(--ink); font: 500 13.5px/1 var(--font-sans); cursor: pointer; white-space: nowrap; }
.fgc-chip:hover { border-color: var(--ink); }

.fgc-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.fgc-input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--steel); border-radius: 4px; background: var(--surface); color: var(--ink); font: 16px var(--font-sans); }
.fgc-send { min-height: 44px; padding: 0 16px; border: 0; border-radius: 4px; background: var(--btn-bg); color: var(--btn-fg); font: 600 14px var(--font-sans); cursor: pointer; }

.fgc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px 10px; background: var(--surface); }
.fgc-note { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.fgc-note a { color: var(--muted); }
.fgc-reset { flex: none; border: 0; background: none; padding: 4px 0; color: var(--muted); font: 12px var(--font-sans); text-decoration: underline; cursor: pointer; }

/* phones: launcher sits above the Call / WhatsApp bar; the panel becomes a full-height sheet */
@media (max-width: 720px) {
  .fgc-launch { right: 12px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); min-height: 44px; padding: 0 12px; }
  .fgc-launch-label { display: none; }
  .fgc-panel { inset: 0; right: 0; bottom: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  html.fgc-open, html.fgc-open body { overflow: hidden; }
  .fgc-sub { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .fgc-panel:not([hidden]) { animation: fgc-in .16s ease-out; }
  @keyframes fgc-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media print { .fgc-launch, .fgc-panel { display: none !important; } }
