/* Chat launcher, copied from header-spacing-correction.css (lines 1730-2257) so the new homepage keeps the same chat behavior. */
/* The chat control floats, so it does not leave a white band under the footer. */
:is(#blg-bp05-pilot, .blg-pilot):not(.is-intaker-visible) .blg-intaker-dock,
.blg-intaker-dock {
  display: block;
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
}

.blg-intaker-fab {
  position: fixed;
  z-index: 110;
  right: 24px;
  bottom: 24px;
  display: inline-block;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  line-height: 0;
}

.blg-intaker-home,
.blg-pilot .blg-intaker-home {
  position: relative;
  z-index: 1;
  right: auto;
  bottom: auto;
  width: auto;
  min-width: 220px;
  height: auto;
  min-height: 56px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 22px 10px 10px !important;
  color: #07161f !important;
  background: #fbfaf6 !important;
  border: 1px solid rgba(7, 22, 31, 0.5) !important;
  border-radius: 34px !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.blg-intaker-home::before {
  width: 40px;
  height: 40px;
  display: grid;
  place-content: center;
  content: "i";
  color: #07161f;
  background: #f1cb87;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 22px;
  font-style: italic;
  grid-row: 1 / 3;
}

.blg-intaker-home small {
  display: block;
  color: #18303c;
  font-size: 14px;
  font-weight: 500;
}

.blg-intaker-fab .blg-intaker-dismiss,
.blg-pilot .blg-intaker-fab .blg-intaker-dismiss {
  position: absolute !important;
  top: -7px !important;
  right: -7px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 2;
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(7, 22, 31, 0.28) !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  color: transparent !important;
  font-size: 0 !important;
  font-weight: 400 !important;
  line-height: 0 !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
  text-transform: none !important;
  overflow: hidden !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.blg-intaker-fab .blg-intaker-dismiss::before,
.blg-pilot .blg-intaker-fab .blg-intaker-dismiss::before {
  content: "\00d7";
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: #07161f;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  pointer-events: none;
}

.blg-intaker-fab .blg-intaker-dismiss:hover,
.blg-intaker-fab .blg-intaker-dismiss:focus-visible,
.blg-pilot .blg-intaker-fab .blg-intaker-dismiss:hover,
.blg-pilot .blg-intaker-fab .blg-intaker-dismiss:focus-visible {
  background: #f1cb87 !important;
  color: transparent !important;
  outline: none;
}

.blg-intaker-dock.is-minimized .blg-intaker-home,
.blg-pilot .blg-intaker-dock.is-minimized .blg-intaker-home {
  width: 56px !important;
  min-width: 56px !important;
  height: 56px !important;
  min-height: 56px !important;
  padding: 8px !important;
  grid-template-columns: 1fr;
  justify-items: center;
  border-radius: 50% !important;
}

.blg-intaker-dock.is-minimized .blg-intaker-home::before {
  grid-row: auto;
  width: 40px;
  height: 40px;
}

.blg-intaker-dock.is-minimized .blg-intaker-home > strong,
.blg-intaker-dock.is-minimized .blg-intaker-home small {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.blg-intaker-dock.is-minimized .blg-intaker-dismiss {
  display: none !important;
}

/* Once Intaker #icw owns the bubble (video preview / launcher / chat), hide our site FAB
   so close (X) can leave Goldlaw-style circular video avatar instead of the static "i" pill. */
.blg-intaker-dock.is-intaker-native .blg-intaker-fab {
  display: none !important;
}

/* Active dock: never paint the "Open Chat / Intaker" pill — video + brief text from first paint. */
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-fab,
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-fab {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: auto !important;
  height: auto !important;
}
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-standin-brief,
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-standin-brief {
  display: inline-block !important;
  order: 0;
  max-width: 220px;
  padding: 10px 14px;
  color: #111;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  pointer-events: none;
}
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-home,
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-home {
  order: 1;
  width: 92px !important;
  min-width: 92px !important;
  max-width: 92px !important;
  height: 92px !important;
  min-height: 92px !important;
  padding: 0 !important;
  display: block !important;
  overflow: hidden !important;
  border-radius: 24px !important;
  border: 2px solid #e8b4a0 !important;
  background: #111 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  grid-template-columns: none !important;
  gap: 0 !important;
}
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-home::before,
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-home > strong,
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-home small,
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-home::before,
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-home > strong,
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-home small {
  display: none !important;
  content: none !important;
}
.blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-home video[data-blg-avatar-standin="1"],
.blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-home video[data-blg-avatar-standin="1"] {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 18% !important;
  display: block !important;
  border-radius: inherit !important;
}
.blg-intaker-dock.is-intaker-native .blg-intaker-standin-brief {
  display: none !important;
}

/* Intaker mounts already in large preview; the carrier collapses it to the corner
   avatar ~70ms later and only then adds blg-intaker-launcher-ready. Keep that first
   mount invisible (opacity only, so the video keeps loading) to stop the load flash. */
#icw.icw--is-preview:not(.blg-intaker-launcher-ready) {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Goldlaw: large video preview hides the corner avatar. */
#icw.icw--is-preview #icw--launcher {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* While chat is open, exterior launcher stays hidden. */
#icw.icw--is-frame:not(.icw--is-preview) #icw--launcher {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Never overlay a greeting video on open chat — it covered Intaker copy. */
#blg-intaker-inchat-pip,
.blg-intaker-inchat-pip {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/*
  Only hide the Intaker preview once chat is open or we fully collapsed.
  Do NOT hide `#icw--preview` merely because `icw--is-preview` is missing yet —
  on mobile Intaker checks computed display during mount; if we force `none`
  first, it aborts the greeting video and jumps straight to chat.
*/
#icw.icw--is-frame:not(.icw--is-preview) #icw--preview,
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--preview {
  display: none !important;
}

/* After close-to-avatar, Intaker sometimes leaves backdrop open and hides the site header. */
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--backdrop-container,
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--modal-backdrop-container {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

html.icw-lockBody:not(:has(#icw.icw--is-preview)):not(:has(#icw.icw--is-frame)),
body.icw-lockBody:not(:has(#icw.icw--is-preview)):not(:has(#icw.icw--is-frame)) {
  overflow: auto !important;
}

/* Keep site header above a stray Intaker backdrop in avatar-only mode.
   Sticky is desktop-only: below 1024px the header is fixed over a 70px page offset,
   and sticky there leaves a blank 70px band above the header. */
:is(#blg-bp05-pilot, .blg-pilot) .blg-site-header {
  z-index: 10020;
}

@media (min-width: 1024px) {
  :is(#blg-bp05-pilot, .blg-pilot) .blg-site-header {
    position: sticky;
    top: 0;
  }
}

/* Goldlaw-style collapsed avatar: compact squircle + soft peach border (not a tall portrait). */
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--avatar-container {
  width: 92px !important;
  height: 92px !important;
  min-width: 92px !important;
  min-height: 92px !important;
  max-width: 92px !important;
  max-height: 92px !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: 24px !important;
  border: 2px solid #e8b4a0 !important;
  box-sizing: border-box !important;
  background: #111 !important;
  flex: 0 0 92px !important;
}

#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--avatar-container video,
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--avatar-container img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  /* Keep face/top of greeting video in frame (square crop otherwise cuts the head). */
  object-position: center 18% !important;
  border-radius: inherit !important;
  display: block !important;
}

#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--launcher {
  align-items: flex-end !important;
}

/* Avatar + "Start a brief…" must appear together (never sequential flash).
   Use opacity only — visibility:hidden / display:none pauses the greeting video.
   Until ready, keep #icw click-through so the stand-in (video+brief) stays usable. */
#icw:not(.icw--is-preview):not(.icw--is-frame):not(.blg-intaker-launcher-ready) {
  pointer-events: none !important;
}
#icw:not(.icw--is-preview):not(.icw--is-frame):not(.blg-intaker-launcher-ready) #icw--launcher {
  opacity: 0 !important;
  pointer-events: none !important;
}
#icw:not(.icw--is-preview):not(.icw--is-frame).blg-intaker-launcher-ready {
  pointer-events: auto !important;
}
#icw:not(.icw--is-preview):not(.icw--is-frame).blg-intaker-launcher-ready #icw--launcher {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--launcher .icw--launcher--text,
#icw:not(.icw--is-preview):not(.icw--is-frame) #icw--launcher .icw--launcher--text--onlytxt {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
/* Preview welcome copy only belongs on the large greeting video, not the corner bubble. */
#icw:not(.icw--is-preview) .icw--preview--text--container,
#icw:not(.icw--is-preview) #icw-preview-welcome-message-text,
#icw:not(.icw--is-preview) .icw-preview-welcome-message-text {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mobile — match goldlaw.com Intaker:
   preview 235×417 bottom-right; chat full-bleed; collapsed avatar ~100px. */
@media (max-width: 760px) {
  #icw.icw--is-preview {
    display: flex !important;
    right: 10px !important;
    bottom: 10px !important;
    left: auto !important;
    top: auto !important;
    width: 235px !important;
    max-width: calc(100vw - 20px) !important;
    height: 417px !important;
    z-index: 2147483000 !important;
  }

  #icw.icw--is-preview #icw--preview,
  #icw.icw--is-preview #icw--preview.icw--preview--has-video,
  #icw.icw--is-preview #icw--preview.desktop-small {
    display: block !important;
    position: relative !important;
    width: 235px !important;
    height: 417px !important;
    max-width: 235px !important;
    max-height: 417px !important;
    border-radius: 22px !important;
    overflow: hidden !important;
  }

  #icw.icw--is-preview #icw--preview--video {
    width: 235px !important;
    height: 417px !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center 18% !important;
    border-radius: 22px !important;
  }

  /* Intaker only shows the mute toggle and top-left pause at >=764px;
     below that mute is display:none and pause floats mid-video. Match desktop. */
  #icw.icw--is-preview #icw--preview #icw--preview--unmute,
  #icw.icw--is-preview #icw--preview .icw-preview-unmute-duplication {
    display: block !important;
    top: 15px !important;
    right: auto !important;
    margin-right: 0 !important;
    width: 32px !important;
    height: 32px !important;
    z-index: 2001 !important;
  }

  #icw.icw--is-preview #icw--preview #icw--preview--unmute {
    left: 20px !important;
  }

  #icw.icw--is-preview #icw--preview .icw-preview-unmute-duplication {
    left: 57px !important;
  }

  /* Mobile Intaker puts close at top:-41px, which our overflow:hidden clips. */
  #icw.icw--is-preview #icw--preview #icw--preview--close {
    display: inline-block !important;
    top: 15px !important;
    right: 20px !important;
    width: 32px !important;
    height: 32px !important;
    z-index: 9999 !important;
  }

  /* Goldlaw mobile: open chat fills the viewport. */
  #icw.icw--is-frame:not(.icw--is-preview) {
    display: block !important;
    inset: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
  }

  #icw.icw--is-frame:not(.icw--is-preview) #icw--frame-container,
  #icw.icw--is-frame:not(.icw--is-preview) #icw--frame {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100vw !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
  }

  #icw:not(.icw--is-preview):not(.icw--is-frame) #icw--avatar-container {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px !important;
    min-height: 100px !important;
    max-width: 100px !important;
    max-height: 100px !important;
    flex: 0 0 100px !important;
    border-radius: 20px !important;
  }

  /* Stand-in matches the 100px Intaker avatar so the handoff does not pop. */
  .blg-intaker-dock[data-blg-intaker-mode="active"]:not(.is-minimized):not(.is-intaker-native) .blg-intaker-home,
  .blg-intaker-dock.is-avatar-first:not(.is-intaker-native) .blg-intaker-home {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
    height: 100px !important;
    min-height: 100px !important;
    border-radius: 20px !important;
  }

  #icw:not(.icw--is-preview):not(.icw--is-frame) {
    right: 10px !important;
    bottom: 10px !important;
  }

  #icw:not(.icw--is-preview):not(.icw--is-frame) #icw--launcher {
    right: auto !important;
    bottom: auto !important;
  }
}

.blg-intaker-home:hover,
.blg-intaker-home:focus-visible,
.blg-pilot .blg-intaker-home:hover,
.blg-pilot .blg-intaker-home:focus-visible {
  color: #07161f !important;
  background: #ffffff !important;
  transform: none;
}

@media (max-width: 900px) {
  .blg-intaker-fab {
    right: 16px;
    bottom: 16px;
  }
}

/* Below 941px the fixed Call and Book bar sits at the bottom of the screen. The chat launcher stays above it. */
@media (max-width: 940px) {
  .blg-intaker-fab,
  .blg-pilot .blg-intaker-fab {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
  #icw.icw--is-preview,
  #icw:not(.icw--is-preview):not(.icw--is-frame),
  div#icw--call--content {
    bottom: calc(70px + env(safe-area-inset-bottom)) !important;
  }
}
