/* v1.1 Sound Studio and AUTO/TURBO pill correction. Loaded after all approved art. */
.wheel-stage .side-action,
.wheel-stage #turbo-btn,
.wheel-stage #auto-btn{
  box-sizing:border-box!important;
  width:29%!important;
  max-width:none!important;
  min-width:0!important;
  height:clamp(42px,13%,64px)!important;
  min-height:42px!important;
  padding:4px clamp(3px,1.2vw,10px)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-flow:row nowrap!important;
  gap:clamp(3px,.9vw,8px)!important;
  overflow:visible!important;
  border-radius:999px!important;
  white-space:nowrap!important;
  bottom:7%!important;
}
.wheel-stage #turbo-btn{left:1%!important;right:auto!important}
.wheel-stage #auto-btn{right:1%!important;left:auto!important}
.wheel-stage .side-action .action-icon{
  flex:0 0 auto!important;
  font-size:clamp(17px,4.5vw,30px)!important;
  line-height:1!important;
}
.wheel-stage .side-action small{
  flex:0 1 auto!important;
  min-width:0!important;
  line-height:1.1!important;
  font-size:clamp(11px,2.85vw,17px)!important;
  letter-spacing:0!important;
}
@media(max-width:350px){
  .wheel-stage .side-action,.wheel-stage #turbo-btn,.wheel-stage #auto-btn{
    width:30%!important;
    height:clamp(39px,12%,50px)!important;
    min-height:39px!important;
    padding:3px!important;gap:3px!important;
  }
  .wheel-stage #turbo-btn{left:0!important}
  .wheel-stage #auto-btn{right:0!important}
  .wheel-stage .side-action small{font-size:clamp(10px,3.15vw,12px)!important}
  .wheel-stage .side-action .action-icon{font-size:clamp(15px,5vw,18px)!important}
}
/* Settings is intentionally scrollable: NEVER crop audio editor controls. */
.modal:has(.sound-studio){max-width:min(96vw,600px);width:96vw;max-height:min(90dvh,840px)}
.modal:has(.sound-studio) .modal-card{max-height:min(90dvh,840px)}
.modal:has(.sound-studio) .modal-content{
  overflow-y:auto!important;overflow-x:hidden!important;
  padding:clamp(10px,3vw,18px)!important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.sound-studio{display:flex;flex-direction:column;gap:10px;min-width:0}
.sound-studio .studio-note{font-size:12px;color:#ffe2a8;line-height:1.45;margin:0!important}
.sound-studio .studio-cue{
  width:100%;min-width:0;border:1px solid #d5a759;border-radius:15px;
  background:linear-gradient(180deg,#500c1ac9,#1b0209ed);overflow:visible;
  box-shadow:inset 0 1px #fff3;
}
.sound-studio .studio-title{
  list-style-position:inside;cursor:pointer;padding:14px 12px;
  color:#ffe4a1;font-weight:900;letter-spacing:.03em;font-size:clamp(12px,3.3vw,15px);
  overflow-wrap:anywhere;
}
.sound-studio .studio-title::marker{color:#ffad43}
.sound-studio .studio-body{padding:0 clamp(10px,3vw,16px) 15px;min-width:0}
.sound-studio .studio-status{font-size:12px;overflow-wrap:anywhere;color:#fff1cc}
.sound-studio .studio-edit-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
}
.sound-studio .studio-field{
  font-size:11px;letter-spacing:.03em;font-weight:800;color:#ffdc88;min-width:0;
  display:flex;flex-direction:column;gap:3px;
}
.sound-studio .studio-field input{
  width:100%!important;min-width:0!important;
  min-height:39px!important;padding:8px!important;
  margin:0!important;background:#1b050c!important;
  font-size:15px!important;color:white!important;
}
.sound-studio input[type=file]{
  width:100%;max-width:100%;min-width:0;
  white-space:normal;overflow-wrap:anywhere;
  background:#1e0610!important;color:#fff3da!important;font-size:12px;
}
.sound-studio input[type=file]::file-selector-button{
  border:1px solid #ffe5a7;background:#8b2332;color:#fff7e7;
  padding:6px 8px;border-radius:8px;margin-right:6px;
}
.sound-studio .studio-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:9px}
.sound-studio .studio-buttons .studio-button{
  margin:0!important;min-width:0;min-height:41px!important;
  padding:8px 5px!important;font-size:12px!important;
  white-space:normal!important;overflow-wrap:anywhere;line-height:1.2!important;
  border-radius:999px!important;
}
@media(orientation:landscape) and (max-height:470px){
  .wheel-stage .side-action,.wheel-stage #turbo-btn,.wheel-stage #auto-btn{
    height:clamp(32px,13%,48px)!important;min-height:32px!important;bottom:5%!important;
  }
  .wheel-stage .side-action small{font-size:clamp(9px,2vw,13px)!important}
  .modal:has(.sound-studio),.modal:has(.sound-studio) .modal-card{max-height:94dvh}
}

/* Reliable user-gesture audio entry on iOS: keep the Soft Tech logo visible
   until the visitor chooses sound or silent playback after each reload. */
.boot-softtech{position:absolute;isolation:isolate;}
.boot-sound-gate{
  position:absolute;z-index:9;left:50%;bottom:calc(max(14px,env(safe-area-inset-bottom)) + 5dvh);
  transform:translateX(-50%);
  width:min(calc(100% - 24px),470px);padding:10px 12px 14px;
  display:flex;align-items:center;flex-direction:column;gap:12px;
  border:1px solid #ffbd735e;border-radius:20px;
  background:linear-gradient(180deg,#0a0a16d9,#07070de8);
  box-shadow:0 7px 26px #000a;
}
.boot-sound-gate[hidden]{display:none!important}
.boot-sound-status{
  margin:0;color:#f5eedf;font:600 clamp(11px,2.9vw,14px)/1.4 system-ui,sans-serif;
  text-align:center;overflow-wrap:anywhere;max-width:100%;
}
.boot-sound-controls{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:8px;width:100%}
.boot-sound-controls button{
  min-width:0;min-height:clamp(40px,7dvh,54px);border:2px solid #ffdb78;
  border-radius:999px;padding:8px 6px;font:900 clamp(11px,2.8vw,15px)/1.1 system-ui,sans-serif;
  cursor:pointer;touch-action:manipulation;
}
.boot-gate-start{background:linear-gradient(#fff0a6,#e98e1b);color:#421008;box-shadow:0 0 13px #fac0447a}
.boot-gate-muted{background:#220a13;color:#fff0d8;border-color:#a9685a!important}
.boot-sound-controls button:disabled{opacity:.64;cursor:progress}
.boot-sound-controls button:focus-visible{outline:3px solid #63bfff;outline-offset:3px}
@media(orientation:landscape) and (max-height:470px){
  .boot-sound-gate{bottom:max(5px,env(safe-area-inset-bottom));padding:5px 10px;gap:4px}
  .boot-sound-controls button{min-height:32px;font-size:11px;padding:4px 8px}
}


/* Interactive trim timeline for every Sound Studio cue. */
.sound-studio .studio-timeline{
  min-width:0;display:flex;flex-direction:column;gap:5px;margin:10px 0 12px;
}
.sound-studio .studio-timeline-rail{
  position:relative;height:12px;width:100%;border-radius:999px;overflow:hidden;
  background:linear-gradient(180deg,#080209,#48151e);border:1px solid #e9aa7050;
}
.sound-studio .studio-timeline-selection{
  position:absolute;top:0;bottom:0;left:0;width:0;
  border-radius:999px;background:linear-gradient(90deg,#c42c37,#ffd15f,#ff9c27);
  box-shadow:0 0 8px #ffae4799;transition:left .07s linear,width .07s linear;
}
.sound-studio .studio-timeline-label{
  font-size:clamp(10px,2.7vw,12px);font-variant-numeric:tabular-nums;
  color:#ffd597;font-weight:700;white-space:normal;overflow-wrap:anywhere;
}
.sound-studio .studio-slider-panel{
  display:grid;grid-template-columns:minmax(0,1fr);gap:10px;
  margin:5px 0 14px;padding:11px 10px 12px;
  border-radius:14px;background:linear-gradient(150deg,#210410ef,#350919ad);
  border:1px solid #eab17445;min-width:0;
}
.sound-studio .studio-slider-row{
  min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:4px;
  color:#fff1d0;
}
.sound-studio .studio-slider-heading{
  display:flex;align-items:baseline;justify-content:space-between;gap:8px;
  font-size:11px;line-height:1.2;letter-spacing:.035em;
}
.sound-studio .studio-slider-heading strong{font-weight:800;color:#ffdf91}
.sound-studio .studio-slider-value{
  font-variant-numeric:tabular-nums;font-weight:800;color:#fff6ce;white-space:nowrap;
}
.modal:has(.sound-studio) .sound-studio .studio-range{
  box-sizing:border-box!important;appearance:auto;-webkit-appearance:auto;
  display:block!important;width:100%!important;min-width:0!important;
  height:26px!important;min-height:26px!important;max-height:26px!important;
  border:0!important;outline-offset:3px;border-radius:0!important;
  padding:0!important;margin:0!important;
  box-shadow:none!important;background:transparent!important;
  accent-color:#ffcd60;cursor:pointer;touch-action:pan-y;
}
.modal:has(.sound-studio) .sound-studio .studio-range::-webkit-slider-thumb{
  cursor:grab;
}
.modal:has(.sound-studio) .sound-studio .studio-range:disabled{
  opacity:.38;cursor:not-allowed;
}
.sound-studio .studio-repeat-row{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:10px;width:100%;min-width:0;
  margin:11px 0;padding:11px 10px;
  border:1px solid #f8c57086;border-radius:12px;
  background:linear-gradient(135deg,#7a30164d,#210917e8);
  cursor:pointer;
}
.modal:has(.sound-studio) .sound-studio .studio-repeat-input{
  display:block!important;width:24px!important;height:24px!important;
  min-height:24px!important;margin:0!important;padding:0!important;
  accent-color:#ffcf5a;
}
.sound-studio .studio-repeat-label{
  min-width:0;color:#ffe19e;font-size:clamp(11px,3vw,14px);
  font-weight:900;overflow-wrap:anywhere;
}
.sound-studio .studio-repeat-state{
  font-size:12px;font-weight:900;color:#fff5d2;
  padding:4px 9px;border-radius:999px;background:#6b2535;
}
@media(max-width:350px){
  .sound-studio .studio-slider-panel{padding:9px 7px}
  .sound-studio .studio-repeat-row{gap:6px;padding:9px 7px}
}

/* Cloud publication lives in the existing Sound Studio scroll pane and keeps
   all controls reachable at 320px without horizontal overflow. */
.sound-studio .studio-cloud-panel{
  display:flex;flex-direction:column;gap:9px;width:100%;min-width:0;
  margin:3px 0 12px;padding:12px;
  border:1px solid #ffe0a199;border-radius:16px;
  background:linear-gradient(165deg,#482413,#120a14 72%);
  box-shadow:inset 0 1px #ffecbe3b;
}
.sound-studio .studio-cloud-heading{
  font-size:clamp(13px,3.1vw,16px);letter-spacing:.055em;color:#ffe09a;
}
.sound-studio .studio-cloud-status{
  color:#fff0cc;font-size:12px;line-height:1.4;margin:0;
  overflow-wrap:anywhere;min-width:0;
}
.sound-studio .studio-cloud-button{
  display:block;box-sizing:border-box;width:100%;min-width:0;
  min-height:42px;margin:0!important;padding:9px 11px!important;
  border-radius:999px;border:1px solid #ffdc89;background:#8b3a24;
  color:#fff6df;font-size:clamp(11px,2.9vw,13px);font-weight:800;
  white-space:normal;overflow-wrap:anywhere;line-height:1.25;
}
.sound-studio .studio-cloud-button:disabled{opacity:.56;cursor:wait}
.sound-studio .studio-cloud-admin{
  min-width:0;overflow:visible;border-top:1px solid #ffcc8040;padding-top:6px;
}
.sound-studio .studio-cloud-admin summary{
  color:#ffdc9e;font-size:12px;font-weight:800;
  cursor:pointer;overflow-wrap:anywhere;padding:10px 3px;
}
.sound-studio .studio-cloud-admin[open]{
  display:flex;flex-direction:column;gap:9px;
}
.sound-studio .studio-admin-key{
  display:block!important;box-sizing:border-box!important;
  width:100%!important;max-width:100%;min-width:0!important;
  min-height:42px!important;background:#220710!important;color:#fff9df!important;
  padding:10px!important;border:1px solid #ad754f!important;
  border-radius:10px!important;font-size:14px!important;
}
@media(max-width:350px){
  .sound-studio .studio-cloud-panel{padding:9px;gap:7px}
  .sound-studio .studio-cloud-button{padding:8px!important}
}

/* Mirror Loop controls stay in Sound Studio's existing scrollable panel. */
.sound-studio .studio-mirror-panel{
  display:flex;flex-direction:column;gap:9px;box-sizing:border-box;
  width:100%;min-width:0;padding:12px;margin-top:7px;
  border:1px solid #f4ca7f88;border-radius:13px;
  background:linear-gradient(135deg,#2b1713,#110f16);
}
.sound-studio .studio-mirror-panel .studio-note{
  margin:0;font-size:12px;line-height:1.35;color:#f5dfb4;
}
.sound-studio .studio-mirror-fade{
  display:flex;flex-wrap:wrap;align-items:center;
  gap:8px;min-width:0;color:#ffe1a5;font-size:12px;
}
.sound-studio .studio-mirror-fade .studio-range{
  min-width:80px;flex:1 1 140px;width:auto;max-width:100%;
}
.sound-studio .studio-mirror-fade output{
  white-space:nowrap;min-width:58px;text-align:right;
}
@media(max-width:350px){
  .sound-studio .studio-mirror-panel{padding:9px}
  .sound-studio .studio-mirror-fade{gap:6px}
}