/* Hide ONLY WorkRamp native search controls (direct children) */
.academy-search-bar-wrapper.AL_Custom_NavSearchBar > input,
.academy-search-bar-wrapper.AL_Custom_NavSearchBar > .fa-search {
  display: none !important;
}

/* Widget host container */
#academy-search-widget {
  width: 260px;
  max-width: 100%;
  margin: 0;
  z-index: 9999;
}

/* =========================
   Algolia Agent Studio chat
   stable bottom-left layout
   ========================= */

#algolia-agentstudio-chat-host {
  position: fixed !important;
  left: 20px !important;
  right: auto !important;
  bottom: 20px !important;
  top: auto !important;
  width: 380px !important;
  max-width: calc(100vw - 40px) !important;
  z-index: 2147483647 !important;
}

/* Keep the blue button where it belongs */
#algolia-agentstudio-chat-trigger {
  position: relative !important;
  z-index: 2147483647 !important;
}

/* Keep the chat widget in the same horizontal position */
#algolia-agentstudio-chat {
  position: relative !important;
  width: 380px !important;
  max-width: calc(100vw - 40px) !important;
  z-index: 2147483646 !important;
}

/* Move only the open chat panel upward so it clears the button */
#algolia-agentstudio-chat .ais-Chat-panel,
#algolia-agentstudio-chat .ais-Chat-panel[style],
#algolia-agentstudio-chat .ais-Chat__panel {
  margin-bottom: 82px !important;
  transform-origin: left bottom !important;
}

/* Do not reposition the internal root or the button */
#algolia-agentstudio-chat .ais-Chat,
#algolia-agentstudio-chat-trigger .ais-Chat,
#algolia-agentstudio-chat-trigger .ais-Chat-toggleButtonWrapper,
#algolia-agentstudio-chat-trigger .ais-Chat__toggleButtonWrapper {
  left: auto !important;
  right: auto !important;
  top: auto !important;
}

/* Button stays clickable and above the page */
#algolia-agentstudio-chat-trigger,
#algolia-agentstudio-chat-trigger * {
  z-index: 2147483647 !important;
  pointer-events: auto !important;
}

/* Hide WorkRamp search area until custom widget is ready */
.academy-search-bar-wrapper,
.academy-search-bar-wrapper.AL_Custom_NavSearchBar {
  visibility: hidden !important;
}

/* Reveal once widget mounted */
.academy-search-bar-wrapper.widget-ready,
.academy-search-bar-wrapper.AL_Custom_NavSearchBar.widget-ready {
  visibility: visible !important;
}