#studio-mobile-nav,#studio-mobile-tools,.studio-mobile-help{display:none}
.sr-mobile-label>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
@media(max-width:760px),(pointer:coarse),(max-width:1000px) and (max-height:540px){
 html{height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
 body{height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none;-webkit-text-size-adjust:100%}
 /* Blocca lo scorrimento della pagina su iOS; scorrono solo i menu interni.
    Origine e dimensioni sono quelle dell'area realmente visibile di Chrome. */
 html body.studio-mobile{position:fixed;inset:auto;top:var(--studio-top,0px);left:var(--studio-left,0px);width:var(--studio-width,100%);height:var(--studio-height,100dvh);min-height:0;margin:0;overflow:hidden}
 body.studio-mobile.menus-ready #header{position:absolute;top:0;left:0;right:0;box-sizing:border-box;height:calc(58px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px)}
 body.studio-mobile.menus-ready #workspace{position:absolute;top:calc(58px + env(safe-area-inset-top,0px));left:0;right:0;bottom:0;height:auto;min-height:0;margin:0}
 #header .mode-tabs{display:none}
 #header{min-width:0;padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
 #header #modello3d-link,#header #studio-esterni-btn{display:none}
 .menus-ready #header{height:calc(58px + env(safe-area-inset-top,0px));padding-top:env(safe-area-inset-top,0px);gap:8px;z-index:100}
 .menus-ready #header .brand{flex:1;min-width:0;gap:8px;overflow:hidden}
 .menus-ready .brand img{width:32px;height:32px;flex:none}
 .menus-ready .brand strong{font-size:12px;letter-spacing:1px}
 .menus-ready .brand small{font-size:8px;letter-spacing:.4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .menus-ready .header-right{flex:none;gap:0}
 .menus-ready #solo-btn{min-width:78px;min-height:44px;padding:10px 12px}
 .menus-ready #workspace{height:calc(100% - 58px - env(safe-area-inset-top,0px));height:calc(var(--studio-height,100dvh) - 58px - env(safe-area-inset-top,0px));min-width:0}
 #stage-area{touch-action:none;overflow:hidden}
 #viewport,#viewport canvas{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
 .menus-ready .view-top,.menus-ready #context-hint,.menus-ready #viewport-footer{display:none}
 #studio-mobile-nav{position:absolute;left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));top:10px;z-index:66;display:grid;grid-template-columns:minmax(112px,.9fr) minmax(0,1.3fr);gap:8px;pointer-events:none;align-items:start}
 #studio-mobile-nav>*{min-width:0;pointer-events:auto}
 #studio-mobile-nav #walk-bar{position:static;transform:none;display:flex;justify-content:stretch;margin:0}
 #studio-mobile-nav #walk-btn{width:100%;min-height:46px;justify-content:center;padding:10px 12px;font-size:13px;white-space:nowrap}
 #studio-mobile-nav .walk-piano{min-height:44px;max-width:74px;padding:8px 6px;font-size:11px;white-space:normal;line-height:1.2}
 #studio-mobile-views{height:46px;font-size:16px;font-weight:600;line-height:1.2;padding:8px 10px;border:1px solid #7b9d9d;border-radius:10px;background:#142d3bed;color:#fff;max-width:100%;box-shadow:0 3px 12px #0003}
 #studio-mobile-tools{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:calc(78px + env(safe-area-inset-bottom,0px));z-index:61;display:grid;gap:7px}
 #studio-mobile-tools button{width:46px;min-height:46px;border:1px solid #8aabab;background:#15312fed;color:#fff;border-radius:10px;font-size:23px;touch-action:manipulation;box-shadow:0 3px 12px #0003}
 #studio-mobile-tools #studio-mobile-labels{font-size:11px;font-weight:700}
 #studio-mobile-tools button[aria-pressed=true]{background:#356657}
 .is-walking #studio-mobile-nav{grid-template-columns:1fr}
 .is-walking #studio-mobile-nav #walk-bar{justify-content:center;gap:6px}
 .is-walking #studio-mobile-nav #walk-btn{width:auto;min-width:122px}
 .is-walking #studio-mobile-views-label,.is-walking #studio-mobile-tools,.is-walking #v21-controls{display:none!important}
 .is-walking #walk-help{top:70px;max-width:calc(100% - 20px);font-size:12px;line-height:1.4}
 #walk-pad button{min-width:48px;min-height:48px}
 .menus-ready #left-panel,.menus-ready #right-panel,.menus-ready #studio-menu{z-index:95;width:min(100%,420px);max-height:100%;border:0;box-shadow:0 0 35px #0008;overscroll-behavior:contain}
 .menus-ready .drawer-content,.menus-ready #tree,.menus-ready #areas,.menus-ready #inspector{overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));touch-action:pan-y}
 .menus-ready .drawer-heading,.menus-ready .panel-top{min-height:58px;padding:9px 12px}
 .menus-ready [data-close-drawer]{width:44px;height:44px}
 .menus-ready .studio-mobile-help{display:block;margin:0 0 14px;padding:12px;border:1px solid #476263;border-radius:8px;font-size:13px;line-height:1.6;color:#d5e7e4;background:#19302e}
 .menus-ready button,.menus-ready select,.menus-ready summary,.menus-ready a.studio-portal-link{touch-action:manipulation}
 .menus-ready .studio-drawer button,.menus-ready .studio-drawer summary,.menus-ready .studio-drawer select{min-height:44px}
 .menus-ready .studio-drawer input,.menus-ready .studio-drawer select,.menus-ready .studio-drawer textarea,dialog input,dialog select,dialog textarea{font-size:16px}
 .menus-ready .studio-drawer .tab{min-height:44px}
 .menus-ready #studio-menu #modello3d-link{display:flex;min-height:44px;align-items:center;border:1px solid #415867;border-radius:6px;padding:10px;font-size:13px;text-decoration:none}
 .menus-ready #studio-menu #tools button{width:44px;height:44px}
 #v21-controls{left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));bottom:calc(10px + env(safe-area-inset-bottom,0px));width:auto;max-width:none;z-index:73;border-radius:12px;font-size:12px}
 #v21-controls summary{min-height:48px;display:flex;align-items:center;justify-content:space-between;font-size:12px;padding:12px}
 #v21-controls .v21-body{max-height:min(55vh,calc(100dvh - 190px));overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
 #v21-controls .v21-actions button,#v21-controls .v21-tabs button{min-height:44px;font-size:12px;padding:10px}
 #v21-controls .v21-options label{min-height:44px;font-size:12px}
 #v21-controls .v21-options input{width:20px;height:20px}
 dialog{max-width:calc(100vw - 16px)!important;max-height:calc(100dvh - 24px)!important;margin:auto!important;overflow:auto!important;overscroll-behavior:contain;padding:14px!important;font-size:14px}
 dialog button{min-height:44px}
 dialog table{display:block;max-width:100%;overflow-x:auto}
 #toast{left:12px;right:12px;bottom:calc(70px + env(safe-area-inset-bottom,0px));transform:none;max-width:calc(100% - 24px);width:auto;pointer-events:none;font-size:12px}
}
/* Mobile: nessun comando essenziale sul bordo superiore coperto da Chrome iOS.
   La barra resta raggiungibile anche con un menu aperto. */
@media(max-width:760px),(pointer:coarse),(max-width:1000px) and (max-height:540px){
 body.studio-mobile.menus-ready #header{display:none}
 body.studio-mobile.menus-ready #workspace{top:0}
 body.studio-mobile #viewport{position:absolute;top:0;left:0;right:0;bottom:calc(142px + env(safe-area-inset-bottom,0px));height:auto}
 body.studio-mobile #stage-area.is-walking #viewport{bottom:calc(88px + env(safe-area-inset-bottom,0px))}
 body.studio-mobile #studio-mobile-nav{top:auto;bottom:calc(16px + env(safe-area-inset-bottom,0px));left:max(10px,env(safe-area-inset-left));right:max(10px,env(safe-area-inset-right));width:auto;transform:none;z-index:110;grid-template-columns:70px minmax(0,1fr) 68px;gap:8px;padding:10px;border:1px solid #6d9295;border-radius:14px;background:#101e2cf5;box-shadow:0 5px 22px #0006}
 body.studio-mobile #studio-mobile-nav #solo-btn{min-width:0;min-height:46px;padding:6px;font-size:13px;white-space:nowrap;border:1px solid #6d9295;border-radius:9px;background:#244a43;color:#fff}
 body.studio-mobile #studio-mobile-nav #walk-bar{grid-column:2;grid-row:1;min-width:0}
 body.studio-mobile #studio-mobile-tools-toggle{grid-column:3;grid-row:1;min-height:46px;font-size:13px;border:1px solid #6d9295;border-radius:9px;background:#24404b;color:#fff;padding:6px}
 body.studio-mobile #studio-mobile-views-label{grid-column:1/-1;grid-row:2}
 body.studio-mobile #studio-mobile-views{width:100%}
 body.studio-mobile #studio-mobile-tools{bottom:calc(150px + env(safe-area-inset-bottom,0px));display:grid;grid-template-columns:repeat(3,44px);gap:6px;padding:10px;border:1px solid #6d9295;border-radius:12px;background:#101e2cf5;z-index:105}
 body.studio-mobile #studio-mobile-tools[hidden]{display:none!important}
 body.studio-mobile #studio-mobile-tools button{width:44px;min-height:44px}
 body.studio-mobile #studio-mobile-tools [data-view-control=up]{grid-area:1/2}
 body.studio-mobile #studio-mobile-tools [data-view-control=left]{grid-area:2/1}
 body.studio-mobile #studio-mobile-tools [data-view-control=down]{grid-area:2/2}
 body.studio-mobile #studio-mobile-tools [data-view-control=right]{grid-area:2/3}
 body.studio-mobile #studio-mobile-tools [data-view-control=in]{grid-area:3/1}
 body.studio-mobile #studio-mobile-tools [data-view-control=out]{grid-area:3/2}
 body.studio-mobile #studio-mobile-tools [data-view-control=home]{grid-area:3/3}
 body.studio-mobile #studio-mobile-tools #studio-mobile-labels{grid-area:4/1/5/4;width:auto}
 body.studio-mobile #v21-controls:not([open]){display:none}
 body.studio-mobile #v21-controls[open]{bottom:calc(154px + env(safe-area-inset-bottom,0px));max-height:calc(100% - 180px);overflow:auto}
 body.studio-mobile #v21-controls .v21-body{max-height:35vh}
 body.studio-mobile.menus-ready #left-panel,body.studio-mobile.menus-ready #right-panel,body.studio-mobile.menus-ready #studio-menu{top:auto;bottom:calc(154px + env(safe-area-inset-bottom,0px));height:min(60%,480px);max-height:none}
 body.studio-mobile #toast{bottom:calc(150px + env(safe-area-inset-bottom,0px))}
 body.studio-mobile #stage-area.is-walking #studio-mobile-nav{grid-template-columns:76px minmax(0,1fr)}
 body.studio-mobile #stage-area.is-walking #studio-mobile-tools-toggle{display:none}
 body.studio-mobile #stage-area.is-walking #walk-btn{min-width:0;flex:1;font-size:11px;padding:8px 6px}
 body.studio-mobile #stage-area.is-walking .walk-piano{width:48px;min-width:44px;padding:6px 3px;font-size:10px}
 body.studio-mobile #stage-area.is-walking #walk-pad{bottom:calc(104px + env(safe-area-inset-bottom,0px))}
 body.studio-mobile #stage-area.is-walking #walk-help{top:auto;bottom:calc(232px + env(safe-area-inset-bottom,0px));left:12px;right:12px;max-width:none;transform:none}
}
@media(max-height:540px) and (min-width:600px){
 body.studio-mobile #viewport{bottom:calc(86px + env(safe-area-inset-bottom,0px))}
 body.studio-mobile #studio-mobile-nav{left:10px;right:10px;grid-template-columns:70px 130px minmax(0,1fr) 68px;padding:8px;bottom:calc(10px + env(safe-area-inset-bottom,0px))}
 body.studio-mobile #studio-mobile-views-label{grid-column:3;grid-row:1}
 body.studio-mobile #studio-mobile-tools-toggle{grid-column:4}
 body.studio-mobile #studio-mobile-tools{bottom:90px}
 body.studio-mobile #v21-controls[open]{bottom:90px}
 body.studio-mobile.menus-ready #left-panel,body.studio-mobile.menus-ready #right-panel,body.studio-mobile.menus-ready #studio-menu{bottom:90px}
 body.studio-mobile #stage-area.is-walking #studio-mobile-nav{left:10px;right:auto;width:355px;grid-template-columns:76px minmax(0,1fr)}
 body.studio-mobile #stage-area.is-walking #walk-pad{bottom:20px;left:auto;right:14px;transform:none}
 body.studio-mobile #stage-area.is-walking #walk-help{bottom:100px}
}
@media(max-height:540px) and (min-width:600px){
 #studio-mobile-nav{right:auto;width:350px}
 .is-walking #studio-mobile-nav{left:50%;transform:translateX(-50%);width:330px}
 #v21-controls{right:auto;width:285px;max-width:40vw}
 #studio-mobile-tools{bottom:14px;display:flex}
 #v21-controls .v21-body{max-height:calc(100dvh - 140px)}
 .is-walking #walk-help{top:62px;font-size:11px;padding:5px 8px;max-width:60%}
}
@media(max-width:760px),(pointer:coarse),(max-width:1000px) and (max-height:540px){
 html{background:#edf2f5;color-scheme:light}
 body.studio-mobile{--bg:#edf2f5;--panel:#fff;--panel2:#f1f6f8;--text:#172e3a;--muted:#485e6b;--border:#9aafb9;--mint:#19664f;background:#edf2f5;color:#172e3a;color-scheme:light}
 body.studio-mobile #stage-area,body.studio-mobile #viewport{background:#e4ebef}
 body.studio-mobile #studio-mobile-nav,body.studio-mobile #studio-mobile-tools{background:#fff;border-color:#8ca5b0;box-shadow:0 3px 16px #16334226;color:#172e3a}
 body.studio-mobile #studio-mobile-nav #solo-btn,body.studio-mobile #studio-mobile-tools-toggle{background:#e0eee9;color:#173c32;border-color:#779e91;font-weight:700}
 body.studio-mobile #studio-mobile-views-label{grid-column:1/3}
 body.studio-mobile #studio-mobile-model-btn{grid-column:3;grid-row:2;min-height:46px;padding:8px;border:1px solid #7696a9;border-radius:9px;background:#dcebf5;color:#143a55;font-size:15px;font-weight:700}
 body.studio-mobile #studio-mobile-views{background:#f1f6f8;color:#173444;border-color:#849faa;box-shadow:none}
 body.studio-mobile #studio-mobile-views option{background:#fff;color:#173444}
 body.studio-mobile #studio-mobile-nav #walk-btn{background:#e0eee9;color:#173c32;border-color:#779e91;box-shadow:none}
 body.studio-mobile #studio-mobile-nav #walk-btn.on{background:#f8e5dd;color:#6c2819;border-color:#ba8c7b}
 body.studio-mobile #studio-mobile-nav .walk-piano{background:#f1f6f8;color:#173444;border-color:#849faa;box-shadow:none}
 body.studio-mobile #studio-mobile-tools button{background:#f1f6f8;color:#173444;border-color:#849faa;box-shadow:none}
 body.studio-mobile #studio-mobile-tools button[aria-pressed=true]{background:#1e6654;color:#fff;border-color:#1e6654}
 body.studio-mobile #walk-pad button{background:#fff;color:#174736;border-color:#6b9388;box-shadow:0 2px 8px #1633422b}
 body.studio-mobile #walk-pad button[data-pressed]{background:#d5ede3;color:#113e30}
 body.studio-mobile #walk-help{background:#fff;color:#233d4a;border:1px solid #93aab5}
 body.studio-mobile.menus-ready #left-panel,body.studio-mobile.menus-ready #right-panel,body.studio-mobile.menus-ready #studio-menu{background:#fff;color:#172e3a;border:1px solid #91a8b4;box-shadow:0 3px 22px #18374630}
 body.studio-mobile.menus-ready .drawer-heading,body.studio-mobile.menus-ready .panel-top{background:#edf3f6;border-color:#a4b7c0;color:#172e3a}
 body.studio-mobile.menus-ready .drawer-heading h2,body.studio-mobile.menus-ready .menu-section summary{color:#172e3a}
 body.studio-mobile.menus-ready .drawer-help,body.studio-mobile.menus-ready .drawer-content p,body.studio-mobile.menus-ready .eyebrow{color:#435b69}
 body.studio-mobile.menus-ready .studio-mobile-help{background:#edf5f2;border-color:#9ab8aa;color:#224637;font-size:14px}
 body.studio-mobile.menus-ready .studio-drawer button,body.studio-mobile.menus-ready .studio-drawer .chip,body.studio-mobile.menus-ready .studio-drawer select,body.studio-mobile.menus-ready .studio-drawer input,body.studio-mobile.menus-ready .studio-drawer textarea,body.studio-mobile.menus-ready .studio-drawer a{background:#f1f6f8;color:#173444;border-color:#849faa}
 body.studio-mobile.menus-ready .studio-drawer .chip,body.studio-mobile.menus-ready .drawer-shortcuts button,body.studio-mobile.menus-ready .menu-section summary{font-size:13px}
 body.studio-mobile.menus-ready .menu-section{border-color:#adbec7}
 body.studio-mobile.menus-ready .studio-drawer button[aria-pressed=true],body.studio-mobile.menus-ready .studio-drawer button.active{background:#1e6654;color:#fff}
 body.studio-mobile #v21-controls{background:#fff;color:#172e3a;border-color:#91a8b4}
 body.studio-mobile #v21-controls button,body.studio-mobile #v21-controls select{background:#f1f6f8;color:#173444;border-color:#849faa}
 body.studio-mobile #v21-controls #v21-message,body.studio-mobile #v21-controls summary span{color:#435b69}
 body.studio-mobile #v21-controls button.active{background:#1e6654;color:#fff}
 body.studio-mobile #toast{background:#edf5f2;color:#224637;border-color:#9ab8aa}
 body.studio-mobile #stage-area.is-walking #studio-mobile-model-btn{display:none}
 body.studio-mobile dialog{background:#fff;color:#172e3a;border-color:#91a8b4}
}
@media(max-height:540px) and (min-width:600px){
 body.studio-mobile #studio-mobile-nav{grid-template-columns:70px 130px minmax(0,1fr) 62px 52px}
 body.studio-mobile #studio-mobile-views-label{grid-column:3;grid-row:1}
 body.studio-mobile #studio-mobile-tools-toggle{grid-column:4}
 body.studio-mobile #studio-mobile-model-btn{grid-column:5;grid-row:1}
}
