/* The studio has one scene and one independently scrolling selection sheet. */
html:has(body.studio-mode){height:var(--app-height,100dvh);overflow:hidden;scroll-padding:0}
body.studio-mode{
  --studio-accent:#2d95ff;
  --studio-accent-soft:#b7e2ff;
  --studio-border:rgba(164,197,225,.16);
  --studio-bottom-height:180px;
  height:var(--app-height,100dvh);
  min-height:0;
  padding:0;
  overflow:hidden;
  background:#13182d;
  color:#f5f8ff;
}
body.studio-mode button{transition:background .16s,border-color .16s,color .16s,box-shadow .16s;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
body.studio-mode button:focus-visible,body.studio-mode input:focus-visible,body.studio-mode summary:focus-visible{outline:2px solid #70c6ff;outline-offset:3px}
body.studio-mode button:disabled{cursor:not-allowed;opacity:.42}
body.studio-mode button:active:not(:disabled){transform:translateY(1px)}
body.studio-mode [hidden]{display:none!important}
body.studio-mode .studio-header{
  position:absolute;
  inset:0 var(--safe-right) auto var(--safe-left);
  height:calc(60px + var(--safe-top));
  min-height:0;
  padding:calc(10px + var(--safe-top)) 16px 10px;
  z-index:20;
  border:0;
  background:linear-gradient(#13182ded,#13182d80 74%,transparent);
  visibility:visible;
  pointer-events:auto;
}
body.studio-mode .studio-header .brand{gap:9px;font-size:12px;letter-spacing:.1em;white-space:nowrap}
body.studio-mode .studio-header .brand-logo{flex:none;width:34px;height:34px;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
body.studio-mode .studio-header .brand-logo img{display:block;width:100%;height:100%;object-fit:contain;transform:none}
body.studio-mode .studio-header .brand span:not(.brand-logo){color:#e1f2ff}
body.studio-mode #language.language-switch{margin:0;padding:3px;border-radius:12px;background:#212638cc;border-color:var(--studio-border);box-shadow:0 3px 15px #0002}
body.studio-mode #language button{min-height:32px;padding:5px 10px;font-size:11px;letter-spacing:.02em;border-radius:8px}
body.studio-mode #language button[aria-pressed=true]{background:#268df6;box-shadow:0 2px 8px #268df63d}
body.studio-mode .studio-main{position:fixed;inset:0;display:block;height:var(--app-height,100dvh);min-height:0;max-width:none;width:100%;margin:0;padding:0;overflow:hidden}
body.studio-mode .studio-main .stage.card,
body.studio-mode.preview-expanded .studio-main .stage.card{
  position:absolute;inset:0;z-index:0;display:block;max-width:none;height:auto;min-height:0;margin:0;padding:0;overflow:hidden;border:0;border-radius:0;background:radial-gradient(ellipse at 50% 37%,#212638 0,#1a2035 38%,#13182d 73%);
}
body.studio-mode .stage-head{position:absolute;top:calc(68px + var(--safe-top));left:calc(18px + var(--safe-left));right:calc(18px + var(--safe-right));z-index:12;min-height:34px;gap:10px;margin:0;align-items:center}
body.studio-mode .stage-head h1,body.studio-mode.preview-expanded .stage-head h1{flex:1;min-width:0;margin:0;font-size:14px;line-height:1.3;font-weight:650;letter-spacing:-.015em;color:#d8dbe6;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.studio-mode .stage-tools{flex:none;gap:5px}
body.studio-mode .stage-tools .icon{width:34px;height:34px;padding:7px;display:grid;place-items:center;background:#202840a6;border:1px solid var(--studio-border);border-radius:11px;color:#a5aec2;font-size:21px;box-shadow:0 3px 12px #0001}
body.studio-mode .stage-tools .icon svg{width:18px;height:18px;stroke-width:1.7}
body.studio-mode .stage-tools #resetAll{color:#9bd2f3}
body.studio-mode .stage-tools #previewExpand[aria-pressed=true]{background:#1a4161;border-color:#3f8bc0;color:#c8edff}
body.studio-mode .stage #viewport,
body.studio-mode.pack-mode .stage #viewport,
body.studio-mode.preview-expanded .stage #viewport{
  position:absolute;top:calc(108px + var(--safe-top));bottom:calc(var(--studio-bottom-height) + 10px + var(--safe-bottom));left:var(--safe-left);right:var(--safe-right);width:auto;height:auto;min-height:0;max-height:none;flex:none;border:0;border-radius:0;overflow:hidden;background:transparent;
}
body.studio-mode #viewport canvas{width:100%;height:100%;display:block;touch-action:none;position:relative;z-index:1}
body.studio-mode #viewport .clan-backdrop{width:min(65%,420px);max-height:75%;object-fit:contain}
body.studio-mode #viewport .clan-banner{position:absolute;z-index:0;left:calc(50% + var(--banner-left));top:var(--banner-top);width:var(--banner-width);aspect-ratio:4/5;transform:rotate(var(--banner-angle));transform-origin:top center;pointer-events:none;filter:drop-shadow(0 10px 13px #0005)}
body.studio-mode #viewport .clan-banner[hidden]{display:none}
body.studio-mode #viewport .clan-banner svg{display:block;width:100%;height:100%}
body.studio-mode #status{position:absolute;top:calc(106px + var(--safe-top));left:20px;right:20px;z-index:15;width:max-content;max-width:calc(100% - 40px);min-height:0;margin:0 auto;padding:8px 12px;border:1px solid var(--studio-border);border-radius:12px;background:#212b42d9;backdrop-filter:blur(12px);color:#c5c8d8;font-size:11px;line-height:1.4;text-align:center;box-shadow:0 5px 24px #0003}
body.studio-mode .studio-bottom{
  position:absolute;z-index:15;bottom:calc(10px + var(--safe-bottom));left:calc(12px + var(--safe-left));right:calc(12px + var(--safe-right));width:auto;max-width:580px;margin:0 auto;padding:10px;display:flex;flex-direction:column;gap:8px;border:1px solid var(--studio-border);border-radius:23px;background:linear-gradient(145deg,#212638e8,#1b2238ef);box-shadow:0 10px 45px #0004,inset 0 1px 0 #ffffff06;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);transition:opacity .16s,transform .2s;
}
body.studio-mode .studio-bottom .actions,body.studio-mode.pack-mode .studio-bottom .actions,body.studio-mode.preview-expanded .studio-bottom .actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;flex:none;margin:0}
body.studio-mode .studio-bottom .actions>button{min-width:0;height:38px;min-height:38px;margin:0;padding:6px 4px;font-size:11px;font-weight:600;white-space:nowrap;background:#131c31b8;border:1px solid #383e514a;border-radius:11px;color:#c5ccda}
body.studio-mode .studio-bottom #png{color:#bce6ff;grid-column:2;background:#20354f75}
body.studio-mode .studio-bottom .actions .visual-picker-control{display:none}
body.studio-mode .studio-bottom .actions .visual-picker-button{height:38px;min-height:38px;grid-template-columns:25px minmax(0,1fr) 15px;gap:5px;padding:3px 7px;background:#131c31b8;border:1px solid #383e514a;border-radius:11px;font-size:11px}
body.studio-mode .studio-bottom .actions .picker-current-thumb{width:24px;height:28px;border:0;border-radius:6px;background:#121b30}
body.studio-mode .studio-bottom .actions .picker-current-name{font-size:11px;line-height:1.2}
body.studio-mode .studio-bottom .actions .picker-arrow{width:15px;height:15px}
body.studio-mode .studio-bottom .actions .picker-arrow svg{width:15px;height:15px}
body.studio-mode .studio-bottom .actions .picker-clear{right:2px;width:27px;height:30px}
body.studio-mode .studio-bottom .actions .picker-clear svg{width:16px;height:16px}
body.studio-mode .studio-bottom .actions .visual-picker-control:has(.picker-clear:not([hidden])) .visual-picker-button{padding-right:28px}
body.studio-mode .studio-dock{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;margin:0;padding:0}
body.studio-mode .studio-dock>button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;min-height:58px;padding:7px 2px 6px;background:transparent;border:1px solid transparent;border-radius:13px;color:#959eb2;box-shadow:none}
body.studio-mode .studio-dock>button img{display:block;width:23px;height:23px;object-fit:contain;opacity:.77;transition:opacity .16s,transform .16s}
body.studio-mode .studio-dock .category-label{display:block;width:100%;min-width:0;font-size:9px;line-height:1.2;font-weight:600;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.studio-mode .studio-dock>button.selected{border-color:#2d95ff50;background:linear-gradient(145deg,#2d95ff26,#2d95ff13);color:#d6eeff}
body.studio-mode .studio-dock>button.selected img{opacity:1;transform:translateY(-1px)}
body.studio-mode .studio-dock>button[data-studio-picker=weapon] img{transform:translateY(-3px)}
body.studio-mode .studio-dock>button[data-studio-picker=weapon].selected img{transform:translateY(-4px)}
body.studio-mode .studio-dock>button[data-studio-picker=clan] img{filter:brightness(0) invert(1)}
body.studio-mode .dock-lock{position:absolute;top:3px;right:5px;display:grid;place-items:center;width:13px;height:13px;border-radius:4px;background:#164461;color:#c0e6ff}
body.studio-mode .dock-lock svg{width:11px;height:11px;fill:none;stroke:currentColor;stroke-width:1.7}
body.studio-mode .studio-build-row{display:grid;grid-template-columns:minmax(96px,.82fr) minmax(0,1.8fr);gap:8px;align-items:stretch}
body.studio-mode #randomDockSlot{min-width:0;display:flex}
body.studio-mode #randomDockSlot #outfitRandom{width:100%;height:42px;min-height:42px;display:flex;align-items:center;justify-content:center;gap:8px;margin:0;padding:8px 9px;border-radius:12px;border:1px solid #2d7dba69;background:#17395884;color:#b9e2ff;font-size:12px;font-weight:650}
body.studio-mode #randomDockSlot #outfitRandom svg{width:19px;height:19px;stroke-width:1.5;flex:none}
body.studio-mode .studio-pack-open.primary{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;height:42px;min-height:42px;margin:0;padding:8px 12px;border:1px solid #4baaff;background:linear-gradient(115deg,#268fff,#14a1c3);border-radius:12px;font-size:12px;line-height:1.1;font-weight:750;box-shadow:0 4px 18px #178cdd2b}
body.studio-mode .studio-pack-open>img{width:19px;height:19px;object-fit:contain;flex:none}
body.studio-mode.studio-picker-open .studio-bottom,body.studio-mode.studio-settings-open .studio-bottom{opacity:0;visibility:hidden;pointer-events:none}
body.studio-mode .studio-settings{position:fixed;inset:0;z-index:45;display:flex;align-items:flex-end;justify-content:center;pointer-events:none}
body.studio-mode .studio-settings-backdrop{position:absolute;inset:0;background:#00000008;border:0;border-radius:0;padding:0;backdrop-filter:none;pointer-events:none}
body.studio-mode .studio-settings-backdrop:active{transform:none}
body.studio-mode .studio-settings-panel.card{
  position:relative;width:100%;height:calc(var(--app-height,100dvh) * .6);max-height:calc(var(--app-height,100dvh) - var(--safe-top) - 125px);min-height:0;display:flex;flex-direction:column;gap:12px;margin:0;padding:14px max(14px,var(--safe-right)) calc(16px + var(--safe-bottom)) max(14px,var(--safe-left));overflow:hidden;visibility:visible;pointer-events:auto;border:1px solid #8295ad45;border-bottom:0;border-radius:24px 24px 0 0;background:linear-gradient(145deg,#25304a80,#1b223895);box-shadow:0 -10px 40px #0003;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
}
body.studio-mode .studio-settings-head{flex:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:30px}
body.studio-mode .studio-settings-head strong{font-size:16px;letter-spacing:-.015em}
body.studio-mode .studio-settings-head button{width:32px;height:32px;padding:0;display:grid;place-items:center;background:#ffffff07;border-color:#a1a5c426;border-radius:10px;color:#bbc0d2}
body.studio-mode .studio-settings-panel .editor-tabs{display:none}
body.studio-mode .studio-settings-panel .editor-panel{flex:1 1 0;min-width:0;min-height:0;display:grid;align-content:start;gap:12px;overflow:auto;overscroll-behavior:contain;overflow-anchor:none;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:1px 2px 24px;scroll-padding-bottom:24px;scrollbar-width:thin;scrollbar-color:#557da470 transparent}
body.studio-mode .studio-settings-panel .editor-panel[data-panel=look]{grid-template-columns:1fr}
body.studio-mode .studio-settings-panel .editor-panel[data-panel=pack]{order:1;display:block;flex:1 1 0;overflow:auto;padding-bottom:20px}
body.studio-mode .studio-settings-panel .editor-panel[data-panel=pack] .pack-dances{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;min-height:0;overflow:visible;padding:2px 0 8px;flex:none}
body.studio-mode .studio-settings-panel label{font-size:12px;color:#b8c8d9;gap:6px}
body.studio-mode .studio-settings-panel .picker-label-row{height:28px}
body.studio-mode .studio-settings-panel .visual-picker-button{min-height:48px;border-radius:12px;background:#19263db5;border-color:#52698346;grid-template-columns:34px minmax(0,1fr) auto;gap:8px;padding:6px 9px;font-size:12px}
body.studio-mode .studio-settings-panel .picker-current-thumb{width:32px;height:34px;border-radius:8px}
body.studio-mode .studio-settings-panel .random-lock{width:28px;height:28px;border-radius:9px;background:#25334ab0}
body.studio-mode .studio-settings-panel .random-lock[aria-pressed=true]{background:#173d5b;border-color:#2d95ff88;color:#bce8ff}
body.studio-mode .studio-settings-panel input[type=range]{width:100%;min-height:32px;margin:3px 0;accent-color:#299bff;touch-action:pan-x}
body.studio-mode .studio-settings-panel input[type=checkbox]{accent-color:#299bff;width:17px;height:17px;margin:0 5px 0 0}
body.studio-mode .studio-settings-panel details{display:block;padding-top:13px;margin-top:2px;border-color:#7c8ea426}
body.studio-mode .studio-settings-panel summary{font-size:12px;font-weight:650;line-height:1.4;padding:3px 0 9px}
body.studio-mode .studio-settings-panel details label+label{margin-top:10px}
body.studio-mode .studio-settings-panel #clanOptions{gap:13px}
body.studio-mode .studio-settings[data-panel=pack] .studio-settings-head strong{display:flex;align-items:center;gap:9px}
body.studio-mode .studio-settings[data-panel=pack] .studio-settings-head strong::before{content:'';display:block;width:19px;height:19px;background:url('/icons/pack.png') center/contain no-repeat;flex:none}
body.studio-mode .studio-settings-panel #packFooter{position:static;order:3;flex:none;display:flex;gap:9px;margin:0;padding:11px;border:1px solid #9cb3cb2a;border-radius:17px;background:#1d2a4345;box-shadow:inset 0 1px 0 #ffffff05}
body.studio-mode .studio-settings-panel .pack-heading strong{font-size:13px;font-weight:650;letter-spacing:-.015em;color:#e1edf6}
body.studio-mode .studio-settings-panel #packCount{font-size:10px;font-weight:700;line-height:1.2;padding:5px 8px;border:1px solid #2d95ff36;border-radius:9px;background:#1d79b725;color:#bfe8ff}
body.studio-mode .studio-settings-panel .pack-select-actions{gap:7px;flex-wrap:wrap}
body.studio-mode .studio-settings-panel .pack-select-actions button{flex:1;padding:7px 8px;min-height:33px;font-size:10px;border-radius:10px;background:#1b28405c;border-color:#8ba5bf32;color:#bacadd}
body.studio-mode .studio-settings-panel #telegramPack.primary{position:static;min-height:44px;margin:0;padding:11px;font-size:12px;border:1px solid #68bfff5c;border-radius:11px;background:linear-gradient(115deg,#268fffd9,#14a1c3da);box-shadow:0 3px 15px #178cdd20}
body.studio-mode .studio-settings-panel #packFooter>.small{display:none}
body.studio-mode .studio-settings-panel .pack-limit-note{font-size:10px;line-height:1.35}
body.studio-mode .studio-settings-panel .pack-result{min-height:36px;margin:0;padding:8px 10px;font-size:11px;border-radius:10px;border-color:#8caac436;background:#1b284055;color:#c3d8ea}
body.studio-mode .studio-settings-panel .pack-result a{font-size:10px;color:#94daff}
body.studio-mode .studio-settings[data-panel=pack] .studio-settings-panel{height:calc(var(--app-height,100dvh) * .72)}
body.studio-mode .studio-settings-panel .pack-mode-switch{padding:3px;border-color:#8ba5bf32;background:#15223870}
body.studio-mode .studio-settings-panel .pack-mode-switch label{min-height:34px;padding:6px 4px;font-size:11px;line-height:1.2;color:#afc4d8}
body.studio-mode .studio-settings-panel .pack-mode-switch label:has(input:checked){background:#22547b99;border-color:#2d95ff70;color:#d8f0ff}
body.studio-mode .studio-settings-panel .pack-mode-switch label:has(input:focus-visible){outline-color:#70c6ff}
body.studio-mode .studio-settings-panel .pack-mode-hint,body.studio-mode .studio-settings-panel .pack-presence-note{font-size:10px;line-height:1.35;color:#91aec6}
body.studio-mode .studio-settings-panel .pack-presence-note[data-presence=missing]{color:#e0c38b}
body.studio-mode .studio-settings-panel .pack-dance{min-height:52px;gap:4px;padding:7px;background:#1d2a4360;border-radius:12px;outline:0;border:1px solid #93a9bd22;box-shadow:inset 0 1px 0 #ffffff03}
body.studio-mode .studio-settings-panel .pack-dance:has(input:checked){background:#194e7557;border-color:#2d95ff9c;box-shadow:inset 0 0 0 1px #2d95ff12}
body.studio-mode .studio-settings-panel .pack-dance label{gap:5px;min-width:0}
body.studio-mode .studio-settings-panel .pack-dance input{width:16px;height:16px;flex:none;margin:0;accent-color:#299bff}
body.studio-mode .studio-settings-panel .pack-dance img{width:24px;height:30px;flex:none;filter:drop-shadow(0 2px 3px #0003)}
body.studio-mode .studio-settings-panel .pack-dance span{font-size:12px;line-height:1.25;color:#d8e5f0}
body.studio-mode .studio-settings-panel .dance-preview{min-width:27px;min-height:31px;width:27px;padding:3px;border:1px solid #70b9e62b;border-radius:9px;background:#1e79b716;color:#abe1ff;font-size:10px}
body.studio-mode .studio-settings-panel .profile-sync-status{order:4;font-size:9px;line-height:1.3;min-height:12px;flex:none;margin:0;color:#8eacc5}
body.studio-mode .picker-sheet{z-index:50;padding:0;align-items:flex-end;justify-content:center;pointer-events:none}
body.studio-mode .picker-backdrop{background:#00000008;backdrop-filter:none;pointer-events:none}
body.studio-mode .picker-panel{
  width:100%;height:calc(var(--app-height,100dvh) * .52);max-height:calc(var(--app-height,100dvh) - var(--safe-top) - 125px);min-height:0;margin:0;padding:14px max(14px,var(--safe-right)) calc(14px + var(--safe-bottom)) max(14px,var(--safe-left));gap:10px;border:1px solid #8295ad45;border-bottom:0;border-radius:24px 24px 0 0;background:linear-gradient(145deg,#25334d80,#1b223895);box-shadow:0 -10px 40px #0003;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);overflow:hidden;pointer-events:auto;
}
body.studio-mode .picker-head{flex:none;min-height:30px}
body.studio-mode .picker-head strong{font-size:16px;font-weight:750;letter-spacing:-.02em}
body.studio-mode .picker-head button{width:32px;height:32px;padding:0;display:grid;place-items:center;background:#ffffff07;border-color:#a1a5c426;border-radius:10px;color:#bbc0d2}
body.studio-mode .picker-search{flex:none;min-height:38px;padding:9px 12px;font-size:12px;border-radius:11px;background:#18253db3;border-color:#5269834d;color:#edf5fb}
body.studio-mode .picker-search::placeholder{color:#8e95a9}
body.studio-mode .picker-grid{flex:1 1 0;min-width:0;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:7px;overflow-y:auto;overscroll-behavior:contain;overflow-anchor:none;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:2px 2px 12px;scroll-padding-bottom:12px;scrollbar-width:thin;scrollbar-color:#557da470 transparent}
body.studio-mode .picker-item{min-height:56px;gap:7px;padding:6px 7px;background:#1d2a4360;border:1px solid #9a98b12a;border-radius:12px;color:#d4e1ec}
body.studio-mode .picker-item .picker-thumb{width:36px;height:40px;border:0;border-radius:8px;background:#121b31a6;flex:none}
body.studio-mode .picker-item span{font-size:12px;line-height:1.25;min-width:0}
body.studio-mode .picker-item.selected{background:#16476666;border-color:#2d95ffc4;color:#ebf7ff;box-shadow:inset 0 0 0 1px #2d95ff1f}
body.studio-mode .picker-tools{flex:none;display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap;margin:0;padding-top:1px}
body.studio-mode .picker-tool{min-height:33px;padding:7px 9px;font-size:10px;font-weight:600;line-height:1.2;border-radius:10px;background:#26334bba;border-color:#5266844a;color:#c1c8d9;display:flex;align-items:center;justify-content:center;gap:6px}
body.studio-mode .picker-tool svg{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
body.studio-mode .picker-tool img{width:15px;height:15px;object-fit:contain;flex:none}
body.studio-mode .picker-tool[aria-pressed=true]{background:#164764;border-color:#2d95ff8a;color:#c3e9ff}
body.studio-mode .picker-tool:disabled{display:none}
body.studio-mode #outfitPreviewControls{position:absolute;top:calc(112px + var(--safe-top));left:16px;right:16px;z-index:15;width:max-content;max-width:calc(100% - 32px);margin:0 auto;padding:9px;border:1px solid var(--studio-border);border-radius:12px;background:#192740e8;backdrop-filter:blur(12px)}
body.studio-mode #resetDialog{background:#212b42;border-color:#38678b;border-radius:22px;box-shadow:0 22px 80px #0007}
body.studio-mode #resetDialog::backdrop{background:#050710a6;backdrop-filter:blur(8px)}
body.studio-mode #resetDialog button{background:#192a42;border-color:#527394;color:#e7f4ff}
body.studio-mode #resetDialog .confirm-reset{background:linear-gradient(115deg,#268fff,#14a1c3);border-color:#4baaff;color:#fff}
body.studio-mode .picker-clear:hover{color:#eff9ff;background:#24446675}
@media(hover:hover){
  body.studio-mode .stage-tools .icon:hover,body.studio-mode .studio-bottom .actions>button:hover{background:#252b3d;border-color:#4394d070;color:#e6f4ff}
  body.studio-mode .studio-dock>button:hover{background:#ffffff06;color:#cde5f6}
  body.studio-mode .studio-dock>button:hover img{opacity:1}
  body.studio-mode #randomDockSlot #outfitRandom:hover{background:#214c72c4;border-color:#56b1f188}
  body.studio-mode .studio-pack-open.primary:hover{background:linear-gradient(115deg,#3ea1ff,#23b4d0);box-shadow:0 4px 22px #178cdd4d}
  body.studio-mode .picker-item:hover{border-color:#2d95ff6e;background:#20364e}
  body.studio-mode .picker-tool:hover{border-color:#2d95ff80;color:#e9f8ff}
}
@media(min-width:821px){
  body.studio-mode{--studio-bottom-height:188px}
  body.studio-mode .studio-header{height:calc(72px + var(--safe-top));padding:calc(17px + var(--safe-top)) 28px 17px}
  body.studio-mode .studio-header .brand{font-size:14px;gap:11px}
  body.studio-mode .studio-header .brand-logo{width:38px;height:38px}
  body.studio-mode #language button{min-height:33px;padding:5px 12px;font-size:12px}
  body.studio-mode .stage-head{top:calc(83px + var(--safe-top));left:30px;right:30px}
  body.studio-mode .stage-head h1{font-size:17px}
  body.studio-mode .stage-tools .icon{width:38px;height:38px;border-radius:12px}
  body.studio-mode .stage-tools .icon svg{width:20px;height:20px}
  body.studio-mode .stage #viewport,body.studio-mode.pack-mode .stage #viewport,body.studio-mode.preview-expanded .stage #viewport{top:calc(126px + var(--safe-top));bottom:calc(var(--studio-bottom-height) + 16px + var(--safe-bottom));left:24px;right:24px}
  body.studio-mode .studio-bottom{bottom:calc(20px + var(--safe-bottom));padding:11px 13px;max-width:580px;gap:9px;border-radius:25px}
  body.studio-mode .studio-bottom .actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.studio-mode .studio-bottom .actions>button,body.studio-mode .studio-bottom .actions .picker-current-name{font-size:12px}
  body.studio-mode .studio-dock{gap:7px}
  body.studio-mode .studio-dock>button{min-height:61px}
  body.studio-mode .studio-dock>button img{width:25px;height:25px}
  body.studio-mode .studio-dock .category-label{font-size:10px}
  body.studio-mode .studio-build-row{grid-template-columns:1fr 1.8fr}
  body.studio-mode #randomDockSlot #outfitRandom,body.studio-mode .studio-pack-open.primary{height:44px;font-size:13px}
  body.studio-mode.studio-picker-open .studio-bottom,body.studio-mode.studio-settings-open .studio-bottom{opacity:1;transform:none;visibility:visible;pointer-events:auto}
  body.studio-mode .picker-sheet,body.studio-mode .studio-settings{justify-content:flex-end;align-items:center;padding:calc(78px + var(--safe-top)) 22px calc(22px + var(--safe-bottom))}
  body.studio-mode .picker-backdrop,body.studio-mode .studio-settings-backdrop{background:#0000000a}
  body.studio-mode .picker-panel,body.studio-mode .studio-settings-panel.card{width:390px;height:100%;max-height:720px;min-height:0;margin:0;padding:17px;border:1px solid #8295ad45;border-radius:24px;box-shadow:-10px 15px 45px #0003;background:linear-gradient(145deg,#25334d80,#1b223895)}
  body.studio-mode .picker-grid{gap:8px}
  body.studio-mode .picker-item{min-height:64px;padding:8px;gap:8px}
  body.studio-mode .picker-item .picker-thumb{width:42px;height:46px}
  body.studio-mode .picker-item span{font-size:12px}
  body.studio-mode .picker-tool{font-size:11px;min-height:35px}
  body.studio-mode .studio-settings-panel .pack-dance{min-height:55px}
  body.studio-mode .studio-settings-panel .pack-dance span{font-size:12px}
  body.studio-mode .studio-settings-panel .editor-panel{padding-bottom:14px}
}
@media(max-width:360px){
  body.studio-mode .studio-header{padding-right:12px;padding-left:12px}
  body.studio-mode .studio-header .brand{font-size:11px;gap:7px}
  body.studio-mode .studio-header .brand-logo{width:31px;height:31px}
  body.studio-mode #language button{padding:5px 8px;font-size:10px}
  body.studio-mode .stage-head{left:14px;right:14px;gap:5px}
  body.studio-mode .stage-head h1{font-size:12px}
  body.studio-mode .stage-tools{gap:4px}
  body.studio-mode .stage-tools .icon{width:31px;height:31px;padding:6px}
  body.studio-mode .studio-bottom{left:8px;right:8px;padding:9px;gap:7px;border-radius:20px}
  body.studio-mode .studio-bottom .actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
  body.studio-mode .studio-bottom .actions>button,body.studio-mode .studio-bottom .actions .picker-current-name{font-size:10px}
  body.studio-mode .studio-dock{gap:2px}
  body.studio-mode .studio-dock>button{min-height:57px;gap:5px;padding-left:1px;padding-right:1px}
  body.studio-mode .studio-dock>button img{width:21px;height:21px}
  body.studio-mode .studio-dock .category-label{font-size:8px}
  body.studio-mode #randomDockSlot #outfitRandom,body.studio-mode .studio-pack-open.primary{font-size:11px;gap:6px;padding-left:7px;padding-right:7px}
  body.studio-mode .picker-panel,body.studio-mode .studio-settings-panel.card{padding-left:11px;padding-right:11px;gap:8px}
  body.studio-mode .picker-item{padding:6px 5px;gap:5px;min-height:54px}
  body.studio-mode .picker-item .picker-thumb{width:31px;height:37px}
  body.studio-mode .picker-item span{font-size:11px}
  body.studio-mode .picker-tool{font-size:9px;padding:7px;gap:4px}
  body.studio-mode .studio-settings-panel .pack-dance{padding:6px 4px;gap:2px}
  body.studio-mode .studio-settings-panel .pack-dance label{gap:3px}
  body.studio-mode .studio-settings-panel .pack-dance span{font-size:10px}
  body.studio-mode .studio-settings-panel .pack-dance img{width:19px}
  body.studio-mode .studio-settings-panel .dance-preview{min-width:20px;width:20px}
}
@media(max-width:820px) and (max-height:680px){
  body.studio-mode{--studio-bottom-height:173px}
  body.studio-mode .studio-header{height:calc(54px + var(--safe-top));padding-top:calc(7px + var(--safe-top));padding-bottom:7px}
  body.studio-mode .stage-head{top:calc(58px + var(--safe-top))}
  body.studio-mode .stage #viewport,body.studio-mode.pack-mode .stage #viewport,body.studio-mode.preview-expanded .stage #viewport{top:calc(96px + var(--safe-top))}
  body.studio-mode .studio-bottom{gap:6px;bottom:calc(8px + var(--safe-bottom));padding-top:8px;padding-bottom:8px}
  body.studio-mode .studio-bottom .actions>button,body.studio-mode .studio-bottom .actions .visual-picker-button{height:36px;min-height:36px}
  body.studio-mode .studio-dock>button{min-height:54px}
  body.studio-mode #randomDockSlot #outfitRandom,body.studio-mode .studio-pack-open.primary{height:40px;min-height:40px}
  body.studio-mode .picker-panel,body.studio-mode .studio-settings-panel.card{max-height:calc(var(--app-height,100dvh) - var(--safe-top) - 125px)}
  body.studio-mode .picker-panel{height:calc(var(--app-height,100dvh) * .54)}
}
@media(max-width:820px) and (max-height:470px) and (orientation:landscape){
  body.studio-mode .studio-header .brand{font-size:10px}
  body.studio-mode .studio-header .brand-logo{width:28px;height:28px}
  body.studio-mode .stage-head{top:calc(52px + var(--safe-top))}
  body.studio-mode .stage-head h1{display:none}
  body.studio-mode .stage-tools{margin-left:auto}
  body.studio-mode .stage #viewport,body.studio-mode.pack-mode .stage #viewport,body.studio-mode.preview-expanded .stage #viewport{top:calc(54px + var(--safe-top));bottom:calc(10px + var(--safe-bottom));right:330px}
  body.studio-mode .studio-bottom{left:auto;right:10px;width:300px;max-width:none;bottom:calc(12px + var(--safe-bottom))}
  body.studio-mode .picker-panel,body.studio-mode .studio-settings-panel.card{width:330px;height:calc(var(--app-height,100dvh) - var(--safe-top) - 68px);max-height:none;border-radius:20px}
  body.studio-mode .picker-sheet,body.studio-mode .studio-settings{align-items:flex-end;justify-content:flex-end;padding:calc(60px + var(--safe-top)) 8px calc(8px + var(--safe-bottom))}
}
@media(max-width:820px) and (max-height:520px) and (orientation:portrait){
  body.studio-mode .picker-panel,body.studio-mode .studio-settings-panel.card{height:calc(var(--app-height,100dvh) - var(--safe-top) - 145px);max-height:none;padding-top:10px;padding-bottom:10px}
  body.studio-mode .picker-head,body.studio-mode .studio-settings-head{min-height:28px}
  body.studio-mode .picker-head strong,body.studio-mode .studio-settings-head strong{font-size:14px}
  body.studio-mode .picker-tools{gap:5px}
}
@media(max-width:820px){
  /* iOS zooms editable fields below 16px. Only the picker follows the keyboard;
     the character canvas keeps the bounds it had before search was focused. */
  body.studio-mode .picker-search{font-size:16px}
  body.studio-mode[data-keyboard-open] .stage #viewport{top:var(--studio-keyboard-scene-top)!important;height:var(--studio-keyboard-scene-height)!important;bottom:auto!important}
  body.studio-mode[data-keyboard-open] .picker-sheet{top:var(--studio-visual-top,0px);height:var(--studio-visible-height,var(--app-height,100dvh));bottom:auto;padding:0;align-items:flex-end;justify-content:center}
  body.studio-mode[data-keyboard-open] .picker-panel{height:calc(var(--studio-visible-height,var(--app-height,100dvh)) - var(--safe-top) - 64px);max-height:calc(var(--studio-visible-height,var(--app-height,100dvh)) - var(--safe-top) - 64px);padding-bottom:12px}
  body.studio-mode .studio-settings[data-panel=pack] .studio-settings-panel.card{height:calc(var(--app-height,100dvh) * .76);max-height:calc(var(--app-height,100dvh) - var(--safe-top) - 125px)}
  body.studio-mode[data-keyboard-open] .picker-panel .picker-tools{display:none}
}
@media(prefers-reduced-motion:reduce){
  body.studio-mode button,body.studio-mode .studio-bottom,body.studio-mode .stage #viewport,body.studio-mode .studio-dock>button img{transition:none}
}

/* Camera is a named action; secondary scene tools share a small menu. */
body.studio-mode .stage-tools{position:relative;align-items:center}
body.studio-mode .stage-tools #resetCamera.studio-camera.icon{display:flex;align-items:center;justify-content:center;gap:6px;width:auto;min-width:73px;padding:7px 10px;font-size:10px;font-weight:600;white-space:nowrap;color:#bac3d6}
body.studio-mode .stage-tools .studio-camera.icon svg{width:17px;height:17px;flex:none}
body.studio-mode .stage-tools .studio-more.icon{color:#b7cfe0}
body.studio-mode .stage-tools .studio-more.icon>span{display:none}
/* The HTML already contains the final menu trigger. Keep it visible and its
   width reserved while the scene loads; legacy actions move into the menu. */
body.studio-mode .stage-tools>.studio-more.icon:disabled{opacity:1;cursor:progress}
body.studio-mode .stage-tools>#previewExpand,
body.studio-mode .stage-tools>#resetCamera,
body.studio-mode .stage-tools>#resetAll{display:none!important}
body.studio-mode .stage-tools .studio-more.icon[aria-expanded=true]{background:#183d5e;border-color:#419ce380;color:#c9edff}
body.studio-mode .studio-tools-popover{position:absolute;top:calc(100% + 8px);right:0;z-index:60;width:210px;display:flex;flex-direction:column;gap:4px;padding:7px;border:1px solid #6792b466;border-radius:16px;background:#212638ee;box-shadow:0 12px 40px #0005;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
body.studio-mode .stage-tools .studio-tools-popover .studio-menu-item.icon{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;height:44px;min-height:44px;padding:9px 10px;border:1px solid transparent;border-radius:10px;background:transparent;box-shadow:none;font-size:12px;color:#c8dced;white-space:nowrap}
body.studio-mode .stage-tools .studio-tools-popover .studio-menu-item.icon svg{width:19px;height:19px;flex:none}
body.studio-mode .stage-tools .studio-tools-popover .studio-tool-label{font-size:11px;font-weight:600;line-height:1.2;color:inherit}
body.studio-mode .stage-tools .studio-tools-popover .studio-menu-item.icon:hover{background:#21456766;border-color:#419ce336}
body.studio-mode .stage-tools .studio-tools-popover #resetAll .studio-tool-label{color:#b7d4ea}

/* Clean view keeps the same scene and camera controls, without the editor dock. */
body.studio-mode.preview-expanded .studio-header,
body.studio-mode.preview-expanded .studio-bottom{display:none!important}
body.studio-mode.preview-expanded .stage-head{
  top:calc(16px + var(--safe-top));left:calc(16px + var(--safe-left));right:calc(16px + var(--safe-right));min-height:40px;visibility:visible;pointer-events:auto;
}
body.studio-mode.preview-expanded .stage #viewport,
body.studio-mode.preview-expanded.pack-mode .stage #viewport{
  top:calc(64px + var(--safe-top));bottom:calc(16px + var(--safe-bottom));left:var(--safe-left);right:var(--safe-right);height:auto;min-height:0;
}
@media(max-width:360px){
  body.studio-mode{--studio-bottom-height:182px}
  body.studio-mode .stage-tools .icon{width:44px;height:44px;padding:11px}
  body.studio-mode .stage-head{min-height:44px}
  body.studio-mode:not(.preview-expanded) .stage #viewport,
  body.studio-mode:not(.preview-expanded).pack-mode .stage #viewport{top:calc(110px + var(--safe-top))}
  body.studio-mode .studio-bottom .actions>button,
  body.studio-mode .studio-bottom .actions .visual-picker-button{height:44px;min-height:44px}
  body.studio-mode #randomDockSlot #outfitRandom,
  body.studio-mode .studio-pack-open.primary{height:44px;min-height:44px}
  body.studio-mode.preview-expanded .stage-head{min-height:44px}
}

/* The original standalone action IDs must not turn menu rows into square grids. */
body.studio-mode .stage-tools .studio-tools-popover #resetCamera.studio-menu-item.icon,
body.studio-mode .stage-tools .studio-tools-popover #previewExpand.studio-menu-item.icon,
body.studio-mode .stage-tools .studio-tools-popover #resetAll.studio-menu-item.icon{
  display:flex;align-items:center;justify-content:flex-start;flex:none;gap:10px;width:100%;height:44px;min-height:44px;padding:9px 10px;font-size:12px;line-height:1.2;white-space:nowrap;
}
body.studio-mode .stage-tools .studio-tools-popover #resetCamera .studio-tool-label,
body.studio-mode .stage-tools .studio-tools-popover #previewExpand .studio-tool-label,
body.studio-mode .stage-tools .studio-tools-popover #resetAll .studio-tool-label{
  display:block;flex:1;min-width:0;margin:0;font-size:11px;line-height:1.2;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
body.studio-mode .stage-tools .studio-tools-popover #resetCamera svg,
body.studio-mode .stage-tools .studio-tools-popover #previewExpand svg,
body.studio-mode .stage-tools .studio-tools-popover #resetAll .studio-tool-symbol{
  display:block;flex:0 0 19px;width:19px;height:19px;min-width:19px;margin:0;font-size:18px;line-height:1;text-align:center;
}

/* Original lobby tile. This decorative layer never enters the sticker renderer. */
body.studio-mode .stage.card{--lobby-tile:128px;isolation:isolate}
body.studio-mode .stage.card::before{
  content:"";position:absolute;top:0;right:0;bottom:calc(var(--lobby-tile) * -2);left:calc(var(--lobby-tile) * -3);
  z-index:0;pointer-events:none;background-image:url('/icons/lobby-pattern.png');
  background-repeat:repeat;background-size:var(--lobby-tile) var(--lobby-tile);opacity:.022;
  animation:studio-lobby-drift 90s linear infinite;
}
body.studio-mode .stage #viewport{z-index:1}
@keyframes studio-lobby-drift{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(calc(var(--lobby-tile) * 3),calc(var(--lobby-tile) * -2),0)}
}
@media(min-width:821px){body.studio-mode .stage.card{--lobby-tile:192px}}
@media(prefers-reduced-motion:reduce){body.studio-mode .stage.card::before{animation:none}}
