/* Site overrides: mobile safe-area, stacking below WhatsApp float, touch */
#autotest-whatsapp-float,
#autotest-contact-float,
#autotest-mail-float {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0,0,0,.25);
}
#autotest-whatsapp-float {
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  background: #25D366;
  z-index: 2147483647;
}
#autotest-contact-float {
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 68px);
  background: #6d28d9;
  z-index: 2147483500;
}
#autotest-mail-float {
  bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 136px);
  background: #2563eb;
  z-index: 2147483400;
}

#mic-init-access-tool .mic-access-tool-general-button {
  z-index: 99990 !important;
  bottom: max(7px, env(safe-area-inset-bottom, 0px)) !important;
  right: max(7px, env(safe-area-inset-right, 0px)) !important;
  touch-action: manipulation;
}

#mic-init-access-tool .mic-access-tool-general-button.mic-access-tool-general-button-right {
  left: auto !important;
}

#mic-init-access-tool .mic-access-tool-box {
  z-index: 9999998 !important;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Keep widgets visible and non-overlapping on mobile screens. */
@media (max-width: 767px) {
  html,
  body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #autotest-whatsapp-float {
    display: flex !important;
    left: max(16px, env(safe-area-inset-left, 0px)) !important;
    bottom: max(16px, env(safe-area-inset-bottom, 0px)) !important;
    z-index: 2147483647 !important;
  }

  #mic-init-access-tool .mic-access-tool-general-button {
    display: block !important;
    right: max(16px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(86px, calc(env(safe-area-inset-bottom, 0px) + 78px)) !important;
    z-index: 2147483600 !important;
  }

  #mic-init-access-tool .mic-access-tool-box {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .magic-button-container,
  .magic-button-container .all-magic-buttons {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .magic-button-container .all-magic-buttons {
    z-index: 2147483500 !important;
  }

  #autotest-contact-float {
    display: inline-flex !important;
  }
  #autotest-mail-float {
    display: inline-flex !important;
  }
}
