
/* oMATIC Minds v0.6.8.70 Image Studio mobile single reference pill.
   Mobile-only simplification: hide the three extra status chips and keep only
   the main References N/8 pill above the Add reference image button. */

@media (max-width: 640px) {
  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage.om-image-reference-stage-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-height: 178px !important;
    height: auto !important;
    max-height: none !important;
    padding: 12px 10px 14px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-stage-head {
    order: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Hide the three mobile-problem chips:
     Current session refs / Reference use / Protected previews. */
  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-session-review {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-stage-head > div:first-child {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* The remaining References N/8 pill gets its own padded top row. */
  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-stage-actions {
    order: 1 !important;
    position: static !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-stage-actions .status-pill {
    order: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    font-size: .72rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-stage-actions button {
    order: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    font-size: .8rem !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-grid {
    order: 2 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 72px !important;
    min-height: 72px !important;
    max-height: 72px !important;
    margin: 0 !important;
    padding: 8px 5px 5px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-card {
    position: relative !important;
    flex: 0 0 56px !important;
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-preview,
  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #image-reference-stage .om-image-reference-preview img {
    width: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
    border-radius: 12px !important;
    object-fit: cover !important;
  }

  /* Keep the rest of the composer below the simplified reference box. */
  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references .om-image-live-confirm-row {
    order: 2 !important;
    margin-top: 2px !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references .om-image-generation-submit-status {
    order: 3 !important;
  }

  body.om-image-studio-route .om-image-studio-composer-shell.has-image-references #om-image-studio-generate-form {
    order: 4 !important;
  }

  body.om-image-studio-route:has(.om-image-studio-composer-shell.has-image-references) {
    --om-image-studio-composer-clearance: 620px;
  }

  body.om-image-studio-route:has(.om-image-studio-composer-shell.has-image-references) .om-chat-messages,
  body.om-image-studio-route:has(.om-image-studio-composer-shell.has-image-references) .om-image-studio-messages {
    padding-bottom: 680px !important;
    scroll-padding-bottom: 680px !important;
  }
}
