/* Assistant access has a stable place: a mobile navigation slot or a
   full-size desktop robot in the page gutter. Scrolling never hides it. */
html body#top .etl-chat-fab {
  right: 16px !important; left: auto !important;
  bottom: calc(110px + var(--etl-bar-h, 0px) + var(--etl-cookie-h, 0px)
    + env(safe-area-inset-bottom, 0px)) !important;
  width: 92px !important; height: 92px !important; min-width: 92px !important;
  padding: 0 !important; gap: 0 !important;
  transform: none !important; filter: drop-shadow(0 3px 5px rgba(0,0,0,.16)) !important;
}
html body#top .etl-chat-fab .etl-chat-fab__avatar,
html body#top .etl-chat-fab .etl-chat-fab__avatar :is(.etl-bot-avatar,.etl-bot-img,.etl-bot-3d) {
  width: 92px !important; height: 92px !important;
}
html body#top .etl-chat-fab .etl-chat-fab__avatar::before,
html body#top .etl-chat-fab .etl-chat-fab__avatar::after { display: none !important; }
html body#top .etl-chat-fab .etl-chat-fab__label { display: none !important; }
html body#top .etl-chat-fab:focus-visible { outline: 2px solid var(--c-accent, #e52629); outline-offset: 2px; }

/* The full-size robot needs its own edge: 92px + 16px + 4px clearance. */
@media (min-width: 1100px) {
  html:root body#top:not(.cabinet-page):not(.admin-page) { --ui-page-gutter: max(112px, 2.2vw) !important; }
}

/* A mobile fallback remains usable if a page has no bottom navigation. */
@media (max-width: 1099px) {
  html body#top .etl-chat-fab {
    width: 72px !important; height: 72px !important; min-width: 72px !important;
    right: 12px !important;
    bottom: calc(16px + var(--etl-cookie-h, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body#top .etl-chat-fab .etl-chat-fab__avatar,
  html body#top .etl-chat-fab .etl-chat-fab__avatar :is(.etl-bot-avatar,.etl-bot-img,.etl-bot-3d) {
    width: 72px !important; height: 72px !important;
  }
  html body#top.has-mbar .etl-chat-fab {
    bottom: calc(70px + var(--etl-cookie-h, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body#top #mbar.mbar--assistant { grid-template-columns: repeat(5,minmax(0,1fr)) !important; }
  html body#top #mbar.mbar--assistant .mbar__item { padding-inline: 0 !important; }
  html body#top #mbar .mbar__assistant-slot { min-width: 0; display: flex; }
  html body#top #mbar .etl-chat-fab {
    position: relative !important; inset: auto !important;
    display: flex !important; flex-direction: column; align-items: center; justify-content: center;
    width: 100% !important; max-width: 100% !important; min-width: 0 !important;
    height: 56px !important; min-height: 56px !important; padding: 2px 0 !important; gap: 1px !important;
    border: 0 !important; border-radius: 0 !important; background: transparent !important;
    color: var(--ui-muted, #58616b) !important; box-shadow: none !important; filter: none !important;
    transform: none !important; transition: background-color .16s ease !important;
  }
  html body#top #mbar .etl-chat-fab .etl-chat-fab__avatar,
  html body#top #mbar .etl-chat-fab .etl-chat-fab__avatar :is(.etl-bot-avatar,.etl-bot-img,.etl-bot-3d) {
    width: 36px !important; height: 36px !important;
  }
  html body#top #mbar .etl-chat-fab .etl-chat-fab__label {
    display: block !important; position: static !important; inset: auto !important;
    width: auto !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important;
    opacity: 1 !important; transform: none !important; visibility: inherit !important;
    font: 500 12px/1.2 var(--ui-font,Inter,sans-serif) !important; color: inherit !important;
    white-space: nowrap; border: 0 !important; border-radius: 0 !important;
    background: none !important; box-shadow: none !important; backdrop-filter: none !important;
  }
  html body#top #mbar .etl-chat-fab:active { background: var(--ui-hover,rgba(16,24,32,.06)) !important; }
  html body#top #mbar .etl-chat-fab:focus-visible { outline-offset: -3px; }
  html body#top #mbar .etl-chat-fab :is(.etl-bot-bubble,.etl-chat-fab__poke) { display: none !important; }
}

/* Typing suppresses promotional prompts, without removing assistant access. */
html.etl-ai-typing .etl-chat-teaser,
html.etl-ai-typing .etl-sticky-cta {
  opacity: 0 !important; visibility: hidden !important; pointer-events: none !important;
}

@media (min-width: 861px) {
  html body .etl-chat-panel {
    left: auto !important; right: 56px !important;
    transform-origin: bottom right !important; max-width: calc(100vw - 80px) !important;
    bottom: calc(22px + var(--etl-cookie-h, 0px)) !important;
    max-height: calc(100vh - 60px - var(--etl-cookie-h, 0px)) !important;
  }
  html body .etl-chat-panel::after { display: none !important; }
  html body .etl-chat-fab :is(.etl-chat-fab__poke,.etl-bot-bubble) { right: 100% !important; left: auto !important; }
}
@media (min-width: 861px) and (max-width: 1099px) {
  html body#top .etl-chat-panel {
    right: 16px !important; bottom: calc(72px + var(--etl-cookie-h,0px)) !important;
    max-height: calc(100vh - 100px - var(--etl-cookie-h,0px)) !important;
  }
}
