/* PXLGEN phone layout. Every rule here is scoped to html.phone (set by index.html/editor/mobile.js for phones:
   <=430px wide, or <=430px tall in landscape), so the desktop editor renders exactly as before. */
html:not(.phone) .m-ui{display:none!important}
html.phone{--sat:env(safe-area-inset-top,0px);--sab:env(safe-area-inset-bottom,0px);--sal:env(safe-area-inset-left,0px);--sar:env(safe-area-inset-right,0px);
  --m-l:calc(var(--sal) + 10px);--m-r:calc(var(--sar) + 10px);--m-tabs-h:62px;--m-tabs-b:calc(var(--sab) + 10px);
  touch-action:manipulation;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-tap-highlight-color:transparent}
html.phone body{position:fixed;inset:0;overflow:hidden;overscroll-behavior:none;font-size:calc(14px * var(--ui, 1))}
html.phone input,html.phone textarea{font-size:calc(16px * var(--ui, 1))} /* iOS: no zoom-on-focus */
html.phone .backdrop{overflow:hidden}
html.phone .backdrop .aura{top:24%;width:120vw;height:50vh}

/* ---------- compact top bar ---------- */
html.phone .nav{top:calc(var(--sat) + calc(8px * var(--ui, 1)));left:var(--m-l);right:var(--m-r);height:calc(52px * var(--ui, 1));padding:0 calc(6px * var(--ui, 1)) 0 calc(16px * var(--ui, 1));gap:calc(10px * var(--ui, 1))}
html.phone .nav::after{left:calc(22px * var(--ui, 1));right:calc(22px * var(--ui, 1))}
html.phone .nav .vsep,html.phone .nav .doc,html.phone #presetSel,html.phone #aspectSel,html.phone #accentPick,html.phone #stageBtn{display:none}
html.phone .brand{gap:calc(9px * var(--ui, 1));min-width:0;flex:none}
html.phone .brand .logo{width:calc(22px * var(--ui, 1));height:calc(22px * var(--ui, 1))}
html.phone .brand .wm{font-size:calc(13px * var(--ui, 1));white-space:nowrap}
.m-menu-btn{display:flex;align-items:center;gap:calc(8px * var(--ui, 1));height:calc(40px * var(--ui, 1));min-width:0;max-width:58%;margin-left:auto;padding:0 calc(13px * var(--ui, 1)) 0 calc(15px * var(--ui, 1));border-radius:999px;border:1px solid var(--line-2);background:rgb(255 255 255/.04);
  font-size:calc(14px * var(--ui, 1));font-weight:600;letter-spacing:-.01em;transition:border-color .25s,background .25s}
.m-menu-btn:active{background:rgb(255 255 255/.09)}
.m-menu-btn .m-mb-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-menu-btn .m-mb-ar{flex:none;font:500 calc(12px * var(--ui, 1))/1 var(--font-mono);color:var(--accent);letter-spacing:.04em}
.m-menu-btn svg{width:calc(10px * var(--ui, 1));height:calc(10px * var(--ui, 1));color:var(--mute);flex:none}
html.phone[data-mmodal=look] .m-menu-btn{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-12)}

/* ---------- stage: canvas full width at the top (fixed; app.js fitPhone places it) ---------- */
html.phone .app{position:static;inset:auto}
html.phone .stage{position:fixed;inset:0;left:0;right:0;z-index:1;pointer-events:none}
html.phone .canvas-wrap{pointer-events:auto;border-radius:18px;box-shadow:0 0 0 1px var(--line-2),0 0 80px -24px var(--accent-glow),0 30px 80px -30px rgb(0 0 0/.9)}
html.phone .hud{top:calc(10px * var(--ui, 1));height:calc(28px * var(--ui, 1));padding:0 calc(10px * var(--ui, 1));font-size:calc(12px * var(--ui, 1));letter-spacing:.06em}
html.phone .hud.tl{left:calc(10px * var(--ui, 1));max-width:calc(100% - calc(96px * var(--ui, 1)));overflow:hidden;white-space:nowrap}
html.phone .hud.tr{right:calc(10px * var(--ui, 1))}
html.phone .canvas-wrap.narrow .hud.tr{display:none}
html.phone .canvas-wrap.narrow .hud.tl{max-width:calc(100% - calc(20px * var(--ui, 1)))}
html.phone .canvas-wrap.narrow .hud.tl #hudRes{overflow:hidden;text-overflow:ellipsis}

/* ---------- floating play / scrub / loop dock ---------- */
html.phone .dock{pointer-events:auto;top:var(--m-dock-top,calc(300px * var(--ui, 1)))!important;bottom:auto!important;left:var(--m-l);right:var(--m-r);transform:none;max-width:none;height:calc(64px * var(--ui, 1));padding:0 calc(10px * var(--ui, 1));gap:calc(12px * var(--ui, 1));transition:none}
html.phone .dock .dsep,html.phone .dock #qualitySel,html.phone .dock #shuffleAll,html.phone .dock #exportBtn,html.phone .dock .stepper{display:none}
html.phone .dock .play{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1))}
html.phone .dock .play svg{width:calc(15px * var(--ui, 1));height:calc(15px * var(--ui, 1))}
html.phone .scrub{flex:1;min-width:0;width:auto;gap:calc(4px * var(--ui, 1))}
html.phone .timeline{height:calc(26px * var(--ui, 1))}
html.phone .timeline::after{content:"";position:absolute;left:calc(-4px * var(--ui, 1));right:calc(-4px * var(--ui, 1));top:calc(-9px * var(--ui, 1));bottom:calc(-9px * var(--ui, 1))} /* 44px touch target */
html.phone .timeline::before,html.phone .timeline .fillbar{top:calc(11px * var(--ui, 1))}
html.phone .timeline i{top:calc(5px * var(--ui, 1));height:calc(16px * var(--ui, 1));width:calc(4px * var(--ui, 1));margin-left:-2px;border-radius:1px}
html.phone .tc{font-size:calc(12px * var(--ui, 1));letter-spacing:.04em}
html.phone .chip-tgl{height:calc(44px * var(--ui, 1));padding:0 calc(15px * var(--ui, 1)) 0 calc(13px * var(--ui, 1));font-size:calc(12px * var(--ui, 1));gap:calc(8px * var(--ui, 1));flex:none}
html.phone .chip-tgl svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1))}

/* ---------- floating tab bar ---------- */
.m-tabs{position:fixed;z-index:40;left:var(--m-l);right:var(--m-r);bottom:var(--m-tabs-b);height:var(--m-tabs-h);border-radius:999px;display:grid;grid-template-columns:repeat(4,1fr);gap:calc(4px * var(--ui, 1));padding:calc(6px * var(--ui, 1));
  background:rgb(16 16 19/.78);box-shadow:0 24px 70px -20px rgb(0 0 0/.95)}
.m-tabs button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(5px * var(--ui, 1));min-width:0;border-radius:999px;font-size:calc(12px * var(--ui, 1));font-weight:600;letter-spacing:-.005em;color:var(--mute);transition:background .25s,color .25s}
.m-tabs button svg{width:calc(16px * var(--ui, 1));height:calc(16px * var(--ui, 1))}
.m-tabs button[aria-selected=true]{color:var(--fg);background:rgb(255 255 255/.09);box-shadow:inset 0 0 0 1px var(--line-2)}
.m-tabs button[aria-selected=true] svg{color:var(--accent);filter:drop-shadow(0 0 6px var(--accent-glow))}
.m-tabs button[data-locked=true] svg{color:var(--accent)}
.m-tabs button span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}

/* ---------- swipeable bottom sheet (Layers / Controls / Export) ---------- */
.m-sheet{position:fixed;z-index:35;left:var(--m-l);right:var(--m-r);top:var(--m-full-top,calc(70px * var(--ui, 1)));bottom:calc(var(--m-tabs-b) + var(--m-tabs-h) + calc(10px * var(--ui, 1)));display:flex;flex-direction:column;overflow:hidden;
  border-radius:28px;border:1px solid var(--line-2);background:rgb(15 15 17/.9);-webkit-backdrop-filter:blur(20px) saturate(1.4);backdrop-filter:blur(20px) saturate(1.4);
  box-shadow:0 -10px 60px -30px rgb(0 0 0/.9);transition:transform .5s var(--ease-out-expo),clip-path .5s var(--ease-out-expo),visibility 0s;will-change:transform}
.m-sheet::before{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(180deg,rgb(255 255 255/.05),transparent 120px)}
.m-sheet.closed{visibility:hidden;transition:transform .4s var(--ease-out-expo),clip-path .4s var(--ease-out-expo),visibility 0s .4s}
.m-sheet.dragging,.m-modal.dragging{transition:none}
.m-grab{flex:none;height:calc(26px * var(--ui, 1));display:grid;place-items:center;touch-action:none;cursor:grab}
.m-handle{width:calc(40px * var(--ui, 1));height:calc(5px * var(--ui, 1));border-radius:999px;background:rgb(255 255 255/.26)}
.m-body{position:relative;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.m-body::-webkit-scrollbar{display:none}
.m-pane{display:none}
.m-sheet[data-pane=layers] .m-pane[data-pane=layers],.m-sheet[data-pane=controls] .m-pane[data-pane=controls],.m-sheet[data-pane=stage] .m-pane[data-pane=stage],.m-sheet[data-pane=export] .m-pane[data-pane=export]{display:block}
html.phone .m-pane .panel{position:static;inset:auto;width:auto;border:0;border-radius:0;background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;overflow:visible}
html.phone .m-pane .panel::before{display:none}
html.phone .panel-head,html.phone .insp-head,html.phone .pop-head,.m-modal-head{touch-action:none}

/* layers pane */
html.phone .panel-head{padding:2px calc(14px * var(--ui, 1)) calc(12px * var(--ui, 1)) calc(20px * var(--ui, 1))}
html.phone .eyebrow{font-size:calc(12px * var(--ui, 1));letter-spacing:.14em}
html.phone .add-btn{height:calc(40px * var(--ui, 1));padding:0 calc(16px * var(--ui, 1)) 0 calc(14px * var(--ui, 1));font-size:calc(14px * var(--ui, 1));gap:calc(8px * var(--ui, 1))}
html.phone .add-btn svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1))}
html.phone .layer-list{padding:0 calc(12px * var(--ui, 1)) calc(6px * var(--ui, 1));overflow:visible}
html.phone .layer{flex-wrap:wrap;gap:calc(6px * var(--ui, 1)) calc(12px * var(--ui, 1));padding:calc(8px * var(--ui, 1)) calc(4px * var(--ui, 1)) calc(8px * var(--ui, 1)) calc(8px * var(--ui, 1));border-radius:20px;margin-bottom:calc(6px * var(--ui, 1));min-height:calc(64px * var(--ui, 1))}
html.phone .layer.sel::before{left:calc(-12px * var(--ui, 1))}
html.phone .layer .thumb{width:calc(72px * var(--ui, 1));height:calc(46px * var(--ui, 1));border-radius:12px}
html.phone .layer .thumb .kind{width:calc(18px * var(--ui, 1));height:calc(18px * var(--ui, 1));border-radius:6px}
html.phone .layer .thumb .kind svg{width:calc(8px * var(--ui, 1));height:calc(8px * var(--ui, 1))}
html.phone .layer .nm{font-size:calc(15px * var(--ui, 1))}
html.phone .layer .nm small{font-size:calc(12px * var(--ui, 1));letter-spacing:.06em;margin-top:calc(3px * var(--ui, 1))}
html.phone .layer .eye{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1))}
html.phone .layer .eye svg{width:calc(14px * var(--ui, 1));height:calc(14px * var(--ui, 1))}
html.phone .layer .ops{display:none}
html.phone .layer.sel .ops{display:grid;grid-template-columns:repeat(4,1fr);gap:calc(6px * var(--ui, 1));position:static;transform:none;opacity:1;pointer-events:auto;order:9;flex-basis:100%;background:none;border:0;padding:calc(4px * var(--ui, 1)) calc(4px * var(--ui, 1)) 2px 0;border-radius:0}
html.phone .layer.sel .ops .icon{display:flex;flex-direction:column;gap:calc(5px * var(--ui, 1));width:auto;height:calc(52px * var(--ui, 1));border-radius:16px;background:rgb(255 255 255/.04);border:1px solid var(--line);color:var(--fg);font-size:calc(12px * var(--ui, 1));font-weight:500}
html.phone .layer.sel .ops .icon::after{content:attr(title);white-space:nowrap}
html.phone .layer.sel .ops .icon svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1));color:var(--accent)}
html.phone .layer.sel .ops .icon:active{background:var(--accent-12);border-color:var(--accent)}
html.phone .hint{font-size:calc(13px * var(--ui, 1));padding:calc(14px * var(--ui, 1)) calc(20px * var(--ui, 1)) calc(22px * var(--ui, 1));margin-top:calc(4px * var(--ui, 1))}
html.phone .hint svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1));margin-top:calc(3px * var(--ui, 1))}

/* controls pane (inspector) */
html.phone .inspector{overflow:visible}
html.phone .insp-head{padding:2px calc(14px * var(--ui, 1)) calc(14px * var(--ui, 1)) calc(20px * var(--ui, 1));background:linear-gradient(180deg,rgb(17 17 19) 78%,rgb(17 17 19/0))}
html.phone .insp-head .acts{gap:calc(8px * var(--ui, 1))}
html.phone .insp-head .icon{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1))}
html.phone .insp-head .icon svg{width:calc(14px * var(--ui, 1));height:calc(14px * var(--ui, 1))}
html.phone .insp-head .ttl{font-size:calc(28px * var(--ui, 1));margin-top:calc(8px * var(--ui, 1))}
html.phone .sec{margin:0 calc(12px * var(--ui, 1)) calc(10px * var(--ui, 1));border-radius:22px}
html.phone .sec-title{min-height:calc(54px * var(--ui, 1));padding:calc(12px * var(--ui, 1)) calc(12px * var(--ui, 1)) calc(12px * var(--ui, 1)) calc(16px * var(--ui, 1));gap:calc(12px * var(--ui, 1))}
html.phone .sec-title .ix,html.phone .sec-title .ct{font-size:calc(12px * var(--ui, 1))}
html.phone .sec-title .tt{font-size:calc(15px * var(--ui, 1))}
html.phone .sec-title .pm{width:calc(32px * var(--ui, 1));height:calc(32px * var(--ui, 1))}
html.phone .sec-title .pm svg{width:calc(10px * var(--ui, 1));height:calc(10px * var(--ui, 1))}
html.phone .sec-body{padding:0 calc(16px * var(--ui, 1)) calc(16px * var(--ui, 1))}
html.phone .ctl{margin-top:calc(14px * var(--ui, 1))}
html.phone .ctl:first-child{margin-top:0}
html.phone .ctl-top{font-size:calc(14px * var(--ui, 1));gap:calc(6px * var(--ui, 1));margin-bottom:0;min-height:calc(36px * var(--ui, 1))}
html.phone .ctl-top .mini{width:calc(36px * var(--ui, 1));height:calc(36px * var(--ui, 1))}
html.phone .ctl-top .mini svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1))}
html.phone .ctl-top .vt{font-size:calc(13px * var(--ui, 1));height:calc(32px * var(--ui, 1));min-width:calc(58px * var(--ui, 1));padding:0 calc(10px * var(--ui, 1))}
html.phone .ctl-top .vt input{width:calc(62px * var(--ui, 1));font-size:calc(16px * var(--ui, 1))}
/* touch slider: 44px hit area; pan-y keeps vertical sheet scrolling, horizontal drags go to the slider (never the page) */
html.phone .sl{height:calc(44px * var(--ui, 1));touch-action:pan-y}
html.phone .sl .rail,html.phone .sl .fl{top:calc(20px * var(--ui, 1));height:calc(4px * var(--ui, 1))}
html.phone .sl .z{top:calc(15px * var(--ui, 1));height:calc(14px * var(--ui, 1))}
html.phone .sl .kn{top:calc(11px * var(--ui, 1));width:calc(22px * var(--ui, 1));height:calc(22px * var(--ui, 1));margin-left:calc(-11px * var(--ui, 1));border-radius:6px}
html.phone .lfo{flex-wrap:wrap;gap:calc(4px * var(--ui, 1)) calc(10px * var(--ui, 1));border-radius:20px;padding:2px calc(8px * var(--ui, 1)) calc(8px * var(--ui, 1)) calc(14px * var(--ui, 1));font-size:calc(12px * var(--ui, 1))}
html.phone .lfo>svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1))}
html.phone .lfo .sl{flex:1;min-width:calc(120px * var(--ui, 1));height:calc(44px * var(--ui, 1))}
html.phone .lfo .sl .rail,html.phone .lfo .sl .fl{top:calc(20px * var(--ui, 1))}
html.phone .lfo .sl .kn{top:calc(12px * var(--ui, 1));width:calc(20px * var(--ui, 1));height:calc(20px * var(--ui, 1));margin-left:calc(-10px * var(--ui, 1))}
html.phone .lfo .vt{font-size:calc(12px * var(--ui, 1));min-width:calc(40px * var(--ui, 1))}
html.phone .lfo .cyc{gap:calc(4px * var(--ui, 1))}
html.phone .lfo .cyc button{min-width:calc(44px * var(--ui, 1));height:calc(36px * var(--ui, 1));font-size:calc(12px * var(--ui, 1))}
html.phone .ctl .sel-pill{height:calc(44px * var(--ui, 1));font-size:calc(15px * var(--ui, 1));padding:0 calc(14px * var(--ui, 1)) 0 calc(16px * var(--ui, 1))}
html.phone .sel-pill .k{font-size:calc(12px * var(--ui, 1))}
html.phone .swatches{gap:calc(8px * var(--ui, 1))}
html.phone .swatches button{height:calc(40px * var(--ui, 1))}
html.phone .color-pill,html.phone .toggle{height:calc(44px * var(--ui, 1));font-size:calc(12px * var(--ui, 1))}
html.phone .note{font-size:calc(13px * var(--ui, 1))}
html.phone .ctl .btn,html.phone .lyr-btns .btn{height:calc(44px * var(--ui, 1));font-size:calc(14px * var(--ui, 1))}
html.phone .lyr{font-size:calc(16px * var(--ui, 1));height:calc(180px * var(--ui, 1))}
html.phone .empty{font-size:calc(15px * var(--ui, 1))}

/* export pane */
html.phone .m-pane #exportPop{display:block!important;position:static;width:auto;border:0;border-radius:0;background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;padding:2px calc(20px * var(--ui, 1)) calc(24px * var(--ui, 1));animation:none}
html.phone .pop-head h3{font-size:calc(30px * var(--ui, 1))}
html.phone #exportClose{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1))}
html.phone .pop .row{margin-top:calc(18px * var(--ui, 1))}
html.phone .pop .row>label{font-size:calc(12px * var(--ui, 1));margin-bottom:calc(10px * var(--ui, 1))}
html.phone .seg{gap:calc(8px * var(--ui, 1))}
html.phone .seg button{height:calc(44px * var(--ui, 1));font-size:calc(14px * var(--ui, 1))}
html.phone .pop .spec{font-size:calc(12px * var(--ui, 1));letter-spacing:.04em}
html.phone .status{font-size:calc(13px * var(--ui, 1))}
html.phone .btn.wide{height:calc(52px * var(--ui, 1));font-size:calc(15px * var(--ui, 1))}
.m-loop-slot .stepper{display:inline-flex;height:calc(48px * var(--ui, 1));padding:0 calc(4px * var(--ui, 1));font-size:calc(13px * var(--ui, 1));color:var(--mute)}
.m-loop-slot .stepper button{width:calc(40px * var(--ui, 1));height:calc(40px * var(--ui, 1))}
.m-loop-slot .stepper button svg{width:calc(11px * var(--ui, 1));height:calc(11px * var(--ui, 1))}
.m-loop-slot .stepper input{width:calc(40px * var(--ui, 1));font-size:calc(16px * var(--ui, 1))}
.m-loop-slot .stepper span{font-size:calc(13px * var(--ui, 1));margin:0 calc(6px * var(--ui, 1)) 0 2px}

/* ---------- modal sheets: Add layer, Preset & frame ---------- */
.m-scrim{position:fixed;inset:0;z-index:45;background:rgb(0 0 0/.5);opacity:0;pointer-events:none;transition:opacity .35s}
.m-scrim.on{opacity:1;pointer-events:auto}
.m-modal{position:fixed;z-index:50;left:var(--m-l);right:var(--m-r);bottom:calc(var(--sab) + calc(10px * var(--ui, 1)));max-height:calc(100dvh - var(--sat) - calc(70px * var(--ui, 1)));display:flex;flex-direction:column;overflow:hidden;
  border-radius:28px;border:1px solid var(--line-2);background:rgb(16 16 19/.95);-webkit-backdrop-filter:blur(24px) saturate(1.4);backdrop-filter:blur(24px) saturate(1.4);
  box-shadow:0 -20px 80px -20px rgb(0 0 0/.9);transform:translate3d(0,calc(100% + 40px),0);visibility:hidden;transition:transform .45s var(--ease-out-expo),visibility 0s .45s}
.m-modal.open{transform:none;visibility:visible;transition:transform .5s var(--ease-out-expo),visibility 0s}
.m-modal-head{flex:none;display:flex;justify-content:space-between;align-items:flex-start;gap:calc(12px * var(--ui, 1));padding:0 calc(14px * var(--ui, 1)) calc(14px * var(--ui, 1)) calc(20px * var(--ui, 1))}
.m-modal-head h3{font-size:calc(28px * var(--ui, 1));margin-top:calc(10px * var(--ui, 1))}
.m-modal .m-x{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1))}
.m-modal .m-body{padding-bottom:calc(6px * var(--ui, 1))}
html.phone .m-add #addMenu{display:block;position:static;max-height:none;overflow:visible;border:0;border-radius:0;background:none;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;padding:0 calc(16px * var(--ui, 1)) calc(18px * var(--ui, 1));animation:none}
html.phone .add-menu h6{font-size:calc(12px * var(--ui, 1));margin:calc(14px * var(--ui, 1)) calc(4px * var(--ui, 1)) calc(8px * var(--ui, 1));letter-spacing:.14em}
html.phone .add-menu h6:first-child{margin-top:0}
html.phone .add-menu .tiles{gap:calc(8px * var(--ui, 1))}
/* t1126u: don't inflate Looks/Effects tabs; tiles stay tappable but a step smaller */
html.phone .add-menu .am-tile{min-height:calc(44px * var(--ui, 1));font-size:calc(13px * var(--ui, 1));padding:calc(8px * var(--ui, 1)) calc(10px * var(--ui, 1));border-radius:0;gap:calc(8px * var(--ui, 1))}
html.phone .add-menu .am-tile svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1))}
.m-look{padding:0 calc(20px * var(--ui, 1)) calc(22px * var(--ui, 1))}
.m-field{margin-top:calc(20px * var(--ui, 1))}
.m-field:first-child{margin-top:0}
.m-field>.eyebrow{margin-bottom:calc(10px * var(--ui, 1))}
.m-field .note{margin-top:calc(10px * var(--ui, 1))}
.m-proj .doc{display:block;cursor:text}
.m-proj .doc .eyebrow{display:none}
.m-proj .doc input{display:block;width:100%;height:calc(48px * var(--ui, 1));padding:0 calc(16px * var(--ui, 1));border-radius:16px;border:1px solid var(--line-2);background:rgb(255 255 255/.04);font-size:calc(16px * var(--ui, 1));font-weight:600;color:var(--fg);outline:none}
.m-proj .doc input:focus{border-color:var(--accent);box-shadow:0 0 0 4px var(--accent-12);color:var(--fg)}
.m-presets{display:grid;grid-template-columns:1fr 1fr;gap:calc(8px * var(--ui, 1))}
.m-presets button{display:flex;align-items:center;gap:calc(10px * var(--ui, 1));min-height:calc(52px * var(--ui, 1));padding:calc(10px * var(--ui, 1)) calc(12px * var(--ui, 1));border-radius:16px;border:1px solid var(--line);background:rgb(255 255 255/.02);text-align:left;font-size:calc(14px * var(--ui, 1));font-weight:600;line-height:1.2}
.m-presets button i{flex:none;width:calc(18px * var(--ui, 1));height:calc(18px * var(--ui, 1));border-radius:5px;box-shadow:inset 0 0 0 1px rgb(255 255 255/.15)}
.m-presets button.on{border-color:var(--accent);background:var(--accent-12)}
.m-accents{display:flex;flex-wrap:wrap;gap:calc(8px * var(--ui, 1))}
.m-accents button{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1));border-radius:999px;display:grid;place-items:center;border:1px solid var(--line-2)}
.m-accents button i{width:calc(16px * var(--ui, 1));height:calc(16px * var(--ui, 1));border-radius:4px}
.m-accents button.on{box-shadow:0 0 0 2px var(--fg) inset}
.m-shuffle{margin-top:calc(24px * var(--ui, 1))}
html.phone .m-look .seg button.on,html.phone #exportPop .seg button.on{font-weight:600}

/* pill-select menus become bottom action sheets */
.m-menu-scrim{position:fixed;inset:0;z-index:59;background:rgb(0 0 0/.45);animation:fade .25s ease}
html.phone .menu:not(.accent-menu){left:var(--m-l)!important;right:var(--m-r)!important;top:auto!important;bottom:calc(var(--sab) + calc(10px * var(--ui, 1)))!important;min-width:0!important;max-height:min(62dvh,calc(520px * var(--ui, 1)));border-radius:24px;padding:calc(8px * var(--ui, 1));overscroll-behavior:contain}
html.phone .menu button{min-height:calc(48px * var(--ui, 1));font-size:calc(15px * var(--ui, 1));padding:calc(10px * var(--ui, 1)) calc(14px * var(--ui, 1));gap:calc(12px * var(--ui, 1))}
html.phone .menu .grp{font-size:calc(12px * var(--ui, 1))}

/* locked export on phones: the card becomes a bottom sheet, the watermark stays legible */
html.phone .lock-card{left:var(--m-l);right:var(--m-r);top:auto;bottom:calc(var(--sab) + calc(10px * var(--ui, 1)));width:auto;transform:none;animation:lockup .45s var(--ease-out-expo);padding:calc(26px * var(--ui, 1)) calc(22px * var(--ui, 1)) calc(22px * var(--ui, 1))}
@keyframes lockup{from{transform:translateY(40px);opacity:0}}
html.phone .lock-card h3{font-size:calc(28px * var(--ui, 1))}
html.phone .lock-copy{font-size:calc(14px * var(--ui, 1))}
html.phone .lock-btns .btn{height:calc(50px * var(--ui, 1));font-size:calc(15px * var(--ui, 1))}
html.phone .lock-x{width:calc(44px * var(--ui, 1));height:calc(44px * var(--ui, 1));top:calc(14px * var(--ui, 1));right:calc(14px * var(--ui, 1))}
html.phone .wm-lock{right:calc(10px * var(--ui, 1));bottom:calc(10px * var(--ui, 1));height:calc(26px * var(--ui, 1));font-size:calc(12px * var(--ui, 1));letter-spacing:.06em}
html.phone .canvas-wrap.narrow .wm-lock span{display:none}

/* ---------- landscape phones: dock rides in the top bar, the sheet docks right, the canvas refits beside it ---------- */
html.phone.land{--m-tabs-h:54px}
html.phone.land .dock{top:var(--m-dock-t,calc(12px * var(--ui, 1)))!important;left:var(--m-dock-l,calc(200px * var(--ui, 1)));right:auto;width:var(--m-dock-w,calc(360px * var(--ui, 1)));height:calc(44px * var(--ui, 1));padding:0;gap:calc(10px * var(--ui, 1));background:none;border:0;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none;z-index:31}
html.phone.land .stage{z-index:31}
html.phone.land .canvas-wrap{transition:left .45s var(--ease-out-expo),top .45s var(--ease-out-expo),width .45s var(--ease-out-expo),height .45s var(--ease-out-expo)}
html.phone.land .dock .play{width:calc(40px * var(--ui, 1));height:calc(40px * var(--ui, 1))}
html.phone.land .scrub-meta{display:none}
html.phone.land .timeline{height:calc(22px * var(--ui, 1))}
html.phone.land .timeline::before,html.phone.land .timeline .fillbar{top:calc(9px * var(--ui, 1))}
html.phone.land .timeline i{top:calc(3px * var(--ui, 1))}
html.phone.land .timeline::after{top:calc(-11px * var(--ui, 1));bottom:calc(-11px * var(--ui, 1))}
html.phone.land .scrub{flex-direction:row;align-items:center;gap:calc(10px * var(--ui, 1))}
html.phone.land .scrub .timeline{flex:1}
html.phone.land .chip-tgl{height:calc(40px * var(--ui, 1))}
html.phone.land .m-tabs{right:auto;left:var(--m-col-c,50%);width:min(calc(440px * var(--ui, 1)),var(--m-col-w,100%));transform:translateX(-50%);transition:left .45s var(--ease-out-expo)}
html.phone.land .m-tabs button{gap:calc(3px * var(--ui, 1))}
html.phone.land .m-sheet{left:auto;width:min(calc(400px * var(--ui, 1)),48vw);bottom:calc(var(--sab) + calc(10px * var(--ui, 1)))}
html.phone.land .m-modal{left:max(var(--m-l),calc(50% - calc(320px * var(--ui, 1))));right:max(var(--m-r),calc(50% - calc(320px * var(--ui, 1))));max-height:calc(100dvh - var(--sat) - calc(16px * var(--ui, 1)))}
html.phone.land .add-menu .tiles,html.phone.land .m-presets{grid-template-columns:repeat(3,1fr)}
html.phone.land .lock-card{left:max(var(--m-l),calc(50% - calc(230px * var(--ui, 1))));right:max(var(--m-r),calc(50% - calc(230px * var(--ui, 1))))}
@media (prefers-reduced-motion:reduce){.m-sheet,.m-modal,html.phone.land .canvas-wrap{transition-duration:.001ms!important}}
/* fixed chrome never pans or zooms the page; taps still click */
html.phone .nav,html.phone .dock,.m-tabs{touch-action:none}

/* =========== PXL SUPPLY v5 phone layout: square, mono white, edge to edge (overrides the rules above) =========== */
html.phone{--accent:#f4f4f2!important;--accent-ink:#050505!important;--accent-glow:rgb(255 255 255/.16)!important;--accent-12:rgb(255 255 255/.09)!important;--accent-22:rgb(255 255 255/.16)!important;
  --m-l:0px;--m-r:0px;--m-tabs-h:60px;--m-tabs-b:0px;--m-line:rgb(255 255 255/.1);--m-pad-l:calc(var(--sal) + 18px);--m-pad-r:calc(var(--sar) + 18px)}
html.phone body{background:#050505}
html.phone .backdrop .aura{opacity:.06}
/* top bar */
html.phone .nav{top:0;left:0;right:0;height:calc(calc(52px * var(--ui, 1)) + var(--sat));padding:var(--sat) calc(var(--sar) + calc(8px * var(--ui, 1))) 0 calc(var(--sal) + calc(16px * var(--ui, 1)));background:#050505;border:0;border-bottom:1px solid var(--m-line);box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
html.phone .nav::before,html.phone .nav::after{display:none}
.m-menu-btn{height:calc(40px * var(--ui, 1));max-width:62%;padding:0 calc(12px * var(--ui, 1)) 0 calc(14px * var(--ui, 1));border:1px solid var(--m-line);background:none;font-size:calc(14px * var(--ui, 1))}
.m-menu-btn .m-mb-ar{color:rgb(255 255 255/.55)}
html.phone[data-mtab=looks] .m-menu-btn{border-color:#fff}
/* canvas: full width at its own aspect, pinned under the bar */
html.phone .canvas-wrap{box-shadow:none;border:0}
html.phone .hud{height:calc(26px * var(--ui, 1));font-size:calc(11px * var(--ui, 1))}
/* play / scrub / loop row under the canvas */
html.phone:not(.land) .dock{left:0;right:0;height:calc(56px * var(--ui, 1));padding:0 calc(var(--sar) + calc(10px * var(--ui, 1))) 0 calc(var(--sal) + calc(10px * var(--ui, 1)));gap:calc(12px * var(--ui, 1));background:#050505;border:0;border-bottom:1px solid var(--m-line);box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
html.phone .dock::before,html.phone .dock::after{display:none}
/* bottom tab bar */
.m-tabs{left:0;right:0;bottom:0;height:calc(var(--m-tabs-h) + var(--sab));padding:0 var(--sar) var(--sab) var(--sal);gap:0;grid-template-columns:repeat(4,1fr);background:#0a0a0b;border:0;border-top:1px solid var(--m-line);box-shadow:none;-webkit-backdrop-filter:none;backdrop-filter:none}
.m-tabs::before,.m-tabs::after{display:none}
.m-tabs button{position:relative;gap:calc(6px * var(--ui, 1));font-size:calc(11px * var(--ui, 1));font-weight:600;letter-spacing:.02em;color:rgb(255 255 255/.5);background:none;box-shadow:none}
.m-tabs button svg{width:calc(15px * var(--ui, 1));height:calc(15px * var(--ui, 1))}
.m-tabs button[aria-selected=true]{color:#fff;background:rgb(255 255 255/.04);box-shadow:none}
.m-tabs button[aria-selected=true]::before{content:"";position:absolute;left:24%;right:24%;top:-1px;height:2px;background:#fff}
.m-tabs button[aria-selected=true] svg,.m-tabs button[data-locked=true] svg{color:#fff;filter:none}
/* bottom sheet */
.m-sheet{left:0;right:0;bottom:calc(var(--m-tabs-h) + var(--sab));border:0;border-top:1px solid var(--m-line);background:#111214;-webkit-backdrop-filter:none;backdrop-filter:none;box-shadow:none}
.m-sheet::before{display:none}
.m-grab{height:calc(22px * var(--ui, 1))}
.m-handle{width:calc(36px * var(--ui, 1));height:calc(3px * var(--ui, 1));background:rgb(255 255 255/.3)}
.m-sheet[data-pane=looks] .m-pane[data-pane=looks],.m-sheet[data-pane=color] .m-pane[data-pane=color]{display:block}
.m-pane-head{padding:2px var(--m-pad-r) calc(4px * var(--ui, 1)) var(--m-pad-l)}
.m-pane-head h3{font-size:calc(26px * var(--ui, 1));margin-top:calc(6px * var(--ui, 1))}
html.phone .panel-head,html.phone .insp-head{padding-left:var(--m-pad-l);padding-right:calc(var(--sar) + calc(12px * var(--ui, 1)))}
html.phone .insp-head{background:linear-gradient(180deg,#111214 78%,rgb(17 18 20/0))}
html.phone .m-pane #exportPop{padding:2px var(--m-pad-r) calc(28px * var(--ui, 1)) var(--m-pad-l)}
html.phone .layer-list{padding:0 calc(var(--sar) + calc(12px * var(--ui, 1))) calc(6px * var(--ui, 1)) calc(var(--sal) + calc(12px * var(--ui, 1)))}
html.phone .sec{margin:0 calc(var(--sar) + calc(12px * var(--ui, 1))) calc(8px * var(--ui, 1)) calc(var(--sal) + calc(12px * var(--ui, 1)));background:rgb(255 255 255/.02)}
/* looks pane */
.m-look,.m-color{padding:calc(10px * var(--ui, 1)) var(--m-pad-r) calc(28px * var(--ui, 1)) var(--m-pad-l)}
.m-field{margin-top:calc(22px * var(--ui, 1))}
.m-presets{gap:calc(6px * var(--ui, 1))}
.m-presets button{min-height:calc(56px * var(--ui, 1));border:1px solid var(--m-line);background:rgb(255 255 255/.02);color:var(--fg)}
.m-presets button i{width:calc(22px * var(--ui, 1));height:calc(22px * var(--ui, 1))}
.m-presets button.on{border-color:#fff;background:rgb(255 255 255/.08)}
.m-look-acts{display:grid;grid-template-columns:1fr 1fr;gap:calc(6px * var(--ui, 1));margin-top:calc(24px * var(--ui, 1))}
.m-look-acts .btn{height:calc(52px * var(--ui, 1));gap:calc(10px * var(--ui, 1));font-size:calc(14px * var(--ui, 1))}
.m-look-acts .btn svg{width:calc(12px * var(--ui, 1));height:calc(12px * var(--ui, 1))}
.m-proj .doc input{height:calc(48px * var(--ui, 1));border:1px solid var(--m-line)}
/* color pane */
.m-pal-all{display:grid;grid-template-columns:repeat(3,1fr);gap:calc(6px * var(--ui, 1))}
.m-pal{display:flex;flex-direction:column;align-items:stretch;gap:calc(8px * var(--ui, 1));min-width:0;padding:calc(6px * var(--ui, 1)) calc(6px * var(--ui, 1)) calc(10px * var(--ui, 1));border:1px solid var(--m-line);background:rgb(255 255 255/.02);font-size:calc(13px * var(--ui, 1));font-weight:600;text-align:left;color:var(--fg)}
.m-pal i{display:block;height:calc(40px * var(--ui, 1))}
.m-pal span{padding-left:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.m-pal.on{border-color:#fff;background:rgb(255 255 255/.08)}
.m-pal-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(calc(44px * var(--ui, 1)),1fr));gap:calc(6px * var(--ui, 1))}
.m-chip{height:calc(44px * var(--ui, 1));padding:calc(4px * var(--ui, 1));border:1px solid var(--m-line);background:none}
.m-chip i{display:block;width:100%;height:100%}
.m-chip.on{border-color:#fff;box-shadow:inset 0 0 0 1px #fff}
.m-color>.note{margin-top:calc(22px * var(--ui, 1))}
/* thumb-sized sliders + big readouts */
html.phone .ctl-top{font-size:calc(15px * var(--ui, 1));min-height:calc(40px * var(--ui, 1))}
html.phone .ctl-top .vt{height:calc(38px * var(--ui, 1));min-width:calc(76px * var(--ui, 1));padding:0 calc(10px * var(--ui, 1));font:600 calc(17px * var(--ui, 1))/1 var(--font-mono)}
html.phone .ctl-top .vt input{width:calc(70px * var(--ui, 1));font:600 calc(17px * var(--ui, 1))/1 var(--font-mono)}
html.phone .sl{height:calc(48px * var(--ui, 1))}
html.phone .sl .rail,html.phone .sl .fl{top:calc(21px * var(--ui, 1));height:calc(6px * var(--ui, 1))}
html.phone .sl .z{top:calc(17px * var(--ui, 1));height:calc(14px * var(--ui, 1))}
html.phone .sl .kn{top:calc(10px * var(--ui, 1));width:calc(28px * var(--ui, 1));height:calc(28px * var(--ui, 1));margin-left:calc(-14px * var(--ui, 1));background:#fff;box-shadow:0 0 0 1px rgb(0 0 0/.6),0 4px 14px rgb(0 0 0/.5)}
html.phone .lfo .sl .kn{top:calc(12px * var(--ui, 1));width:calc(24px * var(--ui, 1));height:calc(24px * var(--ui, 1));margin-left:calc(-12px * var(--ui, 1))}
/* my presets in the sheet */
html.phone .mp-name{font-size:calc(16px * var(--ui, 1))}
html.phone .m-mine .mp-list{height:min(calc(340px * var(--ui, 1)),46dvh);overflow-y:auto;align-content:start;overscroll-behavior:contain;scrollbar-width:thin}
html.phone .m-mine .mp-list:has(> .mp-empty){align-content:center}
html.phone .menu.menu-presets{width:auto;height:min(62dvh,calc(520px * var(--ui, 1)))}
/* landscape keeps the docked sheet; five tabs */
html.phone.land .m-sheet{bottom:calc(var(--sab) + calc(10px * var(--ui, 1)))}
html.phone.land .m-tabs{bottom:calc(var(--sab) + calc(8px * var(--ui, 1)));height:var(--m-tabs-h);padding:0;border:1px solid var(--m-line)}
html.phone.land .nav{height:calc(calc(52px * var(--ui, 1)) + var(--sat))}

/* PXL SUPPLY v5: hard edges to match the 5-block mark */
*, *::before, *::after { border-radius: 0 !important; }

/* Undo / Redo in the phone top bar (Oct 17) */
html.phone .nav .hist{order:5;margin-left:auto;border-color:var(--m-line)}
html.phone .nav .hist-b{width:calc(34px * var(--ui, 1));height:calc(34px * var(--ui, 1))}
html.phone .nav .m-menu-btn{order:6}
@media (max-width:430px){html.phone .nav .hist-b{width:calc(30px * var(--ui, 1))} html.phone .nav .m-menu-btn .m-mb-ar{display:none} html.phone .nav .m-menu-btn{max-width:none;flex:1 1 auto;min-width:0}}
/* Palette hint + the Custom chip's "+" (Oct 17: make picking your own colors obvious) */
.m-pal-hint{margin:-2px 0 calc(10px * var(--ui, 1));font-size:calc(12.5px * var(--ui, 1));line-height:1.4;color:rgb(255 255 255/.6)}
.m-chip.custom{position:relative}
.m-chip.custom b{position:absolute;inset:0;display:grid;place-items:center;font:500 calc(16px * var(--ui, 1))/1 var(--font-mono,ui-monospace,monospace);color:#fff;text-shadow:0 0 6px #000,0 0 2px #000;pointer-events:none}
/* Any color — square swatches in the Color sheet */
html.phone .m-any-colors{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:calc(8px * var(--ui, 1));margin-top:calc(10px * var(--ui, 1))}
html.phone .m-any-swatch{position:relative;display:flex;flex-direction:column;align-items:stretch;gap:calc(4px * var(--ui, 1));border:1px solid var(--m-line,#2a2a2e);background:#0a0a0c;padding:calc(6px * var(--ui, 1));cursor:pointer}
html.phone .m-any-swatch i{display:block;aspect-ratio:1;border:1px solid rgb(255 255 255 / .12)}
html.phone .m-any-swatch span{font-family:var(--font-mono,ui-monospace,monospace);font-size:0.58rem;letter-spacing:0.12em;text-transform:uppercase;color:rgb(255 255 255 / .55);text-align:center}
html.phone .m-any-swatch input[type=color]{position:absolute;inset:0;opacity:0;cursor:pointer;border:0;padding:0}

/* ---------- Oct 8: home strip under the canvas (portrait, all sheets closed) ---------- */
.m-home{display:none}
html.phone:not(.land).m-home-on .m-home{display:flex}
html.phone:not(.land) .m-home{position:fixed;z-index:30;left:0;right:0;top:calc(var(--m-dock-top,calc(300px * var(--ui, 1))) + calc(52px * var(--ui, 1)));bottom:calc(var(--m-tabs-h) + var(--sab));flex-direction:column;gap:calc(18px * var(--ui, 1));padding:calc(16px * var(--ui, 1)) var(--m-pad-r,calc(18px * var(--ui, 1))) calc(18px * var(--ui, 1)) var(--m-pad-l,calc(18px * var(--ui, 1)));overflow-y:auto;overscroll-behavior:contain;background:#050505}
html.phone[data-mmodal] .m-home{visibility:hidden}
.m-home-head{display:flex;align-items:center;justify-content:space-between}
.m-home-head .btn{height:calc(36px * var(--ui, 1));padding:0 calc(14px * var(--ui, 1));font-size:calc(13px * var(--ui, 1))}
.m-chips{display:flex;gap:calc(8px * var(--ui, 1));overflow-x:auto;scroll-snap-type:x mandatory;margin:calc(-6px * var(--ui, 1)) calc(-1 * var(--m-pad-r,calc(18px * var(--ui, 1)))) 0 calc(-1 * var(--m-pad-l,calc(18px * var(--ui, 1))));padding:0 var(--m-pad-r,calc(18px * var(--ui, 1))) calc(4px * var(--ui, 1)) var(--m-pad-l,calc(18px * var(--ui, 1)));scrollbar-width:none}
.m-chips::-webkit-scrollbar{display:none}
.m-chip-l{flex:none;width:calc(112px * var(--ui, 1));scroll-snap-align:start;display:flex;flex-direction:column;gap:calc(7px * var(--ui, 1));text-align:left;padding:calc(5px * var(--ui, 1)) calc(5px * var(--ui, 1)) calc(9px * var(--ui, 1));border:1px solid var(--m-line,var(--line));background:#0b0b0d;color:var(--fg);font-size:calc(12.5px * var(--ui, 1))}
.m-chip-l i{position:relative;display:grid;place-items:center;aspect-ratio:16/9;background:#18181b;color:#fff}
.m-chip-l i svg{width:calc(11px * var(--ui, 1));height:calc(11px * var(--ui, 1));filter:drop-shadow(0 0 2px #000)}
.m-chip-l span{padding:0 calc(3px * var(--ui, 1));white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.m-chip-l.on{border-color:var(--fg)}
.m-chip-l.off{opacity:.45}
.m-home-tempo .tp{grid-template-columns:calc(132px * var(--ui, 1)) 1fr;gap:calc(14px * var(--ui, 1));margin:0}
.m-home-tempo .tp-bpm{font-size:calc(42px * var(--ui, 1))}
.m-home-tempo .tp-type,.m-home-tempo .tp-info{display:none}
.m-home-tempo .tp-row .seg button{height:calc(40px * var(--ui, 1));font-size:calc(12px * var(--ui, 1))}
.m-home-tempo .tp-bars button:nth-child(5){display:none}
.m-home-acts{display:grid;grid-template-columns:1fr 1fr 1.2fr;gap:calc(8px * var(--ui, 1));margin-top:auto}
.m-home-acts .btn{height:calc(48px * var(--ui, 1));font-size:calc(14px * var(--ui, 1))}
html.phone .dock #tempoBtn{display:none}

/* Oct 23: look thumbs in My Looks */
html.phone .mp-sw{width:calc(36px * var(--ui, 1));height:calc(36px * var(--ui, 1))}
html.phone .m-look-acts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:calc(8px * var(--ui, 1))}
html.phone .m-look-acts .btn{min-height:calc(44px * var(--ui, 1));justify-content:center}
