@font-face{
  font-family:"Science Gothic";
  src:url("/fonts/ScienceGothic.woff2") format("woff2");
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face{
  font-family:"Science Gothic";
  src:url("/fonts/ScienceGothic-Latin.woff2") format("woff2");
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root{--bg:#050505;--panel:#0b0b0b;--line:#272727;--text:#f5f5f2;--muted:#888;--accent:#ff6500}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text);font-family:"Science Gothic",ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}button,input{font:inherit}button{cursor:pointer}.hidden{display:none!important}.app{min-height:100vh;padding:10px}.topbar{height:56px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;border:1px solid var(--line);border-radius:16px;padding:0 15px;background:#080808}.brand{color:#fff;text-decoration:none;font-size:29px;font-weight:1000;letter-spacing:-.07em}.top-title{font-size:10px;font-weight:900;letter-spacing:.18em;color:#777}.status{justify-self:end;font-size:9px;font-weight:900;letter-spacing:.12em;color:#777}.status.ok{color:#7cb883}.status.fail{color:#ff845d}.layout{display:grid;grid-template-columns:minmax(0,1fr) 430px;gap:10px;margin-top:10px;min-height:calc(100vh - 86px)}.viewer-card{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:18px;min-height:760px;background:var(--viewer-background,radial-gradient(circle at 50% 40%,#252525 0,#111 44%,#070707 75%,#050505 100%))}#viewer{position:absolute;inset:0}#viewer canvas{display:block;width:100%;height:100%;touch-action:none}.zone-switch{display:flex;gap:3px;padding:4px;border:1px solid #333;border-radius:999px;background:rgba(5,5,5,.78)}.zone-switch-viewer{position:absolute;z-index:4;top:14px;left:50%;transform:translateX(-50%);backdrop-filter:blur(8px)}.zone-btn{border:0;background:transparent;color:#888;padding:9px 13px;border-radius:999px;font-size:9px;font-weight:950;letter-spacing:.06em;white-space:nowrap}.zone-btn.active{background:#fff;color:#070707}.reset{position:absolute;top:16px;right:16px;border:1px solid #333;background:rgba(5,5,5,.72);color:#aaa;border-radius:10px;padding:9px 11px;font-size:9px;font-weight:850}.hint{position:absolute;left:14px;bottom:14px;padding:8px 10px;border:1px solid #303030;border-radius:999px;background:rgba(0,0,0,.58);font-size:10px;color:#888}.error{position:absolute;left:20px;right:20px;top:50%;transform:translateY(-50%);padding:16px;border:1px solid #61270f;background:#2c140b;color:#ffad7c;border-radius:13px;font-size:12px;line-height:1.5;z-index:8}.panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;display:grid;grid-template-rows:minmax(0,1fr) auto;overflow:hidden}.scroll{padding:18px;overflow:auto}.group{padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid #242424}.eyebrow{font-size:9px;font-weight:950;letter-spacing:.18em;color:#707070}h1{margin:7px 0 0;font-size:27px;line-height:1.05;letter-spacing:-.04em}h2{margin:7px 0 14px;font-size:25px;letter-spacing:-.04em}.muted{margin:0;color:var(--muted);font-size:10px;line-height:1.5}.product-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}.color-block{min-width:218px}.label-row{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:11px;font-weight:800;margin-bottom:10px}.compact-row{margin-bottom:8px}.label-row output{color:#aaa;font-variant-numeric:tabular-nums}.colors{display:flex;gap:7px;align-items:center}.colors input[type=color]{width:35px;height:35px;border-radius:50%;border:1px solid #444;padding:2px;background:#111}.swatch{width:30px;height:30px;border:0;border-radius:50%;background:var(--sw);box-shadow:0 0 0 1px #444}.swatch.active{box-shadow:0 0 0 2px var(--panel),0 0 0 4px #fff}.editor-tabs{margin-top:10px;border-radius:11px;width:100%;display:grid;grid-template-columns:repeat(4,1fr)}.editor-tabs .zone-btn{padding:10px 4px;border-radius:8px}.editor-toolbar{display:grid;grid-template-columns:1fr auto auto auto;gap:6px;margin:9px 0}.add-design,.tool-btn{height:39px;border:1px solid #303030;border-radius:9px;background:#151515;color:#e8e8e8;font-size:9px;font-weight:900;letter-spacing:.04em}.add-design{display:flex;align-items:center;gap:8px;padding:0 11px;cursor:pointer}.plus{width:23px;height:23px;border-radius:6px;background:#fff;color:#111;display:grid;place-items:center;font-size:17px}.tool-btn{min-width:38px;padding:0 10px}.tool-btn:disabled{opacity:.35;cursor:default}.tool-btn.danger:not(:disabled){color:#ff9575}.editor-stage-wrap{border:1px solid #252525;border-radius:13px;background:#0d0d0d;padding:10px}.placement-caption{display:flex;justify-content:space-between;color:#777;font-size:9px;font-weight:900;letter-spacing:.08em;margin:0 2px 8px}.editor-stage{position:relative;width:min(100%,300px);aspect-ratio:4/5;margin:auto;overflow:hidden;border:1px solid #303030;border-radius:9px;background:#f3f2ee;touch-action:none;outline:none}.editor-stage.sleeve-mode{aspect-ratio:3/4}.shirt-guide{position:absolute;inset:0;pointer-events:none}.shirt-guide svg{width:100%;height:100%}.shirt-guide path:first-child{fill:#e8e7e2;stroke:#d4d3cf;stroke-width:2}.shirt-guide .neck{fill:none;stroke:#d0cfcb;stroke-width:8}.shirt-guide line{stroke:#d8d7d2;stroke-width:1;stroke-dasharray:5 5}.layers-canvas{position:absolute;inset:0}.empty-zone{position:absolute;inset:0;display:grid;place-content:center;text-align:center;padding:30px;color:#8b8b87;pointer-events:none}.empty-zone b{font-size:12px;color:#6c6c68}.empty-zone span{font-size:9px;line-height:1.5;margin-top:5px}.design-layer{position:absolute;left:50%;top:50%;transform-origin:center center;user-select:none;touch-action:none;cursor:move}.design-layer img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}.design-layer.selected{outline:1.5px solid #151515;outline-offset:2px}.handle{position:absolute;width:14px;height:14px;border:2px solid #111;background:#fff;border-radius:50%;display:none}.selected .handle{display:block}.handle-scale{cursor:nwse-resize}.handle-nw{left:-9px;top:-9px}.handle-ne{right:-9px;top:-9px;cursor:nesw-resize}.handle-sw{left:-9px;bottom:-9px;cursor:nesw-resize}.handle-se{right:-9px;bottom:-9px}.handle-rotate{left:50%;top:-27px;transform:translateX(-50%);cursor:grab}.selected:before{content:"";position:absolute;left:50%;top:-17px;height:15px;border-left:1px solid #111;display:block}.selection-panel{margin-top:10px;padding:11px;border:1px solid #252525;border-radius:11px;background:#0e0e0e}.selection-panel.disabled{opacity:.45}.selection-title{display:flex;justify-content:space-between;gap:12px;align-items:end}.selection-title strong{display:block;max-width:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11px;margin-top:3px}.selection-title output{font-size:10px;color:#aaa;font-variant-numeric:tabular-nums}.numeric-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.numeric-grid label{font-size:8px;color:#747474;font-weight:900;letter-spacing:.06em}.numeric-grid input{width:100%;height:34px;margin-top:4px;padding:0 8px;border:1px solid #2d2d2d;border-radius:8px;background:#141414;color:#eee;font-size:11px}.layers-list{display:grid;gap:6px}.layers-empty{padding:10px;border:1px dashed #2d2d2d;border-radius:9px;color:#666;font-size:10px;text-align:center}.layer-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:8px;align-items:center;padding:6px;border:1px solid #262626;border-radius:9px;background:#101010;cursor:pointer}.layer-row.active{border-color:#7d7d7d;background:#151515}.layer-thumb{width:34px;height:34px;display:grid;place-items:center;border-radius:6px;background:#fff;overflow:hidden}.layer-thumb img{max-width:100%;max-height:100%}.layer-meta{min-width:0}.layer-name{font-size:10px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layer-dim{font-size:8px;color:#737373;margin-top:2px}.layer-index{font-size:8px;color:#666;padding-right:4px}.info-card{padding:13px;border:1px solid #222;border-radius:13px;background:#0f0f0f}.info-card strong{display:block;margin-top:6px;font-size:19px;font-variant-numeric:tabular-nums}.badge{display:inline-block;margin-top:8px;padding:6px 9px;border-radius:999px;background:#1c1c1c;color:#bbb;font-size:9px}.info-note{margin-top:9px}.actions{display:grid;grid-template-columns:1fr 1.2fr;gap:7px;padding:12px;border-top:1px solid #242424;background:#090909}.actions button,.primary,.secondary{border-radius:11px;padding:13px 10px;font-size:10px;font-weight:950;letter-spacing:.04em}.secondary{border:1px solid #2b2b2b;background:#181818;color:#eee}.primary{border:0;background:var(--accent);color:#070707}dialog{border:0;padding:0;background:transparent;color:inherit;width:min(650px,calc(100% - 24px))}dialog::backdrop{background:rgba(0,0,0,.78);backdrop-filter:blur(5px)}.dialog-card{position:relative;padding:23px;background:#0e0e0e;border:1px solid #292929;border-radius:19px}.close{position:absolute;right:12px;top:9px;border:0;background:transparent;color:#888;font-size:27px}pre{white-space:pre-wrap;word-break:break-word;padding:13px;max-height:360px;overflow:auto;border:1px solid #222;border-radius:12px;background:#070707;color:#ccc;font-size:10px;line-height:1.5}.dialog-ok{width:100%;margin-top:14px}
@media(max-width:1100px){.layout{grid-template-columns:minmax(0,1fr) 390px}.color-block{min-width:190px}.zone-switch-viewer .zone-btn:nth-child(n+3){display:none}}
@media(max-width:900px){.app{padding:7px}.topbar{height:50px;grid-template-columns:1fr auto}.top-title{display:none}.layout{grid-template-columns:1fr;min-height:0;gap:7px;margin-top:7px}.viewer-card{min-height:58vh;border-radius:15px}.panel{border-radius:15px}.scroll{padding:14px}.reset{top:auto;bottom:13px;right:13px}.hint{left:13px;max-width:62%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.actions{position:sticky;bottom:0;z-index:4}.product-head{display:block}.color-block{margin-top:14px;min-width:0}.editor-stage{width:min(100%,360px)}}

/* v5: transform interaction */
.layers-canvas,.design-layer,.handle{touch-action:none}.design-layer.selected{z-index:20}.handle{z-index:25;width:16px;height:16px}.handle-rotate{width:17px;height:17px;top:-31px}.editor-stage{overscroll-behavior:contain}

/* v6 compact selection + precise mode */
.compact-selection{padding:10px 12px}.selection-compact{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:10px}.selection-file{min-width:0}.selection-file strong{display:block;margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10px}.selection-compact output{font-size:9px;color:#aaa;white-space:nowrap}.precise-btn{height:29px;padding:0 9px;border:1px solid #303030;border-radius:8px;background:#151515;color:#aaa;font-size:8px;font-weight:950;letter-spacing:.08em}.precise-btn.active{background:#fff;color:#080808}.precise-btn:disabled{opacity:.3}.precise-fields{margin-top:10px}.hidden{display:none!important}
.editor-stage.sleeve-mode .shirt-guide svg{opacity:.22}.editor-stage.sleeve-mode .shirt-guide{transform:scale(.78) rotate(-1deg)}

/* v7: UV atlas model */
.status.ok{color:#79e38d}

/* v9 — single HEX garment palette */
.colors.hex-only{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.colors.hex-only input[type="color"]{
  width:42px;height:42px;padding:0;border:1px solid #454545;border-radius:50%;
  background:transparent;overflow:hidden;cursor:pointer;
}
.colors.hex-only input[type="color"]::-webkit-color-swatch-wrapper{padding:3px}
.colors.hex-only input[type="color"]::-webkit-color-swatch{border:0;border-radius:50%}
.colors.hex-only input[type="color"]::-moz-color-swatch{border:0;border-radius:50%}

/* v11 product switch */
.product-switch{display:flex;gap:6px;margin:8px 0 6px}
.product-btn{border:1px solid #303030;background:#0b0b0b;color:#8c8c8c;border-radius:999px;padding:8px 12px;font:800 10px/1 inherit;letter-spacing:.08em;cursor:pointer}
.product-btn.active{background:#fff;color:#050505;border-color:#fff}
.zone-btn.is-disabled{opacity:.25;pointer-events:none}

/* v17 — mobile containment + hoodie sleeves */
html,body{max-width:100%;overflow-x:hidden}
.app,.layout,.panel,.scroll,.group,.editor-group,.layers-group,.info-card,
.product-head,.color-block,.editor-toolbar,.editor-stage-wrap,.selection-panel,
.layers-list,.layer-row{min-width:0;max-width:100%}
.scroll{overflow-y:auto;overflow-x:hidden}
.panel{min-width:0}
.actions{min-width:0}

@media(max-width:900px){
  .panel{width:100%;max-width:100%;overflow:hidden}
  .scroll{width:100%;max-width:100%;overflow-x:hidden;padding-left:14px;padding-right:14px}
  .product-head{
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:14px;
  }
  .color-block{
    width:100%;
    min-width:0;
    margin-top:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
  }
  .color-block .label-row{
    margin:0;
    min-width:0;
    justify-content:flex-start;
    gap:10px;
  }
  .color-block .colors.hex-only{
    justify-content:flex-end;
    min-width:48px;
  }
  .colors.hex-only input[type="color"]{
    width:44px;
    height:44px;
    flex:0 0 44px;
  }
  .editor-toolbar{
    grid-template-columns:minmax(0,1fr) auto auto auto;
    width:100%;
  }
  .add-design{min-width:0;overflow:hidden}
  .add-design>span:last-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .selection-compact{grid-template-columns:minmax(0,1fr) auto}
  .selection-compact .precise-btn{grid-column:1/-1;width:100%}
  .actions{width:100%;max-width:100%;grid-template-columns:1fr 1.2fr}
}

/* v20.2 */
.editor-stage[style*="aspect-ratio"] .shirt-guide{opacity:.18;transform:scale(.72)}


/* v20.4 — portrait hoodie sleeve editor */
.editor-stage[style*="120 / 180"] .shirt-guide{
  opacity:.10;
  transform:rotate(90deg) scale(.72);
}

/* v23: temporary project links */
.project-status{
  margin:0 12px 10px;
  padding:10px 12px;
  border:1px solid #292929;
  border-radius:11px;
  background:#101010;
  color:#aaa;
  font-size:9px;
  line-height:1.45;
}
.project-status strong{color:#eee}
.project-dialog-message{
  margin:10px 0 14px;
  color:#c8c8c8;
  font-size:12px;
  line-height:1.55;
}
.project-link-box{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:7px;
  margin-top:12px;
}
.project-link-box input{
  min-width:0;
  border:1px solid #2a2a2a;
  border-radius:10px;
  padding:11px 12px;
  background:#070707;
  color:#eee;
  font:600 11px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;
}
.project-expiry{
  min-height:18px;
  margin-top:11px;
  color:#777;
  font-size:9px;
  line-height:1.45;
}
#orderBtn:disabled{opacity:.55;cursor:wait}
@media(max-width:520px){
  .project-link-box{grid-template-columns:1fr}
  .project-link-box .secondary{width:100%}
}

/* v23.1 desktop app shell: keep the editor inside one viewport */
@media(min-width:901px){
  html,body{height:100%;overflow:hidden}
  body{min-height:0}
  .app{
    height:100dvh;
    min-height:0;
    display:grid;
    grid-template-rows:56px minmax(0,1fr);
    gap:10px;
    padding:10px;
    overflow:hidden;
  }
  .topbar{height:56px}
  .layout{
    margin-top:0;
    min-height:0;
    height:100%;
    overflow:hidden;
  }
  .viewer-card{
    min-height:0;
    height:100%;
  }
  .panel{
    min-height:0;
    height:100%;
    overflow:hidden;
    display:flex;
    flex-direction:column;
  }
  .panel .scroll{
    min-height:0;
    flex:1 1 auto;
    overflow-y:auto;
    overscroll-behavior:contain;
    scrollbar-gutter:stable;
  }
  .actions{
    flex:0 0 auto;
  }
  .project-status{
    flex:0 0 auto;
  }
}


/* v23.2 typography hierarchy */
body{
  font-weight:400;
}

.top-title,
.status,
.eyebrow,
.label-row,
.badge,
.info-note,
.layer-index,
.layer-dim,
.project-status,
.project-expiry{
  font-weight:600;
}

.zone-btn,
.product-btn,
.precise-btn,
.reset,
.actions button,
.primary,
.secondary,
.dialog-ok,
#copyProjectLink{
  font-weight:700;
}

h1,h2,
.product-head h1,
.info-card strong,
.selection-file strong,
.layer-name{
  font-weight:750;
}

.brand{
  font-weight:900;
}

.primary{
  color:#fff;
}

#orderBtn{
  color:#fff;
}


/* v23.3 PNG garment guides */
.shirt-guide{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
  overflow:hidden;
  background:#f3f2ee;
}
.shirt-guide img{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center;
  opacity:.72;
  filter:grayscale(1) contrast(.92);
  mix-blend-mode:multiply;
}
.editor-stage.sleeve-mode .shirt-guide{
  transform:none;
}
.editor-stage.sleeve-mode .shirt-guide img{
  opacity:.72;
}


/* v23.4 calibrated 2D garment / print coordinate mapping */
.editor-stage{
  aspect-ratio:1 / 1.08;
}
.editor-stage.sleeve-mode{
  aspect-ratio:3 / 4;
}
.print-area{
  position:absolute;
  left:50%;
  top:50%;
  width:38%;
  aspect-ratio:300 / 540;
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.print-area .layers-canvas{
  position:absolute;
  inset:0;
  pointer-events:auto;
  overflow:visible;
}
.print-area .empty-zone{
  position:absolute;
  inset:0;
}


/* v23.12 — mobile app UX: 3D stays visible, tools open as a bottom sheet */
.mobile-bottom-nav,.mobile-sheet-head{display:none}

@media(max-width:900px){
  html,body{height:100%;min-height:0;overflow:hidden}
  body{overscroll-behavior:none}
  .app{
    height:100dvh;
    min-height:0;
    padding:0;
    display:block;
    overflow:hidden;
  }
  .topbar{
    position:absolute;
    z-index:20;
    top:max(8px,env(safe-area-inset-top));
    left:10px;
    right:10px;
    height:48px;
    border-radius:15px;
    padding:0 14px;
    background:rgba(7,7,7,.78);
    backdrop-filter:blur(12px);
  }
  .brand{font-size:24px}
  .status{max-width:54%;font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .layout{
    display:block;
    width:100%;
    height:100dvh;
    margin:0;
    overflow:hidden;
  }
  .viewer-card{
    position:absolute;
    inset:0 0 calc(70px + env(safe-area-inset-bottom)) 0;
    min-height:0;
    height:auto;
    border:0;
    border-radius:0;
  }
  .zone-switch-viewer{
    top:calc(max(8px,env(safe-area-inset-top)) + 58px);
    max-width:calc(100% - 20px);
  }
  .zone-switch-viewer .zone-btn:nth-child(n+3){display:block}
  .zone-btn{padding:8px 10px;font-size:8px}
  .reset{
    top:auto;
    bottom:14px;
    right:12px;
    padding:8px 9px;
    font-size:7px;
  }
  .hint{
    bottom:14px;
    left:12px;
    max-width:58%;
    font-size:8px;
  }

  /* Bottom tool bar */
  .mobile-bottom-nav{
    position:fixed;
    z-index:60;
    left:0;right:0;bottom:0;
    height:calc(70px + env(safe-area-inset-bottom));
    padding:7px 8px calc(7px + env(safe-area-inset-bottom));
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:4px;
    background:#0a0a0a;
    border-top:1px solid #292929;
  }
  .mobile-nav-btn{
    min-width:0;
    border:0;
    border-radius:12px;
    background:transparent;
    color:#8a8a8a;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:4px;
    padding:4px 2px;
    font-size:7px;
    font-weight:700;
    letter-spacing:.06em;
  }
  .mobile-nav-btn svg{
    width:23px;height:23px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
  }
  .mobile-nav-btn.active{color:#fff;background:#151515}
  .mobile-nav-btn.active:not(.mobile-nav-done) span{color:var(--accent)}
  .mobile-nav-done{color:#fff}
  .mobile-nav-done svg{
    width:25px;height:25px;
    border-radius:50%;
    padding:4px;
    background:var(--accent);
    stroke:#fff;
  }

  /* Tool sheet */
  .panel{
    position:fixed;
    z-index:50;
    left:7px;right:7px;
    bottom:calc(70px + env(safe-area-inset-bottom));
    width:auto;
    max-width:none;
    height:auto;
    max-height:min(58dvh,620px);
    border:1px solid #2c2c2c;
    border-radius:22px 22px 14px 14px;
    background:rgba(10,10,10,.84);
    backdrop-filter:blur(14px) saturate(115%);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    transform:translateY(calc(100% + 90px));
    opacity:0;
    pointer-events:none;
    transition:transform .22s ease,opacity .18s ease;
  }
  .panel.mobile-sheet-open{
    transform:translateY(0);
    opacity:1;
    pointer-events:auto;
  }
  .mobile-sheet-head{
    flex:0 0 auto;
    min-height:52px;
    padding:11px 14px 9px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid #242424;
  }
  .mobile-sheet-head strong{display:block;margin-top:2px;font-size:15px}
  .mobile-sheet-close{
    width:34px;height:34px;
    border:1px solid #2d2d2d;
    border-radius:50%;
    background:#141414;
    color:#aaa;
    font-size:23px;
    line-height:1;
  }
  .panel .scroll{
    flex:1 1 auto;
    min-height:0;
    padding:12px;
    overflow-y:auto;
    overscroll-behavior:contain;
  }

  /* Only the selected mobile tool is visible in the sheet */
  .panel[data-mobile-active="design"] .product-head{
    display:none!important;
  }
  .panel[data-mobile-active="color"] [data-mobile-panel="design"],
  .panel[data-mobile-active="product"] [data-mobile-panel="design"]{
    display:none!important;
  }

  /* Color mode: product wrapper stays visible, only the picker is shown. */
  .panel[data-mobile-active="color"] .product-head{
    display:block!important;
    padding:0;
    margin:0;
    border:0;
  }
  .panel[data-mobile-active="color"] .product-select-block{
    display:none!important;
  }
  .panel[data-mobile-active="color"] .color-block{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:14px;
    padding:8px 4px 14px;
    margin:0;
  }
  .panel[data-mobile-active="color"] .colors.hex-only{
    display:flex!important;
    justify-content:flex-end;
  }
  .panel[data-mobile-active="color"] .colors.hex-only input[type="color"]{
    width:54px;
    height:54px;
    flex:0 0 54px;
  }

  /* Product mode: only product buttons. The duplicate H1 is hidden. */
  .panel[data-mobile-active="product"] .product-head{
    display:block!important;
    padding:2px 2px 10px;
    margin:0;
    border:0;
  }
  .panel[data-mobile-active="product"] .product-select-block{
    display:block!important;
  }
  .panel[data-mobile-active="product"] .color-block{
    display:none!important;
  }
  .panel[data-mobile-active="product"] .product-switch{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:12px;
  }
  .panel[data-mobile-active="product"] .product-btn{
    min-height:52px;
    border-radius:13px;
    font-size:10px;
  }
  .panel[data-mobile-active="product"] #productTitle{
    display:none!important;
  }

  /* Design editor optimized for sheet */
  .panel[data-mobile-active="design"] .editor-group{
    padding:0 0 12px;
    margin:0 0 12px;
  }
  .panel[data-mobile-active="design"] .editor-group>.eyebrow{display:none}
  .editor-tabs{margin-top:0}
  .editor-toolbar{margin:8px 0}
  .add-design{height:42px}
  .editor-stage-wrap{padding:8px}
  .editor-stage{
    width:min(100%,320px);
    max-height:34dvh;
  }
  .selection-panel{margin-top:8px}
  .layers-group{padding-bottom:10px;margin-bottom:10px}
  .info-card{display:none!important}

  /* Existing desktop actions are replaced by the mobile "ГОТОВО" item */
  .panel>.actions{display:none!important}
  .panel>.project-status{
    margin:8px 12px 10px;
    flex:0 0 auto;
  }
}

@media(max-width:520px){
  .zone-switch-viewer{width:calc(100% - 24px);justify-content:center}
  .zone-switch-viewer .zone-btn{flex:1;padding-left:4px;padding-right:4px}
  .panel{max-height:60dvh}
}


/* v23.13 mobile visual polish */
@media(max-width:900px){
  .mobile-sheet-head{
    background:rgba(10,10,10,.56);
  }
  .panel .scroll{
    background:rgba(8,8,8,.18);
  }
  .panel[data-mobile-active="design"] .editor-stage-wrap,
  .panel[data-mobile-active="design"] .selection-panel,
  .panel[data-mobile-active="design"] .layers-list{
    backdrop-filter:blur(5px);
  }
}


/* v23.14 — 3D environment/background color */
.viewer-bg-control{
  position:absolute;
  z-index:5;
  left:16px;
  top:16px;
  height:34px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:5px 7px 5px 10px;
  border:1px solid #333;
  border-radius:10px;
  background:rgba(5,5,5,.72);
  backdrop-filter:blur(8px);
  color:#888;
  font-size:8px;
  font-weight:700;
  letter-spacing:.12em;
}
.viewer-bg-control input[type="color"]{
  width:22px;
  height:22px;
  flex:0 0 22px;
  padding:0;
  overflow:hidden;
  border:1px solid #4a4a4a;
  border-radius:50%;
  background:transparent;
  cursor:pointer;
}
.viewer-bg-control input[type="color"]::-webkit-color-swatch-wrapper{padding:2px}
.viewer-bg-control input[type="color"]::-webkit-color-swatch{border:0;border-radius:50%}
.viewer-bg-control input[type="color"]::-moz-color-swatch{border:0;border-radius:50%}

@media(max-width:900px){
  .viewer-bg-control{
    top:auto;
    left:auto;
    right:12px;
    bottom:54px;
    height:32px;
    padding:4px 6px 4px 8px;
    font-size:7px;
  }
  .viewer-bg-control input[type="color"]{
    width:21px;
    height:21px;
    flex-basis:21px;
  }
  .reset{bottom:14px}
}


/* v23.15 — combined garment + background color on mobile */
.mobile-bg-color-row{display:none}

@media(max-width:900px){
  /* Hide the floating viewer background control on mobile;
     background now lives inside the Color tool sheet. */
  .viewer-bg-control{display:none!important}

  .panel[data-mobile-active="color"] .color-block{
    display:grid!important;
    grid-template-columns:1fr;
    gap:0;
    padding:0;
    margin:0;
  }

  .panel[data-mobile-active="color"] .color-block>.label-row{
    display:none!important;
  }

  .panel[data-mobile-active="color"] .colors.hex-only{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    min-height:68px;
    padding:10px 6px;
    border-bottom:1px solid #242424;
  }

  .panel[data-mobile-active="color"] .colors.hex-only::before{
    content:"ИЗДЕЛИЕ";
    color:#f0f0ed;
    font-size:10px;
    font-weight:700;
    letter-spacing:.08em;
  }

  .panel[data-mobile-active="color"] .colors.hex-only input[type="color"]{
    width:48px;
    height:48px;
    flex:0 0 48px;
    justify-self:end;
  }

  .mobile-bg-color-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    min-height:68px;
    padding:10px 6px;
  }

  .mobile-color-label{
    display:flex;
    align-items:baseline;
    gap:10px;
    min-width:0;
  }

  .mobile-color-label>span{
    color:#f0f0ed;
    font-size:10px;
    font-weight:700;
    letter-spacing:.08em;
  }

  .mobile-color-label output{
    color:#777;
    font-size:9px;
    font-weight:600;
    letter-spacing:.04em;
  }

  #mobileViewerBgColor{
    width:48px;
    height:48px;
    padding:0;
    border:1px solid #454545;
    border-radius:50%;
    background:transparent;
    overflow:hidden;
    cursor:pointer;
  }
  #mobileViewerBgColor::-webkit-color-swatch-wrapper{padding:3px}
  #mobileViewerBgColor::-webkit-color-swatch{border:0;border-radius:50%}
  #mobileViewerBgColor::-moz-color-swatch{border:0;border-radius:50%}
}


/* v23.17 — exact print-zone editor.
   The white canvas itself IS the physical printable zone. */
.editor-stage{
  background:#f3f2ee;
}
.editor-stage .shirt-guide{
  display:none!important;
}
.print-area{
  position:absolute;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  transform:none!important;
  aspect-ratio:auto!important;
}
.print-area .layers-canvas{
  position:absolute;
  inset:0;
  overflow:visible;
}
.print-area .empty-zone{
  position:absolute;
  inset:0;
}
.empty-zone b::before{
  content:"ПЕЧАТНАЯ ЗОНА";
  display:block;
  margin-bottom:7px;
  font-size:9px;
  letter-spacing:.12em;
  color:#9a9994;
}
@media(max-width:900px){
  .editor-stage{
    width:auto;
    max-width:100%;
    max-height:34dvh;
  }
}


/* v23.18 — clean header */
.brand{
  display:flex;
  align-items:center;
  text-decoration:none;
  min-width:0;
}
.brand-logo{
  display:block;
  height:1.2rem;
  width:auto;
  max-width:100%;
}

.home-link{
  justify-self:end;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:32px;
  padding:0 12px;
  border:1px solid #333;
  border-radius:10px;
  background:rgba(5,5,5,.72);
  color:#aaa!important;
  text-decoration:none;
  font-size:8px;
  font-weight:700;
  letter-spacing:.08em;
  white-space:nowrap;
}
.home-link:hover{
  color:#fff!important;
  border-color:#555;
}
.home-link.ok,
.home-link.fail{
  color:#aaa!important;
}

@media(max-width:900px){
  .brand-logo{height:1.15rem}
  .home-link{
    height:30px;
    padding:0 10px;
    font-size:7px;
  }
}


/* v23.19 — robust header sizing */
.topbar{
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
}
.brand{
  justify-self:start;
  display:flex;
  align-items:center;
  width:auto;
  max-width:180px;
  height:34px;
  overflow:hidden;
}
.brand-logo{
  display:block!important;
  width:auto!important;
  height:22px!important;
  max-width:160px!important;
  max-height:22px!important;
  object-fit:contain;
  object-position:left center;
  flex:0 0 auto;
}
.home-link{
  justify-self:end;
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  height:32px;
  padding:0 12px;
  border:1px solid #333;
  border-radius:10px;
  background:rgba(5,5,5,.72);
  color:#aaa!important;
  text-decoration:none;
  font-size:8px;
  font-weight:700;
  letter-spacing:.08em;
  white-space:nowrap;
}

/* Кастомный scrollbar правой панели */
.scroll{
  scrollbar-width: thin;
  scrollbar-color: #3a3a3a #0b0b0b;
}

/* Chrome / Edge / Safari */
.scroll::-webkit-scrollbar{
  width: 8px;
}

.scroll::-webkit-scrollbar-track{
  background: #0b0b0b;
  border-radius: 999px;
}

.scroll::-webkit-scrollbar-thumb{
  background: #3a3a3a;
  border-radius: 999px;
  border: 2px solid #0b0b0b;
}

.scroll::-webkit-scrollbar-thumb:hover{
  background: #565656;
}

@media(max-width:900px){
  .topbar{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .top-title{display:none}
  .brand{
    max-width:150px;
    height:30px;
  }
  .brand-logo{
    height:20px!important;
    max-height:20px!important;
    max-width:140px!important;
  }
  .home-link{
    height:30px;
    padding:0 10px;
    font-size:7px;
  }
}
