/* Only existing vendor controls are positioned; website controls stay unchanged. */
/* Fail closed before the device gate runs, and for wide desktop-mode tablets.
   Remove the complete vendor interface from layout, hit testing and focus. */
html:not([data-ao-jivo-desktop="true"]) :is(jdiv,#jdiv,#jcont,#jivo-iframe-container,.ao-chat-close,.ao-chat-inline,[data-chat-open],iframe[id^="jivo"],iframe[src*=".jivosite.com"]) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
/* Immediate protection while resize/device media events are being processed. */
@media (max-width: 1024px) {
  :is(jdiv,#jdiv,#jcont,#jivo-iframe-container,.ao-chat-close,.ao-chat-inline,[data-chat-open],iframe[id^="jivo"],iframe[src*=".jivosite.com"]) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}
[data-ao-jivo-float] {
  bottom: var(--ao-jivo-lift, calc(var(--spacing) * 4)) !important;
  top: auto !important;
  right: var(--ao-jivo-right, calc(var(--spacing) * 4)) !important;
  left: auto !important;
  max-height: var(--ao-jivo-height, 90dvh) !important;
}
.ao-chat-open [data-ao-jivo-float] { overflow: auto !important; }
/* The existing button lives outside .ao-recovery, so its old scoped --ao-*
   colors are not inherited. Use the site's global design-system tokens. */
@media (min-width: 1025px) {
  html[data-ao-jivo-desktop="true"] .ao-chat-close:not([hidden]) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: fixed !important;
    z-index: 2147483647 !important;
    top: var(--ao-chat-close-top, calc(var(--spacing) * 4)) !important;
    right: var(--ao-chat-close-right, calc(var(--spacing) * 4)) !important;
    min-width: 44px;
    min-height: 44px;
    padding: calc(var(--spacing) * 2) calc(var(--spacing) * 3);
    color: hsl(var(--primary-foreground)) !important;
    background: hsl(var(--primary)) !important;
    border: 2px solid hsl(var(--primary-foreground));
    border-radius: var(--radius);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    pointer-events: auto !important;
    visibility: visible;
  }
  html[data-ao-jivo-desktop="true"] .ao-chat-close:focus-visible {
    outline: 3px solid hsl(var(--ring));
    outline-offset: 2px;
  }
}
/* The vendor keeps a transparent conversation host after closing. It must not
   intercept clicks through its invisible rectangle (the label is separate). */
html:not(.ao-chat-open) #jcont,
html:not(.ao-chat-open) #jcont * { pointer-events: none !important; }
html[data-ao-assistant-open="true"] [data-ao-jivo-float],
html[data-ao-assistant-open="true"] .ao-chat-close {
  visibility: hidden !important;
  pointer-events: none !important;
}
