
/* oMATIC Minds v0.6.8.40 Image Studio composer reset.
   Removes the unstable pull-down tray/collapsed composer experiment and restores a stable composer. */

/* Kill any stale tray UI 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;
}

/* Collapsed class should have no visual effect anymore. */
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,
body.om-image-studio-route .om-image-studio-composer-shell {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Desktop/tablet stable composer: compact centered bottom tool. */
@media (min-width: 641px) {
  body.om-image-studio-route {
    --om-image-studio-composer-clearance: 150px !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: 50% !important;
    right: auto !important;
    bottom: 22px !important;
    transform: translateX(-50%) !important;
    width: min(900px, calc(100vw - 380px)) !important;
    max-width: 900px !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: 190px !important;
    margin: 0 !important;
    padding: 14px 18px !important;
    overflow: visible !important;
    border-radius: 22px !important;
    box-sizing: border-box !important;
    z-index: 120 !important;
    background: rgba(31,33,38,.96) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.36) !important;
  }

  @media (max-width: 1180px) and (min-width: 641px) {
    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 {
      left: calc(50% + 28px) !important;
      width: min(860px, calc(100vw - 112px)) !important;
      max-width: min(860px, calc(100vw - 112px)) !important;
    }
  }

  body.om-image-studio-route .om-image-live-confirm-row,
  body.om-image-composer-collapsed.om-image-studio-route .om-image-live-confirm-row,
  body.om-image-studio-route .om-image-studio-composer-shell.is-collapsed .om-image-live-confirm-row {
    display: block !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    min-height: 20px !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form,
  body.om-image-composer-collapsed.om-image-studio-route #om-image-studio-generate-form,
  body.om-image-studio-route .om-image-studio-composer-shell.is-collapsed #om-image-studio-generate-form {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form textarea[name="prompt"] {
    min-height: 42px !important;
    max-height: 112px !important;
    flex: 1 1 auto !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-model-select-wrap {
    flex: 0 0 178px !important;
    max-width: 178px !important;
  }

  body.om-image-studio-route .om-image-generation-submit-status[hidden] {
    display: none !important;
  }

  body.om-image-studio-route .om-image-generation-card,
  body.om-image-composer-collapsed.om-image-studio-route .om-image-generation-card {
    transform: none !important;
    margin-bottom: 0 !important;
  }

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

/* Phone stable composer: full usable width, stacked enough to be readable, not clipped by left rail. */
@media (max-width: 640px) {
  body.om-image-studio-route {
    --om-image-studio-composer-clearance: 260px !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: 64px !important;
    right: 10px !important;
    bottom: 10px !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(48vh, 320px) !important;
    margin: 0 !important;
    padding: 12px 10px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    border-radius: 20px !important;
    box-sizing: border-box !important;
    z-index: 140 !important;
    background: rgba(31,33,38,.96) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.40) !important;
    transform: none !important;
  }

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

  body.om-image-studio-route #om-image-studio-generate-form,
  body.om-image-composer-collapsed.om-image-studio-route #om-image-studio-generate-form,
  body.om-image-studio-route .om-image-studio-composer-shell.is-collapsed #om-image-studio-generate-form {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

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

  body.om-image-studio-route #om-image-studio-generate-form .om-image-model-select-wrap,
  body.om-image-studio-route #om-image-studio-generate-form select,
  body.om-image-studio-route #om-image-studio-generate-form .button,
  body.om-image-studio-route #om-image-studio-generate-form button {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route #om-image-studio-generate-form .om-image-send-button,
  body.om-image-studio-route #om-image-studio-generate-form button[type="submit"] {
    min-height: 44px !important;
    padding: 10px 14px !important;
  }

  body.om-image-studio-route .om-image-generation-card,
  body.om-image-composer-collapsed.om-image-studio-route .om-image-generation-card {
    transform: none !important;
    margin-bottom: 24px !important;
  }

  body.om-image-studio-route .om-image-studio-messages,
  body.om-image-composer-collapsed.om-image-studio-route .om-image-studio-messages,
  body.om-image-studio-route .om-image-generation-grid,
  body.om-image-composer-collapsed.om-image-studio-route .om-image-generation-grid {
    padding-bottom: 300px !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;
    box-sizing: border-box !important;
  }
}
