@font-face {
  font-family: "IBM Plex Sans";
  src: url("/fonts/plexsans-var.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --studio-cream: #fcf8f1;
  --studio-surface: rgba(255, 253, 249, 0.96);
  --studio-surface-solid: #fffdf9;
  --studio-purple: #4d0d4a;
  --studio-purple-hover: #641560;
  --studio-purple-soft: #f4ecf3;
  --studio-purple-line: rgba(77, 13, 74, 0.12);
  --studio-purple-line-strong: rgba(77, 13, 74, 0.24);
  --studio-ink: #271f27;
  --studio-muted: #5b4e5d; /* >= 6.9:1 on #fffdf9 and #fcf8f1 (WCAG AA/AAA) */
  --studio-shadow: 0 10px 34px rgba(77, 13, 74, 0.08), 0 1px 3px rgba(77, 13, 74, 0.05);
  --studio-shadow-soft: 0 4px 16px rgba(77, 13, 74, 0.06);
  --r-card: 22px;
  --r-dock: 24px;
  --r-tile: 16px;
  --r-control: 11px;
  font-family: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--studio-ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--studio-cream);
  touch-action: pan-x pan-y;
}
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
main {
  width: 100%;
  height: 100%;
}

button, input { font: inherit; color: inherit; }
button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2.5px solid var(--studio-purple);
  outline-offset: 2px;
}
[hidden] { display: none !important; }

/* Full-bleed Studio Stage */
#stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 49% 40%, #fffdf9 0%, #fbf6ee 54%, #f2eae0 100%);
}
#viewport {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 106px;
}
#viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: none;
  cursor: grab;
}
#viewport canvas:active { cursor: grabbing; }

.studio-ui {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.studio-ui img {
  -webkit-user-drag: none;
  pointer-events: none;
}

/* Top-left Brand Lockup */
.studio-top-left {
  position: absolute;
  top: 24px;
  left: 28px;
  right: 268px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}
.brand-logo {
  width: 106px;
  height: auto;
  display: block;
}
.brand-divider {
  width: 1px;
  height: 24px;
  background: rgba(77, 13, 74, 0.22);
}
.brand-lockup h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--studio-purple);
}
.back-link {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--studio-purple-line);
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow-soft);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--studio-ink);
  transition: border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}
.back-link:hover {
  border-color: var(--studio-purple);
  color: var(--studio-purple);
}
.back-short { display: none; }
.is-embedded .back-link { display: none; }

/* Top-left Hardware Switches */
#studioLeft {
  position: absolute;
  top: 72px;
  left: 28px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.studio-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--studio-muted);
  font-variant-numeric: tabular-nums;
}
.studio-summary strong {
  color: var(--studio-purple);
  font-weight: 600;
}
.summary-sep {
  opacity: 0.45;
}
.studio-switches {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.pill-switch {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: rgba(77, 13, 74, 0.075);
  border: 1px solid rgba(77, 13, 74, 0.06);
}
.pill-switch button {
  min-height: 32px;
  padding: 4px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-muted);
  white-space: nowrap;
}
.pill-switch button:hover {
  color: var(--studio-purple);
}
.pill-switch button[aria-pressed="true"] {
  background: var(--studio-surface-solid);
  color: var(--studio-purple);
  font-weight: 600;
  box-shadow: 0 1px 5px rgba(77, 13, 74, 0.14);
}
.gas-switch button small {
  font-size: 11px;
  font-weight: 400;
  color: var(--studio-muted);
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}
.gas-switch button[aria-pressed="true"] small {
  color: var(--studio-muted);
}

/* Top-right Floating Studio Card (Tilt + Height + Footring) */
#studioCard {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 11;
  width: 218px;
  padding: 16px;
  border-radius: var(--r-card);
  border: 1px solid rgba(77, 13, 74, 0.09);
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--studio-purple);
}
#angleVal {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--studio-muted);
  font-variant-numeric: tabular-nums;
}
#motionPad {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(77, 13, 74, 0.15);
  background: #f4eef3;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
}
.pad-ring {
  position: absolute;
  width: 76%;
  height: 76%;
  left: 12%;
  top: 12%;
  border-radius: 50%;
  border: 1px solid rgba(77, 13, 74, 0.16);
  pointer-events: none;
}
.pad-ring::after {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  border: 1px dashed rgba(77, 13, 74, 0.15);
}
.pad-line {
  position: absolute;
  background: rgba(77, 13, 74, 0.15);
  pointer-events: none;
}
.pad-line.horizontal {
  left: 8%;
  width: 84%;
  top: 50%;
  height: 1px;
}
.pad-line.vertical {
  top: 8%;
  height: 84%;
  left: 50%;
  width: 1px;
}
#padKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--studio-purple);
  border: 3px solid var(--studio-surface-solid);
  box-shadow: 0 2px 8px rgba(77, 13, 74, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pad-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 10.5px;
  color: var(--studio-muted);
}

.card-ergo-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.studio-slider label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-purple);
  margin-bottom: 2px;
}
.studio-slider output {
  font-weight: 600;
  color: var(--studio-ink);
  font-variant-numeric: tabular-nums;
}
.studio-slider input[type="range"] {
  display: block;
  width: 100%;
  height: 26px;
  margin: 0;
  accent-color: var(--studio-purple);
  cursor: pointer;
}
.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--studio-muted);
  font-variant-numeric: tabular-nums;
  margin-top: -2px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 36px;
  padding: 6px 2px;
  border: 0;
  border-top: 1px solid rgba(77, 13, 74, 0.09);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-ink);
  text-align: left;
}
.switch-row i {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #bcb2bc;
  flex: none;
  transition: background 0.15s ease;
}
.switch-row i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.switch-row[aria-checked="true"] i {
  background: var(--studio-purple);
}
.switch-row[aria-checked="true"] i::after {
  transform: translateX(14px);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(77, 13, 74, 0.09);
}
.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--studio-purple-line-strong);
  background: var(--studio-surface-solid);
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-purple);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.action-pill:hover {
  background: var(--studio-purple-soft);
}
.action-pill[aria-pressed="true"] {
  background: var(--studio-purple);
  border-color: var(--studio-purple);
  color: #fff;
}
.action-link {
  min-height: 34px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.action-link:hover {
  color: var(--studio-purple);
}

/* Bottom-left Interaction Hint */
#stageHint {
  position: absolute;
  left: 28px;
  bottom: 34px;
  z-index: 9;
  pointer-events: none;
}
#interactionHint {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.88);
  font-size: 11.5px;
  color: var(--studio-muted);
}

/* Bottom Centered Studio Dock */
#studioDockWrap {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 12;
  max-width: calc(100% - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
#studioViewNote {
  margin: 0;
  max-width: min(440px, calc(100vw - 48px));
  padding: 9px 14px;
  border-radius: 14px;
  border: 1px solid var(--studio-purple-line);
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow-soft);
  font-size: 12px;
  line-height: 1.45;
  color: var(--studio-ink);
  text-align: center;
}
#studioDock {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-dock);
  border: 1px solid rgba(77, 13, 74, 0.09);
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow);
}
.dock-divider {
  width: 1px;
  align-self: stretch;
  margin: 6px 0;
  background: rgba(77, 13, 74, 0.12);
  flex: none;
}

.dock-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-tile);
  border: 1px solid rgba(77, 13, 74, 0.09);
  background: #ffffff;
}
.tile-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tile-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--studio-muted);
  line-height: 1.1;
}
#colourVal {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--studio-purple);
  line-height: 1.15;
}

/* Colour Swatch Dots inside Dock */
.swatch-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.swatch-dot-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgba(39, 31, 39, 0.24);
  transition: width 0.16s ease, box-shadow 0.16s ease;
}
.swatch-dot-btn:hover {
  box-shadow: 0 0 0 2px var(--studio-purple);
}
.swatch-dot-btn[aria-pressed="true"] {
  width: 28px;
  box-shadow: 0 0 0 2px var(--studio-purple);
}

.circle-action {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  transition: transform 0.12s ease, opacity 0.14s ease;
}
.circle-action:active {
  transform: scale(0.95);
}
.swatch-cycle {
  background: var(--active-swatch, #6c7f90);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(77, 13, 74, 0.18);
}
.plum-cycle {
  background: var(--studio-purple);
  color: #fff;
  box-shadow: 0 2px 8px rgba(77, 13, 74, 0.24);
}
.plum-cycle:hover {
  background: var(--studio-purple-hover);
}

/* View Mode Pills inside Dock */
.mode-pills {
  display: inline-flex;
  gap: 2px;
  margin-top: 1px;
}
.mode-pills button {
  min-height: 28px;
  padding: 4px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-muted);
  white-space: nowrap;
}
.mode-pills button:hover {
  background: var(--studio-purple-soft);
  color: var(--studio-purple);
}
.mode-pills button.is-active,
.mode-pills button.is-active:hover,
.mode-pills button[aria-pressed="true"],
.mode-pills button[aria-pressed="true"]:hover {
  background: var(--studio-purple);
  color: #fff;
  font-weight: 600;
}

/* Camera Presets inside Dock */
.dock-camera {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
}
.dock-camera button {
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--studio-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.dock-camera button:hover {
  background: var(--studio-purple-soft);
  color: var(--studio-purple);
}
.dock-camera button[aria-pressed="true"] {
  background: var(--studio-purple-soft);
  color: var(--studio-purple);
  font-weight: 600;
}
.spin-btn[aria-pressed="true"] {
  background: var(--studio-purple);
  color: #fff;
}

/* Bottom-right Provenance Pill & Popover */
#studioProvenance {
  position: absolute;
  right: 28px;
  bottom: 30px;
  z-index: 10;
}
#infoBtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--studio-purple-line);
  background: var(--studio-surface);
  box-shadow: var(--studio-shadow-soft);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--studio-muted);
}
#infoBtn:hover {
  border-color: var(--studio-purple);
  color: var(--studio-purple);
}
.info-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--studio-purple-soft);
  color: var(--studio-purple);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
#infoPopover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: 270px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--studio-purple-line);
  background: var(--studio-surface-solid);
  box-shadow: var(--studio-shadow);
  font-size: 12px;
  line-height: 1.5;
  color: var(--studio-muted);
}
#infoPopover strong {
  display: block;
  color: var(--studio-purple);
  margin-bottom: 4px;
  font-size: 12.5px;
}
#infoPopover p { margin: 0; }

/* Optional ?tune=1 Panel */
.tune-panel {
  position: absolute;
  left: 28px;
  bottom: 112px;
  z-index: 15;
  width: 248px;
  padding: 13px 14px;
  border-radius: 18px;
  background: var(--studio-surface-solid);
  border: 1px solid var(--studio-purple-line-strong);
  box-shadow: var(--studio-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tune-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--studio-purple);
}
.tune-head button {
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 8px;
  border: 1px solid var(--studio-purple-line-strong);
  background: var(--studio-surface-solid);
  font-size: 11px;
}
.tune-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tune-lbl {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 500;
}
.tune-lbl output { color: var(--studio-muted); font-variant-numeric: tabular-nums; }
.tune-row input[type="range"] { width: 100%; height: 22px; accent-color: var(--studio-purple); margin: 0; }
.tune-row small { font-size: 10.5px; color: var(--studio-muted); line-height: 1.25; }
.tune-copy {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid var(--studio-purple);
  background: var(--studio-purple);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
}

/* Loading & WebGL Fallback Overlays */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 28px;
  background: #fcf8f1;
}
.overlay h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--studio-purple);
}
.overlay p {
  margin: 0;
  max-width: 420px;
  color: var(--studio-muted);
  line-height: 1.55;
  font-size: 13.5px;
}
.overlay img {
  max-width: 360px;
  width: 100%;
  height: auto;
  border-radius: 16px;
  border: 1px solid var(--studio-purple-line);
}
.fatal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 4px;
}
.reload-btn {
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 0;
  background: var(--studio-purple);
  color: #fff;
  font-weight: 600;
}
.reload-btn:hover {
  background: var(--studio-purple-hover);
}
.fallback-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--studio-purple-line-strong);
  background: var(--studio-surface-solid);
  color: var(--studio-purple);
  font-weight: 600;
  text-decoration: none;
}
.fallback-link:hover {
  background: var(--studio-purple-soft);
  border-color: var(--studio-purple);
}
.spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(77, 13, 74, 0.16);
  border-top-color: var(--studio-purple);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Medium desktop / embedded iframe (~900-1180px wide) */
@media (max-width: 1180px) {
  #stageHint, #studioProvenance { display: none; }
  #studioDock { gap: 8px; padding: 7px 9px; }
  .dock-tile { padding: 7px 8px 7px 12px; gap: 10px; }
  .dock-camera button { padding: 6px 8px; }
  .spin-btn span { display: none; }
}

/* Compact desktop / tablet (<= 900px) */
@media (max-width: 900px) {
  .studio-top-left { top: 16px; left: 16px; right: 226px; }
  #studioLeft { top: 62px; left: 16px; }
  #studioCard { top: 16px; right: 16px; width: 198px; padding: 13px; }
  .brand-logo { width: 92px; }
  .brand-lockup h1 { font-size: 20px; }
  #studioDock { flex-wrap: wrap; justify-content: center; border-radius: 20px; }
  .dock-cam-divider { display: none; }
}

/* Mobile Layout (<= 740px, verified at 390x844@2x) */
@media (max-width: 740px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  main { height: auto; }
  #stage {
    height: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding-bottom: 24px;
  }

  .studio-top-left {
    order: -3;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    padding: 14px 16px 6px;
    pointer-events: auto;
  }
  .brand-logo { width: 88px; }
  .brand-divider { height: 20px; }
  .brand-lockup { gap: 10px; }
  .brand-lockup h1 { font-size: 19px; }
  .back-full { display: none; }
  .back-short { display: inline; }
  .back-link { min-height: 36px; padding: 6px 12px; font-size: 12px; }

  #viewport {
    order: -2;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    height: 43svh;
    min-height: 300px;
    max-height: 390px;
    flex: none;
  }

  #stageHint {
    order: -1;
    display: block;
    position: relative;
    left: auto;
    bottom: auto;
    padding: 0 16px 10px;
    text-align: center;
  }
  #interactionHint {
    background: transparent;
    padding: 0;
    font-size: 11px;
  }

  #studioDockWrap {
    order: 0;
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    max-width: none;
    width: 100%;
    padding: 0 14px;
    margin-bottom: 12px;
  }
  #studioDock {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border-radius: 20px;
  }
  .dock-divider { display: none; }
  .dock-tile {
    width: 100%;
    justify-content: space-between;
    min-height: 54px;
    padding: 8px 10px 8px 12px;
  }
  .swatch-dot-btn {
    width: 24px;
    height: 24px;
  }
  .swatch-dot-btn[aria-pressed="true"] {
    width: 34px;
  }
  .mode-pills {
    flex-wrap: wrap;
    gap: 4px;
  }
  .mode-pills button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }
  .dock-camera {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 0;
  }
  .dock-camera button {
    justify-content: center;
    min-height: 40px;
    padding: 6px 4px;
    font-size: 11.5px;
    border: 1px solid var(--studio-purple-line);
    background: #fff;
  }
  .spin-btn span { display: none; }

  #studioLeft {
    order: 1;
    position: relative;
    top: auto;
    left: auto;
    width: calc(100% - 28px);
    margin: 0 14px 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(77, 13, 74, 0.09);
    background: var(--studio-surface-solid);
    box-shadow: var(--studio-shadow-soft);
    align-items: stretch;
  }
  .studio-switches {
    width: 100%;
    align-items: stretch;
    gap: 8px;
  }
  .pill-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .pill-switch.gas-switch {
    grid-template-columns: repeat(2, 1fr);
  }
  .pill-switch button {
    min-height: 40px;
    font-size: 12.5px;
  }

  #studioCard {
    order: 2;
    position: relative;
    top: auto;
    right: auto;
    width: calc(100% - 28px);
    margin: 0 14px 12px;
    padding: 14px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
  }
  .card-pad-area {
    display: flex;
    flex-direction: column;
  }
  .pad-axis {
    flex-direction: column;
    gap: 1px;
    font-size: 9.5px;
  }
  .studio-slider input[type="range"] {
    height: 36px;
  }
  .switch-row {
    min-height: 44px;
  }
  .action-pill, .action-link {
    min-height: 40px;
  }

  #studioProvenance {
    order: 3;
    display: block;
    position: relative;
    right: auto;
    bottom: auto;
    margin: 0 14px;
  }
  #infoBtn {
    width: 100%;
    justify-content: space-between;
    min-height: 44px;
    padding: 8px 14px;
    border-radius: 14px;
  }
  #infoPopover {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    margin-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
