/* =============================================================
 *  Studio — Lacoste-style single-screen editor.
 *  The garment canvas owns the viewport; chrome floats on it
 *  (transparent top bar + bottom tool-dock). Controls open as
 *  short bottom-sheets OVER the canvas, so the shirt is always
 *  visible — zero page scroll, mobile-first. Greyscale editor;
 *  only the ONE active tool gets colour (TRUEF gold).
 *  Same skeleton + same #ids/classes → studio.js untouched.
 * ============================================================= */

/* ---- tokens (bright editor palette; the dark theme is flipped) ---- */
body.theme-light {
  --ink:       #f5f5f2;   /* page background (soft white)  */
  --ink-2:     #ffffff;   /* raised surfaces / cards       */
  --ink-3:     #efeee9;   /* insets / chips                */
  --paper:     #191914;   /* primary text (near-black)     */
  --paper-dim: #8b8b82;   /* muted text                    */
  --line:      rgba(0,0,0,.10);
  --olive:     #b78a2e;
  --on-dark:   #191914;

  /* editor (Lacoste) tokens */
  --accent:    #b78a2e;   /* the ONE active-tool colour (TRUEF gold) */
  --hairline:  #ececec;
  --ed-ink:    #2a2a2a;   /* dock icons + wayfinding */
  --ed-muted:  #b4b4b4;
  --canvas-c:  #ffffff;   /* studio gradient — centre */
  --canvas-e:  #e9e9ea;   /* studio gradient — edge  */
  --shadow-contact: rgba(0,0,0,.16);
  --ed-top-h:  56px;
  --ed-dock-h: 68px;
  --font-ed:   "Figtree", "Space Grotesk", system-ui, sans-serif;
}
body.theme-light .grain { display: none; }

/* ---- single-screen shell: never scroll the page ------------------- */
html, body.ed { height: 100%; }
body.ed {
  overflow: hidden;
  background: #e8e8eb;
  color: var(--ed-ink);
  overscroll-behavior: none;
}
/* faint full-viewport wall tone so the area behind the transparent top bar reads
   continuous with the studio cyclorama inside the stage */
body.ed::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, #ececed 0%, #e7e7ea 62%, #e3e3e6 100%);
}

/* =========================== PHOTO-STUDIO ENVIRONMENT ===========================
 * A neutral, greyscale studio so the customer's artwork colours read TRUE: a seamless
 * cyclorama sweep, a soft key light + softbox, a light shaft with drifting dust, faint
 * out-of-focus studio gear, and an edge vignette. Pure CSS/DOM behind the transparent
 * canvas — decoupled from the WebGL camera. Lives inside .ed-stage.                  */
.studio-room { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  perspective: 900px; perspective-origin: 50% 42%; }

/* seamless cyclorama: light pools where the garment stands, falls to grey at the edges;
   a low soft sheen = the floor catching the key light (no hard wall/floor seam) */
.sr-cyc { position: absolute; inset: 0;
  background: radial-gradient(116% 78% at 50% 40%, #fbfbfc 0%, #f1f1f3 46%, #e7e7ea 78%, #e1e1e4 100%); }
.sr-cyc::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 120%; height: 44%;
  background: radial-gradient(58% 100% at 50% 100%, rgba(255,255,255,.55), rgba(255,255,255,0) 72%);
  filter: blur(10px); }

/* faint, out-of-focus studio gear in the haze (light stand left, boom/C-stand right) */
.sr-gear { position: absolute; bottom: 0; height: 60%; opacity: .07; filter: blur(2.5px); }
.sr-gear svg { height: 100%; width: auto; display: block; }
.sr-gear--l { left: -3%; }
.sr-gear--r { right: -4.5%; }

/* soft volumetric light shaft from the upper-left softbox */
.sr-shaft { position: absolute; top: -8%; left: 1%; width: 50%; height: 120%; transform-origin: top left;
  transform: rotate(9deg); mix-blend-mode: screen;
  background: linear-gradient(166deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.05) 30%, rgba(255,255,255,0) 54%);
  filter: blur(7px); }

/* key light pool behind the garment — gently breathing */
.sr-key { position: absolute; left: 50%; top: 33%; transform: translate(-50%,-50%);
  width: 70%; height: 64%; mix-blend-mode: screen;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.62), rgba(255,255,255,0) 68%);
  filter: blur(16px); animation: srBreathe 7.5s ease-in-out infinite; }

/* softbox glow, upper-left, just out of frame */
.sr-softbox { position: absolute; top: -5%; left: 5%; width: 32%; height: 24%; border-radius: 34px;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.5), rgba(255,255,255,0) 70%);
  filter: blur(20px); animation: srBreathe 7.5s ease-in-out infinite .9s; }

/* dust motes drifting in the beam */
.sr-motes { position: absolute; top: 0; left: 0; width: 56%; height: 100%; opacity: .5;
  background-image:
    radial-gradient(1.6px 1.6px at 20% 30%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 38% 62%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.2px 1.2px at 28% 80%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.6px 1.6px at 12% 52%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 44% 22%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.5px 1.5px at 33% 46%, rgba(255,255,255,.8), transparent 60%);
  -webkit-mask-image: linear-gradient(166deg, #000 4%, rgba(0,0,0,.35) 38%, transparent 58%);
          mask-image: linear-gradient(166deg, #000 4%, rgba(0,0,0,.35) 38%, transparent 58%);
  animation: srMotes 24s linear infinite; }

/* a faint perspective FLOOR receding into depth — gives the room real ground + space */
.sr-floor3d { position: absolute; left: 50%; bottom: -2%; width: 240%; height: 60%;
  transform: translateX(-50%) rotateX(82deg); transform-origin: 50% 100%;
  background-image:
    linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px);
  background-size: 66px 66px; opacity: .5;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 66%);
          mask-image: linear-gradient(to top, #000 0%, transparent 66%); }

/* vertical luminance: lit middle (where the garment stands), the back wall + floor
   fall into soft depth so the room reads as a space, not a flat card */
.sr-lum { position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(20,20,26,.10) 0%, rgba(20,20,26,.03) 17%, transparent 40%,
    transparent 60%, rgba(20,20,26,.04) 82%, rgba(20,20,26,.12) 100%); }

/* soft edge vignette + atmospheric falloff so space recedes past the light */
.sr-vignette { position: absolute; inset: 0;
  background: radial-gradient(150% 128% at 50% 41%,
    transparent 50%, rgba(24,24,30,.10) 80%, rgba(18,18,24,.24) 100%); }

/* one-shot theatrical light-show overlay (transparent until Preview-in-3D) */
.sr-flash { position: absolute; inset: 0; background: #0b0b0f; opacity: 0; }

/* ---- Preview LIGHT-SHOW: lights dip, then the studio POPS on (pro, not strobey) ---- */
.ed-stage.preview-show .sr-flash   { animation: pvFlash 1.9s var(--ease) both; }
.ed-stage.preview-show #garment3d  { animation: pvGarment 1.9s var(--ease) both; }
.ed-stage.preview-show .sr-key     { animation: pvKey 1.9s var(--ease) both; }
.ed-stage.preview-show .sr-softbox { animation: pvBox 1.9s var(--ease) both; }
.ed-stage.preview-show .sr-shaft   { animation: pvShaft 1.9s var(--ease) both; }
@keyframes pvFlash   { 0%{ opacity:0 } 7%{ opacity:.66 } 24%{ opacity:.5 } 56%{ opacity:0 } 100%{ opacity:0 } }
@keyframes pvGarment { 0%{ filter:brightness(1) } 12%{ filter:brightness(.5) } 30%{ filter:brightness(.52) }
  50%{ filter:brightness(1.14) } 72%{ filter:brightness(1) } 100%{ filter:brightness(1) } }
@keyframes pvKey { 0%{ opacity:.82; transform:translate(-50%,-50%) scale(1) }
  16%{ opacity:.08 } 30%{ opacity:.08; transform:translate(-50%,-50%) scale(.92) }
  46%{ opacity:1; transform:translate(-50%,-50%) scale(1.1) }
  100%{ opacity:.82; transform:translate(-50%,-50%) scale(1) } }
@keyframes pvBox   { 0%{ opacity:.82 } 16%{ opacity:0 } 40%{ opacity:0 } 52%{ opacity:1 } 100%{ opacity:.82 } }
@keyframes pvShaft { 0%{ opacity:1 } 16%{ opacity:0 } 44%{ opacity:0 } 60%{ opacity:1 } 100%{ opacity:1 } }

@keyframes srBreathe { 0%,100% { opacity: .82; } 50% { opacity: 1; } }
@keyframes srMotes  { from { transform: translateY(6px); } to { transform: translateY(-34px); } }

@media (max-width: 760px) {
  .sr-key { filter: blur(12px); } .sr-softbox { filter: blur(14px); }
  .sr-shaft, .sr-motes { display: none; }   /* trim the heaviest blended layers on phones */
}
@media (prefers-reduced-motion: reduce) {
  .sr-key, .sr-softbox, .sr-motes { animation: none; }
  .ed-stage.preview-show .sr-flash, .ed-stage.preview-show #garment3d,
  .ed-stage.preview-show .sr-key, .ed-stage.preview-show .sr-softbox,
  .ed-stage.preview-show .sr-shaft { animation: none; }
}

/* ============================================ TOP BAR (floating) === */
.ed-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: calc(var(--ed-top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  pointer-events: none;                 /* empty bar space falls through to the canvas */
}
.ed-top > * { pointer-events: auto; }
.ed-top__l { justify-self: start; }
.ed-top__c { justify-self: center; }
.ed-top__r { justify-self: end; display: flex; align-items: center; gap: 8px; }

.ed-back { display: inline-flex; align-items: center; gap: 9px; color: var(--ed-ink);
  min-height: 44px; }
.ed-back .navmark { width: 22px; height: 22px; flex: none; }
.ed-back__lbl { font-family: var(--font-ed); font-size: 12px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; }

/* centre pill: Front / Back (the existing .side-toggle, restyled) */
.ed-pill { display: inline-flex; gap: 2px; background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ed-pill button { background: transparent; border: 0; cursor: pointer;
  font-family: var(--font-ed); font-size: 11.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ed-muted); padding: 9px 16px; border-radius: 999px;
  min-height: 36px; transition: color .18s, background .18s; }
.ed-pill button.on { background: var(--ed-ink); color: #fff; }

/* cart chip + finish */
.ed-cart { position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; background: none; color: var(--ed-ink); cursor: pointer; }
.ed-cart svg { width: 22px; height: 22px; }
.ed-cart__n { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff; font: 700 10px/16px var(--font-ed);
  text-align: center; }
.ed-finish { font-family: var(--font-ed); font-size: 12px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: #fff; background: var(--ed-ink); border: 0; border-radius: 999px;
  padding: 0 18px; height: 40px; min-width: 44px; cursor: pointer; transition: background .2s, opacity .2s, transform .12s; }
.ed-finish:hover { background: #000; }
.ed-finish:active { transform: scale(.97); }
.ed-finish:disabled { background: transparent; color: var(--ed-muted);
  box-shadow: inset 0 0 0 1px var(--hairline); cursor: not-allowed; }

/* =========================================== FULL-BLEED STAGE ===== */
/* The canvas sits between the top bar and dock so the garment is framed
   (never hidden behind the dock). The gradient/floor is the body backdrop. */
.ed-stage {
  position: fixed; left: 0; right: 0; z-index: 1;
  top: calc(var(--ed-top-h) + env(safe-area-inset-top));
  bottom: calc(var(--ed-dock-h) + env(safe-area-inset-bottom));
  display: grid; place-items: center; overflow: hidden;
}
#garment3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; touch-action: none; }

/* soft contact shadow grounding the garment */
.ed-stage::after {
  content: ""; position: absolute; left: 50%; bottom: 9%; z-index: 1;
  width: min(46%, 300px); height: 30px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, var(--shadow-contact), rgba(0,0,0,0) 70%);
  filter: blur(5px); pointer-events: none;
}

/* 2D fallback (un-modelled products) + library art overlay */
.stage__placeholder {
  position: relative; width: min(72%, 420px); aspect-ratio: 4/5; border-radius: var(--r);
  overflow: hidden; border: 1px solid var(--line); z-index: 2; background: #fff;
}
.stage__placeholder img#refPhoto { width: 100%; height: 100%; object-fit: contain; }
.stage__overlay-art {
  position: absolute; z-index: 3; top: 43%; left: 50%; transform: translate(-50%, -50%);
  width: 40%; max-height: 46%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.18));
}
.stage__soon { position: relative; z-index: 3; max-width: 300px; text-align: center;
  color: var(--paper-dim); padding: 30px; }
.stage__soon .soon-name { display: block; font-family: var(--font-display); text-transform: uppercase;
  font-size: clamp(22px,3vw,30px); letter-spacing: .02em; color: var(--paper); margin-bottom: 12px; line-height: 1; }
.stage__soon p { font-size: 13px; line-height: 1.55; }

/* preview-in-3D chip (flat-design lock lives in the engine) */
.preview-toggle { position: absolute; top: 12px; right: 12px; z-index: 6;
  font: 600 11.5px/1 var(--font-ed); letter-spacing: .02em;
  padding: 10px 14px; min-height: 40px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline); background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ed-ink);
  box-shadow: 0 4px 16px rgba(0,0,0,.08); transition: transform .2s, background .2s, color .2s; }
.preview-toggle:hover { transform: translateY(-1px); }
.preview-toggle.previewing { background: var(--ed-ink); color: #fff; border-color: var(--ed-ink); }

.stage__note {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 13px;
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ed-muted);
  white-space: nowrap; font-family: var(--font-ed); }

/* =============================================== BOTTOM DOCK ====== */
.ed-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  height: calc(var(--ed-dock-h) + env(safe-area-inset-bottom));
  padding: 0 6px env(safe-area-inset-bottom);
  display: flex; align-items: stretch; justify-content: space-between;
  background: #fff; border-top: 1px solid var(--hairline);
  box-shadow: 0 -4px 24px rgba(0,0,0,.05);
}
.ed-dock .tool {
  flex: 1 1 0; min-width: 40px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; padding: 8px 2px 6px; border: 0; background: none; cursor: pointer;
  color: var(--ed-ink); position: relative; -webkit-tap-highlight-color: transparent;
  transition: color .18s var(--ease); }
.ed-dock .tool svg { width: 22px; height: 22px; }
.ed-dock .tool__lbl { font-family: var(--font-ed); font-size: 9.5px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--ed-muted); transition: color .18s; }
.ed-dock .tool::after { content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; border-radius: 2px; background: var(--accent); transition: width .18s var(--ease); }
.ed-dock .tool.on { color: var(--accent); }
.ed-dock .tool.on .tool__lbl { color: var(--accent); }
.ed-dock .tool.on::after { width: 18px; }
.ed-dock .tool:active { transform: scale(.94); }

/* =============================================== CONTROL SHEETS === */
.ed-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(20,18,16,.16);
  -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); }
.ed-scrim[hidden] { display: none; }

.ed-sheets { position: fixed; left: 0; right: 0; z-index: 95;
  bottom: calc(var(--ed-dock-h) + env(safe-area-inset-bottom)); pointer-events: none; }
.ed-sheet {
  pointer-events: auto; position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  background: #fff; border: 1px solid var(--hairline); border-bottom: 0;
  border-radius: 20px 20px 0 0; box-shadow: 0 -14px 40px rgba(0,0,0,.14);
  display: flex; flex-direction: column; max-height: 48vh;
  transform: translateY(8px); opacity: 0;
  animation: edSheetIn .26s cubic-bezier(.165,.84,.44,1) forwards;
}
.ed-sheet[hidden] { display: none; }
@keyframes edSheetIn { to { transform: none; opacity: 1; } }
.ed-sheet--tall { max-height: 60vh; }
.ed-sheet__h { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px; flex: none; }
.ed-sheet__h span { font-family: var(--font-ed); font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ed-muted); }
.ed-sheet__h b { color: var(--ed-ink); font-weight: 600; letter-spacing: .02em; text-transform: none; font-size: 13px; }
.ed-sheet__x { width: 34px; height: 34px; border: 0; background: var(--ink-3); border-radius: 999px;
  color: var(--ed-ink); font-size: 14px; cursor: pointer; display: grid; place-items: center; }
.ed-sheet__b { padding: 2px 20px max(18px, env(safe-area-inset-bottom)); overflow-y: auto;
  -webkit-overflow-scrolling: touch; }
.ed-empty { color: var(--paper-dim); font-size: 13px; line-height: 1.5; padding: 6px 0 14px; }

/* drag handle affordance */
.ed-sheet::before { content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 4px; border-radius: 999px; background: var(--hairline); }

/* ============================================ COMPONENT STYLES ==== */
/* (IDs/classes unchanged from the old panel — they just live in sheets now) */
.prod-info { margin-top: 18px; }
.prod-info h1 { font-family: var(--font-display); text-transform: uppercase; font-size: clamp(24px,5vw,32px);
  line-height: .96; letter-spacing: -.01em; color: var(--paper); }
.prod-info .price { font-size: 20px; margin-top: 6px; color: var(--paper); }
.prod-info .price s { color: var(--paper-dim); font-size: 14px; margin-left: 8px; }
.prod-info .blurb { color: var(--paper-dim); font-size: 13.5px; margin-top: 8px; line-height: 1.5; }
.sku { display: none; }   /* never show the raw fulfilment UID to customers */

.field { margin-top: 4px; }
.field > label { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--paper-dim);
  margin-bottom: 14px; }
.field > label .val { color: var(--paper); letter-spacing: .02em; text-transform: none; font-size: 14px; }

/* range filter — segmented All / Men / Women */
.gender-filter { display: inline-flex; gap: 4px; background: var(--ink-3); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; margin-bottom: 16px; }
.gender-filter button { border: 0; background: transparent; color: var(--paper-dim); cursor: pointer;
  font-family: var(--font-ed); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 11px 18px; border-radius: 999px; transition: background .2s var(--ease), color .2s; }
.gender-filter button.on { background: var(--ed-ink); color: #fff; }

.product-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.product-tabs button { padding: 12px 16px; border-radius: 12px; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--paper-dim);
  font-family: var(--font-ed); font-size: 14px; font-weight: 600; transition: .2s var(--ease); }
.product-tabs button:hover { color: var(--paper); }
.product-tabs button.on { border-color: var(--ed-ink); color: var(--ed-ink); background: #fff; }

.swatches { display: flex; gap: 14px; flex-wrap: wrap; }
.swatch { width: 44px; height: 44px; border-radius: 50%; cursor: pointer; position: relative;
  border: 0; box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .12s var(--ease), box-shadow .2s var(--ease); }
.swatch:hover { transform: scale(1.08); }
.swatch.on { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.swatch:active { transform: scale(.93); }

.sizes { display: flex; gap: 10px; flex-wrap: wrap; }
.size { min-width: 58px; padding: 15px 0; text-align: center; border-radius: 10px; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--paper-dim);
  font-weight: 600; font-size: 14px; transition: .15s var(--ease); font-family: var(--font-ed); }
.size:hover { color: var(--paper); }
.size.on { background: var(--ed-ink); color: #fff; border-color: var(--ed-ink); }
.size:active { transform: scale(.95); }

/* upload — clean, minimal dropzone */
.dropzone { position: relative; border: 1.5px dashed rgba(0,0,0,.16); border-radius: 16px;
  padding: 24px 20px; text-align: center; cursor: pointer; background: #fafaf8;
  transition: border-color .2s var(--ease), background .2s; }
.dropzone:hover, .dropzone.drag { border-color: var(--ed-ink); background: #f2f2ee; }
.dropzone .dz-mark { width: 44px; height: 44px; margin: 0 auto; color: var(--ed-ink); display: block; }
.dropzone p { font: 600 15px/1.35 var(--font-ed); margin-top: 12px; color: var(--paper); }
.dropzone p u { color: var(--paper); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.dropzone small { display: block; color: var(--paper-dim); font-size: 11.5px; margin-top: 10px; line-height: 1.5; }
.dropzone small b { color: var(--paper); }

/* ready-made design picker */
.design-toggle { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  background: #fff; border: 1px solid var(--line); color: var(--paper);
  font-family: var(--font-ed); font-size: 12.5px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; cursor: pointer; padding: 11px 16px; border-radius: 999px; transition: .2s var(--ease); }
.design-toggle:hover { background: var(--ed-ink); color: #fff; border-color: var(--ed-ink); }
.design-grid { display: flex; gap: 14px; margin-top: 14px; overflow-x: auto;
  padding: 6px 2px 12px; scroll-snap-type: x mandatory; scroll-padding-left: 2px;
  -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.design-grid::-webkit-scrollbar { height: 6px; }
.design-grid::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 999px; }
.design-grid .muted { color: var(--paper-dim); font-size: 12px; margin: 4px 0; }
.design-thumb { flex: 0 0 auto; width: 120px; height: 150px; scroll-snap-align: center;
  border: 1px solid var(--line); border-radius: 16px; cursor: pointer; position: relative;
  background: #fff center / cover no-repeat; box-shadow: 0 3px 12px rgba(0,0,0,.07);
  transition: transform .15s var(--ease), box-shadow .2s, border-color .2s; }
.design-thumb:hover { transform: translateY(-3px) scale(1.03); border-color: var(--ed-ink);
  box-shadow: 0 14px 28px -10px rgba(0,0,0,.28); }

/* placement presets */
.xf-presets { display: flex; gap: 10px; margin-bottom: 4px; }
.xf-preset {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--ink-3);
  background: var(--ink-3); color: var(--paper-dim);
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  cursor: pointer; transition: border-color .18s, color .18s, background .18s;
}
.xf-preset svg { width: 28px; height: 28px; }
.xf-preset.on {
  border-color: var(--accent); background: rgba(183,138,46,.10); color: var(--accent);
}
.xf-preset:hover:not(.on) { border-color: var(--paper-dim); color: var(--paper); }

/* transform sliders */
.xf { display: flex; flex-direction: column; gap: 12px; }
.xf-row { display: flex; align-items: center; gap: 12px; }
.xf-row span { width: 54px; font-size: 11px; color: var(--paper-dim); text-transform: uppercase; letter-spacing: .08em; }
.xf-row input[type=range] { flex: 1; accent-color: var(--accent); height: 30px; cursor: pointer; }
.xf-hint { display: block; color: var(--paper-dim); font-size: 11px; margin-top: 6px; line-height: 1.4; }

/* print-quality verdict */
.validation { margin-top: 16px; border-radius: 12px; padding: 16px; font-size: 13px;
  border: 1px solid var(--line); display: none; background: #fff; }
.validation.show { display: block; }
.validation .vhead { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; color: var(--paper); }
.validation .badge { width: 10px; height: 10px; border-radius: 50%; }
.validation.pass { border-color: rgba(60,160,90,.4); } .validation.pass .badge { background: #3da35a; }
.validation.warn { border-color: rgba(200,150,40,.45); } .validation.warn .badge { background: #d6a31f; }
.validation.fail { border-color: rgba(210,70,60,.45); } .validation.fail .badge { background: #d6483c; }
.validation .meta { color: var(--paper-dim); margin-top: 8px; line-height: 1.5; }
.validation .meta b { color: var(--paper); font-weight: 600; }
.val-actions { display: flex; gap: 8px; margin-top: 12px; }
.val-btn-remove {
  flex: 1; padding: 9px 12px; border-radius: 10px; font-size: 12px; font-weight: 600;
  border: 1.5px solid var(--ink-3); background: var(--ink-3); color: var(--paper);
  cursor: pointer; letter-spacing: .03em; transition: border-color .18s;
}
.val-btn-remove:hover { border-color: var(--paper-dim); }
.val-btn-override {
  flex: 1; padding: 9px 12px; border-radius: 10px; font-size: 12px; font-weight: 600;
  border: 1.5px solid rgba(210,70,60,.45); background: transparent; color: #d6483c;
  cursor: pointer; letter-spacing: .03em; transition: background .18s;
}
.val-btn-override:hover { background: rgba(210,70,60,.08); }

/* moderation note */
.modnote { margin-top: 10px; border-radius: 10px; padding: 12px 14px; font-size: 12.5px;
  line-height: 1.45; border: 1px solid var(--line); display: flex; gap: 9px; align-items: flex-start; background: #fff; }
.modnote[hidden] { display: none; }
.modnote .ico { font-size: 14px; line-height: 1.2; flex: 0 0 auto; }
.modnote.blocked { border-color: rgba(210,70,60,.5); }
.modnote b { color: var(--paper); }

/* rights consent — hidden (handled by the originality pop-up), kept for payload */
.rights { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px;
  font-size: 12.5px; line-height: 1.45; color: var(--paper-dim); cursor: pointer; }
.rights input { margin-top: 2px; width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); cursor: pointer; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 50px; height: 50px; background: transparent; border: 0; color: var(--paper); font-size: 22px; cursor: pointer; }
.qty span { min-width: 40px; text-align: center; font-weight: 600; color: var(--paper); font-size: 16px; }

.toast { position: fixed; bottom: calc(var(--ed-dock-h) + env(safe-area-inset-bottom) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px); z-index: 2000;
  background: var(--ed-ink); color: #fff; padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: .35s var(--ease);
  font-family: var(--font-ed); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* garment3d-injected helpers (loading spinner / reset / hint) */
.g3d-loading { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; pointer-events: none; }
.g3d-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line);
  border-top-color: var(--ed-ink); animation: g3dspin .8s linear infinite; }
@keyframes g3dspin { to { transform: rotate(360deg); } }
.g3d-load-txt { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--paper-dim); }
.g3d-reset { position: absolute; right: 12px; bottom: 12px; z-index: 5; width: 42px; height: 42px;
  border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.86); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline); color: var(--ed-ink); font-size: 19px; line-height: 1;
  display: grid; place-items: center; transition: transform .18s var(--ease); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.g3d-reset:hover { transform: rotate(-45deg); }
.g3d-hint { position: absolute; left: 50%; bottom: 54px; transform: translateX(-50%); z-index: 5;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--paper-dim);
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid var(--hairline);
  padding: 6px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap;
  opacity: 0; animation: g3dHint 6.5s ease forwards; font-family: var(--font-ed); }
@keyframes g3dHint { 0%,6% { opacity: 0 } 14%,68% { opacity: .9 } 100% { opacity: 0 } }

/* ------------------------------------------------ small phones ---- */
@media (max-width: 380px) {
  .ed-back__lbl { display: none; }                 /* logo links home → label redundant */
  .ed-pill button { padding: 9px 13px; }
  .ed-finish { padding: 0 14px; letter-spacing: .08em; }
  .ed-dock .tool__lbl { font-size: 9px; }
}

/* ------------------------------------------------ reduced motion -- */
@media (prefers-reduced-motion: reduce) {
  .ed-sheet { animation: none; transform: none; opacity: 1; }
  .g3d-hint { animation: none; opacity: .9; }
  .toast { transition: opacity .2s; }
}

/* ============================================ SIZE-METER LIVE PREVIEW ==== */
/* The MOVE sheet covers the lower ~half of the garment, so while you drag the
   Width / Height / Rotate sliders you couldn't see the print resize. This makes
   the sheet turn see-through for exactly as long as a slider is held, then snap
   back the moment you let go — so you watch the change live.
   Pure CSS (:has + :active); the sheet never moves, so your finger stays on the
   slider. Flat translucency only — NO backdrop-filter over the live WebGL canvas
   (that combo glitches). Degrades gracefully where :has() is unsupported. */
#sheet-move {
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
#sheet-move::before,
#sheet-move .ed-sheet__h,
#sheet-move .xf-presets,
#sheet-move .xf-hint,
#sheet-move #xfReset {
  transition: opacity .15s ease;
}
#sheet-move:has(.xf-row input[type="range"]:active) {
  background: rgba(12, 12, 15, .20);
  box-shadow: none;
  border-color: transparent;
}
/* fade the chrome out of the way (kept in place — no reflow, so the slider you're
   dragging doesn't shift under your finger) */
#sheet-move:has(.xf-row input[type="range"]:active)::before,
#sheet-move:has(.xf-row input[type="range"]:active) .ed-sheet__h,
#sheet-move:has(.xf-row input[type="range"]:active) .xf-presets,
#sheet-move:has(.xf-row input[type="range"]:active) .xf-hint,
#sheet-move:has(.xf-row input[type="range"]:active) #xfReset {
  opacity: .1;
  pointer-events: none;
}
/* keep the live sliders + their labels crisp and readable over the garment */
#sheet-move:has(.xf-row input[type="range"]:active) .xf-row span {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .8);
}
