/* CodzeeyAI v0.9.6 mobile support and account-menu fixes. */
/* Keep My Account and Logout above the fixed WhatsApp workspace. */
html.codzeey-whatsapp-page-active .codzeey-account-stack,
body.codzeey-whatsapp-page-active .codzeey-account-stack{isolation:auto!important;z-index:2147483000!important;overflow:visible!important}
html.codzeey-whatsapp-page-active .codzeey-account-needs-position,
body.codzeey-whatsapp-page-active .codzeey-account-needs-position{position:relative!important}
html.codzeey-whatsapp-page-active .codzeey-mobile-account-menu,
body.codzeey-whatsapp-page-active .codzeey-mobile-account-menu{z-index:2147483001!important}
html.codzeey-whatsapp-page-active .typony-shell.is-message-center,
body.codzeey-whatsapp-page-active .typony-shell.is-message-center{z-index:9000!important}
.cz-support-record.recording {
  width: 58px;
  flex-basis: 58px;
  border-radius: 18px;
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 900px) {
  html.cz-support-is-open {
    overflow: hidden;
  }

  .codzeey-support {
    right: 12px;
    bottom: max(18px, env(safe-area-inset-bottom));
  }

  .cz-support-panel {
    position: fixed;
    inset: auto 10px calc(72px + env(safe-area-inset-bottom));
    width: auto;
    height: min(72dvh, 620px);
    max-height: calc(100dvh - 96px - env(safe-area-inset-bottom));
    border-radius: 18px;
  }

  .cz-support-panel header {
    flex-basis: 62px;
    min-height: 62px;
  }

  .cz-support-suggestions {
    padding: 8px;
  }

  .cz-support-messages {
    padding: 12px;
  }

  .cz-support-launch b {
    display: none;
  }

  .cz-support-launch {
    padding: 10px;
  }

  .cz-support-form {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  /* Added by typony.js only to the menu that contains the real logout link. */
  .codzeey-mobile-account-menu {
    position: fixed !important;
    top: var(--codzeey-account-top, max(72px, env(safe-area-inset-top))) !important;
    right: 12px !important;
    left: auto !important;
    width: min(300px, calc(100vw - 24px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100dvh - 92px - env(safe-area-inset-bottom)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    z-index: 2147483001 !important;
    box-sizing: border-box !important;
  }

  .codzeey-mobile-account-menu * {
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
  }

  .codzeey-account-stack {
    isolation: auto !important;
    z-index: 2147483000 !important;
  }

  .codzeey-account-needs-position {
    position: relative !important;
  }

  /* Keep the dashboard's sticky tab rail below the open account dropdown. */
  html.codzeey-account-menu-open .typony-sidebar,
  html.codzeey-account-menu-open .codzeeyai-dashboard-frame .typony-sidebar {
    z-index: 1 !important;
  }

  .codzeey-mobile-account-menu a,
  .codzeey-mobile-account-menu button {
    touch-action: manipulation;
  }

  .cz-support-record.stopping {
    background: #eef2f7;
    color: #40506d;
    pointer-events: none;
  }
}

@media (max-width: 420px) {
  .cz-support-panel {
    inset: auto 8px calc(66px + env(safe-area-inset-bottom));
    height: min(74dvh, 590px);
  }

  .cz-support-message {
    max-width: 92%;
  }

  .cz-support-form {
    gap: 4px;
    padding-inline: 7px;
  }

  .cz-support-file,
  .cz-support-record,
  .cz-support-send {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }

  .cz-support-record.recording {
    width: 54px;
    flex-basis: 54px;
  }

  .cz-support-form textarea {
    font-size: 16px;
  }
}

@media (max-height: 560px) and (max-width: 900px) {
  .cz-support-panel {
    inset: auto 10px calc(68px + env(safe-area-inset-bottom));
    height: calc(100dvh - 88px - env(safe-area-inset-bottom));
    max-height: none;
  }

  .cz-support-suggestions {
    display: none;
  }
}
