/* Ask Avvi v4.0.1 (avvi-ux-bot.css). 4.0.1: the open panel never reaches the site header (top edge stays below it, --avx-top set by the script from the real header).
   Ask Avvi v4 (avvi-ux-bot.css). Served from /wp-content/uploads/avvi-site/ by mu-plugin avvi-ux-bot.php.
   v4.0.0 (2026-11-06, builder "bot-consent"): the production robot is back as the launcher (the live "Avvi buddy":
   white egg robot, glowing purple eyes that blink and follow the pointer, same 91 x 103 box at right 22, bottom 14).
   The panel keeps the production look (purple gradient header, white bubbles, purple user bubbles, pill chips,
   tinted input) but opens wide: 600px at 1280px and up, 560px to 1100px, 520px below, never wider than the screen
   minus 32px, always on screen. 16px text in messages and input. No bot at all under 700px wide.
   Everything is scoped to #avx-root, except: (1) the rules that hide the old inline bot that older pages
   still carry, and (2) a small spacer under the site footer so the robot never sits on footer text. */

/* 1. Old inline bot (some pages still carry their own copy): hide it everywhere, phones included. */
html.avx-on #avviFab, html.avx-on .avvi-fab, html.avx-on #avviFabPanel, html.avx-on #avvi-buddy-root,
html.avx-on #mhelpWrap, html.avx-on .mhelp-wrap, html.avx-on #mhelpBtn, html.avx-on #mhelpSheet, html.avx-on .mhelp-back {
  display: none !important; visibility: hidden !important; pointer-events: none !important;
}
/* 2. Room under the footer so the robot covers nothing when the page is scrolled to the end (not on phones). */
html.avx-on .avvi-hero .foot::after { content: ""; display: block; height: 124px; }

#avx-root {
  --avx-purple: #6D28D9; --avx-purple-d: #5B21B6; --avx-brand1: #3300C8; --avx-brand2: #6600C2;
  --avx-grad: linear-gradient(108deg, #3300C8 0%, #6600C2 100%);
  --avx-ink: #15121C; --avx-soft: #2C2739; --avx-muted: #4A4560;
  --avx-line: #E9E8EE; --avx-line2: #E4DEF0; --avx-tint: #F6F6F8; --avx-lav: #F4F1FA;
  --avx-lift: 0px; --avx-pb: 130px; --avx-top: 102px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--avx-ink); -webkit-text-size-adjust: 100%;
}
#avx-root, #avx-root * { box-sizing: border-box; }
#avx-root [hidden] { display: none !important; }
#avx-root button, #avx-root input { font: inherit; color: inherit; margin: 0; letter-spacing: normal; text-transform: none; }
#avx-root button { background: none; border: 0; padding: 0; cursor: pointer; box-shadow: none; min-height: 0; line-height: 1.2; -webkit-tap-highlight-color: transparent; }
#avx-root button:hover, #avx-root button:focus { background-color: transparent; }
#avx-root svg { display: block; }
#avx-root p { margin: 0; }
#avx-root a { text-decoration: none; }
#avx-root img { max-width: none; }
#avx-root :focus-visible { outline: 3px solid var(--avx-purple); outline-offset: 2px; }
#avx-root .avx-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- launcher: the production robot (same box as the live site: 91 x 103, right 22, bottom 14) ----------
   The box itself never takes clicks, so its empty corners never block links under it; only the painted robot does
   (rule on #avxb-jump). The real <button> sits over the robot for keyboard and screen reader users. */
#avx-root .avx-buddy {
  position: fixed; z-index: 99990; right: 22px; width: 91px; height: 103px; pointer-events: none;
  bottom: calc(14px + var(--avx-lift) + env(safe-area-inset-bottom, 0px)); transition: bottom .18s ease;
}
#avx-root .avx-launch { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 22px; pointer-events: none; background: transparent; }
#avx-root .avx-launch:focus-visible { outline-offset: 2px; }
#avx-root #avxb-walk { position: absolute; left: 0; top: 0; width: 91px; height: 103px; will-change: transform; }
#avx-root .avx-buddy svg { display: block; overflow: visible; pointer-events: none; -webkit-tap-highlight-color: transparent; }
#avx-root .avx-buddy svg #avxb-jump { pointer-events: auto; cursor: pointer; }
#avx-root .avxb-lid { transition: transform .2s cubic-bezier(.34, 1.3, .64, 1); }
#avx-root .avxb-eye { transform-box: fill-box; transform-origin: center; transition: transform .15s cubic-bezier(.34, 1.3, .64, 1); }
/* speech cloud, same as the live site: a small frosted bubble above the robot */
#avx-root #avxb-cloud { position: absolute; right: 56px; bottom: 121px; pointer-events: none; will-change: transform; }
#avx-root #avxb-bubble {
  position: relative; pointer-events: none; background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6);
  color: #3a3554; font: 500 14px/1.45 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 9px 13px; border-radius: 14px; max-width: 220px; width: max-content; border: 0;
  opacity: 0; transform: translateY(8px) scale(.9); transform-origin: bottom right;
  transition: opacity .28s ease, transform .34s cubic-bezier(.3, 1.25, .55, 1);
  box-shadow: 0 10px 30px rgba(90, 70, 170, .16);
}
#avx-root #avxb-bubble.on { opacity: 1; transform: translateY(0) scale(1); }
#avx-root #avxb-bubble:empty { display: none; }

/* ---------- panel: the production look, wide ---------- */
#avx-root .avx-panel {
  position: fixed; z-index: 100005; right: 22px; bottom: calc(var(--avx-pb) + env(safe-area-inset-bottom, 0px));
  width: min(600px, calc(100vw - 32px));
  height: min(720px, calc(100vh - var(--avx-pb) - var(--avx-top)));
  display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right;
  background: #fff; border: 1px solid var(--avx-line); border-radius: 18px;
  box-shadow: 0 24px 60px -18px rgba(30, 12, 60, .42);
  animation: avx-pop .2s ease both;
}
@supports (height: 100dvh) { #avx-root .avx-panel { height: min(720px, calc(100dvh - var(--avx-pb) - var(--avx-top))); } }
@keyframes avx-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
#avx-root .avx-panel:focus { outline: none; }
#avx-root .avx-backdrop { display: none !important; }

#avx-root .avx-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 18px; background: var(--avx-grad); color: #fff; flex: none; }
#avx-root .avx-mark { width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
#avx-root .avx-mark svg { width: 28px; height: 26px; }
#avx-root .avx-ttl { min-width: 0; flex: 1 1 auto; }
#avx-root .avx-h { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; font-size: 1.1875rem; font-weight: 600; line-height: 1.2; color: #fff; margin: 0; padding: 0; text-transform: none; letter-spacing: 0; }
#avx-root .avx-status { font-size: .875rem; line-height: 1.35; color: #fff; opacity: .92; margin-top: 2px; }
#avx-root .avx-x { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; transition: background-color .15s; }
@media (hover: hover) { #avx-root .avx-x:hover { background: rgba(255, 255, 255, .18); } }
#avx-root .avx-x:focus-visible { outline-color: #fff; }

#avx-root .avx-thread { flex: 1 1 auto; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 14px; background: var(--avx-tint); display: flex; flex-direction: column; gap: 14px; -webkit-overflow-scrolling: touch; }
#avx-root .avx-thread::-webkit-scrollbar { width: 7px; }
#avx-root .avx-thread::-webkit-scrollbar-thumb { background: #d9cdf3; border-radius: 99px; }
#avx-root .avx-msg { display: flex; gap: 10px; align-items: flex-end; }
#avx-root .avx-av { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--avx-grad); display: grid; place-items: center; }
#avx-root .avx-av svg { width: 24px; height: 22px; }
#avx-root .avx-av-me { background: #ECE7F6; color: var(--avx-brand1); }
#avx-root .avx-av-me svg { width: 18px; height: 18px; }
#avx-root .avx-card { min-width: 0; max-width: calc(100% - 46px); background: #fff; border: 1px solid var(--avx-line); border-radius: 14px 14px 14px 5px; padding: 12px 16px 13px; font-size: 1rem; line-height: 1.55; color: #14111D; overflow-wrap: break-word; }
#avx-root .avx-card p + p { margin-top: .6em; }
#avx-root .avx-links { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
#avx-root .avx-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; padding: 8px 12px; color: var(--avx-brand1); background: var(--avx-tint); border: 1px solid var(--avx-line); border-radius: 10px; font-weight: 600; font-size: 1rem; line-height: 1.3; transition: border-color .15s, background-color .15s; }
@media (hover: hover) { #avx-root .avx-link:hover { border-color: var(--avx-brand1); background: #fff; } }
#avx-root .avx-link svg { flex: none; transition: transform .15s ease; }
@media (hover: hover) { #avx-root .avx-link:hover svg { transform: translateX(3px); } }
#avx-root .avx-from-me { flex-direction: row-reverse; }
#avx-root .avx-bubble { max-width: calc(88% - 46px); background: var(--avx-grad); color: #fff; border-radius: 14px 14px 5px 14px; padding: 11px 15px; font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
#avx-root .avx-typing { display: inline-flex; gap: 5px; align-items: center; padding: 16px 18px; }
#avx-root .avx-typing i { width: 7px; height: 7px; border-radius: 50%; background: #c3b8e0; animation: avx-dot 1s infinite ease-in-out; }
#avx-root .avx-typing i:nth-child(2) { animation-delay: .15s; }
#avx-root .avx-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes avx-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }

/* quick replies: pills, one row where they fit; when they do not fit they wrap and each row fills the width,
   so every chip has the same height and the edges line up */
#avx-root .avx-chips { flex: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--avx-line); }
#avx-root .avx-chips:empty { display: none; }
#avx-root .avx-chip {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center; height: 40px; padding: 0 14px; min-width: 0;
  border: 1.5px solid var(--avx-line2); border-radius: 999px; background: #fff; color: var(--avx-brand1);
  font-size: .9375rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: border-color .15s, color .15s, background-color .15s;
}
@media (hover: hover) { #avx-root .avx-chip:hover { border-color: var(--avx-brand1); background: var(--avx-brand1); color: #fff; } }
#avx-root .avx-form { flex: none; display: flex; gap: 10px; align-items: center; padding: 10px 14px 14px; background: #fff; }
#avx-root .avx-chips:empty + .avx-form { border-top: 1px solid var(--avx-line); }
#avx-root .avx-in {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 14px; font-size: 16px; line-height: 1.2;
  border: 1.5px solid var(--avx-line2); border-radius: 12px; background: var(--avx-tint); color: var(--avx-ink);
  box-shadow: none; outline: none; -webkit-appearance: none; appearance: none; transition: border-color .15s, background-color .15s;
}
#avx-root .avx-in::placeholder { color: #6E6880; opacity: 1; }
#avx-root .avx-in:focus { border-color: var(--avx-brand1); background: #fff; box-shadow: 0 0 0 3px rgba(109, 40, 217, .15); }
#avx-root .avx-send { width: 48px; height: 48px; flex: none; border-radius: 12px; background: var(--avx-purple); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -8px rgba(109, 40, 217, .6); transition: filter .15s, transform .1s; }
/* hover and focus always keep a filled button (the generic button:hover reset above would otherwise blank it) */
#avx-root .avx-send:focus, #avx-root .avx-send:hover { background: var(--avx-purple); color: #fff; filter: brightness(1.07); }
#avx-root .avx-send:active { transform: scale(.94); }

/* ---------- widths ---------- */
@media (max-width: 1279.98px) { #avx-root .avx-panel { width: min(560px, calc(100vw - 32px)); } }
@media (max-width: 1099.98px) {
  #avx-root .avx-panel { width: min(520px, calc(100vw - 32px)); }
  #avx-root .avx-thread { padding: 16px 16px 12px; }
  #avx-root .avx-chips { padding: 10px 14px; gap: 6px; }
  #avx-root .avx-chip { padding: 0 11px; }
  #avx-root .avx-form { padding: 10px 12px 12px; }
}
/* touch: 44px chips */
@media (hover: none) and (pointer: coarse) { #avx-root .avx-chip { height: 44px; } }
@media (max-width: 980px) { html.avx-on .avvi-hero .foot::after { height: 124px; } }

/* ---------- short screens (a laptop with a small window, desktop zoomed to 200%) ----------
   There is no room for the panel above the robot: the panel takes the bottom, and the robot waits behind it
   (hidden while the panel is open). */
@media (max-height: 759.98px) {
  #avx-root { --avx-pb: 16px; }
  #avx-root.avx-open .avx-buddy { visibility: hidden; }
}
@media (max-height: 560px) {
  #avx-root .avx-thread { padding-top: 12px; }
  #avx-root .avx-head { padding-top: 8px; padding-bottom: 8px; }
}

/* ---------- PHONES: no bot at all ----------
   Under 700px wide, or a touch screen under 500px tall (phones in landscape). iPads (768 to 1024 wide) keep it.
   The loader in avvi-ux-bot.php does not even fetch the script here; this rule is the second guard. */
@media (max-width: 699.98px), (hover: none) and (pointer: coarse) and (max-height: 499.98px) {
  #avx-root { display: none !important; }
  html.avx-on .avvi-hero .foot::after { display: none; height: 0; }
  /* page links that open the assistant would do nothing here: hide them (Contact: the whole "Ask the Avvi
     assistant" card, which is about the corner robot) */
  html.avx-on [data-open-avvi] { display: none !important; }
  html.avx-on .cmethod:has([data-open-avvi]) { display: none !important; }
}

/* hide the robot while the site's mobile menu is open, and when printing */
body:has(#avviNavLinks.open) #avx-root .avx-buddy, body:has(#mobileMenu.open) #avx-root .avx-buddy { display: none; }
@media print { #avx-root { display: none !important; } }

/* reduced motion: no pop, no typing dots, no robot motion (the script also stops the physics and the walking) */
@media (prefers-reduced-motion: reduce) {
  #avx-root *, #avx-root *::before, #avx-root *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  #avx-root .avx-chip, #avx-root .avx-card, #avx-root .avx-bubble, #avx-root .avx-panel, #avx-root .avx-link { border: 1px solid CanvasText; }
}
