/* Browser interface for the Mashup Stutter product page. */
.stutter-lab {
  --lab-ink: #fbf7fd;
  --lab-black: #151217;
  --lab-pink: #ff008d;
  --lab-gold: #ffcf57;
  --lab-cyan: #43edf1;
  --lab-edge: #47434d;
  color-scheme: dark;
  padding-block: 66px 44px;
}

.stutter-lab-intro {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: end;
  margin: 0 0 24px;
}

.stutter-lab-intro h2 {
  color: var(--ink, #f9f5fd);
  font: 800 clamp(48px, 6.3vw, 88px)/.89 var(--display, "Arial Narrow", sans-serif);
  letter-spacing: -.015em;
  margin: 9px 0 0;
}

.stutter-lab-intro > p {
  color: var(--muted, #bbb0c9);
  font: 400 15px/1.55 var(--body, system-ui, sans-serif);
  max-width: 36ch;
}

.stutter-lab-shell {
  position: relative;
  border-radius: clamp(12px, 2vw, 27px);
  background:
    url("media/lab-brushed-metal.webp") center / 100% 100% no-repeat,
    linear-gradient(125deg, #ffc84e 8%, #ef5d68 43%, #ff008d 65%, #d107e7 100%);
  border: 1px solid #f7a3ad80;
  box-shadow: 0 26px 70px #0007, 0 4px 20px #ed148f26;
  padding: clamp(9px, 1.25vw, 20px);
  color: var(--lab-ink);
  font: 500 13px/1.3 var(--body, system-ui, sans-serif);
}

.stutter-lab-brand {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(0, .9fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 17px;
  padding: 3px 11px 7px;
}

.stutter-lab-wordmark { display: flex; flex-direction: column; align-items: start; gap: 4px; justify-self: start; }
.stutter-lab-wordmark img:first-child { width: min(100%, 355px); }
.stutter-lab-wordmark img:last-child { width: min(44%, 160px); }
.stutter-lab-emblem { width: min(73%, 209px); justify-self: center; }

.stutter-lab-preset-label {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-self: end;
  min-width: 0;
}

.stutter-lab-preset-label > span,
.stutter-lab-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.stutter-lab-shell button,
.stutter-lab-shell select,
.stutter-lab-shell input[type="number"] {
  color: var(--lab-ink);
  min-width: 0;
  margin: 0;
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid #5b565e;
  border-radius: 8px;
  background: linear-gradient(#363239, #1e1b22 58%, #18161c);
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 1px 0 #fff1;
  white-space: nowrap;
  transition: border-color .18s, background-color .18s, box-shadow .18s, transform .15s;
}

.stutter-lab-shell select {
  appearance: none;
  padding-right: 22px;
  background:
    linear-gradient(45deg, transparent 48%, #ffe232 50%) right 10px center / 5px 5px no-repeat,
    linear-gradient(135deg, #ffe232 50%, transparent 52%) right 5px center / 5px 5px no-repeat,
    linear-gradient(#363239, #1e1b22 58%, #18161c);
}

.stutter-lab-shell select option { color: var(--lab-ink); background: #201a27; }
.stutter-lab-shell .stutter-lab-preset-label select { width: min(15vw, 204px); min-width: 125px; }
.stutter-lab-shell input[type="number"] {
  cursor: text;
  text-align: center;
  min-width: 51px;
  width: 55px;
  padding-inline: 3px;
  scrollbar-width: none;
}
[data-theme="light"] .stutter-lab .stutter-lab-shell input[type="number"] {
  color: var(--lab-ink);
  background: linear-gradient(#363239, #1e1b22 58%, #18161c);
  border-color: #5b565e;
}
[data-theme="light"] .stutter-lab .stutter-lab-shell input[type="range"] {
  background: transparent;
  border-color: transparent;
}
[data-theme="light"] .stutter-lab .stutter-lab-shell :is(input, select):focus {
  border-color: #5b565e !important;
  box-shadow: none !important;
}

.stutter-lab-shell input[type="number"]::-webkit-outer-spin-button,
.stutter-lab-shell input[type="number"]::-webkit-inner-spin-button { appearance: none; margin: 0; }
.stutter-lab-shell :where(input, select, button):focus-visible {
  outline: 2px solid var(--lab-cyan);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #111c;
  z-index: 2;
}

.stutter-lab-shell button:active:not(:disabled) {
  border-color: var(--lab-cyan);
  box-shadow: inset 0 2px 6px #000a;
  transform: translateY(1px);
}

.stutter-lab-shell button:disabled { opacity: .45; cursor: default; }
.stutter-lab-shell :is([data-lab-play], [data-lab-loop])[aria-pressed="true"] { color: #fff; border-color: #ff88c5; background: linear-gradient(#b52d71,#6e1f52); }

.stutter-lab [data-lab-loop]::before {
  --loop-cue-angle: 0deg;
  position: absolute;
  z-index: 3;
  inset: auto auto calc(100% + 5px) 50%;
  width: 68px;
  height: 64px;
  transform: translateX(-50%) rotate(var(--loop-cue-angle));
  transform-origin: bottom center;
  background: url("media/lab-play-loop-arrow.webp") center bottom/contain no-repeat;
  filter: saturate(1.15) drop-shadow(0 2px 2px #350b31be) drop-shadow(0 0 5px #ff6b897d);
  pointer-events: none;
  content: "";
}

.stutter-lab.has-loop-cue-motion [data-lab-loop]::before {
  animation: stutter-loop-cue 1.22s cubic-bezier(.45,0,.55,1) infinite;
}

@keyframes stutter-loop-cue {
  0%, 100% { transform: translateX(-50%) rotate(var(--loop-cue-angle)) scale(1); }
  29% { transform: translate(-50%, -3px) rotate(var(--loop-cue-angle)) scale(.95); }
  62% { transform: translate(-50%, 3px) rotate(var(--loop-cue-angle)) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .stutter-lab.has-loop-cue-motion [data-lab-loop]::before { animation: none; }
}

@media (max-width: 979px) {
  .stutter-lab-shell [data-lab-loop] { position: relative; overflow: visible; }
  .stutter-lab-shell .stutter-lab-toolbar { padding-block-start: 79px; }
}

.stutter-lab-tabs {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(44%, 575px);
  margin: 1px auto 8px;
  border-radius: clamp(7px, 1.2vw, 16px);
  background: linear-gradient(#343233, #161515 62%, #171617);
  border: 1px solid #160916;
  box-shadow: 0 2px 3px #50063836, inset 0 1px 2px #fff5;
}

.stutter-lab-shell .stutter-lab-tab {
  min-height: clamp(36px, 4.4vw, 57px);
  border: 1px solid transparent;
  border-radius: inherit;
  background: none;
  font: 600 clamp(15px, 2vw, 25px)/1 var(--body, system-ui, sans-serif);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 8px;
}

.stutter-lab-shell [data-lab-view="sample"][aria-pressed="true"] {
  background: linear-gradient(#ff17b1, #ff0089 62%, #ea006c);
  text-shadow: 0 1px 3px #770725;
}

.stutter-lab-shell [data-lab-view="effect"][aria-pressed="true"] {
  background: linear-gradient(#ffdc77, #ffca50 60%, #e6aa28);
  color: #271710;
}

.stutter-lab-display {
  border: 1px solid #050406;
  background: #110f14;
  border-radius: clamp(7px, 1.1vw, 15px);
  box-shadow: 0 1px 3px #160c175f;
}

.stutter-lab-toolbar {
  display: flex;
  gap: 8px 13px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 8px;
  background: linear-gradient(#2e2b31, #1d1b20);
  border-radius: inherit;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom: 1px solid #463d47;
}

.stutter-lab-transport,
.stutter-lab-mode,
.stutter-lab-division {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.stutter-lab-play { display: inline-flex; align-items: center; gap: 6px; }
.stutter-lab-play i { border-block: 5px solid transparent; border-inline-start: 8px solid currentColor; }
.stutter-lab-tempo,
.stutter-lab-control {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #e2dae8;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.stutter-lab-mode {
  flex-wrap: nowrap;
  gap: 0;
  background: #171419;
  border: 1px solid #5b565e;
  border-radius: 8px;
}

.stutter-lab-shell .stutter-lab-mode button {
  border: 0;
  background: none;
  box-shadow: none;
  color: #d9d0da;
  min-height: 32px;
  font-weight: 650;
}
.stutter-lab-shell .stutter-lab-mode button[aria-pressed="true"] {
  color: var(--lab-cyan);
  background: #183a43;
  box-shadow: inset 0 0 0 1px #2f666d;
}
.stutter-lab[data-mode="buildup"] .stutter-lab-repeats,
.stutter-lab[data-mode="stutter"] .stutter-lab-rate { display: none; }

.stutter-lab-wave-panel { padding: 9px 13px 8px; }

.stutter-lab-wave-meta,
.stutter-lab-tray {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stutter-lab-wave-meta {
  font: 650 11px/1.4 var(--body, system-ui, sans-serif);
  color: #eee9f0;
  margin: 0 0 8px;
}

.stutter-lab-wave-meta p { margin: 0; min-width: 0; }
.stutter-lab-wave-meta [data-lab-source-name] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #bbadca;
  text-align: end;
}

.stutter-lab-timeline {
  position: relative;
  width: 100%;
  height: clamp(173px, 17vw, 238px);
  min-height: 0;
  background: linear-gradient(#141117, #121013);
  border-radius: 5px;
  border: 1px solid #6252685c;
  isolation: isolate;
  touch-action: manipulation;
}

.stutter-lab-timeline:focus-within { border-color: #a788b9; }
.stutter-lab[data-view="sample"] .stutter-lab-timeline { touch-action: pan-y; }
.stutter-lab-timeline.is-playing::after {
  position: absolute;
  z-index: 2;
  inset-block: 0;
  inset-inline-start: clamp(1px, var(--lab-playhead), calc(100% - 1px));
  width: 1px;
  background: #f9ece8;
  box-shadow: 0 0 7px #fb94ca;
  pointer-events: none;
  content: "";
}
.stutter-lab.is-drag-over .stutter-lab-timeline { outline: 2px dashed var(--lab-cyan); outline-offset: 2px; }
.stutter-lab-timeline [data-lab-wave] {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.stutter-lab-cues { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.stutter-lab-cues button {
  pointer-events: auto;
  touch-action: none;
  min-height: 24px;
  min-width: 24px;
  position: absolute;
  inset-block-start: 22px;
  padding: 2px 4px;
  border-radius: 5px;
  color: #fff;
  font-size: 10px;
  white-space: nowrap;
}
.stutter-lab-cues button[aria-pressed="true"],
.stutter-lab-cues button[aria-selected="true"],
.stutter-lab-cues button[data-selected="true"],
.stutter-lab-cues button.is-selected {
  color: #21140a;
  background: var(--lab-gold);
  border-color: #ffda79;
}

.stutter-lab-tray { padding-top: 8px; }
.stutter-lab-source, .stutter-lab-cue-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.stutter-lab[data-view="sample"] .stutter-lab-cue-actions { visibility: hidden; }
.stutter-lab-tray button { min-height: 32px; font-size: 11px; padding-inline: 8px; }
.stutter-lab-drag {
  color: #eacae9;
  border: 1px dashed #735c7f;
  border-radius: 6px;
  padding: 6px 7px;
  font-size: 11px;
  cursor: grab;
}
.stutter-lab-drag:active { cursor: grabbing; }

.stutter-lab-knobs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 0;
  margin: 11px auto 4px;
  padding: 0;
  gap: 12px;
  min-width: 0;
  width: min(100%, 1050px);
}

.stutter-lab-knob {
  --lab-angle: 0deg;
  --lab-accent: #fe94c5;
  --lab-knob-rim: url("media/lab-gate-rim.png");
  --lab-knob-cap: url("media/lab-gate-cap.png");
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  color: #210e18;
}

.stutter-lab-knob[data-lab-knob="gate"] { --lab-angle: -133deg; --lab-accent: #ff8b91; }
.stutter-lab-knob[data-lab-knob="pan"] { --lab-accent: #ffe28d; --lab-knob-rim: url("media/lab-pan-rim.png"); --lab-knob-cap: url("media/lab-pan-cap.png"); }
.stutter-lab-knob[data-lab-knob="lowCut"] { --lab-angle: -133deg; --lab-accent: #f9aaff; --lab-knob-rim: url("media/lab-filter-rim.png"); --lab-knob-cap: url("media/lab-filter-cap.png"); }
.stutter-lab-knob[data-lab-knob="pitch"] { --lab-accent: #9dff9c; --lab-knob-rim: url("media/lab-pitch-rim.png"); --lab-knob-cap: url("media/lab-pitch-cap.png"); }
.stutter-lab-knob[data-lab-knob="formant"] { --lab-accent: #8ff4f3; --lab-knob-rim: url("media/lab-pitch-rim.png"); --lab-knob-cap: url("media/lab-pitch-cap.png"); }
.stutter-lab-knob[data-lab-knob="formant"] .stutter-lab-knob-face::before { filter: hue-rotate(63deg); }

.stutter-lab-knob-face {
  width: clamp(48px, 8.3vw, 118px);
  aspect-ratio: 1;
  position: relative;
  z-index: 0;
  grid-row: 1;
  pointer-events: none;
}
.stutter-lab-knob-face::before,
.stutter-lab-knob-face span {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--lab-knob-rim) center / contain no-repeat;
}
.stutter-lab-knob-face span {
  background-image: var(--lab-knob-cap);
  transform: rotate(var(--lab-angle));
  transform-origin: 50% 50%;
}
.stutter-lab-knob label {
  grid-row: 4;
  cursor: pointer;
  border-radius: 4px;
  color: #fff;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.2;
  text-shadow: 0 1px 3px #270019da;
  text-transform: uppercase;
}
.stutter-lab-knob output {
  grid-row: 3;
  border-radius: 5px;
  min-width: 38px;
  padding: 0 4px;
  color: #fff;
  background: #261521c1;
  font: 650 10px/1.5 var(--body, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.stutter-lab-knob input[type="range"] {
  appearance: none;
  display: block;
  grid-row: 2;
  height: 22px;
  width: min(100%, 78px);
  margin: -3px 0 0;
  background: transparent;
  border: 0;
  color: var(--lab-accent);
  cursor: ew-resize;
  touch-action: pan-y;
}
.stutter-lab-knob input[type="range"]::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: #251321a8; }
.stutter-lab-knob input[type="range"]::-moz-range-track { height: 4px; border-radius: 999px; background: #251321a8; }
.stutter-lab-knob input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #29111f; margin-top: -4px; box-shadow: 0 1px 4px #1e081380; background: var(--lab-accent); }
.stutter-lab-knob input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #29111f; box-shadow: 0 1px 4px #1e081380; background: var(--lab-accent); }
.stutter-lab-knob:focus-within .stutter-lab-knob-face { filter: drop-shadow(0 0 4px #ffffffe0); }
.stutter-lab-filter-type {
  display: flex;
  justify-content: center;
  margin: 5px 0 0;
}
.stutter-lab-shell .stutter-lab-filter-type select { min-height: 29px; font-size: 11px; }

.stutter-lab-help {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 11px 0 0;
  color: var(--muted, #bbb0c9);
  font: 400 12px/1.5 var(--body, system-ui, sans-serif);
}

.stutter-lab-help > p { margin: 0; }
.stutter-lab-help [data-lab-status] { color: var(--ink, #f9f5fd); }

@media (hover: hover) {
  .stutter-lab-shell button:hover:not(:disabled),
  .stutter-lab-shell select:hover { border-color: #eee4ef; }
  .stutter-lab-shell .stutter-lab-mode button:hover { color: var(--lab-cyan); }
}

@media (max-width: 1030px) {
  .stutter-lab-toolbar { justify-content: start; }
  .stutter-lab-toolbar .stutter-lab-division { justify-content: end; flex: 1; }
}

@media (max-width: 845px) {
  .stutter-lab-toolbar .stutter-lab-division { justify-content: start; flex-basis: 100%; }
  .stutter-lab-tabs { width: min(56%, 480px); }
  .stutter-lab-knob-face { width: clamp(47px, 10vw, 85px); }
}

@media (max-width: 620px) {
  .stutter-lab { padding-block: 44px 33px; }
  .stutter-lab-intro { display: grid; gap: 10px; margin-bottom: 18px; }
  .stutter-lab-intro > p { font-size: 14px; }
  .stutter-lab-shell { font-size: 12px; }
  .stutter-lab-brand { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 3px 2px 7px; }
  .stutter-lab-emblem { display: none; }
  .stutter-lab-shell .stutter-lab-preset-label select { min-width: 105px; width: auto; }
  .stutter-lab-tabs { width: 100%; margin-bottom: 7px; }
  .stutter-lab-shell .stutter-lab-tab { min-height: 44px; }
  .stutter-lab-toolbar { padding: 7px 5px; gap: 5px 8px; }
  .stutter-lab-toolbar .stutter-lab-transport { flex-basis: 100%; }
  .stutter-lab-shell :is(button, select, input[type="number"]) { min-height: 40px; }
  .stutter-lab-mode button { padding-inline: 6px; }
  .stutter-lab-toolbar .stutter-lab-division { gap: 4px; }
  .stutter-lab-control { flex-direction: column; align-items: stretch; gap: 3px; flex: 1; min-width: 0; }
  .stutter-lab-control span { font-size: 10px; }
  .stutter-lab-control select { width: 100%; }
  .stutter-lab-wave-panel { padding: 8px 6px 6px; }
  .stutter-lab-timeline { height: clamp(145px, 46vw, 260px); }
  .stutter-lab-cues button { min-height: 26px; }
  .stutter-lab-tray { justify-content: start; flex-wrap: wrap; gap: 5px 8px; }
  .stutter-lab-tray .stutter-lab-cue-actions { justify-content: start; }
  .stutter-lab[data-view="sample"] .stutter-lab-cue-actions { display: none; }
  .stutter-lab-drag { display: none; }
  .stutter-lab-knobs { gap: 5px; }
  .stutter-lab-knob-face { width: min(13vw, 67px); }
  .stutter-lab-knob input[type="range"] { width: min(90%, 67px); height: 25px; }
  .stutter-lab-knob label { font-size: 9px; padding-inline: 1px; letter-spacing: .01em; white-space: nowrap; }
  .stutter-lab-knob output { font-size: 9px; min-width: 27px; }
  .stutter-lab-shell .stutter-lab-filter-type select { min-height: 40px; }
}

@media (max-width: 355px) {
  .stutter-lab-control select { font-size: 11px; padding-left: 4px; padding-right: 19px; }
  .stutter-lab-knobs { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 9px; }
  .stutter-lab-knob-face { width: clamp(45px, 17vw, 64px); }
}

@media (prefers-reduced-motion: reduce) {
  .stutter-lab-shell :is(button, select, input) { transition: none; }
}

/* On larger screens the hardware canvas uses the native editor's 1755×896
   coordinate system. Only the live controls and display cover the approved art. */
.stutter-lab-native-menu,
.stutter-lab-native-mode-switch,
.stutter-lab-bank-art,
.stutter-lab-pitch-shift-face,
.stutter-lab-bank-feel-switch { display: none; }

.stutter-lab-shell [data-lab-export-locked] {
  color: #c7bdcc;
  border-style: dashed;
}
.stutter-lab-shell [data-lab-export-locked]::after {
  content: "";
  display: inline-block;
  vertical-align: -.05em;
  width: .5em;
  height: .47em;
  margin-inline-start: .42em;
  background: currentColor;
  border-radius: .07em;
  box-shadow: 0 -.19em 0 -.105em currentColor;
}
.stutter-lab-bank {
  margin: 9px 0 5px;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.stutter-lab-bank input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.stutter-lab-bank label {
  padding: 6px 11px;
  color: #fff;
  background: #2a162bc9;
  border: 1px solid #c54da7ac;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
}
.stutter-lab-bank input:checked + label { background: #8c075a; border-color: #fcb6df; }
.stutter-lab-bank input:focus-visible + label { outline: 2px solid var(--lab-cyan); outline-offset: 2px; }
.stutter-lab-bank-rhythm,
.stutter-lab-pitch-range,
.stutter-lab-filter-type,
.stutter-lab-small-knob { display: none; }
.stutter-lab-shell:has([data-lab-bank="filter"]:checked) .stutter-lab-filter-type,
.stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-pitch-range,
.stutter-lab-shell:has([data-lab-bank="gate"]:checked) .stutter-lab-bank-rhythm-gate,
.stutter-lab-shell:has([data-lab-bank="pan"]:checked) .stutter-lab-bank-rhythm-pan {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding-block: 5px;
}
.stutter-lab-shell:has([data-lab-bank="filter"]:checked) .stutter-lab-small-knob { display: grid; }
.stutter-lab-bank-rate,
.stutter-lab-bank-feel { display: grid; gap: 3px; }
.stutter-lab-pitch-range > span,
.stutter-lab-bank-rate > span,
.stutter-lab-bank-feel > span {
  color: #fff;
  text-shadow: 0 1px 3px #270019da;
  font-weight: 700;
}
.stutter-lab-knob[data-lab-knob="frequency"] { --lab-knob-cap: url("media/lab-native-frequency-marker.png"); --lab-knob-rim: url("media/lab-native-frequency-base.png"); }
.stutter-lab-knob[data-lab-knob="bellGain"] { --lab-knob-cap: url("media/lab-native-bell-gain-marker.png"); --lab-knob-rim: url("media/lab-native-bell-gain-base.png"); }
.stutter-lab-knob[data-lab-knob="q"] { --lab-knob-cap: url("media/lab-native-q-marker.png"); --lab-knob-rim: url("media/lab-native-q-base.png"); }

@media (max-width: 979px) {
  .stutter-lab-shell .stutter-lab-knobs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stutter-lab-knob[data-lab-knob="formant"] { display: none; }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-knob[data-lab-knob="formant"] { display: grid; }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-knobs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stutter-lab-shell:has([data-lab-bank="filter"]:checked) .stutter-lab-knobs:has(.stutter-lab-small-knob) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 355px) {
  .stutter-lab-shell:has([data-lab-bank]) .stutter-lab-knobs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stutter-lab-bank label { padding-inline: 7px; }
}

@media (min-width: 980px) {
  .stutter-lab { container-type: inline-size; }
  .stutter-lab-shell {
    --u: calc(100cqw / 1755);
    height: calc(896 * var(--u));
    aspect-ratio: 1755 / 896;
    padding: 0;
    margin-bottom: 51px;
    border: 0;
    border-radius: 0;
    background: url("media/lab-native-faceplate.png") left top / 100% 100% no-repeat #050405;
    box-shadow: 0 18px 57px #0008;
    font: 400 calc(21 * var(--u))/1 Arial, sans-serif;
  }
  .stutter-lab-shell :is(.stutter-lab-brand, .stutter-lab-display, .stutter-lab-toolbar, .stutter-lab-transport,
      .stutter-lab-division, .stutter-lab-knobs, .stutter-lab-knob, .stutter-lab-bank-rhythm) {
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }
  .stutter-lab-shell :is(.stutter-lab-brand, .stutter-lab-display, .stutter-lab-toolbar, .stutter-lab-transport,
      .stutter-lab-mode, .stutter-lab-division, .stutter-lab-knobs) { display: contents; }
  .stutter-lab-shell :is(.stutter-lab-wordmark, .stutter-lab-emblem) { display: none; }

  .stutter-lab-shell :is(.stutter-lab-tabs, .stutter-lab-native-menu, .stutter-lab-preset-label,
      .stutter-lab-transport > button, .stutter-lab-tempo, .stutter-lab-mode > button,
      .stutter-lab-division > label,
      .stutter-lab-wave-panel, .stutter-lab-bank, .stutter-lab-bank-art,
      .stutter-lab-knob-face, .stutter-lab-pitch-shift-face, .stutter-lab-knob input,
      .stutter-lab-knob output, .stutter-lab-filter-type, .stutter-lab-pitch-range,
      .stutter-lab-bank-rate, .stutter-lab-bank-feel-switch),
  .stutter-lab-shell .stutter-lab-mode::before,
  .stutter-lab-shell .stutter-lab-division::before {
    position: absolute;
    inset: calc(var(--y) * var(--u)) auto auto calc(var(--x) * var(--u));
    width: calc(var(--w) * var(--u));
    height: calc(var(--h) * var(--u));
    min-width: 0;
    min-height: 0;
    max-width: none;
    margin: 0;
  }

  .stutter-lab-shell button,
  .stutter-lab-shell select,
  .stutter-lab-shell input[type="number"] {
    min-width: 0;
    min-height: 0;
    border: 0;
    box-shadow: none;
    margin: 0;
    border-radius: calc(8 * var(--u));
    background: transparent;
    font: 400 calc(21 * var(--u))/1 Arial, sans-serif;
  }
  .stutter-lab-shell select {
    width: 100%;
    height: 100%;
    padding: 0 calc(21 * var(--u)) 0 calc(8 * var(--u));
    color: #f8f7f5;
    text-align: center;
  }
  .stutter-lab-shell select option { font: 400 14px/1.2 Arial, sans-serif; }
  .stutter-lab-shell :is(button, input, select, summary):focus-visible,
  .stutter-lab-bank input:focus-visible + label {
    outline: max(1px, calc(2 * var(--u))) solid var(--lab-cyan);
    outline-offset: max(1px, calc(2 * var(--u)));
    box-shadow: none;
  }
  .stutter-lab-shell button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #6dfcfd7d; }
  .stutter-lab-shell button:active:not(:disabled) { transform: none; }

  .stutter-lab-preset-label {
    --x: 1353; --y: 35; --w: 320; --h: 59;
    background: url("media/lab-native-preset.png") center/100% 100% no-repeat;
  }
  .stutter-lab-shell .stutter-lab-preset-label select {
    min-width: 0;
    width: 100%;
    text-align: left;
    padding-inline: calc(22 * var(--u)) calc(25 * var(--u));
    font-size: calc(27 * var(--u));
  }
  .stutter-lab-native-menu {
    --x: 1685; --y: 44; --w: 42; --h: 43;
    display: block;
    z-index: 7;
  }
  .stutter-lab-native-menu summary {
    width: 100%;
    height: 100%;
    border-radius: 5px;
    list-style: none;
    cursor: pointer;
  }
  .stutter-lab-native-menu summary::-webkit-details-marker { display: none; }
  .stutter-lab-native-menu-list {
    display: grid;
    gap: 1px;
    position: absolute;
    inset: 100% 0 auto auto;
    width: max(170px, calc(302 * var(--u)));
    padding: 5px;
    background: #201a24;
    border: 1px solid #8a778b;
    border-radius: calc(10 * var(--u));
    box-shadow: 0 8px 18px #000a;
    color: #fff;
    font: 400 max(11px, calc(19 * var(--u)))/1.25 Arial, sans-serif;
  }
  .stutter-lab-native-menu-list > :is(label, span, a) { padding: 8px; border-radius: 4px; }
  .stutter-lab-native-menu-list label { cursor: pointer; }
  .stutter-lab-native-menu-list > :is(label, a):hover { background: #4b2444; }
  .stutter-lab-native-menu-list span { color: #b6a9b9; }

  .stutter-lab-tabs {
    --x: 514; --y: 130; --w: 725; --h: 71;
    display: grid;
    width: auto;
    grid-template-columns: 355fr 365fr;
    gap: 0;
    padding: calc(2 * var(--u));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .stutter-lab[data-view="sample"] .stutter-lab-tabs { background: url("media/lab-native-sample.png") center/100% 100% no-repeat; }
  .stutter-lab[data-view="effect"] .stutter-lab-tabs { background: url("media/lab-native-effect.png") center/100% 100% no-repeat; }
  .stutter-lab-shell :is([data-lab-view="sample"], [data-lab-view="effect"]),
  .stutter-lab-shell :is([data-lab-view="sample"], [data-lab-view="effect"])[aria-pressed="true"] {
    color: transparent;
    background: none;
    text-shadow: none;
    min-height: 0;
    padding: 0;
    font-size: 0;
    border-radius: calc(23 * var(--u));
  }

  .stutter-lab-shell [data-lab-play] { --x: 49; --y: 210; --w: 59; --h: 45; }
  .stutter-lab-shell [data-lab-loop] { --x: 108; --y: 210; --w: 131; --h: 45; }
  .stutter-lab [data-lab-loop]::before {
    --loop-cue-angle: -42deg;
    bottom: calc(100% + 7px);
    width: clamp(47px, calc(101 * var(--u)), 82px);
    height: clamp(43px, calc(90 * var(--u)), 68px);
    filter: saturate(1.24) drop-shadow(0 2px 2px #350b31be) drop-shadow(0 0 4px #ff4e7e73);
  }
  .stutter-lab-shell [data-lab-export-locked] { --x: 270; --y: 210; --w: 191; --h: 45; }
  .stutter-lab-shell .stutter-lab-transport > button {
    color: transparent;
    font-size: 0;
    padding: 0;
  }
  .stutter-lab-shell [data-lab-export-locked] { background: #1b191c7a; border: 1px dashed #eee3e669; cursor: pointer; }
  .stutter-lab-shell [data-lab-export-locked]::after { display: none; }
  .stutter-lab-shell [data-lab-play][aria-pressed="true"] { color: transparent; background: url("media/lab-native-play-once.png") center/100% 100% no-repeat; }
  .stutter-lab-shell [data-lab-loop][aria-pressed="true"] { color: transparent; background: url("media/lab-native-play-loop.png") center/100% 100% no-repeat; }

  .stutter-lab-tempo {
    --x: 492; --y: 211; --w: 114; --h: 43;
    font-size: 0;
    background: url("media/lab-native-bpm.png") center/100% 100% no-repeat;
  }
  .stutter-lab-shell .stutter-lab-tempo input {
    width: 49%;
    height: 100%;
    padding: 0 0 0 calc(5 * var(--u));
    font-size: calc(20 * var(--u));
  }
  [data-theme="light"] .stutter-lab .stutter-lab-shell .stutter-lab-tempo input {
    color: var(--lab-ink);
    background: transparent;
    border: 0;
  }
  .stutter-lab-mode::before {
    --x: 637; --y: 210; --w: 266; --h: 43;
    content: "";
    pointer-events: none;
  }
  .stutter-lab[data-mode="stutter"] .stutter-lab-mode::before { background: url("media/lab-native-stutter-mode.png") center/100% 100% no-repeat; }
  .stutter-lab-shell .stutter-lab-mode > button,
  .stutter-lab-shell .stutter-lab-mode > button[aria-pressed="true"] {
    color: transparent;
    box-shadow: none;
    background: none;
    min-height: 0;
    font-size: 0;
    padding: 0;
    border-radius: calc(14 * var(--u));
  }
  .stutter-lab-mode [data-lab-mode="stutter"] { --x: 637; --y: 210; --w: 82; --h: 43; }
  .stutter-lab-mode [data-lab-native-mode-switch] { --x: 719; --y: 214; --w: 89; --h: 34; display: block; }
  .stutter-lab-mode [data-lab-mode="buildup"] { --x: 808; --y: 210; --w: 95; --h: 43; }
  .stutter-lab[data-mode="stutter"] .stutter-lab-division::before {
    --x: 1250; --y: 204; --w: 471; --h: 56;
    background: url("media/lab-native-stutter-rail.png") center/100% 100% no-repeat;
    content: "";
    pointer-events: none;
  }
  .stutter-lab-division label { display: block; font-size: 0; }
  .stutter-lab-division .stutter-lab-length {
    --x: 1111; --y: 210; --w: 138; --h: 45;
    background: url("media/lab-native-length.png") center/100% 100% no-repeat;
  }
  .stutter-lab-division :is(.stutter-lab-rate, .stutter-lab-repeats) {
    --x: 1364; --y: 210; --w: 138; --h: 45;
    background: url("media/lab-native-rate.png") center/100% 100% no-repeat;
  }
  .stutter-lab-shell .stutter-lab-repeats select {
    padding-inline: calc(8 * var(--u)) calc(35 * var(--u));
    font-size: calc(17 * var(--u));
  }
  .stutter-lab-division .stutter-lab-feel {
    --x: 1554; --y: 210; --w: 155; --h: 45;
    background: url("media/lab-native-feel.png") center/100% 100% no-repeat;
  }

  .stutter-lab-wave-panel {
    --x: 34; --y: 261; --w: 1690; --h: 362;
    padding: 0;
    border-radius: calc(12 * var(--u));
    background:
      url("media/lab-native-display-chrome.png") center/100% 100% no-repeat,
      url("media/lab-native-display.png") center/100% 100% no-repeat #0b0a0e;
  }
  .stutter-lab-wave-meta {
    position: absolute;
    inset: calc(8 * var(--u)) calc(30 * var(--u)) auto auto;
    top: auto;
    bottom: calc(13 * var(--u));
    right: calc(33 * var(--u));
    z-index: 2;
    font-size: calc(15 * var(--u));
    color: #d4c1cd;
    margin: 0;
    pointer-events: none;
  }
  .stutter-lab-wave-meta p:first-child {
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .stutter-lab-wave-meta p:last-child { opacity: .76; }
  .stutter-lab-wave-panel .stutter-lab-timeline {
    position: absolute;
    inset: calc(6 * var(--u)) auto auto calc(19 * var(--u));
    width: calc(1647 * var(--u));
    height: calc(341 * var(--u));
    border: 0;
    border-radius: 0;
  }
  .stutter-lab-cues button {
    font-size: max(9px, calc(17 * var(--u)));
    inset-block-start: max(18px, calc(24 * var(--u)));
    min-width: max(18px, calc(29 * var(--u)));
    height: max(19px, calc(28 * var(--u)));
    padding: 0 calc(4 * var(--u));
    border: 1px solid #e9deea;
    color: #fff;
    background: #130f15;
  }
  .stutter-lab-cues button[aria-pressed="true"] { color: #21140a; background: var(--lab-gold); border-color: #ffda79; }
  .stutter-lab-tray {
    position: absolute;
    top: calc(648 * var(--u));
    left: calc(-34 * var(--u));
    width: calc(1755 * var(--u));
    padding: 4px 0;
  }
  .stutter-lab-shell .stutter-lab-tray button {
    min-height: 33px;
    padding: 5px 9px;
    background: linear-gradient(#35303d, #1d1a22);
    border: 1px solid #5d5164;
    font-size: 12px;
  }
  .stutter-lab-shell .stutter-lab-tray button:disabled { opacity: .52; }

  .stutter-lab-bank {
    --x: 1042; --y: 630; --w: 647; --h: 37;
    display: grid;
    grid-template-columns: 151fr 157fr 174fr 165fr;
    gap: 0;
    padding: 0;
    z-index: 2;
  }
  .stutter-lab-shell:has([data-lab-bank="gate"]:checked) .stutter-lab-bank { background: url("media/lab-native-tab-gate.png") center/100% 100% no-repeat; }
  .stutter-lab-shell:has([data-lab-bank="pan"]:checked) .stutter-lab-bank { background: url("media/lab-native-tab-pan.png") center/100% 100% no-repeat; }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-bank { background: url("media/lab-native-tab-pitch.png") center/100% 100% no-repeat; }
  .stutter-lab-bank label,
  .stutter-lab-bank input:checked + label {
    padding: 0;
    background: none;
    border: none;
    color: transparent;
    font-size: 0;
    border-radius: calc(12 * var(--u));
  }
  .stutter-lab-bank label:hover { box-shadow: inset 0 0 0 1px #91f6f196; }
  .stutter-lab-bank-art {
    --x: 1015; --y: 674; --w: 690; --h: 198;
    display: block;
    pointer-events: none;
    background: url("media/lab-native-filter-panel.png") center/100% 100% no-repeat;
  }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-bank-art { background-image: url("media/lab-native-pitch-panel.png"); }
  .stutter-lab-shell:has([data-lab-bank="gate"]:checked) .stutter-lab-bank-art { background-image: url("media/lab-native-rhythm-gate.png"); }
  .stutter-lab-shell:has([data-lab-bank="pan"]:checked) .stutter-lab-bank-art { background-image: url("media/lab-native-rhythm-pan.png"); }
  .stutter-lab-shell:not(:has([data-lab-bank="filter"]:checked)) .stutter-lab-bank-art::before {
    position: absolute;
    top: calc(-7 * var(--u));
    left: calc(324 * var(--u));
    width: calc(198 * var(--u));
    height: calc(7 * var(--u));
    background: url("media/lab-native-bank-shadow-clear.png") center/100% 100% no-repeat;
    content: "";
  }

  .stutter-lab-shell .stutter-lab-knob { display: contents; }
  .stutter-lab-shell .stutter-lab-knob label,
  .stutter-lab-shell .stutter-lab-knob output {
    position: absolute;
    width: 1px;
    height: 1px;
    white-space: nowrap;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .stutter-lab-knob-face, .stutter-lab-knob input {
    --x: var(--knob-x); --y: var(--knob-y); --w: var(--knob-size); --h: var(--knob-size);
  }
  .stutter-lab-shell .stutter-lab-knob {
    --knob-y: 671;
    --knob-size: 144;
  }
  .stutter-lab-knob[data-lab-knob="gate"] {
    --knob-x: 97;
    --lab-knob-rim: url("media/lab-native-gate-base.png");
    --lab-knob-cap: url("media/lab-native-gate-marker.png");
  }
  .stutter-lab-knob[data-lab-knob="pan"] {
    --knob-x: 325;
    --lab-knob-rim: url("media/lab-native-pan-base.png");
    --lab-knob-cap: url("media/lab-native-pan-marker.png");
  }
  .stutter-lab-knob[data-lab-knob="lowCut"] {
    --knob-x: 554;
    --lab-knob-rim: url("media/lab-native-filter-base.png");
    --lab-knob-cap: url("media/lab-native-filter-marker.png");
  }
  .stutter-lab-knob[data-lab-knob="pitch"] {
    --knob-x: 782;
    --lab-knob-rim: url("media/lab-native-pitch-base.png");
    --lab-knob-cap: url("media/lab-native-pitch-marker.png");
  }
  .stutter-lab-shell .stutter-lab-small-knob { --knob-y: 731; --knob-size: 88; }
  .stutter-lab-knob[data-lab-knob="frequency"] { --knob-x: 1112; }
  .stutter-lab-knob[data-lab-knob="bellGain"] { --knob-x: 1311; }
  .stutter-lab-knob[data-lab-knob="q"] { --knob-x: 1499; }
  .stutter-lab-shell .stutter-lab-knob[data-lab-knob="formant"] {
    --knob-x: 1292;
    --knob-y: 711;
    --knob-size: 116;
    --lab-knob-rim: none;
    --lab-knob-cap: url("media/lab-native-pitch-panel-marker.png");
  }
  .stutter-lab-shell .stutter-lab-knob-face { grid-row: auto; }
  .stutter-lab-shell .stutter-lab-knob input[type="range"] {
    height: calc(var(--h) * var(--u));
    width: calc(var(--w) * var(--u));
    grid-row: auto;
    padding: 0;
    margin: 0;
    background: transparent;
    color: transparent;
    cursor: ns-resize;
    border-radius: 50%;
    clip-path: none;
    touch-action: none;
  }
  .stutter-lab-knob input[type="range"]::-webkit-slider-runnable-track { background: transparent; }
  .stutter-lab-knob input[type="range"]::-moz-range-track { background: transparent; }
  .stutter-lab-knob input[type="range"]::-webkit-slider-thumb { background: transparent; border: 0; box-shadow: none; }
  .stutter-lab-knob input[type="range"]::-moz-range-thumb { background: transparent; border: 0; box-shadow: none; }

  .stutter-lab-shell:not(:has([data-lab-bank="pitch"]:checked)) [data-lab-knob="formant"],
  .stutter-lab-shell:not(:has([data-lab-bank="filter"]:checked)) .stutter-lab-small-knob { display: none; }
  .stutter-lab-shell:has([data-lab-bank="filter"]:checked) .stutter-lab-small-knob { display: contents; }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) [data-lab-knob="pitch"] input {
    --x: 1086; --y: 711; --w: 116; --h: 116;
  }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-pitch-shift-face {
    --x: 1086; --y: 711; --w: 116; --h: 116;
    display: block;
    background: url("media/lab-native-pitch-panel-marker.png") center/100% 100% no-repeat;
    transform: rotate(var(--lab-angle));
    pointer-events: none;
  }

  .stutter-lab-shell .stutter-lab-knob:is(.stutter-lab-small-knob, [data-lab-knob="formant"]) output,
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-knob[data-lab-knob="pitch"] output {
    --x: calc(var(--knob-x) + var(--knob-size) / 2 - 52);
    --y: 843;
    --w: 104;
    --h: 23;
    width: calc(var(--w) * var(--u));
    height: calc(var(--h) * var(--u));
    clip-path: none;
    color: #fff;
    overflow: visible;
    background: transparent;
    font: 400 calc(20 * var(--u))/1.1 Arial, sans-serif;
  }
  .stutter-lab-shell .stutter-lab-knob[data-lab-knob="formant"] output { --y: 849; }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-knob[data-lab-knob="pitch"] output { --x: 1092; --y: 849; }

  .stutter-lab-shell .stutter-lab-filter-type {
    --x: 1204; --y: 676; --w: 298; --h: 43;
    display: none;
    padding: 0;
  }
  .stutter-lab-shell:has([data-lab-bank="filter"]:checked) .stutter-lab-filter-type { display: block; padding: 0; }
  .stutter-lab-filter-type:has(option[value="high"]:checked) { background: url("media/lab-native-filter-high-cut.png") center/100% 100% no-repeat; }
  .stutter-lab-shell .stutter-lab-filter-type select { height: 100%; font-size: 0; color: transparent; min-height: 0; }
  .stutter-lab-shell .stutter-lab-filter-type select option { color: #fff; font-size: 14px; }
  .stutter-lab-shell .stutter-lab-pitch-range {
    --x: 1500; --y: 746; --w: 155; --h: 45;
    padding: 0;
    font-size: 0;
    background: url("media/lab-native-pitch-range.png") center/100% 100% no-repeat;
  }
  .stutter-lab-shell:has([data-lab-bank="pitch"]:checked) .stutter-lab-pitch-range { padding: 0; }

  .stutter-lab-shell .stutter-lab-bank-rhythm { display: none; }
  .stutter-lab-shell:has([data-lab-bank="gate"]:checked) .stutter-lab-bank-rhythm-gate,
  .stutter-lab-shell:has([data-lab-bank="pan"]:checked) .stutter-lab-bank-rhythm-pan { display: contents; }
  .stutter-lab-bank-rate {
    --x: 1119; --y: 727; --w: 482; --h: 51;
    display: block;
    font-size: 0;
  }
  .stutter-lab-bank-rate select { font-size: calc(28 * var(--u)); }
  /* The storefront enforces a global important label size. Desktop legends live in the artwork. */
  .stutter-lab-shell :is(.stutter-lab-tempo, .stutter-lab-control, .stutter-lab-bank-rate, .stutter-lab-pitch-range) {
    font-size: 0 !important;
  }
  .stutter-lab-shell :is(.stutter-lab-control, .stutter-lab-bank-rate, .stutter-lab-pitch-range) > span {
    display: none;
  }
  .stutter-lab-bank-feel { display: none; }
  .stutter-lab-bank-feel-switch {
    --x: 1119; --y: 799; --w: 482; --h: 44;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: calc(7 * var(--u));
    background: url("media/lab-native-rhythm-straight.png") center/100% 100% no-repeat;
  }
  .stutter-lab-bank-rhythm:has(.stutter-lab-bank-feel option[value="triplet"]:checked) .stutter-lab-bank-feel-switch { background-image: url("media/lab-native-rhythm-triplet.png"); }
  .stutter-lab-bank-rhythm:has(.stutter-lab-bank-feel option[value="dotted"]:checked) .stutter-lab-bank-feel-switch { background-image: url("media/lab-native-rhythm-dotted.png"); }
  .stutter-lab-shell .stutter-lab-bank-feel-switch button { color: transparent; font-size: 0; padding: 0; }
}
