/* PXLGEN layout pass (Oct 17, Camaron): section labels, Randomize + Export in the top bar, a solid inspector header, the
   custom palette gradient editor. Own file (loaded last) so editor.css / mobile.css stay as they were. White monochrome, square. */

/* ---------- section labels: the PXLGEN wordmark face (wide heavy display), beacon square, count after the label */
#layersPanel .panel-head .eyebrow,.sec-h,.sp-k,.stage-bar::before{font-family:var(--font-display);font-stretch:125%;font-weight:800;font-size:12px;line-height:1;letter-spacing:.02em;text-transform:uppercase;color:var(--fg)}
#layersPanel .panel-head .eyebrow b{margin-left:2px;font-family:var(--font-mono);font-stretch:100%;font-weight:500;font-size:11px;letter-spacing:.08em;color:var(--dim)}
.sec-h{display:flex;align-items:center;gap:9px;margin:0;white-space:nowrap}
.sec-h i{flex:none;width:8px;height:8px;
  background:linear-gradient(#fff,#fff) 0 0/3px 3px no-repeat,linear-gradient(#fff,#fff) 5px 5px/3px 3px no-repeat,
  linear-gradient(rgb(255 255 255/.22),rgb(255 255 255/.22)) 5px 0/3px 3px no-repeat,linear-gradient(rgb(255 255 255/.22),rgb(255 255 255/.22)) 0 5px/3px 3px no-repeat}
/* pseudo-element labels (Stage Settings, Preset Manager) carry the same beacon as an inline SVG */
.stage-bar::before,.sp-k{padding-left:17px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='3' height='3' fill='%23fff'/%3E%3Crect x='5' y='5' width='3' height='3' fill='%23fff'/%3E%3Crect x='5' width='3' height='3' fill='%23fff' fill-opacity='.22'/%3E%3Crect y='5' width='3' height='3' fill='%23fff' fill-opacity='.22'/%3E%3C/svg%3E") 0 50%/8px 8px no-repeat}
/* Editor: above the preview (app.js fitCanvas reserves its height and aligns it with the panels) */
#secEditor{position:absolute;z-index:4;height:14px;pointer-events:none}
html.phone #secEditor{display:none}
/* Stage Settings: first row of the stage panel */
html:not(.phone) .stage>.stage-bar::before{content:"Stage Settings";flex:0 0 100%;display:block;height:14px;margin:4px 0 4px 6px}
/* Playback: first row of the transport, which is now one column-wide two-row panel */
.dock>.dk-h{display:none}
html:not(.phone):not(.tablet) .dock>.dk-h{display:flex;flex:0 0 100%;order:0!important;height:14px;margin:2px 0 0 4px}
html:not(.phone):not(.tablet) .dock.dk-wrap{padding:10px 10px 10px;row-gap:10px}
/* the dock without Randomize / Export: row 1 play · timeline · loop, row 2 BPM · length · Loop Quality (no leftover gaps) */
html:not(.phone):not(.tablet) .dock.dk-wrap .dsep:not(:first-of-type){display:none}
html:not(.phone):not(.tablet) .dock.dk-wrap .wm-up{order:21;margin-left:auto}
/* row 2 keeps BPM · length · Loop Quality · Go Pro on one line: the upsell shortens to its mark below 700px */
@media (max-width:1700px){html:not(.phone):not(.tablet) .dock.dk-wrap .wm-up{font-size:0;gap:0;padding:0 6px;height:34px;border:1px solid var(--line-2)}html:not(.phone):not(.tablet) .dock.dk-wrap .wm-up svg{width:12px;height:12px}}
#qualitySel .sel-pill .k{font:400 9.5px/1 var(--font-mono);letter-spacing:.16em;color:var(--dim);margin-right:2px}
/* Preset Manager label sits in its header the same way */
.sp-k{display:inline-block;height:14px;line-height:14px}

/* ---------- top bar: Randomize (ghost) + Export (primary white) at the far right, after Undo / Redo and Preset */
.nav .nav-rand,.nav .nav-export{flex:none;height:38px;padding:0 14px;gap:8px;font-size:13px}
.nav .nav-rand{border:1px solid var(--line-2);background:rgb(255 255 255/.03);color:var(--fg)}
.nav .nav-rand:hover{border-color:var(--fg)}
.nav .nav-rand svg,.nav .nav-export svg{width:13px;height:13px}
.nav .nav-export{background:#fff;color:#050505;box-shadow:0 0 22px -10px rgb(255 255 255/.6)}
.nav .nav-export.locked{background:rgb(255 255 255/.1);color:var(--fg);box-shadow:inset 0 0 0 1px var(--line-2)}
@media (max-width:1180px){html:not(.phone) .nav .nav-rand span{display:none}html:not(.phone) .nav .nav-rand{padding:0 12px}}
/* the Export dialog opens under the top-bar button (app.js still toggles it; only its anchor moved) */
html:not(.phone) #exportPop{top:calc(var(--gap) + var(--nav-h) + 8px)!important;bottom:auto!important;left:auto!important;right:var(--gap)!important;max-height:calc(100vh - var(--nav-h) - var(--gap) * 2 - 16px);overflow-y:auto}
/* phone: icon-only in the top bar (the phone app's own Randomize button stays; the desktop one hides) */
html.phone .nav .nav-rand{display:none}
html.phone .nav .nav-export{order:7;width:40px;height:36px;padding:0;font-size:0;gap:0;margin-left:2px}
html.phone .nav .nav-export svg{width:14px;height:14px}
html.phone .nav .mx-shuffle{order:6}

/* ---------- inspector header: solid (controls never show through), even rhythm kicker · title · counter · description */
.insp-head{background:rgb(14 14 16)!important;padding:20px 16px 16px 20px;border-bottom:1px solid var(--line)}
.insp-head::after{display:none!important}
.insp-head .ttl{display:flex;flex-direction:column;align-items:flex-start;gap:8px;margin-top:12px;line-height:.92}
.insp-head .ttl .t{display:block;max-width:100%;overflow-wrap:anywhere}
.insp-head .ttl .n{display:block;margin:0;font-size:10.5px;line-height:1;letter-spacing:.14em;vertical-align:baseline;color:var(--dim)}
.insp-head .ttl .n:empty{display:none}
.insp-head .insp-desc{margin:10px 0 0;max-width:36ch}
.insp-head + *{margin-top:12px}
html.phone .insp-head{background:#111214!important;padding-bottom:14px}

/* ---------- custom palette: Randomize + gradient editor (editor/layout-oct17.js PXLGrad) */
.swatches .gx{order:99;grid-column:1/-1;display:grid;gap:8px;margin-top:2px}
.gx-acts{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.gx-acts.one{grid-template-columns:1fr}
.gx-btn{height:30px;display:flex;align-items:center;justify-content:center;gap:7px;padding:0 10px;border:1px solid var(--line-2);background:rgb(255 255 255/.03);color:var(--fg);font:500 10.5px/1 var(--font-mono);letter-spacing:.14em;text-transform:uppercase;cursor:pointer}
.gx-btn svg{width:11px;height:11px}
.gx-btn:hover:not(:disabled){border-color:var(--fg)}
.gx-btn:disabled{opacity:.35;cursor:not-allowed}
.gx-bar{position:relative;height:28px;margin:10px 7px 14px;box-shadow:inset 0 0 0 1px rgb(255 255 255/.14);cursor:copy;touch-action:none}
.gx-stop{position:absolute;top:50%;width:14px;height:36px;margin:-18px 0 0 -7px;padding:0;border:2px solid #050505;box-shadow:0 0 0 1px rgb(255 255 255/.55);cursor:grab;touch-action:none}
.gx-stop.on{box-shadow:0 0 0 1px #050505,0 0 0 3px #fff;z-index:2}
.gx-stop.off{opacity:.25}
.gx-stop:active{cursor:grabbing}
.gx-sel{display:flex;align-items:center;gap:6px;min-width:0}
.gx-sw{position:relative;flex:none;width:30px;height:30px;box-shadow:inset 0 0 0 1px rgb(255 255 255/.2);overflow:hidden;cursor:pointer}
.gx-sw input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.gx-lab{flex:1;min-width:0;font:500 10.5px/1.2 var(--font-mono);letter-spacing:.08em;text-transform:uppercase;color:var(--mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gx-lab b{color:var(--fg);font-weight:500}
.gx-del{flex:none;width:30px;height:30px;display:grid;place-items:center;border:1px solid var(--line-2);background:none;color:var(--fg);cursor:pointer;font-size:15px;line-height:1}
.gx-del:hover:not(:disabled){background:#fff;color:#050505}
.gx-del:disabled{opacity:.3;cursor:not-allowed}
.gx-note{margin:0;font-size:11px;line-height:1.4;color:var(--dim)}
html.phone .gx-btn,html.phone .gx-sw,html.phone .gx-del{height:40px}
html.phone .gx-sw,html.phone .gx-del{width:40px}
html.phone .gx-bar{height:34px}
html.phone .gx-stop{width:18px;height:44px;margin:-22px 0 0 -9px}

/* ---------- free preview pulse (editor/layout-oct17.js): guest + free only, overlay above the 2D / 3D preview, never strobing */
.free-pulse{position:absolute;inset:0;z-index:5;pointer-events:none;opacity:0;background:rgb(232 28 36/var(--fp,0));box-shadow:inset 0 0 calc(60px + 80px * var(--fp,0)) rgb(255 40 48/calc(var(--fp,0) * 1.2))}
.free-pulse.on{opacity:1}
.free-pulse .fp-tag{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);padding:5px 10px;font:500 10px/1 var(--font-mono);letter-spacing:.18em;text-transform:uppercase;color:#fff;background:rgb(5 5 5/.6);box-shadow:inset 0 0 0 1px rgb(255 255 255/.25);opacity:calc(var(--fp,0) * 2.5);white-space:nowrap}
html.phone .free-pulse .fp-tag{bottom:10px;font-size:9px}

/* =========== Oct 18 mobile pass 2 (Camaron: "tabs and buttons are so big", "no words cut off", dense pro-tool feel) ===========
   Phone tokens (same styles as desktop, one size step down): controls are 32–36px visually; hit areas stay 44px through
   transparent top/bottom borders (background-clip:padding-box, outline drawn with an inset shadow), never visual bulk.
   No ellipsis on any button, tab or chip: labels fit, rows scroll. Shared with the site: docs/MOBILE_QA.md. */
html.phone{--tk-h:36px;--tk-h-sm:32px;--tk-fs:12px;--tk-ico:12px;--tk-hit:44px;--m-tabs-h:48px;--m-pad-l:calc(var(--sal) + 16px);--m-pad-r:calc(var(--sar) + 16px)}
/* hit-pad helper: 44px box, 36px (or 32px) visual */
html.phone .m-home .btn,html.phone .m-look-acts .btn,html.phone .tp-type .btn,html.phone .m-pane #exportPop .btn:not(.wide),html.phone .sp-plus,html.phone .sp-manage,
html.phone .m-home .m-home-add{height:var(--tk-hit)!important;border:4px solid transparent!important;border-left-width:0!important;border-right-width:0!important;background-clip:padding-box!important;box-shadow:inset 0 0 0 1px var(--m-line)!important;font-size:var(--tk-fs)!important;padding:0 12px!important;gap:6px!important}
html.phone .m-home .btn svg,html.phone .m-look-acts .btn svg,html.phone .tp-type .btn svg,html.phone .sp-plus svg{width:var(--tk-ico)!important;height:var(--tk-ico)!important}
html.phone .m-home .btn-accent,html.phone .m-pane #exportPop .btn-accent{box-shadow:none!important}
/* top bar: 48px, compact controls */
html.phone .nav{height:calc(48px + var(--sat))}
html.phone .m-menu-btn{height:32px;padding:0 10px;font-size:13px;gap:6px;max-width:none;flex:none}
html.phone .m-menu-btn .m-mb-ar{display:none}
html.phone .nav .hist-b{width:32px;height:32px}
html.phone .nav .nav-export{width:36px;height:32px}
html.phone .nav .brand{flex:none}
/* bottom tabs: 48px bar (44px+ hits), 34px visual active block, inline 11.5px Title Case labels */
.m-tabs button{flex-direction:column!important;justify-content:center;gap:3px!important;font-size:11px!important;font-weight:500!important;letter-spacing:0!important;isolation:isolate}
.m-tabs button svg{width:18px!important;height:18px!important}
.m-tabs button span{overflow:visible!important;text-overflow:clip!important;max-width:none!important;line-height:1}
.m-tabs button[aria-selected=true]{background:none!important}
.m-tabs button[aria-selected=true]::after{content:"";position:absolute;inset:4px 6px;z-index:-1;background:rgb(255 255 255/.06)}
/* transport row */
html.phone:not(.land) .dock{height:48px}
/* sheet panes: tighter rhythm */
html.phone .m-grab{height:18px}
.m-pane-head{padding:0 var(--m-pad-r) 2px var(--m-pad-l)}
.m-pane-head h3{font-size:18px!important;margin-top:4px!important}
.m-field{margin-top:16px}
.m-presets button{min-height:44px;font-size:13px}
.m-pal i{height:28px}
.m-pal{font-size:12px;padding:4px 4px 8px;gap:6px}
.m-pal span{overflow:visible!important;text-overflow:clip!important;white-space:normal!important;line-height:1.2}
.m-chip{height:36px}
html.phone .sec{margin-bottom:6px}

/* ---- peek (closed): the home strip fills the space under the pinned preview: Layers · chips · quick actions · tempo */
html.phone:not(.land) .m-sheet .m-home{flex-direction:column!important;align-items:stretch!important;height:auto!important;padding:2px 0 12px!important;gap:10px!important}
html.phone:not(.land) .m-home .m-home-head{order:1!important;display:flex;align-items:center;justify-content:space-between;padding:0 var(--m-pad-r) 0 var(--m-pad-l)!important}
html.phone:not(.land) .m-home .m-home-head .eyebrow{display:flex!important;margin:0}
html.phone:not(.land) .m-home .m-home-add{width:auto!important;padding:0 12px!important}
html.phone:not(.land) .m-home .m-home-add span{display:inline!important}
html.phone:not(.land) .m-home .m-chips{order:2!important;flex:none!important;display:flex;scroll-padding-inline:16px;overflow-x:auto;scrollbar-width:none;padding:0 var(--m-pad-r) 0 var(--m-pad-l)!important;gap:6px!important;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent)}
html.phone:not(.land) .m-home .m-chip-l{height:36px!important;max-width:none!important;flex:none!important;padding:0 12px 0 0!important;font-size:12.5px!important;gap:8px!important}
html.phone:not(.land) .m-home .m-chip-l i{width:36px!important;height:36px!important}
html.phone:not(.land) .m-home .m-chip-l span{white-space:nowrap;overflow:visible;text-overflow:clip}
html.phone:not(.land) .m-home .m-home-acts{order:3!important;display:grid!important;grid-template-columns:repeat(3,1fr);gap:6px;padding:0 var(--m-pad-r) 0 var(--m-pad-l)}
html.phone:not(.land) .m-home .m-home-tempo{order:4!important;display:block!important;padding:0 var(--m-pad-r) 0 var(--m-pad-l)}

/* ---- Tap BPM (home strip + phone sheet): one column. Short wide pad, then Loop / Feel / BPM rows with equal segments */
html.phone .tp{display:flex!important;flex-direction:column;align-items:stretch!important;gap:10px;margin:0}
html.phone .tp-pad{aspect-ratio:auto!important;width:100%;height:124px;flex-direction:row;gap:14px}
html.phone .tp-pad .tp-mark{grid-template-columns:repeat(3,8px);grid-template-rows:repeat(3,8px)}
html.phone .tp-pad .tp-bpm{font-size:44px!important}
html.phone .tp-pad .tp-sub{position:absolute;left:0;right:0;bottom:10px;font-size:10.5px;letter-spacing:.12em;white-space:nowrap}
html.phone .tp-side{gap:6px}
html.phone .tp-row{gap:10px}
html.phone .tp-row>.eyebrow{width:40px;font-size:10.5px}
html.phone .tp-row .seg{display:grid!important;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px;flex:1}
html.phone .tp-row .seg button{height:40px!important;border:4px solid transparent!important;border-left:0!important;border-right:0!important;background-clip:padding-box!important;box-shadow:inset 0 0 0 1px var(--m-line);font-size:12px!important;white-space:nowrap;padding:0 2px!important}
html.phone .tp-row .seg button.on{box-shadow:none}
html.phone .tp-type input{flex:1;width:auto;height:36px}
html.phone .tp-info{font-size:12px;line-height:1.35}
html.phone .m-home-tempo .tp-type,html.phone .m-home-tempo .tp-info{display:none}
html.phone .m-home-tempo .tp-pad{height:96px}
html.phone .m-home-tempo .tp-bpm{font-size:36px!important}
html.phone .m-home-tempo .tp-bars button:nth-child(5){display:block}
html.phone .tp-pop{max-height:min(60dvh,520px)!important;padding:0 var(--m-pad-r) calc(var(--sab) + 14px) var(--m-pad-l)!important}
html.phone .tp-pop .pop-head{display:flex;align-items:center;justify-content:space-between;min-height:48px;margin:0}
html.phone .tp-pop .pop-head .eyebrow{display:none}
html.phone .tp-pop .pop-head h3{font-size:16px!important;margin:0!important;letter-spacing:0}
html.phone .tp-pop .pop-head .icon{width:44px;height:44px;margin-right:-12px}

/* ---- inspector header: one compact row of label + actions, then name + n/n + (i); no inline description */
.insp-head .ttl{flex-direction:row!important;flex-wrap:wrap;align-items:center!important;gap:8px!important}
.insp-head .info-btn{position:relative;flex:none;width:22px;height:22px;display:inline-grid;place-items:center;border:1px solid var(--line-2);color:var(--mute);background:none;padding:0;cursor:pointer;align-self:center}
.insp-head .info-btn::after{content:"";position:absolute;inset:-11px}
.insp-head .info-btn svg{width:9px;height:9px}
.insp-head .info-btn:hover,.insp-head .info-btn.on{color:#fff;border-color:#fff;box-shadow:0 0 14px -6px rgb(255 255 255/.7)}
html.phone .insp-head{padding-top:0!important;padding-bottom:10px!important}
html.phone .insp-head .row1{min-height:44px}
html.phone .insp-head .acts{gap:2px!important}
html.phone .insp-head .icon:not(.info-btn){width:44px!important;height:44px!important;border:0!important;position:relative}
html.phone .insp-head .icon:not(.info-btn)::before{content:"";position:absolute;inset:6px;border:1px solid var(--line-2)}
html.phone .insp-head .icon:not(.info-btn) svg{width:12px!important;height:12px!important}
html.phone .insp-head .ttl{font-size:22px!important;margin-top:0!important}
html.phone .insp-head .ttl .n{font-size:10.5px}

/* ---- callout (PXLCallout, layout-oct17.js) */
.pxl-callout{position:fixed;z-index:200;max-width:calc(100vw - 24px);padding:10px 12px 12px;background:#111214;border:1px solid rgb(255 255 255/.18);box-shadow:0 0 0 1px rgb(0 0 0/.6),0 0 28px -10px rgb(255 255 255/.28),0 18px 50px -20px #000;color:var(--fg);border-radius:0}
.pxl-callout[hidden]{display:none}
.pxl-callout::before{content:"";position:absolute;top:-5px;left:calc(var(--pc-arrow,24px) - 4px);width:8px;height:8px;background:#111214;border-left:1px solid rgb(255 255 255/.18);border-top:1px solid rgb(255 255 255/.18);transform:rotate(45deg)}
.pxl-callout.above::before{top:auto;bottom:-5px;transform:rotate(225deg)}
.pc-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:-4px -8px 4px 0}
.pc-t{font:600 13px/1.2 var(--font-display,inherit);letter-spacing:.01em}
.pc-x{position:relative;width:28px;height:28px;display:grid;place-items:center;border:0;background:none;color:var(--mute);cursor:pointer;padding:0}
.pc-x::after{content:"";position:absolute;inset:-8px}
.pc-x svg{width:9px;height:9px}
.pc-x:hover{color:#fff}
.pc-body{margin:0;max-height:calc(1.45em * 4 + 2px);overflow:auto;font-size:13px;line-height:1.45;color:rgb(255 255 255/.75)}

/* ---- Preset Manager: compact head, one horizontal strip of looks (desktop + phone), phone disclosure */
.sp-head{height:auto;min-height:28px}
.sp-hname b{overflow:visible!important;text-overflow:clip!important;white-space:normal!important;line-height:1.15}
.sp-list{display:flex!important;grid-template-columns:none!important;overflow-x:auto;scrollbar-width:none;gap:4px;padding-bottom:2px;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 28px),transparent)}
.sp-cw{flex:none}
.sp-cw.on,.sp-cw.dirty{grid-column:auto}
.sp-sw{flex:none;height:32px;padding:0 10px 0 8px;font-size:12.5px}
.sp-sw span{overflow:visible!important;text-overflow:clip!important;white-space:nowrap}
.sp-acts{grid-template-columns:auto auto 1fr!important}
.sp-manage{justify-self:end}
/* phone: one sticky strip at the top of the Layers pane (research: sticky chip row above the layer stack) */
.m-pane .sp-bar.sp-phone{position:sticky!important;top:0;z-index:3;margin:0 0 8px!important;padding:6px var(--m-pad-r) 8px var(--m-pad-l)!important;background:#111214!important;border:0!important;border-bottom:1px solid var(--m-line)!important;box-shadow:none!important;display:flex;flex-direction:column;gap:6px}
html.phone .sp-bar.sp-phone .sp-head{display:flex;align-items:center;gap:6px;min-height:44px}
html.phone .sp-bar .sp-k{display:none}
html.phone .sp-hname{height:44px;flex:1 1 auto;min-width:0;justify-content:flex-start;gap:6px}
html.phone .sp-hname b{font-size:15px;font-weight:600}
html.phone .sp-hname svg{opacity:.5!important;width:11px;height:11px}
html.phone .sp-bar.sp-phone .sp-meta{font:500 11px var(--font-mono);color:var(--mute);white-space:nowrap}
html.phone .sp-bar.sp-phone .sp-fade{height:44px!important;flex:none;gap:0}
html.phone .sp-bar.sp-phone .sp-fade button{width:32px;height:44px}
html.phone .sp-bar.sp-phone .sp-fade b{min-width:32px;font-size:11px;text-align:center}
html.phone .sp-bar.sp-phone .sp-manage-sm,html.phone .sp-bar.sp-phone .sp-plus-sm{flex:none;width:auto!important;padding:0 10px!important}
html.phone .sp-bar.sp-phone .sp-list{display:flex!important;gap:6px;margin:0 calc(-1 * var(--m-pad-r)) 0 0;padding-right:var(--m-pad-r)}
html.phone .sp-bar.sp-phone .sp-sw{height:44px!important;padding:0 10px 0 8px;font-size:12.5px;gap:6px;border:4px solid transparent!important;border-left:0!important;border-right:0!important;background-clip:padding-box!important;box-shadow:inset 0 0 0 1px var(--m-line)!important}
html.phone .sp-bar.sp-phone .sp-sw.on{box-shadow:inset 0 0 0 1px #fff!important}
html.phone .sp-bar.sp-phone .sp-sw i{font:500 10.5px var(--font-mono);opacity:.6}
html.phone .sp-bar.sp-phone .sp-cw{display:flex;align-items:center;gap:2px}
html.phone .sp-bar.sp-phone .sp-ia{display:none!important}
html.phone .sp-bar.sp-phone .sp-cw.on.dirty .sp-ia{display:flex!important}
html.phone .sp-bar.sp-phone .sp-ib{width:32px;height:44px}
html.phone .sp-bar.sp-phone .sp-plus-chip{flex:none;width:auto!important;padding:0 12px!important}

/* ---- pop sheets on phones (Export, Add Look, Loop Quality / pill menus): full width, no clipped rows */
html.phone .sp-pop{left:8px!important;right:8px!important;width:auto!important;max-width:none!important}
html.phone .sp-add-row{display:grid!important;grid-template-columns:minmax(0,1fr) auto auto;gap:6px}
html.phone .sp-add-row input{min-width:0}
html.phone .sp-chips{display:flex;flex-wrap:wrap;gap:6px}
html.phone .menu{left:0!important;right:0!important;width:auto!important;max-width:none!important}
html.phone .m-pane #exportPop .seg{flex-wrap:nowrap}
html.phone .m-pane #exportPop .seg button{min-width:0;white-space:nowrap;height:40px;border:4px solid transparent;border-left:1px solid var(--line-2);border-right:1px solid var(--line-2);background-clip:padding-box;font-size:12px}

/* ---- Controls (research: 44px rows, label left / slider / value right, 4px track, 18px square thumb) */
html.phone .ctl:has(>.sl){display:grid;grid-template-columns:minmax(0,27%) minmax(0,1fr) auto auto auto;align-items:center;min-height:44px;margin-top:2px}
html.phone .ctl:has(>.sl):first-child{margin-top:0}
html.phone .ctl:has(>.sl)>.ctl-top{display:contents}
html.phone .ctl:has(>.sl) .lb{grid-area:1/1;font-size:13px;line-height:1.2;padding-right:8px;overflow-wrap:anywhere}
html.phone .ctl:has(>.sl)>.sl{grid-area:1/2;height:44px}
html.phone .ctl:has(>.sl) .reset{grid-area:1/3;display:none}
html.phone .ctl.dirty:has(>.sl) .reset{display:grid}
html.phone .ctl:has(>.sl) .kf{grid-area:1/4}
html.phone .ctl:has(>.sl) .mini{width:30px;height:44px}
html.phone .ctl:has(>.sl) .vt{grid-area:1/5;margin-left:2px;min-width:48px;height:28px;font-size:12px;padding:0 6px}
html.phone .ctl:has(>.sl)>:not(.ctl-top):not(.sl){grid-column:1/-1}
html.phone .sl .kn{top:13px;width:18px;height:18px;margin-left:-9px;border-radius:0}
html.phone .ctl:has(>.sel-pill) .ctl-top{min-height:32px;font-size:13px}
/* section group headers in the inspector: 11px Title Case, tight */
html.phone .sec-h{min-height:44px}
/* layer rows (research: 56px rows, 40px thumbnails) */
html.phone .layer{min-height:56px!important;gap:10px!important}
html.phone .layer .thumb{width:40px!important;height:40px!important}
/* Tap BPM stepper (research: BPM field + − / + + Clear) */
.tp-step{flex:none;width:32px;height:32px;display:grid;place-items:center;border:1px solid var(--line-2);background:none;color:var(--fg);font:500 15px var(--font-mono);padding:0;cursor:pointer}
.tp-step:hover{border-color:#fff}
html.phone .tp-step{width:40px;height:44px;border:4px solid transparent;border-left:0;border-right:0;background-clip:padding-box;box-shadow:inset 0 0 0 1px var(--m-line)}
html.phone .tp-type{gap:6px}
html.phone .tp-type input{min-width:0;text-align:center}
/* full sheet: the preview shrinks to a 64px strip above it; transport + HUD hide (the strip is a live thumbnail) */
html.phone.m-full:not(.land) .dock,html.phone.m-full:not(.land) .hud{visibility:hidden}

/* ---- Manage (My Presets): its own full sheet on phones (research), compact one-line rows, no ellipsis anywhere */
.sp-item b,.sp-item small{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}
html.phone .mp-dialog{place-items:end stretch}
html.phone .mp-dialog .mp-dialog-card{width:100%!important;height:auto!important;max-height:calc(100dvh - 48px - var(--sat))!important;min-height:60dvh;padding:4px var(--m-pad-r) calc(var(--sab) + 12px) var(--m-pad-l);border:0;border-top:1px solid var(--m-line);box-shadow:none}
html.phone .mp-dialog-head{align-items:center;margin-bottom:8px;min-height:48px}
html.phone .mp-dialog-head .eyebrow{display:none}
html.phone .mp-dialog-head h3{font-size:18px!important;margin:0!important}
html.phone .mp-dialog-head .icon{width:44px;height:44px;margin-right:-12px;border:0}
html.phone .sp-row{flex-wrap:nowrap!important;gap:2px;min-height:48px}
html.phone .sp-row .sp-item{flex:1 1 auto!important;padding:6px 8px;gap:8px}
html.phone .sp-row .sp-item b{font-size:13px}
html.phone .sp-row .sp-act{flex:none!important;width:32px!important;height:auto!important;border:0;color:var(--mute)}
html.phone .sp-nest{margin-left:0!important;padding-left:8px!important}
html .insp-head .ttl .info-btn{width:22px!important;height:22px!important;min-width:0!important;font-size:0!important;border-radius:0!important;margin:0 0 0 2px}
html .insp-head .ttl .info-btn svg{width:9px!important;height:9px!important}

/* ---- phone hit areas without visual bulk (qa:mobile) + 11px type floor */
html.phone:not(.land) .m-home .m-chip-l{height:44px!important;border:4px solid transparent!important;border-left:0!important;border-right:0!important;background-clip:padding-box!important}
html.phone .m-home .m-chip-l.on{box-shadow:inset 0 -2px 0 #fff}
html.phone .m-menu-btn{height:44px!important;border:6px solid transparent!important;border-left:0!important;border-right:0!important;background-clip:padding-box;box-shadow:inset 0 0 0 1px var(--m-line)}
html.phone[data-mtab=looks] .m-menu-btn{box-shadow:inset 0 0 0 1px #fff}
html.phone .nav .nav-export{height:44px!important;border:6px solid transparent!important;border-left:0!important;border-right:0!important;background-clip:padding-box!important}
html.phone .nav .brand{height:44px}
html.phone .tp-row .seg button{height:44px!important;border-top-width:6px!important;border-bottom-width:6px!important}
html.phone #wmUp{position:relative} /* Oct 18: #fsBtn stays absolute (top-right of the preview); relative here had dropped it behind the play button */
html.phone #fsBtn::after{content:"";position:absolute;inset:-10px}
html.phone #wmUp::after{content:"";position:absolute;inset:-16px -12px}
html.phone .hud,html.phone .hud span,html.phone .scrub-meta .tc,html.phone .tp-btn,html.phone .tp-row>.eyebrow,html.phone .tp-pad .tp-sub{font-size:11px!important}
/* Manage sheet at 375: nothing wider than the sheet; names wrap */
html.phone .mp-dialog-body .mp-list{display:grid;grid-template-columns:minmax(0,1fr)}
html.phone .mp-group,html.phone .mp-row,html.phone .sp-nest,html.phone .sp-row{min-width:0;max-width:100%}
html.phone .mp-item{min-width:0;flex:1 1 auto}
html.phone .mp-item b,html.phone .mp-item small{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:anywhere}
html.phone .mp-act{width:40px!important;flex:none}
html.phone .mp-dialog-head{min-width:0}
/* top bar never truncates the Looks pill (375: everything shares 375px) */
html.phone .m-menu-btn{flex:none!important;min-width:max-content}
html.phone .m-menu-btn .m-mb-name{overflow:visible!important;text-overflow:clip!important;max-width:none!important}
@media (max-width:389px){html.phone .nav .brand .wm{font-size:.9em}html.phone .nav .hist-b{width:30px}html.phone .nav .brand{gap:6px}}
/* phone modals (Add Layer, Song, Stage…): 18px titles; Add Layer card descriptions wrap in full (no clamp) */
html.phone .m-modal h3.display,html.phone .m-modal h2.display,html.phone .m-pane h3.display{font-size:18px!important;margin-top:4px!important}
html.phone .am-desc{-webkit-line-clamp:unset!important;line-clamp:unset!important;display:block!important;overflow:visible!important;font-size:12px;line-height:1.35}
html.phone .trk-head h3.display,html.phone .pop-head h3.display,html.phone .mp-dialog-head h3.display{font-size:18px!important;margin-top:4px!important}

/* Oct 18: Pro export upsell banner (after generating, watermarked output only) */
.pxl-upsell { position: fixed; z-index: 60; left: 50%; bottom: 72px; transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); display: flex; align-items: center; gap: 12px;
  padding: 10px 6px 10px 14px; background: #111214; border: 1px solid rgb(54 240 122 / .45); box-shadow: 0 0 0 1px #000, 0 0 26px -10px rgb(54 240 122 / .55), 0 18px 40px -18px #000; color: #f4f4f0; }
.pxl-upsell .pu-dot { width: 8px; height: 8px; flex: none; background: #36f07a; box-shadow: 0 0 10px 2px rgb(54 240 122 / .6); }
.pxl-upsell .pu-t { flex: 1; min-width: 0; margin: 0; display: grid; gap: 2px; font-size: 13px; line-height: 1.35; }
.pxl-upsell .pu-t b { font-weight: 600; font-size: 14px; }
.pxl-upsell .pu-t span { color: rgb(255 255 255 / .62); }
.pxl-upsell .pu-go { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; background: #fff; color: #050505; font-weight: 600; font-size: 13px; text-decoration: none; }
.pxl-upsell .pu-x { position: relative; flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: rgb(255 255 255 / .6); cursor: pointer; }
.pxl-upsell .pu-x::after { content: ""; position: absolute; inset: -6px; }
html.phone .pxl-upsell { bottom: calc(var(--m-dock-h, 48px) + var(--safe-b, 0px) + 12px); padding: 8px 4px 8px 12px; gap: 10px; }
html.phone .pxl-upsell .pu-go { height: 36px; border-top: 4px solid transparent; border-bottom: 4px solid transparent; background-clip: padding-box; height: 44px; }
html.phone .pxl-upsell .pu-x { width: 44px; height: 44px; }
html.phone .pxl-upsell .pu-x::after { display: none; }

/* Oct 18 Title Case UI: labels, buttons, tabs and eyebrows show their Title Case source text instead of forced caps.
   Display headings and the wordmark keep the brand caps. */
body :not(.display, .display *, .wm, .wm *, .brand *) { text-transform: none !important; }
html:not(.phone) .pxl-upsell { left: auto; right: 16px; bottom: 16px; transform: none; width: min(520px, calc(100vw - 32px)); }

/* Oct 18 dock fix: the transport always paints above the stage view (z 1) on phones, so no part of it can be covered */
html.phone .dock{z-index:2}

/* Oct 18 qa:mobile state audit (Looks / Layers / Controls / Color / Export): phone controls follow the standard
   (visual 32 / 36 / 40 inside a 44px hit, text >= 11px). Hit pads are transparent borders or ::after, so visuals do not move. */
html.phone .mp-name{height:44px;border:4px solid transparent;border-left-width:0;border-right-width:0;background-clip:padding-box;box-shadow:inset 0 0 0 1px rgb(255 255 255/.14)}
html.phone .mp-name:focus{border-color:transparent;box-shadow:inset 0 0 0 1px var(--fg)}
html.phone .mp-save-btn{height:44px;border:2px solid transparent;border-left-width:0;border-right-width:0;background-clip:padding-box}
html.phone .mp-save-btn::before{inset:2px 0}
html.phone .sp-head .sp-hname{border-top-width:4px;border-bottom-width:4px}
html.phone #addLayer{position:relative}
html.phone #addLayer::after{content:"";position:absolute;inset:-3px -1px}
html.phone .m-pal-row .m-chip{height:44px;border:4px solid transparent;border-left-width:0;border-right-width:0;background-clip:padding-box;box-shadow:inset 0 0 0 1px rgb(255 255 255/.1)}
html.phone .m-pal-row .m-chip.on{border-color:transparent;box-shadow:inset 0 0 0 2px #fff}
html.phone .insp-head .ttl .info-btn{width:24px!important;height:24px!important;z-index:1}
html.phone .insp-head .info-btn::after{inset:-12px}
html.phone #lockJoin,html.phone #lockSignin{height:44px;min-height:44px;border:2px solid transparent!important;border-left-width:0!important;border-right-width:0!important;background-clip:padding-box}
html.phone #lockSignin{box-shadow:inset 0 0 0 1px rgb(255 255 255/.14)}
html.phone small,html.phone .insp-head .ttl .n{font-size:11px!important}
html.phone .tp-pop input{height:44px;border-top:4px solid transparent!important;border-bottom:4px solid transparent!important;background-clip:padding-box}

/* Oct 18 preview resize: the sheet handle is a 44px drag target with a slim 36x4 pill; it lights up (steady, no pulse) while dragging */
html.phone:not(.land) .m-grab{height:44px;touch-action:none;cursor:ns-resize;position:relative}
html.phone:not(.land) .m-handle{width:36px;height:4px;border-radius:0;background:rgb(255 255 255/.32);transition:background .15s,box-shadow .15s}
html.phone:not(.land) .m-sheet.dragging .m-handle,html.phone:not(.land) .m-sheet.resizing .m-handle,html.phone:not(.land) .m-grab:active .m-handle{background:#fff;box-shadow:0 0 10px rgb(255 255 255/.35)}
html.phone .m-sheet.resizing{transition:none!important}
html.phone.m-resizing .canvas-wrap,html.phone.m-resizing .dock,html.phone.m-resizing .stage-view{transition:none!important} /* the box follows the finger 1:1 while resizing */
