#sound-lab {
  display:block;
  color:#fff0d8;
  background:radial-gradient(ellipse at 95% 100%,#413047 0,transparent 54%),#2c1f32;
}
#sound-lab .studio-intro {display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:26px}
.studio-intro p {max-width:42rem;margin-top:11px;color:#dfd0df;font-size:1.05rem;line-height:1.5}
.studio-space,.studio-play,.lab-share,.studio-linkcopy,.studio-export {
  display:inline-flex;align-items:center;justify-content:center;gap:9px;border-radius:100px;padding:11px 18px;
  min-height:43px;font-size:.92rem;line-height:1.1;font-weight:700;white-space:nowrap;
}
.studio-space {color:#24182b;background:#d9bfee;border:1px solid #e7c9f7;margin-bottom:3px}
.studio-space:hover {background:#ebd4fc}
.studio-space .icon {width:20px;height:20px;stroke-width:1.5}
.lab-machine {
  position:relative;overflow:hidden;border:1px solid #957589;border-radius:15px;
  background:#4c384c;box-shadow:0 6px 0 #1f1424,0 8px 25px #2014223d;padding:0 7px 8px;
}
.studio-strip {
  margin:0 -7px;height:8px;
  background:linear-gradient(90deg,#ec9979 0 20%,#d794b7 20% 40%,#e7cc87 40% 60%,#91cdbb 60% 80%,#b4a1d1 80%);
  opacity:.96;
}
.studio-face {border:1px solid #2a1d2d;border-top:0;border-radius:0 0 9px 9px;background:#281e2d;padding:clamp(17px,2.25vw,36px)}
.machine-top,.machine-playback,.machine-bottom,.machine-ranges {display:flex;align-items:center}
.machine-top {justify-content:space-between;gap:20px}
.machine-playback {gap:clamp(16px,2.2vw,36px)}
.machine-label,.lab-ruler,.lab-range output,.step-counter,.step-banks button {
  font-family:var(--mono);font-weight:400;font-variant-numeric:tabular-nums;
}
.machine-label {display:block;font-size:.73rem;text-transform:uppercase;letter-spacing:.135em;color:#d7bdd4;line-height:1.45}
.pattern-field {display:grid;gap:2px;min-width:0}
.select-wrap {display:inline-flex;align-items:center;position:relative;width:max-content;max-width:100%}
.select-wrap i {position:absolute;right:8px;width:8px;height:8px;border-right:1.5px solid #dcb6cf;border-bottom:1.5px solid #dcb6cf;transform:translateY(-2px) rotate(45deg);pointer-events:none}
.studio-pattern {appearance:none;-webkit-appearance:none;max-width:100%;outline-offset:2px;border:0;border-radius:2px;padding:3px 28px 4px 0;background:transparent;color:#ffedcf;font:400 clamp(1.37rem,2.4vw,2.05rem)/1.2 var(--display);letter-spacing:-.04em;cursor:pointer}
.studio-pattern option {color:#fff1d8;background:#2f2133;font:500 1rem var(--body)}
.studio-pattern:focus-visible,.lab-range input:focus-visible,.share-url:focus-visible {outline:2px solid #9cdad0;outline-offset:4px}
.step-counter {display:grid;grid-template-columns:auto auto;align-items:baseline;gap:0 5px;color:#c6a9bc}
.step-counter .machine-label {grid-column:1/-1;font-size:.65rem}
.step-counter output {color:#f4c99a;line-height:1;font-size:1.32rem}
.step-counter>span:last-child {font-size:.74rem}
.studio-play {border:1px solid #f9cf98;background:#ffca85;color:#2d1b23;min-width:120px}
.studio-play:hover {background:#ffdaaa}
.studio-play[aria-pressed="true"] {background:#ffd6aa}
.lab-sequence {margin:20px 0 18px;padding:12px clamp(6px,1vw,16px) 14px;background:#201823;border:1px solid #594354;border-radius:8px}
.lab-ruler,.lab-track {display:grid;grid-template-columns:clamp(64px,7.5vw,114px) repeat(16,minmax(0,1fr));align-items:center;gap:clamp(3px,.42vw,9px);min-width:0}
.lab-ruler {margin-bottom:8px;color:#bdabbb;text-align:center;font-size:clamp(.62rem,.83vw,.83rem)}
.lab-ruler .machine-label {text-align:left;font-size:.65rem;letter-spacing:.09em;margin-left:4px}
.lab-ruler [data-col="0"],.lab-ruler [data-col="4"],.lab-ruler [data-col="8"],.lab-ruler [data-col="12"] {color:#fae4ca}
.lab-ruler [data-col].current {background:#ecd7bc;color:#2b202c;border-radius:3px}
.lab-track + .lab-track {margin-top:clamp(5px,.58vw,9px)}
.lab-mute {
  display:flex;align-items:center;gap:8px;min-height:32px;padding:4px;background:none;border:0;text-align:left;
  font:650 .95rem/1 var(--body);color:#ffefdb;
}
.lab-mute i {width:9px;height:9px;flex:none;border-radius:50%;background:var(--voice);box-shadow:inset 0 0 0 1px #ffffff4a}
.lab-mute:hover {color:var(--voice)}
.lab-track.muted .lab-mute i {background:transparent;box-shadow:inset 0 0 0 1.5px var(--voice)}
.lab-track.muted .lab-mute {color:#cbb7c5}
.lab-pad {
  position:relative;min-width:0;height:clamp(31px,2.8vw,45px);padding:0;
  border:1px solid #695365;border-bottom:3px solid #281d2b;border-radius:4px;
  background:linear-gradient(#4b394b,#423143);box-shadow:inset 0 1px 0 #ffffff0d;
}
.lab-pad:nth-child(4n + 6),.lab-ruler>span:nth-child(4n + 6) {margin-left:clamp(2px,.5vw,9px)}
.lab-pad[aria-pressed="true"] {border-color:var(--voice);border-bottom-color:color-mix(in srgb,var(--voice) 60%,#241b26);background:var(--voice)}
.lab-pad[aria-pressed="true"]::after {content:"";position:absolute;bottom:5px;left:50%;margin-left:-4px;width:8px;height:2px;border-radius:2px;background:#30252c66}
.lab-pad:hover {border-color:#f6e1c9}
.lab-pad.current {outline:1px solid #fff2d8;outline-offset:1px}
.lab-pad:focus-visible {z-index:1;outline:3px solid white;outline-offset:2px}
.lab-track.muted .lab-pad[aria-pressed="true"] {background:color-mix(in srgb,var(--voice) 30%,#352936);border-color:color-mix(in srgb,var(--voice) 40%,#352936)}
.machine-bottom {justify-content:space-between;gap:22px}
.machine-ranges {gap:clamp(20px,3.7vw,62px);max-width:600px;flex:1}
.lab-range {display:grid;gap:4px;flex:1;min-width:0}
.lab-range>span {display:flex;gap:10px;align-items:baseline;justify-content:space-between;font-size:.87rem;font-weight:650;color:#e3d2df}
.lab-range output {font-size:.78rem;color:#efc78d}
.lab-range input {width:100%;height:20px;accent-color:#ffcd8b;cursor:pointer;margin:0}
.lab-range:last-child input {accent-color:#bda5df}
.lab-range:last-child output {color:#debfef}
.lab-share,.studio-linkcopy,.studio-export {border:1px solid #8b6e83;color:#f8e8da;background:transparent}
.lab-share:hover,.studio-export:hover,.studio-linkcopy:hover {border-color:#e0b9cf;background:#412f40}
.lab-share .icon {width:16px;height:16px}
.share-panel {display:flex;align-items:flex-end;gap:10px;margin-top:22px;padding-top:16px;border-top:1px solid #5b4459}
.share-panel[hidden],.step-banks {display:none}
.share-url-field {min-width:0;flex:1;display:grid;gap:5px}
.share-url {border-radius:5px;height:42px;padding:0 10px;min-width:0;border:1px solid #80657c;background:#1f1823;color:#efdeea;font:400 .8rem var(--mono)}
.studio-linkcopy {background:#48364b}
.studio-export:disabled {opacity:.55;cursor:wait}
.studio-status {font-size:.88rem;color:#f1d5ac;line-height:1.45}
.studio-status:not(:empty) {margin-top:16px}
@media(max-width:760px) {
  #sound-lab .studio-intro {align-items:flex-start;flex-direction:column;gap:14px;margin-bottom:18px}
  .studio-intro p {font-size:1rem;margin-top:9px}
  .studio-space {margin:0}
  .machine-playback {gap:12px}
  .step-counter {display:none}
  .step-banks {display:inline-flex;gap:2px;padding:2px;border:1px solid #685369;border-radius:6px;margin-top:15px}
  .step-banks button {border:0;border-radius:3px;background:none;font-size:.72rem;padding:6px 11px;color:#dcc9d8}
  .step-banks button[aria-pressed="true"] {color:#2e2231;background:#dbc4dd}
  .lab-sequence {margin:12px 0 16px}
  .lab-track,.lab-ruler {grid-template-columns:64px repeat(8,minmax(0,1fr));gap:4px}
  .lab-ruler {font-size:.68rem}
  .lab-pad {height:36px}
  .lab-pad:nth-child(4n + 6),.lab-ruler>span:nth-child(4n + 6) {margin-left:3px}
  .lab-sequence[data-bank="0"] [data-half="1"],.lab-sequence[data-bank="1"] [data-half="0"] {display:none}
  .machine-ranges {gap:20px}
  .machine-bottom {gap:15px}
}
@media(max-width:510px) {
  #sound-lab {padding-inline:var(--page-gutter)}
  .lab-machine {margin-inline:-7px;padding-inline:4px;border-radius:10px}
  .studio-strip {margin-inline:-4px;height:6px}
  .studio-face {padding:14px 9px}
  .machine-top {gap:8px}
  .studio-pattern {font-size:clamp(1.13rem,4.7vw,1.45rem)}
  .studio-play {min-width:0;padding:9px 11px;font-size:.85rem}
  .lab-sequence {padding:10px 4px}
  .lab-track,.lab-ruler {grid-template-columns:53px repeat(8,minmax(0,1fr));gap:3px}
  .lab-mute {font-size:.8rem;padding-inline:1px;gap:5px}
  .lab-mute i {width:6px;height:6px}
  .lab-pad {height:35px;border-radius:3px}
  .machine-bottom,.share-panel {flex-wrap:wrap}
  .machine-ranges {flex-basis:100%}
  .share-url-field {flex-basis:100%}
  .lab-share,.studio-linkcopy,.studio-export {font-size:.83rem;min-height:39px;padding:9px 14px}
}
.local-share-hint {margin:10px 0 0;font-size:.85rem;line-height:1.45;color:#ddc9d8}
