/* The support assistant's chat box (support/chat.js) on the homepage and in the portal: a gold Ask button and a panel.
   Its own tokens fall back to the site's, so it looks the same on both pages. */
.gr-ask, .gr-chat {
  --gr-gold: var(--gold, #e2c46c);
  --gr-gold-soft: var(--gold-soft, #f3dc93);
  --gr-ink: var(--ink, #f5f3ec);
  --gr-muted: var(--muted, #aab2be);
  --gr-quiet: var(--quiet, #7f8997);
  --gr-line: var(--line, rgba(255, 255, 255, .08));
  --gr-surface: #0e1014;
  --gr-raised: #15181e;
  --gr-bottom: max(16px, env(safe-area-inset-bottom));
  font-family: var(--body, "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
}
.gr-ask {
  position: fixed; right: 16px; bottom: var(--gr-bottom); z-index: 45;
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; background: linear-gradient(180deg, #f0d584, var(--gr-gold)); color: #16140b;
  font: 700 15px/1 var(--body, "Inter", system-ui, sans-serif); letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 14px 32px -12px rgba(0, 0, 0, .8), 0 10px 26px -12px rgba(226, 196, 108, .55), 0 0 0 1px rgba(255, 255, 255, .12) inset, inset 0 1px rgba(255, 255, 255, .45);
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), bottom .45s cubic-bezier(.2, .7, .2, 1), right .45s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}
.gr-ask:hover { transform: translateY(-2px); }
.gr-ask:focus-visible { outline: 2px solid var(--gr-gold-soft); outline-offset: 3px; }
.gr-ask svg { width: 20px; height: 20px; flex: 0 0 auto; }
/* .gr-tuck: a control or a figure lies under the button (chat.js); a keyboard user who reaches it still sees it. */
.gr-ask[aria-expanded="true"], .gr-ask.gr-tuck:not(:focus-visible) { opacity: 0; pointer-events: none; }
/* Phones: inside the homepage's bottom bar, beside "Request access", as tall as it, while the bar shows (owner 2026-10-11):
   always seen and covering nothing; it sat above the bar, over the page (A-Z #71). There it is the round icon alone: with the
   word the bar needs 378 px and a 390 phone gives 366, so its two lines broke into five. The word stays for screen readers. */
@media (max-width: 640px) {
  .sticky-cta:has(~ .gr-ask) { padding-right: 60px; }
  .sticky-cta.show ~ .gr-ask { right: 21px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 9px); width: 44px; min-height: 44px; padding: 0; justify-content: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, inset 0 1px rgba(255, 255, 255, .45); }
  .sticky-cta.show ~ .gr-ask > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* the circle rides in with the bar and the pill fades back in: both snapped in one frame, the circle above the still rising
   bar (live audit 2026-10-12) */
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) {
  .sticky-cta.show ~ .gr-ask { animation: gr-ride .45s cubic-bezier(.2, .7, .2, 1); }
  .sticky-cta:not(.show) ~ .gr-ask { animation: gr-back .3s cubic-bezier(.2, .7, .2, 1); }
}
@keyframes gr-ride { from { translate: 0 96px; } }
@keyframes gr-back { from { opacity: 0; translate: 0 8px; } }
/* a 360 phone: 12 px less around Request access keeps "Private access / Reply by email" on two lines */
@media (max-width: 374px) {
  .sticky-cta:has(~ .gr-ask) { gap: 8px; }
  .sticky-cta:has(~ .gr-ask) .btn { padding: 0 12px; }
}

.gr-chat {
  position: fixed; right: 16px; bottom: var(--gr-bottom); z-index: 46;
  display: flex; flex-direction: column; width: 384px; height: min(600px, calc(100vh - 112px)); height: min(600px, calc(100dvh - 112px));
  border: 1px solid rgba(226, 196, 108, .22); border-radius: 20px; background: var(--gr-surface); color: var(--gr-ink);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .9); overflow: hidden;
}
.gr-chat[hidden] { display: none; }
/* it fades and rises in, and fades out, like the Ask button beside it; it came and went in one frame (A-Z #72) */
@media (prefers-reduced-motion: no-preference) {
  .gr-chat { transition: opacity .22s, translate .22s cubic-bezier(.2, .7, .2, 1), display .22s allow-discrete; }
  .gr-chat[hidden] { opacity: 0; translate: 0 12px; }
  @starting-style { .gr-chat { opacity: 0; translate: 0 12px; } }
}
.gr-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px 14px 18px; border-bottom: 1px solid var(--gr-line); background: linear-gradient(180deg, rgba(226, 196, 108, .07), transparent); }
.gr-head-text { flex: 1 1 auto; min-width: 0; }
.gr-title { margin: 0; font: 700 16px/1.25 var(--display, "Geist", "Inter", system-ui, sans-serif); letter-spacing: normal; color: var(--gr-ink); }   /* the portal's; the homepage's h2 rule gave it -0.64 px (audit 19 Oct #95) */
.gr-sub { margin: 3px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--gr-quiet); }
.gr-close { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; margin: -4px -2px 0 0; border: 1px solid var(--gr-line); border-radius: 50%; background: transparent; color: var(--gr-muted); cursor: pointer; }
.gr-close svg { width: 16px; height: 16px; }
.gr-close:hover, .gr-close:focus-visible { color: var(--gr-gold-soft); border-color: rgba(226, 196, 108, .5); outline: none; }

.gr-log { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.gr-msg { max-width: 88%; padding: 10px 13px; border-radius: 15px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.gr-msg a { color: var(--gr-gold); text-decoration: underline; text-underline-offset: 2px; }
.gr-msg.gr-bot { align-self: flex-start; background: var(--gr-raised); border: 1px solid var(--gr-line); border-bottom-left-radius: 5px; color: var(--gr-ink); }
.gr-msg.gr-me { align-self: flex-end; background: rgba(226, 196, 108, .14); border: 1px solid rgba(226, 196, 108, .28); border-bottom-right-radius: 5px; color: var(--gr-ink); }
.gr-contact { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.gr-contact a, .gr-quick button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid rgba(226, 196, 108, .4); border-radius: 999px; color: var(--gr-gold); font-size: 13px; font-weight: 600; text-decoration: none; }
.gr-contact a:hover, .gr-contact a:focus-visible, .gr-quick button:hover, .gr-quick button:focus-visible { background: rgba(226, 196, 108, .1); }
.gr-contact a:focus-visible, .gr-quick button:focus-visible { outline: 2px solid var(--gr-gold-soft); outline-offset: 2px; }   /* a visible ring, not a 1.2:1 tint (audit #129) */
.gr-quick button { background: none; font-family: inherit; text-align: left; cursor: pointer; padding-block: 7px; line-height: 1.35; }   /* the owner's quick questions; a long one wraps */
.gr-typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 13px 14px; border-radius: 15px; background: var(--gr-raised); border: 1px solid var(--gr-line); }
.gr-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--gr-quiet); animation: gr-dot 1.1s infinite ease-in-out; }
.gr-typing i:nth-child(2) { animation-delay: .15s; }
.gr-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes gr-dot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.gr-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--gr-line); }
.gr-input { flex: 1 1 auto; min-width: 0; min-height: 44px; max-height: 120px; padding: 11px 13px; border: 1px solid var(--quiet, #7f8997); border-radius: 14px; background: #0a0c0f; color: var(--gr-ink); font: 16px/1.4 var(--body, "Inter", system-ui, sans-serif); resize: none; }
.gr-input::placeholder { color: var(--gr-quiet); }
.gr-input:focus { outline: none; border-color: rgba(226, 196, 108, .55); box-shadow: 0 0 0 3px rgba(226, 196, 108, .12); }
.gr-send { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: linear-gradient(180deg, #f0d584, var(--gr-gold)); color: #16140b; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(226, 196, 108, .6), inset 0 1px rgba(255, 255, 255, .45); }
.gr-send:disabled { opacity: .45; cursor: default; }
.gr-send svg { width: 18px; height: 18px; }
.gr-note { margin: 0; padding: 6px 14px 12px; font-size: 11.5px; line-height: 1.45; color: var(--gr-quiet); }
.gr-note a { color: var(--gr-muted); text-decoration: underline; text-underline-offset: 2px; }   /* underlined on the homepage too, where a{} drops it (#95) */

/* Phones: a sheet across the bottom of the screen. */
@media (max-width: 520px) {
  .gr-ask { right: 12px; }
  .gr-chat { right: 8px; left: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; height: min(640px, calc(100vh - 88px)); height: min(640px, calc(100dvh - 88px)); border-radius: 18px; }
  .gr-msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) {
  .gr-ask { transition: none; }
  .gr-ask:hover { transform: none; }
  .gr-typing i { animation: none; opacity: .7; }
}
