/* Modelwright mobile layer v1 (shared by the phase-3 kit demos, 02.11.2026). Loaded after each demo's own <style>.
 * compact = (max-width:900px) or a landscape phone (max-height:560px and max-width:1100px). touch = compact or (pointer:coarse). */

/* reset view + WebGL message: both live inside #stage */
.mw-reset{position:absolute;z-index:8;right:14px;bottom:max(18px,calc(var(--mwn-h,0px) + 10px));display:grid;place-items:center;width:44px;height:44px;padding:0;appearance:none;border:1px solid var(--line);border-radius:50%;background:rgba(255,255,255,.94);color:var(--ink);cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.08);touch-action:manipulation}
.mw-reset:active{background:var(--ink);color:#fff}
.mw-glerr{display:none;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:9;width:min(86%,380px);background:var(--errbg,#fdecec);border:1px solid var(--err,#c62828);color:var(--err,#c62828);border-radius:12px;padding:12px 14px;font-weight:600;font-size:14px;line-height:1.4;text-align:center}
.mw-glerr.on{display:block}
.mw-glerr button{display:block;margin:10px auto 0;appearance:none;border:0;background:var(--err,#c62828);color:#fff;border-radius:10px;min-height:44px;padding:0 16px;font-weight:700;font-size:14px;line-height:1;font-family:inherit;cursor:pointer}
body.shot .mw-reset{display:none!important}
.mw-stp{display:none}
.mw-stpw{display:contents}

/* ---------- touch + small screens: 44 px targets, readable type, no tiny sliders ---------- */
@media (max-width:900px),(pointer:coarse),(max-height:560px) and (max-width:1100px) and (orientation:landscape){
  html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
  body{font-size:15px}
  button,select,summary,[role=button],input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]){min-height:44px!important}
  button{min-width:44px!important}
  input[type=number],input[type=text],input[type=email],input[type=tel],select,textarea{font-size:16px!important}
  label:has(> input[type=checkbox]),label:has(> input[type=radio]){min-height:44px}
  input[type=checkbox],input[type=radio]{width:22px;height:22px}
  button,.card,a,label,input,select{touch-action:manipulation}
  #mw-note{font-size:13px!important}
  small{font-size:max(13px,.83em)}
  .seg button,.seg button small{overflow-wrap:anywhere}
  /* dimension sliders → − / + steppers around the number field */
  .mw-hasstp input[type=range]{display:none!important}
  .mw-hasstp{grid-template-columns:1fr!important}
  .mw-stpw{display:flex;align-items:center;gap:8px;width:100%}
  .mw-stpw input{flex:1 1 auto;min-width:0;width:auto!important;text-align:center}
  .mw-stp{display:grid;place-items:center;flex:0 0 52px;height:48px;appearance:none;border:1px solid var(--line);background:#f6f7f8;color:var(--ink);border-radius:10px;font-weight:700;font-size:22px;line-height:1;font-family:inherit;cursor:pointer;padding:0}
  .mw-stp:active{background:var(--ink);color:#fff}
  .mw-stp:disabled{opacity:.4;cursor:not-allowed}
  /* remaining sliders (signature controls): 44 px thumb, vertical page scroll still allowed */
  input[type=range]{-webkit-appearance:none;appearance:none;height:44px!important;background:transparent;touch-action:pan-y}
  input[type=range]::-webkit-slider-runnable-track{height:6px;border-radius:6px;background:var(--line)}
  input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:44px;height:44px;margin-top:-19px;border:0;border-radius:50%;background:radial-gradient(circle,#fff 0 8px,var(--a) 9px 13px,rgba(0,0,0,.08) 14px 21px,transparent 22px)}
  input[type=range]::-moz-range-track{height:6px;border-radius:6px;background:var(--line)}
  input[type=range]::-moz-range-thumb{width:44px;height:44px;border:0;border-radius:50%;background:radial-gradient(circle,#fff 0 8px,var(--a) 9px 13px,rgba(0,0,0,.08) 14px 21px,transparent 22px)}
  input[type=range]:disabled{opacity:.4}
}

/* ---------- compact: reset button at the top right of the pinned 3D ---------- */
@media (max-width:900px),(max-height:560px) and (max-width:1100px) and (orientation:landscape){
  .mw-reset{top:max(8px,env(safe-area-inset-top));right:max(8px,env(safe-area-inset-right));bottom:auto}
  .brand{max-width:calc(100% - 76px)}
  .brand .k{letter-spacing:.05em!important}
}

/* ---------- landscape phones: product left, configuration right (scrolls), nothing pinned on top of each other ---------- */
@media (max-height:560px) and (max-width:1100px) and (orientation:landscape){
  :root{--lw:56vw}
  html{scroll-padding-top:12px!important}
  body{padding-left:var(--lw)!important;padding-right:env(safe-area-inset-right)}
  #stage{position:fixed!important;left:0!important;top:0!important;bottom:0!important;right:auto!important;width:var(--lw)!important;height:auto!important;margin:0!important}
  #labels{position:fixed!important;left:0!important;top:0!important;bottom:0!important;right:auto!important;width:var(--lw)!important;height:auto!important}
  #loading{left:0!important;right:auto!important;width:var(--lw);top:45%!important}
  .brand{left:max(10px,env(safe-area-inset-left))!important;top:8px!important;max-width:calc(var(--lw) - 76px)}
  .views{position:fixed!important;left:max(8px,env(safe-area-inset-left))!important;right:auto!important;top:auto!important;bottom:8px!important;max-width:calc(var(--lw) - 16px);margin:0!important;flex-wrap:wrap;justify-content:flex-start!important;z-index:7}
  .views .grp{flex:0 1 auto!important}
  .approx{position:static!important;max-width:none!important;margin:0!important;border-radius:0!important;white-space:normal!important;left:auto!important;top:auto!important}
  .ctl{position:sticky!important;top:0!important;left:auto!important;bottom:auto!important;width:auto!important;margin:0!important;border-radius:0!important;z-index:6}
  .sec{scroll-margin-top:96px!important}
  aside{width:100%!important;max-width:none!important}
  #stick,#mobCta,#stickyCta,#stickyQ,#sticky,#enqFab,#enqBtn,#toEnq,#cta,#mAnf{left:calc(var(--lw) + 10px)!important;right:10px!important;width:auto!important}
  #mw-note{max-width:none!important;margin:0 10px 80px!important}
}
