.app-shell {
  --panel-bg: rgba(13, 17, 25, 0.9);
  --panel-bg-soft: rgba(255, 255, 255, 0.035);
  --panel-bg-strong: rgba(255, 255, 255, 0.065);
  --panel-border: rgba(255, 255, 255, 0.12);
  --panel-border-strong: rgba(159, 231, 255, 0.24);
  --text-primary: rgba(238, 246, 255, 0.94);
  --text-secondary: rgba(238, 246, 255, 0.66);
  --text-muted: rgba(238, 246, 255, 0.48);
  --accent: #35e0c2;
  --accent-soft: rgba(53, 224, 194, 0.14);
  --radius: 8px;
  --control-height: 38px;
  --shadow-panel: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.player-shell {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.player-stage {
  width: 100vw;
  height: 100vh;
}

.player-controls {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  max-width: min(920px, calc(100vw - 28px));
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: rgba(7, 9, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  opacity: 0.18;
  transition: opacity 160ms ease;
}

.static-toggle {
  display: inline-flex;
  min-height: var(--control-height, 38px);
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.18));
  border-radius: var(--radius, 8px);
  background: var(--panel-bg-strong, rgba(255, 255, 255, 0.08));
  color: var(--text-secondary, rgba(238, 246, 255, 0.7));
  font-size: 13px;
  line-height: 1.2;
}

.static-toggle input {
  accent-color: var(--accent, #35e0c2);
}

.lock-palette-toggle,
.lock-playback-toggle,
.lock-image-toggle,
.lock-text-toggle {
  min-height: 34px;
  margin: 0;
  white-space: nowrap;
}

.debug-readout {
  position: fixed;
  left: 14px;
  top: 14px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 10px;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(7, 9, 16, 0.82);
  color: rgba(238, 246, 255, 0.82);
  font-size: 12px;
}

.debug-readout div {
  display: grid;
  gap: 2px;
}

.debug-readout dt,
.debug-readout dd {
  margin: 0;
}

.debug-readout dt {
  color: rgba(238, 246, 255, 0.52);
}

.debug-readout dd {
  font-variant-numeric: tabular-nums;
}

.app-status {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 28px));
  padding: 10px 13px;
  border: 1px solid var(--panel-border-strong, rgba(159, 231, 255, 0.24));
  border-radius: 999px;
  background: rgba(7, 9, 16, 0.74);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
  color: rgba(238, 246, 255, 0.92);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  backdrop-filter: blur(14px) saturate(130%);
}

.app-status.is-busy {
  padding-left: 32px;
}

.app-status.is-busy::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  border: 2px solid rgba(159, 231, 255, 0.25);
  border-top-color: rgba(159, 231, 255, 0.9);
  border-radius: 999px;
  animation: app-status-spin 860ms linear infinite;
}

@keyframes app-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.player-controls:hover,
.player-controls:focus-within {
  opacity: 1;
}

.player-controls a,
button,
select,
input,
textarea {
  color: #eef6ff;
}

.player-controls a,
button,
select {
  min-height: var(--control-height, 38px);
  border: 1px solid var(--panel-border, rgba(255, 255, 255, 0.18));
  border-radius: var(--radius, 8px);
  background: var(--panel-bg-strong, rgba(255, 255, 255, 0.08));
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button,
select {
  padding: 0 11px;
  cursor: pointer;
}

button:hover,
select:hover,
.player-controls a:hover {
  border-color: rgba(159, 231, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
}

.player-controls a {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
}

.app-shell,
.studio-shell {
  min-height: 100vh;
  overflow: hidden;
}

.app-layout {
  min-height: 100vh;
  background: #05070c;
}

.app-stage,
.app-stage .preview-stage {
  position: fixed;
  inset: 0;
}

.studio-layout {
  display: block;
  min-height: 100vh;
}

.preview-panel {
  min-width: 0;
  background: #05070c;
}

.preview-stage {
  width: 100%;
  height: 100vh;
}

.editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 12;
  width: clamp(420px, 34vw, 760px);
  max-height: 100vh;
  overflow: auto;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(22, 27, 37, 0.96), rgba(11, 14, 21, 0.94)),
    var(--panel-bg);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: -18px 0 56px rgba(0, 0, 0, 0.42);
  transition: transform 180ms ease, opacity 180ms ease;
  scrollbar-color: rgba(159, 231, 255, 0.34) rgba(255, 255, 255, 0.04);
}

.app-shell.editor-hidden .editor-panel {
  pointer-events: none;
  transform: translateX(100%);
  opacity: 0;
}

.editor-toggle {
  display: inline-block;
}

.app-shell.editor-hidden .editor-toggle {
  opacity: 0.22;
}

.app-shell.editor-hidden .editor-toggle:hover,
.app-shell.editor-hidden .editor-toggle:focus-visible {
  opacity: 1;
}

.editor-title,
.toolbar,
.effect-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.editor-title {
  position: sticky;
  top: -20px;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  margin: -20px -20px 18px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 14, 21, 0.82);
  backdrop-filter: blur(16px) saturate(130%);
}

.editor-title-actions {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  max-width: none;
  margin-top: 12px;
}

.editor-title p {
  margin: 0 0 2px;
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor-title h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.editor-toggle {
  grid-column: 2;
  grid-row: 1;
}

.preset-status {
  margin: 4px 0 0;
  color: rgba(255, 230, 109, 0.84);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.25;
}

.field > span,
.motion-step-field span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.field input[type="text"],
.field input[type="number"],
.field input[type="color"],
.field textarea,
.field select,
.toolbar select,
.effect-header select {
  width: 100%;
  min-height: var(--control-height);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.065);
  color: #eef6ff;
}

.field input[type="text"],
.field input[type="number"],
.field textarea {
  padding: 10px;
}

.field input[type="range"] {
  min-height: 28px;
  accent-color: var(--accent);
}

.field input[type="color"] {
  padding: 4px;
}

.field input[type="text"]:focus,
.field input[type="number"]:focus,
.field textarea:focus,
.field select:focus,
button:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(53, 224, 194, 0.34);
  outline-offset: 2px;
}

.number-stepper {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  gap: 5px;
}

.number-stepper input[type="number"] {
  min-width: 0;
  text-align: center;
}

.number-stepper button {
  min-height: var(--control-height);
  padding: 0;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(238, 246, 255, 0.72);
  font-size: 14px;
  line-height: 1;
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input {
  width: 20px;
  height: 20px;
  accent-color: #35e0c2;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

.preset-manager {
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.playback-manager,
.preset-editor-section {
  display: block;
  margin: 0 0 20px;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.playback-manager > summary,
.preset-editor-section > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.playback-manager[open] > summary,
.preset-editor-section[open] > summary {
  border-bottom-color: rgba(159, 231, 255, 0.14);
  background: linear-gradient(90deg, rgba(53, 224, 194, 0.11), rgba(255, 255, 255, 0.035));
}

.playback-manager > :not(summary),
.preset-editor-section > :not(summary) {
  margin-right: 14px;
  margin-left: 14px;
}

.playback-manager > summary + *,
.preset-editor-section > summary + * {
  margin-top: 14px;
}

.playback-manager > :last-child,
.preset-editor-section > :last-child {
  margin-bottom: 14px;
}

.playback-manager .static-toggle {
  align-self: start;
  margin-bottom: 14px;
}

.loop-status {
  margin: -2px 0 14px;
  color: rgba(159, 231, 255, 0.8);
  font-size: 12px;
  line-height: 1.35;
}

.quick-export {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 16px;
  padding: 10px;
  border: 1px solid rgba(159, 231, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(53, 224, 194, 0.045);
}

.quick-export button {
  min-width: 0;
  padding: 0 8px;
}

.export-status {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: rgba(159, 231, 255, 0.8);
  font-size: 12px;
}

.playback-effects,
.image-influence-section {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.095);
}

.image-influence-section {
  margin-top: 16px;
}

.playback-effects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.playback-effects-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.2;
}

.playback-effect-group {
  padding: 0 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.playback-effect-group summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  position: relative;
}

.playback-effect-group[open] {
  border-color: rgba(159, 231, 255, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.playback-effect-group[open] summary {
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent);
  margin-bottom: 1em;
}

.playback-effect-group summary:after {
  content: "▶";
  right: 0;
  position: absolute;
  font-style: normal;
  transition: rotate .2s;
}

.playback-effect-group[open] summary:after {
  rotate: 90deg;
}

.playback-effect-group .field:last-child,
.playback-effect-group .static-toggle:last-child {
  margin-bottom: 0;
}

.preset-select-field {
  margin-bottom: 10px;
}

.preset-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preset-actions button {
  min-width: 0;
  padding: 0 8px;
}

#savePresetButton,
#saveAsPresetButton,
#exportButton,
#copyJsonButton,
#exportAllButton {
  border-color: rgba(159, 231, 255, 0.2);
  background: rgba(159, 231, 255, 0.075);
}

#randomizeButton,
#stageRandomizeButton,
#randomizeColorsButton {
  border-color: rgba(53, 224, 194, 0.32);
  background: rgba(53, 224, 194, 0.13);
  color: rgba(236, 255, 250, 0.96);
}

#deletePresetButton,
#resetBuiltInsButton,
#resetPlaybackEffectsButton,
.step-remove-button {
  border-color: rgba(255, 110, 142, 0.18);
  color: rgba(255, 210, 220, 0.82);
}

.palette-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 11px;
  margin-bottom: 16px;
}

.palette-color {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.115);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.palette-color input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.palette-color input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  color: #eef6ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.effect-color {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.effect-color input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 0;
}

.effect-color input[type="text"] {
  height: 38px;
  min-height: 38px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.effect-color .palette-reroll {
  grid-column: 1 / -1;
  margin: 0;
}

.palette-reroll {
  grid-column: 1 / -1;
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(238, 246, 255, 0.76);
  font-size: 12px;
}

.toolbar {
  margin: 12px 0 16px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.026);
}

.toolbar select {
  min-width: 0;
  flex: 1;
}

.effects-list {
  display: grid;
  gap: 14px;
}

.effect-editor {
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.052), rgba(255, 255, 255, 0.032));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.effect-header {
  margin: -2px 0 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.effect-header input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.compact-field {
  margin-bottom: 10px;
}

.motion-sequence-editor {
  display: grid;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 12px;
  border: 1px solid rgba(88, 219, 204, 0.2);
  border-radius: var(--radius);
  background: rgba(42, 230, 204, 0.055);
}

.movement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.movement-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.2;
}

.sequence-toggle {
  margin: 0;
}

.motion-sequence-steps,
.sequence-actions {
  display: grid;
  gap: 12px;
}

.motion-sequence-step {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(8, 12, 20, 0.34);
}

.motion-sequence-step h3 {
  margin: 0;
  color: rgba(238, 246, 255, 0.84);
  font-size: 13px;
  line-height: 1.2;
}

.motion-step-stack {
  display: grid;
  gap: 10px;
}

.motion-step-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.motion-step-field {
  display: grid;
  grid-template-columns: minmax(72px, 0.42fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.motion-step-pair .motion-step-field {
  grid-template-columns: 1fr;
  gap: 5px;
}

.motion-step-field select,
.motion-step-field input,
.motion-sequence-step button {
  min-width: 0;
}

.motion-step-field input,
.motion-step-field select {
  width: 100%;
}

.step-remove-button {
  justify-self: stretch;
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(238, 246, 255, 0.72);
}

.sequence-actions {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.sequence-actions button {
  width: 100%;
  min-width: 0;
  padding: 0 8px;
}

.base-motion-details,
.appearance-details,
.effect-params-details {
  margin: 0 0 9px;
  padding: 0 10px 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.024);
  color: var(--text-secondary);
  font-size: 13px;
}

.base-motion-details summary,
.appearance-details summary,
.effect-params-details summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 700;
  position: relative;
}

.base-motion-details summary:after,
.appearance-details summary:after,
.effect-params-details summary:after{
  content: "▶";
  right: 0;
  position: absolute;
  font-style: normal;
  transition: rotate .2s;
}

.base-motion-details[open],
.appearance-details[open],
.effect-params-details[open] {
  border-color: rgba(159, 231, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
}

.base-motion-details[open] summary,
.appearance-details[open] summary,
.effect-params-details[open] summary {
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent);
  margin-bottom: 1em;
}

.base-motion-details[open] summary:after,
.appearance-details[open] summary:after,
.effect-params-details[open] summary:after{
  rotate: -90deg;
}

.effect-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 10px;
  padding-bottom: 10px;
}

.effect-params-grid .full-field {
  grid-column: 1 / -1;
}

.json-field {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.032);
}

.json-field textarea {
  min-height: 220px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.launcher-shell {
  min-height: 100vh;
  overflow: hidden;
}

.launcher-app {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.launcher-preview {
  position: fixed;
  inset: 0;
}

.launcher-preview .fs-label {
  display: none;
}

.launcher-panel {
  position: relative;
  z-index: 4;
  width: min(100%, 340px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(6, 8, 14, 0.76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
}

.launcher-title {
  margin-bottom: 16px;
}

.launcher-title p,
.launcher-title h1 {
  margin: 0;
}

.launcher-title p {
  color: rgba(238, 246, 255, 0.58);
  font-size: 12px;
  text-transform: uppercase;
}

.launcher-title h1 {
  margin-top: 2px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.launcher-static-toggle {
  width: 100%;
  justify-content: flex-start;
  margin: 0 0 14px;
}

.launcher-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.launcher-actions button {
  width: 100%;
}

.launcher-actions button:last-child {
  grid-column: 1 / -1;
}

button:disabled {
  cursor: default;
  opacity: 0.46;
}

.stage-actions {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  max-width: calc(100vw - 2rem);
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius);
  background: rgba(7, 9, 16, 0.54);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.26);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px) saturate(130%);
  transition: opacity 160ms ease, background 160ms ease;
}

.app-shell.editor-hidden .stage-actions {
  opacity: 1;
  pointer-events: auto;
}

.stage-actions button {
  min-width: 0;
  background: rgba(255, 255, 255, 0.09);
}

.fs-label {
  left: 20px;
  bottom: 18px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(7, 9, 16, 0.2);
  color: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(8px);
}

.app-shell.ui-hidden .editor-panel,
.app-shell.ui-hidden .stage-actions,
.app-shell.ui-hidden #showEditorButton,
.app-shell.ui-hidden #stageRandomizeButton,
.app-shell.ui-hidden .stage-controls,
.app-shell.ui-hidden .fs-label,
.app-shell.ui-hidden #appStatus {
  opacity: 0;
  pointer-events: none;
}

.app-shell.ui-hidden.hotkey-peek .fs-label {
  opacity: 1;
}

.app-shell.ui-hidden .editor-panel {
  transform: translateX(100%);
}

.app-shell.ui-hidden .stage-actions {
  transform: translateY(-8px);
}

@media (max-width: 860px) {
  html,
  body,
  .app-shell,
  .studio-shell {
    min-height: 100%;
    overflow: auto;
  }

  .app-layout {
    min-height: 100svh;
  }

  .app-stage,
  .app-stage .preview-stage {
    position: relative;
    inset: auto;
  }

  .preview-stage {
    height: 42svh;
    min-height: 260px;
  }

  .editor-panel {
    position: relative;
    inset: auto;
    width: 100%;
    max-height: none;
    min-height: auto;
    overflow: visible;
    transform: none;
    opacity: 1;
    border-left: 0;
    box-shadow: none;
  }

  .app-shell.editor-hidden .editor-panel {
    display: none;
  }

  .stage-actions {
    position: fixed;
  }

  .app-shell.editor-hidden .app-stage,
  .app-shell.editor-hidden .preview-stage {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    min-height: 100svh;
    z-index: 1;
  }

  .app-shell.editor-hidden .editor-panel {
    display: none;
  }

  .app-shell.editor-hidden .stage-actions {
    position: fixed;
    z-index: 20;
  }
}

@media (max-width: 520px) {
  .fs-label {
    max-width: calc(100vw - 32px);
    font-size: 10px;
    line-height: 1.25;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .preset-actions {
    grid-template-columns: 1fr 1fr;
  }

  .playback-manager {
    grid-template-columns: 1fr;
  }

  .motion-step-field,
  .motion-step-pair,
  .sequence-actions {
    grid-template-columns: 1fr;
  }

  .motion-sequence-editor {
    padding: 10px;
  }

  .toolbar,
  .editor-title-actions,
  .player-controls,
  .debug-readout {
    align-items: stretch;
    flex-direction: column;
  }

  .debug-readout {
    grid-template-columns: 1fr 1fr;
  }
}
