
/* oMATIC Minds v0.6.8.42 Image Studio phone composer toggle/action clearance.
   Loaded last. Phone-only close/open composer with content kept above the tool. */

/* Old pull-down experiment remains disabled everywhere. */
body.om-image-studio-route .om-image-composer-mobile-handle,
body.om-image-studio-route .om-image-composer-mobile-grip,
body.om-image-studio-route .om-image-composer-mobile-handle-label {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

.om-image-phone-composer-toggle {
  display: none;
}

@media (max-width: 640px) {
  body.om-image-studio-route {
    --om-image-phone-rail: 60px !important;
    --om-image-phone-side-pad: 8px !important;
    --om-image-studio-composer-clearance: 390px !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell,
  body.om-image-composer-collapsed.om-image-studio-route .om-image-studio-composer-shell,
  body.om-image-studio-route .om-image-studio-composer-shell.is-collapsed {
    position: fixed !important;
    left: var(--om-image-phone-rail) !important;
    right: var(--om-image-phone-side-pad) !important;
    bottom: 8px !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 50vh !important;
    margin: 0 !important;
    padding: 10px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-radius: 18px !important;
    box-sizing: border-box !important;
    z-index: 150 !important;
    background: rgba(31,33,38,.975) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.42) !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.om-image-studio-route .om-image-phone-composer-toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 36px !important;
    height: 36px !important;
    margin: 0 0 8px !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,.14) !important;
    background: rgba(255,255,255,.09) !important;
    color: #fff !important;
    font-size: .82rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    text-align: center !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    pointer-events: auto !important;
  }

  body.om-image-studio-route .om-image-live-confirm-row {
    display: block !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    font-size: .74rem !important;
    line-height: 1.25 !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas:
      "upload upload"
      "prompt prompt"
      "model advanced"
      "send send" !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-chat-composer-plus {
    grid-area: upload !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 38px !important;
    height: 38px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-ref-plus {
    display: none !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-ref-mobile-label {
    display: inline !important;
    white-space: nowrap !important;
    font-size: .82rem !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form textarea[name="prompt"] {
    grid-area: prompt !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 58px !important;
    max-height: 92px !important;
    padding: 10px 12px !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-model-select-wrap {
    grid-area: model !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-model-select-wrap select {
    width: 100% !important;
    min-height: 40px !important;
    padding: 8px 34px 8px 12px !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-advanced-prompt-trigger {
    grid-area: advanced !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-chat-composer-mic {
    display: none !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-chat-send-button {
    grid-area: send !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: 44px !important;
    border-radius: 14px !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    font-size: 0 !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-chat-send-button span,
  body.om-image-studio-route #om-image-studio-generate-form .om-chat-send-button::after {
    display: none !important;
    content: none !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-chat-send-button::before {
    content: "Send" !important;
    display: inline !important;
    color: inherit !important;
    font-size: .95rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }

  /* Keep the image/action content scrollable above the open composer. */
  body.om-image-studio-route .om-image-studio-messages,
  body.om-image-studio-route .om-image-generation-grid {
    padding-bottom: 420px !important;
  }

  body.om-image-studio-route .om-image-generation-card {
    margin-bottom: 380px !important;
  }

  body.om-image-studio-route .om-image-generation-actions.split-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
  }

  body.om-image-studio-route .om-image-generation-actions.split-actions > *,
  body.om-image-studio-route .om-image-generation-actions.split-actions form,
  body.om-image-studio-route .om-image-generation-actions.split-actions button,
  body.om-image-studio-route .om-image-generation-actions.split-actions .button,
  body.om-image-studio-route .om-image-generation-actions.split-actions details,
  body.om-image-studio-route .om-image-generation-actions.split-actions summary {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    box-sizing: border-box !important;
  }

  /* Closed composer: leave only a small fixed tab, so Download/Delete behind it are usable. */
  body.om-image-phone-composer-closed.om-image-studio-route {
    --om-image-studio-composer-clearance: 82px !important;
  }

  body.om-image-phone-composer-closed.om-image-studio-route .om-image-studio-composer-shell {
    left: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    width: 180px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  body.om-image-phone-composer-closed.om-image-studio-route .om-image-studio-composer-shell .om-image-live-confirm-row,
  body.om-image-phone-composer-closed.om-image-studio-route .om-image-studio-composer-shell .om-image-generation-submit-status,
  body.om-image-phone-composer-closed.om-image-studio-route .om-image-studio-composer-shell #om-image-studio-generate-form {
    display: none !important;
  }

  body.om-image-phone-composer-closed.om-image-studio-route .om-image-phone-composer-toggle {
    display: flex !important;
    width: 180px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border-radius: 999px !important;
    background: rgba(80,80,80,.97) !important;
    box-shadow: 0 10px 32px rgba(0,0,0,.38) !important;
    pointer-events: auto !important;
  }

  body.om-image-phone-composer-closed.om-image-studio-route .om-image-studio-messages,
  body.om-image-phone-composer-closed.om-image-studio-route .om-image-generation-grid {
    padding-bottom: 96px !important;
  }

  body.om-image-phone-composer-closed.om-image-studio-route .om-image-generation-card {
    margin-bottom: 88px !important;
  }
}
