/* Developed by John Matthew */
/* ============================================================
   AIM Tech AI — Hero AI Chat Widget Styles
   Glass-card aesthetic, brand teal accents.
   ============================================================ */

#hero-ai-chat {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 760px;
  max-height: 600px;
  min-height: 480px;
  margin-left: auto;
  padding: 22px 22px 18px;
  /* Layered background: solid fallback under the translucent one so any
     brief blank composite frame (during reparenting / theme swaps) shows
     the brand chat color instead of flashing pure white or black. */
  background-color: #0d141f;
  background-image: linear-gradient(180deg, rgba(20, 28, 44, 0.65), rgba(13, 20, 31, 0.65));
  border: 1px solid var(--clr-border, rgba(255, 255, 255, 0.08));
  border-radius: 20px;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow:
    0 18px 60px -20px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(15, 193, 183, 0.06) inset;
  color: var(--clr-text, #fff);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  position: relative;
  overflow: hidden;
  /* Lock a GPU composite layer so reparenting + theme swaps don't drop
     and re-rasterize the heavy backdrop-filter (the source of the glitch). */
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  will-change: transform, opacity;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  contain: layout paint;
  /* Smooth out any tiny seam — colors cross-fade instead of snapping */
  transition: background-color 0.18s ease, background-image 0.18s ease;
}

/* ---------- light mode ---------- */
[data-theme="light"] #hero-ai-chat {
  /* Solid fallback under the translucent — fixes blank-flash on theme swap */
  background-color: #f5f7fa;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 247, 250, 0.92));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow:
    0 18px 60px -20px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(15, 193, 183, 0.08) inset;
  color: #1a1a1a;
}
[data-theme="light"] #hero-ai-chat .chat-message.user {
  background: rgba(15, 193, 183, 0.12);
  color: #0a4a46;
}
[data-theme="light"] #hero-ai-chat .chat-message.ai {
  background: rgba(0, 0, 0, 0.04);
  color: #1a1a1a;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
[data-theme="light"] #hero-ai-chat .chat-quick-btn,
[data-theme="light"] #hero-ai-chat .chat-link-btn {
  background: rgba(0, 0, 0, 0.03);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.12);
}
[data-theme="light"] #hero-ai-chat .chat-quick-btn:hover,
[data-theme="light"] #hero-ai-chat .chat-link-btn:hover {
  background: rgba(15, 193, 183, 0.1);
  border-color: rgba(15, 193, 183, 0.4);
  color: #0a4a46;
}
[data-theme="light"] #hero-ai-chat .chat-input {
  color: #1a1a1a;
}
[data-theme="light"] #hero-ai-chat .chat-input::placeholder {
  color: rgba(0, 0, 0, 0.4);
}
[data-theme="light"] #hero-ai-chat .chat-input-row {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

/* ---------- header ---------- */
.chat-header {
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--clr-border, rgba(255, 255, 255, 0.08));
}
.chat-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--clr-text, #fff);
}
.chat-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--clr-primary, #0FC1B7);
  box-shadow: 0 0 10px var(--clr-primary, #0FC1B7);
  vertical-align: middle;
  transform: translateY(-1px);
}
.chat-subtitle {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--clr-text-dim, rgba(255, 255, 255, 0.7));
  letter-spacing: 0.02em;
}

/* ---------- messages ---------- */
.chat-messages {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 6px 4px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--clr-primary, #0FC1B7) transparent;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(15, 193, 183, 0.35);
  border-radius: 3px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-wrap: break-word;
  animation: chatFadeIn 0.25s ease-out both;
}
.chat-message.user {
  align-self: flex-end;
  background: rgba(15, 193, 183, 0.16);
  border: 1px solid rgba(15, 193, 183, 0.32);
  border-bottom-right-radius: 4px;
  color: var(--clr-text, #fff);
}
.chat-message.ai {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--clr-border, rgba(255, 255, 255, 0.08));
  border-bottom-left-radius: 4px;
  color: var(--clr-text, #fff);
}
.chat-bubble-text { white-space: pre-wrap; }

@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- typing dots ---------- */
.chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 14px;
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clr-primary, #0FC1B7);
  opacity: 0.55;
  animation: chatDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chatDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

/* ---------- link button under AI msg ---------- */
.chat-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--clr-primary, #0FC1B7);
  background: transparent;
  border: 1px solid rgba(15, 193, 183, 0.5);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.chat-link-btn:hover {
  background: rgba(15, 193, 183, 0.15);
  color: #fff;
  transform: translateX(2px);
}
.chat-link-arrow { display: inline-flex; align-items: center; }

/* ---------- quick prompts ---------- */
.chat-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0 8px;
  border-top: 1px dashed var(--clr-border, rgba(255, 255, 255, 0.08));
}
.chat-quick-btn {
  font: inherit;
  font-size: 0.74rem;
  color: var(--clr-text-dim, rgba(255, 255, 255, 0.7));
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--clr-border, rgba(255, 255, 255, 0.08));
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.chat-quick-btn:hover {
  color: var(--clr-text, #fff);
  border-color: var(--clr-primary, #0FC1B7);
  background: rgba(15, 193, 183, 0.1);
}

/* ---------- input row ---------- */
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  border-top: 1px solid var(--clr-border, rgba(255, 255, 255, 0.08));
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  border: 1px solid var(--clr-border, rgba(255, 255, 255, 0.08));
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.chat-input-row:focus-within {
  border-color: var(--clr-primary, #0FC1B7);
  background: rgba(15, 193, 183, 0.07);
  box-shadow: 0 0 0 3px rgba(15, 193, 183, 0.15);
}
.chat-input {
  flex: 1 1 auto;
  font: inherit;
  font-size: 1rem;
  color: var(--clr-text, #fff);
  background: transparent;
  border: none;
  padding: 10px 6px;
  outline: none;
  min-height: 24px;
}
.chat-input::placeholder { color: var(--clr-text-dim, rgba(255, 255, 255, 0.5)); }
.chat-input:focus { border-bottom-color: var(--clr-primary, #0FC1B7); }
.chat-input:disabled { opacity: 0.6; }

.chat-send-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--clr-primary, #0FC1B7);
  color: #0b1322;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  box-shadow: 0 4px 14px -4px rgba(15, 193, 183, 0.6);
}
.chat-send-btn:hover { transform: scale(1.06); box-shadow: 0 6px 18px -4px rgba(15, 193, 183, 0.8); }
.chat-send-btn:active { transform: scale(0.96); }
.chat-send-btn:disabled,
.chat-send-btn.is-busy { opacity: 0.55; cursor: not-allowed; transform: none; }
.chat-send-btn svg { display: block; transform: translateX(-1px); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  #hero-ai-chat {
    max-width: 100%;
    margin-left: 0;
    min-height: 380px;
    max-height: 460px;
    padding: 18px;
    border-radius: 16px;
  }
  .chat-title { font-size: 1.1rem; }
}

/* ---------- full-screen mode (triggered when input is focused) ---------- */
#hero-ai-chat.is-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  margin: 0 !important;
  border-radius: 0 !important;
  z-index: 99999 !important;
  padding: 16px 16px 14px !important;
  border: none !important;
}
#hero-ai-chat.is-fullscreen .chat-messages {
  flex: 1 1 auto;
  max-height: none;
}
#hero-ai-chat.is-fullscreen .chat-input-row {
  padding: 14px 16px;
  font-size: 1.05rem;
}
#hero-ai-chat.is-fullscreen .chat-input {
  font-size: 1.05rem;
  padding: 12px 6px;
}
#hero-ai-chat.is-fullscreen .chat-send-btn {
  width: 44px;
  height: 44px;
}
.chat-fs-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--clr-text, #fff);
  border: 1px solid var(--clr-border, rgba(255, 255, 255, 0.1));
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.18s;
}
.chat-fs-close:hover { background: rgba(255, 255, 255, 0.15); }
[data-theme="light"] .chat-fs-close {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .chat-fs-close:hover { background: rgba(0, 0, 0, 0.1); }
#hero-ai-chat.is-fullscreen .chat-fs-close { display: inline-flex; }
body.chat-fs-open { overflow: hidden; }
/* ============================================================
   Mobile fixes — eliminate the white/black blank-flash glitch
   ------------------------------------------------------------
   Backdrop-filter blur is the #1 cause of compositing flashes
   on mobile when the chat is reparented (hero ↔ bottom sheet)
   or when theme-toggle re-rasterizes the layer. We:
     - Drop backdrop-filter entirely on small screens (replace
       with a fully-opaque solid background)
     - Lock the GPU layer so the sheet open animation can't
       force a re-rasterization
     - Hide content for one frame when the parent changes so
       the user sees a stable color, not a partial paint
   ============================================================ */
@media (max-width: 900px), (pointer: coarse) {
  #hero-ai-chat {
    /* Solid, opaque background — no translucency = no compositing flash */
    background-color: #0d141f !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    /* Keep the GPU layer through reparenting and class swaps */
    transform: translateZ(0) !important;
    will-change: transform !important;
    contain: layout paint !important;
  }
  [data-theme="light"] #hero-ai-chat {
    background-color: #ffffff !important;
    background-image: none !important;
  }
  /* Fullscreen variant inside the bottom sheet — also opaque */
  #hero-ai-chat.is-fullscreen {
    background-color: #0d141f !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  [data-theme="light"] #hero-ai-chat.is-fullscreen {
    background-color: #ffffff !important;
  }
  /* Soft fade-in on mount so any partial paint is hidden */
  #hero-ai-chat[data-hero-chat-ready="1"] {
    animation: chatContainerFadeIn 0.18s ease-out;
  }
  @keyframes chatContainerFadeIn {
    from { opacity: 0.001; }   /* not 0 — keeps the layer composited */
    to   { opacity: 1; }
  }
}

/* When theme switches, repaint the chat without a flash by suppressing
   transitions for one frame — the new opaque bg shows immediately. */
html.theme-switching #hero-ai-chat,
html.theme-switching #hero-ai-chat * {
  transition: none !important;
  animation: none !important;
}

/* ============================================================
   Desktop floating chat launcher + popup (bottom-right)
   ------------------------------------------------------------
   Hidden on mobile (mobile uses the bottom-sheet from mobile-dock.js).
   ============================================================ */
@media (min-width: 769px) {
  #hero-ai-chat-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: auto;
    min-width: 60px;
    height: 60px;
    padding: 0 22px 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0FC1B7 0%, #0A9B92 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    box-shadow:
      0 14px 36px -10px rgba(15, 193, 183, 0.55),
      0 4px 14px -4px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    cursor: pointer;
    z-index: 9998;
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.2px;
    transition: transform .2s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow .2s, opacity .2s;
  }
  #hero-ai-chat-fab:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
      0 18px 40px -10px rgba(15, 193, 183, 0.7),
      0 6px 18px -4px rgba(0, 0, 0, 0.5);
  }
  #hero-ai-chat-fab:active { transform: translateY(0) scale(0.98); }
  #hero-ai-chat-fab .fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
  }
  #hero-ai-chat-fab .fab-label { white-space: nowrap; }
  /* Soft pulse halo to draw the eye */
  #hero-ai-chat-fab .fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    box-shadow: 0 0 0 0 rgba(15, 193, 183, 0.55);
    animation: fabPulse 2.4s ease-out infinite;
    pointer-events: none;
  }
  @keyframes fabPulse {
    0%   { box-shadow: 0 0 0 0   rgba(15, 193, 183, 0.55); }
    70%  { box-shadow: 0 0 0 18px rgba(15, 193, 183, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(15, 193, 183, 0);   }
  }
  #hero-ai-chat-fab.is-open .fab-pulse { display: none; }
  #hero-ai-chat-fab.is-open {
    background: rgba(20, 28, 44, 0.92);
    color: #fff;
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.55);
  }
  [data-theme="light"] #hero-ai-chat-fab.is-open {
    background: #ffffff;
    color: #0a0a0a;
  }
  @media (prefers-reduced-motion: reduce) {
    #hero-ai-chat-fab .fab-pulse { animation: none; }
  }

  /* Popup container — lower-right corner */
  #hero-ai-chat-popup {
    position: fixed;
    right: 22px;
    bottom: calc(22px + 60px + 12px);    /* 60px fab height + 12px gap */
    width: 380px;
    max-width: calc(100vw - 44px);
    height: 540px;
    max-height: calc(100vh - 140px);
    background: #0d141f;
    background-image: linear-gradient(180deg, rgba(20, 28, 44, 0.9), rgba(13, 20, 31, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow:
      0 30px 80px -20px rgba(0, 0, 0, 0.65),
      0 0 0 1px rgba(15, 193, 183, 0.08) inset;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    transform-origin: bottom right;
    transition: opacity .22s ease, transform .22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }
  #hero-ai-chat-popup.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }
  [data-theme="light"] #hero-ai-chat-popup {
    background: #ffffff;
    background-image: linear-gradient(180deg, #ffffff, #f5f7fa);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
      0 30px 80px -20px rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(15, 193, 183, 0.08) inset;
  }

  /* Popup header */
  #hero-ai-chat-popup .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(15, 193, 183, 0.10), transparent);
  }
  [data-theme="light"] #hero-ai-chat-popup .popup-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, rgba(15, 193, 183, 0.06), transparent);
  }
  #hero-ai-chat-popup .popup-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--clr-text, #fff);
  }
  [data-theme="light"] #hero-ai-chat-popup .popup-title-row { color: #1a1a1a; }
  #hero-ai-chat-popup .popup-status-dot {
    width: 8px; height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  }
  #hero-ai-chat-popup .popup-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--clr-text, #fff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .12s;
  }
  #hero-ai-chat-popup .popup-close:hover {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.5);
  }
  #hero-ai-chat-popup .popup-close:active { transform: scale(0.94); }
  [data-theme="light"] #hero-ai-chat-popup .popup-close {
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.1);
  }

  /* Body wraps the actual chat widget */
  #hero-ai-chat-popup-body {
    flex: 1 1 auto;
    overflow: hidden;
    display: flex;
    min-height: 0;
  }
  /* Override the standalone chat sizing — fill the popup */
  #hero-ai-chat-popup #hero-ai-chat {
    width: 100%;
    max-width: none;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 14px 14px 12px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    background-image: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    flex: 1 1 auto;
    height: 100%;
  }
  /* Header inside the chat is redundant with the popup header — hide it */
  #hero-ai-chat-popup #hero-ai-chat .chat-header { display: none; }
}

/* Hide the launcher entirely on mobile (mobile uses the dock-driven sheet) */
@media (max-width: 768px) {
  #hero-ai-chat-fab,
  #hero-ai-chat-popup { display: none !important; }
}

/* === HOME QUICK FAB — REMOVED ==============================================
   Was a floating Home button above the Ask AI bubble. Removed because the
   top-bar nav already has Home. Force-hide any cached instance and keep the
   block-as-comment so the old positioning rules don't accidentally re-engage. */
#home-quick-fab { display: none !important; }
/* (legacy desktop styles below kept disabled via the !important hide above) */
@media (min-width: 769px) {
  #home-quick-fab {
    position: fixed;
    right: 22px;
    /* Sit ABOVE the Ask AI fab: 22 (its bottom) + 60 (its height) + 12 (gap) = 94 */
    bottom: calc(22px + 60px + 12px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(20, 28, 44, 0.92);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
            backdrop-filter: blur(14px) saturate(140%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(15, 193, 183, 0.06) inset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 9998;
    transition: transform .18s cubic-bezier(0.16, 1, 0.3, 1),
                background .18s, box-shadow .18s, color .18s, border-color .18s;
  }
  #home-quick-fab:hover {
    transform: translateY(-2px) scale(1.06);
    background: var(--clr-primary, #0FC1B7);
    color: #ffffff;
    border-color: var(--clr-primary, #0FC1B7);
    box-shadow: 0 14px 36px -10px rgba(15, 193, 183, 0.55);
  }
  #home-quick-fab:active { transform: translateY(0) scale(0.96); }

  [data-theme="light"] #home-quick-fab {
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.18);
  }
  [data-theme="light"] #home-quick-fab:hover {
    background: var(--clr-primary, #0FC1B7);
    color: #ffffff;
    border-color: var(--clr-primary, #0FC1B7);
  }

  /* When the chat popup is OPEN, lift the home FAB above the popup so it
     doesn't get visually buried. Popup is at bottom: 94px and 540px tall;
     pushing the home FAB up by the popup height keeps it accessible. */
  #hero-ai-chat-popup.open ~ #home-quick-fab,
  body:has(#hero-ai-chat-popup.open) #home-quick-fab {
    bottom: calc(22px + 60px + 12px + 540px + 12px);
  }
}

/* Mobile: hide both FABs entirely (defense-in-depth — chat-bubble.js also
   skips injection on mobile). The bottom dock already provides Home + Chat. */
@media (max-width: 768px) {
  #hero-ai-chat-fab,
  #home-quick-fab,
  #hero-ai-chat-popup,
  body #hero-ai-chat-fab,
  body #home-quick-fab,
  html body #hero-ai-chat-fab,
  html body #home-quick-fab {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }
}
