/*
 * Zone3Dplus Phase 3A.4 — equal-size upload/workspace panels.
 * Staging-only presentation overrides. Loaded after Phase 3A.3.
 * Existing R2 transfer events and native model cards are not changed.
 */

/* Desktop: equal WIDTHS, equal HEIGHTS, and aligned top/bottom edges. */
#m3dreader.step-0[data-z3d3a2-init="1"] #m3dreader__container {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch !important;
  column-gap: 20px !important;
}

#m3dreader.step-0[data-z3d3a2-init="1"] .m3dreader__files-uploader--wrapper,
#m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a-status {
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  align-self: stretch !important;
  box-sizing: border-box !important;
}

/* Keep "Your Workspace" and live counts. Remove ONLY highlighted guide copy. */
#m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a-status-steps,
#m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a-status-help {
  display: none !important;
}

/*
 * If many files are uploading, the transfer list scrolls within
 * "Upload your 3D models". The choose-files area, explanatory note,
 * live status tiles, and "Your Models" remain visible and unaffected.
 */
#m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a2-transfer-box {
  min-width: 0 !important;
  max-width: 100% !important;
}
#m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a2-transfer-list {
  display: grid !important;
  max-height: 218px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 5px;
  align-content: start;
}
#m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a2-upload-item {
  min-width: 0;
}

/* A half-width desktop upload area must wrap controls instead of overflowing. */
@media (min-width: 981px) and (max-width: 1280px) {
  #m3dreader.step-0[data-z3d3a2-init="1"] .m3dreader__files-uploader {
    flex-wrap: wrap !important;
    gap: 9px 12px !important;
  }
  #m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a-drop-cta {
    margin-left: 0 !important;
  }
  #m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a-drop-hint {
    padding-left: 0 !important;
  }
}

/* Tablet and phone: preserve the established single-column flow. */
@media (max-width: 980px) {
  #m3dreader.step-0[data-z3d3a2-init="1"] #m3dreader__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  #m3dreader.step-0[data-z3d3a2-init="1"] .m3dreader__files-uploader--wrapper {
    order: 1 !important;
    width: 100% !important;
  }
  #m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a-status {
    order: 2 !important;
    width: 100% !important;
  }
  #m3dreader.step-0[data-z3d3a2-init="1"] #m3dreader__model--uploaded:not(.hide) {
    order: 3 !important;
    width: 100% !important;
  }
  #m3dreader.step-0[data-z3d3a2-init="1"] .z3d3a2-transfer-list {
    max-height: 210px !important;
  }
}
