/* Zone3Dplus Phase 3A — major staged UPLOAD WORKSPACE redesign.
 * Additive style only. Never rewrites original uploader, card controls, steps,
 * R2 endpoints, calculated data or add-to-cart elements.
 */
#m3dreader { --z3d3a-ink: #192231; --z3d3a-pink: #E40C44; --z3d3a-gray: #64748b; }
#m3dreader .z3d3a-hero,
#m3dreader .z3d3a-progress { width: min(100% - 32px, 1280px); margin-inline: auto; }
#m3dreader .z3d3a-hero {
  position: relative; display: flex; align-items: center; min-height: 230px;
  padding: clamp(25px, 4vw, 48px); overflow: hidden;
  border-radius: 22px; background: #171e2a; color: white; isolation: isolate;
  box-shadow: 0 22px 50px rgba(21,30,45,.1);
}
#m3dreader .z3d3a-hero:before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at 83% 62%, rgba(228,12,68,.3), transparent 32%),
              linear-gradient(110deg,#171e2a 0%,#171e2a 58%,#242435 100%);
}
#m3dreader .z3d3a-hero-content { position: relative; z-index: 2; max-width: 690px; }
#m3dreader .z3d3a-hero-eyebrow {
  color: #ff9ab4; font-size: 11px; font-weight: 850; letter-spacing: .15em;
  margin: 0 0 14px; text-transform: uppercase;
}
#m3dreader .z3d3a-hero-title {
  margin: 0 0 13px; padding: 0; max-width: 680px; color: #fff;
  font: 850 clamp(29px,3.3vw,47px)/1.1 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing: -.035em;
}
#m3dreader .z3d3a-hero-description {
  max-width: 600px; color: #cad2de; font-size: clamp(13px,1.2vw,15px);
  line-height: 1.65; margin: 0 0 23px;
}
#m3dreader .z3d3a-hero-details { display: flex; flex-wrap: wrap; gap: 8px; }
#m3dreader .z3d3a-hero-details span {
  color: #e0e5ed; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.045); border-radius: 999px;
  padding: 6px 11px; font-size: 10px; letter-spacing: .065em; font-weight: 650;
}
#m3dreader .z3d3a-hero-art {
  position: absolute; width: 310px; height: 290px; right: 3%; top: -14px;
  display: grid; place-items: center; transform: rotate(-12deg); pointer-events: none;
}
#m3dreader .z3d3a-orbit {
  position: absolute; border: 1px solid rgba(252,116,152,.43);
  border-radius: 34%; transform: rotate(45deg);
}
#m3dreader .z3d3a-orbit-a { width: 220px; height: 220px; }
#m3dreader .z3d3a-orbit-b { width: 160px; height: 160px; transform: rotate(18deg); border-color: rgba(255,255,255,.2); }
#m3dreader .z3d3a-orbit-c { width: 270px; height: 100px; transform: rotate(-19deg); border-color: rgba(244,67,116,.4); }
#m3dreader .z3d3a-orbit-core {
  width: 98px; height: 98px; border-radius: 28px; display: grid; place-items: center;
  color: #fff; font: 850 35px/1 system-ui,sans-serif; box-shadow: 0 20px 50px rgba(228,12,68,.35);
  background: linear-gradient(135deg,#fa3569,#cb0037); transform: rotate(12deg);
}
/* Progress is intentionally informative, not clickable. The original step
   buttons and their business validation remain the only navigation controls. */
#m3dreader .z3d3a-progress {
  margin-top: 17px; margin-bottom: 0; padding: 16px 20px;
  border: 1px solid #e6eaf0; background: #fff; border-radius: 17px;
  box-shadow: 0 5px 24px rgba(15,23,42,.035);
}
#m3dreader .z3d3a-progress-list {
  display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: center;
  gap: 6px; margin: 0; padding: 0; list-style: none;
}
#m3dreader .z3d3a-progress-item {
  display: flex; align-items: center; min-width: 0; gap: 10px;
  color: #818b9a; font: 750 12px/1.2 system-ui,sans-serif;
}
#m3dreader .z3d3a-progress-number {
  flex: 0 0 31px; width: 31px; height: 31px; display: grid; place-items: center;
  background: #f4f6f9; color: #7d8899; border: 1px solid #e2e7ee;
  border-radius: 50%; font-size: 11px;
}
#m3dreader .z3d3a-progress-item.is-active { color: #e40c44; }
#m3dreader .z3d3a-progress-item.is-active .z3d3a-progress-number { color: white; border-color: #e40c44; background: #e40c44; }
#m3dreader .z3d3a-progress-item.is-complete { color: #273447; }
#m3dreader .z3d3a-progress-item.is-complete .z3d3a-progress-number { background: #e8f8ef; border-color: #bdebd0; color: #16804a; }

/* Main stage 0 layout: large upload surface + separate, live overview, with the
   original multi-model list and buttons in an untouched full-width bottom row. */
#m3dreader.step-0 #m3dreader__container {
  width: min(100% - 32px, 1280px) !important; max-width: 1280px;
  display: grid !important; grid-template-columns: minmax(0,1fr) minmax(280px,340px);
  grid-auto-flow: row; gap: 20px 22px; align-items: stretch;
  margin: 19px auto 46px !important;
}
#m3dreader.step-0 .m3dreader__files-uploader--wrapper {
  grid-column: 1; grid-row: 1; min-width: 0; width: 100%;
  padding: clamp(18px,2.2vw,27px); border: 1px solid #e6eaf0; border-radius: 19px;
  background: #fff; box-shadow: 0 8px 28px rgba(16,24,40,.045);
}
#m3dreader.step-0 .m3dreader__page-title { display: none !important; }
#m3dreader .z3d3a-upload-intro { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 20px; }
#m3dreader .z3d3a-kicker { display: block; margin-bottom: 7px; font-weight: 800; font-size: 10px; letter-spacing: .11em; color: #e40c44; }
#m3dreader .z3d3a-upload-heading { margin: 0 0 5px; font: 800 clamp(20px,2vw,27px)/1.18 system-ui,sans-serif; letter-spacing: -.025em; color: #192231; }
#m3dreader .z3d3a-upload-subheading { margin: 0; color: #6e7d91; font-size: 13px; line-height: 1.5; }
#m3dreader .z3d3a-stage-tag { flex: 0 0 auto; margin-top: 3px; border-radius: 7px; background: #f3f5f8; padding: 7px 9px; color: #637389; font-weight: 800; font-size: 10px; letter-spacing: .05em; }
#m3dreader.step-0 .m3dreader__files-uploader {
  min-height: 260px; border: 2px dashed #f19ab2; border-radius: 16px;
  background: linear-gradient(150deg,#fff9fb,#fffafb 55%,#fff);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 11px; padding: 26px 20px; cursor: pointer;
}
#m3dreader.step-0 .m3dreader__files-uploader.dragover,
#m3dreader.step-0 .m3dreader__files-uploader:hover { border-color:#e40c44; background: #fff4f7; }
#m3dreader.step-0 .m3dreader__files-uploader--icon {
  display: grid; place-items: center; width: 66px; height: 66px;
  margin: 0 0 4px; border-radius: 18px; background: #ffe8f0; padding: 17px;
}
#m3dreader.step-0 .m3dreader__files-uploader--icon svg { width: 100%; height: 100%; }
#m3dreader.step-0 .m3dreader__files-uploader p { display: none !important; }
#m3dreader .z3d3a-drop-title { color: #1d2939; font-weight: 800; font-size: 18px; line-height: 1.25; text-align: center; }
#m3dreader .z3d3a-drop-hint { color: #7a889b; font-size: 12px; text-align: center; }
#m3dreader .z3d3a-drop-cta {
  margin-top: 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #e40c44; color: white; min-height: 42px;
  padding: 11px 20px; font-size: 12px; font-weight: 800; pointer-events: none;
  box-shadow: 0 8px 19px rgba(228,12,68,.14);
}
#m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .m3dreader__files-uploader,
#m3dreader.step-0 .m3dreader__files-uploader--container.has-models .m3dreader__files-uploader {
  min-height: 132px; padding: 17px 20px; flex-direction: row; flex-wrap: wrap; justify-content: flex-start;
  gap: 8px 14px;
}
#m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .m3dreader__files-uploader--icon,
#m3dreader.step-0 .m3dreader__files-uploader--container.has-models .m3dreader__files-uploader--icon {
  width: 47px; height: 47px; flex-basis: 47px; padding: 11px; margin: 0;
}
#m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .z3d3a-drop-title,
#m3dreader.step-0 .m3dreader__files-uploader--container.has-models .z3d3a-drop-title { font-size: 16px; }
#m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .z3d3a-drop-hint,
#m3dreader.step-0 .m3dreader__files-uploader--container.has-models .z3d3a-drop-hint { flex-basis: 100%; text-align: left; padding-left: 61px; order: 3; }
#m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .z3d3a-drop-cta,
#m3dreader.step-0 .m3dreader__files-uploader--container.has-models .z3d3a-drop-cta { margin: 0 0 0 auto; }
#m3dreader.step-0 .m3dreader__files-uploader--note { margin: 12px 3px 0; font-size: 11px; color: #748299; line-height: 1.6; }

#m3dreader.step-0 .z3d3a-status {
  grid-column: 2; grid-row: 1; min-width: 0; padding: 26px 24px 22px;
  border: 1px solid #e6eaf0; border-radius: 19px; background: white;
  box-shadow: 0 8px 28px rgba(16,24,40,.045);
}
#m3dreader .z3d3a-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
#m3dreader .z3d3a-status-heading h2 { margin: 0; font: 800 18px/1.3 system-ui,sans-serif; color: #1d2939; }
#m3dreader .z3d3a-status-label { color: #e40c44; border: 1px solid #ffcad7; border-radius: 999px; background:#fff6f8; padding: 5px 7px; font-size: 9px; font-weight: 800; }
#m3dreader .z3d3a-status-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#m3dreader .z3d3a-stat { background: #f7f9fc; border: 1px solid #edf1f5; border-radius: 11px; padding: 14px 12px; }
#m3dreader .z3d3a-stat strong { display: block; color: #182538; font-size: 25px; font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums; }
#m3dreader .z3d3a-stat span { display: block; margin-top: 4px; color: #718197; font-size: 11px; }
#m3dreader .z3d3a-status-steps { border-top: 1px solid #e9edf3; margin-top: 20px; padding-top: 19px; }
#m3dreader .z3d3a-status-steps h3 { margin: 0 0 16px; font-size: 13px; font-weight: 800; color: #273447; }
#m3dreader .z3d3a-status-step { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 15px; }
#m3dreader .z3d3a-status-step-num { flex: 0 0 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #e40c44; background: #fff0f4; font-size: 10px; font-weight: 800; }
#m3dreader .z3d3a-status-step-copy { min-width: 0; }
#m3dreader .z3d3a-status-step strong { font-size: 12px; font-weight: 800; color:#243246; }
#m3dreader .z3d3a-status-step p { margin: 3px 0 0; font-size: 11px; line-height: 1.5; color:#748198; }
#m3dreader .z3d3a-status-help { border-top:1px solid #e9edf3; margin: 9px 0 0; padding-top:15px; color: #79869a; font-size: 11px; line-height: 1.5; }

/* Present uploaded model cards as the second *full-width* part of the workspace.
   The original card grid, live selection, progress, and buttons are untouched. */
#m3dreader.step-0 #m3dreader__model--uploaded:not(.hide) {
  grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0;
  padding: 26px; background: #fff; border: 1px solid #e6eaf0;
  border-radius: 19px; box-shadow: 0 9px 29px rgba(16,24,40,.045);
}
#m3dreader.step-0 .m3dreader__model--uploaded-header { margin-bottom: 20px; }
#m3dreader.step-0 .m3dreader__model--uploaded-header--title { color: #1d2939; font-size: 18px; }
#m3dreader.step-0 .m3dreader__mini-cart--model-list > .m3dreader__model-item:not(.loading) .m3dreader__model-item--wrap {
  border: 1px solid #e6ebf2; box-shadow: 0 4px 13px rgba(18,31,48,.045);
}
#m3dreader.step-0 #m3dreader__model-property-selector { margin-top: 15px; min-height: 49px; }
/* Avoid keeping a large void inside card descriptions on wide screens. */
@media (min-width: 1201px) {
  #m3dreader.step-0 .m3dreader__mini-cart--model-list > .m3dreader__model-item:not(.loading) .m3dreader__model-item--wrap {
    grid-template-rows: minmax(43px,auto) minmax(29px,auto) minmax(34px,auto) minmax(44px,1fr) !important;
    row-gap: 5px !important;
  }
}
/* Follow-up phases redesign materials and review. This phase adds a persistent,
   passive progress indicator there without disrupting those step layouts. */
#m3dreader:not(.step-0) .z3d3a-status { display: none !important; }

@media (max-width: 1050px) {
  #m3dreader.step-0 #m3dreader__container { grid-template-columns: minmax(0,1fr) 285px; gap: 16px; }
  #m3dreader .z3d3a-hero-art { right:-30px; opacity:.62; }
  #m3dreader .z3d3a-hero-content { max-width: 68%; }
}
@media (max-width: 800px) {
  #m3dreader.step-0 #m3dreader__container { display: flex !important; flex-direction: column !important; }
  #m3dreader.step-0 .m3dreader__files-uploader--wrapper { width: 100%; order:1; }
  #m3dreader.step-0 .z3d3a-status { order:2; width: 100%; }
  #m3dreader.step-0 #m3dreader__model--uploaded:not(.hide) { order:3; }
  #m3dreader .z3d3a-status-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
  #m3dreader .z3d3a-status-steps h3 { grid-column: 1 / -1; margin-bottom: 1px; }
  #m3dreader .z3d3a-status-step { margin-bottom: 0; }
  #m3dreader .z3d3a-progress { padding: 13px 15px; }
}
@media (max-width: 580px) {
  #m3dreader .z3d3a-hero,
  #m3dreader .z3d3a-progress { width: min(100% - 20px, 1280px); }
  #m3dreader .z3d3a-hero { min-height: 235px; padding: 25px 21px; border-radius: 16px; }
  #m3dreader .z3d3a-hero-content { max-width: 100%; }
  #m3dreader .z3d3a-hero-art { width: 190px; height: 180px; right:-75px; bottom:-85px; top:auto; opacity:.23; }
  #m3dreader .z3d3a-hero-title { font-size: clamp(27px,7.5vw,36px); }
  #m3dreader .z3d3a-hero-description { font-size: 12px; }
  #m3dreader .z3d3a-hero-details span { padding: 5px 7px; font-size: 9px; }
  #m3dreader .z3d3a-progress { border-radius: 13px; padding: 12px 7px; }
  #m3dreader .z3d3a-progress-list { gap: 0; }
  #m3dreader .z3d3a-progress-item { flex-direction: column; gap: 6px; font-size: 9px; text-align: center; }
  #m3dreader .z3d3a-progress-number { width: 29px; height: 29px; flex-basis: 29px; }
  #m3dreader.step-0 #m3dreader__container { width: min(100% - 20px,1280px) !important; margin-top: 15px !important; }
  #m3dreader.step-0 .m3dreader__files-uploader--wrapper { padding: 17px; border-radius: 15px; }
  #m3dreader .z3d3a-upload-intro { flex-wrap: wrap; gap: 10px; }
  #m3dreader .z3d3a-upload-heading { font-size: 22px; }
  #m3dreader.step-0 .m3dreader__files-uploader { min-height: 238px; padding: 21px 13px; }
  #m3dreader .z3d3a-drop-title { font-size: 16px; }
  #m3dreader .z3d3a-drop-hint { font-size: 11px; }
  #m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .m3dreader__files-uploader,
  #m3dreader.step-0 .m3dreader__files-uploader--container.has-models .m3dreader__files-uploader {
    flex-direction: column; justify-content: center; min-height: 155px; gap: 9px;
  }
  #m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .z3d3a-drop-hint,
  #m3dreader.step-0 .m3dreader__files-uploader--container.has-models .z3d3a-drop-hint { order:unset; text-align:center; padding-left:0; flex-basis:auto; }
  #m3dreader.step-0 .m3dreader__files-uploader--container.z3d3a-has-files .z3d3a-drop-cta,
  #m3dreader.step-0 .m3dreader__files-uploader--container.has-models .z3d3a-drop-cta { margin:0; }
  #m3dreader.step-0 .z3d3a-status { padding:20px; border-radius: 15px; }
  #m3dreader .z3d3a-status-steps { display: block; }
  #m3dreader .z3d3a-status-steps h3 { margin-bottom: 15px; }
  #m3dreader .z3d3a-status-step { margin-bottom: 14px; }
  #m3dreader.step-0 #m3dreader__model--uploaded:not(.hide) { padding: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  #m3dreader .z3d3a-hero *,
  #m3dreader .z3d3a-progress * { transition: none !important; animation: none !important; }
}
